Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make node_modules to relative path #10

Merged
merged 2 commits into from
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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