piral-cli 0.14.0-pre.2983 → 0.14.0-pre.3074
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 +23 -23
- package/lib/api.js.map +1 -1
- package/lib/apps/build-pilet.js +18 -16
- package/lib/apps/build-pilet.js.map +1 -1
- package/lib/apps/build-piral.js +35 -34
- package/lib/apps/build-piral.js.map +1 -1
- package/lib/apps/debug-pilet.js +28 -27
- package/lib/apps/debug-pilet.js.map +1 -1
- package/lib/apps/debug-piral.js +15 -14
- package/lib/apps/debug-piral.js.map +1 -1
- package/lib/apps/declaration-piral.js +5 -3
- package/lib/apps/declaration-piral.js.map +1 -1
- package/lib/apps/new-pilet.js +40 -39
- package/lib/apps/new-pilet.js.map +1 -1
- package/lib/apps/new-piral.js +21 -20
- package/lib/apps/new-piral.js.map +1 -1
- package/lib/apps/pack-pilet.js +6 -4
- package/lib/apps/pack-pilet.js.map +1 -1
- package/lib/apps/publish-pilet.js +48 -47
- package/lib/apps/publish-pilet.js.map +1 -1
- package/lib/apps/publish-piral.js +23 -22
- package/lib/apps/publish-piral.js.map +1 -1
- package/lib/apps/upgrade-pilet.js +34 -33
- package/lib/apps/upgrade-pilet.js.map +1 -1
- package/lib/apps/upgrade-piral.js +20 -19
- package/lib/apps/upgrade-piral.js.map +1 -1
- package/lib/apps/validate-pilet.js +13 -11
- package/lib/apps/validate-pilet.js.map +1 -1
- package/lib/apps/validate-piral.js +12 -10
- package/lib/apps/validate-piral.js.map +1 -1
- package/lib/bundler.js +18 -18
- package/lib/bundler.js.map +1 -1
- package/lib/cli.js +2 -2
- package/lib/cli.js.map +1 -1
- package/lib/commands.js +12 -12
- package/lib/commands.js.map +1 -1
- package/lib/common/archive.js +8 -8
- package/lib/common/archive.js.map +1 -1
- package/lib/common/browser.js +2 -2
- package/lib/common/browser.js.map +1 -1
- package/lib/common/clients/lerna.js +4 -4
- package/lib/common/clients/lerna.js.map +1 -1
- package/lib/common/clients/npm.js +12 -12
- package/lib/common/clients/npm.js.map +1 -1
- package/lib/common/clients/pnpm.js +5 -5
- package/lib/common/clients/pnpm.js.map +1 -1
- package/lib/common/clients/yarn.js +5 -5
- package/lib/common/clients/yarn.js.map +1 -1
- package/lib/common/compatibility.js +9 -9
- package/lib/common/compatibility.js.map +1 -1
- package/lib/common/config.d.ts +5 -1
- package/lib/common/config.js +2 -1
- package/lib/common/config.js.map +1 -1
- package/lib/common/declaration.js +19 -19
- package/lib/common/declaration.js.map +1 -1
- package/lib/common/emulator.js +23 -23
- package/lib/common/emulator.js.map +1 -1
- package/lib/common/envs.js +3 -3
- package/lib/common/envs.js.map +1 -1
- package/lib/common/hash.d.ts +1 -0
- package/lib/common/hash.js +8 -3
- package/lib/common/hash.js.map +1 -1
- package/lib/common/http.d.ts +1 -0
- package/lib/common/http.js +28 -14
- package/lib/common/http.js.map +1 -1
- package/lib/common/injectors.js +4 -4
- package/lib/common/injectors.js.map +1 -1
- package/lib/common/inspect.js +4 -4
- package/lib/common/inspect.js.map +1 -1
- package/lib/common/io.d.ts +1 -1
- package/lib/common/io.js +114 -93
- package/lib/common/io.js.map +1 -1
- package/lib/common/language.js +2 -2
- package/lib/common/language.js.map +1 -1
- package/lib/common/log.js +8 -8
- package/lib/common/log.js.map +1 -1
- package/lib/common/npm.js +43 -43
- package/lib/common/npm.js.map +1 -1
- package/lib/common/pack.js +18 -18
- package/lib/common/pack.js.map +1 -1
- package/lib/common/package.d.ts +3 -1
- package/lib/common/package.js +181 -80
- package/lib/common/package.js.map +1 -1
- package/lib/common/patcher.js +20 -20
- package/lib/common/patcher.js.map +1 -1
- package/lib/common/port.js +3 -3
- package/lib/common/port.js.map +1 -1
- package/lib/common/rules.js +4 -4
- package/lib/common/rules.js.map +1 -1
- package/lib/common/scaffold.js +15 -15
- package/lib/common/scaffold.js.map +1 -1
- package/lib/common/scripts.js +5 -5
- package/lib/common/scripts.js.map +1 -1
- package/lib/common/template.js +4 -4
- package/lib/common/template.js.map +1 -1
- package/lib/external/index.js +1369 -611
- package/lib/helpers.js +1 -1
- package/lib/helpers.js.map +1 -1
- package/lib/inject.js +2 -2
- package/lib/inject.js.map +1 -1
- package/lib/injectors/pilet.d.ts +1 -10
- package/lib/injectors/pilet.js +74 -27
- package/lib/injectors/pilet.js.map +1 -1
- package/lib/injectors/piral.js +4 -4
- package/lib/injectors/piral.js.map +1 -1
- package/lib/messages.d.ts +7 -2
- package/lib/messages.js +7 -2
- package/lib/messages.js.map +1 -1
- package/lib/pb-cli.js +1 -1
- package/lib/pb-cli.js.map +1 -1
- package/lib/pilet-cli.js +1 -1
- package/lib/pilet-cli.js.map +1 -1
- package/lib/piral-cli.js +1 -1
- package/lib/piral-cli.js.map +1 -1
- package/lib/plugin.js +10 -10
- package/lib/plugin.js.map +1 -1
- package/lib/release.js +3 -3
- package/lib/release.js.map +1 -1
- package/lib/resolvers.js +13 -13
- package/lib/resolvers.js.map +1 -1
- package/lib/rules/index.js +7 -7
- package/lib/rules/index.js.map +1 -1
- package/lib/rules/pilet-has-externals-as-peers.js +3 -3
- package/lib/rules/pilet-has-externals-as-peers.js.map +1 -1
- package/lib/rules/pilet-has-no-self-reference.js +1 -1
- package/lib/rules/pilet-has-no-self-reference.js.map +1 -1
- package/lib/rules/pilet-stays-small.js +3 -3
- package/lib/rules/pilet-stays-small.js.map +1 -1
- package/lib/rules/pilet-uses-latest-piral.js +1 -1
- package/lib/rules/pilet-uses-latest-piral.js.map +1 -1
- package/lib/rules/piral-entry-ends-with-html.js +1 -1
- package/lib/rules/piral-entry-ends-with-html.js.map +1 -1
- package/lib/rules/piral-has-valid-files.js +5 -5
- package/lib/rules/piral-has-valid-files.js.map +1 -1
- package/lib/runner.js +1 -1
- package/lib/runner.js.map +1 -1
- package/lib/select.js +6 -6
- package/lib/select.js.map +1 -1
- package/lib/types/common.d.ts +8 -0
- package/lib/types/public.d.ts +4 -2
- package/package.json +2 -2
- package/src/apps/build-pilet.ts +8 -5
- package/src/apps/build-piral.ts +4 -3
- package/src/apps/debug-pilet.ts +5 -4
- package/src/apps/debug-piral.ts +2 -1
- package/src/apps/declaration-piral.ts +3 -1
- package/src/apps/new-pilet.ts +3 -2
- package/src/apps/new-piral.ts +2 -1
- package/src/apps/pack-pilet.ts +3 -1
- package/src/apps/publish-pilet.ts +6 -5
- package/src/apps/publish-piral.ts +3 -2
- package/src/apps/upgrade-pilet.ts +4 -3
- package/src/apps/upgrade-piral.ts +2 -1
- package/src/apps/validate-pilet.ts +5 -2
- package/src/apps/validate-piral.ts +3 -1
- package/src/bundler.test.ts +18 -22
- package/src/common/config.ts +6 -1
- package/src/common/hash.ts +5 -0
- package/src/common/http.ts +18 -4
- package/src/common/io.ts +56 -33
- package/src/common/package.ts +118 -8
- package/src/helpers.ts +1 -1
- package/src/injectors/pilet.ts +82 -22
- package/src/messages.ts +7 -2
- package/src/types/common.ts +9 -0
- package/src/types/public.ts +4 -1
package/lib/api.js
CHANGED
|
@@ -40,10 +40,10 @@ function maybeWithFlags(commandName, setter) {
|
|
|
40
40
|
}
|
|
41
41
|
function withFlags(commandName, setter) {
|
|
42
42
|
if (typeof commandName !== 'string') {
|
|
43
|
-
common_1.log('apiCommandNameInvalid_0200', 'flags');
|
|
43
|
+
(0, common_1.log)('apiCommandNameInvalid_0200', 'flags');
|
|
44
44
|
}
|
|
45
45
|
else if (typeof setter !== 'function') {
|
|
46
|
-
common_1.log('apiArgumentInvalid_0201', 'setter', 'flags');
|
|
46
|
+
(0, common_1.log)('apiArgumentInvalid_0201', 'setter', 'flags');
|
|
47
47
|
}
|
|
48
48
|
else {
|
|
49
49
|
findAll(commandName, (command) => {
|
|
@@ -56,10 +56,10 @@ function withFlags(commandName, setter) {
|
|
|
56
56
|
exports.withFlags = withFlags;
|
|
57
57
|
function wrapCommand(commandName, wrapper) {
|
|
58
58
|
if (typeof commandName !== 'string') {
|
|
59
|
-
common_1.log('apiCommandNameInvalid_0200', 'command');
|
|
59
|
+
(0, common_1.log)('apiCommandNameInvalid_0200', 'command');
|
|
60
60
|
}
|
|
61
61
|
else if (typeof wrapper !== 'function') {
|
|
62
|
-
common_1.log('apiArgumentInvalid_0201', 'wrapper', 'command');
|
|
62
|
+
(0, common_1.log)('apiArgumentInvalid_0201', 'wrapper', 'command');
|
|
63
63
|
}
|
|
64
64
|
else {
|
|
65
65
|
findAll(commandName, (command) => {
|
|
@@ -72,10 +72,10 @@ function wrapCommand(commandName, wrapper) {
|
|
|
72
72
|
exports.wrapCommand = wrapCommand;
|
|
73
73
|
function beforeCommand(commandName, before) {
|
|
74
74
|
if (typeof commandName !== 'string') {
|
|
75
|
-
common_1.log('apiCommandNameInvalid_0200', 'before command');
|
|
75
|
+
(0, common_1.log)('apiCommandNameInvalid_0200', 'before command');
|
|
76
76
|
}
|
|
77
77
|
else if (typeof before !== 'function') {
|
|
78
|
-
common_1.log('apiArgumentInvalid_0201', 'before', 'before command');
|
|
78
|
+
(0, common_1.log)('apiArgumentInvalid_0201', 'before', 'before command');
|
|
79
79
|
}
|
|
80
80
|
else {
|
|
81
81
|
wrapCommand(commandName, (args, current) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -88,10 +88,10 @@ function beforeCommand(commandName, before) {
|
|
|
88
88
|
exports.beforeCommand = beforeCommand;
|
|
89
89
|
function afterCommand(commandName, after) {
|
|
90
90
|
if (typeof commandName !== 'string') {
|
|
91
|
-
common_1.log('apiCommandNameInvalid_0200', 'after command');
|
|
91
|
+
(0, common_1.log)('apiCommandNameInvalid_0200', 'after command');
|
|
92
92
|
}
|
|
93
93
|
else if (typeof after !== 'function') {
|
|
94
|
-
common_1.log('apiArgumentInvalid_0201', 'after', 'after command');
|
|
94
|
+
(0, common_1.log)('apiArgumentInvalid_0201', 'after', 'after command');
|
|
95
95
|
}
|
|
96
96
|
else {
|
|
97
97
|
wrapCommand(commandName, (args, current) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -104,52 +104,52 @@ function afterCommand(commandName, after) {
|
|
|
104
104
|
exports.afterCommand = afterCommand;
|
|
105
105
|
function withPiralRule(name, run) {
|
|
106
106
|
if (typeof name !== 'string') {
|
|
107
|
-
common_1.log('apiValidateNameInvalid_0202', 'Piral');
|
|
107
|
+
(0, common_1.log)('apiValidateNameInvalid_0202', 'Piral');
|
|
108
108
|
}
|
|
109
109
|
else if (typeof run !== 'function') {
|
|
110
|
-
common_1.log('apiValidateRunInvalid_0203', 'Piral');
|
|
110
|
+
(0, common_1.log)('apiValidateRunInvalid_0203', 'Piral');
|
|
111
111
|
}
|
|
112
112
|
else {
|
|
113
|
-
rules_1.addPiralRule({ name, run });
|
|
113
|
+
(0, rules_1.addPiralRule)({ name, run });
|
|
114
114
|
}
|
|
115
115
|
return this;
|
|
116
116
|
}
|
|
117
117
|
exports.withPiralRule = withPiralRule;
|
|
118
118
|
function withPiletRule(name, run) {
|
|
119
119
|
if (typeof name !== 'string') {
|
|
120
|
-
common_1.log('apiValidateNameInvalid_0202', 'pilet');
|
|
120
|
+
(0, common_1.log)('apiValidateNameInvalid_0202', 'pilet');
|
|
121
121
|
}
|
|
122
122
|
else if (typeof run !== 'function') {
|
|
123
|
-
common_1.log('apiValidateRunInvalid_0203', 'pilet');
|
|
123
|
+
(0, common_1.log)('apiValidateRunInvalid_0203', 'pilet');
|
|
124
124
|
}
|
|
125
125
|
else {
|
|
126
|
-
rules_1.addPiletRule({ name, run });
|
|
126
|
+
(0, rules_1.addPiletRule)({ name, run });
|
|
127
127
|
}
|
|
128
128
|
return this;
|
|
129
129
|
}
|
|
130
130
|
exports.withPiletRule = withPiletRule;
|
|
131
131
|
function withPatcher(packageName, patch) {
|
|
132
132
|
if (typeof packageName !== 'string') {
|
|
133
|
-
common_1.log('apiPatchInvalid_0204', 'packageName');
|
|
133
|
+
(0, common_1.log)('apiPatchInvalid_0204', 'packageName');
|
|
134
134
|
}
|
|
135
135
|
else if (typeof patch !== 'function') {
|
|
136
|
-
common_1.log('apiPatchInvalid_0204', 'patch');
|
|
136
|
+
(0, common_1.log)('apiPatchInvalid_0204', 'patch');
|
|
137
137
|
}
|
|
138
138
|
else {
|
|
139
|
-
common_1.installPatch(packageName, patch);
|
|
139
|
+
(0, common_1.installPatch)(packageName, patch);
|
|
140
140
|
}
|
|
141
141
|
return this;
|
|
142
142
|
}
|
|
143
143
|
exports.withPatcher = withPatcher;
|
|
144
144
|
function withBundler(name, actions) {
|
|
145
145
|
if (typeof name !== 'string') {
|
|
146
|
-
common_1.log('apiBundlerInvalid_0206', 'bundlerName');
|
|
146
|
+
(0, common_1.log)('apiBundlerInvalid_0206', 'bundlerName');
|
|
147
147
|
}
|
|
148
148
|
else if (typeof actions !== 'object') {
|
|
149
|
-
common_1.log('apiBundlerInvalid_0206', 'bundler');
|
|
149
|
+
(0, common_1.log)('apiBundlerInvalid_0206', 'bundler');
|
|
150
150
|
}
|
|
151
151
|
else {
|
|
152
|
-
bundler_1.setBundler({
|
|
152
|
+
(0, bundler_1.setBundler)({
|
|
153
153
|
name,
|
|
154
154
|
actions,
|
|
155
155
|
});
|
|
@@ -163,13 +163,13 @@ function withBundler(name, actions) {
|
|
|
163
163
|
exports.withBundler = withBundler;
|
|
164
164
|
function withReleaseProvider(name, action) {
|
|
165
165
|
if (typeof name !== 'string') {
|
|
166
|
-
common_1.log('apiReleaseProviderInvalid_0207', 'providerName');
|
|
166
|
+
(0, common_1.log)('apiReleaseProviderInvalid_0207', 'providerName');
|
|
167
167
|
}
|
|
168
168
|
else if (typeof action !== 'object') {
|
|
169
|
-
common_1.log('apiReleaseProviderInvalid_0207', 'provider');
|
|
169
|
+
(0, common_1.log)('apiReleaseProviderInvalid_0207', 'provider');
|
|
170
170
|
}
|
|
171
171
|
else {
|
|
172
|
-
release_1.setReleaseProvider({
|
|
172
|
+
(0, release_1.setReleaseProvider)({
|
|
173
173
|
name,
|
|
174
174
|
action,
|
|
175
175
|
});
|
package/lib/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":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,IAAA,YAAG,EAAC,gCAAgC,EAAE,cAAc,CAAC,CAAC;KACvD;SAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QACrC,IAAA,YAAG,EAAC,gCAAgC,EAAE,UAAU,CAAC,CAAC;KACnD;SAAM;QACL,IAAA,4BAAkB,EAAC;YACjB,IAAI;YACJ,MAAM;SACP,CAAC,CAAC;KACJ;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAbD,kDAaC"}
|
package/lib/apps/build-pilet.js
CHANGED
|
@@ -23,29 +23,30 @@ exports.buildPiletDefaults = {
|
|
|
23
23
|
sourceMaps: true,
|
|
24
24
|
contentHash: true,
|
|
25
25
|
optimizeModules: false,
|
|
26
|
-
schemaVersion:
|
|
26
|
+
schemaVersion: common_1.config.schemaVersion,
|
|
27
27
|
declaration: true,
|
|
28
28
|
};
|
|
29
29
|
function buildPilet(baseDir = process.cwd(), options = {}) {
|
|
30
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
31
31
|
const { entry = exports.buildPiletDefaults.entry, target = exports.buildPiletDefaults.target, minify = exports.buildPiletDefaults.minify, sourceMaps = exports.buildPiletDefaults.sourceMaps, contentHash = exports.buildPiletDefaults.contentHash, logLevel = exports.buildPiletDefaults.logLevel, fresh = exports.buildPiletDefaults.fresh, optimizeModules = exports.buildPiletDefaults.optimizeModules, schemaVersion = exports.buildPiletDefaults.schemaVersion, declaration = exports.buildPiletDefaults.declaration, _ = {}, bundlerName, app, } = options;
|
|
32
|
-
|
|
33
|
-
common_1.
|
|
34
|
-
|
|
32
|
+
const fullBase = (0, path_1.resolve)(process.cwd(), baseDir);
|
|
33
|
+
(0, common_1.setLogLevel)(logLevel);
|
|
34
|
+
(0, common_1.progress)('Reading configuration ...');
|
|
35
|
+
const allEntries = yield (0, common_1.matchAnyPilet)(fullBase, [entry]);
|
|
35
36
|
if (allEntries.length === 0) {
|
|
36
|
-
common_1.fail('entryFileMissing_0077');
|
|
37
|
+
(0, common_1.fail)('entryFileMissing_0077');
|
|
37
38
|
}
|
|
38
39
|
const entryModule = allEntries.shift();
|
|
39
|
-
const targetDir = path_1.dirname(entryModule);
|
|
40
|
-
const { peerDependencies, peerModules, root, appPackage, piletPackage, ignored } = yield common_1.retrievePiletData(targetDir, app);
|
|
40
|
+
const targetDir = (0, path_1.dirname)(entryModule);
|
|
41
|
+
const { peerDependencies, peerModules, root, appPackage, piletPackage, ignored, importmap } = yield (0, common_1.retrievePiletData)(targetDir, app);
|
|
41
42
|
const externals = [...Object.keys(peerDependencies), ...peerModules];
|
|
42
|
-
const outDir = path_1.dirname(path_1.resolve(
|
|
43
|
+
const outDir = (0, path_1.dirname)((0, path_1.resolve)(fullBase, target));
|
|
43
44
|
if (fresh) {
|
|
44
|
-
common_1.progress('Removing output directory ...');
|
|
45
|
-
yield common_1.removeDirectory(outDir);
|
|
45
|
+
(0, common_1.progress)('Removing output directory ...');
|
|
46
|
+
yield (0, common_1.removeDirectory)(outDir);
|
|
46
47
|
}
|
|
47
|
-
common_1.logInfo('Bundle pilet ...');
|
|
48
|
-
yield bundler_1.callPiletBuild({
|
|
48
|
+
(0, common_1.logInfo)('Bundle pilet ...');
|
|
49
|
+
yield (0, bundler_1.callPiletBuild)({
|
|
49
50
|
root,
|
|
50
51
|
piral: appPackage.name,
|
|
51
52
|
optimizeModules,
|
|
@@ -54,18 +55,19 @@ function buildPilet(baseDir = process.cwd(), options = {}) {
|
|
|
54
55
|
minify,
|
|
55
56
|
externals,
|
|
56
57
|
targetDir,
|
|
57
|
-
|
|
58
|
+
importmap,
|
|
59
|
+
outFile: (0, path_1.basename)(target),
|
|
58
60
|
outDir,
|
|
59
|
-
entryModule: `./${path_1.relative(root, entryModule)}`,
|
|
61
|
+
entryModule: `./${(0, path_1.relative)(root, entryModule)}`,
|
|
60
62
|
logLevel,
|
|
61
63
|
version: schemaVersion,
|
|
62
64
|
ignored,
|
|
63
65
|
_,
|
|
64
66
|
}, bundlerName);
|
|
65
67
|
if (declaration) {
|
|
66
|
-
yield common_1.createPiletDeclaration(piletPackage.name, root, entryModule, externals, outDir, common_1.ForceOverwrite.yes, logLevel);
|
|
68
|
+
yield (0, common_1.createPiletDeclaration)(piletPackage.name, root, entryModule, externals, outDir, common_1.ForceOverwrite.yes, logLevel);
|
|
67
69
|
}
|
|
68
|
-
common_1.logDone('Pilet built successfully!');
|
|
70
|
+
(0, common_1.logDone)('Pilet built successfully!');
|
|
69
71
|
});
|
|
70
72
|
}
|
|
71
73
|
exports.buildPilet = buildPilet;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-pilet.js","sourceRoot":"","sources":["../../src/apps/build-pilet.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+BAA4D;AAC5D,oCAAyD;AACzD,wCAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"build-pilet.js","sourceRoot":"","sources":["../../src/apps/build-pilet.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+BAA4D;AAC5D,oCAAyD;AACzD,wCAA4C;AAC5C,sCAYmB;AAwEN,QAAA,kBAAkB,GAAsB;IACnD,KAAK,EAAE,aAAa;IACpB,MAAM,EAAE,iBAAiB;IACzB,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,iBAAS,CAAC,IAAI;IACxB,KAAK,EAAE,KAAK;IACZ,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,IAAI;IACjB,eAAe,EAAE,KAAK;IACtB,aAAa,EAAE,eAAM,CAAC,aAAa;IACnC,WAAW,EAAE,IAAI;CAClB,CAAC;AAEF,SAAsB,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,EAAE,UAA6B,EAAE;;QACvF,MAAM,EACJ,KAAK,GAAG,0BAAkB,CAAC,KAAK,EAChC,MAAM,GAAG,0BAAkB,CAAC,MAAM,EAClC,MAAM,GAAG,0BAAkB,CAAC,MAAM,EAClC,UAAU,GAAG,0BAAkB,CAAC,UAAU,EAC1C,WAAW,GAAG,0BAAkB,CAAC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C,MAAM,CAAC,CAAC;SAC/B;QAED,IAAA,gBAAO,EAAC,kBAAkB,CAAC,CAAC;QAE5B,MAAM,IAAA,wBAAc,EAClB;YACE,IAAI;YACJ,KAAK,EAAE,UAAU,CAAC,IAAI;YACtB,eAAe;YACf,UAAU;YACV,WAAW;YACX,MAAM;YACN,SAAS;YACT,SAAS;YACT,SAAS;YACT,OAAO,EAAE,IAAA,eAAQ,EAAC,MAAM,CAAC;YACzB,MAAM;YACN,WAAW,EAAE,KAAK,IAAA,eAAQ,EAAC,IAAI,EAAE,WAAW,CAAC,EAAE;YAC/C,QAAQ;YACR,OAAO,EAAE,aAAa;YACtB,OAAO;YACP,CAAC;SACF,EACD,WAAW,CACZ,CAAC;QAEF,IAAI,WAAW,EAAE;YACf,MAAM,IAAA,+BAAsB,EAAC,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,uBAAc,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;SACrH;QAED,IAAA,gBAAO,EAAC,2BAA2B,CAAC,CAAC;IACvC,CAAC;CAAA;AApED,gCAoEC"}
|
package/lib/apps/build-piral.js
CHANGED
|
@@ -18,17 +18,17 @@ const releaseName = 'release';
|
|
|
18
18
|
const emulatorName = 'emulator';
|
|
19
19
|
const emulatorSourcesName = 'emulator-sources';
|
|
20
20
|
function getDestination(entryFiles, target) {
|
|
21
|
-
const isdir = path_1.extname(target) !== '.html';
|
|
21
|
+
const isdir = (0, path_1.extname)(target) !== '.html';
|
|
22
22
|
if (isdir) {
|
|
23
23
|
return {
|
|
24
24
|
outDir: target,
|
|
25
|
-
outFile: path_1.basename(entryFiles),
|
|
25
|
+
outFile: (0, path_1.basename)(entryFiles),
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
else {
|
|
29
29
|
return {
|
|
30
|
-
outDir: path_1.dirname(target),
|
|
31
|
-
outFile: path_1.basename(target),
|
|
30
|
+
outDir: (0, path_1.dirname)(target),
|
|
31
|
+
outFile: (0, path_1.basename)(target),
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -49,37 +49,38 @@ function runLifecycle(root, scripts, type) {
|
|
|
49
49
|
return __awaiter(this, void 0, void 0, function* () {
|
|
50
50
|
const script = scripts === null || scripts === void 0 ? void 0 : scripts[type];
|
|
51
51
|
if (script) {
|
|
52
|
-
common_1.log('generalDebug_0003', `Running "${type}" ("${script}") ...`);
|
|
53
|
-
yield common_1.runScript(script, root);
|
|
54
|
-
common_1.log('generalDebug_0003', `Finished running "${type}".`);
|
|
52
|
+
(0, common_1.log)('generalDebug_0003', `Running "${type}" ("${script}") ...`);
|
|
53
|
+
yield (0, common_1.runScript)(script, root);
|
|
54
|
+
(0, common_1.log)('generalDebug_0003', `Finished running "${type}".`);
|
|
55
55
|
}
|
|
56
56
|
else {
|
|
57
|
-
common_1.log('generalDebug_0003', `No script for "${type}" found ...`);
|
|
57
|
+
(0, common_1.log)('generalDebug_0003', `No script for "${type}" found ...`);
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
function buildPiral(baseDir = process.cwd(), options = {}) {
|
|
62
62
|
return __awaiter(this, void 0, void 0, function* () {
|
|
63
63
|
const { entry = exports.buildPiralDefaults.entry, target = exports.buildPiralDefaults.target, publicUrl = exports.buildPiralDefaults.publicUrl, logLevel = exports.buildPiralDefaults.logLevel, minify = exports.buildPiralDefaults.minify, sourceMaps = exports.buildPiralDefaults.sourceMaps, contentHash = exports.buildPiralDefaults.contentHash, subdir = exports.buildPiralDefaults.subdir, fresh = exports.buildPiralDefaults.fresh, type = exports.buildPiralDefaults.type, optimizeModules = exports.buildPiralDefaults.optimizeModules, _ = {}, bundlerName, } = options;
|
|
64
|
-
|
|
65
|
-
common_1.progress('Reading configuration ...');
|
|
64
|
+
const fullBase = (0, path_1.resolve)(process.cwd(), baseDir);
|
|
66
65
|
const useSubdir = type === 'all' || subdir;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
yield common_1.
|
|
66
|
+
(0, common_1.setLogLevel)(logLevel);
|
|
67
|
+
(0, common_1.progress)('Reading configuration ...');
|
|
68
|
+
const entryFiles = yield (0, common_1.retrievePiralRoot)(fullBase, entry);
|
|
69
|
+
const { name, root, ignored, externals, scripts } = yield (0, common_1.retrievePiletsInfo)(entryFiles);
|
|
70
|
+
const dest = getDestination(entryFiles, (0, path_1.resolve)(fullBase, target));
|
|
71
|
+
yield (0, common_1.checkCliCompatibility)(root);
|
|
71
72
|
if (fresh) {
|
|
72
|
-
common_1.progress('Removing output directory ...');
|
|
73
|
-
yield common_1.removeDirectory(dest.outDir);
|
|
73
|
+
(0, common_1.progress)('Removing output directory ...');
|
|
74
|
+
yield (0, common_1.removeDirectory)(dest.outDir);
|
|
74
75
|
}
|
|
75
76
|
// everything except release -> build emulator
|
|
76
77
|
if (type !== releaseName) {
|
|
77
|
-
const targetDir = useSubdir ? path_1.join(dest.outDir, emulatorName) : dest.outDir;
|
|
78
|
-
common_1.progress('Starting emulator build ...');
|
|
78
|
+
const targetDir = useSubdir ? (0, path_1.join)(dest.outDir, emulatorName) : dest.outDir;
|
|
79
|
+
(0, common_1.progress)('Starting emulator build ...');
|
|
79
80
|
// since we create this anyway let's just pretend we want to have it clean!
|
|
80
|
-
yield common_1.removeDirectory(targetDir);
|
|
81
|
-
common_1.logInfo(`Bundle ${emulatorName} ...`);
|
|
82
|
-
const { dir: outDir, name: outFile } = yield bundler_1.callPiralBuild({
|
|
81
|
+
yield (0, common_1.removeDirectory)(targetDir);
|
|
82
|
+
(0, common_1.logInfo)(`Bundle ${emulatorName} ...`);
|
|
83
|
+
const { dir: outDir, name: outFile } = yield (0, bundler_1.callPiralBuild)({
|
|
83
84
|
root,
|
|
84
85
|
piral: name,
|
|
85
86
|
emulator: true,
|
|
@@ -90,7 +91,7 @@ function buildPiral(baseDir = process.cwd(), options = {}) {
|
|
|
90
91
|
externals,
|
|
91
92
|
publicUrl,
|
|
92
93
|
outFile: dest.outFile,
|
|
93
|
-
outDir: path_1.join(targetDir, 'app'),
|
|
94
|
+
outDir: (0, path_1.join)(targetDir, 'app'),
|
|
94
95
|
entryFiles,
|
|
95
96
|
logLevel,
|
|
96
97
|
ignored,
|
|
@@ -98,24 +99,24 @@ function buildPiral(baseDir = process.cwd(), options = {}) {
|
|
|
98
99
|
}, bundlerName);
|
|
99
100
|
yield runLifecycle(root, scripts, 'piral:postbuild');
|
|
100
101
|
yield runLifecycle(root, scripts, `piral:postbuild-${emulatorName}`);
|
|
101
|
-
const rootDir = yield common_1.createEmulatorSources(root, outDir, outFile, logLevel);
|
|
102
|
+
const rootDir = yield (0, common_1.createEmulatorSources)(root, outDir, outFile, logLevel);
|
|
102
103
|
if (type !== emulatorSourcesName) {
|
|
103
|
-
yield common_1.packageEmulator(rootDir);
|
|
104
|
-
common_1.logDone(`Emulator sources available in "${rootDir}".`);
|
|
104
|
+
yield (0, common_1.packageEmulator)(rootDir);
|
|
105
|
+
(0, common_1.logDone)(`Emulator sources available in "${rootDir}".`);
|
|
105
106
|
}
|
|
106
107
|
else {
|
|
107
|
-
common_1.logDone(`Emulator package available in "${rootDir}".`);
|
|
108
|
+
(0, common_1.logDone)(`Emulator package available in "${rootDir}".`);
|
|
108
109
|
}
|
|
109
|
-
common_1.logReset();
|
|
110
|
+
(0, common_1.logReset)();
|
|
110
111
|
}
|
|
111
112
|
// everything except emulator and emulator-soruces -> build release
|
|
112
113
|
if (type !== emulatorName && type !== emulatorSourcesName) {
|
|
113
|
-
const targetDir = useSubdir ? path_1.join(dest.outDir, releaseName) : dest.outDir;
|
|
114
|
-
common_1.progress('Starting release build ...');
|
|
114
|
+
const targetDir = useSubdir ? (0, path_1.join)(dest.outDir, releaseName) : dest.outDir;
|
|
115
|
+
(0, common_1.progress)('Starting release build ...');
|
|
115
116
|
// since we create this anyway let's just pretend we want to have it clean!
|
|
116
|
-
yield common_1.removeDirectory(targetDir);
|
|
117
|
-
common_1.logInfo(`Bundle ${releaseName} ...`);
|
|
118
|
-
const { dir: outDir } = yield bundler_1.callPiralBuild({
|
|
117
|
+
yield (0, common_1.removeDirectory)(targetDir);
|
|
118
|
+
(0, common_1.logInfo)(`Bundle ${releaseName} ...`);
|
|
119
|
+
const { dir: outDir } = yield (0, bundler_1.callPiralBuild)({
|
|
119
120
|
root,
|
|
120
121
|
piral: name,
|
|
121
122
|
emulator: false,
|
|
@@ -134,8 +135,8 @@ function buildPiral(baseDir = process.cwd(), options = {}) {
|
|
|
134
135
|
}, bundlerName);
|
|
135
136
|
yield runLifecycle(root, scripts, 'piral:postbuild');
|
|
136
137
|
yield runLifecycle(root, scripts, `piral:postbuild-${releaseName}`);
|
|
137
|
-
common_1.logDone(`Files for publication available in "${outDir}".`);
|
|
138
|
-
common_1.logReset();
|
|
138
|
+
(0, common_1.logDone)(`Files for publication available in "${outDir}".`);
|
|
139
|
+
(0, common_1.logReset)();
|
|
139
140
|
}
|
|
140
141
|
});
|
|
141
142
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-piral.js","sourceRoot":"","sources":["../../src/apps/build-piral.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+BAAiE;AACjE,wCAA4C;AAC5C,oCAAqD;AACrD,sCAcmB;AAEnB,MAAM,WAAW,GAAG,SAAS,CAAC;AAC9B,MAAM,YAAY,GAAG,UAAU,CAAC;AAChC,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAO/C,SAAS,cAAc,CAAC,UAAkB,EAAE,MAAc;IACxD,MAAM,KAAK,GAAG,cAAO,
|
|
1
|
+
{"version":3,"file":"build-piral.js","sourceRoot":"","sources":["../../src/apps/build-piral.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+BAAiE;AACjE,wCAA4C;AAC5C,oCAAqD;AACrD,sCAcmB;AAEnB,MAAM,WAAW,GAAG,SAAS,CAAC;AAC9B,MAAM,YAAY,GAAG,UAAU,CAAC;AAChC,MAAM,mBAA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efaults = {
|
|
|
22
22
|
port: 1234,
|
|
23
23
|
hmr: true,
|
|
24
24
|
optimizeModules: false,
|
|
25
|
-
schemaVersion:
|
|
25
|
+
schemaVersion: common_1.config.schemaVersion,
|
|
26
26
|
};
|
|
27
|
-
const injectorName = path_1.resolve(__dirname, '../injectors/pilet.js');
|
|
27
|
+
const injectorName = (0, path_1.resolve)(__dirname, '../injectors/pilet.js');
|
|
28
28
|
function getOrMakeAppDir({ emulator, piral, externals, appFile }, logLevel) {
|
|
29
29
|
return __awaiter(this, void 0, void 0, function* () {
|
|
30
30
|
if (!emulator) {
|
|
31
31
|
const packageJson = require.resolve(`${piral}/package.json`);
|
|
32
|
-
const cwd = path_1.resolve(packageJson, '..');
|
|
33
|
-
const { dir } = yield bundler_1.callDebugPiralFromMonoRepo({
|
|
32
|
+
const cwd = (0, path_1.resolve)(packageJson, '..');
|
|
33
|
+
const { dir } = yield (0, bundler_1.callDebugPiralFromMonoRepo)({
|
|
34
34
|
root: cwd,
|
|
35
35
|
optimizeModules: false,
|
|
36
36
|
ignored: [],
|
|
@@ -42,7 +42,7 @@ function getOrMakeAppDir({ emulator, piral, externals, appFile }, logLevel) {
|
|
|
42
42
|
});
|
|
43
43
|
return dir;
|
|
44
44
|
}
|
|
45
|
-
return path_1.dirname(appFile);
|
|
45
|
+
return (0, path_1.dirname)(appFile);
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
function checkSanity(pilets) {
|
|
@@ -50,57 +50,58 @@ function checkSanity(pilets) {
|
|
|
50
50
|
const previous = pilets[i - 1];
|
|
51
51
|
const current = pilets[i];
|
|
52
52
|
if (previous.piral !== current.piral) {
|
|
53
|
-
return common_1.log('piletMultiDebugAppShellDifferent_0301', previous.piral, current.piral);
|
|
53
|
+
return (0, common_1.log)('piletMultiDebugAppShellDifferent_0301', previous.piral, current.piral);
|
|
54
54
|
}
|
|
55
55
|
else if (previous.appVersion !== current.appVersion) {
|
|
56
|
-
return common_1.log('piletMultiDebugAppShellVersions_0302', previous.appVersion, current.appVersion);
|
|
56
|
+
return (0, common_1.log)('piletMultiDebugAppShellVersions_0302', previous.appVersion, current.appVersion);
|
|
57
57
|
}
|
|
58
58
|
else if (previous.externals.length !== current.externals.length) {
|
|
59
|
-
return common_1.log('piletMultiDebugExternalsDifferent_0303', previous.externals, current.externals);
|
|
59
|
+
return (0, common_1.log)('piletMultiDebugExternalsDifferent_0303', previous.externals, current.externals);
|
|
60
60
|
}
|
|
61
61
|
else if (previous.externals.some((m) => !current.externals.includes(m))) {
|
|
62
|
-
return common_1.log('piletMultiDebugExternalsDifferent_0303', previous.externals, current.externals);
|
|
62
|
+
return (0, common_1.log)('piletMultiDebugExternalsDifferent_0303', previous.externals, current.externals);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
function debugPilet(baseDir = process.cwd(), options = {}) {
|
|
67
67
|
return __awaiter(this, void 0, void 0, function* () {
|
|
68
68
|
const { entry = exports.debugPiletDefaults.entry, port = exports.debugPiletDefaults.port, open = exports.debugPiletDefaults.open, hmr = exports.debugPiletDefaults.hmr, logLevel = exports.debugPiletDefaults.logLevel, optimizeModules = exports.debugPiletDefaults.optimizeModules, schemaVersion = exports.debugPiletDefaults.schemaVersion, _ = {}, bundlerName, app, feed, } = options;
|
|
69
|
-
common_1.setLogLevel(logLevel);
|
|
70
|
-
common_1.progress('Reading configuration ...');
|
|
71
|
-
const krasConfig = kras_1.readKrasConfig({ port }, kras_1.krasrc);
|
|
69
|
+
(0, common_1.setLogLevel)(logLevel);
|
|
70
|
+
(0, common_1.progress)('Reading configuration ...');
|
|
71
|
+
const krasConfig = (0, kras_1.readKrasConfig)({ port }, kras_1.krasrc);
|
|
72
72
|
const api = common_1.config.piletApi;
|
|
73
73
|
const entryList = Array.isArray(entry) ? entry : [entry];
|
|
74
74
|
const multi = entryList.length > 1 || entryList[0].indexOf('*') !== -1;
|
|
75
|
-
common_1.log('generalDebug_0003', `Looking for (${multi ? 'multi' : 'single'}) "${entryList.join('", "')}" in "${baseDir}".`);
|
|
76
|
-
const allEntries = yield common_1.
|
|
77
|
-
common_1.log('generalDebug_0003', `Found the following entries: ${allEntries.join(', ')}`);
|
|
75
|
+
(0, common_1.log)('generalDebug_0003', `Looking for (${multi ? 'multi' : 'single'}) "${entryList.join('", "')}" in "${baseDir}".`);
|
|
76
|
+
const allEntries = yield (0, common_1.matchAnyPilet)(baseDir, entryList);
|
|
77
|
+
(0, common_1.log)('generalDebug_0003', `Found the following entries: ${allEntries.join(', ')}`);
|
|
78
78
|
if (krasConfig.sources === undefined) {
|
|
79
79
|
krasConfig.sources = [];
|
|
80
80
|
}
|
|
81
81
|
if (allEntries.length === 0) {
|
|
82
|
-
common_1.fail('entryFileMissing_0077');
|
|
82
|
+
(0, common_1.fail)('entryFileMissing_0077');
|
|
83
83
|
}
|
|
84
84
|
const pilets = yield Promise.all(allEntries.map((entryModule) => __awaiter(this, void 0, void 0, function* () {
|
|
85
|
-
const targetDir = path_1.dirname(entryModule);
|
|
86
|
-
const { peerDependencies, peerModules, root, appPackage, appFile, ignored, emulator } = yield common_1.retrievePiletData(targetDir, app);
|
|
85
|
+
const targetDir = (0, path_1.dirname)(entryModule);
|
|
86
|
+
const { peerDependencies, peerModules, root, appPackage, appFile, ignored, emulator, importmap } = yield (0, common_1.retrievePiletData)(targetDir, app);
|
|
87
87
|
const externals = [...Object.keys(peerDependencies), ...peerModules];
|
|
88
|
-
const mocks = path_1.join(targetDir, 'mocks');
|
|
89
|
-
const exists = yield common_1.checkExistingDirectory(mocks);
|
|
88
|
+
const mocks = (0, path_1.join)(targetDir, 'mocks');
|
|
89
|
+
const exists = yield (0, common_1.checkExistingDirectory)(mocks);
|
|
90
90
|
if (exists) {
|
|
91
91
|
if (krasConfig.directory === undefined) {
|
|
92
92
|
krasConfig.directory = mocks;
|
|
93
93
|
}
|
|
94
94
|
krasConfig.sources.push(mocks);
|
|
95
95
|
}
|
|
96
|
-
const bundler = yield bundler_1.callPiletDebug({
|
|
96
|
+
const bundler = yield (0, bundler_1.callPiletDebug)({
|
|
97
97
|
root,
|
|
98
98
|
piral: appPackage.name,
|
|
99
99
|
optimizeModules,
|
|
100
100
|
hmr,
|
|
101
101
|
externals,
|
|
102
102
|
targetDir,
|
|
103
|
-
|
|
103
|
+
importmap,
|
|
104
|
+
entryModule: `./${(0, path_1.relative)(root, entryModule)}`,
|
|
104
105
|
logLevel,
|
|
105
106
|
version: schemaVersion,
|
|
106
107
|
ignored,
|
|
@@ -141,13 +142,13 @@ function debugPilet(baseDir = process.cwd(), options = {}) {
|
|
|
141
142
|
};
|
|
142
143
|
krasConfig.map['/'] = '';
|
|
143
144
|
krasConfig.map[api] = '';
|
|
144
|
-
krasConfig.injectors = common_1.reorderInjectors(injectorName, injectorConfig, krasConfig.injectors);
|
|
145
|
-
common_1.log('generalVerbose_0004', `Using kras with configuration: ${JSON.stringify(krasConfig, undefined, 2)}`);
|
|
146
|
-
const krasServer = kras_1.buildKrasWithCli(krasConfig);
|
|
145
|
+
krasConfig.injectors = (0, common_1.reorderInjectors)(injectorName, injectorConfig, krasConfig.injectors);
|
|
146
|
+
(0, common_1.log)('generalVerbose_0004', `Using kras with configuration: ${JSON.stringify(krasConfig, undefined, 2)}`);
|
|
147
|
+
const krasServer = (0, kras_1.buildKrasWithCli)(krasConfig);
|
|
147
148
|
krasServer.removeAllListeners('open');
|
|
148
|
-
krasServer.on('open', common_1.notifyServerOnline(pilets.map((p) => p.bundler), krasConfig.api));
|
|
149
|
+
krasServer.on('open', (0, common_1.notifyServerOnline)(pilets.map((p) => p.bundler), krasConfig.api));
|
|
149
150
|
yield krasServer.start();
|
|
150
|
-
common_1.openBrowser(open, port);
|
|
151
|
+
(0, common_1.openBrowser)(open, port);
|
|
151
152
|
yield new Promise((resolve) => krasServer.on('close', resolve));
|
|
152
153
|
});
|
|
153
154
|
}
|