diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..758659a --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: ant-design +open_collective: ant-design diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..5e6c7fa --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,27 @@ +version: 2 +updates: + - package-ecosystem: npm + directory: '/' + schedule: + interval: weekly + day: monday + time: '21:00' + timezone: Asia/Shanghai + open-pull-requests-limit: 10 + groups: + npm-dependencies: + patterns: + - '*' + + - package-ecosystem: github-actions + directory: '/' + schedule: + interval: weekly + day: monday + time: '21:00' + timezone: Asia/Shanghai + open-pull-requests-limit: 10 + groups: + github-actions: + patterns: + - '*' diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..6082fc6 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,43 @@ +name: 'CodeQL' + +on: + push: + branches: ['master'] + pull_request: + branches: ['master'] + schedule: + - cron: '36 13 * * 3' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [javascript-typescript] + + steps: + - name: Checkout + uses: actions/checkout@v7 + with: + persist-credentials: false + + - name: Initialize CodeQL + uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e + with: + languages: ${{ matrix.language }} + queries: +security-and-quality + + - name: Autobuild + uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e + with: + category: '/language:${{ matrix.language }}' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..e17c37b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,24 @@ +name: ✅ test + +on: + push: + branches: [master] + pull_request: + branches: [master] + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + with: + persist-credentials: false + - uses: actions/setup-node@v6 + with: + node-version: 22 + - run: npm install --legacy-peer-deps + - run: npm run compile + - run: npm run test:only diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..378e691 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) react-component + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 64f79cb..4a76384 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,63 @@ -# rc-np +
+

@rc-component/np

+

Ant Design Part of the Ant Design ecosystem.

+

🚀 Release helper for rc-component packages.

-version control for package publish +

+ NPM version + npm downloads + bundle size + build status + Codecov +

+
+ +

English | 简体中文

+ +## Highlights + +| Area | Support | +| ------- | ----------------------------------------- | +| Purpose | Release helper for rc-component packages. | +| Package | `@rc-component/np` | +| Release | `@rc-component/np` / `rc-np` | + +## Install + +```bash +npm install @rc-component/np --save-dev +``` ## Usage +```bash +npx rc-np ``` -$ rc-np + +## API + +| Command | Description | +| ------- | ---------------------------------- | +| `rc-np` | Run the rc-component release flow. | + +## Development + +```bash +npm install +npm run compile +npm run test:only +``` + +## Release + +Maintainers can run the publish guard before releasing this package: + +```bash +npm run prepublishOnly ``` + +This package is the release helper itself, so the guard only verifies the build before publishing. + +## License + +@rc-component/np is released under the [MIT](./LICENSE) license. diff --git a/README.zh-CN.md b/README.zh-CN.md new file mode 100644 index 0000000..c468de3 --- /dev/null +++ b/README.zh-CN.md @@ -0,0 +1,63 @@ +
+

@rc-component/np

+

Ant Design Ant Design 生态的一部分。

+

🚀 rc-component 包使用的发布辅助工具。

+ +

+ NPM version + npm downloads + bundle size + build status + Codecov +

+
+ +

English | 简体中文

+ +## 亮点 + +| 方向 | 支持 | +| ---- | ----------------------------------- | +| 定位 | rc-component 包使用的发布辅助工具。 | +| 包名 | `@rc-component/np` | +| 发布 | `@rc-component/np` / `rc-np` | + +## 安装 + +```bash +npm install @rc-component/np --save-dev +``` + +## 用法 + +```bash +npx rc-np +``` + +## API + +| 名称 | 说明 | +| ------- | ---------------------------- | +| `rc-np` | 运行 rc-component 发布流程。 | + +## 本地开发 + +```bash +npm install +npm run compile +npm run test:only +``` + +## 发布 + +维护者发布此包前可以运行发布校验: + +```bash +npm run prepublishOnly +``` + +这个包本身就是发布辅助工具,所以发布校验只检查构建产物。 + +## 许可证 + +@rc-component/np 基于 [MIT](./LICENSE) 协议发布。 diff --git a/package.json b/package.json index b3c6cce..0a9a916 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@rc-component/np", "version": "1.0.4", - "description": "publish tools for version bumping and changelog generation", + "description": "🚀 Release helper for rc-component packages.", "keywords": [ "publish" ], @@ -31,28 +31,28 @@ "compile": "father build", "prepublishOnly": "npm run compile", "test": "npm run compile && npm run test:only", - "test:only": "node ./bin/np.mjs" + "test:only": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js --runInBand" }, "dependencies": { "@inquirer/prompts": "^7.2.3", - "babel-jest": "^29.7.0", + "babel-jest": "^30.4.1", "chalk": "^4.1.2", "escape-goat": "^4.0.0", "fs-extra": "^10.1.0", - "jest": "^29.2.1", + "jest": "^30.4.2", "open": "^10.1.0", "semver": "^7.6.3", "simple-git": "^3.27.0", "yargs-parser": "^21.1.1" }, "devDependencies": { - "@types/fs-extra": "^9.0.13", - "@types/jest": "^29.2.0", - "@types/node": "^22.7.5", - "eslint": "^7.18.0", - "father": "^4.0.0", - "prettier": "^2.1.2", - "typescript": "^5.0.0" + "@types/fs-extra": "^11.0.4", + "@types/jest": "^30.0.0", + "@types/node": "^26.0.1", + "eslint": "^9.39.4", + "father": "^4.6.24", + "prettier": "^3.9.4", + "typescript": "^6.0.3" }, "engines": { "node": ">=18.x"