@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
@@ -7,7 +7,7 @@ import { writeJSFile } from "./writeContentDeclaration/writeJSFile.js";
7
7
  import "./writeContentDeclaration/index.js";
8
8
  import { detectFormatCommand } from "./detectFormatCommand.js";
9
9
  import { getContentDeclarationFileTemplate } from "./getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.js";
10
- import { COMPAT_I18N_LIBRARIES, CompatI18nLibrary, PackageManager, detectCompatI18nLibraries, detectPackageManager, hasLintTooling, installPackages } from "./init/utils/packageManager.js";
10
+ import { COMPAT_I18N_LIBRARIES, CompatI18nLibrary, PackageManager, detectCompatI18nLibraries, detectPackageManager, findLockFileDir, hasLintTooling, installPackages } from "./init/utils/packageManager.js";
11
11
  import { RoutingMode } from "./init/utils/configManipulation.js";
12
12
  import { CmsCredentials, enableEditorInConfig, setupCmsCredentials, writeCmsCredentialsToEnv } from "./init/cms.js";
13
13
  import { DocumentationRouter, DocumentationRouterType, getDocumentationUrl } from "./init/documentationRouter.js";
@@ -23,4 +23,4 @@ import { listDictionaries, listDictionariesWithStats } from "./listDictionariesP
23
23
  import { DiffMode, ListGitFilesOptions, ListGitLinesOptions, listGitFiles, listGitLines } from "./listGitFiles.js";
24
24
  import { ListProjectsOptions, getGitRootDir, listProjects } from "./listProjects.js";
25
25
  import { logConfigDetails } from "./logConfigDetails.js";
