Skip to content

Commit f189112

Browse files
committed
fix: build system
1 parent f33c0e3 commit f189112

File tree

5 files changed

+195
-41
lines changed

5 files changed

+195
-41
lines changed

.github/workflows/npm-test.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,16 @@ jobs:
1313
matrix:
1414
include:
1515
- os: windows-latest
16-
platform: win32
17-
arch: x64
16+
- os: ubuntu-latest
1817
- os: macos-latest
19-
platform: darwin
20-
arch: arm64
2118
runs-on: ${{ matrix.os }}
2219
steps:
2320
- uses: actions/checkout@v4
2421
- uses: actions/setup-node@v4
2522
with:
2623
node-version: 20.x
2724
cache: 'npm'
28-
- run: npm ci
25+
- run: xvfb-run -a npm test
26+
if: runner.os == 'Linux'
2927
- run: npm test
28+
if: runner.os != 'Linux'

.vscode/tasks.json

+1-20
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,6 @@
33
{
44
"version": "2.0.0",
55
"tasks": [
6-
{
7-
"type": "shell",
8-
"label": "cp-wasm",
9-
"command": "cp node_modules/float-pigment-css/float_pigment_css_bg.wasm dist/",
10-
"problemMatcher": "$ts-webpack-watch",
11-
"isBackground": true,
12-
"presentation": {
13-
"reveal": "never",
14-
"group": "watchers"
15-
},
16-
"group": {
17-
"kind": "build"
18-
},
19-
"options": {
20-
"cwd": "${workspaceFolder}"
21-
}
22-
},
236
{
247
"type": "npm",
258
"script": "watch",
@@ -55,16 +38,14 @@
5538
"label": "tasks: watch-tests",
5639
"dependsOn": [
5740
"npm: watch",
58-
"cp-wasm",
5941
"npm: watch-tests"
6042
],
6143
"problemMatcher": []
6244
},
6345
{
6446
"label": "tasks: watch",
6547
"dependsOn": [
66-
"npm: watch",
67-
"cp-wasm"
48+
"npm: watch"
6849
],
6950
"problemMatcher": []
7051
}

package-lock.json

+169-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
"@vscode/test-cli": "^0.0.10",
8888
"@vscode/test-electron": "^2.4.1",
8989
"assert": "^2.1.0",
90+
"copy-webpack-plugin": "^12.0.2",
9091
"eslint": "^7.17.0",
9192
"eslint-config-airbnb-base": "^14.2.1",
9293
"eslint-config-prettier": "^8.6.0",

webpack.config.js

+20-14
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
11
//@ts-check
22

3-
'use strict';
3+
'use strict'
44

5-
const path = require('path');
5+
const path = require('path')
6+
const CopyPlugin = require('copy-webpack-plugin')
67

78
//@ts-check
89
/** @typedef {import('webpack').Configuration} WebpackConfig **/
910

1011
/** @type WebpackConfig */
1112
const extensionConfig = {
1213
target: 'node', // VS Code extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/
13-
mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
14+
mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
1415

1516
entry: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
1617
output: {
1718
// the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/
1819
path: path.resolve(__dirname, 'dist'),
1920
filename: 'extension.js',
20-
libraryTarget: 'commonjs2'
21+
libraryTarget: 'commonjs2',
2122
},
2223
externals: {
23-
vscode: 'commonjs vscode' // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/
24+
vscode: 'commonjs vscode', // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/
2425
// modules added here also need to be added in the .vscodeignore file
2526
},
2627
resolve: {
2728
// support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader
28-
extensions: ['.ts', '.js']
29+
extensions: ['.ts', '.js'],
2930
},
3031
module: {
3132
rules: [
@@ -34,15 +35,20 @@ const extensionConfig = {
3435
exclude: /node_modules/,
3536
use: [
3637
{
37-
loader: 'ts-loader'
38-
}
39-
]
40-
}
41-
]
38+
loader: 'ts-loader',
39+
},
40+
],
41+
},
42+
],
4243
},
4344
devtool: 'nosources-source-map',
4445
infrastructureLogging: {
45-
level: "log", // enables logging required for problem matchers
46+
level: 'log', // enables logging required for problem matchers
4647
},
47-
};
48-
module.exports = [ extensionConfig ];
48+
plugins: [
49+
new CopyPlugin({
50+
patterns: [{ from: 'node_modules/float-pigment-css/float_pigment_css_bg.wasm', to: '.' }],
51+
}),
52+
],
53+
}
54+
module.exports = [extensionConfig]

0 commit comments

Comments
 (0)