@intlayer/engine 9.5.11 → 9.5.12

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 (83) hide show
  1. package/dist/assets/installSkills/skills/bundle-optimization.md +123 -0
  2. package/dist/assets/installSkills/skills/compat.md +0 -4
  3. package/dist/assets/installSkills/skills/content.md +8 -2
  4. package/dist/assets/installSkills/skills/next-js.md +2 -2
  5. package/dist/assets/installSkills/skills/usage.md +1 -1
  6. package/dist/cjs/build.cjs +5 -0
  7. package/dist/cjs/cli.cjs +1 -0
  8. package/dist/cjs/init/index.cjs +2 -12
  9. package/dist/cjs/init/index.cjs.map +1 -1
  10. package/dist/cjs/init/utils/backendPackages.cjs +15 -0
  11. package/dist/cjs/init/utils/backendPackages.cjs.map +1 -0
  12. package/dist/cjs/init/utils/index.cjs +2 -3
  13. package/dist/cjs/installSkills/index.cjs +2 -0
  14. package/dist/cjs/installSkills/index.cjs.map +1 -1
  15. package/dist/cjs/loadDictionaries/loadDictionaries.cjs +9 -8
  16. package/dist/cjs/loadDictionaries/loadDictionaries.cjs.map +1 -1
  17. package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs +3 -5
  18. package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs.map +1 -1
  19. package/dist/cjs/loadDictionaries/remoteDictionaryClient.cjs +18 -0
  20. package/dist/cjs/loadDictionaries/remoteDictionaryClient.cjs.map +1 -0
  21. package/dist/cjs/prepareIntlayerServer.cjs +132 -0
  22. package/dist/cjs/prepareIntlayerServer.cjs.map +1 -0
  23. package/dist/cjs/utils/getProcessChainCommands.cjs +117 -0
  24. package/dist/cjs/utils/getProcessChainCommands.cjs.map +1 -0
  25. package/dist/cjs/utils/index.cjs +2 -0
  26. package/dist/cjs/utils/startContentWatcher.cjs +99 -0
  27. package/dist/cjs/utils/startContentWatcher.cjs.map +1 -0
  28. package/dist/cjs/watcher.cjs +2 -2
  29. package/dist/cjs/watcher.cjs.map +1 -1
  30. package/dist/cjs/writeJsonIfChanged.cjs.map +1 -1
  31. package/dist/esm/build.mjs +2 -1
  32. package/dist/esm/cli.mjs +2 -2
  33. package/dist/esm/init/index.mjs +1 -11
  34. package/dist/esm/init/index.mjs.map +1 -1
  35. package/dist/esm/init/utils/backendPackages.mjs +14 -0
  36. package/dist/esm/init/utils/backendPackages.mjs.map +1 -0
  37. package/dist/esm/init/utils/index.mjs +2 -2
  38. package/dist/esm/installSkills/index.mjs +2 -0
  39. package/dist/esm/installSkills/index.mjs.map +1 -1
  40. package/dist/esm/loadDictionaries/loadDictionaries.mjs +9 -8
  41. package/dist/esm/loadDictionaries/loadDictionaries.mjs.map +1 -1
  42. package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs +2 -4
  43. package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs.map +1 -1
  44. package/dist/esm/loadDictionaries/remoteDictionaryClient.mjs +16 -0
  45. package/dist/esm/loadDictionaries/remoteDictionaryClient.mjs.map +1 -0
  46. package/dist/esm/prepareIntlayerServer.mjs +128 -0
  47. package/dist/esm/prepareIntlayerServer.mjs.map +1 -0
  48. package/dist/esm/utils/getProcessChainCommands.mjs +115 -0
  49. package/dist/esm/utils/getProcessChainCommands.mjs.map +1 -0
  50. package/dist/esm/utils/index.mjs +2 -1
  51. package/dist/esm/utils/startContentWatcher.mjs +98 -0
  52. package/dist/esm/utils/startContentWatcher.mjs.map +1 -0
  53. package/dist/esm/watcher.mjs +1 -1
  54. package/dist/esm/watcher.mjs.map +1 -1
  55. package/dist/esm/writeJsonIfChanged.mjs +1 -1
  56. package/dist/esm/writeJsonIfChanged.mjs.map +1 -1
  57. package/dist/types/build.d.ts +2 -1
  58. package/dist/types/cli.d.ts +2 -2
  59. package/dist/types/init/index.d.ts +1 -1
  60. package/dist/types/init/index.d.ts.map +1 -1
  61. package/dist/types/init/utils/backendPackages.d.ts +5 -0
  62. package/dist/types/init/utils/backendPackages.d.ts.map +1 -0
  63. package/dist/types/init/utils/index.d.ts +2 -2
  64. package/dist/types/installSkills/index.d.ts +1 -0
  65. package/dist/types/installSkills/index.d.ts.map +1 -1
  66. package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts.map +1 -1
  67. package/dist/types/loadDictionaries/remoteDictionaryClient.d.ts +14 -0
  68. package/dist/types/loadDictionaries/remoteDictionaryClient.d.ts.map +1 -0
  69. package/dist/types/prepareIntlayerServer.d.ts +67 -0
  70. package/dist/types/prepareIntlayerServer.d.ts.map +1 -0
  71. package/dist/types/utils/getProcessChainCommands.d.ts +35 -0
  72. package/dist/types/utils/getProcessChainCommands.d.ts.map +1 -0
  73. package/dist/types/utils/index.d.ts +2 -1
  74. package/dist/types/utils/startContentWatcher.d.ts +40 -0
  75. package/dist/types/utils/startContentWatcher.d.ts.map +1 -0
  76. package/dist/types/watcher.d.ts.map +1 -1
  77. package/package.json +7 -7
  78. package/dist/cjs/init/utils/devScript.cjs +0 -57
  79. package/dist/cjs/init/utils/devScript.cjs.map +0 -1
  80. package/dist/esm/init/utils/devScript.mjs +0 -55
  81. package/dist/esm/init/utils/devScript.mjs.map +0 -1
  82. package/dist/types/init/utils/devScript.d.ts +0 -48
  83. package/dist/types/init/utils/devScript.d.ts.map +0 -1
