@starci/hfs 3.0.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +25 -21
  3. package/bin/hfs.mjs +59 -37
  4. package/lint/run.mjs +70 -39
  5. package/package.json +2 -2
  6. package/runtime/engine/admission.mjs +3 -3
  7. package/runtime/engine/ledger-db.mjs +2 -2
  8. package/runtime/engine/machine-db.mjs +90 -9
  9. package/runtime/engine/migrations/machine/0002-worktrees-no-workflow-kind.sql +13 -0
  10. package/runtime/engine/migrations/runtime/0005-ended-workflow-views.sql +93 -0
  11. package/runtime/knowledge/hfs/canon-pins.yaml +28 -9
  12. package/runtime/knowledge/hfs/peer-integrations.yaml +18 -0
  13. package/runtime/knowledge/hfs/slots.yaml +193 -128
  14. package/runtime/knowledge/patterns/fe/folder.yaml +36 -36
  15. package/runtime/modules/kernel/failure-codes.yaml +23 -32
  16. package/runtime/scripts/checks/architecture/backend.mjs +1 -1
  17. package/runtime/scripts/checks/architecture/config.mjs +31 -11
  18. package/runtime/scripts/checks/architecture/contracts.mjs +4 -4
  19. package/runtime/scripts/checks/architecture/fe-slot-allows.mjs +7 -3
  20. package/runtime/scripts/checks/architecture/framework-pinned.mjs +5 -47
  21. package/runtime/scripts/checks/architecture/frontend.mjs +6 -4
  22. package/runtime/scripts/checks/architecture/hfs.mjs +104 -66
  23. package/runtime/scripts/checks/architecture/next-data.mjs +3 -2
  24. package/runtime/scripts/checks/architecture/registration.mjs +1 -1
  25. package/runtime/scripts/checks/architecture/symbols.mjs +13 -2
  26. package/runtime/scripts/checks/architecture/test-world-files.mjs +83 -45
  27. package/runtime/scripts/checks/architecture/typescript.mjs +45 -20
  28. package/runtime/scripts/checks/typescript-programs.mjs +2 -2
  29. package/runtime/scripts/lib/hfs-check.mjs +156 -141
  30. package/runtime/scripts/lib/hfs-path-findings.mjs +13 -2
  31. package/runtime/scripts/lib/hfs-rules/contract.mjs +15 -42
  32. package/runtime/scripts/lib/hfs-rules/frontend.mjs +37 -36
  33. package/runtime/scripts/lib/hfs-rules/peer-integrations.mjs +44 -0
  34. package/runtime/scripts/lib/hfs-rules/proof-commands.mjs +11 -8
  35. package/runtime/scripts/lib/hfs-slots.mjs +244 -61
  36. package/runtime/scripts/lib/hfs-view.mjs +9 -7
  37. package/runtime/scripts/lib/language.mjs +11 -1
  38. package/runtime/scripts/lib/safe-remove.mjs +95 -10
  39. package/scaffold/app.mjs +179 -0
  40. package/scaffold/service.mjs +26 -16
  41. package/sync/cli.mjs +1 -1
  42. package/sync/hygiene.mjs +11 -8
  43. package/sync/index.mjs +109 -111
  44. package/sync/managed.mjs +9 -8
  45. package/sync/sonar-key.mjs +20 -22
  46. package/templates/{be → app}/ci-workflows/github/workflows/ci.yml +4 -2
  47. package/templates/app/gitignore +6 -0
  48. package/templates/app/hooks/husky/pre-commit +25 -0
  49. package/templates/app/hooks/husky/pre-push +7 -0
  50. package/templates/app/package-scripts/package.json +22 -0
  51. package/templates/{be → app}/quality-config/sonar-project.properties +3 -2
  52. package/templates/app/skeleton/.editorconfig +15 -0
  53. package/templates/app/skeleton/.gitattributes +2 -0
  54. package/templates/app/skeleton/.nvmrc +1 -0
  55. package/templates/app/skeleton/.starciwork/features/index.yaml +7 -0
  56. package/templates/app/skeleton/.starciwork/workspace.yaml +9 -0
  57. package/templates/app/skeleton/README.md +36 -0
  58. package/templates/app/skeleton/scripts/codegen.mjs +4 -0
  59. package/templates/{fe → app}/tool-config/prettierignore +4 -1
  60. package/templates/be/skeleton/.sops.yaml +2 -0
  61. package/templates/be/skeleton/.starcistacks/application-stacks.yaml +10 -0
  62. package/templates/be/skeleton/apps/__app__/src/__app__.options.ts +3 -0
  63. package/templates/be/skeleton/apps/__app__/src/app.module.ts +27 -6
  64. package/templates/be/skeleton/apps/__app__/src/main.ts +4 -1
  65. package/templates/be/skeleton/src/features/system-health/transport/http/live.controller.ts +2 -0
  66. package/templates/be/skeleton/src/modules/domain/identity/admission.policy.ts +11 -0
  67. package/templates/be/skeleton/src/modules/domain/identity/auth.guard.ts +25 -0
  68. package/templates/be/skeleton/src/modules/domain/identity/errors/identity.error.ts +16 -0
  69. package/templates/be/skeleton/src/modules/domain/identity/identity.contracts.ts +11 -0
  70. package/templates/be/skeleton/src/modules/domain/identity/identity.decorators.ts +8 -0
  71. package/templates/be/skeleton/src/modules/domain/identity/identity.module-definition.ts +7 -0
  72. package/templates/be/skeleton/src/modules/domain/identity/identity.module.ts +14 -0
  73. package/templates/be/skeleton/src/modules/domain/identity/identity.options.ts +2 -0
  74. package/templates/be/skeleton/src/modules/domain/identity/index.ts +6 -0
  75. package/templates/be/skeleton/src/modules/domain/identity/messages/identity.messages.ts +11 -0
  76. package/templates/be/skeleton/src/modules/platform/composition/composition.decorators.ts +8 -1
  77. package/templates/be/skeleton/src/modules/platform/composition/index.ts +1 -1
  78. package/templates/be/skeleton/src/modules/platform/config/env-source.config.ts +71 -23
  79. package/templates/be/skeleton/src/modules/platform/config/errors/config.error.ts +14 -16
  80. package/templates/be/skeleton/src/modules/platform/config/index.ts +1 -1
  81. package/templates/be/skeleton/src/modules/platform/config/server.config.ts +2 -12
  82. package/templates/be/skeleton/src/modules/platform/errors/domain.error.ts +16 -7
  83. package/templates/be/skeleton/src/modules/platform/errors/errors/errors.error.ts +16 -0
  84. package/templates/be/skeleton/src/modules/platform/errors/errors.contracts.ts +33 -0
  85. package/templates/be/skeleton/src/modules/platform/errors/errors.decorators.ts +16 -0
  86. package/templates/be/skeleton/src/modules/platform/errors/errors.filter.ts +32 -0
  87. package/templates/be/skeleton/src/modules/platform/errors/errors.log-events.ts +2 -2
  88. package/templates/be/skeleton/src/modules/platform/errors/errors.module-definition.ts +9 -0
  89. package/templates/be/skeleton/src/modules/platform/errors/errors.module.ts +19 -0
  90. package/templates/be/skeleton/src/modules/platform/errors/errors.options.ts +7 -0
  91. package/templates/be/skeleton/src/modules/platform/errors/errors.service.spec.ts +94 -0
  92. package/templates/be/skeleton/src/modules/platform/errors/errors.service.ts +47 -0
  93. package/templates/be/skeleton/src/modules/platform/errors/http-status.policy.ts +13 -0
  94. package/templates/be/skeleton/src/modules/platform/errors/index.ts +4 -1
  95. package/templates/be/skeleton/src/modules/platform/errors/messages/errors.messages.ts +11 -0
  96. package/templates/be/skeleton/src/modules/platform/http-security/errors/http-security.error.ts +19 -0
  97. package/templates/be/skeleton/src/modules/platform/http-security/execution-request.mapper.ts +5 -0
  98. package/templates/be/skeleton/src/modules/platform/http-security/http-security.config.ts +16 -0
  99. package/templates/be/skeleton/src/modules/platform/http-security/http-security.decorators.ts +10 -0
  100. package/templates/be/skeleton/src/modules/platform/http-security/http-security.module-definition.ts +9 -0
  101. package/templates/be/skeleton/src/modules/platform/http-security/http-security.module.ts +13 -0
  102. package/templates/be/skeleton/src/modules/platform/http-security/http-security.options.ts +17 -0
  103. package/templates/be/skeleton/src/modules/platform/http-security/index.ts +7 -0
  104. package/templates/be/skeleton/src/modules/platform/http-security/messages/http-security.messages.ts +13 -0
  105. package/templates/be/skeleton/src/modules/platform/http-security/origin.guard.ts +31 -0
  106. package/templates/be/skeleton/src/modules/platform/http-security/rate-limit.guard.ts +68 -0
  107. package/templates/be/skeleton/src/modules/platform/i18n/bundle-message-catalog.service.spec.ts +66 -0
  108. package/templates/be/skeleton/src/modules/platform/i18n/bundle-message-catalog.service.ts +30 -0
  109. package/templates/be/skeleton/src/modules/platform/i18n/i18n.contracts.ts +18 -0
  110. package/templates/be/skeleton/src/modules/platform/i18n/i18n.decorators.ts +23 -0
  111. package/templates/be/skeleton/src/modules/platform/i18n/i18n.module-definition.ts +9 -0
  112. package/templates/be/skeleton/src/modules/platform/i18n/i18n.module.ts +24 -0
  113. package/templates/be/skeleton/src/modules/platform/i18n/i18n.options.ts +7 -0
  114. package/templates/be/skeleton/src/modules/platform/i18n/i18n.port.ts +13 -0
  115. package/templates/be/skeleton/src/modules/platform/i18n/index.ts +4 -0
  116. package/templates/be/skeleton/src/modules/platform/i18n/request-locale.service.spec.ts +45 -0
  117. package/templates/be/skeleton/src/modules/platform/i18n/request-locale.service.ts +19 -0
  118. package/templates/be/skeleton/src/modules/platform/logging/index.ts +1 -1
  119. package/templates/be/skeleton/src/modules/platform/logging/json-logger.service.spec.ts +85 -68
  120. package/templates/be/skeleton/src/modules/platform/logging/json-logger.service.ts +14 -10
  121. package/templates/be/skeleton/src/modules/platform/logging/logging.decorators.ts +13 -0
  122. package/templates/be/skeleton/src/modules/platform/logging/logging.log-events.ts +4 -0
  123. package/templates/be/skeleton/src/modules/platform/logging/logging.port.ts +0 -1
  124. package/templates/be/skeleton/src/modules/platform/primitives/index.ts +2 -0
  125. package/templates/be/skeleton/src/modules/platform/primitives/outcome.contracts.ts +25 -0
  126. package/templates/be/skeleton/src/modules/platform/primitives/outcome.mapper.ts +24 -0
  127. package/templates/fe/skeleton/apps/__app__/postcss.config.mjs +7 -0
  128. package/templates/fe/skeleton/apps/__app__/src/app/[locale]/error.tsx +5 -17
  129. package/templates/fe/skeleton/apps/__app__/src/app/[locale]/layout.tsx +11 -22
  130. package/templates/fe/skeleton/apps/__app__/src/app/[locale]/loading.tsx +6 -0
  131. package/templates/fe/skeleton/apps/__app__/src/app/[locale]/not-found.tsx +3 -12
  132. package/templates/fe/skeleton/apps/__app__/src/app/[locale]/page.tsx +6 -24
  133. package/templates/fe/skeleton/apps/__app__/src/app/global-error.tsx +4 -18
  134. package/templates/fe/skeleton/apps/__app__/src/app/globals.css +5 -0
  135. package/templates/fe/skeleton/apps/__app__/src/components/composites/FailureScreen/index.tsx +28 -0
  136. package/templates/fe/skeleton/apps/__app__/src/features/layouts/LocaleShell/index.tsx +35 -0
  137. package/templates/fe/skeleton/apps/__app__/src/features/pages/ErrorPage/component.tsx +21 -0
  138. package/templates/fe/skeleton/apps/__app__/src/features/pages/ErrorPage/index.tsx +17 -0
  139. package/templates/fe/skeleton/apps/__app__/src/features/pages/GlobalErrorPage/component.tsx +26 -0
  140. package/templates/fe/skeleton/apps/__app__/src/features/pages/GlobalErrorPage/index.tsx +15 -0
  141. package/templates/fe/skeleton/apps/__app__/src/features/pages/HomePage/component.tsx +25 -0
  142. package/templates/fe/skeleton/apps/__app__/src/features/pages/HomePage/index.tsx +15 -0
  143. package/templates/fe/skeleton/apps/__app__/src/features/pages/LoadingPage/component.tsx +27 -0
  144. package/templates/fe/skeleton/apps/__app__/src/features/pages/LoadingPage/index.tsx +8 -0
  145. package/templates/fe/skeleton/apps/__app__/src/features/pages/NotFoundPage/component.tsx +32 -0
  146. package/templates/fe/skeleton/apps/__app__/src/features/pages/NotFoundPage/index.tsx +8 -0
  147. package/templates/fe/skeleton/apps/__app__/src/modules/config/index.ts +12 -0
  148. package/templates/fe/skeleton/apps/__app__/src/modules/i18n/index.ts +2 -0
  149. package/templates/fe/skeleton/apps/__app__/src/modules/i18n/messages/vi.json +6 -0
  150. package/templates/fe/{skeleton-app → skeleton}/apps/__app__/src/modules/i18n/request.ts +1 -0
  151. package/templates/fe/skeleton/apps/__app__/src/modules/routes/index.ts +4 -0
  152. package/templates/fe/{skeleton-app → skeleton}/apps/__app__/src/proxy.ts +1 -1
  153. package/sync/skeleton.mjs +0 -76
  154. package/templates/be/gitignore +0 -2
  155. package/templates/be/hooks/husky/pre-commit +0 -13
  156. package/templates/be/hooks/husky/pre-push +0 -6
  157. package/templates/be/package-scripts/package.json +0 -19
  158. package/templates/be/skeleton/scripts/.gitkeep +0 -0
  159. package/templates/be/skeleton/src/modules/platform/config/config.decorators.ts +0 -9
  160. package/templates/be/skeleton/src/modules/platform/errors/error.filter.ts +0 -20
  161. package/templates/be/tool-config/prettierignore +0 -8
  162. package/templates/fe/ci-workflows/github/workflows/ci.yml +0 -40
  163. package/templates/fe/gitignore +0 -3
  164. package/templates/fe/hooks/husky/pre-commit +0 -16
  165. package/templates/fe/hooks/husky/pre-push +0 -5
  166. package/templates/fe/package-scripts/package.json +0 -13
  167. package/templates/fe/parts/api-client.ts +0 -44
  168. package/templates/fe/parts/api-outcome.ts +0 -7
  169. package/templates/fe/quality-config/sonar-project.properties +0 -8
  170. package/templates/fe/skeleton/scripts/.gitkeep +0 -0
  171. package/templates/fe/skeleton-app/apps/__app__/src/modules/api/client.ts +0 -1
  172. package/templates/fe/skeleton-app/apps/__app__/src/modules/api/index.ts +0 -3
  173. package/templates/fe/skeleton-app/apps/__app__/src/modules/api/outcome.ts +0 -1
  174. package/templates/fe/skeleton-app/apps/__app__/src/modules/i18n/index.ts +0 -4
  175. package/templates/fe/skeleton-app/apps/__app__/src/modules/i18n/navigation.ts +0 -5
  176. package/templates/fe/skeleton-shared/apps/__app__/next.config.ts +0 -12
  177. package/templates/fe/skeleton-shared/apps/__app__/src/modules/api/index.ts +0 -2
  178. package/templates/fe/skeleton-shared/apps/__app__/src/modules/i18n/index.ts +0 -9
  179. package/templates/fe/skeleton-shared/apps/__app__/src/modules/i18n/request.ts +0 -5
  180. package/templates/fe/skeleton-shared/apps/__app__/src/proxy.ts +0 -5
  181. package/templates/fe/skeleton-shared/packages/__family__-api/package.json +0 -12
  182. package/templates/fe/skeleton-shared/packages/__family__-api/src/client.ts +0 -1
  183. package/templates/fe/skeleton-shared/packages/__family__-api/src/index.ts +0 -3
  184. package/templates/fe/skeleton-shared/packages/__family__-api/src/outcome.ts +0 -1
  185. package/templates/fe/skeleton-shared/packages/__family__-api/tsconfig.json +0 -5
  186. package/templates/fe/skeleton-shared/packages/__family__-i18n/package.json +0 -18
  187. package/templates/fe/skeleton-shared/packages/__family__-i18n/src/app.ts +0 -19
  188. package/templates/fe/skeleton-shared/packages/__family__-i18n/src/index.ts +0 -2
  189. package/templates/fe/skeleton-shared/packages/__family__-i18n/src/proxy.ts +0 -12
  190. package/templates/fe/skeleton-shared/packages/__family__-i18n/src/request.ts +0 -15
  191. package/templates/fe/skeleton-shared/packages/__family__-i18n/tsconfig.json +0 -5
  192. package/templates/fe/tool-config/prettierrc +0 -1
  193. /package/templates/{be → app}/ci-workflows/github/workflows/e2e.yml +0 -0
  194. /package/templates/{be → app}/starciwork.gitignore +0 -0
  195. /package/templates/{be → app}/tool-config/prettierrc +0 -0
  196. /package/templates/fe/{skeleton-app → skeleton}/apps/__app__/next.config.ts +0 -0
  197. /package/templates/fe/{skeleton-app → skeleton}/apps/__app__/src/modules/i18n/config.ts +0 -0
  198. /package/templates/fe/{skeleton-app → skeleton}/apps/__app__/src/modules/i18n/routing.ts +0 -0
