easy-soft-develop 2.1.107 → 2.1.110

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-soft-develop",
3
- "version": "2.1.107",
3
+ "version": "2.1.110",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/kityandhero/easy-soft-develop#readme",
6
6
  "bugs": {
@@ -0,0 +1,47 @@
1
+ const {
2
+ writeJsonFileSync,
3
+ readJsonFileSync,
4
+ existFileSync,
5
+ mkdirSync,
6
+ } = require('../tools/meta');
7
+
8
+ const developSubPathVersionNcu = {
9
+ paths: [],
10
+ };
11
+
12
+ const developSubPathVersionNcuConfigFilePath =
13
+ './develop/config/develop.subPath.version.ncu.json';
14
+
15
+ function createDevelopSubPathVersionNcuConfigFile() {
16
+ mkdirSync(`./develop`);
17
+
18
+ mkdirSync(`./develop/config`);
19
+
20
+ writeJsonFileSync(
21
+ developSubPathVersionNcuConfigFilePath,
22
+ developSubPathVersionNcu,
23
+ {
24
+ coverFile: false,
25
+ },
26
+ );
27
+ }
28
+
29
+ function getDevelopSubPathVersionNcuConfig() {
30
+ const developSubPathVersionNcuConfigFileExist = existFileSync(
31
+ developSubPathVersionNcuConfigFilePath,
32
+ );
33
+
34
+ if (!developSubPathVersionNcuConfigFileExist) {
35
+ createDevelopSubPathVersionNcuConfigFile();
36
+ }
37
+
38
+ return {
39
+ ...developSubPathVersionNcu,
40
+ ...readJsonFileSync(developSubPathVersionNcuConfigFilePath),
41
+ };
42
+ }
43
+
44
+ module.exports = {
45
+ createDevelopSubPathVersionNcuConfigFile,
46
+ getDevelopSubPathVersionNcuConfig,
47
+ };
@@ -28,6 +28,9 @@ const {
28
28
  const {
29
29
  createDevelopInitialEnvironmentConfigFile,
30
30
  } = require('../config/develop.initial.environment');
31
+ const {
32
+ createDevelopSubPathVersionNcuConfigFile,
33
+ } = require('../config/develop.subPath.version.ncu');
31
34
 
32
35
  function createRepositoryProjectFolder(name) {
33
36
  mkdirSync(`./${name}`);
@@ -200,6 +203,8 @@ function initialEnvironment() {
200
203
 
201
204
  createDevelopInitialEnvironmentConfigFile();
202
205
 
206
+ createDevelopSubPathVersionNcuConfigFile();
207
+
203
208
  promptSuccess(`step *: config environment`);
204
209
 
205
210
  promptEmptyLine();
@@ -1,33 +1,53 @@
1
1
  const fs = require('fs');
2
2
 
3
- const { resolvePath, existDirectorySync } = require('./meta');
3
+ const { resolvePath, existDirectorySync, isArray } = require('./meta');
4
+ const {
5
+ getDevelopSubPathVersionNcuConfig,
6
+ } = require('../config/develop.subPath.version.ncu');
4
7
 
5
8
  /**
6
9
  * loop all package
7
10
  */
8
11
  // eslint-disable-next-line no-unused-vars
9
12
  function loopPackage(callback = ({ name, absolutePath, relativePath }) => {}) {
10
- const packagesDir = './packages/';
13
+ const developSubPathVersionNcuConfig = getDevelopSubPathVersionNcuConfig();
11
14
 
12
- if (!existDirectorySync(resolvePath(packagesDir))) {
15
+ const { paths = [] } = {
16
+ paths: [],
17
+ ...developSubPathVersionNcuConfig,
18
+ };
19
+
20
+ if (!isArray(paths)) {
13
21
  return;
14
22
  }
15
23
 
16
- const packagesPath = resolvePath(packagesDir);
17
-
18
- const files = fs.readdirSync(packagesDir);
24
+ if (paths.length === 0) {
25
+ return;
26
+ }
19
27
 
20
- files.forEach((file) => {
21
- const itemPath = `${packagesPath}/${file}`;
28
+ for (let index = 0; index < paths.length; index++) {
29
+ const path = paths[index];
22
30
 
23
- if (file && fs.lstatSync(itemPath).isDirectory()) {
24
- callback({
25
- name: file,
26
- absolutePath: itemPath,
27
- relativePath: `./packages/${file}`,
28
- });
31
+ if (!existDirectorySync(resolvePath(path))) {
32
+ continue;
29
33
  }
30
- });
34
+
35
+ const packagesPath = resolvePath(path);
36
+
37
+ const files = fs.readdirSync(path);
38
+
39
+ files.forEach((file) => {
40
+ const itemPath = `${packagesPath}/${file}`;
41
+
42
+ if (file && fs.lstatSync(itemPath).isDirectory()) {
43
+ callback({
44
+ name: file,
45
+ absolutePath: itemPath,
46
+ relativePath: `./packages/${file}`,
47
+ });
48
+ }
49
+ });
50
+ }
31
51
  }
32
52
 
33
53
  module.exports = { loopPackage };
@@ -0,0 +1,2 @@
1
+ export function createDevelopSubPathVersionNcuConfigFile(): void;
2
+ export function getDevelopSubPathVersionNcuConfig(): any;