Skip to content

Commit

Permalink
feat: support calc enum
Browse files Browse the repository at this point in the history
  • Loading branch information
baozouai committed Apr 22, 2023
1 parent 5d11038 commit b2a3763
Show file tree
Hide file tree
Showing 18 changed files with 2,156 additions and 2,235 deletions.
8 changes: 8 additions & 0 deletions .codecov.yml
@@ -0,0 +1,8 @@
coverage:
status:
project:
default:
target: 95%
patch:
default:
target: 95%
97 changes: 97 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,97 @@
name: CI

on:
push:
branches:
- master

pull_request:
branches:
- master

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

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

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: pnpm

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

- name: Lint
run: nr lint

typecheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

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

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: pnpm

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

test:
runs-on: ${{ matrix.os }}

strategy:
matrix:
node: [16.x, 18.x]
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v3

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

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

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

- name: Test
run: nr test --run --coverage

- name: Build
run: nr build

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/lcov.info
fail_ci_if_error: true
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,42 @@
name: Release

permissions:
contents: write

on:
push:
tags:
- 'v*'

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

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

- name: Set node
uses: actions/setup-node@v3
with:
node-version: 16.x
registry-url: 'https://registry.npmjs.org'

- name: ChangeLog
run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

- name: Release
run: nr release
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -7,3 +7,4 @@ yarn-error.log
.eslintcache
node_modules
dist
coverage/
11 changes: 0 additions & 11 deletions .npmignore

This file was deleted.

3 changes: 2 additions & 1 deletion .npmrc
@@ -1 +1,2 @@
registry = http://registry.npmjs.org
registry = http://registry.npmjs.org
auto-install-peers=false
1 change: 1 addition & 0 deletions .nvmrc
@@ -0,0 +1 @@
16.14
11 changes: 9 additions & 2 deletions README-zh_CN.md
Expand Up @@ -5,15 +5,22 @@

<div align="center">

[![NPM version][npm-image]][npm-url] ![NPM downloads][download-image]

![Test][test-badge] ![codecov][codecov-badge]

[![NPM version][npm-image]][npm-url] ![NPM downloads][download-image]

[npm-image]: https://img.shields.io/npm/v/babel-plugin-enum-to-object.svg?style=flat-square
[npm-url]: http://npmjs.org/package/babel-plugin-enum-to-object


[download-image]: https://img.shields.io/npm/dm/babel-plugin-enum-to-object.svg?style=flat-square
[download-url]: https://npmjs.org/package/babel-plugin-enum-to-object



[test-badge]: https://github.com/baozouai/babel-plugin-enum-to-object/actions/workflows/test.yml/badge.svg

[codecov-badge]: https://codecov.io/github/baozouai/babel-plugin-enum-to-object/branch/master/graph/badge.svg


</div>
Expand Down
9 changes: 8 additions & 1 deletion README.md
Expand Up @@ -8,14 +8,21 @@

[![NPM version][npm-image]][npm-url] ![NPM downloads][download-image]

![Test][test-badge] ![codecov][codecov-badge]


[npm-image]: https://img.shields.io/npm/v/babel-plugin-enum-to-object.svg?style=flat-square
[npm-url]: http://npmjs.org/package/babel-plugin-enum-to-object


[download-image]: https://img.shields.io/npm/dm/babel-plugin-enum-to-object.svg?style=flat-square
[download-url]: https://npmjs.org/package/babel-plugin-enum-to-object



[test-badge]: https://github.com/baozouai/babel-plugin-enum-to-object/actions/workflows/ci.yml/badge.svg

[codecov-badge]: https://codecov.io/github/baozouai/babel-plugin-enum-to-object/branch/master/graph/badge.svg

</div>

English | [中文](./README-zh_CN.md)
Expand Down
63 changes: 0 additions & 63 deletions __tests__/test.js

This file was deleted.

0 comments on commit b2a3763

Please sign in to comment.