@teambit/dependencies.fs.linked-dependencies
Advanced tools
Comparing version 0.0.8 to 0.0.9
declare type CreateLinksOpts = { | ||
componentId?: string | null | undefined; | ||
componentId?: string; | ||
avoidHardLink?: boolean; | ||
@@ -4,0 +4,0 @@ skipIfSymlinkValid?: boolean; |
@@ -17,7 +17,7 @@ "use strict"; | ||
const path_1 = __importDefault(require("path")); | ||
const utils_1 = require("@teambit/legacy/dist/utils"); | ||
const toolbox_fs_link_or_symlink_1 = require("@teambit/toolbox.fs.link-or-symlink"); | ||
function createLinks(rootDir, linkedDeps, opts = {}) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const modulesDir = path_1.default.join(rootDir, 'node_modules'); | ||
yield Promise.all(Object.entries(linkedDeps).map(([packageName, linkPath]) => (0, utils_1.createSymlinkOrCopy)(linkPath.substring(5), path_1.default.join(modulesDir, packageName), opts.componentId, opts.avoidHardLink, opts.skipIfSymlinkValid))); | ||
yield Promise.all(Object.entries(linkedDeps).map(([packageName, linkPath]) => (0, toolbox_fs_link_or_symlink_1.createLinkOrSymlink)(linkPath.substring(5), path_1.default.join(modulesDir, packageName), opts.componentId, opts.avoidHardLink, opts.skipIfSymlinkValid))); | ||
}); | ||
@@ -24,0 +24,0 @@ } |
import path from 'path'; | ||
import { createSymlinkOrCopy } from '@teambit/legacy/dist/utils'; | ||
import { createLinkOrSymlink } from '@teambit/toolbox.fs.link-or-symlink'; | ||
type CreateLinksOpts = { | ||
componentId?: string | null | undefined; | ||
componentId?: string; | ||
avoidHardLink?: boolean; | ||
@@ -14,3 +14,3 @@ skipIfSymlinkValid?: boolean; | ||
Object.entries(linkedDeps).map(([packageName, linkPath]) => | ||
createSymlinkOrCopy( | ||
createLinkOrSymlink( | ||
linkPath.substring(5), | ||
@@ -17,0 +17,0 @@ path.join(modulesDir, packageName), |
{ | ||
"name": "@teambit/dependencies.fs.linked-dependencies", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"homepage": "https://bit.cloud/teambit/dependencies/fs/linked-dependencies", | ||
@@ -9,5 +9,7 @@ "main": "dist/index.js", | ||
"name": "fs/linked-dependencies", | ||
"version": "0.0.8" | ||
"version": "0.0.9" | ||
}, | ||
"dependencies": {}, | ||
"dependencies": { | ||
"@teambit/toolbox.fs.link-or-symlink": "0.0.1" | ||
}, | ||
"devDependencies": { | ||
@@ -14,0 +16,0 @@ "@types/mocha": "9.1.0", |
Sorry, the diff of this file is not supported yet
8583
1