react-scripts-intlayer 8.9.7 → 8.10.0-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.
- package/README.md +14 -0
- package/dist/cjs/cli/react-scripts-intlayer.cjs.map +1 -1
- package/dist/cjs/craco.config.cjs.map +1 -1
- package/dist/cjs/intlayerCracoPlugin.cjs.map +1 -1
- package/dist/types/craco.config.d.ts +1 -3
- package/dist/types/craco.config.d.ts.map +1 -1
- package/dist/types/intlayerCracoPlugin.d.ts.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -67,6 +67,7 @@ With **per-locale content files**, **TypeScript autocompletion**, **tree-shakabl
|
|
|
67
67
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/mcp.png?raw=true" alt="Feature" width="700"> | **MCP Server Integration**<br><br>Provides an MCP (Model Context Protocol) server for IDE automation, enabling seamless content management and i18n workflows directly within your development environment. <br><br> - [MCP Server](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/mcp_server.md) |
|
|
68
68
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/vscode_extension.png?raw=true" alt="Feature" width="700"> | **VSCode Extension**<br><br>Intlayer provides a VSCode extension to help you manage your content and translations, building your dictionaries, translating your content, and more. <br><br> - [VSCode Extension](https://intlayer.org/doc/vs-code-extension) |
|
|
69
69
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/interoperability.png?raw=true" alt="Feature" width="700"> | **Interoperability**<br><br>Allow interoperability with react-i18next, next-i18next, next-intl, react-intl, vue-i18n. <br><br> - [Intlayer and react-intl](https://intlayer.org/blog/intlayer-with-react-intl) <br> - [Intlayer and next-intl](https://intlayer.org/blog/intlayer-with-next-intl) <br> - [Intlayer and next-i18next](https://intlayer.org/blog/intlayer-with-next-i18next) <br> - [Intlayer and vue-i18n](https://intlayer.org/blog/intlayer-with-vue-i18n) |
|
|
70
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/benchmark.png?raw=true" alt="Feature" width="700"> | **Performances & Benchmark**<br><br>Uses advanced tree-shaking and dynamic loading to boost performances and keep the solution as light as possible. <br><br> - [Performances & Benchmark](https://intlayer.org/doc/benchmark) |
|
|
70
71
|
|
|
71
72
|
---
|
|
72
73
|
|
|
@@ -249,6 +250,19 @@ Explore our comprehensive documentation to get started with Intlayer and learn h
|
|
|
249
250
|
</ul>
|
|
250
251
|
</details>
|
|
251
252
|
|
|
253
|
+
## Multilingual content management system
|
|
254
|
+
|
|
255
|
+
More than an i18n library, Intlayer is a complete **multilingual content management system**. A full CMS is available for free at [app.intlayer.org](https://app.intlayer.org).
|
|
256
|
+
|
|
257
|
+
Intlayer connects **developers**, **copywriters**, and **AI agents** in one workflow for creating and maintaining multilingual websites effortlessly.Intlayer replaces the following stack in a single solution:
|
|
258
|
+
|
|
259
|
+
- i18n solutions (e.g. `i18next`, `next-intl`, `vue-i18n`)
|
|
260
|
+
- TMSs (Translation Management Systems) (e.g. Crowdin, Phrase, Lokalise)
|
|
261
|
+
- Feature flags
|
|
262
|
+
- Headless CMSs (e.g. Contentful, Strapi, Sanity)
|
|
263
|
+
|
|
264
|
+

|
|
265
|
+
|
|
252
266
|
## 🌐 Readme in other languages
|
|
253
267
|
|
|
254
268
|
<p align="center">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-scripts-intlayer.cjs","names":[],"sources":["../../../src/cli/react-scripts-intlayer.ts"],"sourcesContent":["#!/usr/bin/env node\n\n/**\n * To make the setup easier, we are using craco to override the webpack configuration.\n * This script is used to run the craco scripts with the custom configuration.\n *\n * The script is based on the original craco script from create-react-app.\n */\n\nimport { spawnSync } from 'node:child_process';\nimport { logger } from '@intlayer/config/logger';\nimport { getProjectRequire } from '@intlayer/config/utils';\n\nconst args = process.argv.slice(2);\nconst scriptIndex = args.findIndex(\n (index) => index === 'build' || index === 'start' || index === 'test'\n);\nconst script = scriptIndex === -1 ? args[0] : args[scriptIndex];\n\nswitch (script) {\n case 'build':\n case 'start':\n case 'test': {\n const nodeArgs = scriptIndex > 0 ? args.slice(0, scriptIndex) : [];\n const scriptPath = getProjectRequire().resolve(\n `@craco/craco/dist/scripts/${script}`\n );\n\n const scriptArgs = args.slice(scriptIndex + 1);\n const processArgs = nodeArgs\n .concat(scriptPath)\n .concat([\n ...scriptArgs,\n '--config',\n './node_modules/react-scripts-intlayer/dist/cjs/craco.config.cjs',\n ]);\n\n const child = spawnSync('node', processArgs, {\n stdio: 'inherit',\n });\n\n if (child.signal) {\n if (child.signal === 'SIGKILL') {\n logger(`\n The build failed because the process exited too early.\n This probably means the system ran out of memory or someone called\n \\`kill -9\\` on the process.\n `);\n } else if (child.signal === 'SIGTERM') {\n logger(`\n The build failed because the process exited too early.\n Someone might have called \\`kill\\` or \\`killall\\`, or the system could\n be shutting down.\n `);\n }\n\n process.exit(1);\n }\n\n process.exit(child.status ?? undefined);\n break;\n }\n default:\n logger(`Unknown script \"${script}\".`);\n logger('Perhaps you need to update craco?');\n break;\n}\n"],"mappings":";;;;;;;;;;;;AAaA,MAAM,OAAO,QAAQ,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"react-scripts-intlayer.cjs","names":[],"sources":["../../../src/cli/react-scripts-intlayer.ts"],"sourcesContent":["#!/usr/bin/env node\n\n/**\n * To make the setup easier, we are using craco to override the webpack configuration.\n * This script is used to run the craco scripts with the custom configuration.\n *\n * The script is based on the original craco script from create-react-app.\n */\n\nimport { spawnSync } from 'node:child_process';\nimport { logger } from '@intlayer/config/logger';\nimport { getProjectRequire } from '@intlayer/config/utils';\n\nconst args = process.argv.slice(2);\nconst scriptIndex = args.findIndex(\n (index) => index === 'build' || index === 'start' || index === 'test'\n);\nconst script = scriptIndex === -1 ? args[0] : args[scriptIndex];\n\nswitch (script) {\n case 'build':\n case 'start':\n case 'test': {\n const nodeArgs = scriptIndex > 0 ? args.slice(0, scriptIndex) : [];\n const scriptPath = getProjectRequire().resolve(\n `@craco/craco/dist/scripts/${script}`\n );\n\n const scriptArgs = args.slice(scriptIndex + 1);\n const processArgs = nodeArgs\n .concat(scriptPath)\n .concat([\n ...scriptArgs,\n '--config',\n './node_modules/react-scripts-intlayer/dist/cjs/craco.config.cjs',\n ]);\n\n const child = spawnSync('node', processArgs, {\n stdio: 'inherit',\n });\n\n if (child.signal) {\n if (child.signal === 'SIGKILL') {\n logger(`\n The build failed because the process exited too early.\n This probably means the system ran out of memory or someone called\n \\`kill -9\\` on the process.\n `);\n } else if (child.signal === 'SIGTERM') {\n logger(`\n The build failed because the process exited too early.\n Someone might have called \\`kill\\` or \\`killall\\`, or the system could\n be shutting down.\n `);\n }\n\n process.exit(1);\n }\n\n process.exit(child.status ?? undefined);\n break;\n }\n default:\n logger(`Unknown script \"${script}\".`);\n logger('Perhaps you need to update craco?');\n break;\n}\n"],"mappings":";;;;;;;;;;;;AAaA,MAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;AACjC,MAAM,cAAc,KAAK,WACtB,UAAU,UAAU,WAAW,UAAU,WAAW,UAAU,MACjE;AACA,MAAM,SAAS,gBAAgB,KAAK,KAAK,KAAK,KAAK;AAEnD,QAAQ,QAAR;CACE,KAAK;CACL,KAAK;CACL,KAAK,QAAQ;EACX,MAAM,WAAW,cAAc,IAAI,KAAK,MAAM,GAAG,WAAW,IAAI,CAAC;EACjE,MAAM,2DAA+B,EAAE,QACrC,6BAA6B,QAC/B;EAEA,MAAM,aAAa,KAAK,MAAM,cAAc,CAAC;EAS7C,MAAM,0CAAkB,QARJ,SACjB,OAAO,UAAU,EACjB,OAAO;GACN,GAAG;GACH;GACA;EACF,CAEwC,GAAG,EAC3C,OAAO,UACT,CAAC;EAED,IAAI,MAAM,QAAQ;GAChB,IAAI,MAAM,WAAW,WACnB,oCAAO;;;;aAIF;QACA,IAAI,MAAM,WAAW,WAC1B,oCAAO;;;;aAIF;GAGP,QAAQ,KAAK,CAAC;EAChB;EAEA,QAAQ,KAAK,MAAM,UAAU,MAAS;EACtC;CACF;CACA;EACE,oCAAO,mBAAmB,OAAO,GAAG;EACpC,oCAAO,mCAAmC;EAC1C;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"craco.config.cjs","names":["intlayerCracoPlugin"],"sources":["../../src/craco.config.ts"],"sourcesContent":["import type { CracoConfig } from '@craco/types';\nimport { intlayerCracoPlugin } from './intlayerCracoPlugin';\n\n// Usage Example\nconst cracoConfig = {\n plugins: [\n {\n plugin: intlayerCracoPlugin,\n },\n ],\n} satisfies CracoConfig;\n\n// Necessary Exporting as CJS for CRACO to work\nexport default cracoConfig;\n"],"mappings":";;;AAIA,MAAM,cAAc,EAClB,SAAS,CACP,EACE,QAAQA,
|
|
1
|
+
{"version":3,"file":"craco.config.cjs","names":["intlayerCracoPlugin"],"sources":["../../src/craco.config.ts"],"sourcesContent":["import type { CracoConfig } from '@craco/types';\nimport { intlayerCracoPlugin } from './intlayerCracoPlugin';\n\n// Usage Example\nconst cracoConfig = {\n plugins: [\n {\n plugin: intlayerCracoPlugin,\n },\n ],\n} satisfies CracoConfig;\n\n// Necessary Exporting as CJS for CRACO to work\nexport default cracoConfig;\n"],"mappings":";;;AAIA,MAAM,cAAc,EAClB,SAAS,CACP,EACE,QAAQA,gDACV,CACF,EACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intlayerCracoPlugin.cjs","names":["IntlayerPlugin"],"sources":["../../src/intlayerCracoPlugin.ts"],"sourcesContent":["import { join } from 'node:path';\nimport type {\n CracoConfig,\n CracoConfigOverride,\n CracoPlugin,\n WebpackConfigOverride,\n} from '@craco/types';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { getAlias } from '@intlayer/config/utils';\nimport { IntlayerPlugin } from '@intlayer/webpack';\nimport { defu } from 'defu';\nimport type { Configuration as WebpackConfig } from 'webpack';\n\n// Get Intlayer configuration\nconst intlayerConfig = getConfiguration();\n\nconst alias = getAlias({\n configuration: intlayerConfig,\n formatter: (value: string) => join(process.cwd(), value),\n});\n\n/**\n * Override the final CRA Webpack config.\n * We explicitely type the return as WebpackConfig to solve TS2742.\n */\nexport const overrideWebpackConfig = ({\n webpackConfig,\n}: WebpackConfigOverride): WebpackConfig => {\n // 1) Remove `module`, `fs`, `path`, `vm` from externals.\n if (typeof webpackConfig.externals === 'object') {\n webpackConfig.externals = {\n ...webpackConfig.externals,\n esbuild: 'esbuild',\n };\n }\n\n // 2) Properly push node-loader rule\n webpackConfig.module?.rules?.push({\n test: /\\.node$/,\n use: 'node-loader',\n });\n\n // We cast here to satisfy the internal function return type if there are minor discrepancies\n return webpackConfig as WebpackConfig;\n};\n\n/**\n * Override the CRACO config itself to set up aliases, fallbacks, and plugins.\n */\nexport const overrideCracoConfig = ({\n cracoConfig,\n}: CracoConfigOverride): CracoConfig =>\n defu(\n {\n webpack: {\n plugins: {\n // defu overwrites arrays by default, so we manually preserve existing plugins\n add: [\n ...(cracoConfig.webpack?.plugins?.add ?? []),\n new IntlayerPlugin(intlayerConfig),\n ],\n },\n // Automatically merges deeply with existing aliases\n alias,\n },\n },\n cracoConfig\n ) as CracoConfig;\n\n/**\n * A CRACO plugin that adds the Intlayer configuration to the webpack configuration\n * and sets the environment variables.\n */\nexport const intlayerCracoPlugin: CracoPlugin = {\n overrideCracoConfig,\n // We cast to `any` here to bypass the strict version mismatch between\n // the 'webpack' package installed in your node_modules and the one expected by '@craco/types'\n overrideWebpackConfig: overrideWebpackConfig as any,\n};\n"],"mappings":";;;;;;;;AAcA,MAAM,
|
|
1
|
+
{"version":3,"file":"intlayerCracoPlugin.cjs","names":["IntlayerPlugin"],"sources":["../../src/intlayerCracoPlugin.ts"],"sourcesContent":["import { join } from 'node:path';\nimport type {\n CracoConfig,\n CracoConfigOverride,\n CracoPlugin,\n WebpackConfigOverride,\n} from '@craco/types';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { getAlias } from '@intlayer/config/utils';\nimport { IntlayerPlugin } from '@intlayer/webpack';\nimport { defu } from 'defu';\nimport type { Configuration as WebpackConfig } from 'webpack';\n\n// Get Intlayer configuration\nconst intlayerConfig = getConfiguration();\n\nconst alias = getAlias({\n configuration: intlayerConfig,\n formatter: (value: string) => join(process.cwd(), value),\n});\n\n/**\n * Override the final CRA Webpack config.\n * We explicitely type the return as WebpackConfig to solve TS2742.\n */\nexport const overrideWebpackConfig = ({\n webpackConfig,\n}: WebpackConfigOverride): WebpackConfig => {\n // 1) Remove `module`, `fs`, `path`, `vm` from externals.\n if (typeof webpackConfig.externals === 'object') {\n webpackConfig.externals = {\n ...webpackConfig.externals,\n esbuild: 'esbuild',\n };\n }\n\n // 2) Properly push node-loader rule\n webpackConfig.module?.rules?.push({\n test: /\\.node$/,\n use: 'node-loader',\n });\n\n // We cast here to satisfy the internal function return type if there are minor discrepancies\n return webpackConfig as WebpackConfig;\n};\n\n/**\n * Override the CRACO config itself to set up aliases, fallbacks, and plugins.\n */\nexport const overrideCracoConfig = ({\n cracoConfig,\n}: CracoConfigOverride): CracoConfig =>\n defu(\n {\n webpack: {\n plugins: {\n // defu overwrites arrays by default, so we manually preserve existing plugins\n add: [\n ...(cracoConfig.webpack?.plugins?.add ?? []),\n new IntlayerPlugin(intlayerConfig),\n ],\n },\n // Automatically merges deeply with existing aliases\n alias,\n },\n },\n cracoConfig\n ) as CracoConfig;\n\n/**\n * A CRACO plugin that adds the Intlayer configuration to the webpack configuration\n * and sets the environment variables.\n */\nexport const intlayerCracoPlugin: CracoPlugin = {\n overrideCracoConfig,\n // We cast to `any` here to bypass the strict version mismatch between\n // the 'webpack' package installed in your node_modules and the one expected by '@craco/types'\n overrideWebpackConfig: overrideWebpackConfig as any,\n};\n"],"mappings":";;;;;;;;AAcA,MAAM,6DAAkC;AAExC,MAAM,6CAAiB;CACrB,eAAe;CACf,YAAY,8BAAuB,QAAQ,IAAI,GAAG,KAAK;AACzD,CAAC;;;;;AAMD,MAAa,yBAAyB,EACpC,oBAC0C;CAE1C,IAAI,OAAO,cAAc,cAAc,UACrC,cAAc,YAAY;EACxB,GAAG,cAAc;EACjB,SAAS;CACX;CAIF,cAAc,QAAQ,OAAO,KAAK;EAChC,MAAM;EACN,KAAK;CACP,CAAC;CAGD,OAAO;AACT;;;;AAKA,MAAa,uBAAuB,EAClC,iCAGE,EACE,SAAS;CACP,SAAS,EAEP,KAAK,CACH,GAAI,YAAY,SAAS,SAAS,OAAO,CAAC,GAC1C,IAAIA,iCAAe,cAAc,CACnC,EACF;CAEA;AACF,EACF,GACA,WACF;;;;;AAMF,MAAa,sBAAmC;CAC9C;CAGuB;AACzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"craco.config.d.ts","names":[],"sources":["../../src/craco.config.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"craco.config.d.ts","names":[],"sources":["../../src/craco.config.ts"],"mappings":";cAIM,WAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intlayerCracoPlugin.d.ts","names":[],"sources":["../../src/intlayerCracoPlugin.ts"],"mappings":";;;;;;AAyBA;;cAAa,qBAAA;EAAyB;AAAA,GAEnC,qBAAA,KAAwB,aAAA;;;;cAsBd,mBAAA;EAAuB;AAAA,GAEjC,mBAAA,KAAsB,WAAA;;;;;cAsBZ,mBAAA,EAAqB,
|
|
1
|
+
{"version":3,"file":"intlayerCracoPlugin.d.ts","names":[],"sources":["../../src/intlayerCracoPlugin.ts"],"mappings":";;;;;;AAyBA;;cAAa,qBAAA;EAAyB;AAAA,GAEnC,qBAAA,KAAwB,aAAA;;;;cAsBd,mBAAA;EAAuB;AAAA,GAEjC,mBAAA,KAAsB,WAAA;;;;;cAsBZ,mBAAA,EAAqB,WAKjC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-scripts-intlayer",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.10.0-canary.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Integrate Intlayer with Create React App using custom React scripts for internationalization i18n and advanced Webpack configurations",
|
|
6
6
|
"keywords": [
|
|
@@ -79,9 +79,9 @@
|
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@craco/craco": "7.1.0",
|
|
82
|
-
"@intlayer/config": "8.
|
|
83
|
-
"@intlayer/types": "8.
|
|
84
|
-
"@intlayer/webpack": "8.
|
|
82
|
+
"@intlayer/config": "8.10.0-canary.0",
|
|
83
|
+
"@intlayer/types": "8.10.0-canary.0",
|
|
84
|
+
"@intlayer/webpack": "8.10.0-canary.0",
|
|
85
85
|
"defu": "6.1.7",
|
|
86
86
|
"node-loader": "2.1.0",
|
|
87
87
|
"process": "0.11.10",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"devDependencies": {
|
|
91
91
|
"@craco/types": "7.1.0",
|
|
92
92
|
"@types/cross-spawn": "6.0.6",
|
|
93
|
-
"@types/node": "25.
|
|
93
|
+
"@types/node": "25.9.0",
|
|
94
94
|
"@types/webpack": "5.28.5",
|
|
95
95
|
"@utils/ts-config": "1.0.4",
|
|
96
96
|
"@utils/ts-config-types": "1.0.4",
|