piral-cli 0.15.0-alpha.4122 → 0.15.0-alpha.4231
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/apps/new-pilet.js +5 -9
- package/lib/apps/new-pilet.js.map +1 -1
- package/lib/apps/new-piral.js +5 -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 +8 -0
- 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 +1 -1
- package/lib/common/http.js +12 -7
- 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/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 +31 -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/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/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.js +1 -1
- package/lib/helpers.js.map +1 -1
- package/lib/injectors/pilet.js +2 -2
- package/lib/injectors/pilet.js.map +1 -1
- package/lib/messages.d.ts +1 -1
- 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 +7 -2
- 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 +5 -3
- package/src/apps/new-pilet.ts +9 -14
- package/src/apps/new-piral.ts +9 -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 +8 -0
- 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 +20 -6
- package/src/common/info.ts +6 -1
- package/src/common/inspect.ts +2 -1
- package/src/common/interactive.test.ts +3 -0
- package/src/common/interactive.ts +48 -1
- package/src/common/io.ts +1 -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/scaffold.ts +6 -2
- package/src/common/version.ts +4 -4
- package/src/external/index.ts +2 -1
- package/src/helpers.ts +1 -1
- package/src/injectors/pilet.ts +3 -3
- package/src/messages.ts +1 -1
- package/src/plugin.ts +34 -5
- package/src/release.ts +10 -2
- package/src/types/common.ts +1 -1
- package/src/types/internal.ts +6 -1
- package/src/types/public.ts +1 -1
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
|
@@ -21,6 +21,9 @@ const providers: Record<string, ReleaseProvider> = {
|
|
|
21
21
|
|
|
22
22
|
await Promise.all(files.map(async (file) => copy(file, resolve(target, basename(file)))));
|
|
23
23
|
},
|
|
24
|
+
async feed(files, args, interactive) {
|
|
25
|
+
//TODO post files to Piral Feed Service
|
|
26
|
+
},
|
|
24
27
|
};
|
|
25
28
|
|
|
26
29
|
function findReleaseProvider(providerName: string) {
|
|
@@ -43,7 +46,12 @@ export function setReleaseProvider(provider: QualifiedReleaseProvider) {
|
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
48
|
|
|
46
|
-
export function publishArtifacts(
|
|
49
|
+
export function publishArtifacts(
|
|
50
|
+
providerName: string,
|
|
51
|
+
files: Array<string>,
|
|
52
|
+
args: Record<string, string>,
|
|
53
|
+
interactive: boolean,
|
|
54
|
+
) {
|
|
47
55
|
const runRelease = findReleaseProvider(providerName);
|
|
48
|
-
return runRelease(files, args);
|
|
56
|
+
return runRelease(files, args, interactive);
|
|
49
57
|
}
|
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
|
+
(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
|
|