Skip to content

Commit e80564e

Browse files
committed
refactor!: v3.0.0 major overhaul
- Hook: stabilize useCodeExecution (refs, stable execute, updateCode alias) - Tests: fix TypeScript matchers and marked renderer signature; remove unused vars - Docs: README requirements, hook example, CI/CD notes - CI: Node 18 + PNPM, cache; turbo scripts; gh-pages publish docs/dist - Publish: Changesets + npm provenance (OIDC), remove NODE_AUTH_TOKEN - Misc: align workspace configs
1 parent f29548b commit e80564e

File tree

177 files changed

+17728
-7748
lines changed

Some content is hidden

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

177 files changed

+17728
-7748
lines changed

.eslintrc.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "https://json.schemastore.org/eslintrc.json",
3+
"root": true,
4+
"env": {
5+
"browser": true,
6+
"es2021": true,
7+
"node": true
8+
},
9+
"extends": [
10+
"eslint:recommended",
11+
"plugin:@typescript-eslint/recommended",
12+
"plugin:react/recommended",
13+
"plugin:react-hooks/recommended",
14+
"prettier"
15+
],
16+
"parser": "@typescript-eslint/parser",
17+
"parserOptions": {
18+
"ecmaFeatures": {
19+
"jsx": true
20+
},
21+
"ecmaVersion": "latest",
22+
"sourceType": "module"
23+
},
24+
"plugins": ["@typescript-eslint", "react", "react-hooks"],
25+
"settings": {
26+
"react": {
27+
"version": "detect"
28+
}
29+
},
30+
"rules": {
31+
"react/react-in-jsx-scope": "off",
32+
"react/prop-types": "off",
33+
"@typescript-eslint/no-explicit-any": "warn",
34+
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }]
35+
},
36+
"ignorePatterns": ["dist", "node_modules", "*.js", "*.cjs"]
37+
}

.github/workflows/gh-pages.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,26 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v4
2020

21+
- name: Setup PNPM
22+
uses: pnpm/action-setup@v4
23+
with:
24+
version: 9
25+
2126
- name: Setup node
2227
uses: actions/setup-node@v4
2328
with:
24-
node-version: 'lts/*'
29+
node-version: '18.x'
30+
cache: 'pnpm'
2531

2632
- name: Install
27-
run: npm install
33+
run: pnpm install --frozen-lockfile
2834

2935
- name: Build
30-
run: npm run build:docs
36+
run: pnpm docs:build
3137

3238
- name: Deploy
3339
uses: peaceiris/actions-gh-pages@v3
3440
if: github.ref == 'refs/heads/main'
3541
with:
3642
github_token: ${{ secrets.GITHUB_TOKEN }}
37-
publish_dir: ./docs/assets
43+
publish_dir: ./docs/dist

.github/workflows/nodejs-ci.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,33 @@ on:
1212
- main
1313
jobs:
1414
test:
15-
name: 'Test'
15+
name: 'Build & Test'
1616
runs-on: ubuntu-latest
17-
container: node:16
1817

1918
steps:
20-
- uses: actions/checkout@v2
21-
- env:
19+
- uses: actions/checkout@v4
20+
21+
- name: Setup PNPM
22+
uses: pnpm/action-setup@v4
23+
with:
24+
version: 9
25+
26+
- name: Setup Node
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: '18.x'
30+
cache: 'pnpm'
31+
32+
- name: Install dependencies
33+
run: pnpm install --frozen-lockfile
34+
env:
2235
HUSKY: 0
23-
run: npm install
24-
- run: npm test
36+
37+
- name: Typecheck
38+
run: pnpm -w typecheck
39+
40+
- name: Build
41+
run: pnpm -w build
42+
43+
- name: Test
44+
run: pnpm -w test --reporter verbose
Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,44 @@
11
# see https://help.github.com/cn/actions/language-and-framework-guides/publishing-nodejs-packages
22

3-
name: Node.js Package
3+
name: Release Packages
44

55
on:
6+
workflow_dispatch: {}
67
push:
7-
tags: ['*']
8+
tags:
9+
- 'v*'
810

911
jobs:
1012
publish:
11-
name: 'Publish'
13+
name: 'Publish to npm'
1214
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
id-token: write
1318
steps:
14-
- uses: actions/checkout@v2
15-
# Setup .npmrc file to publish to npm
16-
- uses: actions/setup-node@v1
19+
- uses: actions/checkout@v4
20+
21+
- name: Setup PNPM
22+
uses: pnpm/action-setup@v4
23+
with:
24+
version: 9
25+
26+
- name: Setup Node
27+
uses: actions/setup-node@v4
1728
with:
18-
node-version: '14.x'
29+
node-version: '18.x'
1930
registry-url: 'https://registry.npmjs.org'
31+
cache: 'pnpm'
2032

2133
- name: Install dependencies
22-
run: npm install
34+
run: pnpm install --frozen-lockfile
35+
env:
36+
HUSKY: 0
2337

2438
- name: Build
25-
run: npm run build
39+
run: pnpm -w build
2640

27-
- name: Npm Publish
28-
run: npm publish dist
41+
- name: Publish with Changesets
42+
run: pnpm release
2943
env:
30-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
44+
NPM_CONFIG_PROVENANCE: true

.gitignore

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
karma-*
6-
7-
# Runtime data
8-
pids
9-
*.pid
10-
*.seed
1+
# Dependencies
2+
node_modules/
3+
.pnpm-store/
114

12-
# Directory for instrumented libs generated by jscoverage/JSCover
13-
lib-cov
5+
# Build outputs
6+
dist/
7+
*.tsbuildinfo
148

15-
# Coverage directory used by tools like istanbul
16-
coverage
9+
# IDE
10+
.idea/
11+
.vscode/
12+
*.swp
13+
*.swo
1714

18-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
19-
.grunt
15+
# OS
16+
.DS_Store
17+
Thumbs.db
2018

21-
# node-waf configuration
22-
.lock-wscript
19+
# Logs
20+
*.log
21+
npm-debug.log*
22+
pnpm-debug.log*
2323

24-
# Compiled binary addons (http://nodejs.org/api/addons.html)
25-
build/Release
24+
# Test coverage
25+
coverage/
2626

27-
# Dependency directory
28-
node_modules
27+
# Turbo
28+
.turbo/
2929

30-
# Optional npm cache directory
30+
# Environment
31+
.env
32+
.env.local
33+
.env.*.local
3134
.npm
3235

3336
# Optional REPL history

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"tabWidth": 2,
5+
"trailingComma": "none",
6+
"printWidth": 100,
7+
"arrowParens": "avoid"
8+
}

0 commit comments

Comments
 (0)