generator-reshow 0.16.3 → 0.17.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/generators/app/__tests__/TestApp.js +1 -2
- package/generators/app/index.js +1 -2
- package/generators/app/templates/package.json +2 -10
- package/generators/compile-sh/__tests__/Test.js +1 -2
- package/generators/compile-sh/index.js +4 -4
- package/generators/docker/__tests__/Test.js +1 -2
- package/generators/docker/index.js +1 -2
- package/generators/docker/templates/_circleci/config.yml +2 -1
- package/generators/generator/__tests__/TestGenerator.js +1 -2
- package/generators/generator/index.js +1 -2
- package/generators/generator/templates/Test.js +1 -2
- package/generators/generator/templates/index.js +1 -2
- package/generators/library/__tests__/Test.js +1 -2
- package/generators/library/index.js +1 -2
- package/generators/npm/__tests__/Test.js +1 -2
- package/generators/npm/index.js +1 -2
- package/generators/update-esm-export/__tests__/Test.js +1 -2
- package/generators/update-esm-export/index.js +41 -23
- package/package.json +3 -3
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
* https://github.com/yeoman/yeoman-test/blob/main/lib/run-context.js
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
const { YoTest, assert } = getYoUnit();
|
|
9
|
+
const { YoTest, assert } = require("yo-unit");
|
|
11
10
|
|
|
12
11
|
describe("generator-reshow:app", () => {
|
|
13
12
|
let runResult;
|
package/generators/app/index.js
CHANGED
|
@@ -10,18 +10,10 @@
|
|
|
10
10
|
"author": "",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"get-object-value": "*",
|
|
14
|
-
"organism-react-ajax": "*",
|
|
15
|
-
"organism-react-navigation": "*",
|
|
16
|
-
"organism-react-popup": "*",
|
|
17
|
-
"organism-react-progress": "*",
|
|
18
13
|
"pmvc_react_admin": "*",
|
|
19
|
-
"react": "^
|
|
20
|
-
"react-dom": "^
|
|
21
|
-
"reshow": "*",
|
|
14
|
+
"react": "^18.x",
|
|
15
|
+
"react-dom": "^18.x",
|
|
22
16
|
"reshow-app": "*",
|
|
23
|
-
"reshow-constant": "*",
|
|
24
|
-
"reshow-url": "*",
|
|
25
17
|
"ricon": "*"
|
|
26
18
|
},
|
|
27
19
|
"scripts": {
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
* https://github.com/yeoman/yeoman-test/blob/main/lib/run-context.js
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
const { YoTest, assert } = getYoUnit();
|
|
9
|
+
const { YoTest, assert } = require("yo-unit");
|
|
11
10
|
|
|
12
11
|
describe("!! compile-sh !!", () => {
|
|
13
12
|
let runResult;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const
|
|
2
|
-
const { YoGenerator, YoHelper, commonPrompt } = getYo();
|
|
1
|
+
const { YoGenerator, YoHelper, commonPrompt } = require("yo-reshow");
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* compile-sh Generator
|
|
6
5
|
*/
|
|
7
6
|
module.exports = class extends YoGenerator {
|
|
8
7
|
writing() {
|
|
9
|
-
const { cp } = YoHelper(this);
|
|
10
|
-
|
|
8
|
+
const { cp, getDotYo } = YoHelper(this);
|
|
9
|
+
const { webpackEnabled } = { ...this.options, ...getDotYo(this.options) };
|
|
10
|
+
cp("compile.sh", null, { webpackEnabled }, true);
|
|
11
11
|
}
|
|
12
12
|
};
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
* https://github.com/yeoman/yeoman-test/blob/main/lib/run-context.js
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
const { YoTest, assert } = getYoUnit();
|
|
9
|
+
const { YoTest, assert } = require("yo-unit");
|
|
11
10
|
|
|
12
11
|
describe("!! docker !!", () => {
|
|
13
12
|
let runResult;
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
* https://github.com/yeoman/yeoman-test/blob/main/lib/run-context.js
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
const { YoTest, assert } = getYoUnit();
|
|
9
|
+
const { YoTest, assert } = require("yo-unit");
|
|
11
10
|
|
|
12
11
|
describe("!! generator !!", () => {
|
|
13
12
|
let runResult;
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
* https://github.com/yeoman/yeoman-test/blob/main/lib/run-context.js
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
const { YoTest, assert } = getYoUnit();
|
|
9
|
+
const { YoTest, assert } = require("yo-unit");
|
|
11
10
|
|
|
12
11
|
describe("!! <%= mainName %> !!", () => {
|
|
13
12
|
let runResult;
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
* https://github.com/yeoman/yeoman-test/blob/main/lib/run-context.js
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
const { YoTest, assert } = getYoUnit();
|
|
9
|
+
const { YoTest, assert } = require("yo-unit");
|
|
11
10
|
|
|
12
11
|
describe("!! library !!", () => {
|
|
13
12
|
let runResult;
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
* https://github.com/yeoman/yeoman-test/blob/main/lib/run-context.js
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
const { YoTest, assert } = getYoUnit();
|
|
9
|
+
const { YoTest, assert } = require("yo-unit");
|
|
11
10
|
|
|
12
11
|
describe("!! npm !!", () => {
|
|
13
12
|
let runResult;
|
package/generators/npm/index.js
CHANGED
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
* https://github.com/yeoman/yeoman-test/blob/main/lib/run-context.js
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
const { YoTest, assert } = getYoUnit();
|
|
9
|
+
const { YoTest, assert } = require("yo-unit");
|
|
11
10
|
|
|
12
11
|
describe("!! update-esm-export !!", () => {
|
|
13
12
|
let runResult;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
const
|
|
2
|
-
const { KEYS } = require("reshow-constant");
|
|
3
|
-
const { YoGenerator, YoHelper, commonPrompt } = getYo();
|
|
1
|
+
const { YoGenerator, YoHelper, commonPrompt } = require("yo-reshow");
|
|
4
2
|
|
|
5
3
|
/**
|
|
6
4
|
* update-esm-export Generator
|
|
@@ -27,32 +25,46 @@ module.exports = class extends YoGenerator {
|
|
|
27
25
|
* https://github.com/SBoudrias/Inquirer.js
|
|
28
26
|
*/
|
|
29
27
|
async prompting() {
|
|
30
|
-
const {
|
|
31
|
-
say,
|
|
32
|
-
exit,
|
|
33
|
-
isFile,
|
|
34
|
-
getDotYo,
|
|
35
|
-
glob,
|
|
36
|
-
updateJSON,
|
|
37
|
-
} = YoHelper(this);
|
|
28
|
+
const { say, exit, isFile, getDotYo, glob, updateJSON } = YoHelper(this);
|
|
38
29
|
const pkg = isFile("package.json");
|
|
39
30
|
|
|
40
31
|
const opts = getDotYo();
|
|
41
32
|
if (!opts.exports) {
|
|
42
33
|
return;
|
|
43
34
|
}
|
|
44
|
-
const {
|
|
45
|
-
|
|
35
|
+
const {
|
|
36
|
+
srcArr,
|
|
37
|
+
prependArr,
|
|
38
|
+
moreKeyArr,
|
|
39
|
+
moreValArr,
|
|
40
|
+
pkgjson,
|
|
41
|
+
appendArr,
|
|
42
|
+
requirePrependArr,
|
|
43
|
+
requireAppendArr,
|
|
44
|
+
importPrependArr,
|
|
45
|
+
importAppendArr,
|
|
46
|
+
} = opts.exports;
|
|
46
47
|
const nextExports = {};
|
|
47
48
|
srcArr.forEach((v, index) => {
|
|
48
49
|
const prepend = prependArr[index];
|
|
49
|
-
const append = appendArr[index];
|
|
50
50
|
glob(
|
|
51
51
|
v,
|
|
52
52
|
({ filename }) => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
let content;
|
|
54
|
+
if (appendArr) {
|
|
55
|
+
const append = appendArr[index];
|
|
56
|
+
content = `${prepend}${filename}${append}`;
|
|
57
|
+
} else {
|
|
58
|
+
content = {
|
|
59
|
+
require: `${requirePrependArr[index]}${filename}${requireAppendArr[index]}`,
|
|
60
|
+
import: `${importPrependArr[index]}${filename}${importAppendArr[index]}`,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
let nextKey = `${prepend}${filename}`;
|
|
64
|
+
if (nextKey === "./index") {
|
|
65
|
+
nextKey = ".";
|
|
66
|
+
}
|
|
67
|
+
nextExports[nextKey] = content;
|
|
56
68
|
},
|
|
57
69
|
true
|
|
58
70
|
);
|
|
@@ -63,20 +75,27 @@ module.exports = class extends YoGenerator {
|
|
|
63
75
|
|
|
64
76
|
const pkgFile = isFile(pkgjson);
|
|
65
77
|
if (pkgFile) {
|
|
66
|
-
updateJSON(null, pkgFile, null, ({ exports, ...json }) => {
|
|
78
|
+
updateJSON(null, pkgFile, null, ({ exports = {}, ...json }) => {
|
|
67
79
|
if (this.options.n) {
|
|
68
80
|
const diff = {};
|
|
69
81
|
KEYS(exports).forEach((key) => {
|
|
70
82
|
if (exports[key] !== nextExports[key]) {
|
|
71
83
|
diff[key] = {
|
|
72
84
|
prev: exports[key],
|
|
73
|
-
next: nextExports[key]
|
|
85
|
+
next: nextExports[key],
|
|
74
86
|
};
|
|
75
87
|
}
|
|
76
|
-
|
|
88
|
+
if (exports[key] && nextExports[key]) {
|
|
89
|
+
delete exports[key];
|
|
90
|
+
delete nextExports[key];
|
|
91
|
+
}
|
|
77
92
|
});
|
|
78
|
-
const allDiff = {
|
|
79
|
-
|
|
93
|
+
const allDiff = {
|
|
94
|
+
new: nextExports,
|
|
95
|
+
willClean: exports,
|
|
96
|
+
modify: diff,
|
|
97
|
+
};
|
|
98
|
+
this.log({ allDiff });
|
|
80
99
|
return null;
|
|
81
100
|
} else {
|
|
82
101
|
json.exports = nextExports;
|
|
@@ -84,7 +103,6 @@ module.exports = class extends YoGenerator {
|
|
|
84
103
|
}
|
|
85
104
|
});
|
|
86
105
|
}
|
|
87
|
-
|
|
88
106
|
}
|
|
89
107
|
|
|
90
108
|
writing() {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "generator-reshow",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.1",
|
|
4
4
|
"description": "Yeoman generator for reshow. (app, generator, ...etc)",
|
|
5
5
|
"author": "Hill <hill@kimo.com>",
|
|
6
6
|
"repository": {
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"license": "ISC",
|
|
15
15
|
"main": "",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"yo-reshow": "
|
|
17
|
+
"yo-reshow": "*"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"yo-unit": "
|
|
20
|
+
"yo-unit": "*"
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
23
|
"generators"
|