Skip to content

Commit b816f93

Browse files
authored
Add CI (changeset / vitest) (#58)
1 parent b32fa71 commit b816f93

File tree

13 files changed

+3385
-3900
lines changed

13 files changed

+3385
-3900
lines changed

.babelrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"presets": [
3+
"@babel/preset-env",
4+
"@babel/preset-typescript",
5+
["babel-preset-solid", { "generate": "dom", "hydratable": true }]
6+
]
7+
}

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
jobs:
11+
release:
12+
name: Release
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout Repo
16+
uses: actions/checkout@v4
17+
18+
- uses: pnpm/action-setup@v4
19+
with:
20+
# https://github.com/pnpm/pnpm/issues/8953
21+
version: 9.15.3
22+
23+
- name: Use Node.js from nvmrc
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version-file: '.nvmrc'
27+
registry-url: 'https://registry.npmjs.org'
28+
29+
- name: Install Dependencies
30+
run: pnpm i --frozen-lockfile
31+
32+
- name: Create Release Pull Request or Publish to npm
33+
id: changesets
34+
uses: changesets/action@v1
35+
with:
36+
publish: pnpm run release
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Tests
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [main]
7+
pull_request:
8+
branches: [main]
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Use Node.js from nvmrc
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version-file: '.nvmrc'
21+
registry-url: 'https://registry.npmjs.org'
22+
23+
- name: Install pnpm
24+
uses: pnpm/action-setup@v4
25+
with:
26+
version: 9
27+
28+
- name: Install dependencies
29+
run: pnpm install
30+
31+
- name: Run tests
32+
run: pnpm run test

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.13.1

package.json

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,30 @@
2828
"prebuild": "npm run clean",
2929
"clean": "rimraf dist/",
3030
"build": "tsc && babel src/index.tsx --out-file dist/index.js",
31-
"test": "jest && npm run test:types",
32-
"test:types": "tsc --project tsconfig.test.json"
31+
"test": "npm run test:unit && npm run test:types",
32+
"test:unit": "vitest run",
33+
"test:watch": "vitest",
34+
"test:types": "tsc --project tsconfig.test.json",
35+
"release": "pnpm build && changeset publish"
3336
},
3437
"peerDependencies": {
3538
"solid-js": ">=1.8.4"
3639
},
3740
"devDependencies": {
38-
"@babel/cli": "^7.14.3",
39-
"@babel/core": "7.14.3",
40-
"@babel/preset-env": "7.14.4",
41-
"@babel/preset-typescript": "7.13.0",
42-
"@types/jest": "^26.0.23",
43-
"babel-preset-solid": "^1.8.4",
44-
"jest": "^26.6.3",
45-
"rimraf": "^3.0.2",
46-
"solid-jest": "0.1.1",
47-
"solid-js": "^1.8.4",
48-
"typescript": "4.9.4"
49-
},
50-
"jest": {
51-
"preset": "solid-jest/preset/browser"
41+
"@babel/cli": "^7.27.0",
42+
"@babel/core": "7.26.10",
43+
"@babel/preset-env": "7.26.9",
44+
"@babel/preset-typescript": "7.27.0",
45+
"@rollup/plugin-babel": "^6.0.4",
46+
"@testing-library/jest-dom": "^6.6.3",
47+
"@types/jest": "^29.5.14",
48+
"@vitest/browser": "^3.1.1",
49+
"babel-preset-solid": "^1.9.5",
50+
"jsdom": "^26.0.0",
51+
"rimraf": "^6.0.1",
52+
"solid-js": "^1.9.5",
53+
"typescript": "5.8.3",
54+
"vite-plugin-solid": "^2.11.6",
55+
"vitest": "^3.1.1"
5256
}
5357
}

0 commit comments

Comments
 (0)