forked from miraclx/xbytes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: module.exports being overwritten (#1)
- Loading branch information
Showing
16 changed files
with
6,584 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
### 关联 Issue | ||
|
||
<!-- 请用 fixes、closes、resolves、relates 这些关键词来关联 issue,原则上,所有 PR 都应该有关联 Issue --> | ||
|
||
### 主要改动 | ||
|
||
<!-- | ||
@example: | ||
1. 修复了 xxx | ||
2. 改进了 xxx | ||
3. 调整了 xxx | ||
--> | ||
|
||
### 界面截图 | ||
|
||
<!-- 如果改动的是跟 UI 相关的,不论是 CLI 还是 WEB 都应该截图 --> | ||
|
||
### 测试计划 | ||
|
||
<!-- 如果本次变更没有自动化测试覆盖,你整理的测试用例集是什么?需要编写成 todo list 放到下面 --> | ||
|
||
### 检查清单 | ||
|
||
- [ ] CHANGELOG.md 是否更新好了 | ||
- [ ] 版本升级过了吗? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: check-pr-title | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- edited | ||
- synchronize | ||
branches: | ||
- main | ||
- dev | ||
|
||
jobs: | ||
lint-title: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: ArcBlock/action-lint-pull-request-title@main | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: publish-beta-to-npm | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
publish-beta-to-npm: | ||
runs-on: ubuntu-latest | ||
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')" | ||
steps: | ||
- name: Checkout release branch code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: "pnpm" | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- name: Install deps | ||
run: pnpm install | ||
|
||
- name: Build | ||
run: pnpm build | ||
|
||
- name: Publish to NPM | ||
run: | | ||
node scripts/update-beta-package-version.js | ||
cat package.json | grep version | ||
npm publish --tag beta | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: publish-to-npm | ||
|
||
on: | ||
push: | ||
branches: [release] | ||
|
||
jobs: | ||
publish-to-npm: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout release branch code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: "pnpm" | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- name: Install deps | ||
run: pnpm install | ||
|
||
- name: Build | ||
run: pnpm build | ||
|
||
- name: Publish to NPM | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: task-list-checker | ||
on: | ||
pull_request: | ||
types: [opened, edited, synchronize, reopened] | ||
jobs: | ||
task-list-checker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check for incomplete task list items | ||
uses: Shopify/task-list-checker@main | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: unit-test | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- release | ||
- main | ||
- master | ||
|
||
jobs: | ||
integration: | ||
runs-on: ubuntu-latest | ||
|
||
if: "! contains(toJSON(github.event.commits.*.message), '[skip actions]')" | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: "pnpm" | ||
|
||
- name: Install deps | ||
run: pnpm install | ||
|
||
- name: Run unit test | ||
run: pnpm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: version-check-for-npm | ||
env: | ||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- release | ||
|
||
jobs: | ||
version-check-for-npm: | ||
timeout-minutes: 30 | ||
runs-on: ubuntu-latest | ||
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' | ||
|
||
- name: Extract current version | ||
id: get_version | ||
run: | | ||
PACKAGE_NAME=$(node -p -e "require('./package.json').name") | ||
echo "PACKAGE_NAME=${PACKAGE_NAME}" >> $GITHUB_ENV | ||
CURRENT_VERSION=$(node -p -e "require('./package.json').version") | ||
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV | ||
- name: Publish to NPM | ||
run: | | ||
LATEST_VERSION=$(npm show $PACKAGE_NAME version) | ||
# https://www.npmjs.com/package/compare-versions-cli | ||
npm install -g compare-versions-cli | ||
COMPARE=$(compare-versions-cli $CURRENT_VERSION $LATEST_VERSION) | ||
if [ $COMPARE -le 0 ] | ||
then | ||
echo "CURRENT_VERSION($CURRENT_VERSION) must greater than LATEST_VERSION($LATEST_VERSION)" | ||
echo "npm: https://www.npmjs.com/package/$PACKAGE_NAME" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
dist/ | ||
node_modules/ | ||
package-lock\.json | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.