generator-reshow 0.0.1 → 0.15.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/index.js +2 -2
- package/generators/app/templates/ui/templates/Doc.jsx +1 -1
- package/generators/library/index.js +3 -2
- package/generators/library/templates/Test.js +10 -0
- package/generators/library/templates/compile.sh +3 -0
- package/generators/library/templates/src/index.js +3 -0
- package/generators/library/templates/yarn.lock +4075 -0
- package/generators/npm/index.js +10 -7
- package/generators/npm/templates/Test.js +10 -0
- package/generators/npm/templates/src/index.js +5 -0
- package/generators/npm/templates/src/init.js +8 -0
- package/generators/npm/templates/yarn.lock +4026 -0
- package/package.json +3 -3
- package/generators/app/templates/.gitignore +0 -8
package/generators/npm/index.js
CHANGED
|
@@ -27,8 +27,6 @@ module.exports = class extends YoGenerator {
|
|
|
27
27
|
* https://github.com/SBoudrias/Inquirer.js
|
|
28
28
|
*/
|
|
29
29
|
async prompting() {
|
|
30
|
-
this.env.options.nodePackageManager = "yarn";
|
|
31
|
-
|
|
32
30
|
const {
|
|
33
31
|
handleAnswers,
|
|
34
32
|
mergePromptOrOption,
|
|
@@ -47,11 +45,15 @@ module.exports = class extends YoGenerator {
|
|
|
47
45
|
const answers = await mergePromptOrOption(prompts, (nextPrompts) =>
|
|
48
46
|
promptChain(promptChainLocator(nextPrompts))
|
|
49
47
|
);
|
|
50
|
-
handleAnswers(answers)
|
|
51
|
-
|
|
48
|
+
handleAnswers(answers, (payload) => {
|
|
49
|
+
if (payload.isUseBabel) {
|
|
50
|
+
this.composeWith(require.resolve("../compile-sh"), payload);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
writing() {
|
|
56
|
+
this.env.options.nodePackageManager = "yarn";
|
|
55
57
|
const { cp, chMainName, updateJSON } = YoHelper(this);
|
|
56
58
|
|
|
57
59
|
// handle change to new folder
|
|
@@ -61,6 +63,7 @@ module.exports = class extends YoGenerator {
|
|
|
61
63
|
cp("src", null, this.payload);
|
|
62
64
|
cp("README.md", null, this.payload);
|
|
63
65
|
cp("Test.js", "src/__tests__/Test.js", this.payload);
|
|
66
|
+
cp("yarn.lock");
|
|
64
67
|
|
|
65
68
|
updateJSON("package.json", null, this.payload, (data) => {
|
|
66
69
|
data.repository = this.payload.repository;
|
|
@@ -70,7 +73,7 @@ module.exports = class extends YoGenerator {
|
|
|
70
73
|
...this.payload.npmDependencies,
|
|
71
74
|
};
|
|
72
75
|
if (!this.payload.isUseBabel) {
|
|
73
|
-
delete data.devDependencies[
|
|
76
|
+
delete data.devDependencies["@babel/cli"];
|
|
74
77
|
delete data.module;
|
|
75
78
|
delete data.scripts.clean;
|
|
76
79
|
delete data.scripts.build;
|
|
@@ -79,9 +82,9 @@ module.exports = class extends YoGenerator {
|
|
|
79
82
|
data.main = "./src/index.js";
|
|
80
83
|
data.bin[this.mainName] = "./src/index.js";
|
|
81
84
|
data.scripts.test = "npm run mocha";
|
|
82
|
-
data.
|
|
85
|
+
data.scripts.mocha = "npm run mochaFor -- 'src/**/__tests__/*.js'";
|
|
86
|
+
data.files = data.files.filter((f) => f !== "build");
|
|
83
87
|
data.files.push("src");
|
|
84
|
-
console.log({data});
|
|
85
88
|
}
|
|
86
89
|
return data;
|
|
87
90
|
});
|