diff --git a/CHANGELOG.md b/CHANGELOG.md index 881ca45..6d21304 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# [1.1.0](https://github.com/IDuxFE/idux-coder/compare/v1.0.1...v1.1.0) (2022-08-24) +# [1.2.0](https://github.com/IDuxFE/idux-coder/compare/v1.0.1...v1.2.0) (2023-03-08) ### Bug Fixes @@ -8,6 +8,11 @@ * support lower compatible version of vscode ([3e822dc](https://github.com/IDuxFE/idux-coder/commit/3e822dc572f4a510671639c51ef1f507ecfde338)) +### Features + +* make node_modules to relative path ([5fbe0de](https://github.com/IDuxFE/idux-coder/commit/5fbe0deaeecb4a550c4838b44b56ef3510af333b)) + + ## [1.0.1](https://github.com/IDuxFE/idux-coder/compare/v1.0.0...v1.0.1) (2022-08-12) diff --git a/package.json b/package.json index 6bf4c24..d87a9ef 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "idux-coder", "displayName": "iDuxCoder", "description": "💻 A IDE Extension for iDux", - "version": "1.1.0", + "version": "1.2.0", "license": "MIT", "publisher": "IDuxFE", "author": { diff --git a/src/vscode-extension/utils/pkg.ts b/src/vscode-extension/utils/pkg.ts index 0bd4719..e161b04 100644 --- a/src/vscode-extension/utils/pkg.ts +++ b/src/vscode-extension/utils/pkg.ts @@ -7,11 +7,14 @@ const nodeModulesName = 'node_modules'; export const resolvePkgFolder = async (pkgName: string[]) => { let nodeModulesPath = getConfiguration().get('PackageLocation')!; + const workspacePath =await getWorkspaceFolder(); + if (nodeModulesPath === '') { - nodeModulesPath = join((await getWorkspaceFolder())!, nodeModulesName); - getConfiguration().update('PackageLocation', nodeModulesPath, false); + getConfiguration().update('PackageLocation', nodeModulesName, false); } + nodeModulesPath = join(workspacePath!, nodeModulesPath); + if (await exists(nodeModulesPath)) { return Promise.all( pkgName.map(async name => {