Skip to content

Commit

Permalink
chore(vscode): 修改构建命令
Browse files Browse the repository at this point in the history
  • Loading branch information
aooiuu committed Jul 19, 2024
1 parent 7584fbc commit 0fe3d4f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ jobs:

- run: pnpm install
- run: pnpm run build
- run: pnpm run vscode:build-tpl

- run: pnpm run vscode:build
# https://github.com/HaaLeo/publish-vscode-extension
- name: build vscode vsx
if: matrix.os == 'windows-latest'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:

- run: pnpm install
- run: pnpm run build
- run: pnpm run vscode:build-tpl
- run: pnpm run vscode:build

# https://github.com/HaaLeo/publish-vscode-extension
- name: build vscode vsx
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:

- name: build vscode template
if: matrix.os == 'windows-latest'
run: pnpm run vscode:build-tpl
run: pnpm run vscode:build

# https://github.com/HaaLeo/publish-vscode-extension
- name: build vscode vsx
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"vscode:server": "pnpm --filter=@any-reader/web vscode:dev",
"vscode:dev": "npm-run-all core:build shared:build --parallel vscode:server server",
"vscode:build-tpl": "pnpm --filter=@any-reader/web vscode:build",
"vscode:build-vsx": "pnpm --filter=@any-reader/vscode build",
"vscode:build-vsx": "pnpm --filter=@any-reader/vscode vscode:prepublish",
"vscode:build": "npm-run-all vscode:build-tpl vscode:build-vsx",
"server": "pnpm --filter=@any-reader/server dev",
"server:build": "pnpm --filter=@any-reader/server build",
Expand Down
6 changes: 4 additions & 2 deletions packages/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@
],
"main": "./dist/extension.js",
"scripts": {
"build": "tsup",
"dev": "tsx ./scripts/publish.cjs && tsup --watch src",
"compile": "tsup",
"compile-watch": "tsup --watch src",
"vscode:prepublish": "tsx ./scripts/publish.cjs",
"dev": "npm-run-all vscode:prepublish compile-watch",
"build": "npm-run-all vscode:prepublish compile pack",
"pack": "vsce package --no-dependencies"
},
"contributes": {
Expand Down
7 changes: 6 additions & 1 deletion packages/vscode/scripts/publish.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ async function publish() {
pkg.version = pkg.version.replace(/\.\d+\-.*?$/, '.' + (10000 + version.build));
}

const outputDir = path.join(root, 'dist');
if (!fs.existsSync(outputDir)) {
fs.mkdirSync(outputDir);
}

// sql-wasm.wasm
fs.copyFileSync(path.resolve(root, '../../node_modules/sql.js/dist/sql-wasm.wasm'), path.join(root, 'dist', 'sql-wasm.wasm'));
fs.copyFileSync(path.resolve(root, '../../node_modules/sql.js/dist/sql-wasm.wasm'), path.join(outputDir, 'sql-wasm.wasm'));

pkg.devDependencies = {};
await fs.writeJSON(pkgPath, pkg, { spaces: 2 });
Expand Down

0 comments on commit 0fe3d4f

Please sign in to comment.