piral-cli 1.5.0-beta.6658 → 1.5.0-beta.6685
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.d.ts +1 -2
- package/lib/api.js +1 -18
- package/lib/api.js.map +1 -1
- package/lib/apps/build-pilet.js +14 -37
- package/lib/apps/build-pilet.js.map +1 -1
- package/lib/apps/build-piral.js +29 -104
- package/lib/apps/build-piral.js.map +1 -1
- package/lib/apps/debug-pilet.js +8 -2
- package/lib/apps/debug-pilet.js.map +1 -1
- package/lib/apps/debug-piral.js +5 -1
- package/lib/apps/debug-piral.js.map +1 -1
- package/lib/apps/publish-pilet.d.ts +11 -2
- package/lib/apps/publish-pilet.js +16 -43
- package/lib/apps/publish-pilet.js.map +1 -1
- package/lib/apps/publish-piral.d.ts +37 -7
- package/lib/apps/publish-piral.js +62 -47
- package/lib/apps/publish-piral.js.map +1 -1
- package/lib/build/bundler-calls.js +4 -1
- package/lib/build/bundler-calls.js.map +1 -1
- package/lib/commands.js +31 -12
- package/lib/commands.js.map +1 -1
- package/lib/common/constants.d.ts +7 -0
- package/lib/common/constants.js +8 -1
- package/lib/common/constants.js.map +1 -1
- package/lib/common/emulator.js +1 -1
- package/lib/common/emulator.js.map +1 -1
- package/lib/common/http.d.ts +3 -3
- package/lib/common/http.js.map +1 -1
- package/lib/common/index.d.ts +3 -0
- package/lib/common/index.js +3 -0
- package/lib/common/index.js.map +1 -1
- package/lib/common/interactive.d.ts +2 -2
- package/lib/common/pilet.d.ts +31 -0
- package/lib/common/pilet.js +79 -0
- package/lib/common/pilet.js.map +1 -0
- package/lib/common/piral.d.ts +35 -0
- package/lib/common/piral.js +125 -0
- package/lib/common/piral.js.map +1 -0
- package/lib/common/release.d.ts +4 -0
- package/lib/common/release.js +43 -0
- package/lib/common/release.js.map +1 -0
- package/lib/helpers.d.ts +2 -2
- package/lib/helpers.js.map +1 -1
- package/lib/messages.d.ts +19 -0
- package/lib/messages.js +23 -1
- package/lib/messages.js.map +1 -1
- package/lib/platforms/web.js +20 -7
- package/lib/platforms/web.js.map +1 -1
- package/lib/types/common.d.ts +8 -4
- package/lib/types/public.d.ts +2 -3
- package/package.json +2 -2
- package/src/api.ts +0 -17
- package/src/apps/build-pilet.ts +17 -59
- package/src/apps/build-piral.ts +37 -140
- package/src/apps/debug-pilet.ts +10 -3
- package/src/apps/debug-piral.ts +6 -2
- package/src/apps/publish-pilet.ts +35 -62
- package/src/apps/publish-piral.ts +150 -80
- package/src/build/bundler-calls.ts +4 -1
- package/src/commands.ts +34 -15
- package/src/common/constants.ts +7 -0
- package/src/common/emulator.ts +2 -2
- package/src/common/http.ts +3 -3
- package/src/common/index.ts +3 -0
- package/src/common/interactive.ts +2 -2
- package/src/common/pilet.ts +140 -0
- package/src/common/piral.ts +227 -0
- package/src/common/release.ts +62 -0
- package/src/helpers.ts +2 -2
- package/src/messages.ts +22 -0
- package/src/platforms/web.ts +25 -8
- package/src/types/common.ts +9 -4
- package/src/types/public.ts +2 -3
- package/lib/release.d.ts +0 -7
- package/lib/release.js +0 -67
- package/lib/release.js.map +0 -1
- package/src/release.ts +0 -91
package/lib/release.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"release.js","sourceRoot":"","sources":["../src/release.ts"],"names":[],"mappings":";;;AAAA,+BAA4D;AAC5D,qCAAmF;AACnF,uCAAsD;AAGtD,KAAK,UAAU,UAAU,CAAC,SAAiB;IACzC,MAAM,IAAI,GAAG,MAAM,IAAA,iBAAQ,EAAC,SAAS,EAAE,cAAc,CAAC,CAAC;IAEvD,IAAI,CAAC,IAAI,EAAE;QACT,IAAA,aAAI,EAAC,0BAA0B,CAAC,CAAC;KAClC;IAED,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,OAAO,OAAO,CAAC;AACjB,CAAC;AAOD,MAAM,SAAS,GAAoC;IACjD,IAAI;QACF,OAAO,OAAO,CAAC,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AC,CAAC;SACrC;QAED,MAAM,IAAA,iBAAQ,EAAC,GAAG,EAAE,MAAa,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;IAC/E,CAAC;CACF,CAAC;AAEF,SAAS,mBAAmB,CAAC,YAAoB;IAC/C,MAAM,QAAQ,GAAG,SAAS,CAAC,YAAY,CAAC,CAAC;IAEzC,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;QAClC,IAAA,aAAI,EAAC,6BAA6B,EAAE,YAAY,EAAE,mCAAyB,CAAC,CAAC;KAC9E;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,mCAAyB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;AAE1D,SAAgB,kBAAkB,CAAC,QAAkC;IACnE,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC;IAE3C,IAAI,CAAC,mCAAyB,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;QACtD,mCAAyB,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;KAC/C;AACH,CAAC;AAND,gDAMC;AAED,SAAgB,gBAAgB,CAC9B,YAAoB,EACpB,SAAiB,EACjB,KAAoB,EACpB,IAA4B,EAC5B,WAAoB;IAEpB,MAAM,UAAU,GAAG,mBAAmB,CAAC,YAAY,CAAC,CAAC;IACrD,OAAO,UAAU,CAAC,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;AACzD,CAAC;AATD,4CASC"}
|
package/src/release.ts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { basename, dirname, relative, resolve } from 'path';
|
|
2
|
-
import { copy, fail, findFile, FormDataObj, postForm, readBinary } from './common';
|
|
3
|
-
import { availableReleaseProviders } from './helpers';
|
|
4
|
-
import { ReleaseProvider } from './types';
|
|
5
|
-
|
|
6
|
-
async function getVersion(directory: string) {
|
|
7
|
-
const data = await findFile(directory, 'package.json');
|
|
8
|
-
|
|
9
|
-
if (!data) {
|
|
10
|
-
fail('packageJsonNotFound_0020');
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const { version } = require(data);
|
|
14
|
-
return version;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface QualifiedReleaseProvider {
|
|
18
|
-
name: string;
|
|
19
|
-
action: ReleaseProvider;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const providers: Record<string, ReleaseProvider> = {
|
|
23
|
-
none() {
|
|
24
|
-
return Promise.resolve();
|
|
25
|
-
},
|
|
26
|
-
async xcopy(_, files, args) {
|
|
27
|
-
const { target } = args;
|
|
28
|
-
|
|
29
|
-
if (!target) {
|
|
30
|
-
fail('publishXcopyMissingTarget_0112');
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
await Promise.all(files.map(async (file) => copy(file, resolve(target, basename(file)))));
|
|
34
|
-
},
|
|
35
|
-
async feed(directory, files, args, interactive) {
|
|
36
|
-
const { url, apiKey, scheme = 'basic', version = await getVersion(directory) } = args;
|
|
37
|
-
|
|
38
|
-
if (!url) {
|
|
39
|
-
fail('publishFeedMissingUrl_0115');
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (!version) {
|
|
43
|
-
fail('publishFeedMissingVersion_0116');
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const data: FormDataObj = {
|
|
47
|
-
version,
|
|
48
|
-
type: 'custom',
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
for (const file of files) {
|
|
52
|
-
const relPath = relative(directory, file);
|
|
53
|
-
const fileName = basename(file);
|
|
54
|
-
const content = await readBinary(dirname(file), fileName);
|
|
55
|
-
data[relPath] = [content, fileName];
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
await postForm(url, scheme as any, apiKey, data, {}, undefined, interactive);
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
function findReleaseProvider(providerName: string) {
|
|
63
|
-
const provider = providers[providerName];
|
|
64
|
-
|
|
65
|
-
if (typeof provider !== 'function') {
|
|
66
|
-
fail('publishProviderMissing_0113', providerName, availableReleaseProviders);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return provider;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
availableReleaseProviders.push(...Object.keys(providers));
|
|
73
|
-
|
|
74
|
-
export function setReleaseProvider(provider: QualifiedReleaseProvider) {
|
|
75
|
-
providers[provider.name] = provider.action;
|
|
76
|
-
|
|
77
|
-
if (!availableReleaseProviders.includes(provider.name)) {
|
|
78
|
-
availableReleaseProviders.push(provider.name);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export function publishArtifacts(
|
|
83
|
-
providerName: string,
|
|
84
|
-
directory: string,
|
|
85
|
-
files: Array<string>,
|
|
86
|
-
args: Record<string, string>,
|
|
87
|
-
interactive: boolean,
|
|
88
|
-
) {
|
|
89
|
-
const runRelease = findReleaseProvider(providerName);
|
|
90
|
-
return runRelease(directory, files, args, interactive);
|
|
91
|
-
}
|