@bleedingdev/modern-js-create 3.2.0-ultramodern.117 → 3.2.0-ultramodern.118

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.
Files changed (62) hide show
  1. package/README.md +35 -125
  2. package/dist/cjs/create-package-root.cjs +1 -1
  3. package/dist/cjs/index.cjs +11 -602
  4. package/dist/cjs/locale/en.cjs +12 -19
  5. package/dist/cjs/locale/zh.cjs +12 -19
  6. package/dist/cjs/ultramodern-workspace.cjs +16 -19
  7. package/dist/esm/create-package-root.js +1 -1
  8. package/dist/esm/index.js +13 -603
  9. package/dist/esm/locale/en.js +12 -19
  10. package/dist/esm/locale/zh.js +12 -19
  11. package/dist/esm/ultramodern-workspace.js +17 -17
  12. package/dist/esm-node/create-package-root.js +1 -1
  13. package/dist/esm-node/index.js +13 -603
  14. package/dist/esm-node/locale/en.js +12 -19
  15. package/dist/esm-node/locale/zh.js +12 -19
  16. package/dist/esm-node/ultramodern-workspace.js +17 -17
  17. package/dist/types/locale/en.d.ts +0 -7
  18. package/dist/types/locale/index.d.ts +0 -14
  19. package/dist/types/locale/zh.d.ts +0 -7
  20. package/dist/types/ultramodern-workspace.d.ts +0 -1
  21. package/package.json +4 -5
  22. package/template-workspace/.github/workflows/ultramodern-workspace-gates.yml.handlebars +22 -6
  23. package/template-workspace/AGENTS.md +7 -3
  24. package/template-workspace/README.md.handlebars +5 -1
  25. package/template-workspace/lefthook.yml +18 -4
  26. package/template/.agents/skills-lock.json +0 -34
  27. package/template/.browserslistrc +0 -4
  28. package/template/.codex/hooks.json +0 -16
  29. package/template/.github/renovate.json +0 -53
  30. package/template/.github/workflows/ultramodern-gates.yml.handlebars +0 -54
  31. package/template/.gitignore.handlebars +0 -30
  32. package/template/.mise.toml.handlebars +0 -2
  33. package/template/.nvmrc +0 -2
  34. package/template/AGENTS.md +0 -23
  35. package/template/README.md +0 -111
  36. package/template/api/effect/index.ts.handlebars +0 -34
  37. package/template/api/lambda/hello.ts.handlebars +0 -6
  38. package/template/config/favicon.svg +0 -5
  39. package/template/config/public/assets/ultramodern-logo.svg +0 -6
  40. package/template/config/public/locales/cs/translation.json +0 -44
  41. package/template/config/public/locales/en/translation.json +0 -44
  42. package/template/lefthook.yml +0 -10
  43. package/template/modern.config.ts.handlebars +0 -78
  44. package/template/oxfmt.config.ts +0 -15
  45. package/template/oxlint.config.ts +0 -19
  46. package/template/package.json.handlebars +0 -69
  47. package/template/pnpm-workspace.yaml +0 -34
  48. package/template/postcss.config.mjs.handlebars +0 -6
  49. package/template/rstest.config.mts +0 -5
  50. package/template/scripts/bootstrap-agent-skills.mjs +0 -228
  51. package/template/scripts/check-i18n-strings.mjs +0 -3
  52. package/template/scripts/validate-ultramodern.mjs.handlebars +0 -658
  53. package/template/shared/effect/api.ts.handlebars +0 -17
  54. package/template/src/modern-app-env.d.ts +0 -3
  55. package/template/src/modern.runtime.ts.handlebars +0 -23
  56. package/template/src/routes/[lang]/page.tsx.handlebars +0 -209
  57. package/template/src/routes/index.css.handlebars +0 -266
  58. package/template/src/routes/layout.tsx.handlebars +0 -10
  59. package/template/tailwind.config.ts.handlebars +0 -10
  60. package/template/tests/tsconfig.json +0 -7
  61. package/template/tests/ultramodern.contract.test.ts.handlebars +0 -163
  62. package/template/tsconfig.json +0 -121
package/README.md CHANGED
@@ -8,17 +8,13 @@
8
8
  A Progressive React Framework for modern web development.
9
9
  </p>
10
10
 