@@ -0,0 +1,123 @@
1
+ ---
2
+ name: intlayer-bundle-optimization
3
+ description: Keeps Intlayer dictionaries small in production bundles (purge, minify, import modes). Use when the user asks to "reduce bundle size", "optimize dictionaries", fix "cannot be purged or minified" / "Opaque field" build warnings, or configure `build.optimize`, `build.purge`, `build.minify` or `importMode`.
4
+ metadata:
5
+ author: Intlayer
6
+ url: https://intlayer.org
7
+ license: Apache-2.0
8
+ category: productivity
9
+ tags: [i18n, performance, bundle]
10
+ documentation: https://intlayer.org/doc/concept/bundle-optimization
11
+ support: contact@intlayer.org
12
+ ---
13
+
14
+ # Intlayer Bundle Optimization
15
+
16
+ [Doc](https://intlayer.org/doc/concept/bundle-optimization.md)
17
+
18
+ ## Configuration
19
+
20
+ ```typescript fileName="intlayer.config.ts"
21
+ import type { IntlayerConfig } from "intlayer";
22
+
23
+ const config: IntlayerConfig = {
24
+ dictionary: {
25
+ importMode: "dynamic", // 'static' (default) | 'dynamic' | 'fetch'
26
+ },
27
+ build: {
28
+ optimize: undefined, // auto: enabled in production builds only
29
+ purge: true, // drop fields never read in source code
30
+ minify: true, // rename field keys to short aliases (title → a)
31
+ chunkGrouping: true, // dynamic mode: one dictionary chunk per split boundary
32
+ dictionariesPreload: true, // dynamic mode: fetch content with its chunk
33
+ },
34
+ };
35
+
36
+ export default config;
37
+ ```
38
+
39
+ - `purge` and `minify` do nothing when `optimize` is `false`.
40
+ - `minify` skips key renaming while `editor.enabled` is `true`, and for `importMode: 'fetch'` dictionaries.
41
+ - `importMode: 'dynamic'` ships only the current locale's JSON; it can also be set per dictionary.
42
+
43
+ ## Dictionaries Follow Their Chunk
44
+
45
+ The build optimization rewrites each `useIntlayer('key')` / `getIntlayer('key')` into a direct import of that dictionary, then empties the global dictionary registry:
46
+
47
+ - A dictionary is bundled with the component that reads it, so a lazy-loaded route only ships its own content.
48
+
49
+ With `importMode: 'dynamic'`, `vite-intlayer` adds two more build plugins (build only, not in dev):
50
+
51
+ - `intlayerChunk` (`build.chunkGrouping`, default `true`) merges the per-dictionary, per-locale chunks by the code-split boundary that uses them (`React.lazy`, split route). Each boundary loads its content in one request per locale. Dictionaries used by several boundaries go to a shared chunk.
52
+ - `intlayerPreload` (`build.dictionariesPreload`, default `true`) starts the dictionary fetch when its chunk is loaded, instead of when the component renders, so navigation does not flash a loading state.
53
+
54
+ Keep dictionaries scoped to their component or page. A dictionary read from many routes ends up in a shared chunk.
55
+
56
+ ## Write Code the Analyzer Can Follow
57
+
58
+ Purge and minify rely on a static analysis of every `useIntlayer` / `getIntlayer` call. When a read cannot be followed, the build keeps the whole field or dictionary and warns:
59
+
60
+ - `Dictionary <key> cannot be purged or minified`: the content object escapes.
61
+ - `Dictionary <key> partially minified. Opaque field: '<path>'`: a field is read with a dynamic key.
62
+
63
+ ### Read fields by name
64
+
65
+ ```tsx
66
+ // ✅ Destructure or use dot access
67
+ const { title, description } = useIntlayer("post");
68
+ ```
69
+
70
+ ### Use `select()` instead of dynamic keys
71
+
72
+ ```tsx
73
+ // ❌ Opaque field: 'statuses' is kept whole, keys not minified
74
+ const { statuses } = useIntlayer("post");
75
+ <p>{statuses[post.status]}</p>;
76
+
77
+ // ✅ post.content.ts: publishStatus: select({ draft: "…", published: "…" })
78
+ const { publishStatus } = useIntlayer("post");
79
+ <p>{publishStatus(post.status)}</p>;
80
+ ```
81
+
82
+ Same for numbers (`enu()`), booleans (`cond()`) and genders (`gender()`).
83
+
84
+ ### Call `useIntlayer` in each component
85
+
86
+ ```tsx
87
+ // ❌ Passing content as a prop: the whole dictionary is kept
88
+ const Post = () => {
89
+ const content = useIntlayer("post");
90
+ return <PostFooter content={content} />;
91
+ };
92
+
93
+ // ✅ Each component reads its own fields; the dictionary is loaded once
94
+ const PostFooter = () => {
95
+ const { footer } = useIntlayer("post");
96
+ return <footer>{footer}</footer>;
97
+ };
98
+ ```
99
+
100
+ ### Don't let the content object escape
101
+
102
+ Spreading (`{ ...content }`), iterating (`Object.entries(content)`) or passing it to a helper (`format(content)`) keeps the whole dictionary.
103
+
104
+ ## Accepted Exceptions
105
+
106
+ Some framework APIs need the content as a value, for example a TanStack Start route that loads it in `loader` and reads it in `head`:
107
+
108
+ ```tsx
109
+ loader: async ({ params }) => ({
110
+ content: await getIntlayerAsync("admin-metadata", params.locale),
111
+ }),
112
+ head: ({ loaderData }) => ({
113
+ meta: [{ title: loaderData?.content.title }],
114
+ }),
115
+ ```
116
+
117
+ The analyzer cannot follow `loaderData`, so this dictionary stays whole and the warning is expected. Keep such dictionaries dedicated and small (e.g. a `*-metadata` dictionary holding only the page metadata) so the rest of the content is still optimized.
118
+
119
+ ## References
120
+
121
+ - [Bundle Optimization](https://intlayer.org/doc/concept/bundle-optimization.md)
122
+ - [Select](https://intlayer.org/doc/concept/content/select.md)
123
+ - [Configuration](https://intlayer.org/doc/concept/configuration.md)
@@ -80,8 +80,4 @@ Once the app runs on Intlayer, components can be moved progressively to the nati
80
80
  - [Lingui](https://intlayer.org/doc/compatibility/lingui.md)
81
81
  - [NuxtJS I18n](https://intlayer.org/doc/compatibility/nuxtjs-i18n.md)
82
82
  - [NGX Translate](https://intlayer.org/doc/compatibility/ngx-translate.md)
83
- - [Transloco](https://intlayer.org/doc/compatibility/transloco.md)
84
83
  - [Svelte I18n](https://intlayer.org/doc/compatibility/svelte-i18n.md)
85
- - [Next Translate](https://intlayer.org/doc/compatibility/next-translate.md)
86
- - [Polyglot.js](https://intlayer.org/doc/compatibility/polyglot.md)
87
- - [i18n-js](https://intlayer.org/doc/compatibility/i18n-js.md)
@@ -210,7 +210,7 @@ const publishStatus = select({
210
210
  // Usage: publishStatus(post.status)
211
211
  ```
212
212
 
213
- > Prefer `select()` over indexing a plain object (`content[status]`): dynamic property access prevents the compiler from pruning and minifying the content.
213
+ > Prefer `select()` over indexing a plain object (`content.statuses[status]`): dynamic property access prevents the compiler from pruning and minifying the content, and the build warns `Opaque field`.
214
214
 
215
215
  ### Choosing a node by discriminant
216
216
 
@@ -304,6 +304,7 @@ import {
304
304
  html,
305
305
  md,
306
306
  nest,
307
+ select,
307
308
  t,
308
309
  type Dictionary,
309
310
  } from "intlayer";
@@ -312,7 +313,7 @@ const content = {
312
313
  key: "test",
313
314
  title: "Test component content",
314
315
  description:
315
- "Content declarations for the Test component, including examples of plurals, conditions, gender-specific messages, dynamic insertions, markdown, file-based content and nested dictionaries used for demonstration and testing purposes.",
316
+ "Content declarations for the Test component, including examples of plurals, conditions, gender-specific messages, string-based selections, dynamic insertions, markdown, file-based content and nested dictionaries used for demonstration and testing purposes.",
316
317
  content: {
317
318
  baseContent: "Intlayer", // Content that no need to be i18n
318
319
  welcomeMessage: t({
@@ -342,6 +343,11 @@ const content = {
342
343
  female: "my content for female users",
343
344
  fallback: "my content when gender is not specified", // Optional but avoid undefined type
344
345
  }),
346
+ mySelect: select({
347
+ draft: "my content when the status is draft",
348
+ published: "my content when the status is published",
349
+ fallback: "my content for any other status", // Optional but avoid undefined type
350
+ }),
345
351
  myInsertion: insert(
346
352
  "Hello, my name is {{name}} and I am {{age}} years old!"
347
353
  ),
@@ -90,8 +90,8 @@ The [Intlayer Compiler](https://intlayer.org/doc/compiler.md) can extract all yo
90
90
  - [Next.js 14](https://intlayer.org/doc/environment/nextjs/14.md)
91
91
  - [Next.js 15](https://intlayer.org/doc/environment/nextjs/15.md)
92
92
  - [Next.js with Page Router](https://intlayer.org/doc/environment/nextjs/next-with-page-router.md)
93
- - [Intlayer with next-intl](https://intlayer.org/doc/next-intl.md)
94
- - [Intlayer with next-i18next](https://intlayer.org/doc/next-i18next.md)
93
+ - [Intlayer with next-intl](https://intlayer.org/doc/migration/next-intl.md)
94
+ - [Intlayer with next-i18next](https://intlayer.org/doc/migration/next-i18next.md)
95
95
 
96
96
  ### Concepts
97
97
 
@@ -19,7 +19,7 @@ To use Intlayer effectively:
19
19
  1. **Retrieve Locales**: Check `intlayer.config.{ts,js,json,json5,jsonc,cjs,mjs}`, `.intlayerrc` to see the configured locales.
20
20
 
21
21
  2. **Declare Content**:
22
- We recommend creating one content declaration file per component, located alongside the component file. This keeps translations close to the code.
22
+ We recommend creating one content declaration file per component or per section of your application, located alongside the component file. This keeps translations close to the code.
23
23
 
24
24
  3. **Consume Content**: Use the provided hooks and functions to access your content.
25
25
  - [Intlayer Exports](https://intlayer.org/doc/packages/intlayer/exports.md)
@@ -19,11 +19,13 @@ const require_loadDictionaries_loadDictionaries = require('./loadDictionaries/lo
19
19
  const require_loadDictionaries_loadLocalDictionaries = require('./loadDictionaries/loadLocalDictionaries.cjs');
20
20
  const require_writeConfiguration_index = require('./writeConfiguration/index.cjs');
21
21
  const require_prepareIntlayer = require('./prepareIntlayer.cjs');
22
+ const require_prepareIntlayerServer = require('./prepareIntlayerServer.cjs');
22
23
  const require_writeContentDeclaration_detectExportedComponentName = require('./writeContentDeclaration/detectExportedComponentName.cjs');
23
24
  const require_writeContentDeclaration_transformJSFile = require('./writeContentDeclaration/transformJSFile.cjs');
24
25
  const require_writeContentDeclaration_writeJSFile = require('./writeContentDeclaration/writeJSFile.cjs');
25
26
  const require_writeContentDeclaration_writeContentDeclaration = require('./writeContentDeclaration/writeContentDeclaration.cjs');
26
27
 
28
+ exports.INTLAYER_WATCH_ENV_VAR = require_prepareIntlayerServer.INTLAYER_WATCH_ENV_VAR;
27
29
  exports.buildDictionary = require_buildIntlayerDictionary_buildIntlayerDictionary.buildDictionary;
28
30
  exports.cleanOutputDir = require_cleanOutputDir.cleanOutputDir;
29
31
  exports.createDictionaryEntryPoint = require_createDictionaryEntryPoint_createDictionaryEntryPoint.createDictionaryEntryPoint;
@@ -46,6 +48,8 @@ exports.getBuiltDynamicDictionariesPath = require_createDictionaryEntryPoint_get
46
48
  exports.getBuiltFetchDictionariesPath = require_createDictionaryEntryPoint_getBuiltFetchDictionariesPath.getBuiltFetchDictionariesPath;
47
49
  exports.getBuiltRemoteDictionariesPath = require_createDictionaryEntryPoint_getBuiltRemoteDictionariesPath.getBuiltRemoteDictionariesPath;
48
50
  exports.getBuiltUnmergedDictionariesPath = require_createDictionaryEntryPoint_getBuiltUnmergedDictionariesPath.getBuiltUnmergedDictionariesPath;
51
+ exports.getIsDevWatcherCommand = require_prepareIntlayerServer.getIsDevWatcherCommand;
52
+ exports.getIsServerDevelopment = require_prepareIntlayerServer.getIsServerDevelopment;
49
53
  exports.getTypeName = require_createType_createModuleAugmentation.getTypeName;
50
54
  exports.isCachedConfigurationUpToDate = require_writeConfiguration_index.isCachedConfigurationUpToDate;
51
55
  exports.loadContentDeclaration = require_loadDictionaries_loadContentDeclaration.loadContentDeclaration;
@@ -54,6 +58,7 @@ exports.loadDictionaries = require_loadDictionaries_loadDictionaries.loadDiction
54
58
  exports.loadLocalDictionaries = require_loadDictionaries_loadLocalDictionaries.loadLocalDictionaries;
55
59
  exports.loadRemoteDictionaries = require_loadDictionaries_loadRemoteDictionaries.loadRemoteDictionaries;
56
60
  exports.prepareIntlayer = require_prepareIntlayer.prepareIntlayer;
61
+ exports.prepareIntlayerServer = require_prepareIntlayerServer.prepareIntlayerServer;
57
62
  exports.processContentDeclaration = require_buildIntlayerDictionary_processContentDeclaration.processContentDeclaration;
58
63
  exports.readDictionariesFromDisk = require_utils_readDictionariesFromDisk.readDictionariesFromDisk;
59
64
  exports.transformJSFile = require_writeContentDeclaration_transformJSFile.transformJSFile;
package/dist/cjs/cli.cjs CHANGED
@@ -33,6 +33,7 @@ exports.detectExportedComponentName = require_writeContentDeclaration_detectExpo
33
33
  exports.detectFormatCommand = require_detectFormatCommand.detectFormatCommand;
34
34
  exports.detectPackageManager = require_init_utils_packageManager.detectPackageManager;
35
35
  exports.enableEditorInConfig = require_init_cms.enableEditorInConfig;
36
+ exports.findLockFileDir = require_init_utils_packageManager.findLockFileDir;
36
37
  exports.getContentDeclarationFileTemplate = require_getContentDeclarationFileTemplate_getContentDeclarationFileTemplate.getContentDeclarationFileTemplate;
37
38
  exports.getDefaultApplicationURL = require_init_index.getDefaultApplicationURL;
38
39
  exports.getDocumentationUrl = require_init_documentationRouter.getDocumentationUrl;
@@ -6,7 +6,7 @@ const require_init_cms = require('./cms.cjs');
6
6
  const require_initConfig_index = require('../initConfig/index.cjs');
7
7
  const require_init_documentationRouter = require('./documentationRouter.cjs');
8
8
  const require_init_frameworkSetup_index = require('./frameworkSetup/index.cjs');
9
- const require_init_utils_devScript = require('./utils/devScript.cjs');
9
+ const require_init_utils_backendPackages = require('./utils/backendPackages.cjs');
10
10
  const require_init_utils_packageManager = require('./utils/packageManager.cjs');
11
11
  const require_init_utils_githubActions = require('./utils/githubActions.cjs');
12
12
  const require_init_utils_jsonParser = require('./utils/jsonParser.cjs');
@@ -398,16 +398,6 @@ const initIntlayer = async (rootDir, options) => {
398
398
  (0, _intlayer_config_logger.logger)(`${_intlayer_config_logger.v} Created ${(0, _intlayer_config_logger.colorizePath)(newMetroConfigFile)} with the Intlayer Metro plugin`);
399
399
  }
400
400
  }
401
- const newDevScript = require_init_utils_devScript.resolveDevScript({
402
- devScript: packageJson.scripts?.dev,
403
- allDeps,
404
- isNextJsProject
405
- });
406
- if (newDevScript) {
407
- packageJson.scripts.dev = newDevScript;
408
- await require_init_utils_fileSystem.writeFileToRoot(rootDir, packageJsonPath, JSON.stringify(packageJson, null, 2));
409
- (0, _intlayer_config_logger.logger)(`${_intlayer_config_logger.v} Updated ${(0, _intlayer_config_logger.colorizePath)("package.json")} dev script to run intlayer watch`);
410
- }
411
401
  for (const file of [
412
402
  "webpack.config.js",
413
403
  "webpack.config.ts",
@@ -424,7 +414,7 @@ const initIntlayer = async (rootDir, options) => {
424
414
  "@adonisjs/core",
425
415
  "hono",
426
416
  "elysia",
427
- ...require_init_utils_devScript.BACKEND_INTLAYER_PACKAGES
417
+ ...require_init_utils_backendPackages.BACKEND_INTLAYER_PACKAGES
428
418
  ].some((pkg) => allDeps[pkg])) hasAliasConfiguration = true;
429
419
  if (!hasAliasConfiguration) {
430
420
  const configuration = (0, _intlayer_config_node.getConfiguration)({ baseDir: rootDir });
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["colorize","ANSIColors","exists","x","colorizePath","readFileFromRoot","getDocumentationUrl","moveCompatPackagesToDevDependencies","writeFileToRoot","v","detectPackageManager","detectLinguiCatalogPattern","detectMissingIntlayerPackages","isIntlayerPackageName","upgradeIntlayerPackages","resolveGithubWorkflowsContext","getGithubWorkflows","ensureDirectory","join","parseJSONWithComments","hasLegacyEslint","LINT_PLUGIN_PACKAGE_NAME","DocumentationRouter","hasLintTooling","addIntlayerRulesToOxlintConfig","findTsConfigFiles","detectJsonLocalePattern","initConfig","setCompilerOutputInConfig","detectNextIntlMessagesPattern","updateIntlayerConfigWithSyncPlugin","hasUrlRoutingFramework","detectCompatI18nLibraries","setRoutingStorageOnlyInConfig","ROUTING_MODE","setRoutingModeInConfig","setEnableProxyInConfig","replaceViteConfigPluginImportSource","updateViteConfigForCompatPlugin","hasIntlayerVitePlugin","updateViteConfig","updateNextConfigForNextI18next","updateNextConfigForNextIntl","updateNextConfigForNextTranslate","updateNextConfig","setupNextCompilerBabelConfig","updateAstroConfig","updateNuxtConfigForNuxtjsI18n","updateNuxtConfig","updateMetroConfig","getMetroConfigTemplate","resolveDevScript","BACKEND_INTLAYER_PACKAGES","getConfiguration","getAlias","setupFramework"],"sources":["../../../src/init/index.ts"],"sourcesContent":["import { join } from 'node:path';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport { ROUTING_MODE } from '@intlayer/config/defaultValues';\nimport { colorize, colorizePath, logger, v, x } from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { getAlias } from '@intlayer/config/utils';\nimport { initConfig } from '../initConfig';\nimport {\n setCompilerOutputInConfig,\n setEnableProxyInConfig,\n setRoutingModeInConfig,\n setRoutingStorageOnlyInConfig,\n} from './cms';\nimport {\n DocumentationRouter,\n type DocumentationRouterType,\n getDocumentationUrl,\n} from './documentationRouter';\nimport { setupFramework } from './frameworkSetup';\nimport { upgradeIntlayerPackages } from './upgradeIntlayerPackages';\nimport type { CompatSyncConfig, RoutingMode } from './utils';\nimport {\n addIntlayerRulesToOxlintConfig,\n BACKEND_INTLAYER_PACKAGES,\n detectCompatI18nLibraries,\n detectJsonLocalePattern,\n detectLinguiCatalogPattern,\n detectMissingIntlayerPackages,\n detectNextIntlMessagesPattern,\n detectPackageManager,\n ensureDirectory,\n exists,\n findTsConfigFiles,\n getGithubWorkflows,\n getMetroConfigTemplate,\n hasIntlayerVitePlugin,\n hasLegacyEslint,\n hasLintTooling,\n hasUrlRoutingFramework,\n installPackages,\n isIntlayerPackageName,\n LINT_PLUGIN_PACKAGE_NAME,\n MINIMUM_ESLINT_MAJOR,\n moveCompatPackagesToDevDependencies,\n type OxlintConfig,\n parseJSONWithComments,\n readFileFromRoot,\n replaceViteConfigPluginImportSource,\n resolveDevScript,\n resolveGithubWorkflowsContext,\n setupNextCompilerBabelConfig,\n updateAstroConfig,\n updateIntlayerConfigWithSyncPlugin,\n updateMetroConfig,\n updateNextConfig,\n updateNextConfigForNextI18next,\n updateNextConfigForNextIntl,\n updateNextConfigForNextTranslate,\n updateNuxtConfig,\n updateNuxtConfigForNuxtjsI18n,\n updateViteConfig,\n updateViteConfigForCompatPlugin,\n writeFileToRoot,\n} from './utils';\n\nexport {\n DocumentationRouter,\n type DocumentationRouterType,\n getDocumentationUrl,\n};\n\n/**\n * Resolves the default dev-server URL of the detected framework, used as the\n * `editor.applicationURL` of the generated configuration file. Frameworks that\n * embed Vite (Astro, SvelteKit, …) are checked before the bare Vite fallback so\n * their own dev port wins.\n */\nexport const getDefaultApplicationURL = (\n dependencies: Record<string, string>\n): string => {\n if (dependencies.next) return 'http://localhost:3000';\n if (dependencies.astro) return 'http://localhost:4321';\n if (dependencies['@angular/core']) return 'http://localhost:4200';\n if (dependencies.nuxt) return 'http://localhost:3000';\n if (dependencies['@sveltejs/kit']) return 'http://localhost:5173';\n if (dependencies['react-scripts']) return 'http://localhost:3000';\n if (dependencies.vite) return 'http://localhost:5173';\n\n return 'http://localhost:3000';\n};\n\n/**\n * How the interactive init organizes autogenerated content (compiler output /\n * autofill):\n * - `per-component` — multilingual `.content` files co-located with components\n * (the configuration template default).\n * - `centralized` — per-locale JSON dictionaries under `/locales/{locale}/`.\n * - `json-namespaces` — plain per-locale JSON namespace files kept in sync\n * through `@intlayer/sync-json-plugin`.\n */\nexport type ContentStrategy =\n | 'per-component'\n | 'centralized'\n | 'json-namespaces';\n\n/**\n * OPTIONS\n */\nexport type InitOptions = {\n noGitignore?: boolean;\n /** Skip scaffolding the `fill` and `test` GitHub Actions workflows. */\n noGithubActions?: boolean;\n /**\n * Skip installing missing Intlayer dependencies and upgrading the Intlayer\n * packages of every `package.json` to their latest version.\n */\n noInstallPackages?: boolean;\n /** Skip adding the Intlayer extension to `.vscode/extensions.json`. */\n noVscodeExtension?: boolean;\n /** Skip writing the Intlayer LSP configuration to `.vscode/settings.json`. */\n noLsp?: boolean;\n /** Skip enabling the Intlayer lint rules (ESLint / oxlint). */\n noEslint?: boolean;\n /**\n * Skip the project setup: tsconfig types/aliases, the Intlayer config file,\n * bundler/framework configs, the dev script and framework-specific\n * scaffolding (middleware/proxy, providers in layout/page). Defaults to\n * enabled.\n */\n noFrameworkSetup?: boolean;\n /** Skip logging the final success message and documentation link. */\n skipFinalMessage?: boolean;\n /**\n * Version to install the missing Intlayer packages at (typically the running\n * CLI version). Already declared Intlayer packages are upgraded to the latest\n * published version instead.\n */\n upgradeToVersion?: string;\n /**\n * Locale routing strategy to write to `routing.mode` in the generated/existing\n * Intlayer configuration file. When omitted, the configuration default\n * (`prefix-no-default`) is kept.\n */\n routingMode?: RoutingMode;\n /**\n * Whether the app routes by locale through the Intlayer proxy (middleware).\n * Written to `routing.enableProxy` in the configuration file and drives the\n * framework scaffolding: `false` skips the proxy file and any locale route\n * segment. When omitted, the configured value is kept (unset means enabled).\n */\n enableProxy?: boolean;\n /**\n * Content organization strategy chosen by the interactive init prompt. Drives\n * the `compiler.output` template (`centralized`) or the injection of the\n * syncJSON plugin (`json-namespaces`). When omitted (or `per-component`), the\n * configuration template default is kept.\n */\n contentStrategy?: ContentStrategy;\n};\n\n/**\n * MAIN LOGIC\n */\nexport const initIntlayer = async (rootDir: string, options?: InitOptions) => {\n logger(colorize('Checking Intlayer configuration...', ANSIColors.CYAN));\n\n // READ PACKAGE.JSON\n const packageJsonPath = 'package.json';\n if (!(await exists(rootDir, packageJsonPath))) {\n logger(\n `${x} No ${colorizePath('package.json')} found. Please run this script from the project root.`,\n { level: 'error' }\n );\n process.exit(1);\n }\n\n const packageJsonContent = await readFileFromRoot(rootDir, packageJsonPath);\n let packageJson: Record<string, any>;\n try {\n packageJson = JSON.parse(packageJsonContent);\n } catch {\n logger(`${x} Could not parse ${colorizePath('package.json')}.`, {\n level: 'error',\n });\n process.exit(1);\n }\n\n // Determine the correct documentation URL based on dependencies\n const guideUrl = getDocumentationUrl(packageJson);\n\n const allDeps: Record<string, string> = {\n ...(packageJson.dependencies ?? {}),\n ...(packageJson.devDependencies ?? {}),\n };\n\n // MOVE COMPAT PACKAGES (e.g. next-intl) REPLACED BY @INTLAYER/* TO DEVDEPENDENCIES\n const movedPackages = moveCompatPackagesToDevDependencies(packageJson);\n if (movedPackages.length > 0) {\n const indentation = packageJsonContent.match(/^[ \\t]+(?=\")/m)?.[0] ?? 2;\n const trailingNewline = packageJsonContent.endsWith('\\n') ? '\\n' : '';\n await writeFileToRoot(\n rootDir,\n packageJsonPath,\n `${JSON.stringify(packageJson, null, indentation)}${trailingNewline}`\n );\n for (const pkg of movedPackages) {\n logger(\n `${v} Moved ${colorize(pkg, ANSIColors.MAGENTA)} from dependencies to devDependencies`\n );\n }\n }\n\n // INSTALL MISSING INTLAYER DEPENDENCIES\n const packageManager = detectPackageManager(rootDir);\n\n // lingui keeps its catalogs as `.po` (default) or `.json`. Detect which so the\n // matching sync plugin (`syncPO` / `syncJSON`) + dev dependency are chosen.\n const linguiPresent = Boolean(\n allDeps['@lingui/core'] ||\n allDeps['@lingui/react'] ||\n allDeps['@intlayer/lingui']\n );\n\n const linguiCatalog = linguiPresent\n ? await detectLinguiCatalogPattern(rootDir)\n : null;\n\n // `linguiCatalogFormat` resolution:\n // 1. Filesystem scan result (authoritative when catalogs already exist)\n // 2. Fallback: 'po' (lingui's default) when lingui is installed but no\n // catalogs have been generated yet.\n const linguiCatalogFormat: 'po' | 'json' | null =\n linguiCatalog?.format ?? (linguiPresent ? 'po' : null);\n\n const {\n packagesToInstall,\n devPackagesToInstall,\n compatSyncConfig,\n compatVitePluginConfig,\n pendingCompatAdapters,\n } = detectMissingIntlayerPackages(allDeps, {\n linguiCatalogFormat,\n dependencies: packageJson.dependencies,\n devDependencies: packageJson.devDependencies,\n });\n\n /** Whether the compat adapter for a library is not released yet. */\n const isCompatAdapterPending = (adapterPackage: string): boolean =>\n pendingCompatAdapters.includes(adapterPackage);\n\n if (pendingCompatAdapters.length > 0) {\n logger(\n `${x} No released Intlayer adapter yet for ${pendingCompatAdapters\n .map((adapterPackage) => colorize(adapterPackage, ANSIColors.MAGENTA))\n .join(\n ', '\n )} — keeping your current i18n library and only syncing its catalogs with Intlayer.`,\n { level: 'warn' }\n );\n }\n\n // The `json-namespaces` content strategy uses the same syncJSON pipeline as\n // the compat libraries: plain per-locale JSON namespace files synced through\n // `@intlayer/sync-json-plugin`. A detected compat library keeps precedence —\n // its own catalog format/template is authoritative.\n const wantsJsonNamespaces =\n options?.contentStrategy === 'json-namespaces' && !compatSyncConfig;\n\n if (\n wantsJsonNamespaces &&\n !allDeps['@intlayer/sync-json-plugin'] &&\n !devPackagesToInstall.includes('@intlayer/sync-json-plugin')\n ) {\n devPackagesToInstall.push('@intlayer/sync-json-plugin');\n }\n\n if (!options?.noInstallPackages) {\n const withVersion = (packages: string[]): string[] =>\n options?.upgradeToVersion\n ? packages.map((pkg) =>\n isIntlayerPackageName(pkg)\n ? `${pkg}@${options.upgradeToVersion}`\n : pkg\n )\n : packages;\n\n if (packagesToInstall.length > 0) {\n logger(\n colorize('Installing missing Intlayer dependencies...', ANSIColors.CYAN)\n );\n try {\n installPackages(\n rootDir,\n withVersion(packagesToInstall),\n packageManager\n );\n logger(\n `${v} Installed: ${packagesToInstall.map((pkg) => colorize(pkg, ANSIColors.MAGENTA)).join(', ')}`\n );\n } catch {\n logger(\n `${x} Failed to install packages. Please install manually: ${packagesToInstall.join(' ')}`,\n { level: 'warn' }\n );\n }\n }\n\n if (devPackagesToInstall.length > 0) {\n logger(\n colorize(\n 'Installing missing Intlayer dev dependencies...',\n ANSIColors.CYAN\n )\n );\n try {\n installPackages(\n rootDir,\n withVersion(devPackagesToInstall),\n packageManager,\n true\n );\n logger(\n `${v} Installed: ${devPackagesToInstall.map((pkg) => colorize(pkg, ANSIColors.MAGENTA)).join(', ')}`\n );\n } catch {\n logger(\n `${x} Failed to install dev packages. Please install manually: ${devPackagesToInstall.join(' ')}`,\n { level: 'warn' }\n );\n }\n }\n\n // UPGRADE INTLAYER DEPENDENCIES TO LATEST\n await upgradeIntlayerPackages(rootDir);\n }\n\n // CHECK .GITIGNORE\n const gitignorePath = '.gitignore';\n if (\n !options?.noGitignore &&\n !options?.noFrameworkSetup &&\n (await exists(rootDir, gitignorePath))\n ) {\n const gitignoreContent = await readFileFromRoot(rootDir, gitignorePath);\n\n if (!gitignoreContent.includes('intlayer')) {\n const newContent = `${gitignoreContent}\\n# Intlayer\\n.intlayer\\n`;\n await writeFileToRoot(rootDir, gitignorePath, newContent);\n logger(\n `${v} Added ${colorizePath('.intlayer')} to ${colorizePath(gitignorePath)}`\n );\n } else {\n logger(`${v} ${colorizePath(gitignorePath)} already includes .intlayer`);\n }\n }\n\n // SCAFFOLD GITHUB ACTIONS WORKFLOWS (fill + test)\n // Generate two workflows whose commands match the detected package manager:\n // - intlayer-fill.yml: auto-fills missing translations on pull requests\n // - intlayer-test.yml: fails the PR when required locales are missing\n // Every command runs with `--ci`, which iterates over the Intlayer\n // project(s) of the repository. GitHub only triggers workflows stored at the\n // repository root, so in a monorepo the files are written to the git root\n // (see resolveGithubWorkflowsContext).\n if (!options?.noGithubActions) {\n const workflowsContext = await resolveGithubWorkflowsContext(\n rootDir,\n packageManager\n );\n const workflows = getGithubWorkflows(\n workflowsContext.packageManager,\n workflowsContext.options\n );\n\n for (const workflow of workflows) {\n if (await exists(workflowsContext.workflowsRootDir, workflow.filePath)) {\n logger(`${v} ${colorizePath(workflow.filePath)} already exists`);\n continue;\n }\n\n try {\n await ensureDirectory(\n workflowsContext.workflowsRootDir,\n join('.github', 'workflows')\n );\n await writeFileToRoot(\n workflowsContext.workflowsRootDir,\n workflow.filePath,\n workflow.content\n );\n logger(\n `${v} Added GitHub Actions workflow ${colorizePath(workflow.filePath)}`\n );\n } catch {\n logger(\n `${x} Could not create ${colorizePath(workflow.filePath)}. You may need to add it manually.`,\n { level: 'warn' }\n );\n }\n }\n }\n\n // CHECK VS CODE EXTENSION RECOMMENDATIONS\n const vscodeDir = '.vscode';\n const extensionsJsonPath = join(vscodeDir, 'extensions.json');\n const extensionId = 'intlayer.intlayer-vs-code-extension';\n\n if (!options?.noVscodeExtension) {\n try {\n let extensionsConfig: { recommendations: string[] } = {\n recommendations: [],\n };\n\n if (await exists(rootDir, extensionsJsonPath)) {\n const content = await readFileFromRoot(rootDir, extensionsJsonPath);\n extensionsConfig = parseJSONWithComments(content);\n } else {\n await ensureDirectory(rootDir, vscodeDir);\n }\n\n if (!extensionsConfig.recommendations) {\n extensionsConfig.recommendations = [];\n }\n\n if (!extensionsConfig.recommendations.includes(extensionId)) {\n extensionsConfig.recommendations.push(extensionId);\n await writeFileToRoot(\n rootDir,\n extensionsJsonPath,\n JSON.stringify(extensionsConfig, null, 2)\n );\n logger(\n `${v} Added ${colorize(extensionId, ANSIColors.MAGENTA)} to ${colorizePath(extensionsJsonPath)}`\n );\n } else {\n logger(\n `${v} ${colorizePath(extensionsJsonPath)} already includes ${colorize(extensionId, ANSIColors.MAGENTA)}`\n );\n }\n } catch {\n logger(\n `${x} Could not update ${colorizePath(extensionsJsonPath)}. You may need to add ${colorize(extensionId, ANSIColors.MAGENTA)} manually.`,\n { level: 'warn' }\n );\n }\n }\n\n // CHECK VS CODE LSP SETTINGS\n const settingsJsonPath = join(vscodeDir, 'settings.json');\n\n if (!options?.noLsp) {\n try {\n let settingsConfig: Record<string, unknown> = {};\n\n if (await exists(rootDir, settingsJsonPath)) {\n const content = await readFileFromRoot(rootDir, settingsJsonPath);\n settingsConfig = parseJSONWithComments(content);\n } else {\n await ensureDirectory(rootDir, vscodeDir);\n }\n\n let settingsUpdated = false;\n\n if (!settingsConfig['intlayer.languageServer.command']) {\n settingsConfig['intlayer.languageServer.command'] = 'npx';\n settingsUpdated = true;\n }\n\n if (!settingsConfig['intlayer.languageServer.args']) {\n settingsConfig['intlayer.languageServer.args'] = ['@intlayer/lsp'];\n settingsUpdated = true;\n }\n\n if (settingsUpdated) {\n await writeFileToRoot(\n rootDir,\n settingsJsonPath,\n JSON.stringify(settingsConfig, null, 2)\n );\n logger(\n `${v} Updated ${colorizePath(settingsJsonPath)} with LSP configuration`\n );\n } else {\n logger(\n `${v} ${colorizePath(settingsJsonPath)} already includes LSP configuration`\n );\n }\n } catch {\n logger(\n `${x} Could not update ${colorizePath(settingsJsonPath)}. You may need to add the LSP settings manually.`,\n { level: 'warn' }\n );\n }\n }\n\n // CHECK LINT RULES (eslint-plugin-intlayer)\n //\n // Gated on the project already having a linter installed: with no ESLint or\n // oxlint there is nothing to plug the rules into, and the guidance below\n // would just be noise. The same check gates the install in\n // `detectMissingIntlayerPackages`, so the two never disagree.\n //\n // Only the oxlint config is patched here: `.oxlintrc.json` is plain JSON and\n // safe to edit, whereas an ESLint flat config is arbitrary JavaScript that\n // cannot be rewritten reliably — that one is left to the user, with the\n // snippet printed below.\n if (!options?.noEslint && hasLegacyEslint(allDeps)) {\n logger(\n `${x} ${colorize(LINT_PLUGIN_PACKAGE_NAME, ANSIColors.MAGENTA)} needs ESLint ${MINIMUM_ESLINT_MAJOR}+ (flat config) — skipped the Intlayer lint rules. Upgrade ESLint to enable them: ${colorizePath(DocumentationRouter.ESLint)}`,\n { level: 'warn' }\n );\n }\n\n if (!options?.noEslint && hasLintTooling(allDeps)) {\n const oxlintConfigPath = '.oxlintrc.json';\n const hasOxlintConfig = await exists(rootDir, oxlintConfigPath);\n // An oxlint-only project without a config gets one; with ESLint around,\n // the rules go into the ESLint config instead.\n const shouldCreateOxlintConfig =\n !hasOxlintConfig && Boolean(allDeps.oxlint) && !allDeps.eslint;\n\n if (hasOxlintConfig || shouldCreateOxlintConfig) {\n try {\n const oxlintConfig: OxlintConfig = hasOxlintConfig\n ? parseJSONWithComments(\n await readFileFromRoot(rootDir, oxlintConfigPath)\n )\n : {};\n\n if (addIntlayerRulesToOxlintConfig(oxlintConfig)) {\n await writeFileToRoot(\n rootDir,\n oxlintConfigPath,\n JSON.stringify(oxlintConfig, null, 2)\n );\n logger(\n `${v} ${hasOxlintConfig ? 'Added the Intlayer lint rules to' : 'Created'} ${colorizePath(oxlintConfigPath)}`\n );\n } else {\n logger(\n `${v} ${colorizePath(oxlintConfigPath)} already includes the Intlayer lint rules`\n );\n }\n } catch {\n logger(\n `${x} Could not update ${colorizePath(oxlintConfigPath)}. You may need to add ${colorize(LINT_PLUGIN_PACKAGE_NAME, ANSIColors.MAGENTA)} manually.`,\n { level: 'warn' }\n );\n }\n } else {\n // ESLint flat config — print the snippet instead of rewriting the file.\n logger([\n colorize('Intlayer lint rules →', ANSIColors.MAGENTA),\n colorize(\n `Add the ${LINT_PLUGIN_PACKAGE_NAME} preset to the array your ESLint flat config exports, to catch hardcoded text and dynamic calls the compiler cannot optimize:`,\n ANSIColors.GREY_LIGHT\n ),\n colorize(\n ` import intlayer from '${LINT_PLUGIN_PACKAGE_NAME}';\\n\\n export default [\\n // ...your existing config\\n ...intlayer.configs.recommended,\\n ];`,\n ANSIColors.GREY_LIGHT\n ),\n colorizePath(DocumentationRouter.ESLint),\n ]);\n }\n }\n\n // PROJECT SETUP\n // Everything below edits the project itself: tsconfig types and aliases, the\n // Intlayer config file, bundler/framework configs, the dev script and the\n // framework scaffolding. It only runs with the framework setup step, so\n // picking e.g. only the CI or editor steps never creates project files.\n if (!options?.noFrameworkSetup) {\n // CHECK TSCONFIGS\n const tsConfigFiles = await findTsConfigFiles(rootDir);\n let hasTsConfig = false;\n\n for (const fileName of tsConfigFiles) {\n if (await exists(rootDir, fileName)) {\n hasTsConfig = true;\n try {\n const fileContent = await readFileFromRoot(rootDir, fileName);\n const config = parseJSONWithComments(fileContent);\n const typeDefinition = './.intlayer/**/*.ts';\n\n let updated = false;\n\n if (!config.include) {\n // Skip if no include array (solution-style)\n } else if (\n Array.isArray(config.include) &&\n !(config.include as string[]).some((pattern: string) =>\n pattern.includes('.intlayer')\n )\n ) {\n config.include.push(typeDefinition);\n updated = true;\n } else if (config.include.includes(typeDefinition)) {\n logger(\n `${v} ${colorizePath(fileName)} already includes intlayer types`\n );\n }\n\n if (updated) {\n await writeFileToRoot(\n rootDir,\n fileName,\n JSON.stringify(config, null, 2)\n );\n logger(\n `${v} Updated ${colorizePath(fileName)} to include intlayer types`\n );\n }\n } catch {\n logger(\n `${x} Could not parse or update ${colorizePath(fileName)}. You may need to add ${colorizePath('.intlayer/types/**/*.ts')} manually.`,\n { level: 'warn' }\n );\n }\n }\n }\n\n // INITIALIZE CONFIG FILE\n const format = hasTsConfig ? 'intlayer.config.ts' : 'intlayer.config.mjs';\n\n // Detect the locale JSON file pattern already in the project so we can\n // insert the matching locales into the config and produce the most\n // accurate source template for compat libraries.\n const detectedPattern = await detectJsonLocalePattern(rootDir);\n\n const isConfigCreated = await initConfig(format, rootDir, {\n locales: detectedPattern?.locales,\n applicationURL: getDefaultApplicationURL(allDeps),\n });\n\n // APPLY CONTENT STRATEGY — CENTRALIZED\n // Point `compiler.output` at per-locale JSON dictionaries under `/locales/`\n // instead of the per-component template default.\n if (options?.contentStrategy === 'centralized') {\n await setCompilerOutputInConfig(\n rootDir,\n '/locales/{{locale}}/{{key}}.content.json'\n );\n }\n\n // INJECT SYNC-JSON PLUGIN FOR COMPAT LIBRARIES / JSON-NAMESPACES STRATEGY\n const syncConfigToInject: CompatSyncConfig | undefined =\n compatSyncConfig ??\n (wantsJsonNamespaces\n ? {\n format: 'i18next',\n sourceTemplate:\n detectedPattern?.template ?? './locales/${locale}/${key}.json',\n }\n : undefined);\n\n if (syncConfigToInject) {\n // For next-intl / use-intl, the messages path is authoritatively declared\n // in `i18n/request.ts` (e.g. `import(`../messages/${locale}.json`)`), so we\n // read it directly. It usually resolves to a single file per locale (no\n // `${key}` segment), whose first-level keys are namespaces — so the compat\n // config carries `splitKeys: true` to emit one dictionary per namespace.\n // Falls back to file-system globbing otherwise.\n const nextIntlMessagesPattern =\n allDeps['next-intl'] ||\n allDeps['@intlayer/next-intl'] ||\n allDeps['use-intl'] ||\n allDeps['@intlayer/use-intl']\n ? await detectNextIntlMessagesPattern(rootDir)\n : null;\n\n // lingui authoritatively resolves to `…/{locale}/messages.{po,json}`, where\n // the `messages` filename becomes the dictionary key. Prefer it so a `.po`\n // project gets `syncPO` (the generic JSON glob only sees `.json`).\n const sourceTemplate =\n linguiCatalog?.template ??\n nextIntlMessagesPattern?.template ??\n detectedPattern?.template;\n\n const resolvedSyncConfig = {\n ...syncConfigToInject,\n ...(sourceTemplate ? { sourceTemplate } : {}),\n };\n\n const syncPluginPackage =\n resolvedSyncConfig.plugin === 'po'\n ? '@intlayer/sync-po-plugin'\n : '@intlayer/sync-json-plugin';\n const syncPluginName =\n resolvedSyncConfig.plugin === 'po' ? 'syncPO' : 'syncJSON';\n\n // `splitKeys` only makes sense for a single file holding several namespaces.\n // If the resolved template addresses one namespace per file (`${key}`\n // segment), each file is already a single namespace — drop the flag so\n // syncJSON keeps one dictionary per file.\n if (\n resolvedSyncConfig.splitKeys &&\n resolvedSyncConfig.sourceTemplate.includes('${key}')\n ) {\n resolvedSyncConfig.splitKeys = false;\n }\n\n const intlayerConfigCandidates = [\n 'intlayer.config.ts',\n 'intlayer.config.mjs',\n 'intlayer.config.js',\n 'intlayer.config.cjs',\n ];\n\n for (const configFile of intlayerConfigCandidates) {\n if (await exists(rootDir, configFile)) {\n const configContent = await readFileFromRoot(rootDir, configFile);\n\n if (!configContent.includes(syncPluginPackage)) {\n const extension = configFile.split('.').pop()!;\n const updatedConfigContent = updateIntlayerConfigWithSyncPlugin(\n configContent,\n extension,\n resolvedSyncConfig\n );\n await writeFileToRoot(rootDir, configFile, updatedConfigContent);\n logger(\n `${v} Updated ${colorizePath(configFile)} with ${syncPluginName} compat plugin`\n );\n } else {\n logger(\n `${v} ${colorizePath(configFile)} already includes ${syncPluginName} plugin`\n );\n }\n break;\n }\n }\n }\n\n // APPLY ROUTING\n // An explicit choice (interactive prompt / `--routing`) is written to\n // `routing.mode` + `routing.enableProxy`. Without one, a freshly created\n // config is adapted to the project: frontends get prefix routing through\n // the proxy (the template ships it disabled), projects without URL routing\n // (backend, React Native…) keep only `routing.storage`. An existing config\n // is never rewritten without an explicit choice. A compat i18n library\n // owns the app routing, so its config keeps the template's disabled proxy:\n // compat bundler plugins wrap `intlayer()`, which would register it.\n const hasUrlRouting = hasUrlRoutingFramework(allDeps);\n const hasCompatI18nLibrary = detectCompatI18nLibraries(allDeps).length > 0;\n const shouldApplyDefaultRouting =\n isConfigCreated &&\n options?.routingMode === undefined &&\n !hasCompatI18nLibrary;\n\n if (shouldApplyDefaultRouting && !hasUrlRouting) {\n await setRoutingStorageOnlyInConfig(rootDir);\n }\n\n const routingMode =\n options?.routingMode ??\n (shouldApplyDefaultRouting && hasUrlRouting ? ROUTING_MODE : undefined);\n const enableProxy =\n options?.enableProxy ??\n (shouldApplyDefaultRouting && hasUrlRouting ? true : undefined);\n\n if (routingMode) {\n await setRoutingModeInConfig(rootDir, routingMode);\n }\n\n if (enableProxy !== undefined) {\n await setEnableProxyInConfig(rootDir, enableProxy);\n }\n\n let hasAliasConfiguration = false;\n\n // CHECK VITE CONFIG\n const viteConfigs = ['vite.config.ts', 'vite.config.js', 'vite.config.mjs'];\n\n for (const file of viteConfigs) {\n if (await exists(rootDir, file)) {\n hasAliasConfiguration = true;\n const content = await readFileFromRoot(rootDir, file);\n const extension = file.split('.').pop()!;\n\n if (compatVitePluginConfig) {\n const { replacesVitePlugin } = compatVitePluginConfig;\n\n if (content.includes(compatVitePluginConfig.pluginPackageSource)) {\n logger(\n `${v} ${colorizePath(file)} already includes ${compatVitePluginConfig.pluginPackageSource}`\n );\n } else if (\n replacesVitePlugin &&\n content.includes(replacesVitePlugin.fromPackageSource)\n ) {\n // Drop-in replacement: rewrite the original i18n vite plugin's import\n // source, keeping its binding and call site (e.g. lingui).\n const updatedContent = replaceViteConfigPluginImportSource(\n content,\n replacesVitePlugin.importName,\n replacesVitePlugin.fromPackageSource,\n compatVitePluginConfig.pluginPackageSource\n );\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to import ${replacesVitePlugin.importName} from ${compatVitePluginConfig.pluginPackageSource}`\n );\n } else {\n const updatedContent = updateViteConfigForCompatPlugin(\n content,\n extension,\n compatVitePluginConfig\n );\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include ${compatVitePluginConfig.pluginFunctionName} compat plugin`\n );\n }\n } else if (hasIntlayerVitePlugin(content)) {\n // A compat adapter plugin (e.g. `reactI18nextVitePlugin`) already wraps\n // `intlayer()` internally, so skip adding a redundant standalone plugin.\n logger(\n `${v} ${colorizePath(file)} already includes an Intlayer plugin`\n );\n } else {\n const updatedContent = updateViteConfig(content, extension);\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer plugin`\n );\n }\n break;\n }\n }\n\n // CHECK NEXT CONFIG\n const nextConfigs = ['next.config.js', 'next.config.mjs', 'next.config.ts'];\n let isNextJsProject = false;\n\n for (const file of nextConfigs) {\n if (await exists(rootDir, file)) {\n isNextJsProject = true;\n hasAliasConfiguration = true;\n const content = await readFileFromRoot(rootDir, file);\n const extension = file.split('.').pop()!;\n\n if (allDeps['next-i18next'] || allDeps['@intlayer/next-i18next']) {\n if (!content.includes('@intlayer/next-i18next')) {\n const updatedContent = updateNextConfigForNextI18next(\n content,\n extension\n );\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer next-i18next compat plugin`\n );\n } else {\n logger(\n `${v} ${colorizePath(file)} already includes @intlayer/next-i18next`\n );\n }\n } else if (allDeps['next-intl'] || allDeps['@intlayer/next-intl']) {\n if (!content.includes('@intlayer/next-intl/plugin')) {\n const updatedContent = updateNextConfigForNextIntl(\n content,\n extension\n );\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer next-intl compat plugin`\n );\n } else {\n logger(\n `${v} ${colorizePath(file)} already includes @intlayer/next-intl/plugin`\n );\n }\n } else if (isCompatAdapterPending('@intlayer/next-translate')) {\n logger(\n `${v} Kept ${colorizePath(file)} untouched (next-translate stays in charge)`\n );\n } else if (\n allDeps['next-translate'] ||\n allDeps['@intlayer/next-translate']\n ) {\n if (!content.includes('@intlayer/next-translate')) {\n const updatedContent = updateNextConfigForNextTranslate(\n content,\n extension\n );\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer next-translate compat plugin`\n );\n } else {\n logger(\n `${v} ${colorizePath(file)} already includes @intlayer/next-translate`\n );\n }\n } else if (!content.includes('next-intlayer')) {\n const updatedContent = updateNextConfig(content, extension);\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer plugin`\n );\n }\n break;\n }\n }\n\n // CHECK NEXT.JS COMPILER (BABEL)\n // When a Next.js project already uses Babel, install @intlayer/babel and print\n // the compiler + build-optimization plugins (extract, purge, minify, optimize)\n // to add. SWC projects need no setup: withIntlayer injects @intlayer/swc.\n if (isNextJsProject) {\n await setupNextCompilerBabelConfig({\n rootDir,\n packageManager,\n allDeps,\n skipInstall: Boolean(options?.noInstallPackages),\n });\n }\n\n // CHECK OTHER FRAMEWORKS CONFIG\n const astroConfigs = [\n 'astro.config.mjs',\n 'astro.config.js',\n 'astro.config.ts',\n 'astro.config.cjs',\n ];\n\n for (const file of astroConfigs) {\n if (await exists(rootDir, file)) {\n hasAliasConfiguration = true;\n\n if (file.startsWith('astro.config.')) {\n const content = await readFileFromRoot(rootDir, file);\n\n if (!content.includes('astro-intlayer')) {\n const extension = file.split('.').pop()!;\n const updatedContent = updateAstroConfig(content, extension);\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer integration`\n );\n }\n }\n break;\n }\n }\n\n const nuxtConfigs = ['nuxt.config.js', 'nuxt.config.ts'];\n for (const file of nuxtConfigs) {\n if (await exists(rootDir, file)) {\n hasAliasConfiguration = true;\n\n const content = await readFileFromRoot(rootDir, file);\n\n if (isCompatAdapterPending('@intlayer/nuxtjs-i18n')) {\n logger(\n `${v} Kept ${colorizePath(file)} untouched (@nuxtjs/i18n stays in charge)`\n );\n } else if (allDeps['@nuxtjs/i18n']) {\n if (!content.includes('@intlayer/nuxtjs-i18n')) {\n const updatedContent = updateNuxtConfigForNuxtjsI18n(content);\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include @intlayer/nuxtjs-i18n module`\n );\n } else {\n logger(\n `${v} ${colorizePath(file)} already includes @intlayer/nuxtjs-i18n`\n );\n }\n } else if (!content.includes('nuxt-intlayer')) {\n const updatedContent = updateNuxtConfig(content);\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer module`\n );\n }\n break;\n }\n }\n\n // CHECK METRO CONFIG (React Native / Expo)\n // Metro is the React Native bundler. The Intlayer Metro plugin\n // (`react-native-intlayer/metro`) handles dictionary aliasing and building.\n // When no config exists we scaffold one; when one exists we safely wrap its\n // exported config with `configMetroIntlayerSync`, leaving custom async\n // (IIFE) configs untouched so existing setups are never broken.\n const isReactNativeProject = Boolean(\n allDeps['react-native'] || allDeps.expo\n );\n\n if (isReactNativeProject) {\n // Metro resolves Intlayer aliases itself, so skip the alias fallback below.\n hasAliasConfiguration = true;\n\n const metroConfigs = [\n 'metro.config.js',\n 'metro.config.cjs',\n 'metro.config.mjs',\n 'metro.config.ts',\n ];\n\n let metroConfigFile: string | undefined;\n\n for (const file of metroConfigs) {\n if (await exists(rootDir, file)) {\n metroConfigFile = file;\n break;\n }\n }\n\n if (metroConfigFile) {\n const content = await readFileFromRoot(rootDir, metroConfigFile);\n\n if (content.includes('react-native-intlayer')) {\n logger(\n `${v} ${colorizePath(metroConfigFile)} already includes the Intlayer Metro plugin`\n );\n } else {\n const extension = metroConfigFile.split('.').pop()!;\n const updatedContent = updateMetroConfig(content, extension);\n\n if (updatedContent !== content) {\n await writeFileToRoot(rootDir, metroConfigFile, updatedContent);\n logger(\n `${v} Updated ${colorizePath(metroConfigFile)} to include the Intlayer Metro plugin`\n );\n } else {\n logger(\n `${x} Could not automatically update ${colorizePath(metroConfigFile)}. Wrap your exported config with ${colorize('configMetroIntlayer', ANSIColors.MAGENTA)}: ${colorizePath(DocumentationRouter.ReactNativeAndExpo)}`,\n { level: 'warn' }\n );\n }\n }\n } else {\n const newMetroConfigFile = 'metro.config.js';\n await writeFileToRoot(\n rootDir,\n newMetroConfigFile,\n getMetroConfigTemplate(Boolean(allDeps.expo))\n );\n logger(\n `${v} Created ${colorizePath(newMetroConfigFile)} with the Intlayer Metro plugin`\n );\n }\n }\n\n // UPDATE PACKAGE.JSON DEV SCRIPT\n // Only frameworks with no bundler plugin to host the content watcher get\n // their dev server wrapped; a Next.js app is always left alone. See\n // `resolveDevScript`.\n const newDevScript = resolveDevScript({\n devScript: packageJson.scripts?.dev,\n allDeps,\n isNextJsProject,\n });\n\n if (newDevScript) {\n packageJson.scripts.dev = newDevScript;\n\n await writeFileToRoot(\n rootDir,\n packageJsonPath,\n JSON.stringify(packageJson, null, 2)\n );\n\n logger(\n `${v} Updated ${colorizePath('package.json')} dev script to run intlayer watch`\n );\n }\n\n // CHECK WEBPACK CONFIG\n const webpackConfigs = [\n 'webpack.config.js',\n 'webpack.config.ts',\n 'webpack.config.mjs',\n 'webpack.config.cjs',\n ];\n\n for (const file of webpackConfigs) {\n if (await exists(rootDir, file)) {\n hasAliasConfiguration = true;\n logger(\n `${v} Found ${colorizePath(\n file\n )}. Make sure to configure aliases manually or use the Intlayer Webpack plugin.`\n );\n break;\n }\n }\n\n // The server frameworks themselves, alongside their Intlayer packages: a\n // project may be mid-setup and carry only one of the two.\n const backendConfigPackages = [\n 'express',\n 'fastify',\n '@adonisjs/core',\n 'hono',\n 'elysia',\n ...BACKEND_INTLAYER_PACKAGES,\n ];\n\n if (backendConfigPackages.some((pkg) => allDeps[pkg])) {\n hasAliasConfiguration = true;\n }\n\n if (!hasAliasConfiguration) {\n const configuration = getConfiguration({ baseDir: rootDir });\n // `tsconfig`/`jsconfig` `paths` and `package.json` `imports` both expect\n // explicitly relative specifiers, so bare relative paths get a `./` prefix.\n const aliases = getAlias({\n configuration,\n formatter: (value) =>\n value.startsWith('./') || value.startsWith('../')\n ? value\n : `./${value}`,\n });\n\n if (hasTsConfig && tsConfigFiles.length > 0) {\n const tsConfigPath =\n tsConfigFiles.find((file) => file === 'tsconfig.json') ||\n tsConfigFiles[0];\n\n if (tsConfigPath) {\n const tsConfigContent = await readFileFromRoot(rootDir, tsConfigPath);\n const config = parseJSONWithComments(tsConfigContent);\n\n config.compilerOptions ??= {};\n config.compilerOptions.paths ??= {};\n\n let updated = false;\n\n Object.entries(aliases).forEach(([alias, path]) => {\n if (!config.compilerOptions.paths[alias]) {\n config.compilerOptions.paths[alias] = [path];\n updated = true;\n }\n });\n\n if (updated) {\n await writeFileToRoot(\n rootDir,\n tsConfigPath,\n JSON.stringify(config, null, 2)\n );\n\n logger(\n `${v} Updated ${colorizePath(\n tsConfigPath\n )} to include Intlayer aliases`\n );\n }\n }\n } else {\n const jsConfigPath = 'jsconfig.json';\n\n if (await exists(rootDir, jsConfigPath)) {\n const jsConfigContent = await readFileFromRoot(rootDir, jsConfigPath);\n const config = parseJSONWithComments(jsConfigContent);\n\n config.compilerOptions ??= {};\n config.compilerOptions.paths ??= {};\n\n let updated = false;\n\n Object.entries(aliases).forEach(([alias, path]) => {\n if (!config.compilerOptions.paths[alias]) {\n config.compilerOptions.paths[alias] = [path];\n updated = true;\n }\n });\n\n if (updated) {\n await writeFileToRoot(\n rootDir,\n jsConfigPath,\n JSON.stringify(config, null, 2)\n );\n logger(\n `${v} Updated ${colorizePath(\n jsConfigPath\n )} to include Intlayer aliases`\n );\n }\n } else {\n packageJson.imports ??= {};\n\n let updated = false;\n\n Object.entries(aliases).forEach(([alias, path]) => {\n const importAlias = alias.replace('@', '#');\n\n if (!packageJson.imports[importAlias]) {\n packageJson.imports[importAlias] = path;\n updated = true;\n }\n });\n\n if (updated) {\n await writeFileToRoot(\n rootDir,\n packageJsonPath,\n JSON.stringify(packageJson, null, 2)\n );\n logger(\n `${v} Updated ${colorizePath(\n packageJsonPath\n )} to include Intlayer imports`\n );\n }\n }\n }\n }\n\n // FRAMEWORK-SPECIFIC SCAFFOLDING\n // Sets up middleware/proxy and wraps the layout/page with the Intlayer\n // providers for the detected framework (Next.js App Router today). Idempotent\n // and non-destructive: it never overwrites user code it cannot safely\n // transform, skipping with guidance instead.\n //\n // Skipped entirely when a compat i18n library drives the app (i18next,\n // next-intl, vue-i18n, …): the app already owns its routing, providers and\n // layouts, and Intlayer only syncs its catalogs — restructuring routes or\n // injecting providers would break the existing setup.\n const hasCompatLibrary = Boolean(\n compatSyncConfig || compatVitePluginConfig\n );\n\n if (hasCompatLibrary) {\n logger(\n `${v} Compat i18n library detected — keeping the app structure untouched (no route restructure, no provider injection)`\n );\n }\n\n if (!hasCompatLibrary) {\n try {\n // Prefer the user's choices, else the configured routing (mode defaults\n // to `prefix-no-default`, an unset `enableProxy` means enabled). Drives\n // the proxy file and the locale route segment the adapters scaffold.\n const { routing } = getConfiguration({ baseDir: rootDir });\n\n await setupFramework({\n rootDir,\n allDeps,\n packageManager,\n useTypeScript: hasTsConfig,\n routingMode: routingMode ?? routing.mode,\n enableProxy: enableProxy ?? routing.enableProxy !== false,\n });\n } catch {\n logger(\n `${x} Framework-specific scaffolding failed. Your existing files were left untouched; follow the documentation to finish the setup.`,\n { level: 'warn' }\n );\n }\n }\n }\n\n // FINAL SUCCESS MESSAGE\n if (!options?.skipFinalMessage) {\n logInitSuccessMessage(guideUrl);\n }\n\n return { guideUrl };\n};\n\nexport const logInitSuccessMessage = (guideUrl: string): void => {\n logger(`${v} ${colorize('Intlayer init setup complete.', ANSIColors.GREEN)}`);\n logger([\n colorize('Next →', ANSIColors.MAGENTA),\n colorize(\n 'Follow the instructions in the documentation to complete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IColors","exists","x","colorizePath","readFileFromRoot","getDocumentationUrl","moveCompatPackagesToDevDependencies","writeFileToRoot","v","detectPackageManager","detectLinguiCatalogPattern","detectMissingIntlayerPackages","isIntlayerPackageName","upgradeIntlayerPackages","resolveGithubWorkflowsContext","getGithubWorkflows","ensureDirectory","join","parseJSONWithComments","hasLegacyEslint","LINT_PLUGIN_PACKAGE_NAME","DocumentationRouter","hasLintTooling","addIntlayerRulesToOxlintConfig","findTsConfigFiles","detectJsonLocalePattern","initConfig","setCompilerOutputInConfig","detectNextIntlMessagesPattern","updateIntlayerConfigWithSyncPlugin","hasUrlRoutingFramework","detectCompatI18nLibraries","setRoutingStorageOnlyInConfig","ROUTING_MODE","setRoutingModeInConfig","setEnableProxyInConfig","replaceViteConfigPluginImportSource","updateViteConfigForCompatPlugin","hasIntlayerVitePlugin","updateViteConfig","updateNextConfigForNextI18next","updateNextConfigForNextIntl","updateNextConfigForNextTranslate","updateNextConfig","setupNextCompilerBabelConfig","updateAstroConfig","updateNuxtConfigForNuxtjsI18n","updateNuxtConfig","updateMetroConfig","getMetroConfigTemplate","BACKEND_INTLAYER_PACKAGES","getConfiguration","getAlias","setupFramework"],"sources":["../../../src/init/index.ts"],"sourcesContent":["import { join } from 'node:path';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport { ROUTING_MODE } from '@intlayer/config/defaultValues';\nimport { colorize, colorizePath, logger, v, x } from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { getAlias } from '@intlayer/config/utils';\nimport { initConfig } from '../initConfig';\nimport {\n setCompilerOutputInConfig,\n setEnableProxyInConfig,\n setRoutingModeInConfig,\n setRoutingStorageOnlyInConfig,\n} from './cms';\nimport {\n DocumentationRouter,\n type DocumentationRouterType,\n getDocumentationUrl,\n} from './documentationRouter';\nimport { setupFramework } from './frameworkSetup';\nimport { upgradeIntlayerPackages } from './upgradeIntlayerPackages';\nimport type { CompatSyncConfig, RoutingMode } from './utils';\nimport {\n addIntlayerRulesToOxlintConfig,\n BACKEND_INTLAYER_PACKAGES,\n detectCompatI18nLibraries,\n detectJsonLocalePattern,\n detectLinguiCatalogPattern,\n detectMissingIntlayerPackages,\n detectNextIntlMessagesPattern,\n detectPackageManager,\n ensureDirectory,\n exists,\n findTsConfigFiles,\n getGithubWorkflows,\n getMetroConfigTemplate,\n hasIntlayerVitePlugin,\n hasLegacyEslint,\n hasLintTooling,\n hasUrlRoutingFramework,\n installPackages,\n isIntlayerPackageName,\n LINT_PLUGIN_PACKAGE_NAME,\n MINIMUM_ESLINT_MAJOR,\n moveCompatPackagesToDevDependencies,\n type OxlintConfig,\n parseJSONWithComments,\n readFileFromRoot,\n replaceViteConfigPluginImportSource,\n resolveGithubWorkflowsContext,\n setupNextCompilerBabelConfig,\n updateAstroConfig,\n updateIntlayerConfigWithSyncPlugin,\n updateMetroConfig,\n updateNextConfig,\n updateNextConfigForNextI18next,\n updateNextConfigForNextIntl,\n updateNextConfigForNextTranslate,\n updateNuxtConfig,\n updateNuxtConfigForNuxtjsI18n,\n updateViteConfig,\n updateViteConfigForCompatPlugin,\n writeFileToRoot,\n} from './utils';\n\nexport {\n DocumentationRouter,\n type DocumentationRouterType,\n getDocumentationUrl,\n};\n\n/**\n * Resolves the default dev-server URL of the detected framework, used as the\n * `editor.applicationURL` of the generated configuration file. Frameworks that\n * embed Vite (Astro, SvelteKit, …) are checked before the bare Vite fallback so\n * their own dev port wins.\n */\nexport const getDefaultApplicationURL = (\n dependencies: Record<string, string>\n): string => {\n if (dependencies.next) return 'http://localhost:3000';\n if (dependencies.astro) return 'http://localhost:4321';\n if (dependencies['@angular/core']) return 'http://localhost:4200';\n if (dependencies.nuxt) return 'http://localhost:3000';\n if (dependencies['@sveltejs/kit']) return 'http://localhost:5173';\n if (dependencies['react-scripts']) return 'http://localhost:3000';\n if (dependencies.vite) return 'http://localhost:5173';\n\n return 'http://localhost:3000';\n};\n\n/**\n * How the interactive init organizes autogenerated content (compiler output /\n * autofill):\n * - `per-component` — multilingual `.content` files co-located with components\n * (the configuration template default).\n * - `centralized` — per-locale JSON dictionaries under `/locales/{locale}/`.\n * - `json-namespaces` — plain per-locale JSON namespace files kept in sync\n * through `@intlayer/sync-json-plugin`.\n */\nexport type ContentStrategy =\n | 'per-component'\n | 'centralized'\n | 'json-namespaces';\n\n/**\n * OPTIONS\n */\nexport type InitOptions = {\n noGitignore?: boolean;\n /** Skip scaffolding the `fill` and `test` GitHub Actions workflows. */\n noGithubActions?: boolean;\n /**\n * Skip installing missing Intlayer dependencies and upgrading the Intlayer\n * packages of every `package.json` to their latest version.\n */\n noInstallPackages?: boolean;\n /** Skip adding the Intlayer extension to `.vscode/extensions.json`. */\n noVscodeExtension?: boolean;\n /** Skip writing the Intlayer LSP configuration to `.vscode/settings.json`. */\n noLsp?: boolean;\n /** Skip enabling the Intlayer lint rules (ESLint / oxlint). */\n noEslint?: boolean;\n /**\n * Skip the project setup: tsconfig types/aliases, the Intlayer config file,\n * bundler/framework configs and framework-specific\n * scaffolding (middleware/proxy, providers in layout/page). Defaults to\n * enabled.\n */\n noFrameworkSetup?: boolean;\n /** Skip logging the final success message and documentation link. */\n skipFinalMessage?: boolean;\n /**\n * Version to install the missing Intlayer packages at (typically the running\n * CLI version). Already declared Intlayer packages are upgraded to the latest\n * published version instead.\n */\n upgradeToVersion?: string;\n /**\n * Locale routing strategy to write to `routing.mode` in the generated/existing\n * Intlayer configuration file. When omitted, the configuration default\n * (`prefix-no-default`) is kept.\n */\n routingMode?: RoutingMode;\n /**\n * Whether the app routes by locale through the Intlayer proxy (middleware).\n * Written to `routing.enableProxy` in the configuration file and drives the\n * framework scaffolding: `false` skips the proxy file and any locale route\n * segment. When omitted, the configured value is kept (unset means enabled).\n */\n enableProxy?: boolean;\n /**\n * Content organization strategy chosen by the interactive init prompt. Drives\n * the `compiler.output` template (`centralized`) or the injection of the\n * syncJSON plugin (`json-namespaces`). When omitted (or `per-component`), the\n * configuration template default is kept.\n */\n contentStrategy?: ContentStrategy;\n};\n\n/**\n * MAIN LOGIC\n */\nexport const initIntlayer = async (rootDir: string, options?: InitOptions) => {\n logger(colorize('Checking Intlayer configuration...', ANSIColors.CYAN));\n\n // READ PACKAGE.JSON\n const packageJsonPath = 'package.json';\n if (!(await exists(rootDir, packageJsonPath))) {\n logger(\n `${x} No ${colorizePath('package.json')} found. Please run this script from the project root.`,\n { level: 'error' }\n );\n process.exit(1);\n }\n\n const packageJsonContent = await readFileFromRoot(rootDir, packageJsonPath);\n let packageJson: Record<string, any>;\n try {\n packageJson = JSON.parse(packageJsonContent);\n } catch {\n logger(`${x} Could not parse ${colorizePath('package.json')}.`, {\n level: 'error',\n });\n process.exit(1);\n }\n\n // Determine the correct documentation URL based on dependencies\n const guideUrl = getDocumentationUrl(packageJson);\n\n const allDeps: Record<string, string> = {\n ...(packageJson.dependencies ?? {}),\n ...(packageJson.devDependencies ?? {}),\n };\n\n // MOVE COMPAT PACKAGES (e.g. next-intl) REPLACED BY @INTLAYER/* TO DEVDEPENDENCIES\n const movedPackages = moveCompatPackagesToDevDependencies(packageJson);\n if (movedPackages.length > 0) {\n const indentation = packageJsonContent.match(/^[ \\t]+(?=\")/m)?.[0] ?? 2;\n const trailingNewline = packageJsonContent.endsWith('\\n') ? '\\n' : '';\n await writeFileToRoot(\n rootDir,\n packageJsonPath,\n `${JSON.stringify(packageJson, null, indentation)}${trailingNewline}`\n );\n for (const pkg of movedPackages) {\n logger(\n `${v} Moved ${colorize(pkg, ANSIColors.MAGENTA)} from dependencies to devDependencies`\n );\n }\n }\n\n // INSTALL MISSING INTLAYER DEPENDENCIES\n const packageManager = detectPackageManager(rootDir);\n\n // lingui keeps its catalogs as `.po` (default) or `.json`. Detect which so the\n // matching sync plugin (`syncPO` / `syncJSON`) + dev dependency are chosen.\n const linguiPresent = Boolean(\n allDeps['@lingui/core'] ||\n allDeps['@lingui/react'] ||\n allDeps['@intlayer/lingui']\n );\n\n const linguiCatalog = linguiPresent\n ? await detectLinguiCatalogPattern(rootDir)\n : null;\n\n // `linguiCatalogFormat` resolution:\n // 1. Filesystem scan result (authoritative when catalogs already exist)\n // 2. Fallback: 'po' (lingui's default) when lingui is installed but no\n // catalogs have been generated yet.\n const linguiCatalogFormat: 'po' | 'json' | null =\n linguiCatalog?.format ?? (linguiPresent ? 'po' : null);\n\n const {\n packagesToInstall,\n devPackagesToInstall,\n compatSyncConfig,\n compatVitePluginConfig,\n pendingCompatAdapters,\n } = detectMissingIntlayerPackages(allDeps, {\n linguiCatalogFormat,\n dependencies: packageJson.dependencies,\n devDependencies: packageJson.devDependencies,\n });\n\n /** Whether the compat adapter for a library is not released yet. */\n const isCompatAdapterPending = (adapterPackage: string): boolean =>\n pendingCompatAdapters.includes(adapterPackage);\n\n if (pendingCompatAdapters.length > 0) {\n logger(\n `${x} No released Intlayer adapter yet for ${pendingCompatAdapters\n .map((adapterPackage) => colorize(adapterPackage, ANSIColors.MAGENTA))\n .join(\n ', '\n )} — keeping your current i18n library and only syncing its catalogs with Intlayer.`,\n { level: 'warn' }\n );\n }\n\n // The `json-namespaces` content strategy uses the same syncJSON pipeline as\n // the compat libraries: plain per-locale JSON namespace files synced through\n // `@intlayer/sync-json-plugin`. A detected compat library keeps precedence —\n // its own catalog format/template is authoritative.\n const wantsJsonNamespaces =\n options?.contentStrategy === 'json-namespaces' && !compatSyncConfig;\n\n if (\n wantsJsonNamespaces &&\n !allDeps['@intlayer/sync-json-plugin'] &&\n !devPackagesToInstall.includes('@intlayer/sync-json-plugin')\n ) {\n devPackagesToInstall.push('@intlayer/sync-json-plugin');\n }\n\n if (!options?.noInstallPackages) {\n const withVersion = (packages: string[]): string[] =>\n options?.upgradeToVersion\n ? packages.map((pkg) =>\n isIntlayerPackageName(pkg)\n ? `${pkg}@${options.upgradeToVersion}`\n : pkg\n )\n : packages;\n\n if (packagesToInstall.length > 0) {\n logger(\n colorize('Installing missing Intlayer dependencies...', ANSIColors.CYAN)\n );\n try {\n installPackages(\n rootDir,\n withVersion(packagesToInstall),\n packageManager\n );\n logger(\n `${v} Installed: ${packagesToInstall.map((pkg) => colorize(pkg, ANSIColors.MAGENTA)).join(', ')}`\n );\n } catch {\n logger(\n `${x} Failed to install packages. Please install manually: ${packagesToInstall.join(' ')}`,\n { level: 'warn' }\n );\n }\n }\n\n if (devPackagesToInstall.length > 0) {\n logger(\n colorize(\n 'Installing missing Intlayer dev dependencies...',\n ANSIColors.CYAN\n )\n );\n try {\n installPackages(\n rootDir,\n withVersion(devPackagesToInstall),\n packageManager,\n true\n );\n logger(\n `${v} Installed: ${devPackagesToInstall.map((pkg) => colorize(pkg, ANSIColors.MAGENTA)).join(', ')}`\n );\n } catch {\n logger(\n `${x} Failed to install dev packages. Please install manually: ${devPackagesToInstall.join(' ')}`,\n { level: 'warn' }\n );\n }\n }\n\n // UPGRADE INTLAYER DEPENDENCIES TO LATEST\n await upgradeIntlayerPackages(rootDir);\n }\n\n // CHECK .GITIGNORE\n const gitignorePath = '.gitignore';\n if (\n !options?.noGitignore &&\n !options?.noFrameworkSetup &&\n (await exists(rootDir, gitignorePath))\n ) {\n const gitignoreContent = await readFileFromRoot(rootDir, gitignorePath);\n\n if (!gitignoreContent.includes('intlayer')) {\n const newContent = `${gitignoreContent}\\n# Intlayer\\n.intlayer\\n`;\n await writeFileToRoot(rootDir, gitignorePath, newContent);\n logger(\n `${v} Added ${colorizePath('.intlayer')} to ${colorizePath(gitignorePath)}`\n );\n } else {\n logger(`${v} ${colorizePath(gitignorePath)} already includes .intlayer`);\n }\n }\n\n // SCAFFOLD GITHUB ACTIONS WORKFLOWS (fill + test)\n // Generate two workflows whose commands match the detected package manager:\n // - intlayer-fill.yml: auto-fills missing translations on pull requests\n // - intlayer-test.yml: fails the PR when required locales are missing\n // Every command runs with `--ci`, which iterates over the Intlayer\n // project(s) of the repository. GitHub only triggers workflows stored at the\n // repository root, so in a monorepo the files are written to the git root\n // (see resolveGithubWorkflowsContext).\n if (!options?.noGithubActions) {\n const workflowsContext = await resolveGithubWorkflowsContext(\n rootDir,\n packageManager\n );\n const workflows = getGithubWorkflows(\n workflowsContext.packageManager,\n workflowsContext.options\n );\n\n for (const workflow of workflows) {\n if (await exists(workflowsContext.workflowsRootDir, workflow.filePath)) {\n logger(`${v} ${colorizePath(workflow.filePath)} already exists`);\n continue;\n }\n\n try {\n await ensureDirectory(\n workflowsContext.workflowsRootDir,\n join('.github', 'workflows')\n );\n await writeFileToRoot(\n workflowsContext.workflowsRootDir,\n workflow.filePath,\n workflow.content\n );\n logger(\n `${v} Added GitHub Actions workflow ${colorizePath(workflow.filePath)}`\n );\n } catch {\n logger(\n `${x} Could not create ${colorizePath(workflow.filePath)}. You may need to add it manually.`,\n { level: 'warn' }\n );\n }\n }\n }\n\n // CHECK VS CODE EXTENSION RECOMMENDATIONS\n const vscodeDir = '.vscode';\n const extensionsJsonPath = join(vscodeDir, 'extensions.json');\n const extensionId = 'intlayer.intlayer-vs-code-extension';\n\n if (!options?.noVscodeExtension) {\n try {\n let extensionsConfig: { recommendations: string[] } = {\n recommendations: [],\n };\n\n if (await exists(rootDir, extensionsJsonPath)) {\n const content = await readFileFromRoot(rootDir, extensionsJsonPath);\n extensionsConfig = parseJSONWithComments(content);\n } else {\n await ensureDirectory(rootDir, vscodeDir);\n }\n\n if (!extensionsConfig.recommendations) {\n extensionsConfig.recommendations = [];\n }\n\n if (!extensionsConfig.recommendations.includes(extensionId)) {\n extensionsConfig.recommendations.push(extensionId);\n await writeFileToRoot(\n rootDir,\n extensionsJsonPath,\n JSON.stringify(extensionsConfig, null, 2)\n );\n logger(\n `${v} Added ${colorize(extensionId, ANSIColors.MAGENTA)} to ${colorizePath(extensionsJsonPath)}`\n );\n } else {\n logger(\n `${v} ${colorizePath(extensionsJsonPath)} already includes ${colorize(extensionId, ANSIColors.MAGENTA)}`\n );\n }\n } catch {\n logger(\n `${x} Could not update ${colorizePath(extensionsJsonPath)}. You may need to add ${colorize(extensionId, ANSIColors.MAGENTA)} manually.`,\n { level: 'warn' }\n );\n }\n }\n\n // CHECK VS CODE LSP SETTINGS\n const settingsJsonPath = join(vscodeDir, 'settings.json');\n\n if (!options?.noLsp) {\n try {\n let settingsConfig: Record<string, unknown> = {};\n\n if (await exists(rootDir, settingsJsonPath)) {\n const content = await readFileFromRoot(rootDir, settingsJsonPath);\n settingsConfig = parseJSONWithComments(content);\n } else {\n await ensureDirectory(rootDir, vscodeDir);\n }\n\n let settingsUpdated = false;\n\n if (!settingsConfig['intlayer.languageServer.command']) {\n settingsConfig['intlayer.languageServer.command'] = 'npx';\n settingsUpdated = true;\n }\n\n if (!settingsConfig['intlayer.languageServer.args']) {\n settingsConfig['intlayer.languageServer.args'] = ['@intlayer/lsp'];\n settingsUpdated = true;\n }\n\n if (settingsUpdated) {\n await writeFileToRoot(\n rootDir,\n settingsJsonPath,\n JSON.stringify(settingsConfig, null, 2)\n );\n logger(\n `${v} Updated ${colorizePath(settingsJsonPath)} with LSP configuration`\n );\n } else {\n logger(\n `${v} ${colorizePath(settingsJsonPath)} already includes LSP configuration`\n );\n }\n } catch {\n logger(\n `${x} Could not update ${colorizePath(settingsJsonPath)}. You may need to add the LSP settings manually.`,\n { level: 'warn' }\n );\n }\n }\n\n // CHECK LINT RULES (eslint-plugin-intlayer)\n //\n // Gated on the project already having a linter installed: with no ESLint or\n // oxlint there is nothing to plug the rules into, and the guidance below\n // would just be noise. The same check gates the install in\n // `detectMissingIntlayerPackages`, so the two never disagree.\n //\n // Only the oxlint config is patched here: `.oxlintrc.json` is plain JSON and\n // safe to edit, whereas an ESLint flat config is arbitrary JavaScript that\n // cannot be rewritten reliably — that one is left to the user, with the\n // snippet printed below.\n if (!options?.noEslint && hasLegacyEslint(allDeps)) {\n logger(\n `${x} ${colorize(LINT_PLUGIN_PACKAGE_NAME, ANSIColors.MAGENTA)} needs ESLint ${MINIMUM_ESLINT_MAJOR}+ (flat config) — skipped the Intlayer lint rules. Upgrade ESLint to enable them: ${colorizePath(DocumentationRouter.ESLint)}`,\n { level: 'warn' }\n );\n }\n\n if (!options?.noEslint && hasLintTooling(allDeps)) {\n const oxlintConfigPath = '.oxlintrc.json';\n const hasOxlintConfig = await exists(rootDir, oxlintConfigPath);\n // An oxlint-only project without a config gets one; with ESLint around,\n // the rules go into the ESLint config instead.\n const shouldCreateOxlintConfig =\n !hasOxlintConfig && Boolean(allDeps.oxlint) && !allDeps.eslint;\n\n if (hasOxlintConfig || shouldCreateOxlintConfig) {\n try {\n const oxlintConfig: OxlintConfig = hasOxlintConfig\n ? parseJSONWithComments(\n await readFileFromRoot(rootDir, oxlintConfigPath)\n )\n : {};\n\n if (addIntlayerRulesToOxlintConfig(oxlintConfig)) {\n await writeFileToRoot(\n rootDir,\n oxlintConfigPath,\n JSON.stringify(oxlintConfig, null, 2)\n );\n logger(\n `${v} ${hasOxlintConfig ? 'Added the Intlayer lint rules to' : 'Created'} ${colorizePath(oxlintConfigPath)}`\n );\n } else {\n logger(\n `${v} ${colorizePath(oxlintConfigPath)} already includes the Intlayer lint rules`\n );\n }\n } catch {\n logger(\n `${x} Could not update ${colorizePath(oxlintConfigPath)}. You may need to add ${colorize(LINT_PLUGIN_PACKAGE_NAME, ANSIColors.MAGENTA)} manually.`,\n { level: 'warn' }\n );\n }\n } else {\n // ESLint flat config — print the snippet instead of rewriting the file.\n logger([\n colorize('Intlayer lint rules →', ANSIColors.MAGENTA),\n colorize(\n `Add the ${LINT_PLUGIN_PACKAGE_NAME} preset to the array your ESLint flat config exports, to catch hardcoded text and dynamic calls the compiler cannot optimize:`,\n ANSIColors.GREY_LIGHT\n ),\n colorize(\n ` import intlayer from '${LINT_PLUGIN_PACKAGE_NAME}';\\n\\n export default [\\n // ...your existing config\\n ...intlayer.configs.recommended,\\n ];`,\n ANSIColors.GREY_LIGHT\n ),\n colorizePath(DocumentationRouter.ESLint),\n ]);\n }\n }\n\n // PROJECT SETUP\n // Everything below edits the project itself: tsconfig types and aliases, the\n // Intlayer config file, bundler/framework configs and the\n // framework scaffolding. It only runs with the framework setup step, so\n // picking e.g. only the CI or editor steps never creates project files.\n if (!options?.noFrameworkSetup) {\n // CHECK TSCONFIGS\n const tsConfigFiles = await findTsConfigFiles(rootDir);\n let hasTsConfig = false;\n\n for (const fileName of tsConfigFiles) {\n if (await exists(rootDir, fileName)) {\n hasTsConfig = true;\n try {\n const fileContent = await readFileFromRoot(rootDir, fileName);\n const config = parseJSONWithComments(fileContent);\n const typeDefinition = './.intlayer/**/*.ts';\n\n let updated = false;\n\n if (!config.include) {\n // Skip if no include array (solution-style)\n } else if (\n Array.isArray(config.include) &&\n !(config.include as string[]).some((pattern: string) =>\n pattern.includes('.intlayer')\n )\n ) {\n config.include.push(typeDefinition);\n updated = true;\n } else if (config.include.includes(typeDefinition)) {\n logger(\n `${v} ${colorizePath(fileName)} already includes intlayer types`\n );\n }\n\n if (updated) {\n await writeFileToRoot(\n rootDir,\n fileName,\n JSON.stringify(config, null, 2)\n );\n logger(\n `${v} Updated ${colorizePath(fileName)} to include intlayer types`\n );\n }\n } catch {\n logger(\n `${x} Could not parse or update ${colorizePath(fileName)}. You may need to add ${colorizePath('.intlayer/types/**/*.ts')} manually.`,\n { level: 'warn' }\n );\n }\n }\n }\n\n // INITIALIZE CONFIG FILE\n const format = hasTsConfig ? 'intlayer.config.ts' : 'intlayer.config.mjs';\n\n // Detect the locale JSON file pattern already in the project so we can\n // insert the matching locales into the config and produce the most\n // accurate source template for compat libraries.\n const detectedPattern = await detectJsonLocalePattern(rootDir);\n\n const isConfigCreated = await initConfig(format, rootDir, {\n locales: detectedPattern?.locales,\n applicationURL: getDefaultApplicationURL(allDeps),\n });\n\n // APPLY CONTENT STRATEGY — CENTRALIZED\n // Point `compiler.output` at per-locale JSON dictionaries under `/locales/`\n // instead of the per-component template default.\n if (options?.contentStrategy === 'centralized') {\n await setCompilerOutputInConfig(\n rootDir,\n '/locales/{{locale}}/{{key}}.content.json'\n );\n }\n\n // INJECT SYNC-JSON PLUGIN FOR COMPAT LIBRARIES / JSON-NAMESPACES STRATEGY\n const syncConfigToInject: CompatSyncConfig | undefined =\n compatSyncConfig ??\n (wantsJsonNamespaces\n ? {\n format: 'i18next',\n sourceTemplate:\n detectedPattern?.template ?? './locales/${locale}/${key}.json',\n }\n : undefined);\n\n if (syncConfigToInject) {\n // For next-intl / use-intl, the messages path is authoritatively declared\n // in `i18n/request.ts` (e.g. `import(`../messages/${locale}.json`)`), so we\n // read it directly. It usually resolves to a single file per locale (no\n // `${key}` segment), whose first-level keys are namespaces — so the compat\n // config carries `splitKeys: true` to emit one dictionary per namespace.\n // Falls back to file-system globbing otherwise.\n const nextIntlMessagesPattern =\n allDeps['next-intl'] ||\n allDeps['@intlayer/next-intl'] ||\n allDeps['use-intl'] ||\n allDeps['@intlayer/use-intl']\n ? await detectNextIntlMessagesPattern(rootDir)\n : null;\n\n // lingui authoritatively resolves to `…/{locale}/messages.{po,json}`, where\n // the `messages` filename becomes the dictionary key. Prefer it so a `.po`\n // project gets `syncPO` (the generic JSON glob only sees `.json`).\n const sourceTemplate =\n linguiCatalog?.template ??\n nextIntlMessagesPattern?.template ??\n detectedPattern?.template;\n\n const resolvedSyncConfig = {\n ...syncConfigToInject,\n ...(sourceTemplate ? { sourceTemplate } : {}),\n };\n\n const syncPluginPackage =\n resolvedSyncConfig.plugin === 'po'\n ? '@intlayer/sync-po-plugin'\n : '@intlayer/sync-json-plugin';\n const syncPluginName =\n resolvedSyncConfig.plugin === 'po' ? 'syncPO' : 'syncJSON';\n\n // `splitKeys` only makes sense for a single file holding several namespaces.\n // If the resolved template addresses one namespace per file (`${key}`\n // segment), each file is already a single namespace — drop the flag so\n // syncJSON keeps one dictionary per file.\n if (\n resolvedSyncConfig.splitKeys &&\n resolvedSyncConfig.sourceTemplate.includes('${key}')\n ) {\n resolvedSyncConfig.splitKeys = false;\n }\n\n const intlayerConfigCandidates = [\n 'intlayer.config.ts',\n 'intlayer.config.mjs',\n 'intlayer.config.js',\n 'intlayer.config.cjs',\n ];\n\n for (const configFile of intlayerConfigCandidates) {\n if (await exists(rootDir, configFile)) {\n const configContent = await readFileFromRoot(rootDir, configFile);\n\n if (!configContent.includes(syncPluginPackage)) {\n const extension = configFile.split('.').pop()!;\n const updatedConfigContent = updateIntlayerConfigWithSyncPlugin(\n configContent,\n extension,\n resolvedSyncConfig\n );\n await writeFileToRoot(rootDir, configFile, updatedConfigContent);\n logger(\n `${v} Updated ${colorizePath(configFile)} with ${syncPluginName} compat plugin`\n );\n } else {\n logger(\n `${v} ${colorizePath(configFile)} already includes ${syncPluginName} plugin`\n );\n }\n break;\n }\n }\n }\n\n // APPLY ROUTING\n // An explicit choice (interactive prompt / `--routing`) is written to\n // `routing.mode` + `routing.enableProxy`. Without one, a freshly created\n // config is adapted to the project: frontends get prefix routing through\n // the proxy (the template ships it disabled), projects without URL routing\n // (backend, React Native…) keep only `routing.storage`. An existing config\n // is never rewritten without an explicit choice. A compat i18n library\n // owns the app routing, so its config keeps the template's disabled proxy:\n // compat bundler plugins wrap `intlayer()`, which would register it.\n const hasUrlRouting = hasUrlRoutingFramework(allDeps);\n const hasCompatI18nLibrary = detectCompatI18nLibraries(allDeps).length > 0;\n const shouldApplyDefaultRouting =\n isConfigCreated &&\n options?.routingMode === undefined &&\n !hasCompatI18nLibrary;\n\n if (shouldApplyDefaultRouting && !hasUrlRouting) {\n await setRoutingStorageOnlyInConfig(rootDir);\n }\n\n const routingMode =\n options?.routingMode ??\n (shouldApplyDefaultRouting && hasUrlRouting ? ROUTING_MODE : undefined);\n const enableProxy =\n options?.enableProxy ??\n (shouldApplyDefaultRouting && hasUrlRouting ? true : undefined);\n\n if (routingMode) {\n await setRoutingModeInConfig(rootDir, routingMode);\n }\n\n if (enableProxy !== undefined) {\n await setEnableProxyInConfig(rootDir, enableProxy);\n }\n\n let hasAliasConfiguration = false;\n\n // CHECK VITE CONFIG\n const viteConfigs = ['vite.config.ts', 'vite.config.js', 'vite.config.mjs'];\n\n for (const file of viteConfigs) {\n if (await exists(rootDir, file)) {\n hasAliasConfiguration = true;\n const content = await readFileFromRoot(rootDir, file);\n const extension = file.split('.').pop()!;\n\n if (compatVitePluginConfig) {\n const { replacesVitePlugin } = compatVitePluginConfig;\n\n if (content.includes(compatVitePluginConfig.pluginPackageSource)) {\n logger(\n `${v} ${colorizePath(file)} already includes ${compatVitePluginConfig.pluginPackageSource}`\n );\n } else if (\n replacesVitePlugin &&\n content.includes(replacesVitePlugin.fromPackageSource)\n ) {\n // Drop-in replacement: rewrite the original i18n vite plugin's import\n // source, keeping its binding and call site (e.g. lingui).\n const updatedContent = replaceViteConfigPluginImportSource(\n content,\n replacesVitePlugin.importName,\n replacesVitePlugin.fromPackageSource,\n compatVitePluginConfig.pluginPackageSource\n );\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to import ${replacesVitePlugin.importName} from ${compatVitePluginConfig.pluginPackageSource}`\n );\n } else {\n const updatedContent = updateViteConfigForCompatPlugin(\n content,\n extension,\n compatVitePluginConfig\n );\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include ${compatVitePluginConfig.pluginFunctionName} compat plugin`\n );\n }\n } else if (hasIntlayerVitePlugin(content)) {\n // A compat adapter plugin (e.g. `reactI18nextVitePlugin`) already wraps\n // `intlayer()` internally, so skip adding a redundant standalone plugin.\n logger(\n `${v} ${colorizePath(file)} already includes an Intlayer plugin`\n );\n } else {\n const updatedContent = updateViteConfig(content, extension);\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer plugin`\n );\n }\n break;\n }\n }\n\n // CHECK NEXT CONFIG\n const nextConfigs = ['next.config.js', 'next.config.mjs', 'next.config.ts'];\n let isNextJsProject = false;\n\n for (const file of nextConfigs) {\n if (await exists(rootDir, file)) {\n isNextJsProject = true;\n hasAliasConfiguration = true;\n const content = await readFileFromRoot(rootDir, file);\n const extension = file.split('.').pop()!;\n\n if (allDeps['next-i18next'] || allDeps['@intlayer/next-i18next']) {\n if (!content.includes('@intlayer/next-i18next')) {\n const updatedContent = updateNextConfigForNextI18next(\n content,\n extension\n );\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer next-i18next compat plugin`\n );\n } else {\n logger(\n `${v} ${colorizePath(file)} already includes @intlayer/next-i18next`\n );\n }\n } else if (allDeps['next-intl'] || allDeps['@intlayer/next-intl']) {\n if (!content.includes('@intlayer/next-intl/plugin')) {\n const updatedContent = updateNextConfigForNextIntl(\n content,\n extension\n );\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer next-intl compat plugin`\n );\n } else {\n logger(\n `${v} ${colorizePath(file)} already includes @intlayer/next-intl/plugin`\n );\n }\n } else if (isCompatAdapterPending('@intlayer/next-translate')) {\n logger(\n `${v} Kept ${colorizePath(file)} untouched (next-translate stays in charge)`\n );\n } else if (\n allDeps['next-translate'] ||\n allDeps['@intlayer/next-translate']\n ) {\n if (!content.includes('@intlayer/next-translate')) {\n const updatedContent = updateNextConfigForNextTranslate(\n content,\n extension\n );\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer next-translate compat plugin`\n );\n } else {\n logger(\n `${v} ${colorizePath(file)} already includes @intlayer/next-translate`\n );\n }\n } else if (!content.includes('next-intlayer')) {\n const updatedContent = updateNextConfig(content, extension);\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer plugin`\n );\n }\n break;\n }\n }\n\n // CHECK NEXT.JS COMPILER (BABEL)\n // When a Next.js project already uses Babel, install @intlayer/babel and print\n // the compiler + build-optimization plugins (extract, purge, minify, optimize)\n // to add. SWC projects need no setup: withIntlayer injects @intlayer/swc.\n if (isNextJsProject) {\n await setupNextCompilerBabelConfig({\n rootDir,\n packageManager,\n allDeps,\n skipInstall: Boolean(options?.noInstallPackages),\n });\n }\n\n // CHECK OTHER FRAMEWORKS CONFIG\n const astroConfigs = [\n 'astro.config.mjs',\n 'astro.config.js',\n 'astro.config.ts',\n 'astro.config.cjs',\n ];\n\n for (const file of astroConfigs) {\n if (await exists(rootDir, file)) {\n hasAliasConfiguration = true;\n\n if (file.startsWith('astro.config.')) {\n const content = await readFileFromRoot(rootDir, file);\n\n if (!content.includes('astro-intlayer')) {\n const extension = file.split('.').pop()!;\n const updatedContent = updateAstroConfig(content, extension);\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer integration`\n );\n }\n }\n break;\n }\n }\n\n const nuxtConfigs = ['nuxt.config.js', 'nuxt.config.ts'];\n for (const file of nuxtConfigs) {\n if (await exists(rootDir, file)) {\n hasAliasConfiguration = true;\n\n const content = await readFileFromRoot(rootDir, file);\n\n if (isCompatAdapterPending('@intlayer/nuxtjs-i18n')) {\n logger(\n `${v} Kept ${colorizePath(file)} untouched (@nuxtjs/i18n stays in charge)`\n );\n } else if (allDeps['@nuxtjs/i18n']) {\n if (!content.includes('@intlayer/nuxtjs-i18n')) {\n const updatedContent = updateNuxtConfigForNuxtjsI18n(content);\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include @intlayer/nuxtjs-i18n module`\n );\n } else {\n logger(\n `${v} ${colorizePath(file)} already includes @intlayer/nuxtjs-i18n`\n );\n }\n } else if (!content.includes('nuxt-intlayer')) {\n const updatedContent = updateNuxtConfig(content);\n await writeFileToRoot(rootDir, file, updatedContent);\n logger(\n `${v} Updated ${colorizePath(file)} to include Intlayer module`\n );\n }\n break;\n }\n }\n\n // CHECK METRO CONFIG (React Native / Expo)\n // Metro is the React Native bundler. The Intlayer Metro plugin\n // (`react-native-intlayer/metro`) handles dictionary aliasing and building.\n // When no config exists we scaffold one; when one exists we safely wrap its\n // exported config with `configMetroIntlayerSync`, leaving custom async\n // (IIFE) configs untouched so existing setups are never broken.\n const isReactNativeProject = Boolean(\n allDeps['react-native'] || allDeps.expo\n );\n\n if (isReactNativeProject) {\n // Metro resolves Intlayer aliases itself, so skip the alias fallback below.\n hasAliasConfiguration = true;\n\n const metroConfigs = [\n 'metro.config.js',\n 'metro.config.cjs',\n 'metro.config.mjs',\n 'metro.config.ts',\n ];\n\n let metroConfigFile: string | undefined;\n\n for (const file of metroConfigs) {\n if (await exists(rootDir, file)) {\n metroConfigFile = file;\n break;\n }\n }\n\n if (metroConfigFile) {\n const content = await readFileFromRoot(rootDir, metroConfigFile);\n\n if (content.includes('react-native-intlayer')) {\n logger(\n `${v} ${colorizePath(metroConfigFile)} already includes the Intlayer Metro plugin`\n );\n } else {\n const extension = metroConfigFile.split('.').pop()!;\n const updatedContent = updateMetroConfig(content, extension);\n\n if (updatedContent !== content) {\n await writeFileToRoot(rootDir, metroConfigFile, updatedContent);\n logger(\n `${v} Updated ${colorizePath(metroConfigFile)} to include the Intlayer Metro plugin`\n );\n } else {\n logger(\n `${x} Could not automatically update ${colorizePath(metroConfigFile)}. Wrap your exported config with ${colorize('configMetroIntlayer', ANSIColors.MAGENTA)}: ${colorizePath(DocumentationRouter.ReactNativeAndExpo)}`,\n { level: 'warn' }\n );\n }\n }\n } else {\n const newMetroConfigFile = 'metro.config.js';\n await writeFileToRoot(\n rootDir,\n newMetroConfigFile,\n getMetroConfigTemplate(Boolean(allDeps.expo))\n );\n logger(\n `${v} Created ${colorizePath(newMetroConfigFile)} with the Intlayer Metro plugin`\n );\n }\n }\n\n // CHECK WEBPACK CONFIG\n const webpackConfigs = [\n 'webpack.config.js',\n 'webpack.config.ts',\n 'webpack.config.mjs',\n 'webpack.config.cjs',\n ];\n\n for (const file of webpackConfigs) {\n if (await exists(rootDir, file)) {\n hasAliasConfiguration = true;\n logger(\n `${v} Found ${colorizePath(\n file\n )}. Make sure to configure aliases manually or use the Intlayer Webpack plugin.`\n );\n break;\n }\n }\n\n // The server frameworks themselves, alongside their Intlayer packages: a\n // project may be mid-setup and carry only one of the two.\n const backendConfigPackages = [\n 'express',\n 'fastify',\n '@adonisjs/core',\n 'hono',\n 'elysia',\n ...BACKEND_INTLAYER_PACKAGES,\n ];\n\n if (backendConfigPackages.some((pkg) => allDeps[pkg])) {\n hasAliasConfiguration = true;\n }\n\n if (!hasAliasConfiguration) {\n const configuration = getConfiguration({ baseDir: rootDir });\n // `tsconfig`/`jsconfig` `paths` and `package.json` `imports` both expect\n // explicitly relative specifiers, so bare relative paths get a `./` prefix.\n const aliases = getAlias({\n configuration,\n formatter: (value) =>\n value.startsWith('./') || value.startsWith('../')\n ? value\n : `./${value}`,\n });\n\n if (hasTsConfig && tsConfigFiles.length > 0) {\n const tsConfigPath =\n tsConfigFiles.find((file) => file === 'tsconfig.json') ||\n tsConfigFiles[0];\n\n if (tsConfigPath) {\n const tsConfigContent = await readFileFromRoot(rootDir, tsConfigPath);\n const config = parseJSONWithComments(tsConfigContent);\n\n config.compilerOptions ??= {};\n config.compilerOptions.paths ??= {};\n\n let updated = false;\n\n Object.entries(aliases).forEach(([alias, path]) => {\n if (!config.compilerOptions.paths[alias]) {\n config.compilerOptions.paths[alias] = [path];\n updated = true;\n }\n });\n\n if (updated) {\n await writeFileToRoot(\n rootDir,\n tsConfigPath,\n JSON.stringify(config, null, 2)\n );\n\n logger(\n `${v} Updated ${colorizePath(\n tsConfigPath\n )} to include Intlayer aliases`\n );\n }\n }\n } else {\n const jsConfigPath = 'jsconfig.json';\n\n if (await exists(rootDir, jsConfigPath)) {\n const jsConfigContent = await readFileFromRoot(rootDir, jsConfigPath);\n const config = parseJSONWithComments(jsConfigContent);\n\n config.compilerOptions ??= {};\n config.compilerOptions.paths ??= {};\n\n let updated = false;\n\n Object.entries(aliases).forEach(([alias, path]) => {\n if (!config.compilerOptions.paths[alias]) {\n config.compilerOptions.paths[alias] = [path];\n updated = true;\n }\n });\n\n if (updated) {\n await writeFileToRoot(\n rootDir,\n jsConfigPath,\n JSON.stringify(config, null, 2)\n );\n logger(\n `${v} Updated ${colorizePath(\n jsConfigPath\n )} to include Intlayer aliases`\n );\n }\n } else {\n packageJson.imports ??= {};\n\n let updated = false;\n\n Object.entries(aliases).forEach(([alias, path]) => {\n const importAlias = alias.replace('@', '#');\n\n if (!packageJson.imports[importAlias]) {\n packageJson.imports[importAlias] = path;\n updated = true;\n }\n });\n\n if (updated) {\n await writeFileToRoot(\n rootDir,\n packageJsonPath,\n JSON.stringify(packageJson, null, 2)\n );\n logger(\n `${v} Updated ${colorizePath(\n packageJsonPath\n )} to include Intlayer imports`\n );\n }\n }\n }\n }\n\n // FRAMEWORK-SPECIFIC SCAFFOLDING\n // Sets up middleware/proxy and wraps the layout/page with the Intlayer\n // providers for the detected framework (Next.js App Router today). Idempotent\n // and non-destructive: it never overwrites user code it cannot safely\n // transform, skipping with guidance instead.\n //\n // Skipped entirely when a compat i18n library drives the app (i18next,\n // next-intl, vue-i18n, …): the app already owns its routing, providers and\n // layouts, and Intlayer only syncs its catalogs — restructuring routes or\n // injecting providers would break the existing setup.\n const hasCompatLibrary = Boolean(\n compatSyncConfig || compatVitePluginConfig\n );\n\n if (hasCompatLibrary) {\n logger(\n `${v} Compat i18n library detected — keeping the app structure untouched (no route restructure, no provider injection)`\n );\n }\n\n if (!hasCompatLibrary) {\n try {\n // Prefer the user's choices, else the configured routing (mode defaults\n // to `prefix-no-default`, an unset `enableProxy` means enabled). Drives\n // the proxy file and the locale route segment the adapters scaffold.\n const { routing } = getConfiguration({ baseDir: rootDir });\n\n await setupFramework({\n rootDir,\n allDeps,\n packageManager,\n useTypeScript: hasTsConfig,\n routingMode: routingMode ?? routing.mode,\n enableProxy: enableProxy ?? routing.enableProxy !== false,\n });\n } catch {\n logger(\n `${x} Framework-specific scaffolding failed. Your existing files were left untouched; follow the documentation to finish the setup.`,\n { level: 'warn' }\n );\n }\n }\n }\n\n // FINAL SUCCESS MESSAGE\n if (!options?.skipFinalMessage) {\n logInitSuccessMessage(guideUrl);\n }\n\n return { guideUrl };\n};\n\nexport const logInitSuccessMessage = (guideUrl: string): void => {\n logger(`${v} ${colorize('Intlayer init setup complete.', ANSIColors.GREEN)}`);\n logger([\n colorize('Next →', ANSIColors.MAGENTA),\n colorize(\n 'Follow the instructions in the documentation to complete the setup:',\n ANSIColors.GREY_LIGHT\n ),\n colorizePath(guideUrl),\n ]);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4EA,MAAa,4BACX,iBACW;CACX,IAAI,aAAa,MAAM,OAAO;CAC9B,IAAI,aAAa,OAAO,OAAO;CAC/B,IAAI,aAAa,kBAAkB,OAAO;CAC1C,IAAI,aAAa,MAAM,OAAO;CAC9B,IAAI,aAAa,kBAAkB,OAAO;CAC1C,IAAI,aAAa,kBAAkB,OAAO;CAC1C,IAAI,aAAa,MAAM,OAAO;CAE9B,OAAO;AACT;;;;AA0EA,MAAa,eAAe,OAAO,SAAiB,YAA0B;CAC5E,wCAAOA,kCAAS,sCAAsCC,wBAAW,IAAI,CAAC;CAGtE,MAAM,kBAAkB;CACxB,IAAI,CAAE,MAAMC,qCAAO,SAAS,eAAe,GAAI;EAC7C,oCACE,GAAGC,0BAAE,UAAMC,sCAAa,cAAc,EAAE,wDACxC,EAAE,OAAO,QAAQ,CACnB;EACA,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,qBAAqB,MAAMC,+CAAiB,SAAS,eAAe;CAC1E,IAAI;CACJ,IAAI;EACF,cAAc,KAAK,MAAM,kBAAkB;CAC7C,QAAQ;EACN,oCAAO,GAAGF,0BAAE,uBAAmBC,sCAAa,cAAc,EAAE,IAAI,EAC9D,OAAO,QACT,CAAC;EACD,QAAQ,KAAK,CAAC;CAChB;CAGA,MAAM,WAAWE,qDAAoB,WAAW;CAEhD,MAAM,UAAkC;EACtC,GAAI,YAAY,gBAAgB,CAAC;EACjC,GAAI,YAAY,mBAAmB,CAAC;CACtC;CAGA,MAAM,gBAAgBC,sEAAoC,WAAW;CACrE,IAAI,cAAc,SAAS,GAAG;EAC5B,MAAM,cAAc,mBAAmB,MAAM,eAAe,CAAC,GA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IAAI,UAAU;KAEd,OAAO,QAAQ,OAAO,CAAC,CAAC,SAAS,CAAC,OAAO,UAAU;MACjD,MAAM,cAAc,MAAM,QAAQ,KAAK,GAAG;MAE1C,IAAI,CAAC,YAAY,QAAQ,cAAc;OACrC,YAAY,QAAQ,eAAe;OACnC,UAAU;MACZ;KACF,CAAC;KAED,IAAI,SAAS;MACX,MAAMI,8CACJ,SACA,iBACA,KAAK,UAAU,aAAa,MAAM,CAAC,CACrC;MACA,oCACE,GAAGC,0BAAE,eAAWL,sCACd,eACF,EAAE,6BACJ;KACF;IACF;GACF;EACF;EAYA,MAAM,mBAAmB,QACvB,oBAAoB,sBACtB;EAEA,IAAI,kBACF,oCACE,GAAGK,0BAAE,kHACP;EAGF,IAAI,CAAC,kBACH,IAAI;GAIF,MAAM,EAAE,gBAAY2C,wCAAiB,EAAE,SAAS,QAAQ,CAAC;GAEzD,MAAME,iDAAe;IACnB;IACA;IACA;IACA,eAAe;IACf,aAAa,eAAe,QAAQ;IACpC,aAAa,eAAe,QAAQ,gBAAgB;GACtD,CAAC;EACH,QAAQ;GACN,oCACE,GAAGnD,0BAAE,iIACL,EAAE,OAAO,OAAO,CAClB;EACF;CAEJ;CAGA,IAAI,CAAC,SAAS,kBACZ,sBAAsB,QAAQ;CAGhC,OAAO,EAAE,SAAS;AACpB;AAEA,MAAa,yBAAyB,aAA2B;CAC/D,oCAAO,GAAGM,0BAAE,OAAGT,kCAAS,iCAAiCC,wBAAW,KAAK,GAAG;CAC5E,oCAAO;MACLD,kCAAS,UAAUC,wBAAW,OAAO;MACrCD,kCACE,uEACAC,wBAAW,UACb;MACAG,sCAAa,QAAQ;CACvB,CAAC;AACH"}
@@ -0,0 +1,15 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ //#region src/init/utils/backendPackages.ts
3
+ /** Intlayer integrations for server frameworks (no bundler plugin). */
4
+ const BACKEND_INTLAYER_PACKAGES = [
5
+ "express-intlayer",
6
+ "fastify-intlayer",
7
+ "adonis-intlayer",
8
+ "hono-intlayer",
9
+ "elysia-intlayer",
10
+ "remix-intlayer"
11
+ ];
12
+
13
+ //#endregion
14
+ exports.BACKEND_INTLAYER_PACKAGES = BACKEND_INTLAYER_PACKAGES;
15
+ //# sourceMappingURL=backendPackages.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backendPackages.cjs","names":[],"sources":["../../../../src/init/utils/backendPackages.ts"],"sourcesContent":["/** Intlayer integrations for server frameworks (no bundler plugin). */\nexport const BACKEND_INTLAYER_PACKAGES = [\n 'express-intlayer',\n 'fastify-intlayer',\n 'adonis-intlayer',\n 'hono-intlayer',\n 'elysia-intlayer',\n 'remix-intlayer',\n];\n"],"mappings":";;;AACA,MAAa,4BAA4B;CACvC;CACA;CACA;CACA;CACA;CACA;AACF"}