@teambit/bvm.commands.link 0.0.33 → 0.0.36
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/dist/link.js +20 -4
- package/dist/link.js.map +1 -1
- package/dist/tsconfig.json +32 -0
- package/link.ts +20 -5
- package/package-tar/teambit-bvm.commands.link-0.0.36.tgz +0 -0
- package/package.json +4 -3
- package/preview-1655128580080.js +1 -0
- package/tsconfig.json +8 -2
- package/package-tar/teambit-bvm.commands.link-0.0.33.tgz +0 -0
- package/preview-1647776012433.js +0 -1
package/dist/link.js
CHANGED
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.command = exports.LinkCmd = void 0;
|
|
16
16
|
const chalk_1 = __importDefault(require("chalk"));
|
|
17
17
|
const bvm_link_1 = require("@teambit/bvm.link");
|
|
18
|
+
const bvm_reporter_1 = require("@teambit/bvm.reporter");
|
|
18
19
|
class LinkCmd {
|
|
19
20
|
constructor() {
|
|
20
21
|
this.aliases = ['link'];
|
|
@@ -27,6 +28,13 @@ class LinkCmd {
|
|
|
27
28
|
yargs.positional('name', {
|
|
28
29
|
describe: 'name of the link',
|
|
29
30
|
type: 'string'
|
|
31
|
+
})
|
|
32
|
+
.option({
|
|
33
|
+
skipUpdatePath: {
|
|
34
|
+
describe: "don't add the bvm directory to the system PATH",
|
|
35
|
+
default: false,
|
|
36
|
+
type: 'boolean',
|
|
37
|
+
}
|
|
30
38
|
})
|
|
31
39
|
.positional('bit-version', {
|
|
32
40
|
describe: 'version to link',
|
|
@@ -41,10 +49,10 @@ class LinkCmd {
|
|
|
41
49
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
50
|
let results;
|
|
43
51
|
if (!args.name) {
|
|
44
|
-
results = yield (0, bvm_link_1.linkAll)();
|
|
52
|
+
results = yield (0, bvm_link_1.linkAll)({ addToPathIfMissing: !args.skipUpdatePath });
|
|
45
53
|
}
|
|
46
54
|
else {
|
|
47
|
-
results = [yield (0, bvm_link_1.linkOne)(args.name, args.bitVersion, true)];
|
|
55
|
+
results = [yield (0, bvm_link_1.linkOne)(args.name, args.bitVersion, { addToConfig: true, addToPathIfMissing: !args.skipUpdatePath })];
|
|
48
56
|
}
|
|
49
57
|
printOutput(results, args.verbose);
|
|
50
58
|
return;
|
|
@@ -54,13 +62,21 @@ class LinkCmd {
|
|
|
54
62
|
}
|
|
55
63
|
exports.LinkCmd = LinkCmd;
|
|
56
64
|
function formatOutput(linkResults, verbose = false) {
|
|
65
|
+
var _a;
|
|
57
66
|
const links = linkResults.map(result => {
|
|
58
67
|
const linkTarget = verbose ? chalk_1.default.cyan(`(${result.generatedLink.target})`) : '';
|
|
59
68
|
const linkSource = verbose ? chalk_1.default.cyan(`(${result.generatedLink.source})`) : '';
|
|
60
69
|
return (`name ${chalk_1.default.green(result.linkName)}${linkTarget} points to version ${chalk_1.default.green(result.version)}${linkSource}`);
|
|
61
70
|
});
|
|
62
|
-
|
|
63
|
-
|
|
71
|
+
links.push(`successfully linked binaries\n`);
|
|
72
|
+
const pathExtenderReport = (_a = linkResults.find((result) => result.pathExtenderReport)) === null || _a === void 0 ? void 0 : _a.pathExtenderReport;
|
|
73
|
+
if (pathExtenderReport) {
|
|
74
|
+
const output = (0, bvm_reporter_1.renderPathExtenderReport)(pathExtenderReport);
|
|
75
|
+
if (output) {
|
|
76
|
+
links.push(output);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return links.filter(msg => msg).join('\n');
|
|
64
80
|
}
|
|
65
81
|
function printOutput(linkResults, verbose = false) {
|
|
66
82
|
const output = formatOutput(linkResults, verbose);
|
package/dist/link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","sourceRoot":"","sources":["../link.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,kDAA0B;AAC1B,gDAA+D;
|
|
1
|
+
{"version":3,"file":"link.js","sourceRoot":"","sources":["../link.ts"],"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AY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACpB,OAAO,MAAM,CAAC;AAChB,CAAC;AAEY,QAAA,OAAO,GAAI,IAAI,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"lib": [
|
|
4
|
+
"es2019",
|
|
5
|
+
"DOM",
|
|
6
|
+
"ES6",
|
|
7
|
+
"DOM.Iterable"
|
|
8
|
+
],
|
|
9
|
+
"target": "es2015",
|
|
10
|
+
"module": "CommonJS",
|
|
11
|
+
"jsx": "react",
|
|
12
|
+
"allowJs": true,
|
|
13
|
+
"composite": true,
|
|
14
|
+
"declaration": true,
|
|
15
|
+
"sourceMap": true,
|
|
16
|
+
"skipLibCheck": true,
|
|
17
|
+
"experimentalDecorators": true,
|
|
18
|
+
"outDir": "dist",
|
|
19
|
+
"moduleResolution": "node",
|
|
20
|
+
"esModuleInterop": true,
|
|
21
|
+
"rootDir": ".",
|
|
22
|
+
"resolveJsonModule": true
|
|
23
|
+
},
|
|
24
|
+
"exclude": [
|
|
25
|
+
"dist",
|
|
26
|
+
"package.json"
|
|
27
|
+
],
|
|
28
|
+
"include": [
|
|
29
|
+
"**/*",
|
|
30
|
+
"**/*.json"
|
|
31
|
+
]
|
|
32
|
+
}
|
package/link.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type {CommandModule, Argv} from 'yargs';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import {linkAll, linkOne, LinkResult} from '@teambit/bvm.link';
|
|
4
|
+
import { renderPathExtenderReport } from '@teambit/bvm.reporter';
|
|
4
5
|
|
|
5
6
|
export class LinkCmd implements CommandModule {
|
|
6
7
|
aliases = ['link'];
|
|
@@ -13,6 +14,13 @@ export class LinkCmd implements CommandModule {
|
|
|
13
14
|
describe: 'name of the link',
|
|
14
15
|
type: 'string'
|
|
15
16
|
})
|
|
17
|
+
.option({
|
|
18
|
+
skipUpdatePath: {
|
|
19
|
+
describe: "don't add the bvm directory to the system PATH",
|
|
20
|
+
default: false,
|
|
21
|
+
type: 'boolean',
|
|
22
|
+
}
|
|
23
|
+
})
|
|
16
24
|
.positional('bit-version', {
|
|
17
25
|
describe: 'version to link',
|
|
18
26
|
type: 'string',
|
|
@@ -25,9 +33,9 @@ export class LinkCmd implements CommandModule {
|
|
|
25
33
|
async handler(args) {
|
|
26
34
|
let results;
|
|
27
35
|
if (!args.name){
|
|
28
|
-
results = await linkAll();
|
|
36
|
+
results = await linkAll({ addToPathIfMissing: !args.skipUpdatePath });
|
|
29
37
|
} else {
|
|
30
|
-
results = [await linkOne(args.name, args.bitVersion, true)]
|
|
38
|
+
results = [await linkOne(args.name, args.bitVersion, { addToConfig: true, addToPathIfMissing: !args.skipUpdatePath })]
|
|
31
39
|
}
|
|
32
40
|
printOutput(results, args.verbose);
|
|
33
41
|
return;
|
|
@@ -41,9 +49,16 @@ function formatOutput(linkResults: LinkResult[], verbose = false): string {
|
|
|
41
49
|
|
|
42
50
|
return(`name ${chalk.green(result.linkName)}${linkTarget} points to version ${chalk.green(result.version)}${linkSource}`);
|
|
43
51
|
});
|
|
52
|
+
links.push(`successfully linked binaries\n`)
|
|
44
53
|
|
|
45
|
-
const
|
|
46
|
-
|
|
54
|
+
const pathExtenderReport = linkResults.find((result) => result.pathExtenderReport)?.pathExtenderReport
|
|
55
|
+
if (pathExtenderReport) {
|
|
56
|
+
const output = renderPathExtenderReport(pathExtenderReport)
|
|
57
|
+
if (output) {
|
|
58
|
+
links.push(output)
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return links.filter(msg => msg).join('\n');
|
|
47
62
|
}
|
|
48
63
|
|
|
49
64
|
function printOutput(linkResults: LinkResult[], verbose = false): string {
|
|
@@ -52,4 +67,4 @@ function printOutput(linkResults: LinkResult[], verbose = false): string {
|
|
|
52
67
|
return output;
|
|
53
68
|
}
|
|
54
69
|
|
|
55
|
-
export const command = new LinkCmd();
|
|
70
|
+
export const command = new LinkCmd();
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/bvm.commands.link",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.36",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/bvm/commands/link",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.bvm",
|
|
8
8
|
"name": "commands/link",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.36"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "4.1.0",
|
|
13
13
|
"yargs": "17.0.1",
|
|
14
|
-
"@teambit/bvm.link": "0.0.
|
|
14
|
+
"@teambit/bvm.link": "0.0.36",
|
|
15
|
+
"@teambit/bvm.reporter": "0.0.1"
|
|
15
16
|
},
|
|
16
17
|
"devDependencies": {
|
|
17
18
|
"@types/chalk": "0.4.31",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const overview = [require('/Users/giladshoham/Library/Caches/Bit/capsules/f3900c88552f465f36e94e9f684555a848de0105/teambit.bvm_commands_link@0.0.36/dist/link.docs.md')]
|
package/tsconfig.json
CHANGED
|
@@ -7,13 +7,14 @@
|
|
|
7
7
|
"DOM.Iterable"
|
|
8
8
|
],
|
|
9
9
|
"target": "es2015",
|
|
10
|
-
"module": "
|
|
10
|
+
"module": "CommonJS",
|
|
11
11
|
"jsx": "react",
|
|
12
12
|
"allowJs": true,
|
|
13
13
|
"composite": true,
|
|
14
14
|
"declaration": true,
|
|
15
15
|
"sourceMap": true,
|
|
16
16
|
"skipLibCheck": true,
|
|
17
|
+
"experimentalDecorators": true,
|
|
17
18
|
"outDir": "dist",
|
|
18
19
|
"moduleResolution": "node",
|
|
19
20
|
"esModuleInterop": true,
|
|
@@ -21,6 +22,11 @@
|
|
|
21
22
|
"resolveJsonModule": true
|
|
22
23
|
},
|
|
23
24
|
"exclude": [
|
|
24
|
-
"dist"
|
|
25
|
+
"dist",
|
|
26
|
+
"package.json"
|
|
27
|
+
],
|
|
28
|
+
"include": [
|
|
29
|
+
"**/*",
|
|
30
|
+
"**/*.json"
|
|
25
31
|
]
|
|
26
32
|
}
|
|
Binary file
|
package/preview-1647776012433.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const overview = [require('/Users/guysaar/Library/Caches/Bit/capsules/b01b7f7e45244ee1cf3449194097a51aa9a60e58/teambit.bvm_commands_link@0.0.33/dist/link.docs.md')]
|