Skip to content

Commit

Permalink
feat: 完成 v3 (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
fjc0k committed Jun 14, 2020
1 parent 27b8a5f commit 8791ed8
Show file tree
Hide file tree
Showing 386 changed files with 19,763 additions and 31,685 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
!**/.*
node_modules
lib
dist
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** @type import('haoma').ESLintConfig */
module.exports = require('haoma').getESLintConfig()
46 changes: 46 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish

on:
push:
branches:
- master

jobs:
publish:
if: ${{ startsWith(github.event.head_commit.message, 'chore(release):') }}
name: Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: master
persist-credentials: false
- uses: actions/setup-node@v1
with:
node-version: '13'
registry-url: 'https://registry.npmjs.org'
- uses: actions/cache@v2
id: cache
with:
path: node_modules
key: ${{ hashFiles('pnpm-lock.yaml') }}
- if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: npx pnpm install
- run: |
npm run build
npm run test
if $IS_BETA; then
npm run publish-package-next
else
npm run publish-package
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
IS_BETA: ${{ contains(github.event.head_commit.message, 'beta') }}
- uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: docs/dist
TARGET_FOLDER: v3
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Test

on:
push:
branches:
- master

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: master
- uses: actions/setup-node@v1
with:
node-version: '13'
registry-url: 'https://registry.npmjs.org'
- uses: actions/cache@v2
id: cache
with:
path: node_modules
key: ${{ hashFiles('pnpm-lock.yaml') }}
- if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: npx pnpm install
- run: |
npm run build
npm run test-with-coverage
npx codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
14 changes: 8 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
*.log
.DS_Store
Thumbs.db
node_modules
*.stackdump
.rpt2_cache
coverage
lib
.typedoc
*.tsbuildinfo
*.log*
/lib
/dist
/coverage
/docs
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shamefully-hoist=true
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
package-lock.json
yarn.lock
pnpm-lock.yaml
lib
dist
2 changes: 2 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** @type import('haoma').PrettierConfig */
module.exports = require('haoma').getPrettierConfig()
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .versionrc.README-updater.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const pkg = require('./package.json')

/**
* @param {String} content
*/
module.exports.readVersion = content => {
return content.match(new RegExp(`${pkg.name}@([^']+)'`))[1]
}

/**
* @param {String} content
* @param {String} version
*/
module.exports.writeVersion = (content, version) => {
const prevVersion = module.exports.readVersion(content)
const nextVersion = version.includes('beta') ? prevVersion : version
return content.replace(
new RegExp(`(?<=${pkg.name}@)[^']+(?=')`, 'g'),
nextVersion,
)
}
14 changes: 14 additions & 0 deletions .versionrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/** @type import('standard-version').Options */
module.exports = {
// ref: https://github.com/conventional-changelog/standard-version#can-i-use-standard-version-for-additional-metadata-files-languages-or-version-files
bumpFiles: [
{
filename: 'package.json',
type: 'json',
},
{
filename: 'README.md',
updater: '.versionrc.README-updater.js',
},
],
}
21 changes: 0 additions & 21 deletions .vscode/launch.json

This file was deleted.

21 changes: 0 additions & 21 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
{
"eslint.enable": true,
"eslint.nodePath": "./node_modules",
"eslint.packageManager": "yarn",
"eslint.run": "onSave",
"eslint.options": {
"ignorePath": ".gitignore",
"cache": true,
"cacheLocation": "./node_modules/.cache/eslint"
},
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"files.associations": {
"*.json": "jsonc"
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"typescript.tsdk": "node_modules/typescript/lib"
}
20 changes: 0 additions & 20 deletions .vscode/vtils.code-snippets

This file was deleted.

0 comments on commit 8791ed8

Please sign in to comment.