@bleedingdev/modern-js-create 3.2.0-ultramodern.12 → 3.2.0-ultramodern.121

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 (165) hide show
  1. package/README.md +167 -72
  2. package/bin/run.js +0 -0
  3. package/dist/cjs/create-package-root.cjs +63 -0
  4. package/dist/cjs/index.cjs +528 -0
  5. package/dist/cjs/locale/en.cjs +93 -0
  6. package/dist/cjs/locale/index.cjs +50 -0
  7. package/dist/cjs/locale/zh.cjs +93 -0
  8. package/dist/cjs/ultramodern-package-source.cjs +135 -0
  9. package/dist/cjs/ultramodern-workspace/add-vertical.cjs +337 -0
  10. package/dist/cjs/ultramodern-workspace/app-files.cjs +223 -0
  11. package/dist/cjs/ultramodern-workspace/contracts.cjs +836 -0
  12. package/dist/cjs/ultramodern-workspace/demo-components.cjs +422 -0
  13. package/dist/cjs/ultramodern-workspace/descriptors.cjs +222 -0
  14. package/dist/cjs/ultramodern-workspace/effect-api.cjs +952 -0
  15. package/dist/cjs/ultramodern-workspace/fs-io.cjs +191 -0
  16. package/dist/cjs/ultramodern-workspace/index.cjs +48 -0
  17. package/dist/cjs/ultramodern-workspace/locales.cjs +173 -0
  18. package/dist/cjs/ultramodern-workspace/module-federation.cjs +487 -0
  19. package/dist/cjs/ultramodern-workspace/naming.cjs +161 -0
  20. package/dist/cjs/ultramodern-workspace/package-json.cjs +406 -0
  21. package/dist/cjs/ultramodern-workspace/package-source.cjs +59 -0
  22. package/dist/cjs/ultramodern-workspace/policy.cjs +248 -0
  23. package/dist/cjs/ultramodern-workspace/public-surface.cjs +268 -0
  24. package/dist/cjs/ultramodern-workspace/routes.cjs +375 -0
  25. package/dist/cjs/ultramodern-workspace/types.cjs +61 -0
  26. package/dist/cjs/ultramodern-workspace/versions.cjs +153 -0
  27. package/dist/cjs/ultramodern-workspace/workspace-scripts.cjs +153 -0
  28. package/dist/cjs/ultramodern-workspace/write-workspace.cjs +175 -0
  29. package/dist/esm/create-package-root.js +14 -0
  30. package/dist/esm/index.js +491 -0
  31. package/dist/esm/locale/en.js +55 -0
  32. package/dist/esm/locale/index.js +9 -0
  33. package/dist/esm/locale/zh.js +55 -0
  34. package/dist/esm/ultramodern-package-source.js +63 -0
  35. package/dist/esm/ultramodern-workspace/add-vertical.js +252 -0
  36. package/dist/esm/ultramodern-workspace/app-files.js +149 -0
  37. package/dist/esm/ultramodern-workspace/contracts.js +741 -0
  38. package/dist/esm/ultramodern-workspace/demo-components.js +363 -0
  39. package/dist/esm/ultramodern-workspace/descriptors.js +133 -0
  40. package/dist/esm/ultramodern-workspace/effect-api.js +854 -0
  41. package/dist/esm/ultramodern-workspace/fs-io.js +90 -0
  42. package/dist/esm/ultramodern-workspace/index.js +3 -0
  43. package/dist/esm/ultramodern-workspace/locales.js +122 -0
  44. package/dist/esm/ultramodern-workspace/module-federation.js +415 -0
  45. package/dist/esm/ultramodern-workspace/naming.js +71 -0
  46. package/dist/esm/ultramodern-workspace/package-json.js +338 -0
  47. package/dist/esm/ultramodern-workspace/package-source.js +21 -0
  48. package/dist/esm/ultramodern-workspace/policy.js +183 -0
  49. package/dist/esm/ultramodern-workspace/public-surface.js +183 -0
  50. package/dist/esm/ultramodern-workspace/routes.js +280 -0
  51. package/dist/esm/ultramodern-workspace/types.js +16 -0
  52. package/dist/esm/ultramodern-workspace/versions.js +34 -0
  53. package/dist/esm/ultramodern-workspace/workspace-scripts.js +91 -0
  54. package/dist/esm/ultramodern-workspace/write-workspace.js +121 -0
  55. package/dist/esm-node/create-package-root.js +15 -0
  56. package/dist/esm-node/index.js +492 -0
  57. package/dist/esm-node/locale/en.js +56 -0
  58. package/dist/esm-node/locale/index.js +10 -0
  59. package/dist/esm-node/locale/zh.js +56 -0
  60. package/dist/esm-node/ultramodern-package-source.js +64 -0
  61. package/dist/esm-node/ultramodern-workspace/add-vertical.js +253 -0
  62. package/dist/esm-node/ultramodern-workspace/app-files.js +150 -0
  63. package/dist/esm-node/ultramodern-workspace/contracts.js +742 -0
  64. package/dist/esm-node/ultramodern-workspace/demo-components.js +364 -0
  65. package/dist/esm-node/ultramodern-workspace/descriptors.js +134 -0
  66. package/dist/esm-node/ultramodern-workspace/effect-api.js +855 -0
  67. package/dist/esm-node/ultramodern-workspace/fs-io.js +91 -0
  68. package/dist/esm-node/ultramodern-workspace/index.js +4 -0
  69. package/dist/esm-node/ultramodern-workspace/locales.js +123 -0
  70. package/dist/esm-node/ultramodern-workspace/module-federation.js +416 -0
  71. package/dist/esm-node/ultramodern-workspace/naming.js +72 -0
  72. package/dist/esm-node/ultramodern-workspace/package-json.js +339 -0
  73. package/dist/esm-node/ultramodern-workspace/package-source.js +22 -0
  74. package/dist/esm-node/ultramodern-workspace/policy.js +184 -0
  75. package/dist/esm-node/ultramodern-workspace/public-surface.js +184 -0
  76. package/dist/esm-node/ultramodern-workspace/routes.js +281 -0
  77. package/dist/esm-node/ultramodern-workspace/types.js +17 -0
  78. package/dist/esm-node/ultramodern-workspace/versions.js +35 -0
  79. package/dist/esm-node/ultramodern-workspace/workspace-scripts.js +92 -0
  80. package/dist/esm-node/ultramodern-workspace/write-workspace.js +122 -0
  81. package/dist/types/create-package-root.d.ts +1 -0
  82. package/dist/types/locale/en.d.ts +8 -9
  83. package/dist/types/locale/index.d.ts +109 -2
  84. package/dist/types/locale/zh.d.ts +8 -9
  85. package/dist/types/ultramodern-package-source.d.ts +28 -0
  86. package/dist/types/ultramodern-workspace/add-vertical.d.ts +19 -0
  87. package/dist/types/ultramodern-workspace/app-files.d.ts +14 -0
  88. package/dist/types/ultramodern-workspace/contracts.d.ts +21 -0
  89. package/dist/types/ultramodern-workspace/demo-components.d.ts +9 -0
  90. package/dist/types/ultramodern-workspace/descriptors.d.ts +39 -0
  91. package/dist/types/ultramodern-workspace/effect-api.d.ts +73 -0
  92. package/dist/types/ultramodern-workspace/fs-io.d.ts +18 -0
  93. package/dist/types/ultramodern-workspace/index.d.ts +4 -0
  94. package/dist/types/ultramodern-workspace/locales.d.ts +183 -0
  95. package/dist/types/ultramodern-workspace/module-federation.d.ts +16 -0
  96. package/dist/types/ultramodern-workspace/naming.d.ts +16 -0
  97. package/dist/types/ultramodern-workspace/package-json.d.ts +12 -0
  98. package/dist/types/ultramodern-workspace/package-source.d.ts +2 -0
  99. package/dist/types/ultramodern-workspace/policy.d.ts +60 -0
  100. package/dist/types/ultramodern-workspace/public-surface.d.ts +37 -0
  101. package/dist/types/ultramodern-workspace/routes.d.ts +25 -0
  102. package/dist/types/ultramodern-workspace/types.d.ts +95 -0
  103. package/dist/types/ultramodern-workspace/versions.d.ts +38 -0
  104. package/dist/types/ultramodern-workspace/workspace-scripts.d.ts +10 -0
  105. package/dist/types/ultramodern-workspace/write-workspace.d.ts +4 -0
  106. package/package.json +34 -15
  107. package/template-workspace/.agents/agent-reference-repos.json +24 -0
  108. package/template-workspace/.agents/skills-lock.json +19 -0
  109. package/template-workspace/.codex/hooks.json +16 -0
  110. package/template-workspace/.github/renovate.json +29 -0
  111. package/template-workspace/.github/workflows/ultramodern-workspace-gates.yml.handlebars +67 -0
  112. package/template-workspace/.gitignore.handlebars +5 -0
  113. package/template-workspace/.mise.toml.handlebars +3 -0
  114. package/template-workspace/AGENTS.md.handlebars +87 -0
  115. package/template-workspace/README.md.handlebars +132 -11
  116. package/template-workspace/lefthook.yml +24 -0
  117. package/template-workspace/oxfmt.config.ts +1 -0
  118. package/template-workspace/oxlint.config.ts +1 -0
  119. package/template-workspace/pnpm-workspace.yaml.handlebars +40 -0
  120. package/template-workspace/scripts/bootstrap-agent-skills.mjs +184 -21
  121. package/template-workspace/scripts/setup-agent-reference-repos.mjs +370 -0
  122. package/templates/app/shell-frame.tsx +49 -0
  123. package/templates/app/ultramodern-route-head.tsx.handlebars +142 -0
  124. package/templates/packages/shared-contracts-index.ts +466 -0
  125. package/templates/workspace-scripts/assert-mf-types.mjs.handlebars +69 -0
  126. package/templates/workspace-scripts/check-ultramodern-i18n-boundaries.mjs +9 -0
  127. package/templates/workspace-scripts/generate-public-surface-assets.mjs +529 -0
  128. package/templates/workspace-scripts/proof-cloudflare-version.mjs +125 -0
  129. package/templates/workspace-scripts/ultramodern-cloudflare-proof.mjs +851 -0
  130. package/templates/workspace-scripts/ultramodern-performance-readiness.config.mjs +7 -0
  131. package/templates/workspace-scripts/ultramodern-performance-readiness.mjs +223 -0
  132. package/templates/workspace-scripts/validate-ultramodern-workspace.mjs.handlebars +593 -0
  133. package/dist/index.js +0 -2626
  134. package/dist/types/ultramodern-workspace.d.ts +0 -20
  135. package/template/.agents/skills-lock.json +0 -34
  136. package/template/.browserslistrc +0 -4
  137. package/template/.github/workflows/ultramodern-gates.yml.handlebars +0 -30
  138. package/template/.gitignore.handlebars +0 -30
  139. package/template/.nvmrc +0 -2
  140. package/template/AGENTS.md +0 -25
  141. package/template/README.md +0 -79
  142. package/template/api/effect/index.ts.handlebars +0 -23
  143. package/template/api/lambda/hello.ts.handlebars +0 -6
  144. package/template/config/public/locales/cs/translation.json +0 -39
  145. package/template/config/public/locales/en/translation.json +0 -39
  146. package/template/modern.config.ts.handlebars +0 -53
  147. package/template/oxfmt.config.ts +0 -8
  148. package/template/oxlint.config.ts +0 -12
  149. package/template/package.json.handlebars +0 -67
  150. package/template/postcss.config.mjs.handlebars +0 -6
  151. package/template/scripts/bootstrap-agent-skills.mjs +0 -95
  152. package/template/scripts/check-i18n-strings.mjs +0 -83
  153. package/template/scripts/validate-ultramodern.mjs.handlebars +0 -178
  154. package/template/shared/effect/api.ts.handlebars +0 -17
  155. package/template/src/modern-app-env.d.ts +0 -1
  156. package/template/src/modern.runtime.ts.handlebars +0 -23
  157. package/template/src/routes/index.css.handlebars +0 -129
  158. package/template/src/routes/layout.tsx.handlebars +0 -9
  159. package/template/src/routes/page.tsx.handlebars +0 -155
  160. package/template/tailwind.config.ts.handlebars +0 -10
  161. package/template/tsconfig.json +0 -120
  162. package/template-workspace/AGENTS.md +0 -50
  163. package/template-workspace/pnpm-workspace.yaml +0 -17
  164. package/template-workspace/scripts/check-i18n-strings.mjs +0 -83
  165. package/template-workspace/scripts/validate-ultramodern-workspace.mjs.handlebars +0 -433
