@bleedingdev/modern-js-create 3.4.0-ultramodern.0 → 3.4.0-ultramodern.10
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 +7 -7
- package/dist/cjs/ultramodern-workspace/add-vertical.cjs +24 -0
- package/dist/cjs/ultramodern-workspace/contracts.cjs +8 -4
- package/dist/cjs/ultramodern-workspace/demo-components.cjs +14 -21
- package/dist/cjs/ultramodern-workspace/descriptors.cjs +2 -2
- package/dist/cjs/ultramodern-workspace/effect-api.cjs +162 -31
- package/dist/cjs/ultramodern-workspace/module-federation.cjs +29 -10
- package/dist/cjs/ultramodern-workspace/package-json.cjs +102 -14
- 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 +6 -8
- package/dist/esm/ultramodern-workspace/add-vertical.js +25 -1
- package/dist/esm/ultramodern-workspace/contracts.js +9 -5
- package/dist/esm/ultramodern-workspace/demo-components.js +14 -21
- package/dist/esm/ultramodern-workspace/descriptors.js +2 -2
- package/dist/esm/ultramodern-workspace/effect-api.js +162 -31
- package/dist/esm/ultramodern-workspace/module-federation.js +27 -11
- package/dist/esm/ultramodern-workspace/package-json.js +87 -11
- 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 +9 -11
- package/dist/esm-node/ultramodern-workspace/add-vertical.js +25 -1
- package/dist/esm-node/ultramodern-workspace/contracts.js +9 -5
- package/dist/esm-node/ultramodern-workspace/demo-components.js +14 -21
- package/dist/esm-node/ultramodern-workspace/descriptors.js +2 -2
- package/dist/esm-node/ultramodern-workspace/effect-api.js +162 -31
- package/dist/esm-node/ultramodern-workspace/module-federation.js +27 -11
- package/dist/esm-node/ultramodern-workspace/package-json.js +87 -11
- 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 +9 -11
- package/dist/types/ultramodern-workspace/module-federation.d.ts +1 -0
- package/dist/types/ultramodern-workspace/package-json.d.ts +12 -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/patches/@tanstack__router-core@1.171.13.patch +51 -0
- package/template-workspace/pnpm-workspace.yaml.handlebars +11 -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 +22 -11
- package/templates/packages/shared-contracts-index.ts +206 -272
- package/templates/workspace-scripts/assert-mf-types.mjs.handlebars +9 -0
- package/templates/workspace-scripts/ultramodern-typecheck.mjs +197 -0
- package/templates/workspace-scripts/validate-ultramodern-workspace.mjs.handlebars +234 -2
|
@@ -8,10 +8,10 @@ import { createEffectClient, createEffectServiceEntry, createEffectSharedApi, cr
|
|
|
8
8
|
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
|
-
import { createAppModernConfig, createRemoteModuleFederationConfig, createShellModuleFederationConfig, createUltramodernBuildModule } from "./module-federation.js";
|
|
12
|
-
import { assertUniqueTailwindPrefixes,
|
|
11
|
+
import { createAppModernConfig, createRemoteModuleFederationConfig, createShellModuleFederationConfig, createUltramodernBuildModule, createUltramodernBuildReexportModule } from "./module-federation.js";
|
|
12
|
+
import { assertUniqueTailwindPrefixes, toPackageScope } from "./naming.js";
|
|
13
13
|
import { runCodeSmithOverlays } from "./overlays.js";
|
|
14
|
-
import { createAppPackage,
|
|
14
|
+
import { createAppMfTypesTsConfig, 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,9 +23,11 @@ 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
|
+
writeJson(targetDir, `${resolvedApp.directory}/tsconfig.mf-types.json`, createAppMfTypesTsConfig(resolvedApp));
|
|
27
28
|
writeFile(targetDir, `${resolvedApp.directory}/src/modern-app-env.d.ts`, createAppEnvDts(resolvedApp, remotes));
|
|
28
|
-
writeFile(targetDir, `${resolvedApp.directory}/src/ultramodern-build.ts`,
|
|
29
|
+
writeFile(targetDir, `${resolvedApp.directory}/src/ultramodern-build.ts`, createUltramodernBuildReexportModule());
|
|
30
|
+
writeFile(targetDir, `${resolvedApp.directory}/shared/ultramodern-build.ts`, createUltramodernBuildModule(scope, resolvedApp));
|
|
29
31
|
writeFile(targetDir, publicWeb.jsonLdHelperFile.path, publicWeb.jsonLdHelperFile.content);
|
|
30
32
|
writeFile(targetDir, publicWeb.routeMetadataFile.path, publicWeb.routeMetadataFile.content);
|
|
31
33
|
writeFile(targetDir, publicWeb.routeHeadFile.path, publicWeb.routeHeadFile.content);
|
|
@@ -66,12 +68,7 @@ function writeApp(targetDir, scope, app, packageSource, enableTailwind, remotes
|
|
|
66
68
|
function writeSharedPackages(targetDir, scope) {
|
|
67
69
|
for (const sharedPackage of sharedPackages){
|
|
68
70
|
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
|
-
});
|
|
71
|
+
writeJson(targetDir, `${sharedPackage.directory}/tsconfig.json`, createSharedPackageTsConfig(sharedPackage.directory));
|
|
75
72
|
}
|
|
76
73
|
writeFile(targetDir, 'packages/shared-contracts/src/index.ts', createSharedContractsIndex());
|
|
77
74
|
writeFile(targetDir, 'packages/shared-design-tokens/src/index.ts', `export const sharedDesignTokens = {
|
|
@@ -113,6 +110,7 @@ function generateUltramodernWorkspace(options) {
|
|
|
113
110
|
});
|
|
114
111
|
writeJson(options.targetDir, 'package.json', createRootPackageJson(scope, packageSource, initialVerticals));
|
|
115
112
|
writeJson(options.targetDir, 'tsconfig.base.json', createTsConfigBase());
|
|
113
|
+
writeJson(options.targetDir, 'tsconfig.json', createRootTsConfig(createdApps));
|
|
116
114
|
writeJson(options.targetDir, 'topology/reference-topology.json', createTopology(scope, initialVerticals));
|
|
117
115
|
writeJson(options.targetDir, 'topology/ownership.json', createOwnership(scope, initialVerticals));
|
|
118
116
|
writeJson(options.targetDir, 'topology/local-overlays/development.json', createDevelopmentOverlay(initialVerticals));
|
|
@@ -13,4 +13,5 @@ export declare function createUltramodernBuildModule(scope: string, app: {
|
|
|
13
13
|
id: string;
|
|
14
14
|
packageSuffix: string;
|
|
15
15
|
}): string;
|
|
16
|
+
export declare function createUltramodernBuildReexportModule(): string;
|
|
16
17
|
export declare function createRemoteModuleFederationConfig(scope: string, app: WorkspaceApp, remotes?: WorkspaceApp[]): string;
|
|
@@ -1,12 +1,22 @@
|
|
|
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 createAppMfTypesTsConfig(app: WorkspaceApp): JsonValue;
|
|
17
|
+
export declare function createSharedPackageTsConfig(packageDir: string): JsonValue;
|
|
18
|
+
export declare function createRootTsConfig(apps?: WorkspaceApp[]): JsonValue;
|
|
10
19
|
export declare function createAppPackage(scope: string, app: WorkspaceApp, packageSource: ResolvedPackageSource, enableTailwind: boolean, remotes?: WorkspaceApp[]): JsonValue;
|
|
11
20
|
export declare function createSharedPackage(scope: string, id: string, description: string): JsonValue;
|
|
12
21
|
export declare function createSharedContractsIndex(): string;
|
|
22
|
+
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 = "7.0.1-rc";
|
|
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.10",
|
|
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.10"
|
|
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.10"
|
|
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
|
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
diff --git a/dist/cjs/load-matches.cjs b/dist/cjs/load-matches.cjs
|
|
2
|
+
index c09976a80c2c112b7dac6f941e643c81eeaf8d52..ec5156d89e9c5924a9ec0c19aad79711124f9ff4 100644
|
|
3
|
+
--- a/dist/cjs/load-matches.cjs
|
|
4
|
+
+++ b/dist/cjs/load-matches.cjs
|
|
5
|
+
@@ -442,0 +443 @@
|
|
6
|
+
+ if (!match) return;
|
|
7
|
+
@@ -472,0 +474 @@
|
|
8
|
+
+ if (!match) return inner.matches[index];
|
|
9
|
+
@@ -487,0 +490 @@
|
|
10
|
+
+ if (!match) return inner.matches[index];
|
|
11
|
+
@@ -503 +506 @@
|
|
12
|
+
- return inner.router.getMatch(matchId);
|
|
13
|
+
+ return inner.router.getMatch(matchId) ?? inner.matches[index];
|
|
14
|
+
diff --git a/dist/esm/load-matches.js b/dist/esm/load-matches.js
|
|
15
|
+
index bcea2e0d88d037a01b93bf36dd6e643f98028e83..57484bf2825dab47030a1d4f905b9fb2e6067310 100644
|
|
16
|
+
--- a/dist/esm/load-matches.js
|
|
17
|
+
+++ b/dist/esm/load-matches.js
|
|
18
|
+
@@ -442,0 +443 @@
|
|
19
|
+
+ if (!match) return;
|
|
20
|
+
@@ -472,0 +474 @@
|
|
21
|
+
+ if (!match) return inner.matches[index];
|
|
22
|
+
@@ -487,0 +490 @@
|
|
23
|
+
+ if (!match) return inner.matches[index];
|
|
24
|
+
@@ -503 +506 @@
|
|
25
|
+
- return inner.router.getMatch(matchId);
|
|
26
|
+
+ return inner.router.getMatch(matchId) ?? inner.matches[index];
|
|
27
|
+
diff --git a/src/load-matches.ts b/src/load-matches.ts
|
|
28
|
+
index f901a0c97ddf0618dd83229ac260277b46e2676d..76674e01e89ac2cbaba4d776c2be3bf0e3fdb432 100644
|
|
29
|
+
--- a/src/load-matches.ts
|
|
30
|
+
+++ b/src/load-matches.ts
|
|
31
|
+
@@ -838 +838,4 @@
|
|
32
|
+
- const match = inner.router.getMatch(matchId)!
|
|
33
|
+
+ const match = inner.router.getMatch(matchId)
|
|
34
|
+
+ if (!match) {
|
|
35
|
+
+ return
|
|
36
|
+
+ }
|
|
37
|
+
@@ -906 +909,4 @@
|
|
38
|
+
- const match = inner.router.getMatch(matchId)!
|
|
39
|
+
+ const match = inner.router.getMatch(matchId)
|
|
40
|
+
+ if (!match) {
|
|
41
|
+
+ return inner.matches[index]!
|
|
42
|
+
+ }
|
|
43
|
+
@@ -936 +942,4 @@
|
|
44
|
+
- const match = inner.router.getMatch(matchId)!
|
|
45
|
+
+ const match = inner.router.getMatch(matchId)
|
|
46
|
+
+ if (!match) {
|
|
47
|
+
+ return inner.matches[index]!
|
|
48
|
+
+ }
|
|
49
|
+
@@ -955 +964 @@
|
|
50
|
+
- return inner.router.getMatch(matchId)!
|
|
51
|
+
+ return inner.router.getMatch(matchId) ?? inner.matches[index]!
|
|
@@ -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
|
|
@@ -43,3 +51,6 @@ allowBuilds:
|
|
|
43
51
|
msgpackr-extract: true
|
|
44
52
|
sharp: true
|
|
45
53
|
workerd: true
|
|
54
|
+
|
|
55
|
+
patchedDependencies:
|
|
56
|
+
'@tanstack/router-core@{{tanstackRouterVersion}}': patches/@tanstack__router-core@{{tanstackRouterVersion}}.patch
|
|
@@ -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,11 +139,11 @@ 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 ? null : (
|
|
136
147
|
<script type="application/ld+json">{sanitiseJsonLd(jsonLd)}</script>
|
|
137
148
|
)}
|
|
138
149
|
</>
|