@bleedingdev/modern-js-create 3.5.0-ultramodern.1 → 3.5.0-ultramodern.11
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 +10 -6
- package/dist/cjs/ultramodern-tooling/commands.cjs +271 -3
- package/dist/cjs/ultramodern-workspace/app-files.cjs +8 -11
- package/dist/cjs/ultramodern-workspace/package-json.cjs +15 -7
- package/dist/cjs/ultramodern-workspace/versions.cjs +9 -4
- package/dist/cjs/ultramodern-workspace/workspace-scripts.cjs +1 -0
- package/dist/cjs/ultramodern-workspace/write-workspace.cjs +1 -0
- package/dist/esm/ultramodern-tooling/commands.js +271 -3
- package/dist/esm/ultramodern-workspace/app-files.js +8 -11
- package/dist/esm/ultramodern-workspace/package-json.js +5 -7
- package/dist/esm/ultramodern-workspace/versions.js +7 -5
- package/dist/esm/ultramodern-workspace/workspace-scripts.js +2 -1
- package/dist/esm/ultramodern-workspace/write-workspace.js +2 -1
- package/dist/esm-node/ultramodern-tooling/commands.js +271 -3
- package/dist/esm-node/ultramodern-workspace/app-files.js +8 -11
- package/dist/esm-node/ultramodern-workspace/package-json.js +5 -7
- package/dist/esm-node/ultramodern-workspace/versions.js +7 -5
- package/dist/esm-node/ultramodern-workspace/workspace-scripts.js +2 -1
- package/dist/esm-node/ultramodern-workspace/write-workspace.js +2 -1
- package/dist/types/ultramodern-workspace/versions.d.ts +6 -4
- package/package.json +6 -6
- package/template-workspace/.gitignore.handlebars +2 -0
- package/template-workspace/README.md.handlebars +8 -4
- 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 +7 -0
- package/templates/workspace-scripts/validate-ultramodern-workspace.mjs.handlebars +58 -2
package/README.md
CHANGED
|
@@ -193,8 +193,8 @@ For strict Effect API migrations, update generated package metadata and Modern
|
|
|
193
193
|
package aliases through the framework command before hand-editing app code:
|
|
194
194
|
|
|
195
195
|
```bash
|
|
196
|
-
pnpm dlx @bleedingdev/modern-js-create@3.5.0-ultramodern.
|
|
197
|
-
migrate-strict-effect --version 3.5.0-ultramodern.
|
|
196
|
+
pnpm dlx @bleedingdev/modern-js-create@3.5.0-ultramodern.10 ultramodern \
|
|
197
|
+
migrate-strict-effect --version 3.5.0-ultramodern.10
|
|
198
198
|
pnpm api:check
|
|
199
199
|
pnpm contract:check
|
|
200
200
|
pnpm check
|
|
@@ -202,16 +202,20 @@ pnpm build
|
|
|
202
202
|
```
|
|
203
203
|
|
|
204
204
|
The command updates `.modernjs/ultramodern.json`, root `modernjs.packageSource`,
|
|
205
|
-
generated Modern package aliases,
|
|
205
|
+
generated Modern package aliases, framework-owned toolchain pins, old direct
|
|
206
|
+
topology metadata, strict Effect pnpm overrides/trust policy, and the pnpm
|
|
206
207
|
lockfile. It does not invent compatibility shims or move business code behind
|
|
207
208
|
your back. If `pnpm api:check` still fails, migrate the source to
|
|
208
209
|
`shared/api.ts`, `api/index.ts`, and `src/api/*-client.ts` and delete
|
|
209
210
|
`api/effect`, `api/lambda`, `shared/effect`, and `src/effect` paths.
|
|
210
211
|
|
|
211
212
|
Generated strict Effect workspaces pin the compatible Effect cohort through
|
|
212
|
-
`pnpm-workspace.yaml` overrides: `effect@4.0.0-beta.
|
|
213
|
-
`@effect/vitest@4.0.0-beta.
|
|
214
|
-
|
|
213
|
+
`pnpm-workspace.yaml` overrides: `effect@4.0.0-beta.91` and
|
|
214
|
+
`@effect/vitest@4.0.0-beta.91`. The generated pnpm policy also excludes the
|
|
215
|
+
known `effect@4.0.0-beta.91` and `@effect/opentelemetry@4.0.0-beta.91`
|
|
216
|
+
versions from the 24-hour minimum-release-age gate and their trusted-publisher
|
|
217
|
+
to provenance transitions from no-downgrade checks. Do not override those in
|
|
218
|
+
app packages; update the framework cohort when the runtime moves.
|
|
215
219
|
|
|
216
220
|
Use `--ultramodern-package-source=install` for published cohort proof and pin a
|
|
217
221
|
specific release with `--ultramodern-package-version` when CI must prove an
|
|
@@ -52,7 +52,10 @@ var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_no
|
|
|
52
52
|
const external_node_url_namespaceObject = require("node:url");
|
|
53
53
|
const external_create_package_root_cjs_namespaceObject = require("../create-package-root.cjs");
|
|
54
54
|
const external_ultramodern_package_source_cjs_namespaceObject = require("../ultramodern-package-source.cjs");
|
|
55
|
+
const app_files_cjs_namespaceObject = require("../ultramodern-workspace/app-files.cjs");
|
|
55
56
|
const mf_validation_cjs_namespaceObject = require("../ultramodern-workspace/mf-validation.cjs");
|
|
57
|
+
const package_json_cjs_namespaceObject = require("../ultramodern-workspace/package-json.cjs");
|
|
58
|
+
const versions_cjs_namespaceObject = require("../ultramodern-workspace/versions.cjs");
|
|
56
59
|
const workspace_scripts_cjs_namespaceObject = require("../ultramodern-workspace/workspace-scripts.cjs");
|
|
57
60
|
const external_config_cjs_namespaceObject = require("./config.cjs");
|
|
58
61
|
const commands_dirname = external_node_path_default().dirname((0, external_node_url_namespaceObject.fileURLToPath)(__rslib_import_meta_url__));
|
|
@@ -198,6 +201,82 @@ function updateModernDependencies(packageJson, packageSource) {
|
|
|
198
201
|
}
|
|
199
202
|
return changed;
|
|
200
203
|
}
|
|
204
|
+
const generatedToolingDependencyPins = new Map([
|
|
205
|
+
[
|
|
206
|
+
'@effect/tsgo',
|
|
207
|
+
versions_cjs_namespaceObject.EFFECT_TSGO_VERSION
|
|
208
|
+
],
|
|
209
|
+
[
|
|
210
|
+
"@typescript/native-preview",
|
|
211
|
+
versions_cjs_namespaceObject.TYPESCRIPT_NATIVE_PREVIEW_VERSION
|
|
212
|
+
],
|
|
213
|
+
[
|
|
214
|
+
'oxfmt',
|
|
215
|
+
versions_cjs_namespaceObject.OXFMT_VERSION
|
|
216
|
+
],
|
|
217
|
+
[
|
|
218
|
+
'oxlint',
|
|
219
|
+
versions_cjs_namespaceObject.OXLINT_VERSION
|
|
220
|
+
],
|
|
221
|
+
[
|
|
222
|
+
'wrangler',
|
|
223
|
+
versions_cjs_namespaceObject.WRANGLER_VERSION
|
|
224
|
+
],
|
|
225
|
+
[
|
|
226
|
+
'zephyr-agent',
|
|
227
|
+
versions_cjs_namespaceObject.ZEPHYR_AGENT_VERSION
|
|
228
|
+
],
|
|
229
|
+
[
|
|
230
|
+
'zephyr-rspack-plugin',
|
|
231
|
+
versions_cjs_namespaceObject.ZEPHYR_RSPACK_PLUGIN_VERSION
|
|
232
|
+
]
|
|
233
|
+
]);
|
|
234
|
+
const strictEffectPackageVersionPolicyExclusions = [
|
|
235
|
+
`effect@${versions_cjs_namespaceObject.EFFECT_VERSION}`,
|
|
236
|
+
`@effect/opentelemetry@${versions_cjs_namespaceObject.EFFECT_VERSION}`
|
|
237
|
+
];
|
|
238
|
+
const effectDeclarationPatchPath = 'patches/effect-schema-error-type-id.patch';
|
|
239
|
+
const effectDeclarationPatchSourcePath = external_node_path_default().join(createPackageRoot, 'template-workspace', effectDeclarationPatchPath);
|
|
240
|
+
const drizzleOrmDeclarationPatchPath = 'patches/drizzle-orm-ts7-strict-declarations.patch';
|
|
241
|
+
const drizzleOrmDeclarationPatchSourcePath = external_node_path_default().join(createPackageRoot, 'template-workspace', drizzleOrmDeclarationPatchPath);
|
|
242
|
+
function updateGeneratedToolingDependencies(packageJson) {
|
|
243
|
+
let changed = false;
|
|
244
|
+
for (const section of [
|
|
245
|
+
'dependencies',
|
|
246
|
+
'devDependencies',
|
|
247
|
+
'peerDependencies',
|
|
248
|
+
'optionalDependencies'
|
|
249
|
+
]){
|
|
250
|
+
const dependencies = packageJson[section];
|
|
251
|
+
if (!(!dependencies || 'object' != typeof dependencies || Array.isArray(dependencies))) {
|
|
252
|
+
for (const [packageName, version] of generatedToolingDependencyPins)if (Object.prototype.hasOwnProperty.call(dependencies, packageName) && dependencies[packageName] !== version) {
|
|
253
|
+
dependencies[packageName] = version;
|
|
254
|
+
changed = true;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return changed;
|
|
259
|
+
}
|
|
260
|
+
const cloudflareModernDeployCommand = 'ULTRAMODERN_ZEPHYR=false MODERNJS_DEPLOY=cloudflare modern deploy';
|
|
261
|
+
const cloudflareModernDeploySkipBuildCommand = `${cloudflareModernDeployCommand} --skip-build`;
|
|
262
|
+
const cloudflareWranglerDeployCommand = 'wrangler deploy --config .output/wrangler.json';
|
|
263
|
+
const cloudflareWranglerDeployInvalidSkipBuildCommand = `${cloudflareWranglerDeployCommand} --skip-build`;
|
|
264
|
+
function updateGeneratedPackageScripts(packageJson) {
|
|
265
|
+
const scripts = packageJson.scripts;
|
|
266
|
+
if (!scripts || 'object' != typeof scripts || Array.isArray(scripts)) return false;
|
|
267
|
+
let changed = false;
|
|
268
|
+
const cloudflareBuild = scripts['cloudflare:build'];
|
|
269
|
+
if ('string' == typeof cloudflareBuild && cloudflareBuild.includes(cloudflareModernDeployCommand) && !cloudflareBuild.includes(cloudflareModernDeploySkipBuildCommand)) {
|
|
270
|
+
scripts['cloudflare:build'] = cloudflareBuild.replace(cloudflareModernDeployCommand, cloudflareModernDeploySkipBuildCommand);
|
|
271
|
+
changed = true;
|
|
272
|
+
}
|
|
273
|
+
const cloudflareDeploy = scripts['cloudflare:deploy'];
|
|
274
|
+
if ('string' == typeof cloudflareDeploy && cloudflareDeploy.includes(cloudflareWranglerDeployInvalidSkipBuildCommand)) {
|
|
275
|
+
scripts['cloudflare:deploy'] = cloudflareDeploy.replace(cloudflareWranglerDeployInvalidSkipBuildCommand, cloudflareWranglerDeployCommand);
|
|
276
|
+
changed = true;
|
|
277
|
+
}
|
|
278
|
+
return changed;
|
|
279
|
+
}
|
|
201
280
|
function normalizeStrictEffectApiMetadata(value) {
|
|
202
281
|
const api = value.api;
|
|
203
282
|
if (!api || 'object' != typeof api || Array.isArray(api)) return false;
|
|
@@ -263,6 +342,135 @@ function normalizeStrictEffectApiMetadata(value) {
|
|
|
263
342
|
}
|
|
264
343
|
return changed;
|
|
265
344
|
}
|
|
345
|
+
function replaceYamlLine(source, pattern, replacement) {
|
|
346
|
+
const updated = source.replace(pattern, replacement);
|
|
347
|
+
return {
|
|
348
|
+
source: updated,
|
|
349
|
+
changed: updated !== source
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
function ensureYamlListItem(source, key, item) {
|
|
353
|
+
const itemLine = ` - '${item}'`;
|
|
354
|
+
const headerPattern = new RegExp(`^${key}:\\n(?:(?: - .+\\n)*)`, 'mu');
|
|
355
|
+
const header = source.match(headerPattern);
|
|
356
|
+
if (header) {
|
|
357
|
+
if (header[0].split('\n').includes(itemLine)) return {
|
|
358
|
+
source,
|
|
359
|
+
changed: false
|
|
360
|
+
};
|
|
361
|
+
return {
|
|
362
|
+
source: source.replace(headerPattern, `${header[0]}${itemLine}\n`),
|
|
363
|
+
changed: true
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
const block = `${key}:\n${itemLine}\n`;
|
|
367
|
+
const afterTrustPolicyIgnore = source.replace(/^(trustPolicyIgnoreAfter: .+\n)/mu, `$1${block}`);
|
|
368
|
+
if (afterTrustPolicyIgnore !== source) return {
|
|
369
|
+
source: afterTrustPolicyIgnore,
|
|
370
|
+
changed: true
|
|
371
|
+
};
|
|
372
|
+
return {
|
|
373
|
+
source: `${source.trimEnd()}\n${block}`,
|
|
374
|
+
changed: true
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
function ensureYamlMapEntry(source, key, entryKey, value) {
|
|
378
|
+
const entryLine = ` '${entryKey}': ${value}`;
|
|
379
|
+
const packageName = entryKey.includes('@') ? entryKey.slice(0, entryKey.lastIndexOf('@')) : entryKey;
|
|
380
|
+
const escapedPackageName = packageName.replace(/[.*+?^${}()|[\]\\]/gu, '\\$&');
|
|
381
|
+
const currentEntryPattern = new RegExp(`^ {2}'${escapedPackageName}@[^']+': .+$`, 'mu');
|
|
382
|
+
const currentEntry = source.match(currentEntryPattern);
|
|
383
|
+
if (currentEntry) {
|
|
384
|
+
if (currentEntry[0] === entryLine) return {
|
|
385
|
+
source,
|
|
386
|
+
changed: false
|
|
387
|
+
};
|
|
388
|
+
return {
|
|
389
|
+
source: source.replace(currentEntryPattern, entryLine),
|
|
390
|
+
changed: true
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
const headerPattern = new RegExp(`^${key}:\\n(?:(?: .+\\n)*)`, 'mu');
|
|
394
|
+
const header = source.match(headerPattern);
|
|
395
|
+
if (header) {
|
|
396
|
+
if (header[0].split('\n').includes(entryLine)) return {
|
|
397
|
+
source,
|
|
398
|
+
changed: false
|
|
399
|
+
};
|
|
400
|
+
return {
|
|
401
|
+
source: source.replace(headerPattern, `${header[0]}${entryLine}\n`),
|
|
402
|
+
changed: true
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
return {
|
|
406
|
+
source: `${source.trimEnd()}\n${key}:\n${entryLine}\n`,
|
|
407
|
+
changed: true
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
function ensureGeneratedPatchFile(workspaceRoot, relativePatchPath, sourcePatchPath) {
|
|
411
|
+
const targetPath = external_node_path_default().join(workspaceRoot, relativePatchPath);
|
|
412
|
+
const patch = external_node_fs_default().readFileSync(sourcePatchPath, 'utf-8');
|
|
413
|
+
if (external_node_fs_default().existsSync(targetPath) && external_node_fs_default().readFileSync(targetPath, 'utf-8') === patch) return false;
|
|
414
|
+
external_node_fs_default().mkdirSync(external_node_path_default().dirname(targetPath), {
|
|
415
|
+
recursive: true
|
|
416
|
+
});
|
|
417
|
+
external_node_fs_default().writeFileSync(targetPath, patch, 'utf-8');
|
|
418
|
+
return true;
|
|
419
|
+
}
|
|
420
|
+
function ensureGeneratedDeclarationPatches(workspaceRoot) {
|
|
421
|
+
let changed = false;
|
|
422
|
+
changed = ensureGeneratedPatchFile(workspaceRoot, effectDeclarationPatchPath, effectDeclarationPatchSourcePath) || changed;
|
|
423
|
+
changed = ensureGeneratedPatchFile(workspaceRoot, drizzleOrmDeclarationPatchPath, drizzleOrmDeclarationPatchSourcePath) || changed;
|
|
424
|
+
return changed;
|
|
425
|
+
}
|
|
426
|
+
function updateGeneratedPnpmWorkspacePolicy(workspaceRoot) {
|
|
427
|
+
const workspaceFile = external_node_path_default().join(workspaceRoot, 'pnpm-workspace.yaml');
|
|
428
|
+
if (!external_node_fs_default().existsSync(workspaceFile)) return false;
|
|
429
|
+
let source = external_node_fs_default().readFileSync(workspaceFile, 'utf-8');
|
|
430
|
+
let changed = false;
|
|
431
|
+
const replacements = [
|
|
432
|
+
[
|
|
433
|
+
/^ {4}'@effect\/vitest>effect': .+$/mu,
|
|
434
|
+
` '@effect/vitest>effect': '${versions_cjs_namespaceObject.EFFECT_VERSION}'`
|
|
435
|
+
],
|
|
436
|
+
[
|
|
437
|
+
/^ {2}'@effect\/vitest': .+$/mu,
|
|
438
|
+
` '@effect/vitest': ${versions_cjs_namespaceObject.EFFECT_VITEST_VERSION}`
|
|
439
|
+
],
|
|
440
|
+
[
|
|
441
|
+
/^ {2}effect: .+$/mu,
|
|
442
|
+
` effect: ${versions_cjs_namespaceObject.EFFECT_VERSION}`
|
|
443
|
+
]
|
|
444
|
+
];
|
|
445
|
+
for (const [pattern, replacement] of replacements){
|
|
446
|
+
const result = replaceYamlLine(source, pattern, replacement);
|
|
447
|
+
source = result.source;
|
|
448
|
+
changed = result.changed || changed;
|
|
449
|
+
}
|
|
450
|
+
for (const item of strictEffectPackageVersionPolicyExclusions){
|
|
451
|
+
const packageName = item.slice(0, item.lastIndexOf('@'));
|
|
452
|
+
const escapedPackageName = packageName.replace(/[.*+?^${}()|[\]\\]/gu, '\\$&');
|
|
453
|
+
const currentVersion = replaceYamlLine(source, new RegExp(`^ {2}- '${escapedPackageName}@[^']+'$`, 'gmu'), ` - '${item}'`);
|
|
454
|
+
source = currentVersion.source;
|
|
455
|
+
changed = currentVersion.changed || changed;
|
|
456
|
+
for (const policyKey of [
|
|
457
|
+
'minimumReleaseAgeExclude',
|
|
458
|
+
'trustPolicyExclude'
|
|
459
|
+
]){
|
|
460
|
+
const policyExclude = ensureYamlListItem(source, policyKey, item);
|
|
461
|
+
source = policyExclude.source;
|
|
462
|
+
changed = policyExclude.changed || changed;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
const effectPatch = ensureYamlMapEntry(source, 'patchedDependencies', `effect@${versions_cjs_namespaceObject.EFFECT_VERSION}`, effectDeclarationPatchPath);
|
|
466
|
+
source = effectPatch.source;
|
|
467
|
+
changed = effectPatch.changed || changed;
|
|
468
|
+
const drizzleOrmPatch = ensureYamlMapEntry(source, 'patchedDependencies', `drizzle-orm@${versions_cjs_namespaceObject.DRIZZLE_ORM_VERSION}`, drizzleOrmDeclarationPatchPath);
|
|
469
|
+
source = drizzleOrmPatch.source;
|
|
470
|
+
changed = drizzleOrmPatch.changed || changed;
|
|
471
|
+
if (changed) external_node_fs_default().writeFileSync(workspaceFile, source, 'utf-8');
|
|
472
|
+
return changed;
|
|
473
|
+
}
|
|
266
474
|
function updateUltramodernConfig(workspaceRoot, packageSource) {
|
|
267
475
|
const configPath = external_node_path_default().join(workspaceRoot, '.modernjs/ultramodern.json');
|
|
268
476
|
const config = readJsonFile(configPath);
|
|
@@ -282,6 +490,57 @@ function updateUltramodernConfig(workspaceRoot, packageSource) {
|
|
|
282
490
|
for (const app of config.topology?.apps ?? [])if (app && 'object' == typeof app && !Array.isArray(app)) normalizeStrictEffectApiMetadata(app);
|
|
283
491
|
writeJsonFile(configPath, config);
|
|
284
492
|
}
|
|
493
|
+
function writeJsonIfChanged(filePath, value) {
|
|
494
|
+
const next = `${JSON.stringify(value, null, 2)}\n`;
|
|
495
|
+
if (external_node_fs_default().existsSync(filePath) && external_node_fs_default().readFileSync(filePath, 'utf-8') === next) return false;
|
|
496
|
+
external_node_fs_default().mkdirSync(external_node_path_default().dirname(filePath), {
|
|
497
|
+
recursive: true
|
|
498
|
+
});
|
|
499
|
+
external_node_fs_default().writeFileSync(filePath, next, 'utf-8');
|
|
500
|
+
return true;
|
|
501
|
+
}
|
|
502
|
+
function writeTextIfChanged(filePath, value) {
|
|
503
|
+
if (external_node_fs_default().existsSync(filePath) && external_node_fs_default().readFileSync(filePath, 'utf-8') === value) return false;
|
|
504
|
+
external_node_fs_default().mkdirSync(external_node_path_default().dirname(filePath), {
|
|
505
|
+
recursive: true
|
|
506
|
+
});
|
|
507
|
+
external_node_fs_default().writeFileSync(filePath, value, 'utf-8');
|
|
508
|
+
return true;
|
|
509
|
+
}
|
|
510
|
+
function ensureGeneratedIgnoreRules(workspaceRoot) {
|
|
511
|
+
const gitignorePath = external_node_path_default().join(workspaceRoot, '.gitignore');
|
|
512
|
+
const existing = external_node_fs_default().existsSync(gitignorePath) ? external_node_fs_default().readFileSync(gitignorePath, 'utf-8') : '';
|
|
513
|
+
const lines = 0 === existing.trimEnd().length ? [] : existing.trimEnd().split(/\r?\n/u);
|
|
514
|
+
let changed = false;
|
|
515
|
+
for (const rule of [
|
|
516
|
+
'.mf/',
|
|
517
|
+
'**/.mf/'
|
|
518
|
+
])if (!lines.includes(rule)) {
|
|
519
|
+
lines.push(rule);
|
|
520
|
+
changed = true;
|
|
521
|
+
}
|
|
522
|
+
if (!changed) return false;
|
|
523
|
+
const next = `${lines.join('\n')}\n`;
|
|
524
|
+
external_node_fs_default().writeFileSync(gitignorePath, next, 'utf-8');
|
|
525
|
+
return true;
|
|
526
|
+
}
|
|
527
|
+
function updateGeneratedTypeScriptSurfaces(workspaceRoot, config) {
|
|
528
|
+
let changed = false;
|
|
529
|
+
const apps = (0, external_config_cjs_namespaceObject.workspaceAppsFromToolingConfig)(config);
|
|
530
|
+
const remotes = apps.filter((app)=>'shell' !== app.kind);
|
|
531
|
+
changed = writeJsonIfChanged(external_node_path_default().join(workspaceRoot, 'tsconfig.base.json'), (0, package_json_cjs_namespaceObject.createTsConfigBase)()) || changed;
|
|
532
|
+
changed = ensureGeneratedIgnoreRules(workspaceRoot) || changed;
|
|
533
|
+
for (const sharedPackage of [
|
|
534
|
+
'packages/shared-contracts',
|
|
535
|
+
'packages/shared-design-tokens'
|
|
536
|
+
])changed = writeJsonIfChanged(external_node_path_default().join(workspaceRoot, sharedPackage, 'tsconfig.json'), (0, package_json_cjs_namespaceObject.createSharedPackageTsConfig)(sharedPackage)) || changed;
|
|
537
|
+
for (const app of apps){
|
|
538
|
+
changed = writeJsonIfChanged(external_node_path_default().join(workspaceRoot, app.directory, 'tsconfig.json'), (0, package_json_cjs_namespaceObject.createAppTsConfig)(app, remotes)) || changed;
|
|
539
|
+
changed = writeJsonIfChanged(external_node_path_default().join(workspaceRoot, app.directory, 'tsconfig.mf-types.json'), (0, package_json_cjs_namespaceObject.createAppMfTypesTsConfig)(app)) || changed;
|
|
540
|
+
changed = writeTextIfChanged(external_node_path_default().join(workspaceRoot, app.directory, 'src/modern-app-env.d.ts'), (0, app_files_cjs_namespaceObject.createAppEnvDts)(app, remotes)) || changed;
|
|
541
|
+
}
|
|
542
|
+
return changed;
|
|
543
|
+
}
|
|
285
544
|
function updateReferenceTopology(workspaceRoot) {
|
|
286
545
|
const topologyPath = external_node_path_default().join(workspaceRoot, 'topology/reference-topology.json');
|
|
287
546
|
if (!external_node_fs_default().existsSync(topologyPath)) return false;
|
|
@@ -344,8 +603,10 @@ function runMigrateStrictEffect(args, context) {
|
|
|
344
603
|
modern-js-create ultramodern migrate-strict-effect --version <version> [--skip-install]
|
|
345
604
|
|
|
346
605
|
Updates generated UltraModern package-source metadata, Modern package aliases,
|
|
347
|
-
direct Effect API topology metadata,
|
|
348
|
-
|
|
606
|
+
framework-owned toolchain pins, direct Effect API topology metadata, strict
|
|
607
|
+
Effect pnpm overrides/trust policy, framework-owned TypeScript config
|
|
608
|
+
surfaces, and the pnpm lockfile. Source code still has to pass pnpm api:check
|
|
609
|
+
and pnpm contract:check.
|
|
349
610
|
`);
|
|
350
611
|
return 0;
|
|
351
612
|
}
|
|
@@ -353,6 +614,7 @@ workspaces. Source code still has to pass pnpm api:check and pnpm contract:check
|
|
|
353
614
|
const packageSource = createMigrationPackageSource(args, current);
|
|
354
615
|
updateUltramodernConfig(context.workspaceRoot, packageSource);
|
|
355
616
|
updateReferenceTopology(context.workspaceRoot);
|
|
617
|
+
updateGeneratedTypeScriptSurfaces(context.workspaceRoot, current);
|
|
356
618
|
for (const relativePackageFile of listWorkspacePackageFiles(context.workspaceRoot)){
|
|
357
619
|
const packageFile = external_node_path_default().join(context.workspaceRoot, relativePackageFile);
|
|
358
620
|
const packageJson = readJsonFile(packageFile);
|
|
@@ -363,9 +625,15 @@ workspaces. Source code still has to pass pnpm api:check and pnpm contract:check
|
|
|
363
625
|
config: './.modernjs/ultramodern.json'
|
|
364
626
|
};
|
|
365
627
|
}
|
|
366
|
-
|
|
628
|
+
const modernDependenciesChanged = updateModernDependencies(packageJson, packageSource);
|
|
629
|
+
const toolingDependenciesChanged = updateGeneratedToolingDependencies(packageJson);
|
|
630
|
+
const generatedScriptsChanged = updateGeneratedPackageScripts(packageJson);
|
|
631
|
+
const changed = modernDependenciesChanged || toolingDependenciesChanged || generatedScriptsChanged;
|
|
632
|
+
if (changed) writeJsonFile(packageFile, packageJson);
|
|
367
633
|
else if ('package.json' === relativePackageFile) writeJsonFile(packageFile, packageJson);
|
|
368
634
|
}
|
|
635
|
+
updateGeneratedPnpmWorkspacePolicy(context.workspaceRoot);
|
|
636
|
+
ensureGeneratedDeclarationPatches(context.workspaceRoot);
|
|
369
637
|
if (!hasFlag(args, '--skip-install')) {
|
|
370
638
|
const status = runPnpmLockfileRefresh(context);
|
|
371
639
|
if (0 !== status) return status;
|
|
@@ -71,17 +71,14 @@ function createAppEnvDts(app, remotes = []) {
|
|
|
71
71
|
}
|
|
72
72
|
`;
|
|
73
73
|
})).join('\n');
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
declare module '*.css';
|
|
84
|
-
${remoteModuleDeclarations ? `\n${remoteModuleDeclarations}` : ''}`;
|
|
74
|
+
const reactTypeImport = remoteModuleDeclarations ? "import type React from 'react';\n" : '';
|
|
75
|
+
return [
|
|
76
|
+
`import '@modern-js/app-tools/types';\n${reactTypeImport}`.trimEnd(),
|
|
77
|
+
`declare global {
|
|
78
|
+
const ULTRAMODERN_SITE_URL: string;
|
|
79
|
+
}`,
|
|
80
|
+
remoteModuleDeclarations.trimEnd()
|
|
81
|
+
].filter((section)=>section.length > 0).join('\n\n').concat('\n');
|
|
85
82
|
}
|
|
86
83
|
function createAppRuntimeConfig(app, scope, remotes = []) {
|
|
87
84
|
const pluginsConfig = 'shell' === app.kind ? ` plugins: [
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
3
12
|
(()=>{
|
|
4
13
|
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
14
|
var define = (defs, kind)=>{
|
|
@@ -44,6 +53,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
44
53
|
createZephyrDependencies: ()=>createZephyrDependencies,
|
|
45
54
|
effectDiagnostics: ()=>effectDiagnostics
|
|
46
55
|
});
|
|
56
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
57
|
+
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
47
58
|
const external_ultramodern_package_source_cjs_namespaceObject = require("../ultramodern-package-source.cjs");
|
|
48
59
|
const external_descriptors_cjs_namespaceObject = require("./descriptors.cjs");
|
|
49
60
|
const external_fs_io_cjs_namespaceObject = require("./fs-io.cjs");
|
|
@@ -294,7 +305,6 @@ function createTsConfigBase() {
|
|
|
294
305
|
noFallthroughCasesInSwitch: true,
|
|
295
306
|
noPropertyAccessFromIndexSignature: true,
|
|
296
307
|
noImplicitReturns: true,
|
|
297
|
-
skipLibCheck: true,
|
|
298
308
|
resolveJsonModule: true,
|
|
299
309
|
plugins: [
|
|
300
310
|
{
|
|
@@ -326,7 +336,7 @@ function createReferences(packageDir, references) {
|
|
|
326
336
|
return [
|
|
327
337
|
...new Set(references)
|
|
328
338
|
].filter((reference)=>reference !== packageDir).map((reference)=>({
|
|
329
|
-
path:
|
|
339
|
+
path: external_node_path_default().relative(packageDir, reference).split(external_node_path_default().sep).join('/')
|
|
330
340
|
}));
|
|
331
341
|
}
|
|
332
342
|
function createPackageTsConfig(packageDir, options = {}) {
|
|
@@ -336,8 +346,6 @@ function createPackageTsConfig(packageDir, options = {}) {
|
|
|
336
346
|
const include = resolvedOptions.include ?? [
|
|
337
347
|
'src',
|
|
338
348
|
'locales/**/*.json',
|
|
339
|
-
'modern.config.ts',
|
|
340
|
-
'module-federation.config.ts',
|
|
341
349
|
'package.json',
|
|
342
350
|
'shared'
|
|
343
351
|
];
|
|
@@ -371,9 +379,9 @@ function createAppTsConfig(app, remotes = []) {
|
|
|
371
379
|
});
|
|
372
380
|
}
|
|
373
381
|
function createAppMfTypesTsConfig(app) {
|
|
374
|
-
const exposedFiles = Object.
|
|
382
|
+
const exposedFiles = Object.entries(app.exposes ?? {}).sort(([left], [right])=>'./Route' === left ? -1 : './Route' === right ? 1 : 0).map(([, exposePath])=>exposePath.replace(/^\.\//u, ''));
|
|
375
383
|
return {
|
|
376
|
-
extends:
|
|
384
|
+
extends: `${(0, external_naming_cjs_namespaceObject.relativeRootFor)(app.directory)}/tsconfig.base.json`,
|
|
377
385
|
include: [
|
|
378
386
|
...new Set([
|
|
379
387
|
...exposedFiles,
|
|
@@ -417,7 +425,7 @@ function createAppPackage(scope, app, packageSource, enableTailwind, remotes = [
|
|
|
417
425
|
scripts: {
|
|
418
426
|
dev: 'modern dev',
|
|
419
427
|
build: app.exposes ? `ULTRAMODERN_ZEPHYR=false modern build && ${publicSurfaceBuildCommand} && node ${(0, external_naming_cjs_namespaceObject.relativeRootFor)(app.directory)}/scripts/assert-mf-types.mts` : `ULTRAMODERN_ZEPHYR=false modern build && ${publicSurfaceBuildCommand}`,
|
|
420
|
-
'cloudflare:build': `ULTRAMODERN_ZEPHYR=false MODERNJS_DEPLOY=cloudflare modern build && ${publicSurfaceCloudflareBuildCommand} && ULTRAMODERN_ZEPHYR=false MODERNJS_DEPLOY=cloudflare modern deploy && ${publicSurfaceCloudflareOutputCommand}`,
|
|
428
|
+
'cloudflare:build': `ULTRAMODERN_ZEPHYR=false MODERNJS_DEPLOY=cloudflare modern build && ${publicSurfaceCloudflareBuildCommand} && ULTRAMODERN_ZEPHYR=false MODERNJS_DEPLOY=cloudflare modern deploy --skip-build && ${publicSurfaceCloudflareOutputCommand}`,
|
|
421
429
|
'cloudflare:deploy': 'ULTRAMODERN_CLOUDFLARE_REQUIRE_PUBLIC_URLS=true pnpm run cloudflare:build && wrangler deploy --config .output/wrangler.json',
|
|
422
430
|
'cloudflare:preview': 'pnpm run cloudflare:build && wrangler dev --config .output/wrangler.json',
|
|
423
431
|
'cloudflare:proof': `node ${(0, external_naming_cjs_namespaceObject.relativeRootFor)(app.directory)}/scripts/proof-cloudflare-version.mts --app ${app.id}`,
|
|
@@ -37,14 +37,15 @@ const CLOUDFLARE_COMPATIBILITY_DATE = '2026-06-02';
|
|
|
37
37
|
const TAILWIND_VERSION = '4.3.1';
|
|
38
38
|
const TAILWIND_POSTCSS_VERSION = '4.3.1';
|
|
39
39
|
const POSTCSS_VERSION = '8.5.15';
|
|
40
|
-
const EFFECT_VERSION = '4.0.0-beta.
|
|
41
|
-
const EFFECT_VITEST_VERSION = '4.0.0-beta.
|
|
40
|
+
const EFFECT_VERSION = '4.0.0-beta.91';
|
|
41
|
+
const EFFECT_VITEST_VERSION = '4.0.0-beta.91';
|
|
42
42
|
const EFFECT_TSGO_VERSION = '0.14.6';
|
|
43
|
+
const DRIZZLE_ORM_VERSION = '1.0.0-rc.4';
|
|
43
44
|
const TYPESCRIPT_STABLE_VERSION = '6.0.3';
|
|
44
|
-
const TYPESCRIPT_NATIVE_PREVIEW_VERSION = '7.0.0-dev.
|
|
45
|
+
const TYPESCRIPT_NATIVE_PREVIEW_VERSION = '7.0.0-dev.20260628.1';
|
|
45
46
|
const TYPESCRIPT_VERSION = TYPESCRIPT_STABLE_VERSION;
|
|
46
47
|
const OXLINT_VERSION = '1.71.0';
|
|
47
|
-
const OXFMT_VERSION = '0.
|
|
48
|
+
const OXFMT_VERSION = '0.56.0';
|
|
48
49
|
const ULTRACITE_VERSION = '7.8.3';
|
|
49
50
|
const LEFTHOOK_VERSION = '^2.1.9';
|
|
50
51
|
const I18NEXT_VERSION = '26.3.1';
|
|
@@ -64,11 +65,13 @@ const ultramodernWorkspaceVersions = {
|
|
|
64
65
|
moduleFederation: MODULE_FEDERATION_VERSION,
|
|
65
66
|
effect: EFFECT_VERSION,
|
|
66
67
|
effectVitest: EFFECT_VITEST_VERSION,
|
|
68
|
+
drizzleOrm: DRIZZLE_ORM_VERSION,
|
|
67
69
|
tailwind: TAILWIND_VERSION,
|
|
68
70
|
tailwindPostcss: TAILWIND_POSTCSS_VERSION
|
|
69
71
|
};
|
|
70
72
|
__webpack_require__.d(__webpack_exports__, {}, {
|
|
71
73
|
CLOUDFLARE_COMPATIBILITY_DATE: CLOUDFLARE_COMPATIBILITY_DATE,
|
|
74
|
+
DRIZZLE_ORM_VERSION: DRIZZLE_ORM_VERSION,
|
|
72
75
|
EFFECT_TSGO_VERSION: EFFECT_TSGO_VERSION,
|
|
73
76
|
EFFECT_VERSION: EFFECT_VERSION,
|
|
74
77
|
EFFECT_VITEST_VERSION: EFFECT_VITEST_VERSION,
|
|
@@ -102,6 +105,7 @@ __webpack_require__.d(__webpack_exports__, {}, {
|
|
|
102
105
|
ultramodernWorkspaceVersions: ultramodernWorkspaceVersions
|
|
103
106
|
});
|
|
104
107
|
exports.CLOUDFLARE_COMPATIBILITY_DATE = __webpack_exports__.CLOUDFLARE_COMPATIBILITY_DATE;
|
|
108
|
+
exports.DRIZZLE_ORM_VERSION = __webpack_exports__.DRIZZLE_ORM_VERSION;
|
|
105
109
|
exports.EFFECT_TSGO_VERSION = __webpack_exports__.EFFECT_TSGO_VERSION;
|
|
106
110
|
exports.EFFECT_VERSION = __webpack_exports__.EFFECT_VERSION;
|
|
107
111
|
exports.EFFECT_VITEST_VERSION = __webpack_exports__.EFFECT_VITEST_VERSION;
|
|
@@ -135,6 +139,7 @@ exports.ZEPHYR_RSPACK_PLUGIN_VERSION = __webpack_exports__.ZEPHYR_RSPACK_PLUGIN_
|
|
|
135
139
|
exports.ultramodernWorkspaceVersions = __webpack_exports__.ultramodernWorkspaceVersions;
|
|
136
140
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
137
141
|
"CLOUDFLARE_COMPATIBILITY_DATE",
|
|
142
|
+
"DRIZZLE_ORM_VERSION",
|
|
138
143
|
"EFFECT_TSGO_VERSION",
|
|
139
144
|
"EFFECT_VERSION",
|
|
140
145
|
"EFFECT_VITEST_VERSION",
|
|
@@ -174,6 +174,7 @@ function createWorkspaceValidationScript(scope, enableTailwind, remotes = []) {
|
|
|
174
174
|
const expectedCloudflareSecurity = (0, external_policy_cjs_namespaceObject.createCloudflareSecurityContract)();
|
|
175
175
|
return (0, external_fs_io_cjs_namespaceObject.renderFileTemplate)("workspace-scripts/validate-ultramodern-workspace.mjs", {
|
|
176
176
|
packageScope: scope,
|
|
177
|
+
effectVersion: external_versions_cjs_namespaceObject.EFFECT_VERSION,
|
|
177
178
|
nodeVersion: external_versions_cjs_namespaceObject.NODE_VERSION,
|
|
178
179
|
pnpmVersion: external_versions_cjs_namespaceObject.PNPM_VERSION,
|
|
179
180
|
tailwindEnabledJson: JSON.stringify(enableTailwind),
|
|
@@ -175,6 +175,7 @@ function generateUltramodernWorkspace(options) {
|
|
|
175
175
|
nodeVersion: external_versions_cjs_namespaceObject.NODE_VERSION,
|
|
176
176
|
pnpmVersion: external_versions_cjs_namespaceObject.PNPM_VERSION,
|
|
177
177
|
nodeFetchVersion: external_versions_cjs_namespaceObject.NODE_FETCH_VERSION,
|
|
178
|
+
drizzleOrmVersion: external_versions_cjs_namespaceObject.DRIZZLE_ORM_VERSION,
|
|
178
179
|
effectVersion: external_versions_cjs_namespaceObject.EFFECT_VERSION,
|
|
179
180
|
effectVitestVersion: external_versions_cjs_namespaceObject.EFFECT_VITEST_VERSION,
|
|
180
181
|
tanstackRouterCoreVersion: external_versions_cjs_namespaceObject.TANSTACK_ROUTER_CORE_VERSION,
|