26
- export { COMPAT_I18N_LIBRARIES, type CmsCredentials, type CompatI18nLibrary, ContentStrategy, DictionaryStatus, DiffMode, DocumentationRouter, type DocumentationRouterType, InitOptions, ListGitFilesOptions, ListGitLinesOptions, ListProjectsOptions, MCPTransport, NEXT_INTLAYER_BABEL_CONFIG_CONTENT, PLATFORMS, PLATFORMS_METADATA, type PackageManager, Platform, PlatformMetadata, type RoutingMode, SKILLS, SKILLS_METADATA, Skill, UpgradeIntlayerPackagesOptions, UpgradeIntlayerPackagesResult, detectCompatI18nLibraries, detectExportedComponentName, detectFormatCommand, detectPackageManager, enableEditorInConfig, getContentDeclarationFileTemplate, getDefaultApplicationURL, getDocumentationUrl, getGitRootDir, getInitialSkills, hasLintTooling, hasUrlRoutingFramework, initIntlayer, installLSP, installMCP, installPackages, installSkills, listDictionaries, listDictionariesWithStats, listGitFiles, listGitLines, listProjects, logConfigDetails, logInitSuccessMessage, prepareIntlayer, setupCmsCredentials, transformJSFile, upgradeIntlayerPackages, writeCmsCredentialsToEnv, writeContentDeclaration, writeJSFile };
26
+ export { COMPAT_I18N_LIBRARIES, type CmsCredentials, type CompatI18nLibrary, ContentStrategy, DictionaryStatus, DiffMode, DocumentationRouter, type DocumentationRouterType, InitOptions, ListGitFilesOptions, ListGitLinesOptions, ListProjectsOptions, MCPTransport, NEXT_INTLAYER_BABEL_CONFIG_CONTENT, PLATFORMS, PLATFORMS_METADATA, type PackageManager, Platform, PlatformMetadata, type RoutingMode, SKILLS, SKILLS_METADATA, Skill, UpgradeIntlayerPackagesOptions, UpgradeIntlayerPackagesResult, detectCompatI18nLibraries, detectExportedComponentName, detectFormatCommand, detectPackageManager, enableEditorInConfig, findLockFileDir, getContentDeclarationFileTemplate, getDefaultApplicationURL, getDocumentationUrl, getGitRootDir, getInitialSkills, hasLintTooling, hasUrlRoutingFramework, initIntlayer, installLSP, installMCP, installPackages, installSkills, listDictionaries, listDictionariesWithStats, listGitFiles, listGitLines, listProjects, logConfigDetails, logInitSuccessMessage, prepareIntlayer, setupCmsCredentials, transformJSFile, upgradeIntlayerPackages, writeCmsCredentialsToEnv, writeContentDeclaration, writeJSFile };
@@ -39,7 +39,7 @@ export type InitOptions = {
39
39
  noEslint?: boolean;
40
40
  /**
41
41
  * Skip the project setup: tsconfig types/aliases, the Intlayer config file,
42
- * bundler/framework configs, the dev script and framework-specific
42
+ * bundler/framework configs and framework-specific
43
43
  * scaffolding (middleware/proxy, providers in layout/page). Defaults to
44
44
  * enabled.
45
45
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/init/index.ts"],"mappings":";;;;;;;;;;qBA6Ea,2BAAwB,cACrB;;;;;;;;;;YAsBJ;;;;YAQA;EACV;;EAEA;;;;;EAKA;;EAEA;;EAEA;;EAEA;;;;;;;EAOA;;EAEA;;;;;;EAMA;;;;;;EAMA,cAAc;;;;;;;EAOd;;;;;;;EAOA,kBAAkB;;;;;qBAMP,eAAY,iBAAyB,UAAY,gBAAW;;;qBA6kC5D,wBAAqB"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/init/index.ts"],"mappings":";;;;;;;;;;qBA4Ea,2BAAwB,cACrB;;;;;;;;;;YAsBJ;;;;YAQA;EACV;;EAEA;;;;;EAKA;;EAEA;;EAEA;;EAEA;;;;;;;EAOA;;EAEA;;;;;;EAMA;;;;;;EAMA,cAAc;;;;;;;EAOd;;;;;;;EAOA,kBAAkB;;;;;qBAMP,eAAY,iBAAyB,UAAY,gBAAW;;;qBAqjC5D,wBAAqB"}
@@ -0,0 +1,5 @@
1
+ //#region src/init/utils/backendPackages.d.ts
2
+ /** Intlayer integrations for server frameworks (no bundler plugin). */
3
+ export declare const BACKEND_INTLAYER_PACKAGES: string[];
4
+ //#endregion
5
+ //# sourceMappingURL=backendPackages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backendPackages.d.ts","names":[],"sources":["../../../../src/init/utils/backendPackages.ts"],"mappings":";;qBACa"}
@@ -1,7 +1,7 @@
1
1
  import { COMPAT_I18N_LIBRARIES, COMPAT_PACKAGE_REPLACEMENTS, CompatI18nLibrary, CompatSyncConfig, CompatVitePluginConfig, DetectMissingPackagesOptions, IntlayerPackageAnalysis, MINIMUM_ESLINT_MAJOR, PENDING_COMPAT_ADAPTERS, PackageManager, detectCompatI18nLibraries, detectMissingIntlayerPackages, detectPackageManager, findLockFileDir, hasLegacyEslint, hasLintTooling, installPackages, isIntlayerPackageName, moveCompatPackagesToDevDependencies, normalizeVersion, runPackageInstall } from "./packageManager.js";
2
2
  import { RoutingMode, enableIntlayerEditorConfig, getMetroConfigTemplate, hasIntlayerVitePlugin, replaceViteConfigPluginImportSource, setIntlayerConfigCompilerOutput, setIntlayerConfigEnableProxy, setIntlayerConfigRoutingMode, setIntlayerConfigRoutingStorageOnly, updateAstroConfig, updateIntlayerConfigWithSyncPlugin, updateMetroConfig, updateNextConfig, updateNextConfigForNextI18next, updateNextConfigForNextIntl, updateNextConfigForNextTranslate, updateNuxtConfig, updateNuxtConfigForNuxtjsI18n, updateViteConfig, updateViteConfigForCompatPlugin, updateViteConfigForVueI18n } from "./configManipulation.js";
3
3
  import { ensureNamedImport, firstInsertIndex, isModuleScopeBinding } from "./astImports.js";
4
- import { BACKEND_INTLAYER_PACKAGES, ResolveDevScriptParams, resolveDevScript } from "./devScript.js";
4
+ import { BACKEND_INTLAYER_PACKAGES } from "./backendPackages.js";
5
5
  import { JsonLocalePattern, JsonLocalePatternType, LinguiCatalogPattern, NextIntlMessagesPattern, detectJsonLocalePattern, detectLinguiCatalogPattern, detectNextIntlMessagesPattern, ensureDirectory, exists, readFileFromRoot, writeFileToRoot } from "./fileSystem.js";
6
6
  import { GITHUB_FILL_WORKFLOW_PATH, GITHUB_TEST_WORKFLOW_PATH, GithubWorkflowFile, GithubWorkflowsContext, GithubWorkflowsOptions, getGithubWorkflows, resolveGithubWorkflowsContext } from "./githubActions.js";
7
7
  import { IntlayerDependency, IntlayerDependencyUpgrade, PackageJsonIntlayerDependencies, fetchLatestPackageVersion, findPackageJsonFiles, getIntlayerDependencies, getIntlayerDependencyUpgrades, listIntlayerDependencies, toRange, writeIntlayerDependencyUpgrades } from "./intlayerDependencies.js";
@@ -11,4 +11,4 @@ import { NEXT_INTLAYER_BABEL_CONFIG_CONTENT, setupNextCompilerBabelConfig } from
11
11
  import { findTsConfigFiles } from "./tsConfig.js";
12
12
  import { hasUrlRoutingFramework } from "./urlRoutingFramework.js";
13
13
  import { isVersionAtLeast } from "./version.js";
14
- export { BACKEND_INTLAYER_PACKAGES, COMPAT_I18N_LIBRARIES, COMPAT_PACKAGE_REPLACEMENTS, CompatI18nLibrary, CompatSyncConfig, CompatVitePluginConfig, DetectMissingPackagesOptions, GITHUB_FILL_WORKFLOW_PATH, GITHUB_TEST_WORKFLOW_PATH, GithubWorkflowFile, GithubWorkflowsContext, GithubWorkflowsOptions, IntlayerDependency, IntlayerDependencyUpgrade, IntlayerPackageAnalysis, JsonLocalePattern, JsonLocalePatternType, LINT_PLUGIN_PACKAGE_NAME, LinguiCatalogPattern, MINIMUM_ESLINT_MAJOR, NEXT_INTLAYER_BABEL_CONFIG_CONTENT, NextIntlMessagesPattern, OxlintConfig, PENDING_COMPAT_ADAPTERS, PackageJsonIntlayerDependencies, PackageManager, ResolveDevScriptParams, RoutingMode, addIntlayerRulesToOxlintConfig, detectCompatI18nLibraries, detectJsonLocalePattern, detectLinguiCatalogPattern, detectMissingIntlayerPackages, detectNextIntlMessagesPattern, detectPackageManager, enableIntlayerEditorConfig, ensureDirectory, ensureNamedImport, exists, fetchLatestPackageVersion, findLockFileDir, findPackageJsonFiles, findTsConfigFiles, firstInsertIndex, getGithubWorkflows, getIntlayerDependencies, getIntlayerDependencyUpgrades, getMetroConfigTemplate, hasIntlayerVitePlugin, hasLegacyEslint, hasLintTooling, hasUrlRoutingFramework, installPackages, isIntlayerPackageName, isModuleScopeBinding, isVersionAtLeast, listIntlayerDependencies, moveCompatPackagesToDevDependencies, normalizeVersion, parseJSONWithComments, readFileFromRoot, replaceViteConfigPluginImportSource, resolveDevScript, resolveGithubWorkflowsContext, runPackageInstall, setIntlayerConfigCompilerOutput, setIntlayerConfigEnableProxy, setIntlayerConfigRoutingMode, setIntlayerConfigRoutingStorageOnly, setupNextCompilerBabelConfig, toRange, updateAstroConfig, updateIntlayerConfigWithSyncPlugin, updateMetroConfig, updateNextConfig, updateNextConfigForNextI18next, updateNextConfigForNextIntl, updateNextConfigForNextTranslate, updateNuxtConfig, updateNuxtConfigForNuxtjsI18n, updateViteConfig, updateViteConfigForCompatPlugin, updateViteConfigForVueI18n, writeFileToRoot, writeIntlayerDependencyUpgrades };
14
+ export { BACKEND_INTLAYER_PACKAGES, COMPAT_I18N_LIBRARIES, COMPAT_PACKAGE_REPLACEMENTS, CompatI18nLibrary, CompatSyncConfig, CompatVitePluginConfig, DetectMissingPackagesOptions, GITHUB_FILL_WORKFLOW_PATH, GITHUB_TEST_WORKFLOW_PATH, GithubWorkflowFile, GithubWorkflowsContext, GithubWorkflowsOptions, IntlayerDependency, IntlayerDependencyUpgrade, IntlayerPackageAnalysis, JsonLocalePattern, JsonLocalePatternType, LINT_PLUGIN_PACKAGE_NAME, LinguiCatalogPattern, MINIMUM_ESLINT_MAJOR, NEXT_INTLAYER_BABEL_CONFIG_CONTENT, NextIntlMessagesPattern, OxlintConfig, PENDING_COMPAT_ADAPTERS, PackageJsonIntlayerDependencies, PackageManager, RoutingMode, addIntlayerRulesToOxlintConfig, detectCompatI18nLibraries, detectJsonLocalePattern, detectLinguiCatalogPattern, detectMissingIntlayerPackages, detectNextIntlMessagesPattern, detectPackageManager, enableIntlayerEditorConfig, ensureDirectory, ensureNamedImport, exists, fetchLatestPackageVersion, findLockFileDir, findPackageJsonFiles, findTsConfigFiles, firstInsertIndex, getGithubWorkflows, getIntlayerDependencies, getIntlayerDependencyUpgrades, getMetroConfigTemplate, hasIntlayerVitePlugin, hasLegacyEslint, hasLintTooling, hasUrlRoutingFramework, installPackages, isIntlayerPackageName, isModuleScopeBinding, isVersionAtLeast, listIntlayerDependencies, moveCompatPackagesToDevDependencies, normalizeVersion, parseJSONWithComments, readFileFromRoot, replaceViteConfigPluginImportSource, resolveGithubWorkflowsContext, runPackageInstall, setIntlayerConfigCompilerOutput, setIntlayerConfigEnableProxy, setIntlayerConfigRoutingMode, setIntlayerConfigRoutingStorageOnly, setupNextCompilerBabelConfig, toRange, updateAstroConfig, updateIntlayerConfigWithSyncPlugin, updateMetroConfig, updateNextConfig, updateNextConfigForNextI18next, updateNextConfigForNextIntl, updateNextConfigForNextTranslate, updateNuxtConfig, updateNuxtConfigForNuxtjsI18n, updateViteConfig, updateViteConfigForCompatPlugin, updateViteConfigForVueI18n, writeFileToRoot, writeIntlayerDependencyUpgrades };
@@ -9,6 +9,7 @@ export declare const SKILLS_METADATA: {
9
9
  readonly Usage: 'How to use Intlayer in your project';
10
10
  readonly CLI: 'Intlayer CLI commands and usage';
11
11
  readonly Compiler: 'Intlayer Compiler setup and usage for automatic content extraction without .content files';
12
+ readonly BundleOptimization: 'Purge, minify and import modes; writing code the bundle optimizer can follow';
12
13
  readonly RemoteContent: 'How to use Intlayer with Remote/CMS/Server-side content';
13
14
  readonly DevTools: 'ESLint, LSP, VS Code & Chrome extensions, MCP server and CI/CD';
14
15
  readonly Compat: 'Migrate from i18next, next-intl, react-intl, vue-i18n, Lingui… keeping their API';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/installSkills/index.ts"],"mappings":";;;;qBASa;WACX;WACA;WACA;WAEA;WACA;WACA;WAEA;WACA;WACA;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;YAIU,qBAAqB;qBAEpB,QAAyC;;;;;;;qBAoFzC,mBAAgB,cACb,2BACb;iBAUc;EACf;EACA;EACA;;;;;qBAMW,oBAAoB,eAAe;YA6JpC,wBAAwB;qBAEvB,WAA+C;;;;;qBA8G/C,gBAAa,qBACL,UACT,UAAQ,QACV,YACP"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/installSkills/index.ts"],"mappings":";;;;qBASa;WACX;WACA;WACA;WAEA;WACA;WACA;WAEA;WAEA;WACA;WACA;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;YAIU,qBAAqB;qBAEpB,QAAyC;;;;;;;qBAqFzC,mBAAgB,cACb,2BACb;iBAUc;EACf;EACA;EACA;;;;;qBAMW,oBAAoB,eAAe;YA6JpC,wBAAwB;qBAEvB,WAA+C;;;;;qBA8G/C,gBAAa,qBACL,UACT,UAAQ,QACV,YACP"}
