This repository was archived by the owner on Jan 28, 2025. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathpackage-scripts.js
More file actions
244 lines (242 loc) · 6.62 KB
/
Copy pathpackage-scripts.js
File metadata and controls
244 lines (242 loc) · 6.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
const npsUtils = require('nps-utils');
module.exports = {
scripts: {
default: {
// NPM START for deployment
script: 'nps nodemon.node.production',
hiddenFromHelp: true,
},
build: {
script: npsUtils.series.nps(
'parcel.dom.build',
'parcel.node.build',
),
description: 'Build both Node and DOM for production',
},
/*
<==========================================>
< Both >
<==========================================>
*/
both: {
default: {
script: npsUtils.concurrent.nps(
'parcel.node',
'parcel.dom',
'nodemon.both',
),
description: 'Development mode for Node.js and the DOM',
},
build: {
default: {
script: npsUtils.series.nps(
'parcel.dom.build',
'parcel.node.build',
),
description: 'Build both Node and DOM for production',
},
run: {
script: npsUtils.series.nps(
'parcel.dom.build',
'parcel.node.build',
'nodemon.node',
),
description:
'Build both Node and DOM for production and run server',
},
},
},
/*
<==========================================>
< Node.js >
<==========================================>
*/
node: {
// Development mode
default: {
script: npsUtils.concurrent.nps(
'parcel.node',
'nodemon.node',
),
description: 'Development mode for Node.js',
},
// Builds
build: {
default: {
script: npsUtils.series.nps('parcel.node.build'),
description: 'Build Node.js project',
},
run: {
script: npsUtils.series.nps(
'parcel.node.build',
'nodemon.node',
),
description: 'Build Node.js project and run server',
},
},
test: {
default: {
script:
'cross-env NODE_ENV=development TESTING=true mocha --require babel-core/register src/**/*.test.js',
description: 'Mocha test',
},
watch: {
script:
'cross-env NODE_ENV=development TESTING=true nodemon --exec "npm start node.test"',
description: 'Mocha test watcher',
},
},
// Debug mode
debug: {
script: npsUtils.concurrent.nps(
'parcel.node',
'nodemon.node.debug',
),
description: 'Debug Node.js project',
},
},
/*
<==========================================>
< DOM >
<==========================================>
*/
dom: {
// Development mode
default: {
script: npsUtils.concurrent.nps(
'parcel.dom',
'nodemon.dom',
),
description: 'Development mode for DOM',
},
// Builds
build: {
default: {
script: 'nps parcel.dom.build',
description: 'Build DOM project',
},
run: {
script: npsUtils.series.nps(
'parcel.dom.build',
'nodemon.dom',
),
description: 'Build DOM project and run server',
},
},
test: {
/*
TODO
- Summary: Testing for Frontend
* Description: Testing tool might get added in the future
*/
script: '',
description: '',
hiddenFromHelp: true,
},
},
/*
<==========================================>
< Nodemon >
<==========================================>
*/
nodemon: {
node: {
// Default as development
default: {
script:
'cross-env NODE_ENV=development nodemon ./dist/app.js',
hiddenFromHelp: true,
},
production: {
script:
'cross-env NODE_ENV=production nodemon ./prod/app.js',
hiddenFromHelp: true,
},
debug: {
script: 'nodemon --inspect-brk ./dist/app.js',
hiddenFromHelp: true,
},
},
dom: {
default: {
script:
'cross-env NODE_ENV=production FrontEnd=true nodemon ./prod/app.js',
hiddenFromHelp: true,
},
},
both: {
default: {
script:
'cross-env NODE_ENV=development FrontEnd=true nodemon ./dist/app.js',
hiddenFromHelp: true,
},
},
},
/*
<==========================================>
< Parcel >
<==========================================>
*/
parcel: {
node: {
default: {
script:
'cross-env NODE_ENV=development parcel watch src/app.js --public-url ./ --target node',
hiddenFromHelp: true,
},
build: {
script:
'cross-env NODE_ENV=production parcel build src/app.js --public-url ./ --out-dir prod --target node --no-cache --no-source-maps',
hiddenFromHelp: true,
},
},
dom: {
default: {
script:
'cross-env NODE_ENV=development parcel watch public/src/index.html --public-url ./ --out-dir public/dist --target browser',
hiddenFromHelp: true,
},
build: {
script:
'cross-env NODE_ENV=production parcel build public/src/index.html --public-url ./ --out-dir public/prod --target browser --no-cache --no-source-maps',
hiddenFromHelp: true,
},
},
},
/*
<==========================================>
< EsLint >
<==========================================>
*/
eslint: {
default: {
script: 'eslint --fix --no-ignore **/*.js',
hiddenFromHelp: true,
},
},
/*
<==========================================>
< MongoDB >
<==========================================>
*/
// <-------------- Add your own MongoDB path --------------> //
mongodb: {
script: 'mongod.exe --dbpath \\path-to-MongoDB-data\\',
description: 'Run MongoDB server',
hiddenFromHelp: true,
},
/*
<==========================================>
< Others >
<==========================================>
*/
localTunnel: {
script: 'lt --port 3000',
description: 'Expose localhost port 3000',
},
update: {
script: 'npm-check -u',
description: 'Package interactive updater',
},
},
};