piral-cli 0.14.24-beta.4168 → 0.14.24-beta.4195
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/new-pilet.js.map +1 -1
- package/lib/apps/new-piral.js +3 -1
- package/lib/apps/new-piral.js.map +1 -1
- package/lib/common/clients/lerna.d.ts +2 -0
- package/lib/common/clients/lerna.js +28 -1
- package/lib/common/clients/lerna.js.map +1 -1
- package/lib/common/clients/npm.d.ts +1 -0
- package/lib/common/clients/npm.js +14 -1
- package/lib/common/clients/npm.js.map +1 -1
- package/lib/common/clients/pnpm.d.ts +2 -0
- package/lib/common/clients/pnpm.js +28 -1
- package/lib/common/clients/pnpm.js.map +1 -1
- package/lib/common/clients/rush.d.ts +2 -0
- package/lib/common/clients/rush.js +28 -1
- package/lib/common/clients/rush.js.map +1 -1
- package/lib/common/clients/yarn.d.ts +2 -0
- package/lib/common/clients/yarn.js +28 -1
- package/lib/common/clients/yarn.js.map +1 -1
- package/lib/common/emulator.js +1 -1
- package/lib/common/emulator.js.map +1 -1
- package/lib/common/npm.d.ts +3 -2
- package/lib/common/npm.js +38 -26
- package/lib/common/npm.js.map +1 -1
- package/lib/common/package.js +4 -3
- package/lib/common/package.js.map +1 -1
- package/lib/common/scaffold.js +3 -0
- package/lib/common/scaffold.js.map +1 -1
- package/lib/plugin.js +4 -4
- package/lib/plugin.js.map +1 -1
- package/package.json +2 -2
- package/src/apps/new-pilet.ts +0 -1
- package/src/apps/new-piral.ts +5 -1
- package/src/common/clients/lerna.ts +26 -0
- package/src/common/clients/npm.ts +12 -0
- package/src/common/clients/pnpm.ts +26 -0
- package/src/common/clients/rush.ts +26 -0
- package/src/common/clients/yarn.ts +26 -0
- package/src/common/emulator.ts +1 -1
- package/src/common/npm.test.ts +9 -9
- package/src/common/npm.ts +41 -27
- package/src/common/package.ts +4 -3
- package/src/common/scaffold.ts +4 -0
- package/src/plugin.ts +4 -4
package/src/common/package.ts
CHANGED
|
@@ -466,13 +466,14 @@ export async function retrievePiletsInfo(entryFile: string) {
|
|
|
466
466
|
fail('packageJsonMissing_0074');
|
|
467
467
|
}
|
|
468
468
|
|
|
469
|
+
const root = dirname(packageJson);
|
|
469
470
|
const packageInfo = require(packageJson);
|
|
470
471
|
const allDeps = {
|
|
471
472
|
...packageInfo.devDependencies,
|
|
472
473
|
...packageInfo.dependencies,
|
|
473
474
|
};
|
|
474
475
|
const info = getPiletsInfo(packageInfo);
|
|
475
|
-
const externals = makeExternals(allDeps, info.externals);
|
|
476
|
+
const externals = makeExternals(root, allDeps, info.externals);
|
|
476
477
|
|
|
477
478
|
return {
|
|
478
479
|
...info,
|
|
@@ -486,7 +487,7 @@ export async function retrievePiletsInfo(entryFile: string) {
|
|
|
486
487
|
},
|
|
487
488
|
scripts: packageInfo.scripts,
|
|
488
489
|
ignored: checkArrayOrUndefined(packageInfo, 'preservedDependencies'),
|
|
489
|
-
root
|
|
490
|
+
root,
|
|
490
491
|
};
|
|
491
492
|
}
|
|
492
493
|
|
|
@@ -524,7 +525,7 @@ export async function patchPiletPackage(
|
|
|
524
525
|
}
|
|
525
526
|
: info.scripts;
|
|
526
527
|
const peerModules = [];
|
|
527
|
-
const allExternals = makePiletExternals(piralDependencies, externals, fromEmulator, piralInfo);
|
|
528
|
+
const allExternals = makePiletExternals(root, piralDependencies, externals, fromEmulator, piralInfo);
|
|
528
529
|
const peerDependencies = {
|
|
529
530
|
...allExternals.reduce((deps, name) => {
|
|
530
531
|
const valid = isValidDependency(name);
|
package/src/common/scaffold.ts
CHANGED
|
@@ -36,6 +36,10 @@ async function getTemplateFiles(
|
|
|
36
36
|
if (templatePackageName.startsWith('.')) {
|
|
37
37
|
templatePackageName = resolve(process.cwd(), templatePackageName);
|
|
38
38
|
} else {
|
|
39
|
+
if (templatePackageName.indexOf('@', 1) === -1) {
|
|
40
|
+
templatePackageName = `${templatePackageName}@latest`;
|
|
41
|
+
}
|
|
42
|
+
|
|
39
43
|
await installNpmPackage('npm', templatePackageName, __dirname, '--registry', registry);
|
|
40
44
|
}
|
|
41
45
|
|
package/src/plugin.ts
CHANGED
|
@@ -6,11 +6,11 @@ import { inject } from './inject';
|
|
|
6
6
|
function getContainerDir() {
|
|
7
7
|
const currentDir = __dirname.split(sep).join(posix.sep);
|
|
8
8
|
|
|
9
|
-
if (currentDir.includes(`/.pnpm/${cliName}@${cliVersion}/node_modules/${cliName}/`)) {
|
|
10
|
-
return resolve(__dirname, '..', '..'
|
|
9
|
+
if (!currentDir.includes(`/.pnpm/${cliName}@${cliVersion}/node_modules/${cliName}/`)) {
|
|
10
|
+
return resolve(__dirname, '..', '..');
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
return
|
|
13
|
+
return undefined;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
async function getLocalPackageDir() {
|
|
@@ -25,7 +25,7 @@ async function getLocalPackageDir() {
|
|
|
25
25
|
// Right now we always take the first one, but in the future this may be different
|
|
26
26
|
// once we come up with more / better criteria to identify if its a good/valid
|
|
27
27
|
// plugin root directory
|
|
28
|
-
for (const dir of proposedDirs) {
|
|
28
|
+
for (const dir of proposedDirs.filter(Boolean)) {
|
|
29
29
|
log('generalDebug_0003', `Checking for potential plugin directory "${dir}" ...`);
|
|
30
30
|
|
|
31
31
|
if (await isDirectory(dir)) {
|