i18nexus-cli 3.8.2 → 4.0.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 CHANGED
@@ -49,17 +49,6 @@ If your i18nexus project is set to **`i18next`**:
49
49
  └── common.json
50
50
  ```
51
51
 
52
- If your i18nexus project is set to **`i18next`** and the CLI detects you're using **Next.js + App Router**:
53
-
54
- ```
55
- .
56
- └── locales
57
- ├── en
58
- | └── common.json
59
- └── de
60
- └── common.json
61
- ```
62
-
63
52
  If your i18nexus project is set to **`next-intl`**:
64
53
 
65
54
  ```
@@ -73,14 +62,25 @@ If your i18nexus project is set to **`react-intl`**:
73
62
 
74
63
  ```
75
64
  .
76
- └── messages
77
- └── locales
65
+ └── src
66
+ └── messages
78
67
  ├── en
79
68
  | └── common.json
80
69
  └── de
81
70
  └── common.json
82
71
  ```
83
72
 
73
+ If your i18nexus project is set to **`react-intl`** and a `src` directory does not exist:
74
+
75
+ ```
76
+ .
77
+ └── messages
78
+ ├── en
79
+ | └── common.json
80
+ └── de
81
+ └── common.json
82
+ ```
83
+
84
84
  If you wish to download your files to a different directory, you can use the `--path` option to specify your download destination. See all options below:
85
85
 
86
86
  ### Options
package/commands/pull.js CHANGED
@@ -45,20 +45,13 @@ const pull = async (opt, internalOptions = {}) => {
45
45
  }
46
46
 
47
47
  if (projectLibrary === 'i18next') {
48
- const hasAppDir =
49
- fs.existsSync(`${process.cwd()}/app`) ||
50
- fs.existsSync(`${process.cwd()}/src/app`);
51
- const usingAppRouter =
52
- hasAppDir &&
53
- (fs.existsSync(`${process.cwd()}/.next`) ||
54
- fs.existsSync(`${process.cwd()}/next.config.js`) ||
55
- fs.existsSync(`${process.cwd()}/next.config.ts`));
56
-
57
- if (usingAppRouter) {
58
- path = `${process.cwd()}/locales`;
59
- } else {
60
- path = `${process.cwd()}/public/locales`;
61
- }
48
+ path = `${process.cwd()}/public/locales`;
49
+ } else if (projectLibrary === 'react-intl') {
50
+ const hasSrcDir = fs.existsSync(`${process.cwd()}/src`);
51
+
52
+ path = hasSrcDir
53
+ ? `${process.cwd()}/src/messages`
54
+ : `${process.cwd()}/messages`;
62
55
  } else {
63
56
  path = `${process.cwd()}/messages`;
64
57
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "i18nexus-cli",
3
- "version": "3.8.2",
3
+ "version": "4.0.0",
4
4
  "description": "Command line interface (CLI) for accessing the i18nexus API",
5
5
  "main": "index.js",
6
6
  "bin": {