generator-reshow 0.17.17 → 0.17.18

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
@@ -0,0 +1,8 @@
1
+ node_modules
2
+ npm-debug.log
3
+ coverage*
4
+ .tern-port
5
+ v8.log
6
+ build
7
+ .*.sw?
8
+ webpack.pid
@@ -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,96 @@ 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
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
+ npm run clean:webpack
77
+ ENABLE_SW=1 CONFIG=$conf NODE_ENV=production $webpack
74
78
  }
75
79
 
76
- analyzer(){
77
- stop
78
- echo "Analyzer Mode";
79
- checkBabel
80
- npm run build
81
- CONFIG=$conf BUNDLE='{}' $webpack
80
+ analyzer() {
81
+ stop
82
+ echo "Analyzer Mode"
83
+ checkBabel
84
+ npm run build
85
+ npm run clean:webpack
86
+ CONFIG=$conf BUNDLE='{}' $webpack
82
87
  }
83
88
 
84
- develop(){
85
- stop
86
- echo "Develop Mode";
87
- checkBabel
88
- npm run build
89
- CONFIG=$conf $webpack
89
+ develop() {
90
+ stop
91
+ echo "Develop Mode"
92
+ checkBabel
93
+ npm run build
94
+ npm run clean:webpack
95
+ CONFIG=$conf $webpack
90
96
  }
91
97
 
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 &
98
+ watch() {
99
+ stop
100
+ echo "Watch Mode"
101
+ checkBabel
102
+ npm run build:es:ui -- --watch &
103
+ npm run build:es:src -- --watch &
104
+ sleep 10
105
+ npm run clean:webpack
106
+ CONFIG=$conf $webpack --watch &
100
107
  }
101
108
 
102
- watchTest(){
103
- stop
104
- echo "Watch Test";
105
- checkBabel
106
- npm run build:cjs:ui -- --watch &
107
- npm run build:cjs:src -- --watch &
109
+ watchTest() {
110
+ stop
111
+ echo "Watch Test"
112
+ checkBabel
113
+ npm run build:cjs:ui -- --watch &
114
+ npm run build:cjs:src -- --watch &
108
115
  }
109
116
 
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 &
117
+ hot() {
118
+ stop
119
+ rm $SWJS
120
+ echo "Hot Mode"
121
+ checkBabel
122
+ npm run build:es:ui -- --watch &
123
+ npm run build:es:src -- --watch &
124
+ sleep 10
125
+ npm run clean:webpack
126
+ HOT_UPDATE=1 CONFIG=$conf $webpack serve &
119
127
  }
120
128
 
121
129
  case "$1" in
@@ -123,7 +131,7 @@ case "$1" in
123
131
  production
124
132
  ;;
125
133
  a)
126
- analyzer
134
+ analyzer
127
135
  ;;
128
136
  s)
129
137
  startServer $2
@@ -135,17 +143,18 @@ case "$1" in
135
143
  hot
136
144
  ;;
137
145
  watch)
138
- watch
146
+ watch
139
147
  ;;
140
148
  watchTest)
141
149
  watchTest
142
150
  ;;
143
151
  stop)
144
- stop
152
+ stop
145
153
  ;;
146
154
  *)
147
155
  develop
148
156
  exit
157
+ ;;
149
158
  esac
150
159
 
151
160
  exit $?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-reshow",
3
- "version": "0.17.17",
3
+ "version": "0.17.18",
4
4
  "description": "Yeoman generator for reshow. (app, generator, ...etc)",
5
5
  "author": "Hill <hill@kimo.com>",
6
6
  "repository": {
@@ -1,10 +0,0 @@
1
- import { expect } from "chai";
2
-
3
- import YourFunc from "../index";
4
-
5
- describe("Test <%= mainName %>", () => {
6
- it("basic testt", () => {
7
- /*your test code*/
8
- YourFunc();
9
- });
10
- });
@@ -1,3 +0,0 @@
1
- #!/bin/sh
2
-
3
- npm run build
@@ -1,3 +0,0 @@
1
- const YourFunc = (props) => {};
2
-
3
- export default YourFunc;
@@ -1,10 +0,0 @@
1
- const {expect} = require("chai");
2
- const {init} = require("../init");
3
-
4
- describe("Test <%= mainName %>", () => {
5
- it("basic testt", () => {
6
- /*your test code*/
7
- const actual = init();
8
- expect(actual).to.equal('bar');
9
- });
10
- });
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const { init } = require("./init");
4
-
5
- init();
@@ -1,8 +0,0 @@
1
- const init = (props) => {
2
- console.log("foo");
3
- return "bar";
4
- };
5
-
6
- module.exports = {
7
- init,
8
- };