@bleedingdev/modern-js-create 3.4.0-ultramodern.1 → 3.4.0-ultramodern.3
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/dist/cjs/ultramodern-workspace/add-vertical.cjs +18 -0
- package/dist/cjs/ultramodern-workspace/contracts.cjs +5 -3
- package/dist/cjs/ultramodern-workspace/demo-components.cjs +9 -18
- package/dist/cjs/ultramodern-workspace/descriptors.cjs +2 -2
- package/dist/cjs/ultramodern-workspace/module-federation.cjs +10 -1
- package/dist/cjs/ultramodern-workspace/package-json.cjs +74 -13
- package/dist/cjs/ultramodern-workspace/versions.cjs +1 -5
- package/dist/cjs/ultramodern-workspace/workspace-scripts.cjs +7 -0
- package/dist/cjs/ultramodern-workspace/write-workspace.cjs +3 -7
- package/dist/esm/ultramodern-workspace/add-vertical.js +19 -1
- package/dist/esm/ultramodern-workspace/contracts.js +6 -4
- package/dist/esm/ultramodern-workspace/demo-components.js +9 -18
- package/dist/esm/ultramodern-workspace/descriptors.js +2 -2
- package/dist/esm/ultramodern-workspace/module-federation.js +10 -1
- package/dist/esm/ultramodern-workspace/package-json.js +62 -10
- package/dist/esm/ultramodern-workspace/versions.js +2 -3
- package/dist/esm/ultramodern-workspace/workspace-scripts.js +5 -1
- package/dist/esm/ultramodern-workspace/write-workspace.js +5 -9
- package/dist/esm-node/ultramodern-workspace/add-vertical.js +19 -1
- package/dist/esm-node/ultramodern-workspace/contracts.js +6 -4
- package/dist/esm-node/ultramodern-workspace/demo-components.js +9 -18
- package/dist/esm-node/ultramodern-workspace/descriptors.js +2 -2
- package/dist/esm-node/ultramodern-workspace/module-federation.js +10 -1
- package/dist/esm-node/ultramodern-workspace/package-json.js +62 -10
- package/dist/esm-node/ultramodern-workspace/versions.js +2 -3
- package/dist/esm-node/ultramodern-workspace/workspace-scripts.js +5 -1
- package/dist/esm-node/ultramodern-workspace/write-workspace.js +5 -9
- package/dist/types/ultramodern-workspace/package-json.d.ts +11 -2
- package/dist/types/ultramodern-workspace/versions.d.ts +1 -2
- package/dist/types/ultramodern-workspace/workspace-scripts.d.ts +1 -0
- package/package.json +4 -4
- package/template-workspace/AGENTS.md.handlebars +2 -1
- package/template-workspace/README.md.handlebars +7 -0
- package/template-workspace/oxfmt.config.ts +3 -1
- package/template-workspace/oxlint.config.ts +3 -1
- package/template-workspace/pnpm-workspace.yaml.handlebars +8 -0
- package/template-workspace/scripts/bootstrap-agent-skills.mjs +42 -10
- package/templates/app/shell-frame.tsx +1 -2
- package/templates/app/ultramodern-route-head.tsx.handlebars +23 -12
- package/templates/packages/shared-contracts-index.ts +206 -272
- package/templates/workspace-scripts/ultramodern-typecheck.mjs +197 -0
- package/templates/workspace-scripts/validate-ultramodern-workspace.mjs.handlebars +166 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "node:module";
|
|
2
2
|
import { WORKSPACE_PACKAGE_VERSION, modernPackageSpecifier } from "../ultramodern-package-source.js";
|
|
3
|
-
import { appHasEffectApi, remoteDependencyAlias, resolveRemoteRefs, shellApp, verticalEffectApps, zephyrRemoteDependency } from "./descriptors.js";
|
|
3
|
+
import { appHasEffectApi, remoteDependencyAlias, resolveRemoteRefs, sharedPackages, shellApp, verticalEffectApps, zephyrRemoteDependency } from "./descriptors.js";
|
|
4
4
|
import { readFileTemplate } from "./fs-io.js";
|
|
5
5
|
import { packageName, relativeRootFor } from "./naming.js";
|
|
6
6
|
import { createPublicSurfaceGenerationCommand } from "./public-surface.js";
|
|
7
7
|
import { EFFECT_TSGO_VERSION, I18NEXT_VERSION, LEFTHOOK_VERSION, MODULE_FEDERATION_VERSION, NODE_FETCH_VERSION, OXFMT_VERSION, OXLINT_VERSION, PNPM_VERSION, POSTCSS_VERSION, REACT_DOM_VERSION, REACT_ROUTER_VERSION, REACT_VERSION, TAILWIND_POSTCSS_VERSION, TAILWIND_VERSION, TANSTACK_ROUTER_VERSION, TYPESCRIPT_NATIVE_PREVIEW_VERSION, TYPESCRIPT_VERSION, TYPES_REACT_DOM_VERSION, TYPES_REACT_VERSION, ULTRACITE_VERSION, WRANGLER_VERSION, ZEPHYR_AGENT_VERSION, ZEPHYR_RSPACK_PLUGIN_VERSION } from "./versions.js";
|
|
8
|
-
const
|
|
8
|
+
const createEffectTsgoTypecheckCommand = (packageDir)=>`node ${relativeRootFor(packageDir)}/scripts/ultramodern-typecheck.mjs --project tsconfig.json`;
|
|
9
9
|
const effectDiagnostics = [
|
|
10
10
|
'anyUnknownInErrorContext',
|
|
11
11
|
'classSelfMismatch',
|
|
@@ -151,7 +151,7 @@ function createRootPackageJson(scope, packageSource, remotes = []) {
|
|
|
151
151
|
'format:check': "oxfmt --check . '!repos/**'",
|
|
152
152
|
lint: 'oxlint apps verticals packages',
|
|
153
153
|
'lint:fix': 'oxlint apps verticals packages --fix',
|
|
154
|
-
typecheck:
|
|
154
|
+
typecheck: "node ./scripts/ultramodern-typecheck.mjs --build tsconfig.json",
|
|
155
155
|
'cloudflare:build': `${remoteCloudflareBuildPrefix}pnpm --filter "./apps/shell-super-app" run cloudflare:build && pnpm mf:types`,
|
|
156
156
|
'cloudflare:deploy': `${remoteCloudflareDeployPrefix}pnpm --filter "./apps/shell-super-app" run cloudflare:deploy`,
|
|
157
157
|
'cloudflare:proof': "node ./scripts/proof-cloudflare-version.mjs --out .codex/reports/cloudflare-version-proof/public-url-proof.json",
|
|
@@ -252,17 +252,69 @@ function createTsConfigBase() {
|
|
|
252
252
|
}
|
|
253
253
|
};
|
|
254
254
|
}
|
|
255
|
-
function
|
|
256
|
-
const
|
|
255
|
+
function createTsBuildInfoFile(packageDir) {
|
|
256
|
+
const cacheKey = packageDir.replace(/[^a-zA-Z0-9._-]+/gu, '__');
|
|
257
|
+
return `${relativeRootFor(packageDir)}/node_modules/.cache/tsgo/${cacheKey}.tsbuildinfo`;
|
|
258
|
+
}
|
|
259
|
+
function createReferences(packageDir, references) {
|
|
260
|
+
return [
|
|
261
|
+
...new Set(references)
|
|
262
|
+
].filter((reference)=>reference !== packageDir).map((reference)=>({
|
|
263
|
+
path: `${relativeRootFor(packageDir)}/${reference}`
|
|
264
|
+
}));
|
|
265
|
+
}
|
|
266
|
+
function createPackageTsConfig(packageDir, options = {}) {
|
|
267
|
+
const resolvedOptions = 'boolean' == typeof options ? {
|
|
268
|
+
includeApi: options
|
|
269
|
+
} : options;
|
|
270
|
+
const include = resolvedOptions.include ?? [
|
|
257
271
|
'src',
|
|
258
272
|
'modern.config.ts',
|
|
259
273
|
'module-federation.config.ts'
|
|
260
274
|
];
|
|
261
|
-
if (includeApi) include.push('api', 'shared');
|
|
262
|
-
|
|
275
|
+
if (resolvedOptions.includeApi) include.push('api', 'shared');
|
|
276
|
+
const references = createReferences(packageDir, resolvedOptions.references ?? []);
|
|
277
|
+
const tsconfig = {
|
|
263
278
|
extends: `${relativeRootFor(packageDir)}/tsconfig.base.json`,
|
|
279
|
+
compilerOptions: {
|
|
280
|
+
composite: true,
|
|
281
|
+
incremental: true,
|
|
282
|
+
tsBuildInfoFile: createTsBuildInfoFile(packageDir)
|
|
283
|
+
},
|
|
264
284
|
include
|
|
265
285
|
};
|
|
286
|
+
if (references.length > 0) tsconfig.references = references;
|
|
287
|
+
return tsconfig;
|
|
288
|
+
}
|
|
289
|
+
function createAppTsConfig(app, remotes = []) {
|
|
290
|
+
const references = [
|
|
291
|
+
...sharedPackages.map((sharedPackage)=>sharedPackage.directory),
|
|
292
|
+
...'shell' === app.kind ? verticalEffectApps(remotes).map((remote)=>remote.directory) : resolveRemoteRefs(app, remotes).map((remote)=>remote.directory)
|
|
293
|
+
];
|
|
294
|
+
return createPackageTsConfig(app.directory, {
|
|
295
|
+
includeApi: appHasEffectApi(app),
|
|
296
|
+
references
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
function createSharedPackageTsConfig(packageDir) {
|
|
300
|
+
return createPackageTsConfig(packageDir, {
|
|
301
|
+
include: [
|
|
302
|
+
'src'
|
|
303
|
+
]
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
function createRootTsConfig(apps = []) {
|
|
307
|
+
return {
|
|
308
|
+
files: [],
|
|
309
|
+
references: [
|
|
310
|
+
...sharedPackages.map((sharedPackage)=>({
|
|
311
|
+
path: sharedPackage.directory
|
|
312
|
+
})),
|
|
313
|
+
...apps.map((app)=>({
|
|
314
|
+
path: app.directory
|
|
315
|
+
}))
|
|
316
|
+
]
|
|
317
|
+
};
|
|
266
318
|
}
|
|
267
319
|
function createAppPackage(scope, app, packageSource, enableTailwind, remotes = []) {
|
|
268
320
|
const publicSurfaceBuildCommand = createPublicSurfaceGenerationCommand(app, 'dist');
|
|
@@ -284,7 +336,7 @@ function createAppPackage(scope, app, packageSource, enableTailwind, remotes = [
|
|
|
284
336
|
'cloudflare:preview': 'pnpm run cloudflare:build && wrangler dev --config .output/wrangler.json',
|
|
285
337
|
'cloudflare:proof': `node ${relativeRootFor(app.directory)}/scripts/proof-cloudflare-version.mjs --app ${app.id}`,
|
|
286
338
|
serve: 'modern serve',
|
|
287
|
-
typecheck:
|
|
339
|
+
typecheck: createEffectTsgoTypecheckCommand(app.directory)
|
|
288
340
|
},
|
|
289
341
|
modernjs: {
|
|
290
342
|
preset: 'presetUltramodern',
|
|
@@ -320,7 +372,7 @@ function createSharedPackage(scope, id, description) {
|
|
|
320
372
|
'.': './src/index.ts'
|
|
321
373
|
},
|
|
322
374
|
scripts: {
|
|
323
|
-
typecheck:
|
|
375
|
+
typecheck: createEffectTsgoTypecheckCommand(`packages/${id}`)
|
|
324
376
|
},
|
|
325
377
|
devDependencies: {
|
|
326
378
|
'@effect/tsgo': EFFECT_TSGO_VERSION,
|
|
@@ -336,4 +388,4 @@ function createSharedPackage(scope, id, description) {
|
|
|
336
388
|
function createSharedContractsIndex() {
|
|
337
389
|
return readFileTemplate('packages/shared-contracts-index.ts');
|
|
338
390
|
}
|
|
339
|
-
export { appDependencies, appDevDependencies, createAppPackage, createPackageTsConfig, createRootPackageJson, createSharedContractsIndex, createSharedPackage, createTsConfigBase, createZephyrDependencies, effectDiagnostics
|
|
391
|
+
export { appDependencies, appDevDependencies, createAppPackage, createAppTsConfig, createEffectTsgoTypecheckCommand, createPackageTsConfig, createRootPackageJson, createRootTsConfig, createSharedContractsIndex, createSharedPackage, createSharedPackageTsConfig, createTsConfigBase, createZephyrDependencies, effectDiagnostics };
|
|
@@ -10,9 +10,8 @@ const TAILWIND_POSTCSS_VERSION = '4.3.1';
|
|
|
10
10
|
const POSTCSS_VERSION = '8.5.15';
|
|
11
11
|
const EFFECT_TSGO_VERSION = '0.14.6';
|
|
12
12
|
const TYPESCRIPT_STABLE_VERSION = '6.0.3';
|
|
13
|
-
const TYPESCRIPT_7_VERSION = '7.0.1-rc';
|
|
14
|
-
const TYPESCRIPT_VERSION = TYPESCRIPT_STABLE_VERSION;
|
|
15
13
|
const TYPESCRIPT_NATIVE_PREVIEW_VERSION = '7.0.0-dev.20260624.1';
|
|
14
|
+
const TYPESCRIPT_VERSION = TYPESCRIPT_STABLE_VERSION;
|
|
16
15
|
const OXLINT_VERSION = '1.71.0';
|
|
17
16
|
const OXFMT_VERSION = '0.55.0';
|
|
18
17
|
const ULTRACITE_VERSION = '7.8.3';
|
|
@@ -34,4 +33,4 @@ const ultramodernWorkspaceVersions = {
|
|
|
34
33
|
tailwind: TAILWIND_VERSION,
|
|
35
34
|
tailwindPostcss: TAILWIND_POSTCSS_VERSION
|
|
36
35
|
};
|
|
37
|
-
export { CLOUDFLARE_COMPATIBILITY_DATE, EFFECT_TSGO_VERSION, I18NEXT_VERSION, LEFTHOOK_VERSION, MODULE_FEDERATION_AGENT_SKILLS_COMMIT, MODULE_FEDERATION_VERSION, NODE_FETCH_VERSION, NODE_VERSION, OXFMT_VERSION, OXLINT_VERSION, PNPM_VERSION, POSTCSS_VERSION, REACT_DOM_VERSION, REACT_ROUTER_VERSION, REACT_VERSION, RSTACK_AGENT_SKILLS_COMMIT, TAILWIND_POSTCSS_VERSION, TAILWIND_VERSION, TANSTACK_ROUTER_VERSION,
|
|
36
|
+
export { CLOUDFLARE_COMPATIBILITY_DATE, EFFECT_TSGO_VERSION, I18NEXT_VERSION, LEFTHOOK_VERSION, MODULE_FEDERATION_AGENT_SKILLS_COMMIT, MODULE_FEDERATION_VERSION, NODE_FETCH_VERSION, NODE_VERSION, OXFMT_VERSION, OXLINT_VERSION, PNPM_VERSION, POSTCSS_VERSION, REACT_DOM_VERSION, REACT_ROUTER_VERSION, REACT_VERSION, RSTACK_AGENT_SKILLS_COMMIT, TAILWIND_POSTCSS_VERSION, TAILWIND_VERSION, TANSTACK_ROUTER_VERSION, TYPESCRIPT_NATIVE_PREVIEW_VERSION, TYPESCRIPT_STABLE_VERSION, TYPESCRIPT_VERSION, TYPES_REACT_DOM_VERSION, TYPES_REACT_VERSION, ULTRACITE_VERSION, WRANGLER_VERSION, ZEPHYR_AGENT_VERSION, ZEPHYR_RSPACK_PLUGIN_VERSION, ultramodernWorkspaceVersions };
|
|
@@ -80,6 +80,9 @@ function createPerformanceReadinessConfigScript() {
|
|
|
80
80
|
function createPerformanceReadinessScript() {
|
|
81
81
|
return readFileTemplate("workspace-scripts/ultramodern-performance-readiness.mjs");
|
|
82
82
|
}
|
|
83
|
+
function createUltramodernTypecheckScript() {
|
|
84
|
+
return readFileTemplate("workspace-scripts/ultramodern-typecheck.mjs");
|
|
85
|
+
}
|
|
83
86
|
function writeGeneratedWorkspaceScripts(targetDir, scope, enableTailwind, remotes = []) {
|
|
84
87
|
writeFileReplacing(targetDir, "scripts/assert-mf-types.mjs", createAssertMfTypesScript(remotes));
|
|
85
88
|
writeFileReplacing(targetDir, "scripts/validate-ultramodern-workspace.mjs", createWorkspaceValidationScript(scope, enableTailwind, remotes));
|
|
@@ -89,5 +92,6 @@ function writeGeneratedWorkspaceScripts(targetDir, scope, enableTailwind, remote
|
|
|
89
92
|
writeFileReplacing(targetDir, "scripts/proof-cloudflare-version.mjs", createCloudflareVersionProofScript());
|
|
90
93
|
writeFileReplacing(targetDir, "scripts/ultramodern-performance-readiness.config.mjs", createPerformanceReadinessConfigScript());
|
|
91
94
|
writeFileReplacing(targetDir, "scripts/ultramodern-performance-readiness.mjs", createPerformanceReadinessScript());
|
|
95
|
+
writeFileReplacing(targetDir, "scripts/ultramodern-typecheck.mjs", createUltramodernTypecheckScript());
|
|
92
96
|
}
|
|
93
|
-
export { createAssertMfTypesScript, createCloudflareProofHelperScript, createCloudflareVersionProofScript, createPerformanceReadinessConfigScript, createPerformanceReadinessScript, createPublicSurfaceAssetsScript, createWorkspaceI18nBoundaryValidationScript, createWorkspaceValidationScript, writeGeneratedWorkspaceScripts };
|
|
97
|
+
export { createAssertMfTypesScript, createCloudflareProofHelperScript, createCloudflareVersionProofScript, createPerformanceReadinessConfigScript, createPerformanceReadinessScript, createPublicSurfaceAssetsScript, createUltramodernTypecheckScript, createWorkspaceI18nBoundaryValidationScript, createWorkspaceValidationScript, writeGeneratedWorkspaceScripts };
|
|
@@ -9,9 +9,9 @@ import { copyRootTemplate, writeFile, writeJson } from "./fs-io.js";
|
|
|
9
9
|
import { createFileSnapshot, createGenerationResult, diffFileSnapshots } from "./generation-result.js";
|
|
10
10
|
import { createAppPublicLocaleMessages } from "./locales.js";
|
|
11
11
|
import { createAppModernConfig, createRemoteModuleFederationConfig, createShellModuleFederationConfig, createUltramodernBuildModule } from "./module-federation.js";
|
|
12
|
-
import { assertUniqueTailwindPrefixes,
|
|
12
|
+
import { assertUniqueTailwindPrefixes, toPackageScope } from "./naming.js";
|
|
13
13
|
import { runCodeSmithOverlays } from "./overlays.js";
|
|
14
|
-
import { createAppPackage,
|
|
14
|
+
import { createAppPackage, createAppTsConfig, createRootPackageJson, createRootTsConfig, createSharedContractsIndex, createSharedPackage, createSharedPackageTsConfig, createTsConfigBase } from "./package-json.js";
|
|
15
15
|
import { resolvePackageSource } from "./package-source.js";
|
|
16
16
|
import { createPublicWebAppArtifacts } from "./public-surface.js";
|
|
17
17
|
import { NODE_FETCH_VERSION, NODE_VERSION, PNPM_VERSION, TANSTACK_ROUTER_VERSION, TYPESCRIPT_VERSION } from "./versions.js";
|
|
@@ -23,7 +23,7 @@ function writeApp(targetDir, scope, app, packageSource, enableTailwind, remotes
|
|
|
23
23
|
writeFile(targetDir, `${resolvedApp.directory}/${relativePath}`, content);
|
|
24
24
|
};
|
|
25
25
|
writeJson(targetDir, `${resolvedApp.directory}/package.json`, createAppPackage(scope, resolvedApp, packageSource, enableTailwind, remotes));
|
|
26
|
-
writeJson(targetDir, `${resolvedApp.directory}/tsconfig.json`,
|
|
26
|
+
writeJson(targetDir, `${resolvedApp.directory}/tsconfig.json`, createAppTsConfig(resolvedApp, remotes));
|
|
27
27
|
writeFile(targetDir, `${resolvedApp.directory}/src/modern-app-env.d.ts`, createAppEnvDts(resolvedApp, remotes));
|
|
28
28
|
writeFile(targetDir, `${resolvedApp.directory}/src/ultramodern-build.ts`, createUltramodernBuildModule(scope, resolvedApp));
|
|
29
29
|
writeFile(targetDir, publicWeb.jsonLdHelperFile.path, publicWeb.jsonLdHelperFile.content);
|
|
@@ -66,12 +66,7 @@ function writeApp(targetDir, scope, app, packageSource, enableTailwind, remotes
|
|
|
66
66
|
function writeSharedPackages(targetDir, scope) {
|
|
67
67
|
for (const sharedPackage of sharedPackages){
|
|
68
68
|
writeJson(targetDir, `${sharedPackage.directory}/package.json`, createSharedPackage(scope, sharedPackage.id, sharedPackage.description));
|
|
69
|
-
writeJson(targetDir, `${sharedPackage.directory}/tsconfig.json`,
|
|
70
|
-
extends: `${relativeRootFor(sharedPackage.directory)}/tsconfig.base.json`,
|
|
71
|
-
include: [
|
|
72
|
-
'src'
|
|
73
|
-
]
|
|
74
|
-
});
|
|
69
|
+
writeJson(targetDir, `${sharedPackage.directory}/tsconfig.json`, createSharedPackageTsConfig(sharedPackage.directory));
|
|
75
70
|
}
|
|
76
71
|
writeFile(targetDir, 'packages/shared-contracts/src/index.ts', createSharedContractsIndex());
|
|
77
72
|
writeFile(targetDir, 'packages/shared-design-tokens/src/index.ts', `export const sharedDesignTokens = {
|
|
@@ -113,6 +108,7 @@ function generateUltramodernWorkspace(options) {
|
|
|
113
108
|
});
|
|
114
109
|
writeJson(options.targetDir, 'package.json', createRootPackageJson(scope, packageSource, initialVerticals));
|
|
115
110
|
writeJson(options.targetDir, 'tsconfig.base.json', createTsConfigBase());
|
|
111
|
+
writeJson(options.targetDir, 'tsconfig.json', createRootTsConfig(createdApps));
|
|
116
112
|
writeJson(options.targetDir, 'topology/reference-topology.json', createTopology(scope, initialVerticals));
|
|
117
113
|
writeJson(options.targetDir, 'topology/ownership.json', createOwnership(scope, initialVerticals));
|
|
118
114
|
writeJson(options.targetDir, 'topology/local-overlays/development.json', createDevelopmentOverlay(initialVerticals));
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import type { JsonValue, ResolvedPackageSource, WorkspaceApp } from './types';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const createEffectTsgoTypecheckCommand: (packageDir: string) => string;
|
|
3
3
|
export declare const effectDiagnostics: string[];
|
|
4
4
|
export declare function appDependencies(scope: string, packageSource: ResolvedPackageSource, app: WorkspaceApp, remotes?: WorkspaceApp[]): Record<string, string>;
|
|
5
5
|
export declare function appDevDependencies(packageSource: ResolvedPackageSource, enableTailwind: boolean): Record<string, string>;
|
|
6
6
|
export declare function createRootPackageJson(scope: string, packageSource: ResolvedPackageSource, remotes?: WorkspaceApp[]): JsonValue;
|
|
7
7
|
export declare function createZephyrDependencies(scope: string, app: WorkspaceApp, remotes?: WorkspaceApp[]): JsonValue;
|
|
8
8
|
export declare function createTsConfigBase(): JsonValue;
|
|
9
|
-
|
|
9
|
+
type CreatePackageTsConfigOptions = {
|
|
10
|
+
include?: string[];
|
|
11
|
+
includeApi?: boolean;
|
|
12
|
+
references?: string[];
|
|
13
|
+
};
|
|
14
|
+
export declare function createPackageTsConfig(packageDir: string, options?: CreatePackageTsConfigOptions | boolean): JsonValue;
|
|
15
|
+
export declare function createAppTsConfig(app: WorkspaceApp, remotes?: WorkspaceApp[]): JsonValue;
|
|
16
|
+
export declare function createSharedPackageTsConfig(packageDir: string): JsonValue;
|
|
17
|
+
export declare function createRootTsConfig(apps?: WorkspaceApp[]): JsonValue;
|
|
10
18
|
export declare function createAppPackage(scope: string, app: WorkspaceApp, packageSource: ResolvedPackageSource, enableTailwind: boolean, remotes?: WorkspaceApp[]): JsonValue;
|
|
11
19
|
export declare function createSharedPackage(scope: string, id: string, description: string): JsonValue;
|
|
12
20
|
export declare function createSharedContractsIndex(): string;
|
|
21
|
+
export {};
|
|
@@ -14,9 +14,8 @@ export declare const TAILWIND_POSTCSS_VERSION = "4.3.1";
|
|
|
14
14
|
export declare const POSTCSS_VERSION = "8.5.15";
|
|
15
15
|
export declare const EFFECT_TSGO_VERSION = "0.14.6";
|
|
16
16
|
export declare const TYPESCRIPT_STABLE_VERSION = "6.0.3";
|
|
17
|
-
export declare const TYPESCRIPT_7_VERSION = "7.0.1-rc";
|
|
18
|
-
export declare const TYPESCRIPT_VERSION = "6.0.3";
|
|
19
17
|
export declare const TYPESCRIPT_NATIVE_PREVIEW_VERSION = "7.0.0-dev.20260624.1";
|
|
18
|
+
export declare const TYPESCRIPT_VERSION = "6.0.3";
|
|
20
19
|
export declare const OXLINT_VERSION = "1.71.0";
|
|
21
20
|
export declare const OXFMT_VERSION = "0.55.0";
|
|
22
21
|
export declare const ULTRACITE_VERSION = "7.8.3";
|
|
@@ -7,4 +7,5 @@ export declare function createCloudflareProofHelperScript(): string;
|
|
|
7
7
|
export declare function createCloudflareVersionProofScript(): string;
|
|
8
8
|
export declare function createPerformanceReadinessConfigScript(): string;
|
|
9
9
|
export declare function createPerformanceReadinessScript(): string;
|
|
10
|
+
export declare function createUltramodernTypecheckScript(): string;
|
|
10
11
|
export declare function writeGeneratedWorkspaceScripts(targetDir: string, scope: string, enableTailwind: boolean, remotes?: WorkspaceApp[]): void;
|
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"engines": {
|
|
22
22
|
"node": ">=20"
|
|
23
23
|
},
|
|
24
|
-
"version": "3.4.0-ultramodern.
|
|
24
|
+
"version": "3.4.0-ultramodern.3",
|
|
25
25
|
"types": "./dist/types/index.d.ts",
|
|
26
26
|
"main": "./dist/esm-node/index.js",
|
|
27
27
|
"bin": {
|
|
@@ -75,11 +75,11 @@
|
|
|
75
75
|
],
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@modern-js/codesmith": "2.6.9",
|
|
78
|
-
"@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.4.0-ultramodern.
|
|
78
|
+
"@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.4.0-ultramodern.3"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@rslib/core": "0.23.0",
|
|
82
|
-
"@types/node": "^26.0.
|
|
82
|
+
"@types/node": "^26.0.1",
|
|
83
83
|
"@typescript/native-preview": "7.0.0-dev.20260624.1",
|
|
84
84
|
"tsx": "^4.22.4",
|
|
85
85
|
"typescript": "^6.0.3",
|
|
@@ -97,6 +97,6 @@
|
|
|
97
97
|
"test": "rm -rf dist && rslib build -c rslibconfig.mts && rstest --passWithNoTests"
|
|
98
98
|
},
|
|
99
99
|
"ultramodern": {
|
|
100
|
-
"frameworkVersion": "3.4.0-ultramodern.
|
|
100
|
+
"frameworkVersion": "3.4.0-ultramodern.3"
|
|
101
101
|
}
|
|
102
102
|
}
|
|
@@ -12,7 +12,7 @@ baseline; do not reintroduce Corepack or older pnpm aliases.
|
|
|
12
12
|
|
|
13
13
|
- `pnpm lint` runs Oxlint with the Ultracite preset.
|
|
14
14
|
- `pnpm format` runs oxfmt.
|
|
15
|
-
- `pnpm typecheck` runs effect-tsgo
|
|
15
|
+
- `pnpm typecheck` runs TS7 native-preview through effect-tsgo in project-reference build mode with parallel `--checkers` and `--builders`.
|
|
16
16
|
- `pnpm i18n:boundaries` verifies workspace source boundaries through `@modern-js/code-tools`.
|
|
17
17
|
- `pnpm contract:check` verifies the generated workspace contract.
|
|
18
18
|
- `pnpm mf:types` verifies Module Federation type outputs after builds.
|
|
@@ -72,6 +72,7 @@ Agents may read files under `repos/` to understand upstream patterns, APIs, and
|
|
|
72
72
|
## Project Priorities
|
|
73
73
|
|
|
74
74
|
- Keep `presetUltramodern` as the single preset.
|
|
75
|
+
- Maximize TS7 latest dev usage through `@typescript/native-preview` and TS-Go. Keep classic `typescript` on latest TS6 only for compatibility peers and tooling that cannot consume native-preview yet.
|
|
75
76
|
- Keep the initial workspace shell-only unless a user explicitly asks for a
|
|
76
77
|
starter vertical.
|
|
77
78
|
- Use `create <domain> --vertical` as the growth path for real business
|
|
@@ -68,6 +68,13 @@ Generated CI does not call the local aggregate. It runs format, lint,
|
|
|
68
68
|
typecheck, skills, i18n boundary validation, contract validation, and build as
|
|
69
69
|
separate matrix jobs so failures are isolated and parallelizable.
|
|
70
70
|
|
|
71
|
+
Type checking is TS7-first. `pnpm typecheck` runs
|
|
72
|
+
`scripts/ultramodern-typecheck.mjs` in TS-Go build mode over
|
|
73
|
+
`tsconfig.json` project references, with native-preview `--checkers` and
|
|
74
|
+
`--builders` enabled by default. `@typescript/native-preview` is the TS7 latest
|
|
75
|
+
dev compiler lane. The classic `typescript` package is pinned to latest TS6
|
|
76
|
+
only where compatibility peers or tooling still require it.
|
|
77
|
+
|
|
71
78
|
Read-only agent reference repositories under `repos/` (Effect and
|
|
72
79
|
UltraModern.js source lookup using squashed git subtrees) are an explicit
|
|
73
80
|
opt-in step: run `pnpm agents:refs:install` when you want them. `pnpm install`
|
|
@@ -5,13 +5,15 @@ export default defineConfig({
|
|
|
5
5
|
extends: [ultracite],
|
|
6
6
|
ignorePatterns: [
|
|
7
7
|
'.agents',
|
|
8
|
+
'.output',
|
|
8
9
|
'**/*.json',
|
|
9
10
|
'dist',
|
|
10
11
|
'node_modules',
|
|
11
12
|
'repos/**',
|
|
12
13
|
'.modern',
|
|
13
14
|
'.modernjs',
|
|
14
|
-
'**/
|
|
15
|
+
'**/modern-tanstack/**',
|
|
16
|
+
'**/routeTree.gen.*',
|
|
15
17
|
],
|
|
16
18
|
singleQuote: true,
|
|
17
19
|
});
|
|
@@ -10,11 +10,13 @@ export default defineConfig({
|
|
|
10
10
|
extends: [core, react],
|
|
11
11
|
ignorePatterns: [
|
|
12
12
|
'.agents',
|
|
13
|
+
'.output',
|
|
13
14
|
'dist',
|
|
14
15
|
'node_modules',
|
|
15
16
|
'repos/**',
|
|
16
17
|
'.modern',
|
|
17
18
|
'.modernjs',
|
|
18
|
-
'**/
|
|
19
|
+
'**/modern-tanstack/**',
|
|
20
|
+
'**/routeTree.gen.*',
|
|
19
21
|
],
|
|
20
22
|
});
|
|
@@ -14,6 +14,14 @@ minimumReleaseAgeExclude:
|
|
|
14
14
|
- '@typescript/native-preview'
|
|
15
15
|
- '@typescript/native-preview-*'
|
|
16
16
|
- '@types/react'
|
|
17
|
+
- '@rsbuild/core'
|
|
18
|
+
- '@rsbuild/plugin-react'
|
|
19
|
+
- '@rsbuild/plugin-type-check'
|
|
20
|
+
- '@rspack/binding'
|
|
21
|
+
- '@rspack/binding-*'
|
|
22
|
+
- '@rspack/core'
|
|
23
|
+
- '@rspack/plugin-react-refresh'
|
|
24
|
+
- 'ts-checker-rspack-plugin'
|
|
17
25
|
trustPolicy: no-downgrade
|
|
18
26
|
trustPolicyIgnoreAfter: 1440
|
|
19
27
|
blockExoticSubdeps: true
|
|
@@ -20,13 +20,30 @@ const cloneTimeoutMs = Number.parseInt(
|
|
|
20
20
|
|
|
21
21
|
const readJson = filePath => JSON.parse(fs.readFileSync(filePath, 'utf-8'));
|
|
22
22
|
|
|
23
|
-
const
|
|
24
|
-
|
|
23
|
+
const commandOverrideEnv = {
|
|
24
|
+
gh: 'ULTRAMODERN_GH_BIN',
|
|
25
|
+
git: 'ULTRAMODERN_GIT_BIN',
|
|
26
|
+
lefthook: 'ULTRAMODERN_LEFTHOOK_BIN',
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const resolveCommand = command => {
|
|
30
|
+
const overrideEnv = commandOverrideEnv[command];
|
|
31
|
+
return overrideEnv ? (process.env[overrideEnv] ?? command) : command;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const requiresCommandShell = command =>
|
|
35
|
+
process.platform === 'win32' && /\.(?:bat|cmd)$/iu.test(command);
|
|
36
|
+
|
|
37
|
+
const run = (command, args, options = {}) => {
|
|
38
|
+
const resolvedCommand = resolveCommand(command);
|
|
39
|
+
return execFileSync(resolvedCommand, args, {
|
|
25
40
|
cwd: options.cwd ?? root,
|
|
26
41
|
encoding: 'utf-8',
|
|
42
|
+
shell: requiresCommandShell(resolvedCommand),
|
|
27
43
|
stdio: options.stdio ?? ['ignore', 'pipe', 'pipe'],
|
|
28
44
|
timeout: options.timeout,
|
|
29
45
|
});
|
|
46
|
+
};
|
|
30
47
|
|
|
31
48
|
const commandExists = command => {
|
|
32
49
|
try {
|
|
@@ -47,17 +64,18 @@ const requireGit = () => {
|
|
|
47
64
|
);
|
|
48
65
|
};
|
|
49
66
|
|
|
50
|
-
const
|
|
67
|
+
const gitTopLevel = () => {
|
|
51
68
|
try {
|
|
52
|
-
return run('git', ['rev-parse', '--
|
|
69
|
+
return run('git', ['rev-parse', '--show-toplevel']).trim();
|
|
53
70
|
} catch {
|
|
54
|
-
return
|
|
71
|
+
return undefined;
|
|
55
72
|
}
|
|
56
73
|
};
|
|
57
74
|
|
|
58
75
|
const initializeGitRepository = () => {
|
|
59
|
-
|
|
60
|
-
|
|
76
|
+
const topLevel = gitTopLevel();
|
|
77
|
+
if (topLevel !== undefined) {
|
|
78
|
+
return path.resolve(topLevel) === root;
|
|
61
79
|
}
|
|
62
80
|
|
|
63
81
|
try {
|
|
@@ -66,9 +84,24 @@ const initializeGitRepository = () => {
|
|
|
66
84
|
run('git', ['init'], { stdio: 'inherit' });
|
|
67
85
|
run('git', ['branch', '-M', 'main'], { stdio: 'inherit' });
|
|
68
86
|
}
|
|
87
|
+
return true;
|
|
69
88
|
};
|
|
70
89
|
|
|
71
90
|
const installLefthook = () => {
|
|
91
|
+
if (!commandExists('git')) {
|
|
92
|
+
console.warn(
|
|
93
|
+
'Skipping lefthook hook installation because git is not available. Install git and run lefthook install from the generated workspace root to enable local hooks.',
|
|
94
|
+
);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (!initializeGitRepository()) {
|
|
99
|
+
console.log(
|
|
100
|
+
'Skipping lefthook hook installation because this generated workspace is nested inside another Git worktree. Run git init from the generated workspace root before installing hooks if you want workspace-local hooks.',
|
|
101
|
+
);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
|
|
72
105
|
try {
|
|
73
106
|
run('lefthook', ['install'], { stdio: 'inherit' });
|
|
74
107
|
} catch (error) {
|
|
@@ -199,8 +232,8 @@ if (checkOnly) {
|
|
|
199
232
|
}
|
|
200
233
|
|
|
201
234
|
if (missingCloneInstalled.length > 0) {
|
|
202
|
-
console.
|
|
203
|
-
`
|
|
235
|
+
console.log(
|
|
236
|
+
`Advisory: clone-installed agent skills are not present: ${missingCloneInstalled.join(', ')}. This is expected in CI, nested generated workspaces, and postinstall-only installs; run pnpm skills:install when you need those skills.`,
|
|
204
237
|
);
|
|
205
238
|
} else {
|
|
206
239
|
console.log('All pinned agent skills are installed.');
|
|
@@ -218,7 +251,6 @@ if (postinstall && !cloneOptIn) {
|
|
|
218
251
|
|
|
219
252
|
fs.mkdirSync(installDir, { recursive: true });
|
|
220
253
|
requireGit();
|
|
221
|
-
initializeGitRepository();
|
|
222
254
|
|
|
223
255
|
for (const source of [...requiredCloneSources, ...optionalCloneSources]) {
|
|
224
256
|
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'ultramodern-skills-'));
|
|
@@ -7,8 +7,7 @@ interface ShellFrameProps {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export default function ShellFrame({ children }: ShellFrameProps) {
|
|
10
|
-
const {
|
|
11
|
-
const t = i18nInstance['t'].bind(i18nInstance);
|
|
10
|
+
const { language, t } = useModernI18n();
|
|
12
11
|
const { alternates } = useLocalizedLocation();
|
|
13
12
|
|
|
14
13
|
return (
|
|
@@ -9,11 +9,17 @@ const appName = {{appDisplayNameJson}};
|
|
|
9
9
|
const fallbackLanguage = 'en';
|
|
10
10
|
const supportedLanguages = ['en', 'cs'] as const;
|
|
11
11
|
type SupportedLanguage = (typeof supportedLanguages)[number];
|
|
12
|
-
type
|
|
12
|
+
type GeneratedRouteMetadata = (typeof ultramodernRouteMetadata)[number];
|
|
13
|
+
type RouteMetadata = Omit<
|
|
14
|
+
GeneratedRouteMetadata,
|
|
15
|
+
'indexable' | 'jsonLd' | 'public'
|
|
16
|
+
> & {
|
|
17
|
+
readonly indexable: boolean;
|
|
13
18
|
readonly jsonLd?: RouteJsonLd;
|
|
19
|
+
readonly public: boolean;
|
|
14
20
|
};
|
|
15
21
|
|
|
16
|
-
const routeMetadata
|
|
22
|
+
const routeMetadata: readonly RouteMetadata[] = ultramodernRouteMetadata;
|
|
17
23
|
|
|
18
24
|
const isSupportedLanguage = (value: string): value is SupportedLanguage =>
|
|
19
25
|
supportedLanguages.includes(value as SupportedLanguage);
|
|
@@ -84,6 +90,11 @@ const resolveRouteMetadata = (pathname: string) => {
|
|
|
84
90
|
return routeMetadata[0];
|
|
85
91
|
};
|
|
86
92
|
|
|
93
|
+
const isPublicIndexableRoute = (
|
|
94
|
+
route: RouteMetadata | undefined,
|
|
95
|
+
): route is RouteMetadata =>
|
|
96
|
+
route !== undefined && route.public && route.indexable;
|
|
97
|
+
|
|
87
98
|
const absoluteUrl = (pathname: string) => {
|
|
88
99
|
const origin = ULTRAMODERN_SITE_URL.replace(/\/+$/u, '');
|
|
89
100
|
return `${origin}${pathname}`;
|
|
@@ -93,18 +104,18 @@ const sanitiseJsonLd = (value: RouteJsonLd) =>
|
|
|
93
104
|
JSON.stringify(value).replaceAll('<', '\\u003c');
|
|
94
105
|
|
|
95
106
|
export const UltramodernRouteHead = () => {
|
|
96
|
-
const {
|
|
97
|
-
const t = i18nInstance['t'].bind(i18nInstance);
|
|
107
|
+
const { language, t } = useModernI18n();
|
|
98
108
|
const { canonical, alternates } = useLocalizedLocation();
|
|
99
109
|
const route = resolveRouteMetadata(canonical);
|
|
100
|
-
const title = route ? t(route.titleKey)
|
|
101
|
-
const description =
|
|
110
|
+
const title = route === undefined ? appName : t(route.titleKey);
|
|
111
|
+
const description =
|
|
112
|
+
route === undefined ? appName : t(route.descriptionKey);
|
|
102
113
|
const canonicalUrl = absoluteUrl(alternates[fallbackLanguage] ?? `/${fallbackLanguage}`);
|
|
103
|
-
const indexable = route
|
|
104
|
-
const jsonLd =
|
|
114
|
+
const indexable = isPublicIndexableRoute(route);
|
|
115
|
+
const jsonLd = route?.jsonLd;
|
|
105
116
|
|
|
106
117
|
return (
|
|
107
|
-
<Helmet htmlAttributes={{ lang:
|
|
118
|
+
<Helmet htmlAttributes={{ lang: language ?? fallbackLanguage }}>
|
|
108
119
|
<title>{title}</title>
|
|
109
120
|
<meta content={description} name="description" />
|
|
110
121
|
<meta content={indexable ? 'index, follow' : 'noindex, nofollow'} name="robots" />
|
|
@@ -128,13 +139,13 @@ export const UltramodernRouteHead = () => {
|
|
|
128
139
|
<meta content={description} property="og:description" />
|
|
129
140
|
<meta content={canonicalUrl} property="og:url" />
|
|
130
141
|
<meta content="website" property="og:type" />
|
|
131
|
-
<meta content={
|
|
142
|
+
<meta content={language ?? fallbackLanguage} property="og:locale" />
|
|
132
143
|
<meta content="summary_large_image" name="twitter:card" />
|
|
133
144
|
<meta content={title} name="twitter:title" />
|
|
134
145
|
<meta content={description} name="twitter:description" />
|
|
135
|
-
{jsonLd
|
|
146
|
+
{jsonLd !== undefined ? (
|
|
136
147
|
<script type="application/ld+json">{sanitiseJsonLd(jsonLd)}</script>
|
|
137
|
-
)}
|
|
148
|
+
) : null}
|
|
138
149
|
</>
|
|
139
150
|
)}
|
|
140
151
|
</Helmet>
|