generator-reshow 0.17.16 → 0.17.19

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/README.md CHANGED
@@ -9,3 +9,9 @@ npx yonpx reshow my-app
9
9
  cd my-app
10
10
  npm start
11
11
  ```
12
+
13
+ ## GIT
14
+ https://github.com/react-atomic/reshow/tree/main/packages/generator-reshow
15
+
16
+ ## NPM
17
+ https://www.npmjs.com/package/generator-reshow
@@ -1,6 +1,9 @@
1
- #!/bin/bash
1
+ #!/usr/bin/env bash
2
2
 
3
- DIR=$( cd "$(dirname "$0")" ; pwd -P )
3
+ DIR=$(
4
+ cd "$(dirname "$0")"
5
+ pwd -P
6
+ )
4
7
  cd $DIR
5
8
  SWJS=${DIR}/service-worker.js
6
9
 
@@ -14,8 +17,8 @@ conf+='"swDest":"'${SWJS}'",'
14
17
  conf+='"hotPort": "'${hotPort:-3088}'"'
15
18
  conf+='}'
16
19
 
17
- OPEN=$(which xdg-open 2>/dev/null)
18
- if [ -z "$OPEN" ]; then
20
+ OPEN=$(which xdg-open 2> /dev/null)
21
+ if [ -z "$OPEN" ]; then
19
22
  OPEN="open"
20
23
  fi
21
24
 
@@ -23,7 +26,7 @@ if [ "x<%= webpackEnabled %>" == "xon" ]; then
23
26
  webpack='npm run webpack --'
24
27
  fi
25
28
 
26
- checkBabel(){
29
+ checkBabel() {
27
30
  if [ ! -e ".babelrc" ] && [ ! -e "../../packages" ]; then
28
31
  if [ -e ${DIR}/node_modules/reshow-app/.babelrc ]; then
29
32
  cp ${DIR}/node_modules/reshow-app/.babelrc ${DIR}/.babelrc
@@ -31,91 +34,91 @@ checkBabel(){
31
34
  fi
32
35
  }
33
36
 
34
- killBy(){
35
- ps -eo pid,args | grep $1 | grep -v grep | awk '{print $1}' | xargs -I{} kill -9 {}
37
+ killBy() {
38
+ ps -eo pid,args | grep $1 | grep -v grep | awk '{print $1}' | xargs -I{} kill -9 {}
36
39
  }
37
40
 
38
- stop(){
39
- killBy ${DIR}/node_modules/.bin/babel
40
- cat webpack.pid | xargs -I{} kill -9 {}
41
- npm run clean
42
- rm $SWJS
43
- echo "Stop done";
41
+ stop() {
42
+ killBy ${DIR}/node_modules/.bin/babel
43
+ cat webpack.pid | xargs -I{} kill -9 {}
44
+ npm run clean:webpack
45
+ rm $SWJS
46
+ echo "Stop done"
44
47
  }
45
48
 
46
- stopServer(){
49
+ stopServer() {
47
50
  killBy ${DIR}/node_modules/.bin/ws
48
- echo "stop server done";
51
+ echo "stop server done"
49
52
  }
50
53
 
51
- startServer(){
52
- stopServer
53
- yarn
54
- if [ ! -e "build" ]; then
55
- develop
56
- fi
57
- port=${port-3000}
58
- echo "Start server";
59
- if [ "$1" == "open" ]; then
60
- npm run start -- -p $port &
61
- sleep 3
62
- $OPEN http://localhost:$port
63
- else
64
- npm run start -- -p $port -v
65
- fi
54
+ startServer() {
55
+ stopServer
56
+ yarn
57
+ if [ ! -e "build" ]; then
58
+ develop
59
+ fi
60
+ port=${port-3000}
61
+ echo "Start server"
62
+ if [ "$1" == "open" ]; then
63
+ npm run start -- -p $port &
64
+ sleep 3
65
+ $OPEN http://localhost:$port
66
+ else
67
+ npm run start -- -p $port -v
68
+ fi
66
69
  }
67
70
 
68
- production(){
69
- stop
70
- echo "Production Mode";
71
- checkBabel
72
- npm run build
73
- ENABLE_SW=1 CONFIG=$conf NODE_ENV=production $webpack
71
+ production() {
72
+ stop
73
+ echo "Production Mode"
74
+ checkBabel
75
+ npm run build
76
+ ENABLE_SW=1 CONFIG=$conf NODE_ENV=production $webpack
74
77
  }
75
78
 
76
- analyzer(){
77
- stop
78
- echo "Analyzer Mode";
79
- checkBabel
80
- npm run build
81
- CONFIG=$conf BUNDLE='{}' $webpack
79
+ analyzer() {
80
+ stop
81
+ echo "Analyzer Mode"
82
+ checkBabel
83
+ npm run build
84
+ CONFIG=$conf BUNDLE='{}' $webpack
82
85
  }
83
86
 
84
- develop(){
85
- stop
86
- echo "Develop Mode";
87
- checkBabel
88
- npm run build
89
- CONFIG=$conf $webpack
87
+ develop() {
88
+ stop
89
+ echo "Develop Mode"
90
+ checkBabel
91
+ npm run build
92
+ CONFIG=$conf $webpack
90
93
  }
91
94
 
92
- watch(){
93
- stop
94
- echo "Watch Mode";
95
- checkBabel
96
- npm run build:es:ui -- --watch &
97
- npm run build:es:src -- --watch &
98
- sleep 10
99
- CONFIG=$conf $webpack --watch &
95
+ watch() {
96
+ stop
97
+ echo "Watch Mode"
98
+ checkBabel
99
+ npm run build:es:ui -- --watch &
100
+ npm run build:es:src -- --watch &
101
+ sleep 10
102
+ CONFIG=$conf $webpack --watch &
100
103
  }
101
104
 
102
- watchTest(){
103
- stop
104
- echo "Watch Test";
105
- checkBabel
106
- npm run build:cjs:ui -- --watch &
107
- npm run build:cjs:src -- --watch &
105
+ watchTest() {
106
+ stop
107
+ echo "Watch Test"
108
+ checkBabel
109
+ npm run build:cjs:ui -- --watch &
110
+ npm run build:cjs:src -- --watch &
108
111
  }
109
112
 
110
- hot(){
111
- stop
112
- rm $SWJS
113
- echo "Hot Mode";
114
- checkBabel
115
- npm run build:es:ui -- --watch &
116
- npm run build:es:src -- --watch &
117
- sleep 5
118
- HOT_UPDATE=1 CONFIG=$conf $webpack serve &
113
+ hot() {
114
+ stop
115
+ rm $SWJS
116
+ echo "Hot Mode"
117
+ checkBabel
118
+ npm run build:es:ui -- --watch &
119
+ npm run build:es:src -- --watch &
120
+ sleep 10
121
+ HOT_UPDATE=1 CONFIG=$conf $webpack serve &
119
122
  }
120
123
 
121
124
  case "$1" in
@@ -123,7 +126,7 @@ case "$1" in
123
126
  production
124
127
  ;;
125
128
  a)
126
- analyzer
129
+ analyzer
127
130
  ;;
128
131
  s)
129
132
  startServer $2
@@ -135,17 +138,18 @@ case "$1" in
135
138
  hot
136
139
  ;;
137
140
  watch)
138
- watch
141
+ watch
139
142
  ;;
140
143
  watchTest)
141
144
  watchTest
142
145
  ;;
143
146
  stop)
144
- stop
147
+ stop
145
148
  ;;
146
149
  *)
147
150
  develop
148
151
  exit
152
+ ;;
149
153
  esac
150
154
 
151
155
  exit $?
@@ -56,7 +56,7 @@ module.exports = class extends YoGenerator {
56
56
  type: "input",
57
57
  name: "folderPrefix",
58
58
  message: "Please input your folder-prefix?",
59
- default: "",
59
+ default: "ver-",
60
60
  },
61
61
  /*
62
62
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-reshow",
3
- "version": "0.17.16",
3
+ "version": "0.17.19",
4
4
  "description": "Yeoman generator for reshow. (app, generator, ...etc)",
5
5
  "author": "Hill <hill@kimo.com>",
6
6
  "repository": {