@bleedingdev/modern-js-create 3.2.0-ultramodern.6 → 3.2.0-ultramodern.60
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 +116 -22
- package/dist/index.js +4563 -603
- package/dist/types/locale/en.d.ts +3 -0
- package/dist/types/locale/zh.d.ts +3 -0
- package/dist/types/ultramodern-workspace.d.ts +11 -0
- package/package.json +6 -6
- package/template/.agents/skills-lock.json +34 -0
- 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 +23 -0
- package/template/README.md +60 -34
- package/template/api/effect/index.ts.handlebars +7 -45
- package/template/config/public/locales/cs/translation.json +39 -0
- package/template/config/public/locales/en/translation.json +39 -0
- package/template/lefthook.yml +15 -0
- package/template/modern.config.ts.handlebars +44 -23
- package/template/oxfmt.config.ts +8 -0
- package/template/oxlint.config.ts +12 -0
- package/template/package.json.handlebars +50 -31
- package/template/pnpm-workspace.yaml +19 -0
- package/template/rstest.config.mts +7 -0
- package/template/scripts/bootstrap-agent-skills.mjs +135 -0
- package/template/scripts/check-i18n-strings.mjs +83 -0
- package/template/scripts/validate-ultramodern.mjs.handlebars +439 -17
- package/template/shared/effect/api.ts.handlebars +1 -2
- package/template/src/modern-app-env.d.ts +2 -0
- package/template/src/modern.runtime.ts.handlebars +17 -3
- package/template/src/routes/[lang]/page.tsx.handlebars +212 -0
- package/template/src/routes/index.css.handlebars +14 -3
- package/template/src/routes/layout.tsx.handlebars +2 -1
- package/template/tests/tsconfig.json +7 -0
- package/template/tests/ultramodern.contract.test.ts.handlebars +78 -0
- package/template/tsconfig.json +106 -2
- package/template-workspace/.agents/agent-reference-repos.json +24 -0
- package/template-workspace/.agents/rstackjs-agent-skills-LICENSE +21 -0
- package/template-workspace/.agents/skills/rsbuild-best-practices/SKILL.md +57 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/SKILL.md +96 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/command-map.md +113 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/common-analysis-patterns.md +190 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/install-rsdoctor-common.md +88 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/install-rsdoctor-rspack.md +138 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/install-rsdoctor-webpack.md +71 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/install-rsdoctor.md +39 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/rsdoctor-data-types.md +103 -0
- package/template-workspace/.agents/skills/rslib-best-practices/SKILL.md +58 -0
- package/template-workspace/.agents/skills/rslib-modern-package/SKILL.md +173 -0
- package/template-workspace/.agents/skills/rspack-best-practices/SKILL.md +70 -0
- package/template-workspace/.agents/skills/rspack-tracing/SKILL.md +75 -0
- package/template-workspace/.agents/skills/rspack-tracing/references/bottlenecks.md +47 -0
- package/template-workspace/.agents/skills/rspack-tracing/references/tracing-guide.md +38 -0
- package/template-workspace/.agents/skills/rspack-tracing/scripts/analyze_trace.js +184 -0
- package/template-workspace/.agents/skills/rstest-best-practices/SKILL.md +133 -0
- package/template-workspace/.agents/skills-lock.json +114 -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 +76 -0
- package/template-workspace/README.md.handlebars +33 -10
- package/template-workspace/lefthook.yml +15 -0
- package/template-workspace/oxfmt.config.ts +16 -0
- package/template-workspace/oxlint.config.ts +19 -0
- package/template-workspace/pnpm-workspace.yaml +20 -10
- package/template-workspace/scripts/bootstrap-agent-skills.mjs +163 -0
- package/template-workspace/scripts/setup-agent-reference-repos.mjs +368 -0
- package/template/biome.json +0 -41
- package/template/src/routes/page.tsx.handlebars +0 -119
- package/template-workspace/scripts/validate-ultramodern-workspace.mjs.handlebars +0 -276
|
@@ -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.
|
|
24
|
+
"version": "3.2.0-ultramodern.60",
|
|
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.
|
|
42
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
43
|
-
"tsx": "^4.22.
|
|
44
|
-
"@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.2.0-ultramodern.
|
|
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.59"
|
|
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.
|
|
57
|
+
"frameworkVersion": "3.2.0-ultramodern.59"
|
|
58
58
|
}
|
|
59
59
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 2,
|
|
3
|
+
"installDir": ".agents/skills",
|
|
4
|
+
"sources": [
|
|
5
|
+
{
|
|
6
|
+
"id": "techsiocz-private",
|
|
7
|
+
"visibility": "private",
|
|
8
|
+
"repository": "https://github.com/TechsioCZ/skills",
|
|
9
|
+
"install": "clone-if-authorized",
|
|
10
|
+
"baseline": [
|
|
11
|
+
{
|
|
12
|
+
"name": "plan-graph",
|
|
13
|
+
"reason": "Build and validate DAGs from .plan.md files"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "dag",
|
|
17
|
+
"reason": "Inspect current plan frontiers and blocked lanes"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "subagent-graph",
|
|
21
|
+
"reason": "Design dependency-aware multi-agent launch graphs"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "helm",
|
|
25
|
+
"reason": "Steer already-running multi-agent work"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "debugger-mode",
|
|
29
|
+
"reason": "Run hypothesis-driven debugging with runtime evidence"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
@@ -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:
|
|
12
|
-
uses:
|
|
26
|
+
- name: Harden Runner
|
|
27
|
+
uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5 # v2
|
|
28
|
+
with:
|
|
29
|
+
egress-policy: audit
|
|
13
30
|
|
|
14
|
-
- name:
|
|
15
|
-
uses:
|
|
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@
|
|
38
|
+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
19
39
|
with:
|
|
20
|
-
node-version:
|
|
21
|
-
|
|
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
|
-
|
|
52
|
+
env:
|
|
53
|
+
MODERN_PUBLIC_SITE_URL: http://localhost:8080
|
|
54
|
+
run: mise exec -- pnpm run build
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# UltraModern Agent Contract
|
|
2
|
+
|
|
3
|
+
This project is generated for Codex-first UltraModern.js work.
|
|
4
|
+
|
|
5
|
+
## Quality Gates
|
|
6
|
+
|
|
7
|
+
- `pnpm lint` runs Oxlint with the Ultracite preset.
|
|
8
|
+
- `pnpm format` runs oxfmt.
|
|
9
|
+
- `pnpm typecheck` runs effect-tsgo as the TypeScript checker.
|
|
10
|
+
- `pnpm i18n:check` rejects hardcoded user-visible JSX text.
|
|
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` installs `lefthook` when the app is inside a Git worktree. Generated `lefthook.yml` runs `pnpm format`, `pnpm lint:fix`, and `pnpm ultramodern:check` on pre-commit; pre-push runs `pnpm ultramodern:check`.
|
|
14
|
+
|
|
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.
|
|
18
|
+
|
|
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.
|
|
20
|
+
|
|
21
|
+
## Private Skills
|
|
22
|
+
|
|
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.
|
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,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
|
-
|
|
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
|
+
| 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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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/).
|
|
@@ -2,60 +2,22 @@
|
|
|
2
2
|
Effect,
|
|
3
3
|
HttpApiBuilder,
|
|
4
4
|
Layer,
|
|
5
|
-
Schema,
|
|
6
|
-
ServiceMap,
|
|
7
5
|
defineEffectBff,
|
|
8
6
|
} from '@modern-js/plugin-bff/effect-server';
|
|
9
7
|
import { bffEffectApi } from '../../shared/effect/api';
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
'GreetingUnavailableError',
|
|
13
|
-
{
|
|
14
|
-
message: Schema.String,
|
|
15
|
-
},
|
|
16
|
-
) {}
|
|
17
|
-
|
|
18
|
-
class GreetingService extends ServiceMap.Service<GreetingService>()('GreetingService', {
|
|
19
|
-
make: Effect.succeed({
|
|
20
|
-
hello: Effect.fn('GreetingService.hello')(function* () {
|
|
21
|
-
if (Date.now() < 0) {
|
|
22
|
-
return yield* Effect.fail(
|
|
23
|
-
new GreetingUnavailableError({
|
|
24
|
-
message: 'Greeting service is unavailable',
|
|
25
|
-
}),
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return {
|
|
30
|
-
message: 'Hello from Effect HttpApi',
|
|
31
|
-
runtime: 'effect' as const,
|
|
32
|
-
};
|
|
33
|
-
}),
|
|
34
|
-
}),
|
|
35
|
-
}) {
|
|
36
|
-
static readonly layer = Layer.effect(this, this.make);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const greetingsLayer = HttpApiBuilder.group(bffEffectApi, 'greetings', handlers =>
|
|
9
|
+
const greetingsLayer = HttpApiBuilder.group(bffEffectApi, 'greetings', (handlers) =>
|
|
40
10
|
handlers.handle('hello', () =>
|
|
41
|
-
|
|
42
|
-
Effect
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
runtime: 'effect' as const,
|
|
46
|
-
}),
|
|
47
|
-
),
|
|
48
|
-
),
|
|
11
|
+
Effect.succeed({
|
|
12
|
+
message: 'Hello from Effect HttpApi',
|
|
13
|
+
runtime: 'effect' as const,
|
|
14
|
+
}),
|
|
49
15
|
),
|
|
50
16
|
);
|
|
51
17
|
|
|
52
|
-
const layer = HttpApiBuilder.layer(bffEffectApi).pipe(
|
|
53
|
-
Layer.provide(greetingsLayer),
|
|
54
|
-
Layer.provide(GreetingService.layer),
|
|
55
|
-
);
|
|
18
|
+
const layer = HttpApiBuilder.layer(bffEffectApi).pipe(Layer.provide(greetingsLayer));
|
|
56
19
|
|
|
57
20
|
export default defineEffectBff({
|
|
58
21
|
api: bffEffectApi,
|
|
59
22
|
layer,
|
|
60
|
-
});
|
|
61
|
-
{{/if}}
|
|
23
|
+
});{{/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
|
+
}
|