@bleedingdev/modern-js-sandpack-react 3.2.0-ultramodern.51 → 3.2.0-ultramodern.52
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.
|
@@ -30,8 +30,8 @@ const external_common_js_namespaceObject = require("./common.js");
|
|
|
30
30
|
const MWAFiles = {
|
|
31
31
|
...external_common_js_namespaceObject.commonFiles,
|
|
32
32
|
".browserslistrc": "chrome >= 87\nedge >= 88\nfirefox >= 78\nsafari >= 14\n",
|
|
33
|
-
".gitignore": ".DS_Store\n\n.pnp\n.pnp.js\n.env.local\n.env.*.local\n.history\n*.log*\n\nnode_modules/\n.yarn-integrity\n.pnpm-store/\n*.tsbuildinfo\n.changeset/pre.json\n\ndist/\ncoverage/\nrelease/\noutput/\noutput_resource/\nlog/\n\n.vscode/**/*\n!.vscode/settings.json\n!.vscode/extensions.json\n.idea/\n\n**/*/typings/auto-generated\n\nmodern.config.local.*\n",
|
|
34
33
|
".mise.toml": "[tools]\npnpm = \"\"\n",
|
|
34
|
+
".gitignore": ".DS_Store\n\n.pnp\n.pnp.js\n.env.local\n.env.*.local\n.history\n*.log*\n\nnode_modules/\n.yarn-integrity\n.pnpm-store/\n*.tsbuildinfo\n.changeset/pre.json\n\ndist/\ncoverage/\nrelease/\noutput/\noutput_resource/\nlog/\n\n.vscode/**/*\n!.vscode/settings.json\n!.vscode/extensions.json\n.idea/\n\n**/*/typings/auto-generated\n\nmodern.config.local.*\n",
|
|
35
35
|
".npmrc": "strict-peer-dependencies=false\n",
|
|
36
36
|
"AGENTS.md": "# UltraModern Agent Contract\n\nThis project is generated for Codex-first UltraModern.js work.\n\n## Quality Gates\n\n- `pnpm lint` runs Oxlint with the Ultracite preset.\n- `pnpm format` runs oxfmt.\n- `pnpm typecheck` runs effect-tsgo as the TypeScript checker.\n- `pnpm i18n:check` rejects hardcoded user-visible JSX text.\n- `mise exec -- pnpm ultramodern:check` verifies the generated contract.\n\n## Internationalization\n\nRuntime 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.\n\nRoutes 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.\n\n## Private Skills\n\nPrivate orchestration skills are not vendored into this template. If you are authorized for `TechsioCZ/skills`, run:\n\n```bash\npnpm skills:install\n```\n\nThe installer clones that private repository and copies only the allowlisted skills from `.agents/skills-lock.json`.\n",
|
|
37
37
|
"modern.config.ts": "// @effect-diagnostics nodeBuiltinImport:off processEnv:off\nimport { appTools, defineConfig, presetUltramodern } from '@modern-js/app-tools';\nimport path from 'node:path';\nimport { i18nPlugin } from '@modern-js/plugin-i18n';\nconst appId = process.env['MODERN_BASELINE_APP_ID'] || path.basename(process.cwd());\nconst enableModuleFederationSSR = process.env['MODERN_BASELINE_ENABLE_MF_SSR'] !== 'false';\nconst enableBffRequestId = process.env['MODERN_BASELINE_ENABLE_BFF_REQUEST_ID'] !== 'false';\nconst enableTelemetryExporters =\n process.env['MODERN_BASELINE_ENABLE_TELEMETRY_EXPORTERS'] !== 'false';\nconst telemetryFailLoudStartup = process.env['MODERN_TELEMETRY_FAIL_LOUD_STARTUP'] !== 'false';\nconst otlpEndpoint = process.env['MODERN_TELEMETRY_OTLP_ENDPOINT'];\nconst configuredSiteUrl = process.env['MODERN_PUBLIC_SITE_URL'];\nconst hasConfiguredSiteUrl = typeof configuredSiteUrl === 'string' && configuredSiteUrl.length > 0;\nconst isProductionBuild =\n process.env['NODE_ENV'] === 'production' || process.argv.includes('build');\n\nif (isProductionBuild && !hasConfiguredSiteUrl) {\n throw new Error(\n 'MODERN_PUBLIC_SITE_URL must be set for production builds so canonical and hreflang URLs use the deployed origin.',\n );\n}\n\nconst siteUrl = hasConfiguredSiteUrl ? configuredSiteUrl : 'http://localhost:8080';\nconst victoriaMetricsEndpoint = process.env['MODERN_TELEMETRY_VICTORIA_ENDPOINT'];\n\n// https://bleedingdev.github.io/ultramodern.js/configure/app/usage.html\nexport default defineConfig(\n presetUltramodern(\n {\n plugins: [\n appTools(),\n i18nPlugin({\n localeDetection: {\n fallbackLanguage: 'en',\n languages: ['en', 'cs'],\n localePathRedirect: true,\n },\n }),\n ],\n source: {\n globalVars: {\n ULTRAMODERN_SITE_URL: siteUrl,\n },\n },\n },\n {\n appId,\n enableBffRequestId,\n enableModuleFederationSSR,\n enableTelemetryExporters,\n telemetryFailLoudStartup,\n ...(typeof otlpEndpoint === 'string' ? { otlpEndpoint } : {}),\n ...(typeof victoriaMetricsEndpoint === 'string' ? { victoriaMetricsEndpoint } : {}),\n },\n ),\n);\n",
|
|
@@ -51,11 +51,11 @@ const MWAFiles = {
|
|
|
51
51
|
"tests/ultramodern.contract.test.ts": "import fs from 'node:fs';\nimport path from 'node:path';\nimport { describe, expect, test } from '@rstest/core';\n\nconst root = process.cwd();\nconst readText = (relativePath: string) =>\n fs.readFileSync(path.join(root, relativePath), 'utf-8');\nconst readJson = <T>(relativePath: string): T =>\n JSON.parse(readText(relativePath)) as T;\n\ndescribe('generated UltraModern contract', () => {\n test('keeps localized route metadata and Rstest wiring', () => {\n expect(fs.existsSync(path.join(root, 'src/routes/[lang]/page.tsx'))).toBe(\n true,\n );\n expect(fs.existsSync(path.join(root, 'src/routes/page.tsx'))).toBe(false);\n expect(fs.existsSync(path.join(root, 'src/routes/layout.tsx'))).toBe(true);\n expect(fs.existsSync(path.join(root, 'postcss.config.mjs'))).toBe(false);\n expect(fs.existsSync(path.join(root, 'tailwind.config.ts'))).toBe(false);\n });\n\n test('retains package-source metadata for generated Modern.js packages', () => {\n const packageJson = readJson<{\n dependencies?: Record<string, string>;\n devDependencies?: Record<string, string>;\n modernjs?: {\n packageSource?: {\n config?: string;\n };\n preset?: string;\n };\n }>('package.json');\n const packageSource = readJson<{\n modernPackages?: {\n packages?: string[];\n specifier?: string;\n };\n strategy?: string;\n }>('.modernjs/ultramodern-package-source.json');\n\n expect(packageJson.modernjs?.preset).toBe('presetUltramodern');\n expect(packageJson.modernjs?.packageSource?.config).toBe(\n './.modernjs/ultramodern-package-source.json',\n );\n expect(packageSource.strategy).toMatch(/^(workspace|install)$/u);\n expect(packageSource.modernPackages?.packages).toContain(\n '@modern-js/runtime',\n );\n expect(packageSource.modernPackages?.packages).toContain(\n '@modern-js/app-tools',\n );\n expect(packageSource.modernPackages?.packages).toContain(\n '@modern-js/adapter-rstest',\n );\n expect(packageSource.modernPackages?.specifier).toBeTruthy();\n expect(\n packageJson.devDependencies?.['@modern-js/adapter-rstest'],\n ).toBeTruthy();\n expect(packageJson.devDependencies?.tailwindcss).toBeUndefined();\n expect(\n packageJson.devDependencies?.['@tailwindcss/postcss'],\n ).toBeUndefined();\n });\n});\n",
|
|
52
52
|
".github/renovate.json": "{\n \"$schema\": \"https://docs.renovatebot.com/renovate-schema.json\",\n \"extends\": [\n \"config:recommended\",\n \"helpers:pinGitHubActionDigests\"\n ],\n \"dependencyDashboard\": true,\n \"minimumReleaseAge\": \"1 day\",\n \"prConcurrentLimit\": 5,\n \"prHourlyLimit\": 2,\n \"rangeStrategy\": \"bump\",\n \"schedule\": [\n \"before 5am on monday\"\n ],\n \"timezone\": \"Etc/UTC\",\n \"packageRules\": [\n {\n \"matchManagers\": [\n \"github-actions\"\n ],\n \"groupName\": \"github-actions\",\n \"labels\": [\n \"dependencies\",\n \"github-actions\",\n \"security\"\n ]\n },\n {\n \"matchManagers\": [\n \"npm\"\n ],\n \"matchUpdateTypes\": [\n \"patch\",\n \"minor\"\n ],\n \"groupName\": \"npm minor and patch updates\",\n \"labels\": [\n \"dependencies\",\n \"npm\"\n ]\n },\n {\n \"matchUpdateTypes\": [\n \"major\"\n ],\n \"dependencyDashboardApproval\": true,\n \"labels\": [\n \"dependencies\",\n \"major\"\n ]\n }\n ]\n}\n",
|
|
53
53
|
".github/workflows/ultramodern-gates.yml": "name: Ultramodern Gates\n\non:\n push:\n pull_request:\n\npermissions:\n contents: read\n\ndefaults:\n run:\n shell: bash\n\nenv:\n FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true\n\nconcurrency:\n group: ultramodern-gates-$-$\n cancel-in-progress: true\n\njobs:\n ultramodern-gates:\n runs-on: ubuntu-latest\n timeout-minutes: 20\n steps:\n - name: Harden Runner\n uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5 # v2\n with:\n egress-policy: audit\n\n - name: Checkout\n uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n with:\n fetch-depth: 1\n persist-credentials: false\n\n - name: Setup Node.js\n uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0\n with:\n node-version: 24\n\n - name: Setup mise\n uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0\n\n - name: Install Dependencies\n run: mise exec -- pnpm install --frozen-lockfile\n\n - name: Validate Ultramodern Contract\n run: mise exec -- pnpm run ultramodern:check\n\n - name: Build\n env:\n MODERN_PUBLIC_SITE_URL: http://localhost:8080\n run: mise exec -- pnpm run build\n",
|
|
54
|
-
"api/lambda/hello.ts": "",
|
|
55
54
|
"api/effect/index.ts": "\n",
|
|
55
|
+
"api/lambda/hello.ts": "",
|
|
56
56
|
"shared/effect/api.ts": "\n",
|
|
57
|
-
"src/modern.runtime.ts": "import { defineRuntimeConfig } from '@modern-js/runtime';\nimport { createInstance } from 'i18next';\n\nconst i18nInstance = createInstance();\n\nexport default defineRuntimeConfig({\n i18n: {\n i18nInstance,\n initOptions: {\n defaultNS: 'translation',\n fallbackLng: 'en',\n interpolation: {\n escapeValue: false,\n },\n ns: ['translation'],\n supportedLngs: ['en', 'cs'],\n },\n },\n});\n",
|
|
58
57
|
"src/modern-app-env.d.ts": "/// <reference types='@modern-js/app-tools/types' />\n\ndeclare const ULTRAMODERN_SITE_URL: string;\n",
|
|
58
|
+
"src/modern.runtime.ts": "import { defineRuntimeConfig } from '@modern-js/runtime';\nimport { createInstance } from 'i18next';\n\nconst i18nInstance = createInstance();\n\nexport default defineRuntimeConfig({\n i18n: {\n i18nInstance,\n initOptions: {\n defaultNS: 'translation',\n fallbackLng: 'en',\n interpolation: {\n escapeValue: false,\n },\n ns: ['translation'],\n supportedLngs: ['en', 'cs'],\n },\n },\n});\n",
|
|
59
59
|
"src/routes/index.css": "html,\nbody {\n padding: 0;\n margin: 0;\n font-family:\n PingFang SC,\n Hiragino Sans GB,\n Microsoft YaHei,\n Arial,\n sans-serif;\n background: linear-gradient(to bottom, transparent, #fff) #eceeef;\n}\n\np {\n margin: 0;\n}\n\n* {\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n box-sizing: border-box;\n}\n\n.container-box {\n min-height: 100vh;\n max-width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n padding-top: 10px;\n}\n\nmain {\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.title {\n display: flex;\n margin: 4rem 0 4rem;\n align-items: center;\n font-size: 4rem;\n font-weight: 600;\n}\n\n.logo {\n width: 6rem;\n margin: 7px 0 0 1rem;\n}\n\n.name {\n color: #4ecaff;\n}\n\n.description {\n text-align: center;\n line-height: 1.5;\n font-size: 1.3rem;\n color: #1b3a42;\n margin-bottom: 5rem;\n}\n\n.code {\n background: #fafafa;\n border-radius: 12px;\n padding: 0.6rem 0.9rem;\n font-size: 1.05rem;\n font-family:\n Menlo,\n Monaco,\n Lucida Console,\n Liberation Mono,\n DejaVu Sans Mono,\n Bitstream Vera Sans Mono,\n Courier New,\n monospace;\n}\n\n.container-box .grid {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 1100px;\n margin-top: 3rem;\n}\n\n.card {\n padding: 1.5rem;\n display: flex;\n flex-direction: column;\n justify-content: center;\n height: 100px;\n color: inherit;\n text-decoration: none;\n transition: 0.15s ease;\n width: 45%;\n}\n\n.card:hover,\n.card:focus {\n transform: scale(1.05);\n}\n\n.card h2 {\n display: flex;\n align-items: center;\n font-size: 1.5rem;\n margin: 0;\n padding: 0;\n}\n\n.card p {\n opacity: 0.6;\n font-size: 0.9rem;\n line-height: 1.5;\n margin-top: 1rem;\n}\n\n.arrow-right {\n width: 1.3rem;\n margin-left: 0.5rem;\n margin-top: 3px;\n}\n",
|
|
60
60
|
"src/routes/layout.tsx": "import { Outlet } from '';\nimport './index.css';\n\nexport default function Layout() {\n return (\n <div>\n <Outlet />\n </div>\n );\n}\n",
|
|
61
61
|
"src/routes/[lang]/page.tsx": 'import { Helmet } from \'@modern-js/runtime/head\';\nimport { useModernI18n } from \'@modern-js/plugin-i18n/runtime\';\nimport { useLocation } from \'\';\nimport { useTranslation } from \'react-i18next\';\n\nconst fallbackLanguage = \'en\';\nconst supportedLanguages = [\'en\', \'cs\'] as const;\ntype SupportedLanguage = (typeof supportedLanguages)[number];\n\nconst isSupportedLanguage = (value: string): value is SupportedLanguage =>\n supportedLanguages.includes(value as SupportedLanguage);\n\nconst stripLanguagePrefix = (pathname: string) => {\n const segments = pathname.split(\'/\').filter(Boolean);\n if (segments.length > 0 && isSupportedLanguage(segments[0] ?? \'\')) {\n segments.shift();\n }\n return `/${segments.join(\'/\')}`;\n};\n\nconst localizedPath = (pathname: string, language: SupportedLanguage) => {\n const pathWithoutLanguage = stripLanguagePrefix(pathname);\n return pathWithoutLanguage === \'/\' ? `/${language}` : `/${language}${pathWithoutLanguage}`;\n};\n\nconst absoluteUrl = (pathname: string) => {\n const origin = ULTRAMODERN_SITE_URL.replace(/\\/+$/u, \'\');\n return `${origin}${pathname}`;\n};\n\nconst locationSuffix = (location: { hash?: unknown; search?: unknown; searchStr?: unknown }) => {\n const { hash, search, searchStr } = location;\n let locationSearch = \'\';\n if (typeof searchStr === \'string\') {\n locationSearch = searchStr;\n } else if (typeof search === \'string\') {\n locationSearch = search;\n }\n const locationHash = typeof hash === \'string\' ? hash : \'\';\n return `${locationSearch}${locationHash}`;\n};\n\nconst Index = () => {\n const { t } = useTranslation();\n const { language } = useModernI18n();\n const location = useLocation();\n const currentLanguage = isSupportedLanguage(language) ? language : fallbackLanguage;\n const canonicalPath = localizedPath(location.pathname, currentLanguage);\n const suffix = locationSuffix(location);\n const languageOptions = supportedLanguages.map((code) => ({\n code,\n href: `${localizedPath(location.pathname, code)}${suffix}`,\n label: t(`home.language.${code}`),\n }));\n return (\n <div className="container-box">\n <Helmet>\n <link\n rel="icon"\n type="image/x-icon"\n href="https://lf3-static.bytednsdoc.com/obj/eden-cn/uhbfnupenuhf/favicon.ico"\n />\n <link rel="canonical" href={absoluteUrl(canonicalPath)} />\n {supportedLanguages.map((code) => (\n <link\n href={absoluteUrl(localizedPath(location.pathname, code))}\n hrefLang={code}\n key={code}\n rel="alternate"\n />\n ))}\n <link\n href={absoluteUrl(localizedPath(location.pathname, fallbackLanguage))}\n hrefLang="x-default"\n rel="alternate"\n />\n </Helmet>\n <main>\n <nav className="language-switcher" aria-label={t(\'home.language.switcher\')}>\n {languageOptions.map((option) => (\n <a\n aria-current={currentLanguage === option.code ? \'page\' : undefined}\n href={option.href}\n key={option.code}\n >\n {option.label}\n </a>\n ))}\n </nav>\n <div className="title">\n {t(\'home.title\')}\n <img\n alt={t(\'home.logoAlt\')}\n className="logo"\n src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/modern-js-logo.svg"\n />\n <p className="name">{t(\'home.name\')}</p>\n </div>\n <p className="description">\n {t(\'home.description.intro\')} <code className="code">presetUltramodern(...)</code>{\' \'}\n {/* i18n-ignore technical token */}\n {t(\'home.description.afterPreset\')}\n <code className="code">modern.config.ts</code>\n {/* i18n-ignore technical token */}\n {t(\'home.description.afterConfig\')}\n <code className="code">mise exec -- pnpm run ultramodern:check</code>\n {/* i18n-ignore technical token */}\n {t(\'home.description.end\')}\n </p>\n <div className="grid">\n <a\n href="https://bleedingdev.github.io/ultramodern.js/guides/get-started/ultramodern.html"\n target="_blank"\n rel="noopener noreferrer"\n className="card"\n >\n <h2>\n {t(\'home.cards.guide.title\')}\n <img\n alt=""\n className="arrow-right"\n src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg"\n />\n </h2>\n <p>{t(\'home.cards.guide.body\')}</p>\n </a>\n <a\n href="https://bleedingdev.github.io/ultramodern.js/configure/app/usage.html"\n target="_blank"\n className="card"\n rel="noreferrer"\n >\n <h2>\n {t(\'home.cards.config.title\')}\n <img\n alt=""\n className="arrow-right"\n src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg"\n />\n </h2>\n <p>{t(\'home.cards.config.body\')}</p>\n </a>\n <a\n href="https://github.com/BleedingDev/ultramodern.js/blob/main-ultramodern/packages/toolkit/create/template/.github/workflows/ultramodern-gates.yml.handlebars"\n target="_blank"\n className="card"\n rel="noreferrer"\n >\n <h2>\n {t(\'home.cards.gates.title\')}\n <img\n alt=""\n className="arrow-right"\n src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg"\n />\n </h2>\n <p>{t(\'home.cards.gates.body\')}</p>\n </a>\n <a\n href="https://bleedingdev.github.io/ultramodern.js/configure/app/bff/effect.html"\n target="_blank"\n rel="noopener noreferrer"\n className="card"\n >\n <h2>\n {t(\'home.cards.bff.title\')}\n <img\n alt=""\n className="arrow-right"\n src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg"\n />\n </h2>\n <p>{t(\'home.cards.bff.body\')}</p>\n </a>\n </div>\n </main>\n </div>\n );\n};\n\nexport default Index;\n',
|
|
@@ -2,8 +2,8 @@ import { commonFiles } from "./common.mjs";
|
|
|
2
2
|
const MWAFiles = {
|
|
3
3
|
...commonFiles,
|
|
4
4
|
".browserslistrc": "chrome >= 87\nedge >= 88\nfirefox >= 78\nsafari >= 14\n",
|
|
5
|
-
".gitignore": ".DS_Store\n\n.pnp\n.pnp.js\n.env.local\n.env.*.local\n.history\n*.log*\n\nnode_modules/\n.yarn-integrity\n.pnpm-store/\n*.tsbuildinfo\n.changeset/pre.json\n\ndist/\ncoverage/\nrelease/\noutput/\noutput_resource/\nlog/\n\n.vscode/**/*\n!.vscode/settings.json\n!.vscode/extensions.json\n.idea/\n\n**/*/typings/auto-generated\n\nmodern.config.local.*\n",
|
|
6
5
|
".mise.toml": "[tools]\npnpm = \"\"\n",
|
|
6
|
+
".gitignore": ".DS_Store\n\n.pnp\n.pnp.js\n.env.local\n.env.*.local\n.history\n*.log*\n\nnode_modules/\n.yarn-integrity\n.pnpm-store/\n*.tsbuildinfo\n.changeset/pre.json\n\ndist/\ncoverage/\nrelease/\noutput/\noutput_resource/\nlog/\n\n.vscode/**/*\n!.vscode/settings.json\n!.vscode/extensions.json\n.idea/\n\n**/*/typings/auto-generated\n\nmodern.config.local.*\n",
|
|
7
7
|
".npmrc": "strict-peer-dependencies=false\n",
|
|
8
8
|
"AGENTS.md": "# UltraModern Agent Contract\n\nThis project is generated for Codex-first UltraModern.js work.\n\n## Quality Gates\n\n- `pnpm lint` runs Oxlint with the Ultracite preset.\n- `pnpm format` runs oxfmt.\n- `pnpm typecheck` runs effect-tsgo as the TypeScript checker.\n- `pnpm i18n:check` rejects hardcoded user-visible JSX text.\n- `mise exec -- pnpm ultramodern:check` verifies the generated contract.\n\n## Internationalization\n\nRuntime 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.\n\nRoutes 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.\n\n## Private Skills\n\nPrivate orchestration skills are not vendored into this template. If you are authorized for `TechsioCZ/skills`, run:\n\n```bash\npnpm skills:install\n```\n\nThe installer clones that private repository and copies only the allowlisted skills from `.agents/skills-lock.json`.\n",
|
|
9
9
|
"modern.config.ts": "// @effect-diagnostics nodeBuiltinImport:off processEnv:off\nimport { appTools, defineConfig, presetUltramodern } from '@modern-js/app-tools';\nimport path from 'node:path';\nimport { i18nPlugin } from '@modern-js/plugin-i18n';\nconst appId = process.env['MODERN_BASELINE_APP_ID'] || path.basename(process.cwd());\nconst enableModuleFederationSSR = process.env['MODERN_BASELINE_ENABLE_MF_SSR'] !== 'false';\nconst enableBffRequestId = process.env['MODERN_BASELINE_ENABLE_BFF_REQUEST_ID'] !== 'false';\nconst enableTelemetryExporters =\n process.env['MODERN_BASELINE_ENABLE_TELEMETRY_EXPORTERS'] !== 'false';\nconst telemetryFailLoudStartup = process.env['MODERN_TELEMETRY_FAIL_LOUD_STARTUP'] !== 'false';\nconst otlpEndpoint = process.env['MODERN_TELEMETRY_OTLP_ENDPOINT'];\nconst configuredSiteUrl = process.env['MODERN_PUBLIC_SITE_URL'];\nconst hasConfiguredSiteUrl = typeof configuredSiteUrl === 'string' && configuredSiteUrl.length > 0;\nconst isProductionBuild =\n process.env['NODE_ENV'] === 'production' || process.argv.includes('build');\n\nif (isProductionBuild && !hasConfiguredSiteUrl) {\n throw new Error(\n 'MODERN_PUBLIC_SITE_URL must be set for production builds so canonical and hreflang URLs use the deployed origin.',\n );\n}\n\nconst siteUrl = hasConfiguredSiteUrl ? configuredSiteUrl : 'http://localhost:8080';\nconst victoriaMetricsEndpoint = process.env['MODERN_TELEMETRY_VICTORIA_ENDPOINT'];\n\n// https://bleedingdev.github.io/ultramodern.js/configure/app/usage.html\nexport default defineConfig(\n presetUltramodern(\n {\n plugins: [\n appTools(),\n i18nPlugin({\n localeDetection: {\n fallbackLanguage: 'en',\n languages: ['en', 'cs'],\n localePathRedirect: true,\n },\n }),\n ],\n source: {\n globalVars: {\n ULTRAMODERN_SITE_URL: siteUrl,\n },\n },\n },\n {\n appId,\n enableBffRequestId,\n enableModuleFederationSSR,\n enableTelemetryExporters,\n telemetryFailLoudStartup,\n ...(typeof otlpEndpoint === 'string' ? { otlpEndpoint } : {}),\n ...(typeof victoriaMetricsEndpoint === 'string' ? { victoriaMetricsEndpoint } : {}),\n },\n ),\n);\n",
|
|
@@ -23,11 +23,11 @@ const MWAFiles = {
|
|
|
23
23
|
"tests/ultramodern.contract.test.ts": "import fs from 'node:fs';\nimport path from 'node:path';\nimport { describe, expect, test } from '@rstest/core';\n\nconst root = process.cwd();\nconst readText = (relativePath: string) =>\n fs.readFileSync(path.join(root, relativePath), 'utf-8');\nconst readJson = <T>(relativePath: string): T =>\n JSON.parse(readText(relativePath)) as T;\n\ndescribe('generated UltraModern contract', () => {\n test('keeps localized route metadata and Rstest wiring', () => {\n expect(fs.existsSync(path.join(root, 'src/routes/[lang]/page.tsx'))).toBe(\n true,\n );\n expect(fs.existsSync(path.join(root, 'src/routes/page.tsx'))).toBe(false);\n expect(fs.existsSync(path.join(root, 'src/routes/layout.tsx'))).toBe(true);\n expect(fs.existsSync(path.join(root, 'postcss.config.mjs'))).toBe(false);\n expect(fs.existsSync(path.join(root, 'tailwind.config.ts'))).toBe(false);\n });\n\n test('retains package-source metadata for generated Modern.js packages', () => {\n const packageJson = readJson<{\n dependencies?: Record<string, string>;\n devDependencies?: Record<string, string>;\n modernjs?: {\n packageSource?: {\n config?: string;\n };\n preset?: string;\n };\n }>('package.json');\n const packageSource = readJson<{\n modernPackages?: {\n packages?: string[];\n specifier?: string;\n };\n strategy?: string;\n }>('.modernjs/ultramodern-package-source.json');\n\n expect(packageJson.modernjs?.preset).toBe('presetUltramodern');\n expect(packageJson.modernjs?.packageSource?.config).toBe(\n './.modernjs/ultramodern-package-source.json',\n );\n expect(packageSource.strategy).toMatch(/^(workspace|install)$/u);\n expect(packageSource.modernPackages?.packages).toContain(\n '@modern-js/runtime',\n );\n expect(packageSource.modernPackages?.packages).toContain(\n '@modern-js/app-tools',\n );\n expect(packageSource.modernPackages?.packages).toContain(\n '@modern-js/adapter-rstest',\n );\n expect(packageSource.modernPackages?.specifier).toBeTruthy();\n expect(\n packageJson.devDependencies?.['@modern-js/adapter-rstest'],\n ).toBeTruthy();\n expect(packageJson.devDependencies?.tailwindcss).toBeUndefined();\n expect(\n packageJson.devDependencies?.['@tailwindcss/postcss'],\n ).toBeUndefined();\n });\n});\n",
|
|
24
24
|
".github/renovate.json": "{\n \"$schema\": \"https://docs.renovatebot.com/renovate-schema.json\",\n \"extends\": [\n \"config:recommended\",\n \"helpers:pinGitHubActionDigests\"\n ],\n \"dependencyDashboard\": true,\n \"minimumReleaseAge\": \"1 day\",\n \"prConcurrentLimit\": 5,\n \"prHourlyLimit\": 2,\n \"rangeStrategy\": \"bump\",\n \"schedule\": [\n \"before 5am on monday\"\n ],\n \"timezone\": \"Etc/UTC\",\n \"packageRules\": [\n {\n \"matchManagers\": [\n \"github-actions\"\n ],\n \"groupName\": \"github-actions\",\n \"labels\": [\n \"dependencies\",\n \"github-actions\",\n \"security\"\n ]\n },\n {\n \"matchManagers\": [\n \"npm\"\n ],\n \"matchUpdateTypes\": [\n \"patch\",\n \"minor\"\n ],\n \"groupName\": \"npm minor and patch updates\",\n \"labels\": [\n \"dependencies\",\n \"npm\"\n ]\n },\n {\n \"matchUpdateTypes\": [\n \"major\"\n ],\n \"dependencyDashboardApproval\": true,\n \"labels\": [\n \"dependencies\",\n \"major\"\n ]\n }\n ]\n}\n",
|
|
25
25
|
".github/workflows/ultramodern-gates.yml": "name: Ultramodern Gates\n\non:\n push:\n pull_request:\n\npermissions:\n contents: read\n\ndefaults:\n run:\n shell: bash\n\nenv:\n FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true\n\nconcurrency:\n group: ultramodern-gates-$-$\n cancel-in-progress: true\n\njobs:\n ultramodern-gates:\n runs-on: ubuntu-latest\n timeout-minutes: 20\n steps:\n - name: Harden Runner\n uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5 # v2\n with:\n egress-policy: audit\n\n - name: Checkout\n uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n with:\n fetch-depth: 1\n persist-credentials: false\n\n - name: Setup Node.js\n uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0\n with:\n node-version: 24\n\n - name: Setup mise\n uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0\n\n - name: Install Dependencies\n run: mise exec -- pnpm install --frozen-lockfile\n\n - name: Validate Ultramodern Contract\n run: mise exec -- pnpm run ultramodern:check\n\n - name: Build\n env:\n MODERN_PUBLIC_SITE_URL: http://localhost:8080\n run: mise exec -- pnpm run build\n",
|
|
26
|
-
"api/lambda/hello.ts": "",
|
|
27
26
|
"api/effect/index.ts": "\n",
|
|
27
|
+
"api/lambda/hello.ts": "",
|
|
28
28
|
"shared/effect/api.ts": "\n",
|
|
29
|
-
"src/modern.runtime.ts": "import { defineRuntimeConfig } from '@modern-js/runtime';\nimport { createInstance } from 'i18next';\n\nconst i18nInstance = createInstance();\n\nexport default defineRuntimeConfig({\n i18n: {\n i18nInstance,\n initOptions: {\n defaultNS: 'translation',\n fallbackLng: 'en',\n interpolation: {\n escapeValue: false,\n },\n ns: ['translation'],\n supportedLngs: ['en', 'cs'],\n },\n },\n});\n",
|
|
30
29
|
"src/modern-app-env.d.ts": "/// <reference types='@modern-js/app-tools/types' />\n\ndeclare const ULTRAMODERN_SITE_URL: string;\n",
|
|
30
|
+
"src/modern.runtime.ts": "import { defineRuntimeConfig } from '@modern-js/runtime';\nimport { createInstance } from 'i18next';\n\nconst i18nInstance = createInstance();\n\nexport default defineRuntimeConfig({\n i18n: {\n i18nInstance,\n initOptions: {\n defaultNS: 'translation',\n fallbackLng: 'en',\n interpolation: {\n escapeValue: false,\n },\n ns: ['translation'],\n supportedLngs: ['en', 'cs'],\n },\n },\n});\n",
|
|
31
31
|
"src/routes/index.css": "html,\nbody {\n padding: 0;\n margin: 0;\n font-family:\n PingFang SC,\n Hiragino Sans GB,\n Microsoft YaHei,\n Arial,\n sans-serif;\n background: linear-gradient(to bottom, transparent, #fff) #eceeef;\n}\n\np {\n margin: 0;\n}\n\n* {\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n box-sizing: border-box;\n}\n\n.container-box {\n min-height: 100vh;\n max-width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n padding-top: 10px;\n}\n\nmain {\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.title {\n display: flex;\n margin: 4rem 0 4rem;\n align-items: center;\n font-size: 4rem;\n font-weight: 600;\n}\n\n.logo {\n width: 6rem;\n margin: 7px 0 0 1rem;\n}\n\n.name {\n color: #4ecaff;\n}\n\n.description {\n text-align: center;\n line-height: 1.5;\n font-size: 1.3rem;\n color: #1b3a42;\n margin-bottom: 5rem;\n}\n\n.code {\n background: #fafafa;\n border-radius: 12px;\n padding: 0.6rem 0.9rem;\n font-size: 1.05rem;\n font-family:\n Menlo,\n Monaco,\n Lucida Console,\n Liberation Mono,\n DejaVu Sans Mono,\n Bitstream Vera Sans Mono,\n Courier New,\n monospace;\n}\n\n.container-box .grid {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 1100px;\n margin-top: 3rem;\n}\n\n.card {\n padding: 1.5rem;\n display: flex;\n flex-direction: column;\n justify-content: center;\n height: 100px;\n color: inherit;\n text-decoration: none;\n transition: 0.15s ease;\n width: 45%;\n}\n\n.card:hover,\n.card:focus {\n transform: scale(1.05);\n}\n\n.card h2 {\n display: flex;\n align-items: center;\n font-size: 1.5rem;\n margin: 0;\n padding: 0;\n}\n\n.card p {\n opacity: 0.6;\n font-size: 0.9rem;\n line-height: 1.5;\n margin-top: 1rem;\n}\n\n.arrow-right {\n width: 1.3rem;\n margin-left: 0.5rem;\n margin-top: 3px;\n}\n",
|
|
32
32
|
"src/routes/layout.tsx": "import { Outlet } from '';\nimport './index.css';\n\nexport default function Layout() {\n return (\n <div>\n <Outlet />\n </div>\n );\n}\n",
|
|
33
33
|
"src/routes/[lang]/page.tsx": 'import { Helmet } from \'@modern-js/runtime/head\';\nimport { useModernI18n } from \'@modern-js/plugin-i18n/runtime\';\nimport { useLocation } from \'\';\nimport { useTranslation } from \'react-i18next\';\n\nconst fallbackLanguage = \'en\';\nconst supportedLanguages = [\'en\', \'cs\'] as const;\ntype SupportedLanguage = (typeof supportedLanguages)[number];\n\nconst isSupportedLanguage = (value: string): value is SupportedLanguage =>\n supportedLanguages.includes(value as SupportedLanguage);\n\nconst stripLanguagePrefix = (pathname: string) => {\n const segments = pathname.split(\'/\').filter(Boolean);\n if (segments.length > 0 && isSupportedLanguage(segments[0] ?? \'\')) {\n segments.shift();\n }\n return `/${segments.join(\'/\')}`;\n};\n\nconst localizedPath = (pathname: string, language: SupportedLanguage) => {\n const pathWithoutLanguage = stripLanguagePrefix(pathname);\n return pathWithoutLanguage === \'/\' ? `/${language}` : `/${language}${pathWithoutLanguage}`;\n};\n\nconst absoluteUrl = (pathname: string) => {\n const origin = ULTRAMODERN_SITE_URL.replace(/\\/+$/u, \'\');\n return `${origin}${pathname}`;\n};\n\nconst locationSuffix = (location: { hash?: unknown; search?: unknown; searchStr?: unknown }) => {\n const { hash, search, searchStr } = location;\n let locationSearch = \'\';\n if (typeof searchStr === \'string\') {\n locationSearch = searchStr;\n } else if (typeof search === \'string\') {\n locationSearch = search;\n }\n const locationHash = typeof hash === \'string\' ? hash : \'\';\n return `${locationSearch}${locationHash}`;\n};\n\nconst Index = () => {\n const { t } = useTranslation();\n const { language } = useModernI18n();\n const location = useLocation();\n const currentLanguage = isSupportedLanguage(language) ? language : fallbackLanguage;\n const canonicalPath = localizedPath(location.pathname, currentLanguage);\n const suffix = locationSuffix(location);\n const languageOptions = supportedLanguages.map((code) => ({\n code,\n href: `${localizedPath(location.pathname, code)}${suffix}`,\n label: t(`home.language.${code}`),\n }));\n return (\n <div className="container-box">\n <Helmet>\n <link\n rel="icon"\n type="image/x-icon"\n href="https://lf3-static.bytednsdoc.com/obj/eden-cn/uhbfnupenuhf/favicon.ico"\n />\n <link rel="canonical" href={absoluteUrl(canonicalPath)} />\n {supportedLanguages.map((code) => (\n <link\n href={absoluteUrl(localizedPath(location.pathname, code))}\n hrefLang={code}\n key={code}\n rel="alternate"\n />\n ))}\n <link\n href={absoluteUrl(localizedPath(location.pathname, fallbackLanguage))}\n hrefLang="x-default"\n rel="alternate"\n />\n </Helmet>\n <main>\n <nav className="language-switcher" aria-label={t(\'home.language.switcher\')}>\n {languageOptions.map((option) => (\n <a\n aria-current={currentLanguage === option.code ? \'page\' : undefined}\n href={option.href}\n key={option.code}\n >\n {option.label}\n </a>\n ))}\n </nav>\n <div className="title">\n {t(\'home.title\')}\n <img\n alt={t(\'home.logoAlt\')}\n className="logo"\n src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/modern-js-logo.svg"\n />\n <p className="name">{t(\'home.name\')}</p>\n </div>\n <p className="description">\n {t(\'home.description.intro\')} <code className="code">presetUltramodern(...)</code>{\' \'}\n {/* i18n-ignore technical token */}\n {t(\'home.description.afterPreset\')}\n <code className="code">modern.config.ts</code>\n {/* i18n-ignore technical token */}\n {t(\'home.description.afterConfig\')}\n <code className="code">mise exec -- pnpm run ultramodern:check</code>\n {/* i18n-ignore technical token */}\n {t(\'home.description.end\')}\n </p>\n <div className="grid">\n <a\n href="https://bleedingdev.github.io/ultramodern.js/guides/get-started/ultramodern.html"\n target="_blank"\n rel="noopener noreferrer"\n className="card"\n >\n <h2>\n {t(\'home.cards.guide.title\')}\n <img\n alt=""\n className="arrow-right"\n src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg"\n />\n </h2>\n <p>{t(\'home.cards.guide.body\')}</p>\n </a>\n <a\n href="https://bleedingdev.github.io/ultramodern.js/configure/app/usage.html"\n target="_blank"\n className="card"\n rel="noreferrer"\n >\n <h2>\n {t(\'home.cards.config.title\')}\n <img\n alt=""\n className="arrow-right"\n src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg"\n />\n </h2>\n <p>{t(\'home.cards.config.body\')}</p>\n </a>\n <a\n href="https://github.com/BleedingDev/ultramodern.js/blob/main-ultramodern/packages/toolkit/create/template/.github/workflows/ultramodern-gates.yml.handlebars"\n target="_blank"\n className="card"\n rel="noreferrer"\n >\n <h2>\n {t(\'home.cards.gates.title\')}\n <img\n alt=""\n className="arrow-right"\n src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg"\n />\n </h2>\n <p>{t(\'home.cards.gates.body\')}</p>\n </a>\n <a\n href="https://bleedingdev.github.io/ultramodern.js/configure/app/bff/effect.html"\n target="_blank"\n rel="noopener noreferrer"\n className="card"\n >\n <h2>\n {t(\'home.cards.bff.title\')}\n <img\n alt=""\n className="arrow-right"\n src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg"\n />\n </h2>\n <p>{t(\'home.cards.bff.body\')}</p>\n </a>\n </div>\n </main>\n </div>\n );\n};\n\nexport default Index;\n',
|
|
@@ -3,8 +3,8 @@ import { commonFiles } from "./common.mjs";
|
|
|
3
3
|
const MWAFiles = {
|
|
4
4
|
...commonFiles,
|
|
5
5
|
".browserslistrc": "chrome >= 87\nedge >= 88\nfirefox >= 78\nsafari >= 14\n",
|
|
6
|
-
".gitignore": ".DS_Store\n\n.pnp\n.pnp.js\n.env.local\n.env.*.local\n.history\n*.log*\n\nnode_modules/\n.yarn-integrity\n.pnpm-store/\n*.tsbuildinfo\n.changeset/pre.json\n\ndist/\ncoverage/\nrelease/\noutput/\noutput_resource/\nlog/\n\n.vscode/**/*\n!.vscode/settings.json\n!.vscode/extensions.json\n.idea/\n\n**/*/typings/auto-generated\n\nmodern.config.local.*\n",
|
|
7
6
|
".mise.toml": "[tools]\npnpm = \"\"\n",
|
|
7
|
+
".gitignore": ".DS_Store\n\n.pnp\n.pnp.js\n.env.local\n.env.*.local\n.history\n*.log*\n\nnode_modules/\n.yarn-integrity\n.pnpm-store/\n*.tsbuildinfo\n.changeset/pre.json\n\ndist/\ncoverage/\nrelease/\noutput/\noutput_resource/\nlog/\n\n.vscode/**/*\n!.vscode/settings.json\n!.vscode/extensions.json\n.idea/\n\n**/*/typings/auto-generated\n\nmodern.config.local.*\n",
|
|
8
8
|
".npmrc": "strict-peer-dependencies=false\n",
|
|
9
9
|
"AGENTS.md": "# UltraModern Agent Contract\n\nThis project is generated for Codex-first UltraModern.js work.\n\n## Quality Gates\n\n- `pnpm lint` runs Oxlint with the Ultracite preset.\n- `pnpm format` runs oxfmt.\n- `pnpm typecheck` runs effect-tsgo as the TypeScript checker.\n- `pnpm i18n:check` rejects hardcoded user-visible JSX text.\n- `mise exec -- pnpm ultramodern:check` verifies the generated contract.\n\n## Internationalization\n\nRuntime 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.\n\nRoutes 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.\n\n## Private Skills\n\nPrivate orchestration skills are not vendored into this template. If you are authorized for `TechsioCZ/skills`, run:\n\n```bash\npnpm skills:install\n```\n\nThe installer clones that private repository and copies only the allowlisted skills from `.agents/skills-lock.json`.\n",
|
|
10
10
|
"modern.config.ts": "// @effect-diagnostics nodeBuiltinImport:off processEnv:off\nimport { appTools, defineConfig, presetUltramodern } from '@modern-js/app-tools';\nimport path from 'node:path';\nimport { i18nPlugin } from '@modern-js/plugin-i18n';\nconst appId = process.env['MODERN_BASELINE_APP_ID'] || path.basename(process.cwd());\nconst enableModuleFederationSSR = process.env['MODERN_BASELINE_ENABLE_MF_SSR'] !== 'false';\nconst enableBffRequestId = process.env['MODERN_BASELINE_ENABLE_BFF_REQUEST_ID'] !== 'false';\nconst enableTelemetryExporters =\n process.env['MODERN_BASELINE_ENABLE_TELEMETRY_EXPORTERS'] !== 'false';\nconst telemetryFailLoudStartup = process.env['MODERN_TELEMETRY_FAIL_LOUD_STARTUP'] !== 'false';\nconst otlpEndpoint = process.env['MODERN_TELEMETRY_OTLP_ENDPOINT'];\nconst configuredSiteUrl = process.env['MODERN_PUBLIC_SITE_URL'];\nconst hasConfiguredSiteUrl = typeof configuredSiteUrl === 'string' && configuredSiteUrl.length > 0;\nconst isProductionBuild =\n process.env['NODE_ENV'] === 'production' || process.argv.includes('build');\n\nif (isProductionBuild && !hasConfiguredSiteUrl) {\n throw new Error(\n 'MODERN_PUBLIC_SITE_URL must be set for production builds so canonical and hreflang URLs use the deployed origin.',\n );\n}\n\nconst siteUrl = hasConfiguredSiteUrl ? configuredSiteUrl : 'http://localhost:8080';\nconst victoriaMetricsEndpoint = process.env['MODERN_TELEMETRY_VICTORIA_ENDPOINT'];\n\n// https://bleedingdev.github.io/ultramodern.js/configure/app/usage.html\nexport default defineConfig(\n presetUltramodern(\n {\n plugins: [\n appTools(),\n i18nPlugin({\n localeDetection: {\n fallbackLanguage: 'en',\n languages: ['en', 'cs'],\n localePathRedirect: true,\n },\n }),\n ],\n source: {\n globalVars: {\n ULTRAMODERN_SITE_URL: siteUrl,\n },\n },\n },\n {\n appId,\n enableBffRequestId,\n enableModuleFederationSSR,\n enableTelemetryExporters,\n telemetryFailLoudStartup,\n ...(typeof otlpEndpoint === 'string' ? { otlpEndpoint } : {}),\n ...(typeof victoriaMetricsEndpoint === 'string' ? { victoriaMetricsEndpoint } : {}),\n },\n ),\n);\n",
|
|
@@ -24,11 +24,11 @@ const MWAFiles = {
|
|
|
24
24
|
"tests/ultramodern.contract.test.ts": "import fs from 'node:fs';\nimport path from 'node:path';\nimport { describe, expect, test } from '@rstest/core';\n\nconst root = process.cwd();\nconst readText = (relativePath: string) =>\n fs.readFileSync(path.join(root, relativePath), 'utf-8');\nconst readJson = <T>(relativePath: string): T =>\n JSON.parse(readText(relativePath)) as T;\n\ndescribe('generated UltraModern contract', () => {\n test('keeps localized route metadata and Rstest wiring', () => {\n expect(fs.existsSync(path.join(root, 'src/routes/[lang]/page.tsx'))).toBe(\n true,\n );\n expect(fs.existsSync(path.join(root, 'src/routes/page.tsx'))).toBe(false);\n expect(fs.existsSync(path.join(root, 'src/routes/layout.tsx'))).toBe(true);\n expect(fs.existsSync(path.join(root, 'postcss.config.mjs'))).toBe(false);\n expect(fs.existsSync(path.join(root, 'tailwind.config.ts'))).toBe(false);\n });\n\n test('retains package-source metadata for generated Modern.js packages', () => {\n const packageJson = readJson<{\n dependencies?: Record<string, string>;\n devDependencies?: Record<string, string>;\n modernjs?: {\n packageSource?: {\n config?: string;\n };\n preset?: string;\n };\n }>('package.json');\n const packageSource = readJson<{\n modernPackages?: {\n packages?: string[];\n specifier?: string;\n };\n strategy?: string;\n }>('.modernjs/ultramodern-package-source.json');\n\n expect(packageJson.modernjs?.preset).toBe('presetUltramodern');\n expect(packageJson.modernjs?.packageSource?.config).toBe(\n './.modernjs/ultramodern-package-source.json',\n );\n expect(packageSource.strategy).toMatch(/^(workspace|install)$/u);\n expect(packageSource.modernPackages?.packages).toContain(\n '@modern-js/runtime',\n );\n expect(packageSource.modernPackages?.packages).toContain(\n '@modern-js/app-tools',\n );\n expect(packageSource.modernPackages?.packages).toContain(\n '@modern-js/adapter-rstest',\n );\n expect(packageSource.modernPackages?.specifier).toBeTruthy();\n expect(\n packageJson.devDependencies?.['@modern-js/adapter-rstest'],\n ).toBeTruthy();\n expect(packageJson.devDependencies?.tailwindcss).toBeUndefined();\n expect(\n packageJson.devDependencies?.['@tailwindcss/postcss'],\n ).toBeUndefined();\n });\n});\n",
|
|
25
25
|
".github/renovate.json": "{\n \"$schema\": \"https://docs.renovatebot.com/renovate-schema.json\",\n \"extends\": [\n \"config:recommended\",\n \"helpers:pinGitHubActionDigests\"\n ],\n \"dependencyDashboard\": true,\n \"minimumReleaseAge\": \"1 day\",\n \"prConcurrentLimit\": 5,\n \"prHourlyLimit\": 2,\n \"rangeStrategy\": \"bump\",\n \"schedule\": [\n \"before 5am on monday\"\n ],\n \"timezone\": \"Etc/UTC\",\n \"packageRules\": [\n {\n \"matchManagers\": [\n \"github-actions\"\n ],\n \"groupName\": \"github-actions\",\n \"labels\": [\n \"dependencies\",\n \"github-actions\",\n \"security\"\n ]\n },\n {\n \"matchManagers\": [\n \"npm\"\n ],\n \"matchUpdateTypes\": [\n \"patch\",\n \"minor\"\n ],\n \"groupName\": \"npm minor and patch updates\",\n \"labels\": [\n \"dependencies\",\n \"npm\"\n ]\n },\n {\n \"matchUpdateTypes\": [\n \"major\"\n ],\n \"dependencyDashboardApproval\": true,\n \"labels\": [\n \"dependencies\",\n \"major\"\n ]\n }\n ]\n}\n",
|
|
26
26
|
".github/workflows/ultramodern-gates.yml": "name: Ultramodern Gates\n\non:\n push:\n pull_request:\n\npermissions:\n contents: read\n\ndefaults:\n run:\n shell: bash\n\nenv:\n FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true\n\nconcurrency:\n group: ultramodern-gates-$-$\n cancel-in-progress: true\n\njobs:\n ultramodern-gates:\n runs-on: ubuntu-latest\n timeout-minutes: 20\n steps:\n - name: Harden Runner\n uses: step-security/harden-runner@ab7a9404c0f3da075243ca237b5fac12c98deaa5 # v2\n with:\n egress-policy: audit\n\n - name: Checkout\n uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n with:\n fetch-depth: 1\n persist-credentials: false\n\n - name: Setup Node.js\n uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0\n with:\n node-version: 24\n\n - name: Setup mise\n uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0\n\n - name: Install Dependencies\n run: mise exec -- pnpm install --frozen-lockfile\n\n - name: Validate Ultramodern Contract\n run: mise exec -- pnpm run ultramodern:check\n\n - name: Build\n env:\n MODERN_PUBLIC_SITE_URL: http://localhost:8080\n run: mise exec -- pnpm run build\n",
|
|
27
|
-
"api/lambda/hello.ts": "",
|
|
28
27
|
"api/effect/index.ts": "\n",
|
|
28
|
+
"api/lambda/hello.ts": "",
|
|
29
29
|
"shared/effect/api.ts": "\n",
|
|
30
|
-
"src/modern.runtime.ts": "import { defineRuntimeConfig } from '@modern-js/runtime';\nimport { createInstance } from 'i18next';\n\nconst i18nInstance = createInstance();\n\nexport default defineRuntimeConfig({\n i18n: {\n i18nInstance,\n initOptions: {\n defaultNS: 'translation',\n fallbackLng: 'en',\n interpolation: {\n escapeValue: false,\n },\n ns: ['translation'],\n supportedLngs: ['en', 'cs'],\n },\n },\n});\n",
|
|
31
30
|
"src/modern-app-env.d.ts": "/// <reference types='@modern-js/app-tools/types' />\n\ndeclare const ULTRAMODERN_SITE_URL: string;\n",
|
|
31
|
+
"src/modern.runtime.ts": "import { defineRuntimeConfig } from '@modern-js/runtime';\nimport { createInstance } from 'i18next';\n\nconst i18nInstance = createInstance();\n\nexport default defineRuntimeConfig({\n i18n: {\n i18nInstance,\n initOptions: {\n defaultNS: 'translation',\n fallbackLng: 'en',\n interpolation: {\n escapeValue: false,\n },\n ns: ['translation'],\n supportedLngs: ['en', 'cs'],\n },\n },\n});\n",
|
|
32
32
|
"src/routes/index.css": "html,\nbody {\n padding: 0;\n margin: 0;\n font-family:\n PingFang SC,\n Hiragino Sans GB,\n Microsoft YaHei,\n Arial,\n sans-serif;\n background: linear-gradient(to bottom, transparent, #fff) #eceeef;\n}\n\np {\n margin: 0;\n}\n\n* {\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n box-sizing: border-box;\n}\n\n.container-box {\n min-height: 100vh;\n max-width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n padding-top: 10px;\n}\n\nmain {\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.title {\n display: flex;\n margin: 4rem 0 4rem;\n align-items: center;\n font-size: 4rem;\n font-weight: 600;\n}\n\n.logo {\n width: 6rem;\n margin: 7px 0 0 1rem;\n}\n\n.name {\n color: #4ecaff;\n}\n\n.description {\n text-align: center;\n line-height: 1.5;\n font-size: 1.3rem;\n color: #1b3a42;\n margin-bottom: 5rem;\n}\n\n.code {\n background: #fafafa;\n border-radius: 12px;\n padding: 0.6rem 0.9rem;\n font-size: 1.05rem;\n font-family:\n Menlo,\n Monaco,\n Lucida Console,\n Liberation Mono,\n DejaVu Sans Mono,\n Bitstream Vera Sans Mono,\n Courier New,\n monospace;\n}\n\n.container-box .grid {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 1100px;\n margin-top: 3rem;\n}\n\n.card {\n padding: 1.5rem;\n display: flex;\n flex-direction: column;\n justify-content: center;\n height: 100px;\n color: inherit;\n text-decoration: none;\n transition: 0.15s ease;\n width: 45%;\n}\n\n.card:hover,\n.card:focus {\n transform: scale(1.05);\n}\n\n.card h2 {\n display: flex;\n align-items: center;\n font-size: 1.5rem;\n margin: 0;\n padding: 0;\n}\n\n.card p {\n opacity: 0.6;\n font-size: 0.9rem;\n line-height: 1.5;\n margin-top: 1rem;\n}\n\n.arrow-right {\n width: 1.3rem;\n margin-left: 0.5rem;\n margin-top: 3px;\n}\n",
|
|
33
33
|
"src/routes/layout.tsx": "import { Outlet } from '';\nimport './index.css';\n\nexport default function Layout() {\n return (\n <div>\n <Outlet />\n </div>\n );\n}\n",
|
|
34
34
|
"src/routes/[lang]/page.tsx": 'import { Helmet } from \'@modern-js/runtime/head\';\nimport { useModernI18n } from \'@modern-js/plugin-i18n/runtime\';\nimport { useLocation } from \'\';\nimport { useTranslation } from \'react-i18next\';\n\nconst fallbackLanguage = \'en\';\nconst supportedLanguages = [\'en\', \'cs\'] as const;\ntype SupportedLanguage = (typeof supportedLanguages)[number];\n\nconst isSupportedLanguage = (value: string): value is SupportedLanguage =>\n supportedLanguages.includes(value as SupportedLanguage);\n\nconst stripLanguagePrefix = (pathname: string) => {\n const segments = pathname.split(\'/\').filter(Boolean);\n if (segments.length > 0 && isSupportedLanguage(segments[0] ?? \'\')) {\n segments.shift();\n }\n return `/${segments.join(\'/\')}`;\n};\n\nconst localizedPath = (pathname: string, language: SupportedLanguage) => {\n const pathWithoutLanguage = stripLanguagePrefix(pathname);\n return pathWithoutLanguage === \'/\' ? `/${language}` : `/${language}${pathWithoutLanguage}`;\n};\n\nconst absoluteUrl = (pathname: string) => {\n const origin = ULTRAMODERN_SITE_URL.replace(/\\/+$/u, \'\');\n return `${origin}${pathname}`;\n};\n\nconst locationSuffix = (location: { hash?: unknown; search?: unknown; searchStr?: unknown }) => {\n const { hash, search, searchStr } = location;\n let locationSearch = \'\';\n if (typeof searchStr === \'string\') {\n locationSearch = searchStr;\n } else if (typeof search === \'string\') {\n locationSearch = search;\n }\n const locationHash = typeof hash === \'string\' ? hash : \'\';\n return `${locationSearch}${locationHash}`;\n};\n\nconst Index = () => {\n const { t } = useTranslation();\n const { language } = useModernI18n();\n const location = useLocation();\n const currentLanguage = isSupportedLanguage(language) ? language : fallbackLanguage;\n const canonicalPath = localizedPath(location.pathname, currentLanguage);\n const suffix = locationSuffix(location);\n const languageOptions = supportedLanguages.map((code) => ({\n code,\n href: `${localizedPath(location.pathname, code)}${suffix}`,\n label: t(`home.language.${code}`),\n }));\n return (\n <div className="container-box">\n <Helmet>\n <link\n rel="icon"\n type="image/x-icon"\n href="https://lf3-static.bytednsdoc.com/obj/eden-cn/uhbfnupenuhf/favicon.ico"\n />\n <link rel="canonical" href={absoluteUrl(canonicalPath)} />\n {supportedLanguages.map((code) => (\n <link\n href={absoluteUrl(localizedPath(location.pathname, code))}\n hrefLang={code}\n key={code}\n rel="alternate"\n />\n ))}\n <link\n href={absoluteUrl(localizedPath(location.pathname, fallbackLanguage))}\n hrefLang="x-default"\n rel="alternate"\n />\n </Helmet>\n <main>\n <nav className="language-switcher" aria-label={t(\'home.language.switcher\')}>\n {languageOptions.map((option) => (\n <a\n aria-current={currentLanguage === option.code ? \'page\' : undefined}\n href={option.href}\n key={option.code}\n >\n {option.label}\n </a>\n ))}\n </nav>\n <div className="title">\n {t(\'home.title\')}\n <img\n alt={t(\'home.logoAlt\')}\n className="logo"\n src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/modern-js-logo.svg"\n />\n <p className="name">{t(\'home.name\')}</p>\n </div>\n <p className="description">\n {t(\'home.description.intro\')} <code className="code">presetUltramodern(...)</code>{\' \'}\n {/* i18n-ignore technical token */}\n {t(\'home.description.afterPreset\')}\n <code className="code">modern.config.ts</code>\n {/* i18n-ignore technical token */}\n {t(\'home.description.afterConfig\')}\n <code className="code">mise exec -- pnpm run ultramodern:check</code>\n {/* i18n-ignore technical token */}\n {t(\'home.description.end\')}\n </p>\n <div className="grid">\n <a\n href="https://bleedingdev.github.io/ultramodern.js/guides/get-started/ultramodern.html"\n target="_blank"\n rel="noopener noreferrer"\n className="card"\n >\n <h2>\n {t(\'home.cards.guide.title\')}\n <img\n alt=""\n className="arrow-right"\n src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg"\n />\n </h2>\n <p>{t(\'home.cards.guide.body\')}</p>\n </a>\n <a\n href="https://bleedingdev.github.io/ultramodern.js/configure/app/usage.html"\n target="_blank"\n className="card"\n rel="noreferrer"\n >\n <h2>\n {t(\'home.cards.config.title\')}\n <img\n alt=""\n className="arrow-right"\n src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg"\n />\n </h2>\n <p>{t(\'home.cards.config.body\')}</p>\n </a>\n <a\n href="https://github.com/BleedingDev/ultramodern.js/blob/main-ultramodern/packages/toolkit/create/template/.github/workflows/ultramodern-gates.yml.handlebars"\n target="_blank"\n className="card"\n rel="noreferrer"\n >\n <h2>\n {t(\'home.cards.gates.title\')}\n <img\n alt=""\n className="arrow-right"\n src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg"\n />\n </h2>\n <p>{t(\'home.cards.gates.body\')}</p>\n </a>\n <a\n href="https://bleedingdev.github.io/ultramodern.js/configure/app/bff/effect.html"\n target="_blank"\n rel="noopener noreferrer"\n className="card"\n >\n <h2>\n {t(\'home.cards.bff.title\')}\n <img\n alt=""\n className="arrow-right"\n src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/arrow-right.svg"\n />\n </h2>\n <p>{t(\'home.cards.bff.body\')}</p>\n </a>\n </div>\n </main>\n </div>\n );\n};\n\nexport default Index;\n',
|
|
@@ -2,8 +2,8 @@ export declare const MWAFiles: {
|
|
|
2
2
|
".codesandbox/environment.json": string;
|
|
3
3
|
".codesandbox/tasks.json": string;
|
|
4
4
|
".browserslistrc": string;
|
|
5
|
-
".gitignore": string;
|
|
6
5
|
".mise.toml": string;
|
|
6
|
+
".gitignore": string;
|
|
7
7
|
".npmrc": string;
|
|
8
8
|
"AGENTS.md": string;
|
|
9
9
|
"modern.config.ts": string;
|
|
@@ -23,11 +23,11 @@ export declare const MWAFiles: {
|
|
|
23
23
|
"tests/ultramodern.contract.test.ts": string;
|
|
24
24
|
".github/renovate.json": string;
|
|
25
25
|
".github/workflows/ultramodern-gates.yml": string;
|
|
26
|
-
"api/lambda/hello.ts": string;
|
|
27
26
|
"api/effect/index.ts": string;
|
|
27
|
+
"api/lambda/hello.ts": string;
|
|
28
28
|
"shared/effect/api.ts": string;
|
|
29
|
-
"src/modern.runtime.ts": string;
|
|
30
29
|
"src/modern-app-env.d.ts": string;
|
|
30
|
+
"src/modern.runtime.ts": string;
|
|
31
31
|
"src/routes/index.css": string;
|
|
32
32
|
"src/routes/layout.tsx": string;
|
|
33
33
|
"src/routes/[lang]/page.tsx": string;
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"modern",
|
|
18
18
|
"modern.js"
|
|
19
19
|
],
|
|
20
|
-
"version": "3.2.0-ultramodern.
|
|
20
|
+
"version": "3.2.0-ultramodern.52",
|
|
21
21
|
"types": "./dist/types/index.d.ts",
|
|
22
22
|
"main": "./dist/cjs/index.js",
|
|
23
23
|
"module": "./dist/esm/index.mjs",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@types/recursive-readdir": "^2.2.4",
|
|
49
49
|
"@typescript/native-preview": "7.0.0-dev.20260527.2",
|
|
50
50
|
"recursive-readdir": "^2.2.3",
|
|
51
|
-
"@modern-js/create": "npm:@bleedingdev/modern-js-create@3.2.0-ultramodern.
|
|
51
|
+
"@modern-js/create": "npm:@bleedingdev/modern-js-create@3.2.0-ultramodern.52"
|
|
52
52
|
},
|
|
53
53
|
"sideEffects": false,
|
|
54
54
|
"publishConfig": {
|