@teambit/bvm.link 1.1.5 → 1.2.1
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/bitx-link.spec.ts +36 -0
- package/bitx-link.ts +51 -0
- package/dist/bitx-link.d.ts +18 -0
- package/dist/bitx-link.js +51 -0
- package/dist/bitx-link.js.map +1 -0
- package/dist/bitx-link.spec.d.ts +1 -0
- package/dist/bitx-link.spec.js +37 -0
- package/dist/bitx-link.spec.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/link.d.ts +25 -0
- package/dist/link.docs.md +5 -0
- package/dist/link.js +128 -9
- package/dist/link.js.map +1 -1
- package/dist/{preview-1793888985211.js → preview-1795437384781.js} +1 -1
- package/index.ts +8 -1
- package/link.docs.md +5 -0
- package/link.ts +137 -12
- package/package.json +4 -4
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import os from 'os';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import { getBitxLinkSource, readBitxMetadata, BITX_METADATA_FILE } from './bitx-link';
|
|
5
|
+
|
|
6
|
+
describe('bitx link helpers', () => {
|
|
7
|
+
let root: string;
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
root = fs.mkdtempSync(path.join(os.tmpdir(), 'bvm-bitx-link-'));
|
|
10
|
+
});
|
|
11
|
+
afterEach(() => fs.rmSync(root, { recursive: true, force: true }));
|
|
12
|
+
|
|
13
|
+
describe('getBitxLinkSource', () => {
|
|
14
|
+
it('selects bin/bitx on Unix', () => {
|
|
15
|
+
fs.mkdirSync(path.join(root, 'bin'));
|
|
16
|
+
fs.writeFileSync(path.join(root, 'bin/bitx'), 'native fixture', { mode: 0o755 });
|
|
17
|
+
expect(getBitxLinkSource(root, 'linux')).toEqual(path.join('bin', 'bitx'));
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('selects bin/bitx.exe on Windows', () => {
|
|
21
|
+
fs.mkdirSync(path.join(root, 'bin'));
|
|
22
|
+
fs.writeFileSync(path.join(root, 'bin/bitx.exe'), 'native fixture');
|
|
23
|
+
expect(getBitxLinkSource(root, 'win32')).toEqual(path.join('bin', 'bitx.exe'));
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('fails with a reinstall hint when the executable is missing', () => {
|
|
27
|
+
expect(() => getBitxLinkSource(root, 'linux')).toThrow('bvm install --next --override');
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('reads the metadata file and treats a missing one as not installed', () => {
|
|
32
|
+
expect(readBitxMetadata(root)).toBeUndefined();
|
|
33
|
+
fs.writeFileSync(path.join(root, BITX_METADATA_FILE), JSON.stringify({ version: '0.1.0', node: '22.23.4' }));
|
|
34
|
+
expect(readBitxMetadata(root)).toEqual({ version: '0.1.0', node: '22.23.4' });
|
|
35
|
+
});
|
|
36
|
+
});
|
package/bitx-link.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { BvmError } from '@teambit/bvm.error';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Written to the root of every installed bitx version once its installation completes.
|
|
7
|
+
* A bitx version directory without it is an interrupted installation.
|
|
8
|
+
*/
|
|
9
|
+
export const BITX_METADATA_FILE = 'bvm-bitx.json';
|
|
10
|
+
|
|
11
|
+
export type BitxMetadata = {
|
|
12
|
+
version: string,
|
|
13
|
+
// the npm package the version was installed from, and the platform package that holds the executable
|
|
14
|
+
package: string,
|
|
15
|
+
platformPackage: string,
|
|
16
|
+
// the Node.js version installed for this bitx version (undefined when the system Node.js is used)
|
|
17
|
+
node?: string,
|
|
18
|
+
installedAt: string,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export function getBitxExecutableName(platform = process.platform): string {
|
|
22
|
+
return platform === 'win32' ? 'bitx.exe' : 'bitx';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function readBitxMetadata(versionDir: string): BitxMetadata | undefined {
|
|
26
|
+
try {
|
|
27
|
+
return JSON.parse(fs.readFileSync(path.join(versionDir, BITX_METADATA_FILE), 'utf8'));
|
|
28
|
+
} catch {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The bitx executable inside an installed bitx version, relative to the version directory.
|
|
35
|
+
*/
|
|
36
|
+
export function getBitxLinkSource(versionDir: string, platform = process.platform): string {
|
|
37
|
+
const source = path.join('bin', getBitxExecutableName(platform));
|
|
38
|
+
const filename = path.join(versionDir, source);
|
|
39
|
+
let stat: fs.Stats;
|
|
40
|
+
try {
|
|
41
|
+
stat = fs.statSync(filename);
|
|
42
|
+
} catch (error) {
|
|
43
|
+
if ((error as NodeJS.ErrnoException).code === 'ENOENT') {
|
|
44
|
+
throw new BvmError(`the bitx executable is missing at ${filename}. reinstall bitx with "bvm install --next --override"`);
|
|
45
|
+
}
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
if (!stat.isFile()) throw new BvmError(`the bitx executable is not a regular file: ${filename}`);
|
|
49
|
+
if (platform !== 'win32') fs.accessSync(filename, fs.constants.X_OK);
|
|
50
|
+
return source;
|
|
51
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Written to the root of every installed bitx version once its installation completes.
|
|
3
|
+
* A bitx version directory without it is an interrupted installation.
|
|
4
|
+
*/
|
|
5
|
+
export declare const BITX_METADATA_FILE = "bvm-bitx.json";
|
|
6
|
+
export type BitxMetadata = {
|
|
7
|
+
version: string;
|
|
8
|
+
package: string;
|
|
9
|
+
platformPackage: string;
|
|
10
|
+
node?: string;
|
|
11
|
+
installedAt: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function getBitxExecutableName(platform?: NodeJS.Platform): string;
|
|
14
|
+
export declare function readBitxMetadata(versionDir: string): BitxMetadata | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* The bitx executable inside an installed bitx version, relative to the version directory.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getBitxLinkSource(versionDir: string, platform?: NodeJS.Platform): string;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.BITX_METADATA_FILE = void 0;
|
|
7
|
+
exports.getBitxExecutableName = getBitxExecutableName;
|
|
8
|
+
exports.readBitxMetadata = readBitxMetadata;
|
|
9
|
+
exports.getBitxLinkSource = getBitxLinkSource;
|
|
10
|
+
const fs_1 = __importDefault(require("fs"));
|
|
11
|
+
const path_1 = __importDefault(require("path"));
|
|
12
|
+
const bvm_error_1 = require("@teambit/bvm.error");
|
|
13
|
+
/**
|
|
14
|
+
* Written to the root of every installed bitx version once its installation completes.
|
|
15
|
+
* A bitx version directory without it is an interrupted installation.
|
|
16
|
+
*/
|
|
17
|
+
exports.BITX_METADATA_FILE = 'bvm-bitx.json';
|
|
18
|
+
function getBitxExecutableName(platform = process.platform) {
|
|
19
|
+
return platform === 'win32' ? 'bitx.exe' : 'bitx';
|
|
20
|
+
}
|
|
21
|
+
function readBitxMetadata(versionDir) {
|
|
22
|
+
try {
|
|
23
|
+
return JSON.parse(fs_1.default.readFileSync(path_1.default.join(versionDir, exports.BITX_METADATA_FILE), 'utf8'));
|
|
24
|
+
}
|
|
25
|
+
catch (_a) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The bitx executable inside an installed bitx version, relative to the version directory.
|
|
31
|
+
*/
|
|
32
|
+
function getBitxLinkSource(versionDir, platform = process.platform) {
|
|
33
|
+
const source = path_1.default.join('bin', getBitxExecutableName(platform));
|
|
34
|
+
const filename = path_1.default.join(versionDir, source);
|
|
35
|
+
let stat;
|
|
36
|
+
try {
|
|
37
|
+
stat = fs_1.default.statSync(filename);
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
if (error.code === 'ENOENT') {
|
|
41
|
+
throw new bvm_error_1.BvmError(`the bitx executable is missing at ${filename}. reinstall bitx with "bvm install --next --override"`);
|
|
42
|
+
}
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
if (!stat.isFile())
|
|
46
|
+
throw new bvm_error_1.BvmError(`the bitx executable is not a regular file: ${filename}`);
|
|
47
|
+
if (platform !== 'win32')
|
|
48
|
+
fs_1.default.accessSync(filename, fs_1.default.constants.X_OK);
|
|
49
|
+
return source;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=bitx-link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bitx-link.js","sourceRoot":"","sources":["../bitx-link.ts"],"names":[],"mappings":";;;;;;AAoBA,sDAEC;AAED,4CAMC;AAKD,8CAeC;AAlDD,4CAAoB;AACpB,gDAAwB;AACxB,kDAA8C;AAE9C;;;GAGG;AACU,QAAA,kBAAkB,GAAG,eAAe,CAAC;AAYlD,SAAgB,qBAAqB,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ;IAC/D,OAAO,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC;AACpD,CAAC;AAED,SAAgB,gBAAgB,CAAC,UAAkB;IACjD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,cAAI,CAAC,IAAI,CAAC,UAAU,EAAE,0BAAkB,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACxF,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAgB,iBAAiB,CAAC,UAAkB,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ;IAC/E,MAAM,MAAM,GAAG,cAAI,CAAC,IAAI,CAAC,KAAK,EAAE,qBAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC;IACjE,MAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAC/C,IAAI,IAAc,CAAC;IACnB,IAAI,CAAC;QACH,IAAI,GAAG,YAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAK,KAA+B,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACvD,MAAM,IAAI,oBAAQ,CAAC,qCAAqC,QAAQ,uDAAuD,CAAC,CAAC;QAC3H,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;IACD,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;QAAE,MAAM,IAAI,oBAAQ,CAAC,8CAA8C,QAAQ,EAAE,CAAC,CAAC;IACjG,IAAI,QAAQ,KAAK,OAAO;QAAE,YAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,YAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACrE,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const fs_1 = __importDefault(require("fs"));
|
|
7
|
+
const os_1 = __importDefault(require("os"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const bitx_link_1 = require("./bitx-link");
|
|
10
|
+
describe('bitx link helpers', () => {
|
|
11
|
+
let root;
|
|
12
|
+
beforeEach(() => {
|
|
13
|
+
root = fs_1.default.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), 'bvm-bitx-link-'));
|
|
14
|
+
});
|
|
15
|
+
afterEach(() => fs_1.default.rmSync(root, { recursive: true, force: true }));
|
|
16
|
+
describe('getBitxLinkSource', () => {
|
|
17
|
+
it('selects bin/bitx on Unix', () => {
|
|
18
|
+
fs_1.default.mkdirSync(path_1.default.join(root, 'bin'));
|
|
19
|
+
fs_1.default.writeFileSync(path_1.default.join(root, 'bin/bitx'), 'native fixture', { mode: 0o755 });
|
|
20
|
+
expect((0, bitx_link_1.getBitxLinkSource)(root, 'linux')).toEqual(path_1.default.join('bin', 'bitx'));
|
|
21
|
+
});
|
|
22
|
+
it('selects bin/bitx.exe on Windows', () => {
|
|
23
|
+
fs_1.default.mkdirSync(path_1.default.join(root, 'bin'));
|
|
24
|
+
fs_1.default.writeFileSync(path_1.default.join(root, 'bin/bitx.exe'), 'native fixture');
|
|
25
|
+
expect((0, bitx_link_1.getBitxLinkSource)(root, 'win32')).toEqual(path_1.default.join('bin', 'bitx.exe'));
|
|
26
|
+
});
|
|
27
|
+
it('fails with a reinstall hint when the executable is missing', () => {
|
|
28
|
+
expect(() => (0, bitx_link_1.getBitxLinkSource)(root, 'linux')).toThrow('bvm install --next --override');
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
it('reads the metadata file and treats a missing one as not installed', () => {
|
|
32
|
+
expect((0, bitx_link_1.readBitxMetadata)(root)).toBeUndefined();
|
|
33
|
+
fs_1.default.writeFileSync(path_1.default.join(root, bitx_link_1.BITX_METADATA_FILE), JSON.stringify({ version: '0.1.0', node: '22.23.4' }));
|
|
34
|
+
expect((0, bitx_link_1.readBitxMetadata)(root)).toEqual({ version: '0.1.0', node: '22.23.4' });
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=bitx-link.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bitx-link.sp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AAC;YACpE,MAAM,CAAC,IAAA,6BAAiB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,cAAI,CAAC,IAAI,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;QACjF,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;YACpE,MAAM,CAAC,GAAG,EAAE,CAAC,IAAA,6BAAiB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAAC;QAC1F,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mEAAmE,EAAE,GAAG,EAAE;QAC3E,MAAM,CAAC,IAAA,4BAAgB,EAAC,IAAI,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;QAC/C,YAAE,CAAC,aAAa,CAAC,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,8BAAkB,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;QAC7G,MAAM,CAAC,IAAA,4BAAgB,EAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;IAChF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -14,5 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.readBitxMetadata = exports.getBitxLinkSource = exports.getBitxExecutableName = exports.BITX_METADATA_FILE = void 0;
|
|
17
18
|
__exportStar(require("./link"), exports);
|
|
19
|
+
var bitx_link_1 = require("./bitx-link");
|
|
20
|
+
Object.defineProperty(exports, "BITX_METADATA_FILE", { enumerable: true, get: function () { return bitx_link_1.BITX_METADATA_FILE; } });
|
|
21
|
+
Object.defineProperty(exports, "getBitxExecutableName", { enumerable: true, get: function () { return bitx_link_1.getBitxExecutableName; } });
|
|
22
|
+
Object.defineProperty(exports, "getBitxLinkSource", { enumerable: true, get: function () { return bitx_link_1.getBitxLinkSource; } });
|
|
23
|
+
Object.defineProperty(exports, "readBitxMetadata", { enumerable: true, get: function () { return bitx_link_1.readBitxMetadata; } });
|
|
18
24
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,yCAMqB;AALnB,+GAAA,kBAAkB,OAAA;AAElB,kHAAA,qBAAqB,OAAA;AACrB,8GAAA,iBAAiB,OAAA;AACjB,6GAAA,gBAAgB,OAAA"}
|
package/dist/link.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ConfigFileChangeType, ConfigReport, PathExtenderReport } from '@pnpm/os.env.path-extender';
|
|
2
|
+
import { BvmError } from '@teambit/bvm.error';
|
|
2
3
|
export type LinkResult = {
|
|
3
4
|
linkName: string;
|
|
4
5
|
version: string;
|
|
@@ -23,3 +24,27 @@ export interface LinkOptions {
|
|
|
23
24
|
}
|
|
24
25
|
export declare function linkDefault(version: string | undefined, opts?: LinkOptions): Promise<LinkResult>;
|
|
25
26
|
export declare function linkOne(linkName: string, version: string | undefined, opts?: LinkOptions): Promise<LinkResult>;
|
|
27
|
+
export declare class BitLinkOverrideDeclined extends BvmError {
|
|
28
|
+
constructor(linkName: string, bitVersion: string);
|
|
29
|
+
}
|
|
30
|
+
export type BitxLinkOptions = {
|
|
31
|
+
/** replace a Bit link that uses the bitx link name. when undefined, the user is asked */
|
|
32
|
+
overrideBitLink?: boolean;
|
|
33
|
+
addToConfig?: boolean;
|
|
34
|
+
addToPathIfMissing?: boolean;
|
|
35
|
+
useSystemNode?: boolean;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Links an installed bitx (the next Bit) version.
|
|
39
|
+
* bitx is a native executable, so the shim runs it directly. Unless `useSystemNode` is set,
|
|
40
|
+
* the shim puts the Node.js that was installed for this bitx version first on the PATH,
|
|
41
|
+
* since bitx runs Node.js for env-related work (compile, test, build, start...).
|
|
42
|
+
*/
|
|
43
|
+
export declare function linkBitx(linkName: string | undefined, version: string, opts?: BitxLinkOptions): Promise<LinkResult>;
|
|
44
|
+
/**
|
|
45
|
+
* Relinks every bitx link that is saved in the config.
|
|
46
|
+
*/
|
|
47
|
+
export declare function linkAllBitx(opts: {
|
|
48
|
+
addToPathIfMissing?: boolean;
|
|
49
|
+
useSystemNode?: boolean;
|
|
50
|
+
}): Promise<LinkResult[]>;
|
package/dist/link.docs.md
CHANGED
|
@@ -9,3 +9,8 @@ Packaged releases may include a native entry at `bin/bit` (`bin/bit.exe` on Wind
|
|
|
9
9
|
Links select that executable when present. Releases without it retain the Node CLI entry.
|
|
10
10
|
The packaged Node CLI and its Node.js runtime remain available for delegated commands.
|
|
11
11
|
An invalid native entry fails linking with a filesystem error.
|
|
12
|
+
|
|
13
|
+
`linkBitx()` links an installed bitx (the next Bit CLI) version from `<bvm dir>/bitx/versions/<version>`.
|
|
14
|
+
The shim runs the native `bin/bitx` directly and puts the Node.js installed for that version first on the `PATH`.
|
|
15
|
+
bitx links are saved under `bitx_links` in the config. The default bitx link name is `bit` (see `BITX_LINK`), so set
|
|
16
|
+
`BITX_LINK` to another name to keep Bit and bitx side by side. A Bit link can't take the name of a bitx link.
|
package/dist/link.js
CHANGED
|
@@ -12,9 +12,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.BitLinkOverrideDeclined = void 0;
|
|
15
16
|
exports.linkAll = linkAll;
|
|
16
17
|
exports.linkDefault = linkDefault;
|
|
17
18
|
exports.linkOne = linkOne;
|
|
19
|
+
exports.linkBitx = linkBitx;
|
|
20
|
+
exports.linkAllBitx = linkAllBitx;
|
|
18
21
|
const os_env_path_extender_1 = require("@pnpm/os.env.path-extender");
|
|
19
22
|
const bvm_config_1 = require("@teambit/bvm.config");
|
|
20
23
|
const bvm_list_1 = require("@teambit/bvm.list");
|
|
@@ -24,8 +27,10 @@ const symlink_dir_1 = __importDefault(require("symlink-dir"));
|
|
|
24
27
|
const bin_links_1 = __importDefault(require("bin-links"));
|
|
25
28
|
const bvm_error_1 = require("@teambit/bvm.error");
|
|
26
29
|
const os_1 = __importDefault(require("os"));
|
|
30
|
+
const readline_1 = __importDefault(require("readline"));
|
|
27
31
|
const semver_1 = __importDefault(require("semver"));
|
|
28
32
|
const link_source_1 = require("./link-source");
|
|
33
|
+
const bitx_link_1 = require("./bitx-link");
|
|
29
34
|
const IS_WINDOWS = os_1.default.platform() === 'win32';
|
|
30
35
|
const DOCS_BASE_URL = 'https://bit.dev/docs';
|
|
31
36
|
const DOCS_REFERENCE_BASE_URL = 'https://bit.dev/reference';
|
|
@@ -79,6 +84,9 @@ function linkOne(linkName_1, version_1) {
|
|
|
79
84
|
if (!exists) {
|
|
80
85
|
throw new bvm_error_1.BvmError(`version ${concreteVersion} is not installed`);
|
|
81
86
|
}
|
|
87
|
+
if (config.getBitxLinks()[linkName]) {
|
|
88
|
+
throw new bvm_error_1.BvmError(`the link name "${linkName}" is used by bitx (the next Bit). choose another link name for Bit, or change the bitx link name with "bvm config set BITX_LINK <name>"`);
|
|
89
|
+
}
|
|
82
90
|
const source = (0, link_source_1.getLinkSource)(versionDir);
|
|
83
91
|
let nodeExecPath;
|
|
84
92
|
const wantedNodeVersion = config.getWantedNodeVersion(versionDir);
|
|
@@ -95,6 +103,37 @@ function linkOne(linkName_1, version_1) {
|
|
|
95
103
|
else if (semver_1.default.lt(process.version, wantedNodeVersion)) {
|
|
96
104
|
warnings.push(`The system Node.js is ${process.version} while Bit CLI requires at least Node.js ${wantedNodeVersion}!`);
|
|
97
105
|
}
|
|
106
|
+
const generatedLink = yield createShim({
|
|
107
|
+
linkName,
|
|
108
|
+
versionDir,
|
|
109
|
+
source,
|
|
110
|
+
nodeExecPath,
|
|
111
|
+
prependToPath: nodeExecPath ? path_1.default.dirname(nodeExecPath) : undefined,
|
|
112
|
+
});
|
|
113
|
+
let previousLinkVersion;
|
|
114
|
+
if (opts.addToConfig) {
|
|
115
|
+
previousLinkVersion = config.setLink(linkName, concreteVersion);
|
|
116
|
+
}
|
|
117
|
+
const { pathExtenderReport, warning } = yield validateBinDirInPath(getBinDir(), opts);
|
|
118
|
+
if (warning) {
|
|
119
|
+
warnings.push(warning);
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
linkName,
|
|
123
|
+
previousLinkVersion,
|
|
124
|
+
version: concreteVersion,
|
|
125
|
+
generatedLink,
|
|
126
|
+
pathExtenderReport,
|
|
127
|
+
warnings,
|
|
128
|
+
};
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Points `<bvm dir>/links/<linkName>` at the version directory and writes the
|
|
133
|
+
* `<linkName>` shim (in ~/bin, or in the bvm directory on Windows) that runs `source` from it.
|
|
134
|
+
*/
|
|
135
|
+
function createShim(_a) {
|
|
136
|
+
return __awaiter(this, arguments, void 0, function* ({ linkName, versionDir, source, nodeExecPath, prependToPath }) {
|
|
98
137
|
const pkg = {
|
|
99
138
|
bin: {
|
|
100
139
|
[linkName]: source
|
|
@@ -119,30 +158,110 @@ function linkOne(linkName_1, version_1) {
|
|
|
119
158
|
// so it is better to not use them.
|
|
120
159
|
createPwshFile: false,
|
|
121
160
|
nodeExecPath,
|
|
122
|
-
prependToPath
|
|
161
|
+
prependToPath,
|
|
162
|
+
});
|
|
163
|
+
return generatedLink;
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
function getBinDir() {
|
|
167
|
+
if (IS_WINDOWS) {
|
|
168
|
+
return config.getBvmDirectory();
|
|
169
|
+
}
|
|
170
|
+
return path_1.default.join(os_1.default.homedir(), 'bin');
|
|
171
|
+
}
|
|
172
|
+
class BitLinkOverrideDeclined extends bvm_error_1.BvmError {
|
|
173
|
+
constructor(linkName, bitVersion) {
|
|
174
|
+
super(`the link name "${linkName}" is already used by Bit ${bitVersion}, and it was not replaced with bitx. change the bitx link name with "bvm config set BITX_LINK <name>" or run "bvm link --next ${linkName} <version>" to replace it`);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
exports.BitLinkOverrideDeclined = BitLinkOverrideDeclined;
|
|
178
|
+
function confirmBitLinkOverride(linkName, bitVersion) {
|
|
179
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
180
|
+
if (!process.stdin.isTTY)
|
|
181
|
+
return false;
|
|
182
|
+
const rl = readline_1.default.createInterface({ input: process.stdin, output: process.stdout });
|
|
183
|
+
const answer = yield new Promise((resolve) => {
|
|
184
|
+
rl.question(`"${linkName}" is currently linked to Bit ${bitVersion} (the old Bit). Override it to point to bitx? [y/N] `, resolve);
|
|
185
|
+
});
|
|
186
|
+
rl.close();
|
|
187
|
+
return /^y(es)?$/i.test(answer.trim());
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Links an installed bitx (the next Bit) version.
|
|
192
|
+
* bitx is a native executable, so the shim runs it directly. Unless `useSystemNode` is set,
|
|
193
|
+
* the shim puts the Node.js that was installed for this bitx version first on the PATH,
|
|
194
|
+
* since bitx runs Node.js for env-related work (compile, test, build, start...).
|
|
195
|
+
*/
|
|
196
|
+
function linkBitx(linkName_1, version_1) {
|
|
197
|
+
return __awaiter(this, arguments, void 0, function* (linkName, version, opts = {}) {
|
|
198
|
+
var _a;
|
|
199
|
+
const concreteLinkName = linkName || config.getBitxLinkName();
|
|
200
|
+
if (!concreteLinkName)
|
|
201
|
+
throw new bvm_error_1.BvmError('bitx link name is empty');
|
|
202
|
+
const { versionDir } = config.getSpecificBitxVersionDir(version);
|
|
203
|
+
const conflictingBitVersion = config.getLinks()[concreteLinkName];
|
|
204
|
+
let overrideBitLink = false;
|
|
205
|
+
if (conflictingBitVersion) {
|
|
206
|
+
overrideBitLink = (_a = opts.overrideBitLink) !== null && _a !== void 0 ? _a : (yield confirmBitLinkOverride(concreteLinkName, conflictingBitVersion));
|
|
207
|
+
if (!overrideBitLink)
|
|
208
|
+
throw new BitLinkOverrideDeclined(concreteLinkName, conflictingBitVersion);
|
|
209
|
+
}
|
|
210
|
+
const metadata = (0, bitx_link_1.readBitxMetadata)(versionDir);
|
|
211
|
+
if (!metadata) {
|
|
212
|
+
throw new bvm_error_1.BvmError(`bitx version ${version} is not installed`);
|
|
213
|
+
}
|
|
214
|
+
const source = (0, bitx_link_1.getBitxLinkSource)(versionDir);
|
|
215
|
+
const warnings = [];
|
|
216
|
+
let prependToPath;
|
|
217
|
+
if (!opts.useSystemNode && metadata.node) {
|
|
218
|
+
const node = config.getSpecificNodeVersionDir(metadata.node);
|
|
219
|
+
if (!node.exists) {
|
|
220
|
+
throw new bvm_error_1.BvmError(`Node.js version ${metadata.node} is not installed. Try to reinstall bitx with "bvm install --next ${version} --override"`);
|
|
221
|
+
}
|
|
222
|
+
prependToPath = IS_WINDOWS ? node.versionDir : path_1.default.join(node.versionDir, 'bin');
|
|
223
|
+
}
|
|
224
|
+
const generatedLink = yield createShim({
|
|
225
|
+
linkName: concreteLinkName,
|
|
226
|
+
versionDir,
|
|
227
|
+
source,
|
|
228
|
+
prependToPath,
|
|
123
229
|
});
|
|
230
|
+
if (overrideBitLink)
|
|
231
|
+
config.delLink(concreteLinkName);
|
|
124
232
|
let previousLinkVersion;
|
|
125
233
|
if (opts.addToConfig) {
|
|
126
|
-
previousLinkVersion = config.
|
|
127
|
-
}
|
|
128
|
-
let binDir = path_1.default.join(os_1.default.homedir(), 'bin');
|
|
129
|
-
if (IS_WINDOWS) {
|
|
130
|
-
binDir = config.getBvmDirectory();
|
|
234
|
+
previousLinkVersion = config.setBitxLink(concreteLinkName, version);
|
|
131
235
|
}
|
|
132
|
-
const { pathExtenderReport, warning } = yield validateBinDirInPath(
|
|
236
|
+
const { pathExtenderReport, warning } = yield validateBinDirInPath(getBinDir(), opts);
|
|
133
237
|
if (warning) {
|
|
134
238
|
warnings.push(warning);
|
|
135
239
|
}
|
|
136
240
|
return {
|
|
137
|
-
linkName,
|
|
241
|
+
linkName: concreteLinkName,
|
|
138
242
|
previousLinkVersion,
|
|
139
|
-
version
|
|
243
|
+
version,
|
|
140
244
|
generatedLink,
|
|
141
245
|
pathExtenderReport,
|
|
142
246
|
warnings,
|
|
143
247
|
};
|
|
144
248
|
});
|
|
145
249
|
}
|
|
250
|
+
/**
|
|
251
|
+
* Relinks every bitx link that is saved in the config.
|
|
252
|
+
*/
|
|
253
|
+
function linkAllBitx(opts) {
|
|
254
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
255
|
+
const links = config.getBitxLinks();
|
|
256
|
+
return Promise.all(Object.entries(links).map(([linkName, version]) => {
|
|
257
|
+
return linkBitx(linkName, version, {
|
|
258
|
+
addToConfig: false,
|
|
259
|
+
addToPathIfMissing: opts.addToPathIfMissing,
|
|
260
|
+
useSystemNode: opts.useSystemNode,
|
|
261
|
+
});
|
|
262
|
+
}));
|
|
263
|
+
});
|
|
264
|
+
}
|
|
146
265
|
function validateBinDirInPath(binDir_1) {
|
|
147
266
|
return __awaiter(this, arguments, void 0, function* (binDir, opts = { addToPathIfMissing: true }) {
|
|
148
267
|
const osPaths = (process.env.PATH || process.env.Path || process.env.path).split(path_1.default.delimiter);
|
package/dist/link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","sourceRoot":"","sources":["../link.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"link.js","sourceRoot":"","sources":["../link.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAsCA,0BAoBC;AAQD,kCASC;AAED,0BA4DC;AAkFD,4BA+CC;AAKD,kCASC;AAxRD,qEAAqH;AACrH,oDAA2C;AAC3C,gDAA4C;AAC5C,iEAAwC;AACxC,gDAAwB;AACxB,8DAAqC;AACrC,0DAAiC;AACjC,kDAA8C;AAC9C,4CAAoB;AACpB,wDAAgC;AAChC,oDAA4B;AAC5B,+CAA8C;AAC9C,2CAAkE;AAElE,MAAM,UAAU,GAAG,YAAE,CAAC,QAAQ,EAAE,KAAK,OAAO,CAAC;AAC7C,MAAM,aAAa,GAAG,sBAAsB,CAAC;AAC7C,MAAM,uBAAuB,GAAG,2BAA2B,CAAC;AAC5D,MAAM,wCAAwC,GAAG,GAAG,uBAAuB,sCAAsC,CAAC;AAClH,MAAM,0CAA0C,GAAG,GAAG,uBAAuB,sCAAsC,CAAC;AAEpH,MAAM,MAAM,GAAG,mBAAM,CAAC,IAAI,EAAE,CAAC;AAkB7B,SAAsB,OAAO,CAAC,IAA+D;;QAC3F,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;QAChC,MAAM,kBAAkB,GAAG,MAAM,CAAC,qBAAqB,EAAE,CAAC;QAC1D,MAAM,WAAW,GAAG,CAAC,MAAM,IAAA,oBAAS,GAAE,CAAC,CAAC,MAAM,EAAE,CAAC;QACjD,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,EAAE;YACjE,OAAO,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE;gBAChC,WAAW,EAAE,KAAK;gBAClB,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;gBAC3C,a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KAEd,kBAAkB,CAAC,MAAM,CAAC,EAAE;qBACxB,CAAC;gBACJ,CAAC;gBACD,OAAO;oBACL,OAAO,EAAE,oCAAoC,GAAG,CAAC,OAAO;EAC9D,kBAAkB,CAAC,MAAM,CAAC,EAAE;iBACvB,CAAA;YACH,CAAC;QACH,CAAC;IACH,CAAC;CAAA;AAED,SAAS,kBAAkB,CAAC,MAAc;IACxC,IAAI,UAAU,EAAE,CAAC;QACf,OAAO;oBACS,MAAM;mCACS,wCAAwC,EAAE,CAAC;IAC5E,CAAC;IACD,OAAO;;mCAE0B,0CAA0C,EAAE,CAAC;AAChF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
;
|
|
2
|
-
import * as overview_0 from '/home/runner/Library/Caches/Bit/capsules/22984e0a6/teambit.bvm_link@1.1
|
|
2
|
+
import * as overview_0 from '/home/runner/Library/Caches/Bit/capsules/22984e0a6/teambit.bvm_link@1.2.1/dist/link.docs.md';
|
|
3
3
|
|
|
4
4
|
export const compositions = [];
|
|
5
5
|
export const overview = [overview_0];
|
package/index.ts
CHANGED
package/link.docs.md
CHANGED
|
@@ -9,3 +9,8 @@ Packaged releases may include a native entry at `bin/bit` (`bin/bit.exe` on Wind
|
|
|
9
9
|
Links select that executable when present. Releases without it retain the Node CLI entry.
|
|
10
10
|
The packaged Node CLI and its Node.js runtime remain available for delegated commands.
|
|
11
11
|
An invalid native entry fails linking with a filesystem error.
|
|
12
|
+
|
|
13
|
+
`linkBitx()` links an installed bitx (the next Bit CLI) version from `<bvm dir>/bitx/versions/<version>`.
|
|
14
|
+
The shim runs the native `bin/bitx` directly and puts the Node.js installed for that version first on the `PATH`.
|
|
15
|
+
bitx links are saved under `bitx_links` in the config. The default bitx link name is `bit` (see `BITX_LINK`), so set
|
|
16
|
+
`BITX_LINK` to another name to keep Bit and bitx side by side. A Bit link can't take the name of a bitx link.
|
package/link.ts
CHANGED
|
@@ -7,8 +7,10 @@ import symlinkDir from 'symlink-dir';
|
|
|
7
7
|
import binLinks from 'bin-links';
|
|
8
8
|
import { BvmError } from '@teambit/bvm.error';
|
|
9
9
|
import os from 'os';
|
|
10
|
+
import readline from 'readline';
|
|
10
11
|
import semver from 'semver';
|
|
11
12
|
import { getLinkSource } from './link-source';
|
|
13
|
+
import { getBitxLinkSource, readBitxMetadata } from './bitx-link';
|
|
12
14
|
|
|
13
15
|
const IS_WINDOWS = os.platform() === 'win32';
|
|
14
16
|
const DOCS_BASE_URL = 'https://bit.dev/docs';
|
|
@@ -90,6 +92,9 @@ export async function linkOne(linkName: string, version: string | undefined, opt
|
|
|
90
92
|
if (!exists){
|
|
91
93
|
throw new BvmError(`version ${concreteVersion} is not installed`);
|
|
92
94
|
}
|
|
95
|
+
if (config.getBitxLinks()[linkName]) {
|
|
96
|
+
throw new BvmError(`the link name "${linkName}" is used by bitx (the next Bit). choose another link name for Bit, or change the bitx link name with "bvm config set BITX_LINK <name>"`);
|
|
97
|
+
}
|
|
93
98
|
const source = getLinkSource(versionDir);
|
|
94
99
|
let nodeExecPath: string;
|
|
95
100
|
const wantedNodeVersion = config.getWantedNodeVersion(versionDir);
|
|
@@ -105,6 +110,47 @@ export async function linkOne(linkName: string, version: string | undefined, opt
|
|
|
105
110
|
} else if (semver.lt(process.version, wantedNodeVersion)) {
|
|
106
111
|
warnings.push(`The system Node.js is ${process.version} while Bit CLI requires at least Node.js ${wantedNodeVersion}!`)
|
|
107
112
|
}
|
|
113
|
+
const generatedLink = await createShim({
|
|
114
|
+
linkName,
|
|
115
|
+
versionDir,
|
|
116
|
+
source,
|
|
117
|
+
nodeExecPath,
|
|
118
|
+
prependToPath: nodeExecPath ? path.dirname(nodeExecPath) : undefined,
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
let previousLinkVersion;
|
|
122
|
+
if (opts.addToConfig){
|
|
123
|
+
previousLinkVersion = config.setLink(linkName, concreteVersion);
|
|
124
|
+
}
|
|
125
|
+
const { pathExtenderReport, warning } = await validateBinDirInPath(getBinDir(), opts);
|
|
126
|
+
if (warning) {
|
|
127
|
+
warnings.push(warning);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return {
|
|
131
|
+
linkName,
|
|
132
|
+
previousLinkVersion,
|
|
133
|
+
version: concreteVersion,
|
|
134
|
+
generatedLink,
|
|
135
|
+
pathExtenderReport,
|
|
136
|
+
warnings,
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
type CreateShimOpts = {
|
|
141
|
+
linkName: string,
|
|
142
|
+
versionDir: string,
|
|
143
|
+
// relative to versionDir
|
|
144
|
+
source: string,
|
|
145
|
+
nodeExecPath?: string,
|
|
146
|
+
prependToPath?: string,
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Points `<bvm dir>/links/<linkName>` at the version directory and writes the
|
|
151
|
+
* `<linkName>` shim (in ~/bin, or in the bvm directory on Windows) that runs `source` from it.
|
|
152
|
+
*/
|
|
153
|
+
async function createShim({ linkName, versionDir, source, nodeExecPath, prependToPath }: CreateShimOpts): Promise<GeneratedLink> {
|
|
108
154
|
const pkg = {
|
|
109
155
|
bin: {
|
|
110
156
|
[linkName]: source
|
|
@@ -129,30 +175,109 @@ export async function linkOne(linkName: string, version: string | undefined, opt
|
|
|
129
175
|
// so it is better to not use them.
|
|
130
176
|
createPwshFile: false,
|
|
131
177
|
nodeExecPath,
|
|
132
|
-
prependToPath
|
|
178
|
+
prependToPath,
|
|
133
179
|
});
|
|
180
|
+
return generatedLink;
|
|
181
|
+
}
|
|
134
182
|
|
|
135
|
-
|
|
136
|
-
if (opts.addToConfig){
|
|
137
|
-
previousLinkVersion = config.setLink(linkName, concreteVersion);
|
|
138
|
-
}
|
|
139
|
-
let binDir = path.join(os.homedir(), 'bin');
|
|
183
|
+
function getBinDir(): string {
|
|
140
184
|
if (IS_WINDOWS){
|
|
141
|
-
|
|
185
|
+
return config.getBvmDirectory();
|
|
186
|
+
}
|
|
187
|
+
return path.join(os.homedir(), 'bin');
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export class BitLinkOverrideDeclined extends BvmError {
|
|
191
|
+
constructor(linkName: string, bitVersion: string) {
|
|
192
|
+
super(`the link name "${linkName}" is already used by Bit ${bitVersion}, and it was not replaced with bitx. change the bitx link name with "bvm config set BITX_LINK <name>" or run "bvm link --next ${linkName} <version>" to replace it`);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
async function confirmBitLinkOverride(linkName: string, bitVersion: string): Promise<boolean> {
|
|
197
|
+
if (!process.stdin.isTTY) return false;
|
|
198
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
199
|
+
const answer = await new Promise<string>((resolve) => {
|
|
200
|
+
rl.question(`"${linkName}" is currently linked to Bit ${bitVersion} (the old Bit). Override it to point to bitx? [y/N] `, resolve);
|
|
201
|
+
});
|
|
202
|
+
rl.close();
|
|
203
|
+
return /^y(es)?$/i.test(answer.trim());
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export type BitxLinkOptions = {
|
|
207
|
+
/** replace a Bit link that uses the bitx link name. when undefined, the user is asked */
|
|
208
|
+
overrideBitLink?: boolean
|
|
209
|
+
addToConfig?: boolean
|
|
210
|
+
addToPathIfMissing?: boolean
|
|
211
|
+
useSystemNode?: boolean
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Links an installed bitx (the next Bit) version.
|
|
216
|
+
* bitx is a native executable, so the shim runs it directly. Unless `useSystemNode` is set,
|
|
217
|
+
* the shim puts the Node.js that was installed for this bitx version first on the PATH,
|
|
218
|
+
* since bitx runs Node.js for env-related work (compile, test, build, start...).
|
|
219
|
+
*/
|
|
220
|
+
export async function linkBitx(linkName: string | undefined, version: string, opts: BitxLinkOptions = {}): Promise<LinkResult> {
|
|
221
|
+
const concreteLinkName = linkName || config.getBitxLinkName();
|
|
222
|
+
if (!concreteLinkName) throw new BvmError('bitx link name is empty');
|
|
223
|
+
const { versionDir } = config.getSpecificBitxVersionDir(version);
|
|
224
|
+
const conflictingBitVersion = config.getLinks()[concreteLinkName];
|
|
225
|
+
let overrideBitLink = false;
|
|
226
|
+
if (conflictingBitVersion) {
|
|
227
|
+
overrideBitLink = opts.overrideBitLink ?? (await confirmBitLinkOverride(concreteLinkName, conflictingBitVersion));
|
|
228
|
+
if (!overrideBitLink) throw new BitLinkOverrideDeclined(concreteLinkName, conflictingBitVersion);
|
|
229
|
+
}
|
|
230
|
+
const metadata = readBitxMetadata(versionDir);
|
|
231
|
+
if (!metadata) {
|
|
232
|
+
throw new BvmError(`bitx version ${version} is not installed`);
|
|
142
233
|
}
|
|
143
|
-
const
|
|
234
|
+
const source = getBitxLinkSource(versionDir);
|
|
235
|
+
const warnings: string[] = [];
|
|
236
|
+
let prependToPath: string | undefined;
|
|
237
|
+
if (!opts.useSystemNode && metadata.node) {
|
|
238
|
+
const node = config.getSpecificNodeVersionDir(metadata.node);
|
|
239
|
+
if (!node.exists) {
|
|
240
|
+
throw new BvmError(`Node.js version ${metadata.node} is not installed. Try to reinstall bitx with "bvm install --next ${version} --override"`);
|
|
241
|
+
}
|
|
242
|
+
prependToPath = IS_WINDOWS ? node.versionDir : path.join(node.versionDir, 'bin');
|
|
243
|
+
}
|
|
244
|
+
const generatedLink = await createShim({
|
|
245
|
+
linkName: concreteLinkName,
|
|
246
|
+
versionDir,
|
|
247
|
+
source,
|
|
248
|
+
prependToPath,
|
|
249
|
+
});
|
|
250
|
+
if (overrideBitLink) config.delLink(concreteLinkName);
|
|
251
|
+
let previousLinkVersion;
|
|
252
|
+
if (opts.addToConfig) {
|
|
253
|
+
previousLinkVersion = config.setBitxLink(concreteLinkName, version);
|
|
254
|
+
}
|
|
255
|
+
const { pathExtenderReport, warning } = await validateBinDirInPath(getBinDir(), opts);
|
|
144
256
|
if (warning) {
|
|
145
257
|
warnings.push(warning);
|
|
146
258
|
}
|
|
147
|
-
|
|
148
259
|
return {
|
|
149
|
-
linkName,
|
|
260
|
+
linkName: concreteLinkName,
|
|
150
261
|
previousLinkVersion,
|
|
151
|
-
version
|
|
262
|
+
version,
|
|
152
263
|
generatedLink,
|
|
153
264
|
pathExtenderReport,
|
|
154
265
|
warnings,
|
|
155
|
-
}
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Relinks every bitx link that is saved in the config.
|
|
271
|
+
*/
|
|
272
|
+
export async function linkAllBitx(opts: { addToPathIfMissing?: boolean, useSystemNode?: boolean }): Promise<LinkResult[]> {
|
|
273
|
+
const links = config.getBitxLinks();
|
|
274
|
+
return Promise.all(Object.entries(links).map(([linkName, version]) => {
|
|
275
|
+
return linkBitx(linkName, version, {
|
|
276
|
+
addToConfig: false,
|
|
277
|
+
addToPathIfMissing: opts.addToPathIfMissing,
|
|
278
|
+
useSystemNode: opts.useSystemNode,
|
|
279
|
+
});
|
|
280
|
+
}));
|
|
156
281
|
}
|
|
157
282
|
|
|
158
283
|
async function validateBinDirInPath(binDir: string, opts: { addToPathIfMissing?: boolean } = { addToPathIfMissing: true }): Promise<{ pathExtenderReport?: PathExtenderReport | undefined, warning?: string }> {
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/bvm.link",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/bvm/link",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.bvm",
|
|
8
8
|
"name": "link",
|
|
9
|
-
"version": "1.1
|
|
9
|
+
"version": "1.2.1"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"fs-extra": "9.1.0",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"symlink-dir": "^5.1.1",
|
|
17
17
|
"@teambit/bvm.error": "1.0.0",
|
|
18
18
|
"@pnpm/os.env.path-extender": "2.0.3",
|
|
19
|
-
"@teambit/bvm.config": "1.
|
|
20
|
-
"@teambit/bvm.list": "1.1.
|
|
19
|
+
"@teambit/bvm.config": "1.1.1",
|
|
20
|
+
"@teambit/bvm.list": "1.1.6"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/fs-extra": "9.0.7",
|