@postxl/cli 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -43,8 +43,6 @@ const devDependencies = [
|
|
|
43
43
|
{ packageName: Generator.toPostXlPackageName('@postxl/generator') },
|
|
44
44
|
{ packageName: Generator.toPostXlPackageName('@postxl/generators') },
|
|
45
45
|
{ packageName: Generator.toPostXlPackageName('@postxl/schema') },
|
|
46
|
-
{ packageName: 'prettier', version: '3.7.4' },
|
|
47
|
-
{ packageName: 'eslint', version: '9.39.2' },
|
|
48
46
|
];
|
|
49
47
|
const scripts = [
|
|
50
48
|
{ name: 'generate', command: 'pnpm run generate:project && pnpm run generate:prisma' },
|
|
@@ -69,10 +69,10 @@ Installation flow:
|
|
|
69
69
|
1. Writes initial project files (schema, generate.ts, tsconfig, package.json, .env)
|
|
70
70
|
Uses the simple schema for the first pass even if a custom schema is provided
|
|
71
71
|
2. Runs pnpm install to fetch initial dependencies
|
|
72
|
-
3. Runs first code generation without formatting
|
|
72
|
+
3. Runs first code generation without linting and formatting, to produce the full package.json
|
|
73
73
|
4. Runs pnpm install again to fetch devDependencies added by the generated package.json
|
|
74
74
|
5. Swaps in the custom schema (if provided) before the final generation
|
|
75
|
-
6. Runs second code generation with
|
|
75
|
+
6. Runs second code generation with linting and formatting (Oxlint, Oxfmt)
|
|
76
76
|
7. Generates TanStack Router route tree
|
|
77
77
|
8. Generates Prisma client
|
|
78
78
|
9. Initializes a git repository (unless --skip-git)
|
|
@@ -105,17 +105,17 @@ If --skip-generate is used with a custom schema, the custom schema is written di
|
|
|
105
105
|
});
|
|
106
106
|
await installDependencies({ targetPath: projectPath, link });
|
|
107
107
|
if (!options.skipGenerate) {
|
|
108
|
-
// We initially only install the PostXL generator
|
|
109
|
-
//
|
|
108
|
+
// We initially only install the PostXL generator, so the first generation runs without
|
|
109
|
+
// transformations. It writes the full package.json with all scripts and dependencies.
|
|
110
110
|
await runGenerate({ projectPath, transform: false });
|
|
111
|
-
// After the generation, we now have the full package.json including devDependencies
|
|
111
|
+
// After the generation, we now have the full package.json including all devDependencies.
|
|
112
112
|
// So we install dependencies again to get those.
|
|
113
113
|
await installDependencies({ targetPath: projectPath, link });
|
|
114
114
|
// If a custom schema was provided, write it now before the second (final) generation pass.
|
|
115
115
|
if (customSchema) {
|
|
116
116
|
await writeSchema({ name, slug, schema: customSchema, projectPath });
|
|
117
117
|
}
|
|
118
|
-
// The second generation runs with transformations
|
|
118
|
+
// The second generation runs with transformations: linting (Oxlint) and formatting (Oxfmt).
|
|
119
119
|
await runGenerate({ projectPath, transform: true });
|
|
120
120
|
await generateTanStackRouter(projectPath);
|
|
121
121
|
await generatePrismaClient(projectPath);
|
package/dist/generate.command.js
CHANGED
|
@@ -160,6 +160,7 @@ This reads the schema from ${(0, utils_1.yellow)('schema.json')} and runs the ge
|
|
|
160
160
|
...(targetModelNames ? { selectiveGeneration: true } : {}),
|
|
161
161
|
...(options.dryRun ? { dryRun: true } : {}),
|
|
162
162
|
...(baseVfs ? { baseVfs } : {}),
|
|
163
|
+
...(options.threeWay === false ? { recoverBase: false } : {}),
|
|
163
164
|
});
|
|
164
165
|
(0, generator_1.logSyncResult)(result, {
|
|
165
166
|
showModifiedStats: options.modified ?? options.ejected ?? false,
|
|
@@ -338,7 +339,10 @@ async function maybeReconstructBaseVfs(params) {
|
|
|
338
339
|
const baseGenerated = await manager.generate(baseContext);
|
|
339
340
|
const baseG = await new generator_1.Generator(baseGenerated).generate((g) => g);
|
|
340
341
|
if (!options.skipTransform) {
|
|
341
|
-
|
|
342
|
+
// An unlinted base would not match the lockfile's checksums, so it is no ancestor: let a lint
|
|
343
|
+
// failure fall through to the 2-way fallback below, even under `-i`, rather than logging it
|
|
344
|
+
// a second time and returning a base that fails verification anyway.
|
|
345
|
+
await (0, generator_1.lint)(baseG.context.vfs, { ...options, ignoreErrors: false });
|
|
342
346
|
await baseG.context.vfs.transform(generator_1.format, {
|
|
343
347
|
onError: ({ error }) => {
|
|
344
348
|
if (!options.ignoreErrors) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@postxl/cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Command-line interface for PostXL code generation framework",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"dotenv": "17.4.2",
|
|
46
46
|
"ts-morph": "26.0.0",
|
|
47
47
|
"zod-validation-error": "5.0.0",
|
|
48
|
-
"@postxl/
|
|
49
|
-
"@postxl/
|
|
50
|
-
"@postxl/
|
|
51
|
-
"@postxl/utils": "^1.4.
|
|
48
|
+
"@postxl/generator": "^2.2.0",
|
|
49
|
+
"@postxl/generators": "^6.2.0",
|
|
50
|
+
"@postxl/schema": "^2.5.0",
|
|
51
|
+
"@postxl/utils": "^1.4.3"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {},
|
|
54
54
|
"wallaby": {
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"build": "tsc -b tsconfig.build.json",
|
|
64
|
-
"lint": "
|
|
65
|
-
"
|
|
64
|
+
"lint": "oxlint",
|
|
65
|
+
"format:check": "oxfmt --check \"**/*.{ts,tsx}\"",
|
|
66
66
|
"test:jest": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest",
|
|
67
67
|
"test:coverage": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --coverage",
|
|
68
68
|
"test:types": "tsc --noEmit"
|