Skip to content

Commit

Permalink
feat: make node_modules to relative path (#10)
Browse files Browse the repository at this point in the history
* feat: make node_modules to relative path

* chore(release): v1.2.0
  • Loading branch information
tuchg committed Mar 8, 2023
1 parent 105b656 commit 5bd4268
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
7 changes: 5 additions & 2 deletions src/vscode-extension/utils/pkg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ const nodeModulesName = 'node_modules';

export const resolvePkgFolder = async (pkgName: string[]) => {
let nodeModulesPath = getConfiguration().get<string>('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 => {
Expand Down

0 comments on commit 5bd4268

Please sign in to comment.