@bleedingdev/modern-js-create 3.2.0-ultramodern.9 → 3.2.0-ultramodern.91

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.
Files changed (51) hide show
  1. package/README.md +152 -35
  2. package/dist/index.js +4700 -608
  3. package/dist/types/locale/en.d.ts +3 -0
  4. package/dist/types/locale/zh.d.ts +3 -0
  5. package/dist/types/ultramodern-workspace.d.ts +11 -0
  6. package/package.json +6 -6
  7. package/template/.codex/hooks.json +16 -0
  8. package/template/.github/renovate.json +53 -0
  9. package/template/.github/workflows/ultramodern-gates.yml.handlebars +34 -10
  10. package/template/.mise.toml.handlebars +2 -0
  11. package/template/AGENTS.md +9 -6
  12. package/template/README.md +60 -34
  13. package/template/api/effect/index.ts.handlebars +8 -3
  14. package/template/config/public/locales/cs/translation.json +39 -0
  15. package/template/config/public/locales/en/translation.json +39 -0
  16. package/template/lefthook.yml +10 -0
  17. package/template/modern.config.ts.handlebars +39 -24
  18. package/template/oxfmt.config.ts +11 -3
  19. package/template/oxlint.config.ts +11 -4
  20. package/template/package.json.handlebars +43 -34
  21. package/template/pnpm-workspace.yaml +29 -0
  22. package/template/rstest.config.mts +5 -0
  23. package/template/scripts/bootstrap-agent-skills.mjs +160 -35
  24. package/template/scripts/check-i18n-strings.mjs +94 -0
  25. package/template/scripts/validate-ultramodern.mjs.handlebars +387 -35
  26. package/template/shared/effect/api.ts.handlebars +1 -2
  27. package/template/src/modern-app-env.d.ts +2 -0
  28. package/template/src/modern.runtime.ts.handlebars +17 -3
  29. package/template/src/routes/[lang]/page.tsx.handlebars +211 -0
  30. package/template/src/routes/index.css.handlebars +14 -3
  31. package/template/src/routes/layout.tsx.handlebars +2 -1
  32. package/template/tailwind.config.ts.handlebars +1 -1
  33. package/template/tests/tsconfig.json +7 -0
  34. package/template/tests/ultramodern.contract.test.ts.handlebars +78 -0
  35. package/template-workspace/.agents/agent-reference-repos.json +24 -0
  36. package/template-workspace/.agents/skills-lock.json +19 -0
  37. package/template-workspace/.codex/hooks.json +16 -0
  38. package/template-workspace/.github/renovate.json +29 -0
  39. package/template-workspace/.github/workflows/ultramodern-workspace-gates.yml.handlebars +54 -0
  40. package/template-workspace/.gitignore.handlebars +5 -0
  41. package/template-workspace/.mise.toml.handlebars +2 -0
  42. package/template-workspace/AGENTS.md +36 -5
  43. package/template-workspace/README.md.handlebars +61 -11
  44. package/template-workspace/lefthook.yml +10 -0
  45. package/template-workspace/oxfmt.config.ts +13 -3
  46. package/template-workspace/oxlint.config.ts +12 -4
  47. package/template-workspace/pnpm-workspace.yaml +26 -8
  48. package/template-workspace/scripts/bootstrap-agent-skills.mjs +184 -26
  49. package/template-workspace/scripts/setup-agent-reference-repos.mjs +368 -0
  50. package/template/src/routes/page.tsx.handlebars +0 -119
  51. package/template-workspace/scripts/validate-ultramodern-workspace.mjs.handlebars +0 -403
