Skip to content

feat: new build + esm support #296

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

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from
Draft
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
12 changes: 12 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "@antfu",
"rules": {
"no-console": "warn"
},
"ignorePatterns": [
"dist",
"node_modules",
"old",
"src/**/__tests__/*.ts",
]
}
6 changes: 0 additions & 6 deletions .github/dependabot.yml

This file was deleted.

94 changes: 46 additions & 48 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,65 @@
name: CI
name: Main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches:
- develop
- main

pull_request:
types:
- 'synchronize'
- 'opened'
branches:
- '**'
- main

jobs:
build-and-test:
name: Build and Test (Node ${{ matrix.node }})
runs-on: ubuntu-latest
timeout-minutes: 30
build-test:
name: 📚 Main
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node:
- 18.x
- 16.x
- 14.x
- 12.x
steps:
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- uses: actions/checkout@v2
- name: Restore Dependency Cache
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.OS }}-dependency-cache-${{ hashFiles('**/package.json') }}
- run: npm install
- run: npm run lint
- run: npm run build
- run: npm test
deploy:
name: Deploy
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/stable' }}
timeout-minutes: 30
needs:
- build-and-test

steps:
- run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
- uses: actions/setup-node@v1
with:
node-version: 16.x
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Restore Dependency Cache
uses: actions/cache@v1

- uses: pnpm/[email protected]

- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ~/.npm
key: ${{ runner.OS }}-dependency-cache-${{ hashFiles('**/package.json') }}
- run: npm install
- run: npm run publish:ci
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-main-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-main-

- name: 📦 Install deps (with cache)
run: pnpm install --child-concurrency 3

- name: 👀 Lint
run: pnpm lint

- name: 🚀 Build
run: pnpm build

- name: 🧪 Test
run: pnpm test
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GIT_AUTHOR_NAME: Ionitron
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: Ionitron
GIT_COMMITTER_EMAIL: [email protected]
VITE_TEST_DB_URL: ${{ secrets.VITE_TEST_DB_URL }}
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-node@v3
with:
node-version: 16.x

- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.REPOCHANGELOG_TOKEN}}
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.swp
dist
node_modules
*.log
.DS_Store
.vscode
node_modules
dist
package-lock.json
old
1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

4 changes: 3 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
package-lock=false
enable-pre-post-scripts=true
shamefully-hoist=true
git-checks=false
Loading