Skip to content

Commit 4214c40

Browse files
feat: migrate to TypeScript and build .node in CI (#30)
--------- Co-authored-by: semantic-release-bot <[email protected]>
1 parent f95e382 commit 4214c40

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+9755
-3238
lines changed

.commitlintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["@commitlint/config-conventional"]
3+
}

.eslintrc.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "bun" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"

.github/labeler.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
typescript:
2+
- changed-files:
3+
any-glob-to-any-file: ['**/*.ts']
4+
5+
native:
6+
- changed-files:
7+
any-glob-to-any-file: ['native/**/*']
8+
9+
documentation:
10+
- changed-files:
11+
any-glob-to-any-file: ['README.md', 'docs/**/*']
12+
13+
tests:
14+
- changed-files:
15+
any-glob-to-any-file: ['test/**/*']
16+
17+
examples:
18+
- changed-files:
19+
any-glob-to-any-file: ['examples/**/*']
20+
21+
build:
22+
- changed-files:
23+
any-glob-to-any-file: ['build.ts', 'tsconfig.json']
24+
25+
dependencies:
26+
- changed-files:
27+
any-glob-to-any-file: ['package.json', 'bun.lock']
28+
29+
config:
30+
- changed-files:
31+
any-glob-to-any-file: [
32+
'config/**/*',
33+
'.gitignore',
34+
'.npmignore',
35+
'.gitattributes',
36+
'lefthook.yml',
37+
'biome.json',
38+
'.github/*',
39+
'.github/!(workflows)/**/*'
40+
]
41+
42+
ci:
43+
- changed-files:
44+
any-glob-to-any-file: ['.github/workflows/**/*']

.github/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
changelog:
2+
categories:
3+
- title: What's Changed
4+
labels:
5+
- "*"

.github/workflows/labeler.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: "Pull Request Labeler"
2+
on:
3+
- pull_request_target
4+
5+
jobs:
6+
triage:
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/labeler@v5
13+
with:
14+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
15+
sync-labels: true

.github/workflows/pull_request.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: reviewdog
2+
on: [pull_request]
3+
jobs:
4+
biome:
5+
name: Biome Linter
6+
runs-on: ubuntu-latest
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: mongolyy/reviewdog-action-biome@v1
13+
with:
14+
github_token: ${{ secrets.GITHUB_TOKEN }}
15+
reporter: github-pr-review
16+
fail_level: any

.github/workflows/release.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
branch:
7+
description: 'The branch to release from (e.g., main, beta, next). Semantic-release must be configured for this branch.'
8+
required: true
9+
default: 'main'
10+
push:
11+
branches:
12+
- main
13+
- beta
14+
15+
permissions:
16+
contents: write
17+
18+
jobs:
19+
build:
20+
strategy:
21+
fail-fast: false
22+
runs-on: windows-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
with:
27+
persist-credentials: false
28+
29+
- name: Setup Bun
30+
uses: oven-sh/setup-bun@v2
31+
with:
32+
bun-version: latest
33+
34+
- name: Install dependencies
35+
run: bun install --ignore-scripts --no-save
36+
37+
- name: Install node-gyp
38+
run: bun add -g node-gyp
39+
40+
- name: Build
41+
run: bun run build
42+
43+
- name: Upload artifact
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: memoryprocess
47+
path: lib/
48+
49+
release:
50+
needs: [build]
51+
runs-on: ubuntu-latest
52+
permissions:
53+
contents: write
54+
issues: write
55+
pull-requests: write
56+
id-token: write
57+
steps:
58+
- name: Checkout
59+
uses: actions/checkout@v4
60+
with:
61+
fetch-depth: 0
62+
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.branch || github.ref }}
63+
persist-credentials: false
64+
65+
- name: Download artifacts
66+
uses: actions/download-artifact@v4
67+
with:
68+
name: memoryprocess
69+
path: lib/
70+
71+
- name: Setup Node.js
72+
uses: actions/setup-node@v4
73+
with:
74+
node-version: '20'
75+
76+
- name: Configure npm
77+
run: |
78+
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
79+
npm whoami
80+
env:
81+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
82+
83+
- name: Install dependencies
84+
run: npm ci --ignore-scripts
85+
86+
- name: Run semantic-release
87+
run: npx semantic-release
88+
env:
89+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
node_modules
2+
lib
13
build
2-
test.js
3-
npm-debug.log
44
.vscode
55
.vs
6-
node_modules
7-
test/vcxproj/Debug
8-
test/vcxproj/Release
9-
test/*.exe
10-
test/.vs
6+
.windsurfrules
7+
bun.lock*
8+
9+
# Logs
10+
*.log
11+
npm-debug.log*

.npmignore

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
1-
build
2-
test.js
3-
npm-debug.log
4-
.vscode
5-
.vs
6-
node_modules
7-
test/vcxproj/Debug
8-
test/vcxproj/Release
9-
test/*.exe
10-
test/.vs
1+
# Ignore everything by default
2+
*
3+
4+
# Keep the lib directory and its contents
5+
!lib/
6+
!lib/**
7+
8+
# Keep the assets directory and its contents
9+
!assets/
10+
!assets/**
11+
12+
# Keep essential files
13+
!package.json
14+
!README.md
15+
!LICENSE
16+
!CHANGELOG.md
17+
18+
# Keep the lock files
19+
!package-lock.json
20+
!bun.lockb

0 commit comments

Comments
 (0)