@@ -35,6 +35,7 @@ export declare const EN_LOCALE: {
35
35
  optionUltramodernPackageSource: string;
36
36
  optionUltramodernPackageScope: string;
37
37
  optionUltramodernPackageNamePrefix: string;
38
+ optionVertical: string;
38
39
  optionSub: string;
39
40
  examples: string;
40
41
  example1: string;
@@ -47,6 +48,8 @@ export declare const EN_LOCALE: {
47
48
  example8: string;
48
49
  example9: string;
49
50
  example10: string;
51
+ example11: string;
52
+ example12: string;
50
53
  moreInfo: string;
51
54
  };
52
55
  version: {
@@ -35,6 +35,7 @@ export declare const ZH_LOCALE: {
35
35
  optionUltramodernPackageSource: string;
36
36
  optionUltramodernPackageScope: string;
37
37
  optionUltramodernPackageNamePrefix: string;
38
+ optionVertical: string;
38
39
  optionSub: string;
39
40
  examples: string;
40
41
  example1: string;
@@ -47,6 +48,8 @@ export declare const ZH_LOCALE: {
47
48
  example8: string;
48
49
  example9: string;
49
50
  example10: string;
51
+ example11: string;
52
+ example12: string;
50
53
  moreInfo: string;
51
54
  };
52
55
  version: {
@@ -3,6 +3,7 @@ export type UltramodernWorkspaceOptions = {
3
3
  targetDir: string;
4
4
  packageName: string;
5
5
  modernVersion: string;
6
+ enableTailwind?: boolean;
6
7
  packageSource?: {
7
8
  strategy?: UltramodernPackageSourceStrategy;
8
9
  modernPackageVersion?: string;
@@ -11,10 +12,20 @@ export type UltramodernWorkspaceOptions = {
11
12
  aliasPackageNamePrefix?: string;
12
13
  };
13
14
  };
15
+ export type AddUltramodernVerticalOptions = {
16
+ workspaceRoot: string;
17
+ name: string;
18
+ modernVersion: string;
19
+ enableTailwind?: boolean;
20
+ packageSource?: UltramodernWorkspaceOptions['packageSource'];
21
+ };
14
22
  export declare const ULTRAMODERN_WORKSPACE_FLAG = "--ultramodern-workspace";
23
+ export declare function addUltramodernVertical(options: AddUltramodernVerticalOptions): void;
15
24
  export declare function generateUltramodernWorkspace(options: UltramodernWorkspaceOptions): void;
16
25
  export declare const ultramodernWorkspaceVersions: {
17
26
  tanstackRouter: string;
18
27
  moduleFederation: string;
28
+ tailwind: string;
29
+ tailwindPostcss: string;
19
30
  };
20
31
  export {};
package/package.json CHANGED
@@ -21,7 +21,7 @@
21
21
  "engines": {
22
22
  "node": ">=20"
23
23
  },
24
- "version": "3.2.0-ultramodern.9",
24
+ "version": "3.2.0-ultramodern.91",
25
25
  "types": "./dist/types/index.d.ts",
26
26
  "main": "./dist/index.js",
27
27
  "bin": {
@@ -38,10 +38,10 @@
38
38
  ],
39
39
  "devDependencies": {
40
40
  "@rslib/core": "0.21.5",
41
- "@types/node": "^25.8.0",
42
- "@typescript/native-preview": "7.0.0-dev.20260516.1",
43
- "tsx": "^4.22.0",
44
- "@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.2.0-ultramodern.9"
41
+ "@types/node": "^25.9.1",
42
+ "@typescript/native-preview": "7.0.0-dev.20260527.2",
43
+ "tsx": "^4.22.3",
44
+ "@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.2.0-ultramodern.91"
45
45
  },
46
46
  "publishConfig": {
47
47
  "registry": "https://registry.npmjs.org/",
@@ -54,6 +54,6 @@
54
54
  "start": "node ./dist/index.js"
55
55
  },
56
56
  "ultramodern": {
57
- "frameworkVersion": "3.2.0-ultramodern.9"
57
+ "frameworkVersion": "3.2.0-ultramodern.91"
58
58
  }
59
59
  }
@@ -0,0 +1,16 @@
1
+ {
2
+ "Stop": [
3
+ {
4
+ "command": "pnpm format && pnpm lint:fix && pnpm ultramodern:check",
5
+ "timeout": 600000,
6
+ "statusMessage": "Running UltraModern quality gates"
7
+ }
8
+ ],
9
+ "SubagentStop": [
10
+ {
11
+ "command": "pnpm format && pnpm lint:fix && pnpm ultramodern:check",
12
+ "timeout": 600000,
13
+ "statusMessage": "Running UltraModern quality gates"
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,53 @@
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
+ "extends": [
4
+ "config:recommended",
5
+ "helpers:pinGitHubActionDigests"
6
+ ],
7
+ "dependencyDashboard": true,
8
+ "minimumReleaseAge": "1 day",
9
+ "prConcurrentLimit": 5,
10
+ "prHourlyLimit": 2,
11
+ "rangeStrategy": "bump",
12
+ "schedule": [
13
+ "before 5am on monday"
14
+ ],
15
+ "timezone": "Etc/UTC",
16
+ "packageRules": [
17
+ {
18
+ "matchManagers": [
19
+ "github-actions"
20
+ ],
21
+ "groupName": "github-actions",
22
+ "labels": [
23
+ "dependencies",
24
+ "github-actions",
25
+ "security"
26
+ ]
27
+ },
28
+ {
29
+ "matchManagers": [
30
+ "npm"
31
+ ],
32
+ "matchUpdateTypes": [
33
+ "patch",
34
+ "minor"
35
+ ],
36
+ "groupName": "npm minor and patch updates",
37
+ "labels": [
38
+ "dependencies",
39
+ "npm"
40
+ ]
41
+ },
42
+ {
43
+ "matchUpdateTypes": [
44
+ "major"
45
+ ],
46
+ "dependencyDashboardApproval": true,
47
+ "labels": [
48
+ "dependencies",
49
+ "major"
50
+ ]
51
+ }
52
+ ]
53
+ }
@@ -4,27 +4,51 @@ on:
4
4
  push:
5
5
  pull_request:
6
6
 
7
+ permissions:
8
+ contents: read
9
+
10
+ defaults:
11
+ run:
12
+ shell: bash
13
+
14
+ env:
15
+ FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
16
+
17
+ concurrency:
18
+ group: ultramodern-gates-${{ github.workflow }}-${{ github.ref }}
19
+ cancel-in-progress: true
20
+
7
21
  jobs:
8
22
  ultramodern-gates:
9
23
  runs-on: ubuntu-latest
24
+ timeout-minutes: 20
10
25
  steps:
11
- - name: Checkout
12
- uses: actions/checkout@v4
26
+ - name: Harden Runner
27
+ uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5 # v2
28
+ with:
29
+ egress-policy: audit
13
30
 
14
- - name: Setup pnpm
15
- uses: pnpm/action-setup@v4
31
+ - name: Checkout
32
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
33
+ with:
34
+ fetch-depth: 1
35
+ persist-credentials: false
16
36
 
17
37
  - name: Setup Node.js
18
- uses: actions/setup-node@v4
38
+ uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
19
39
  with:
20
- node-version: 20
21
- cache: pnpm
40
+ node-version: 24
41
+
42
+ - name: Setup mise
43
+ uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0
22
44
 
23
45
  - name: Install Dependencies
24
- run: pnpm install
46
+ run: mise exec -- pnpm install --frozen-lockfile
25
47
 
26
48
  - name: Validate Ultramodern Contract
27
- run: pnpm run ultramodern:check
49
+ run: mise exec -- pnpm run ultramodern:check
28
50
 
29
51
  - name: Build
30
- run: pnpm run build
52
+ env:
53
+ MODERN_PUBLIC_SITE_URL: http://localhost:8080
54
+ run: mise exec -- pnpm run build
@@ -0,0 +1,2 @@
1
+ [tools]
2
+ pnpm = "{{pnpmVersion}}"
@@ -7,14 +7,17 @@ This project is generated for Codex-first UltraModern.js work.
7
7
  - `pnpm lint` runs Oxlint with the Ultracite preset.
8
8
  - `pnpm format` runs oxfmt.
9
9
  - `pnpm typecheck` runs effect-tsgo as the TypeScript checker.
10
+ - `pnpm i18n:check` rejects hardcoded user-visible JSX text.
10
11
  - `pnpm ultramodern:check` verifies the generated contract.
12
+ - Generated Codex stop hooks and subagent-stop hooks run `pnpm format && pnpm lint:fix && pnpm ultramodern:check`.
13
+ - `postinstall` formats the generated tree, installs private orchestration skills when available, initializes a Git repository when needed, and installs `lefthook`. Generated `lefthook.yml` runs `pnpm format && pnpm lint:fix && pnpm ultramodern:check` on pre-commit; pre-push runs `pnpm ultramodern:check`.
11
14
 
12
- ## Private Skills
15
+ ## Internationalization
16
+
17
+ Runtime i18n is enabled by default. Agents must put user-visible UI copy in `config/public/locales/<lang>/translation.json` and render it through `react-i18next` or `@modern-js/plugin-i18n/runtime`. Do not add hardcoded JSX text, `aria-label`, `title`, `alt`, or `placeholder` strings unless the value is a non-translatable technical token.
13
18
 
14
- Private orchestration skills are not vendored into this template. If you are authorized for `TechsioCZ/skills`, run:
19
+ Routes are locale-prefixed by default through `localePathRedirect: true`. Keep localized pages under `src/routes/[lang]`, use links for language switching, and preserve canonical plus `hreflang` metadata. Production builds fail unless `MODERN_PUBLIC_SITE_URL` is set, so deployed canonical URLs always use the production origin.
15
20
 
16
- ```bash
17
- pnpm skills:install
18
- ```
21
+ ## Private Skills
19
22
 
20
- The installer clones that private repository and copies only the allowlisted skills from `.agents/skills-lock.json`.
23
+ Private orchestration skills are installed automatically during `pnpm install` when the current developer is authorized for `TechsioCZ/skills`. The installer clones that private repository and copies only the allowlisted skills from `.agents/skills-lock.json`; unauthorized developers get a warning and can continue with the public contract.
@@ -1,10 +1,16 @@
1
1
  # UltraModern.js 3.0 Starter
2
2
 
3
+ This generated app is a simple UltraModern.js starting point. It gives one app
4
+ with localized routes, production URL metadata, optional BFF support, Rstest,
5
+ Oxlint, oxfmt, and a local contract check. You can build a useful product here
6
+ without deleting fake product areas, shell packages, or deployment topology.
7
+
3
8
  ## Setup
4
9
 
5
10
  Install the dependencies:
6
11
 
7
12
  ```bash
13
+ mise install
8
14
  pnpm install
9
15
  ```
10
16
 
@@ -19,61 +25,81 @@ pnpm dev
19
25
  Build the app for production:
20
26
 
21
27
  ```bash
22
- pnpm build
28
+ MODERN_PUBLIC_SITE_URL=https://example.com pnpm build
23
29
  ```
24
30
 
25
- Validate the generated Ultramodern preset contract locally:
31
+ Preview the production build locally:
26
32
 
27
33
  ```bash
28
- pnpm run ultramodern:check
34
+ pnpm serve
29
35
  ```
30
36
 
31
- The generated preset defaults are opt-out. Disable specific contracts via env vars:
37
+ Run the local gates before treating the scaffold as ready:
32
38
 
33
39
  ```bash
34
- MODERN_BASELINE_ENABLE_MF_SSR=false
35
- MODERN_BASELINE_ENABLE_BFF_REQUEST_ID=false
36
- MODERN_BASELINE_ENABLE_TELEMETRY_EXPORTERS=false
40
+ pnpm run ultramodern:check
41
+ MODERN_PUBLIC_SITE_URL=https://example.com pnpm run build
37
42
  ```
38
43
 
39
- The generated starter also includes `.github/workflows/ultramodern-gates.yml`.
40
- That workflow runs `pnpm run ultramodern:check` and `pnpm run build` on every
41
- push and pull request so the `presetUltramodern(...)` contract stays explicit.
44
+ ## What You Get
42
45
 
43
- ## Micro Vertical Workspaces
46
+ The default app is intentionally monolith-friendly:
44
47
 
45
- Inside a Micro Vertical workspace, generate shell, remote, and service packages
46
- with `--sub` so the workspace root owns package-manager and CI policy:
48
+ | Area | Starting Point |
49
+ | --- | --- |
50
+ | App routes | Locale-prefixed pages under `src/routes/[lang]` |
51
+ | Copy | English and Czech resources in `config/public/locales` |
52
+ | Styling | App-local CSS, with Tailwind files only when selected |
53
+ | Server logic | Optional BFF entrypoints under `api/` |
54
+ | Tests | Rstest smoke coverage in `tests/` |
55
+ | Agent workflow | Generated `AGENTS.md`, hooks, and local quality gates |
47
56
 
48
- ```bash
49
- npx @modern-js/create apps/shell --router tanstack --tailwind --workspace --sub
50
- npx @modern-js/create apps/remotes/catalog --router tanstack --tailwind --workspace --sub
51
- npx @modern-js/create apps/remotes/design-system --router tanstack --tailwind --workspace --sub
52
- npx @modern-js/create services/catalog-api --bff-runtime effect --workspace --sub
53
- ```
57
+ Keep feature code in the app while one team owns the workflow, release train,
58
+ and operational behavior. Add ordinary workspace packages for shared tokens,
59
+ small UI primitives, generated clients, or domain-neutral utilities when that
60
+ keeps the app easier to understand.
54
61
 
55
- The canonical topology is documented in
56
- `docs/super-app-rfc-adr/WORKSPACE-0001-micro-vertical-workspace-scaffolding.md`.
57
- Shell packages own route assembly and topology selection, remote packages own
58
- route subtrees and degraded UI, service packages own Effect or explicit Hono
59
- contracts, and shared packages are limited to tokens, primitives, generated
60
- clients, or domain-neutral utilities.
62
+ ## Customize The App
61
63
 
62
- If the design system needs independent deployment, keep it as a horizontal
63
- Module Federation remote with the same topology, trust, SSR compatibility, and
64
- fallback rules as the vertical remotes. Do not add a second preset or a
65
- design-system-specific framework mode.
64
+ Start with the generated page and replace the placeholder cards with your first
65
+ real routes, actions, and API calls. Put user-visible text in
66
+ `config/public/locales/<lang>/translation.json`, then render it through
67
+ `react-i18next` or `@modern-js/plugin-i18n/runtime`.
66
68
 
67
- The public opinionated entrypoint is `presetUltramodern(...)`. It is the default
68
- UltraModern.js SuperApp surface for Effect, TanStack, SSR, BFF, and Micro
69
- Verticals.
69
+ Tune the preset in `modern.config.ts`. Production builds require
70
+ `MODERN_PUBLIC_SITE_URL` so canonical and `hreflang` URLs use your deployed
71
+ origin. The local fallback is `http://localhost:8080`.
70
72
 
71
- Preview the production build locally:
73
+ The generated preset defaults are opt-out. Disable specific contracts via env
74
+ vars when your app needs a softer lane:
72
75
 
73
76
  ```bash
74
- pnpm serve
77
+ MODERN_BASELINE_ENABLE_MF_SSR=false
78
+ MODERN_BASELINE_ENABLE_BFF_REQUEST_ID=false
79
+ MODERN_BASELINE_ENABLE_TELEMETRY_EXPORTERS=false
75
80
  ```
76
81
 
82
+ ## Grow When Needed
83
+
84
+ Stay in the single app until a boundary has a real owner and operational reason
85
+ to split. A separate package is usually enough when you only need reusable code.
86
+ Consider a larger workspace boundary later when a feature needs independent
87
+ ownership, rollout, rollback, incident routing, or deployment evidence.
88
+
89
+ The public opinionated entrypoint is `presetUltramodern(...)`. It keeps Effect,
90
+ TanStack, SSR, BFF, i18n, and quality gates available without requiring a
91
+ distributed app layout on day one.
92
+
93
+ ## Generated Automation
94
+
95
+ The generated starter includes `.github/workflows/ultramodern-gates.yml` and
96
+ `.github/renovate.json` for full app projects. The workflow runs
97
+ `pnpm run ultramodern:check` and `pnpm run build` on every push and pull request
98
+ with read-only permissions, commit-pinned actions, frozen installs, and
99
+ StepSecurity audit-mode runner hardening. Renovate is configured for dependency
100
+ dashboard review, one-day release age, grouped updates, action digest pinning,
101
+ and manual approval for major upgrades.
102
+
77
103
  For more information, see the
78
104
  [UltraModern.js guide](https://bleedingdev.github.io/ultramodern.js/guides/get-started/ultramodern.html)
79
105
  and the [UltraModern.js documentation](https://bleedingdev.github.io/ultramodern.js/).
@@ -4,12 +4,18 @@
4
4
  Layer,
5
5
  defineEffectBff,
6
6
  } from '@modern-js/plugin-bff/effect-server';
7
+ import type { HttpApi, HttpApiGroup } from '@modern-js/plugin-bff/effect-server';
7
8
  import { bffEffectApi } from '../../shared/effect/api';
8
9
 
10
+ type ApiGroups<TApi> = TApi extends HttpApi.HttpApi<string, infer TGroups> ? TGroups : never;
11
+ type GreetingsHandlers = HttpApiBuilder.Handlers.FromGroup<
12
+ HttpApiGroup.WithName<ApiGroups<typeof bffEffectApi>, 'greetings'>
13
+ >;
14
+
9
15
  const greetingsLayer = HttpApiBuilder.group(
10
16
  bffEffectApi,
11
17
  'greetings',
12
- handlers =>
18
+ (handlers: GreetingsHandlers) =>
13
19
  handlers.handle('hello', () =>
14
20
  Effect.succeed({
15
21
  message: 'Hello from Effect HttpApi',
@@ -25,5 +31,4 @@ const layer = HttpApiBuilder.layer(bffEffectApi).pipe(
25
31
  export default defineEffectBff({
26
32
  api: bffEffectApi,
27
33
  layer,
28
- });
29
- {{/if}}
34
+ });{{/if}}
@@ -0,0 +1,39 @@
1
+ {
2
+ "home": {
3
+ "bff": {
4
+ "response": "Odpoved Effect HttpApi:"
5
+ },
6
+ "cards": {
7
+ "bff": {
8
+ "body": "Pridej serverovou logiku, kdyz route potrebuje typovana data nebo mutace.",
9
+ "title": "BFF + Effect"
10
+ },
11
+ "config": {
12
+ "body": "Upravuj vychozi hodnoty v modern.config.ts podle rustu aplikace.",
13
+ "title": "Konfigurace presetUltramodern"
14
+ },
15
+ "gates": {
16
+ "body": "Pred releasem spust ultramodern:check, testy, typecheck, lint a build.",
17
+ "title": "Ultramodern kontroly"
18
+ },
19
+ "guide": {
20
+ "body": "Zacni jednou aplikaci a pridej routy, API nebo balicky az kdyz pomuzou.",
21
+ "title": "UltraModern.js pruvodce"
22
+ }
23
+ },
24
+ "description": {
25
+ "afterConfig": "podle rustu aplikace a udrzuj",
26
+ "afterPreset": "profilem. Lad",
27
+ "end": "zelene pri pridavani rout, API a workspace balicku.",
28
+ "intro": "Zacni s verejnym"
29
+ },
30
+ "language": {
31
+ "cs": "Cestina",
32
+ "en": "Anglictina",
33
+ "switcher": "Jazyk"
34
+ },
35
+ "logoAlt": "Logo UltraModern.js",
36
+ "name": "Jednoduchy starter aplikace",
37
+ "title": "UltraModern.js Starter"
38
+ }
39
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "home": {
3
+ "bff": {
4
+ "response": "Effect HttpApi response:"
5
+ },
6
+ "cards": {
7
+ "bff": {
8
+ "body": "Add server logic when a route needs typed data or mutation handling.",
9
+ "title": "BFF + Effect"
10
+ },
11
+ "config": {
12
+ "body": "Tune generated defaults in modern.config.ts as the app grows.",
13
+ "title": "Configure presetUltramodern"
14
+ },
15
+ "gates": {
16
+ "body": "Run ultramodern:check, tests, typecheck, lint, and build before release.",
17
+ "title": "Ultramodern Gates"
18
+ },
19
+ "guide": {
20
+ "body": "Start with one app, then add routes, APIs, and packages when they help.",
21
+ "title": "UltraModern.js Guide"
22
+ }
23
+ },
24
+ "description": {
25
+ "afterConfig": "as the app grows, and keep",
26
+ "afterPreset": "profile. Tune",
27
+ "end": "green while you add routes, APIs, and workspace packages.",
28
+ "intro": "Start from the public"
29
+ },
30
+ "language": {
31
+ "cs": "Czech",
32
+ "en": "English",
33
+ "switcher": "Language"
34
+ },
35
+ "logoAlt": "UltraModern.js Logo",
36
+ "name": "Simple app starter",
37
+ "title": "UltraModern.js Starter"
38
+ }
39
+ }
@@ -0,0 +1,10 @@
1
+ pre-commit:
2
+ commands:
3
+ fix-and-check:
4
+ run: pnpm format && pnpm lint:fix && pnpm ultramodern:check
5
+ stage_fixed: true
6
+
7
+ pre-push:
8
+ commands:
9
+ check:
10
+ run: pnpm ultramodern:check
@@ -2,44 +2,61 @@
2
2
  import { appTools, defineConfig, presetUltramodern } from '@modern-js/app-tools';
3
3
  import path from 'node:path';
4
4
  {{#if enableBff}}import { bffPlugin } from '@modern-js/plugin-bff';
5
- {{/if}}{{#if isTanstackRouter}}import { tanstackRouterPlugin } from '@modern-js/plugin-tanstack';
5
+ {{/if}}import { i18nPlugin } from '@modern-js/plugin-i18n';
6
+ {{#if isTanstackRouter}}import { tanstackRouterPlugin } from '@modern-js/plugin-tanstack';
6
7
  {{/if}}
7
-
8
8
  const appId = process.env['MODERN_BASELINE_APP_ID'] || path.basename(process.cwd());
9
- const enableModuleFederationSSR =
10
- process.env['MODERN_BASELINE_ENABLE_MF_SSR'] !== 'false';
11
- const enableBffRequestId =
12
- process.env['MODERN_BASELINE_ENABLE_BFF_REQUEST_ID'] !== 'false';
9
+ const enableModuleFederationSSR = process.env['MODERN_BASELINE_ENABLE_MF_SSR'] !== 'false';
10
+ const enableBffRequestId = process.env['MODERN_BASELINE_ENABLE_BFF_REQUEST_ID'] !== 'false';
13
11
  const enableTelemetryExporters =
14
12
  process.env['MODERN_BASELINE_ENABLE_TELEMETRY_EXPORTERS'] !== 'false';
15
- const telemetryFailLoudStartup =
16
- process.env['MODERN_TELEMETRY_FAIL_LOUD_STARTUP'] !== 'false';
13
+ const telemetryFailLoudStartup = process.env['MODERN_TELEMETRY_FAIL_LOUD_STARTUP'] !== 'false';
17
14
  const otlpEndpoint = process.env['MODERN_TELEMETRY_OTLP_ENDPOINT'];
18
- const victoriaMetricsEndpoint =
19
- process.env['MODERN_TELEMETRY_VICTORIA_ENDPOINT'];
15
+ const configuredSiteUrl = process.env['MODERN_PUBLIC_SITE_URL'];
16
+ const hasConfiguredSiteUrl = typeof configuredSiteUrl === 'string' && configuredSiteUrl.length > 0;
17
+ const isProductionBuild =
18
+ process.env['NODE_ENV'] === 'production' || process.argv.includes('build');
19
+
20
+ if (isProductionBuild && !hasConfiguredSiteUrl) {
21
+ throw new Error(
22
+ 'MODERN_PUBLIC_SITE_URL must be set for production builds so canonical and hreflang URLs use the deployed origin.',
23
+ );
24
+ }
25
+
26
+ const siteUrl = hasConfiguredSiteUrl ? configuredSiteUrl : 'http://localhost:8080';
27
+ const victoriaMetricsEndpoint = process.env['MODERN_TELEMETRY_VICTORIA_ENDPOINT'];
20
28
 
21
29
  // https://bleedingdev.github.io/ultramodern.js/configure/app/usage.html
22
30
  export default defineConfig(
23
31
  presetUltramodern(
24
32
  {
25
- plugins: [
33
+ {{#if enableBff}} bff: {
34
+ {{#if useEffectBff}} effect: {
35
+ openapi: true,
36
+ },
37
+
38
+ {{/if}} runtimeFramework: '{{bffRuntime}}',
39
+ },
40
+
41
+ {{/if}} plugins: [
26
42
  appTools(),
43
+ i18nPlugin({
44
+ localeDetection: {
45
+ fallbackLanguage: 'en',
46
+ languages: ['en', 'cs'],
47
+ localePathRedirect: true,
48
+ },
49
+ }),
27
50
  {{#if isTanstackRouter}}
28
51
  tanstackRouterPlugin(),
29
52
  {{/if}}{{#if enableBff}}
30
53
  bffPlugin(),
31
- {{/if}}
32
- ],
33
- {{#if enableBff}}
34
- bff: {
35
- runtimeFramework: '{{bffRuntime}}',
36
- {{#if useEffectBff}}
37
- effect: {
38
- openapi: true,
54
+ {{/if}} ],
55
+ source: {
56
+ globalVars: {
57
+ ULTRAMODERN_SITE_URL: siteUrl,
39
58
  },
40
- {{/if}}
41
59
  },
42
- {{/if}}
43
60
  },
44
61
  {
45
62
  appId,
@@ -48,9 +65,7 @@ export default defineConfig(
48
65
  enableTelemetryExporters,
49
66
  telemetryFailLoudStartup,
50
67
  ...(typeof otlpEndpoint === 'string' ? { otlpEndpoint } : {}),
51
- ...(typeof victoriaMetricsEndpoint === 'string'
52
- ? { victoriaMetricsEndpoint }
53
- : {}),
68
+ ...(typeof victoriaMetricsEndpoint === 'string' ? { victoriaMetricsEndpoint } : {}),
54
69
  },
55
70
  ),
56
71
  );
@@ -1,7 +1,15 @@
1
- import { defineConfig } from "oxfmt";
2
- import ultracite from "ultracite/oxfmt";
1
+ import { defineConfig } from 'oxfmt';
2
+ import ultracite from 'ultracite/oxfmt';
3
3
 
4
4
  export default defineConfig({
5
5
  extends: [ultracite],
6
- ignorePatterns: ["dist", "node_modules", ".modern", ".modernjs", "**/routeTree.gen.ts"],
6
+ ignorePatterns: [
7
+ '.agents',
8
+ 'dist',
9
+ 'node_modules',
10
+ '.modern',
11
+ '.modernjs',
12
+ '**/routeTree.gen.ts',
13
+ ],
14
+ singleQuote: true,
7
15
  });
@@ -1,6 +1,6 @@
1
- import { defineConfig } from "oxlint";
2
- import core from "ultracite/oxlint/core";
3
- import react from "ultracite/oxlint/react";
1
+ import { defineConfig } from 'oxlint';
2
+ import core from 'ultracite/oxlint/core';
3
+ import react from 'ultracite/oxlint/react';
4
4
 
5
5
  export default defineConfig({
6
6
  env: {
@@ -8,5 +8,12 @@ export default defineConfig({
8
8
  node: true,
9
9
  },
10
10
  extends: [core, react],
11
- ignorePatterns: ["dist", "node_modules", ".modern", ".modernjs", "**/routeTree.gen.ts"],
11
+ ignorePatterns: [
12
+ '.agents',
13
+ 'dist',
14
+ 'node_modules',
15
+ '.modern',
16
+ '.modernjs',
17
+ '**/routeTree.gen.ts',
18
+ ],
12
19
  });