piral-cli 0.15.0-alpha.4041 → 0.15.0-alpha.4231
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/lib/apps/build-pilet.js.map +1 -1
- package/lib/apps/build-piral.js.map +1 -1
- package/lib/apps/debug-pilet.js.map +1 -1
- package/lib/apps/debug-piral.js.map +1 -1
- package/lib/apps/index.js +5 -1
- package/lib/apps/index.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 +5 -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/build/bundler-calls.d.ts +1 -1
- package/lib/build/run-build-pilet.js.map +1 -1
- package/lib/build/run-build-piral.js.map +1 -1
- package/lib/build/run-debug-mono-piral.js +1 -1
- package/lib/build/run-debug-mono-piral.js.map +1 -1
- package/lib/build/run-debug-pilet.js.map +1 -1
- package/lib/build/run-debug-piral.js.map +1 -1
- package/lib/bundler.js +1 -1
- package/lib/bundler.js.map +1 -1
- package/lib/commands.js +8 -0
- 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 +36 -9
- package/lib/common/clients/npm.js.map +1 -1
- package/lib/common/clients/pnpm.d.ts +4 -0
- package/lib/common/clients/pnpm.js +41 -1
- 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 +44 -4
- package/lib/common/clients/yarn.js.map +1 -1
- package/lib/common/config.js.map +1 -1
- package/lib/common/constants.d.ts +1 -1
- package/lib/common/constants.js +1 -1
- package/lib/common/constants.js.map +1 -1
- package/lib/common/declaration.js +14 -10
- 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 +1 -1
- package/lib/common/http.js +12 -7
- package/lib/common/http.js.map +1 -1
- package/lib/common/importmap.js +7 -16
- package/lib/common/importmap.js.map +1 -1
- package/lib/common/index.js +5 -1
- package/lib/common/index.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/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 +31 -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/npm.d.ts +11 -16
- package/lib/common/npm.js +165 -158
- 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 -7
- package/lib/common/package.js +26 -28
- package/lib/common/package.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 +2380 -470
- package/lib/helpers.d.ts +1 -1
- package/lib/helpers.js +1 -1
- package/lib/helpers.js.map +1 -1
- package/lib/index.js +5 -1
- package/lib/index.js.map +1 -1
- package/lib/injectors/pilet.d.ts +1 -0
- package/lib/injectors/pilet.js +7 -7
- package/lib/injectors/pilet.js.map +1 -1
- package/lib/messages.d.ts +1 -1
- package/lib/messages.js +5 -1
- 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 +7 -2
- package/lib/release.js.map +1 -1
- package/lib/types/common.d.ts +1 -1
- package/lib/types/index.js +5 -1
- package/lib/types/index.js.map +1 -1
- package/lib/types/internal.d.ts +9 -1
- package/lib/types/public.d.ts +2 -2
- package/package.json +5 -3
- package/src/apps/new-pilet.ts +9 -14
- package/src/apps/new-piral.ts +9 -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/build/bundler-calls.ts +1 -1
- package/src/build/run-build-pilet.ts +1 -1
- package/src/build/run-build-piral.ts +1 -1
- package/src/build/run-debug-mono-piral.ts +2 -2
- package/src/build/run-debug-pilet.ts +1 -1
- package/src/build/run-debug-piral.ts +1 -1
- package/src/bundler.test.ts +1 -1
- package/src/bundler.ts +2 -2
- package/src/commands.ts +8 -0
- 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 +31 -6
- package/src/common/clients/pnpm.ts +37 -0
- package/src/common/clients/rush.ts +111 -0
- package/src/common/clients/yarn.ts +40 -3
- package/src/common/config.ts +3 -3
- package/src/common/constants.ts +1 -1
- package/src/common/declaration.ts +17 -10
- package/src/common/emulator.ts +3 -3
- package/src/common/http.ts +20 -6
- package/src/common/importmap.ts +7 -15
- package/src/common/info.ts +6 -1
- package/src/common/inspect.ts +2 -1
- package/src/common/interactive.test.ts +3 -0
- package/src/common/interactive.ts +48 -1
- package/src/common/io.ts +1 -1
- package/src/common/npm.test.ts +122 -76
- package/src/common/npm.ts +177 -152
- package/src/common/pack.test.ts +1 -1
- package/src/common/pack.ts +2 -2
- package/src/common/package.test.ts +1 -14
- package/src/common/package.ts +31 -29
- package/src/common/scaffold.ts +7 -2
- package/src/common/version.ts +4 -4
- package/src/external/index.ts +2 -1
- package/src/helpers.ts +2 -2
- package/src/injectors/pilet.ts +9 -8
- package/src/messages.ts +6 -2
- package/src/plugin.ts +34 -5
- package/src/release.ts +10 -2
- package/src/types/common.ts +1 -1
- package/src/types/internal.ts +6 -1
- package/src/types/public.ts +2 -2
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,
|
|
@@ -25,6 +21,7 @@ import {
|
|
|
25
21
|
getPackageVersion,
|
|
26
22
|
isGitPackage,
|
|
27
23
|
makeExternals,
|
|
24
|
+
findPackageRoot,
|
|
28
25
|
} from './npm';
|
|
29
26
|
|
|
30
27
|
jest.mock('child_process');
|
|
@@ -42,9 +39,10 @@ jest.mock('../external', () => ({
|
|
|
42
39
|
}));
|
|
43
40
|
|
|
44
41
|
let specialCase = false;
|
|
42
|
+
let shouldFind = true;
|
|
45
43
|
let wrongCase = false;
|
|
46
|
-
const jsonValueString = JSON.stringify({
|
|
47
|
-
const jsonValueStringWrong = JSON.stringify(
|
|
44
|
+
const jsonValueString = JSON.stringify([{ name: 'npm' }]);
|
|
45
|
+
const jsonValueStringWrong = JSON.stringify([]);
|
|
48
46
|
|
|
49
47
|
jest.mock('./scripts', () => ({
|
|
50
48
|
runCommand: (exe: string, args: Array<string>, cwd: string, output?: NodeJS.WritableStream) => {
|
|
@@ -56,14 +54,15 @@ jest.mock('./scripts', () => ({
|
|
|
56
54
|
}));
|
|
57
55
|
|
|
58
56
|
jest.mock('fs', () => ({
|
|
59
|
-
constants: {
|
|
60
|
-
F_OK: 1,
|
|
61
|
-
},
|
|
62
57
|
createReadStream() {
|
|
63
58
|
return undefined;
|
|
64
59
|
},
|
|
65
60
|
exists: (file: string, cb: (status: boolean) => void) =>
|
|
66
|
-
cb(
|
|
61
|
+
cb(
|
|
62
|
+
shouldFind &&
|
|
63
|
+
!file.endsWith('package.json') &&
|
|
64
|
+
!(specialCase && (file.endsWith('lerna.json') || file.endsWith('yarn.lock'))),
|
|
65
|
+
),
|
|
67
66
|
existsSync: (file: string) => {
|
|
68
67
|
return true;
|
|
69
68
|
},
|
|
@@ -72,16 +71,21 @@ jest.mock('fs', () => ({
|
|
|
72
71
|
},
|
|
73
72
|
realpathSync: () => ({}),
|
|
74
73
|
readFileSync: () => '',
|
|
75
|
-
access: (path: string, mode: number, callback: (err: NodeJS.ErrnoException) => void) => {
|
|
76
|
-
if (path.includes('test')) {
|
|
77
|
-
return callback(undefined);
|
|
78
|
-
} else {
|
|
79
|
-
return callback(new Error('bla'));
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
74
|
}));
|
|
83
75
|
|
|
84
76
|
describe('npm Module', () => {
|
|
77
|
+
it('findPackageRoot correctly resolves the package root of parcel-bundler', () => {
|
|
78
|
+
const dir = process.cwd();
|
|
79
|
+
const version = findPackageRoot('webpack', dir);
|
|
80
|
+
expect(version).toBe(resolve(dir, 'node_modules', 'webpack', 'package.json'));
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it('findPackageRoot returns undefined for invalid package', () => {
|
|
84
|
+
const dir = process.cwd();
|
|
85
|
+
const version = findPackageRoot('foo-bar-not-exist', dir);
|
|
86
|
+
expect(version).toBeUndefined();
|
|
87
|
+
});
|
|
88
|
+
|
|
85
89
|
it('dissects a fully qualified name with latest correctly', async () => {
|
|
86
90
|
wrongCase = false;
|
|
87
91
|
const [name, version, hadVersion, type] = await dissectPackageName(process.cwd(), 'foo@latest');
|
|
@@ -174,55 +178,66 @@ describe('npm Module', () => {
|
|
|
174
178
|
|
|
175
179
|
it('installs a package using the npm command line tool without a target', async () => {
|
|
176
180
|
wrongCase = false;
|
|
177
|
-
await
|
|
181
|
+
await installNpmPackage('npm', 'foo', 'latest').then((result) => expect(result).toEqual(jsonValueString));
|
|
178
182
|
wrongCase = true;
|
|
179
|
-
await
|
|
183
|
+
await installNpmPackage('npm', 'foo', 'latest').then((result) => expect(result).not.toEqual(jsonValueString));
|
|
180
184
|
});
|
|
181
185
|
|
|
182
186
|
it('installs a package using the npm command line tool without a version', async () => {
|
|
183
187
|
wrongCase = false;
|
|
184
|
-
await
|
|
188
|
+
await installNpmPackage('npm', 'foo').then((result) => expect(result).toEqual(jsonValueString));
|
|
185
189
|
wrongCase = true;
|
|
186
|
-
await
|
|
190
|
+
await installNpmPackage('npm', 'foo').then((result) => expect(result).not.toEqual(jsonValueString));
|
|
187
191
|
});
|
|
188
192
|
|
|
189
193
|
it('installs a package using the Yarn command line tool without a version', async () => {
|
|
190
194
|
wrongCase = false;
|
|
191
|
-
await
|
|
195
|
+
await installNpmPackage('yarn', 'foo').then((result) => expect(result).toEqual(jsonValueString));
|
|
192
196
|
wrongCase = true;
|
|
193
|
-
await
|
|
197
|
+
await installNpmPackage('yarn', 'foo').then((result) => expect(result).not.toEqual(jsonValueString));
|
|
194
198
|
});
|
|
195
199
|
|
|
196
200
|
it('installs a package using the Pnpm command line tool without a version', async () => {
|
|
197
201
|
wrongCase = false;
|
|
198
|
-
await
|
|
202
|
+
await installNpmPackage('pnpm', 'foo').then((result) => expect(result).toEqual(jsonValueString));
|
|
199
203
|
wrongCase = true;
|
|
200
|
-
await
|
|
204
|
+
await installNpmPackage('pnpm', 'foo').then((result) => expect(result).not.toEqual(jsonValueString));
|
|
201
205
|
});
|
|
202
206
|
|
|
203
207
|
it('installs a package using the npm command line tool with some flag', async () => {
|
|
204
208
|
wrongCase = false;
|
|
205
|
-
await
|
|
209
|
+
await installNpmPackage('npm', 'foo', '1.3', '.', '--a=b').then((result) =>
|
|
210
|
+
expect(result).toEqual(jsonValueString),
|
|
211
|
+
);
|
|
206
212
|
wrongCase = true;
|
|
207
|
-
await
|
|
213
|
+
await installNpmPackage('npm', 'foo', '1.3', '.', '--a=b').then((result) =>
|
|
208
214
|
expect(result).not.toEqual(jsonValueString),
|
|
209
215
|
);
|
|
210
216
|
});
|
|
211
217
|
|
|
212
218
|
it('detectNpm finds package-lock.json', async () => {
|
|
213
|
-
|
|
214
|
-
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;
|
|
215
224
|
});
|
|
216
225
|
|
|
217
|
-
it('detectPnpm finds
|
|
218
|
-
|
|
219
|
-
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;
|
|
220
232
|
});
|
|
221
233
|
|
|
222
234
|
it('detectYarn finds yarn.lock', async () => {
|
|
223
|
-
|
|
235
|
+
shouldFind = true;
|
|
236
|
+
await clients.yarn.detectClient('test').then((result) => expect(result).toBeTruthy());
|
|
237
|
+
shouldFind = false;
|
|
224
238
|
specialCase = true;
|
|
225
|
-
await
|
|
239
|
+
await clients.yarn.detectClient('toast').then((result) => expect(result).toBeFalsy());
|
|
240
|
+
shouldFind = true;
|
|
226
241
|
specialCase = false;
|
|
227
242
|
});
|
|
228
243
|
|
|
@@ -233,59 +248,46 @@ describe('npm Module', () => {
|
|
|
233
248
|
await isMonorepoPackageRef('npm', './').then((result) => expect(result).toBeFalsy());
|
|
234
249
|
});
|
|
235
250
|
|
|
236
|
-
it('verifies whether lerna config path is valid', async () => {
|
|
237
|
-
wrongCase = false;
|
|
238
|
-
await detectMonorepo('./').then((result) => {
|
|
239
|
-
expect(result).toBe('lerna');
|
|
240
|
-
});
|
|
241
|
-
wrongCase = true;
|
|
242
|
-
specialCase = true;
|
|
243
|
-
await detectMonorepo('./').then((result) => {
|
|
244
|
-
expect(result).toBe('none');
|
|
245
|
-
});
|
|
246
|
-
specialCase = false;
|
|
247
|
-
});
|
|
248
|
-
|
|
249
251
|
it('verifies whether lerna bootstrap ran', async () => {
|
|
250
252
|
wrongCase = false;
|
|
251
|
-
await
|
|
253
|
+
await clients.lerna.installDependencies().then((result) => expect(result).toEqual(jsonValueString));
|
|
252
254
|
wrongCase = true;
|
|
253
|
-
await
|
|
255
|
+
await clients.lerna.installDependencies().then((result) => expect(result).not.toEqual(jsonValueString));
|
|
254
256
|
});
|
|
255
257
|
|
|
256
258
|
it('install dependencies with npm client', async () => {
|
|
257
259
|
wrongCase = false;
|
|
258
|
-
await
|
|
260
|
+
await installNpmDependencies('npm').then((result) => expect(result).toEqual(jsonValueString));
|
|
259
261
|
wrongCase = true;
|
|
260
|
-
await
|
|
262
|
+
await installNpmDependencies('npm').then((result) => expect(result).not.toEqual(jsonValueString));
|
|
261
263
|
});
|
|
262
264
|
|
|
263
265
|
it('install dependencies with pnpm client', async () => {
|
|
264
266
|
wrongCase = false;
|
|
265
|
-
await
|
|
267
|
+
await installNpmDependencies('pnpm').then((result) => expect(result).toEqual(jsonValueString));
|
|
266
268
|
wrongCase = true;
|
|
267
|
-
await
|
|
269
|
+
await installNpmDependencies('pnpm').then((result) => expect(result).not.toEqual(jsonValueString));
|
|
268
270
|
});
|
|
269
271
|
|
|
270
272
|
it('install dependencies with yarn client', async () => {
|
|
271
273
|
wrongCase = false;
|
|
272
|
-
await
|
|
274
|
+
await installNpmDependencies('yarn').then((result) => expect(result).toEqual(jsonValueString));
|
|
273
275
|
wrongCase = true;
|
|
274
|
-
await
|
|
276
|
+
await installNpmDependencies('yarn').then((result) => expect(result).not.toEqual(jsonValueString));
|
|
275
277
|
});
|
|
276
278
|
|
|
277
279
|
it('create npm package', async () => {
|
|
278
280
|
wrongCase = false;
|
|
279
|
-
await
|
|
281
|
+
await createNpmPackage().then((result) => expect(result).toEqual(jsonValueString));
|
|
280
282
|
wrongCase = true;
|
|
281
|
-
await
|
|
283
|
+
await createNpmPackage().then((result) => expect(result).not.toEqual(jsonValueString));
|
|
282
284
|
});
|
|
283
285
|
|
|
284
286
|
it('find npm tarball', async () => {
|
|
285
287
|
wrongCase = false;
|
|
286
|
-
await
|
|
288
|
+
await findNpmTarball('foo').then((result) => expect(result).toEqual(jsonValueString));
|
|
287
289
|
wrongCase = true;
|
|
288
|
-
await
|
|
290
|
+
await findNpmTarball('foo').then((result) => expect(result).not.toEqual(jsonValueString));
|
|
289
291
|
});
|
|
290
292
|
|
|
291
293
|
it('find latest version', async () => {
|
|
@@ -302,17 +304,61 @@ describe('npm Module', () => {
|
|
|
302
304
|
await findSpecificVersion('foo', '1.0.0').then((result) => expect(result).not.toEqual(jsonValueString));
|
|
303
305
|
});
|
|
304
306
|
|
|
305
|
-
it('check if package is local', () => {
|
|
306
|
-
|
|
307
|
+
it('check if package from full file is local', () => {
|
|
308
|
+
const result = isLocalPackage('./', 'file://foo.tgz');
|
|
309
|
+
expect(result).toBeTruthy();
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
it('check if package from current dir is local', () => {
|
|
313
|
+
const result = isLocalPackage('./', './');
|
|
307
314
|
expect(result).toBeTruthy();
|
|
308
|
-
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
it('check if package from file is local', () => {
|
|
318
|
+
const result = isLocalPackage('./', 'foo.tgz');
|
|
309
319
|
expect(result).toBeTruthy();
|
|
310
|
-
|
|
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');
|
|
311
349
|
expect(result).toBeTruthy();
|
|
312
|
-
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
it('check if package from zero is not local', () => {
|
|
353
|
+
const result = isLocalPackage('./', '.0');
|
|
313
354
|
expect(result).toBeFalsy();
|
|
314
355
|
});
|
|
315
356
|
|
|
357
|
+
it('check if package from absolute dir is local', () => {
|
|
358
|
+
const result = isLocalPackage('./', '/0');
|
|
359
|
+
expect(result).toBeTruthy();
|
|
360
|
+
});
|
|
361
|
+
|
|
316
362
|
it('check if package is coming from git', () => {
|
|
317
363
|
let result = isGitPackage('https://.foo.git');
|
|
318
364
|
expect(result).toBeTruthy();
|
|
@@ -407,7 +453,7 @@ describe('npm Module', () => {
|
|
|
407
453
|
});
|
|
408
454
|
|
|
409
455
|
it('makeExternals without externals returns coreExternals', () => {
|
|
410
|
-
const externals = makeExternals({ piral: '*' });
|
|
456
|
+
const externals = makeExternals(process.cwd(), { piral: '*' });
|
|
411
457
|
expect(externals).toEqual([
|
|
412
458
|
'react',
|
|
413
459
|
'react-dom',
|
|
@@ -422,7 +468,7 @@ describe('npm Module', () => {
|
|
|
422
468
|
});
|
|
423
469
|
|
|
424
470
|
it('makeExternals with no externals returns coreExternals', () => {
|
|
425
|
-
const externals = makeExternals({ piral: '*' }, []);
|
|
471
|
+
const externals = makeExternals(process.cwd(), { piral: '*' }, []);
|
|
426
472
|
expect(externals).toEqual([
|
|
427
473
|
'react',
|
|
428
474
|
'react-dom',
|
|
@@ -437,12 +483,12 @@ describe('npm Module', () => {
|
|
|
437
483
|
});
|
|
438
484
|
|
|
439
485
|
it('makeExternals with exclude coreExternals returns empty set', () => {
|
|
440
|
-
const externals = makeExternals({ piral: '*' }, ['!*']);
|
|
486
|
+
const externals = makeExternals(process.cwd(), { piral: '*' }, ['!*']);
|
|
441
487
|
expect(externals).toEqual([]);
|
|
442
488
|
});
|
|
443
489
|
|
|
444
490
|
it('makeExternals with externals concats coreExternals', () => {
|
|
445
|
-
const externals = makeExternals({ piral: '*' }, ['foo', 'bar']);
|
|
491
|
+
const externals = makeExternals(process.cwd(), { piral: '*' }, ['foo', 'bar']);
|
|
446
492
|
expect(externals).toEqual([
|
|
447
493
|
'foo',
|
|
448
494
|
'bar',
|
|
@@ -459,7 +505,7 @@ describe('npm Module', () => {
|
|
|
459
505
|
});
|
|
460
506
|
|
|
461
507
|
it('makeExternals with external duplicate only reflects coreExternals', () => {
|
|
462
|
-
const externals = makeExternals({ piral: '*' }, ['react', 'foo']);
|
|
508
|
+
const externals = makeExternals(process.cwd(), { piral: '*' }, ['react', 'foo']);
|
|
463
509
|
expect(externals).toEqual([
|
|
464
510
|
'react',
|
|
465
511
|
'foo',
|
|
@@ -475,7 +521,7 @@ describe('npm Module', () => {
|
|
|
475
521
|
});
|
|
476
522
|
|
|
477
523
|
it('makeExternals with explicit include and exclude', () => {
|
|
478
|
-
const externals = makeExternals({ piral: '*' }, ['react', 'react-calendar', '!history']);
|
|
524
|
+
const externals = makeExternals(process.cwd(), { piral: '*' }, ['react', 'react-calendar', '!history']);
|
|
479
525
|
expect(externals).toEqual([
|
|
480
526
|
'react',
|
|
481
527
|
'react-calendar',
|
|
@@ -490,7 +536,7 @@ describe('npm Module', () => {
|
|
|
490
536
|
});
|
|
491
537
|
|
|
492
538
|
it('makeExternals with all exclude and explicit include', () => {
|
|
493
|
-
const externals = makeExternals({ piral: '*' }, ['react', 'react-router-dom', '!*']);
|
|
539
|
+
const externals = makeExternals(process.cwd(), { piral: '*' }, ['react', 'react-router-dom', '!*']);
|
|
494
540
|
expect(externals).toEqual(['react', 'react-router-dom']);
|
|
495
541
|
});
|
|
496
542
|
});
|