@bleedingdev/modern-js-create 3.5.0-ultramodern.3 → 3.5.0-ultramodern.30
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 +21 -17
- package/dist/cjs/ultramodern-tooling/commands.cjs +772 -75
- package/dist/cjs/ultramodern-tooling/config.cjs +149 -8
- package/dist/cjs/ultramodern-workspace/add-vertical.cjs +25 -0
- package/dist/cjs/ultramodern-workspace/api.cjs +44 -0
- package/dist/cjs/ultramodern-workspace/app-files.cjs +8 -11
- package/dist/cjs/ultramodern-workspace/backend-federation.cjs +282 -0
- package/dist/cjs/ultramodern-workspace/contracts.cjs +24 -8
- package/dist/cjs/ultramodern-workspace/delivery-unit-sync.cjs +157 -0
- package/dist/cjs/ultramodern-workspace/delivery-unit.cjs +88 -0
- package/dist/cjs/ultramodern-workspace/descriptors.cjs +24 -0
- package/dist/cjs/ultramodern-workspace/module-federation.cjs +161 -50
- package/dist/cjs/ultramodern-workspace/package-json.cjs +26 -43
- package/dist/cjs/ultramodern-workspace/pnpm-workspace-policy-plan.cjs +166 -0
- package/dist/cjs/ultramodern-workspace/tooling-command-catalog.cjs +153 -0
- package/dist/cjs/ultramodern-workspace/versions.cjs +8 -3
- package/dist/cjs/ultramodern-workspace/workspace-script-plan.cjs +175 -0
- package/dist/cjs/ultramodern-workspace/workspace-scripts.cjs +104 -63
- package/dist/cjs/ultramodern-workspace/workspace-validation-contract.cjs +97 -0
- package/dist/cjs/ultramodern-workspace/write-workspace.cjs +11 -3
- package/dist/cjs/ultramodern-workspace/zerops.cjs +100 -0
- package/dist/esm/ultramodern-tooling/commands.js +775 -78
- package/dist/esm/ultramodern-tooling/config.js +144 -9
- package/dist/esm/ultramodern-workspace/add-vertical.js +26 -1
- package/dist/esm/ultramodern-workspace/api.js +43 -2
- package/dist/esm/ultramodern-workspace/app-files.js +8 -11
- package/dist/esm/ultramodern-workspace/backend-federation.js +217 -0
- package/dist/esm/ultramodern-workspace/contracts.js +24 -8
- package/dist/esm/ultramodern-workspace/delivery-unit-sync.js +108 -0
- package/dist/esm/ultramodern-workspace/delivery-unit.js +31 -0
- package/dist/esm/ultramodern-workspace/descriptors.js +13 -1
- package/dist/esm/ultramodern-workspace/module-federation.js +160 -42
- package/dist/esm/ultramodern-workspace/package-json.js +16 -40
- package/dist/esm/ultramodern-workspace/pnpm-workspace-policy-plan.js +113 -0
- package/dist/esm/ultramodern-workspace/tooling-command-catalog.js +100 -0
- package/dist/esm/ultramodern-workspace/versions.js +6 -4
- package/dist/esm/ultramodern-workspace/workspace-script-plan.js +110 -0
- package/dist/esm/ultramodern-workspace/workspace-scripts.js +88 -65
- package/dist/esm/ultramodern-workspace/workspace-validation-contract.js +59 -0
- package/dist/esm/ultramodern-workspace/write-workspace.js +14 -6
- package/dist/esm/ultramodern-workspace/zerops.js +62 -0
- package/dist/esm-node/ultramodern-tooling/commands.js +775 -78
- package/dist/esm-node/ultramodern-tooling/config.js +144 -9
- package/dist/esm-node/ultramodern-workspace/add-vertical.js +26 -1
- package/dist/esm-node/ultramodern-workspace/api.js +43 -2
- package/dist/esm-node/ultramodern-workspace/app-files.js +8 -11
- package/dist/esm-node/ultramodern-workspace/backend-federation.js +218 -0
- package/dist/esm-node/ultramodern-workspace/contracts.js +24 -8
- package/dist/esm-node/ultramodern-workspace/delivery-unit-sync.js +109 -0
- package/dist/esm-node/ultramodern-workspace/delivery-unit.js +32 -0
- package/dist/esm-node/ultramodern-workspace/descriptors.js +13 -1
- package/dist/esm-node/ultramodern-workspace/module-federation.js +160 -42
- package/dist/esm-node/ultramodern-workspace/package-json.js +16 -40
- package/dist/esm-node/ultramodern-workspace/pnpm-workspace-policy-plan.js +114 -0
- package/dist/esm-node/ultramodern-workspace/tooling-command-catalog.js +101 -0
- package/dist/esm-node/ultramodern-workspace/versions.js +6 -4
- package/dist/esm-node/ultramodern-workspace/workspace-script-plan.js +111 -0
- package/dist/esm-node/ultramodern-workspace/workspace-scripts.js +88 -65
- package/dist/esm-node/ultramodern-workspace/workspace-validation-contract.js +60 -0
- package/dist/esm-node/ultramodern-workspace/write-workspace.js +14 -6
- package/dist/esm-node/ultramodern-workspace/zerops.js +63 -0
- package/dist/types/ultramodern-tooling/config.d.ts +6 -0
- package/dist/types/ultramodern-workspace/api.d.ts +1 -0
- package/dist/types/ultramodern-workspace/backend-federation.d.ts +11 -0
- package/dist/types/ultramodern-workspace/contracts.d.ts +1 -1
- package/dist/types/ultramodern-workspace/delivery-unit-sync.d.ts +6 -0
- package/dist/types/ultramodern-workspace/delivery-unit.d.ts +27 -0
- package/dist/types/ultramodern-workspace/descriptors.d.ts +4 -0
- package/dist/types/ultramodern-workspace/module-federation.d.ts +4 -9
- package/dist/types/ultramodern-workspace/package-json.d.ts +0 -1
- package/dist/types/ultramodern-workspace/pnpm-workspace-policy-plan.d.ts +39 -0
- package/dist/types/ultramodern-workspace/tooling-command-catalog.d.ts +18 -0
- package/dist/types/ultramodern-workspace/versions.d.ts +5 -3
- package/dist/types/ultramodern-workspace/workspace-script-plan.d.ts +72 -0
- package/dist/types/ultramodern-workspace/workspace-scripts.d.ts +13 -0
- package/dist/types/ultramodern-workspace/workspace-validation-contract.d.ts +42 -0
- package/dist/types/ultramodern-workspace/zerops.d.ts +2 -0
- package/package.json +3 -3
- package/template-workspace/.gitignore.handlebars +4 -0
- package/template-workspace/README.md.handlebars +18 -15
- package/template-workspace/patches/@module-federation__bridge-react@2.6.0.patch +140 -0
- package/template-workspace/patches/@module-federation__modern-js-v3@2.6.0.patch +57 -0
- package/template-workspace/patches/drizzle-orm-ts7-strict-declarations.patch +452 -0
- package/template-workspace/patches/effect-schema-error-type-id.patch +18 -0
- package/template-workspace/pnpm-workspace.yaml.handlebars +8 -0
- package/template-workspace/scripts/bootstrap-agent-skills.mjs +11 -3
- package/templates/workspace-scripts/check-ultramodern-api-boundaries.mts +40 -2
- package/templates/workspace-scripts/generate-node-backend-federation.mjs +270 -0
- package/templates/workspace-scripts/materialize-zerops-runtime.mjs +448 -0
- package/templates/workspace-scripts/proof-cloudflare-version.mjs +237 -9
- package/templates/workspace-scripts/proof-node-backend-federation.mjs +729 -0
- package/templates/workspace-scripts/ultramodern-cloudflare-proof.mjs +188 -2
- package/templates/workspace-scripts/validate-ultramodern-workspace.mjs.handlebars +434 -18
|
@@ -37,28 +37,29 @@ var __webpack_require__ = {};
|
|
|
37
37
|
var __webpack_exports__ = {};
|
|
38
38
|
__webpack_require__.r(__webpack_exports__);
|
|
39
39
|
__webpack_require__.d(__webpack_exports__, {
|
|
40
|
+
createAgentReferenceReposSetupScript: ()=>createAgentReferenceReposSetupScript,
|
|
41
|
+
createNodeBackendFederationProofScript: ()=>createNodeBackendFederationProofScript,
|
|
40
42
|
createPerformanceReadinessConfigScript: ()=>createPerformanceReadinessConfigScript,
|
|
41
43
|
createWorkspaceApiBoundaryValidationScript: ()=>createWorkspaceApiBoundaryValidationScript,
|
|
42
44
|
createWorkspaceI18nBoundaryValidationScript: ()=>createWorkspaceI18nBoundaryValidationScript,
|
|
43
45
|
createWorkspaceValidationScript: ()=>createWorkspaceValidationScript,
|
|
46
|
+
createZeropsRuntimeMaterializationScript: ()=>createZeropsRuntimeMaterializationScript,
|
|
47
|
+
migratedWorkspaceScriptArtifacts: ()=>migratedWorkspaceScriptArtifacts,
|
|
48
|
+
migratedWorkspaceScriptBasenames: ()=>migratedWorkspaceScriptBasenames,
|
|
49
|
+
writeGeneratedToolWrapperScripts: ()=>writeGeneratedToolWrapperScripts,
|
|
44
50
|
writeGeneratedWorkspaceScripts: ()=>writeGeneratedWorkspaceScripts
|
|
45
51
|
});
|
|
46
52
|
const external_node_fs_namespaceObject = require("node:fs");
|
|
47
53
|
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
48
54
|
const external_node_path_namespaceObject = require("node:path");
|
|
49
55
|
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
50
|
-
const external_api_cjs_namespaceObject = require("./api.cjs");
|
|
51
|
-
const external_demo_components_cjs_namespaceObject = require("./demo-components.cjs");
|
|
52
|
-
const external_descriptors_cjs_namespaceObject = require("./descriptors.cjs");
|
|
53
56
|
const external_fs_io_cjs_namespaceObject = require("./fs-io.cjs");
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
const external_routes_cjs_namespaceObject = require("./routes.cjs");
|
|
58
|
-
const external_versions_cjs_namespaceObject = require("./versions.cjs");
|
|
57
|
+
const external_tooling_command_catalog_cjs_namespaceObject = require("./tooling-command-catalog.cjs");
|
|
58
|
+
const external_workspace_validation_contract_cjs_namespaceObject = require("./workspace-validation-contract.cjs");
|
|
59
|
+
const singleQuoted = (value)=>`'${value.replace(/'/gu, "\\'")}'`;
|
|
59
60
|
function createToolWrapperScript(command, extraArgs = []) {
|
|
60
|
-
const
|
|
61
|
-
const
|
|
61
|
+
const commandLiteral = singleQuoted(command);
|
|
62
|
+
const extraArgsLiteral = `[${extraArgs.map(singleQuoted).join(', ')}]`;
|
|
62
63
|
return `#!/usr/bin/env node
|
|
63
64
|
import { spawnSync } from 'node:child_process';
|
|
64
65
|
import path from 'node:path';
|
|
@@ -69,7 +70,7 @@ const forwardedArgs = process.argv.slice(2);
|
|
|
69
70
|
const workspaceRoot =
|
|
70
71
|
process.env.ULTRAMODERN_WORKSPACE_ROOT ??
|
|
71
72
|
path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
72
|
-
const ultramodernArgs = ['ultramodern', ${
|
|
73
|
+
const ultramodernArgs = ['ultramodern', ${commandLiteral}, ...${extraArgsLiteral}, ...forwardedArgs];
|
|
73
74
|
const result = createBin
|
|
74
75
|
? spawnSync(process.execPath, [createBin, ...ultramodernArgs], {
|
|
75
76
|
env: { ...process.env, ULTRAMODERN_WORKSPACE_ROOT: workspaceRoot },
|
|
@@ -89,6 +90,13 @@ if (result.error) {
|
|
|
89
90
|
process.exit(result.status ?? 1);
|
|
90
91
|
`;
|
|
91
92
|
}
|
|
93
|
+
function writeGeneratedToolWrapperScript(targetDir, key) {
|
|
94
|
+
const command = external_tooling_command_catalog_cjs_namespaceObject.GENERATED_TOOLING_COMMANDS[key];
|
|
95
|
+
writeWorkspaceOwnedMtsScript(targetDir, command.wrapperName, createToolWrapperScript(command.command));
|
|
96
|
+
}
|
|
97
|
+
function writeGeneratedToolWrapperScripts(targetDir) {
|
|
98
|
+
for (const command of external_tooling_command_catalog_cjs_namespaceObject.generatedToolingCommands)writeGeneratedToolWrapperScript(targetDir, command.id);
|
|
99
|
+
}
|
|
92
100
|
function createSkillsToolWrapperScript() {
|
|
93
101
|
return `#!/usr/bin/env node
|
|
94
102
|
import { spawnSync } from 'node:child_process';
|
|
@@ -143,52 +151,24 @@ function migrateCopiedWorkspaceScriptToMts(targetDir, name) {
|
|
|
143
151
|
external_node_fs_default().renameSync(legacyPath, migratedPath);
|
|
144
152
|
}
|
|
145
153
|
function createWorkspaceValidationScript(scope, enableTailwind, remotes = []) {
|
|
146
|
-
const
|
|
147
|
-
id: remote.id,
|
|
148
|
-
domain: remote.domain,
|
|
149
|
-
stem: remote.api.stem,
|
|
150
|
-
group: (0, external_api_cjs_namespaceObject.verticalApiGroupName)(remote),
|
|
151
|
-
path: remote.directory,
|
|
152
|
-
port: remote.port,
|
|
153
|
-
mfName: remote.mfName,
|
|
154
|
-
apiPrefix: remote.api.prefix,
|
|
155
|
-
tailwindPrefix: (0, external_naming_cjs_namespaceObject.tailwindPrefixForApp)(remote),
|
|
156
|
-
zephyrAlias: (0, external_descriptors_cjs_namespaceObject.remoteDependencyAlias)(remote),
|
|
157
|
-
packageName: (0, external_naming_cjs_namespaceObject.packageName)(scope, remote.packageSuffix),
|
|
158
|
-
exposes: Object.keys(remote.exposes ?? {}),
|
|
159
|
-
componentPaths: Object.keys(remote.exposes ?? {}).map((expose)=>(0, external_demo_components_cjs_namespaceObject.remoteComponentOutputPath)(remote, expose)).filter((componentPath)=>Boolean(componentPath)),
|
|
160
|
-
namespace: (0, external_descriptors_cjs_namespaceObject.appI18nNamespace)(remote),
|
|
161
|
-
routePagePaths: (0, external_routes_cjs_namespaceObject.createRouteOwnedI18nPaths)(remote).filter((route)=>'/' !== route.canonicalPath).map((route)=>(0, external_routes_cjs_namespaceObject.createRoutePageFilePath)(remote, route.canonicalPath)),
|
|
162
|
-
routeMetaPaths: (0, external_routes_cjs_namespaceObject.createRouteOwnedI18nPaths)(remote).map((route)=>(0, external_routes_cjs_namespaceObject.createRouteMetaFilePath)(remote, route.canonicalPath)),
|
|
163
|
-
localisedUrls: (0, external_routes_cjs_namespaceObject.createLocalisedUrlsMap)(remote),
|
|
164
|
-
verticalRefs: remote.verticalRefs ?? []
|
|
165
|
-
}));
|
|
166
|
-
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));
|
|
167
|
-
const shellNamespace = (0, external_descriptors_cjs_namespaceObject.appI18nNamespace)(external_descriptors_cjs_namespaceObject.shellApp);
|
|
168
|
-
const oldRemotePaths = [
|
|
169
|
-
'apps/remotes'
|
|
170
|
-
];
|
|
171
|
-
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';
|
|
172
|
-
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';
|
|
173
|
-
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';
|
|
174
|
-
const expectedCloudflareSecurity = (0, external_policy_cjs_namespaceObject.createCloudflareSecurityContract)();
|
|
154
|
+
const contract = (0, external_workspace_validation_contract_cjs_namespaceObject.createWorkspaceValidationContract)(scope, enableTailwind, remotes);
|
|
175
155
|
return (0, external_fs_io_cjs_namespaceObject.renderFileTemplate)("workspace-scripts/validate-ultramodern-workspace.mjs", {
|
|
176
|
-
packageScope:
|
|
177
|
-
nodeVersion:
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
publicSurfaceManagedSourceAssetPathsJson: JSON.stringify(
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
cloudflareCompatibilityDate:
|
|
156
|
+
packageScope: contract.packageScope,
|
|
157
|
+
nodeVersion: contract.versions.node,
|
|
158
|
+
tailwindEnabledJson: JSON.stringify(contract.tailwindEnabled),
|
|
159
|
+
fullStackVerticalsJson: JSON.stringify(contract.fullStackVerticals, null, 2),
|
|
160
|
+
shellNamespaceJson: JSON.stringify(contract.shellNamespace),
|
|
161
|
+
oldRemotePathsJson: JSON.stringify(contract.oldRemotePaths),
|
|
162
|
+
expectedBuildScriptJson: JSON.stringify(contract.scripts.build),
|
|
163
|
+
expectedCloudflareBuildScriptJson: JSON.stringify(contract.scripts.cloudflareBuild),
|
|
164
|
+
expectedCloudflareDeployScriptJson: JSON.stringify(contract.scripts.cloudflareDeploy),
|
|
165
|
+
expectedCloudflareSecurityJson: JSON.stringify(contract.cloudflareSecurity, null, 2),
|
|
166
|
+
workspaceValidationContractJson: JSON.stringify(contract, null, 2),
|
|
167
|
+
publicSurfaceManagedSourceAssetPathsJson: JSON.stringify(contract.publicSurfaceManagedSourceAssetPaths, null, 2),
|
|
168
|
+
shellRouteMetaPathsJson: JSON.stringify(contract.shellRouteMetaPaths, null, 2),
|
|
169
|
+
effectVersion: contract.versions.effect,
|
|
170
|
+
moduleFederationVersion: contract.versions.moduleFederation,
|
|
171
|
+
cloudflareCompatibilityDate: contract.versions.cloudflareCompatibilityDate
|
|
192
172
|
});
|
|
193
173
|
}
|
|
194
174
|
function createWorkspaceI18nBoundaryValidationScript() {
|
|
@@ -200,30 +180,91 @@ function createWorkspaceApiBoundaryValidationScript() {
|
|
|
200
180
|
function createPerformanceReadinessConfigScript() {
|
|
201
181
|
return (0, external_fs_io_cjs_namespaceObject.readFileTemplate)("workspace-scripts/ultramodern-performance-readiness.config.mjs");
|
|
202
182
|
}
|
|
183
|
+
function createNodeBackendFederationProofScript() {
|
|
184
|
+
return (0, external_fs_io_cjs_namespaceObject.readFileTemplate)("workspace-scripts/proof-node-backend-federation.mjs");
|
|
185
|
+
}
|
|
186
|
+
function createZeropsRuntimeMaterializationScript() {
|
|
187
|
+
return (0, external_fs_io_cjs_namespaceObject.readFileTemplate)("workspace-scripts/materialize-zerops-runtime.mjs");
|
|
188
|
+
}
|
|
203
189
|
function writeGeneratedWorkspaceScripts(targetDir, _scope, _enableTailwind, _remotes = []) {
|
|
204
|
-
writeWorkspaceOwnedMtsScript(targetDir, 'assert-mf-types', createToolWrapperScript('mf-types'));
|
|
205
|
-
writeWorkspaceOwnedMtsScript(targetDir, 'validate-ultramodern-workspace', createToolWrapperScript('validate'));
|
|
206
190
|
writeWorkspaceOwnedMtsScript(targetDir, 'check-ultramodern-i18n-boundaries', createWorkspaceI18nBoundaryValidationScript());
|
|
207
191
|
writeWorkspaceOwnedMtsScript(targetDir, 'check-ultramodern-api-boundaries', createWorkspaceApiBoundaryValidationScript());
|
|
208
|
-
|
|
209
|
-
writeWorkspaceOwnedMtsScript(targetDir, 'proof-cloudflare-version', createToolWrapperScript('cloudflare-proof'));
|
|
192
|
+
(0, external_fs_io_cjs_namespaceObject.writeFileReplacing)(targetDir, "scripts/materialize-zerops-runtime.mjs", createZeropsRuntimeMaterializationScript());
|
|
210
193
|
(0, external_fs_io_cjs_namespaceObject.writeFileReplacing)(targetDir, "scripts/ultramodern-performance-readiness.config.mjs", createPerformanceReadinessConfigScript());
|
|
211
|
-
|
|
212
|
-
writeWorkspaceOwnedMtsScript(targetDir, 'migrate-strict-effect', createToolWrapperScript('migrate-strict-effect'));
|
|
213
|
-
writeWorkspaceOwnedMtsScript(targetDir, 'ultramodern-typecheck', createToolWrapperScript('typecheck'));
|
|
194
|
+
writeGeneratedToolWrapperScripts(targetDir);
|
|
214
195
|
writeWorkspaceOwnedMtsScript(targetDir, 'bootstrap-agent-skills', createSkillsToolWrapperScript());
|
|
215
196
|
migrateCopiedWorkspaceScriptToMts(targetDir, 'setup-agent-reference-repos');
|
|
216
197
|
}
|
|
198
|
+
function createAgentReferenceReposSetupScript() {
|
|
199
|
+
return external_node_fs_default().readFileSync(external_node_path_default().join(external_fs_io_cjs_namespaceObject.workspaceTemplateDir, "scripts/setup-agent-reference-repos.mjs"), 'utf-8');
|
|
200
|
+
}
|
|
201
|
+
const BACKEND_FEDERATION_WRAPPER_IDS = new Set([
|
|
202
|
+
'backendFederationGenerate',
|
|
203
|
+
'backendFederationProof'
|
|
204
|
+
]);
|
|
205
|
+
function migratedWorkspaceScriptArtifacts(options) {
|
|
206
|
+
const artifacts = [
|
|
207
|
+
{
|
|
208
|
+
relativePath: "scripts/check-ultramodern-i18n-boundaries.mts",
|
|
209
|
+
content: createWorkspaceI18nBoundaryValidationScript(),
|
|
210
|
+
legacyPath: "scripts/check-ultramodern-i18n-boundaries.mjs"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
relativePath: "scripts/check-ultramodern-api-boundaries.mts",
|
|
214
|
+
content: createWorkspaceApiBoundaryValidationScript(),
|
|
215
|
+
legacyPath: "scripts/check-ultramodern-api-boundaries.mjs"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
relativePath: "scripts/ultramodern-performance-readiness.config.mjs",
|
|
219
|
+
content: createPerformanceReadinessConfigScript()
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
relativePath: "scripts/bootstrap-agent-skills.mts",
|
|
223
|
+
content: createSkillsToolWrapperScript(),
|
|
224
|
+
legacyPath: "scripts/bootstrap-agent-skills.mjs"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
relativePath: "scripts/setup-agent-reference-repos.mts",
|
|
228
|
+
content: createAgentReferenceReposSetupScript(),
|
|
229
|
+
legacyPath: "scripts/setup-agent-reference-repos.mjs"
|
|
230
|
+
}
|
|
231
|
+
];
|
|
232
|
+
for (const command of external_tooling_command_catalog_cjs_namespaceObject.generatedToolingCommands)if (!(options.shellOnly && BACKEND_FEDERATION_WRAPPER_IDS.has(command.id))) artifacts.push({
|
|
233
|
+
relativePath: command.wrapperPath,
|
|
234
|
+
content: createToolWrapperScript(command.command),
|
|
235
|
+
legacyPath: command.wrapperPath.replace(/\.mts$/u, '.mjs')
|
|
236
|
+
});
|
|
237
|
+
return artifacts;
|
|
238
|
+
}
|
|
239
|
+
const migratedWorkspaceScriptBasenames = [
|
|
240
|
+
'check-ultramodern-i18n-boundaries',
|
|
241
|
+
'check-ultramodern-api-boundaries',
|
|
242
|
+
'bootstrap-agent-skills',
|
|
243
|
+
'setup-agent-reference-repos',
|
|
244
|
+
...external_tooling_command_catalog_cjs_namespaceObject.generatedToolingCommands.map((command)=>command.wrapperName)
|
|
245
|
+
];
|
|
246
|
+
exports.createAgentReferenceReposSetupScript = __webpack_exports__.createAgentReferenceReposSetupScript;
|
|
247
|
+
exports.createNodeBackendFederationProofScript = __webpack_exports__.createNodeBackendFederationProofScript;
|
|
217
248
|
exports.createPerformanceReadinessConfigScript = __webpack_exports__.createPerformanceReadinessConfigScript;
|
|
218
249
|
exports.createWorkspaceApiBoundaryValidationScript = __webpack_exports__.createWorkspaceApiBoundaryValidationScript;
|
|
219
250
|
exports.createWorkspaceI18nBoundaryValidationScript = __webpack_exports__.createWorkspaceI18nBoundaryValidationScript;
|
|
220
251
|
exports.createWorkspaceValidationScript = __webpack_exports__.createWorkspaceValidationScript;
|
|
252
|
+
exports.createZeropsRuntimeMaterializationScript = __webpack_exports__.createZeropsRuntimeMaterializationScript;
|
|
253
|
+
exports.migratedWorkspaceScriptArtifacts = __webpack_exports__.migratedWorkspaceScriptArtifacts;
|
|
254
|
+
exports.migratedWorkspaceScriptBasenames = __webpack_exports__.migratedWorkspaceScriptBasenames;
|
|
255
|
+
exports.writeGeneratedToolWrapperScripts = __webpack_exports__.writeGeneratedToolWrapperScripts;
|
|
221
256
|
exports.writeGeneratedWorkspaceScripts = __webpack_exports__.writeGeneratedWorkspaceScripts;
|
|
222
257
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
258
|
+
"createAgentReferenceReposSetupScript",
|
|
259
|
+
"createNodeBackendFederationProofScript",
|
|
223
260
|
"createPerformanceReadinessConfigScript",
|
|
224
261
|
"createWorkspaceApiBoundaryValidationScript",
|
|
225
262
|
"createWorkspaceI18nBoundaryValidationScript",
|
|
226
263
|
"createWorkspaceValidationScript",
|
|
264
|
+
"createZeropsRuntimeMaterializationScript",
|
|
265
|
+
"migratedWorkspaceScriptArtifacts",
|
|
266
|
+
"migratedWorkspaceScriptBasenames",
|
|
267
|
+
"writeGeneratedToolWrapperScripts",
|
|
227
268
|
"writeGeneratedWorkspaceScripts"
|
|
228
269
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
229
270
|
Object.defineProperty(exports, '__esModule', {
|
|
@@ -0,0 +1,97 @@
|
|
|
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
|
+
createWorkspaceValidationContract: ()=>createWorkspaceValidationContract
|
|
32
|
+
});
|
|
33
|
+
const external_api_cjs_namespaceObject = require("./api.cjs");
|
|
34
|
+
const external_backend_federation_cjs_namespaceObject = require("./backend-federation.cjs");
|
|
35
|
+
const external_delivery_unit_cjs_namespaceObject = require("./delivery-unit.cjs");
|
|
36
|
+
const external_demo_components_cjs_namespaceObject = require("./demo-components.cjs");
|
|
37
|
+
const external_descriptors_cjs_namespaceObject = require("./descriptors.cjs");
|
|
38
|
+
const external_naming_cjs_namespaceObject = require("./naming.cjs");
|
|
39
|
+
const external_policy_cjs_namespaceObject = require("./policy.cjs");
|
|
40
|
+
const external_public_surface_cjs_namespaceObject = require("./public-surface.cjs");
|
|
41
|
+
const external_routes_cjs_namespaceObject = require("./routes.cjs");
|
|
42
|
+
const external_versions_cjs_namespaceObject = require("./versions.cjs");
|
|
43
|
+
const external_workspace_script_plan_cjs_namespaceObject = require("./workspace-script-plan.cjs");
|
|
44
|
+
function createWorkspaceValidationContract(scope, enableTailwind, remotes = []) {
|
|
45
|
+
const fullStackVerticals = remotes.filter(external_descriptors_cjs_namespaceObject.appHasApi).map((remote)=>({
|
|
46
|
+
id: remote.id,
|
|
47
|
+
domain: remote.domain,
|
|
48
|
+
stem: remote.api.stem,
|
|
49
|
+
group: (0, external_api_cjs_namespaceObject.verticalApiGroupName)(remote),
|
|
50
|
+
path: remote.directory,
|
|
51
|
+
port: remote.port,
|
|
52
|
+
mfName: remote.mfName,
|
|
53
|
+
apiPrefix: remote.api.prefix,
|
|
54
|
+
tailwindPrefix: (0, external_naming_cjs_namespaceObject.tailwindPrefixForApp)(remote),
|
|
55
|
+
zephyrAlias: (0, external_descriptors_cjs_namespaceObject.remoteDependencyAlias)(remote),
|
|
56
|
+
packageName: (0, external_naming_cjs_namespaceObject.packageName)(scope, remote.packageSuffix),
|
|
57
|
+
backendFederation: (0, external_backend_federation_cjs_namespaceObject.createBackendFederationMetadata)(scope, remote),
|
|
58
|
+
deliveryUnit: (0, external_delivery_unit_cjs_namespaceObject.createDeliveryUnitRecord)(scope, remote),
|
|
59
|
+
exposes: Object.keys(remote.exposes ?? {}),
|
|
60
|
+
componentPaths: Object.keys(remote.exposes ?? {}).map((expose)=>(0, external_demo_components_cjs_namespaceObject.remoteComponentOutputPath)(remote, expose)).filter((componentPath)=>Boolean(componentPath)),
|
|
61
|
+
namespace: (0, external_descriptors_cjs_namespaceObject.appI18nNamespace)(remote),
|
|
62
|
+
routePagePaths: (0, external_routes_cjs_namespaceObject.createRouteOwnedI18nPaths)(remote).filter((route)=>'/' !== route.canonicalPath).map((route)=>(0, external_routes_cjs_namespaceObject.createRoutePageFilePath)(remote, route.canonicalPath)),
|
|
63
|
+
routeMetaPaths: (0, external_routes_cjs_namespaceObject.createRouteOwnedI18nPaths)(remote).map((route)=>(0, external_routes_cjs_namespaceObject.createRouteMetaFilePath)(remote, route.canonicalPath)),
|
|
64
|
+
localisedUrls: (0, external_routes_cjs_namespaceObject.createLocalisedUrlsMap)(remote),
|
|
65
|
+
verticalRefs: remote.verticalRefs ?? []
|
|
66
|
+
}));
|
|
67
|
+
return {
|
|
68
|
+
packageScope: scope,
|
|
69
|
+
versions: {
|
|
70
|
+
cloudflareCompatibilityDate: external_versions_cjs_namespaceObject.CLOUDFLARE_COMPATIBILITY_DATE,
|
|
71
|
+
effect: external_versions_cjs_namespaceObject.EFFECT_VERSION,
|
|
72
|
+
moduleFederation: external_versions_cjs_namespaceObject.MODULE_FEDERATION_VERSION,
|
|
73
|
+
node: external_versions_cjs_namespaceObject.NODE_VERSION,
|
|
74
|
+
pnpm: external_versions_cjs_namespaceObject.PNPM_VERSION
|
|
75
|
+
},
|
|
76
|
+
tailwindEnabled: enableTailwind,
|
|
77
|
+
fullStackVerticals,
|
|
78
|
+
shellNamespace: (0, external_descriptors_cjs_namespaceObject.appI18nNamespace)(external_descriptors_cjs_namespaceObject.shellApp),
|
|
79
|
+
oldRemotePaths: [
|
|
80
|
+
'apps/remotes'
|
|
81
|
+
],
|
|
82
|
+
scripts: (0, external_workspace_script_plan_cjs_namespaceObject.createWorkspaceRootScriptPlan)(remotes),
|
|
83
|
+
packageScripts: (0, external_workspace_script_plan_cjs_namespaceObject.createWorkspaceRootPackageScripts)(remotes),
|
|
84
|
+
cloudflareSecurity: (0, external_policy_cjs_namespaceObject.createCloudflareSecurityContract)(),
|
|
85
|
+
publicSurfaceManagedSourceAssetPaths: [
|
|
86
|
+
...external_public_surface_cjs_namespaceObject.publicSurfaceManagedSourceAssetPaths
|
|
87
|
+
],
|
|
88
|
+
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))
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
exports.createWorkspaceValidationContract = __webpack_exports__.createWorkspaceValidationContract;
|
|
92
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
93
|
+
"createWorkspaceValidationContract"
|
|
94
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
95
|
+
Object.defineProperty(exports, '__esModule', {
|
|
96
|
+
value: true
|
|
97
|
+
});
|
|
@@ -46,6 +46,7 @@ const external_node_fs_namespaceObject = require("node:fs");
|
|
|
46
46
|
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
47
47
|
const external_api_cjs_namespaceObject = require("./api.cjs");
|
|
48
48
|
const external_app_files_cjs_namespaceObject = require("./app-files.cjs");
|
|
49
|
+
const external_backend_federation_cjs_namespaceObject = require("./backend-federation.cjs");
|
|
49
50
|
const external_bridge_config_cjs_namespaceObject = require("./bridge-config.cjs");
|
|
50
51
|
const external_contracts_cjs_namespaceObject = require("./contracts.cjs");
|
|
51
52
|
const external_demo_components_cjs_namespaceObject = require("./demo-components.cjs");
|
|
@@ -61,6 +62,7 @@ const external_package_source_cjs_namespaceObject = require("./package-source.cj
|
|
|
61
62
|
const external_public_surface_cjs_namespaceObject = require("./public-surface.cjs");
|
|
62
63
|
const external_versions_cjs_namespaceObject = require("./versions.cjs");
|
|
63
64
|
const external_workspace_scripts_cjs_namespaceObject = require("./workspace-scripts.cjs");
|
|
65
|
+
const external_zerops_cjs_namespaceObject = require("./zerops.cjs");
|
|
64
66
|
function writeApp(targetDir, scope, app, packageSource, enableTailwind, remotes = [], bridge) {
|
|
65
67
|
const resolvedApp = 'shell' === app.kind ? (0, external_descriptors_cjs_namespaceObject.createShellHost)(remotes) : app;
|
|
66
68
|
const publicWeb = (0, external_public_surface_cjs_namespaceObject.createPublicWebAppArtifacts)(resolvedApp);
|
|
@@ -76,7 +78,7 @@ function writeApp(targetDir, scope, app, packageSource, enableTailwind, remotes
|
|
|
76
78
|
(0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, publicWeb.jsonLdHelperFile.path, publicWeb.jsonLdHelperFile.content);
|
|
77
79
|
(0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, publicWeb.routeMetadataFile.path, publicWeb.routeMetadataFile.content);
|
|
78
80
|
(0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, publicWeb.routeHeadFile.path, publicWeb.routeHeadFile.content);
|
|
79
|
-
(0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, `${resolvedApp.directory}/modern.config.ts`, (0, external_module_federation_cjs_namespaceObject.createAppModernConfig)(scope, resolvedApp));
|
|
81
|
+
(0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, `${resolvedApp.directory}/modern.config.ts`, (0, external_module_federation_cjs_namespaceObject.createAppModernConfig)(scope, resolvedApp, remotes));
|
|
80
82
|
(0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, `${resolvedApp.directory}/src/modern.runtime.ts`, (0, external_app_files_cjs_namespaceObject.createAppRuntimeConfig)(resolvedApp, scope, remotes));
|
|
81
83
|
(0, external_fs_io_cjs_namespaceObject.writeJson)(targetDir, `${resolvedApp.directory}/locales/en/translation.json`, (0, external_locales_cjs_namespaceObject.createAppPublicLocaleMessages)(resolvedApp, 'en', remotes));
|
|
82
84
|
(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));
|
|
@@ -88,6 +90,7 @@ function writeApp(targetDir, scope, app, packageSource, enableTailwind, remotes
|
|
|
88
90
|
(0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, `${resolvedApp.directory}/tailwind.config.ts`, (0, external_app_files_cjs_namespaceObject.createTailwindConfig)());
|
|
89
91
|
}
|
|
90
92
|
(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));
|
|
93
|
+
if ((0, external_descriptors_cjs_namespaceObject.appHasApi)(resolvedApp)) (0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, `${resolvedApp.directory}/backend-federation.config.ts`, (0, external_module_federation_cjs_namespaceObject.createBackendModuleFederationConfig)(resolvedApp));
|
|
91
94
|
writeAppFile('src/routes/layout.tsx', (0, external_demo_components_cjs_namespaceObject.createLayout)(resolvedApp.id));
|
|
92
95
|
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));
|
|
93
96
|
for (const generatedFile of publicWeb.routeMetaFiles)(0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, generatedFile.path, generatedFile.content);
|
|
@@ -100,6 +103,8 @@ function writeApp(targetDir, scope, app, packageSource, enableTailwind, remotes
|
|
|
100
103
|
if ((0, external_descriptors_cjs_namespaceObject.appHasApi)(resolvedApp)) {
|
|
101
104
|
(0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, `${resolvedApp.directory}/shared/api.ts`, (0, external_api_cjs_namespaceObject.createSharedApi)(resolvedApp));
|
|
102
105
|
(0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, `${resolvedApp.directory}/api/index.ts`, (0, external_api_cjs_namespaceObject.createApiServiceEntry)(resolvedApp, '../shared/api.ts'));
|
|
106
|
+
(0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, `${resolvedApp.directory}/api/backend-federation.ts`, (0, external_backend_federation_cjs_namespaceObject.createBackendFederationContractFile)(resolvedApp));
|
|
107
|
+
(0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, `${resolvedApp.directory}/api/effect-api.ts`, (0, external_api_cjs_namespaceObject.createBackendEffectApiExpose)(scope, resolvedApp));
|
|
103
108
|
(0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, `${resolvedApp.directory}/src/api/${resolvedApp.api.stem}-client.ts`, (0, external_api_cjs_namespaceObject.createApiClient)(resolvedApp, '../../shared/api'));
|
|
104
109
|
}
|
|
105
110
|
if ('vertical' === resolvedApp.kind) {
|
|
@@ -149,7 +154,7 @@ function writePnpmWorkspacePackages(targetDir, bridge) {
|
|
|
149
154
|
...bridge.workspacePackages.map((entry)=>entry.pattern)
|
|
150
155
|
];
|
|
151
156
|
const renderedPackages = packages.map((pattern)=>` - ${pattern}`).join('\n');
|
|
152
|
-
(0, external_fs_io_cjs_namespaceObject.writeFileReplacing)(targetDir, 'pnpm-workspace.yaml', pnpmWorkspace.replace(/^packages:\n(?: {2}- .+\n)+/u, `packages:\n${renderedPackages}\n`));
|
|
157
|
+
(0, external_fs_io_cjs_namespaceObject.writeFileReplacing)(targetDir, 'pnpm-workspace.yaml', pnpmWorkspace.replace(/^packages:\r?\n(?: {2}- .+\r?\n)+/u, `packages:\n${renderedPackages}\n`));
|
|
153
158
|
}
|
|
154
159
|
function generateUltramodernWorkspace(options) {
|
|
155
160
|
const beforeFiles = (0, external_generation_result_cjs_namespaceObject.createFileSnapshot)(options.targetDir);
|
|
@@ -175,8 +180,10 @@ function generateUltramodernWorkspace(options) {
|
|
|
175
180
|
nodeVersion: external_versions_cjs_namespaceObject.NODE_VERSION,
|
|
176
181
|
pnpmVersion: external_versions_cjs_namespaceObject.PNPM_VERSION,
|
|
177
182
|
nodeFetchVersion: external_versions_cjs_namespaceObject.NODE_FETCH_VERSION,
|
|
183
|
+
drizzleOrmVersion: external_versions_cjs_namespaceObject.DRIZZLE_ORM_VERSION,
|
|
178
184
|
effectVersion: external_versions_cjs_namespaceObject.EFFECT_VERSION,
|
|
179
185
|
effectVitestVersion: external_versions_cjs_namespaceObject.EFFECT_VITEST_VERSION,
|
|
186
|
+
moduleFederationVersion: external_versions_cjs_namespaceObject.MODULE_FEDERATION_VERSION,
|
|
180
187
|
tanstackRouterCoreVersion: external_versions_cjs_namespaceObject.TANSTACK_ROUTER_CORE_VERSION,
|
|
181
188
|
tanstackRouterVersion: external_versions_cjs_namespaceObject.TANSTACK_ROUTER_VERSION,
|
|
182
189
|
typescriptVersion: external_versions_cjs_namespaceObject.TYPESCRIPT_VERSION,
|
|
@@ -184,11 +191,12 @@ function generateUltramodernWorkspace(options) {
|
|
|
184
191
|
});
|
|
185
192
|
writePnpmWorkspacePackages(options.targetDir, bridge);
|
|
186
193
|
(0, external_fs_io_cjs_namespaceObject.writeJson)(options.targetDir, 'package.json', createCompactRootPackageJson(scope, packageSource, initialVerticals, bridge));
|
|
194
|
+
(0, external_fs_io_cjs_namespaceObject.writeFile)(options.targetDir, 'zerops.yaml', `${(0, external_zerops_cjs_namespaceObject.createZeropsYaml)(scope, createdApps)}\n`);
|
|
187
195
|
(0, external_fs_io_cjs_namespaceObject.writeJson)(options.targetDir, 'tsconfig.base.json', (0, external_package_json_cjs_namespaceObject.createTsConfigBase)());
|
|
188
196
|
(0, external_fs_io_cjs_namespaceObject.writeJson)(options.targetDir, 'tsconfig.json', (0, external_package_json_cjs_namespaceObject.createRootTsConfig)(createdApps));
|
|
189
197
|
(0, external_fs_io_cjs_namespaceObject.writeJson)(options.targetDir, 'topology/reference-topology.json', (0, external_contracts_cjs_namespaceObject.createTopology)(scope, initialVerticals));
|
|
190
198
|
(0, external_fs_io_cjs_namespaceObject.writeJson)(options.targetDir, 'topology/ownership.json', (0, external_contracts_cjs_namespaceObject.createOwnership)(scope, initialVerticals));
|
|
191
|
-
(0, external_fs_io_cjs_namespaceObject.writeJson)(options.targetDir, 'topology/local-overlays/development.json', (0, external_contracts_cjs_namespaceObject.createDevelopmentOverlay)(initialVerticals));
|
|
199
|
+
(0, external_fs_io_cjs_namespaceObject.writeJson)(options.targetDir, 'topology/local-overlays/development.json', (0, external_contracts_cjs_namespaceObject.createDevelopmentOverlay)(scope, initialVerticals));
|
|
192
200
|
(0, external_fs_io_cjs_namespaceObject.writeJson)(options.targetDir, external_descriptors_cjs_namespaceObject.ULTRAMODERN_CONFIG_PATH, createCompactUltramodernConfig(scope, options.modernVersion, packageSource, createdApps, enableTailwind, bridge));
|
|
193
201
|
writeApp(options.targetDir, scope, external_descriptors_cjs_namespaceObject.shellApp, packageSource, enableTailwind, initialVerticals, bridge);
|
|
194
202
|
for (const remote of initialVerticals)writeApp(options.targetDir, scope, remote, packageSource, enableTailwind, initialVerticals, bridge);
|
|
@@ -0,0 +1,100 @@
|
|
|
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
|
+
createZeropsYaml: ()=>createZeropsYaml
|
|
32
|
+
});
|
|
33
|
+
const external_descriptors_cjs_namespaceObject = require("./descriptors.cjs");
|
|
34
|
+
const external_naming_cjs_namespaceObject = require("./naming.cjs");
|
|
35
|
+
const external_versions_cjs_namespaceObject = require("./versions.cjs");
|
|
36
|
+
const zeropsNodeRuntime = `nodejs@${external_versions_cjs_namespaceObject.NODE_VERSION.split('.')[0]}`;
|
|
37
|
+
function quoteYamlString(value) {
|
|
38
|
+
return `'${value.replace(/'/gu, "''")}'`;
|
|
39
|
+
}
|
|
40
|
+
function readinessPath(app) {
|
|
41
|
+
if (!(0, external_descriptors_cjs_namespaceObject.appHasApi)(app)) return '/';
|
|
42
|
+
return `${(0, external_descriptors_cjs_namespaceObject.resolveApiPrefix)(app)}/${(0, external_descriptors_cjs_namespaceObject.resolveApiStem)(app)}/readiness`;
|
|
43
|
+
}
|
|
44
|
+
function createZeropsService(scope, app) {
|
|
45
|
+
const runtimeDirectory = `.zerops/runtime/${app.id}`;
|
|
46
|
+
const appPackageName = (0, external_naming_cjs_namespaceObject.packageName)(scope, app.packageSuffix);
|
|
47
|
+
const commands = [
|
|
48
|
+
'curl https://mise.run | sh',
|
|
49
|
+
'~/.local/bin/mise install',
|
|
50
|
+
'~/.local/bin/mise exec -- pnpm install --frozen-lockfile',
|
|
51
|
+
`~/.local/bin/mise exec -- pnpm --filter ${appPackageName} run build`,
|
|
52
|
+
`~/.local/bin/mise exec -- pnpm run zerops:materialize -- --app ${app.id} --package ${appPackageName} --package-dir ${app.directory}`,
|
|
53
|
+
`cp topology/reference-topology.json ${runtimeDirectory}/topology.json`,
|
|
54
|
+
`cp topology/local-overlays/development.json ${runtimeDirectory}/local-overlay.json`
|
|
55
|
+
];
|
|
56
|
+
return [
|
|
57
|
+
` - setup: ${app.id}`,
|
|
58
|
+
' build:',
|
|
59
|
+
` base: ${zeropsNodeRuntime}`,
|
|
60
|
+
' buildCommands:',
|
|
61
|
+
' - |',
|
|
62
|
+
...commands.map((command)=>` ${command}`),
|
|
63
|
+
' deployFiles:',
|
|
64
|
+
` - ${runtimeDirectory}`,
|
|
65
|
+
' deploy:',
|
|
66
|
+
' temporaryShutdown: false',
|
|
67
|
+
' readinessCheck:',
|
|
68
|
+
' httpGet:',
|
|
69
|
+
` port: ${app.port}`,
|
|
70
|
+
` path: ${readinessPath(app)}`,
|
|
71
|
+
' failureTimeout: 120',
|
|
72
|
+
' retryPeriod: 10',
|
|
73
|
+
' run:',
|
|
74
|
+
` base: ${zeropsNodeRuntime}`,
|
|
75
|
+
' ports:',
|
|
76
|
+
` - port: ${app.port}`,
|
|
77
|
+
' protocol: TCP',
|
|
78
|
+
' httpSupport: true',
|
|
79
|
+
' envVariables:',
|
|
80
|
+
' NODE_ENV: production',
|
|
81
|
+
` ${app.portEnv}: ${quoteYamlString(String(app.port))}`,
|
|
82
|
+
` ULTRAMODERN_ZEROPS_SERVICE: ${quoteYamlString(app.id)}`,
|
|
83
|
+
` start: cd ${runtimeDirectory} && npm run serve`
|
|
84
|
+
].join('\n');
|
|
85
|
+
}
|
|
86
|
+
function createZeropsYaml(scope, apps) {
|
|
87
|
+
return [
|
|
88
|
+
'# Generated by Modern.js UltraModern workspace tooling.',
|
|
89
|
+
'# Zerops runs each full-stack MicroVertical as a package-owned Node service.',
|
|
90
|
+
'zerops:',
|
|
91
|
+
...apps.map((app)=>createZeropsService(scope, app))
|
|
92
|
+
].join('\n\n');
|
|
93
|
+
}
|
|
94
|
+
exports.createZeropsYaml = __webpack_exports__.createZeropsYaml;
|
|
95
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
96
|
+
"createZeropsYaml"
|
|
97
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
98
|
+
Object.defineProperty(exports, '__esModule', {
|
|
99
|
+
value: true
|
|
100
|
+
});
|