Skip to content

Commit

Permalink
Revert "release: 0.0.1-beta.2"
Browse files Browse the repository at this point in the history
This reverts commit 0f08ce7.
  • Loading branch information
showlotus committed Jan 2, 2024
1 parent 0f08ce7 commit 9a5f5df
Show file tree
Hide file tree
Showing 144 changed files with 288,015 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist
coverage
node_modules
60 changes: 60 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
const { builtinModules } = require('node:module');

module.exports = {
root: true,
env: {
browser: true,
node: true,
es6: true,
},

extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
],
plugins: ['import'],
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
rules: {
eqeqeq: ['warn', 'always', { null: 'never' }],
'no-debugger': ['error'],
'no-empty': ['warn', { allowEmptyCatch: true }],
'prefer-const': [
'warn',
{
destructuring: 'all',
},
],
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/consistent-type-imports': [
'error',
{ prefer: 'type-imports', fixStyle: 'inline-type-imports' },
],

'import/no-nodejs-modules': [
'error',
{ allow: builtinModules.map((mod) => `node:${mod}`) },
],
'import/no-duplicates': 'error',
'import/order': 'error',
'sort-imports': [
'error',
{
ignoreCase: false,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
allowSeparatedGroups: false,
},
],
},
};
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: 🐛 Report Bug
about: Report Bug.
title: '[BUG] Report bug'
assignees:
---

### 🐛 Bug description

<!-- Please describe the bug in detail above so that everyone can understand. -->

### 📝 Steps to reproduce

<!-- Please describe the steps to reproduce the bug above. -->

Reproduction Link (required): <!-- Please provide a link to a reproduction case. -->

### 🏞 Desired result

<!-- Please describe above what you expected to see. -->

### 🚑 Other information

<!-- Please enter other information such as screenshots above. -->
<!-- From: https://github.com/one-template/issue-template -->
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: '❓ Question or need help'
about: Question or need help
title: '[Question] Help'
labels: 'question'
assignees: ''
---

### 🧐 Problem Description

<!-- Describe the problem in detail so that everyone can understand. -->

### 💻 Sample code

<!-- If you have a solution, state it clearly here. -->

### 🚑 Other information

<!-- Other information such as screenshots can be posted here. -->
<!-- From: https://github.com/one-template/issue-template -->
49 changes: 49 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!--
First of all, thank you for your contribution! 😄
-->

### 🤔 What is the nature of this change?

- [ ] New feature
- [ ] Fix bug
- [ ] Style optimization
- [ ] Code style optimization
- [ ] Performance optimization
- [ ] Build optimization
- [ ] Refactor code or style
- [ ] Test related
- [ ] Other

### 🔗 Related Issue

<!--
Describe the source of related requirements, such as the related issue discussion link.
-->

### 💡 Background or solution

<!--
The specific problem solved.
-->

### 📝 Changelog

<!--
Describe changes from the user side, and list all potential break changes or other risks.
--->

| Language | Changelog |
| ---------- | --------- |
| 🇺🇸 English | |
| 🇨🇳 Chinese | |

### ☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

- [ ] Doc is updated/provided or not needed
- [ ] Demo is updated/provided or not needed
- [ ] TypeScript definition is updated/provided or not needed
- [ ] Changelog is provided or not needed

<!-- From: https://github.com/one-template/pr-template -->
21 changes: 21 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
extends: [
'config:base',
'schedule:weekly',
'group:allNonMajor',
':semanticCommitTypeAll(chore)',
],
labels: ['dependencies'],
rangeStrategy: 'bump',
packageRules: [
{
depTypeList: ['peerDependencies'],
enabled: false,
},
],
ignoreDeps: [
// Pure ESM
'camelcase',
],
}
67 changes: 67 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: CI

permissions: {}

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true

jobs:
test:
timeout-minutes: 20
runs-on: ubuntu-latest
name: Unit Test
steps:
- name: Checkout
uses: actions/checkout@v4

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

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: pnpm

- name: Install deps
run: pnpm install

- name: Test unit
run: pnpm run test

lint:
timeout-minutes: 10
runs-on: ubuntu-latest
name: Lint
steps:
- name: Checkout
uses: actions/checkout@v4

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

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: pnpm

- name: Install deps
run: pnpm install

- name: Lint
run: pnpm run lint

- name: Check formatting
run: pnpm prettier --check .

- name: Typecheck
run: pnpm run typecheck
14 changes: 14 additions & 0 deletions .github/workflows/emoji-helper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Emoji Helper

on:
release:
types: [published]

jobs:
emoji:
runs-on: ubuntu-latest
steps:
- uses: actions-cool/emoji-helper@v1.0.0
with:
type: 'release'
emoji: '+1, laugh, heart, hooray, rocket, eyes'
27 changes: 27 additions & 0 deletions .github/workflows/issue-reply.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Issue Reply

on:
issues:
types: [labeled]

jobs:
reply-helper:
runs-on: ubuntu-latest
steps:
- name: help wanted
if: github.event.label.name == 'help wanted'
uses: actions-cool/issues-helper@v3
with:
actions: 'create-comment'
issue-number: ${{ github.event.issue.number }}
body: |
Hello @${{ github.event.issue.user.login }}. We totally like your proposal/feedback, welcome to send us a Pull Request for it. Please be sure to fill in the default template in the Pull Request, provide changelog/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution!
- name: need reproduction
if: github.event.label.name == 'need reproduction'
uses: actions-cool/issues-helper@v3
with:
actions: 'create-comment'
issue-number: ${{ github.event.issue.number }}
body: |
Hello @${{ github.event.issue.user.login }}. In order to facilitate location and troubleshooting, we need you to provide a realistic example. Please forking these link [codesandbox](https://codesandbox.io/s/magical-vaughan-byzhk?file=/src/App.jsx) or provide your GitHub repository.
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

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

- name: Set node
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: pnpm
registry-url: 'https://registry.npmjs.org'

- run: npx changelogithub
continue-on-error: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Install Dependencies
run: pnpm i

- name: PNPM build
run: pnpm run build

- name: Publish to NPM
run: pnpm -r publish --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_PROVENANCE: true
Loading

0 comments on commit 9a5f5df

Please sign in to comment.