@@ -4,7 +4,7 @@ const prompts = require('prompts');
4
4
const pacote = require ( 'pacote' ) ;
5
5
const {
6
6
collectWorkspacesDependencies,
7
- collectWorkspacesMeta
7
+ collectWorkspacesMeta,
8
8
} = require ( './workspace-dependencies' ) ;
9
9
const { getHighestRange } = require ( './semver-helpers' ) ;
10
10
const { runInDir } = require ( './run-in-dir' ) ;
@@ -57,7 +57,7 @@ async function main(argv) {
57
57
isPublic = true ,
58
58
isReact = true ,
59
59
dependants = [ ] ,
60
- depType
60
+ depType,
61
61
} = await prompts (
62
62
[
63
63
{
@@ -75,18 +75,18 @@ async function main(argv) {
75
75
}
76
76
77
77
return true ;
78
- }
78
+ } ,
79
79
} ,
80
80
{
81
81
type : 'text' ,
82
82
name : 'description' ,
83
- message : 'Provide a one-line description of the workspace'
83
+ message : 'Provide a one-line description of the workspace' ,
84
84
} ,
85
85
{
86
86
type : 'confirm' ,
87
87
name : 'isPlugin' ,
88
88
message : 'Are you creating a new Compass plugin?' ,
89
- initial : true
89
+ initial : true ,
90
90
} ,
91
91
{
92
92
type ( _ , { name, description, isPlugin } ) {
@@ -100,7 +100,7 @@ async function main(argv) {
100
100
name : 'isConfig' ,
101
101
message : 'Is it a shared configuration package?' ,
102
102
hint : '(answering yes will create the package in the ./configs/<package-name> directory)' ,
103
- initial : true
103
+ initial : true ,
104
104
} ,
105
105
{
106
106
type ( _ , { isPlugin } ) {
@@ -112,7 +112,7 @@ async function main(argv) {
112
112
} ,
113
113
name : 'isPublic' ,
114
114
message : 'Is it a public package?' ,
115
- initial : true
115
+ initial : true ,
116
116
} ,
117
117
{
118
118
type ( _ , { isPlugin } ) {
@@ -124,7 +124,7 @@ async function main(argv) {
124
124
} ,
125
125
name : 'isReact' ,
126
126
message : 'Will the package use React?' ,
127
- initial : true
127
+ initial : true ,
128
128
} ,
129
129
{
130
130
type ( _ , { isPlugin } ) {
@@ -147,7 +147,7 @@ async function main(argv) {
147
147
· Type text to filter choices
148
148
· Enter to complete the answer
149
149
` ,
150
- initial : [ ]
150
+ initial : [ ] ,
151
151
} ,
152
152
{
153
153
type ( prev ) {
@@ -157,14 +157,14 @@ async function main(argv) {
157
157
message : 'What type of dependency is it?' ,
158
158
choices : [
159
159
{ title : 'Production' , value : 'dependencies' } ,
160
- { title : 'Development' , value : 'devDependencies' }
161
- ]
162
- }
160
+ { title : 'Development' , value : 'devDependencies' } ,
161
+ ] ,
162
+ } ,
163
163
] ,
164
164
{
165
165
onCancel ( ) {
166
166
canceled = true ;
167
- }
167
+ } ,
168
168
}
169
169
) ;
170
170
@@ -177,7 +177,7 @@ async function main(argv) {
177
177
dependants = [
178
178
Array . from ( workspacesMeta . values ( ) ) . find (
179
179
( ws ) => ws . name === 'mongodb-compass'
180
- ) . location
180
+ ) . location ,
181
181
] ;
182
182
depType = 'devDependencies' ;
183
183
}
@@ -189,18 +189,18 @@ async function main(argv) {
189
189
...( description && { description } ) ,
190
190
author : {
191
191
name : 'MongoDB Inc' ,
192
-
192
+
193
193
} ,
194
194
...( isPublic ? { publishConfig : { access : 'public' } } : { private : true } ) ,
195
195
bugs : {
196
196
url : 'https://jira.mongodb.org/projects/COMPASS/issues' ,
197
-
197
+
198
198
} ,
199
199
homepage : 'https://github.com/mongodb-js/compass' ,
200
200
version : '0.1.0' ,
201
201
repository : {
202
202
type : 'git' ,
203
- url : 'https://github.com/mongodb-js/compass.git'
203
+ url : 'https://github.com/mongodb-js/compass.git' ,
204
204
} ,
205
205
files : [ 'dist' ] ,
206
206
license : 'SSPL' ,
@@ -209,15 +209,15 @@ async function main(argv) {
209
209
webpack : './src/index.ts' ,
210
210
require : './dist/index.js' ,
211
211
...( ! isPlugin && {
212
- import : './dist/.esm-wrapper.mjs'
213
- } )
212
+ import : './dist/.esm-wrapper.mjs' ,
213
+ } ) ,
214
214
} ,
215
215
types : './dist/index.d.ts' ,
216
216
scripts : {
217
217
// Plugins are bundled by webpack from source and tested with ts-node
218
218
// runtime processor, no need to bootstrap them
219
219
...( ! isPlugin && {
220
- bootstrap : 'npm run compile'
220
+ bootstrap : 'npm run compile' ,
221
221
} ) ,
222
222
prepublishOnly : 'npm run compile' ,
223
223
// For normal packages we are just compiling code with typescript, for
@@ -230,7 +230,7 @@ async function main(argv) {
230
230
prewebpack : 'rimraf ./lib' ,
231
231
webpack : 'webpack-compass' ,
232
232
start : 'npm run webpack serve -- --mode development' ,
233
- analyze : 'npm run webpack -- --mode production --analyze'
233
+ analyze : 'npm run webpack -- --mode production --analyze' ,
234
234
} ) ,
235
235
eslint : 'eslint' ,
236
236
prettier : 'prettier' ,
@@ -245,7 +245,7 @@ async function main(argv) {
245
245
'test-ci' : isPlugin
246
246
? 'npm run test-electron && npm run test-cov'
247
247
: 'npm run test-cov' ,
248
- reformat : 'npm run prettier -- --write .'
248
+ reformat : 'npm run prettier -- --write .' ,
249
249
} ,
250
250
...( isReact && { peerDependencies : { react : '*' , 'react-dom' : '*' } } ) ,
251
251
...( isReact && { dependencies : { react : '*' , 'react-dom' : '*' } } ) ,
@@ -269,19 +269,19 @@ async function main(argv) {
269
269
'@testing-library/user-event' : '*' ,
270
270
'@types/chai-dom' : '*' ,
271
271
'@types/react' : '*' ,
272
- '@types/react-dom' : '*'
272
+ '@types/react-dom' : '*' ,
273
273
} ) ,
274
274
...( ! isPlugin && {
275
275
typescript : '*' ,
276
- 'gen-esm-wrapper' : '*'
276
+ 'gen-esm-wrapper' : '*' ,
277
277
} ) ,
278
278
...( isPlugin && {
279
279
'@mongodb-js/webpack-config-compass' : '*' ,
280
280
'hadron-app-registry' : '*' ,
281
281
rimraf : '*' ,
282
- 'xvfb-maybe' : '*'
283
- } )
284
- }
282
+ 'xvfb-maybe' : '*' ,
283
+ } ) ,
284
+ } ,
285
285
} ;
286
286
287
287
await applyBestVersionMatch ( pkgJson , workspacesMeta ) ;
@@ -304,7 +304,7 @@ async function main(argv) {
304
304
'@mongodb-js/tsconfig-compass' ,
305
305
'@types/chai' ,
306
306
'@types/sinon-chai' ,
307
- 'sinon'
307
+ 'sinon' ,
308
308
]
309
309
. concat (
310
310
isReact ? [ '@types/chai-dom' , '@types/react' , '@types/react-dom' ] : [ ]
@@ -328,10 +328,10 @@ async function main(argv) {
328
328
isReact ? 'react' : 'common'
329
329
} .json`,
330
330
compilerOptions : {
331
- outDir : 'dist'
331
+ outDir : 'dist' ,
332
332
} ,
333
333
include : [ 'src/**/*' ] ,
334
- exclude : [ './src/**/*.spec.*' ]
334
+ exclude : [ './src/**/*.spec.*' ] ,
335
335
} ,
336
336
null ,
337
337
2
@@ -342,7 +342,7 @@ async function main(argv) {
342
342
{
343
343
extends : './tsconfig.json' ,
344
344
include : [ '**/*' ] ,
345
- exclude : [ 'node_modules' , 'dist' ]
345
+ exclude : [ 'node_modules' , 'dist' ] ,
346
346
} ,
347
347
null ,
348
348
2
0 commit comments