intlayer-cli 1.0.0 → 1.2.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 ADDED
@@ -0,0 +1,72 @@
1
+ # Intlayer: Next-Level Content Management in JavaScript
2
+
3
+ **Intlayer** is an innovative Content Management System (CMS) designed specifically for JavaScript developers. It enables seamless transpilation of JavaScript content into structured dictionaries, making integration into your codebase straightforward and efficient.
4
+
5
+ ## Why Choose Intlayer?
6
+
7
+ - **JavaScript-Powered Content Management**: Harness the flexibility of JavaScript to define and manage your content efficiently.
8
+ - **Type-Safe Environment**: Leverage TypeScript to ensure all your content definitions are precise and error-free.
9
+ - **Integrated Content Files**: Keep your translations close to their respective components, enhancing maintainability and clarity.
10
+ - **Simplified Setup**: Get up and running quickly with minimal configuration, especially optimized for Next.js projects.
11
+ - **Server Component Support**: Perfectly suited for Next.js server components, ensuring smooth server-side rendering.
12
+ - **Enhanced Routing**: Full support for Next.js app routing, adapting seamlessly to complex application structures.
13
+
14
+ ### Install Package
15
+
16
+ Install the necessary packages using npm:
17
+
18
+ ```bash
19
+ npm install intlayer-cli
20
+ ```
21
+
22
+ ```bash
23
+ yarn install intlayer-cli
24
+ ```
25
+
26
+ ```bash
27
+ pnpm install intlayer-cli
28
+ ```
29
+
30
+ ## intlayer-cli package
31
+
32
+ `intlayer-cli` package intend to transpile your [intlayer](https://github.com/aypineau/intlayer/blob/main/packages/intlayer/readme.md) declarations into dictionaries.
33
+
34
+ This package will transpile all intlayer files, such as `src/**/*.content.{ts|js|mjs|cjs|json}`. [See how to declare your Intlayer declaration files](https://github.com/aypineau/intlayer/blob/main/packages/intlayer/readme.md).
35
+
36
+ To interpret intlayer dictionaries you can interpreters, such as [react-intlayer](https://github.com/aypineau/intlayer/blob/main/packages/react-intlayer/readme.md), or [next-intlayer](https://github.com/aypineau/intlayer/blob/main/packages/next-intlayer/readme.md)
37
+
38
+ ## Configuration File Support
39
+
40
+ Intlayer accepts multiple configuration file formats:
41
+
42
+ - `intlayer.config.ts`
43
+ - `intlayer.config.js`
44
+ - `intlayer.config.json`
45
+ - `intlayer.config.cjs`
46
+ - `intlayer.config.mjs`
47
+ - `.intlayerrc`
48
+
49
+ To see how to configure available locales, or other parameters, refer to the [configuration documentation here](https://github.com/aypineau/intlayer/blob/main/docs/configuration.md).
50
+
51
+ ### Run intlayer commands
52
+
53
+ To build your dictionaries, you can run the commands:
54
+
55
+ ```bash
56
+ npx intlayer transpile
57
+ ```
58
+
59
+ or in watch mode
60
+
61
+ ```bash
62
+ npx intlayer watch
63
+ ```
64
+
65
+ ### Use intlayer commands in your `package.json`:
66
+
67
+ ```json
68
+ "scripts": {
69
+ "transpile": "npx intlayer transpile",
70
+ "transpile:watch": "npx intlayer watch"
71
+ }
72
+ ```
@@ -1,13 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
+ var import_chokidar = require("@intlayer/chokidar");
3
4
  var import_cli = require("@intlayer/cli");
4
- var import_webpack = require("@intlayer/webpack");
5
- var import_webpack2 = require("webpack");
6
- const compiler = (0, import_webpack2.webpack)(import_webpack.webpackConfig);
7
5
  (0, import_cli.setAPI)({
8
6
  version: "1.0.0",
9
- transpile: () => (0, import_webpack.bundle)(compiler),
10
- watch: () => (0, import_webpack.watch)(compiler),
11
- serve: () => (0, import_webpack.startServer)(compiler),
7
+ transpile: () => (0, import_chokidar.watch)({ persistent: false }),
8
+ watch: () => (0, import_chokidar.watch)({ persistent: true })
12
9
  });
13
- //# sourceMappingURL=index.cjs.map
10
+ //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { setAPI } from '@intlayer/cli';\nimport { webpackConfig, startServer, bundle, watch } from '@intlayer/webpack';\nimport { webpack } from 'webpack';\n\n// Create a Webpack compiler instance with your configuration\nconst compiler = webpack(webpackConfig);\n\n// Log the compiler options\nsetAPI({\n version: '1.0.0',\n transpile: () => bundle(compiler),\n watch: () => watch(compiler),\n serve: () => startServer(compiler),\n});\n"],"mappings":";;AAEA,iBAAuB;AACvB,qBAA0D;AAC1D,IAAAA,kBAAwB;AAGxB,MAAM,eAAW,yBAAQ,4BAAa;AAAA,IAGtC,mBAAO;AAAA,EACL,SAAS;AAAA,EACT,WAAW,UAAM,uBAAO,QAAQ;AAAA,EAChC,OAAO,UAAM,sBAAM,QAAQ;AAAA,EAC3B,OAAO,UAAM,4BAAY,QAAQ;AACnC,CAAC;","names":["import_webpack"]}
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { watch } from '@intlayer/chokidar';\nimport { setAPI } from '@intlayer/cli';\n\n// Log the compiler options\nsetAPI({\n version: '1.0.0',\n transpile: () => watch({ persistent: false }),\n watch: () => watch({ persistent: true }),\n});\n"],"mappings":";;AAEA,sBAAsB;AACtB,iBAAuB;AAAA,IAGvB,mBAAO;AAAA,EACL,SAAS;AAAA,EACT,WAAW,UAAM,uBAAM,EAAE,YAAY,MAAM,CAAC;AAAA,EAC5C,OAAO,UAAM,uBAAM,EAAE,YAAY,KAAK,CAAC;AACzC,CAAC;","names":[]}
@@ -1,12 +1,9 @@
1
1
  #!/usr/bin/env node
2
+ import { watch } from "@intlayer/chokidar";
2
3
  import { setAPI } from "@intlayer/cli";
3
- import { webpackConfig, startServer, bundle, watch } from "@intlayer/webpack";
4
- import { webpack } from "webpack";
5
- const compiler = webpack(webpackConfig);
6
4
  setAPI({
7
5
  version: "1.0.0",
8
- transpile: () => bundle(compiler),
9
- watch: () => watch(compiler),
10
- serve: () => startServer(compiler),
6
+ transpile: () => watch({ persistent: false }),
7
+ watch: () => watch({ persistent: true })
11
8
  });
12
- //# sourceMappingURL=index.mjs.map
9
+ //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { setAPI } from '@intlayer/cli';\nimport { webpackConfig, startServer, bundle, watch } from '@intlayer/webpack';\nimport { webpack } from 'webpack';\n\n// Create a Webpack compiler instance with your configuration\nconst compiler = webpack(webpackConfig);\n\n// Log the compiler options\nsetAPI({\n version: '1.0.0',\n transpile: () => bundle(compiler),\n watch: () => watch(compiler),\n serve: () => startServer(compiler),\n});\n"],"mappings":";AAEA,SAAS,cAAc;AACvB,SAAS,eAAe,aAAa,QAAQ,aAAa;AAC1D,SAAS,eAAe;AAGxB,MAAM,WAAW,QAAQ,aAAa;AAGtC,OAAO;AAAA,EACL,SAAS;AAAA,EACT,WAAW,MAAM,OAAO,QAAQ;AAAA,EAChC,OAAO,MAAM,MAAM,QAAQ;AAAA,EAC3B,OAAO,MAAM,YAAY,QAAQ;AACnC,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { watch } from '@intlayer/chokidar';\nimport { setAPI } from '@intlayer/cli';\n\n// Log the compiler options\nsetAPI({\n version: '1.0.0',\n transpile: () => watch({ persistent: false }),\n watch: () => watch({ persistent: true }),\n});\n"],"mappings":";AAEA,SAAS,aAAa;AACtB,SAAS,cAAc;AAGvB,OAAO;AAAA,EACL,SAAS;AAAA,EACT,WAAW,MAAM,MAAM,EAAE,YAAY,MAAM,CAAC;AAAA,EAC5C,OAAO,MAAM,MAAM,EAAE,YAAY,KAAK,CAAC;AACzC,CAAC;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intlayer-cli",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "private": false,
5
5
  "description": "IntLayer is a layer of abstraction between the business logic and the data access layer. Manage internationalization in a simple way, through TypeScript, JavaScript or JSON declaration file.",
6
6
  "keywords": [
@@ -15,7 +15,7 @@
15
15
  "homepage": "https://github.com/aypineau/intlayer",
16
16
  "repository": {
17
17
  "type": "git",
18
- "url": "https://github.com/aypineau/intlayer"
18
+ "url": "git+https://github.com/aypineau/intlayer.git"
19
19
  },
20
20
  "license": "MIT",
21
21
  "author": {
@@ -49,10 +49,10 @@
49
49
  ],
50
50
  "dependencies": {
51
51
  "webpack": "^5.91.0",
52
- "@intlayer/config": "^1.0.0",
53
- "@intlayer/core": "^1.0.0",
54
- "@intlayer/webpack": "^1.0.0",
55
- "@intlayer/cli": "^1.0.0"
52
+ "@intlayer/chokidar": "^1.2.0",
53
+ "@intlayer/cli": "^1.2.0",
54
+ "@intlayer/config": "^1.2.0",
55
+ "@intlayer/core": "^1.2.0"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@changesets/changelog-github": "0.5.0",
@@ -60,9 +60,9 @@
60
60
  "@types/node": "^20.12.7",
61
61
  "rimraf": "5.0.5",
62
62
  "tsup": "^8.0.2",
63
- "typescript": "^5.3.3",
64
- "@utils/eslint-config": "^1.0.0",
65
- "@utils/ts-config": "^1.0.0"
63
+ "typescript": "^5.4.5",
64
+ "@utils/eslint-config": "^1.0.1",
65
+ "@utils/ts-config": "^1.0.1"
66
66
  },
67
67
  "engines": {
68
68
  "node": ">=14.18"
package/src/index.ts CHANGED
@@ -1,16 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ import { watch } from '@intlayer/chokidar';
3
4
  import { setAPI } from '@intlayer/cli';
4
- import { webpackConfig, startServer, bundle, watch } from '@intlayer/webpack';
5
- import { webpack } from 'webpack';
6
-
7
- // Create a Webpack compiler instance with your configuration
8
- const compiler = webpack(webpackConfig);
9
5
 
10
6
  // Log the compiler options
11
7
  setAPI({
12
8
  version: '1.0.0',
13
- transpile: () => bundle(compiler),
14
- watch: () => watch(compiler),
15
- serve: () => startServer(compiler),
9
+ transpile: () => watch({ persistent: false }),
10
+ watch: () => watch({ persistent: true }),
16
11
  });