piral-cli 1.4.0-beta.6247 → 1.4.0-beta.6252
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/api.js +8 -17
- package/lib/api.js.map +1 -1
- package/lib/apps/add-piral-instance-pilet.js +20 -34
- package/lib/apps/add-piral-instance-pilet.js.map +1 -1
- package/lib/apps/build-pilet.js +139 -147
- package/lib/apps/build-pilet.js.map +1 -1
- package/lib/apps/build-piral.js +130 -144
- package/lib/apps/build-piral.js.map +1 -1
- package/lib/apps/debug-pilet.js +107 -119
- package/lib/apps/debug-pilet.js.map +1 -1
- package/lib/apps/debug-piral.js +62 -70
- package/lib/apps/debug-piral.js.map +1 -1
- package/lib/apps/declaration-piral.js +6 -17
- package/lib/apps/declaration-piral.js.map +1 -1
- package/lib/apps/new-pilet.js +71 -81
- package/lib/apps/new-pilet.js.map +1 -1
- package/lib/apps/new-piral.js +42 -53
- package/lib/apps/new-piral.js.map +1 -1
- package/lib/apps/pack-pilet.js +7 -18
- package/lib/apps/pack-pilet.js.map +1 -1
- package/lib/apps/publish-pilet.js +127 -141
- package/lib/apps/publish-pilet.js.map +1 -1
- package/lib/apps/publish-piral.js +48 -63
- package/lib/apps/publish-piral.js.map +1 -1
- package/lib/apps/remove-piral-instance-pilet.js +30 -35
- package/lib/apps/remove-piral-instance-pilet.js.map +1 -1
- package/lib/apps/run-emulator-piral.js +49 -61
- package/lib/apps/run-emulator-piral.js.map +1 -1
- package/lib/apps/upgrade-pilet.js +64 -75
- package/lib/apps/upgrade-pilet.js.map +1 -1
- package/lib/apps/upgrade-piral.js +31 -43
- package/lib/apps/upgrade-piral.js.map +1 -1
- package/lib/apps/validate-pilet.js +34 -45
- package/lib/apps/validate-pilet.js.map +1 -1
- package/lib/apps/validate-piral.js +29 -51
- package/lib/apps/validate-piral.js.map +1 -1
- package/lib/build/bundler-calls.js +12 -3
- package/lib/build/bundler-calls.js.map +1 -1
- package/lib/build/run-build-pilet.js +5 -14
- package/lib/build/run-build-pilet.js.map +1 -1
- package/lib/build/run-build-piral.js +5 -14
- package/lib/build/run-build-piral.js.map +1 -1
- package/lib/build/run-debug-mono-piral.js +5 -14
- package/lib/build/run-debug-mono-piral.js.map +1 -1
- package/lib/build/run-debug-pilet.js +5 -14
- package/lib/build/run-debug-pilet.js.map +1 -1
- package/lib/build/run-debug-piral.js +5 -14
- package/lib/build/run-debug-piral.js.map +1 -1
- package/lib/bundler.js +100 -127
- package/lib/bundler.js.map +1 -1
- package/lib/commands.js +5 -1
- package/lib/commands.js.map +1 -1
- package/lib/common/browser.js +13 -26
- package/lib/common/browser.js.map +1 -1
- package/lib/common/compatibility.js +10 -21
- package/lib/common/compatibility.js.map +1 -1
- package/lib/common/declaration.js +80 -101
- package/lib/common/declaration.js.map +1 -1
- package/lib/common/emulator.js +186 -182
- package/lib/common/emulator.js.map +1 -1
- package/lib/common/http.js +7 -4
- package/lib/common/http.js.map +1 -1
- package/lib/common/importmap.js +172 -187
- package/lib/common/importmap.js.map +1 -1
- package/lib/common/injectors.js +4 -1
- package/lib/common/injectors.js.map +1 -1
- package/lib/common/inspect.js +5 -2
- package/lib/common/inspect.js.map +1 -1
- package/lib/common/interactive.js +9 -15
- package/lib/common/interactive.js.map +1 -1
- package/lib/common/io.js +256 -299
- package/lib/common/io.js.map +1 -1
- package/lib/common/language.js +21 -5
- package/lib/common/language.js.map +1 -1
- package/lib/common/npm.js +193 -228
- package/lib/common/npm.js.map +1 -1
- package/lib/common/pack.js +71 -86
- package/lib/common/pack.js.map +1 -1
- package/lib/common/package.d.ts +1 -2
- package/lib/common/package.js +428 -458
- package/lib/common/package.js.map +1 -1
- package/lib/common/parallel.js +12 -23
- package/lib/common/parallel.js.map +1 -1
- package/lib/common/patcher.js +54 -71
- package/lib/common/patcher.js.map +1 -1
- package/lib/common/platform.js +1 -12
- package/lib/common/platform.js.map +1 -1
- package/lib/common/port.js +11 -24
- package/lib/common/port.js.map +1 -1
- package/lib/common/rules.js +6 -17
- package/lib/common/rules.js.map +1 -1
- package/lib/common/scaffold.js +52 -59
- package/lib/common/scaffold.js.map +1 -1
- package/lib/common/shell.d.ts +2 -2
- package/lib/common/shell.js +53 -31
- package/lib/common/shell.js.map +1 -1
- package/lib/common/spec.js +1 -1
- package/lib/common/spec.js.map +1 -1
- package/lib/common/template.js +3 -14
- package/lib/common/template.js.map +1 -1
- package/lib/common/watcher.js +7 -16
- package/lib/common/watcher.js.map +1 -1
- package/lib/common/website.d.ts +2 -2
- package/lib/common/website.js +68 -56
- package/lib/common/website.js.map +1 -1
- package/lib/injectors/pilet-injector.d.ts +12 -10
- package/lib/injectors/pilet-injector.js +123 -87
- package/lib/injectors/pilet-injector.js.map +1 -1
- package/lib/injectors/piral-injector.d.ts +5 -5
- package/lib/injectors/piral-injector.js +32 -14
- package/lib/injectors/piral-injector.js.map +1 -1
- package/lib/messages.d.ts +81 -0
- package/lib/messages.js +94 -1
- package/lib/messages.js.map +1 -1
- package/lib/npm-clients/bun.js +36 -60
- package/lib/npm-clients/bun.js.map +1 -1
- package/lib/npm-clients/index.js +10 -21
- package/lib/npm-clients/index.js.map +1 -1
- package/lib/npm-clients/lerna.js +48 -72
- package/lib/npm-clients/lerna.js.map +1 -1
- package/lib/npm-clients/npm.js +69 -105
- package/lib/npm-clients/npm.js.map +1 -1
- package/lib/npm-clients/pnp.js +35 -59
- package/lib/npm-clients/pnp.js.map +1 -1
- package/lib/npm-clients/pnpm.js +35 -59
- package/lib/npm-clients/pnpm.js.map +1 -1
- package/lib/npm-clients/rush.js +53 -77
- package/lib/npm-clients/rush.js.map +1 -1
- package/lib/npm-clients/yarn.js +35 -59
- package/lib/npm-clients/yarn.js.map +1 -1
- package/lib/platforms/node.js +4 -17
- package/lib/platforms/node.js.map +1 -1
- package/lib/platforms/web.js +81 -96
- package/lib/platforms/web.js.map +1 -1
- package/lib/plugin.js +56 -75
- package/lib/plugin.js.map +1 -1
- package/lib/questionnaire.js +46 -12
- package/lib/questionnaire.js.map +1 -1
- package/lib/release.js +32 -47
- package/lib/release.js.map +1 -1
- package/lib/rules/index.js +10 -23
- package/lib/rules/index.js.map +1 -1
- package/lib/rules/pilet-has-externals-as-peers.js +34 -45
- package/lib/rules/pilet-has-externals-as-peers.js.map +1 -1
- package/lib/rules/pilet-has-no-self-reference.js +16 -27
- package/lib/rules/pilet-has-no-self-reference.js.map +1 -1
- package/lib/rules/pilet-has-non-conflicting-css.js +27 -42
- package/lib/rules/pilet-has-non-conflicting-css.js.map +1 -1
- package/lib/rules/pilet-stays-small.js +20 -33
- package/lib/rules/pilet-stays-small.js.map +1 -1
- package/lib/rules/pilet-uses-latest-piral.js +17 -28
- package/lib/rules/pilet-uses-latest-piral.js.map +1 -1
- package/lib/rules/piral-has-valid-devDependencies.js +4 -1
- package/lib/rules/piral-has-valid-devDependencies.js.map +1 -1
- package/lib/runner.js +3 -12
- package/lib/runner.js.map +1 -1
- package/lib/select.js +21 -32
- package/lib/select.js.map +1 -1
- package/lib/start.js +6 -17
- package/lib/start.js.map +1 -1
- package/package.json +2 -2
- package/src/apps/add-piral-instance-pilet.ts +1 -16
- package/src/apps/build-piral.test.ts +1 -1
- package/src/apps/new-pilet.ts +4 -10
- package/src/apps/run-emulator-piral.ts +1 -1
- package/src/apps/upgrade-pilet.ts +3 -2
- package/src/common/package.ts +29 -37
- package/src/common/shell.ts +59 -18
- package/src/common/website.ts +47 -17
- package/src/injectors/pilet-injector.test.ts +4 -4
- package/src/injectors/pilet-injector.ts +97 -41
- package/src/injectors/piral-injector.test.ts +2 -2
- package/src/injectors/piral-injector.ts +31 -20
- package/src/messages.ts +93 -0
|
@@ -1,43 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
const common_1 = require("../common");
|
|
13
4
|
/**
|
|
14
5
|
* Checks if the used Piral instance is not referenced in the code.
|
|
15
6
|
*/
|
|
16
|
-
function default_1(context, options = 'ignore') {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
context.error(`
|
|
7
|
+
async function default_1(context, options = 'ignore') {
|
|
8
|
+
if (options !== 'ignore') {
|
|
9
|
+
const { name } = context.apps[0].appPackage;
|
|
10
|
+
const names = ['piral', 'piral-core', 'piral-base', name];
|
|
11
|
+
const files = await (0, common_1.getSourceFiles)(context.entry);
|
|
12
|
+
const testers = [];
|
|
13
|
+
for (const packageName of names) {
|
|
14
|
+
testers.push(new RegExp(`(import\\s+.*\\s+from\\s+["'\`]${packageName}["'\`]|require\\(["'\`]${packageName}["'\`]\\));`));
|
|
15
|
+
}
|
|
16
|
+
for (const file of files) {
|
|
17
|
+
const fileContent = await file.read();
|
|
18
|
+
for (const tester of testers) {
|
|
19
|
+
if (tester.test(fileContent)) {
|
|
20
|
+
context.error(`
|
|
31
21
|
The Piral instance is referenced in "${file.path}".
|
|
32
22
|
Expected: No import of "${name}" or Piral itself.
|
|
33
23
|
Received: Import seen.
|
|
34
24
|
`);
|
|
35
|
-
|
|
36
|
-
}
|
|
25
|
+
break;
|
|
37
26
|
}
|
|
38
27
|
}
|
|
39
28
|
}
|
|
40
|
-
}
|
|
29
|
+
}
|
|
41
30
|
}
|
|
42
31
|
exports.default = default_1;
|
|
43
32
|
//# sourceMappingURL=pilet-has-no-self-reference.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pilet-has-no-self-reference.js","sourceRoot":"","sources":["../../src/rules/pilet-has-no-self-reference.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pilet-has-no-self-reference.js","sourceRoot":"","sources":["../../src/rules/pilet-has-no-self-reference.ts"],"names":[],"mappings":";;AACA,sCAA2C;AAI3C;;GAEG;AACY,KAAK,oBAAW,OAAyB,EAAE,UAAmB,QAAQ;IACnF,IAAI,OAAO,KAAK,QAAQ,EAAE;QACxB,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;QAC5C,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;QAC1D,MAAM,KAAK,GAAG,MAAM,IAAA,uBAAc,EAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAClD,MAAM,OAAO,GAAkB,EAAE,CAAC;QAElC,KAAK,MAAM,WAAW,IAAI,KAAK,EAAE;YAC/B,OAAO,CAAC,IAAI,CACV,IAAI,MAAM,CAAC,kCAAkC,WAAW,0BAA0B,WAAW,aAAa,CAAC,CAC5G,CAAC;SACH;QAED,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;YACxB,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;YAEtC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;gBAC5B,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;oBAC5B,OAAO,CAAC,KAAK,CACX;uCAC2B,IAAI,CAAC,IAAI;4BACpB,IAAI;;CAE/B,CACU,CAAC;oBACF,MAAM;iBACP;aACF;SACF;KACF;AACH,CAAC;AA9BD,4BA8BC"}
|
|
@@ -1,37 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
const path_1 = require("path");
|
|
13
4
|
const css_conflict_inspector_1 = require("css-conflict-inspector");
|
|
14
5
|
const common_1 = require("../common");
|
|
15
|
-
function getPiletCssPaths(main, baseDir) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return files.filter((m) => m.endsWith('.css')).map((m) => (0, path_1.resolve)(outDir, m));
|
|
24
|
-
}
|
|
6
|
+
async function getPiletCssPaths(main, baseDir) {
|
|
7
|
+
const paths = [main, `dist/${main}`, `${main}/index.js`, `dist/${main}/index.js`, 'index.js', 'dist/index.js'];
|
|
8
|
+
for (const path of paths) {
|
|
9
|
+
const outDir = (0, path_1.dirname)((0, path_1.resolve)(baseDir, path));
|
|
10
|
+
const exists = await (0, common_1.checkExists)(outDir);
|
|
11
|
+
if (exists) {
|
|
12
|
+
const files = await (0, common_1.getFileNames)(outDir);
|
|
13
|
+
return files.filter((m) => m.endsWith('.css')).map((m) => (0, path_1.resolve)(outDir, m));
|
|
25
14
|
}
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
}
|
|
16
|
+
return [];
|
|
28
17
|
}
|
|
29
|
-
function getCssScore(dir, file) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return result.score;
|
|
34
|
-
});
|
|
18
|
+
async function getCssScore(dir, file) {
|
|
19
|
+
const content = await (0, common_1.readText)(dir, file);
|
|
20
|
+
const result = (0, css_conflict_inspector_1.analyzeCss)(content);
|
|
21
|
+
return result.score;
|
|
35
22
|
}
|
|
36
23
|
/**
|
|
37
24
|
* Checks if a pilet might cause a CSS conflict. A score of 100 means that
|
|
@@ -46,27 +33,25 @@ function getCssScore(dir, file) {
|
|
|
46
33
|
*
|
|
47
34
|
* By default, a pilet's stylesheet having a CSS score of below 50 will result in a warning.
|
|
48
35
|
*/
|
|
49
|
-
function default_1(context, options = -50) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
notify(`
|
|
36
|
+
async function default_1(context, options = -50) {
|
|
37
|
+
if (options !== 0 && typeof options === 'number') {
|
|
38
|
+
const threshold = Math.abs(options);
|
|
39
|
+
const { main } = context.piletPackage;
|
|
40
|
+
const paths = await getPiletCssPaths(main, context.root);
|
|
41
|
+
for (const path of paths) {
|
|
42
|
+
const dir = (0, path_1.dirname)(path);
|
|
43
|
+
const file = (0, path_1.basename)(path);
|
|
44
|
+
const score = await getCssScore(dir, file);
|
|
45
|
+
if (score < threshold) {
|
|
46
|
+
const notify = options > 0 ? context.error : context.warning;
|
|
47
|
+
notify(`
|
|
62
48
|
The CSS in "${file}" might lead to conflicts.
|
|
63
49
|
Minimum: ${threshold} points.
|
|
64
50
|
Received: ${score} points.
|
|
65
51
|
`);
|
|
66
|
-
}
|
|
67
52
|
}
|
|
68
53
|
}
|
|
69
|
-
}
|
|
54
|
+
}
|
|
70
55
|
}
|
|
71
56
|
exports.default = default_1;
|
|
72
57
|
//# sourceMappingURL=pilet-has-non-conflicting-css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pilet-has-non-conflicting-css.js","sourceRoot":"","sources":["../../src/rules/pilet-has-non-conflicting-css.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pilet-has-non-conflicting-css.js","sourceRoot":"","sources":["../../src/rules/pilet-has-non-conflicting-css.ts"],"names":[],"mappings":";;AAAA,+BAAkD;AAClD,mEAAoD;AACpD,sCAAgE;AAKhE,KAAK,UAAU,gBAAgB,CAAC,IAAY,EAAE,OAAe;IAC3D,MAAM,KAAK,GAAG,CAAC,IAAI,EAAE,QAAQ,IAAI,EAAE,EAAE,GAAG,IAAI,WAAW,EAAE,QAAQ,IAAI,WAAW,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC;IAE/G,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,MAAM,MAAM,GAAG,IAAA,cAAO,EAAC,IAAA,cAAO,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;QAC/C,MAAM,MAAM,GAAG,MAAM,IAAA,oBAAW,EAAC,MAAM,CAAC,CAAC;QAEzC,IAAI,MAAM,EAAE;YACV,MAAM,KAAK,GAAG,MAAM,IAAA,qBAAY,EAAC,MAAM,CAAC,CAAC;YACzC,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,cAAO,EAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;SAC/E;KACF;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,KAAK,UAAU,WAAW,CAAC,GAAW,EAAE,IAAY;IAClD,MAAM,OAAO,GAAG,MAAM,IAAA,iBAAQ,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,IAAA,mCAAU,EAAC,OAAO,CAAC,CAAC;IACnC,OAAO,MAAM,CAAC,KAAK,CAAC;AACtB,CAAC;AAED;;;;;;;;;;;;GAYG;AACY,KAAK,oBAAW,OAAyB,EAAE,UAAmB,CAAC,EAAE;IAC9E,IAAI,OAAO,KAAK,CAAC,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAChD,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACpC,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC;QACtC,MAAM,KAAK,GAAG,MAAM,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QAEzD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;YACxB,MAAM,GAAG,GAAG,IAAA,cAAO,EAAC,IAAI,CAAC,CAAC;YAC1B,MAAM,IAAI,GAAG,IAAA,eAAQ,EAAC,IAAI,CAAC,CAAC;YAC5B,MAAM,KAAK,GAAG,MAAM,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YAE3C,IAAI,KAAK,GAAG,SAAS,EAAE;gBACrB,MAAM,MAAM,GAAG,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;gBAC7D,MAAM,CACJ;cACI,IAAI;aACL,SAAS;cACR,KAAK;CAClB,CACQ,CAAC;aACH;SACF;KACF;AACH,CAAC;AAvBD,4BAuBC"}
|
|
@@ -1,29 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
const fs_1 = require("fs");
|
|
13
4
|
const path_1 = require("path");
|
|
14
5
|
const common_1 = require("../common");
|
|
15
|
-
function getPiletMainPath(main, baseDir) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return filePath;
|
|
23
|
-
}
|
|
6
|
+
async function getPiletMainPath(main, baseDir) {
|
|
7
|
+
const paths = [main, `dist/${main}`, `${main}/index.js`, `dist/${main}/index.js`, 'index.js', 'dist/index.js'];
|
|
8
|
+
for (const path of paths) {
|
|
9
|
+
const filePath = (0, path_1.resolve)(baseDir, path);
|
|
10
|
+
const exists = await (0, common_1.checkExists)(filePath);
|
|
11
|
+
if (exists) {
|
|
12
|
+
return filePath;
|
|
24
13
|
}
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
}
|
|
15
|
+
return undefined;
|
|
27
16
|
}
|
|
28
17
|
function getFileSizeInKB(path) {
|
|
29
18
|
return new Promise((resolve, reject) => {
|
|
@@ -53,25 +42,23 @@ function getFileSizeInKB(path) {
|
|
|
53
42
|
*
|
|
54
43
|
* By default, a pilet's main bundle exceeding 50 kB will result in a warning.
|
|
55
44
|
*/
|
|
56
|
-
function default_1(context, options = -50) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
notify(`
|
|
45
|
+
async function default_1(context, options = -50) {
|
|
46
|
+
if (options !== 0 && typeof options === 'number') {
|
|
47
|
+
const maxSize = Math.abs(options);
|
|
48
|
+
const { main } = context.piletPackage;
|
|
49
|
+
const path = await getPiletMainPath(main, context.root);
|
|
50
|
+
if (path) {
|
|
51
|
+
const size = await getFileSizeInKB(path);
|
|
52
|
+
if (size > maxSize) {
|
|
53
|
+
const notify = options > 0 ? context.error : context.warning;
|
|
54
|
+
notify(`
|
|
67
55
|
The main bundle is too large.
|
|
68
56
|
Maximum: ${maxSize} kB.
|
|
69
57
|
Received: ${size} kB.
|
|
70
58
|
`);
|
|
71
|
-
}
|
|
72
59
|
}
|
|
73
60
|
}
|
|
74
|
-
}
|
|
61
|
+
}
|
|
75
62
|
}
|
|
76
63
|
exports.default = default_1;
|
|
77
64
|
//# sourceMappingURL=pilet-stays-small.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pilet-stays-small.js","sourceRoot":"","sources":["../../src/rules/pilet-stays-small.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pilet-stays-small.js","sourceRoot":"","sources":["../../src/rules/pilet-stays-small.ts"],"names":[],"mappings":";;AAAA,2BAA0B;AAC1B,+BAA+B;AAC/B,sCAAwC;AAKxC,KAAK,UAAU,gBAAgB,CAAC,IAAY,EAAE,OAAe;IAC3D,MAAM,KAAK,GAAG,CAAC,IAAI,EAAE,QAAQ,IAAI,EAAE,EAAE,GAAG,IAAI,WAAW,EAAE,QAAQ,IAAI,WAAW,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC;IAE/G,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,MAAM,QAAQ,GAAG,IAAA,cAAO,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACxC,MAAM,MAAM,GAAG,MAAM,IAAA,oBAAW,EAAC,QAAQ,CAAC,CAAC;QAE3C,IAAI,MAAM,EAAE;YACV,OAAO,QAAQ,CAAC;SACjB;KACF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,eAAe,CAAC,IAAY;IACnC,OAAO,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC7C,IAAA,SAAI,EAAC,IAAI,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;YACxB,IAAI,GAAG,EAAE;gBACP,MAAM,CAAC,GAAG,CAAC,CAAC;aACb;iBAAM,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE;gBACzB,2BAA2B;gBAC3B,OAAO,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;aAC5B;iBAAM;gBACL,MAAM,CAAC,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC,CAAC;aAC9E;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;GAWG;AACY,KAAK,oBAAW,OAAyB,EAAE,UAAmB,CAAC,EAAE;IAC9E,IAAI,OAAO,KAAK,CAAC,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAChD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAClC,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC;QACtC,MAAM,IAAI,GAAG,MAAM,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QAExD,IAAI,IAAI,EAAE;YACR,MAAM,IAAI,GAAG,MAAM,eAAe,CAAC,IAAI,CAAC,CAAC;YAEzC,IAAI,IAAI,GAAG,OAAO,EAAE;gBAClB,MAAM,MAAM,GAAG,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;gBAC7D,MAAM,CACJ;;aAEG,OAAO;cACN,IAAI;CACjB,CACQ,CAAC;aACH;SACF;KACF;AACH,CAAC;AArBD,4BAqBC"}
|
|
@@ -1,46 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
const common_1 = require("../common");
|
|
13
4
|
/**
|
|
14
5
|
* Checks if the used Piral instance is used at its latest version.
|
|
15
6
|
*/
|
|
16
|
-
function default_1(context, options = 'suggest') {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
context.warning(`
|
|
7
|
+
async function default_1(context, options = 'suggest') {
|
|
8
|
+
if (options !== 'ignore') {
|
|
9
|
+
const { name, version } = context.apps[0].appPackage;
|
|
10
|
+
const demanded = (context.devDependencies && context.devDependencies[name]) || '';
|
|
11
|
+
const isfixed = demanded.startsWith('git+') || demanded.startsWith('file:');
|
|
12
|
+
if (!isfixed) {
|
|
13
|
+
const isMonorepoRef = await (0, common_1.isMonorepoPackageRef)(name, context.root);
|
|
14
|
+
// either we are not in a monorepo or the app shell is not part of the monorepo
|
|
15
|
+
if (!isMonorepoRef) {
|
|
16
|
+
const latestVersion = await (0, common_1.findLatestVersion)(name).catch((err) => {
|
|
17
|
+
context.warning(`
|
|
28
18
|
The used version of "${name}" could not be determined: ${err}.
|
|
29
19
|
`);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
20
|
+
return version;
|
|
21
|
+
});
|
|
22
|
+
if (version !== latestVersion) {
|
|
23
|
+
const notify = options === 'required' ? context.error : context.warning;
|
|
24
|
+
notify(`
|
|
35
25
|
The used version of "${name}" is outdated.
|
|
36
26
|
Expected: v${latestVersion}.
|
|
37
27
|
Received: v${version}.
|
|
38
28
|
`);
|
|
39
|
-
}
|
|
40
29
|
}
|
|
41
30
|
}
|
|
42
31
|
}
|
|
43
|
-
}
|
|
32
|
+
}
|
|
44
33
|
}
|
|
45
34
|
exports.default = default_1;
|
|
46
35
|
//# sourceMappingURL=pilet-uses-latest-piral.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pilet-uses-latest-piral.js","sourceRoot":"","sources":["../../src/rules/pilet-uses-latest-piral.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pilet-uses-latest-piral.js","sourceRoot":"","sources":["../../src/rules/pilet-uses-latest-piral.ts"],"names":[],"mappings":";;AAAA,sCAAoE;AAKpE;;GAEG;AACY,KAAK,oBAAW,OAAyB,EAAE,UAAmB,SAAS;IACpF,IAAI,OAAO,KAAK,QAAQ,EAAE;QACxB,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;QACrD,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,eAAe,IAAI,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;QAClF,MAAM,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAE5E,IAAI,CAAC,OAAO,EAAE;YACZ,MAAM,aAAa,GAAG,MAAM,IAAA,6BAAoB,EAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;YAErE,+EAA+E;YAC/E,IAAI,CAAC,aAAa,EAAE;gBAClB,MAAM,aAAa,GAAG,MAAM,IAAA,0BAAiB,EAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;oBAChE,OAAO,CAAC,OAAO,CAAC;yBACD,IAAI,8BAA8B,GAAG;WACnD,CAAC,CAAC;oBACH,OAAO,OAAO,CAAC;gBACjB,CAAC,CAAC,CAAC;gBAEH,IAAI,OAAO,KAAK,aAAa,EAAE;oBAC7B,MAAM,MAAM,GAAG,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;oBACxE,MAAM,CACJ;yBACa,IAAI;iBACZ,aAAa;iBACb,OAAO;GACrB,CACQ,CAAC;iBACH;aACF;SACF;KACF;AACH,CAAC;AA/BD,4BA+BC"}
|
|
@@ -13,7 +13,10 @@ The scripts in pilets.devDependencies are invalid.
|
|
|
13
13
|
`);
|
|
14
14
|
}
|
|
15
15
|
else {
|
|
16
|
-
const allDependencies =
|
|
16
|
+
const allDependencies = {
|
|
17
|
+
...context.dependencies,
|
|
18
|
+
...context.devDependencies,
|
|
19
|
+
};
|
|
17
20
|
const invalidDevDepsTypes = Object.keys(devDependencies)
|
|
18
21
|
.map((m) => devDependencies[m])
|
|
19
22
|
.filter((m) => typeof m !== 'string' && m !== true);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"piral-has-valid-devDependencies.js","sourceRoot":"","sources":["../../src/rules/piral-has-valid-devDependencies.ts"],"names":[],"mappings":";;AAIA;;GAEG;AACH,mBAAyB,OAAyB,EAAE,UAAmB,SAAS;IAC9E,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAEzC,IAAI,OAAO,eAAe,KAAK,QAAQ,EAAE;QACvC,OAAO,CAAC,KAAK,CACX;;;eAGS,OAAO,eAAe;CACpC,CACI,CAAC;KACH;SAAM;QACL,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"piral-has-valid-devDependencies.js","sourceRoot":"","sources":["../../src/rules/piral-has-valid-devDependencies.ts"],"names":[],"mappings":";;AAIA;;GAEG;AACH,mBAAyB,OAAyB,EAAE,UAAmB,SAAS;IAC9E,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAEzC,IAAI,OAAO,eAAe,KAAK,QAAQ,EAAE;QACvC,OAAO,CAAC,KAAK,CACX;;;eAGS,OAAO,eAAe;CACpC,CACI,CAAC;KACH;SAAM;QACL,MAAM,eAAe,GAAG;YACtB,GAAG,OAAO,CAAC,YAAY;YACvB,GAAG,OAAO,CAAC,eAAe;SAC3B,CAAC;QACF,MAAM,mBAAmB,GAAG,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC;aACrD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;aAC9B,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC;QACtD,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,MAAM,CAC5D,CAAC,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAC1D,CAAC;QAEF,IAAI,mBAAmB,CAAC,MAAM,GAAG,CAAC,EAAE;YAClC,OAAO,CAAC,KAAK,CACX;;;oBAGY,mBAAmB,CAAC,MAAM;CAC7C,CACM,CAAC;SACH;QAED,KAAK,MAAM,iBAAiB,IAAI,kBAAkB,EAAE;YAClD,OAAO,CAAC,OAAO,CACb;+BACuB,iBAAiB;kCACd,iBAAiB;;CAElD,CACM,CAAC;SACH;KACF;AACH,CAAC;AA3CD,4BA2CC"}
|
package/lib/runner.js
CHANGED
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
const start_1 = require("./start");
|
|
13
|
-
process.on('message', ({ type, select, args }) =>
|
|
4
|
+
process.on('message', async ({ type, select, args }) => {
|
|
14
5
|
if (type === 'start') {
|
|
15
6
|
const from = eval(select);
|
|
16
7
|
process.argv.splice(2, 0, ...args);
|
|
17
|
-
|
|
8
|
+
await (0, start_1.start)(from);
|
|
18
9
|
}
|
|
19
|
-
})
|
|
10
|
+
});
|
|
20
11
|
//# sourceMappingURL=runner.js.map
|
package/lib/runner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":";;AAAA,mCAAgC;AAEhC,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE;IACrD,IAAI,IAAI,KAAK,OAAO,EAAE;QACpB,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1B,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC;QACnC,MAAM,IAAA,aAAK,EAAC,IAAI,CAAC,CAAC;KACnB;AACH,CAAC,CAAC,CAAC"}
|
package/lib/select.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.select = void 0;
|
|
13
4
|
const path_1 = require("path");
|
|
@@ -19,32 +10,30 @@ function getPath() {
|
|
|
19
10
|
paths: [process.cwd()],
|
|
20
11
|
}));
|
|
21
12
|
}
|
|
22
|
-
catch
|
|
13
|
+
catch {
|
|
23
14
|
return (0, path_1.dirname)(__filename);
|
|
24
15
|
}
|
|
25
16
|
}
|
|
26
|
-
function select(from) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
});
|
|
17
|
+
async function select(from) {
|
|
18
|
+
const localPath = getPath();
|
|
19
|
+
const localRunner = (0, path_1.resolve)(localPath, 'runner.js');
|
|
20
|
+
if (localPath !== __dirname && (0, fs_1.existsSync)(localRunner)) {
|
|
21
|
+
// If the runner exists and we found a more local installation use the new mode
|
|
22
|
+
const ps = (0, child_process_1.fork)(localRunner, [], {
|
|
23
|
+
cwd: process.cwd(),
|
|
24
|
+
});
|
|
25
|
+
ps.send({
|
|
26
|
+
type: 'start',
|
|
27
|
+
select: from.toString(),
|
|
28
|
+
args: process.argv.slice(2),
|
|
29
|
+
});
|
|
30
|
+
ps.on('exit', (code) => process.exit(code));
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
// If no runner exists or we are in the same directory go for the classic mode
|
|
34
|
+
const { start } = require((0, path_1.join)(localPath, 'start'));
|
|
35
|
+
await start(from);
|
|
36
|
+
}
|
|
48
37
|
}
|
|
49
38
|
exports.select = select;
|
|
50
39
|
//# sourceMappingURL=select.js.map
|
package/lib/select.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["../src/select.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../src/select.ts"],"names":[],"mappings":";;;AAAA,+BAA8C;AAC9C,2BAAgC;AAChC,iDAAqC;AAGrC,SAAS,OAAO;IACd,IAAI;QACF,OAAO,IAAA,cAAO,EACZ,OAAO,CAAC,OAAO,CAAC,eAAe,EAAE;YAC/B,KAAK,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;SACvB,CAAC,CACH,CAAC;KACH;IAAC,MAAM;QACN,OAAO,IAAA,cAAO,EAAC,UAAU,CAAC,CAAC;KAC5B;AACH,CAAC;AAEM,KAAK,UAAU,MAAM,CAAC,IAAoB;IAC/C,MAAM,SAAS,GAAG,OAAO,EAAE,CAAC;IAC5B,MAAM,WAAW,GAAG,IAAA,cAAO,EAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAEpD,IAAI,SAAS,KAAK,SAAS,IAAI,IAAA,eAAU,EAAC,WAAW,CAAC,EAAE;QACtD,+EAA+E;QAC/E,MAAM,EAAE,GAAG,IAAA,oBAAI,EAAC,WAAW,EAAE,EAAE,EAAE;YAC/B,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;SACnB,CAAC,CAAC;QAEH,EAAE,CAAC,IAAI,CAAC;YACN,IAAI,EAAE,OAAO;YACb,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE;YACvB,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;SAC5B,CAAC,CAAC;QAEH,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;KAC7C;SAAM;QACL,8EAA8E;QAC9E,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,IAAA,WAAI,EAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;QACpD,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;KACnB;AACH,CAAC;AAtBD,wBAsBC"}
|
package/lib/start.js
CHANGED
|
@@ -1,23 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.start = void 0;
|
|
13
|
-
function start(from) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
yield setupCli(from(commands));
|
|
20
|
-
});
|
|
4
|
+
async function start(from) {
|
|
5
|
+
const { loadPlugins } = require('./plugin');
|
|
6
|
+
const { commands } = require('./commands');
|
|
7
|
+
const { setupCli } = require('./cli');
|
|
8
|
+
await loadPlugins();
|
|
9
|
+
await setupCli(from(commands));
|
|
21
10
|
}
|
|
22
11
|
exports.start = start;
|
|
23
12
|
//# sourceMappingURL=start.js.map
|
package/lib/start.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.js","sourceRoot":"","sources":["../src/start.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"start.js","sourceRoot":"","sources":["../src/start.ts"],"names":[],"mappings":";;;AAEO,KAAK,UAAU,KAAK,CAAC,IAAoB;IAC9C,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC5C,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAC3C,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACtC,MAAM,WAAW,EAAE,CAAC;IACpB,MAAM,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;AACjC,CAAC;AAND,sBAMC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-cli",
|
|
3
|
-
"version": "1.4.0-beta.
|
|
3
|
+
"version": "1.4.0-beta.6252",
|
|
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": "f30d158bb902504e233849eb7c7f65a0d3e52ce3"
|
|
85
85
|
}
|
|
@@ -73,27 +73,12 @@ export async function addPiralInstancePilet(baseDir = process.cwd(), options: Ad
|
|
|
73
73
|
if (piletJsonPath) {
|
|
74
74
|
const piletJsonDir = dirname(piletJsonPath);
|
|
75
75
|
const root = await findPiletRoot(piletJsonDir);
|
|
76
|
-
|
|
77
|
-
const [appName, _, appDetails] = await installPiralInstance(app, fullBase, root, npmClient);
|
|
78
|
-
|
|
79
|
-
const newContent = {
|
|
80
|
-
...oldContent,
|
|
81
|
-
piralInstances: {
|
|
82
|
-
...oldContent.piralInstances,
|
|
83
|
-
[appName]: {
|
|
84
|
-
...appDetails,
|
|
85
|
-
selected,
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
await writeJson(piletJsonDir, piletJson, newContent, true);
|
|
76
|
+
await installPiralInstance(app, fullBase, root, npmClient, selected);
|
|
91
77
|
} else {
|
|
92
78
|
log('piletJsonNotAvailable_0180', targetDir);
|
|
93
79
|
}
|
|
94
80
|
});
|
|
95
81
|
|
|
96
82
|
await Promise.all(tasks);
|
|
97
|
-
|
|
98
83
|
logDone(`Added the Piral instance!`);
|
|
99
84
|
}
|
package/src/apps/new-pilet.ts
CHANGED
|
@@ -178,22 +178,17 @@ always-auth=true`,
|
|
|
178
178
|
JSON.stringify(
|
|
179
179
|
{
|
|
180
180
|
schemaVersion: defaultSchemaVersion,
|
|
181
|
+
piralInstances: {},
|
|
181
182
|
},
|
|
182
183
|
undefined,
|
|
183
184
|
2,
|
|
184
185
|
),
|
|
185
186
|
);
|
|
186
187
|
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
fullBase,
|
|
190
|
-
root,
|
|
191
|
-
npmClient,
|
|
192
|
-
);
|
|
188
|
+
const sourceName = source || `empty-piral@${cliVersion}`;
|
|
189
|
+
const packageName = await installPiralInstance(sourceName, fullBase, root, npmClient, true);
|
|
193
190
|
const piralInfo = await readPiralPackage(root, packageName);
|
|
194
|
-
|
|
195
191
|
const isEmulator = checkAppShellPackage(piralInfo);
|
|
196
|
-
|
|
197
192
|
const { preScaffold, postScaffold, files, template: preSelectedTemplate } = getPiletsInfo(piralInfo);
|
|
198
193
|
|
|
199
194
|
if (preScaffold) {
|
|
@@ -206,10 +201,9 @@ always-auth=true`,
|
|
|
206
201
|
|
|
207
202
|
const data = getPiletScaffoldData(language, root, packageName, variables);
|
|
208
203
|
|
|
209
|
-
await patchPiletPackage(root,
|
|
204
|
+
await patchPiletPackage(root, piralInfo, isEmulator, {
|
|
210
205
|
language,
|
|
211
206
|
bundler: bundlerName,
|
|
212
|
-
details: packageDetails,
|
|
213
207
|
});
|
|
214
208
|
|
|
215
209
|
const chosenTemplate = template || preSelectedTemplate || 'default';
|
|
@@ -116,7 +116,7 @@ always-auth=true`,
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
const npmClient = await determineNpmClient(appRoot, defaultNpmClient);
|
|
119
|
-
const
|
|
119
|
+
const packageName = await installPiralInstance(app, fullBase, appRoot, npmClient);
|
|
120
120
|
const piral = await findPiralInstance(packageName, appRoot, {
|
|
121
121
|
port: originalPort,
|
|
122
122
|
});
|