@modern-js/generator-utils 3.0.11 → 3.1.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,44 @@
1
1
  # @modern-js/generator-utils
2
2
 
3
+ ## 3.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [cfb058f]
8
+ - Updated dependencies [0bd018b]
9
+ - Updated dependencies [5d624fd]
10
+ - Updated dependencies [e2466a1]
11
+ - Updated dependencies [02bb383]
12
+ - Updated dependencies [381a3b9]
13
+ - Updated dependencies [7a60f10]
14
+ - Updated dependencies [274b2e5]
15
+ - Updated dependencies [b9e1c54]
16
+ - @modern-js/utils@2.11.0
17
+ - @modern-js/plugin-i18n@2.11.0
18
+ - @modern-js/generator-common@3.1.1
19
+
20
+ ## 3.1.0
21
+
22
+ ### Minor Changes
23
+
24
+ - 03d0eb5: feat: create tools add doc solution
25
+
26
+ feat: create 工具增加文档站工程方案
27
+
28
+ ### Patch Changes
29
+
30
+ - 0da32d0: chore: upgrade jest and puppeteer
31
+ chore: 升级 jest 和 puppeteer 到 latest
32
+ - Updated dependencies [0da32d0]
33
+ - Updated dependencies [0d9962b]
34
+ - Updated dependencies [fbefa7e]
35
+ - Updated dependencies [03d0eb5]
36
+ - Updated dependencies [4d54233]
37
+ - Updated dependencies [6db4864]
38
+ - @modern-js/generator-common@3.1.0
39
+ - @modern-js/plugin-i18n@2.10.0
40
+ - @modern-js/utils@2.10.0
41
+
3
42
  ## 3.0.11
4
43
 
5
44
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -35,6 +35,7 @@ __export(src_exports, {
35
35
  execa: () => import_utils2.execa,
36
36
  fs: () => import_utils2.fs,
37
37
  getAllPackages: () => getAllPackages,
38
+ getDocProjectPath: () => getDocProjectPath,
38
39
  getMWAProjectPath: () => getMWAProjectPath,
39
40
  getModernConfigFile: () => getModernConfigFile,
40
41
  getModernPluginVersion: () => getModernPluginVersion,
@@ -149,10 +150,12 @@ function validatePackageName(value, packages, options) {
149
150
  return { success: true };
150
151
  }
151
152
  function validatePackagePath(value, projectDir, options) {
152
- const { isMwa, isPublic, isTest } = options || {};
153
+ const { isMwa, isPublic, isTest, isDoc } = options || {};
153
154
  let dir = "apps";
154
155
  if (isMwa && isTest) {
155
156
  dir = "examples";
157
+ } else if (isDoc) {
158
+ dir = "website";
156
159
  } else {
157
160
  dir = isPublic ? "packages" : "features";
158
161
  }
@@ -180,6 +183,12 @@ function getMWAProjectPath(packagePath, isMonorepoSubProject, isTest = false) {
180
183
  }
181
184
  return "";
182
185
  }
186
+ function getDocProjectPath(packagePath, isMonorepoSubProject) {
187
+ if (isMonorepoSubProject && packagePath) {
188
+ return `website/${packagePath}/`;
189
+ }
190
+ return "";
191
+ }
183
192
  async function getModernConfigFile(appDir) {
184
193
  let exist = await (0, import_fsExist.fileExist)(import_path.default.join(appDir, "modern.config.ts"));
185
194
  if (exist) {
@@ -200,6 +209,7 @@ async function getModernConfigFile(appDir) {
200
209
  execa,
201
210
  fs,
202
211
  getAllPackages,
212
+ getDocProjectPath,
203
213
  getMWAProjectPath,
204
214
  getModernConfigFile,
205
215
  getModernPluginVersion,
package/dist/esm/index.js CHANGED
@@ -112,10 +112,12 @@ function validatePackageName(value, packages, options) {
112
112
  return { success: true };
113
113
  }
114
114
  function validatePackagePath(value, projectDir, options) {
115
- const { isMwa, isPublic, isTest } = options || {};
115
+ const { isMwa, isPublic, isTest, isDoc } = options || {};
116
116
  let dir = "apps";
117
117
  if (isMwa && isTest) {
118
118
  dir = "examples";
119
+ } else if (isDoc) {
120
+ dir = "website";
119
121
  } else {
120
122
  dir = isPublic ? "packages" : "features";
121
123
  }
@@ -143,6 +145,12 @@ function getMWAProjectPath(packagePath, isMonorepoSubProject, isTest = false) {
143
145
  }
144
146
  return "";
145
147
  }
148
+ function getDocProjectPath(packagePath, isMonorepoSubProject) {
149
+ if (isMonorepoSubProject && packagePath) {
150
+ return `website/${packagePath}/`;
151
+ }
152
+ return "";
153
+ }
146
154
  async function getModernConfigFile(appDir) {
147
155
  let exist = await fileExist(path.join(appDir, "modern.config.ts"));
148
156
  if (exist) {
@@ -162,6 +170,7 @@ export {
162
170
  execa2 as execa,
163
171
  fs2 as fs,
164
172
  getAllPackages,
173
+ getDocProjectPath,
165
174
  getMWAProjectPath,
166
175
  getModernConfigFile,
167
176
  getModernPluginVersion,
@@ -27,6 +27,7 @@ export declare function validatePackagePath(value: string, projectDir: string, o
27
27
  isMwa?: boolean;
28
28
  isPublic?: boolean;
29
29
  isTest?: boolean;
30
+ isDoc?: boolean;
30
31
  }): {
31
32
  success: boolean;
32
33
  error: string;
@@ -36,4 +37,5 @@ export declare function validatePackagePath(value: string, projectDir: string, o
36
37
  };
37
38
  export declare function getModuleProjectPath(packagePath: string, isMonorepoSubProject: boolean, isPublic: boolean, isLocalPackages: boolean): string;
38
39
  export declare function getMWAProjectPath(packagePath: string, isMonorepoSubProject: boolean, isTest?: boolean): string;
40
+ export declare function getDocProjectPath(packagePath: string, isMonorepoSubProject: boolean): string;
39
41
  export declare function getModernConfigFile(appDir: string): Promise<"modern.config.ts" | "modern.config.js">;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "3.0.11",
14
+ "version": "3.1.1",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/cjs/index.js",
@@ -27,18 +27,18 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@babel/runtime": "^7.18.0",
30
- "@modern-js/plugin-i18n": "2.9.0",
31
- "@modern-js/generator-common": "3.0.11",
32
- "@modern-js/utils": "2.9.0"
30
+ "@modern-js/plugin-i18n": "2.11.0",
31
+ "@modern-js/generator-common": "3.1.1",
32
+ "@modern-js/utils": "2.11.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@modern-js/codesmith": "2.0.5",
36
- "@types/jest": "^27",
36
+ "@types/jest": "^29",
37
37
  "@types/node": "^14",
38
- "jest": "^27",
38
+ "jest": "^29",
39
39
  "typescript": "^4",
40
- "@scripts/build": "2.9.0",
41
- "@scripts/jest-config": "2.9.0"
40
+ "@scripts/build": "2.11.0",
41
+ "@scripts/jest-config": "2.11.0"
42
42
  },
43
43
  "sideEffects": false,
44
44
  "modernConfig": {