@bleedingdev/modern-js-create 3.2.0-ultramodern.11 → 3.2.0-ultramodern.110
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 +158 -35
- package/bin/run.js +0 -0
- package/dist/cjs/index.cjs +1040 -0
- package/dist/cjs/locale/en.cjs +97 -0
- package/dist/cjs/locale/index.cjs +50 -0
- package/dist/cjs/locale/zh.cjs +97 -0
- package/dist/cjs/ultramodern-checks/cli/i18n-check.cjs +73 -0
- package/dist/cjs/ultramodern-checks/cli/oxlint.cjs +174 -0
- package/dist/cjs/ultramodern-checks/cli/workspace-source-check.cjs +179 -0
- package/dist/cjs/ultramodern-checks/index.cjs +58 -0
- package/dist/cjs/ultramodern-checks/oxlint-plugin.cjs +354 -0
- package/dist/cjs/ultramodern-package-source.cjs +133 -0
- package/dist/cjs/ultramodern-workspace.cjs +5616 -0
- package/dist/esm/index.js +1002 -0
- package/dist/esm/locale/en.js +59 -0
- package/dist/esm/locale/index.js +9 -0
- package/dist/esm/locale/zh.js +59 -0
- package/dist/esm/ultramodern-checks/cli/i18n-check.js +26 -0
- package/dist/esm/ultramodern-checks/cli/oxlint.js +118 -0
- package/dist/esm/ultramodern-checks/cli/workspace-source-check.js +124 -0
- package/dist/esm/ultramodern-checks/index.js +3 -0
- package/dist/esm/ultramodern-checks/oxlint-plugin.js +316 -0
- package/dist/esm/ultramodern-package-source.js +61 -0
- package/dist/esm/ultramodern-workspace.js +5554 -0
- package/dist/esm-node/index.js +1003 -0
- package/dist/esm-node/locale/en.js +60 -0
- package/dist/esm-node/locale/index.js +10 -0
- package/dist/esm-node/locale/zh.js +60 -0
- package/dist/esm-node/ultramodern-checks/cli/i18n-check.js +27 -0
- package/dist/esm-node/ultramodern-checks/cli/oxlint.js +119 -0
- package/dist/esm-node/ultramodern-checks/cli/workspace-source-check.js +125 -0
- package/dist/esm-node/ultramodern-checks/index.js +4 -0
- package/dist/esm-node/ultramodern-checks/oxlint-plugin.js +317 -0
- package/dist/esm-node/ultramodern-package-source.js +62 -0
- package/dist/esm-node/ultramodern-workspace.js +5555 -0
- package/dist/types/locale/en.d.ts +3 -0
- package/dist/types/locale/index.d.ts +117 -2
- package/dist/types/locale/zh.d.ts +3 -0
- package/dist/types/ultramodern-checks/cli/i18n-check.d.ts +9 -0
- package/dist/types/ultramodern-checks/cli/oxlint.d.ts +22 -0
- package/dist/types/ultramodern-checks/cli/workspace-source-check.d.ts +8 -0
- package/dist/types/ultramodern-checks/index.d.ts +3 -0
- package/dist/types/ultramodern-checks/oxlint-plugin.d.ts +63 -0
- package/dist/types/ultramodern-package-source.d.ts +28 -0
- package/dist/types/ultramodern-workspace.d.ts +12 -2
- package/package.json +52 -11
- package/template/.codex/hooks.json +16 -0
- package/template/.github/renovate.json +53 -0
- package/template/.github/workflows/ultramodern-gates.yml.handlebars +34 -10
- package/template/.mise.toml.handlebars +2 -0
- package/template/AGENTS.md +9 -6
- package/template/README.md +66 -34
- package/template/api/effect/index.ts.handlebars +20 -9
- package/template/api/lambda/hello.ts.handlebars +5 -5
- package/template/config/favicon.svg +5 -0
- package/template/config/public/assets/ultramodern-logo.svg +6 -0
- package/template/config/public/locales/cs/translation.json +44 -0
- package/template/config/public/locales/en/translation.json +44 -0
- package/template/lefthook.yml +10 -0
- package/template/modern.config.ts.handlebars +35 -3
- package/template/oxfmt.config.ts +8 -1
- package/template/oxlint.config.ts +8 -1
- package/template/package.json.handlebars +36 -30
- package/template/pnpm-workspace.yaml +34 -0
- package/template/rstest.config.mts +5 -0
- package/template/scripts/bootstrap-agent-skills.mjs +148 -15
- package/template/scripts/check-i18n-strings.mjs +3 -0
- package/template/scripts/validate-ultramodern.mjs.handlebars +494 -3
- package/template/src/modern-app-env.d.ts +2 -0
- package/template/src/modern.runtime.ts.handlebars +17 -1
- package/template/src/routes/[lang]/page.tsx.handlebars +209 -0
- package/template/src/routes/index.css.handlebars +192 -55
- package/template/src/routes/layout.tsx.handlebars +2 -1
- package/template/tailwind.config.ts.handlebars +1 -1
- package/template/tests/tsconfig.json +7 -0
- package/template/tests/ultramodern.contract.test.ts.handlebars +160 -0
- package/template/tsconfig.json +2 -1
- package/template-workspace/.agents/agent-reference-repos.json +24 -0
- package/template-workspace/.agents/skills-lock.json +19 -0
- package/template-workspace/.codex/hooks.json +16 -0
- package/template-workspace/.github/renovate.json +29 -0
- package/template-workspace/.github/workflows/ultramodern-workspace-gates.yml.handlebars +54 -0
- package/template-workspace/.gitignore.handlebars +5 -0
- package/template-workspace/.mise.toml.handlebars +2 -0
- package/template-workspace/AGENTS.md +36 -5
- package/template-workspace/README.md.handlebars +70 -11
- package/template-workspace/lefthook.yml +10 -0
- package/template-workspace/oxfmt.config.ts +1 -0
- package/template-workspace/oxlint.config.ts +1 -0
- package/template-workspace/pnpm-workspace.yaml +31 -8
- package/template-workspace/scripts/bootstrap-agent-skills.mjs +190 -21
- package/template-workspace/scripts/setup-agent-reference-repos.mjs +370 -0
- package/dist/index.js +0 -2474
- package/template/src/routes/page.tsx.handlebars +0 -136
- package/template-workspace/scripts/validate-ultramodern-workspace.mjs.handlebars +0 -405
package/template/README.md
CHANGED
|
@@ -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,87 @@ 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
|
-
|
|
31
|
+
Preview the production build locally:
|
|
26
32
|
|
|
27
33
|
```bash
|
|
28
|
-
pnpm
|
|
34
|
+
pnpm serve
|
|
29
35
|
```
|
|
30
36
|
|
|
31
|
-
|
|
37
|
+
Run the local gates before treating the scaffold as ready:
|
|
32
38
|
|
|
33
39
|
```bash
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
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
|
-
|
|
46
|
+
The default app is intentionally monolith-friendly:
|
|
44
47
|
|
|
45
|
-
|
|
46
|
-
|
|
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
|
+
| Web defaults | Local favicon/logo assets, localized metadata, semantic starter markup |
|
|
53
|
+
| Styling | App-local CSS, with Tailwind files only when selected |
|
|
54
|
+
| Server logic | Optional BFF entrypoints under `api/` |
|
|
55
|
+
| Tests | Rstest smoke coverage in `tests/` |
|
|
56
|
+
| Agent workflow | Generated `AGENTS.md`, hooks, and local quality gates |
|
|
47
57
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
npx @modern-js/create services/catalog-api --bff-runtime effect --workspace --sub
|
|
53
|
-
```
|
|
58
|
+
Keep feature code in the app while one team owns the workflow, release train,
|
|
59
|
+
and operational behavior. Add ordinary workspace packages for shared tokens,
|
|
60
|
+
small UI primitives, generated clients, or domain-neutral utilities when that
|
|
61
|
+
keeps the app easier to understand.
|
|
54
62
|
|
|
55
|
-
|
|
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.
|
|
63
|
+
## Customize The App
|
|
61
64
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
Start with the generated page and replace the placeholder cards with your first
|
|
66
|
+
real routes, actions, and API calls. Put user-visible text in
|
|
67
|
+
`config/public/locales/<lang>/translation.json`, then render it through
|
|
68
|
+
`react-i18next` or `@modern-js/plugin-i18n/runtime`.
|
|
66
69
|
|
|
67
|
-
The
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
The starter keeps favicon and logo assets local in `config/favicon.svg` and
|
|
71
|
+
`config/public/assets/ultramodern-logo.svg`. Replace those files when your app
|
|
72
|
+
has product branding. The localized page title and description live in the same
|
|
73
|
+
translation resources as the visible UI copy.
|
|
70
74
|
|
|
71
|
-
|
|
75
|
+
Tune the preset in `modern.config.ts`. Production builds require
|
|
76
|
+
`MODERN_PUBLIC_SITE_URL` so canonical and `hreflang` URLs use your deployed
|
|
77
|
+
origin. The local fallback is `http://localhost:8080`.
|
|
78
|
+
|
|
79
|
+
The generated preset defaults are opt-out. Disable specific contracts via env
|
|
80
|
+
vars when your app needs a softer lane:
|
|
72
81
|
|
|
73
82
|
```bash
|
|
74
|
-
|
|
83
|
+
MODERN_BASELINE_ENABLE_MF_SSR=false
|
|
84
|
+
MODERN_BASELINE_ENABLE_BFF_REQUEST_ID=false
|
|
85
|
+
MODERN_BASELINE_ENABLE_TELEMETRY_EXPORTERS=false
|
|
75
86
|
```
|
|
76
87
|
|
|
88
|
+
## Grow When Needed
|
|
89
|
+
|
|
90
|
+
Stay in the single app until a boundary has a real owner and operational reason
|
|
91
|
+
to split. A separate package is usually enough when you only need reusable code.
|
|
92
|
+
Consider a larger workspace boundary later when a feature needs independent
|
|
93
|
+
ownership, rollout, rollback, incident routing, or deployment evidence.
|
|
94
|
+
|
|
95
|
+
The public opinionated entrypoint is `presetUltramodern(...)`. It keeps Effect,
|
|
96
|
+
TanStack, SSR, BFF, i18n, and quality gates available without requiring a
|
|
97
|
+
distributed app layout on day one.
|
|
98
|
+
|
|
99
|
+
## Generated Automation
|
|
100
|
+
|
|
101
|
+
The generated starter includes `.github/workflows/ultramodern-gates.yml` and
|
|
102
|
+
`.github/renovate.json` for full app projects. The workflow runs
|
|
103
|
+
`pnpm run ultramodern:check` and `pnpm run build` on every push and pull request
|
|
104
|
+
with read-only permissions, commit-pinned actions, frozen installs, and
|
|
105
|
+
StepSecurity audit-mode runner hardening. Renovate is configured for dependency
|
|
106
|
+
dashboard review, one-day release age, grouped updates, action digest pinning,
|
|
107
|
+
and manual approval for major upgrades.
|
|
108
|
+
|
|
77
109
|
For more information, see the
|
|
78
110
|
[UltraModern.js guide](https://bleedingdev.github.io/ultramodern.js/guides/get-started/ultramodern.html)
|
|
79
111
|
and the [UltraModern.js documentation](https://bleedingdev.github.io/ultramodern.js/).
|
|
@@ -4,18 +4,29 @@
|
|
|
4
4
|
Layer,
|
|
5
5
|
defineEffectBff,
|
|
6
6
|
} from '@modern-js/plugin-bff/effect-server';
|
|
7
|
-
import {
|
|
7
|
+
import type { HttpApi, HttpApiGroup } from '@modern-js/plugin-bff/effect-server';
|
|
8
|
+
import { bffEffectApi } from '../../shared/effect/api.ts';
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
+
|
|
15
|
+
const greetingsLayer = HttpApiBuilder.group(
|
|
16
|
+
bffEffectApi,
|
|
17
|
+
'greetings',
|
|
18
|
+
(handlers: GreetingsHandlers) =>
|
|
19
|
+
handlers.handle('hello', () =>
|
|
20
|
+
Effect.succeed({
|
|
21
|
+
message: 'Hello from Effect HttpApi',
|
|
22
|
+
runtime: 'effect' as const,
|
|
23
|
+
}),
|
|
24
|
+
),
|
|
16
25
|
);
|
|
17
26
|
|
|
18
|
-
const layer = HttpApiBuilder.layer(bffEffectApi).pipe(
|
|
27
|
+
const layer = HttpApiBuilder.layer(bffEffectApi).pipe(
|
|
28
|
+
Layer.provide(greetingsLayer),
|
|
29
|
+
);
|
|
19
30
|
|
|
20
31
|
export default defineEffectBff({
|
|
21
32
|
api: bffEffectApi,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{{#if useHonoBff}}
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
{{#if useHonoBff}}const hello = () => ({
|
|
2
|
+
message: 'Hello from UltraModern.js BFF ({{bffRuntime}})',
|
|
3
|
+
});
|
|
4
|
+
|
|
5
|
+
export default hello;
|
|
6
6
|
{{/if}}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="UltraModern.js">
|
|
2
|
+
<rect width="64" height="64" rx="12" fill="#111827"/>
|
|
3
|
+
<path fill="#35d399" d="M14 17h9v21c0 5 3 8 9 8s9-3 9-8V17h9v22c0 11-8 18-18 18s-18-7-18-18V17Z"/>
|
|
4
|
+
<path fill="#ffffff" d="M28 17h8v25h-8z"/>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 160 160" role="img" aria-label="UltraModern.js logo">
|
|
2
|
+
<rect width="160" height="160" rx="28" fill="#111827"/>
|
|
3
|
+
<path fill="#35d399" d="M42 36h22v56c0 22 14 34 36 34s36-12 36-34V36h22v57c0 35-24 57-58 57S42 128 42 93V36Z"/>
|
|
4
|
+
<path fill="#ffffff" d="M76 36h20v74H76z"/>
|
|
5
|
+
<path fill="#8be8ff" d="M112 36h18v74h-18z"/>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
"meta": {
|
|
37
|
+
"description": "Lokalizovany starter aplikace UltraModern.js se silnymi vychozimi hodnotami pro komplexni produkty.",
|
|
38
|
+
"title": "UltraModern.js Starter"
|
|
39
|
+
},
|
|
40
|
+
"name": "Jednoduchy starter aplikace",
|
|
41
|
+
"skipLink": "Preskocit na obsah",
|
|
42
|
+
"title": "UltraModern.js Starter"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
"meta": {
|
|
37
|
+
"description": "A localized UltraModern.js app starter with strong defaults for complex products.",
|
|
38
|
+
"title": "UltraModern.js Starter"
|
|
39
|
+
},
|
|
40
|
+
"name": "Simple app starter",
|
|
41
|
+
"skipLink": "Skip to content",
|
|
42
|
+
"title": "UltraModern.js Starter"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -2,7 +2,8 @@
|
|
|
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}}
|
|
5
|
+
{{/if}}import { i18nPlugin } from '@modern-js/plugin-i18n';
|
|
6
|
+
{{#if isTanstackRouter}}import { tanstackRouterPlugin } from '@modern-js/plugin-tanstack';
|
|
6
7
|
{{/if}}
|
|
7
8
|
const appId = process.env['MODERN_BASELINE_APP_ID'] || path.basename(process.cwd());
|
|
8
9
|
const enableModuleFederationSSR = process.env['MODERN_BASELINE_ENABLE_MF_SSR'] !== 'false';
|
|
@@ -11,6 +12,18 @@ const enableTelemetryExporters =
|
|
|
11
12
|
process.env['MODERN_BASELINE_ENABLE_TELEMETRY_EXPORTERS'] !== 'false';
|
|
12
13
|
const telemetryFailLoudStartup = process.env['MODERN_TELEMETRY_FAIL_LOUD_STARTUP'] !== 'false';
|
|
13
14
|
const otlpEndpoint = process.env['MODERN_TELEMETRY_OTLP_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';
|
|
14
27
|
const victoriaMetricsEndpoint = process.env['MODERN_TELEMETRY_VICTORIA_ENDPOINT'];
|
|
15
28
|
|
|
16
29
|
// https://bleedingdev.github.io/ultramodern.js/configure/app/usage.html
|
|
@@ -19,27 +32,46 @@ export default defineConfig(
|
|
|
19
32
|
{
|
|
20
33
|
{{#if enableBff}} bff: {
|
|
21
34
|
{{#if useEffectBff}} effect: {
|
|
35
|
+
entry: './api/effect/index',
|
|
22
36
|
openapi: true,
|
|
23
37
|
},
|
|
24
38
|
|
|
25
39
|
{{/if}} runtimeFramework: '{{bffRuntime}}',
|
|
26
40
|
},
|
|
27
41
|
|
|
28
|
-
{{/if}}
|
|
42
|
+
{{/if}} html: {
|
|
43
|
+
meta: {
|
|
44
|
+
viewport: 'width=device-width, initial-scale=1.0, viewport-fit=cover',
|
|
45
|
+
},
|
|
46
|
+
title: 'UltraModern.js Starter',
|
|
47
|
+
},
|
|
48
|
+
plugins: [
|
|
29
49
|
appTools(),
|
|
50
|
+
i18nPlugin({
|
|
51
|
+
localeDetection: {
|
|
52
|
+
fallbackLanguage: 'en',
|
|
53
|
+
languages: ['en', 'cs'],
|
|
54
|
+
localePathRedirect: true,
|
|
55
|
+
},
|
|
56
|
+
}),
|
|
30
57
|
{{#if isTanstackRouter}}
|
|
31
58
|
tanstackRouterPlugin(),
|
|
32
59
|
{{/if}}{{#if enableBff}}
|
|
33
60
|
bffPlugin(),
|
|
34
61
|
{{/if}} ],
|
|
62
|
+
source: {
|
|
63
|
+
globalVars: {
|
|
64
|
+
ULTRAMODERN_SITE_URL: siteUrl,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
35
67
|
},
|
|
36
68
|
{
|
|
37
69
|
appId,
|
|
38
70
|
enableBffRequestId,
|
|
39
71
|
enableModuleFederationSSR,
|
|
40
72
|
enableTelemetryExporters,
|
|
41
|
-
telemetryFailLoudStartup,
|
|
42
73
|
...(typeof otlpEndpoint === 'string' ? { otlpEndpoint } : {}),
|
|
74
|
+
telemetryFailLoudStartup,
|
|
43
75
|
...(typeof victoriaMetricsEndpoint === 'string' ? { victoriaMetricsEndpoint } : {}),
|
|
44
76
|
},
|
|
45
77
|
),
|
package/template/oxfmt.config.ts
CHANGED
|
@@ -3,6 +3,13 @@ import ultracite from 'ultracite/oxfmt';
|
|
|
3
3
|
|
|
4
4
|
export default defineConfig({
|
|
5
5
|
extends: [ultracite],
|
|
6
|
-
ignorePatterns: [
|
|
6
|
+
ignorePatterns: [
|
|
7
|
+
'.agents',
|
|
8
|
+
'dist',
|
|
9
|
+
'node_modules',
|
|
10
|
+
'.modern',
|
|
11
|
+
'.modernjs',
|
|
12
|
+
'**/routeTree.gen.ts',
|
|
13
|
+
],
|
|
7
14
|
singleQuote: true,
|
|
8
15
|
});
|
|
@@ -8,5 +8,12 @@ export default defineConfig({
|
|
|
8
8
|
node: true,
|
|
9
9
|
},
|
|
10
10
|
extends: [core, react],
|
|
11
|
-
ignorePatterns: [
|
|
11
|
+
ignorePatterns: [
|
|
12
|
+
'.agents',
|
|
13
|
+
'dist',
|
|
14
|
+
'node_modules',
|
|
15
|
+
'.modern',
|
|
16
|
+
'.modernjs',
|
|
17
|
+
'**/routeTree.gen.ts',
|
|
18
|
+
],
|
|
12
19
|
});
|
|
@@ -1,62 +1,68 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "{{packageName}}",
|
|
3
3
|
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
4
5
|
"type": "module",
|
|
6
|
+
"packageManager": "pnpm@{{pnpmVersion}}",
|
|
5
7
|
"scripts": {
|
|
6
8
|
"reset": "npx rimraf node_modules ./**/node_modules",
|
|
7
9
|
"dev": "modern dev",
|
|
8
10
|
"build": "modern build",
|
|
9
11
|
"serve": "modern serve",
|
|
12
|
+
"test": "rstest run",
|
|
10
13
|
"typecheck": "node -e \"const fs = require('node:fs'); const { execFileSync, spawnSync } = require('node:child_process'); const bin = execFileSync('effect-tsgo', ['get-exe-path'], { encoding: 'utf8' }).trim(); if (process.platform !== 'win32') fs.chmodSync(bin, 0o755); const result = spawnSync(bin, ['--noEmit', '-p', 'tsconfig.json'], { stdio: 'inherit' }); process.exit(result.status ?? 1);\"",
|
|
14
|
+
"i18n:check": "node ./scripts/check-i18n-strings.mjs",
|
|
15
|
+
{{#unless isSubproject}}
|
|
11
16
|
"skills:install": "node ./scripts/bootstrap-agent-skills.mjs",
|
|
12
17
|
"skills:check": "node ./scripts/bootstrap-agent-skills.mjs --check",
|
|
13
|
-
"
|
|
18
|
+
"postinstall": "oxfmt . && node ./scripts/bootstrap-agent-skills.mjs",
|
|
19
|
+
{{/unless}}
|
|
20
|
+
"ultramodern:check": "pnpm format:check && pnpm lint && pnpm typecheck && pnpm i18n:check && pnpm test{{#unless isSubproject}} && pnpm skills:check{{/unless}} && node ./scripts/validate-ultramodern.mjs",
|
|
14
21
|
"format": "oxfmt .",
|
|
15
22
|
"format:check": "oxfmt --check .",
|
|
16
23
|
"lint": "oxlint .",
|
|
17
|
-
"lint:fix": "oxlint . --fix"
|
|
18
|
-
"prepare": "simple-git-hooks"{{/unless}}
|
|
24
|
+
"lint:fix": "oxlint . --fix"
|
|
19
25
|
},
|
|
20
26
|
"dependencies": {
|
|
27
|
+
"@modern-js/plugin-i18n": "{{pluginI18nVersion}}",
|
|
21
28
|
{{#if isTanstackRouter}} "@modern-js/plugin-tanstack": "{{pluginTanstackVersion}}",
|
|
22
|
-
{{/if}} "@modern-js/runtime": "{{runtimeVersion}}",
|
|
23
|
-
{{#if isTanstackRouter}} "@tanstack/react-router": "1.170.1",
|
|
24
29
|
{{/if}}
|
|
25
|
-
"
|
|
26
|
-
"react-
|
|
30
|
+
"@modern-js/runtime": "{{runtimeVersion}}",
|
|
31
|
+
{{#if isTanstackRouter}} "@tanstack/react-router": "{{tanstackRouterVersion}}",
|
|
32
|
+
{{/if}}
|
|
33
|
+
"i18next": "{{i18nextVersion}}",
|
|
34
|
+
"react": "{{reactVersion}}",
|
|
35
|
+
"react-dom": "{{reactDomVersion}}",
|
|
36
|
+
"react-i18next": "{{reactI18nextVersion}}"
|
|
27
37
|
},
|
|
28
38
|
"devDependencies": {
|
|
29
|
-
"@effect/tsgo": "
|
|
39
|
+
"@effect/tsgo": "{{effectTsgoVersion}}",
|
|
40
|
+
"@modern-js/adapter-rstest": "{{adapterRstestVersion}}",
|
|
30
41
|
"@modern-js/app-tools": "{{appToolsVersion}}",
|
|
42
|
+
"@modern-js/create": "{{createVersion}}",
|
|
31
43
|
{{#if enableBff}} "@modern-js/plugin-bff": "{{pluginBffVersion}}",
|
|
32
44
|
{{/if}} "@modern-js/tsconfig": "{{tsconfigVersion}}",
|
|
45
|
+
"@rstest/core": "{{rstestCoreVersion}}",
|
|
33
46
|
{{#if enableTailwind}}
|
|
34
|
-
"@tailwindcss/postcss": "^
|
|
47
|
+
"@tailwindcss/postcss": "^{{tailwindPostcssVersion}}",
|
|
35
48
|
{{/if}}
|
|
36
49
|
"@types/node": "^20",
|
|
37
|
-
"@types/react": "
|
|
38
|
-
"@types/react-dom": "
|
|
39
|
-
"@typescript/native-preview": "
|
|
50
|
+
"@types/react": "{{typesReactVersion}}",
|
|
51
|
+
"@types/react-dom": "{{typesReactDomVersion}}",
|
|
52
|
+
"@typescript/native-preview": "{{typescriptNativePreviewVersion}}",
|
|
53
|
+
"happy-dom": "{{happyDomVersion}}",
|
|
40
54
|
{{#unless isSubproject}}
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
{{
|
|
46
|
-
"
|
|
47
|
-
"tailwindcss": "^
|
|
48
|
-
"ultracite": "
|
|
49
|
-
}{{#unless isSubproject}},
|
|
50
|
-
"simple-git-hooks": {
|
|
51
|
-
"pre-commit": "npx lint-staged"
|
|
55
|
+
"lefthook": "^2.1.9",
|
|
56
|
+
{{/unless}}
|
|
57
|
+
"oxfmt": "{{oxfmtVersion}}",
|
|
58
|
+
"oxlint": "{{oxlintVersion}}",
|
|
59
|
+
{{#if enableTailwind}} "postcss": "{{postcssVersion}}",
|
|
60
|
+
{{/if}} "rimraf": "^6.1.3"{{#if enableTailwind}},
|
|
61
|
+
"tailwindcss": "^{{tailwindVersion}}"{{/if}},
|
|
62
|
+
"ultracite": "{{ultraciteVersion}}"
|
|
52
63
|
},
|
|
53
|
-
"lint-staged": {
|
|
54
|
-
"*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}": [
|
|
55
|
-
"oxfmt --write",
|
|
56
|
-
"oxlint --fix"
|
|
57
|
-
]
|
|
58
|
-
}{{/unless}},
|
|
59
64
|
"engines": {
|
|
60
|
-
"node": ">=20"
|
|
65
|
+
"node": ">=20",
|
|
66
|
+
"pnpm": ">={{pnpmVersion}} <11.6.0"
|
|
61
67
|
}
|
|
62
68
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
minimumReleaseAge: 1440
|
|
2
|
+
minimumReleaseAgeStrict: true
|
|
3
|
+
minimumReleaseAgeIgnoreMissingTime: false
|
|
4
|
+
minimumReleaseAgeExclude:
|
|
5
|
+
- '@bleedingdev/modern-js-*'
|
|
6
|
+
- '@tanstack/react-router'
|
|
7
|
+
- '@tanstack/router-core'
|
|
8
|
+
- '@typescript/native-preview'
|
|
9
|
+
- '@typescript/native-preview-*'
|
|
10
|
+
- '@types/react'
|
|
11
|
+
trustPolicy: no-downgrade
|
|
12
|
+
trustPolicyIgnoreAfter: 1440
|
|
13
|
+
blockExoticSubdeps: true
|
|
14
|
+
engineStrict: true
|
|
15
|
+
pmOnFail: error
|
|
16
|
+
verifyDepsBeforeRun: error
|
|
17
|
+
strictDepBuilds: true
|
|
18
|
+
|
|
19
|
+
allowBuilds:
|
|
20
|
+
'@swc/core': true
|
|
21
|
+
core-js: true
|
|
22
|
+
esbuild: true
|
|
23
|
+
lefthook: true
|
|
24
|
+
msgpackr-extract: true
|
|
25
|
+
sharp: true
|
|
26
|
+
workerd: true
|
|
27
|
+
onlyBuiltDependencies:
|
|
28
|
+
- '@swc/core'
|
|
29
|
+
- core-js
|
|
30
|
+
- esbuild
|
|
31
|
+
- lefthook
|
|
32
|
+
- msgpackr-extract
|
|
33
|
+
- sharp
|
|
34
|
+
- workerd
|