From 71c185f3228f29686c84bcda1c40c288f2769840 Mon Sep 17 00:00:00 2001 From: MeetinaXD Date: Fri, 12 Apr 2024 01:55:09 +0800 Subject: [PATCH] chore: update & fix line endings to LF --- .github/ISSUE_TEMPLATE/BUG_REPORT_en.yml | 80 +++++------ .github/ISSUE_TEMPLATE/BUG_REPORT_zh-CN.yml | 110 +++++++------- .github/ISSUE_TEMPLATE/FEATURE_REQUEST_en.yml | 58 ++++---- .../ISSUE_TEMPLATE/FEATURE_REQUEST_zh-CN.yml | 58 ++++---- .github/workflows/release.yml | 136 +++++++++--------- .husky/pre-commit | 8 +- .prettierrc.js | 32 ++--- .vscode/settings.json | 3 +- commitlint.config.js | 6 +- packages/scene-react/.releaserc.yml | 36 ++--- packages/scene-react/tsconfig.json | 6 +- packages/scene-svelte/.releaserc.yml | 36 ++--- packages/scene-svelte/tsconfig.json | 6 +- packages/scene-vue/.releaserc.yml | 36 ++--- packages/scene-vue/tsconfig.json | 6 +- 15 files changed, 309 insertions(+), 308 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/BUG_REPORT_en.yml b/.github/ISSUE_TEMPLATE/BUG_REPORT_en.yml index 411da60..a9bcec9 100644 --- a/.github/ISSUE_TEMPLATE/BUG_REPORT_en.yml +++ b/.github/ISSUE_TEMPLATE/BUG_REPORT_en.yml @@ -1,40 +1,40 @@ -name: Bug Report -description: Use issue template to report a bug. -title: '[Bug Report] Title' -labels: ['bug: need confirm'] -body: - - type: input - id: reproduce - attributes: - label: Reproduction Link - description: Please provide a simple [codesandbox](https://codesandbox.io/) or [stackBlitz](https://stackblitz.com) or GitHub repository link. Do not fill in invalid links, this will cause your issue to be closed directly. - validations: - required: true - - - type: input - id: version - attributes: - label: Version - description: Please fill in the version - placeholder: E.g. 1.4.0 - validations: - required: true - - - type: textarea - id: description - attributes: - label: Describe the Bug - validations: - required: true - - - type: textarea - id: reproduce-steps - attributes: - label: Reproduce Steps - validations: - required: true - - - type: input - id: browsers - attributes: - label: Device / Browser / Browser Version +name: Bug Report +description: Use issue template to report a bug. +title: '[Bug Report] Title' +labels: ['bug: need confirm'] +body: + - type: input + id: reproduce + attributes: + label: Reproduction Link + description: Please provide a simple [codesandbox](https://codesandbox.io/) or [stackBlitz](https://stackblitz.com) or GitHub repository link. Do not fill in invalid links, this will cause your issue to be closed directly. + validations: + required: true + + - type: input + id: version + attributes: + label: Version + description: Please fill in the version + placeholder: E.g. 1.4.0 + validations: + required: true + + - type: textarea + id: description + attributes: + label: Describe the Bug + validations: + required: true + + - type: textarea + id: reproduce-steps + attributes: + label: Reproduce Steps + validations: + required: true + + - type: input + id: browsers + attributes: + label: Device / Browser / Browser Version diff --git a/.github/ISSUE_TEMPLATE/BUG_REPORT_zh-CN.yml b/.github/ISSUE_TEMPLATE/BUG_REPORT_zh-CN.yml index ae9f133..5bf89d8 100644 --- a/.github/ISSUE_TEMPLATE/BUG_REPORT_zh-CN.yml +++ b/.github/ISSUE_TEMPLATE/BUG_REPORT_zh-CN.yml @@ -1,55 +1,55 @@ -name: alova Bug反馈 -description: 通过标准模板进行 Bug 反馈。 -title: '[Bug Report] 请在此填写标题' -labels: ['bug: need confirm'] -body: - - type: markdown - attributes: - value: | - 在提交 Bug 报告前,请注意: - - - 确认你的问题无法通过官方文档得到解决。 - - 确认你搜索过 [历史 issue](https://github.com/alovajs/scene/issues),并且没有发现同样的问题。 - - 如果不是反馈 Bug,请到 [Discussions 讨论区](https://github.com/alovajs/scene/discussions) 发帖。 - - - type: input - id: reproduce - attributes: - label: 重现链接 - description: 请提供一个尽可能简单的 [codesandbox](https://codesandbox.io) 或 [stackBlitz](https://stackblitz.com) 或 GitHub 仓库链接。不要填写无效的链接。 - validations: - required: true - - - type: input - id: version - attributes: - label: @alova/scene 版本 - description: 请填写版本号 - placeholder: 比如 1.4.0 - validations: - required: true - - - type: textarea - id: description - attributes: - label: 描述一下你遇到的问题。 - validations: - required: true - - - type: textarea - id: reproduce-steps - attributes: - label: 重现步骤 - description: 请提供一个最简单的操作步骤,方便我们快速重现问题。 - placeholder: | - 比如: - 1. 点击按钮 - 2. 请求未发出 - validations: - required: true - - - type: input - id: browsers - attributes: - label: 设备/浏览器/浏览器版本 - description: 在哪些设备/浏览器以及哪个浏览器版本上能重现这个问题? +name: alova Bug反馈 +description: 通过标准模板进行 Bug 反馈。 +title: '[Bug Report] 请在此填写标题' +labels: ['bug: need confirm'] +body: + - type: markdown + attributes: + value: | + 在提交 Bug 报告前,请注意: + + - 确认你的问题无法通过官方文档得到解决。 + - 确认你搜索过 [历史 issue](https://github.com/alovajs/scene/issues),并且没有发现同样的问题。 + - 如果不是反馈 Bug,请到 [Discussions 讨论区](https://github.com/alovajs/scene/discussions) 发帖。 + + - type: input + id: reproduce + attributes: + label: 重现链接 + description: 请提供一个尽可能简单的 [codesandbox](https://codesandbox.io) 或 [stackBlitz](https://stackblitz.com) 或 GitHub 仓库链接。不要填写无效的链接。 + validations: + required: true + + - type: input + id: version + attributes: + label: @alova/scene 版本 + description: 请填写版本号 + placeholder: 比如 1.4.0 + validations: + required: true + + - type: textarea + id: description + attributes: + label: 描述一下你遇到的问题。 + validations: + required: true + + - type: textarea + id: reproduce-steps + attributes: + label: 重现步骤 + description: 请提供一个最简单的操作步骤,方便我们快速重现问题。 + placeholder: | + 比如: + 1. 点击按钮 + 2. 请求未发出 + validations: + required: true + + - type: input + id: browsers + attributes: + label: 设备/浏览器/浏览器版本 + description: 在哪些设备/浏览器以及哪个浏览器版本上能重现这个问题? diff --git a/.github/ISSUE_TEMPLATE/FEATURE_REQUEST_en.yml b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST_en.yml index e31e4cb..87fdf59 100644 --- a/.github/ISSUE_TEMPLATE/FEATURE_REQUEST_en.yml +++ b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST_en.yml @@ -1,29 +1,29 @@ -name: I want a new feature -description: Describe your functional requirements through standard templates. -title: '[Feature Request] Please fill in the title here' -labels: ['feature: need confirm'] -body: - - type: markdown - attributes: - value: | - Before submitting a feature request, please note: - - - Confirm that this is a generic feature and cannot be implemented through the existing API. - - Make sure you searched for [historical issues](https://github.com/alovajs/scene/issues) and didn't find the same requirement. - - You can first post in the [Discussions discussion area](https://github.com/alovajs/scene/discussions) to discuss whether the demand is reasonable. - - - type: textarea - id: description - attributes: - label: In what situation do you need this function to solve the problem? - description: Please describe the usage scenarios of this feature in as much detail as possible. - validations: - required: true - - - type: textarea - id: api - attributes: - label: What do you expect the API to look like? - description: Describe the API of this new feature and provide some code examples. - validations: - required: true +name: I want a new feature +description: Describe your functional requirements through standard templates. +title: '[Feature Request] Please fill in the title here' +labels: ['feature: need confirm'] +body: + - type: markdown + attributes: + value: | + Before submitting a feature request, please note: + + - Confirm that this is a generic feature and cannot be implemented through the existing API. + - Make sure you searched for [historical issues](https://github.com/alovajs/scene/issues) and didn't find the same requirement. + - You can first post in the [Discussions discussion area](https://github.com/alovajs/scene/discussions) to discuss whether the demand is reasonable. + + - type: textarea + id: description + attributes: + label: In what situation do you need this function to solve the problem? + description: Please describe the usage scenarios of this feature in as much detail as possible. + validations: + required: true + + - type: textarea + id: api + attributes: + label: What do you expect the API to look like? + description: Describe the API of this new feature and provide some code examples. + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/FEATURE_REQUEST_zh-CN.yml b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST_zh-CN.yml index 45d185d..d80fe00 100644 --- a/.github/ISSUE_TEMPLATE/FEATURE_REQUEST_zh-CN.yml +++ b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST_zh-CN.yml @@ -1,29 +1,29 @@ -name: 我想要一个的新功能 -description: 通过标准模板描述一下你的功能需求。 -title: '[Feature Request] 请在此填写标题' -labels: ['feature: need confirm'] -body: - - type: markdown - attributes: - value: | - 在提交功能需求前,请注意: - - - 确认这是一个通用功能,并且无法通过现有的 API 实现。 - - 确认你搜索过 [历史 issue](https://github.com/alovajs/scene/issues),并且没有发现同样的需求。 - - 可以先到 [Discussions 讨论区](https://github.com/alovajs/scene/discussions) 发帖,讨论一下需求是否合理。 - - - type: textarea - id: description - attributes: - label: 你在什么情况下,需要这个功能解决什么问题? - description: 请尽可能详细地说明这个功能的使用场景。 - validations: - required: true - - - type: textarea - id: api - attributes: - label: 你期望的 API 是什么样子的? - description: 描述一下这个新功能的 API,并提供一些代码示例。 - validations: - required: true +name: 我想要一个的新功能 +description: 通过标准模板描述一下你的功能需求。 +title: '[Feature Request] 请在此填写标题' +labels: ['feature: need confirm'] +body: + - type: markdown + attributes: + value: | + 在提交功能需求前,请注意: + + - 确认这是一个通用功能,并且无法通过现有的 API 实现。 + - 确认你搜索过 [历史 issue](https://github.com/alovajs/scene/issues),并且没有发现同样的需求。 + - 可以先到 [Discussions 讨论区](https://github.com/alovajs/scene/discussions) 发帖,讨论一下需求是否合理。 + + - type: textarea + id: description + attributes: + label: 你在什么情况下,需要这个功能解决什么问题? + description: 请尽可能详细地说明这个功能的使用场景。 + validations: + required: true + + - type: textarea + id: api + attributes: + label: 你期望的 API 是什么样子的? + description: 描述一下这个新功能的 API,并提供一些代码示例。 + validations: + required: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c489e9f..2391cec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,68 +1,68 @@ -name: build - -# 触发条件:在 push或合并请求 到 master 或 release开头的分支后 -on: - push: - branches: - - main - - alpha - - beta - pull_request: - branches: '*' - -# 任务 -jobs: - quality: - # 服务器环境:最新版 Ubuntu - runs-on: ubuntu-latest - steps: - # 拉取代码 - - name: Checkout - uses: actions/checkout@v3 - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: 18.12.x - registry-url: 'https://registry.npmjs.org' - cache: 'npm' - - # 执行测试和打包操作 - - name: Install deps - run: npm ci - - - name: Lint check - run: npm run lint - - # 这条命令包含了测试 - - name: Unit tests - if: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/alpha' && github.ref != 'refs/heads/beta' }} - run: npm run test - - release: - runs-on: ubuntu-latest - needs: [quality] - if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/alpha' || github.ref == 'refs/heads/beta' }} - steps: - # 拉取代码 - - name: Checkout - uses: actions/checkout@v3 - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: 18.12.x - registry-url: 'https://registry.npmjs.org' - cache: 'npm' - - # 执行测试和打包操作 - - name: Install deps - run: npm ci - - # 这条命令包含了测试和上传覆盖率 - - name: Coverage - run: npm run coveralls - - - name: Release - run: npm run release - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_ALOVA_PUBLISH_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +name: build + +# 触发条件:在 push或合并请求 到 master 或 release开头的分支后 +on: + push: + branches: + - main + - alpha + - beta + pull_request: + branches: '*' + +# 任务 +jobs: + quality: + # 服务器环境:最新版 Ubuntu + runs-on: ubuntu-latest + steps: + # 拉取代码 + - name: Checkout + uses: actions/checkout@v3 + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: 18.12.x + registry-url: 'https://registry.npmjs.org' + cache: 'npm' + + # 执行测试和打包操作 + - name: Install deps + run: npm ci + + - name: Lint check + run: npm run lint + + # 这条命令包含了测试 + - name: Unit tests + if: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/alpha' && github.ref != 'refs/heads/beta' }} + run: npm run test + + release: + runs-on: ubuntu-latest + needs: [quality] + if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/alpha' || github.ref == 'refs/heads/beta' }} + steps: + # 拉取代码 + - name: Checkout + uses: actions/checkout@v3 + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: 18.12.x + registry-url: 'https://registry.npmjs.org' + cache: 'npm' + + # 执行测试和打包操作 + - name: Install deps + run: npm ci + + # 这条命令包含了测试和上传覆盖率 + - name: Coverage + run: npm run coveralls + + - name: Release + run: npm run release + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_ALOVA_PUBLISH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.husky/pre-commit b/.husky/pre-commit index d8998c8..75fac8e 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - -npm run lint +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npm run lint diff --git a/.prettierrc.js b/.prettierrc.js index 3ff9ea7..73491be 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,16 +1,16 @@ -module.exports = { - printWidth: 120, // 换行字符串阈值 - tabWidth: 2, // 设置工具每一个水平缩进的空格数 - useTabs: false, // 是否使用tab缩进 - semi: true, // 句末是否加分号 - singleQuote: true, // 用单引号 - trailingComma: 'none', // 最后一个对象元素符加逗号 - bracketSpacing: true, // 对象字面量的大括号之间是否有空格 - jsxBracketSameLine: true, // jsx > 是否另取一行 - insertPragma: false, // 不需要自动在文件开头加入 @prettier - endOfLine: 'lf', // 换行符使用 lf - bracketSameLine: true, // 对象字面量的大括号是否另起一行 - arrowParens: 'avoid', // 箭头函数参数是否使用圆括号 - vueIndentScriptAndStyle: false, // vue文件中script和style标签的缩进 - singleAttributePerLine: true // 单个属性是否单独一行 -}; +module.exports = { + printWidth: 120, // 换行字符串阈值 + tabWidth: 2, // 设置工具每一个水平缩进的空格数 + useTabs: false, // 是否使用tab缩进 + semi: true, // 句末是否加分号 + singleQuote: true, // 用单引号 + trailingComma: 'none', // 最后一个对象元素符加逗号 + bracketSpacing: true, // 对象字面量的大括号之间是否有空格 + jsxBracketSameLine: true, // jsx > 是否另取一行 + insertPragma: false, // 不需要自动在文件开头加入 @prettier + endOfLine: 'lf', // 换行符使用 lf + bracketSameLine: true, // 对象字面量的大括号是否另起一行 + arrowParens: 'avoid', // 箭头函数参数是否使用圆括号 + vueIndentScriptAndStyle: false, // vue文件中script和style标签的缩进 + singleAttributePerLine: true // 单个属性是否单独一行 +}; diff --git a/.vscode/settings.json b/.vscode/settings.json index 2cfe2ec..6efffca 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -11,5 +11,6 @@ "source.fixAll.eslint": "explicit" }, "jest.autoRun": "off", - "typescript.tsdk": "node_modules\\typescript\\lib" + "typescript.tsdk": "node_modules\\typescript\\lib", + "files.eol": "\n" } diff --git a/commitlint.config.js b/commitlint.config.js index 4d64580..c34aa79 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1,3 +1,3 @@ -module.exports = { - extends: ['@commitlint/config-conventional'] -}; +module.exports = { + extends: ['@commitlint/config-conventional'] +}; diff --git a/packages/scene-react/.releaserc.yml b/packages/scene-react/.releaserc.yml index 828c694..0dfbf9d 100644 --- a/packages/scene-react/.releaserc.yml +++ b/packages/scene-react/.releaserc.yml @@ -1,18 +1,18 @@ -branches: - - main - - name: beta - prerelease: true - - name: alpha - prerelease: true - -tagFormat: 'scene-react-v${version}' -plugins: - - '@semantic-release/commit-analyzer' - - '@semantic-release/release-notes-generator' - - '@semantic-release/npm' - - '@semantic-release/github' - - '@semantic-release/git' - - - '@semantic-release/exec' - - # 使用下一个版本号执行打包命令 - - prepareCmd: 'cross-env VERSION=${nextRelease.version} npm run build' +branches: + - main + - name: beta + prerelease: true + - name: alpha + prerelease: true + +tagFormat: 'scene-react-v${version}' +plugins: + - '@semantic-release/commit-analyzer' + - '@semantic-release/release-notes-generator' + - '@semantic-release/npm' + - '@semantic-release/github' + - '@semantic-release/git' + - - '@semantic-release/exec' + + # 使用下一个版本号执行打包命令 + - prepareCmd: 'cross-env VERSION=${nextRelease.version} npm run build' diff --git a/packages/scene-react/tsconfig.json b/packages/scene-react/tsconfig.json index 70cd8fa..4082f16 100644 --- a/packages/scene-react/tsconfig.json +++ b/packages/scene-react/tsconfig.json @@ -1,3 +1,3 @@ -{ - "extends": "../../tsconfig.json" -} +{ + "extends": "../../tsconfig.json" +} diff --git a/packages/scene-svelte/.releaserc.yml b/packages/scene-svelte/.releaserc.yml index d01cf4b..6b1aeec 100644 --- a/packages/scene-svelte/.releaserc.yml +++ b/packages/scene-svelte/.releaserc.yml @@ -1,18 +1,18 @@ -branches: - - main - - name: beta - prerelease: true - - name: alpha - prerelease: true - -tagFormat: 'scene-svelte-v${version}' -plugins: - - '@semantic-release/commit-analyzer' - - '@semantic-release/release-notes-generator' - - '@semantic-release/npm' - - '@semantic-release/github' - - '@semantic-release/git' - - - '@semantic-release/exec' - - # 使用下一个版本号执行打包命令 - - prepareCmd: 'cross-env VERSION=${nextRelease.version} npm run build' +branches: + - main + - name: beta + prerelease: true + - name: alpha + prerelease: true + +tagFormat: 'scene-svelte-v${version}' +plugins: + - '@semantic-release/commit-analyzer' + - '@semantic-release/release-notes-generator' + - '@semantic-release/npm' + - '@semantic-release/github' + - '@semantic-release/git' + - - '@semantic-release/exec' + + # 使用下一个版本号执行打包命令 + - prepareCmd: 'cross-env VERSION=${nextRelease.version} npm run build' diff --git a/packages/scene-svelte/tsconfig.json b/packages/scene-svelte/tsconfig.json index 70cd8fa..4082f16 100644 --- a/packages/scene-svelte/tsconfig.json +++ b/packages/scene-svelte/tsconfig.json @@ -1,3 +1,3 @@ -{ - "extends": "../../tsconfig.json" -} +{ + "extends": "../../tsconfig.json" +} diff --git a/packages/scene-vue/.releaserc.yml b/packages/scene-vue/.releaserc.yml index 5e33c1f..c3d6c83 100644 --- a/packages/scene-vue/.releaserc.yml +++ b/packages/scene-vue/.releaserc.yml @@ -1,18 +1,18 @@ -branches: - - main - - name: beta - prerelease: true - - name: alpha - prerelease: true - -tagFormat: 'scene-vue-v${version}' -plugins: - - '@semantic-release/commit-analyzer' - - '@semantic-release/release-notes-generator' - - '@semantic-release/npm' - - '@semantic-release/github' - - '@semantic-release/git' - - - '@semantic-release/exec' - - # 使用下一个版本号执行打包命令 - - prepareCmd: 'cross-env VERSION=${nextRelease.version} npm run build' +branches: + - main + - name: beta + prerelease: true + - name: alpha + prerelease: true + +tagFormat: 'scene-vue-v${version}' +plugins: + - '@semantic-release/commit-analyzer' + - '@semantic-release/release-notes-generator' + - '@semantic-release/npm' + - '@semantic-release/github' + - '@semantic-release/git' + - - '@semantic-release/exec' + + # 使用下一个版本号执行打包命令 + - prepareCmd: 'cross-env VERSION=${nextRelease.version} npm run build' diff --git a/packages/scene-vue/tsconfig.json b/packages/scene-vue/tsconfig.json index 70cd8fa..4082f16 100644 --- a/packages/scene-vue/tsconfig.json +++ b/packages/scene-vue/tsconfig.json @@ -1,3 +1,3 @@ -{ - "extends": "../../tsconfig.json" -} +{ + "extends": "../../tsconfig.json" +}