@@ -1,8 +0,0 @@
1
- {{header}}
2
- sonar.projectKey={{sonarKey}}
3
- sonar.sourceEncoding=UTF-8
4
- sonar.sources={{sonarRoots}}
5
- sonar.exclusions=**/.next/**,**/node_modules/**,**/src/messages/**
6
- sonar.typescript.tsconfigPaths={{tsconfigPaths}}
7
- sonar.externalIssuesReportPaths=reports/lint.sonar.json
8
- sonar.nodejs.maxspace=8192
File without changes
@@ -1 +0,0 @@
1
- {{> fe/parts/api-client.ts}}
@@ -1,3 +0,0 @@
1
- export { request } from "./client"
2
- export type { ClientRequest } from "./client"
3
- export type { Outcome } from "./outcome"
@@ -1 +0,0 @@
1
- {{> fe/parts/api-outcome.ts}}
@@ -1,4 +0,0 @@
1
- export { DEFAULT_LOCALE, LOCALES } from "./config"
2
- export type { Locale } from "./config"
3
- export { getPathname, Link, redirect, usePathname, useRouter } from "./navigation"
4
- export { routing } from "./routing"
@@ -1,5 +0,0 @@
1
- import { createNavigation } from "next-intl/navigation"
2
- import { routing } from "./routing"
3
-
4
- /** Locale-aware links and navigation; components import these instead of `next/link` and `next/navigation`. */
5
- export const { Link, redirect, usePathname, useRouter, getPathname } = createNavigation(routing)
@@ -1,12 +0,0 @@
1
- import type { NextConfig } from "next"
2
- import createNextIntlPlugin from "next-intl/plugin"
3
-
4
- const withNextIntl = createNextIntlPlugin("./src/modules/i18n/request.ts")
5
-
6
- /** Next config of the {{app}} app: next-intl wired to the request config, Turbopack rooted at the repository, the shared packages compiled from source. */
7
- const nextConfig: NextConfig = {
8
- turbopack: { root: process.cwd() },
9
- transpilePackages: ["@{{family}}/i18n", "@{{family}}/api"],
10
- }
11
-
12
- export default withNextIntl(nextConfig)
@@ -1,2 +0,0 @@
1
- export { request } from "@{{family}}/api"
2
- export type { ClientRequest, Outcome } from "@{{family}}/api"
@@ -1,9 +0,0 @@
1
- import { createAppI18n } from "@{{family}}/i18n"
2
-
3
- /** This app's locales and the next-intl stack (routing, navigation) built from them by the shared i18n package. */
4
- const i18n = createAppI18n({ locales: ["vi"], defaultLocale: "vi" })
5
-
6
- export const { DEFAULT_LOCALE, LOCALES, getPathname, Link, redirect, routing, usePathname, useRouter } = i18n
7
-
8
- /** A served locale. */
9
- export type Locale = (typeof LOCALES)[number]
@@ -1,5 +0,0 @@
1
- import { createRequestConfig } from "@{{family}}/i18n/request"
2
- import { routing } from "./index"
3
-
4
- /** Loads the catalog of the requested locale from this app's `messages/`; the shared package resolves the locale. */
5
- export default createRequestConfig(routing, async (locale) => (await import(`./messages/${locale}.json`)).default)
@@ -1,5 +0,0 @@
1
- import { createProxy } from "@{{family}}/i18n/proxy"
2
- import { routing } from "./modules/i18n"
3
-
4
- /** Negotiates the locale and redirects; the default locale (vi) is served without a prefix. */
5
- export default createProxy(routing)
@@ -1,12 +0,0 @@
1
- {
2
- "name": "@{{family}}/api",
3
- "version": "0.1.0",
4
- "private": true,
5
- "type": "module",
6
- "exports": {
7
- ".": "./src/index.ts"
8
- },
9
- "scripts": {
10
- "typecheck": "tsc --noEmit --pretty false"
11
- }
12
- }
@@ -1 +0,0 @@
1
- {{> fe/parts/api-client.ts}}
@@ -1,3 +0,0 @@
1
- export { request } from "./client"
2
- export type { ClientRequest } from "./client"
3
- export type { Outcome } from "./outcome"
@@ -1 +0,0 @@
1
- {{> fe/parts/api-outcome.ts}}
@@ -1,5 +0,0 @@
1
- {
2
- "extends": "@starci/tsconfig/next.json",
3
- "include": ["src/**/*.ts", "src/**/*.tsx"],
4
- "exclude": ["node_modules"]
5
- }
@@ -1,18 +0,0 @@
1
- {
2
- "name": "@{{family}}/i18n",
3
- "version": "0.1.0",
4
- "private": true,
5
- "type": "module",
6
- "exports": {
7
- ".": "./src/index.ts",
8
- "./proxy": "./src/proxy.ts",
9
- "./request": "./src/request.ts"
10
- },
11
- "scripts": {
12
- "typecheck": "tsc --noEmit --pretty false"
13
- },
14
- "peerDependencies": {
15
- "next": ">=16",
16
- "next-intl": ">=4"
17
- }
18
- }
@@ -1,19 +0,0 @@
1
- import { createNavigation } from "next-intl/navigation"
2
- import { defineRouting } from "next-intl/routing"
3
-
4
- /** The locales an app serves and the one it serves at the unprefixed path. */
5
- export interface AppI18nOptions<Locale extends string> {
6
- readonly locales: readonly [Locale, ...Locale[]]
7
- readonly defaultLocale: Locale
8
- }
9
-
10
- /**
11
- * The next-intl stack of one app, written once for the repository: one routing table (default locale unprefixed) and the
12
- * locale-aware navigation built on it. Components import `Link` and `redirect` from their app's i18n module, never from
13
- * `next/link` or `next/navigation`. The proxy and the request config are the `./proxy` and `./request` entries, so a client
14
- * bundle that imports this one carries no server code.
15
- */
16
- export const createAppI18n = <const Locale extends string>({ locales, defaultLocale }: AppI18nOptions<Locale>) => {
17
- const routing = defineRouting({ locales, defaultLocale, localePrefix: "as-needed" })
18
- return { LOCALES: locales, DEFAULT_LOCALE: defaultLocale, routing, ...createNavigation(routing) }
19
- }
@@ -1,2 +0,0 @@
1
- export { createAppI18n } from "./app"
2
- export type { AppI18nOptions } from "./app"
@@ -1,12 +0,0 @@
1
- import createMiddleware from "next-intl/middleware"
2
- import type { defineRouting } from "next-intl/routing"
3
- import { NextResponse, type NextRequest } from "next/server"
4
-
5
- /** The API, the health probe, framework files and files with an extension are never locale-negotiated. */
6
- const UNNEGOTIATED = /^\/(?:api|health|_next|_vercel)(?:\/|$)|\.[^/]+$/
7
-
8
- /** The proxy of an app: negotiates the locale and redirects, and lets everything that is not a page through untouched. */
9
- export const createProxy = (routing: ReturnType<typeof defineRouting>) => {
10
- const negotiate = createMiddleware(routing)
11
- return (request: NextRequest) => (UNNEGOTIATED.test(request.nextUrl.pathname) ? NextResponse.next() : negotiate(request))
12
- }
@@ -1,15 +0,0 @@
1
- import { hasLocale } from "next-intl"
2
- import type { defineRouting } from "next-intl/routing"
3
- import { getRequestConfig } from "next-intl/server"
4
-
5
- type Routing = ReturnType<typeof defineRouting>
6
-
7
- /** The requested locale when the app serves it, else the default one. */
8
- export const resolveLocale = (routing: Routing, requested: string | undefined): string => (hasLocale(routing.locales, requested) ? requested : routing.defaultLocale)
9
-
10
- /** The request config of an app: the resolved locale and the catalog the app loads for it. */
11
- export const createRequestConfig = (routing: Routing, loadMessages: (locale: string) => Promise<Record<string, unknown>>) =>
12
- getRequestConfig(async ({ requestLocale }) => {
13
- const locale = resolveLocale(routing, await requestLocale)
14
- return { locale, messages: await loadMessages(locale) }
15
- })
@@ -1,5 +0,0 @@
1
- {
2
- "extends": "@starci/tsconfig/next.json",
3
- "include": ["src/**/*.ts", "src/**/*.tsx"],
4
- "exclude": ["node_modules"]
5
- }
@@ -1 +0,0 @@
1
- "@starci/prettier-config"
File without changes
File without changes