11
- ## Getting Started
11
+ ## UltraModern.js Create
12
12
 
13
- Please follow [Quick Start](https://modernjs.dev/en/guides/get-started/quick-start) to get started with Modern.js.
14
-
15
- For UltraModern.js, use the BleedingDev create package. It defaults to a
16
- production-ready single app with `presetUltramodern(...)`, TanStack Router,
17
- Tailwind CSS v4, i18n, Effect BFF, generated quality gates, and published
18
- BleedingDev package aliases:
13
+ The BleedingDev create package has one supported generated product: an
14
+ UltraModern SuperApp workspace.
19
15
 
20
16
  ```bash
21
- pnpm dlx @bleedingdev/modern-js-create my-app
17
+ pnpm dlx @bleedingdev/modern-js-create my-workspace
22
18
  ```
23
19
 
24
20
  To initialize the empty directory you are already in, pass `.` explicitly:
@@ -27,84 +23,43 @@ To initialize the empty directory you are already in, pass `.` explicitly:
27
23
  pnpm dlx @bleedingdev/modern-js-create .
28
24
  ```
29
25
 
30
- The default is the full UltraModern single-app setup. Create a SuperApp
31
- workspace explicitly when you need independently owned verticals:
32
-
33
- ```bash
34
- pnpm dlx @bleedingdev/modern-js-create my-super-app --ultramodern-workspace
35
- ```
36
-
37
26
  The workspace starts shell-only so the first commit has no fake business
38
27
  domains to delete. It generates:
39
28
 
40
29
  - `apps/shell-super-app` as the Module Federation host and topology owner.
41
- - `verticals/*` empty until you add a real domain with `--vertical`.
42
- - `packages/shared-*` placeholders for shared contracts, tokens, and API
43
- support.
44
- - `.modernjs/ultramodern-generated-contract.json` with MF, Effect, i18n,
45
- federated CSS, Cloudflare, route publicness, generated public-surface, and
46
- Zephyr dependency metadata.
30
+ - `verticals/*` empty until a real domain is added with `--vertical`.
31
+ - `packages/shared-*` placeholders for shared contracts, tokens, and Effect
32
+ API support.
33
+ - `.modernjs/ultramodern-generated-contract.json` with Module Federation,
34
+ Effect, i18n, federated CSS, Cloudflare, route publicness, generated
35
+ public-surface, and Zephyr dependency metadata.
47
36
 
48
37
  Validate the generated workspace before making application changes:
49
38
 
50
39
  ```bash
51
- cd my-super-app
40
+ cd my-workspace
52
41
  mise install
53
42
  pnpm install
54
43
  pnpm check
55
44
  pnpm build
56
45
  ```
57
46
 
58
- ### Router Template
59
-
60
- TanStack Router is generated by default. Choose React Router only as an explicit
61
- compatibility lane:
62
-
63
- ```bash
64
- pnpm dlx @bleedingdev/modern-js-create my-app --router react-router
65
- ```
66
-
67
- ### Tailwind Template
68
-
69
- Tailwind CSS v4 setup is generated by default. Disable it explicitly when you
70
- need a plain CSS starter:
71
-
72
- ```bash
73
- pnpm dlx @bleedingdev/modern-js-create my-app --no-tailwind
74
- ```
75
-
76
- TanStack Router and Tailwind CSS work together without extra flags:
77
-
78
- ```bash
79
- pnpm dlx @bleedingdev/modern-js-create my-app
80
- ```
81
-
82
- ### BFF Runtime Template
83
-
84
- UltraModern app scaffolds include Effect HttpApi BFF by default:
85
-
86
- ```bash
87
- pnpm dlx @bleedingdev/modern-js-create my-app
88
- ```
47
+ Generated CI does not call the local aggregate. It runs format, lint,
48
+ typecheck, skills, i18n boundary validation, contract validation, and build as
49
+ separate matrix jobs so failures are isolated and parallelizable. Generated
50
+ lefthook config runs separate format and lint-fix commands on pre-commit, then
51
+ runs the read-only primitive gates in parallel on pre-push.
89
52
 
90
- To scaffold Hono runtime explicitly:
53
+ For local monorepo dependency testing, add `--workspace`:
91
54
 
92
55
  ```bash
93
- pnpm dlx @bleedingdev/modern-js-create my-app --bff-runtime hono
56
+ pnpm dlx @bleedingdev/modern-js-create my-workspace --workspace
94
57
  ```
95
58
 
96
- Generated starters expose `presetUltramodern(...)` as the public opinionated
97
- config wrapper when you want the full Ultramodern setup surface in
98
- `modern.config.ts`.
99
-
100
- TanStack Router, default Tailwind, and Effect BFF are included without extra
101
- flags. For local monorepo dependency testing, add `--workspace`:
102
-
103
- ```bash
104
- pnpm dlx @bleedingdev/modern-js-create my-app --workspace
105
- ```
59
+ For package-source validation outside the monorepo, pass explicit
60
+ `--ultramodern-package-*` options.
106
61
 
107
- ### Vertical Workspace Recipes
62
+ ## Vertical Workspace Recipes
108
63
 
109
64
  Use the workspace add flow from the UltraModern workspace root. It derives the
110
65
  package path, package name, port, Module Federation name, topology entry, local
@@ -125,38 +80,23 @@ Use this decision table before adding a vertical:
125
80
  | Design tokens, primitives, generated clients, or domain-neutral utilities | Yes | Use an ordinary workspace package, not a vertical |
126
81
  | Feature composites or workflow state shared across verticals | No | Revisit ownership; do not hide it in shared code |
127
82
 
128
- The lower-level `--router react-router`, `--workspace`, and `--sub` flags remain
129
- available for compatibility and local package scaffolding, but UltraModern
130
- vertical additions should use `--vertical` so paths, topology, Effect BFF
131
- contracts, and local overlays stay consistent.
132
-
133
- See
134
- `docs/super-app-rfc-adr/WORKSPACE-0001-micro-vertical-workspace-scaffolding.md`
135
- for the canonical workspace topology and local orchestration model.
136
-
137
- The published `@bleedingdev/modern-js-create` package is the preferred
138
- UltraModern.js entrypoint. The lower-level `--ultramodern-*` flags remain
139
- available for release engineering and local package-source testing, but users
140
- should not need them for normal app creation.
141
-
142
- ### SuperApp Architecture Contracts
83
+ ## SuperApp Architecture Contracts
143
84
 
144
85
  The generated shell owns route assembly and policy. Each vertical added with
145
- `--vertical` owns its route subtree, MF exposes, Effect BFF contract, generated
146
- client, `localisedUrls`, locale JSON, CSS layer, and Cloudflare Worker output.
147
- The shell consumes vertical UI through MF manifests and vertical APIs through
148
- generated Effect clients exported by the vertical packages.
86
+ `--vertical` owns its route subtree, Module Federation exposes, Effect BFF
87
+ contract, generated client, `localisedUrls`, locale JSON, CSS layer, and
88
+ Cloudflare Worker output. The shell consumes vertical UI through Module
89
+ Federation manifests and vertical APIs through generated Effect clients
90
+ exported by the vertical packages.
149
91
 
150
92
  Route metadata is route-owned. Each app writes
151
93
  `src/routes/ultramodern-route-metadata` and passes
152
94
  `ultramodernLocalisedUrls` into `@modern-js/plugin-i18n`. Locale JSON is served
153
- from `/locales/{{lng}}/{{ns}}.json`; Czech and English routes are generated from
154
- the route owner, not from shell rewrites. Routes default to
95
+ from `/locales/{{lng}}/{{ns}}.json`; Czech and English routes are generated
96
+ from the route owner, not from shell rewrites. Routes default to
155
97
  `privateByDefault: true` and `publicnessDefault: private-app-screen`; generated
156
98
  public files use only explicit `public && indexable` route metadata, so private
157
- app screens publish only a disallowing `robots.txt` by default. Sitemap,
158
- manifest, `llms.txt`, API catalog, JSON-LD, and broad web profile/certification
159
- output stay omitted unless a safe public input exists.
99
+ app screens publish only a disallowing `robots.txt` by default.
160
100
 
161
101
  CSS federation is explicit:
162
102
 
@@ -168,15 +108,8 @@ CSS federation is explicit:
168
108
  - Tailwind CSS v4 is configured per app through `@tailwindcss/postcss`.
169
109
  - Duplicate base styles are forbidden; SSR first paint depends on shared token
170
110
  CSS plus Modern/Rspack-emitted app CSS.
171
- - Apps should not inject remote `async-index.css` paths, hardcode remote
172
- stylesheet links, or disable filename hashing to make CSS URLs predictable.
173
- UltraModern SSR resolves federated CSS from build output and MF manifests so
174
- generated shells and demos can keep normal hashed assets.
175
-
176
- Version switching evidence must keep UI, Effect API, CSS, i18n JSON, and MF
177
- manifest markers in lockstep for the same vertical version.
178
111
 
179
- ### Cloudflare And Zephyr Proof
112
+ ## Cloudflare And Zephyr Proof
180
113
 
181
114
  Each generated workspace app has:
182
115
 
@@ -198,50 +131,27 @@ ULTRAMODERN_PUBLIC_URL_TRANSPORTATION=https://transportation.example.workers.dev
198
131
  pnpm cloudflare:proof -- --require-public-urls
199
132
  ```
200
133
 
201
- Without public URLs and credentials, use local `pnpm check` and `pnpm build`
134
+ Without public URLs and credentials, use local primitive gates and `pnpm build`
202
135
  evidence only; do not claim live Cloudflare or Zephyr selection has been
203
136
  proven.
204
137
 
205
- ### Troubleshooting
138
+ ## Troubleshooting
206
139
 
207
140
  | Symptom | Current check | Owner |
208
141
  | --- | --- | --- |
209
142
  | 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 |
210
143
  | Install failure | Check the active Node/pnpm from `mise install`; rerun `pnpm install` after the shell sees the pinned versions. | Toolchain setup |
211
- | Build failure | Run `pnpm check` before `pnpm build`; fix reported format, lint, type, skill, i18n, or generated-contract failures first. | Owning package or generated contract |
144
+ | 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 |
212
145
  | Missing public URL | Set the env key from `.modernjs/ultramodern-generated-contract.json`, for example `ULTRAMODERN_PUBLIC_URL_SHELL_SUPER_APP`. | Deployment operator |
213
146
  | Cloudflare credentials | Confirm Wrangler credentials before `pnpm cloudflare:deploy`; local checks do not prove live Worker access. | Deployment operator |
214
147
  | 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 |
215
148
  | 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 |
216
149
 
217
- ### Local Monorepo Testing
218
-
219
- When testing unreleased Modern.js packages from a local monorepo checkout, use
220
- workspace protocol dependencies:
221
-
222
- ```bash
223
- pnpm dlx @bleedingdev/modern-js-create my-app --workspace
224
- ```
225
-
226
- For package-source validation of the full SuperApp workspace, generate with the
227
- workspace package source, then run the generated contract gate:
228
-
229
- ```bash
230
- pnpm dlx @bleedingdev/modern-js-create my-super-app --ultramodern-workspace --ultramodern-package-source workspace
231
- cd my-super-app
232
- pnpm install
233
- pnpm check
234
- ```
235
-
236
- ## Documentation
150
+ ## Modern.js Documentation
237
151
 
238
152
  - [English Documentation](https://modernjs.dev/en/)
239
153
  - [中文文档](https://modernjs.dev)
240
154
 
241
- ## Contributing
242
-
243
- Please read the [Contributing Guide](https://github.com/web-infra-dev/modern.js/blob/main/CONTRIBUTING.md).
244
-
245
155
  ## License
246
156
 
247
157
  Modern.js is [MIT licensed](https://github.com/web-infra-dev/modern.js/blob/main/LICENSE).
@@ -52,7 +52,7 @@ function resolveCreatePackageRoot(fromDir) {
52
52
  const seen = new Set();
53
53
  for (const candidate of candidates)if (!seen.has(candidate)) {
54
54
  seen.add(candidate);
55
- if (external_node_fs_default().existsSync(external_node_path_default().join(candidate, 'package.json')) && external_node_fs_default().existsSync(external_node_path_default().join(candidate, 'template'))) return candidate;
55
+ if (external_node_fs_default().existsSync(external_node_path_default().join(candidate, 'package.json')) && external_node_fs_default().existsSync(external_node_path_default().join(candidate, 'template-workspace'))) return candidate;
56
56
  }
57
57
  throw new Error('Unable to resolve create package root');
58
58
  }