Skip to content

Commit c768136

Browse files
committed
some settings required to work in this project
1 parent 29c386b commit c768136

File tree

7 files changed

+106
-7
lines changed

7 files changed

+106
-7
lines changed

.github/workflows/build.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ jobs:
2929
strategy:
3030
matrix:
3131
os: [ macos-10.15, macos-11, macos-12, ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, windows-2019, windows-2022 ]
32-
node: [ 14, 16, 18 ]
32+
node: [ 18, 20 ]
3333
exclude:
3434
- os: ubuntu-18.04
3535
node: 18
3636
steps:
3737
- name: Fetch Codebase
38-
uses: actions/checkout@v3
38+
uses: actions/checkout@v4
3939
- name: Setup Node.js
40-
uses: actions/setup-node@v3
40+
uses: actions/setup-node@v4
4141
with:
4242
node-version: ${{ matrix.node }}
4343
check-latest: true
@@ -61,7 +61,7 @@ jobs:
6161
curl -sLO https://github.com/ApsarasX/llvm-windows/releases/download/llvmorg-$LLVM_VERSION/$LLVM_PREBUILT_FILE
6262
Expand-Archive -Path $LLVM_PREBUILT_FILE -DestinationPath .
6363
$LLVM_CMAKE_DIR = "$pwd\\LLVM-$LLVM_VERSION-win64\\lib\\cmake\\llvm"
64-
npm config set cmake_LLVM_DIR $LLVM_CMAKE_DIR
64+
echo "cmake_LLVM_DIR=$LLVM_CMAKE_DIR"> .npmrc
6565
- name: Install Dependencies
6666
run: npm install --ignore-scripts
6767
- name: CMake Build Debug and Test
@@ -74,4 +74,4 @@ jobs:
7474
run: |
7575
npm run clear
7676
npm run build:release
77-
npm test
77+
npm test

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
.idea/
2-
.vscode/
2+
.vscode/*
3+
!.vscode/launch.json
4+
!.vscode/settings.json
35

46
cmake-build-*/
57

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cmake_LLVM_DIR=/opt/homebrew/opt/llvm@14/lib/cmake/llvm/

.vscode/launch.json

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Jest: Run tests in current file",
9+
"type": "node",
10+
"request": "launch",
11+
"runtimeExecutable": "npx",
12+
"program": "jest",
13+
"args": [
14+
"${relativeFile}",
15+
],
16+
"console": "integratedTerminal",
17+
"skipFiles": [
18+
"<node_internals>/**"
19+
],
20+
"outFiles": [
21+
"${workspaceFolder}/**/*.js"
22+
]
23+
},
24+
{
25+
"name": "Vitest: Run tests in current file",
26+
"type": "node",
27+
"request": "launch",
28+
"runtimeExecutable": "npx",
29+
"program": "vitest",
30+
"args": [
31+
"run",
32+
"${relativeFile}",
33+
],
34+
"console": "integratedTerminal",
35+
"skipFiles": [
36+
"<node_internals>/**"
37+
],
38+
"outFiles": [
39+
"${workspaceFolder}/**/*.js"
40+
]
41+
},
42+
{
43+
/* execute npm build:debug before running this! */
44+
"name": "LLDB: Debug LLVM-binding native parts during Vitest execution",
45+
"type": "lldb",
46+
"request": "launch",
47+
"program": "node",
48+
"sourceLanguages": ["cpp", "javascript"],
49+
"args": [
50+
"${workspaceFolder}/node_modules/vitest/dist/cli-wrapper.js",
51+
"run",
52+
"${relativeFile}",
53+
],
54+
},
55+
]
56+
}

.vscode/settings.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"C_Cpp.default.cStandard": "c17",
3+
"C_Cpp.default.cppStandard": "c++17",
4+
"C_Cpp.default.includePath": [
5+
"/opt/homebrew/opt/llvm@14/include",
6+
"${userHome}/.cmake-js/node-*/v*/include/node",
7+
"${workspaceFolder}/node_modules/node-addon-api",
8+
"${workspaceFolder}/include",
9+
],
10+
"clangd.fallbackFlags": [
11+
"-std=c++17",
12+
"-xc++-header",
13+
"-I/opt/homebrew/opt/llvm@14/include",
14+
"-I${userHome}/.cmake-js/node-arm64/v18.18.2/include/node/", /* switch to your arch & version here! */
15+
"-I${workspaceFolder}/node_modules/node-addon-api",
16+
"-I${workspaceFolder}/include",
17+
]
18+
}

tsconfig.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
"tests/**/*.ts",
66
],
77
"compilerOptions": {
8+
"noEmit": true,
89
"target": "ES5",
910
"module": "commonjs",
1011
"strict": true,
1112
"moduleResolution": "node",
1213
"esModuleInterop": true,
13-
"forceConsistentCasingInFileNames": true
14+
"forceConsistentCasingInFileNames": true,
15+
"skipLibCheck": true
1416
}
1517
}

vitest.config.mts

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//import { defineConfig } from "vitest/config"
2+
3+
export default /*defineConfig*/({
4+
test: {
5+
deps: {
6+
interopDefault: true
7+
},
8+
include: ['**/*.{test,spec}.ts'],
9+
exclude: ['**/node_modules/**', '**/dist/**'],
10+
globals: true,
11+
typecheck: {
12+
//enabled: false
13+
},
14+
poolOptions: {
15+
threads: {
16+
singleThread: true
17+
}
18+
}
19+
}
20+
});

0 commit comments

Comments
 (0)