@bleedingdev/modern-js-create 3.4.0-ultramodern.8 → 3.5.0-ultramodern.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.md +25 -23
- package/dist/cjs/index.cjs +37 -4
- package/dist/cjs/locale/en.cjs +12 -2
- package/dist/cjs/locale/zh.cjs +12 -2
- package/dist/cjs/ultramodern-tooling/commands.cjs +185 -0
- package/dist/cjs/ultramodern-tooling/config.cjs +172 -0
- package/dist/cjs/ultramodern-workspace/add-vertical.cjs +87 -75
- package/dist/cjs/ultramodern-workspace/{effect-api.cjs → api.cjs} +207 -208
- package/dist/cjs/ultramodern-workspace/bridge-config.cjs +327 -0
- package/dist/cjs/ultramodern-workspace/codesmith.cjs +1 -0
- package/dist/cjs/ultramodern-workspace/contracts.cjs +127 -657
- package/dist/cjs/ultramodern-workspace/demo-components.cjs +12 -12
- package/dist/cjs/ultramodern-workspace/descriptors.cjs +25 -25
- package/dist/cjs/ultramodern-workspace/fs-io.cjs +117 -0
- package/dist/cjs/ultramodern-workspace/generation-result.cjs +5 -5
- package/dist/cjs/ultramodern-workspace/index.cjs +4 -0
- package/dist/cjs/ultramodern-workspace/mf-validation.cjs +571 -0
- package/dist/cjs/ultramodern-workspace/module-federation.cjs +33 -18
- package/dist/cjs/ultramodern-workspace/overlays.cjs +2 -2
- package/dist/cjs/ultramodern-workspace/package-json.cjs +57 -41
- package/dist/cjs/ultramodern-workspace/policy.cjs +4 -4
- package/dist/cjs/ultramodern-workspace/public-api.cjs +4 -0
- package/dist/cjs/ultramodern-workspace/public-surface.cjs +2 -2
- package/dist/cjs/ultramodern-workspace/versions.cjs +5 -0
- package/dist/cjs/ultramodern-workspace/workspace-scripts.cjs +119 -50
- package/dist/cjs/ultramodern-workspace/write-workspace.cjs +62 -21
- package/dist/esm/index.js +37 -4
- package/dist/esm/locale/en.js +12 -2
- package/dist/esm/locale/zh.js +12 -2
- package/dist/esm/ultramodern-tooling/commands.js +132 -0
- package/dist/esm/ultramodern-tooling/config.js +120 -0
- package/dist/esm/ultramodern-workspace/add-vertical.js +88 -79
- package/dist/esm/ultramodern-workspace/{effect-api.js → api.js} +146 -147
- package/dist/esm/ultramodern-workspace/bridge-config.js +270 -0
- package/dist/esm/ultramodern-workspace/codesmith.js +1 -0
- package/dist/esm/ultramodern-workspace/contracts.js +129 -611
- package/dist/esm/ultramodern-workspace/demo-components.js +13 -13
- package/dist/esm/ultramodern-workspace/descriptors.js +11 -11
- package/dist/esm/ultramodern-workspace/fs-io.js +116 -2
- package/dist/esm/ultramodern-workspace/generation-result.js +6 -6
- package/dist/esm/ultramodern-workspace/index.js +1 -0
- package/dist/esm/ultramodern-workspace/mf-validation.js +516 -0
- package/dist/esm/ultramodern-workspace/module-federation.js +34 -19
- package/dist/esm/ultramodern-workspace/overlays.js +2 -2
- package/dist/esm/ultramodern-workspace/package-json.js +56 -40
- package/dist/esm/ultramodern-workspace/policy.js +5 -5
- package/dist/esm/ultramodern-workspace/public-api.js +1 -0
- package/dist/esm/ultramodern-workspace/public-surface.js +2 -2
- package/dist/esm/ultramodern-workspace/versions.js +3 -1
- package/dist/esm/ultramodern-workspace/workspace-scripts.js +107 -34
- package/dist/esm/ultramodern-workspace/write-workspace.js +64 -26
- package/dist/esm-node/index.js +37 -4
- package/dist/esm-node/locale/en.js +12 -2
- package/dist/esm-node/locale/zh.js +12 -2
- package/dist/esm-node/ultramodern-tooling/commands.js +133 -0
- package/dist/esm-node/ultramodern-tooling/config.js +121 -0
- package/dist/esm-node/ultramodern-workspace/add-vertical.js +88 -79
- package/dist/esm-node/ultramodern-workspace/{effect-api.js → api.js} +146 -147
- package/dist/esm-node/ultramodern-workspace/bridge-config.js +271 -0
- package/dist/esm-node/ultramodern-workspace/codesmith.js +1 -0
- package/dist/esm-node/ultramodern-workspace/contracts.js +129 -611
- package/dist/esm-node/ultramodern-workspace/demo-components.js +13 -13
- package/dist/esm-node/ultramodern-workspace/descriptors.js +11 -11
- package/dist/esm-node/ultramodern-workspace/fs-io.js +116 -2
- package/dist/esm-node/ultramodern-workspace/generation-result.js +6 -6
- package/dist/esm-node/ultramodern-workspace/index.js +1 -0
- package/dist/esm-node/ultramodern-workspace/mf-validation.js +517 -0
- package/dist/esm-node/ultramodern-workspace/module-federation.js +34 -19
- package/dist/esm-node/ultramodern-workspace/overlays.js +2 -2
- package/dist/esm-node/ultramodern-workspace/package-json.js +56 -40
- package/dist/esm-node/ultramodern-workspace/policy.js +5 -5
- package/dist/esm-node/ultramodern-workspace/public-api.js +1 -0
- package/dist/esm-node/ultramodern-workspace/public-surface.js +2 -2
- package/dist/esm-node/ultramodern-workspace/versions.js +3 -1
- package/dist/esm-node/ultramodern-workspace/workspace-scripts.js +107 -34
- package/dist/esm-node/ultramodern-workspace/write-workspace.js +64 -26
- package/dist/types/locale/en.d.ts +10 -0
- package/dist/types/locale/index.d.ts +20 -0
- package/dist/types/locale/zh.d.ts +10 -0
- package/dist/types/ultramodern-tooling/commands.d.ts +1 -0
- package/dist/types/ultramodern-tooling/config.d.ts +43 -0
- package/dist/types/ultramodern-workspace/add-vertical.d.ts +5 -2
- package/dist/types/ultramodern-workspace/api.d.ts +73 -0
- package/dist/types/ultramodern-workspace/bridge-config.d.ts +64 -0
- package/dist/types/ultramodern-workspace/codesmith.d.ts +1 -0
- package/dist/types/ultramodern-workspace/contracts.d.ts +2 -17
- package/dist/types/ultramodern-workspace/descriptors.d.ts +10 -10
- package/dist/types/ultramodern-workspace/fs-io.d.ts +1 -0
- package/dist/types/ultramodern-workspace/index.d.ts +2 -0
- package/dist/types/ultramodern-workspace/mf-validation.d.ts +27 -0
- package/dist/types/ultramodern-workspace/package-json.d.ts +5 -4
- package/dist/types/ultramodern-workspace/public-api.d.ts +2 -0
- package/dist/types/ultramodern-workspace/types.d.ts +9 -7
- package/dist/types/ultramodern-workspace/versions.d.ts +2 -0
- package/dist/types/ultramodern-workspace/workspace-scripts.d.ts +2 -7
- package/dist/types/ultramodern-workspace/write-workspace.d.ts +4 -2
- package/package.json +5 -3
- package/template-workspace/{.agents → .codex}/skills-lock.json +12 -12
- package/template-workspace/.github/workflows/ultramodern-workspace-gates.yml.handlebars +2 -0
- package/template-workspace/.gitignore.handlebars +3 -0
- package/template-workspace/AGENTS.md.handlebars +11 -5
- package/template-workspace/README.md.handlebars +15 -12
- package/template-workspace/oxfmt.config.ts +1 -0
- package/template-workspace/oxlint.config.ts +1 -0
- package/template-workspace/patches/@tanstack__router-core@1.171.13.patch +51 -0
- package/template-workspace/pnpm-workspace.yaml.handlebars +4 -0
- package/template-workspace/scripts/bootstrap-agent-skills.mjs +77 -67
- package/templates/workspace-scripts/assert-mf-types.mjs.handlebars +51 -8
- package/templates/workspace-scripts/check-ultramodern-api-boundaries.mts +344 -0
- package/templates/workspace-scripts/{check-ultramodern-i18n-boundaries.mjs → check-ultramodern-i18n-boundaries.mts} +1 -1
- package/templates/workspace-scripts/generate-public-surface-assets.mjs +246 -9
- package/templates/workspace-scripts/proof-cloudflare-version.mjs +277 -9
- package/templates/workspace-scripts/ultramodern-cloudflare-proof.mjs +35 -10
- package/templates/workspace-scripts/ultramodern-performance-readiness.mjs +165 -2
- package/templates/workspace-scripts/ultramodern-typecheck.mjs +4 -2
- package/templates/workspace-scripts/validate-ultramodern-workspace.mjs.handlebars +840 -84
- package/dist/types/ultramodern-workspace/effect-api.d.ts +0 -73
- /package/template-workspace/{.agents → .codex}/rstackjs-agent-skills-LICENSE +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rsbuild-best-practices/SKILL.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/SKILL.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/command-map.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/common-analysis-patterns.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/install-rsdoctor-common.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/install-rsdoctor-rspack.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/install-rsdoctor-webpack.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/install-rsdoctor.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/rsdoctor-data-types.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rslib-best-practices/SKILL.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rslib-modern-package/SKILL.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rspack-best-practices/SKILL.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rspack-tracing/SKILL.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rspack-tracing/references/bottlenecks.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rspack-tracing/references/tracing-guide.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rspack-tracing/scripts/analyze_trace.js +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rstest-best-practices/SKILL.md +0 -0
package/README.md
CHANGED
|
@@ -35,10 +35,11 @@ domains to delete. It generates:
|
|
|
35
35
|
- `apps/shell-super-app` as the Module Federation host and topology owner.
|
|
36
36
|
- `verticals/*` empty until a real domain is added with `--vertical`.
|
|
37
37
|
- `packages/shared-*` placeholders for shared contracts, tokens, and Effect
|
|
38
|
-
|
|
39
|
-
- `.modernjs/ultramodern
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
API support.
|
|
39
|
+
- `.modernjs/ultramodern.json` as compact generator provenance, package-source
|
|
40
|
+
config, app topology, bridge, deploy, Module Federation, and tooling config.
|
|
41
|
+
- `topology/*` as app-owned topology, ownership, and local development overlay
|
|
42
|
+
JSON.
|
|
42
43
|
|
|
43
44
|
Validate the generated workspace before making application changes:
|
|
44
45
|
|
|
@@ -80,8 +81,8 @@ such as Module Federation DTS generation, and use `@effect/tsgo` plus
|
|
|
80
81
|
`@typescript/native-preview` as tooling for `pnpm typecheck`. Generated
|
|
81
82
|
app/package source must not depend on compiler API internals. Existing compiler
|
|
82
83
|
API tests in this package use the stable TypeScript 6 package. If a future AST
|
|
83
|
-
utility is needed, keep it behind a dedicated
|
|
84
|
-
against stable `typescript`, not native-preview internals.
|
|
84
|
+
utility is needed, keep it behind a dedicated stable-TypeScript adapter and test
|
|
85
|
+
it against stable `typescript`, not native-preview internals.
|
|
85
86
|
|
|
86
87
|
Generated CI does not call the local aggregate. It runs format, lint,
|
|
87
88
|
typecheck, skills, i18n boundary validation, contract validation, and build as
|
|
@@ -136,7 +137,7 @@ const vertical = addUltramodernVertical({
|
|
|
136
137
|
|
|
137
138
|
Workspace generation returns `operation`, `workspaceRoot`, `packageScope`,
|
|
138
139
|
`packageSource`, `createdApps`, `createdPaths`, `rewrittenPaths`,
|
|
139
|
-
`assignedPorts`, `moduleFederationNames`, `
|
|
140
|
+
`assignedPorts`, `moduleFederationNames`, `apiPrefixes`,
|
|
140
141
|
`generatedContractPath`, and `warnings`. MicroVertical addition returns the
|
|
141
142
|
same shape for the new vertical and all rewritten integration surfaces.
|
|
142
143
|
|
|
@@ -150,7 +151,7 @@ pnpm dlx @bleedingdev/modern-js-create --vertical-name new-vertical --dry-run
|
|
|
150
151
|
```
|
|
151
152
|
|
|
152
153
|
The dry-run object adds `dryRun: true`, `selectedPort`,
|
|
153
|
-
`moduleFederationRemote`, `
|
|
154
|
+
`moduleFederationRemote`, `apiPrefix`, `jsonMutations`,
|
|
154
155
|
`shellDependencyChanges`, and `generatedContractChanges`. It still validates
|
|
155
156
|
the workspace before returning a plan.
|
|
156
157
|
|
|
@@ -161,11 +162,11 @@ contract so automation can stop safely:
|
|
|
161
162
|
| --- | --- | --- |
|
|
162
163
|
| Fresh input | Invalid or missing vertical name | Use `<name> --vertical`, `--vertical=<name>`, or `--vertical-name <name>` |
|
|
163
164
|
| Existing topology | Duplicate app ID, package suffix, path, Module Federation name, port, API prefix, or manifest key | Choose a new vertical name or repair the existing topology/local overlay first |
|
|
164
|
-
| Workspace files | Missing or non-object topology, ownership,
|
|
165
|
+
| Workspace files | Missing or non-object compact UltraModern config, topology, ownership, or local overlay JSON | Restore the generated config files from source control or rerun from a valid workspace |
|
|
165
166
|
| Tailwind prefix | Existing app already owns the generated CSS prefix | Rename the vertical before generation |
|
|
166
167
|
| Output path | A generated path already exists | Treat it as an existing vertical and do not overwrite it |
|
|
167
168
|
|
|
168
|
-
Package source is explicit and recorded in `.modernjs/ultramodern
|
|
169
|
+
Package source is explicit and recorded in `.modernjs/ultramodern.json`.
|
|
169
170
|
|
|
170
171
|
| Strategy | Use when | CLI |
|
|
171
172
|
| --- | --- | --- |
|
|
@@ -177,7 +178,7 @@ Package source is explicit and recorded in `.modernjs/ultramodern-package-source
|
|
|
177
178
|
Older generated repos should move by adopting one published BleedingDev cohort
|
|
178
179
|
at a time. Start with a dry-run vertical addition so validation reports
|
|
179
180
|
topology, ownership, package-source, overlay, Tailwind prefix, Module Federation,
|
|
180
|
-
and
|
|
181
|
+
and compact UltraModern config conflicts before files are written:
|
|
181
182
|
|
|
182
183
|
```bash
|
|
183
184
|
pnpm dlx @bleedingdev/modern-js-create@latest catalog --vertical --dry-run
|
|
@@ -192,9 +193,9 @@ Use `--ultramodern-package-source=install` for published cohort proof and pin a
|
|
|
192
193
|
specific release with `--ultramodern-package-version` when CI must prove an
|
|
193
194
|
exact framework version. Keep `--workspace` only for local monorepo testing
|
|
194
195
|
against unpublished packages. After install, run the generated
|
|
195
|
-
`scripts/validate-ultramodern-workspace.
|
|
196
|
-
conflicts in the owning JSON/config files instead of editing generated
|
|
197
|
-
|
|
196
|
+
`scripts/validate-ultramodern-workspace.mts` contract check and fix ownership
|
|
197
|
+
conflicts in the owning JSON/config files instead of editing generated metadata
|
|
198
|
+
by hand.
|
|
198
199
|
|
|
199
200
|
## CodeSmith Adapter And Overlays
|
|
200
201
|
|
|
@@ -257,8 +258,8 @@ addUltramodernVertical({
|
|
|
257
258
|
|
|
258
259
|
Overlay config receives `workspaceRoot`, `packageScope`, `operation`,
|
|
259
260
|
`generatedApp`, `generatedApps`, `assignedPort`, `assignedPorts`,
|
|
260
|
-
`moduleFederationName`, `moduleFederationNames`, `
|
|
261
|
-
`
|
|
261
|
+
`moduleFederationName`, `moduleFederationNames`, `apiPrefix`,
|
|
262
|
+
`apiPrefixes`, `packageSource`, and `generationResult`. Overlays extend
|
|
262
263
|
the generated output after base generation; they do not replace, inherit, or
|
|
263
264
|
shadow the base templates. Overlay failures stop the command with an
|
|
264
265
|
`UltraModern CodeSmith overlay failed` error and do not report base generation
|
|
@@ -268,7 +269,7 @@ as fully successful.
|
|
|
268
269
|
|
|
269
270
|
Use the workspace add flow from the UltraModern workspace root. It derives the
|
|
270
271
|
package path, package name, port, Module Federation name, topology entry, local
|
|
271
|
-
overlay, ownership entry, Effect
|
|
272
|
+
overlay, ownership entry, strict Effect HttpApi surface, and root `dev:*` script from the
|
|
272
273
|
requested vertical name.
|
|
273
274
|
|
|
274
275
|
```bash
|
|
@@ -298,7 +299,7 @@ exported by the vertical packages.
|
|
|
298
299
|
|
|
299
300
|
Route metadata is route-owned and colocated in
|
|
300
301
|
`src/routes/**/route.meta.ts`. The scaffold regenerates
|
|
301
|
-
`src/routes/ultramodern-route-metadata.ts` as a
|
|
302
|
+
`src/routes/ultramodern-route-metadata.ts` as a generated route manifest for
|
|
302
303
|
Modern.js config, i18n, public head, and public surface contracts; authors
|
|
303
304
|
should not hand-maintain it. Locale JSON is served from
|
|
304
305
|
`/locales/{{lng}}/{{ns}}.json`; Czech and English routes are generated from the
|
|
@@ -322,7 +323,7 @@ Dynamic public routes can expand sitemap entries through route-owned,
|
|
|
322
323
|
Node-safe ESM providers, normally `route.sitemap.mjs` beside the route
|
|
323
324
|
metadata. The public-surface generator discovers those providers for dynamic
|
|
324
325
|
public routes and still honors explicit `routes.publicSurface.contentSources`
|
|
325
|
-
entries in the generated
|
|
326
|
+
entries in the generated route manifest. Providers may export
|
|
326
327
|
`entries`, `entries()`, or a default entries/loader returning sitemap entries;
|
|
327
328
|
draft entries and `indexable: false` entries are omitted.
|
|
328
329
|
|
|
@@ -348,7 +349,7 @@ updating workspaces.
|
|
|
348
349
|
| --- | --- | --- |
|
|
349
350
|
| `MODERN_PUBLIC_SITE_URL` | Canonical site origin for public SEO output only | Canonical, hreflang, sitemap `<loc>`, robots `Sitemap:` |
|
|
350
351
|
| `MODERN_ASSET_PREFIX` | Preferred JS/CSS/static asset prefix | Modern/Rspack-emitted asset URLs |
|
|
351
|
-
| `ULTRAMODERN_ASSET_PREFIX` | UltraModern
|
|
352
|
+
| `ULTRAMODERN_ASSET_PREFIX` | UltraModern asset prefix fallback | Modern/Rspack-emitted asset URLs when `MODERN_ASSET_PREFIX` is unset |
|
|
352
353
|
| `ULTRAMODERN_PUBLIC_URL_<APP_ID>` | Per-app deployment/proof URL | Cloudflare proof inputs and Module Federation remote URLs |
|
|
353
354
|
|
|
354
355
|
Asset URLs use this precedence: `MODERN_ASSET_PREFIX` →
|
|
@@ -371,12 +372,13 @@ Each generated workspace app has:
|
|
|
371
372
|
|
|
372
373
|
- `cloudflare:build`, `cloudflare:deploy`, `cloudflare:preview`, and
|
|
373
374
|
`cloudflare:proof` scripts.
|
|
374
|
-
- Cloudflare
|
|
375
|
+
- Cloudflare Worker deploy config from Modern config plus
|
|
376
|
+
`.modernjs/ultramodern.json`.
|
|
375
377
|
- `zephyr:dependencies` for any consumed verticals.
|
|
376
378
|
- `zephyr-rspack-plugin` wired through the generated Modern.js Rspack bridge.
|
|
377
379
|
|
|
378
380
|
Deploy first, then pass each deployed app's generated public URL env key into
|
|
379
|
-
the proof step. The proof script reads the
|
|
381
|
+
the proof step. The proof script reads the compact UltraModern config and checks the
|
|
380
382
|
Cloudflare Worker surface, including public-route sitemap/robots consistency,
|
|
381
383
|
preview noindex behavior, unknown-route status, asset headers, byte budgets,
|
|
382
384
|
and public sourcemap exposure. Shell-only workspaces only need the shell URL;
|
|
@@ -401,7 +403,7 @@ proven.
|
|
|
401
403
|
| Package cohort mismatch | Regenerate with one package source strategy, run `mise install`, then rerun `pnpm install` from the activated shell. | Generated workspace package source metadata |
|
|
402
404
|
| Install failure | Check the active Node/pnpm from `mise install`; rerun `pnpm install` after the shell sees the pinned versions. | Toolchain setup |
|
|
403
405
|
| Build failure | Run the matching primitive gate (`pnpm lint`, `pnpm typecheck`, `pnpm i18n:boundaries`, `pnpm contract:check`) before `pnpm build`; fix the owning failure first. | Owning package or generated contract |
|
|
404
|
-
| Missing public URL | Set the env key
|
|
406
|
+
| Missing public URL | Set the app public URL env key recorded in `.modernjs/ultramodern.json`, for example `ULTRAMODERN_PUBLIC_URL_SHELL_SUPER_APP`. | Deployment operator |
|
|
405
407
|
| Cloudflare credentials | Confirm Wrangler credentials before `pnpm cloudflare:deploy`; local checks do not prove live Worker access. | Deployment operator |
|
|
406
408
|
| Asset or CSS 404 | Rebuild with `pnpm build` or `pnpm cloudflare:deploy` and inspect emitted Modern/Rspack asset paths instead of hardcoding CSS URLs. | Framework/runtime asset pipeline |
|
|
407
409
|
| Federation manifest failure | Run the shell and vertical build scripts, then check each deployed `/mf-manifest.json` URL used by the shell. | Module Federation owner |
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -39,7 +39,9 @@ const external_node_url_namespaceObject = require("node:url");
|
|
|
39
39
|
const external_create_package_root_cjs_namespaceObject = require("./create-package-root.cjs");
|
|
40
40
|
const index_cjs_namespaceObject = require("./locale/index.cjs");
|
|
41
41
|
const external_ultramodern_package_source_cjs_namespaceObject = require("./ultramodern-package-source.cjs");
|
|
42
|
+
const commands_cjs_namespaceObject = require("./ultramodern-tooling/commands.cjs");
|
|
42
43
|
const external_ultramodern_workspace_index_cjs_namespaceObject = require("./ultramodern-workspace/index.cjs");
|
|
44
|
+
const bridge_config_cjs_namespaceObject = require("./ultramodern-workspace/bridge-config.cjs");
|
|
43
45
|
const src_dirname = external_node_path_default().dirname((0, external_node_url_namespaceObject.fileURLToPath)(__rslib_import_meta_url__));
|
|
44
46
|
const createPackageRoot = (0, external_create_package_root_cjs_namespaceObject.resolveCreatePackageRoot)(src_dirname);
|
|
45
47
|
const semverPattern = /^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
|
|
@@ -117,6 +119,16 @@ function showHelp() {
|
|
|
117
119
|
console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionUltramodernPackageRegistry));
|
|
118
120
|
console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionUltramodernPackageScope));
|
|
119
121
|
console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionUltramodernPackageNamePrefix));
|
|
122
|
+
console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionBridge));
|
|
123
|
+
console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionBridgeParentRoot));
|
|
124
|
+
console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionBridgeWorkspacePackage));
|
|
125
|
+
console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionBridgeWorkspacePackageName));
|
|
126
|
+
console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionBridgeTestAlias));
|
|
127
|
+
console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionBridgeDependency));
|
|
128
|
+
console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionBridgeLockfilePolicy));
|
|
129
|
+
console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionBridgeGate));
|
|
130
|
+
console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionBridgeGateCwd));
|
|
131
|
+
console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionBridgeReactSingleton));
|
|
120
132
|
console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionVertical));
|
|
121
133
|
console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionVerticalName));
|
|
122
134
|
console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionDryRun));
|
|
@@ -205,7 +217,7 @@ function detectBffRuntime(args) {
|
|
|
205
217
|
process.exit(1);
|
|
206
218
|
}
|
|
207
219
|
if (!SUPPORTED_BFF_RUNTIMES.includes(runtime)) {
|
|
208
|
-
console.error(`Unsupported BFF runtime "${runtime}". UltraModern workspaces scaffold
|
|
220
|
+
console.error(`Unsupported BFF runtime "${runtime}". UltraModern workspaces scaffold a strict Effect API runtime for every MicroVertical (supported: ${SUPPORTED_BFF_RUNTIMES.join(', ')}).`);
|
|
209
221
|
process.exit(1);
|
|
210
222
|
}
|
|
211
223
|
return runtime;
|
|
@@ -230,7 +242,8 @@ function collectPositionalArgs(args) {
|
|
|
230
242
|
'--ultramodern-package-scope',
|
|
231
243
|
'--ultramodern-package-name-prefix',
|
|
232
244
|
VERTICAL_NAME_FLAG,
|
|
233
|
-
CODESMITH_OVERLAY_FLAG
|
|
245
|
+
CODESMITH_OVERLAY_FLAG,
|
|
246
|
+
...bridge_config_cjs_namespaceObject.ultramodernBridgeCliValueFlags
|
|
234
247
|
]);
|
|
235
248
|
const optionWithoutValue = new Set([
|
|
236
249
|
'--help',
|
|
@@ -243,7 +256,8 @@ function collectPositionalArgs(args) {
|
|
|
243
256
|
WORKSPACE_PROTOCOL_FLAG,
|
|
244
257
|
DRY_RUN_FLAG,
|
|
245
258
|
VERTICAL_FLAG,
|
|
246
|
-
LEGACY_MODERN_JS_FLAG
|
|
259
|
+
LEGACY_MODERN_JS_FLAG,
|
|
260
|
+
...bridge_config_cjs_namespaceObject.ultramodernBridgeCliBooleanFlags
|
|
247
261
|
]);
|
|
248
262
|
const positionalArgs = [];
|
|
249
263
|
for(let i = 0; i < args.length; i++){
|
|
@@ -253,7 +267,7 @@ function collectPositionalArgs(args) {
|
|
|
253
267
|
i += 1;
|
|
254
268
|
continue;
|
|
255
269
|
}
|
|
256
|
-
if (!(arg.startsWith('--lang=') || arg.startsWith(`${BFF_RUNTIME_OPTION}=`) || arg.startsWith('--ultramodern-package-source=') || arg.startsWith('--ultramodern-package-version=') || arg.startsWith('--ultramodern-package-registry=') || arg.startsWith('--ultramodern-package-scope=') || arg.startsWith('--ultramodern-package-name-prefix=') || arg.startsWith(`${VERTICAL_FLAG}=`) || arg.startsWith(`${VERTICAL_NAME_FLAG}=`) || arg.startsWith(`${CODESMITH_OVERLAY_FLAG}=`))) positionalArgs.push(arg);
|
|
270
|
+
if (!(arg.startsWith('--lang=') || arg.startsWith(`${BFF_RUNTIME_OPTION}=`) || arg.startsWith('--ultramodern-package-source=') || arg.startsWith('--ultramodern-package-version=') || arg.startsWith('--ultramodern-package-registry=') || arg.startsWith('--ultramodern-package-scope=') || arg.startsWith('--ultramodern-package-name-prefix=') || arg.startsWith(`${VERTICAL_FLAG}=`) || arg.startsWith(`${VERTICAL_NAME_FLAG}=`) || arg.startsWith(`${CODESMITH_OVERLAY_FLAG}=`) || bridge_config_cjs_namespaceObject.ultramodernBridgeCliBooleanFlags.some((flag)=>arg.startsWith(`${flag}=`)) || bridge_config_cjs_namespaceObject.ultramodernBridgeCliValueFlags.some((flag)=>arg.startsWith(`${flag}=`)))) positionalArgs.push(arg);
|
|
257
271
|
}
|
|
258
272
|
}
|
|
259
273
|
return positionalArgs;
|
|
@@ -369,6 +383,14 @@ function detectCodeSmithOverlays(args) {
|
|
|
369
383
|
}
|
|
370
384
|
return overlays.length > 0 ? overlays : void 0;
|
|
371
385
|
}
|
|
386
|
+
function readBridgeCliOptions(args) {
|
|
387
|
+
try {
|
|
388
|
+
return (0, bridge_config_cjs_namespaceObject.parseUltramodernBridgeCliOptions)(args);
|
|
389
|
+
} catch (error) {
|
|
390
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
391
|
+
process.exit(1);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
372
394
|
function detectUltramodernPackageSource(args, defaultPackageVersion, createPackage) {
|
|
373
395
|
const bleedingDevDefaults = isBleedingDevCreatePackage(createPackage);
|
|
374
396
|
const strategy = getOptionValue(args, [
|
|
@@ -578,6 +600,10 @@ async function getProjectName() {
|
|
|
578
600
|
}
|
|
579
601
|
async function main() {
|
|
580
602
|
const args = process.argv.slice(2);
|
|
603
|
+
if ('ultramodern' === args[0]) {
|
|
604
|
+
process.exitCode = await (0, commands_cjs_namespaceObject.runUltramodernToolingCli)(args.slice(1));
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
581
607
|
if (args.includes('--help') || args.includes('-h')) return void showHelp();
|
|
582
608
|
if (args.includes('--version') || args.includes('-v')) return void showVersion();
|
|
583
609
|
if (detectLegacyModernJsFlag(args)) {
|
|
@@ -589,10 +615,16 @@ async function main() {
|
|
|
589
615
|
const dryRun = detectDryRunFlag(args);
|
|
590
616
|
const verticalInput = resolveVerticalCliInput(args);
|
|
591
617
|
const overlays = detectCodeSmithOverlays(args);
|
|
618
|
+
const bridgeRequested = (0, bridge_config_cjs_namespaceObject.hasUltramodernBridgeCliOptions)(args);
|
|
592
619
|
if (dryRun && !verticalInput.addVertical) {
|
|
593
620
|
console.error(`${DRY_RUN_FLAG} is currently supported only with ${VERTICAL_FLAG}`);
|
|
594
621
|
process.exit(1);
|
|
595
622
|
}
|
|
623
|
+
if (verticalInput.addVertical && bridgeRequested) {
|
|
624
|
+
console.error('Bridge options are supported only when creating a new UltraModern workspace.');
|
|
625
|
+
process.exit(1);
|
|
626
|
+
}
|
|
627
|
+
const bridge = readBridgeCliOptions(args);
|
|
596
628
|
if (!dryRun) console.log(`\n${index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.message.welcome)}\n`);
|
|
597
629
|
const createPackage = readCreatePackageJson();
|
|
598
630
|
const version = createPackage.version || 'latest';
|
|
@@ -633,6 +665,7 @@ async function main() {
|
|
|
633
665
|
packageName: generatedPackageName,
|
|
634
666
|
modernVersion: version,
|
|
635
667
|
enableTailwind: detectTailwindFlag(),
|
|
668
|
+
bridge,
|
|
636
669
|
overlays,
|
|
637
670
|
packageSource
|
|
638
671
|
});
|
package/dist/cjs/locale/en.cjs
CHANGED
|
@@ -47,7 +47,7 @@ const EN_LOCALE = {
|
|
|
47
47
|
step1: 'cd {projectName}',
|
|
48
48
|
step2: 'pnpm install',
|
|
49
49
|
step3: 'pnpm dev',
|
|
50
|
-
legacyModernJsWarning: "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\nBRUTAL WARNING: YOU ARE OPTING OUT OF ULTRAMODERN.JS DEFAULTS.\nThe unattended default is the best UltraModern.js configuration:\na structured SuperApp workspace, presetUltramodern, TanStack Router,\
|
|
50
|
+
legacyModernJsWarning: "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\nBRUTAL WARNING: YOU ARE OPTING OUT OF ULTRAMODERN.JS DEFAULTS.\nThe unattended default is the best UltraModern.js configuration:\na structured SuperApp workspace, presetUltramodern, TanStack Router,\na strict Effect API runtime, Tailwind CSS v4, and the BleedingDev package cohort.\nThe original Modern.js setup is a dangerous opt-in path.\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
|
51
51
|
},
|
|
52
52
|
help: {
|
|
53
53
|
title: '🚀 UltraModern.js Project Creator',
|
|
@@ -59,7 +59,7 @@ const EN_LOCALE = {
|
|
|
59
59
|
optionVersion: ' -v, --version Display version information',
|
|
60
60
|
optionLang: ' -l, --lang Set the language (en default; zh opt-in)',
|
|
61
61
|
optionTailwind: ' --no-tailwind Disable default Tailwind CSS v4 workspace styling',
|
|
62
|
-
optionBff: ' --bff Keep the default Effect
|
|
62
|
+
optionBff: ' --bff Keep the default strict Effect API runtime (every MicroVertical ships one)',
|
|
63
63
|
optionBffRuntime: ' --bff-runtime Select the BFF runtime for scaffolded MicroVerticals (supported: effect; default: effect)',
|
|
64
64
|
optionWorkspace: ' --workspace Use workspace protocol for @modern-js dependencies (for local monorepo testing)',
|
|
65
65
|
optionUltramodernPackageSource: ' --ultramodern-package-source Select UltraModern package source (workspace or install; BleedingDev defaults to install aliases)',
|
|
@@ -67,6 +67,16 @@ const EN_LOCALE = {
|
|
|
67
67
|
optionUltramodernPackageRegistry: ' --ultramodern-package-registry npm registry URL used for install package sources',
|
|
68
68
|
optionUltramodernPackageScope: ' --ultramodern-package-scope Publish scope for npm alias installs (for example bleedingdev)',
|
|
69
69
|
optionUltramodernPackageNamePrefix: ' --ultramodern-package-name-prefix Prefix for npm alias package names (default: modern-js-)',
|
|
70
|
+
optionBridge: ' --bridge Enable explicit nested parent-monorepo bridge mode for new workspaces',
|
|
71
|
+
optionBridgeParentRoot: ' --bridge-parent-root <path> Parent monorepo root for bridge mode',
|
|
72
|
+
optionBridgeWorkspacePackage: ' --bridge-workspace-package <glob> Parent workspace package glob consumed by generated apps',
|
|
73
|
+
optionBridgeWorkspacePackageName: ' --bridge-workspace-package-name <glob=package[,package]> Package names covered by a bridge workspace glob',
|
|
74
|
+
optionBridgeTestAlias: ' --bridge-test-alias <glob:alias=target> Test/source alias for a bridge workspace package glob',
|
|
75
|
+
optionBridgeDependency: ' --bridge-dependency <package[,package]> Explicit parent package dependency consumed by generated apps',
|
|
76
|
+
optionBridgeLockfilePolicy: ' --bridge-lockfile-policy <nested|parent> Bridge lockfile ownership policy (default: nested)',
|
|
77
|
+
optionBridgeGate: ' --bridge-gate <name=command> Delegated parent workspace gate command for bridge packages',
|
|
78
|
+
optionBridgeGateCwd: ' --bridge-gate-cwd <name=cwd> Working directory for a named bridge gate',
|
|
79
|
+
optionBridgeReactSingleton: ' --bridge-react-singleton <package[,package]> React singleton package expectation (default: react,react-dom)',
|
|
70
80
|
optionVertical: ' --vertical[=<name>] Mutate the current existing UltraModern workspace and wire a MicroVertical',
|
|
71
81
|
optionVerticalName: ' --vertical-name <name> Explicit MicroVertical name for automation-friendly workspace mutation',
|
|
72
82
|
optionDryRun: ' --dry-run Preview a MicroVertical mutation plan without writing files (supported with --vertical)',
|
package/dist/cjs/locale/zh.cjs
CHANGED
|
@@ -47,7 +47,7 @@ const ZH_LOCALE = {
|
|
|
47
47
|
step1: 'cd {projectName}',
|
|
48
48
|
step2: 'pnpm install',
|
|
49
49
|
step3: 'pnpm dev',
|
|
50
|
-
legacyModernJsWarning: "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n严重警告:你正在退出 ULTRAMODERN.JS 默认配置。\n免交互默认值是最佳 UltraModern.js 配置:\n结构化 SuperApp 工作区、presetUltramodern、TanStack Router、\
|
|
50
|
+
legacyModernJsWarning: "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n严重警告:你正在退出 ULTRAMODERN.JS 默认配置。\n免交互默认值是最佳 UltraModern.js 配置:\n结构化 SuperApp 工作区、presetUltramodern、TanStack Router、\n严格 Effect API 运行时、Tailwind CSS v4,以及 BleedingDev 包版本队列。\n原始 Modern.js 初始化是危险的显式选择路径。\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
|
51
51
|
},
|
|
52
52
|
help: {
|
|
53
53
|
title: '🚀 UltraModern.js 项目创建工具',
|
|
@@ -59,7 +59,7 @@ const ZH_LOCALE = {
|
|
|
59
59
|
optionVersion: ' -v, --version 显示版本信息',
|
|
60
60
|
optionLang: ' -l, --lang 设置语言 (默认 en;zh 需显式选择)',
|
|
61
61
|
optionTailwind: ' --no-tailwind 禁用默认 Tailwind CSS v4 工作区样式',
|
|
62
|
-
optionBff: ' --bff
|
|
62
|
+
optionBff: ' --bff 保留默认的严格 Effect API 运行时(每个 MicroVertical 自带一个)',
|
|
63
63
|
optionBffRuntime: ' --bff-runtime 选择 MicroVertical 脚手架的 BFF 运行时(支持: effect;默认: effect)',
|
|
64
64
|
optionWorkspace: ' --workspace 对 @modern-js 依赖使用 workspace 协议(用于本地 monorepo 联调)',
|
|
65
65
|
optionUltramodernPackageSource: ' --ultramodern-package-source 选择 UltraModern 依赖来源(workspace 或 install;BleedingDev 默认使用 install alias)',
|
|
@@ -67,6 +67,16 @@ const ZH_LOCALE = {
|
|
|
67
67
|
optionUltramodernPackageRegistry: ' --ultramodern-package-registry install 依赖来源使用的 npm registry 地址',
|
|
68
68
|
optionUltramodernPackageScope: ' --ultramodern-package-scope npm alias 安装使用的发布 scope(例如 bleedingdev)',
|
|
69
69
|
optionUltramodernPackageNamePrefix: ' --ultramodern-package-name-prefix npm alias 包名前缀(默认:modern-js-)',
|
|
70
|
+
optionBridge: ' --bridge 为新工作区启用显式的嵌套父 monorepo 桥接模式',
|
|
71
|
+
optionBridgeParentRoot: ' --bridge-parent-root <路径> 桥接模式使用的父 monorepo 根目录',
|
|
72
|
+
optionBridgeWorkspacePackage: ' --bridge-workspace-package <glob> 生成应用消费的父工作区包 glob',
|
|
73
|
+
optionBridgeWorkspacePackageName: ' --bridge-workspace-package-name <glob=包名[,包名]> 桥接工作区 glob 覆盖的包名',
|
|
74
|
+
optionBridgeTestAlias: ' --bridge-test-alias <glob:别名=目标> 桥接工作区包 glob 的测试/源码 alias',
|
|
75
|
+
optionBridgeDependency: ' --bridge-dependency <包名[,包名]> 生成应用显式消费的父包依赖',
|
|
76
|
+
optionBridgeLockfilePolicy: ' --bridge-lockfile-policy <nested|parent> 桥接 lockfile 归属策略(默认:nested)',
|
|
77
|
+
optionBridgeGate: ' --bridge-gate <名称=命令> 桥接包委托给父工作区执行的 gate 命令',
|
|
78
|
+
optionBridgeGateCwd: ' --bridge-gate-cwd <名称=目录> 指定桥接 gate 的工作目录',
|
|
79
|
+
optionBridgeReactSingleton: ' --bridge-react-singleton <包名[,包名]> React 单例包预期(默认:react,react-dom)',
|
|
70
80
|
optionVertical: ' --vertical[=<名称>] 修改当前已有的 UltraModern 工作区,并接入 MicroVertical',
|
|
71
81
|
optionVerticalName: ' --vertical-name <名称> 为自动化工作流显式指定 MicroVertical 名称',
|
|
72
82
|
optionDryRun: ' --dry-run 预览 MicroVertical 修改计划但不写入文件(与 --vertical 一起使用)',
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
|
|
3
|
+
return "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
|
|
4
|
+
}();
|
|
5
|
+
var __webpack_require__ = {};
|
|
6
|
+
(()=>{
|
|
7
|
+
__webpack_require__.n = (module)=>{
|
|
8
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
9
|
+
__webpack_require__.d(getter, {
|
|
10
|
+
a: getter
|
|
11
|
+
});
|
|
12
|
+
return getter;
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
17
|
+
var define = (defs, kind)=>{
|
|
18
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
[kind]: defs[key]
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
define(getters, "get");
|
|
24
|
+
define(values, "value");
|
|
25
|
+
};
|
|
26
|
+
})();
|
|
27
|
+
(()=>{
|
|
28
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
29
|
+
})();
|
|
30
|
+
(()=>{
|
|
31
|
+
__webpack_require__.r = (exports1)=>{
|
|
32
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
33
|
+
value: 'Module'
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
36
|
+
value: true
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
})();
|
|
40
|
+
var __webpack_exports__ = {};
|
|
41
|
+
__webpack_require__.r(__webpack_exports__);
|
|
42
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
43
|
+
runUltramodernToolingCli: ()=>runUltramodernToolingCli
|
|
44
|
+
});
|
|
45
|
+
const external_node_child_process_namespaceObject = require("node:child_process");
|
|
46
|
+
const external_node_fs_namespaceObject = require("node:fs");
|
|
47
|
+
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
48
|
+
const external_node_os_namespaceObject = require("node:os");
|
|
49
|
+
var external_node_os_default = /*#__PURE__*/ __webpack_require__.n(external_node_os_namespaceObject);
|
|
50
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
51
|
+
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
52
|
+
const external_node_url_namespaceObject = require("node:url");
|
|
53
|
+
const external_create_package_root_cjs_namespaceObject = require("../create-package-root.cjs");
|
|
54
|
+
const mf_validation_cjs_namespaceObject = require("../ultramodern-workspace/mf-validation.cjs");
|
|
55
|
+
const workspace_scripts_cjs_namespaceObject = require("../ultramodern-workspace/workspace-scripts.cjs");
|
|
56
|
+
const external_config_cjs_namespaceObject = require("./config.cjs");
|
|
57
|
+
const commands_dirname = external_node_path_default().dirname((0, external_node_url_namespaceObject.fileURLToPath)(__rslib_import_meta_url__));
|
|
58
|
+
const createPackageRoot = (0, external_create_package_root_cjs_namespaceObject.resolveCreatePackageRoot)(commands_dirname);
|
|
59
|
+
function printHelp() {
|
|
60
|
+
process.stdout.write(`Usage:
|
|
61
|
+
modern-js-create ultramodern <command> [args]
|
|
62
|
+
|
|
63
|
+
Commands:
|
|
64
|
+
validate
|
|
65
|
+
typecheck
|
|
66
|
+
mf-types
|
|
67
|
+
public-surface
|
|
68
|
+
cloudflare-proof
|
|
69
|
+
performance-readiness
|
|
70
|
+
skills install
|
|
71
|
+
skills check
|
|
72
|
+
`);
|
|
73
|
+
}
|
|
74
|
+
function spawnNodeScript(relativeScriptPath, args, context, options = {}) {
|
|
75
|
+
const scriptPath = external_node_path_default().join(createPackageRoot, relativeScriptPath);
|
|
76
|
+
const result = (0, external_node_child_process_namespaceObject.spawnSync)(process.execPath, [
|
|
77
|
+
scriptPath,
|
|
78
|
+
...args
|
|
79
|
+
], {
|
|
80
|
+
cwd: options.cwd ?? context.workspaceRoot,
|
|
81
|
+
env: {
|
|
82
|
+
...process.env,
|
|
83
|
+
ULTRAMODERN_WORKSPACE_ROOT: context.workspaceRoot
|
|
84
|
+
},
|
|
85
|
+
stdio: 'inherit'
|
|
86
|
+
});
|
|
87
|
+
if (result.error) throw result.error;
|
|
88
|
+
return result.status ?? 1;
|
|
89
|
+
}
|
|
90
|
+
function runRenderedModule(source, context) {
|
|
91
|
+
const tempDir = external_node_fs_default().mkdtempSync(external_node_path_default().join(external_node_os_default().tmpdir(), 'ultramodern-tool-'));
|
|
92
|
+
const tempFile = external_node_path_default().join(tempDir, 'command.mjs');
|
|
93
|
+
try {
|
|
94
|
+
external_node_fs_default().writeFileSync(tempFile, source, 'utf-8');
|
|
95
|
+
const result = (0, external_node_child_process_namespaceObject.spawnSync)(process.execPath, [
|
|
96
|
+
tempFile
|
|
97
|
+
], {
|
|
98
|
+
cwd: context.workspaceRoot,
|
|
99
|
+
stdio: 'inherit'
|
|
100
|
+
});
|
|
101
|
+
if (result.error) throw result.error;
|
|
102
|
+
return result.status ?? 1;
|
|
103
|
+
} finally{
|
|
104
|
+
external_node_fs_default().rmSync(tempDir, {
|
|
105
|
+
force: true,
|
|
106
|
+
recursive: true
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function runValidate(context) {
|
|
111
|
+
const config = (0, external_config_cjs_namespaceObject.readUltramodernConfig)(context.workspaceRoot);
|
|
112
|
+
const apps = (0, external_config_cjs_namespaceObject.workspaceAppsFromToolingConfig)(config);
|
|
113
|
+
const remotes = apps.filter((app)=>'shell' !== app.kind);
|
|
114
|
+
const source = (0, workspace_scripts_cjs_namespaceObject.createWorkspaceValidationScript)(config.workspace.packageScope, config.features.tailwind, remotes);
|
|
115
|
+
return runRenderedModule(source, context);
|
|
116
|
+
}
|
|
117
|
+
function runMfTypes(args, context) {
|
|
118
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
119
|
+
process.stdout.write(`Usage:
|
|
120
|
+
modern-js-create ultramodern mf-types [app-dir...]
|
|
121
|
+
|
|
122
|
+
Checks real Module Federation config files and DTS archives for exposed apps.
|
|
123
|
+
`);
|
|
124
|
+
return 0;
|
|
125
|
+
}
|
|
126
|
+
(0, mf_validation_cjs_namespaceObject.validateModuleFederationTypes)({
|
|
127
|
+
workspaceRoot: context.workspaceRoot,
|
|
128
|
+
appDirs: args.length > 0 ? args : void 0
|
|
129
|
+
});
|
|
130
|
+
return 0;
|
|
131
|
+
}
|
|
132
|
+
function runSkills(args, context) {
|
|
133
|
+
const [subcommand, ...rest] = args;
|
|
134
|
+
if ('install' === subcommand) return spawnNodeScript("template-workspace/scripts/bootstrap-agent-skills.mjs", rest, context);
|
|
135
|
+
if ('check' === subcommand) return spawnNodeScript("template-workspace/scripts/bootstrap-agent-skills.mjs", [
|
|
136
|
+
'--check',
|
|
137
|
+
...rest
|
|
138
|
+
], context);
|
|
139
|
+
throw new Error('Usage: modern-js-create ultramodern skills <install|check>');
|
|
140
|
+
}
|
|
141
|
+
async function runUltramodernToolingCli(args, workspaceRoot = process.env.ULTRAMODERN_WORKSPACE_ROOT ?? process.cwd()) {
|
|
142
|
+
try {
|
|
143
|
+
const [command, ...rest] = args;
|
|
144
|
+
const context = {
|
|
145
|
+
workspaceRoot: external_node_path_default().resolve(workspaceRoot),
|
|
146
|
+
invocationCwd: process.cwd()
|
|
147
|
+
};
|
|
148
|
+
switch(command){
|
|
149
|
+
case void 0:
|
|
150
|
+
case '--help':
|
|
151
|
+
case '-h':
|
|
152
|
+
printHelp();
|
|
153
|
+
return 0;
|
|
154
|
+
case 'validate':
|
|
155
|
+
return runValidate(context);
|
|
156
|
+
case 'typecheck':
|
|
157
|
+
return spawnNodeScript("templates/workspace-scripts/ultramodern-typecheck.mjs", rest, context, {
|
|
158
|
+
cwd: context.invocationCwd
|
|
159
|
+
});
|
|
160
|
+
case 'mf-types':
|
|
161
|
+
return runMfTypes(rest, context);
|
|
162
|
+
case 'public-surface':
|
|
163
|
+
return spawnNodeScript("templates/workspace-scripts/generate-public-surface-assets.mjs", rest, context);
|
|
164
|
+
case 'cloudflare-proof':
|
|
165
|
+
return spawnNodeScript("templates/workspace-scripts/proof-cloudflare-version.mjs", rest, context);
|
|
166
|
+
case 'performance-readiness':
|
|
167
|
+
return spawnNodeScript("templates/workspace-scripts/ultramodern-performance-readiness.mjs", rest, context);
|
|
168
|
+
case 'skills':
|
|
169
|
+
return runSkills(rest, context);
|
|
170
|
+
default:
|
|
171
|
+
throw new Error(`Unknown UltraModern command: ${command}`);
|
|
172
|
+
}
|
|
173
|
+
} catch (error) {
|
|
174
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
175
|
+
process.stderr.write(`[ultramodern] ${message}\n`);
|
|
176
|
+
return 1;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
exports.runUltramodernToolingCli = __webpack_exports__.runUltramodernToolingCli;
|
|
180
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
181
|
+
"runUltramodernToolingCli"
|
|
182
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
183
|
+
Object.defineProperty(exports, '__esModule', {
|
|
184
|
+
value: true
|
|
185
|
+
});
|