@@ -0,0 +1,153 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, getters, values)=>{
5
+ var define = (defs, kind)=>{
6
+ for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
7
+ enumerable: true,
8
+ [kind]: defs[key]
9
+ });
10
+ };
11
+ define(getters, "get");
12
+ define(values, "value");
13
+ };
14
+ })();
15
+ (()=>{
16
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
17
+ })();
18
+ (()=>{
19
+ __webpack_require__.r = (exports1)=>{
20
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
21
+ value: 'Module'
22
+ });
23
+ Object.defineProperty(exports1, '__esModule', {
24
+ value: true
25
+ });
26
+ };
27
+ })();
28
+ var __webpack_exports__ = {};
29
+ __webpack_require__.r(__webpack_exports__);
30
+ __webpack_require__.d(__webpack_exports__, {
31
+ createAssertMfTypesScript: ()=>createAssertMfTypesScript,
32
+ createCloudflareProofHelperScript: ()=>createCloudflareProofHelperScript,
33
+ createCloudflareVersionProofScript: ()=>createCloudflareVersionProofScript,
34
+ createPerformanceReadinessConfigScript: ()=>createPerformanceReadinessConfigScript,
35
+ createPerformanceReadinessScript: ()=>createPerformanceReadinessScript,
36
+ createPublicSurfaceAssetsScript: ()=>createPublicSurfaceAssetsScript,
37
+ createWorkspaceI18nBoundaryValidationScript: ()=>createWorkspaceI18nBoundaryValidationScript,
38
+ createWorkspaceValidationScript: ()=>createWorkspaceValidationScript,
39
+ writeGeneratedWorkspaceScripts: ()=>writeGeneratedWorkspaceScripts
40
+ });
41
+ const external_demo_components_cjs_namespaceObject = require("./demo-components.cjs");
42
+ const external_descriptors_cjs_namespaceObject = require("./descriptors.cjs");
43
+ const external_effect_api_cjs_namespaceObject = require("./effect-api.cjs");
44
+ const external_fs_io_cjs_namespaceObject = require("./fs-io.cjs");
45
+ const external_naming_cjs_namespaceObject = require("./naming.cjs");
46
+ const external_policy_cjs_namespaceObject = require("./policy.cjs");
47
+ const external_public_surface_cjs_namespaceObject = require("./public-surface.cjs");
48
+ const external_routes_cjs_namespaceObject = require("./routes.cjs");
49
+ const external_versions_cjs_namespaceObject = require("./versions.cjs");
50
+ function createAssertMfTypesScript(remotes = []) {
51
+ return (0, external_fs_io_cjs_namespaceObject.renderFileTemplate)("workspace-scripts/assert-mf-types.mjs", {
52
+ defaultAppDirsJson: JSON.stringify(remotes.map((remote)=>remote.directory), null, 2)
53
+ });
54
+ }
55
+ function createWorkspaceValidationScript(scope, enableTailwind, remotes = []) {
56
+ const verticals = remotes.filter(external_descriptors_cjs_namespaceObject.appHasEffectApi).map((remote)=>({
57
+ id: remote.id,
58
+ domain: remote.domain,
59
+ stem: remote.effectApi.stem,
60
+ group: (0, external_effect_api_cjs_namespaceObject.verticalEffectGroupName)(remote),
61
+ path: remote.directory,
62
+ mfName: remote.mfName,
63
+ apiPrefix: remote.effectApi.prefix,
64
+ tailwindPrefix: (0, external_naming_cjs_namespaceObject.tailwindPrefixForApp)(remote),
65
+ zephyrAlias: (0, external_descriptors_cjs_namespaceObject.remoteDependencyAlias)(remote),
66
+ packageName: (0, external_naming_cjs_namespaceObject.packageName)(scope, remote.packageSuffix),
67
+ exposes: Object.keys(remote.exposes ?? {}),
68
+ componentPaths: Object.keys(remote.exposes ?? {}).map((expose)=>(0, external_demo_components_cjs_namespaceObject.remoteComponentOutputPath)(remote, expose)).filter((componentPath)=>Boolean(componentPath)),
69
+ namespace: (0, external_descriptors_cjs_namespaceObject.appI18nNamespace)(remote),
70
+ routePagePaths: (0, external_routes_cjs_namespaceObject.createRouteOwnedI18nPaths)(remote).filter((route)=>'/' !== route.canonicalPath).map((route)=>(0, external_routes_cjs_namespaceObject.createRoutePageFilePath)(remote, route.canonicalPath)),
71
+ routeMetaPaths: (0, external_routes_cjs_namespaceObject.createRouteOwnedI18nPaths)(remote).map((route)=>(0, external_routes_cjs_namespaceObject.createRouteMetaFilePath)(remote, route.canonicalPath)),
72
+ localisedUrls: (0, external_routes_cjs_namespaceObject.createLocalisedUrlsMap)(remote),
73
+ verticalRefs: remote.verticalRefs ?? []
74
+ }));
75
+ const shellRouteMetaPaths = (0, external_routes_cjs_namespaceObject.createRouteOwnedI18nPaths)(external_descriptors_cjs_namespaceObject.shellApp).map((route)=>(0, external_routes_cjs_namespaceObject.createRouteMetaFilePath)(external_descriptors_cjs_namespaceObject.shellApp, route.canonicalPath));
76
+ const shellNamespace = (0, external_descriptors_cjs_namespaceObject.appI18nNamespace)(external_descriptors_cjs_namespaceObject.shellApp);
77
+ const oldRemotePaths = [
78
+ 'apps/remotes'
79
+ ];
80
+ const expectedBuildScript = remotes.length > 0 ? 'ULTRAMODERN_ZEPHYR=false pnpm -r --filter "./verticals/*" run build && ULTRAMODERN_ZEPHYR=false pnpm --filter "./apps/shell-super-app" run build && pnpm mf:types && pnpm performance:readiness' : 'ULTRAMODERN_ZEPHYR=false pnpm --filter "./apps/shell-super-app" run build && pnpm mf:types && pnpm performance:readiness';
81
+ const expectedCloudflareBuildScript = remotes.length > 0 ? 'pnpm -r --filter "./verticals/*" run cloudflare:build && pnpm --filter "./apps/shell-super-app" run cloudflare:build && pnpm mf:types' : 'pnpm --filter "./apps/shell-super-app" run cloudflare:build && pnpm mf:types';
82
+ const expectedCloudflareDeployScript = remotes.length > 0 ? 'pnpm -r --filter "./verticals/*" run cloudflare:deploy && pnpm --filter "./apps/shell-super-app" run cloudflare:deploy' : 'pnpm --filter "./apps/shell-super-app" run cloudflare:deploy';
83
+ const expectedCloudflareSecurity = (0, external_policy_cjs_namespaceObject.createCloudflareSecurityContract)();
84
+ return (0, external_fs_io_cjs_namespaceObject.renderFileTemplate)("workspace-scripts/validate-ultramodern-workspace.mjs", {
85
+ packageScope: scope,
86
+ nodeVersion: external_versions_cjs_namespaceObject.NODE_VERSION,
87
+ pnpmVersion: external_versions_cjs_namespaceObject.PNPM_VERSION,
88
+ tailwindEnabledJson: JSON.stringify(enableTailwind),
89
+ fullStackVerticalsJson: JSON.stringify(verticals, null, 2),
90
+ shellNamespaceJson: JSON.stringify(shellNamespace),
91
+ oldRemotePathsJson: JSON.stringify(oldRemotePaths, null, 2),
92
+ expectedBuildScriptJson: JSON.stringify(expectedBuildScript),
93
+ expectedCloudflareBuildScriptJson: JSON.stringify(expectedCloudflareBuildScript),
94
+ expectedCloudflareDeployScriptJson: JSON.stringify(expectedCloudflareDeployScript),
95
+ expectedCloudflareSecurityJson: JSON.stringify(expectedCloudflareSecurity, null, 2),
96
+ publicSurfaceManagedSourceAssetPathsJson: JSON.stringify([
97
+ ...external_public_surface_cjs_namespaceObject.publicSurfaceManagedSourceAssetPaths
98
+ ], null, 2),
99
+ shellRouteMetaPathsJson: JSON.stringify(shellRouteMetaPaths, null, 2),
100
+ cloudflareCompatibilityDate: external_versions_cjs_namespaceObject.CLOUDFLARE_COMPATIBILITY_DATE
101
+ });
102
+ }
103
+ function createWorkspaceI18nBoundaryValidationScript() {
104
+ return (0, external_fs_io_cjs_namespaceObject.readFileTemplate)("workspace-scripts/check-ultramodern-i18n-boundaries.mjs");
105
+ }
106
+ function createPublicSurfaceAssetsScript() {
107
+ return (0, external_fs_io_cjs_namespaceObject.readFileTemplate)("workspace-scripts/generate-public-surface-assets.mjs");
108
+ }
109
+ function createCloudflareProofHelperScript() {
110
+ return (0, external_fs_io_cjs_namespaceObject.readFileTemplate)("workspace-scripts/ultramodern-cloudflare-proof.mjs");
111
+ }
112
+ function createCloudflareVersionProofScript() {
113
+ return (0, external_fs_io_cjs_namespaceObject.readFileTemplate)("workspace-scripts/proof-cloudflare-version.mjs");
114
+ }
115
+ function createPerformanceReadinessConfigScript() {
116
+ return (0, external_fs_io_cjs_namespaceObject.readFileTemplate)("workspace-scripts/ultramodern-performance-readiness.config.mjs");
117
+ }
118
+ function createPerformanceReadinessScript() {
119
+ return (0, external_fs_io_cjs_namespaceObject.readFileTemplate)("workspace-scripts/ultramodern-performance-readiness.mjs");
120
+ }
121
+ function writeGeneratedWorkspaceScripts(targetDir, scope, enableTailwind, remotes = []) {
122
+ (0, external_fs_io_cjs_namespaceObject.writeFileReplacing)(targetDir, "scripts/assert-mf-types.mjs", createAssertMfTypesScript(remotes));
123
+ (0, external_fs_io_cjs_namespaceObject.writeFileReplacing)(targetDir, "scripts/validate-ultramodern-workspace.mjs", createWorkspaceValidationScript(scope, enableTailwind, remotes));
124
+ (0, external_fs_io_cjs_namespaceObject.writeFileReplacing)(targetDir, "scripts/check-ultramodern-i18n-boundaries.mjs", createWorkspaceI18nBoundaryValidationScript());
125
+ (0, external_fs_io_cjs_namespaceObject.writeFileReplacing)(targetDir, "scripts/generate-public-surface-assets.mjs", createPublicSurfaceAssetsScript());
126
+ (0, external_fs_io_cjs_namespaceObject.writeFileReplacing)(targetDir, "scripts/ultramodern-cloudflare-proof.mjs", createCloudflareProofHelperScript());
127
+ (0, external_fs_io_cjs_namespaceObject.writeFileReplacing)(targetDir, "scripts/proof-cloudflare-version.mjs", createCloudflareVersionProofScript());
128
+ (0, external_fs_io_cjs_namespaceObject.writeFileReplacing)(targetDir, "scripts/ultramodern-performance-readiness.config.mjs", createPerformanceReadinessConfigScript());
129
+ (0, external_fs_io_cjs_namespaceObject.writeFileReplacing)(targetDir, "scripts/ultramodern-performance-readiness.mjs", createPerformanceReadinessScript());
130
+ }
131
+ exports.createAssertMfTypesScript = __webpack_exports__.createAssertMfTypesScript;
132
+ exports.createCloudflareProofHelperScript = __webpack_exports__.createCloudflareProofHelperScript;
133
+ exports.createCloudflareVersionProofScript = __webpack_exports__.createCloudflareVersionProofScript;
134
+ exports.createPerformanceReadinessConfigScript = __webpack_exports__.createPerformanceReadinessConfigScript;
135
+ exports.createPerformanceReadinessScript = __webpack_exports__.createPerformanceReadinessScript;
136
+ exports.createPublicSurfaceAssetsScript = __webpack_exports__.createPublicSurfaceAssetsScript;
137
+ exports.createWorkspaceI18nBoundaryValidationScript = __webpack_exports__.createWorkspaceI18nBoundaryValidationScript;
138
+ exports.createWorkspaceValidationScript = __webpack_exports__.createWorkspaceValidationScript;
139
+ exports.writeGeneratedWorkspaceScripts = __webpack_exports__.writeGeneratedWorkspaceScripts;
140
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
141
+ "createAssertMfTypesScript",
142
+ "createCloudflareProofHelperScript",
143
+ "createCloudflareVersionProofScript",
144
+ "createPerformanceReadinessConfigScript",
145
+ "createPerformanceReadinessScript",
146
+ "createPublicSurfaceAssetsScript",
147
+ "createWorkspaceI18nBoundaryValidationScript",
148
+ "createWorkspaceValidationScript",
149
+ "writeGeneratedWorkspaceScripts"
150
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
151
+ Object.defineProperty(exports, '__esModule', {
152
+ value: true
153
+ });
@@ -0,0 +1,175 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.n = (module)=>{
5
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
+ __webpack_require__.d(getter, {
7
+ a: getter
8
+ });
9
+ return getter;
10
+ };
11
+ })();
12
+ (()=>{
13
+ __webpack_require__.d = (exports1, getters, values)=>{
14
+ var define = (defs, kind)=>{
15
+ for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
16
+ enumerable: true,
17
+ [kind]: defs[key]
18
+ });
19
+ };
20
+ define(getters, "get");
21
+ define(values, "value");
22
+ };
23
+ })();
24
+ (()=>{
25
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
26
+ })();
27
+ (()=>{
28
+ __webpack_require__.r = (exports1)=>{
29
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
30
+ value: 'Module'
31
+ });
32
+ Object.defineProperty(exports1, '__esModule', {
33
+ value: true
34
+ });
35
+ };
36
+ })();
37
+ var __webpack_exports__ = {};
38
+ __webpack_require__.r(__webpack_exports__);
39
+ __webpack_require__.d(__webpack_exports__, {
40
+ generateUltramodernWorkspace: ()=>generateUltramodernWorkspace,
41
+ writeApp: ()=>writeApp,
42
+ writeSharedPackages: ()=>writeSharedPackages
43
+ });
44
+ const external_node_fs_namespaceObject = require("node:fs");
45
+ var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
46
+ const external_app_files_cjs_namespaceObject = require("./app-files.cjs");
47
+ const external_contracts_cjs_namespaceObject = require("./contracts.cjs");
48
+ const external_demo_components_cjs_namespaceObject = require("./demo-components.cjs");
49
+ const external_descriptors_cjs_namespaceObject = require("./descriptors.cjs");
50
+ const external_effect_api_cjs_namespaceObject = require("./effect-api.cjs");
51
+ const external_fs_io_cjs_namespaceObject = require("./fs-io.cjs");
52
+ const external_locales_cjs_namespaceObject = require("./locales.cjs");
53
+ const external_module_federation_cjs_namespaceObject = require("./module-federation.cjs");
54
+ const external_naming_cjs_namespaceObject = require("./naming.cjs");
55
+ const external_package_json_cjs_namespaceObject = require("./package-json.cjs");
56
+ const external_package_source_cjs_namespaceObject = require("./package-source.cjs");
57
+ const external_public_surface_cjs_namespaceObject = require("./public-surface.cjs");
58
+ const external_versions_cjs_namespaceObject = require("./versions.cjs");
59
+ const external_workspace_scripts_cjs_namespaceObject = require("./workspace-scripts.cjs");
60
+ function writeApp(targetDir, scope, app, packageSource, enableTailwind, remotes = []) {
61
+ const resolvedApp = 'shell' === app.kind ? (0, external_descriptors_cjs_namespaceObject.createShellHost)(remotes) : app;
62
+ const publicWeb = (0, external_public_surface_cjs_namespaceObject.createPublicWebAppArtifacts)(resolvedApp);
63
+ const writeAppFile = (relativePath, content)=>{
64
+ (0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, `${resolvedApp.directory}/${relativePath}`, content);
65
+ };
66
+ (0, external_fs_io_cjs_namespaceObject.writeJson)(targetDir, `${resolvedApp.directory}/package.json`, (0, external_package_json_cjs_namespaceObject.createAppPackage)(scope, resolvedApp, packageSource, enableTailwind, remotes));
67
+ (0, external_fs_io_cjs_namespaceObject.writeJson)(targetDir, `${resolvedApp.directory}/tsconfig.json`, (0, external_package_json_cjs_namespaceObject.createPackageTsConfig)(resolvedApp.directory, (0, external_descriptors_cjs_namespaceObject.appHasEffectApi)(resolvedApp)));
68
+ (0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, `${resolvedApp.directory}/src/modern-app-env.d.ts`, (0, external_app_files_cjs_namespaceObject.createAppEnvDts)(resolvedApp, remotes));
69
+ (0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, `${resolvedApp.directory}/src/ultramodern-build.ts`, (0, external_module_federation_cjs_namespaceObject.createUltramodernBuildModule)(scope, resolvedApp));
70
+ (0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, publicWeb.jsonLdHelperFile.path, publicWeb.jsonLdHelperFile.content);
71
+ (0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, publicWeb.routeMetadataFile.path, publicWeb.routeMetadataFile.content);
72
+ (0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, publicWeb.routeHeadFile.path, publicWeb.routeHeadFile.content);
73
+ (0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, `${resolvedApp.directory}/modern.config.ts`, (0, external_module_federation_cjs_namespaceObject.createAppModernConfig)(scope, resolvedApp));
74
+ (0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, `${resolvedApp.directory}/src/modern.runtime.ts`, (0, external_app_files_cjs_namespaceObject.createAppRuntimeConfig)(resolvedApp, scope, remotes));
75
+ (0, external_fs_io_cjs_namespaceObject.writeJson)(targetDir, `${resolvedApp.directory}/locales/en/translation.json`, (0, external_locales_cjs_namespaceObject.createAppPublicLocaleMessages)(resolvedApp, 'en', remotes));
76
+ (0, external_fs_io_cjs_namespaceObject.writeJson)(targetDir, `${resolvedApp.directory}/locales/en/${(0, external_descriptors_cjs_namespaceObject.appI18nNamespace)(resolvedApp)}.json`, (0, external_locales_cjs_namespaceObject.createAppPublicLocaleMessages)(resolvedApp, 'en', remotes));
77
+ (0, external_fs_io_cjs_namespaceObject.writeJson)(targetDir, `${resolvedApp.directory}/locales/cs/translation.json`, (0, external_locales_cjs_namespaceObject.createAppPublicLocaleMessages)(resolvedApp, 'cs', remotes));
78
+ (0, external_fs_io_cjs_namespaceObject.writeJson)(targetDir, `${resolvedApp.directory}/locales/cs/${(0, external_descriptors_cjs_namespaceObject.appI18nNamespace)(resolvedApp)}.json`, (0, external_locales_cjs_namespaceObject.createAppPublicLocaleMessages)(resolvedApp, 'cs', remotes));
79
+ (0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, `${resolvedApp.directory}/src/routes/index.css`, (0, external_app_files_cjs_namespaceObject.createAppStyles)(enableTailwind, scope, resolvedApp));
80
+ if (enableTailwind) {
81
+ (0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, `${resolvedApp.directory}/postcss.config.mjs`, (0, external_app_files_cjs_namespaceObject.createPostcssConfig)());
82
+ (0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, `${resolvedApp.directory}/tailwind.config.ts`, (0, external_app_files_cjs_namespaceObject.createTailwindConfig)());
83
+ }
84
+ (0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, `${resolvedApp.directory}/module-federation.config.ts`, 'shell' === resolvedApp.kind ? (0, external_module_federation_cjs_namespaceObject.createShellModuleFederationConfig)(scope, remotes) : (0, external_module_federation_cjs_namespaceObject.createRemoteModuleFederationConfig)(scope, resolvedApp, remotes));
85
+ writeAppFile('src/routes/layout.tsx', (0, external_demo_components_cjs_namespaceObject.createLayout)(resolvedApp.id));
86
+ writeAppFile('src/routes/[lang]/page.tsx', 'shell' === resolvedApp.kind ? (0, external_demo_components_cjs_namespaceObject.createShellPage)(remotes) : (0, external_demo_components_cjs_namespaceObject.createRemotePage)(resolvedApp));
87
+ for (const generatedFile of publicWeb.routeMetaFiles)(0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, generatedFile.path, generatedFile.content);
88
+ for (const generatedFile of publicWeb.routeAliasFiles)(0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, generatedFile.path, generatedFile.content);
89
+ if ('shell' === resolvedApp.kind) {
90
+ writeAppFile('src/routes/vertical-components.tsx', (0, external_demo_components_cjs_namespaceObject.createShellRemoteComponents)(scope, remotes));
91
+ writeAppFile('src/routes/shell-frame.tsx', (0, external_app_files_cjs_namespaceObject.createShellFrameComponent)());
92
+ (0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, `${resolvedApp.directory}/src/effect/vertical-clients.ts`, (0, external_effect_api_cjs_namespaceObject.createShellEffectClient)(scope, remotes));
93
+ }
94
+ if ((0, external_descriptors_cjs_namespaceObject.appHasEffectApi)(resolvedApp)) {
95
+ (0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, `${resolvedApp.directory}/shared/effect/api.ts`, (0, external_effect_api_cjs_namespaceObject.createEffectSharedApi)(resolvedApp));
96
+ (0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, `${resolvedApp.directory}/api/effect/index.ts`, (0, external_effect_api_cjs_namespaceObject.createEffectServiceEntry)(resolvedApp, '../../shared/effect/api.ts'));
97
+ (0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, `${resolvedApp.directory}/src/effect/${resolvedApp.effectApi.stem}-client.ts`, (0, external_effect_api_cjs_namespaceObject.createEffectClient)(resolvedApp, '../../shared/effect/api'));
98
+ }
99
+ if ('vertical' === resolvedApp.kind) {
100
+ writeAppFile('src/federation-entry.tsx', (0, external_demo_components_cjs_namespaceObject.createRemoteEntry)(resolvedApp));
101
+ for (const expose of Object.keys(resolvedApp.exposes ?? {})){
102
+ const outputPath = (0, external_demo_components_cjs_namespaceObject.remoteComponentOutputPath)(resolvedApp, expose);
103
+ if (outputPath) writeAppFile(outputPath.slice(resolvedApp.directory.length + 1), (0, external_demo_components_cjs_namespaceObject.createRemoteExposeComponent)(resolvedApp, expose));
104
+ }
105
+ }
106
+ }
107
+ function writeSharedPackages(targetDir, scope) {
108
+ for (const sharedPackage of external_descriptors_cjs_namespaceObject.sharedPackages){
109
+ (0, external_fs_io_cjs_namespaceObject.writeJson)(targetDir, `${sharedPackage.directory}/package.json`, (0, external_package_json_cjs_namespaceObject.createSharedPackage)(scope, sharedPackage.id, sharedPackage.description));
110
+ (0, external_fs_io_cjs_namespaceObject.writeJson)(targetDir, `${sharedPackage.directory}/tsconfig.json`, {
111
+ extends: `${(0, external_naming_cjs_namespaceObject.relativeRootFor)(sharedPackage.directory)}/tsconfig.base.json`,
112
+ include: [
113
+ 'src'
114
+ ]
115
+ });
116
+ }
117
+ (0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, 'packages/shared-contracts/src/index.ts', (0, external_package_json_cjs_namespaceObject.createSharedContractsIndex)());
118
+ (0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, 'packages/shared-design-tokens/src/index.ts', `export const sharedDesignTokens = {
119
+ color: {
120
+ accent: '#2f8f68',
121
+ foreground: '#133225',
122
+ surface: '#f6fbf7',
123
+ },
124
+ } as const;
125
+ `);
126
+ (0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, 'packages/shared-design-tokens/src/tokens.css', (0, external_app_files_cjs_namespaceObject.createSharedDesignTokensCss)());
127
+ }
128
+ function generateUltramodernWorkspace(options) {
129
+ const scope = (0, external_naming_cjs_namespaceObject.toPackageScope)(options.packageName);
130
+ const packageSource = (0, external_package_source_cjs_namespaceObject.resolvePackageSource)(options);
131
+ const enableTailwind = false !== options.enableTailwind;
132
+ const initialVerticals = [];
133
+ (0, external_naming_cjs_namespaceObject.assertUniqueTailwindPrefixes)([
134
+ external_descriptors_cjs_namespaceObject.shellApp,
135
+ ...initialVerticals
136
+ ]);
137
+ external_node_fs_default().mkdirSync(options.targetDir, {
138
+ recursive: true
139
+ });
140
+ (0, external_fs_io_cjs_namespaceObject.copyRootTemplate)(options.targetDir, {
141
+ packageName: options.packageName,
142
+ packageScope: scope,
143
+ nodeVersion: external_versions_cjs_namespaceObject.NODE_VERSION,
144
+ pnpmVersion: external_versions_cjs_namespaceObject.PNPM_VERSION,
145
+ nodeFetchVersion: external_versions_cjs_namespaceObject.NODE_FETCH_VERSION,
146
+ tanstackRouterVersion: external_versions_cjs_namespaceObject.TANSTACK_ROUTER_VERSION,
147
+ tailwindEnabled: String(enableTailwind)
148
+ });
149
+ (0, external_fs_io_cjs_namespaceObject.writeJson)(options.targetDir, 'package.json', (0, external_package_json_cjs_namespaceObject.createRootPackageJson)(scope, packageSource, initialVerticals));
150
+ (0, external_fs_io_cjs_namespaceObject.writeJson)(options.targetDir, 'tsconfig.base.json', (0, external_package_json_cjs_namespaceObject.createTsConfigBase)());
151
+ (0, external_fs_io_cjs_namespaceObject.writeJson)(options.targetDir, 'topology/reference-topology.json', (0, external_contracts_cjs_namespaceObject.createTopology)(scope, initialVerticals));
152
+ (0, external_fs_io_cjs_namespaceObject.writeJson)(options.targetDir, 'topology/ownership.json', (0, external_contracts_cjs_namespaceObject.createOwnership)(scope, initialVerticals));
153
+ (0, external_fs_io_cjs_namespaceObject.writeJson)(options.targetDir, 'topology/local-overlays/development.json', (0, external_contracts_cjs_namespaceObject.createDevelopmentOverlay)(initialVerticals));
154
+ (0, external_fs_io_cjs_namespaceObject.writeJson)(options.targetDir, '.modernjs/ultramodern-workspace-template-manifest.json', (0, external_contracts_cjs_namespaceObject.createTemplateManifest)(options.modernVersion, packageSource));
155
+ (0, external_fs_io_cjs_namespaceObject.writeJson)(options.targetDir, '.modernjs/ultramodern-package-source.json', (0, external_contracts_cjs_namespaceObject.createPackageSourceMetadata)(scope, packageSource));
156
+ (0, external_fs_io_cjs_namespaceObject.writeJson)(options.targetDir, external_descriptors_cjs_namespaceObject.GENERATED_CONTRACT_PATH, (0, external_contracts_cjs_namespaceObject.createGeneratedContract)(scope, [
157
+ (0, external_descriptors_cjs_namespaceObject.createShellHost)(initialVerticals),
158
+ ...initialVerticals
159
+ ], enableTailwind));
160
+ writeApp(options.targetDir, scope, external_descriptors_cjs_namespaceObject.shellApp, packageSource, enableTailwind, initialVerticals);
161
+ for (const remote of initialVerticals)writeApp(options.targetDir, scope, remote, packageSource, enableTailwind, initialVerticals);
162
+ writeSharedPackages(options.targetDir, scope);
163
+ (0, external_workspace_scripts_cjs_namespaceObject.writeGeneratedWorkspaceScripts)(options.targetDir, scope, enableTailwind, initialVerticals);
164
+ }
165
+ exports.generateUltramodernWorkspace = __webpack_exports__.generateUltramodernWorkspace;
166
+ exports.writeApp = __webpack_exports__.writeApp;
167
+ exports.writeSharedPackages = __webpack_exports__.writeSharedPackages;
168
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
169
+ "generateUltramodernWorkspace",
170
+ "writeApp",
171
+ "writeSharedPackages"
172
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
173
+ Object.defineProperty(exports, '__esModule', {
174
+ value: true
175
+ });
@@ -0,0 +1,14 @@
1
+ import node_fs from "node:fs";
2
+ import node_path from "node:path";
3
+ const MAX_WALK_UP_LEVELS = 5;
4
+ function resolveCreatePackageRoot(fromDir) {
5
+ let candidate = fromDir;
6
+ for(let level = 0; level <= MAX_WALK_UP_LEVELS; level++){
7
+ if (node_fs.existsSync(node_path.join(candidate, 'package.json')) && node_fs.existsSync(node_path.join(candidate, 'template-workspace'))) return candidate;
8
+ const parent = node_path.dirname(candidate);
9
+ if (parent === candidate) break;
10
+ candidate = parent;
11
+ }
12
+ throw new Error(`Unable to resolve the @modern-js/create package root (a directory containing both package.json and template-workspace/) within ${MAX_WALK_UP_LEVELS} levels above ${fromDir}`);
13
+ }
14
+ export { resolveCreatePackageRoot };