Skip to content

Commit

Permalink
some settings required to work in this project
Browse files Browse the repository at this point in the history
  • Loading branch information
sailingKieler committed Jul 5, 2024
1 parent 29c386b commit c768136
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 7 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ jobs:
strategy:
matrix:
os: [ macos-10.15, macos-11, macos-12, ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, windows-2019, windows-2022 ]
node: [ 14, 16, 18 ]
node: [ 18, 20 ]
exclude:
- os: ubuntu-18.04
node: 18
steps:
- name: Fetch Codebase
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
check-latest: true
Expand All @@ -61,7 +61,7 @@ jobs:
curl -sLO https://github.com/ApsarasX/llvm-windows/releases/download/llvmorg-$LLVM_VERSION/$LLVM_PREBUILT_FILE
Expand-Archive -Path $LLVM_PREBUILT_FILE -DestinationPath .
$LLVM_CMAKE_DIR = "$pwd\\LLVM-$LLVM_VERSION-win64\\lib\\cmake\\llvm"
npm config set cmake_LLVM_DIR $LLVM_CMAKE_DIR
echo "cmake_LLVM_DIR=$LLVM_CMAKE_DIR"> .npmrc
- name: Install Dependencies
run: npm install --ignore-scripts
- name: CMake Build Debug and Test
Expand All @@ -74,4 +74,4 @@ jobs:
run: |
npm run clear
npm run build:release
npm test
npm test
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.idea/
.vscode/
.vscode/*
!.vscode/launch.json
!.vscode/settings.json

cmake-build-*/

Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cmake_LLVM_DIR=/opt/homebrew/opt/llvm@14/lib/cmake/llvm/
56 changes: 56 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Jest: Run tests in current file",
"type": "node",
"request": "launch",
"runtimeExecutable": "npx",
"program": "jest",
"args": [
"${relativeFile}",
],
"console": "integratedTerminal",
"skipFiles": [
"<node_internals>/**"
],
"outFiles": [
"${workspaceFolder}/**/*.js"
]
},
{
"name": "Vitest: Run tests in current file",
"type": "node",
"request": "launch",
"runtimeExecutable": "npx",
"program": "vitest",
"args": [
"run",
"${relativeFile}",
],
"console": "integratedTerminal",
"skipFiles": [
"<node_internals>/**"
],
"outFiles": [
"${workspaceFolder}/**/*.js"
]
},
{
/* execute npm build:debug before running this! */
"name": "LLDB: Debug LLVM-binding native parts during Vitest execution",
"type": "lldb",
"request": "launch",
"program": "node",
"sourceLanguages": ["cpp", "javascript"],
"args": [
"${workspaceFolder}/node_modules/vitest/dist/cli-wrapper.js",
"run",
"${relativeFile}",
],
},
]
}
18 changes: 18 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"C_Cpp.default.cStandard": "c17",
"C_Cpp.default.cppStandard": "c++17",
"C_Cpp.default.includePath": [
"/opt/homebrew/opt/llvm@14/include",
"${userHome}/.cmake-js/node-*/v*/include/node",
"${workspaceFolder}/node_modules/node-addon-api",
"${workspaceFolder}/include",
],
"clangd.fallbackFlags": [
"-std=c++17",
"-xc++-header",
"-I/opt/homebrew/opt/llvm@14/include",
"-I${userHome}/.cmake-js/node-arm64/v18.18.2/include/node/", /* switch to your arch & version here! */
"-I${workspaceFolder}/node_modules/node-addon-api",
"-I${workspaceFolder}/include",
]
}
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
"tests/**/*.ts",
],
"compilerOptions": {
"noEmit": true,
"target": "ES5",
"module": "commonjs",
"strict": true,
"moduleResolution": "node",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true
}
}
20 changes: 20 additions & 0 deletions vitest.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//import { defineConfig } from "vitest/config"

export default /*defineConfig*/({
test: {
deps: {
interopDefault: true
},
include: ['**/*.{test,spec}.ts'],
exclude: ['**/node_modules/**', '**/dist/**'],
globals: true,
typecheck: {
//enabled: false
},
poolOptions: {
threads: {
singleThread: true
}
}
}
});

0 comments on commit c768136

Please sign in to comment.