@intlayer/engine 9.5.7 → 9.5.9-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/dist/assets/installSkills/skills/angular.md +19 -68
  2. package/dist/assets/installSkills/skills/astro.md +38 -4
  3. package/dist/assets/installSkills/skills/backend.md +113 -0
  4. package/dist/assets/installSkills/skills/cli.md +29 -25
  5. package/dist/assets/installSkills/skills/compat.md +87 -0
  6. package/dist/assets/installSkills/skills/compiler.md +14 -4
  7. package/dist/assets/installSkills/skills/config.md +15 -5
  8. package/dist/assets/installSkills/skills/content.md +80 -6
  9. package/dist/assets/installSkills/skills/dev-tools.md +82 -0
  10. package/dist/assets/installSkills/skills/lit.md +115 -0
  11. package/dist/assets/installSkills/skills/markdown.md +96 -0
  12. package/dist/assets/installSkills/skills/next-js.md +21 -38
  13. package/dist/assets/installSkills/skills/preact.md +18 -0
  14. package/dist/assets/installSkills/skills/react.md +21 -4
  15. package/dist/assets/installSkills/skills/remix.md +95 -0
  16. package/dist/assets/installSkills/skills/remote-content.md +1 -1
  17. package/dist/assets/installSkills/skills/solid.md +21 -1
  18. package/dist/assets/installSkills/skills/svelte.md +22 -1
  19. package/dist/assets/installSkills/skills/usage.md +28 -0
  20. package/dist/assets/installSkills/skills/vanilla.md +108 -0
  21. package/dist/assets/installSkills/skills/vue.md +22 -0
  22. package/dist/cjs/_virtual/_utils_asset.cjs +1 -1
  23. package/dist/cjs/build.cjs +4 -4
  24. package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs +2 -2
  25. package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs +3 -3
  26. package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs +1 -1
  27. package/dist/cjs/buildIntlayerDictionary/writeNestedDictionary.cjs +3 -3
  28. package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs +2 -2
  29. package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs +2 -2
  30. package/dist/cjs/cleanOutputDir.cjs +1 -1
  31. package/dist/cjs/cleanRemovedContentDeclaration.cjs +1 -1
  32. package/dist/cjs/cli.cjs +5 -3
  33. package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs +1 -1
  34. package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs +2 -2
  35. package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs +2 -2
  36. package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs +2 -2
  37. package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs +2 -2
  38. package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs +2 -2
  39. package/dist/cjs/createType/createModuleAugmentation.cjs +3 -3
  40. package/dist/cjs/createType/createType.cjs +1 -1
  41. package/dist/cjs/docReview/index.cjs +5 -5
  42. package/dist/cjs/docReview/pipeline.cjs +4 -4
  43. package/dist/cjs/fetchDistantDictionaries.cjs +1 -1
  44. package/dist/cjs/handleContentDeclarationFileChange.cjs +2 -2
  45. package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs +1 -1
  46. package/dist/cjs/init/frameworkSetup/nextAppRouter/restructure.cjs +1 -1
  47. package/dist/cjs/init/frameworkSetup/tanstackStart/restructure.cjs +1 -1
  48. package/dist/cjs/init/index.cjs +305 -300
  49. package/dist/cjs/init/index.cjs.map +1 -1
  50. package/dist/cjs/init/upgradeIntlayerPackages.cjs +60 -0
  51. package/dist/cjs/init/upgradeIntlayerPackages.cjs.map +1 -0
  52. package/dist/cjs/init/utils/fileSystem.cjs +1 -1
  53. package/dist/cjs/init/utils/githubActions.cjs +1 -1
  54. package/dist/cjs/init/utils/index.cjs +13 -4
  55. package/dist/cjs/init/utils/intlayerDependencies.cjs +119 -0
  56. package/dist/cjs/init/utils/intlayerDependencies.cjs.map +1 -0
  57. package/dist/cjs/init/utils/packageManager.cjs +146 -95
  58. package/dist/cjs/init/utils/packageManager.cjs.map +1 -1
  59. package/dist/cjs/initConfig/index.cjs +1 -1
  60. package/dist/cjs/installLSP.cjs +1 -1
  61. package/dist/cjs/installMCP/installMCP.cjs +1 -1
  62. package/dist/cjs/installSkills/index.cjs +111 -20
  63. package/dist/cjs/installSkills/index.cjs.map +1 -1
  64. package/dist/cjs/listDictionariesPath.cjs +1 -1
  65. package/dist/cjs/listGitFiles.cjs +1 -1
  66. package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs +2 -2
  67. package/dist/cjs/loadDictionaries/index.cjs +1 -1
  68. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs +2 -2
  69. package/dist/cjs/loadDictionaries/loadDictionaries.cjs +1 -1
  70. package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs +1 -1
  71. package/dist/cjs/loadDictionaries/loadMarkdownContentDeclaration.cjs +1 -1
  72. package/dist/cjs/logConfigDetails.cjs +1 -1
  73. package/dist/cjs/prepareIntlayer.cjs +4 -4
  74. package/dist/cjs/scan/index.cjs +1 -1
  75. package/dist/cjs/scan/scanWebsite.cjs +1 -1
  76. package/dist/cjs/syncPluginKit/createFileAdapter.cjs +1 -1
  77. package/dist/cjs/syncPluginKit/index.cjs +1 -1
  78. package/dist/cjs/utils/buildComponentFilesList.cjs +1 -1
  79. package/dist/cjs/utils/contentWatcherLock.cjs +2 -2
  80. package/dist/cjs/utils/index.cjs +4 -4
  81. package/dist/cjs/utils/readDictionariesFromDisk.cjs +1 -1
  82. package/dist/cjs/utils/runOnce.cjs +1 -1
  83. package/dist/cjs/utils/runParallel/pidTree.cjs +1 -1
  84. package/dist/cjs/utils/withFileLock.cjs +1 -1
  85. package/dist/cjs/watcher.cjs +6 -6
  86. package/dist/cjs/writeConfiguration/index.cjs +1 -1
  87. package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs +2 -2
  88. package/dist/cjs/writeContentDeclaration/transformJSFile.cjs +1 -1
  89. package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs +4 -4
  90. package/dist/cjs/writeContentDeclaration/writeJSFile.cjs +3 -3
  91. package/dist/cjs/writeContentDeclaration/writeMarkdownFile.cjs +1 -1
  92. package/dist/cjs/writeContentDeclaration/writeYamlFile.cjs +1 -1
  93. package/dist/cjs/writeFileIfChanged.cjs +1 -1
  94. package/dist/esm/_virtual/_utils_asset.mjs +1 -1
  95. package/dist/esm/build.mjs +4 -4
  96. package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs +2 -2
  97. package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs +3 -3
  98. package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs +1 -1
  99. package/dist/esm/buildIntlayerDictionary/writeNestedDictionary.mjs +3 -3
  100. package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs +2 -2
  101. package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs +2 -2
  102. package/dist/esm/cleanOutputDir.mjs +1 -1
  103. package/dist/esm/cleanRemovedContentDeclaration.mjs +1 -1
  104. package/dist/esm/cli.mjs +5 -4
  105. package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs +1 -1
  106. package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs +2 -2
  107. package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs +2 -2
  108. package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs +2 -2
  109. package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs +2 -2
  110. package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs +2 -2
  111. package/dist/esm/createType/createModuleAugmentation.mjs +3 -3
  112. package/dist/esm/createType/createType.mjs +1 -1
  113. package/dist/esm/docReview/index.mjs +5 -5
  114. package/dist/esm/docReview/pipeline.mjs +4 -4
  115. package/dist/esm/fetchDistantDictionaries.mjs +1 -1
  116. package/dist/esm/handleContentDeclarationFileChange.mjs +2 -2
  117. package/dist/esm/handleUnlinkedContentDeclarationFile.mjs +1 -1
  118. package/dist/esm/init/frameworkSetup/nextAppRouter/restructure.mjs +1 -1
  119. package/dist/esm/init/frameworkSetup/tanstackStart/restructure.mjs +1 -1
  120. package/dist/esm/init/index.mjs +306 -301
  121. package/dist/esm/init/index.mjs.map +1 -1
  122. package/dist/esm/init/upgradeIntlayerPackages.mjs +57 -0
  123. package/dist/esm/init/upgradeIntlayerPackages.mjs.map +1 -0
  124. package/dist/esm/init/utils/fileSystem.mjs +1 -1
  125. package/dist/esm/init/utils/githubActions.mjs +1 -1
  126. package/dist/esm/init/utils/index.mjs +3 -2
  127. package/dist/esm/init/utils/intlayerDependencies.mjs +110 -0
  128. package/dist/esm/init/utils/intlayerDependencies.mjs.map +1 -0
  129. package/dist/esm/init/utils/packageManager.mjs +143 -93
  130. package/dist/esm/init/utils/packageManager.mjs.map +1 -1
  131. package/dist/esm/initConfig/index.mjs +1 -1
  132. package/dist/esm/installLSP.mjs +1 -1
  133. package/dist/esm/installMCP/installMCP.mjs +1 -1
  134. package/dist/esm/installSkills/index.mjs +111 -20
  135. package/dist/esm/installSkills/index.mjs.map +1 -1
  136. package/dist/esm/listDictionariesPath.mjs +1 -1
  137. package/dist/esm/listGitFiles.mjs +1 -1
  138. package/dist/esm/loadDictionaries/getIntlayerBundle.mjs +2 -2
  139. package/dist/esm/loadDictionaries/index.mjs +1 -1
  140. package/dist/esm/loadDictionaries/loadContentDeclaration.mjs +2 -2
  141. package/dist/esm/loadDictionaries/loadDictionaries.mjs +1 -1
  142. package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs +1 -1
  143. package/dist/esm/loadDictionaries/loadMarkdownContentDeclaration.mjs +1 -1
  144. package/dist/esm/logConfigDetails.mjs +1 -1
  145. package/dist/esm/prepareIntlayer.mjs +4 -4
  146. package/dist/esm/scan/index.mjs +1 -1
  147. package/dist/esm/scan/scanWebsite.mjs +1 -1
  148. package/dist/esm/syncPluginKit/createFileAdapter.mjs +1 -1
  149. package/dist/esm/syncPluginKit/index.mjs +1 -1
  150. package/dist/esm/utils/buildComponentFilesList.mjs +1 -1
  151. package/dist/esm/utils/contentWatcherLock.mjs +2 -2
  152. package/dist/esm/utils/index.mjs +4 -4
  153. package/dist/esm/utils/readDictionariesFromDisk.mjs +1 -1
  154. package/dist/esm/utils/runOnce.mjs +1 -1
  155. package/dist/esm/utils/runParallel/pidTree.mjs +1 -1
  156. package/dist/esm/utils/withFileLock.mjs +1 -1
  157. package/dist/esm/watcher.mjs +6 -6
  158. package/dist/esm/writeConfiguration/index.mjs +1 -1
  159. package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs +2 -2
  160. package/dist/esm/writeContentDeclaration/transformJSFile.mjs +1 -1
  161. package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs +4 -4
  162. package/dist/esm/writeContentDeclaration/writeJSFile.mjs +3 -3
  163. package/dist/esm/writeContentDeclaration/writeMarkdownFile.mjs +1 -1
  164. package/dist/esm/writeContentDeclaration/writeYamlFile.mjs +1 -1
  165. package/dist/esm/writeFileIfChanged.mjs +1 -1
  166. package/dist/types/cli.d.ts +2 -1
  167. package/dist/types/init/index.d.ts +9 -6
  168. package/dist/types/init/index.d.ts.map +1 -1
  169. package/dist/types/init/upgradeIntlayerPackages.d.ts +26 -0
  170. package/dist/types/init/upgradeIntlayerPackages.d.ts.map +1 -0
  171. package/dist/types/init/utils/index.d.ts +3 -2
  172. package/dist/types/init/utils/intlayerDependencies.d.ts +66 -0
  173. package/dist/types/init/utils/intlayerDependencies.d.ts.map +1 -0
  174. package/dist/types/init/utils/packageManager.d.ts +44 -19
  175. package/dist/types/init/utils/packageManager.d.ts.map +1 -1
  176. package/dist/types/installSkills/index.d.ts +16 -3
  177. package/dist/types/installSkills/index.d.ts.map +1 -1
  178. package/package.json +7 -7
