generator-reshow 0.17.18 → 0.17.21

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.
@@ -1,6 +1,5 @@
1
1
  import { VerticalMenu } from "pmvc_react_admin";
2
2
  import { SideMenu } from "organism-react-navigation";
3
- import get from "get-object-value";
4
3
  import { pageStore, ReLink } from "reshow";
5
4
  import { KEYS } from "reshow-constant";
6
5
 
@@ -6,6 +6,7 @@ DIR=$(
6
6
  )
7
7
  cd $DIR
8
8
  SWJS=${DIR}/service-worker.js
9
+ webpackEnabled=$(awk -F "=" '/^webpackEnabled/ {print $2}' $DIR/.yo)
9
10
 
10
11
  conf='{'
11
12
  conf+='"assetsRoot":"/assets/",'
@@ -22,7 +23,7 @@ if [ -z "$OPEN" ]; then
22
23
  OPEN="open"
23
24
  fi
24
25
 
25
- if [ "x<%= webpackEnabled %>" == "xon" ]; then
26
+ if [ "x$webpackEnabled" == "xon" ]; then
26
27
  webpack='npm run webpack --'
27
28
  fi
28
29
 
@@ -40,8 +41,10 @@ killBy() {
40
41
 
41
42
  stop() {
42
43
  killBy ${DIR}/node_modules/.bin/babel
43
- cat webpack.pid | xargs -I{} kill -9 {}
44
- npm run clean
44
+ if [ ! -z "$webpack" ]; then
45
+ cat webpack.pid | xargs -I{} kill -9 {}
46
+ npm run clean:webpack
47
+ fi
45
48
  rm $SWJS
46
49
  echo "Stop done"
47
50
  }
@@ -73,8 +76,9 @@ production() {
73
76
  echo "Production Mode"
74
77
  checkBabel
75
78
  npm run build
76
- npm run clean:webpack
77
- ENABLE_SW=1 CONFIG=$conf NODE_ENV=production $webpack
79
+ if [ ! -z "$webpack" ]; then
80
+ ENABLE_SW=1 CONFIG=$conf NODE_ENV=production $webpack
81
+ fi
78
82
  }
79
83
 
80
84
  analyzer() {
@@ -82,8 +86,7 @@ analyzer() {
82
86
  echo "Analyzer Mode"
83
87
  checkBabel
84
88
  npm run build
85
- npm run clean:webpack
86
- CONFIG=$conf BUNDLE='{}' $webpack
89
+ [ ! -z "$webpack" ] && CONFIG=$conf BUNDLE='{}' $webpack
87
90
  }
88
91
 
89
92
  develop() {
@@ -91,8 +94,7 @@ develop() {
91
94
  echo "Develop Mode"
92
95
  checkBabel
93
96
  npm run build
94
- npm run clean:webpack
95
- CONFIG=$conf $webpack
97
+ [ ! -z "$webpack" ] && CONFIG=$conf $webpack
96
98
  }
97
99
 
98
100
  watch() {
@@ -101,17 +103,6 @@ watch() {
101
103
  checkBabel
102
104
  npm run build:es:ui -- --watch &
103
105
  npm run build:es:src -- --watch &
104
- sleep 10
105
- npm run clean:webpack
106
- CONFIG=$conf $webpack --watch &
107
- }
108
-
109
- watchTest() {
110
- stop
111
- echo "Watch Test"
112
- checkBabel
113
- npm run build:cjs:ui -- --watch &
114
- npm run build:cjs:src -- --watch &
115
106
  }
116
107
 
117
108
  hot() {
@@ -121,9 +112,7 @@ hot() {
121
112
  checkBabel
122
113
  npm run build:es:ui -- --watch &
123
114
  npm run build:es:src -- --watch &
124
- sleep 10
125
- npm run clean:webpack
126
- HOT_UPDATE=1 CONFIG=$conf $webpack serve &
115
+ [ ! -z "$webpack" ] && sleep 10 && HOT_UPDATE=1 CONFIG=$conf $webpack serve &
127
116
  }
128
117
 
129
118
  case "$1" in
@@ -145,9 +134,6 @@ case "$1" in
145
134
  watch)
146
135
  watch
147
136
  ;;
148
- watchTest)
149
- watchTest
150
- ;;
151
137
  stop)
152
138
  stop
153
139
  ;;
@@ -0,0 +1,10 @@
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
+ });
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+
3
+ npm run build
@@ -0,0 +1,3 @@
1
+ const YourFunc = (props) => {};
2
+
3
+ export default YourFunc;
@@ -0,0 +1,10 @@
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
+ });
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { init } = require("./init");
4
+
5
+ init();
@@ -0,0 +1,8 @@
1
+ const init = (props) => {
2
+ console.log("foo");
3
+ return "bar";
4
+ };
5
+
6
+ module.exports = {
7
+ init,
8
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-reshow",
3
- "version": "0.17.18",
3
+ "version": "0.17.21",
4
4
  "description": "Yeoman generator for reshow. (app, generator, ...etc)",
5
5
  "author": "Hill <hill@kimo.com>",
6
6
  "repository": {
@@ -1,8 +0,0 @@
1
- node_modules
2
- npm-debug.log
3
- coverage*
4
- .tern-port
5
- v8.log
6
- build
7
- .*.sw?
8
- webpack.pid