piral-cli 0.15.0-alpha.4122 → 0.15.0-alpha.4284
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/README.md +7 -5
- package/lib/apps/debug-pilet.js +28 -42
- package/lib/apps/debug-pilet.js.map +1 -1
- package/lib/apps/debug-piral.js +20 -34
- package/lib/apps/debug-piral.js.map +1 -1
- package/lib/apps/new-pilet.js +5 -9
- package/lib/apps/new-pilet.js.map +1 -1
- package/lib/apps/new-piral.js +9 -3
- package/lib/apps/new-piral.js.map +1 -1
- package/lib/apps/publish-pilet.d.ts +4 -0
- package/lib/apps/publish-pilet.js +4 -3
- package/lib/apps/publish-pilet.js.map +1 -1
- package/lib/apps/publish-piral.d.ts +4 -0
- package/lib/apps/publish-piral.js +9 -7
- package/lib/apps/publish-piral.js.map +1 -1
- package/lib/apps/upgrade-pilet.js +2 -8
- package/lib/apps/upgrade-pilet.js.map +1 -1
- package/lib/apps/upgrade-piral.js +1 -1
- package/lib/apps/upgrade-piral.js.map +1 -1
- package/lib/bundler.js +1 -1
- package/lib/bundler.js.map +1 -1
- package/lib/commands.js +14 -6
- package/lib/commands.js.map +1 -1
- package/lib/common/browser.d.ts +1 -0
- package/lib/common/browser.js +16 -10
- package/lib/common/browser.js.map +1 -1
- package/lib/common/clients/index.d.ts +19 -0
- package/lib/common/clients/index.js +40 -0
- package/lib/common/clients/index.js.map +1 -0
- package/lib/common/clients/lerna.d.ts +6 -1
- package/lib/common/clients/lerna.js +67 -3
- package/lib/common/clients/lerna.js.map +1 -1
- package/lib/common/clients/npm.d.ts +4 -1
- package/lib/common/clients/npm.js +37 -16
- package/lib/common/clients/npm.js.map +1 -1
- package/lib/common/clients/pnpm.d.ts +4 -0
- package/lib/common/clients/pnpm.js +43 -9
- package/lib/common/clients/pnpm.js.map +1 -1
- package/lib/common/clients/rush.d.ts +6 -0
- package/lib/common/clients/rush.js +118 -0
- package/lib/common/clients/rush.js.map +1 -0
- package/lib/common/clients/yarn.d.ts +4 -0
- package/lib/common/clients/yarn.js +45 -11
- package/lib/common/clients/yarn.js.map +1 -1
- package/lib/common/declaration.js +12 -9
- package/lib/common/declaration.js.map +1 -1
- package/lib/common/emulator.js +2 -2
- package/lib/common/emulator.js.map +1 -1
- package/lib/common/http.d.ts +4 -2
- package/lib/common/http.js +35 -16
- package/lib/common/http.js.map +1 -1
- package/lib/common/info.d.ts +4 -0
- package/lib/common/info.js +6 -1
- package/lib/common/info.js.map +1 -1
- package/lib/common/injectors.d.ts +36 -7
- package/lib/common/injectors.js +39 -11
- package/lib/common/injectors.js.map +1 -1
- package/lib/common/inspect.js +2 -1
- package/lib/common/inspect.js.map +1 -1
- package/lib/common/interactive.d.ts +9 -0
- package/lib/common/interactive.js +33 -1
- package/lib/common/interactive.js.map +1 -1
- package/lib/common/io.js +1 -1
- package/lib/common/io.js.map +1 -1
- package/lib/common/log.d.ts +1 -0
- package/lib/common/log.js +9 -2
- package/lib/common/log.js.map +1 -1
- package/lib/common/npm.d.ts +9 -16
- package/lib/common/npm.js +110 -152
- package/lib/common/npm.js.map +1 -1
- package/lib/common/pack.js +1 -1
- package/lib/common/pack.js.map +1 -1
- package/lib/common/package.d.ts +6 -6
- package/lib/common/package.js +13 -4
- package/lib/common/package.js.map +1 -1
- package/lib/common/port.d.ts +1 -0
- package/lib/common/port.js +11 -1
- package/lib/common/port.js.map +1 -1
- package/lib/common/scaffold.js +5 -2
- package/lib/common/scaffold.js.map +1 -1
- package/lib/common/version.js +4 -4
- package/lib/common/version.js.map +1 -1
- package/lib/external/index.js +1982 -92
- package/lib/helpers.d.ts +3 -3
- package/lib/helpers.js +10 -10
- package/lib/helpers.js.map +1 -1
- package/lib/injectors/{pilet.d.ts → pilet-injector.d.ts} +1 -0
- package/lib/injectors/{pilet.js → pilet-injector.js} +29 -31
- package/lib/injectors/pilet-injector.js.map +1 -0
- package/lib/injectors/{piral.d.ts → piral-injector.d.ts} +1 -0
- package/lib/injectors/{piral.js → piral-injector.js} +20 -22
- package/lib/injectors/piral-injector.js.map +1 -0
- package/lib/messages.d.ts +79 -1
- package/lib/messages.js +89 -2
- package/lib/messages.js.map +1 -1
- package/lib/plugin.js +27 -2
- package/lib/plugin.js.map +1 -1
- package/lib/release.d.ts +1 -1
- package/lib/release.js +35 -3
- package/lib/release.js.map +1 -1
- package/lib/types/common.d.ts +1 -1
- package/lib/types/internal.d.ts +9 -1
- package/lib/types/public.d.ts +1 -1
- package/package.json +6 -4
- package/src/apps/debug-pilet.ts +28 -48
- package/src/apps/debug-piral.ts +22 -37
- package/src/apps/new-pilet.ts +9 -14
- package/src/apps/new-piral.ts +16 -5
- package/src/apps/publish-pilet.ts +10 -3
- package/src/apps/publish-piral.ts +21 -6
- package/src/apps/upgrade-pilet.ts +4 -12
- package/src/apps/upgrade-piral.ts +2 -2
- package/src/bundler.test.ts +1 -1
- package/src/bundler.ts +2 -2
- package/src/commands.ts +17 -9
- package/src/common/browser.ts +12 -8
- package/src/common/clients/index.ts +33 -0
- package/src/common/clients/lerna.ts +61 -1
- package/src/common/clients/npm.ts +32 -15
- package/src/common/clients/pnpm.ts +39 -10
- package/src/common/clients/rush.ts +111 -0
- package/src/common/clients/yarn.ts +41 -12
- package/src/common/declaration.ts +15 -9
- package/src/common/emulator.ts +3 -3
- package/src/common/http.ts +56 -19
- package/src/common/info.ts +6 -1
- package/src/common/injectors.ts +46 -17
- package/src/common/inspect.ts +2 -1
- package/src/common/interactive.test.ts +3 -0
- package/src/common/interactive.ts +49 -1
- package/src/common/io.ts +1 -1
- package/src/common/log.ts +9 -1
- package/src/common/npm.test.ts +109 -76
- package/src/common/npm.ts +119 -146
- package/src/common/pack.test.ts +1 -1
- package/src/common/pack.ts +2 -2
- package/src/common/package.ts +19 -10
- package/src/common/port.ts +10 -0
- package/src/common/scaffold.ts +6 -2
- package/src/common/version.ts +4 -4
- package/src/external/index.ts +2 -1
- package/src/helpers.test.ts +5 -5
- package/src/helpers.ts +7 -7
- package/src/injectors/{pilet.test.ts → pilet-injector.test.ts} +10 -1
- package/src/injectors/{pilet.ts → pilet-injector.ts} +36 -28
- package/src/injectors/{piral.test.ts → piral-injector.test.ts} +5 -1
- package/src/injectors/{piral.ts → piral-injector.ts} +24 -17
- package/src/messages.ts +88 -1
- package/src/plugin.ts +34 -5
- package/src/release.ts +47 -5
- package/src/types/common.ts +1 -1
- package/src/types/internal.ts +6 -1
- package/src/types/public.ts +1 -1
- package/lib/injectors/pilet.js.map +0 -1
- package/lib/injectors/piral.js.map +0 -1
package/src/helpers.ts
CHANGED
|
@@ -15,7 +15,7 @@ export const publishModeKeys: Array<PiletPublishScheme> = ['none', 'basic', 'bea
|
|
|
15
15
|
export const fromKeys: Array<PiletPublishSource> = ['local', 'remote', 'npm'];
|
|
16
16
|
export const piralBuildTypeKeys: Array<PiralBuildType> = ['all', 'release', 'emulator', 'emulator-sources'];
|
|
17
17
|
export const piletBuildTypeKeys: Array<PiletBuildType> = ['default', 'standalone', 'manifest'];
|
|
18
|
-
export const clientTypeKeys: Array<NpmClientType> = ['npm', 'pnpm', 'yarn'];
|
|
18
|
+
export const clientTypeKeys: Array<NpmClientType> = ['npm', 'pnpm', 'yarn', 'lerna', 'rush'];
|
|
19
19
|
export const bundlerKeys: Array<string> = ['none', ...bundlerNames];
|
|
20
20
|
export const availableBundlers: Array<string> = [];
|
|
21
21
|
export const availableReleaseProviders: Array<string> = [];
|
|
@@ -42,10 +42,10 @@ export function keyOfForceOverwrite(value: ForceOverwrite) {
|
|
|
42
42
|
return forceOverwriteKeys[0];
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
export const
|
|
45
|
+
export const sourceLanguageKeys = Object.keys(SourceLanguage).filter((m) => typeof SourceLanguage[m] === 'number');
|
|
46
46
|
|
|
47
|
-
export function
|
|
48
|
-
for (const piletLanguageKey of
|
|
47
|
+
export function valueOfSourceLanguage(key: string): SourceLanguage {
|
|
48
|
+
for (const piletLanguageKey of sourceLanguageKeys) {
|
|
49
49
|
if (piletLanguageKey === key) {
|
|
50
50
|
return SourceLanguage[piletLanguageKey];
|
|
51
51
|
}
|
|
@@ -54,12 +54,12 @@ export function valueOfPiletLanguage(key: string): SourceLanguage {
|
|
|
54
54
|
return SourceLanguage.ts;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
export function
|
|
58
|
-
for (const piletLanguageKey of
|
|
57
|
+
export function keyOfSourceLanguage(value: SourceLanguage) {
|
|
58
|
+
for (const piletLanguageKey of sourceLanguageKeys) {
|
|
59
59
|
if (SourceLanguage[piletLanguageKey] === value) {
|
|
60
60
|
return piletLanguageKey;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
return
|
|
64
|
+
return sourceLanguageKeys[0];
|
|
65
65
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
2
|
import { KrasRequest } from 'kras';
|
|
3
|
-
import PiletInjector from './pilet';
|
|
3
|
+
import PiletInjector from './pilet-injector';
|
|
4
4
|
|
|
5
5
|
const optionsMock = {
|
|
6
6
|
pilets: [],
|
|
@@ -9,6 +9,9 @@ const optionsMock = {
|
|
|
9
9
|
api: '',
|
|
10
10
|
app: '',
|
|
11
11
|
active: true,
|
|
12
|
+
publicUrl: '/',
|
|
13
|
+
meta: '',
|
|
14
|
+
headers: {},
|
|
12
15
|
};
|
|
13
16
|
|
|
14
17
|
const configMock: any = {
|
|
@@ -89,6 +92,9 @@ describe('Piral-CLI piral injector', () => {
|
|
|
89
92
|
publicUrl: '/',
|
|
90
93
|
api: 'http://someFakeApi:1234',
|
|
91
94
|
app: '',
|
|
95
|
+
publicUrl: '/',
|
|
96
|
+
meta: '',
|
|
97
|
+
headers: {},
|
|
92
98
|
active: true,
|
|
93
99
|
};
|
|
94
100
|
|
|
@@ -118,6 +124,9 @@ describe('Piral-CLI piral injector', () => {
|
|
|
118
124
|
publicUrl: '/',
|
|
119
125
|
api: 'http://someFakeApi:1234',
|
|
120
126
|
app: '',
|
|
127
|
+
publicUrl: '/',
|
|
128
|
+
meta: '',
|
|
129
|
+
headers: {},
|
|
121
130
|
active: true,
|
|
122
131
|
};
|
|
123
132
|
const core = new EventEmitter();
|
|
@@ -6,7 +6,7 @@ import { KrasInjector, KrasResponse, KrasRequest, KrasInjectorConfig, KrasConfig
|
|
|
6
6
|
import { log } from '../common/log';
|
|
7
7
|
import { getPiletSpecMeta } from '../common/spec';
|
|
8
8
|
import { config } from '../common/config';
|
|
9
|
-
import { axios, mime } from '../external';
|
|
9
|
+
import { axios, mime, jju } from '../external';
|
|
10
10
|
import { Bundler } from '../types';
|
|
11
11
|
|
|
12
12
|
const { host } = config;
|
|
@@ -24,6 +24,7 @@ export interface PiletInjectorConfig extends KrasInjectorConfig {
|
|
|
24
24
|
api: string;
|
|
25
25
|
app: string;
|
|
26
26
|
feed?: string;
|
|
27
|
+
headers: Record<string, string>;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
interface PiletMetadata {
|
|
@@ -35,8 +36,8 @@ function fillPiletMeta(pilet: Pilet, basePath: string, metaFile: string) {
|
|
|
35
36
|
const { root, bundler } = pilet;
|
|
36
37
|
const metaPath = join(root, metaFile);
|
|
37
38
|
const packagePath = join(root, 'package.json');
|
|
38
|
-
const def =
|
|
39
|
-
const metaOverride = existsSync(metaPath) ?
|
|
39
|
+
const def = jju.parse(readFileSync(packagePath, 'utf8'));
|
|
40
|
+
const metaOverride = existsSync(metaPath) ? jju.parse(readFileSync(metaPath, 'utf8')) : undefined;
|
|
40
41
|
const file = bundler.bundle.name.replace(/^[\/\\]/, '');
|
|
41
42
|
const target = join(bundler.bundle.dir, file);
|
|
42
43
|
const url = new URL(file, basePath);
|
|
@@ -79,40 +80,44 @@ export default class PiletInjector implements KrasInjector {
|
|
|
79
80
|
|
|
80
81
|
constructor(options: PiletInjectorConfig, config: KrasConfiguration, core: EventEmitter) {
|
|
81
82
|
this.config = options;
|
|
82
|
-
// either take a full URI or make it an absolute path relative to the current origin
|
|
83
|
-
this.piletApi = /^https?:/.test(options.api)
|
|
84
|
-
? options.api
|
|
85
|
-
: `${config.ssl ? 'https' : 'http'}://${host}:${config.port}${options.api}`;
|
|
86
|
-
|
|
87
|
-
const { pilets, api, publicUrl } = options;
|
|
88
|
-
this.indexPath = `${publicUrl}index.html`;
|
|
89
|
-
const cbs = {};
|
|
90
|
-
|
|
91
|
-
core.on('user-connected', (e) => {
|
|
92
|
-
if (e.target === '*' && e.url === api.substring(1)) {
|
|
93
|
-
cbs[e.id] = (msg: string) => e.ws.send(msg);
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
83
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
84
|
+
if (this.config.active) {
|
|
85
|
+
// either take a full URI or make it an absolute path relative to the current origin
|
|
86
|
+
this.piletApi = /^https?:/.test(options.api)
|
|
87
|
+
? options.api
|
|
88
|
+
: `${config.ssl ? 'https' : 'http'}://${host}:${config.port}${options.api}`;
|
|
100
89
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
const meta = fillPiletMeta(p, basePath, options.meta);
|
|
90
|
+
const { pilets, api, publicUrl } = options;
|
|
91
|
+
this.indexPath = `${publicUrl}index.html`;
|
|
92
|
+
const cbs = {};
|
|
105
93
|
|
|
106
|
-
|
|
107
|
-
|
|
94
|
+
core.on('user-connected', (e) => {
|
|
95
|
+
if (e.target === '*' && e.url === api.substring(1)) {
|
|
96
|
+
cbs[e.id] = (msg: string) => e.ws.send(msg);
|
|
108
97
|
}
|
|
109
|
-
})
|
|
110
|
-
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
core.on('user-disconnected', (e) => {
|
|
101
|
+
delete cbs[e.id];
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
pilets.forEach((p, i) =>
|
|
105
|
+
p.bundler.on(() => {
|
|
106
|
+
const basePath = `${this.piletApi}/${i}/`;
|
|
107
|
+
const meta = fillPiletMeta(p, basePath, options.meta);
|
|
108
|
+
|
|
109
|
+
for (const id of Object.keys(cbs)) {
|
|
110
|
+
cbs[id](meta);
|
|
111
|
+
}
|
|
112
|
+
}),
|
|
113
|
+
);
|
|
114
|
+
}
|
|
111
115
|
}
|
|
112
116
|
|
|
113
117
|
get active() {
|
|
114
118
|
return this.config.active;
|
|
115
119
|
}
|
|
120
|
+
|
|
116
121
|
set active(value) {
|
|
117
122
|
this.config.active = value;
|
|
118
123
|
}
|
|
@@ -159,9 +164,12 @@ export default class PiletInjector implements KrasInjector {
|
|
|
159
164
|
}
|
|
160
165
|
|
|
161
166
|
sendContent(content: Buffer | string, type: string, url: string): KrasResponse {
|
|
167
|
+
const { headers } = this.config;
|
|
168
|
+
|
|
162
169
|
return {
|
|
163
170
|
injector: { name: this.name },
|
|
164
171
|
headers: {
|
|
172
|
+
...headers,
|
|
165
173
|
'content-type': type,
|
|
166
174
|
'cache-control': 'no-cache, no-store, must-revalidate',
|
|
167
175
|
pragma: 'no-cache',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import PiralInjector from './piral';
|
|
1
|
+
import PiralInjector from './piral-injector';
|
|
2
2
|
import { KrasRequest, KrasResult } from 'kras';
|
|
3
3
|
import { EventEmitter } from 'events';
|
|
4
4
|
|
|
@@ -37,6 +37,7 @@ describe('Piral-CLI piral injector', () => {
|
|
|
37
37
|
bundler,
|
|
38
38
|
publicUrl: '/',
|
|
39
39
|
active: true,
|
|
40
|
+
headers: {},
|
|
40
41
|
};
|
|
41
42
|
const injector = new PiralInjector(config, undefined, new EventEmitter());
|
|
42
43
|
expect(injector.active).toBeTruthy();
|
|
@@ -48,6 +49,7 @@ describe('Piral-CLI piral injector', () => {
|
|
|
48
49
|
bundler: bundlerMock,
|
|
49
50
|
publicUrl: '/',
|
|
50
51
|
active: true,
|
|
52
|
+
headers: {},
|
|
51
53
|
};
|
|
52
54
|
const injector = new PiralInjector(config, undefined, new EventEmitter());
|
|
53
55
|
|
|
@@ -67,6 +69,7 @@ describe('Piral-CLI piral injector', () => {
|
|
|
67
69
|
bundler: bundlerMock,
|
|
68
70
|
publicUrl: '/',
|
|
69
71
|
active: true,
|
|
72
|
+
headers: {},
|
|
70
73
|
};
|
|
71
74
|
const injector = new PiralInjector(config, undefined, new EventEmitter());
|
|
72
75
|
|
|
@@ -83,6 +86,7 @@ describe('Piral-CLI piral injector', () => {
|
|
|
83
86
|
bundler: bundlerMock,
|
|
84
87
|
publicUrl: '/',
|
|
85
88
|
active: true,
|
|
89
|
+
headers: {},
|
|
86
90
|
};
|
|
87
91
|
const injector = new PiralInjector(config, undefined, new EventEmitter());
|
|
88
92
|
const request: KrasRequest = {
|
|
@@ -14,6 +14,7 @@ export interface PiralInjectorConfig extends KrasInjectorConfig {
|
|
|
14
14
|
bundler: Bundler;
|
|
15
15
|
publicUrl: string;
|
|
16
16
|
feed?: string;
|
|
17
|
+
headers: Record<string, string>;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
export default class PiralInjector implements KrasInjector {
|
|
@@ -21,29 +22,33 @@ export default class PiralInjector implements KrasInjector {
|
|
|
21
22
|
|
|
22
23
|
constructor(options: PiralInjectorConfig, _config: KrasConfiguration, core: EventEmitter) {
|
|
23
24
|
this.config = options;
|
|
24
|
-
const api = '/$events';
|
|
25
|
-
const cbs = {};
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
26
|
+
if (this.config.active) {
|
|
27
|
+
const api = '/$events';
|
|
28
|
+
const cbs = {};
|
|
29
|
+
|
|
30
|
+
core.on('user-connected', (e) => {
|
|
31
|
+
if (e.target === '*' && e.url === api.substring(1)) {
|
|
32
|
+
cbs[e.id] = (msg: string) => e.ws.send(msg);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
core.on('user-disconnected', (e) => {
|
|
37
|
+
delete cbs[e.id];
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
this.config.bundler.on((args) => {
|
|
41
|
+
for (const id of Object.keys(cbs)) {
|
|
42
|
+
cbs[id](JSON.stringify(args));
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
42
46
|
}
|
|
43
47
|
|
|
44
48
|
get active() {
|
|
45
49
|
return this.config.active;
|
|
46
50
|
}
|
|
51
|
+
|
|
47
52
|
set active(value) {
|
|
48
53
|
this.config.active = value;
|
|
49
54
|
}
|
|
@@ -59,9 +64,11 @@ export default class PiralInjector implements KrasInjector {
|
|
|
59
64
|
setOptions() {}
|
|
60
65
|
|
|
61
66
|
sendContent(content: Buffer | string, type: string, url: string): KrasResponse {
|
|
67
|
+
const { headers } = this.config;
|
|
62
68
|
return {
|
|
63
69
|
injector: { name: this.name },
|
|
64
70
|
headers: {
|
|
71
|
+
...headers,
|
|
65
72
|
'content-type': type,
|
|
66
73
|
'cache-control': 'no-cache, no-store, must-revalidate',
|
|
67
74
|
pragma: 'no-cache',
|
package/src/messages.ts
CHANGED
|
@@ -953,6 +953,41 @@ export function cannotFindFile_0046(file: string): QuickMessage {
|
|
|
953
953
|
return [LogLevels.error, '0046', `The file "${file}" does not exist!`];
|
|
954
954
|
}
|
|
955
955
|
|
|
956
|
+
/**
|
|
957
|
+
* @kind Warning
|
|
958
|
+
*
|
|
959
|
+
* @summary
|
|
960
|
+
* Reported when the provided / default port was not available.
|
|
961
|
+
*
|
|
962
|
+
* @abstract
|
|
963
|
+
* By default, the debug commands spawn at the port 1234. However, under certain
|
|
964
|
+
* circumstances (e.g., another debug command running somewhere) this port may not
|
|
965
|
+
* be free.
|
|
966
|
+
*
|
|
967
|
+
* The piral-cli can select a new port, which is free, however, it will still report
|
|
968
|
+
* a warning message in such cases. You can then always abort the current debug
|
|
969
|
+
* process and start a new one - either closing the other run blocking the port or
|
|
970
|
+
* explicitly selecting a new one using the `--port` flag.
|
|
971
|
+
*
|
|
972
|
+
* @see
|
|
973
|
+
* - [Port (computer networking)](https://en.wikipedia.org/wiki/Port_(computer_networking))
|
|
974
|
+
*
|
|
975
|
+
* @example
|
|
976
|
+
* If you start one process to debug an app shell using `piral debug` and another process
|
|
977
|
+
* to debug some pilet using `pilet debug` both processes would want to run on the default
|
|
978
|
+
* port 1234.
|
|
979
|
+
*
|
|
980
|
+
* As a mitigation you can now either be very explicit, e.g., `piral debug --port 1010` and
|
|
981
|
+
* `pilet debug --port 1020` or you can just drop one of the two and always only run a single
|
|
982
|
+
* debug process.
|
|
983
|
+
*
|
|
984
|
+
* In any case, running both without any options also works, but then a new port will be chosen.
|
|
985
|
+
* The output of the Piral CLI will always show you what port is currently used.
|
|
986
|
+
*/
|
|
987
|
+
export function portNotFree_0047(newPort: number, oldPort: number): QuickMessage {
|
|
988
|
+
return [LogLevels.warning, '0047', `The selected port "${oldPort}" is already used. Changed port to "${newPort}".`];
|
|
989
|
+
}
|
|
990
|
+
|
|
956
991
|
/**
|
|
957
992
|
* @kind Warning
|
|
958
993
|
*
|
|
@@ -1846,7 +1881,7 @@ export function packageJsonMissing_0075(): QuickMessage {
|
|
|
1846
1881
|
* The TypeScript declaration generator will take all files as input to
|
|
1847
1882
|
* gather all required information for constructing the API declaration.
|
|
1848
1883
|
*/
|
|
1849
|
-
export function declarationCouldNotBeGenerated_0076(rootDir: string, error: Error): QuickMessage {
|
|
1884
|
+
export function declarationCouldNotBeGenerated_0076(rootDir: string, error: Error | string): QuickMessage {
|
|
1850
1885
|
return [LogLevels.error, '0076', `Could not create the declaration in "${rootDir}". Error: ${error}`];
|
|
1851
1886
|
}
|
|
1852
1887
|
|
|
@@ -2256,6 +2291,58 @@ export function publishEmulatorSourcesInvalid_0114(): QuickMessage {
|
|
|
2256
2291
|
];
|
|
2257
2292
|
}
|
|
2258
2293
|
|
|
2294
|
+
/**
|
|
2295
|
+
* @kind Error
|
|
2296
|
+
*
|
|
2297
|
+
* @summary
|
|
2298
|
+
* The "feed" provider requires a "--fields.url" argument.
|
|
2299
|
+
*
|
|
2300
|
+
* @abstract
|
|
2301
|
+
* The `piral publish --type release` command requires the selection of a suitable
|
|
2302
|
+
* provider for running successfully. The "feed" provider releases the files to
|
|
2303
|
+
* the a Piral Feed Service with the static page feature.
|
|
2304
|
+
*
|
|
2305
|
+
* Make sure to supply the URL for the feed service via the `--fields.url` command
|
|
2306
|
+
* line flag.
|
|
2307
|
+
*
|
|
2308
|
+
* @example
|
|
2309
|
+
* The following command would specify `https://feed.piral.cloud/api/v1/feed/sample/page`
|
|
2310
|
+
* for the feed service:
|
|
2311
|
+
*
|
|
2312
|
+
* ```sh
|
|
2313
|
+
* piral publish --type release --provider feed --fields.url "https://feed.piral.cloud/api/v1/feed/sample/page" --fields.apikey "foobar123"
|
|
2314
|
+
* ```
|
|
2315
|
+
*/
|
|
2316
|
+
export function publishFeedMissingUrl_0115(): QuickMessage {
|
|
2317
|
+
return [LogLevels.error, '0115', `The "feed" provider requires a "--fields.url" argument.`];
|
|
2318
|
+
}
|
|
2319
|
+
|
|
2320
|
+
/**
|
|
2321
|
+
* @kind Error
|
|
2322
|
+
*
|
|
2323
|
+
* @summary
|
|
2324
|
+
* The "feed" provider requires a "--fields.version" argument.
|
|
2325
|
+
*
|
|
2326
|
+
* @abstract
|
|
2327
|
+
* The `piral publish --type release` command requires the selection of a suitable
|
|
2328
|
+
* provider for running successfully. The "feed" provider releases the files to
|
|
2329
|
+
* the a Piral Feed Service with the static page feature.
|
|
2330
|
+
*
|
|
2331
|
+
* Make sure to supply the version either explicitly via the `--fields.version` argument
|
|
2332
|
+
* or implicitly by having the artifacts stored in a sub-directory of the project's root,
|
|
2333
|
+
* which contains a package.json with the version to use.
|
|
2334
|
+
*
|
|
2335
|
+
* @example
|
|
2336
|
+
* The following command would specify version "1.2.3" for the feed service:
|
|
2337
|
+
*
|
|
2338
|
+
* ```sh
|
|
2339
|
+
* piral publish --type release --provider feed --fields.url "..." --fields.apikey "..." --fields.version "1.2.3"
|
|
2340
|
+
* ```
|
|
2341
|
+
*/
|
|
2342
|
+
export function publishFeedMissingVersion_0116(): QuickMessage {
|
|
2343
|
+
return [LogLevels.error, '0116', `The "feed" provider requires either a "--fields.version" argument or a package.json with a version.`];
|
|
2344
|
+
}
|
|
2345
|
+
|
|
2259
2346
|
/**
|
|
2260
2347
|
* @kind Warning
|
|
2261
2348
|
*
|
package/src/plugin.ts
CHANGED
|
@@ -1,10 +1,39 @@
|
|
|
1
1
|
import { readdir, stat } from 'fs';
|
|
2
|
-
import { join, resolve } from 'path';
|
|
3
|
-
import { log } from './common';
|
|
2
|
+
import { join, resolve, sep, posix } from 'path';
|
|
3
|
+
import { cliName, cliVersion, log } from './common';
|
|
4
4
|
import { inject } from './inject';
|
|
5
5
|
|
|
6
|
-
function
|
|
7
|
-
|
|
6
|
+
function getContainerDir() {
|
|
7
|
+
const currentDir = __dirname.split(sep).join(posix.sep);
|
|
8
|
+
|
|
9
|
+
if (!currentDir.includes(`/.pnpm/${cliName}@${cliVersion}/node_modules/${cliName}/`)) {
|
|
10
|
+
return resolve(__dirname, '..', '..');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
async function getLocalPackageDir() {
|
|
17
|
+
const proposedDirs = [
|
|
18
|
+
getContainerDir(),
|
|
19
|
+
resolve(process.cwd(), 'node_modules'),
|
|
20
|
+
resolve(process.cwd(), '..', 'node_modules'),
|
|
21
|
+
resolve(process.cwd(), '..', '..', 'node_modules'),
|
|
22
|
+
resolve(process.cwd(), '..', '..', '..', 'node_modules'),
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
// Right now we always take the first one, but in the future this may be different
|
|
26
|
+
// once we come up with more / better criteria to identify if its a good/valid
|
|
27
|
+
// plugin root directory
|
|
28
|
+
for (const dir of proposedDirs.filter(Boolean)) {
|
|
29
|
+
log('generalDebug_0003', `Checking for potential plugin directory "${dir}" ...`);
|
|
30
|
+
|
|
31
|
+
if (await isDirectory(dir)) {
|
|
32
|
+
return dir;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return undefined;
|
|
8
37
|
}
|
|
9
38
|
|
|
10
39
|
function isDirectory(dir: string) {
|
|
@@ -83,7 +112,7 @@ async function getAllPlugins(rootDir: string): Promise<Array<string>> {
|
|
|
83
112
|
}
|
|
84
113
|
|
|
85
114
|
export async function loadPlugins() {
|
|
86
|
-
const localDir = getLocalPackageDir();
|
|
115
|
+
const localDir = await getLocalPackageDir();
|
|
87
116
|
const allPlugins = await getAllPlugins(localDir);
|
|
88
117
|
|
|
89
118
|
for (const pluginPath of allPlugins) {
|
package/src/release.ts
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
import { basename, resolve } from 'path';
|
|
2
|
-
import { copy, fail } from './common';
|
|
1
|
+
import { basename, dirname, relative, resolve } from 'path';
|
|
2
|
+
import { copy, fail, findFile, FormDataObj, postForm, readBinary } from './common';
|
|
3
3
|
import { availableReleaseProviders } from './helpers';
|
|
4
4
|
import { ReleaseProvider } from './types';
|
|
5
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
|
+
|
|
6
17
|
export interface QualifiedReleaseProvider {
|
|
7
18
|
name: string;
|
|
8
19
|
action: ReleaseProvider;
|
|
@@ -12,7 +23,7 @@ const providers: Record<string, ReleaseProvider> = {
|
|
|
12
23
|
none() {
|
|
13
24
|
return Promise.resolve();
|
|
14
25
|
},
|
|
15
|
-
async xcopy(files, args) {
|
|
26
|
+
async xcopy(_, files, args) {
|
|
16
27
|
const { target } = args;
|
|
17
28
|
|
|
18
29
|
if (!target) {
|
|
@@ -21,6 +32,31 @@ const providers: Record<string, ReleaseProvider> = {
|
|
|
21
32
|
|
|
22
33
|
await Promise.all(files.map(async (file) => copy(file, resolve(target, basename(file)))));
|
|
23
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(file, directory);
|
|
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
|
+
},
|
|
24
60
|
};
|
|
25
61
|
|
|
26
62
|
function findReleaseProvider(providerName: string) {
|
|
@@ -43,7 +79,13 @@ export function setReleaseProvider(provider: QualifiedReleaseProvider) {
|
|
|
43
79
|
}
|
|
44
80
|
}
|
|
45
81
|
|
|
46
|
-
export function publishArtifacts(
|
|
82
|
+
export function publishArtifacts(
|
|
83
|
+
providerName: string,
|
|
84
|
+
directory: string,
|
|
85
|
+
files: Array<string>,
|
|
86
|
+
args: Record<string, string>,
|
|
87
|
+
interactive: boolean,
|
|
88
|
+
) {
|
|
47
89
|
const runRelease = findReleaseProvider(providerName);
|
|
48
|
-
return runRelease(files, args);
|
|
90
|
+
return runRelease(directory, files, args, interactive);
|
|
49
91
|
}
|
package/src/types/common.ts
CHANGED
|
@@ -42,7 +42,7 @@ export interface Bundler {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
export interface ReleaseProvider {
|
|
45
|
-
(files: Array<string>, args: Record<string, string
|
|
45
|
+
(directory: string, files: Array<string>, args: Record<string, string>, interactive: boolean): Promise<void>;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
export interface TemplateFileLocation {
|
package/src/types/internal.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LogLevels } from './common';
|
|
1
|
+
import type { LogLevels, PiletsInfo } from './common';
|
|
2
2
|
|
|
3
3
|
export interface PackageData {
|
|
4
4
|
name: string;
|
|
@@ -13,6 +13,11 @@ export interface PackageData {
|
|
|
13
13
|
email?: string;
|
|
14
14
|
};
|
|
15
15
|
custom?: any;
|
|
16
|
+
pilets?: PiletsInfo;
|
|
17
|
+
piralCLI?: { generated: boolean; version: string };
|
|
18
|
+
dependencies: Record<string, string>;
|
|
19
|
+
peerDependencies: Record<string, string>;
|
|
20
|
+
devDependencies: Record<string, string>;
|
|
16
21
|
}
|
|
17
22
|
|
|
18
23
|
export interface PackageFiles {
|
package/src/types/public.ts
CHANGED
|
@@ -229,7 +229,7 @@ export type PiletBuildType = 'default' | 'standalone' | 'manifest';
|
|
|
229
229
|
|
|
230
230
|
export type PackageType = 'registry' | 'file' | 'git';
|
|
231
231
|
|
|
232
|
-
export type NpmClientType = 'npm' | 'yarn' | 'pnpm';
|
|
232
|
+
export type NpmClientType = 'npm' | 'yarn' | 'pnpm' | 'lerna' | 'rush';
|
|
233
233
|
|
|
234
234
|
export type Framework = 'piral-native' | 'piral' | 'piral-core' | 'piral-base';
|
|
235
235
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pilet.js","sourceRoot":"","sources":["../../src/injectors/pilet.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA0B;AAC1B,+BAA4B;AAE5B,2BAAwD;AAExD,uCAAoC;AACpC,yCAAkD;AAClD,6CAA0C;AAC1C,0CAA0C;AAG1C,MAAM,E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