@@ -1 +1 @@
1
- {"version":3,"file":"loadRemoteDictionaries.d.ts","names":[],"sources":["../../../src/loadDictionaries/loadRemoteDictionaries.ts"],"mappings":";;;;qBAea,4BAAyB,eACrB,gBAAgB,kBAC9B;qBAOU,yBAAsB,0CAAA,gBAAA,kBAEf,QAAQ,+BAA6B;EAErD;EACA;EACA,WAAW,OAAO;MAEnB,QAAQ"}
1
+ {"version":3,"file":"loadRemoteDictionaries.d.ts","names":[],"sources":["../../../src/loadDictionaries/loadRemoteDictionaries.ts"],"mappings":";;;;qBAYa,4BAAyB,eACrB,gBAAgB,kBAC9B;qBAOU,yBAAsB,0CAAA,gBAAA,kBAEf,QAAQ,+BAA6B;EAErD;EACA;EACA,WAAW,OAAO;MAEnB,QAAQ"}
@@ -0,0 +1,14 @@
1
+ import { fetchDistantDictionaries } from "../fetchDistantDictionaries.js";
2
+ import { IntlayerConfig } from "@intlayer/types/config";
3
+ import { dictionaryEndpoint } from "@intlayer/api/dictionary";
4
+ //#region src/loadDictionaries/remoteDictionaryClient.d.ts
5
+ /**
6
+ * Creates the CMS dictionary client.
7
+ *
8
+ * Kept in its own module so `loadRemoteDictionaries` can import it lazily:
9
+ * `@intlayer/api` is only loaded when remote credentials are configured.
10
+ */
11
+ export declare const createRemoteDictionaryClient: (configuration: IntlayerConfig) => ReturnType<typeof dictionaryEndpoint>;
12
+ //#endregion
13
+ export { fetchDistantDictionaries };
14
+ //# sourceMappingURL=remoteDictionaryClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remoteDictionaryClient.d.ts","names":[],"sources":["../../../src/loadDictionaries/remoteDictionaryClient.ts"],"mappings":";;;;;;;;;;qBAYa,+BAA4B,eACxB,mBACd,kBAAkB"}
@@ -0,0 +1,67 @@
1
+ import { IntlayerConfig } from "@intlayer/types/config";
2
+ //#region src/prepareIntlayerServer.d.ts
3
+ /**
4
+ * Explicit override, for any setup the detection below does not recognise:
5
+ * `INTLAYER_WATCH=true` forces the content watcher on, `INTLAYER_WATCH=false`
6
+ * forces it off.
7
+ */
8
+ export declare const INTLAYER_WATCH_ENV_VAR = "INTLAYER_WATCH";
9
+ /**
10
+ * Whether a command line is a watcher that restarts its child on changes.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * getIsDevWatcherCommand('node /app/node_modules/.bin/nodemon src/index.ts'); // → true
15
+ * getIsDevWatcherCommand('node dist/index.js'); // → false
16
+ * ```
17
+ */
18
+ export declare const getIsDevWatcherCommand: (command: string) => boolean;
19
+ /**
20
+ * Whether a server process runs in development, and so should watch the
21
+ * content declarations.
22
+ *
23
+ * `INTLAYER_WATCH=true|false` decides first, then `NODE_ENV` when set. An unset
24
+ * `NODE_ENV` is not a sign of development (`bun dist/index.mjs` rarely sets
25
+ * it), so the process must then show a positive signal, cheapest first:
26
+ * 1. a runtime watch flag or marker (`bun --watch`/`--hot`, `node --watch`,
27
+ * `ts-node-dev`);
28
+ * 2. a `dev`-like package script;
29
+ * 3. a restarting watcher in its own command line or its ancestors'
30
+ * (`deno run --watch`, `nodemon`, `tsx watch`…), for those started
31
+ * directly rather than through a script.
32
+ */
33
+ export declare const getIsServerDevelopment: () => Promise<boolean>;
34
+ export type PrepareIntlayerServerOptions = {
35
+ /**
36
+ * How the integration names itself in the watcher lock and in messages, e.g.
37
+ * `express-intlayer`.
38
+ */
39
+ label: string;
40
+ /**
41
+ * Whether to watch the content declarations after preparing them.
42
+ * Defaults to {@link getIsServerDevelopment}.
43
+ */
44
+ watch?: boolean;
45
+ };
46
+ /**
47
+ * Prepares the dictionaries for a server integration (Express, Fastify, Hono…)
48
+ * and, in development, keeps them in sync with the content declarations.
49
+ *
50
+ * Replaces wrapping the dev server in `intlayer watch --with`: the watcher runs
51
+ * inside the server, deduplicated through the project's watcher lock, so a
52
+ * server restarted by `tsx watch` / `node --watch` hands it over to its
53
+ * successor, and a remaining `intlayer watch` makes it stand down.
54
+ *
55
+ * Fire-and-forget: the server must not wait on the build to start listening.
56
+ *
57
+ * @param configuration - The resolved Intlayer configuration.
58
+ * @param options - How the integration identifies itself, and whether to watch.
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * prepareIntlayerServer(getConfiguration(), { label: 'express-intlayer' });
63
+ * ```
64
+ */
65
+ export declare const prepareIntlayerServer: (configuration: IntlayerConfig, { label, watch }: PrepareIntlayerServerOptions) => void;
66
+ //#endregion
67
+ //# sourceMappingURL=prepareIntlayerServer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepareIntlayerServer.d.ts","names":[],"sources":["../../src/prepareIntlayerServer.ts"],"mappings":";;;;;;;qBAWa;;;;;;;;;;qBAiDA,yBAAsB;;;;;;;;;;;;;;;qBA4BtB,8BAAmC;YAkCpC;;;;;EAKV;;;;;EAKA;;;;;;;;;;;;;;;;;;;;;qBAsBW,wBAAqB,eACjB,kBAAc,OAAA,SACX"}
@@ -0,0 +1,35 @@
1
+ //#region src/utils/getProcessChainCommands.d.ts
2
+ /** Process as listed by the OS: its parent and the command line it runs. */
3
+ export type ProcessEntry = {
4
+ parentPid: number;
5
+ command: string;
6
+ };
7
+ /**
8
+ * Parses the output of `ps -A -o pid=,ppid=,command=`.
9
+ *
10
+ * @param output - One `<pid> <ppid> <command>` row per line.
11
+ * @returns The processes, keyed by PID.
12
+ */
13
+ export declare const parseProcessTable: (output: string) => Map<number, ProcessEntry>;
14
+ /**
15
+ * Command lines of this process and of the processes above it, closest first.
16
+ *
17
+ * This process is included because some runtimes restart the script inside
18
+ * the same process, leaving their watch flag only on their own command line
19
+ * (`deno run --watch`).
20
+ *
21
+ * Best effort: resolves to an empty list on Windows, or when the process list
22
+ * cannot be read (sandbox, missing `ps`, Deno without the permission), and
23
+ * never throws.
24
+ *
25
+ * @param maxDepth - How many processes to read at most, this one included.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * await getProcessChainCommands();
30
+ * // → ['node src/index.js', 'node …/nodemon src/index.js', 'npm run dev']
31
+ * ```
32
+ */
33
+ export declare const getProcessChainCommands: (maxDepth?: number) => Promise<string[]>;
34
+ //#endregion
35
+ //# sourceMappingURL=getProcessChainCommands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getProcessChainCommands.d.ts","names":[],"sources":["../../../src/utils/getProcessChainCommands.ts"],"mappings":";;YAKY;EACV;EACA;;;;;;;;qBAYW,oBAAiB,mBAE3B,YAAY;;;;;;;;;;;;;;;;;;;;qBA2GF,0BAAuB,sBAEjC"}
@@ -20,6 +20,7 @@ import { RunOnceContext, runOnce } from "./runOnce.js";
20
20
  import { ParallelHandle, runParallel } from "./runParallel/index.js";
