Skip to content

Commit 65421fd

Browse files
committed
🐛 fixed create backend bug and esmodule typings on codegen resolver
1 parent 9cabac5 commit 65421fd

File tree

7 files changed

+10
-14
lines changed

7 files changed

+10
-14
lines changed

packages/cli/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "graphql-editor-cli",
3-
"version": "0.7.9",
3+
"version": "0.8.0",
44
"description": "GraphQL -> anything. Use GraphQL as your source of truth. GraphQL Editor Official CLI.",
55
"main": "lib/api.js",
66
"author": "Artur Czemiel",

packages/cli/src/commands/codegen/models.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const getModel = async (modelsPath: string, field: ParserField) => {
99
HandleTemplates.action({
1010
type: 'addIfNotExist',
1111
path: `${modelsPath}/${modelName}.ts`,
12-
content: `import { ModelTypes } from '../zeus';
12+
content: `import { ModelTypes } from '../zeus/index.js';
1313
1414
export type ${modelName} = ModelTypes['${field.name}'];`,
1515
});
@@ -41,7 +41,7 @@ export const CommandModels = async ({
4141
let modelsContent = [];
4242
for (const f of modelFields) {
4343
const modelName = await getModel(modelsPath, f);
44-
importsContent += `import { ${modelName} } from './${modelName}'\n`;
44+
importsContent += `import { ${modelName} } from './${modelName}.js'\n`;
4545
modelsContent.push(`${modelName}: ${modelName};`);
4646
}
4747
const modelsContentString = `export type Models = {\n\t${modelsContent.join(

packages/cli/src/commands/codegen/resolver.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,15 @@ interface BasicResolverProps {
1515
const basicResolver = ({
1616
field,
1717
resolverParent,
18-
body = '',
19-
imports = '',
2018
source,
2119
}: BasicResolverProps) => `
2220
import { FieldResolveInput } from 'stucco-js';
23-
import { resolverFor } from '../zeus';
24-
${imports}
21+
import { resolverFor } from '../zeus/index.js';
2522
2623
export const handler = async (input: FieldResolveInput) =>
2724
resolverFor('${resolverParent}','${field.name}',async (args${
2825
source ? `, source:${source}` : ``
2926
}) => {
30-
${body}
3127
})(input.arguments${source ? `, input.source` : ``});
3228
`;
3329

packages/cli/src/commands/create/files/tsconfig.json.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ export default {
33
skipLibCheck: true,
44
moduleResolution: 'node',
55
target:
6-
'es2020' /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */,
6+
'es2022' /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */,
77
module:
8-
'es2020' /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
8+
'es2022' /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
99
declaration: true /* Generates corresponding '.d.ts' file. */,
1010
outDir: './lib' /* Redirect output structure to the directory. */,
1111
rootDir:

packages/cli/src/commands/create/project.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const CommandBootstrap = async ({
4949
// new Configuration(projectPath);
5050
const createFiles = async () => {
5151
writeProjectJSONFile(
52-
(await import('./files/package.ts.json.js')).default,
52+
(await import('./files/package.ts.json.js')).default(appSystemName),
5353
'package.json',
5454
);
5555
writeProjectJSONFile(

packages/sandbox/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "sandbox",
33
"private": true,
4-
"version": "0.7.11",
4+
"version": "0.8.0",
55
"description": "GraphQL -> anything. Use GraphQL as your source of truth. GraphQL Editor Official CLI.",
66
"author": "Artur Czemiel",
77
"license": "MIT",

0 commit comments

Comments
 (0)