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

Create npm workspaces v2 #2462

Closed
wants to merge 8 commits into from
Closed
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
5 changes: 1 addition & 4 deletions .github/workflows/home-view-unit-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ on: [workflow_call]
jobs:
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: extensions/vscode/webviews/homeView
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -14,4 +11,4 @@ jobs:
cache: "npm"
cache-dependency-path: "**/package-lock.json"
- run: npm install
- run: npm test
- run: npm test --prefix extensions/vscode/webviews/homeView
1 change: 0 additions & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
- run: just npm-install
- run: just check-format

- run: just vscode deps
- run: just vscode lint

- run: just install
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/vscode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: "20"
- run: just npm-install
- id: get-date
run: echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT
shell: bash
Expand Down
5 changes: 5 additions & 0 deletions extensions/vscode/.vscodeignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Workaround for https://github.com/microsoft/vscode-vsce/issues/580
../..

.*
.*/
.vscode/**
.vscode-test/**
src/**
Expand Down
19 changes: 0 additions & 19 deletions extensions/vscode/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,30 +58,11 @@ clean:
rm -rf out
just ./webviews/homeView/clean


# Install dependencies
deps:
#!/usr/bin/env bash
set -eou pipefail
{{ _with_debug }}

if [ {{ _ci }} = "true" ]; then
npm ci --no-audit --no-fund | sed 's/^/debug: /'
npm --prefix ./webviews/homeView ci --no-audit --no-fund | sed 's/^/debug: /'
else
npm install --no-audit --no-fund | sed 's/^/debug: /'
npm --prefix ./webviews/homeView install --no-audit --no-fund | sed 's/^/debug: /'
fi
just ./webviews/homeView/deps


configure os="$(just ../../os)" arch="$(just ../../arch)":
#!/usr/bin/env bash
set -eou pipefail
{{ _with_debug }}

just deps

echo "info: checking for compatible binary executable..." 1>&2
binary_executable=$(just ../../executable-path {{ os }} {{ arch }})
if ! [ -f "$binary_executable" ]; then
Expand Down
2 changes: 2 additions & 0 deletions extensions/vscode/src/views/homeView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1286,6 +1286,7 @@ export class HomeViewProvider implements WebviewViewProvider, Disposable {
Uri.joinPath(this.extensionUri, "webviews", "homeView", "dist"),
Uri.joinPath(
this.extensionUri,
"../..",
"node_modules",
"@vscode",
"codicons",
Expand Down Expand Up @@ -1335,6 +1336,7 @@ export class HomeViewProvider implements WebviewViewProvider, Disposable {
]);
// The codicon css (and related tff file) are needing to be loaded for icons
const codiconsUri = getUri(webview, extensionUri, [
"../..",
"node_modules",
"@vscode",
"codicons",
Expand Down
2 changes: 1 addition & 1 deletion extensions/vscode/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"paths": {
"src/*": ["./src/*"],
// workaround for: https://github.com/rollup/rollup/issues/5199
"rollup/parseAst": ["./node_modules/rollup/dist/parseAst"]
"rollup/parseAst": ["../../node_modules/rollup/dist/parseAst"]
}
},
"exclude": ["node_modules", "webviews", "vitest.config.ts"]
Expand Down
13 changes: 0 additions & 13 deletions extensions/vscode/webviews/homeView/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,3 @@ clean:
{{ _with_debug }}

rm -rf node_modules


# Install dependencies
deps:
#!/usr/bin/env bash
set -eou pipefail
{{ _with_debug }}

if [ {{ _ci }} = "true" ]; then
npm ci --no-audit --no-fund | sed 's/^/debug: /'
else
npm install --no-audit --no-fund | sed 's/^/debug: /'
fi
6 changes: 3 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ npm-install:
{{ _with_debug }}

if [ {{ _ci }} = "true" ]; then
npm ci --no-audit --no-fund
npm ci --no-audit --no-fund | sed 's/^/debug: /'
else
npm install --no-audit --no-fund
npm install --no-audit --no-fund | sed 's/^/debug: /'
fi

# staticcheck, vet, and format check
Expand Down Expand Up @@ -206,7 +206,7 @@ name:

basename {{ _cmd }}

package:
package: npm-install
#!/usr/bin/env bash
set -eou pipefail
{{ _with_debug }}
Expand Down
Loading
Loading