generator-reshow 0.17.21 → 0.17.25
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.
|
@@ -6,10 +6,10 @@ DIR=$(
|
|
|
6
6
|
)
|
|
7
7
|
cd $DIR
|
|
8
8
|
SWJS=${DIR}/service-worker.js
|
|
9
|
-
webpackEnabled=$(awk -F "=" '/^webpackEnabled/ {print $2}' $DIR/.yo)
|
|
9
|
+
webpackEnabled=$([ -e "$DIR/.yo" ] && awk -F "=" '/^webpackEnabled/ {print $2}' $DIR/.yo)
|
|
10
10
|
|
|
11
11
|
conf='{'
|
|
12
|
-
conf+='"assetsRoot":"
|
|
12
|
+
conf+='"assetsRoot":"./assets/",'
|
|
13
13
|
conf+='"externals":{},'
|
|
14
14
|
conf+='"indexTpl":"'${DIR}/index.tpl'",'
|
|
15
15
|
conf+='"indexHtml":"'${DIR}/index.html'",'
|
|
@@ -27,14 +27,6 @@ if [ "x$webpackEnabled" == "xon" ]; then
|
|
|
27
27
|
webpack='npm run webpack --'
|
|
28
28
|
fi
|
|
29
29
|
|
|
30
|
-
checkBabel() {
|
|
31
|
-
if [ ! -e ".babelrc" ] && [ ! -e "../../packages" ]; then
|
|
32
|
-
if [ -e ${DIR}/node_modules/reshow-app/.babelrc ]; then
|
|
33
|
-
cp ${DIR}/node_modules/reshow-app/.babelrc ${DIR}/.babelrc
|
|
34
|
-
fi
|
|
35
|
-
fi
|
|
36
|
-
}
|
|
37
|
-
|
|
38
30
|
killBy() {
|
|
39
31
|
ps -eo pid,args | grep $1 | grep -v grep | awk '{print $1}' | xargs -I{} kill -9 {}
|
|
40
32
|
}
|
|
@@ -45,7 +37,7 @@ stop() {
|
|
|
45
37
|
cat webpack.pid | xargs -I{} kill -9 {}
|
|
46
38
|
npm run clean:webpack
|
|
47
39
|
fi
|
|
48
|
-
rm $SWJS
|
|
40
|
+
[ -e "$SWJS" ] && rm $SWJS
|
|
49
41
|
echo "Stop done"
|
|
50
42
|
}
|
|
51
43
|
|
|
@@ -74,7 +66,6 @@ startServer() {
|
|
|
74
66
|
production() {
|
|
75
67
|
stop
|
|
76
68
|
echo "Production Mode"
|
|
77
|
-
checkBabel
|
|
78
69
|
npm run build
|
|
79
70
|
if [ ! -z "$webpack" ]; then
|
|
80
71
|
ENABLE_SW=1 CONFIG=$conf NODE_ENV=production $webpack
|
|
@@ -84,7 +75,6 @@ production() {
|
|
|
84
75
|
analyzer() {
|
|
85
76
|
stop
|
|
86
77
|
echo "Analyzer Mode"
|
|
87
|
-
checkBabel
|
|
88
78
|
npm run build
|
|
89
79
|
[ ! -z "$webpack" ] && CONFIG=$conf BUNDLE='{}' $webpack
|
|
90
80
|
}
|
|
@@ -92,24 +82,20 @@ analyzer() {
|
|
|
92
82
|
develop() {
|
|
93
83
|
stop
|
|
94
84
|
echo "Develop Mode"
|
|
95
|
-
checkBabel
|
|
96
85
|
npm run build
|
|
97
86
|
[ ! -z "$webpack" ] && CONFIG=$conf $webpack
|
|
98
87
|
}
|
|
99
88
|
|
|
100
89
|
watch() {
|
|
101
|
-
stop
|
|
102
90
|
echo "Watch Mode"
|
|
103
|
-
checkBabel
|
|
104
91
|
npm run build:es:ui -- --watch &
|
|
105
92
|
npm run build:es:src -- --watch &
|
|
106
93
|
}
|
|
107
94
|
|
|
108
95
|
hot() {
|
|
109
96
|
stop
|
|
110
|
-
rm $SWJS
|
|
97
|
+
[ -e "$SWJS" ] && rm $SWJS
|
|
111
98
|
echo "Hot Mode"
|
|
112
|
-
checkBabel
|
|
113
99
|
npm run build:es:ui -- --watch &
|
|
114
100
|
npm run build:es:src -- --watch &
|
|
115
101
|
[ ! -z "$webpack" ] && sleep 10 && HOT_UPDATE=1 CONFIG=$conf $webpack serve &
|
|
@@ -139,7 +125,7 @@ case "$1" in
|
|
|
139
125
|
;;
|
|
140
126
|
*)
|
|
141
127
|
develop
|
|
142
|
-
exit
|
|
128
|
+
exit 0
|
|
143
129
|
;;
|
|
144
130
|
esac
|
|
145
131
|
|
package/generators/npm/index.js
CHANGED
|
@@ -85,6 +85,10 @@ module.exports = class extends YoGenerator {
|
|
|
85
85
|
data.files = data.files.filter((f) => f !== "build");
|
|
86
86
|
data.files.push("src");
|
|
87
87
|
}
|
|
88
|
+
if (!this.payload.isUseWebpack) {
|
|
89
|
+
delete data.scripts["webpack"];
|
|
90
|
+
delete data.scripts["clean:webpack"];
|
|
91
|
+
}
|
|
88
92
|
return data;
|
|
89
93
|
});
|
|
90
94
|
}
|
|
@@ -20,11 +20,16 @@
|
|
|
20
20
|
"<%= mainName %>": "./build/cjs/src/index.js"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
|
+
"update-compile-sh": "yo reshow:compile-sh",
|
|
24
|
+
"webpack": "webpack",
|
|
25
|
+
"start": "ws",
|
|
26
|
+
"format": "prettier-eslint --write 'src/**/*.js' 'ui/**/*.js*'",
|
|
27
|
+
"clean:webpack": "find ./assets -name '*.*' | xargs rm -rf && rm -rf workbox-*.js",
|
|
23
28
|
"clean": "find ./build -name '*.*' | xargs rm -rf",
|
|
24
29
|
"build:cjs": "BABEL_ENV=cjs babel src -d build/cjs/src<%= babelRootMode %>",
|
|
25
30
|
"build:es": "BABEL_ENV=es babel src -d build/es/src<%= babelRootMode %>",
|
|
26
31
|
"build": "npm run clean && npm run build:cjs && npm run build:es",
|
|
27
|
-
"mochaFor": "mocha -r jsdom
|
|
32
|
+
"mochaFor": "mocha -r global-jsdom/register",
|
|
28
33
|
"mocha": "npm run mochaFor -- 'build/cjs/**/__tests__/*.js'",
|
|
29
34
|
"test": "npm run build && npm run mocha",
|
|
30
35
|
"prepublishOnly": "npm run test"
|
package/package.json
CHANGED
|
@@ -1,37 +1,35 @@
|
|
|
1
1
|
{
|
|
2
|
+
"version": "0.17.25",
|
|
2
3
|
"name": "generator-reshow",
|
|
3
|
-
"version": "0.17.21",
|
|
4
|
-
"description": "Yeoman generator for reshow. (app, generator, ...etc)",
|
|
5
|
-
"author": "Hill <hill@kimo.com>",
|
|
6
4
|
"repository": {
|
|
7
5
|
"type": "git",
|
|
8
6
|
"url": "https://github.com/react-atomic/reshow",
|
|
9
7
|
"directory": "packages/generator-reshow"
|
|
10
8
|
},
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
],
|
|
9
|
+
"homepage": "https://github.com/react-atomic/reshow/tree/main/packages/generator-reshow",
|
|
10
|
+
"description": "Yeoman generator for reshow. (app, generator, ...etc)",
|
|
11
|
+
"keywords": ["yeoman-generator"],
|
|
12
|
+
"author": "Hill <hill@kimo.com>",
|
|
14
13
|
"license": "ISC",
|
|
15
|
-
"main": "",
|
|
16
14
|
"dependencies": {
|
|
17
15
|
"yo-reshow": "*"
|
|
18
16
|
},
|
|
19
17
|
"devDependencies": {
|
|
20
18
|
"yo-unit": "*"
|
|
21
19
|
},
|
|
22
|
-
"files": [
|
|
23
|
-
"generators"
|
|
24
|
-
],
|
|
25
20
|
"scripts": {
|
|
26
21
|
"mochaFor": "mocha",
|
|
27
22
|
"mocha": "npm run mochaFor -- 'generators/**/__tests__/*.js'",
|
|
28
23
|
"test": "npm run mocha",
|
|
29
24
|
"prepublishOnly": "npm run test"
|
|
30
25
|
},
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/react-atomic/reshow/issues"
|
|
28
|
+
},
|
|
31
29
|
"engines": {
|
|
32
30
|
"node": ">=12"
|
|
33
31
|
},
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
32
|
+
"files": [
|
|
33
|
+
"generators"
|
|
34
|
+
]
|
|
37
35
|
}
|