@@ -1,8 +1,8 @@
1
1
  import { readAsset } from "../_virtual/_utils_asset.mjs";
2
+ import { promises } from "node:fs";
2
3
  import path from "node:path";
3
4
  import { v } from "@intlayer/config/logger";
4
5
  import { getMarkdownMetadata } from "@intlayer/core/markdown";
5
- import { promises } from "node:fs";
6
6
 
7
7
  //#region src/installSkills/index.ts
8
8
  /**
@@ -11,36 +11,127 @@ import { promises } from "node:fs";
11
11
  const SKILLS_METADATA = {
12
12
  Config: "Intlayer configuration documentation",
13
13
  Content: "Reference for all Intlayer content node types (t, enu, etc.)",
14
+ Markdown: "Markdown / rich text content: md(), MDX components, MarkdownProvider, SSR",
14
15
  Usage: "How to use Intlayer in your project",
15
16
  CLI: "Intlayer CLI commands and usage",
16
17
  Compiler: "Intlayer Compiler setup and usage for automatic content extraction without .content files",
17
18
  RemoteContent: "How to use Intlayer with Remote/CMS/Server-side content",
19
+ DevTools: "ESLint, LSP, VS Code & Chrome extensions, MCP server and CI/CD",
20
+ Compat: "Migrate from i18next, next-intl, react-intl, vue-i18n, Lingui… keeping their API",
18
21
  NextJS: "Next.js-specific usage (Server & Client components)",
19
22
  React: "React-specific syntax and hooks usage",
20
23
  Vue: "Vue-specific composables and syntax",
21
24
  Svelte: "Svelte-specific stores and syntax",
22
25
  Angular: "Angular-specific syntax and Injectable Function usage",
23
26
  Preact: "Preact-specific syntax and hooks usage",
24
- Solid: "Integrates Intlayer internationalization with SolidJS components. Use when the user asks to \"setup SolidJS i18n\", use the \"useIntlayer\" hook in Solid, or manage locales in a SolidJS application.",
25
- Astro: "Astro-specific usage and getIntlayer"
27
+ Solid: "Solid-specific syntax and hooks usage",
28
+ Astro: "Astro-specific usage, middleware and islands",
29
+ Lit: "Lit-specific ReactiveController usage (useIntlayer, useLocale)",
30
+ Vanilla: "Framework-less JavaScript usage (vanilla-intlayer)",
31
+ Remix: "Remix 3 router middleware and request-scoped hooks",
32
+ Backend: "Server-side usage for Express, Fastify, Hono, NestJS, AdonisJS and Elysia"
26
33
  };
27
34
  const SKILLS = Object.keys(SKILLS_METADATA);
28
- const getInitialSkills = (deps) => {
29
- const skills = [
30
- "Usage",
31
- "Content",
32
- "Config",
33
- "CLI",
34
- "Compiler"
35
- ];
36
- if (deps.next) skills.push("NextJS");
37
- if (deps.react || !deps.next) skills.push("React");
38
- if (deps.preact) skills.push("Preact");
39
- if (deps["solid-js"]) skills.push("Solid");
40
- if (deps.vue || deps.nuxt) skills.push("Vue");
41
- if (deps.svelte || deps["@sveltejs/kit"]) skills.push("Svelte");
42
- if (deps.astro) skills.push("Astro");
43
- return skills;
35
+ /** Skills preselected for every project, whatever its stack. */
36
+ const BASE_SKILLS = [
37
+ "Usage",
38
+ "Content",
39
+ "Config",
40
+ "CLI",
41
+ "Compiler",
42
+ "DevTools"
43
+ ];
44
+ /**
45
+ * Packages whose presence in `package.json` preselects a framework skill.
46
+ * Both the framework itself and its Intlayer adapter are listed, so a skill is
47
+ * suggested before and after the adapter is installed.
48
+ */
49
+ const SKILL_TRIGGER_PACKAGES = {
50
+ NextJS: ["next", "next-intlayer"],
51
+ React: [
52
+ "react",
53
+ "react-intlayer",
54
+ "react-native-intlayer",
55
+ "react-scripts-intlayer",
56
+ "lynx-intlayer"
57
+ ],
58
+ Preact: ["preact", "preact-intlayer"],
59
+ Solid: [
60
+ "solid-js",
61
+ "@solidjs/start",
62
+ "solid-intlayer"
63
+ ],
64
+ Vue: [
65
+ "vue",
66
+ "nuxt",
67
+ "vue-intlayer",
68
+ "nuxt-intlayer"
69
+ ],
70
+ Svelte: [
71
+ "svelte",
72
+ "@sveltejs/kit",
73
+ "svelte-intlayer"
74
+ ],
75
+ Angular: [
76
+ "@angular/core",
77
+ "@analogjs/platform",
78
+ "angular-intlayer"
79
+ ],
80
+ Astro: ["astro", "astro-intlayer"],
81
+ Lit: ["lit", "lit-intlayer"],
82
+ Vanilla: ["vanilla-intlayer"],
83
+ Remix: ["remix", "remix-intlayer"],
84
+ Compat: [
85
+ "i18next",
86
+ "react-i18next",
87
+ "next-i18next",
88
+ "next-intl",
89
+ "use-intl",
90
+ "react-intl",
91
+ "vue-i18n",
92
+ "@lingui/core",
93
+ "@lingui/react",
94
+ "@nuxtjs/i18n",
95
+ "@ngx-translate/core",
96
+ "@jsverse/transloco",
97
+ "svelte-i18n",
98
+ "next-translate",
99
+ "node-polyglot",
100
+ "i18n-js",
101
+ "@intlayer/i18next",
102
+ "@intlayer/react-i18next",
103
+ "@intlayer/next-i18next",
104
+ "@intlayer/next-intl",
105
+ "@intlayer/use-intl",
106
+ "@intlayer/react-intl",
107
+ "@intlayer/vue-i18n",
108
+ "@intlayer/lingui",
109
+ "@intlayer/sync-json-plugin",
110
+ "@intlayer/sync-po-plugin"
111
+ ],
112
+ Backend: [
113
+ "express",
114
+ "fastify",
115
+ "hono",
116
+ "elysia",
117
+ "@nestjs/core",
118
+ "@adonisjs/core",
119
+ "express-intlayer",
120
+ "fastify-intlayer",
121
+ "hono-intlayer",
122
+ "elysia-intlayer",
123
+ "adonis-intlayer"
124
+ ]
125
+ };
126
+ /**
127
+ * Resolves the skills to preselect from the project's installed packages.
128
+ *
129
+ * @param dependencies - Merged `dependencies` and `devDependencies` of `package.json`.
130
+ * @returns The base skills plus every framework skill whose packages are installed.
131
+ */
132
+ const getInitialSkills = (dependencies) => {
133
+ const detectedSkills = SKILLS.filter((skill) => SKILL_TRIGGER_PACKAGES[skill]?.some((packageName) => packageName in dependencies));
134
+ return [...BASE_SKILLS, ...detectedSkills];
44
135
  };
