piral-cli 0.14.28-beta.4360 → 0.14.28
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/common/npm.d.ts +1 -0
- package/lib/common/npm.js +15 -1
- package/lib/common/npm.js.map +1 -1
- package/lib/common/scaffold.js +1 -1
- package/lib/common/scaffold.js.map +1 -1
- package/lib/external/index.js +1174 -1865
- package/package.json +2 -2
- package/src/common/npm.ts +17 -1
- package/src/common/scaffold.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-cli",
|
|
3
|
-
"version": "0.14.28
|
|
3
|
+
"version": "0.14.28",
|
|
4
4
|
"description": "The standard CLI for creating and building a Piral instance or a Pilet.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"portal",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"typescript": "^4.0.2",
|
|
80
80
|
"yargs": "^15.4.1"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "d76ab003556bd113dd00fd41af144411ae974b6c"
|
|
83
83
|
}
|
package/src/common/npm.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { createReadStream, existsSync } from 'fs';
|
|
|
3
3
|
import { log, fail } from './log';
|
|
4
4
|
import { clients, detectClients, isWrapperClient } from './clients';
|
|
5
5
|
import { config } from './config';
|
|
6
|
-
import { legacyCoreExternals, frameworkLibs } from './constants';
|
|
6
|
+
import { legacyCoreExternals, frameworkLibs, defaultRegistry } from './constants';
|
|
7
7
|
import { inspectPackage } from './inspect';
|
|
8
8
|
import { readJson, checkExists } from './io';
|
|
9
9
|
import { clientTypeKeys } from '../helpers';
|
|
@@ -125,6 +125,22 @@ export function installNpmDependencies(client: NpmClientType, target = '.'): Pro
|
|
|
125
125
|
return installDependencies(target);
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
+
export async function installNpmPackageFromOptionalRegistry(
|
|
129
|
+
packageRef: string,
|
|
130
|
+
target = '.',
|
|
131
|
+
registry: string,
|
|
132
|
+
): Promise<void> {
|
|
133
|
+
try {
|
|
134
|
+
await installNpmPackage('npm', packageRef, target, '--registry', registry);
|
|
135
|
+
} catch (e) {
|
|
136
|
+
if (registry === defaultRegistry) {
|
|
137
|
+
throw e;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
await installNpmPackage('npm', packageRef, target, '--registry', defaultRegistry);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
128
144
|
export async function installNpmPackage(
|
|
129
145
|
client: NpmClientType,
|
|
130
146
|
packageRef: string,
|
package/src/common/scaffold.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { join, dirname, resolve, basename, isAbsolute } from 'path';
|
|
2
|
-
import {
|
|
2
|
+
import { installNpmPackageFromOptionalRegistry } from './npm';
|
|
3
3
|
import { ForceOverwrite, SourceLanguage } from './enums';
|
|
4
4
|
import { createDirectory, createFileIfNotExists, updateExistingJson } from './io';
|
|
5
5
|
import { log, fail } from './log';
|
|
@@ -40,7 +40,7 @@ async function getTemplateFiles(
|
|
|
40
40
|
templatePackageName = `${templatePackageName}@latest`;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
await
|
|
43
|
+
await installNpmPackageFromOptionalRegistry(templatePackageName, __dirname, registry);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
const templateRunner = getTemplatePackage(templatePackageName);
|