Skip to content

Commit

Permalink
fix: make vue peer dep
Browse files Browse the repository at this point in the history
chore: add github actions
  • Loading branch information
LinusBorg committed Nov 7, 2022
1 parent 575828f commit c8e73ff
Show file tree
Hide file tree
Showing 3 changed files with 236 additions and 8 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: 'ci'
on:
push:
branches:
- '**'
pull_request:
branches:
- main

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
build-and-typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Set node version to 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'pnpm'

- run: pnpm install

- name: Run build & tsc
run: pnpm run build

unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Set node version to 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'pnpm'

- run: pnpm install

- name: Run unit tests
run: pnpm run test:unit

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Set node version to 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'pnpm'

- run: pnpm install

- name: Lint codebase
run: pnpm run lint

size:
runs-on: ubuntu-latest
env:
CI_JOB_NUMBER: 1
steps:
- uses: actions/checkout@v1
- uses: andresz1/size-limit-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
30 changes: 24 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,28 @@
"./package.json": "./package.json"
},
"files": [
"dist", "README.md", "LICENSE", "src"
"dist",
"README.md",
"LICENSE",
"src"
],
"scripts": {
"dev": "vite",
"build": "vite build && tsc --declaration --emitDeclarationOnly -p tsconfig.app.json --outDir dist",
"type-check": "tsc --noEmit -p tsconfig.vitest.json --composite false",
"test:unit": "vitest --environment jsdom --root src/",
"test:ci": "vitest --environment jsdom --root src/ --run",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
},
"dependencies": {
"type-fest": "^3.2.0",
"vue": "^3.2.41"
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix"
},
"size-limit": [
{
"path": "dist/index.cjs",
"limit": "2kB"
}
],
"devDependencies": {
"@rushstack/eslint-patch": "^1.1.4",
"@size-limit/preset-small-lib": "^8.1.0",
"@types/jsdom": "^20.0.0",
"@types/node": "^16.11.68",
"@vitejs/plugin-vue": "^3.1.2",
Expand All @@ -62,9 +68,21 @@
"jsdom": "^20.0.1",
"npm-run-all": "^4.1.5",
"prettier": "^2.7.1",
"size-limit": "^8.1.0",
"type-fest": "^3.2.0",
"typescript": "~4.7.4",
"vite": "^3.1.8",
"vitest": "^0.24.3",
"vue": "^3.2.41",
"vue-tsc": "^1.0.8"
},
"peerDependencies": {
"vue": "^3.2"
},
"peerDependenciesMeta": {
"vue": {
"optional": true
}
}

}

0 comments on commit c8e73ff

Please sign in to comment.