45
136
  /**
46
137
  * Metadata and configuration for each supported platform.
@@ -294,7 +385,7 @@ const installSkills = async (projectRoot, platform, skills) => {
294
385
  const content = await fetchUrlContent(url);
295
386
  const metadata = getMarkdownMetadata(content);
296
387
  let fileName = "";
297
- if (Array.isArray(metadata.slugs)) fileName = metadata.slugs.filter((slug) => slug !== "doc").join("_");
388
+ if (Array.isArray(metadata.slugs)) fileName = metadata.slugs.filter((slug) => slug !== "doc").join("_").replaceAll("/", "_");
298
389
  else fileName = new URL(url).pathname.split("/").filter((part) => part && part !== "doc").map((part) => part.replace(".md", "")).join("_");
299
390
  fileName = fileName ? `${fileName}.md` : "index.md";
300
391
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["fs"],"sources":["../../../src/installSkills/index.ts"],"sourcesContent":["import { promises as fs } from 'node:fs';\nimport path from 'node:path';\nimport { readAsset } from 'utils:asset';\nimport { v } from '@intlayer/config/logger';\nimport { getMarkdownMetadata } from '@intlayer/core/markdown';\n\n/**\n * Metadata for each available documentation skill.\n */\nexport const SKILLS_METADATA = {\n Config: 'Intlayer configuration documentation',\n Content: 'Reference for all Intlayer content node types (t, enu, etc.)',\n Usage: 'How to use Intlayer in your project',\n CLI: 'Intlayer CLI commands and usage',\n Compiler:\n 'Intlayer Compiler setup and usage for automatic content extraction without .content files',\n RemoteContent: 'How to use Intlayer with Remote/CMS/Server-side content',\n NextJS: 'Next.js-specific usage (Server & Client components)',\n React: 'React-specific syntax and hooks usage',\n Vue: 'Vue-specific composables and syntax',\n Svelte: 'Svelte-specific stores and syntax',\n Angular: 'Angular-specific syntax and Injectable Function usage',\n Preact: 'Preact-specific syntax and hooks usage',\n Solid:\n 'Integrates Intlayer internationalization with SolidJS components. Use when the user asks to \"setup SolidJS i18n\", use the \"useIntlayer\" hook in Solid, or manage locales in a SolidJS application.',\n Astro: 'Astro-specific usage and getIntlayer',\n} as const;\n\nexport type Skill = keyof typeof SKILLS_METADATA;\n\nexport const SKILLS = Object.keys(SKILLS_METADATA) as Skill[];\n\nexport const getInitialSkills = (\n deps: Record<string, string>\n): (keyof typeof SKILLS_METADATA)[] => {\n const skills: (keyof typeof SKILLS_METADATA)[] = [\n 'Usage',\n 'Content',\n 'Config',\n 'CLI',\n 'Compiler',\n ];\n\n if (deps.next) skills.push('NextJS');\n if (deps.react || !deps.next) skills.push('React');\n if (deps.preact) skills.push('Preact');\n if (deps['solid-js']) skills.push('Solid');\n if (deps.vue || deps.nuxt) skills.push('Vue');\n if (deps.svelte || deps['@sveltejs/kit']) skills.push('Svelte');\n if (deps.astro) skills.push('Astro');\n\n return skills;\n};\n\nexport interface PlatformMetadata {\n label: string;\n dir: string;\n check?: () => boolean;\n}\n\n/**\n * Metadata and configuration for each supported platform.\n */\nexport const PLATFORMS_METADATA: Record<string, PlatformMetadata> = {\n Cursor: {\n label: 'Cursor',\n dir: '.cursor/skills',\n check: () =>\n process.env.CURSOR === 'true' || process.env.TERM_PROGRAM === 'cursor',\n },\n Windsurf: {\n label: 'Windsurf',\n dir: '.windsurf/skills',\n check: () =>\n process.env.WINDSURF === 'true' ||\n process.env.TERM_PROGRAM === 'windsurf',\n },\n Trae: {\n label: 'Trae',\n dir: '.trae/skills',\n check: () =>\n process.env.TRAE === 'true' || process.env.TERM_PROGRAM === 'trae',\n },\n TraeCN: {\n label: 'Trae CN',\n dir: '.trae/skills',\n check: () => process.env.TRAE_CN === 'true',\n },\n VSCode: {\n label: 'VS Code',\n dir: '.vscode/skills',\n check: () =>\n process.env.VSCODE === 'true' || process.env.TERM_PROGRAM === 'vscode',\n },\n OpenCode: {\n label: 'OpenCode',\n dir: '.opencode/skills',\n check: () => process.env.OPENCODE === 'true',\n },\n Claude: {\n label: 'Claude Code',\n dir: '.claude/skills',\n check: () => process.env.CLAUDE === 'true',\n },\n GitHub: {\n label: 'GitHub Copilot Workspace',\n dir: '.github/skills',\n check: () =>\n process.env.GITHUB_ACTIONS === 'true' || !!process.env.GITHUB_WORKSPACE,\n },\n Antigravity: {\n label: 'Antigravity',\n dir: '.agent/skills',\n },\n Augment: {\n label: 'Augment',\n dir: '.augment/skills',\n },\n OpenClaw: {\n label: 'OpenClaw',\n dir: 'skills',\n },\n Cline: {\n label: 'Cline',\n dir: '.cline/skills',\n },\n CodeBuddy: {\n label: 'CodeBuddy',\n dir: '.codebuddy/skills',\n },\n CommandCode: {\n label: 'Command Code',\n dir: '.commandcode/skills',\n },\n Continue: {\n label: 'Continue',\n dir: '.continue/skills',\n },\n Crush: {\n label: 'Crush',\n dir: '.crush/skills',\n },\n Droid: {\n label: 'Droid',\n dir: '.factory/skills',\n },\n Goose: {\n label: 'Goose',\n dir: '.goose/skills',\n },\n IFlow: {\n label: 'iFlow CLI',\n dir: '.iflow/skills',\n },\n Junie: {\n label: 'Junie',\n dir: '.junie/skills',\n },\n KiloCode: {\n label: 'Kilo Code',\n dir: '.kilocode/skills',\n },\n Kiro: {\n label: 'Kiro CLI',\n dir: '.kiro/skills',\n },\n Kode: {\n label: 'Kode',\n dir: '.kode/skills',\n },\n MCPJam: {\n label: 'MCPJam',\n dir: '.mcpjam/skills',\n },\n MistralVibe: {\n label: 'Mistral Vibe',\n dir: '.vibe/skills',\n },\n Mux: {\n label: 'Mux',\n dir: '.mux/skills',\n },\n OpenHands: {\n label: 'OpenHands',\n dir: '.openhands/skills',\n },\n Pi: {\n label: 'Pi',\n dir: '.pi/skills',\n },\n Qoder: {\n label: 'Qoder',\n dir: '.qoder/skills',\n },\n Qwen: {\n label: 'Qwen Code',\n dir: '.qwen/skills',\n },\n RooCode: {\n label: 'Roo Code',\n dir: '.roo/skills',\n },\n Zencoder: {\n label: 'Zencoder',\n dir: '.zencoder/skills',\n },\n Neovate: {\n label: 'Neovate',\n dir: '.neovate/skills',\n },\n Pochi: {\n label: 'Pochi',\n dir: '.pochi/skills',\n },\n Other: {\n label: 'Other',\n dir: 'skills',\n },\n} as const;\n\nexport type Platform = keyof typeof PLATFORMS_METADATA;\n\nexport const PLATFORMS = Object.keys(PLATFORMS_METADATA) as Platform[];\n\n/**\n * Maps specific skill keys to special filenames if they differ from standard snake_case.\n */\nconst SKILL_FILENAME_MAP: Partial<Record<Skill, string>> = {};\n\n/**\n * Helper to convert CamelCase to kebab-case for directory naming\n */\nconst camelToKebabCase = (str: string) =>\n str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n\n/**\n * Reads the raw markdown content for a specific skill from the assets folder.\n */\nconst getSkillContent = (skill: Skill): string => {\n const baseName = SKILL_FILENAME_MAP[skill] ?? camelToKebabCase(skill);\n const fileName = `./skills/${baseName}.md`;\n\n try {\n return readAsset(fileName);\n } catch {\n console.warn(\n `Warning: Could not read asset for skill: ${skill} at ${fileName}`\n );\n return '';\n }\n};\n\n/**\n * Reads the licence content from the assets folder.\n */\nconst getLicenceContent = (): string => {\n try {\n return readAsset('./LICENCE.md');\n } catch {\n console.warn('Warning: Could not read LICENCE.md asset');\n return '';\n }\n};\n\nconst ALLOWED_FETCH_HOSTS = new Set(['intlayer.org']);\n\n/** Upper bound on the redirect chain a reference URL may take. */\nconst MAX_FETCH_REDIRECTS = 5;\n\n/**\n * Parses a URL and rejects it unless it is an HTTPS address on an allowed host.\n *\n * @param url - Absolute URL to validate.\n * @returns The parsed URL.\n * @throws When the protocol or host is not allowed.\n */\nconst parseAllowedUrl = (url: string | URL): URL => {\n const parsed = new URL(url);\n\n if (\n parsed.protocol !== 'https:' ||\n !ALLOWED_FETCH_HOSTS.has(parsed.hostname)\n ) {\n throw new Error(`Blocked fetch to disallowed host: ${parsed.hostname}`);\n }\n\n return parsed;\n};\n\n/**\n * Fetches the content of a URL using native fetch.\n *\n * Redirects are followed manually so every hop is re-checked against the host\n * allowlist — a redirect off `intlayer.org` is refused rather than silently\n * followed. Letting `fetch` refuse them outright (`redirect: 'error'`) instead\n * reported an unhelpful `TypeError: fetch failed` for a documentation URL that\n * merely moved.\n *\n * @param url - Absolute URL to read.\n * @returns The response body as text.\n */\nconst fetchUrlContent = async (url: string): Promise<string> => {\n let target = parseAllowedUrl(url);\n\n for (let hop = 0; hop <= MAX_FETCH_REDIRECTS; hop++) {\n const response = await fetch(target, { redirect: 'manual' });\n\n if (response.status >= 300 && response.status < 400) {\n const location = response.headers.get('location');\n\n if (!location) {\n throw new Error(`Failed to fetch ${url}: redirect without a location`);\n }\n\n target = parseAllowedUrl(new URL(location, target));\n continue;\n }\n\n if (!response.ok) {\n throw new Error(`Failed to fetch ${url}: ${response.statusText}`);\n }\n\n return response.text();\n }\n\n throw new Error(`Failed to fetch ${url}: too many redirects`);\n};\n\n/**\n * Installs skills using the \"Agent Skills\" directory standard.\n * Standard: <PROJECT_ROOT>/<CONFIG_DIR>/skills/<SKILL_NAME>/SKILL.md\n */\nexport const installSkills = async (\n projectRoot: string,\n platform: Platform,\n skills: Skill[]\n): Promise<string> => {\n // Determine destination directory\n const relativeDir = PLATFORMS_METADATA[platform]?.dir ?? 'skills';\n const skillsBaseDir = path.join(projectRoot, relativeDir);\n\n // Ensure the base directory exists\n await fs.mkdir(skillsBaseDir, { recursive: true });\n\n const createdSkills: string[] = [];\n const licenceContent = getLicenceContent();\n\n for (const skill of skills) {\n const baseName = SKILL_FILENAME_MAP[skill] ?? camelToKebabCase(skill);\n const skillName = `intlayer-${baseName}`;\n const skillContent = getSkillContent(skill);\n\n if (!skillContent) continue;\n\n // Extract unique URLs\n const urls = Array.from(\n new Set(skillContent.match(/https:\\/\\/intlayer\\.org\\/[^\\s)]+\\.md/g) || [])\n );\n\n // Agent Standard: .../skills/<skill-name>/SKILL.md\n const skillDir = path.join(skillsBaseDir, skillName);\n const referenceDir = path.join(skillDir, 'references');\n\n // Ensure directories exist\n await fs.mkdir(referenceDir, { recursive: true });\n\n // Write License\n if (licenceContent) {\n await fs.writeFile(\n path.join(skillDir, 'LICENCE.md'),\n licenceContent,\n 'utf-8'\n );\n }\n\n let updatedSkillContent = skillContent;\n\n // Parallel download of references\n const downloadPromises = urls.map(async (url) => {\n try {\n const content = await fetchUrlContent(url);\n const metadata = getMarkdownMetadata<{ slugs?: string[] }>(content);\n\n let fileName = '';\n\n // Determine filename from slugs or URL path\n if (Array.isArray(metadata.slugs)) {\n fileName = metadata.slugs.filter((slug) => slug !== 'doc').join('_');\n } else {\n const urlPath = new URL(url).pathname;\n fileName = urlPath\n .split('/')\n .filter((part) => part && part !== 'doc')\n .map((part) => part.replace('.md', '')) // Clean extension for joining\n .join('_');\n }\n\n // Ensure it ends with .md\n fileName = fileName ? `${fileName}.md` : 'index.md';\n const localRefPath = `references/${fileName}`;\n\n return {\n url,\n localRefPath,\n fileName,\n content,\n success: true,\n };\n } catch (error) {\n console.warn(\n `Warning: Failed to download ref ${url} for skill ${skill}`,\n error\n );\n return { url, success: false };\n }\n });\n\n const results = await Promise.all(downloadPromises);\n\n // Process results: Write files and update content string\n for (const res of results) {\n if (res.success && res.fileName && res.content && res.localRefPath) {\n // Write the reference file\n await fs.writeFile(\n path.join(referenceDir, res.fileName),\n res.content,\n 'utf-8'\n );\n\n // Update the main content to point to local file\n updatedSkillContent = updatedSkillContent.replaceAll(\n res.url,\n res.localRefPath\n );\n }\n }\n\n // Write the main SKILL.md\n const filePath = path.join(skillDir, 'SKILL.md');\n await fs.writeFile(filePath, updatedSkillContent, 'utf-8');\n createdSkills.push(`${skillName}/SKILL.md`);\n }\n\n if (createdSkills.length === 0) {\n return `No skill files were created. Check your asset paths.`;\n }\n\n return `${v} Created ${createdSkills.length} skills in ${skillsBaseDir}`;\n};\n"],"mappings":";;;;;;;;;;AASA,MAAa,kBAAkB;CAC7B,QAAQ;CACR,SAAS;CACT,OAAO;CACP,KAAK;CACL,UACE;CACF,eAAe;CACf,QAAQ;CACR,OAAO;CACP,KAAK;CACL,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,OACE;CACF,OAAO;AACT;AAIA,MAAa,SAAS,OAAO,KAAK,eAAe;AAEjD,MAAa,oBACX,SACqC;CACrC,MAAM,SAA2C;EAC/C;EACA;EACA;EACA;EACA;CACF;CAEA,IAAI,KAAK,MAAM,OAAO,KAAK,QAAQ;CACnC,IAAI,KAAK,SAAS,CAAC,KAAK,MAAM,OAAO,KAAK,OAAO;CACjD,IAAI,KAAK,QAAQ,OAAO,KAAK,QAAQ;CACrC,IAAI,KAAK,aAAa,OAAO,KAAK,OAAO;CACzC,IAAI,KAAK,OAAO,KAAK,MAAM,OAAO,KAAK,KAAK;CAC5C,IAAI,KAAK,UAAU,KAAK,kBAAkB,OAAO,KAAK,QAAQ;CAC9D,IAAI,KAAK,OAAO,OAAO,KAAK,OAAO;CAEnC,OAAO;AACT;;;;AAWA,MAAa,qBAAuD;CAClE,Q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index.mjs","names":["fs"],"sources":["../../../src/installSkills/index.ts"],"sourcesContent":["import { promises as fs } from 'node:fs';\nimport path from 'node:path';\nimport { readAsset } from 'utils:asset';\nimport { v } from '@intlayer/config/logger';\nimport { getMarkdownMetadata } from '@intlayer/core/markdown';\n\n/**\n * Metadata for each available documentation skill.\n */\nexport const SKILLS_METADATA = {\n Config: 'Intlayer configuration documentation',\n Content: 'Reference for all Intlayer content node types (t, enu, etc.)',\n Markdown:\n 'Markdown / rich text content: md(), MDX components, MarkdownProvider, SSR',\n Usage: 'How to use Intlayer in your project',\n CLI: 'Intlayer CLI commands and usage',\n Compiler:\n 'Intlayer Compiler setup and usage for automatic content extraction without .content files',\n RemoteContent: 'How to use Intlayer with Remote/CMS/Server-side content',\n DevTools: 'ESLint, LSP, VS Code & Chrome extensions, MCP server and CI/CD',\n Compat:\n 'Migrate from i18next, next-intl, react-intl, vue-i18n, Lingui… keeping their API',\n NextJS: 'Next.js-specific usage (Server & Client components)',\n React: 'React-specific syntax and hooks usage',\n Vue: 'Vue-specific composables and syntax',\n Svelte: 'Svelte-specific stores and syntax',\n Angular: 'Angular-specific syntax and Injectable Function usage',\n Preact: 'Preact-specific syntax and hooks usage',\n Solid: 'Solid-specific syntax and hooks usage',\n Astro: 'Astro-specific usage, middleware and islands',\n Lit: 'Lit-specific ReactiveController usage (useIntlayer, useLocale)',\n Vanilla: 'Framework-less JavaScript usage (vanilla-intlayer)',\n Remix: 'Remix 3 router middleware and request-scoped hooks',\n Backend:\n 'Server-side usage for Express, Fastify, Hono, NestJS, AdonisJS and Elysia',\n} as const;\n\nexport type Skill = keyof typeof SKILLS_METADATA;\n\nexport const SKILLS = Object.keys(SKILLS_METADATA) as Skill[];\n\n/** Skills preselected for every project, whatever its stack. */\nconst BASE_SKILLS: Skill[] = [\n 'Usage',\n 'Content',\n 'Config',\n 'CLI',\n 'Compiler',\n 'DevTools',\n];\n\n/**\n * Packages whose presence in `package.json` preselects a framework skill.\n * Both the framework itself and its Intlayer adapter are listed, so a skill is\n * suggested before and after the adapter is installed.\n */\nconst SKILL_TRIGGER_PACKAGES: Partial<Record<Skill, string[]>> = {\n NextJS: ['next', 'next-intlayer'],\n React: [\n 'react',\n 'react-intlayer',\n 'react-native-intlayer',\n 'react-scripts-intlayer',\n 'lynx-intlayer',\n ],\n Preact: ['preact', 'preact-intlayer'],\n Solid: ['solid-js', '@solidjs/start', 'solid-intlayer'],\n Vue: ['vue', 'nuxt', 'vue-intlayer', 'nuxt-intlayer'],\n Svelte: ['svelte', '@sveltejs/kit', 'svelte-intlayer'],\n Angular: ['@angular/core', '@analogjs/platform', 'angular-intlayer'],\n Astro: ['astro', 'astro-intlayer'],\n Lit: ['lit', 'lit-intlayer'],\n Vanilla: ['vanilla-intlayer'],\n Remix: ['remix', 'remix-intlayer'],\n Compat: [\n 'i18next',\n 'react-i18next',\n 'next-i18next',\n 'next-intl',\n 'use-intl',\n 'react-intl',\n 'vue-i18n',\n '@lingui/core',\n '@lingui/react',\n '@nuxtjs/i18n',\n '@ngx-translate/core',\n '@jsverse/transloco',\n 'svelte-i18n',\n 'next-translate',\n 'node-polyglot',\n 'i18n-js',\n '@intlayer/i18next',\n '@intlayer/react-i18next',\n '@intlayer/next-i18next',\n '@intlayer/next-intl',\n '@intlayer/use-intl',\n '@intlayer/react-intl',\n '@intlayer/vue-i18n',\n '@intlayer/lingui',\n '@intlayer/sync-json-plugin',\n '@intlayer/sync-po-plugin',\n ],\n Backend: [\n 'express',\n 'fastify',\n 'hono',\n 'elysia',\n '@nestjs/core',\n '@adonisjs/core',\n 'express-intlayer',\n 'fastify-intlayer',\n 'hono-intlayer',\n 'elysia-intlayer',\n 'adonis-intlayer',\n ],\n};\n\n/**\n * Resolves the skills to preselect from the project's installed packages.\n *\n * @param dependencies - Merged `dependencies` and `devDependencies` of `package.json`.\n * @returns The base skills plus every framework skill whose packages are installed.\n */\nexport const getInitialSkills = (\n dependencies: Record<string, string>\n): Skill[] => {\n const detectedSkills = SKILLS.filter((skill) =>\n SKILL_TRIGGER_PACKAGES[skill]?.some(\n (packageName) => packageName in dependencies\n )\n );\n\n return [...BASE_SKILLS, ...detectedSkills];\n};\n\nexport interface PlatformMetadata {\n label: string;\n dir: string;\n check?: () => boolean;\n}\n\n/**\n * Metadata and configuration for each supported platform.\n */\nexport const PLATFORMS_METADATA: Record<string, PlatformMetadata> = {\n Cursor: {\n label: 'Cursor',\n dir: '.cursor/skills',\n check: () =>\n process.env.CURSOR === 'true' || process.env.TERM_PROGRAM === 'cursor',\n },\n Windsurf: {\n label: 'Windsurf',\n dir: '.windsurf/skills',\n check: () =>\n process.env.WINDSURF === 'true' ||\n process.env.TERM_PROGRAM === 'windsurf',\n },\n Trae: {\n label: 'Trae',\n dir: '.trae/skills',\n check: () =>\n process.env.TRAE === 'true' || process.env.TERM_PROGRAM === 'trae',\n },\n TraeCN: {\n label: 'Trae CN',\n dir: '.trae/skills',\n check: () => process.env.TRAE_CN === 'true',\n },\n VSCode: {\n label: 'VS Code',\n dir: '.vscode/skills',\n check: () =>\n process.env.VSCODE === 'true' || process.env.TERM_PROGRAM === 'vscode',\n },\n OpenCode: {\n label: 'OpenCode',\n dir: '.opencode/skills',\n check: () => process.env.OPENCODE === 'true',\n },\n Claude: {\n label: 'Claude Code',\n dir: '.claude/skills',\n check: () => process.env.CLAUDE === 'true',\n },\n GitHub: {\n label: 'GitHub Copilot Workspace',\n dir: '.github/skills',\n check: () =>\n process.env.GITHUB_ACTIONS === 'true' || !!process.env.GITHUB_WORKSPACE,\n },\n Antigravity: {\n label: 'Antigravity',\n dir: '.agent/skills',\n },\n Augment: {\n label: 'Augment',\n dir: '.augment/skills',\n },\n OpenClaw: {\n label: 'OpenClaw',\n dir: 'skills',\n },\n Cline: {\n label: 'Cline',\n dir: '.cline/skills',\n },\n CodeBuddy: {\n label: 'CodeBuddy',\n dir: '.codebuddy/skills',\n },\n CommandCode: {\n label: 'Command Code',\n dir: '.commandcode/skills',\n },\n Continue: {\n label: 'Continue',\n dir: '.continue/skills',\n },\n Crush: {\n label: 'Crush',\n dir: '.crush/skills',\n },\n Droid: {\n label: 'Droid',\n dir: '.factory/skills',\n },\n Goose: {\n label: 'Goose',\n dir: '.goose/skills',\n },\n IFlow: {\n label: 'iFlow CLI',\n dir: '.iflow/skills',\n },\n Junie: {\n label: 'Junie',\n dir: '.junie/skills',\n },\n KiloCode: {\n label: 'Kilo Code',\n dir: '.kilocode/skills',\n },\n Kiro: {\n label: 'Kiro CLI',\n dir: '.kiro/skills',\n },\n Kode: {\n label: 'Kode',\n dir: '.kode/skills',\n },\n MCPJam: {\n label: 'MCPJam',\n dir: '.mcpjam/skills',\n },\n MistralVibe: {\n label: 'Mistral Vibe',\n dir: '.vibe/skills',\n },\n Mux: {\n label: 'Mux',\n dir: '.mux/skills',\n },\n OpenHands: {\n label: 'OpenHands',\n dir: '.openhands/skills',\n },\n Pi: {\n label: 'Pi',\n dir: '.pi/skills',\n },\n Qoder: {\n label: 'Qoder',\n dir: '.qoder/skills',\n },\n Qwen: {\n label: 'Qwen Code',\n dir: '.qwen/skills',\n },\n RooCode: {\n label: 'Roo Code',\n dir: '.roo/skills',\n },\n Zencoder: {\n label: 'Zencoder',\n dir: '.zencoder/skills',\n },\n Neovate: {\n label: 'Neovate',\n dir: '.neovate/skills',\n },\n Pochi: {\n label: 'Pochi',\n dir: '.pochi/skills',\n },\n Other: {\n label: 'Other',\n dir: 'skills',\n },\n} as const;\n\nexport type Platform = keyof typeof PLATFORMS_METADATA;\n\nexport const PLATFORMS = Object.keys(PLATFORMS_METADATA) as Platform[];\n\n/**\n * Maps specific skill keys to special filenames if they differ from standard snake_case.\n */\nconst SKILL_FILENAME_MAP: Partial<Record<Skill, string>> = {};\n\n/**\n * Helper to convert CamelCase to kebab-case for directory naming\n */\nconst camelToKebabCase = (str: string) =>\n str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n\n/**\n * Reads the raw markdown content for a specific skill from the assets folder.\n */\nconst getSkillContent = (skill: Skill): string => {\n const baseName = SKILL_FILENAME_MAP[skill] ?? camelToKebabCase(skill);\n const fileName = `./skills/${baseName}.md`;\n\n try {\n return readAsset(fileName);\n } catch {\n console.warn(\n `Warning: Could not read asset for skill: ${skill} at ${fileName}`\n );\n return '';\n }\n};\n\n/**\n * Reads the licence content from the assets folder.\n */\nconst getLicenceContent = (): string => {\n try {\n return readAsset('./LICENCE.md');\n } catch {\n console.warn('Warning: Could not read LICENCE.md asset');\n return '';\n }\n};\n\nconst ALLOWED_FETCH_HOSTS = new Set(['intlayer.org']);\n\n/** Upper bound on the redirect chain a reference URL may take. */\nconst MAX_FETCH_REDIRECTS = 5;\n\n/**\n * Parses a URL and rejects it unless it is an HTTPS address on an allowed host.\n *\n * @param url - Absolute URL to validate.\n * @returns The parsed URL.\n * @throws When the protocol or host is not allowed.\n */\nconst parseAllowedUrl = (url: string | URL): URL => {\n const parsed = new URL(url);\n\n if (\n parsed.protocol !== 'https:' ||\n !ALLOWED_FETCH_HOSTS.has(parsed.hostname)\n ) {\n throw new Error(`Blocked fetch to disallowed host: ${parsed.hostname}`);\n }\n\n return parsed;\n};\n\n/**\n * Fetches the content of a URL using native fetch.\n *\n * Redirects are followed manually so every hop is re-checked against the host\n * allowlist — a redirect off `intlayer.org` is refused rather than silently\n * followed. Letting `fetch` refuse them outright (`redirect: 'error'`) instead\n * reported an unhelpful `TypeError: fetch failed` for a documentation URL that\n * merely moved.\n *\n * @param url - Absolute URL to read.\n * @returns The response body as text.\n */\nconst fetchUrlContent = async (url: string): Promise<string> => {\n let target = parseAllowedUrl(url);\n\n for (let hop = 0; hop <= MAX_FETCH_REDIRECTS; hop++) {\n const response = await fetch(target, { redirect: 'manual' });\n\n if (response.status >= 300 && response.status < 400) {\n const location = response.headers.get('location');\n\n if (!location) {\n throw new Error(`Failed to fetch ${url}: redirect without a location`);\n }\n\n target = parseAllowedUrl(new URL(location, target));\n continue;\n }\n\n if (!response.ok) {\n throw new Error(`Failed to fetch ${url}: ${response.statusText}`);\n }\n\n return response.text();\n }\n\n throw new Error(`Failed to fetch ${url}: too many redirects`);\n};\n\n/**\n * Installs skills using the \"Agent Skills\" directory standard.\n * Standard: <PROJECT_ROOT>/<CONFIG_DIR>/skills/<SKILL_NAME>/SKILL.md\n */\nexport const installSkills = async (\n projectRoot: string,\n platform: Platform,\n skills: Skill[]\n): Promise<string> => {\n // Determine destination directory\n const relativeDir = PLATFORMS_METADATA[platform]?.dir ?? 'skills';\n const skillsBaseDir = path.join(projectRoot, relativeDir);\n\n // Ensure the base directory exists\n await fs.mkdir(skillsBaseDir, { recursive: true });\n\n const createdSkills: string[] = [];\n const licenceContent = getLicenceContent();\n\n for (const skill of skills) {\n const baseName = SKILL_FILENAME_MAP[skill] ?? camelToKebabCase(skill);\n const skillName = `intlayer-${baseName}`;\n const skillContent = getSkillContent(skill);\n\n if (!skillContent) continue;\n\n // Extract unique URLs\n const urls = Array.from(\n new Set(skillContent.match(/https:\\/\\/intlayer\\.org\\/[^\\s)]+\\.md/g) || [])\n );\n\n // Agent Standard: .../skills/<skill-name>/SKILL.md\n const skillDir = path.join(skillsBaseDir, skillName);\n const referenceDir = path.join(skillDir, 'references');\n\n // Ensure directories exist\n await fs.mkdir(referenceDir, { recursive: true });\n\n // Write License\n if (licenceContent) {\n await fs.writeFile(\n path.join(skillDir, 'LICENCE.md'),\n licenceContent,\n 'utf-8'\n );\n }\n\n let updatedSkillContent = skillContent;\n\n // Parallel download of references\n const downloadPromises = urls.map(async (url) => {\n try {\n const content = await fetchUrlContent(url);\n const metadata = getMarkdownMetadata<{ slugs?: string[] }>(content);\n\n let fileName = '';\n\n // Determine filename from slugs or URL path\n if (Array.isArray(metadata.slugs)) {\n fileName = metadata.slugs\n .filter((slug) => slug !== 'doc')\n .join('_')\n // Scoped package slugs (`@intlayer/babel`) must not create subfolders\n .replaceAll('/', '_');\n } else {\n const urlPath = new URL(url).pathname;\n fileName = urlPath\n .split('/')\n .filter((part) => part && part !== 'doc')\n .map((part) => part.replace('.md', '')) // Clean extension for joining\n .join('_');\n }\n\n // Ensure it ends with .md\n fileName = fileName ? `${fileName}.md` : 'index.md';\n const localRefPath = `references/${fileName}`;\n\n return {\n url,\n localRefPath,\n fileName,\n content,\n success: true,\n };\n } catch (error) {\n console.warn(\n `Warning: Failed to download ref ${url} for skill ${skill}`,\n error\n );\n return { url, success: false };\n }\n });\n\n const results = await Promise.all(downloadPromises);\n\n // Process results: Write files and update content string\n for (const res of results) {\n if (res.success && res.fileName && res.content && res.localRefPath) {\n // Write the reference file\n await fs.writeFile(\n path.join(referenceDir, res.fileName),\n res.content,\n 'utf-8'\n );\n\n // Update the main content to point to local file\n updatedSkillContent = updatedSkillContent.replaceAll(\n res.url,\n res.localRefPath\n );\n }\n }\n\n // Write the main SKILL.md\n const filePath = path.join(skillDir, 'SKILL.md');\n await fs.writeFile(filePath, updatedSkillContent, 'utf-8');\n createdSkills.push(`${skillName}/SKILL.md`);\n }\n\n if (createdSkills.length === 0) {\n return `No skill files were created. Check your asset paths.`;\n }\n\n return `${v} Created ${createdSkills.length} skills in ${skillsBaseDir}`;\n};\n"],"mappings":";;;;;;;;;;AASA,MAAa,kBAAkB;CAC7B,QAAQ;CACR,SAAS;CACT,UACE;CACF,OAAO;CACP,KAAK;CACL,UACE;CACF,eAAe;CACf,UAAU;CACV,QACE;CACF,QAAQ;CACR,OAAO;CACP,KAAK;CACL,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,OAAO;CACP,OAAO;CACP,KAAK;CACL,SAAS;CACT,OAAO;CACP,SACE;AACJ;AAIA,MAAa,SAAS,OAAO,KAAK,eAAe;;AAGjD,MAAM,cAAuB;CAC3B;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;AAOA,MAAM,yBAA2D;CAC/D,QAAQ,CAAC,QAAQ,eAAe;CAChC,OAAO;EACL;EACA;EACA;EACA;EACA;CACF;CACA,QAAQ,CAAC,UAAU,iBAAiB;CACpC,OAAO;EAAC;EAAY;EAAkB;CAAgB;CACtD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IAAI,WAAW;CACtC;CACA,QAAQ;EACN,OAAO;EACP,KAAK;EACL,aACE,QAAQ,IAAI,mBAAmB,UAAU,CAAC,CAAC,QAAQ,IAAI;CAC3D;CACA,aAAa;EACX,OAAO;EACP,KAAK;CACP;CACA,SAAS;EACP,OAAO;EACP,KAAK;CACP;CACA,UAAU;EACR,OAAO;EACP,KAAK;CACP;CACA,OAAO;EACL,OAAO;EACP,KAAK;CACP;CACA,WAAW;EACT,OAAO;EACP,KAAK;CACP;CACA,aAAa;EACX,OAAO;EACP,KAAK;CACP;CACA,UAAU;EACR,OAAO;EACP,KAAK;CACP;CACA,OAAO;EACL,OAAO;EACP,KAAK;CACP;CACA,OAAO;EACL,OAAO;EACP,KAAK;CACP;CACA,OAAO;EACL,OAAO;EACP,KAAK;CACP;CACA,OAAO;EACL,OAAO;EACP,KAAK;CACP;CACA,OAAO;EACL,OAAO;EACP,KAAK;CACP;CACA,UAAU;EACR,OAAO;EACP,KAAK;CACP;CACA,MAAM;EACJ,OAAO;EACP,KAAK;CACP;CACA,MAAM;EACJ,OAAO;EACP,KAAK;CACP;CACA,QAAQ;EACN,OAAO;EACP,KAAK;CACP;CACA,aAAa;EACX,OAAO;EACP,KAAK;CACP;CACA,KAAK;EACH,OAAO;EACP,KAAK;CACP;CACA,WAAW;EACT,OAAO;EACP,KAAK;CACP;CACA,IAAI;EACF,OAAO;EACP,KAAK;CACP;CACA,OAAO;EACL,OAAO;EACP,KAAK;CACP;CACA,MAAM;EACJ,OAAO;EACP,KAAK;CACP;CACA,SAAS;EACP,OAAO;EACP,KAAK;CACP;CACA,UAAU;EACR,OAAO;EACP,KAAK;CACP;CACA,SAAS;EACP,OAAO;EACP,KAAK;CACP;CACA,OAAO;EACL,OAAO;EACP,KAAK;CACP;CACA,OAAO;EACL,OAAO;EACP,KAAK;CACP;AACF;AAIA,MAAa,YAAY,OAAO,KAAK,kBAAkB;;;;AAKvD,MAAM,qBAAqD,CAAC;;;;AAK5D,MAAM,oBAAoB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,OAAO;IAGzC,OAAO;KACL;KACA,4BAJiC;KAKjC;KACA;KACA,SAAS;IACX;GACF,SAAS,OAAO;IACd,QAAQ,KACN,mCAAmC,IAAI,aAAa,SACpD,KACF;IACA,OAAO;KAAE;KAAK,SAAS;IAAM;GAC/B;EACF,CAAC;EAED,MAAM,UAAU,MAAM,QAAQ,IAAI,gBAAgB;EAGlD,KAAK,MAAM,OAAO,SAChB,IAAI,IAAI,WAAW,IAAI,YAAY,IAAI,WAAW,IAAI,cAAc;GAElE,MAAMA,SAAG,UACP,KAAK,KAAK,cAAc,IAAI,QAAQ,GACpC,IAAI,SACJ,OACF;GAGA,sBAAsB,oBAAoB,WACxC,IAAI,KACJ,IAAI,YACN;EACF;EAIF,MAAM,WAAW,KAAK,KAAK,UAAU,UAAU;EAC/C,MAAMA,SAAG,UAAU,UAAU,qBAAqB,OAAO;EACzD,cAAc,KAAK,GAAG,UAAU,UAAU;CAC5C;CAEA,IAAI,cAAc,WAAW,GAC3B,OAAO;CAGT,OAAO,GAAG,EAAE,WAAW,cAAc,OAAO,aAAa;AAC3D"}
@@ -1,6 +1,6 @@
1
+ import { stat } from "node:fs/promises";
1
2
  import { normalizePath } from "@intlayer/config/utils";
2
3
  import fg from "fast-glob";
3
- import { stat } from "node:fs/promises";
4
4
 
5
5
  //#region src/listDictionariesPath.ts
6
6
  /**
@@ -1,6 +1,6 @@
1
+ import { readFileSync } from "node:fs";
1
2
  import { join } from "node:path";
2
3
  import { getAppLogger } from "@intlayer/config/logger";
3
- import { readFileSync } from "node:fs";
4
4
  import { log } from "@intlayer/config/built";
5
5
  import simpleGit from "simple-git";
6
6
 
@@ -1,7 +1,7 @@
1
- import { join } from "node:path";
2
- import { getProjectRequire } from "@intlayer/config/utils";
3
1
  import { readFile } from "node:fs/promises";
2
+ import { join } from "node:path";
4
3
  import { bundleFile } from "@intlayer/config/file";
4
+ import { getProjectRequire } from "@intlayer/config/utils";
5
5
  import { builtinModules, createRequire } from "node:module";
6
6
 
7
7
  //#region src/loadDictionaries/getIntlayerBundle.ts
@@ -1,6 +1,6 @@
1
1
  import { ensureIntlayerBundle, formatLocalDictionaries, loadContentDeclaration, loadContentDeclarations } from "./loadContentDeclaration.mjs";
2
+ import { loadLocalDictionaries } from "./loadLocalDictionaries.mjs";
2
3
  import { formatDistantDictionaries, loadRemoteDictionaries } from "./loadRemoteDictionaries.mjs";
3
4
  import { loadDictionaries } from "./loadDictionaries.mjs";
4
- import { loadLocalDictionaries } from "./loadLocalDictionaries.mjs";
5
5
 
6
6
  export { ensureIntlayerBundle, formatDistantDictionaries, formatLocalDictionaries, loadContentDeclaration, loadContentDeclarations, loadDictionaries, loadLocalDictionaries, loadRemoteDictionaries };
@@ -5,10 +5,10 @@ import { getIntlayerBundle } from "./getIntlayerBundle.mjs";
5
5
  import { loadMarkdownContentDeclaration } from "./loadMarkdownContentDeclaration.mjs";
6
6
  import { loadYamlContentDeclaration } from "./loadYamlContentDeclaration.mjs";
7
7
  import { logTypeScriptErrors } from "./logTypeScriptErrors.mjs";
8
- import { dirname, extname, join, relative } from "node:path";
9
- import { cacheDisk, getPackageJsonPath, getProjectRequire } from "@intlayer/config/utils";
10
8
  import { readFile, writeFile } from "node:fs/promises";
9
+ import { dirname, extname, join, relative } from "node:path";
11
10
  import { loadExternalFile } from "@intlayer/config/file";
11
+ import { cacheDisk, getPackageJsonPath, getProjectRequire } from "@intlayer/config/utils";
12
12
 
13
13
  //#region src/loadDictionaries/loadContentDeclaration.ts
14
14
  const formatLocalDictionaries = (dictionariesRecord, configuration) => Object.entries(dictionariesRecord).map(([relativePath, dict]) => ({
@@ -1,6 +1,6 @@
1
1
  import { filterInvalidDictionaries } from "../filterInvalidDictionaries.mjs";
2
- import { formatDictionaries } from "../formatDictionary.mjs";
3
2
  import { loadContentDeclarations } from "./loadContentDeclaration.mjs";
3
+ import { formatDictionaries } from "../formatDictionary.mjs";
4
4
  import { loadRemoteDictionaries } from "./loadRemoteDictionaries.mjs";
5
5
  import { DictionariesLogger } from "./log.mjs";
6
6
  import * as ANSIColors from "@intlayer/config/colors";
@@ -1,6 +1,6 @@
1
1
  import { loadContentDeclarations } from "./loadContentDeclaration.mjs";
2
- import { relative, resolve } from "node:path";
3
2
  import { mkdir } from "node:fs/promises";
3
+ import { relative, resolve } from "node:path";
4
4
 
5
5
  //#region src/loadDictionaries/loadLocalDictionaries.ts
6
6
  const loadLocalDictionaries = async (contentDeclarationsPaths, configuration) => {
@@ -1,7 +1,7 @@
1
1
  import { parseContentDeclarationFileName } from "../utils/parseContentDeclarationFileName.mjs";
2
+ import { readFile } from "node:fs/promises";
2
3
  import { getMarkdownMetadata } from "@intlayer/core/markdown";
3
4
  import { MARKDOWN } from "@intlayer/types/nodeType";
4
- import { readFile } from "node:fs/promises";
5
5
 
6
6
  //#region src/loadDictionaries/loadMarkdownContentDeclaration.ts
7
7
  const loadMarkdownContentDeclaration = async (path, configuration) => {
@@ -2,9 +2,9 @@ import { formatPath } from "./utils/formatter.mjs";
2
2
  import { runOnce } from "./utils/runOnce.mjs";
3
3
  import { join, relative } from "node:path";
4
4
  import * as ANSIColors from "@intlayer/config/colors";
5
- import { getEnvFilePath } from "@intlayer/config/env";
6
5
  import { colorize, colorizePath, getAppLogger, x } from "@intlayer/config/logger";
7
6
  import { getConfigurationAndFilePath, intlayerConfigSchema, intlayerConfigSchemaParseContext } from "@intlayer/config/node";
7
+ import { getEnvFilePath } from "@intlayer/config/env";
8
8
 
9
9
  //#region src/logConfigDetails.ts
10
10
  const logConfigDetails = (options) => {
@@ -1,18 +1,18 @@
1
- import { runOnce } from "./utils/runOnce.mjs";
2
1
  import { buildDictionary } from "./buildIntlayerDictionary/buildIntlayerDictionary.mjs";
3
- import { cleanOutputDir } from "./cleanOutputDir.mjs";
4
2
  import { createDictionaryEntryPoint } from "./createDictionaryEntryPoint/createDictionaryEntryPoint.mjs";
3
+ import { runOnce } from "./utils/runOnce.mjs";
5
4
  import { createModuleAugmentation } from "./createType/createModuleAugmentation.mjs";
6
5
  import { createTypes } from "./createType/createType.mjs";
6
+ import { listDictionariesWithStats } from "./listDictionariesPath.mjs";
7
7
  import { loadDictionaries } from "./loadDictionaries/loadDictionaries.mjs";
8
8
  import { writeRemoteDictionary } from "./buildIntlayerDictionary/writeRemoteDictionary.mjs";
9
- import { listDictionariesWithStats } from "./listDictionariesPath.mjs";
9
+ import { cleanOutputDir } from "./cleanOutputDir.mjs";
10
10
  import { isCachedConfigurationUpToDate, writeConfiguration } from "./writeConfiguration/index.mjs";
11
+ import { stat } from "node:fs/promises";
11
12
  import { join } from "node:path";
12
13
  import * as ANSIColors from "@intlayer/config/colors";
13
14
  import { colorize, getAppLogger } from "@intlayer/config/logger";
14
15
  import { cacheDisk } from "@intlayer/config/utils";
15
- import { stat } from "node:fs/promises";
16
16
  import packageJson from "@intlayer/config/package.json" with { type: "json" };
17
17
 
18
18
  //#region src/prepareIntlayer.ts
@@ -1,5 +1,5 @@
1
- import { mutateScore, scoreRecord, toScorePercent } from "./calculateScore.mjs";
2
1
  import { byteLength, extractAnchors, extractHreflangs, extractHtmlDir, extractHtmlLang, extractMetaDescription, extractOgImage, extractScriptUrls, extractTitle, extractVisibleTextStrings, hasCanonical } from "./parseHtml.mjs";
2
+ import { mutateScore, scoreRecord, toScorePercent } from "./calculateScore.mjs";
3
3
  import { analyzeBundleContent } from "./analyzeBundleContent.mjs";
4
4
  import { checkBundleContent, checkCanonical, checkHtmlAttributes, checkLinguisticStructure, checkRobots, checkSitemap, checkUrlStructure, formatSize } from "./checks.mjs";
5
5
  import { scanWebsite } from "./scanWebsite.mjs";
@@ -1,5 +1,5 @@
1
- import { mutateScore, toScorePercent } from "./calculateScore.mjs";
2
1
  import { byteLength, extractAnchors, extractScriptUrls } from "./parseHtml.mjs";
2
+ import { mutateScore, toScorePercent } from "./calculateScore.mjs";
3
3
  import { checkBundleContent, checkCanonical, checkHtmlAttributes, checkLinguisticStructure, checkRobots, checkSitemap, checkUrlStructure } from "./checks.mjs";
4
4
  import { GREY, GREY_LIGHT } from "@intlayer/config/colors";
5
5
  import { colorize, logger } from "@intlayer/config/logger";
@@ -1,10 +1,10 @@
1
1
  import { writeFileIfChanged } from "../writeFileIfChanged.mjs";
2
2
  import { extractKeyAndLocaleFromPath } from "./extractKeyAndLocaleFromPath.mjs";
3
3
  import { buildFilePathPatternContext } from "./filePathPatternHelpers.mjs";
4
+ import { mkdir, readFile } from "node:fs/promises";
4
5
  import { dirname, isAbsolute, resolve } from "node:path";
5
6
  import { parseFilePathPattern } from "@intlayer/config/utils";
6
7
  import fg from "fast-glob";
7
- import { mkdir, readFile } from "node:fs/promises";
8
8
 
9
9
  //#region src/syncPluginKit/createFileAdapter.ts
10
10
  /**
@@ -1,6 +1,6 @@
1
+ import { createSyncPlugin } from "./createSyncPlugin.mjs";
1
2
  import { extractKeyAndLocaleFromPath } from "./extractKeyAndLocaleFromPath.mjs";
2
3
  import { buildFilePathPatternContext } from "./filePathPatternHelpers.mjs";
3
4
  import { createFileAdapter, createFileReader } from "./createFileAdapter.mjs";
4
- import { createSyncPlugin } from "./createSyncPlugin.mjs";
5
5
 
6
6
  export { buildFilePathPatternContext, createFileAdapter, createFileReader, createSyncPlugin, extractKeyAndLocaleFromPath };
@@ -1,6 +1,6 @@
1
1
  import { isAbsolute, relative, resolve, sep } from "node:path";
2
- import { TRAVERSE_PATTERN } from "@intlayer/config/defaultValues";
3
2
  import { normalizePath } from "@intlayer/config/utils";
3
+ import { TRAVERSE_PATTERN } from "@intlayer/config/defaultValues";
4
4
  import fg from "fast-glob";
5
5
 
6
6
  //#region src/utils/buildComponentFilesList.ts
@@ -1,8 +1,8 @@
1
+ import { rmSync } from "node:fs";
2
+ import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
1
3
  import { dirname, join } from "node:path";
2
4
  import * as ANSIColors from "@intlayer/config/colors";
3
5
  import { colorize, getAppLogger } from "@intlayer/config/logger";
4
- import { rmSync } from "node:fs";
5
- import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
6
6
 
7
7
  //#region src/utils/contentWatcherLock.ts
8
8
  /**
@@ -1,3 +1,7 @@
1
+ import { Queue, pLimit } from "./pLimit.mjs";
2
+ import { parallelize } from "./parallelize.mjs";
3
+ import { getPathHash } from "./getPathHash.mjs";
4
+ import { formatLocale, formatPath } from "./formatter.mjs";
1
5
  import { autoDecorateContent } from "./autoDecorateContent.mjs";
2
6
  import { buildComponentFilesList } from "./buildComponentFilesList.mjs";
3
7
  import { chunkArray } from "./chunkArray.mjs";
@@ -5,13 +9,9 @@ import { splitTextByLines } from "./splitTextByLine.mjs";
5
9
  import { getChunk } from "./getChunk.mjs";
6
10
  import { assembleJSON, chunkJSON, reconstructFromSingleChunk } from "./chunkJSON.mjs";
7
11
  import { CLI_CONTENT_WATCHER_ENV_VAR, acquireContentWatcherLock, claimCliContentWatcher, getCliContentWatcherLabel, getContentWatcherLockFilePath, getContentWatcherOwner, reportRedundantContentWatcher } from "./contentWatcherLock.mjs";
8
- import { formatLocale, formatPath } from "./formatter.mjs";
9
12
  import { getContentExtension } from "./getContentExtension.mjs";
10
13
  import { getExtensionFromFormat, getFormatFromExtension } from "./getFormatFromExtension.mjs";
11
- import { getPathHash } from "./getPathHash.mjs";
12
14
  import { mergeChunks } from "./mergeChunks.mjs";
13
- import { Queue, pLimit } from "./pLimit.mjs";
14
- import { parallelize } from "./parallelize.mjs";
15
15
  import { getGlobalLimiter, getTaskLimiter, parallelizeGlobal } from "./parallelizeGlobal.mjs";
16
16
  import { parseContentDeclarationFileName } from "./parseContentDeclarationFileName.mjs";
17
17
  import { excludeObjectFormat, reduceObjectFormat } from "./reduceObjectFormat.mjs";
@@ -1,5 +1,5 @@
1
- import { basename, extname, join } from "node:path";
2
1
  import { existsSync, readFileSync, readdirSync } from "node:fs";
2
+ import { basename, extname, join } from "node:path";
3
3
 
4
4
  //#region src/utils/readDictionariesFromDisk.ts
5
5
  /**
@@ -1,6 +1,6 @@
1
- import { dirname } from "node:path";
2
1
  import { rmSync } from "node:fs";
3
2
  import { mkdir, readFile, rmdir, stat, unlink, writeFile } from "node:fs/promises";
3
+ import { dirname } from "node:path";
4
4
  import packageJson from "@intlayer/core/package.json" with { type: "json" };
5
5
 
6
6
  //#region src/utils/runOnce.ts
@@ -1,5 +1,5 @@
1
- import { ps } from "./ps.mjs";
2
1
  import { wmic } from "./wmic.mjs";
2
+ import { ps } from "./ps.mjs";
3
3
  import * as os$1 from "node:os";
4
4
 
5
5
  //#region src/utils/runParallel/pidTree.ts
@@ -1,6 +1,6 @@
1
- import { dirname } from "node:path";
2
1
  import { rmSync } from "node:fs";
3
2
  import { mkdir, readFile, unlink, writeFile } from "node:fs/promises";
3
+ import { dirname } from "node:path";
4
4
 
5
5
  //#region src/utils/withFileLock.ts
6
6
  const DEFAULT_OPTIONS = {
@@ -1,20 +1,20 @@
1
1
  import { formatPath } from "./utils/formatter.mjs";
2
2
  import { getFormatFromExtension } from "./utils/getFormatFromExtension.mjs";
3
3
  import { parseContentDeclarationFileName } from "./utils/parseContentDeclarationFileName.mjs";
4
- import { prepareIntlayer } from "./prepareIntlayer.mjs";
5
- import { writeContentDeclaration } from "./writeContentDeclaration/writeContentDeclaration.mjs";
6
- import { handleContentDeclarationFileChange } from "./handleContentDeclarationFileChange.mjs";
7
4
  import { handleAdditionalContentDeclarationFile } from "./handleAdditionalContentDeclarationFile.mjs";
5
+ import { handleContentDeclarationFileChange } from "./handleContentDeclarationFileChange.mjs";
8
6
  import { handleContentDeclarationFileMoved } from "./handleContentDeclarationFileMoved.mjs";
9
7
  import { handleUnlinkedContentDeclarationFile } from "./handleUnlinkedContentDeclarationFile.mjs";
8
+ import { prepareIntlayer } from "./prepareIntlayer.mjs";
9
+ import { writeContentDeclaration } from "./writeContentDeclaration/writeContentDeclaration.mjs";
10
+ import { existsSync, watch as watch$1 } from "node:fs";
11
+ import { readFile } from "node:fs/promises";
10
12
  import { basename, dirname, extname, resolve } from "node:path";
11
13
  import * as ANSIColor from "@intlayer/config/colors";
14
+ import { transpileTSToCJS } from "@intlayer/config/file";
12
15
  import { colorize, getAppLogger } from "@intlayer/config/logger";
13
16
  import { getConfiguration, getConfigurationAndFilePath } from "@intlayer/config/node";
14
17
  import { clearAllCache, clearDiskCacheMemory, clearModuleCache, normalizePath } from "@intlayer/config/utils";
15
- import { existsSync, watch as watch$1 } from "node:fs";
16
- import { readFile } from "node:fs/promises";
17
- import { transpileTSToCJS } from "@intlayer/config/file";
18
18
 
19
19
  //#region src/watcher.ts
20
20
  const pendingUnlinks = /* @__PURE__ */ new Map();
@@ -1,7 +1,7 @@
1
1
  import { writeFileIfChanged } from "../writeFileIfChanged.mjs";
2
2
  import { generateConfigurationContent } from "./generateConfigurationContent.mjs";
3
- import { join } from "node:path";
4
3
  import { mkdir, readFile } from "node:fs/promises";
4
+ import { join } from "node:path";
5
5
 
6
6
  //#region src/writeConfiguration/index.ts
7
7
  const isCachedConfigurationUpToDate = async (configuration) => {
@@ -1,8 +1,8 @@
1
+ import { existsSync, mkdirSync, writeFileSync } from "node:fs";
1
2
  import { dirname, join } from "node:path";
2
3
  import { colorizePath, x } from "@intlayer/config/logger";
3
- import * as NodeTypes from "@intlayer/types/nodeType";
4
- import { existsSync, mkdirSync, writeFileSync } from "node:fs";
5
4
  import { deepTransformNode } from "@intlayer/core/interpreter";
5
+ import * as NodeTypes from "@intlayer/types/nodeType";
6
6
 
7
7
  //#region src/writeContentDeclaration/processContentDeclarationContent.ts
8
8
  /**
@@ -1,6 +1,6 @@
1
1
  import { babelTsParser } from "../utils/babelParser.mjs";
2
- import * as NodeTypes from "@intlayer/types/nodeType";
3
2
  import { getNodeType } from "@intlayer/core/dictionaryManipulator";
3
+ import * as NodeTypes from "@intlayer/types/nodeType";
4
4
  import * as recast from "recast";
5
5
 
6
6
  //#region src/writeContentDeclaration/transformJSFile.ts
@@ -1,17 +1,17 @@
1
+ import { readDictionariesFromDisk } from "../utils/readDictionariesFromDisk.mjs";
1
2
  import { getFormatFromExtension } from "../utils/getFormatFromExtension.mjs";
2
3
  import { detectFormatCommand } from "../detectFormatCommand.mjs";
3
- import { readDictionariesFromDisk } from "../utils/readDictionariesFromDisk.mjs";
4
4
  import { processContentDeclarationContent } from "./processContentDeclarationContent.mjs";
5
5
  import { transformJSONFile } from "./transformJSONFile.mjs";
6
6
  import { writeJSFile } from "./writeJSFile.mjs";
7
7
  import { writeMarkdownFile } from "./writeMarkdownFile.mjs";
8
8
  import { writeYamlFile } from "./writeYamlFile.mjs";
9
- import { basename, dirname, extname, join, resolve } from "node:path";
10
- import { COMPILER_NO_METADATA } from "@intlayer/config/defaultValues";
11
9
  import { existsSync } from "node:fs";
12
10
  import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
13
- import { execSync } from "node:child_process";
11
+ import { basename, dirname, extname, join, resolve } from "node:path";
12
+ import { COMPILER_NO_METADATA } from "@intlayer/config/defaultValues";
14
13
  import { getFilteredLocalesDictionary, getPerLocaleDictionary } from "@intlayer/core/plugins";
14
+ import { execSync } from "node:child_process";
15
15
  import { isDeepStrictEqual } from "node:util";
16
16
 
17
17
  //#region src/writeContentDeclaration/writeContentDeclaration.ts
@@ -1,11 +1,11 @@
1
1
  import { getFormatFromExtension } from "../utils/getFormatFromExtension.mjs";
2
- import { detectFormatCommand } from "../detectFormatCommand.mjs";
3
2
  import { transformJSFile } from "./transformJSFile.mjs";
3
+ import { detectFormatCommand } from "../detectFormatCommand.mjs";
4
4
  import { getContentDeclarationFileTemplate } from "../getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs";
5
- import { basename, extname, join } from "node:path";
6
- import { getAppLogger, logger } from "@intlayer/config/logger";
7
5
  import { existsSync } from "node:fs";
8
6
  import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
7
+ import { basename, extname, join } from "node:path";
8
+ import { getAppLogger, logger } from "@intlayer/config/logger";
9
9
  import { execSync } from "node:child_process";
10
10
 
11
11
  //#region src/writeContentDeclaration/writeJSFile.ts
@@ -1,7 +1,7 @@
1
1
  import { detectFormatCommand } from "../detectFormatCommand.mjs";
2
+ import { mkdir, rename, rm, writeFile } from "node:fs/promises";
2
3
  import { basename, dirname, join } from "node:path";
3
4
  import { MARKDOWN } from "@intlayer/types/nodeType";
4
- import { mkdir, rename, rm, writeFile } from "node:fs/promises";
5
5
  import { execSync } from "node:child_process";
6
6
 
7
7
  //#region src/writeContentDeclaration/writeMarkdownFile.ts
@@ -1,6 +1,6 @@
1
1
  import { detectFormatCommand } from "../detectFormatCommand.mjs";
2
- import { basename, dirname, join } from "node:path";
3
2
  import { mkdir, rename, rm, writeFile } from "node:fs/promises";
3
+ import { basename, dirname, join } from "node:path";
4
4
  import { execSync } from "node:child_process";
5
5
  import { stringifyYaml } from "@intlayer/core/utils";
6
6