piral-cli 0.15.0-alpha.4122 → 0.15.0-alpha.4284
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 +7 -5
- package/lib/apps/debug-pilet.js +28 -42
- package/lib/apps/debug-pilet.js.map +1 -1
- package/lib/apps/debug-piral.js +20 -34
- package/lib/apps/debug-piral.js.map +1 -1
- package/lib/apps/new-pilet.js +5 -9
- package/lib/apps/new-pilet.js.map +1 -1
- package/lib/apps/new-piral.js +9 -3
- package/lib/apps/new-piral.js.map +1 -1
- package/lib/apps/publish-pilet.d.ts +4 -0
- package/lib/apps/publish-pilet.js +4 -3
- package/lib/apps/publish-pilet.js.map +1 -1
- package/lib/apps/publish-piral.d.ts +4 -0
- package/lib/apps/publish-piral.js +9 -7
- package/lib/apps/publish-piral.js.map +1 -1
- package/lib/apps/upgrade-pilet.js +2 -8
- package/lib/apps/upgrade-pilet.js.map +1 -1
- package/lib/apps/upgrade-piral.js +1 -1
- package/lib/apps/upgrade-piral.js.map +1 -1
- package/lib/bundler.js +1 -1
- package/lib/bundler.js.map +1 -1
- package/lib/commands.js +14 -6
- package/lib/commands.js.map +1 -1
- package/lib/common/browser.d.ts +1 -0
- package/lib/common/browser.js +16 -10
- package/lib/common/browser.js.map +1 -1
- package/lib/common/clients/index.d.ts +19 -0
- package/lib/common/clients/index.js +40 -0
- package/lib/common/clients/index.js.map +1 -0
- package/lib/common/clients/lerna.d.ts +6 -1
- package/lib/common/clients/lerna.js +67 -3
- package/lib/common/clients/lerna.js.map +1 -1
- package/lib/common/clients/npm.d.ts +4 -1
- package/lib/common/clients/npm.js +37 -16
- package/lib/common/clients/npm.js.map +1 -1
- package/lib/common/clients/pnpm.d.ts +4 -0
- package/lib/common/clients/pnpm.js +43 -9
- package/lib/common/clients/pnpm.js.map +1 -1
- package/lib/common/clients/rush.d.ts +6 -0
- package/lib/common/clients/rush.js +118 -0
- package/lib/common/clients/rush.js.map +1 -0
- package/lib/common/clients/yarn.d.ts +4 -0
- package/lib/common/clients/yarn.js +45 -11
- package/lib/common/clients/yarn.js.map +1 -1
- package/lib/common/declaration.js +12 -9
- package/lib/common/declaration.js.map +1 -1
- package/lib/common/emulator.js +2 -2
- package/lib/common/emulator.js.map +1 -1
- package/lib/common/http.d.ts +4 -2
- package/lib/common/http.js +35 -16
- package/lib/common/http.js.map +1 -1
- package/lib/common/info.d.ts +4 -0
- package/lib/common/info.js +6 -1
- package/lib/common/info.js.map +1 -1
- package/lib/common/injectors.d.ts +36 -7
- package/lib/common/injectors.js +39 -11
- package/lib/common/injectors.js.map +1 -1
- package/lib/common/inspect.js +2 -1
- package/lib/common/inspect.js.map +1 -1
- package/lib/common/interactive.d.ts +9 -0
- package/lib/common/interactive.js +33 -1
- package/lib/common/interactive.js.map +1 -1
- package/lib/common/io.js +1 -1
- package/lib/common/io.js.map +1 -1
- package/lib/common/log.d.ts +1 -0
- package/lib/common/log.js +9 -2
- package/lib/common/log.js.map +1 -1
- package/lib/common/npm.d.ts +9 -16
- package/lib/common/npm.js +110 -152
- package/lib/common/npm.js.map +1 -1
- package/lib/common/pack.js +1 -1
- package/lib/common/pack.js.map +1 -1
- package/lib/common/package.d.ts +6 -6
- package/lib/common/package.js +13 -4
- package/lib/common/package.js.map +1 -1
- package/lib/common/port.d.ts +1 -0
- package/lib/common/port.js +11 -1
- package/lib/common/port.js.map +1 -1
- package/lib/common/scaffold.js +5 -2
- package/lib/common/scaffold.js.map +1 -1
- package/lib/common/version.js +4 -4
- package/lib/common/version.js.map +1 -1
- package/lib/external/index.js +1982 -92
- package/lib/helpers.d.ts +3 -3
- package/lib/helpers.js +10 -10
- package/lib/helpers.js.map +1 -1
- package/lib/injectors/{pilet.d.ts → pilet-injector.d.ts} +1 -0
- package/lib/injectors/{pilet.js → pilet-injector.js} +29 -31
- package/lib/injectors/pilet-injector.js.map +1 -0
- package/lib/injectors/{piral.d.ts → piral-injector.d.ts} +1 -0
- package/lib/injectors/{piral.js → piral-injector.js} +20 -22
- package/lib/injectors/piral-injector.js.map +1 -0
- package/lib/messages.d.ts +79 -1
- package/lib/messages.js +89 -2
- package/lib/messages.js.map +1 -1
- package/lib/plugin.js +27 -2
- package/lib/plugin.js.map +1 -1
- package/lib/release.d.ts +1 -1
- package/lib/release.js +35 -3
- package/lib/release.js.map +1 -1
- package/lib/types/common.d.ts +1 -1
- package/lib/types/internal.d.ts +9 -1
- package/lib/types/public.d.ts +1 -1
- package/package.json +6 -4
- package/src/apps/debug-pilet.ts +28 -48
- package/src/apps/debug-piral.ts +22 -37
- package/src/apps/new-pilet.ts +9 -14
- package/src/apps/new-piral.ts +16 -5
- package/src/apps/publish-pilet.ts +10 -3
- package/src/apps/publish-piral.ts +21 -6
- package/src/apps/upgrade-pilet.ts +4 -12
- package/src/apps/upgrade-piral.ts +2 -2
- package/src/bundler.test.ts +1 -1
- package/src/bundler.ts +2 -2
- package/src/commands.ts +17 -9
- package/src/common/browser.ts +12 -8
- package/src/common/clients/index.ts +33 -0
- package/src/common/clients/lerna.ts +61 -1
- package/src/common/clients/npm.ts +32 -15
- package/src/common/clients/pnpm.ts +39 -10
- package/src/common/clients/rush.ts +111 -0
- package/src/common/clients/yarn.ts +41 -12
- package/src/common/declaration.ts +15 -9
- package/src/common/emulator.ts +3 -3
- package/src/common/http.ts +56 -19
- package/src/common/info.ts +6 -1
- package/src/common/injectors.ts +46 -17
- package/src/common/inspect.ts +2 -1
- package/src/common/interactive.test.ts +3 -0
- package/src/common/interactive.ts +49 -1
- package/src/common/io.ts +1 -1
- package/src/common/log.ts +9 -1
- package/src/common/npm.test.ts +109 -76
- package/src/common/npm.ts +119 -146
- package/src/common/pack.test.ts +1 -1
- package/src/common/pack.ts +2 -2
- package/src/common/package.ts +19 -10
- package/src/common/port.ts +10 -0
- package/src/common/scaffold.ts +6 -2
- package/src/common/version.ts +4 -4
- package/src/external/index.ts +2 -1
- package/src/helpers.test.ts +5 -5
- package/src/helpers.ts +7 -7
- package/src/injectors/{pilet.test.ts → pilet-injector.test.ts} +10 -1
- package/src/injectors/{pilet.ts → pilet-injector.ts} +36 -28
- package/src/injectors/{piral.test.ts → piral-injector.test.ts} +5 -1
- package/src/injectors/{piral.ts → piral-injector.ts} +24 -17
- package/src/messages.ts +88 -1
- package/src/plugin.ts +34 -5
- package/src/release.ts +47 -5
- package/src/types/common.ts +1 -1
- package/src/types/internal.ts +6 -1
- package/src/types/public.ts +1 -1
- package/lib/injectors/pilet.js.map +0 -1
- package/lib/injectors/piral.js.map +0 -1
package/src/common/npm.test.ts
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { resolve } from 'path';
|
|
2
|
+
import { clients } from './clients';
|
|
2
3
|
import {
|
|
3
4
|
dissectPackageName,
|
|
4
|
-
|
|
5
|
-
detectNpm,
|
|
6
|
-
detectPnpm,
|
|
7
|
-
detectYarn,
|
|
5
|
+
installNpmPackage,
|
|
8
6
|
isMonorepoPackageRef,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
createPackage,
|
|
13
|
-
findTarball,
|
|
7
|
+
installNpmDependencies,
|
|
8
|
+
createNpmPackage,
|
|
9
|
+
findNpmTarball,
|
|
14
10
|
findSpecificVersion,
|
|
15
11
|
findLatestVersion,
|
|
16
12
|
isLocalPackage,
|
|
@@ -43,9 +39,10 @@ jest.mock('../external', () => ({
|
|
|
43
39
|
}));
|
|
44
40
|
|
|
45
41
|
let specialCase = false;
|
|
42
|
+
let shouldFind = true;
|
|
46
43
|
let wrongCase = false;
|
|
47
|
-
const jsonValueString = JSON.stringify({
|
|
48
|
-
const jsonValueStringWrong = JSON.stringify(
|
|
44
|
+
const jsonValueString = JSON.stringify([{ name: 'npm' }]);
|
|
45
|
+
const jsonValueStringWrong = JSON.stringify([]);
|
|
49
46
|
|
|
50
47
|
jest.mock('./scripts', () => ({
|
|
51
48
|
runCommand: (exe: string, args: Array<string>, cwd: string, output?: NodeJS.WritableStream) => {
|
|
@@ -57,14 +54,15 @@ jest.mock('./scripts', () => ({
|
|
|
57
54
|
}));
|
|
58
55
|
|
|
59
56
|
jest.mock('fs', () => ({
|
|
60
|
-
constants: {
|
|
61
|
-
F_OK: 1,
|
|
62
|
-
},
|
|
63
57
|
createReadStream() {
|
|
64
58
|
return undefined;
|
|
65
59
|
},
|
|
66
60
|
exists: (file: string, cb: (status: boolean) => void) =>
|
|
67
|
-
cb(
|
|
61
|
+
cb(
|
|
62
|
+
shouldFind &&
|
|
63
|
+
!file.endsWith('package.json') &&
|
|
64
|
+
!(specialCase && (file.endsWith('lerna.json') || file.endsWith('yarn.lock'))),
|
|
65
|
+
),
|
|
68
66
|
existsSync: (file: string) => {
|
|
69
67
|
return true;
|
|
70
68
|
},
|
|
@@ -73,13 +71,6 @@ jest.mock('fs', () => ({
|
|
|
73
71
|
},
|
|
74
72
|
realpathSync: () => ({}),
|
|
75
73
|
readFileSync: () => '',
|
|
76
|
-
access: (path: string, mode: number, callback: (err: NodeJS.ErrnoException) => void) => {
|
|
77
|
-
if (path.includes('test')) {
|
|
78
|
-
return callback(undefined);
|
|
79
|
-
} else {
|
|
80
|
-
return callback(new Error('bla'));
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
74
|
}));
|
|
84
75
|
|
|
85
76
|
describe('npm Module', () => {
|
|
@@ -187,55 +178,66 @@ describe('npm Module', () => {
|
|
|
187
178
|
|
|
188
179
|
it('installs a package using the npm command line tool without a target', async () => {
|
|
189
180
|
wrongCase = false;
|
|
190
|
-
await
|
|
181
|
+
await installNpmPackage('npm', 'foo', 'latest').then((result) => expect(result).toEqual(jsonValueString));
|
|
191
182
|
wrongCase = true;
|
|
192
|
-
await
|
|
183
|
+
await installNpmPackage('npm', 'foo', 'latest').then((result) => expect(result).not.toEqual(jsonValueString));
|
|
193
184
|
});
|
|
194
185
|
|
|
195
186
|
it('installs a package using the npm command line tool without a version', async () => {
|
|
196
187
|
wrongCase = false;
|
|
197
|
-
await
|
|
188
|
+
await installNpmPackage('npm', 'foo').then((result) => expect(result).toEqual(jsonValueString));
|
|
198
189
|
wrongCase = true;
|
|
199
|
-
await
|
|
190
|
+
await installNpmPackage('npm', 'foo').then((result) => expect(result).not.toEqual(jsonValueString));
|
|
200
191
|
});
|
|
201
192
|
|
|
202
193
|
it('installs a package using the Yarn command line tool without a version', async () => {
|
|
203
194
|
wrongCase = false;
|
|
204
|
-
await
|
|
195
|
+
await installNpmPackage('yarn', 'foo').then((result) => expect(result).toEqual(jsonValueString));
|
|
205
196
|
wrongCase = true;
|
|
206
|
-
await
|
|
197
|
+
await installNpmPackage('yarn', 'foo').then((result) => expect(result).not.toEqual(jsonValueString));
|
|
207
198
|
});
|
|
208
199
|
|
|
209
200
|
it('installs a package using the Pnpm command line tool without a version', async () => {
|
|
210
201
|
wrongCase = false;
|
|
211
|
-
await
|
|
202
|
+
await installNpmPackage('pnpm', 'foo').then((result) => expect(result).toEqual(jsonValueString));
|
|
212
203
|
wrongCase = true;
|
|
213
|
-
await
|
|
204
|
+
await installNpmPackage('pnpm', 'foo').then((result) => expect(result).not.toEqual(jsonValueString));
|
|
214
205
|
});
|
|
215
206
|
|
|
216
207
|
it('installs a package using the npm command line tool with some flag', async () => {
|
|
217
208
|
wrongCase = false;
|
|
218
|
-
await
|
|
209
|
+
await installNpmPackage('npm', 'foo', '1.3', '.', '--a=b').then((result) =>
|
|
210
|
+
expect(result).toEqual(jsonValueString),
|
|
211
|
+
);
|
|
219
212
|
wrongCase = true;
|
|
220
|
-
await
|
|
213
|
+
await installNpmPackage('npm', 'foo', '1.3', '.', '--a=b').then((result) =>
|
|
221
214
|
expect(result).not.toEqual(jsonValueString),
|
|
222
215
|
);
|
|
223
216
|
});
|
|
224
217
|
|
|
225
218
|
it('detectNpm finds package-lock.json', async () => {
|
|
226
|
-
|
|
227
|
-
await
|
|
219
|
+
shouldFind = true;
|
|
220
|
+
await clients.npm.detectClient('test').then((result) => expect(result).toBeTruthy());
|
|
221
|
+
shouldFind = false;
|
|
222
|
+
await clients.npm.detectClient('toast').then((result) => expect(result).toBeFalsy());
|
|
223
|
+
shouldFind = true;
|
|
228
224
|
});
|
|
229
225
|
|
|
230
|
-
it('detectPnpm finds
|
|
231
|
-
|
|
232
|
-
await
|
|
226
|
+
it('detectPnpm finds pnpm-lock.yaml', async () => {
|
|
227
|
+
shouldFind = true;
|
|
228
|
+
await clients.pnpm.detectClient('test').then((result) => expect(result).toBeTruthy());
|
|
229
|
+
shouldFind = false;
|
|
230
|
+
await clients.pnpm.detectClient('toast').then((result) => expect(result).toBeFalsy());
|
|
231
|
+
shouldFind = true;
|
|
233
232
|
});
|
|
234
233
|
|
|
235
234
|
it('detectYarn finds yarn.lock', async () => {
|
|
236
|
-
|
|
235
|
+
shouldFind = true;
|
|
236
|
+
await clients.yarn.detectClient('test').then((result) => expect(result).toBeTruthy());
|
|
237
|
+
shouldFind = false;
|
|
237
238
|
specialCase = true;
|
|
238
|
-
await
|
|
239
|
+
await clients.yarn.detectClient('toast').then((result) => expect(result).toBeFalsy());
|
|
240
|
+
shouldFind = true;
|
|
239
241
|
specialCase = false;
|
|
240
242
|
});
|
|
241
243
|
|
|
@@ -246,59 +248,46 @@ describe('npm Module', () => {
|
|
|
246
248
|
await isMonorepoPackageRef('npm', './').then((result) => expect(result).toBeFalsy());
|
|
247
249
|
});
|
|
248
250
|
|
|
249
|
-
it('verifies whether lerna config path is valid', async () => {
|
|
250
|
-
wrongCase = false;
|
|
251
|
-
await detectMonorepo('./').then((result) => {
|
|
252
|
-
expect(result).toBe('lerna');
|
|
253
|
-
});
|
|
254
|
-
wrongCase = true;
|
|
255
|
-
specialCase = true;
|
|
256
|
-
await detectMonorepo('./').then((result) => {
|
|
257
|
-
expect(result).toBe('none');
|
|
258
|
-
});
|
|
259
|
-
specialCase = false;
|
|
260
|
-
});
|
|
261
|
-
|
|
262
251
|
it('verifies whether lerna bootstrap ran', async () => {
|
|
263
252
|
wrongCase = false;
|
|
264
|
-
await
|
|
253
|
+
await clients.lerna.installDependencies().then((result) => expect(result).toEqual(jsonValueString));
|
|
265
254
|
wrongCase = true;
|
|
266
|
-
await
|
|
255
|
+
await clients.lerna.installDependencies().then((result) => expect(result).not.toEqual(jsonValueString));
|
|
267
256
|
});
|
|
268
257
|
|
|
269
258
|
it('install dependencies with npm client', async () => {
|
|
270
259
|
wrongCase = false;
|
|
271
|
-
await
|
|
260
|
+
await installNpmDependencies('npm').then((result) => expect(result).toEqual(jsonValueString));
|
|
272
261
|
wrongCase = true;
|
|
273
|
-
await
|
|
262
|
+
await installNpmDependencies('npm').then((result) => expect(result).not.toEqual(jsonValueString));
|
|
274
263
|
});
|
|
275
264
|
|
|
276
265
|
it('install dependencies with pnpm client', async () => {
|
|
277
266
|
wrongCase = false;
|
|
278
|
-
await
|
|
267
|
+
await installNpmDependencies('pnpm').then((result) => expect(result).toEqual(jsonValueString));
|
|
279
268
|
wrongCase = true;
|
|
280
|
-
await
|
|
269
|
+
await installNpmDependencies('pnpm').then((result) => expect(result).not.toEqual(jsonValueString));
|
|
281
270
|
});
|
|
282
271
|
|
|
283
272
|
it('install dependencies with yarn client', async () => {
|
|
284
273
|
wrongCase = false;
|
|
285
|
-
await
|
|
274
|
+
await installNpmDependencies('yarn').then((result) => expect(result).toEqual(jsonValueString));
|
|
286
275
|
wrongCase = true;
|
|
287
|
-
await
|
|
276
|
+
await installNpmDependencies('yarn').then((result) => expect(result).not.toEqual(jsonValueString));
|
|
288
277
|
});
|
|
289
278
|
|
|
290
279
|
it('create npm package', async () => {
|
|
291
280
|
wrongCase = false;
|
|
292
|
-
await
|
|
281
|
+
await createNpmPackage().then((result) => expect(result).toEqual(jsonValueString));
|
|
293
282
|
wrongCase = true;
|
|
294
|
-
await
|
|
283
|
+
await createNpmPackage().then((result) => expect(result).not.toEqual(jsonValueString));
|
|
295
284
|
});
|
|
296
285
|
|
|
297
286
|
it('find npm tarball', async () => {
|
|
298
287
|
wrongCase = false;
|
|
299
|
-
await
|
|
288
|
+
await findNpmTarball('foo').then((result) => expect(result).toEqual(jsonValueString));
|
|
300
289
|
wrongCase = true;
|
|
301
|
-
await
|
|
290
|
+
await findNpmTarball('foo').then((result) => expect(result).not.toEqual(jsonValueString));
|
|
302
291
|
});
|
|
303
292
|
|
|
304
293
|
it('find latest version', async () => {
|
|
@@ -315,17 +304,61 @@ describe('npm Module', () => {
|
|
|
315
304
|
await findSpecificVersion('foo', '1.0.0').then((result) => expect(result).not.toEqual(jsonValueString));
|
|
316
305
|
});
|
|
317
306
|
|
|
318
|
-
it('check if package is local', () => {
|
|
319
|
-
|
|
307
|
+
it('check if package from full file is local', () => {
|
|
308
|
+
const result = isLocalPackage('./', 'file://foo.tgz');
|
|
320
309
|
expect(result).toBeTruthy();
|
|
321
|
-
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
it('check if package from current dir is local', () => {
|
|
313
|
+
const result = isLocalPackage('./', './');
|
|
322
314
|
expect(result).toBeTruthy();
|
|
323
|
-
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
it('check if package from file is local', () => {
|
|
318
|
+
const result = isLocalPackage('./', 'foo.tgz');
|
|
319
|
+
expect(result).toBeTruthy();
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
it('check if package from nothing is not local', () => {
|
|
323
|
+
const result = isLocalPackage('./', null);
|
|
324
|
+
expect(result).toBeFalsy();
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
it('check if package from tilde version is not local', () => {
|
|
328
|
+
const result = isLocalPackage('./', '~12.2.2');
|
|
329
|
+
expect(result).toBeFalsy();
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
it('check if package from caret version is not local', () => {
|
|
333
|
+
const result = isLocalPackage('./', '^12.2.2');
|
|
334
|
+
expect(result).toBeFalsy();
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
it('check if package from star version is not local', () => {
|
|
338
|
+
const result = isLocalPackage('./', '*');
|
|
339
|
+
expect(result).toBeFalsy();
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
it('check if package from greater than is not local', () => {
|
|
343
|
+
const result = isLocalPackage('./', '>=1.0.0');
|
|
344
|
+
expect(result).toBeFalsy();
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
it('check if package from home dir is local', () => {
|
|
348
|
+
const result = isLocalPackage('./', '~/foo/bar');
|
|
324
349
|
expect(result).toBeTruthy();
|
|
325
|
-
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
it('check if package from zero is not local', () => {
|
|
353
|
+
const result = isLocalPackage('./', '.0');
|
|
326
354
|
expect(result).toBeFalsy();
|
|
327
355
|
});
|
|
328
356
|
|
|
357
|
+
it('check if package from absolute dir is local', () => {
|
|
358
|
+
const result = isLocalPackage('./', '/0');
|
|
359
|
+
expect(result).toBeTruthy();
|
|
360
|
+
});
|
|
361
|
+
|
|
329
362
|
it('check if package is coming from git', () => {
|
|
330
363
|
let result = isGitPackage('https://.foo.git');
|
|
331
364
|
expect(result).toBeTruthy();
|
|
@@ -420,7 +453,7 @@ describe('npm Module', () => {
|
|
|
420
453
|
});
|
|
421
454
|
|
|
422
455
|
it('makeExternals without externals returns coreExternals', () => {
|
|
423
|
-
const externals = makeExternals({ piral: '*' });
|
|
456
|
+
const externals = makeExternals(process.cwd(), { piral: '*' });
|
|
424
457
|
expect(externals).toEqual([
|
|
425
458
|
'react',
|
|
426
459
|
'react-dom',
|
|
@@ -435,7 +468,7 @@ describe('npm Module', () => {
|
|
|
435
468
|
});
|
|
436
469
|
|
|
437
470
|
it('makeExternals with no externals returns coreExternals', () => {
|
|
438
|
-
const externals = makeExternals({ piral: '*' }, []);
|
|
471
|
+
const externals = makeExternals(process.cwd(), { piral: '*' }, []);
|
|
439
472
|
expect(externals).toEqual([
|
|
440
473
|
'react',
|
|
441
474
|
'react-dom',
|
|
@@ -450,12 +483,12 @@ describe('npm Module', () => {
|
|
|
450
483
|
});
|
|
451
484
|
|
|
452
485
|
it('makeExternals with exclude coreExternals returns empty set', () => {
|
|
453
|
-
const externals = makeExternals({ piral: '*' }, ['!*']);
|
|
486
|
+
const externals = makeExternals(process.cwd(), { piral: '*' }, ['!*']);
|
|
454
487
|
expect(externals).toEqual([]);
|
|
455
488
|
});
|
|
456
489
|
|
|
457
490
|
it('makeExternals with externals concats coreExternals', () => {
|
|
458
|
-
const externals = makeExternals({ piral: '*' }, ['foo', 'bar']);
|
|
491
|
+
const externals = makeExternals(process.cwd(), { piral: '*' }, ['foo', 'bar']);
|
|
459
492
|
expect(externals).toEqual([
|
|
460
493
|
'foo',
|
|
461
494
|
'bar',
|
|
@@ -472,7 +505,7 @@ describe('npm Module', () => {
|
|
|
472
505
|
});
|
|
473
506
|
|
|
474
507
|
it('makeExternals with external duplicate only reflects coreExternals', () => {
|
|
475
|
-
const externals = makeExternals({ piral: '*' }, ['react', 'foo']);
|
|
508
|
+
const externals = makeExternals(process.cwd(), { piral: '*' }, ['react', 'foo']);
|
|
476
509
|
expect(externals).toEqual([
|
|
477
510
|
'react',
|
|
478
511
|
'foo',
|
|
@@ -488,7 +521,7 @@ describe('npm Module', () => {
|
|
|
488
521
|
});
|
|
489
522
|
|
|
490
523
|
it('makeExternals with explicit include and exclude', () => {
|
|
491
|
-
const externals = makeExternals({ piral: '*' }, ['react', 'react-calendar', '!history']);
|
|
524
|
+
const externals = makeExternals(process.cwd(), { piral: '*' }, ['react', 'react-calendar', '!history']);
|
|
492
525
|
expect(externals).toEqual([
|
|
493
526
|
'react',
|
|
494
527
|
'react-calendar',
|
|
@@ -503,7 +536,7 @@ describe('npm Module', () => {
|
|
|
503
536
|
});
|
|
504
537
|
|
|
505
538
|
it('makeExternals with all exclude and explicit include', () => {
|
|
506
|
-
const externals = makeExternals({ piral: '*' }, ['react', 'react-router-dom', '!*']);
|
|
539
|
+
const externals = makeExternals(process.cwd(), { piral: '*' }, ['react', 'react-router-dom', '!*']);
|
|
507
540
|
expect(externals).toEqual(['react', 'react-router-dom']);
|
|
508
541
|
});
|
|
509
542
|
});
|