@bleedingdev/modern-js-create 3.5.0-ultramodern.36 → 3.5.0-ultramodern.37
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 +11 -14
- package/dist/cjs/cli/flags.cjs +0 -31
- package/dist/cjs/cli/help.cjs +0 -1
- package/dist/cjs/cli/package-source.cjs +0 -3
- package/dist/cjs/cli/prompts.cjs +2 -20
- package/dist/cjs/index.cjs +0 -5
- package/dist/cjs/locale/en.cjs +2 -6
- package/dist/cjs/locale/zh.cjs +2 -6
- package/dist/cjs/ultramodern-package-source.cjs +0 -32
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/declaration-patches.cjs +1 -0
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-build-identity.cjs +1 -1
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-modern-configs.cjs +1 -1
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/package-cohort.cjs +5 -3
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/pnpm-policy.cjs +3 -0
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/pnpm-yaml.cjs +2 -8
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/policy-constants.cjs +8 -0
- package/dist/cjs/ultramodern-workspace/add-vertical/plan.cjs +0 -12
- package/dist/cjs/ultramodern-workspace/add-vertical/preflight.cjs +2 -26
- package/dist/cjs/ultramodern-workspace/add-vertical/shell-files.cjs +1 -1
- package/dist/cjs/ultramodern-workspace/add-vertical/topology.cjs +6 -4
- package/dist/cjs/ultramodern-workspace/app-files.cjs +2 -23
- package/dist/cjs/ultramodern-workspace/contracts.cjs +25 -16
- package/dist/cjs/ultramodern-workspace/delivery-unit-sync.cjs +1 -1
- package/dist/cjs/ultramodern-workspace/demo-components.cjs +0 -3
- package/dist/cjs/ultramodern-workspace/fs-io.cjs +0 -33
- package/dist/cjs/ultramodern-workspace/locales.cjs +1 -14
- package/dist/cjs/ultramodern-workspace/mf-validation/inspect.cjs +2 -10
- package/dist/cjs/ultramodern-workspace/mf-validation/object-literal.cjs +2 -17
- package/dist/cjs/ultramodern-workspace/mf-validation/path-utils.cjs +0 -6
- package/dist/cjs/ultramodern-workspace/mf-validation/syntax.cjs +2 -29
- package/dist/cjs/ultramodern-workspace/mf-validation/validate.cjs +1 -1
- package/dist/cjs/ultramodern-workspace/module-federation/config.cjs +19 -8
- package/dist/cjs/ultramodern-workspace/module-federation/reexport-module.cjs +3 -2
- package/dist/cjs/ultramodern-workspace/naming.cjs +0 -6
- package/dist/cjs/ultramodern-workspace/package-json.cjs +5 -14
- package/dist/cjs/ultramodern-workspace/policy.cjs +0 -21
- package/dist/cjs/ultramodern-workspace/public-surface.cjs +0 -21
- package/dist/cjs/ultramodern-workspace/routes.cjs +0 -15
- package/dist/cjs/ultramodern-workspace/shared-patches.cjs +4 -3
- package/dist/cjs/ultramodern-workspace/tooling-command-catalog.cjs +2 -8
- package/dist/cjs/ultramodern-workspace/versions.cjs +25 -37
- package/dist/cjs/ultramodern-workspace/workspace-script-plan.cjs +2 -20
- package/dist/cjs/ultramodern-workspace/workspace-scripts.cjs +0 -21
- package/dist/cjs/ultramodern-workspace/write-app.cjs +3 -6
- package/dist/cjs/ultramodern-workspace/write-workspace.cjs +3 -5
- package/dist/esm/cli/flags.js +1 -11
- package/dist/esm/cli/help.js +0 -1
- package/dist/esm/cli/package-source.js +1 -1
- package/dist/esm/cli/prompts.js +2 -14
- package/dist/esm/index.js +2 -7
- package/dist/esm/locale/en.js +2 -6
- package/dist/esm/locale/zh.js +2 -6
- package/dist/esm/ultramodern-package-source.js +1 -24
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/declaration-patches.js +2 -1
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-build-identity.js +1 -1
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-modern-configs.js +1 -1
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/package-cohort.js +6 -4
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/pnpm-policy.js +4 -1
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/pnpm-yaml.js +1 -1
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/policy-constants.js +3 -1
- package/dist/esm/ultramodern-workspace/add-vertical/plan.js +1 -1
- package/dist/esm/ultramodern-workspace/add-vertical/preflight.js +1 -1
- package/dist/esm/ultramodern-workspace/add-vertical/shell-files.js +1 -1
- package/dist/esm/ultramodern-workspace/add-vertical/topology.js +6 -4
- package/dist/esm/ultramodern-workspace/app-files.js +1 -4
- package/dist/esm/ultramodern-workspace/contracts.js +25 -16
- package/dist/esm/ultramodern-workspace/delivery-unit-sync.js +1 -1
- package/dist/esm/ultramodern-workspace/demo-components.js +1 -1
- package/dist/esm/ultramodern-workspace/fs-io.js +1 -15
- package/dist/esm/ultramodern-workspace/locales.js +1 -1
- package/dist/esm/ultramodern-workspace/mf-validation/inspect.js +3 -2
- package/dist/esm/ultramodern-workspace/mf-validation/object-literal.js +1 -1
- package/dist/esm/ultramodern-workspace/mf-validation/path-utils.js +1 -1
- package/dist/esm/ultramodern-workspace/mf-validation/syntax.js +1 -1
- package/dist/esm/ultramodern-workspace/mf-validation/validate.js +1 -1
- package/dist/esm/ultramodern-workspace/module-federation/config.js +19 -8
- package/dist/esm/ultramodern-workspace/module-federation/reexport-module.js +4 -3
- package/dist/esm/ultramodern-workspace/naming.js +1 -1
- package/dist/esm/ultramodern-workspace/package-json.js +5 -8
- package/dist/esm/ultramodern-workspace/policy.js +1 -7
- package/dist/esm/ultramodern-workspace/public-surface.js +1 -1
- package/dist/esm/ultramodern-workspace/routes.js +1 -1
- package/dist/esm/ultramodern-workspace/shared-patches.js +4 -3
- package/dist/esm/ultramodern-workspace/tooling-command-catalog.js +1 -1
- package/dist/esm/ultramodern-workspace/versions.js +20 -23
- package/dist/esm/ultramodern-workspace/workspace-script-plan.js +1 -1
- package/dist/esm/ultramodern-workspace/workspace-scripts.js +6 -9
- package/dist/esm/ultramodern-workspace/write-app.js +4 -7
- package/dist/esm/ultramodern-workspace/write-workspace.js +3 -2
- package/dist/esm-node/cli/flags.js +1 -11
- package/dist/esm-node/cli/help.js +0 -1
- package/dist/esm-node/cli/package-source.js +1 -1
- package/dist/esm-node/cli/prompts.js +2 -14
- package/dist/esm-node/index.js +2 -7
- package/dist/esm-node/locale/en.js +2 -6
- package/dist/esm-node/locale/zh.js +2 -6
- package/dist/esm-node/ultramodern-package-source.js +1 -24
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/declaration-patches.js +2 -1
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-build-identity.js +1 -1
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-modern-configs.js +1 -1
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/package-cohort.js +6 -4
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/pnpm-policy.js +4 -1
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/pnpm-yaml.js +1 -1
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/policy-constants.js +3 -1
- package/dist/esm-node/ultramodern-workspace/add-vertical/plan.js +1 -1
- package/dist/esm-node/ultramodern-workspace/add-vertical/preflight.js +1 -1
- package/dist/esm-node/ultramodern-workspace/add-vertical/shell-files.js +1 -1
- package/dist/esm-node/ultramodern-workspace/add-vertical/topology.js +6 -4
- package/dist/esm-node/ultramodern-workspace/app-files.js +1 -4
- package/dist/esm-node/ultramodern-workspace/contracts.js +25 -16
- package/dist/esm-node/ultramodern-workspace/delivery-unit-sync.js +1 -1
- package/dist/esm-node/ultramodern-workspace/demo-components.js +1 -1
- package/dist/esm-node/ultramodern-workspace/fs-io.js +1 -15
- package/dist/esm-node/ultramodern-workspace/locales.js +1 -1
- package/dist/esm-node/ultramodern-workspace/mf-validation/inspect.js +3 -2
- package/dist/esm-node/ultramodern-workspace/mf-validation/object-literal.js +1 -1
- package/dist/esm-node/ultramodern-workspace/mf-validation/path-utils.js +1 -1
- package/dist/esm-node/ultramodern-workspace/mf-validation/syntax.js +1 -1
- package/dist/esm-node/ultramodern-workspace/mf-validation/validate.js +1 -1
- package/dist/esm-node/ultramodern-workspace/module-federation/config.js +19 -8
- package/dist/esm-node/ultramodern-workspace/module-federation/reexport-module.js +4 -3
- package/dist/esm-node/ultramodern-workspace/naming.js +1 -1
- package/dist/esm-node/ultramodern-workspace/package-json.js +5 -8
- package/dist/esm-node/ultramodern-workspace/policy.js +1 -7
- package/dist/esm-node/ultramodern-workspace/public-surface.js +1 -1
- package/dist/esm-node/ultramodern-workspace/routes.js +1 -1
- package/dist/esm-node/ultramodern-workspace/shared-patches.js +4 -3
- package/dist/esm-node/ultramodern-workspace/tooling-command-catalog.js +1 -1
- package/dist/esm-node/ultramodern-workspace/versions.js +20 -23
- package/dist/esm-node/ultramodern-workspace/workspace-script-plan.js +1 -1
- package/dist/esm-node/ultramodern-workspace/workspace-scripts.js +6 -9
- package/dist/esm-node/ultramodern-workspace/write-app.js +4 -7
- package/dist/esm-node/ultramodern-workspace/write-workspace.js +3 -2
- package/dist/types/cli/flags.d.ts +4 -9
- package/dist/types/cli/package-source.d.ts +3 -3
- package/dist/types/cli/project-setup.d.ts +1 -1
- package/dist/types/cli/prompts.d.ts +0 -2
- package/dist/types/locale/en.d.ts +0 -4
- package/dist/types/locale/index.d.ts +0 -8
- package/dist/types/locale/zh.d.ts +0 -4
- package/dist/types/ultramodern-package-source.d.ts +0 -11
- package/dist/types/ultramodern-tooling/commands/cloudflare-output-verify.d.ts +1 -1
- package/dist/types/ultramodern-tooling/commands/context.d.ts +3 -3
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/install.d.ts +1 -1
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/pnpm-yaml.d.ts +0 -5
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/policy-constants.d.ts +8 -6
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect.d.ts +1 -1
- package/dist/types/ultramodern-tooling/commands/routes-generate.d.ts +1 -1
- package/dist/types/ultramodern-tooling/commands/skills.d.ts +1 -1
- package/dist/types/ultramodern-tooling/commands/validate.d.ts +1 -1
- package/dist/types/ultramodern-tooling/commands.d.ts +1 -1
- package/dist/types/ultramodern-tooling/config/load.d.ts +1 -1
- package/dist/types/ultramodern-workspace/add-vertical/plan.d.ts +1 -6
- package/dist/types/ultramodern-workspace/add-vertical/preflight.d.ts +1 -9
- package/dist/types/ultramodern-workspace/app-files.d.ts +1 -7
- package/dist/types/ultramodern-workspace/codesmith.d.ts +5 -5
- package/dist/types/ultramodern-workspace/delivery-unit.d.ts +1 -1
- package/dist/types/ultramodern-workspace/demo-components.d.ts +0 -1
- package/dist/types/ultramodern-workspace/fs-io.d.ts +1 -7
- package/dist/types/ultramodern-workspace/generation-result.d.ts +2 -1
- package/dist/types/ultramodern-workspace/locales.d.ts +0 -181
- package/dist/types/ultramodern-workspace/mf-validation/inspect.d.ts +0 -3
- package/dist/types/ultramodern-workspace/mf-validation/object-literal.d.ts +0 -5
- package/dist/types/ultramodern-workspace/mf-validation/path-utils.d.ts +0 -2
- package/dist/types/ultramodern-workspace/mf-validation/syntax.d.ts +0 -9
- package/dist/types/ultramodern-workspace/module-federation/config.d.ts +1 -1
- package/dist/types/ultramodern-workspace/module-federation/reexport-module.d.ts +1 -1
- package/dist/types/ultramodern-workspace/naming.d.ts +0 -2
- package/dist/types/ultramodern-workspace/package-json.d.ts +0 -2
- package/dist/types/ultramodern-workspace/policy.d.ts +0 -47
- package/dist/types/ultramodern-workspace/public-surface.d.ts +5 -15
- package/dist/types/ultramodern-workspace/routes.d.ts +0 -9
- package/dist/types/ultramodern-workspace/shared-patches.d.ts +1 -2
- package/dist/types/ultramodern-workspace/tooling-command-catalog.d.ts +4 -4
- package/dist/types/ultramodern-workspace/types.d.ts +3 -2
- package/dist/types/ultramodern-workspace/versions.d.ts +20 -23
- package/dist/types/ultramodern-workspace/workspace-script-plan.d.ts +7 -21
- package/dist/types/ultramodern-workspace/workspace-scripts.d.ts +2 -9
- package/dist/types/ultramodern-workspace/workspace-validation-contract.d.ts +0 -1
- package/dist/types/ultramodern-workspace/write-workspace.d.ts +0 -1
- package/package.json +14 -12
- package/template-workspace/AGENTS.md.handlebars +2 -2
- package/template-workspace/README.md.handlebars +3 -4
- package/template-workspace/patches/{@module-federation__bridge-react@2.6.0.patch → @module-federation__bridge-react@2.7.0.patch} +22 -22
- package/template-workspace/patches/@module-federation__dts-plugin@2.7.0.patch +37 -0
- package/template-workspace/patches/{@module-federation__modern-js-v3@2.6.0.patch → @module-federation__modern-js-v3@2.7.0.patch} +22 -22
- package/template-workspace/patches/@tanstack__router-core@1.171.14.patch +123 -0
- package/template-workspace/pnpm-workspace.yaml.handlebars +24 -2
- package/templates/workspace/apps/modern.config.ts.handlebars +1 -1
- package/templates/workspace-scripts/assert-mf-types.mjs.handlebars +4 -4
- package/templates/workspace-scripts/ultramodern-typecheck.mjs +1 -1
- package/templates/workspace-scripts/validate-ultramodern-workspace.mjs.handlebars +3 -5
- package/dist/cjs/ultramodern-workspace/pnpm-workspace-policy-plan.cjs +0 -166
- package/dist/esm/ultramodern-workspace/pnpm-workspace-policy-plan.js +0 -113
- package/dist/esm-node/ultramodern-workspace/pnpm-workspace-policy-plan.js +0 -114
- package/dist/types/ultramodern-workspace/pnpm-workspace-policy-plan.d.ts +0 -39
- package/template-workspace/patches/@tanstack__router-core@1.171.13.patch +0 -51
- package/templates/workspace/postcss.config.mjs.handlebars +0 -5
|
@@ -7,7 +7,7 @@ function updateGeneratedBuildIdentityModules(io, config) {
|
|
|
7
7
|
let changed = false;
|
|
8
8
|
for (const app of workspaceAppsFromToolingConfig(config)){
|
|
9
9
|
changed = writeTextIfChanged(io, node_path.join(io.workspaceRoot, app.directory, 'src/ultramodern-build.ts'), createUltramodernBuildReexportModule()) || changed;
|
|
10
|
-
changed = writeTextIfChanged(io, node_path.join(io.workspaceRoot, app.directory, 'shared/ultramodern-build.ts'), createUltramodernBuildModule()) || changed;
|
|
10
|
+
changed = writeTextIfChanged(io, node_path.join(io.workspaceRoot, app.directory, 'shared/ultramodern-build.ts'), createUltramodernBuildModule(config.workspace.packageScope, app)) || changed;
|
|
11
11
|
changed = writeTextIfChanged(io, node_path.join(io.workspaceRoot, app.directory, 'shared/ultramodern-build.json'), createUltramodernBuildArtifactJson(config.workspace.packageScope, app)) || changed;
|
|
12
12
|
}
|
|
13
13
|
return changed;
|
|
@@ -7,7 +7,7 @@ function updateGeneratedModernConfigs(io, config) {
|
|
|
7
7
|
let changed = false;
|
|
8
8
|
const apps = workspaceAppsFromToolingConfig(config);
|
|
9
9
|
const remotes = apps.filter((app)=>'shell' !== app.kind);
|
|
10
|
-
for (const app of apps)changed = writeTextIfChanged(io, node_path.join(io.workspaceRoot, app.directory, 'modern.config.ts'), createAppModernConfig(config.workspace.packageScope, app, remotes)) || changed;
|
|
10
|
+
for (const app of apps)changed = writeTextIfChanged(io, node_path.join(io.workspaceRoot, app.directory, 'modern.config.ts'), createAppModernConfig(config.workspace.packageScope, app, remotes, config.features.tailwind)) || changed;
|
|
11
11
|
return changed;
|
|
12
12
|
}
|
|
13
13
|
export { updateGeneratedModernConfigs };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "node:module";
|
|
2
2
|
import { ULTRAMODERN_SINGLE_APP_MODERN_PACKAGES, ULTRAMODERN_WORKSPACE_MODERN_PACKAGES, modernPackageSpecifier } from "../../../ultramodern-package-source.js";
|
|
3
|
-
import { EFFECT_TSGO_VERSION, OXFMT_VERSION, OXLINT_VERSION,
|
|
3
|
+
import { EFFECT_TSGO_VERSION, OXFMT_VERSION, OXLINT_VERSION, TYPESCRIPT_VERSION, WRANGLER_VERSION, ZEPHYR_AGENT_VERSION, ZEPHYR_RSPACK_PLUGIN_VERSION } from "../../../ultramodern-workspace/versions.js";
|
|
4
4
|
import { createWorkspaceAppPackageScripts, createWorkspaceRootPackageScripts } from "../../../ultramodern-workspace/workspace-script-plan.js";
|
|
5
5
|
import { migratedWorkspaceScriptBasenames } from "../../../ultramodern-workspace/workspace-scripts.js";
|
|
6
6
|
const modernPackageNames = new Set([
|
|
@@ -33,8 +33,8 @@ const generatedToolingDependencyPins = new Map([
|
|
|
33
33
|
EFFECT_TSGO_VERSION
|
|
34
34
|
],
|
|
35
35
|
[
|
|
36
|
-
"
|
|
37
|
-
|
|
36
|
+
"typescript",
|
|
37
|
+
TYPESCRIPT_VERSION
|
|
38
38
|
],
|
|
39
39
|
[
|
|
40
40
|
'oxfmt',
|
|
@@ -140,7 +140,9 @@ function updateGeneratedPackageScripts(packageJson, options = {}) {
|
|
|
140
140
|
}
|
|
141
141
|
continue;
|
|
142
142
|
}
|
|
143
|
-
|
|
143
|
+
if (void 0 === value) continue;
|
|
144
|
+
const existingScript = scripts[name];
|
|
145
|
+
const nextValue = 'check' === name && 'string' == typeof existingScript ? mergeAggregateCheckScript(existingScript, value) : value;
|
|
144
146
|
if (scripts[name] !== nextValue) {
|
|
145
147
|
scripts[name] = nextValue;
|
|
146
148
|
changed = true;
|
|
@@ -4,7 +4,7 @@ import node_path from "node:path";
|
|
|
4
4
|
import { DRIZZLE_ORM_VERSION, EFFECT_VERSION, EFFECT_VITEST_VERSION, MODULE_FEDERATION_VERSION } from "../../../ultramodern-workspace/versions.js";
|
|
5
5
|
import { workspaceUsesDependency } from "./dependency-usage.js";
|
|
6
6
|
import { ensureYamlListItem, ensureYamlMapEntry, ensureYamlScalarMapEntry, removeYamlMapEntry, replaceYamlLine } from "./pnpm-yaml.js";
|
|
7
|
-
import { drizzleOrmDeclarationPatchPath, effectDeclarationPatchPath, moduleFederationBridgeReactPatchPath, moduleFederationModernJsPatchPath, strictEffectPackageVersionPolicyExclusions } from "./policy-constants.js";
|
|
7
|
+
import { drizzleOrmDeclarationPatchPath, effectDeclarationPatchPath, moduleFederationBridgeReactPatchPath, moduleFederationDtsPluginPatchPath, moduleFederationModernJsPatchPath, strictEffectPackageVersionPolicyExclusions } from "./policy-constants.js";
|
|
8
8
|
function updateGeneratedPnpmWorkspacePolicy(io) {
|
|
9
9
|
const workspaceFile = node_path.join(io.workspaceRoot, 'pnpm-workspace.yaml');
|
|
10
10
|
if (!node_fs.existsSync(workspaceFile)) return false;
|
|
@@ -64,6 +64,9 @@ function updateGeneratedPnpmWorkspacePolicy(io) {
|
|
|
64
64
|
const moduleFederationModernJsPatch = ensureYamlMapEntry(source, 'patchedDependencies', `@module-federation/modern-js-v3@${MODULE_FEDERATION_VERSION}`, moduleFederationModernJsPatchPath);
|
|
65
65
|
source = moduleFederationModernJsPatch.source;
|
|
66
66
|
changed = moduleFederationModernJsPatch.changed || changed;
|
|
67
|
+
const moduleFederationDtsPluginPatch = ensureYamlMapEntry(source, 'patchedDependencies', `@module-federation/dts-plugin@${MODULE_FEDERATION_VERSION}`, moduleFederationDtsPluginPatchPath);
|
|
68
|
+
source = moduleFederationDtsPluginPatch.source;
|
|
69
|
+
changed = moduleFederationDtsPluginPatch.changed || changed;
|
|
67
70
|
const moduleFederationBridgeReactPatch = ensureYamlMapEntry(source, 'patchedDependencies', `@module-federation/bridge-react@${MODULE_FEDERATION_VERSION}`, moduleFederationBridgeReactPatchPath);
|
|
68
71
|
source = moduleFederationBridgeReactPatch.source;
|
|
69
72
|
changed = moduleFederationBridgeReactPatch.changed || changed;
|
|
@@ -103,4 +103,4 @@ function removeYamlMapEntry(source, entryKey) {
|
|
|
103
103
|
changed
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
|
-
export { ensureYamlListItem, ensureYamlMapEntry, ensureYamlScalarMapEntry, removeYamlMapEntry, replaceYamlLine
|
|
106
|
+
export { ensureYamlListItem, ensureYamlMapEntry, ensureYamlScalarMapEntry, removeYamlMapEntry, replaceYamlLine };
|
package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/policy-constants.js
CHANGED
|
@@ -8,10 +8,12 @@ const strictEffectPackageVersionPolicyExclusions = [
|
|
|
8
8
|
];
|
|
9
9
|
const moduleFederationModernJsPatchPath = `patches/@module-federation__modern-js-v3@${MODULE_FEDERATION_VERSION}.patch`;
|
|
10
10
|
const moduleFederationModernJsPatchSourcePath = node_path.join(createPackageRoot, 'template-workspace', moduleFederationModernJsPatchPath);
|
|
11
|
+
const moduleFederationDtsPluginPatchPath = `patches/@module-federation__dts-plugin@${MODULE_FEDERATION_VERSION}.patch`;
|
|
12
|
+
const moduleFederationDtsPluginPatchSourcePath = node_path.join(createPackageRoot, 'template-workspace', moduleFederationDtsPluginPatchPath);
|
|
11
13
|
const moduleFederationBridgeReactPatchPath = `patches/@module-federation__bridge-react@${MODULE_FEDERATION_VERSION}.patch`;
|
|
12
14
|
const moduleFederationBridgeReactPatchSourcePath = node_path.join(createPackageRoot, 'template-workspace', moduleFederationBridgeReactPatchPath);
|
|
13
15
|
const effectDeclarationPatchPath = 'patches/effect-schema-error-type-id.patch';
|
|
14
16
|
const effectDeclarationPatchSourcePath = node_path.join(createPackageRoot, 'template-workspace', effectDeclarationPatchPath);
|
|
15
17
|
const drizzleOrmDeclarationPatchPath = 'patches/drizzle-orm-ts7-strict-declarations.patch';
|
|
16
18
|
const drizzleOrmDeclarationPatchSourcePath = node_path.join(createPackageRoot, 'template-workspace', drizzleOrmDeclarationPatchPath);
|
|
17
|
-
export { drizzleOrmDeclarationPatchPath, drizzleOrmDeclarationPatchSourcePath, effectDeclarationPatchPath, effectDeclarationPatchSourcePath, moduleFederationBridgeReactPatchPath, moduleFederationBridgeReactPatchSourcePath, moduleFederationModernJsPatchPath, moduleFederationModernJsPatchSourcePath, strictEffectPackageVersionPolicyExclusions };
|
|
19
|
+
export { drizzleOrmDeclarationPatchPath, drizzleOrmDeclarationPatchSourcePath, effectDeclarationPatchPath, effectDeclarationPatchSourcePath, moduleFederationBridgeReactPatchPath, moduleFederationBridgeReactPatchSourcePath, moduleFederationDtsPluginPatchPath, moduleFederationDtsPluginPatchSourcePath, moduleFederationModernJsPatchPath, moduleFederationModernJsPatchSourcePath, strictEffectPackageVersionPolicyExclusions };
|
|
@@ -120,4 +120,4 @@ function assertNonEmptyString(value, label) {
|
|
|
120
120
|
function assertSafeOutputPath(relativePath, appId) {
|
|
121
121
|
if (node_path.isAbsolute(relativePath) || relativePath.split(/[\\/]+/u).includes('..')) throw new Error(`Unsafe output path for ${appId}: ${relativePath}`);
|
|
122
122
|
}
|
|
123
|
-
export { assertNonEmptyString,
|
|
123
|
+
export { assertNonEmptyString, prepareAddUltramodernVertical };
|
|
@@ -25,7 +25,7 @@ function rewriteShellAppFiles(workspaceRoot, scope, packageSource, enableTailwin
|
|
|
25
25
|
writeJsonFile(node_path.join(workspaceRoot, `${shellApp.directory}/tsconfig.json`), createAppTsConfig(shellHost, remotes));
|
|
26
26
|
writeJsonFile(node_path.join(workspaceRoot, `${shellApp.directory}/tsconfig.mf-types.json`), createAppMfTypesTsConfig(shellHost));
|
|
27
27
|
writeFileReplacing(workspaceRoot, `${shellApp.directory}/src/modern-app-env.d.ts`, createAppEnvDts(shellHost, remotes));
|
|
28
|
-
writeFileReplacing(workspaceRoot, `${shellApp.directory}/modern.config.ts`, createAppModernConfig(scope, shellHost, remotes));
|
|
28
|
+
writeFileReplacing(workspaceRoot, `${shellApp.directory}/modern.config.ts`, createAppModernConfig(scope, shellHost, remotes, enableTailwind));
|
|
29
29
|
writeFileReplacing(workspaceRoot, publicWeb.jsonLdHelperFile.path, publicWeb.jsonLdHelperFile.content);
|
|
30
30
|
writeFileReplacing(workspaceRoot, publicWeb.routeMetadataFile.path, publicWeb.routeMetadataFile.content);
|
|
31
31
|
writeFileReplacing(workspaceRoot, publicWeb.routeHeadFile.path, publicWeb.routeHeadFile.content);
|
|
@@ -6,10 +6,13 @@ import { createModuleFederationRemoteContracts, createNeutralOwnership, shellApp
|
|
|
6
6
|
import { packageName, toEnvSegment, toPascalCase } from "../naming.js";
|
|
7
7
|
import { createCloudflareDeployContract } from "../policy.js";
|
|
8
8
|
function verticalTopologyEntry(scope, vertical, remotes = []) {
|
|
9
|
+
const backendFederation = createBackendFederationContract(scope, vertical);
|
|
9
10
|
return {
|
|
10
11
|
id: vertical.id,
|
|
11
12
|
kind: vertical.kind,
|
|
12
|
-
|
|
13
|
+
...vertical.domain ? {
|
|
14
|
+
domain: vertical.domain
|
|
15
|
+
} : {},
|
|
13
16
|
package: packageName(scope, vertical.packageSuffix),
|
|
14
17
|
path: vertical.directory,
|
|
15
18
|
moduleFederation: {
|
|
@@ -22,11 +25,10 @@ function verticalTopologyEntry(scope, vertical, remotes = []) {
|
|
|
22
25
|
remotes: createModuleFederationRemoteContracts(vertical, remotes)
|
|
23
26
|
} : {},
|
|
24
27
|
ssr: true,
|
|
25
|
-
fallbackTelemetryEvent: 'modernjs:mv-runtime-parity',
|
|
26
28
|
sharedContractVersion: 'mf-ssr-contract-v1'
|
|
27
29
|
},
|
|
28
|
-
...
|
|
29
|
-
backendFederation
|
|
30
|
+
...backendFederation ? {
|
|
31
|
+
backendFederation
|
|
30
32
|
} : {},
|
|
31
33
|
...vertical.api ? {
|
|
32
34
|
deliveryUnit: deliveryUnitContractBlock(createDeliveryUnitRecord(scope, vertical))
|
|
@@ -112,9 +112,6 @@ function createRemoteStyles(enableTailwind, scope, app) {
|
|
|
112
112
|
function createAppStyles(enableTailwind, scope, app) {
|
|
113
113
|
return 'shell' === app.kind ? createShellStyles(enableTailwind, scope) : createRemoteStyles(enableTailwind, scope, app);
|
|
114
114
|
}
|
|
115
|
-
function createPostcssConfig() {
|
|
116
|
-
return renderFileTemplate('workspace/postcss.config.mjs', {});
|
|
117
|
-
}
|
|
118
115
|
function createTailwindConfig() {
|
|
119
116
|
return renderFileTemplate('workspace/tailwind.config.ts', {});
|
|
120
117
|
}
|
|
@@ -129,4 +126,4 @@ function createRouteHeadModule(app) {
|
|
|
129
126
|
function createShellFrameComponent() {
|
|
130
127
|
return readFileTemplate('app/shell-frame.tsx');
|
|
131
128
|
}
|
|
132
|
-
export { createAppEnvDts, createAppRuntimeConfig, createAppStyles,
|
|
129
|
+
export { createAppEnvDts, createAppRuntimeConfig, createAppStyles, createRouteHeadModule, createSharedDesignTokensCss, createShellFrameComponent, createTailwindConfig };
|
|
@@ -7,6 +7,20 @@ import { packageName } from "./naming.js";
|
|
|
7
7
|
import { createCloudflareDeployContract } from "./policy.js";
|
|
8
8
|
import { createGeneratedToolingWrapperMap } from "./tooling-command-catalog.js";
|
|
9
9
|
import { CLOUDFLARE_COMPATIBILITY_DATE, NODE_VERSION, PNPM_VERSION } from "./versions.js";
|
|
10
|
+
function isJsonValue(value) {
|
|
11
|
+
return void 0 !== value;
|
|
12
|
+
}
|
|
13
|
+
function optionalJsonEntry(key, value) {
|
|
14
|
+
return void 0 === value ? {} : {
|
|
15
|
+
[key]: value
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function jsonEntries(entries) {
|
|
19
|
+
return Object.fromEntries(entries.filter((entry)=>isJsonValue(entry[1])));
|
|
20
|
+
}
|
|
21
|
+
function presentJsonValues(values) {
|
|
22
|
+
return values.filter(isJsonValue);
|
|
23
|
+
}
|
|
10
24
|
function createTopology(scope, remotes = []) {
|
|
11
25
|
const shellHost = createShellHost(remotes);
|
|
12
26
|
return {
|
|
@@ -18,7 +32,7 @@ function createTopology(scope, remotes = []) {
|
|
|
18
32
|
id: shellApp.id,
|
|
19
33
|
kind: 'shell',
|
|
20
34
|
package: packageName(scope, shellApp.packageSuffix),
|
|
21
|
-
verticalRefs: shellHost.verticalRefs,
|
|
35
|
+
verticalRefs: shellHost.verticalRefs ?? [],
|
|
22
36
|
moduleFederation: {
|
|
23
37
|
role: 'host',
|
|
24
38
|
name: shellApp.mfName,
|
|
@@ -32,7 +46,9 @@ function createTopology(scope, remotes = []) {
|
|
|
32
46
|
verticals: remotes.map((vertical)=>({
|
|
33
47
|
id: vertical.id,
|
|
34
48
|
kind: vertical.kind,
|
|
35
|
-
|
|
49
|
+
...vertical.domain ? {
|
|
50
|
+
domain: vertical.domain
|
|
51
|
+
} : {},
|
|
36
52
|
package: packageName(scope, vertical.packageSuffix),
|
|
37
53
|
path: vertical.directory,
|
|
38
54
|
moduleFederation: {
|
|
@@ -45,18 +61,13 @@ function createTopology(scope, remotes = []) {
|
|
|
45
61
|
remotes: createModuleFederationRemoteContracts(vertical)
|
|
46
62
|
} : {},
|
|
47
63
|
ssr: true,
|
|
48
|
-
fallbackTelemetryEvent: 'modernjs:mv-runtime-parity',
|
|
49
64
|
sharedContractVersion: 'mf-ssr-contract-v1'
|
|
50
65
|
},
|
|
51
|
-
...createBackendFederationContract(scope, vertical)
|
|
52
|
-
backendFederation: createBackendFederationContract(scope, vertical)
|
|
53
|
-
} : {},
|
|
66
|
+
...optionalJsonEntry('backendFederation', createBackendFederationContract(scope, vertical)),
|
|
54
67
|
...vertical.api ? {
|
|
55
68
|
deliveryUnit: deliveryUnitContractBlock(createDeliveryUnitRecord(scope, vertical))
|
|
56
69
|
} : {},
|
|
57
|
-
...apiTopologyMetadata(vertical)
|
|
58
|
-
api: apiTopologyMetadata(vertical)
|
|
59
|
-
} : {},
|
|
70
|
+
...optionalJsonEntry('api', apiTopologyMetadata(vertical)),
|
|
60
71
|
cloudflare: createCloudflareDeployContract(scope, vertical),
|
|
61
72
|
ownership: vertical.ownership
|
|
62
73
|
})),
|
|
@@ -125,7 +136,7 @@ function createDevelopmentOverlay(scope, remotes = []) {
|
|
|
125
136
|
remote.id,
|
|
126
137
|
`http://localhost:${remote.port}/mf-manifest.json`
|
|
127
138
|
])),
|
|
128
|
-
serverExecution:
|
|
139
|
+
serverExecution: jsonEntries(verticalApiApps(remotes).map((app)=>[
|
|
129
140
|
app.id,
|
|
130
141
|
createServerExecutionOverlay(scope, app)
|
|
131
142
|
])),
|
|
@@ -193,7 +204,7 @@ function createUltramodernConfig(scope, modernVersion, packageSource, apps = [
|
|
|
193
204
|
name: app.mfName,
|
|
194
205
|
exposes: Object.keys(app.exposes ?? {}),
|
|
195
206
|
...'shell' === app.kind ? {
|
|
196
|
-
verticalRefs: shellHost.verticalRefs,
|
|
207
|
+
verticalRefs: shellHost.verticalRefs ?? [],
|
|
197
208
|
remotes: createModuleFederationRemoteContracts(shellHost, remotes)
|
|
198
209
|
} : app.verticalRefs?.length ? {
|
|
199
210
|
verticalRefs: app.verticalRefs,
|
|
@@ -201,13 +212,11 @@ function createUltramodernConfig(scope, modernVersion, packageSource, apps = [
|
|
|
201
212
|
} : {},
|
|
202
213
|
ssr: true,
|
|
203
214
|
dts: {
|
|
204
|
-
compilerInstance: 'tsgo',
|
|
215
|
+
compilerInstance: 'effect-tsgo',
|
|
205
216
|
tsConfigPath: './tsconfig.mf-types.json'
|
|
206
217
|
}
|
|
207
218
|
},
|
|
208
|
-
...createBackendFederationContract(scope, app)
|
|
209
|
-
backendFederation: createBackendFederationContract(scope, app)
|
|
210
|
-
} : {},
|
|
219
|
+
...optionalJsonEntry('backendFederation', createBackendFederationContract(scope, app)),
|
|
211
220
|
...app.api ? {
|
|
212
221
|
deliveryUnit: deliveryUnitContractBlock(createDeliveryUnitRecord(scope, app))
|
|
213
222
|
} : {},
|
|
@@ -255,7 +264,7 @@ function createUltramodernConfig(scope, modernVersion, packageSource, apps = [
|
|
|
255
264
|
}))
|
|
256
265
|
},
|
|
257
266
|
backendFederation: {
|
|
258
|
-
apps: verticalApiApps(remotes).map((app)=>createBackendFederationSummary(scope, app))
|
|
267
|
+
apps: presentJsonValues(verticalApiApps(remotes).map((app)=>createBackendFederationSummary(scope, app)))
|
|
259
268
|
},
|
|
260
269
|
agentSkills: {
|
|
261
270
|
target: 'codex',
|
|
@@ -97,7 +97,7 @@ nothing.
|
|
|
97
97
|
for (const app of apiApps){
|
|
98
98
|
const buildModulePath = node_path.join(app.directory, 'shared/ultramodern-build.ts');
|
|
99
99
|
const buildArtifactPath = node_path.join(app.directory, 'shared/ultramodern-build.json');
|
|
100
|
-
track(buildModulePath, writeTextIfChanged(node_path.join(workspaceRoot, buildModulePath), createUltramodernBuildModule()));
|
|
100
|
+
track(buildModulePath, writeTextIfChanged(node_path.join(workspaceRoot, buildModulePath), createUltramodernBuildModule(scope, app)));
|
|
101
101
|
track(buildArtifactPath, writeTextIfChanged(node_path.join(workspaceRoot, buildArtifactPath), createUltramodernBuildArtifactJson(scope, app)));
|
|
102
102
|
}
|
|
103
103
|
if (0 === written.length) process.stdout.write('[ultramodern] sync-delivery-unit: already in sync; no files written.\n');
|
|
@@ -212,4 +212,4 @@ function remoteComponentOutputPath(app, expose) {
|
|
|
212
212
|
if (!exposePath?.startsWith('./src/components/')) return;
|
|
213
213
|
return `${app.directory}/${exposePath.replace(/^\.\//u, '')}`;
|
|
214
214
|
}
|
|
215
|
-
export { createLayout, createRemoteEntry, createRemoteExposeComponent, createRemotePage,
|
|
215
|
+
export { createLayout, createRemoteEntry, createRemoteExposeComponent, createRemotePage, createShellPage, createShellRemoteComponents, remoteComponentOutputPath };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import "node:module";
|
|
2
2
|
import { spawnSync } from "node:child_process";
|
|
3
|
-
import node_crypto from "node:crypto";
|
|
4
3
|
import node_fs from "node:fs";
|
|
5
4
|
import { createRequire } from "node:module";
|
|
6
5
|
import node_path from "node:path";
|
|
@@ -197,19 +196,6 @@ function collectTemplateFiles(dir) {
|
|
|
197
196
|
collect(dir);
|
|
198
197
|
return files;
|
|
199
198
|
}
|
|
200
|
-
function hashFile(filePath) {
|
|
201
|
-
return node_crypto.createHash('sha256').update(node_fs.readFileSync(filePath)).digest('hex');
|
|
202
|
-
}
|
|
203
|
-
function hashTemplateTree(dir) {
|
|
204
|
-
const hash = node_crypto.createHash('sha256');
|
|
205
|
-
for (const relativePath of collectTemplateFiles(dir)){
|
|
206
|
-
hash.update(relativePath);
|
|
207
|
-
hash.update('\0');
|
|
208
|
-
hash.update(hashFile(node_path.join(dir, relativePath)));
|
|
209
|
-
hash.update('\0');
|
|
210
|
-
}
|
|
211
|
-
return hash.digest('hex');
|
|
212
|
-
}
|
|
213
199
|
function copyRootTemplate(targetDir, data) {
|
|
214
200
|
for (const relativePath of collectTemplateFiles(workspaceTemplateDir)){
|
|
215
201
|
const sourcePath = node_path.join(workspaceTemplateDir, relativePath);
|
|
@@ -224,4 +210,4 @@ function readJsonFile(filePath) {
|
|
|
224
210
|
function writeJsonFile(filePath, value) {
|
|
225
211
|
node_fs.writeFileSync(filePath, `${JSON.stringify(value, null, 2)}\n`, 'utf-8');
|
|
226
212
|
}
|
|
227
|
-
export {
|
|
213
|
+
export { copyRootTemplate, createPackageRoot, formatGeneratedWorkspaceFiles, readFileTemplate, readJsonFile, renderFileTemplate, renderTemplate, workspaceTemplateDir, writeFile, writeFileReplacing, writeJson, writeJsonFile };
|
|
@@ -120,4 +120,4 @@ function createAppPublicLocaleMessages(app, language, remotes = []) {
|
|
|
120
120
|
if ('shell' !== app.kind) return createAppLocaleMessages(app, language);
|
|
121
121
|
return Object.assign({}, createAppLocaleMessages(app, language), ...remotes.map((remote)=>createAppLocaleMessages(remote, language)));
|
|
122
122
|
}
|
|
123
|
-
export {
|
|
123
|
+
export { createAppPublicLocaleMessages };
|
|
@@ -18,8 +18,9 @@ function extractDtsSettings(configPath, value) {
|
|
|
18
18
|
if (!dts || dts.hasSpread) throw new Error(`Cannot statically extract Module Federation DTS settings from ${configPath}; use a literal dts object.`);
|
|
19
19
|
const generateTypes = parseObjectLiteral(dts.properties.get('generateTypes'));
|
|
20
20
|
if (generateTypes?.hasSpread) throw new Error(`Cannot statically extract Module Federation generateTypes settings from ${configPath}; use a literal generateTypes object.`);
|
|
21
|
+
const compilerInstanceSource = generateTypes?.properties.get('compilerInstance');
|
|
21
22
|
return {
|
|
22
|
-
compilerInstance: parseLiteralString(
|
|
23
|
+
compilerInstance: parseLiteralString(compilerInstanceSource) ?? ('tsgoCompilerInstance' === compilerInstanceSource ? 'effect-tsgo' : void 0),
|
|
23
24
|
tsConfigPath: parseLiteralString(dts.properties.get('tsConfigPath'))
|
|
24
25
|
};
|
|
25
26
|
}
|
|
@@ -43,4 +44,4 @@ function inspectModuleFederationConfigSource(source, appDir, configPath) {
|
|
|
43
44
|
hostOnlyNoExposes
|
|
44
45
|
};
|
|
45
46
|
}
|
|
46
|
-
export {
|
|
47
|
+
export { inspectModuleFederationConfigSource };
|
|
@@ -142,4 +142,4 @@ function parseArrayLiteral(source) {
|
|
|
142
142
|
}
|
|
143
143
|
return exposes;
|
|
144
144
|
}
|
|
145
|
-
export {
|
|
145
|
+
export { parseArrayLiteral, parseLiteralString, parseObjectLiteral };
|
|
@@ -87,4 +87,4 @@ function scanForModuleFederationConfigs(workspaceRoot, scanRoot, appDirs) {
|
|
|
87
87
|
};
|
|
88
88
|
visit(absoluteRoot);
|
|
89
89
|
}
|
|
90
|
-
export {
|
|
90
|
+
export { collectBridgeScanRoots, collectMetadataAppDirs, firstSegment, isRecord, normalizeRelativePath, readGeneratedMetadata, readJsonIfExists, relativePath, scanForModuleFederationConfigs, toPosixPath };
|
|
@@ -152,4 +152,4 @@ function getOuterBlock(source, open, close) {
|
|
|
152
152
|
suffix
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
|
-
export {
|
|
155
|
+
export { findCreateModuleFederationConfigObject, findExportDefaultObject, getOuterBlock, skipSyntax };
|
|
@@ -6,7 +6,7 @@ import { discoverModuleFederationConfigs } from "./discovery.js";
|
|
|
6
6
|
import { inspectModuleFederationConfigSource } from "./inspect.js";
|
|
7
7
|
import { relativePath } from "./path-utils.js";
|
|
8
8
|
function assertExposedAppDtsSettings(app) {
|
|
9
|
-
if ('tsgo' !== app.dts.compilerInstance) throw new Error(`Module Federation DTS compilerInstance must
|
|
9
|
+
if ('effect-tsgo' !== app.dts.compilerInstance) throw new Error(`Module Federation DTS compilerInstance must resolve "@effect/tsgo" for ${app.appDir}.`);
|
|
10
10
|
if ('./tsconfig.mf-types.json' !== app.dts.tsConfigPath) throw new Error(`Module Federation DTS tsConfigPath must be "./tsconfig.mf-types.json" for ${app.appDir}.`);
|
|
11
11
|
}
|
|
12
12
|
function assertTypesArchive(workspaceRoot, appDir) {
|
|
@@ -8,8 +8,9 @@ import { sortJsonValue } from "../types.js";
|
|
|
8
8
|
import { CLOUDFLARE_COMPATIBILITY_DATE } from "../versions.js";
|
|
9
9
|
import { createModuleFederationRemoteUrlHelpers, createModuleFederationRemotesConfig } from "./remote-refs.js";
|
|
10
10
|
import { createSharedModuleFederationConfig, formatTsObjectLiteral } from "./shared-config.js";
|
|
11
|
-
function createAppModernConfig(scope, app, remotes = []) {
|
|
11
|
+
function createAppModernConfig(scope, app, remotes = [], enableTailwind = true) {
|
|
12
12
|
const bffImport = appHasApi(app) ? "import { bffPlugin } from '@modern-js/plugin-bff';\n" : '';
|
|
13
|
+
const tailwindImport = enableTailwind ? "import { pluginTailwindcss } from '@rsbuild/plugin-tailwindcss';\n" : '';
|
|
13
14
|
const bffConfig = appHasApi(app) ? ` bff: {
|
|
14
15
|
effect: {
|
|
15
16
|
entry: './api/index',
|
|
@@ -22,6 +23,7 @@ function createAppModernConfig(scope, app, remotes = []) {
|
|
|
22
23
|
runtimeFramework: 'effect',
|
|
23
24
|
},
|
|
24
25
|
` : '';
|
|
26
|
+
const tailwindBuilderPluginsConfig = enableTailwind ? ' builderPlugins: [pluginTailwindcss()],\n' : '';
|
|
25
27
|
const bffPluginEntry = appHasApi(app) ? ' bffPlugin(),\n' : '';
|
|
26
28
|
const serviceBindings = 'shell' === app.kind ? remotes.filter(appHasApi) : [];
|
|
27
29
|
const serviceBindingsConfig = serviceBindings.length > 0 ? ` services: [
|
|
@@ -48,13 +50,13 @@ const defaultAssetPrefix = defaultRemoteAssetPrefix;`;
|
|
|
48
50
|
// shells load remoteEntry.js and exposed chunks from this dev server.
|
|
49
51
|
assetPrefix,`;
|
|
50
52
|
return renderFileTemplate('workspace/apps/modern.config.ts', {
|
|
51
|
-
value0: bffImport
|
|
53
|
+
value0: `${bffImport}${tailwindImport}`,
|
|
52
54
|
value1: app.id,
|
|
53
55
|
value2: createCloudflareWorkerName(scope, app),
|
|
54
56
|
value3: app.portEnv,
|
|
55
|
-
value4: app.port,
|
|
57
|
+
value4: String(app.port),
|
|
56
58
|
value5: createCloudflarePublicUrlEnv(app),
|
|
57
|
-
value6: shellApp.port,
|
|
59
|
+
value6: String(shellApp.port),
|
|
58
60
|
value7: defaultAssetPrefixSource,
|
|
59
61
|
value8: createCloudflarePublicUrlEnv(app),
|
|
60
62
|
value9: bffConfig,
|
|
@@ -65,14 +67,15 @@ const defaultAssetPrefix = defaultRemoteAssetPrefix;`;
|
|
|
65
67
|
value14: resolveApiPrefix(app),
|
|
66
68
|
value15: bffPluginEntry,
|
|
67
69
|
value16: createRspackUniqueName(app),
|
|
68
|
-
value17: createRspackChunkLoadingGlobal(app)
|
|
70
|
+
value17: createRspackChunkLoadingGlobal(app),
|
|
71
|
+
value18: tailwindBuilderPluginsConfig
|
|
69
72
|
});
|
|
70
73
|
}
|
|
71
74
|
function createModuleFederationDtsConfig(hasExposes) {
|
|
72
75
|
return hasExposes ? ` dts: {
|
|
73
76
|
displayErrorInTerminal: true,
|
|
74
77
|
generateTypes: {
|
|
75
|
-
compilerInstance:
|
|
78
|
+
compilerInstance: tsgoCompilerInstance,
|
|
76
79
|
},
|
|
77
80
|
tsConfigPath: './tsconfig.mf-types.json',
|
|
78
81
|
},` : ` dts: {
|
|
@@ -169,8 +172,16 @@ function createRemoteModuleFederationConfig(scope, app, remotes = []) {
|
|
|
169
172
|
const exposes = formatTsObjectLiteral(app.exposes ?? {});
|
|
170
173
|
const hasExposes = Object.keys(app.exposes ?? {}).length > 0;
|
|
171
174
|
const hostOnlyMarker = hasExposes ? '' : '\n// ultramodern-mf: no-exposes';
|
|
175
|
+
const tsgoCompilerImport = hasExposes ? "import { execFileSync } from 'node:child_process';\n" : '';
|
|
176
|
+
const tsgoCompilerInstance = hasExposes ? `
|
|
177
|
+
const tsgoCompilerInstance =
|
|
178
|
+
process.env.EFFECT_TSGO_BIN?.trim() ||
|
|
179
|
+
execFileSync('npx', ['effect-tsgo', 'get-exe-path'], {
|
|
180
|
+
encoding: 'utf8',
|
|
181
|
+
}).trim();
|
|
182
|
+
` : '';
|
|
172
183
|
return `// @effect-diagnostics nodeBuiltinImport:off${hostOnlyMarker}
|
|
173
|
-
import { createRequire } from 'node:module';
|
|
184
|
+
${tsgoCompilerImport}import { createRequire } from 'node:module';
|
|
174
185
|
import { createModuleFederationConfig } from '@module-federation/modern-js-v3';
|
|
175
186
|
import { dependencies } from './package.json';
|
|
176
187
|
|
|
@@ -180,7 +191,7 @@ const pluginTanstackVersion = (require('@modern-js/plugin-tanstack/package.json'
|
|
|
180
191
|
const runtimeVersion = (require('@modern-js/runtime/package.json') as { version: string }).version;
|
|
181
192
|
const reactVersion = (require('react/package.json') as { version: string }).version;
|
|
182
193
|
const reactDomVersion = (require('react-dom/package.json') as { version: string }).version;
|
|
183
|
-
|
|
194
|
+
${tsgoCompilerInstance}
|
|
184
195
|
${createModuleFederationRemoteUrlHelpers(app, remotes)}
|
|
185
196
|
const moduleFederationConfig: Parameters<
|
|
186
197
|
typeof createModuleFederationConfig
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
import {
|
|
2
|
+
import { createUltramodernBuildArtifact } from "@modern-js/utils/universal";
|
|
3
3
|
import { createDeliveryUnitRecord } from "../delivery-unit.js";
|
|
4
4
|
function createUltramodernBuildArtifactJson(scope, app) {
|
|
5
5
|
const record = createDeliveryUnitRecord(scope, app);
|
|
6
6
|
return `${JSON.stringify(createUltramodernBuildArtifact(record), null, 2)}\n`;
|
|
7
7
|
}
|
|
8
|
-
function createUltramodernBuildModule() {
|
|
9
|
-
|
|
8
|
+
function createUltramodernBuildModule(scope, app) {
|
|
9
|
+
const record = createDeliveryUnitRecord(scope, app);
|
|
10
|
+
return `const ultramodernBuildArtifact = ${JSON.stringify(createUltramodernBuildArtifact(record), null, 2)} as const;
|
|
10
11
|
|
|
11
12
|
export { ultramodernBuildArtifact };
|
|
12
13
|
|
|
@@ -69,4 +69,4 @@ function createTw(prefix) {
|
|
|
69
69
|
function toPascalCase(value) {
|
|
70
70
|
return value.split(/[-_]+/).filter(Boolean).map((part)=>`${part.charAt(0).toUpperCase()}${part.slice(1)}`).join('');
|
|
71
71
|
}
|
|
72
|
-
export {
|
|
72
|
+
export { assertUniqueTailwindPrefixes, createRspackChunkLoadingGlobal, createRspackUniqueName, createTw, naming_packageName as packageName, normalizePath, relativeRootFor, tailwindPrefixForApp, toCamelCase, toEnvSegment, toKebabCase, toPackageScope, toPascalCase };
|
|
@@ -3,7 +3,7 @@ import { WORKSPACE_PACKAGE_VERSION, modernPackageSpecifier } from "../ultramoder
|
|
|
3
3
|
import { appHasApi, remoteDependencyAlias, resolveRemoteRefs, shellApp, verticalApiApps, zephyrRemoteDependency } from "./descriptors.js";
|
|
4
4
|
import { readFileTemplate } from "./fs-io.js";
|
|
5
5
|
import { packageName, relativeRootFor } from "./naming.js";
|
|
6
|
-
import { EFFECT_TSGO_VERSION, I18NEXT_VERSION, LEFTHOOK_VERSION, MODULE_FEDERATION_VERSION, NODE_FETCH_VERSION, OXFMT_VERSION, OXLINT_VERSION, PNPM_VERSION,
|
|
6
|
+
import { EFFECT_TSGO_VERSION, I18NEXT_VERSION, LEFTHOOK_VERSION, MODULE_FEDERATION_VERSION, NODE_FETCH_VERSION, OXFMT_VERSION, OXLINT_VERSION, PNPM_VERSION, REACT_DOM_VERSION, REACT_ROUTER_VERSION, REACT_VERSION, RSBUILD_PLUGIN_TAILWINDCSS_VERSION, TAILWIND_VERSION, TANSTACK_ROUTER_VERSION, TYPESCRIPT_COMPILER_API_VERSION, TYPESCRIPT_VERSION, TYPES_REACT_DOM_VERSION, TYPES_REACT_VERSION, ULTRACITE_VERSION, WRANGLER_VERSION, ZEPHYR_AGENT_VERSION, ZEPHYR_RSPACK_PLUGIN_VERSION } from "./versions.js";
|
|
7
7
|
import { createStrictTsgoTypecheckCommand, createWorkspaceAppPackageScripts, createWorkspaceRootPackageScripts } from "./workspace-script-plan.js";
|
|
8
8
|
function appDependencies(scope, packageSource, app, remotes = [], bridge) {
|
|
9
9
|
const dependencies = {
|
|
@@ -39,11 +39,9 @@ function appDevDependencies(packageSource, enableTailwind) {
|
|
|
39
39
|
'@modern-js/app-tools': modernPackageSpecifier('@modern-js/app-tools', packageSource),
|
|
40
40
|
'@effect/tsgo': EFFECT_TSGO_VERSION,
|
|
41
41
|
...enableTailwind ? {
|
|
42
|
-
'@tailwindcss
|
|
43
|
-
postcss: `^${POSTCSS_VERSION}`,
|
|
42
|
+
'@rsbuild/plugin-tailwindcss': `^${RSBUILD_PLUGIN_TAILWINDCSS_VERSION}`,
|
|
44
43
|
tailwindcss: `^${TAILWIND_VERSION}`
|
|
45
44
|
} : {},
|
|
46
|
-
"@typescript/native-preview": TYPESCRIPT_NATIVE_PREVIEW_VERSION,
|
|
47
45
|
'@types/node': '^20',
|
|
48
46
|
'@types/react': TYPES_REACT_VERSION,
|
|
49
47
|
'@types/react-dom': TYPES_REACT_DOM_VERSION,
|
|
@@ -124,7 +122,7 @@ function createRootPackageJson(scope, packageSource, remotes = [], bridge) {
|
|
|
124
122
|
'@modern-js/code-tools': modernPackageSpecifier('@modern-js/code-tools', packageSource),
|
|
125
123
|
'@modern-js/create': modernPackageSpecifier('@modern-js/create', packageSource),
|
|
126
124
|
'@modern-js/plugin-bff': modernPackageSpecifier('@modern-js/plugin-bff', packageSource),
|
|
127
|
-
"@typescript/
|
|
125
|
+
"@typescript/typescript6": TYPESCRIPT_COMPILER_API_VERSION,
|
|
128
126
|
lefthook: LEFTHOOK_VERSION,
|
|
129
127
|
oxlint: OXLINT_VERSION,
|
|
130
128
|
oxfmt: OXFMT_VERSION,
|
|
@@ -188,8 +186,7 @@ function createSharedPackage(scope, id, description) {
|
|
|
188
186
|
typecheck: createStrictTsgoTypecheckCommand(`packages/${id}`)
|
|
189
187
|
},
|
|
190
188
|
devDependencies: {
|
|
191
|
-
'@effect/tsgo': EFFECT_TSGO_VERSION
|
|
192
|
-
"@typescript/native-preview": TYPESCRIPT_NATIVE_PREVIEW_VERSION
|
|
189
|
+
'@effect/tsgo': EFFECT_TSGO_VERSION
|
|
193
190
|
}
|
|
194
191
|
};
|
|
195
192
|
if ('shared-design-tokens' === id) packageJson.exports = {
|
|
@@ -202,4 +199,4 @@ function createSharedContractsIndex() {
|
|
|
202
199
|
return readFileTemplate('packages/shared-contracts-index.ts');
|
|
203
200
|
}
|
|
204
201
|
export { createAppMfTypesTsConfig, createAppTsConfig, createPackageTsConfig, createRootTsConfig, createSharedPackageTsConfig, createTsConfigBase } from "./tsconfigs.js";
|
|
205
|
-
export { appDependencies,
|
|
202
|
+
export { appDependencies, createAppPackage, createRootPackageJson, createSharedContractsIndex, createSharedPackage };
|
|
@@ -146,15 +146,9 @@ const PUBLIC_WEBSITE_POLICY = {
|
|
|
146
146
|
function formatTsJsonValue(value, indent) {
|
|
147
147
|
return JSON.stringify(value, null, 2).replaceAll('\n', `\n${' '.repeat(indent)}`);
|
|
148
148
|
}
|
|
149
|
-
function formatIntegerCodeLiteral(value) {
|
|
150
|
-
return String(value).replace(/\B(?=(\d{3})+(?!\d))/gu, '_');
|
|
151
|
-
}
|
|
152
149
|
function createPublicWebsiteQualityGateContract() {
|
|
153
150
|
return PUBLIC_WEBSITE_POLICY.qualityGates;
|
|
154
151
|
}
|
|
155
|
-
function createPublicWebsiteBudgetFallback(budgetName) {
|
|
156
|
-
return formatIntegerCodeLiteral(PUBLIC_WEBSITE_POLICY.qualityGates.budgets[budgetName]);
|
|
157
|
-
}
|
|
158
152
|
function createPublicHeadRobotsPolicy() {
|
|
159
153
|
return PUBLIC_WEBSITE_POLICY.publicHead;
|
|
160
154
|
}
|
|
@@ -181,4 +175,4 @@ function createCloudflareDeployContract(scope, app) {
|
|
|
181
175
|
}
|
|
182
176
|
};
|
|
183
177
|
}
|
|
184
|
-
export {
|
|
178
|
+
export { createCloudflareDeployContract, createCloudflareSecurityContract, createPublicHeadRobotsPolicy, createPublicSurfaceContentExpansionPolicy, formatTsJsonValue };
|
|
@@ -181,4 +181,4 @@ function createPublicWebAppArtifacts(app) {
|
|
|
181
181
|
publicSurface: createPublicSurfaceContract(app)
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
|
-
export { createLocalisedPublicPath,
|
|
184
|
+
export { createLocalisedPublicPath, createPublicSurfaceGenerationCommand, createPublicWebAppArtifacts, publicSurfaceManagedSourceAssetPaths, rewriteWorkspaceAssetsForApp, uniqueSorted };
|
|
@@ -144,4 +144,4 @@ function createRouteAliasPage(canonicalPath) {
|
|
|
144
144
|
return `export { default } from '${rootPageImport}';
|
|
145
145
|
`;
|
|
146
146
|
}
|
|
147
|
-
export { createJsonLdHelperModule, createLocalisedUrlsMap,
|
|
147
|
+
export { createJsonLdHelperModule, createLocalisedUrlsMap, createPublicRouteMetadata, createPublicRouteMetadataFromRoutes, createRouteAliasPage, createRouteMetaFilePath, createRouteMetaModule, createRouteMetadataModule, createRouteOwnedI18nPaths, createRoutePageFilePath, isConcretePublicPath, normalisePublicPath, routePathParamName, routeSegmentToDirectory, splitPublicPathSegments };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import "node:module";
|
|
2
2
|
const SHARED_ULTRAMODERN_WORKSPACE_PATCH_FILES = [
|
|
3
|
-
'@module-federation__bridge-react@2.
|
|
4
|
-
'@module-
|
|
5
|
-
'@
|
|
3
|
+
'@module-federation__bridge-react@2.7.0.patch',
|
|
4
|
+
'@module-federation__dts-plugin@2.7.0.patch',
|
|
5
|
+
'@module-federation__modern-js-v3@2.7.0.patch',
|
|
6
|
+
'@tanstack__router-core@1.171.14.patch'
|
|
6
7
|
];
|
|
7
8
|
export { SHARED_ULTRAMODERN_WORKSPACE_PATCH_FILES };
|
|
@@ -98,4 +98,4 @@ const createToolingWrapperContract = ()=>Object.fromEntries(generatedToolingComm
|
|
|
98
98
|
command.wrapperPath
|
|
99
99
|
]));
|
|
100
100
|
const createGeneratedToolingWrapperMap = createToolingWrapperContract;
|
|
101
|
-
export { GENERATED_TOOLING_COMMANDS, createGeneratedToolingWrapperMap,
|
|
101
|
+
export { GENERATED_TOOLING_COMMANDS, createGeneratedToolingWrapperMap, generatedToolingCommandList, generatedToolingCommands };
|