@fluojs/cli 2.0.1 → 3.0.0
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.
- package/README.ko.md +169 -21
- package/README.md +172 -21
- package/dist/cli.d.ts +5 -4
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +127 -35
- package/dist/commands/diagnostics.d.ts +35 -0
- package/dist/commands/diagnostics.d.ts.map +1 -1
- package/dist/commands/diagnostics.js +60 -0
- package/dist/commands/inspect.d.ts +5 -1
- package/dist/commands/inspect.d.ts.map +1 -1
- package/dist/commands/inspect.js +84 -17
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +27 -15
- package/dist/commands/migration-transform-tokens.d.ts +15 -0
- package/dist/commands/migration-transform-tokens.d.ts.map +1 -0
- package/dist/commands/migration-transform-tokens.js +41 -0
- package/dist/commands/new.d.ts.map +1 -1
- package/dist/commands/new.js +29 -9
- package/dist/commands/output-path-safety.d.ts +14 -0
- package/dist/commands/output-path-safety.d.ts.map +1 -0
- package/dist/commands/output-path-safety.js +34 -0
- package/dist/commands/scripts.js +2 -2
- package/dist/commands/typegen-artifact.d.ts +54 -0
- package/dist/commands/typegen-artifact.d.ts.map +1 -0
- package/dist/commands/typegen-artifact.js +117 -0
- package/dist/commands/typegen-generation-child.d.ts +2 -0
- package/dist/commands/typegen-generation-child.d.ts.map +1 -0
- package/dist/commands/typegen-generation-child.js +59 -0
- package/dist/commands/typegen-generation-process.d.ts +46 -0
- package/dist/commands/typegen-generation-process.d.ts.map +1 -0
- package/dist/commands/typegen-generation-process.js +131 -0
- package/dist/commands/typegen-generation-protocol.d.ts +16 -0
- package/dist/commands/typegen-generation-protocol.d.ts.map +1 -0
- package/dist/commands/typegen-generation-protocol.js +35 -0
- package/dist/commands/typegen-isolated-source.d.ts +10 -0
- package/dist/commands/typegen-isolated-source.d.ts.map +1 -0
- package/dist/commands/typegen-isolated-source.js +75 -0
- package/dist/commands/typegen-options.d.ts +20 -0
- package/dist/commands/typegen-options.d.ts.map +1 -0
- package/dist/commands/typegen-options.js +71 -0
- package/dist/commands/typegen-source.d.ts +59 -0
- package/dist/commands/typegen-source.d.ts.map +1 -0
- package/dist/commands/typegen-source.js +183 -0
- package/dist/commands/typegen-watch.d.ts +46 -0
- package/dist/commands/typegen-watch.d.ts.map +1 -0
- package/dist/commands/typegen-watch.js +212 -0
- package/dist/commands/typegen.d.ts +29 -0
- package/dist/commands/typegen.d.ts.map +1 -0
- package/dist/commands/typegen.js +119 -0
- package/dist/dev-runner/node-restart-runner.d.ts.map +1 -1
- package/dist/dev-runner/node-restart-runner.js +54 -7
- package/dist/fixtures/inspect-react-app.module.d.ts +4 -0
- package/dist/fixtures/inspect-react-app.module.d.ts.map +1 -0
- package/dist/fixtures/inspect-react-app.module.js +32 -0
- package/dist/fixtures/typegen-react-app.module.d.ts +4 -0
- package/dist/fixtures/typegen-react-app.module.d.ts.map +1 -0
- package/dist/fixtures/typegen-react-app.module.js +33 -0
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/new/install.js +1 -1
- package/dist/new/package-spec-resolver.d.ts.map +1 -1
- package/dist/new/package-spec-resolver.js +50 -59
- package/dist/new/prompt.d.ts +1 -0
- package/dist/new/prompt.d.ts.map +1 -1
- package/dist/new/prompt.js +40 -12
- package/dist/new/published-internal-dependencies.d.ts +20 -0
- package/dist/new/published-internal-dependencies.d.ts.map +1 -0
- package/dist/new/published-internal-dependencies.js +20 -0
- package/dist/new/react-vite-ssr-scaffold.d.ts +19 -0
- package/dist/new/react-vite-ssr-scaffold.d.ts.map +1 -0
- package/dist/new/react-vite-ssr-scaffold.js +108 -0
- package/dist/new/resolver.d.ts +2 -2
- package/dist/new/resolver.d.ts.map +1 -1
- package/dist/new/resolver.js +5 -1
- package/dist/new/scaffold.d.ts.map +1 -1
- package/dist/new/scaffold.js +62 -31
- package/dist/new/starter-profiles.d.ts +8 -4
- package/dist/new/starter-profiles.d.ts.map +1 -1
- package/dist/new/starter-profiles.js +52 -18
- package/dist/new/templates/react-vite-ssr/README.md.ejs +74 -0
- package/dist/new/templates/react-vite-ssr/playwright.config.ts.ejs +26 -0
- package/dist/new/templates/react-vite-ssr/src/app.test.ts.ejs +82 -0
- package/dist/new/templates/react-vite-ssr/src/app.ts.ejs +91 -0
- package/dist/new/templates/react-vite-ssr/src/entry-client.tsx.ejs +29 -0
- package/dist/new/templates/react-vite-ssr/src/entry-server.tsx.ejs +52 -0
- package/dist/new/templates/react-vite-ssr/src/load-manifest.test.ts.ejs +55 -0
- package/dist/new/templates/react-vite-ssr/src/load-manifest.ts.ejs +53 -0
- package/dist/new/templates/react-vite-ssr/src/main.ts.ejs +18 -0
- package/dist/new/templates/react-vite-ssr/src/page.tsx.ejs +43 -0
- package/dist/new/templates/react-vite-ssr/src/react-app.test.tsx.ejs +67 -0
- package/dist/new/templates/react-vite-ssr/src/react-app.tsx.ejs +46 -0
- package/dist/new/templates/react-vite-ssr/src/styles.css.ejs +25 -0
- package/dist/new/templates/react-vite-ssr/src/styles.d.ts.ejs +1 -0
- package/dist/new/templates/react-vite-ssr/tests/production-hydration.spec.ts.ejs +54 -0
- package/dist/new/templates/react-vite-ssr/tsconfig.json.ejs +16 -0
- package/dist/new/templates/react-vite-ssr/vite.client.config.ts.ejs +24 -0
- package/dist/new/templates/react-vite-ssr/vite.server.config.ts.ejs +17 -0
- package/dist/new/templates/react-vite-ssr/vitest.config.ts.ejs +10 -0
- package/dist/new/types.d.ts +4 -0
- package/dist/new/types.d.ts.map +1 -1
- package/dist/public-typegen.d.ts +14 -0
- package/dist/public-typegen.d.ts.map +1 -0
- package/dist/public-typegen.js +17 -0
- package/dist/run-cli.d.ts +2 -1
- package/dist/run-cli.d.ts.map +1 -1
- package/dist/studio/sidecar.d.ts.map +1 -1
- package/dist/studio/sidecar.js +35 -9
- package/dist/transforms/nestjs-migrate.d.ts +4 -1
- package/dist/transforms/nestjs-migrate.d.ts.map +1 -1
- package/dist/transforms/nestjs-migrate.js +625 -65
- package/dist/typegen-contract.d.ts +10 -0
- package/dist/typegen-contract.d.ts.map +1 -0
- package/dist/typegen-contract.js +9 -0
- package/dist/usage.d.ts +6 -0
- package/dist/usage.d.ts.map +1 -1
- package/dist/usage.js +47 -0
- package/package.json +19 -10
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Per-package release ranges for all published starter dependencies except the generator CLI itself. */
|
|
2
|
+
export declare const PUBLISHED_INTERNAL_DEPENDENCIES: {
|
|
3
|
+
readonly "@fluojs/config": "^2.0.0";
|
|
4
|
+
readonly "@fluojs/core": "^2.0.0";
|
|
5
|
+
readonly "@fluojs/di": "^3.0.0";
|
|
6
|
+
readonly "@fluojs/http": "^3.0.0";
|
|
7
|
+
readonly "@fluojs/microservices": "^2.0.0";
|
|
8
|
+
readonly "@fluojs/platform-bun": "^3.0.0";
|
|
9
|
+
readonly "@fluojs/platform-cloudflare-workers": "^2.0.0";
|
|
10
|
+
readonly "@fluojs/platform-deno": "^2.0.0";
|
|
11
|
+
readonly "@fluojs/platform-express": "^2.0.0";
|
|
12
|
+
readonly "@fluojs/platform-fastify": "^2.0.0";
|
|
13
|
+
readonly "@fluojs/platform-nodejs": "^2.0.0";
|
|
14
|
+
readonly "@fluojs/react": "^0.2.0";
|
|
15
|
+
readonly "@fluojs/runtime": "^3.0.0";
|
|
16
|
+
readonly "@fluojs/testing": "^3.0.0";
|
|
17
|
+
readonly "@fluojs/validation": "^2.0.0";
|
|
18
|
+
readonly "@fluojs/vite": "^2.0.0";
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=published-internal-dependencies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"published-internal-dependencies.d.ts","sourceRoot":"","sources":["../../src/new/published-internal-dependencies.ts"],"names":[],"mappings":"AACA,yGAAyG;AACzG,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;CAiBlC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Generated by scripts/generate-published-internal-dependencies.mjs during the CLI build.
|
|
2
|
+
/** Per-package release ranges for all published starter dependencies except the generator CLI itself. */
|
|
3
|
+
export const PUBLISHED_INTERNAL_DEPENDENCIES = {
|
|
4
|
+
"@fluojs/config": "^2.0.0",
|
|
5
|
+
"@fluojs/core": "^2.0.0",
|
|
6
|
+
"@fluojs/di": "^3.0.0",
|
|
7
|
+
"@fluojs/http": "^3.0.0",
|
|
8
|
+
"@fluojs/microservices": "^2.0.0",
|
|
9
|
+
"@fluojs/platform-bun": "^3.0.0",
|
|
10
|
+
"@fluojs/platform-cloudflare-workers": "^2.0.0",
|
|
11
|
+
"@fluojs/platform-deno": "^2.0.0",
|
|
12
|
+
"@fluojs/platform-express": "^2.0.0",
|
|
13
|
+
"@fluojs/platform-fastify": "^2.0.0",
|
|
14
|
+
"@fluojs/platform-nodejs": "^2.0.0",
|
|
15
|
+
"@fluojs/react": "^0.2.0",
|
|
16
|
+
"@fluojs/runtime": "^3.0.0",
|
|
17
|
+
"@fluojs/testing": "^3.0.0",
|
|
18
|
+
"@fluojs/validation": "^2.0.0",
|
|
19
|
+
"@fluojs/vite": "^2.0.0"
|
|
20
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { PackageManager } from './types.js';
|
|
2
|
+
type ReactViteSsrTemplateContext = {
|
|
3
|
+
readonly packageManager: PackageManager;
|
|
4
|
+
readonly projectName: string;
|
|
5
|
+
};
|
|
6
|
+
type ReactViteSsrScaffoldFile = {
|
|
7
|
+
content: string;
|
|
8
|
+
path: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Renders the React SSR + Vite starter template tree with explicit lifecycle commands.
|
|
12
|
+
*
|
|
13
|
+
* @param context Validated project and package-manager command values for template rendering.
|
|
14
|
+
* @param importMetaUrl Module URL used to locate packaged starter templates.
|
|
15
|
+
* @returns Generated scaffold files with rendered template content.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createReactViteSsrScaffoldFiles(context: ReactViteSsrTemplateContext, importMetaUrl?: string): ReactViteSsrScaffoldFile[];
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=react-vite-ssr-scaffold.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-vite-ssr-scaffold.d.ts","sourceRoot":"","sources":["../../src/new/react-vite-ssr-scaffold.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAOjD,KAAK,2BAA2B,GAAG;IACjC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAmEF;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,2BAA2B,EACpC,aAAa,SAAkB,GAC9B,wBAAwB,EAAE,CAkB5B"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
const INSTALL_COMMAND_BY_PACKAGE_MANAGER = {
|
|
5
|
+
bun: 'bun install',
|
|
6
|
+
npm: 'npm install',
|
|
7
|
+
pnpm: 'pnpm install',
|
|
8
|
+
yarn: 'yarn install'
|
|
9
|
+
};
|
|
10
|
+
const RUN_PREFIX_BY_PACKAGE_MANAGER = {
|
|
11
|
+
bun: 'bun run',
|
|
12
|
+
npm: 'npm run',
|
|
13
|
+
pnpm: 'pnpm',
|
|
14
|
+
yarn: 'yarn'
|
|
15
|
+
};
|
|
16
|
+
const REACT_VITE_SSR_TEMPLATES = [{
|
|
17
|
+
outputPath: 'README.md',
|
|
18
|
+
templatePath: 'README.md.ejs'
|
|
19
|
+
}, {
|
|
20
|
+
outputPath: 'playwright.config.ts',
|
|
21
|
+
templatePath: 'playwright.config.ts.ejs'
|
|
22
|
+
}, {
|
|
23
|
+
outputPath: 'tsconfig.json',
|
|
24
|
+
templatePath: 'tsconfig.json.ejs'
|
|
25
|
+
}, {
|
|
26
|
+
outputPath: 'vite.client.config.ts',
|
|
27
|
+
templatePath: 'vite.client.config.ts.ejs'
|
|
28
|
+
}, {
|
|
29
|
+
outputPath: 'vite.server.config.ts',
|
|
30
|
+
templatePath: 'vite.server.config.ts.ejs'
|
|
31
|
+
}, {
|
|
32
|
+
outputPath: 'vitest.config.ts',
|
|
33
|
+
templatePath: 'vitest.config.ts.ejs'
|
|
34
|
+
}, {
|
|
35
|
+
outputPath: 'src/app.test.ts',
|
|
36
|
+
templatePath: 'src/app.test.ts.ejs'
|
|
37
|
+
}, {
|
|
38
|
+
outputPath: 'src/app.ts',
|
|
39
|
+
templatePath: 'src/app.ts.ejs'
|
|
40
|
+
}, {
|
|
41
|
+
outputPath: 'src/entry-client.tsx',
|
|
42
|
+
templatePath: 'src/entry-client.tsx.ejs'
|
|
43
|
+
}, {
|
|
44
|
+
outputPath: 'src/entry-server.tsx',
|
|
45
|
+
templatePath: 'src/entry-server.tsx.ejs'
|
|
46
|
+
}, {
|
|
47
|
+
outputPath: 'src/load-manifest.test.ts',
|
|
48
|
+
templatePath: 'src/load-manifest.test.ts.ejs'
|
|
49
|
+
}, {
|
|
50
|
+
outputPath: 'src/load-manifest.ts',
|
|
51
|
+
templatePath: 'src/load-manifest.ts.ejs'
|
|
52
|
+
}, {
|
|
53
|
+
outputPath: 'src/main.ts',
|
|
54
|
+
templatePath: 'src/main.ts.ejs'
|
|
55
|
+
}, {
|
|
56
|
+
outputPath: 'src/page.tsx',
|
|
57
|
+
templatePath: 'src/page.tsx.ejs'
|
|
58
|
+
}, {
|
|
59
|
+
outputPath: 'src/react-app.test.tsx',
|
|
60
|
+
templatePath: 'src/react-app.test.tsx.ejs'
|
|
61
|
+
}, {
|
|
62
|
+
outputPath: 'src/react-app.tsx',
|
|
63
|
+
templatePath: 'src/react-app.tsx.ejs'
|
|
64
|
+
}, {
|
|
65
|
+
outputPath: 'src/styles.css',
|
|
66
|
+
templatePath: 'src/styles.css.ejs'
|
|
67
|
+
}, {
|
|
68
|
+
outputPath: 'src/styles.d.ts',
|
|
69
|
+
templatePath: 'src/styles.d.ts.ejs'
|
|
70
|
+
}, {
|
|
71
|
+
outputPath: 'tests/production-hydration.spec.ts',
|
|
72
|
+
templatePath: 'tests/production-hydration.spec.ts.ejs'
|
|
73
|
+
}];
|
|
74
|
+
function resolveTemplateDirectory(importMetaUrl) {
|
|
75
|
+
return join(dirname(fileURLToPath(importMetaUrl)), 'templates', 'react-vite-ssr');
|
|
76
|
+
}
|
|
77
|
+
function createLifecycleCommands(packageManager) {
|
|
78
|
+
const runPrefix = RUN_PREFIX_BY_PACKAGE_MANAGER[packageManager];
|
|
79
|
+
const run = script => `${runPrefix} ${script}`;
|
|
80
|
+
return {
|
|
81
|
+
build: run('build'),
|
|
82
|
+
dev: run('dev'),
|
|
83
|
+
install: INSTALL_COMMAND_BY_PACKAGE_MANAGER[packageManager],
|
|
84
|
+
start: run('start'),
|
|
85
|
+
test: run('test'),
|
|
86
|
+
testBrowser: run('test:browser'),
|
|
87
|
+
typecheck: run('typecheck')
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Renders the React SSR + Vite starter template tree with explicit lifecycle commands.
|
|
93
|
+
*
|
|
94
|
+
* @param context Validated project and package-manager command values for template rendering.
|
|
95
|
+
* @param importMetaUrl Module URL used to locate packaged starter templates.
|
|
96
|
+
* @returns Generated scaffold files with rendered template content.
|
|
97
|
+
*/
|
|
98
|
+
export function createReactViteSsrScaffoldFiles(context, importMetaUrl = import.meta.url) {
|
|
99
|
+
const templateDirectory = resolveTemplateDirectory(importMetaUrl);
|
|
100
|
+
const commands = createLifecycleCommands(context.packageManager);
|
|
101
|
+
return REACT_VITE_SSR_TEMPLATES.map(({
|
|
102
|
+
outputPath,
|
|
103
|
+
templatePath
|
|
104
|
+
}) => ({
|
|
105
|
+
content: readFileSync(join(templateDirectory, templatePath), 'utf8').replaceAll('<%= projectName %>', context.projectName).replaceAll('<%= installCommand %>', commands.install).replaceAll('<%= devCommand %>', commands.dev).replaceAll('<%= buildCommand %>', commands.build).replaceAll('<%= startCommand %>', commands.start).replaceAll('<%= testCommand %>', commands.test).replaceAll('<%= testBrowserCommand %>', commands.testBrowser).replaceAll('<%= typecheckCommand %>', commands.typecheck).replaceAll('<%= devCommandJson %>', JSON.stringify(commands.dev)).replaceAll('<%= startCommandJson %>', JSON.stringify(commands.start)),
|
|
106
|
+
path: outputPath
|
|
107
|
+
}));
|
|
108
|
+
}
|
package/dist/new/resolver.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { BootstrapOptions, BootstrapSchema } from './types.js';
|
|
2
1
|
import { type StarterProfile } from './starter-profiles.js';
|
|
3
|
-
type
|
|
2
|
+
import type { BootstrapOptions, BootstrapSchema } from './types.js';
|
|
3
|
+
type BootstrapResolutionInput = Partial<BootstrapSchema> & Pick<Partial<BootstrapOptions>, 'packageManager' | 'starter'>;
|
|
4
4
|
/**
|
|
5
5
|
* Shape-first compatibility baseline for `fluo new` until additional starter variants ship.
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../src/new/resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../src/new/resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,cAAc,EAOpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EAGhB,MAAM,YAAY,CAAC;AAEpB,KAAK,wBAAwB,GAAG,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC,CAAC;AAEzH;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,eAA6C,CAAC;AAErF;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;IAC7C,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACnC,OAAO,EAAE,cAAc,CAAC;IACxB,MAAM,EAAE,eAAe,CAAC;CACzB;AAyBD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,OAAO,CAAC,eAAe,CAAM,GAAG,eAAe,CAe9F;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,wBAAwB,GAAG,gBAAgB,GAAG,qBAAqB,CA0FhH"}
|
package/dist/new/resolver.js
CHANGED
|
@@ -52,7 +52,8 @@ export function resolveBootstrapSchema(partial = {}) {
|
|
|
52
52
|
*/
|
|
53
53
|
export function resolveBootstrapPlan(options) {
|
|
54
54
|
const schema = resolveBootstrapSchema(options);
|
|
55
|
-
const
|
|
55
|
+
const starter = options.starter ?? 'standard';
|
|
56
|
+
const starterProfile = getStarterProfileFromSchema(schema, starter);
|
|
56
57
|
if (starterProfile) {
|
|
57
58
|
return {
|
|
58
59
|
dependencies: starterProfile.dependencies,
|
|
@@ -62,6 +63,9 @@ export function resolveBootstrapPlan(options) {
|
|
|
62
63
|
};
|
|
63
64
|
}
|
|
64
65
|
const defaultProfile = getStarterProfileForShape(schema.shape);
|
|
66
|
+
if (starter === 'react-vite-ssr') {
|
|
67
|
+
throw new Error(`Unsupported react-vite-ssr starter schema "${schema.shape}/${schema.runtime}/${schema.transport}/${schema.platform}/${schema.tooling}/${schema.topology.mode}". ` + 'The React SSR + Vite starter requires application/node/http/fastify/standard/single-package.');
|
|
68
|
+
}
|
|
65
69
|
if (schema.shape === 'microservice' && schema.transport === 'http') {
|
|
66
70
|
throw new Error('Unsupported bootstrap schema "microservice/node/http/' + schema.platform + '/standard/single-package". ' + 'Microservice starters require a transport-aware microservice transport such as tcp, redis-streams, mqtt, grpc, nats, kafka, or rabbitmq.');
|
|
67
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../src/new/scaffold.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../src/new/scaffold.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,gBAAgB,EAAkB,MAAM,YAAY,CAAC;AAq5EnE;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,gBAAgB,EACzB,aAAa,SAAkB,GAC9B,OAAO,CAAC,IAAI,CAAC,CA6Bf;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,6BAAuB,CAAC"}
|
package/dist/new/scaffold.js
CHANGED
|
@@ -3,6 +3,8 @@ import { dirname, join, resolve } from 'node:path';
|
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import { initializeGitRepository, installDependencies } from './install.js';
|
|
5
5
|
import { resolvePackageSpecs } from './package-spec-resolver.js';
|
|
6
|
+
import { PUBLISHED_INTERNAL_DEPENDENCIES } from './published-internal-dependencies.js';
|
|
7
|
+
import { createReactViteSsrScaffoldFiles } from './react-vite-ssr-scaffold.js';
|
|
6
8
|
import { resolveBootstrapPlan } from './resolver.js';
|
|
7
9
|
const PUBLISHED_DEV_DEPENDENCIES = {
|
|
8
10
|
'@babel/cli': '^7.26.4',
|
|
@@ -11,39 +13,29 @@ const PUBLISHED_DEV_DEPENDENCIES = {
|
|
|
11
13
|
'@babel/preset-typescript': '^7.27.1',
|
|
12
14
|
'@types/babel__core': '^7.20.5',
|
|
13
15
|
'@types/node': '^22.13.10',
|
|
14
|
-
'@vitest/coverage-v8': '^
|
|
15
|
-
tsx: '^4.
|
|
16
|
+
'@vitest/coverage-v8': '^4.1.11',
|
|
17
|
+
tsx: '^4.23.1',
|
|
16
18
|
typescript: '^6.0.2',
|
|
17
|
-
vite: '^
|
|
18
|
-
vitest: '^
|
|
19
|
+
vite: '^8.2.2',
|
|
20
|
+
vitest: '^4.1.11'
|
|
19
21
|
};
|
|
20
22
|
const PUBLISHED_RUNTIME_DEPENDENCIES = {
|
|
23
|
+
'@playwright/test': '^1.51.1',
|
|
24
|
+
'@types/react': '^19.2.14',
|
|
25
|
+
'@types/react-dom': '^19.2.3',
|
|
21
26
|
'@types/amqplib': '^0.10.7',
|
|
22
|
-
'@grpc/grpc-js': '^1.
|
|
27
|
+
'@grpc/grpc-js': '^1.14.4',
|
|
23
28
|
'@grpc/proto-loader': '^0.8.0',
|
|
24
29
|
amqplib: '^0.10.5',
|
|
25
30
|
ioredis: '^5.0.0',
|
|
26
31
|
kafkajs: '^2.2.4',
|
|
27
32
|
mqtt: '^5.0.0',
|
|
28
|
-
nats: '^2.29.3'
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
'
|
|
32
|
-
'@fluojs/core': '^1.0.0',
|
|
33
|
-
'@fluojs/di': '^1.0.0',
|
|
34
|
-
'@fluojs/http': '^1.0.0',
|
|
35
|
-
'@fluojs/microservices': '^1.0.0',
|
|
36
|
-
'@fluojs/platform-bun': '^1.0.0',
|
|
37
|
-
'@fluojs/platform-cloudflare-workers': '^1.0.0',
|
|
38
|
-
'@fluojs/platform-deno': '^1.0.0',
|
|
39
|
-
'@fluojs/platform-express': '^1.0.0',
|
|
40
|
-
'@fluojs/platform-fastify': '^1.0.0',
|
|
41
|
-
'@fluojs/platform-nodejs': '^1.0.0',
|
|
42
|
-
'@fluojs/runtime': '^1.0.0',
|
|
43
|
-
'@fluojs/testing': '^1.0.0',
|
|
44
|
-
'@fluojs/validation': '^1.0.0',
|
|
45
|
-
'@fluojs/vite': '^1.0.0'
|
|
33
|
+
nats: '^2.29.3',
|
|
34
|
+
'happy-dom': '^20.9.0',
|
|
35
|
+
react: '^19.2.6',
|
|
36
|
+
'react-dom': '^19.2.6'
|
|
46
37
|
};
|
|
38
|
+
const NODE_HTTP_LISTENER_ENGINE = '>=24.0.0 <27';
|
|
47
39
|
function describeApplicationStarter(options) {
|
|
48
40
|
if (options.runtime === 'bun') {
|
|
49
41
|
return {
|
|
@@ -153,6 +145,16 @@ function createExecCommand(packageManager, command) {
|
|
|
153
145
|
}
|
|
154
146
|
function createProjectScripts(bootstrapPlan) {
|
|
155
147
|
switch (bootstrapPlan.profile.id) {
|
|
148
|
+
case 'application-node-fastify-react-vite-ssr':
|
|
149
|
+
return {
|
|
150
|
+
build: 'vite build --config vite.client.config.ts && vite build --config vite.server.config.ts',
|
|
151
|
+
dev: 'vite build --config vite.client.config.ts && vite build --config vite.server.config.ts && node dist/server/main.js',
|
|
152
|
+
start: 'node dist/server/main.js',
|
|
153
|
+
test: 'vitest run',
|
|
154
|
+
'test:browser': 'playwright test --config playwright.config.ts',
|
|
155
|
+
'test:watch': 'vitest',
|
|
156
|
+
typecheck: 'tsc -p tsconfig.json --noEmit'
|
|
157
|
+
};
|
|
156
158
|
case 'application-bun-bun-http':
|
|
157
159
|
return {
|
|
158
160
|
build: 'bun build ./src/main.ts --outdir ./dist --target bun',
|
|
@@ -210,9 +212,17 @@ function createProjectEngines(bootstrapPlan) {
|
|
|
210
212
|
return {
|
|
211
213
|
deno: '>=2.0.0'
|
|
212
214
|
};
|
|
215
|
+
case 'application-node-fastify-http':
|
|
216
|
+
case 'application-node-fastify-react-vite-ssr':
|
|
217
|
+
case 'application-node-express-http':
|
|
218
|
+
case 'application-node-nodejs-http':
|
|
219
|
+
case 'mixed-node-fastify-tcp':
|
|
220
|
+
return {
|
|
221
|
+
node: NODE_HTTP_LISTENER_ENGINE
|
|
222
|
+
};
|
|
213
223
|
default:
|
|
214
224
|
return {
|
|
215
|
-
node:
|
|
225
|
+
node: NODE_HTTP_LISTENER_ENGINE
|
|
216
226
|
};
|
|
217
227
|
}
|
|
218
228
|
}
|
|
@@ -233,7 +243,8 @@ function createPublishedDevDependencies(bootstrapPlan) {
|
|
|
233
243
|
};
|
|
234
244
|
}
|
|
235
245
|
return {
|
|
236
|
-
...PUBLISHED_DEV_DEPENDENCIES
|
|
246
|
+
...PUBLISHED_DEV_DEPENDENCIES,
|
|
247
|
+
'@types/node': '^24.0.0'
|
|
237
248
|
};
|
|
238
249
|
}
|
|
239
250
|
function createProjectPackageJson(options, bootstrapPlan, releaseVersion, packageSpecs) {
|
|
@@ -302,13 +313,12 @@ function createProjectTsconfigBuild() {
|
|
|
302
313
|
}
|
|
303
314
|
function createBabelConfig() {
|
|
304
315
|
return `module.exports = {
|
|
305
|
-
ignore: ['src/**/*.test.ts'],
|
|
306
316
|
presets: [['@babel/preset-typescript', { allowDeclareFields: true }]],
|
|
307
317
|
plugins: [['@babel/plugin-proposal-decorators', { version: '2023-11' }]],
|
|
308
318
|
};
|
|
309
319
|
`;
|
|
310
320
|
}
|
|
311
|
-
function createViteConfig() {
|
|
321
|
+
function createViteConfig(bootstrapPlan) {
|
|
312
322
|
return `import { fluoDecoratorsPlugin } from '@fluojs/vite';
|
|
313
323
|
import { defineConfig } from 'vite';
|
|
314
324
|
|
|
@@ -317,13 +327,13 @@ export default defineConfig({
|
|
|
317
327
|
build: {
|
|
318
328
|
emptyOutDir: true,
|
|
319
329
|
outDir: 'dist',
|
|
320
|
-
|
|
330
|
+
rolldownOptions: {
|
|
321
331
|
output: {
|
|
322
332
|
entryFileNames: 'main.js',
|
|
323
333
|
},
|
|
324
334
|
},
|
|
325
335
|
ssr: 'src/main.ts',
|
|
326
|
-
target: 'node20',
|
|
336
|
+
target: '${bootstrapPlan.schema.runtime === 'node' ? 'node24' : 'node20'}',
|
|
327
337
|
},
|
|
328
338
|
server: {
|
|
329
339
|
port: 5173,
|
|
@@ -2085,11 +2095,29 @@ function createWranglerConfig(projectName) {
|
|
|
2085
2095
|
}
|
|
2086
2096
|
function emitSharedScaffoldFiles(options, bootstrapPlan, releaseVersion, packageSpecs) {
|
|
2087
2097
|
const envFile = createEnvFile(bootstrapPlan);
|
|
2098
|
+
if (bootstrapPlan.profile.id === 'application-node-fastify-react-vite-ssr') {
|
|
2099
|
+
return [{
|
|
2100
|
+
content: createProjectPackageJson(options, bootstrapPlan, releaseVersion, packageSpecs),
|
|
2101
|
+
path: 'package.json'
|
|
2102
|
+
}, ...createReactViteSsrScaffoldFiles({
|
|
2103
|
+
packageManager: options.packageManager,
|
|
2104
|
+
projectName: options.projectName
|
|
2105
|
+
}), {
|
|
2106
|
+
content: createBabelConfig(),
|
|
2107
|
+
path: 'babel.config.cjs'
|
|
2108
|
+
}, {
|
|
2109
|
+
content: createGitignore(),
|
|
2110
|
+
path: '.gitignore'
|
|
2111
|
+
}, ...(envFile ? [{
|
|
2112
|
+
content: envFile,
|
|
2113
|
+
path: '.env'
|
|
2114
|
+
}] : [])];
|
|
2115
|
+
}
|
|
2088
2116
|
const sharedFiles = [{
|
|
2089
2117
|
content: createProjectPackageJson(options, bootstrapPlan, releaseVersion, packageSpecs),
|
|
2090
2118
|
path: 'package.json'
|
|
2091
2119
|
}, {
|
|
2092
|
-
content: createProjectReadme(options, bootstrapPlan),
|
|
2120
|
+
content: createProjectReadme(options, bootstrapPlan) + (bootstrapPlan.schema.runtime === 'node' ? '\n## Node.js support\n\nRequires Node.js `>=24.0.0 <27`. Use Node 24 LTS for local development, CI, and container images. Node builds target `node24` and use `@types/node@^24.0.0`.\n' : ''),
|
|
2093
2121
|
path: 'README.md'
|
|
2094
2122
|
}, {
|
|
2095
2123
|
content: createGitignore(),
|
|
@@ -2106,7 +2134,7 @@ function emitSharedScaffoldFiles(options, bootstrapPlan, releaseVersion, package
|
|
|
2106
2134
|
content: createBabelConfig(),
|
|
2107
2135
|
path: 'babel.config.cjs'
|
|
2108
2136
|
}, {
|
|
2109
|
-
content: createViteConfig(),
|
|
2137
|
+
content: createViteConfig(bootstrapPlan),
|
|
2110
2138
|
path: 'vite.config.ts'
|
|
2111
2139
|
}, {
|
|
2112
2140
|
content: createVitestConfig(),
|
|
@@ -2181,6 +2209,9 @@ function emitApplicationScaffoldFiles(options) {
|
|
|
2181
2209
|
return files;
|
|
2182
2210
|
}
|
|
2183
2211
|
function emitScaffoldFilesForRecipe(options, recipeId) {
|
|
2212
|
+
if (recipeId === 'application-node-fastify-react-vite-ssr') {
|
|
2213
|
+
return [];
|
|
2214
|
+
}
|
|
2184
2215
|
if (recipeId === 'application-bun-bun-http' || recipeId === 'application-cloudflare-workers-cloudflare-workers-http' || recipeId === 'application-deno-deno-http' || recipeId === 'application-node-fastify-http' || recipeId === 'application-node-express-http' || recipeId === 'application-node-nodejs-http') {
|
|
2185
2216
|
return emitApplicationScaffoldFiles(options);
|
|
2186
2217
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { BootstrapPlatform, BootstrapRuntime, BootstrapSchema, BootstrapShape, BootstrapToolingPreset, BootstrapTopology, BootstrapTransport } from './types.js';
|
|
1
|
+
import type { BootstrapPlatform, BootstrapRuntime, BootstrapSchema, BootstrapShape, BootstrapStarter, BootstrapToolingPreset, BootstrapTopology, BootstrapTransport } from './types.js';
|
|
2
2
|
/** Emitter families that decide which scaffold template tree renders the starter. */
|
|
3
|
-
export type StarterEmitterType = 'http' | 'microservice' | 'mixed';
|
|
3
|
+
export type StarterEmitterType = 'http' | 'microservice' | 'mixed' | 'react-vite-ssr';
|
|
4
4
|
/** Stable IDs for the scaffold recipes currently shipped by `fluo new`. */
|
|
5
|
-
export type StarterScaffoldRecipeId = 'application-bun-bun-http' | 'application-cloudflare-workers-cloudflare-workers-http' | 'application-deno-deno-http' | 'application-node-express-http' | 'application-node-fastify-http' | 'application-node-nodejs-http' | 'microservice-node-none-grpc' | 'microservice-node-none-kafka' | 'microservice-node-none-mqtt' | 'microservice-node-none-nats' | 'microservice-node-none-rabbitmq' | 'microservice-node-none-redis-streams' | 'microservice-node-none-tcp' | 'mixed-node-fastify-tcp';
|
|
5
|
+
export type StarterScaffoldRecipeId = 'application-bun-bun-http' | 'application-cloudflare-workers-cloudflare-workers-http' | 'application-deno-deno-http' | 'application-node-express-http' | 'application-node-fastify-http' | 'application-node-fastify-react-vite-ssr' | 'application-node-nodejs-http' | 'microservice-node-none-grpc' | 'microservice-node-none-kafka' | 'microservice-node-none-mqtt' | 'microservice-node-none-nats' | 'microservice-node-none-rabbitmq' | 'microservice-node-none-redis-streams' | 'microservice-node-none-tcp' | 'mixed-node-fastify-tcp';
|
|
6
6
|
type StarterDependencies = {
|
|
7
7
|
dependencies: readonly string[];
|
|
8
8
|
devDependencies: readonly string[];
|
|
@@ -21,6 +21,7 @@ export interface StarterProfile {
|
|
|
21
21
|
platformPromptLabel?: string;
|
|
22
22
|
promptLabel: string;
|
|
23
23
|
schema: BootstrapSchema;
|
|
24
|
+
starter: BootstrapStarter;
|
|
24
25
|
}
|
|
25
26
|
/** Supported microservice starter transports recognized by `fluo new`. */
|
|
26
27
|
export declare const SUPPORTED_MICROSERVICE_STARTER_TRANSPORTS: readonly BootstrapTransport[];
|
|
@@ -40,6 +41,8 @@ export declare const SUPPORTED_BOOTSTRAP_TRANSPORTS: readonly BootstrapTransport
|
|
|
40
41
|
export declare const SUPPORTED_BOOTSTRAP_TOOLING_PRESETS: readonly BootstrapToolingPreset[];
|
|
41
42
|
/** Supported topology modes accepted by the current starter matrix. */
|
|
42
43
|
export declare const SUPPORTED_BOOTSTRAP_TOPOLOGY_MODES: readonly BootstrapTopology['mode'][];
|
|
44
|
+
/** Named starter variants accepted by `fluo new`. */
|
|
45
|
+
export declare const SUPPORTED_BOOTSTRAP_STARTERS: readonly BootstrapStarter[];
|
|
43
46
|
/** Default starter profile used for shape-less `fluo new` invocations. */
|
|
44
47
|
export declare const DEFAULT_BOOTSTRAP_PROFILE: StarterProfile;
|
|
45
48
|
/**
|
|
@@ -75,9 +78,10 @@ export declare function getDefaultBootstrapSchema(): BootstrapSchema;
|
|
|
75
78
|
* Finds the starter profile that exactly matches a resolved bootstrap schema.
|
|
76
79
|
*
|
|
77
80
|
* @param schema Fully resolved bootstrap schema.
|
|
81
|
+
* @param starter Named starter variant selected by the caller.
|
|
78
82
|
* @returns The matching starter profile, or `undefined` when the schema is validation-only.
|
|
79
83
|
*/
|
|
80
|
-
export declare function getStarterProfileFromSchema(schema: BootstrapSchema): StarterProfile | undefined;
|
|
84
|
+
export declare function getStarterProfileFromSchema(schema: BootstrapSchema, starter?: BootstrapStarter): StarterProfile | undefined;
|
|
81
85
|
/**
|
|
82
86
|
* Checks whether one transport belongs to the supported microservice starter transport family.
|
|
83
87
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"starter-profiles.d.ts","sourceRoot":"","sources":["../../src/new/starter-profiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAEpB,qFAAqF;AACrF,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,cAAc,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"starter-profiles.d.ts","sourceRoot":"","sources":["../../src/new/starter-profiles.ts"],"names":[],"mappings":"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"}
|