@graphitation/cli
Advanced tools
Comparing version 1.13.0-alpha.1 to 1.13.0-alpha.2
# Change Log - @graphitation/cli | ||
<!-- This log was last generated on Wed, 30 Oct 2024 10:07:48 GMT and should not be manually modified. --> | ||
<!-- This log was last generated on Mon, 04 Nov 2024 17:34:13 GMT and should not be manually modified. --> | ||
<!-- Start content --> | ||
## 1.13.0-alpha.2 | ||
Mon, 04 Nov 2024 17:34:13 GMT | ||
### Changes | ||
- Added context namespace into the codegen (77059398+vejrj@users.noreply.github.com) | ||
- Bump @graphitation/ts-codegen to v2.13.0-alpha.3 | ||
## 1.13.0-alpha.1 | ||
Wed, 30 Oct 2024 10:07:48 GMT | ||
Wed, 30 Oct 2024 10:07:52 GMT | ||
@@ -11,0 +20,0 @@ ### Changes |
@@ -80,6 +80,9 @@ "use strict"; | ||
"from where to import context" | ||
).option("-cn, --context-name [contextName]", "Context name").option( | ||
"-cm, --context-namespace-name [contextNamespaceName]", | ||
"context namespace name" | ||
).option( | ||
"-cm, --context-mapping-file [contextMappingFile]", | ||
"context mapping file" | ||
).option("-cn, --context-name [contextName]", "Context name").option("-ei, --enums-import [enumsImport]", "from where to import enums").option("-l, --legacy", "generate legacy types").option("--legacy-models", "do not use models for object types").option( | ||
"-cm, --context-namespace-path [contextNamespacePath]", | ||
"context namespace path" | ||
).option("-ei, --enums-import [enumsImport]", "from where to import enums").option("-l, --legacy", "generate legacy types").option("--legacy-models", "do not use models for object types").option( | ||
"--use-string-unions-instead-of-enums", | ||
@@ -132,20 +135,2 @@ "When this flag is set, then enums are replaced by string unions." | ||
); | ||
const { contextMappingFile } = options; | ||
let contextMappingContent = null; | ||
let fullContextMappingFilePath; | ||
if (contextMappingFile) { | ||
if (import_path.default.isAbsolute(contextMappingFile)) { | ||
fullContextMappingFilePath = contextMappingFile; | ||
} else { | ||
fullContextMappingFilePath = import_path.default.join( | ||
process.cwd(), | ||
contextMappingFile | ||
); | ||
} | ||
if (import_fs.default.existsSync(fullContextMappingFilePath)) { | ||
contextMappingContent = JSON.parse( | ||
yield import_promises.default.readFile(fullContextMappingFilePath, { encoding: "utf-8" }) | ||
); | ||
} | ||
} | ||
const result = (0, import_ts_codegen.generateTS)(document, { | ||
@@ -162,3 +147,4 @@ outputPath, | ||
modelScope: options.scope || null, | ||
contextMappingContent | ||
contextNamespaceName: options.contextNamespaceName, | ||
contextNamespacePath: options.contextNamespacePath | ||
}); | ||
@@ -165,0 +151,0 @@ yield import_promises.default.mkdir(outputPath, { recursive: true }); |
{ | ||
"name": "@graphitation/cli", | ||
"license": "MIT", | ||
"version": "1.13.0-alpha.1", | ||
"version": "1.13.0-alpha.2", | ||
"bin": { | ||
@@ -27,3 +27,3 @@ "supermassive": "./bin/supermassive.js" | ||
"@graphitation/supermassive-extractors": "^2.2.5", | ||
"@graphitation/ts-codegen": "^2.13.0-alpha.1", | ||
"@graphitation/ts-codegen": "^2.13.0-alpha.3", | ||
"commander": "^8.3.0", | ||
@@ -30,0 +30,0 @@ "fast-glob": "^3.2.12", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
44371
379