piral-cli 0.14.3-beta.3297 → 0.14.3-beta.3299
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 +24 -8
- package/lib/apps/build-pilet.js.map +1 -1
- package/lib/helpers.js +1 -1
- package/lib/helpers.js.map +1 -1
- package/lib/types/public.d.ts +1 -1
- package/package.json +2 -2
- package/src/apps/build-pilet.ts +52 -20
- package/src/helpers.ts +1 -1
- package/src/types/public.ts +1 -1
package/lib/apps/build-pilet.js
CHANGED
|
@@ -14,6 +14,17 @@ const path_1 = require("path");
|
|
|
14
14
|
const types_1 = require("../types");
|
|
15
15
|
const bundler_1 = require("../bundler");
|
|
16
16
|
const common_1 = require("../common");
|
|
17
|
+
function createMetadata(outDir, outFile, pilets) {
|
|
18
|
+
return (0, common_1.writeJson)(outDir, outFile, pilets.map((p) => (Object.assign({ name: p.package.name, version: p.package.version, link: `./${p.id}/${p.outFile}` }, (0, common_1.getPiletSpecMeta)(p.path, p.outDir)))));
|
|
19
|
+
}
|
|
20
|
+
function copyPilets(outDir, pilets) {
|
|
21
|
+
return Promise.all(pilets.map((p) => __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const files = yield (0, common_1.getFileNames)(p.outDir);
|
|
23
|
+
for (const file of files) {
|
|
24
|
+
yield (0, common_1.copy)((0, path_1.resolve)(p.outDir, file), (0, path_1.resolve)(outDir, p.id, file), common_1.ForceOverwrite.yes);
|
|
25
|
+
}
|
|
26
|
+
})));
|
|
27
|
+
}
|
|
17
28
|
exports.buildPiletDefaults = {
|
|
18
29
|
entry: './src/index',
|
|
19
30
|
target: './dist/index.js',
|
|
@@ -96,20 +107,16 @@ function buildPilet(baseDir = process.cwd(), options = {}) {
|
|
|
96
107
|
const outDir = (0, path_1.resolve)(distDir, 'standalone');
|
|
97
108
|
const { appFile, appPackage, root } = pilets[0];
|
|
98
109
|
const isEmulator = (0, common_1.checkAppShellPackage)(appPackage);
|
|
99
|
-
(0, common_1.
|
|
110
|
+
(0, common_1.logInfo)('Building standalone solution ...');
|
|
100
111
|
yield (0, common_1.removeDirectory)(outDir);
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
yield (0, common_1.copy)((0, path_1.resolve)(p.outDir, file), (0, path_1.resolve)(outDir, p.id, file), common_1.ForceOverwrite.yes);
|
|
105
|
-
}
|
|
106
|
-
})));
|
|
112
|
+
(0, common_1.progress)('Copying files ...');
|
|
113
|
+
yield copyPilets(outDir, pilets);
|
|
114
|
+
yield createMetadata(outDir, '$pilet-api', pilets);
|
|
107
115
|
if (isEmulator) {
|
|
108
116
|
// in case of an emulator assets are not "seen" by the bundler, so we
|
|
109
117
|
// just copy overthing over - this should work in most cases.
|
|
110
118
|
yield (0, common_1.copy)((0, path_1.dirname)(appFile), outDir, common_1.ForceOverwrite.yes);
|
|
111
119
|
}
|
|
112
|
-
yield (0, common_1.writeJson)(outDir, '$pilet-api', pilets.map((p) => (Object.assign({ name: p.package.name, version: p.package.version, link: `./${p.id}/${p.outFile}` }, (0, common_1.getPiletSpecMeta)(p.path, p.outDir)))));
|
|
113
120
|
(0, common_1.progress)('Optimizing app shell ...');
|
|
114
121
|
yield (0, bundler_1.callPiralBuild)({
|
|
115
122
|
root,
|
|
@@ -131,6 +138,15 @@ function buildPilet(baseDir = process.cwd(), options = {}) {
|
|
|
131
138
|
}, bundlerName);
|
|
132
139
|
(0, common_1.logDone)(`Standalone app available at "${outDir}"!`);
|
|
133
140
|
}
|
|
141
|
+
else if (type === 'manifest') {
|
|
142
|
+
const manifest = 'pilets.json';
|
|
143
|
+
const outDir = (0, path_1.dirname)((0, path_1.resolve)(fullBase, target));
|
|
144
|
+
(0, common_1.logInfo)('Building pilet manifest ...');
|
|
145
|
+
(0, common_1.progress)('Copying files ...');
|
|
146
|
+
yield copyPilets(outDir, pilets);
|
|
147
|
+
yield createMetadata(outDir, manifest, pilets);
|
|
148
|
+
(0, common_1.logDone)(`Manifest available at "${outDir}/${manifest}"!`);
|
|
149
|
+
}
|
|
134
150
|
yield ((_b = hooks.onEnd) === null || _b === void 0 ? void 0 : _b.call(hooks, {}));
|
|
135
151
|
});
|
|
136
152
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-pilet.js","sourceRoot":"","sources":["../../src/apps/build-pilet.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+BAA4D;AAC5D,oCAAyE;AACzE,wCAA4D;AAC5D,sCAmBmB;
|
|
1
|
+
{"version":3,"file":"build-pilet.js","sourceRoot":"","sources":["../../src/apps/build-pilet.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+BAA4D;AAC5D,oCAAyE;AACzE,wCAA4D;AAC5D,sCAmBmB;AAiGnB,SAAS,cAAc,CAAC,MAAc,EAAE,OAAe,EAAE,MAAwB;IAC/E,OAAO,IAAA,kBAAS,EACd,MAAM,EACN,OAAO,EACP,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,iBAChB,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EACpB,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAC1B,IAAI,EAAE,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,IAC3B,IAAA,yBAAgB,EAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,EACrC,CAAC,CACJ,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,MAAc,EAAE,MAAwB;IAC1D,OAAO,OAAO,CAAC,GAAG,CAChB,MAAM,CAAC,GAAG,CAAC,CAAO,CAAC,EAAE,EAAE;QACrB,MAAM,KAAK,GAAG,MAAM,IAAA,qBAAY,EAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QAE3C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;YACxB,MAAM,IAAA,aAAI,EAAC,IAAA,cAAO,EAAC,CAAC,CAAC,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.piralBuildTypeKeys = ['all', 'release', 'emulator', 'emulator-sources'];
|
|
8
|
-
exports.piletBuildTypeKeys = ['default', 'standalone'];
|
|
8
|
+
exports.piletBuildTypeKeys = ['default', 'standalone', 'manifest'];
|
|
9
9
|
exports.clientTypeKeys = ['npm', 'pnpm', 'yarn'];
|
|
10
10
|
exports.bundlerKeys = ['none', 'parcel', 'webpack', 'webpack5', 'esbuild'];
|
|
11
11
|
exports.availableBundlers = [];
|
package/lib/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";;;AAAA,0CAAgE;AAUnD,QAAA,UAAU,GAA8B,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AACnE,QAAA,QAAQ,GAA8B,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AACjE,QAAA,kBAAkB,GAA0B,CAAC,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,kBAAkB,CAAC,CAAC;AAC/F,QAAA,kBAAkB,GAA0B,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";;;AAAA,0CAAgE;AAUnD,QAAA,UAAU,GAA8B,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AACnE,QAAA,QAAQ,GAA8B,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AACjE,QAAA,kBAAkB,GAA0B,CAAC,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,kBAAkB,CAAC,CAAC;AAC/F,QAAA,kBAAkB,GAA0B,CAAC,SAAS,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAClF,QAAA,cAAc,GAAyB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;A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,CAAC,CAAC;SACzC;KACF;IAED,OAAO,sBAAc,CAAC,EAAE,CAAC;AAC3B,CAAC;AARD,oDAQC;AAED,SAAgB,kBAAkB,CAAC,KAAqB;IACtD,KAAK,MAAM,gBAAgB,IAAI,yBAAiB,EAAE;QAChD,IAAI,sBAAc,CAAC,gBAAgB,CAAC,KAAK,KAAK,EAAE;YAC9C,OAAO,gBAAgB,CAAC;SACzB;KACF;IAED,OAAO,yBAAiB,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC;AARD,gDAQC"}
|
package/lib/types/public.d.ts
CHANGED
|
@@ -187,7 +187,7 @@ export interface BundlerDefinition {
|
|
|
187
187
|
export declare type PiletSchemaVersion = 'none' | 'v0' | 'v1' | 'v2';
|
|
188
188
|
export declare type PiletPublishSource = 'local' | 'npm' | 'remote';
|
|
189
189
|
export declare type PiralBuildType = 'all' | 'release' | 'emulator' | 'emulator-sources';
|
|
190
|
-
export declare type PiletBuildType = 'default' | 'standalone';
|
|
190
|
+
export declare type PiletBuildType = 'default' | 'standalone' | 'manifest';
|
|
191
191
|
export declare type PackageType = 'registry' | 'file' | 'git';
|
|
192
192
|
export declare type NpmClientType = 'npm' | 'yarn' | 'pnpm';
|
|
193
193
|
export declare type Framework = 'piral' | 'piral-core' | 'piral-base';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-cli",
|
|
3
|
-
"version": "0.14.3-beta.
|
|
3
|
+
"version": "0.14.3-beta.3299",
|
|
4
4
|
"description": "The standard CLI for creating and building a Piral instance or a Pilet.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"portal",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"typescript": "^4.0.2",
|
|
78
78
|
"yargs": "^15.4.1"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "2329c97cbca23e133c1b432ead68964f6ea411f3"
|
|
81
81
|
}
|
package/src/apps/build-pilet.ts
CHANGED
|
@@ -109,6 +109,39 @@ export interface BuildPiletOptions {
|
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
+
interface PiletData {
|
|
113
|
+
id: string;
|
|
114
|
+
package: any;
|
|
115
|
+
path: string;
|
|
116
|
+
outFile: string;
|
|
117
|
+
outDir: string;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function createMetadata(outDir: string, outFile: string, pilets: Array<PiletData>) {
|
|
121
|
+
return writeJson(
|
|
122
|
+
outDir,
|
|
123
|
+
outFile,
|
|
124
|
+
pilets.map((p) => ({
|
|
125
|
+
name: p.package.name,
|
|
126
|
+
version: p.package.version,
|
|
127
|
+
link: `./${p.id}/${p.outFile}`,
|
|
128
|
+
...getPiletSpecMeta(p.path, p.outDir),
|
|
129
|
+
})),
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function copyPilets(outDir: string, pilets: Array<PiletData>) {
|
|
134
|
+
return Promise.all(
|
|
135
|
+
pilets.map(async (p) => {
|
|
136
|
+
const files = await getFileNames(p.outDir);
|
|
137
|
+
|
|
138
|
+
for (const file of files) {
|
|
139
|
+
await copy(resolve(p.outDir, file), resolve(outDir, p.id, file), ForceOverwrite.yes);
|
|
140
|
+
}
|
|
141
|
+
}),
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
112
145
|
export const buildPiletDefaults: BuildPiletOptions = {
|
|
113
146
|
entry: './src/index',
|
|
114
147
|
target: './dist/index.js',
|
|
@@ -232,18 +265,15 @@ export async function buildPilet(baseDir = process.cwd(), options: BuildPiletOpt
|
|
|
232
265
|
const { appFile, appPackage, root } = pilets[0];
|
|
233
266
|
const isEmulator = checkAppShellPackage(appPackage);
|
|
234
267
|
|
|
235
|
-
|
|
268
|
+
logInfo('Building standalone solution ...');
|
|
269
|
+
|
|
236
270
|
await removeDirectory(outDir);
|
|
237
271
|
|
|
238
|
-
|
|
239
|
-
pilets.map(async (p) => {
|
|
240
|
-
const files = await getFileNames(p.outDir);
|
|
272
|
+
progress('Copying files ...');
|
|
241
273
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
}),
|
|
246
|
-
);
|
|
274
|
+
await copyPilets(outDir, pilets);
|
|
275
|
+
|
|
276
|
+
await createMetadata(outDir, '$pilet-api', pilets);
|
|
247
277
|
|
|
248
278
|
if (isEmulator) {
|
|
249
279
|
// in case of an emulator assets are not "seen" by the bundler, so we
|
|
@@ -251,17 +281,6 @@ export async function buildPilet(baseDir = process.cwd(), options: BuildPiletOpt
|
|
|
251
281
|
await copy(dirname(appFile), outDir, ForceOverwrite.yes);
|
|
252
282
|
}
|
|
253
283
|
|
|
254
|
-
await writeJson(
|
|
255
|
-
outDir,
|
|
256
|
-
'$pilet-api',
|
|
257
|
-
pilets.map((p) => ({
|
|
258
|
-
name: p.package.name,
|
|
259
|
-
version: p.package.version,
|
|
260
|
-
link: `./${p.id}/${p.outFile}`,
|
|
261
|
-
...getPiletSpecMeta(p.path, p.outDir),
|
|
262
|
-
})),
|
|
263
|
-
);
|
|
264
|
-
|
|
265
284
|
progress('Optimizing app shell ...');
|
|
266
285
|
|
|
267
286
|
await callPiralBuild(
|
|
@@ -287,6 +306,19 @@ export async function buildPilet(baseDir = process.cwd(), options: BuildPiletOpt
|
|
|
287
306
|
);
|
|
288
307
|
|
|
289
308
|
logDone(`Standalone app available at "${outDir}"!`);
|
|
309
|
+
} else if (type === 'manifest') {
|
|
310
|
+
const manifest = 'pilets.json';
|
|
311
|
+
const outDir = dirname(resolve(fullBase, target));
|
|
312
|
+
|
|
313
|
+
logInfo('Building pilet manifest ...');
|
|
314
|
+
|
|
315
|
+
progress('Copying files ...');
|
|
316
|
+
|
|
317
|
+
await copyPilets(outDir, pilets);
|
|
318
|
+
|
|
319
|
+
await createMetadata(outDir, manifest, pilets);
|
|
320
|
+
|
|
321
|
+
logDone(`Manifest available at "${outDir}/${manifest}"!`);
|
|
290
322
|
}
|
|
291
323
|
|
|
292
324
|
await hooks.onEnd?.({});
|
package/src/helpers.ts
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
export const schemaKeys: Array<PiletSchemaVersion> = ['v0', 'v1', 'v2', 'none'];
|
|
12
12
|
export const fromKeys: Array<PiletPublishSource> = ['local', 'remote', 'npm'];
|
|
13
13
|
export const piralBuildTypeKeys: Array<PiralBuildType> = ['all', 'release', 'emulator', 'emulator-sources'];
|
|
14
|
-
export const piletBuildTypeKeys: Array<PiletBuildType> = ['default', 'standalone'];
|
|
14
|
+
export const piletBuildTypeKeys: Array<PiletBuildType> = ['default', 'standalone', 'manifest'];
|
|
15
15
|
export const clientTypeKeys: Array<NpmClientType> = ['npm', 'pnpm', 'yarn'];
|
|
16
16
|
export const bundlerKeys: Array<string> = ['none', 'parcel', 'webpack', 'webpack5', 'esbuild'];
|
|
17
17
|
export const availableBundlers: Array<string> = [];
|
package/src/types/public.ts
CHANGED
|
@@ -218,7 +218,7 @@ export type PiletPublishSource = 'local' | 'npm' | 'remote';
|
|
|
218
218
|
|
|
219
219
|
export type PiralBuildType = 'all' | 'release' | 'emulator' | 'emulator-sources';
|
|
220
220
|
|
|
221
|
-
export type PiletBuildType = 'default' | 'standalone';
|
|
221
|
+
export type PiletBuildType = 'default' | 'standalone' | 'manifest';
|
|
222
222
|
|
|
223
223
|
export type PackageType = 'registry' | 'file' | 'git';
|
|
224
224
|
|