21
21
  import { sortAlphabetically } from "./sortAlphabetically.js";
22
22
  import { splitTextByLines } from "./splitTextByLine.js";
23
+ import { StartContentWatcherOptions, startContentWatcher } from "./startContentWatcher.js";
23
24
  import { verifyIdenticObjectFormat } from "./verifyIdenticObjectFormat.js";
24
25
  import { withFileLock } from "./withFileLock.js";
25
- export { CLI_CONTENT_WATCHER_ENV_VAR, ContentDeclarationFileName, ContentWatcherOwner, ContentWatcherSource, Extension, Format, JSONObject, JsonChunk, ParallelHandle, Primitive, Queue, Recursive, RunOnceContext, acquireContentWatcherLock, assembleJSON, autoDecorateContent, buildComponentFilesList, chunkArray, chunkJSON, claimCliContentWatcher, excludeObjectFormat, formatLocale, formatPath, getChunk, getCliContentWatcherLabel, getContentExtension, getContentWatcherLockFilePath, getContentWatcherOwner, getExtensionFromFormat, getFormatFromExtension, getGlobalLimiter, getPathHash, getTaskLimiter, mergeChunks, pLimit, parallelize, parallelizeGlobal, parseContentDeclarationFileName, reconstructFromSingleChunk, reduceObjectFormat, reportRedundantContentWatcher, resolveObjectPromises, resolveRelativePath, runOnce, runParallel, sortAlphabetically, splitTextByLines, verifyIdenticObjectFormat, withFileLock };
26
+ export { CLI_CONTENT_WATCHER_ENV_VAR, ContentDeclarationFileName, ContentWatcherOwner, ContentWatcherSource, Extension, Format, JSONObject, JsonChunk, ParallelHandle, Primitive, Queue, Recursive, RunOnceContext, StartContentWatcherOptions, acquireContentWatcherLock, assembleJSON, autoDecorateContent, buildComponentFilesList, chunkArray, chunkJSON, claimCliContentWatcher, excludeObjectFormat, formatLocale, formatPath, getChunk, getCliContentWatcherLabel, getContentExtension, getContentWatcherLockFilePath, getContentWatcherOwner, getExtensionFromFormat, getFormatFromExtension, getGlobalLimiter, getPathHash, getTaskLimiter, mergeChunks, pLimit, parallelize, parallelizeGlobal, parseContentDeclarationFileName, reconstructFromSingleChunk, reduceObjectFormat, reportRedundantContentWatcher, resolveObjectPromises, resolveRelativePath, runOnce, runParallel, sortAlphabetically, splitTextByLines, startContentWatcher, verifyIdenticObjectFormat, withFileLock };
@@ -0,0 +1,40 @@
1
+ import { IntlayerConfig } from "@intlayer/types/config";
2
+ //#region src/utils/startContentWatcher.d.ts
3
+ export type StartContentWatcherOptions = {
4
+ /**
5
+ * How the integration names itself in the lock and in messages, e.g.
6
+ * `vite-intlayer`.
7
+ */
8
+ label: string;
9
+ /**
10
+ * Whether this process must never own the watcher, re-checked on every
11
+ * attempt (e.g. a helper process that outlives the dev server).
12
+ */
13
+ getShouldSkip?: () => boolean;
14
+ };
15
+ /**
16
+ * Starts the content declaration watcher from an integration (bundler plugin or
17
+ * server middleware), making sure only one watcher rebuilds a project's
18
+ * dictionaries.
19
+ *
20
+ * - Idempotent within a process, across module copies and hot reloads.
21
+ * - Stands down, with an explanation, when `intlayer watch` already covers the
22
+ * project, whether it spawned this process (`--with`) or runs elsewhere.
23
+ * - Otherwise the first process to take the project lock watches; the others
24
+ * retry in the background to take over once it stops.
25
+ *
26
+ * Not awaitable on purpose: a dev server must not wait on the watcher to serve.
27
+ *
28
+ * @param configuration - The resolved Intlayer configuration.
29
+ * @param options - How the integration identifies itself.
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * configureServer() {
34
+ * startContentWatcher(configuration, { label: 'vite-intlayer' });
35
+ * }
36
+ * ```
37
+ */
38
+ export declare const startContentWatcher: (configuration: IntlayerConfig, options: StartContentWatcherOptions) => void;
39
+ //#endregion
40
+ //# sourceMappingURL=startContentWatcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"startContentWatcher.d.ts","names":[],"sources":["../../../src/utils/startContentWatcher.ts"],"mappings":";;YAgBY;;;;;EAKV;;;;;EAKA;;;;;;;;;;;;;;;;;;;;;;;;;qBA6GW,sBAAmB,eACf,gBAAc,SACpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"watcher.d.ts","names":[],"sources":["../../src/watcher.ts"],"mappings":";;;KA2DK;EACH,gBAAgB;EAChB,gBAAgB;EAChB;EACA;;qBAsBW,QAAK,UAAoB,iBAAY;EAkDZ,mBAAM;;qBA2Q/B,wBAAqB,UAAoB,iBAAY"}
1
+ {"version":3,"file":"watcher.d.ts","names":[],"sources":["../../src/watcher.ts"],"mappings":";;;KA0DK;EACH,gBAAgB;EAChB,gBAAgB;EAChB;EACA;;qBAsBW,QAAK,UAAoB,iBAAY;EAkDZ,mBAAM;;qBAgR/B,wBAAqB,UAAoB,iBAAY"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/engine",
3
- "version": "9.5.11",
3
+ "version": "9.5.12",
4
4
  "private": false,
5
5
  "description": "Scans and builds Intlayer declaration files into dictionaries based on Intlayer configuration.",
6
6
  "keywords": [
@@ -150,11 +150,11 @@
150
150
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
151
151
  },
152
152
  "dependencies": {
153
- "@intlayer/api": "9.5.11",
154
- "@intlayer/config": "9.5.11",
155
- "@intlayer/core": "9.5.11",
156
- "@intlayer/dictionaries-entry": "9.5.11",
157
- "@intlayer/types": "9.5.11",
153
+ "@intlayer/api": "9.5.12",
154
+ "@intlayer/config": "9.5.12",
155
+ "@intlayer/core": "9.5.12",
156
+ "@intlayer/dictionaries-entry": "9.5.12",
157
+ "@intlayer/types": "9.5.12",
158
158
  "@parcel/watcher": "2.6.0",
159
159
  "defu": "6.1.7",
160
160
  "fast-glob": "3.3.3",
@@ -174,7 +174,7 @@
174
174
  "zod": "4.6.5"
175
175
  },
176
176
  "peerDependencies": {
177
- "@intlayer/babel": "9.5.11"
177
+ "@intlayer/babel": "9.5.12"
178
178
  },
179
179
  "peerDependenciesMeta": {
180
180
  "@intlayer/babel": {
@@ -1,57 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- //#region src/init/utils/devScript.ts
3
- /**
4
- * Frameworks with no Intlayer bundler plugin to host the content watcher.
5
- *
6
- * Their dev server is a plain Node process, so the only way to rebuild
7
- * `.intlayer` on a content change is to run the watcher next to it.
8
- */
9
- const BACKEND_INTLAYER_PACKAGES = [
10
- "express-intlayer",
11
- "fastify-intlayer",
12
- "adonis-intlayer",
13
- "hono-intlayer",
14
- "elysia-intlayer",
15
- "remix-intlayer"
16
- ];
17
- /**
18
- * Resolves the `dev` script `intlayer init` should write, or `null` when the
19
- * project's script must be left alone.
20
- *
21
- * A Next.js app is always left alone: `withIntlayer` starts the content watcher
22
- * itself on both bundlers, so wrapping the dev server in `intlayer watch --with`
23
- * would only add a second watcher rebuilding the same dictionaries. This is checked on the
24
- * `next` dependency as well as on the config file, since `next.config.*` is
25
- * optional, and it takes precedence over the backend list, which a Next.js app
26
- * with a custom server (or a monorepo root) can match too.
27
- *
28
- * @example a backend project gets its dev server wrapped
29
- * ```ts
30
- * resolveDevScript({
31
- * devScript: 'node ./src/index.ts',
32
- * allDeps: { 'express-intlayer': '9.0.0' },
33
- * isNextJsProject: false,
34
- * }); // → "intlayer watch --with 'node ./src/index.ts'"
35
- * ```
36
- *
37
- * @example a Next.js project keeps its own script
38
- * ```ts
39
- * resolveDevScript({
40
- * devScript: 'next dev',
41
- * allDeps: { next: '16.0.0' },
42
- * isNextJsProject: true,
43
- * }); // → null
44
- * ```
45
- */
46
- const resolveDevScript = ({ devScript, allDeps, isNextJsProject }) => {
47
- if (!devScript) return null;
48
- if (isNextJsProject || Boolean(allDeps.next)) return null;
49
- if (!BACKEND_INTLAYER_PACKAGES.some((packageName) => allDeps[packageName])) return null;
50
- if (devScript.includes("intlayer watch")) return null;
51
- return `intlayer watch --with '${devScript}'`;
52
- };
53
-
54
- //#endregion
55
- exports.BACKEND_INTLAYER_PACKAGES = BACKEND_INTLAYER_PACKAGES;
56
- exports.resolveDevScript = resolveDevScript;
57
- //# sourceMappingURL=devScript.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"devScript.cjs","names":[],"sources":["../../../../src/init/utils/devScript.ts"],"sourcesContent":["/**\n * Frameworks with no Intlayer bundler plugin to host the content watcher.\n *\n * Their dev server is a plain Node process, so the only way to rebuild\n * `.intlayer` on a content change is to run the watcher next to it.\n */\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\nexport type ResolveDevScriptParams = {\n /** The project's current `dev` script, if it has one. */\n devScript?: string;\n /** Combined prod + dev dependencies of the project. */\n allDeps: Record<string, string>;\n /** Whether a `next.config.*` file was found in the project. */\n isNextJsProject: boolean;\n};\n\n/**\n * Resolves the `dev` script `intlayer init` should write, or `null` when the\n * project's script must be left alone.\n *\n * A Next.js app is always left alone: `withIntlayer` starts the content watcher\n * itself on both bundlers, so wrapping the dev server in `intlayer watch --with`\n * would only add a second watcher rebuilding the same dictionaries. This is checked on the\n * `next` dependency as well as on the config file, since `next.config.*` is\n * optional, and it takes precedence over the backend list, which a Next.js app\n * with a custom server (or a monorepo root) can match too.\n *\n * @example a backend project gets its dev server wrapped\n * ```ts\n * resolveDevScript({\n * devScript: 'node ./src/index.ts',\n * allDeps: { 'express-intlayer': '9.0.0' },\n * isNextJsProject: false,\n * }); // → \"intlayer watch --with 'node ./src/index.ts'\"\n * ```\n *\n * @example a Next.js project keeps its own script\n * ```ts\n * resolveDevScript({\n * devScript: 'next dev',\n * allDeps: { next: '16.0.0' },\n * isNextJsProject: true,\n * }); // → null\n * ```\n */\nexport const resolveDevScript = ({\n devScript,\n allDeps,\n isNextJsProject,\n}: ResolveDevScriptParams): string | null => {\n if (!devScript) return null;\n\n const isNextJsApp = isNextJsProject || Boolean(allDeps.next);\n\n if (isNextJsApp) return null;\n\n const hasBackendIntlayerPackage = BACKEND_INTLAYER_PACKAGES.some(\n (packageName) => allDeps[packageName]\n );\n\n if (!hasBackendIntlayerPackage) return null;\n\n // Re-running init must not nest one wrapper inside another.\n if (devScript.includes('intlayer watch')) return null;\n\n return `intlayer watch --with '${devScript}'`;\n};\n"],"mappings":";;;;;;;;AAMA,MAAa,4BAA4B;CACvC;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,MAAa,oBAAoB,EAC/B,WACA,SACA,sBAC2C;CAC3C,IAAI,CAAC,WAAW,OAAO;CAIvB,IAFoB,mBAAmB,QAAQ,QAAQ,IAAI,GAE1C,OAAO;CAMxB,IAAI,CAJ8B,0BAA0B,MACzD,gBAAgB,QAAQ,YAGE,GAAG,OAAO;CAGvC,IAAI,UAAU,SAAS,gBAAgB,GAAG,OAAO;CAEjD,OAAO,0BAA0B,UAAU;AAC7C"}
@@ -1,55 +0,0 @@
1
- //#region src/init/utils/devScript.ts
2
- /**
3
- * Frameworks with no Intlayer bundler plugin to host the content watcher.
4
- *
5
- * Their dev server is a plain Node process, so the only way to rebuild
6
- * `.intlayer` on a content change is to run the watcher next to it.
7
- */
8
- const BACKEND_INTLAYER_PACKAGES = [
9
- "express-intlayer",
10
- "fastify-intlayer",
11
- "adonis-intlayer",
12
- "hono-intlayer",
13
- "elysia-intlayer",
14
- "remix-intlayer"
15
- ];
16
- /**
17
- * Resolves the `dev` script `intlayer init` should write, or `null` when the
18
- * project's script must be left alone.
19
- *
20
- * A Next.js app is always left alone: `withIntlayer` starts the content watcher
21
- * itself on both bundlers, so wrapping the dev server in `intlayer watch --with`
22
- * would only add a second watcher rebuilding the same dictionaries. This is checked on the
23
- * `next` dependency as well as on the config file, since `next.config.*` is
24
- * optional, and it takes precedence over the backend list, which a Next.js app
25
- * with a custom server (or a monorepo root) can match too.
26
- *
27
- * @example a backend project gets its dev server wrapped
28
- * ```ts
29
- * resolveDevScript({
30
- * devScript: 'node ./src/index.ts',
31
- * allDeps: { 'express-intlayer': '9.0.0' },
32
- * isNextJsProject: false,
33
- * }); // → "intlayer watch --with 'node ./src/index.ts'"
34
- * ```
35
- *
36
- * @example a Next.js project keeps its own script
37
- * ```ts
38
- * resolveDevScript({
39
- * devScript: 'next dev',
40
- * allDeps: { next: '16.0.0' },
41
- * isNextJsProject: true,
42
- * }); // → null
43
- * ```
44
- */
45
- const resolveDevScript = ({ devScript, allDeps, isNextJsProject }) => {
46
- if (!devScript) return null;
47
- if (isNextJsProject || Boolean(allDeps.next)) return null;
48
- if (!BACKEND_INTLAYER_PACKAGES.some((packageName) => allDeps[packageName])) return null;
49
- if (devScript.includes("intlayer watch")) return null;
50
- return `intlayer watch --with '${devScript}'`;
51
- };
52
-
53
- //#endregion
54
- export { BACKEND_INTLAYER_PACKAGES, resolveDevScript };
55
- //# sourceMappingURL=devScript.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"devScript.mjs","names":[],"sources":["../../../../src/init/utils/devScript.ts"],"sourcesContent":["/**\n * Frameworks with no Intlayer bundler plugin to host the content watcher.\n *\n * Their dev server is a plain Node process, so the only way to rebuild\n * `.intlayer` on a content change is to run the watcher next to it.\n */\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\nexport type ResolveDevScriptParams = {\n /** The project's current `dev` script, if it has one. */\n devScript?: string;\n /** Combined prod + dev dependencies of the project. */\n allDeps: Record<string, string>;\n /** Whether a `next.config.*` file was found in the project. */\n isNextJsProject: boolean;\n};\n\n/**\n * Resolves the `dev` script `intlayer init` should write, or `null` when the\n * project's script must be left alone.\n *\n * A Next.js app is always left alone: `withIntlayer` starts the content watcher\n * itself on both bundlers, so wrapping the dev server in `intlayer watch --with`\n * would only add a second watcher rebuilding the same dictionaries. This is checked on the\n * `next` dependency as well as on the config file, since `next.config.*` is\n * optional, and it takes precedence over the backend list, which a Next.js app\n * with a custom server (or a monorepo root) can match too.\n *\n * @example a backend project gets its dev server wrapped\n * ```ts\n * resolveDevScript({\n * devScript: 'node ./src/index.ts',\n * allDeps: { 'express-intlayer': '9.0.0' },\n * isNextJsProject: false,\n * }); // → \"intlayer watch --with 'node ./src/index.ts'\"\n * ```\n *\n * @example a Next.js project keeps its own script\n * ```ts\n * resolveDevScript({\n * devScript: 'next dev',\n * allDeps: { next: '16.0.0' },\n * isNextJsProject: true,\n * }); // → null\n * ```\n */\nexport const resolveDevScript = ({\n devScript,\n allDeps,\n isNextJsProject,\n}: ResolveDevScriptParams): string | null => {\n if (!devScript) return null;\n\n const isNextJsApp = isNextJsProject || Boolean(allDeps.next);\n\n if (isNextJsApp) return null;\n\n const hasBackendIntlayerPackage = BACKEND_INTLAYER_PACKAGES.some(\n (packageName) => allDeps[packageName]\n );\n\n if (!hasBackendIntlayerPackage) return null;\n\n // Re-running init must not nest one wrapper inside another.\n if (devScript.includes('intlayer watch')) return null;\n\n return `intlayer watch --with '${devScript}'`;\n};\n"],"mappings":";;;;;;;AAMA,MAAa,4BAA4B;CACvC;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,MAAa,oBAAoB,EAC/B,WACA,SACA,sBAC2C;CAC3C,IAAI,CAAC,WAAW,OAAO;CAIvB,IAFoB,mBAAmB,QAAQ,QAAQ,IAAI,GAE1C,OAAO;CAMxB,IAAI,CAJ8B,0BAA0B,MACzD,gBAAgB,QAAQ,YAGE,GAAG,OAAO;CAGvC,IAAI,UAAU,SAAS,gBAAgB,GAAG,OAAO;CAEjD,OAAO,0BAA0B,UAAU;AAC7C"}
@@ -1,48 +0,0 @@
1
- //#region src/init/utils/devScript.d.ts
2
- /**
3
- * Frameworks with no Intlayer bundler plugin to host the content watcher.
4
- *
5
- * Their dev server is a plain Node process, so the only way to rebuild
6
- * `.intlayer` on a content change is to run the watcher next to it.
7
- */
8
- export declare const BACKEND_INTLAYER_PACKAGES: string[];
9
- export type ResolveDevScriptParams = {
10
- /** The project's current `dev` script, if it has one. */
11
- devScript?: string;
12
- /** Combined prod + dev dependencies of the project. */
13
- allDeps: Record<string, string>;
14
- /** Whether a `next.config.*` file was found in the project. */
15
- isNextJsProject: boolean;
16
- };
17
- /**
18
- * Resolves the `dev` script `intlayer init` should write, or `null` when the
19
- * project's script must be left alone.
20
- *
21
- * A Next.js app is always left alone: `withIntlayer` starts the content watcher
22
- * itself on both bundlers, so wrapping the dev server in `intlayer watch --with`
23
- * would only add a second watcher rebuilding the same dictionaries. This is checked on the
24
- * `next` dependency as well as on the config file, since `next.config.*` is
25
- * optional, and it takes precedence over the backend list, which a Next.js app
26
- * with a custom server (or a monorepo root) can match too.
27
- *
28
- * @example a backend project gets its dev server wrapped
29
- * ```ts
30
- * resolveDevScript({
31
- * devScript: 'node ./src/index.ts',
32
- * allDeps: { 'express-intlayer': '9.0.0' },
33
- * isNextJsProject: false,
34
- * }); // → "intlayer watch --with 'node ./src/index.ts'"
35
- * ```
36
- *
37
- * @example a Next.js project keeps its own script
38
- * ```ts
39
- * resolveDevScript({
40
- * devScript: 'next dev',
41
- * allDeps: { next: '16.0.0' },
42
- * isNextJsProject: true,
43
- * }); // → null
44
- * ```
45
- */
46
- export declare const resolveDevScript: ({ devScript, allDeps, isNextJsProject }: ResolveDevScriptParams) => string | null;
47
- //#endregion
48
- //# sourceMappingURL=devScript.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"devScript.d.ts","names":[],"sources":["../../../../src/init/utils/devScript.ts"],"mappings":";;;;;;;qBAMa;YASD;;EAEV;;EAEA,SAAS;;EAET;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAgCW,qBAAgB,WAAA,SAAA,mBAI1B"}