Skip to content

[PROPOSAL] Integrate Napi.rs to TSC to gradually migrate to Rust 🦀 #60480

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

Closed
wants to merge 1 commit 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
29 changes: 28 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- '20'
- '18'
- '16'
- '14'
# - '14' does not support Nullish Coalescing in napi.rs
bundle:
- 'true'
include:
Expand All @@ -56,6 +56,8 @@ jobs:
node-version: ${{ matrix.node-version }}
check-latest: true
- run: npm ci
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: npm run build:napi

- name: Tests
id: test
Expand All @@ -70,6 +72,7 @@ jobs:
git diff --staged --exit-code

coverage:
if: ${{ github.repository_owner == 'microsoft' }}
runs-on:
- 'self-hosted'
- '1ES.Pool=TypeScript-1ES-GitHub-Large'
Expand All @@ -86,6 +89,9 @@ jobs:
node-version: 'lts/*'
- run: npm ci

- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: npm run build:napi

- name: Run tests with coverage
run: npm test -- --no-lint --coverage

Expand Down Expand Up @@ -157,6 +163,9 @@ jobs:
node-version: 'lts/*'
- run: npm ci

- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: npm run build:napi

- name: Installing browsers
run: npx playwright install --with-deps

Expand All @@ -173,6 +182,9 @@ jobs:
node-version: 'lts/*'
- run: npm ci

- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: npm run build:napi

- name: Build src
run: npx hereby build-src

Expand All @@ -193,6 +205,9 @@ jobs:

- run: npm ci

- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: npm run build:napi

- run: npx hereby lkg
- run: |
node ./scripts/addPackageJsonGitHead.mjs package.json
Expand Down Expand Up @@ -237,6 +252,8 @@ jobs:
npm --version
# corepack enable npm

- uses: actions-rust-lang/setup-rust-toolchain@v1

- run: |
npm install -g $(jq -r '.packageManager' < package.json)
npm --version
Expand All @@ -245,6 +262,10 @@ jobs:
- run: npm ci
working-directory: ./pr

# TODO: same on base once it has the command
- run: npm run build:napi
working-directory: ./pr

- run: npm ci
working-directory: ./base

Expand Down Expand Up @@ -284,6 +305,9 @@ jobs:
node-version: 'lts/*'
- run: npm ci

- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: npm run build:napi

- name: Build tsc
run: npx hereby tsc

Expand All @@ -303,6 +327,9 @@ jobs:
node-version: 'lts/*'
- run: npm ci

- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: npm run build:napi

- name: Remove all baselines
run: rm -rf tests/baselines/reference

Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,9 @@ package-lock.json
.eslintcache
*v8.log
/lib/

# napi.rs
src/rs.d.ts
src/rs.js
target/*
typescript.*
271 changes: 271 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading