piral-cli 1.7.2-beta.7548 → 1.7.3-beta.7564
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/add-piral-instance-pilet.d.ts +8 -0
- package/lib/apps/add-piral-instance-pilet.js +6 -2
- package/lib/apps/add-piral-instance-pilet.js.map +1 -1
- package/lib/apps/new-pilet.d.ts +8 -0
- package/lib/apps/new-pilet.js +6 -2
- package/lib/apps/new-pilet.js.map +1 -1
- package/lib/apps/publish-pilet.d.ts +4 -0
- package/lib/apps/publish-pilet.js +9 -7
- package/lib/apps/publish-pilet.js.map +1 -1
- package/lib/apps/publish-piral.d.ts +4 -0
- package/lib/apps/publish-piral.js +6 -4
- package/lib/apps/publish-piral.js.map +1 -1
- package/lib/apps/run-emulator-piral.d.ts +8 -0
- package/lib/apps/run-emulator-piral.js +7 -5
- package/lib/apps/run-emulator-piral.js.map +1 -1
- package/lib/apps/upgrade-pilet.d.ts +8 -0
- package/lib/apps/upgrade-pilet.js +7 -3
- package/lib/apps/upgrade-pilet.js.map +1 -1
- package/lib/commands.js +40 -0
- package/lib/commands.js.map +1 -1
- package/lib/common/config.d.ts +4 -0
- package/lib/common/config.js +1 -0
- package/lib/common/config.js.map +1 -1
- package/lib/common/http.d.ts +9 -3
- package/lib/common/http.js +24 -8
- package/lib/common/http.js.map +1 -1
- package/lib/common/package.d.ts +5 -3
- package/lib/common/package.js +7 -7
- package/lib/common/package.js.map +1 -1
- package/lib/common/release.d.ts +2 -1
- package/lib/common/release.js +2 -2
- package/lib/common/release.js.map +1 -1
- package/lib/common/shell.d.ts +3 -1
- package/lib/common/shell.js +2 -2
- package/lib/common/shell.js.map +1 -1
- package/lib/common/website.d.ts +4 -2
- package/lib/common/website.js +6 -11
- package/lib/common/website.js.map +1 -1
- package/package.json +2 -2
- package/src/apps/add-piral-instance-pilet.ts +20 -1
- package/src/apps/new-pilet.ts +19 -1
- package/src/apps/publish-pilet.ts +17 -7
- package/src/apps/publish-piral.ts +13 -4
- package/src/apps/run-emulator-piral.ts +22 -6
- package/src/apps/upgrade-pilet.ts +21 -2
- package/src/commands.ts +41 -1
- package/src/common/config.ts +5 -0
- package/src/common/http.test.ts +5 -4
- package/src/common/http.ts +26 -7
- package/src/common/package.ts +10 -11
- package/src/common/release.ts +3 -2
- package/src/common/shell.ts +3 -1
- package/src/common/website.ts +7 -11
package/lib/common/website.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.scaffoldFromEmulatorWebsite = exports.updateFromEmulatorWebsite = void 0;
|
|
4
|
-
const https_1 = require("https");
|
|
5
4
|
const path_1 = require("path");
|
|
6
5
|
const template_1 = require("./template");
|
|
7
6
|
const http_1 = require("./http");
|
|
@@ -12,7 +11,7 @@ const io_1 = require("./io");
|
|
|
12
11
|
const io_2 = require("./io");
|
|
13
12
|
const log_1 = require("./log");
|
|
14
13
|
const external_1 = require("../external");
|
|
15
|
-
async function requestManifest(url,
|
|
14
|
+
async function requestManifest(url, httpsAgent, interactive) {
|
|
16
15
|
const opts = (0, http_1.getAxiosOptions)(url);
|
|
17
16
|
try {
|
|
18
17
|
return await external_1.axios.default.get(url, { ...opts, httpsAgent });
|
|
@@ -27,7 +26,7 @@ async function requestManifest(url, interactive, httpsAgent) {
|
|
|
27
26
|
value: headers.authorization,
|
|
28
27
|
},
|
|
29
28
|
});
|
|
30
|
-
return await requestManifest(url,
|
|
29
|
+
return await requestManifest(url, httpsAgent, false);
|
|
31
30
|
});
|
|
32
31
|
}
|
|
33
32
|
}
|
|
@@ -81,12 +80,10 @@ async function createEmulatorFiles(targetDir, appDir, manifestUrl, emulatorJson,
|
|
|
81
80
|
});
|
|
82
81
|
await downloadEmulatorFiles(manifestUrl, targetDir, appDir, emulatorJson.files, httpsAgent);
|
|
83
82
|
}
|
|
84
|
-
async function updateFromEmulatorWebsite(targetDir, manifestUrl, interactive) {
|
|
83
|
+
async function updateFromEmulatorWebsite(targetDir, manifestUrl, httpsAgent, interactive) {
|
|
85
84
|
(0, log_1.progress)(`Updating emulator from %s ...`, manifestUrl);
|
|
86
|
-
const ca = await (0, http_1.getCertificate)();
|
|
87
|
-
const httpsAgent = ca ? new https_1.Agent({ ca }) : undefined;
|
|
88
85
|
try {
|
|
89
|
-
const response = await requestManifest(manifestUrl,
|
|
86
|
+
const response = await requestManifest(manifestUrl, httpsAgent, interactive);
|
|
90
87
|
const nextEmulator = response.data;
|
|
91
88
|
const currentEmulator = await (0, io_1.readJson)(targetDir, constants_1.packageJson);
|
|
92
89
|
if (currentEmulator.name !== nextEmulator.name) {
|
|
@@ -107,12 +104,10 @@ async function updateFromEmulatorWebsite(targetDir, manifestUrl, interactive) {
|
|
|
107
104
|
}
|
|
108
105
|
}
|
|
109
106
|
exports.updateFromEmulatorWebsite = updateFromEmulatorWebsite;
|
|
110
|
-
async function scaffoldFromEmulatorWebsite(rootDir, manifestUrl) {
|
|
107
|
+
async function scaffoldFromEmulatorWebsite(rootDir, manifestUrl, httpsAgent) {
|
|
111
108
|
(0, log_1.progress)(`Downloading emulator from %s ...`, manifestUrl);
|
|
112
|
-
const ca = await (0, http_1.getCertificate)();
|
|
113
|
-
const httpsAgent = ca ? new https_1.Agent({ ca }) : undefined;
|
|
114
109
|
const interactive = (0, external_1.isInteractive)();
|
|
115
|
-
const response = await requestManifest(manifestUrl,
|
|
110
|
+
const response = await requestManifest(manifestUrl, httpsAgent, interactive);
|
|
116
111
|
const emulatorJson = response.data;
|
|
117
112
|
const targetDir = (0, path_1.resolve)(rootDir, 'node_modules', emulatorJson.name);
|
|
118
113
|
const appDir = (0, path_1.resolve)(targetDir, 'app');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"website.js","sourceRoot":"","sources":["../../src/common/website.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"website.js","sourceRoot":"","sources":["../../src/common/website.ts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,EAAC,OAAO,EAAE,cAAc,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IACtE,MAAM,MAAM,GAAG,IAAA,cAAO,EAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IACzC,MAAM,IAAA,oBAAe,EAAC,MAAM,CAAC,CAAC;IAC9B,MAAM,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;IACpF,OAAO,EAAE,IAAI,EAAE,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;AACtD,CAAC;AAVD,kEAUC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-cli",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.3-beta.7564",
|
|
4
4
|
"description": "The standard CLI for creating and building a Piral instance or a Pilet.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"portal",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"typescript": "^5.0.0",
|
|
82
82
|
"yargs": "^15.0.0"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "936744c565691e81a9e3ce914803c42ba369879c"
|
|
85
85
|
}
|
|
@@ -16,6 +16,9 @@ import {
|
|
|
16
16
|
checkAppShellPackage,
|
|
17
17
|
ForceOverwrite,
|
|
18
18
|
copyPiralFiles,
|
|
19
|
+
config,
|
|
20
|
+
getCertificate,
|
|
21
|
+
getAgent,
|
|
19
22
|
} from '../common';
|
|
20
23
|
|
|
21
24
|
export interface AddPiralInstancePiletOptions {
|
|
@@ -39,6 +42,16 @@ export interface AddPiralInstancePiletOptions {
|
|
|
39
42
|
*/
|
|
40
43
|
selected?: boolean;
|
|
41
44
|
|
|
45
|
+
/**
|
|
46
|
+
* Defines a custom certificate for the website emulator.
|
|
47
|
+
*/
|
|
48
|
+
cert?: string;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Allow self-signed certificates.
|
|
52
|
+
*/
|
|
53
|
+
allowSelfSigned?: boolean;
|
|
54
|
+
|
|
42
55
|
/**
|
|
43
56
|
* The npm client to be used when scaffolding.
|
|
44
57
|
* @example 'yarn'
|
|
@@ -52,6 +65,8 @@ export const addPiralInstancePiletDefaults: AddPiralInstancePiletOptions = {
|
|
|
52
65
|
source: '.',
|
|
53
66
|
selected: false,
|
|
54
67
|
npmClient: undefined,
|
|
68
|
+
cert: undefined,
|
|
69
|
+
allowSelfSigned: config.allowSelfSigned,
|
|
55
70
|
};
|
|
56
71
|
|
|
57
72
|
export async function addPiralInstancePilet(baseDir = process.cwd(), options: AddPiralInstancePiletOptions = {}) {
|
|
@@ -61,6 +76,8 @@ export async function addPiralInstancePilet(baseDir = process.cwd(), options: Ad
|
|
|
61
76
|
source = addPiralInstancePiletDefaults.source,
|
|
62
77
|
selected = addPiralInstancePiletDefaults.selected,
|
|
63
78
|
app = addPiralInstancePiletDefaults.app,
|
|
79
|
+
cert = addPiralInstancePiletDefaults.cert,
|
|
80
|
+
allowSelfSigned = addPiralInstancePiletDefaults.allowSelfSigned,
|
|
64
81
|
} = options;
|
|
65
82
|
|
|
66
83
|
ensure('baseDir', baseDir, 'string');
|
|
@@ -72,6 +89,8 @@ export async function addPiralInstancePilet(baseDir = process.cwd(), options: Ad
|
|
|
72
89
|
|
|
73
90
|
const npmClient = await determineNpmClient(fullBase, defaultNpmClient);
|
|
74
91
|
const allEntries = await matchAnyPilet(fullBase, [source]);
|
|
92
|
+
const ca = await getCertificate(cert);
|
|
93
|
+
const agent = getAgent({ ca, allowSelfSigned });
|
|
75
94
|
|
|
76
95
|
const tasks = allEntries.map(async (entryModule) => {
|
|
77
96
|
const targetDir = dirname(entryModule);
|
|
@@ -80,7 +99,7 @@ export async function addPiralInstancePilet(baseDir = process.cwd(), options: Ad
|
|
|
80
99
|
if (piletJsonPath) {
|
|
81
100
|
const piletJsonDir = dirname(piletJsonPath);
|
|
82
101
|
const root = await findPiletRoot(piletJsonDir);
|
|
83
|
-
const packageName = await installPiralInstance(app, fullBase, root, npmClient, selected);
|
|
102
|
+
const packageName = await installPiralInstance(app, fullBase, root, npmClient, agent, selected);
|
|
84
103
|
const piralInfo = await readPiralPackage(root, packageName);
|
|
85
104
|
const isEmulator = checkAppShellPackage(piralInfo);
|
|
86
105
|
|
package/src/apps/new-pilet.ts
CHANGED
|
@@ -29,6 +29,8 @@ import {
|
|
|
29
29
|
defaultSchemaVersion,
|
|
30
30
|
piletJsonSchemaUrl,
|
|
31
31
|
ensure,
|
|
32
|
+
getCertificate,
|
|
33
|
+
getAgent,
|
|
32
34
|
} from '../common';
|
|
33
35
|
|
|
34
36
|
export interface NewPiletOptions {
|
|
@@ -47,6 +49,16 @@ export interface NewPiletOptions {
|
|
|
47
49
|
*/
|
|
48
50
|
source?: string;
|
|
49
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Defines a custom certificate for the website emulator.
|
|
54
|
+
*/
|
|
55
|
+
cert?: string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Allow self-signed certificates.
|
|
59
|
+
*/
|
|
60
|
+
allowSelfSigned?: boolean;
|
|
61
|
+
|
|
50
62
|
/**
|
|
51
63
|
* Determines if files should be overwritten by the scaffolding.
|
|
52
64
|
*/
|
|
@@ -110,6 +122,8 @@ export const newPiletDefaults: NewPiletOptions = {
|
|
|
110
122
|
bundlerName: 'none',
|
|
111
123
|
variables: {},
|
|
112
124
|
name: undefined,
|
|
125
|
+
cert: undefined,
|
|
126
|
+
allowSelfSigned: config.allowSelfSigned,
|
|
113
127
|
};
|
|
114
128
|
|
|
115
129
|
export async function newPilet(baseDir = process.cwd(), options: NewPiletOptions = {}) {
|
|
@@ -126,6 +140,8 @@ export async function newPilet(baseDir = process.cwd(), options: NewPiletOptions
|
|
|
126
140
|
variables = newPiletDefaults.variables,
|
|
127
141
|
npmClient: defaultNpmClient = newPiletDefaults.npmClient,
|
|
128
142
|
name = newPiletDefaults.name,
|
|
143
|
+
cert = newPiletDefaults.cert,
|
|
144
|
+
allowSelfSigned = newPiletDefaults.allowSelfSigned,
|
|
129
145
|
} = options;
|
|
130
146
|
|
|
131
147
|
ensure('baseDir', baseDir, 'string');
|
|
@@ -142,6 +158,8 @@ export async function newPilet(baseDir = process.cwd(), options: NewPiletOptions
|
|
|
142
158
|
|
|
143
159
|
if (success) {
|
|
144
160
|
const npmClient = await determineNpmClient(root, defaultNpmClient);
|
|
161
|
+
const ca = await getCertificate(cert);
|
|
162
|
+
const agent = getAgent({ ca, allowSelfSigned });
|
|
145
163
|
const projectName = name || basename(root);
|
|
146
164
|
|
|
147
165
|
progress(`Scaffolding new pilet in %s ...`, root);
|
|
@@ -196,7 +214,7 @@ always-auth=true`,
|
|
|
196
214
|
);
|
|
197
215
|
|
|
198
216
|
const sourceName = source || `empty-piral@${cliVersion}`;
|
|
199
|
-
const packageName = await installPiralInstance(sourceName, fullBase, root, npmClient, true);
|
|
217
|
+
const packageName = await installPiralInstance(sourceName, fullBase, root, npmClient, agent, true);
|
|
200
218
|
const piralInfo = await readPiralPackage(root, packageName);
|
|
201
219
|
const isEmulator = checkAppShellPackage(piralInfo);
|
|
202
220
|
const { preScaffold, postScaffold, files, template: preSelectedTemplate } = getPiletsInfo(piralInfo);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Agent } from 'https';
|
|
1
2
|
import { relative, resolve } from 'path';
|
|
2
3
|
import { LogLevels, PiletSchemaVersion, PiletPublishSource, PublishScheme } from '../types';
|
|
3
4
|
import {
|
|
@@ -17,6 +18,7 @@ import {
|
|
|
17
18
|
triggerBuildPilet,
|
|
18
19
|
getCertificate,
|
|
19
20
|
ensure,
|
|
21
|
+
getAgent,
|
|
20
22
|
} from '../common';
|
|
21
23
|
|
|
22
24
|
export interface PublishPiletOptions {
|
|
@@ -52,6 +54,11 @@ export interface PublishPiletOptions {
|
|
|
52
54
|
* Defines a custom certificate for the feed service.
|
|
53
55
|
*/
|
|
54
56
|
cert?: string;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Allow self-signed certificates.
|
|
60
|
+
*/
|
|
61
|
+
allowSelfSigned?: boolean;
|
|
55
62
|
|
|
56
63
|
/**
|
|
57
64
|
* Sets the schema version of the pilet. Usually, the default one should be picked.
|
|
@@ -110,7 +117,6 @@ export const publishPiletDefaults: PublishPiletOptions = {
|
|
|
110
117
|
url: undefined,
|
|
111
118
|
apiKey: undefined,
|
|
112
119
|
fresh: false,
|
|
113
|
-
cert: undefined,
|
|
114
120
|
logLevel: LogLevels.info,
|
|
115
121
|
schemaVersion: undefined,
|
|
116
122
|
mode: 'basic',
|
|
@@ -118,6 +124,8 @@ export const publishPiletDefaults: PublishPiletOptions = {
|
|
|
118
124
|
fields: {},
|
|
119
125
|
headers: {},
|
|
120
126
|
interactive: false,
|
|
127
|
+
cert: undefined,
|
|
128
|
+
allowSelfSigned: config.allowSelfSigned,
|
|
121
129
|
};
|
|
122
130
|
|
|
123
131
|
async function getFiles(
|
|
@@ -129,7 +137,7 @@ async function getFiles(
|
|
|
129
137
|
logLevel: LogLevels,
|
|
130
138
|
bundlerName: string,
|
|
131
139
|
_?: Record<string, any>,
|
|
132
|
-
|
|
140
|
+
agent?: Agent,
|
|
133
141
|
hooks?: PublishPiletOptions['hooks'],
|
|
134
142
|
): Promise<Array<string>> {
|
|
135
143
|
if (fresh) {
|
|
@@ -181,14 +189,14 @@ async function getFiles(
|
|
|
181
189
|
}
|
|
182
190
|
case 'remote': {
|
|
183
191
|
log('generalDebug_0003', `Download file from "${sources.join('", "')}".`);
|
|
184
|
-
const allFiles = await Promise.all(sources.map((s) => downloadFile(s,
|
|
192
|
+
const allFiles = await Promise.all(sources.map((s) => downloadFile(s, agent)));
|
|
185
193
|
return allFiles.reduce((result, files) => [...result, ...files], []);
|
|
186
194
|
}
|
|
187
195
|
case 'npm': {
|
|
188
196
|
log('generalDebug_0003', `View npm package "${sources.join('", "')}".`);
|
|
189
197
|
const allUrls = await Promise.all(sources.map((s) => findNpmTarball(s)));
|
|
190
198
|
log('generalDebug_0003', `Download file from "${allUrls.join('", "')}".`);
|
|
191
|
-
const allFiles = await Promise.all(allUrls.map((url) => downloadFile(url,
|
|
199
|
+
const allFiles = await Promise.all(allUrls.map((url) => downloadFile(url, agent)));
|
|
192
200
|
return allFiles.reduce((result, files) => [...result, ...files], []);
|
|
193
201
|
}
|
|
194
202
|
}
|
|
@@ -204,11 +212,12 @@ export async function publishPilet(baseDir = process.cwd(), options: PublishPile
|
|
|
204
212
|
logLevel = publishPiletDefaults.logLevel,
|
|
205
213
|
from = publishPiletDefaults.from,
|
|
206
214
|
schemaVersion = publishPiletDefaults.schemaVersion,
|
|
207
|
-
cert = publishPiletDefaults.cert,
|
|
208
215
|
fields = publishPiletDefaults.fields,
|
|
209
216
|
headers = publishPiletDefaults.headers,
|
|
210
217
|
mode = publishPiletDefaults.mode,
|
|
211
218
|
interactive = publishPiletDefaults.interactive,
|
|
219
|
+
cert = publishPiletDefaults.cert,
|
|
220
|
+
allowSelfSigned = publishPiletDefaults.allowSelfSigned,
|
|
212
221
|
_ = {},
|
|
213
222
|
hooks = {},
|
|
214
223
|
bundlerName,
|
|
@@ -229,10 +238,11 @@ export async function publishPilet(baseDir = process.cwd(), options: PublishPile
|
|
|
229
238
|
}
|
|
230
239
|
|
|
231
240
|
const ca = await getCertificate(cert);
|
|
241
|
+
const agent = getAgent({ ca, allowSelfSigned });
|
|
232
242
|
|
|
233
243
|
log('generalDebug_0003', 'Getting the tgz files ...');
|
|
234
244
|
const sources = Array.isArray(source) ? source : [source];
|
|
235
|
-
const files = await getFiles(fullBase, sources, from, fresh, schemaVersion, logLevel, bundlerName, _,
|
|
245
|
+
const files = await getFiles(fullBase, sources, from, fresh, schemaVersion, logLevel, bundlerName, _, agent, hooks);
|
|
236
246
|
const successfulUploads: Array<string> = [];
|
|
237
247
|
log('generalDebug_0003', 'Received available tgz files.');
|
|
238
248
|
|
|
@@ -249,7 +259,7 @@ export async function publishPilet(baseDir = process.cwd(), options: PublishPile
|
|
|
249
259
|
|
|
250
260
|
if (content) {
|
|
251
261
|
progress(`Publishing "%s" to "%s" ...`, file, url);
|
|
252
|
-
const result = await postFile(url, mode, apiKey, content, fields, headers,
|
|
262
|
+
const result = await postFile(url, mode, apiKey, content, fields, headers, agent, interactive);
|
|
253
263
|
|
|
254
264
|
if (result.success) {
|
|
255
265
|
successfulUploads.push(file);
|
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
triggerBuildShell,
|
|
26
26
|
publishPackageEmulator,
|
|
27
27
|
ensure,
|
|
28
|
+
getAgent,
|
|
28
29
|
} from '../common';
|
|
29
30
|
|
|
30
31
|
export interface PublishPiralOptions {
|
|
@@ -58,6 +59,11 @@ export interface PublishPiralOptions {
|
|
|
58
59
|
* Defines a custom certificate for the feed service.
|
|
59
60
|
*/
|
|
60
61
|
cert?: string;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Allow self-signed certificates.
|
|
65
|
+
*/
|
|
66
|
+
allowSelfSigned?: boolean;
|
|
61
67
|
|
|
62
68
|
/**
|
|
63
69
|
* Places additional headers that should be posted to the feed service.
|
|
@@ -107,10 +113,11 @@ export const publishPiralDefaults: PublishPiralOptions = {
|
|
|
107
113
|
interactive: false,
|
|
108
114
|
apiKey: undefined,
|
|
109
115
|
fresh: false,
|
|
110
|
-
cert: undefined,
|
|
111
116
|
mode: 'basic',
|
|
112
117
|
headers: {},
|
|
113
118
|
type: 'emulator',
|
|
119
|
+
cert: undefined,
|
|
120
|
+
allowSelfSigned: config.allowSelfSigned,
|
|
114
121
|
};
|
|
115
122
|
|
|
116
123
|
export async function publishPiral(baseDir = process.cwd(), options: PublishPiralOptions = {}) {
|
|
@@ -121,10 +128,11 @@ export async function publishPiral(baseDir = process.cwd(), options: PublishPira
|
|
|
121
128
|
fresh = publishPiralDefaults.fresh,
|
|
122
129
|
url = config.url ?? publishPiralDefaults.url,
|
|
123
130
|
apiKey = config.apiKeys?.[url] ?? config.apiKey ?? publishPiralDefaults.apiKey,
|
|
124
|
-
cert = publishPiralDefaults.cert,
|
|
125
131
|
headers = publishPiralDefaults.headers,
|
|
126
132
|
mode = publishPiralDefaults.mode,
|
|
127
133
|
type = publishPiralDefaults.type,
|
|
134
|
+
cert = publishPiralDefaults.cert,
|
|
135
|
+
allowSelfSigned = publishPiralDefaults.allowSelfSigned,
|
|
128
136
|
_ = {},
|
|
129
137
|
hooks = {},
|
|
130
138
|
bundlerName,
|
|
@@ -144,6 +152,7 @@ export async function publishPiral(baseDir = process.cwd(), options: PublishPira
|
|
|
144
152
|
}
|
|
145
153
|
|
|
146
154
|
const ca = await getCertificate(cert);
|
|
155
|
+
const agent = getAgent({ ca, allowSelfSigned });
|
|
147
156
|
|
|
148
157
|
log('generalDebug_0003', 'Getting the files ...');
|
|
149
158
|
const entryFiles = await retrievePiralRoot(fullBase, './');
|
|
@@ -224,7 +233,7 @@ export async function publishPiral(baseDir = process.cwd(), options: PublishPira
|
|
|
224
233
|
const files = await matchFiles(targetDir, '**/*');
|
|
225
234
|
|
|
226
235
|
progress(`Publishing release artifacts to "%s" ...`, url);
|
|
227
|
-
const result = await publishWebsiteEmulator(version, url, apiKey, mode, targetDir, files, interactive, headers,
|
|
236
|
+
const result = await publishWebsiteEmulator(version, url, apiKey, mode, targetDir, files, interactive, headers, agent);
|
|
228
237
|
|
|
229
238
|
if (!result.success) {
|
|
230
239
|
fail('failedUploading_0064');
|
|
@@ -249,7 +258,7 @@ export async function publishPiral(baseDir = process.cwd(), options: PublishPira
|
|
|
249
258
|
const files = await matchFiles(targetDir, '**/*');
|
|
250
259
|
|
|
251
260
|
progress(`Publishing emulator to "%s" ...`, url);
|
|
252
|
-
const result = await publishWebsiteEmulator(version, url, apiKey, mode, targetDir, files, interactive, headers,
|
|
261
|
+
const result = await publishWebsiteEmulator(version, url, apiKey, mode, targetDir, files, interactive, headers, agent);
|
|
253
262
|
|
|
254
263
|
if (!result.success) {
|
|
255
264
|
fail('failedUploading_0064');
|
|
@@ -18,6 +18,8 @@ import {
|
|
|
18
18
|
findPiralInstance,
|
|
19
19
|
determineNpmClient,
|
|
20
20
|
ensure,
|
|
21
|
+
getCertificate,
|
|
22
|
+
getAgent,
|
|
21
23
|
} from '../common';
|
|
22
24
|
|
|
23
25
|
export interface RunEmulatorPiralOptions {
|
|
@@ -61,6 +63,16 @@ export interface RunEmulatorPiralOptions {
|
|
|
61
63
|
* The package registry to use for resolving the specified Piral app.
|
|
62
64
|
*/
|
|
63
65
|
registry?: string;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Defines a custom certificate for the website emulator.
|
|
69
|
+
*/
|
|
70
|
+
cert?: string;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Allow self-signed certificates.
|
|
74
|
+
*/
|
|
75
|
+
allowSelfSigned?: boolean;
|
|
64
76
|
}
|
|
65
77
|
|
|
66
78
|
export const runEmulatorPiralDefaults: RunEmulatorPiralOptions = {
|
|
@@ -70,6 +82,8 @@ export const runEmulatorPiralDefaults: RunEmulatorPiralOptions = {
|
|
|
70
82
|
strictPort: config.strictPort,
|
|
71
83
|
registry: config.registry,
|
|
72
84
|
npmClient: undefined,
|
|
85
|
+
cert: undefined,
|
|
86
|
+
allowSelfSigned: config.allowSelfSigned,
|
|
73
87
|
};
|
|
74
88
|
|
|
75
89
|
function createTempDir() {
|
|
@@ -94,13 +108,15 @@ export async function runEmulatorPiral(baseDir = process.cwd(), options: RunEmul
|
|
|
94
108
|
logLevel = runEmulatorPiralDefaults.logLevel,
|
|
95
109
|
npmClient: defaultNpmClient = runEmulatorPiralDefaults.npmClient,
|
|
96
110
|
registry = runEmulatorPiralDefaults.registry,
|
|
111
|
+
cert = runEmulatorPiralDefaults.cert,
|
|
112
|
+
allowSelfSigned = runEmulatorPiralDefaults.allowSelfSigned,
|
|
97
113
|
app,
|
|
98
114
|
feed,
|
|
99
115
|
} = options;
|
|
100
|
-
|
|
116
|
+
|
|
101
117
|
ensure('baseDir', baseDir, 'string');
|
|
102
118
|
ensure('app', app, 'string');
|
|
103
|
-
|
|
119
|
+
|
|
104
120
|
const publicUrl = '/';
|
|
105
121
|
const api = config.piletApi;
|
|
106
122
|
const fullBase = resolve(process.cwd(), baseDir);
|
|
@@ -114,6 +130,8 @@ export async function runEmulatorPiral(baseDir = process.cwd(), options: RunEmul
|
|
|
114
130
|
process.stdin?.setMaxListeners(16);
|
|
115
131
|
|
|
116
132
|
const appRoot = await createTempDir();
|
|
133
|
+
const ca = await getCertificate(cert);
|
|
134
|
+
const agent = getAgent({ ca, allowSelfSigned });
|
|
117
135
|
|
|
118
136
|
if (registry !== runEmulatorPiralDefaults.registry) {
|
|
119
137
|
progress(`Setting up npm registry (%s) ...`, registry);
|
|
@@ -128,10 +146,8 @@ always-auth=true`,
|
|
|
128
146
|
}
|
|
129
147
|
|
|
130
148
|
const npmClient = await determineNpmClient(appRoot, defaultNpmClient);
|
|
131
|
-
const packageName = await installPiralInstance(app, fullBase, appRoot, npmClient);
|
|
132
|
-
const piral = await findPiralInstance(packageName, appRoot, {
|
|
133
|
-
port: originalPort,
|
|
134
|
-
});
|
|
149
|
+
const packageName = await installPiralInstance(app, fullBase, appRoot, npmClient, agent);
|
|
150
|
+
const piral = await findPiralInstance(packageName, appRoot, { port: originalPort }, agent);
|
|
135
151
|
const port = await getAvailablePort(piral.port, strictPort);
|
|
136
152
|
|
|
137
153
|
const krasBaseConfig = resolve(fullBase, krasrc);
|
|
@@ -26,6 +26,9 @@ import {
|
|
|
26
26
|
getPiletScaffoldData,
|
|
27
27
|
retrievePiletData,
|
|
28
28
|
ensure,
|
|
29
|
+
config,
|
|
30
|
+
getCertificate,
|
|
31
|
+
getAgent,
|
|
29
32
|
} from '../common';
|
|
30
33
|
|
|
31
34
|
export interface UpgradePiletOptions {
|
|
@@ -58,6 +61,16 @@ export interface UpgradePiletOptions {
|
|
|
58
61
|
*/
|
|
59
62
|
install?: boolean;
|
|
60
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Defines a custom certificate for the website emulator.
|
|
66
|
+
*/
|
|
67
|
+
cert?: string;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Allow self-signed certificates.
|
|
71
|
+
*/
|
|
72
|
+
allowSelfSigned?: boolean;
|
|
73
|
+
|
|
61
74
|
/**
|
|
62
75
|
* Defines the used npm client. By default, "npm" is used
|
|
63
76
|
* if no other client is autodetected. The autodetection
|
|
@@ -79,6 +92,8 @@ export const upgradePiletDefaults: UpgradePiletOptions = {
|
|
|
79
92
|
install: true,
|
|
80
93
|
npmClient: undefined,
|
|
81
94
|
variables: {},
|
|
95
|
+
cert: undefined,
|
|
96
|
+
allowSelfSigned: config.allowSelfSigned,
|
|
82
97
|
};
|
|
83
98
|
|
|
84
99
|
export async function upgradePilet(baseDir = process.cwd(), options: UpgradePiletOptions = {}) {
|
|
@@ -90,6 +105,8 @@ export async function upgradePilet(baseDir = process.cwd(), options: UpgradePile
|
|
|
90
105
|
install = upgradePiletDefaults.install,
|
|
91
106
|
variables = upgradePiletDefaults.variables,
|
|
92
107
|
npmClient: defaultNpmClient = upgradePiletDefaults.npmClient,
|
|
108
|
+
cert = upgradePiletDefaults.cert,
|
|
109
|
+
allowSelfSigned = upgradePiletDefaults.allowSelfSigned,
|
|
93
110
|
} = options;
|
|
94
111
|
|
|
95
112
|
ensure('baseDir', baseDir, 'string');
|
|
@@ -106,10 +123,12 @@ export async function upgradePilet(baseDir = process.cwd(), options: UpgradePile
|
|
|
106
123
|
}
|
|
107
124
|
|
|
108
125
|
const npmClient = await determineNpmClient(root, defaultNpmClient);
|
|
126
|
+
const ca = await getCertificate(cert);
|
|
127
|
+
const agent = getAgent({ ca, allowSelfSigned });
|
|
109
128
|
|
|
110
129
|
// in case we run from a user's CLI we want to allow updating
|
|
111
130
|
const interactive = isInteractive();
|
|
112
|
-
const { apps, piletPackage } = await retrievePiletData(root, undefined, interactive);
|
|
131
|
+
const { apps, piletPackage } = await retrievePiletData(root, undefined, agent, interactive);
|
|
113
132
|
const { devDependencies = {}, dependencies = {}, source } = piletPackage;
|
|
114
133
|
|
|
115
134
|
if (apps.length === 0) {
|
|
@@ -144,7 +163,7 @@ export async function upgradePilet(baseDir = process.cwd(), options: UpgradePile
|
|
|
144
163
|
if (!monorepoRef) {
|
|
145
164
|
// only install the latest if the shell does come from remote
|
|
146
165
|
progress(`Updating npm package to %s ...`, packageRef);
|
|
147
|
-
await installNpmPackage(npmClient, packageRef, root
|
|
166
|
+
await installNpmPackage(npmClient, packageRef, root);
|
|
148
167
|
}
|
|
149
168
|
|
|
150
169
|
const piralInfo = await readPiralPackage(root, sourceName);
|
package/src/commands.ts
CHANGED
|
@@ -218,6 +218,9 @@ const allCommands: Array<ToolCommand<any>> = [
|
|
|
218
218
|
.string('ca-cert')
|
|
219
219
|
.describe('ca-cert', 'Sets a custom certificate authority to use, if any.')
|
|
220
220
|
.default('ca-cert', apps.publishPiralDefaults.cert)
|
|
221
|
+
.boolean('allow-self-signed')
|
|
222
|
+
.describe('allow-self-signed', 'Indicates that self-signed certificates should be allowed.')
|
|
223
|
+
.default('allow-self-signed', apps.publishPiralDefaults.allowSelfSigned)
|
|
221
224
|
.number('log-level')
|
|
222
225
|
.describe('log-level', 'Sets the log level to use (1-5).')
|
|
223
226
|
.default('log-level', apps.publishPiralDefaults.logLevel)
|
|
@@ -250,6 +253,7 @@ const allCommands: Array<ToolCommand<any>> = [
|
|
|
250
253
|
logLevel: args['log-level'] as LogLevels,
|
|
251
254
|
apiKey: args['api-key'] as string,
|
|
252
255
|
cert: args['ca-cert'] as string,
|
|
256
|
+
allowSelfSigned: args['allow-self-signed'] as boolean,
|
|
253
257
|
url: args.url as string,
|
|
254
258
|
interactive: args.interactive as boolean,
|
|
255
259
|
mode: args.mode as PublishScheme,
|
|
@@ -687,6 +691,9 @@ const allCommands: Array<ToolCommand<any>> = [
|
|
|
687
691
|
.boolean('interactive')
|
|
688
692
|
.describe('interactive', 'Defines if authorization tokens can be retrieved interactively.')
|
|
689
693
|
.default('interactive', apps.publishPiletDefaults.interactive)
|
|
694
|
+
.boolean('allow-self-signed')
|
|
695
|
+
.describe('allow-self-signed', 'Indicates that self-signed certificates should be allowed.')
|
|
696
|
+
.default('allow-self-signed', apps.publishPiletDefaults.allowSelfSigned)
|
|
690
697
|
.string('base')
|
|
691
698
|
.default('base', process.cwd())
|
|
692
699
|
.describe('base', 'Sets the base directory. By default the current directory is used.');
|
|
@@ -698,6 +705,7 @@ const allCommands: Array<ToolCommand<any>> = [
|
|
|
698
705
|
url: args.url as string,
|
|
699
706
|
logLevel: args['log-level'] as LogLevels,
|
|
700
707
|
cert: args['ca-cert'] as string,
|
|
708
|
+
allowSelfSigned: args['allow-self-signed'] as boolean,
|
|
701
709
|
bundlerName: args.bundler as string,
|
|
702
710
|
fresh: args.fresh as boolean,
|
|
703
711
|
from: args.from as PiletPublishSource,
|
|
@@ -787,6 +795,12 @@ const allCommands: Array<ToolCommand<any>> = [
|
|
|
787
795
|
.choices('bundler', bundlerKeys)
|
|
788
796
|
.describe('bundler', 'Sets the default bundler to install.')
|
|
789
797
|
.default('bundler', apps.newPiletDefaults.bundlerName)
|
|
798
|
+
.string('ca-cert')
|
|
799
|
+
.describe('ca-cert', 'Sets a custom certificate authority to use, if any.')
|
|
800
|
+
.default('ca-cert', apps.newPiletDefaults.cert)
|
|
801
|
+
.boolean('allow-self-signed')
|
|
802
|
+
.describe('allow-self-signed', 'Indicates that self-signed certificates should be allowed.')
|
|
803
|
+
.default('allow-self-signed', apps.newPiletDefaults.allowSelfSigned)
|
|
790
804
|
.option('vars', undefined)
|
|
791
805
|
.describe('vars', 'Sets additional variables to be used when scaffolding.')
|
|
792
806
|
.default('vars', apps.newPiletDefaults.variables)
|
|
@@ -811,6 +825,8 @@ const allCommands: Array<ToolCommand<any>> = [
|
|
|
811
825
|
bundlerName: args.bundler as string,
|
|
812
826
|
variables: args.vars as Record<string, string>,
|
|
813
827
|
name: args['name'] as string,
|
|
828
|
+
cert: args['ca-cert'] as string,
|
|
829
|
+
allowSelfSigned: args['allow-self-signed'] as boolean,
|
|
814
830
|
});
|
|
815
831
|
},
|
|
816
832
|
},
|
|
@@ -819,7 +835,7 @@ const allCommands: Array<ToolCommand<any>> = [
|
|
|
819
835
|
alias: ['upgrade'],
|
|
820
836
|
description: 'Upgrades an existing pilet to the latest version of the used Piral instance.',
|
|
821
837
|
arguments: ['[target-version]'],
|
|
822
|
-
flags(argv) {
|
|
838
|
+
flags(argv: any) {
|
|
823
839
|
return argv
|
|
824
840
|
.positional('target-version', {
|
|
825
841
|
type: 'string',
|
|
@@ -842,6 +858,12 @@ const allCommands: Array<ToolCommand<any>> = [
|
|
|
842
858
|
.choices('npm-client', clientTypeKeys)
|
|
843
859
|
.describe('npm-client', 'Sets the npm client to be used when upgrading.')
|
|
844
860
|
.default('npm-client', apps.upgradePiletDefaults.npmClient)
|
|
861
|
+
.string('ca-cert')
|
|
862
|
+
.describe('ca-cert', 'Sets a custom certificate authority to use, if any.')
|
|
863
|
+
.default('ca-cert', apps.upgradePiletDefaults.cert)
|
|
864
|
+
.boolean('allow-self-signed')
|
|
865
|
+
.describe('allow-self-signed', 'Indicates that self-signed certificates should be allowed.')
|
|
866
|
+
.default('allow-self-signed', apps.upgradePiletDefaults.allowSelfSigned)
|
|
845
867
|
.option('vars', undefined)
|
|
846
868
|
.describe('vars', 'Sets additional variables to be used when scaffolding.')
|
|
847
869
|
.default('vars', apps.upgradePiletDefaults.variables)
|
|
@@ -858,6 +880,8 @@ const allCommands: Array<ToolCommand<any>> = [
|
|
|
858
880
|
install: args.install as boolean,
|
|
859
881
|
npmClient: args['npm-client'] as NpmClientType,
|
|
860
882
|
variables: args.vars as Record<string, string>,
|
|
883
|
+
cert: args['ca-cert'] as string,
|
|
884
|
+
allowSelfSigned: args['allow-self-signed'] as boolean,
|
|
861
885
|
});
|
|
862
886
|
},
|
|
863
887
|
},
|
|
@@ -916,6 +940,12 @@ const allCommands: Array<ToolCommand<any>> = [
|
|
|
916
940
|
.boolean('selected')
|
|
917
941
|
.describe('selected', 'Defines if the provided Piral instance should be selected initially.')
|
|
918
942
|
.default('selected', apps.addPiralInstancePiletDefaults.selected)
|
|
943
|
+
.string('ca-cert')
|
|
944
|
+
.describe('ca-cert', 'Sets a custom certificate authority to use, if any.')
|
|
945
|
+
.default('ca-cert', apps.addPiralInstancePiletDefaults.cert)
|
|
946
|
+
.boolean('allow-self-signed')
|
|
947
|
+
.describe('allow-self-signed', 'Indicates that self-signed certificates should be allowed.')
|
|
948
|
+
.default('allow-self-signed', apps.addPiralInstancePiletDefaults.allowSelfSigned)
|
|
919
949
|
.string('base')
|
|
920
950
|
.default('base', process.cwd())
|
|
921
951
|
.describe('base', 'Sets the base directory. By default the current directory is used.');
|
|
@@ -927,6 +957,8 @@ const allCommands: Array<ToolCommand<any>> = [
|
|
|
927
957
|
npmClient: args['npm-client'] as NpmClientType,
|
|
928
958
|
app: args.app as string,
|
|
929
959
|
source: args.source as string,
|
|
960
|
+
cert: args['ca-cert'] as string,
|
|
961
|
+
allowSelfSigned: args['allow-self-signed'] as boolean,
|
|
930
962
|
});
|
|
931
963
|
},
|
|
932
964
|
},
|
|
@@ -995,6 +1027,12 @@ const allCommands: Array<ToolCommand<any>> = [
|
|
|
995
1027
|
.choices('npm-client', clientTypeKeys)
|
|
996
1028
|
.describe('npm-client', 'Sets the npm client to be used when installing the emulator.')
|
|
997
1029
|
.default('npm-client', apps.runEmulatorPiralDefaults.npmClient)
|
|
1030
|
+
.string('ca-cert')
|
|
1031
|
+
.describe('ca-cert', 'Sets a custom certificate authority to use, if any.')
|
|
1032
|
+
.default('ca-cert', apps.runEmulatorPiralDefaults.cert)
|
|
1033
|
+
.boolean('allow-self-signed')
|
|
1034
|
+
.describe('allow-self-signed', 'Indicates that self-signed certificates should be allowed.')
|
|
1035
|
+
.default('allow-self-signed', apps.runEmulatorPiralDefaults.allowSelfSigned)
|
|
998
1036
|
.boolean('open')
|
|
999
1037
|
.describe('open', 'Opens the Piral instance directly in the browser.')
|
|
1000
1038
|
.default('open', apps.runEmulatorPiralDefaults.open)
|
|
@@ -1014,6 +1052,8 @@ const allCommands: Array<ToolCommand<any>> = [
|
|
|
1014
1052
|
logLevel: args['log-level'] as LogLevels,
|
|
1015
1053
|
open: args.open as boolean,
|
|
1016
1054
|
feed: args.feed as string,
|
|
1055
|
+
cert: args['ca-cert'] as string,
|
|
1056
|
+
allowSelfSigned: args['allow-self-signed'] as boolean,
|
|
1017
1057
|
});
|
|
1018
1058
|
},
|
|
1019
1059
|
},
|