diff --git a/.github/settings.yml b/.github/settings.yml new file mode 100644 index 00000000..107aa0ad --- /dev/null +++ b/.github/settings.yml @@ -0,0 +1,26 @@ +# This file is automatically added by @npmcli/template-oss. Do not edit. + +repository: + allow_merge_commit: false + allow_rebase_merge: true + allow_squash_merge: true + squash_merge_commit_title: PR_TITLE + squash_merge_commit_message: PR_BODY + delete_branch_on_merge: true + enable_automated_security_fixes: true + enable_vulnerability_alerts: true + +branches: + - name: main + protection: + required_status_checks: null + enforce_admins: true + required_pull_request_reviews: + required_approving_review_count: 1 + require_code_owner_reviews: true + require_last_push_approval: true + dismiss_stale_reviews: true + restrictions: + apps: [] + users: [] + teams: [ "cli-team" ] diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index 73209f32..8e97dfcc 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -61,7 +61,7 @@ jobs: return { summary } - name: Create Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 id: check if: inputs.check-sha with: @@ -93,7 +93,7 @@ jobs: - name: Post Lint run: npm run postlint --ignore-scripts -ws -iwr --if-present - name: Conclude Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 if: steps.check.outputs.check_id && always() with: token: ${{ secrets.GITHUB_TOKEN }} @@ -162,7 +162,7 @@ jobs: return { summary } - name: Create Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 id: check if: inputs.check-sha with: @@ -208,7 +208,7 @@ jobs: - name: Test run: npm test --ignore-scripts -ws -iwr --if-present - name: Conclude Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 if: steps.check.outputs.check_id && always() with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 99877daa..721ea3c0 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -44,5 +44,7 @@ jobs: npx --offline commitlint -V --from 'origin/${{ github.base_ref }}' --to ${{ github.event.pull_request.head.sha }} - name: Run Commitlint on PR Title if: steps.commit.outcome == 'failure' + env: + PR_TITLE: ${{ github.event.pull_request.title }} run: | - echo '${{ github.event.pull_request.title }}' | npx --offline commitlint -V + echo '$PR_TITLE' | npx --offline commitlint -V diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 396a6090..810e7f3e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -124,7 +124,7 @@ jobs: return { summary } - name: Create Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 id: check if: steps.release.outputs.pr-sha with: @@ -215,7 +215,7 @@ jobs: return { summary } - name: Create Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 id: check if: steps.commit.outputs.sha with: @@ -225,7 +225,7 @@ jobs: sha: ${{ steps.commit.outputs.sha }} output: ${{ steps.check-output.outputs.result }} - name: Conclude Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 if: needs.release.outputs.check-id && always() with: token: ${{ secrets.GITHUB_TOKEN }} @@ -263,7 +263,7 @@ jobs: fi echo "result=$result" >> $GITHUB_OUTPUT - name: Conclude Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 if: needs.update.outputs.check-id && always() with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 0316d2b7..135c3883 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ !/bin/ !/CHANGELOG* !/CODE_OF_CONDUCT.md +!/CONTRIBUTING.md !/docs/ !/lib/ !/LICENSE* diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 666e52c6..e5a652cc 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.14.1" + ".": "4.15.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e50761a..7ab7ebcb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## [4.15.1](https://github.com/npm/template-oss/compare/v4.15.0...v4.15.1) (2023-05-03) + +### Bug Fixes + +* [`6f5a253`](https://github.com/npm/template-oss/commit/6f5a2533dadb48edc822a798a2cdda3dcd3e20b0) [#313](https://github.com/npm/template-oss/pull/313) make settings file actually work (#313) (@nlf) + +## [4.15.0](https://github.com/npm/template-oss/compare/v4.14.1...v4.15.0) (2023-05-03) + +### Features + +* [`96776b4`](https://github.com/npm/template-oss/commit/96776b44d73e4695d1ddad07d9104830baa61f11) [#312](https://github.com/npm/template-oss/pull/312) add CONTRIBUTING.md (#312) (@wraithgar) +* [`be7f16a`](https://github.com/npm/template-oss/commit/be7f16a3662fbd2c0c5dacdf0b559f88dde81f7a) [#310](https://github.com/npm/template-oss/pull/310) add probot settings template (#310) (@nlf) + +### Bug Fixes + +* [`238fc4a`](https://github.com/npm/template-oss/commit/238fc4ae07fc9d05454c7f478dfe980b393c10f5) [#309](https://github.com/npm/template-oss/pull/309) pull PR_TITLE into env (@wraithgar) +* [`1edde27`](https://github.com/npm/template-oss/commit/1edde270606255276dc30ef1526970cac1b30644) [#308](https://github.com/npm/template-oss/pull/308) add the -R flag to the post-publish action for easier copy/paste (#308) (@nlf) +* [`1babe54`](https://github.com/npm/template-oss/commit/1babe54a8db71b40cf0eaabf3ee056796ba333ae) [#306](https://github.com/npm/template-oss/pull/306) use a more portable means of spawning subshells (#306) (@nlf) +* [`7a2481c`](https://github.com/npm/template-oss/commit/7a2481c7312a539bfdba6881ac8fbadae41c64b9) [#305](https://github.com/npm/template-oss/pull/305) update the LouisBrunner/checks-action to latest (#305) (@nlf) + ## [4.14.1](https://github.com/npm/template-oss/compare/v4.14.0...v4.14.1) (2023-04-19) ### Bug Fixes diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..69e88788 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,50 @@ + + +# Contributing + +## Code of Conduct + +All interactions in the **npm** organization on GitHub are considered to be covered by our standard [Code of Conduct](https://docs.npmjs.com/policies/conduct). + +## Reporting Bugs + +Before submitting a new bug report please search for an existing or similar report. + +Use one of our existing issue templates if you believe you've come across a unique problem. + +Duplicate issues, or issues that don't use one of our templates may get closed without a response. + +## Pull Request Conventions + +### Commits + +We use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). + +When opening a pull request please be sure that either the pull request title, or each commit in the pull request, has one of the following prefixes: + + - `feat`: For when introducing a new feature. The result will be a new semver minor version of the package when it is next published. + - `fix`: For bug fixes. The result will be a new semver patch version of the package when it is next published. + - `docs`: For documentation updates. The result will be a new semver patch version of the package when it is next published. + - `chore`: For changes that do not affect the published module. Often these are changes to tests. The result will be *no* change to the version of the package when it is next published (as the commit does not affect the published version). + +### Test Coverage + +Pull requests made against this repo will run `npm test` automatically. Please make sure tests pass locally before submitting a PR. + +Every new feature or bug fix should come with a corresponding test or tests that validate the solutions. Testing also reports on code coverage and will fail if code coverage drops. + +### Linting + +Linting is also done automatically once tests pass. `npm run lintfix` will fix most linting errors automatically. + +Please make sure linting passes before submitting a PR. + +## What _not_ to contribute? + +### Dependencies + +It should be noted that our team does not accept third-party dependency updates/PRs. If you submit a PR trying to update our dependencies we will close it with or without a reference to these contribution guidelines. + +### Tools/Automation + +Our core team is responsible for the maintenance of the tooling/automation in this project and we ask contributors to not make changes to these when contributing (e.g. `.github/*`, `.eslintrc.json`, `.licensee.json`). Most of those files also have a header at the top to remind folks they are automatically generated. Pull requests that alter these will not be accepted. diff --git a/bin/release-manager.js b/bin/release-manager.js index 5e29084c..b56695af 100755 --- a/bin/release-manager.js +++ b/bin/release-manager.js @@ -63,7 +63,7 @@ const DEFAULT_RELEASE_PROCESS = (args.publish ? AUTO_PUBLISH_STEPS : MANUAL_PUBL Release Please will run on the just pushed release commit and create GitHub releases and tags for each package. \`\`\` - gh run watch \`gh run list -R {NWO} -w release -b -L 1 --json databaseId -q ".[0].databaseId"\` + gh run watch -R {NWO} $(gh run list -R {NWO} -w release -b -L 1 --json databaseId -q ".[0].databaseId") \`\`\` ` /* eslint-enable max-len */ diff --git a/lib/content/CONTRIBUTING.md b/lib/content/CONTRIBUTING.md new file mode 100644 index 00000000..45aadf5c --- /dev/null +++ b/lib/content/CONTRIBUTING.md @@ -0,0 +1,48 @@ +# Contributing + +## Code of Conduct + +All interactions in the **npm** organization on GitHub are considered to be covered by our standard [Code of Conduct](https://docs.npmjs.com/policies/conduct). + +## Reporting Bugs + +Before submitting a new bug report please search for an existing or similar report. + +Use one of our existing issue templates if you believe you've come across a unique problem. + +Duplicate issues, or issues that don't use one of our templates may get closed without a response. + +## Pull Request Conventions + +### Commits + +We use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). + +When opening a pull request please be sure that either the pull request title, or each commit in the pull request, has one of the following prefixes: + + - `feat`: For when introducing a new feature. The result will be a new semver minor version of the package when it is next published. + - `fix`: For bug fixes. The result will be a new semver patch version of the package when it is next published. + - `docs`: For documentation updates. The result will be a new semver patch version of the package when it is next published. + - `chore`: For changes that do not affect the published module. Often these are changes to tests. The result will be *no* change to the version of the package when it is next published (as the commit does not affect the published version). + +### Test Coverage + +Pull requests made against this repo will run `npm test` automatically. Please make sure tests pass locally before submitting a PR. + +Every new feature or bug fix should come with a corresponding test or tests that validate the solutions. Testing also reports on code coverage and will fail if code coverage drops. + +### Linting + +Linting is also done automatically once tests pass. `npm run lintfix` will fix most linting errors automatically. + +Please make sure linting passes before submitting a PR. + +## What _not_ to contribute? + +### Dependencies + +It should be noted that our team does not accept third-party dependency updates/PRs. If you submit a PR trying to update our dependencies we will close it with or without a reference to these contribution guidelines. + +### Tools/Automation + +Our core team is responsible for the maintenance of the tooling/automation in this project and we ask contributors to not make changes to these when contributing (e.g. `.github/*`, `.eslintrc.json`, `.licensee.json`). Most of those files also have a header at the top to remind folks they are automatically generated. Pull requests that alter these will not be accepted. diff --git a/lib/content/_step-checks.yml b/lib/content/_step-checks.yml index 3eb8cc56..469456bf 100644 --- a/lib/content/_step-checks.yml +++ b/lib/content/_step-checks.yml @@ -34,7 +34,7 @@ return { summary } {{/if}} - name: {{#if jobCheck.sha}}Create{{else}}Conclude{{/if}} Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 {{#if jobCheck.sha}} id: check if: {{ jobCheck.sha }} diff --git a/lib/content/index.js b/lib/content/index.js index 23f2c738..cb572e09 100644 --- a/lib/content/index.js +++ b/lib/content/index.js @@ -49,6 +49,9 @@ const sharedRootAdd = (name) => ({ '.github/workflows/post-dependabot.yml': { file: 'post-dependabot.yml', }, + '.github/settings.yml': { + file: 'settings.yml', + }, }) const sharedRootRm = () => ({ @@ -87,6 +90,7 @@ const rootModule = { '.npmrc': 'npmrc', 'SECURITY.md': 'SECURITY.md', 'CODE_OF_CONDUCT.md': 'CODE_OF_CONDUCT.md', + 'CONTRIBUTING.md': 'CONTRIBUTING.md', 'package.json': 'pkg.json', }, rm: [ diff --git a/lib/content/pull-request.yml b/lib/content/pull-request.yml index a8f3b7e6..3890a3c8 100644 --- a/lib/content/pull-request.yml +++ b/lib/content/pull-request.yml @@ -18,5 +18,7 @@ jobs: {{ rootNpxPath }} --offline commitlint -V --from 'origin/$\{{ github.base_ref }}' --to $\{{ github.event.pull_request.head.sha }} - name: Run Commitlint on PR Title if: steps.commit.outcome == 'failure' + env: + PR_TITLE: $\{{ github.event.pull_request.title }} run: | - echo '$\{{ github.event.pull_request.title }}' | {{ rootNpxPath }} --offline commitlint -V + echo '$PR_TITLE' | {{ rootNpxPath }} --offline commitlint -V diff --git a/lib/content/settings.yml b/lib/content/settings.yml new file mode 100644 index 00000000..0f90cec6 --- /dev/null +++ b/lib/content/settings.yml @@ -0,0 +1,24 @@ +repository: + allow_merge_commit: false + allow_rebase_merge: true + allow_squash_merge: true + squash_merge_commit_title: PR_TITLE + squash_merge_commit_message: PR_BODY + delete_branch_on_merge: true + enable_automated_security_fixes: true + enable_vulnerability_alerts: true + +branches: + - name: {{ defaultBranch }} + protection: + required_status_checks: null + enforce_admins: true + required_pull_request_reviews: + required_approving_review_count: 1 + require_code_owner_reviews: true + require_last_push_approval: true + dismiss_stale_reviews: true + restrictions: + apps: [] + users: [] + teams: ["cli-team"] diff --git a/package.json b/package.json index 2286dd64..0be5f3ef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/template-oss", - "version": "4.14.1", + "version": "4.15.1", "description": "templated files used in npm CLI team oss projects", "main": "lib/content/index.js", "bin": { diff --git a/tap-snapshots/test/apply/files-snapshots.js.test.cjs b/tap-snapshots/test/apply/files-snapshots.js.test.cjs index 382a5258..ef9298fd 100644 --- a/tap-snapshots/test/apply/files-snapshots.js.test.cjs +++ b/tap-snapshots/test/apply/files-snapshots.js.test.cjs @@ -13,6 +13,7 @@ exports[`test/apply/files-snapshots.js TAP private workspace > expect resolving .github/ISSUE_TEMPLATE/bug.yml .github/ISSUE_TEMPLATE/config.yml .github/matchers/tap.json +.github/settings.yml .github/workflows/audit.yml .github/workflows/ci-a.yml .github/workflows/ci-b.yml @@ -26,6 +27,7 @@ exports[`test/apply/files-snapshots.js TAP private workspace > expect resolving .npmrc .release-please-manifest.json CODE_OF_CONDUCT.md +CONTRIBUTING.md package.json release-please-config.json SECURITY.md @@ -44,6 +46,7 @@ exports[`test/apply/files-snapshots.js TAP turn off add/rm types > expect resolv .github/ISSUE_TEMPLATE/bug.yml .github/ISSUE_TEMPLATE/config.yml .github/matchers/tap.json +.github/settings.yml .github/workflows/audit.yml .github/workflows/ci-release.yml .github/workflows/ci.yml @@ -63,6 +66,7 @@ exports[`test/apply/files-snapshots.js TAP turn off module > expect resolving Pr .github/ISSUE_TEMPLATE/bug.yml .github/ISSUE_TEMPLATE/config.yml .github/matchers/tap.json +.github/settings.yml .github/workflows/audit.yml .github/workflows/ci-release.yml .github/workflows/ci.yml @@ -80,6 +84,7 @@ exports[`test/apply/files-snapshots.js TAP turn off repo > expect resolving Prom .gitignore .npmrc CODE_OF_CONDUCT.md +CONTRIBUTING.md package.json SECURITY.md ` @@ -95,6 +100,7 @@ exports[`test/apply/files-snapshots.js TAP turn off specific files > expect reso .github/ISSUE_TEMPLATE/bug.yml .github/ISSUE_TEMPLATE/config.yml .github/matchers/tap.json +.github/settings.yml .github/workflows/audit.yml .github/workflows/ci-release.yml .github/workflows/ci.yml @@ -107,6 +113,7 @@ exports[`test/apply/files-snapshots.js TAP turn off specific files > expect reso .npmrc .release-please-manifest.json CODE_OF_CONDUCT.md +CONTRIBUTING.md package.json release-please-config.json SECURITY.md @@ -115,6 +122,7 @@ SECURITY.md exports[`test/apply/files-snapshots.js TAP workspaces > expect resolving Promise 1`] = ` .github/dependabot.yml .github/matchers/tap.json +.github/settings.yml .github/workflows/ci-d.yml .github/workflows/ci-release.yml .github/workflows/post-dependabot.yml @@ -138,6 +146,7 @@ workspaces/d/package.json exports[`test/apply/files-snapshots.js TAP workspaces only (like npm/cli) > expect resolving Promise 1`] = ` .github/dependabot.yml .github/matchers/tap.json +.github/settings.yml .github/workflows/ci-a.yml .github/workflows/ci-b.yml .github/workflows/ci-release.yml diff --git a/tap-snapshots/test/apply/source-snapshots.js.test.cjs b/tap-snapshots/test/apply/source-snapshots.js.test.cjs index b494d999..4a101dfa 100644 --- a/tap-snapshots/test/apply/source-snapshots.js.test.cjs +++ b/tap-snapshots/test/apply/source-snapshots.js.test.cjs @@ -163,6 +163,35 @@ blank_issues_enabled: true ] } +.github/settings.yml +======================================== +# This file is automatically added by @npmcli/template-oss. Do not edit. + +repository: + allow_merge_commit: false + allow_rebase_merge: true + allow_squash_merge: true + squash_merge_commit_title: PR_TITLE + squash_merge_commit_message: PR_BODY + delete_branch_on_merge: true + enable_automated_security_fixes: true + enable_vulnerability_alerts: true + +branches: + - name: main + protection: + required_status_checks: null + enforce_admins: true + required_pull_request_reviews: + required_approving_review_count: 1 + require_code_owner_reviews: true + require_last_push_approval: true + dismiss_stale_reviews: true + restrictions: + apps: [] + users: [] + teams: [ "cli-team" ] + .github/workflows/audit.yml ======================================== # This file is automatically added by @npmcli/template-oss. Do not edit. @@ -270,7 +299,7 @@ jobs: return { summary } - name: Create Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 id: check if: inputs.check-sha with: @@ -302,7 +331,7 @@ jobs: - name: Post Lint run: npm run postlint --ignore-scripts - name: Conclude Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 if: steps.check.outputs.check_id && always() with: token: \${{ secrets.GITHUB_TOKEN }} @@ -371,7 +400,7 @@ jobs: return { summary } - name: Create Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 id: check if: inputs.check-sha with: @@ -417,7 +446,7 @@ jobs: - name: Test run: npm test --ignore-scripts - name: Conclude Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 if: steps.check.outputs.check_id && always() with: token: \${{ secrets.GITHUB_TOKEN }} @@ -747,8 +776,10 @@ jobs: npx --offline commitlint -V --from 'origin/\${{ github.base_ref }}' --to \${{ github.event.pull_request.head.sha }} - name: Run Commitlint on PR Title if: steps.commit.outcome == 'failure' + env: + PR_TITLE: \${{ github.event.pull_request.title }} run: | - echo '\${{ github.event.pull_request.title }}' | npx --offline commitlint -V + echo '$PR_TITLE' | npx --offline commitlint -V .github/workflows/release.yml ======================================== @@ -878,7 +909,7 @@ jobs: return { summary } - name: Create Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 id: check if: steps.release.outputs.pr-sha with: @@ -969,7 +1000,7 @@ jobs: return { summary } - name: Create Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 id: check if: steps.commit.outputs.sha with: @@ -979,7 +1010,7 @@ jobs: sha: \${{ steps.commit.outputs.sha }} output: \${{ steps.check-output.outputs.result }} - name: Conclude Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 if: needs.release.outputs.check-id && always() with: token: \${{ secrets.GITHUB_TOKEN }} @@ -1017,7 +1048,7 @@ jobs: fi echo "result=$result" >> $GITHUB_OUTPUT - name: Conclude Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 if: needs.update.outputs.check-id && always() with: token: \${{ secrets.GITHUB_TOKEN }} @@ -1186,6 +1217,7 @@ jobs: !/bin/ !/CHANGELOG* !/CODE_OF_CONDUCT.md +!/CONTRIBUTING.md !/docs/ !/lib/ !/LICENSE* @@ -1220,6 +1252,59 @@ Conduct](https://docs.npmjs.com/policies/conduct) The npm cli team may, at its own discretion, moderate, remove, or edit any interactions such as pull requests, issues, and comments. +CONTRIBUTING.md +======================================== + + +# Contributing + +## Code of Conduct + +All interactions in the **npm** organization on GitHub are considered to be covered by our standard [Code of Conduct](https://docs.npmjs.com/policies/conduct). + +## Reporting Bugs + +Before submitting a new bug report please search for an existing or similar report. + +Use one of our existing issue templates if you believe you've come across a unique problem. + +Duplicate issues, or issues that don't use one of our templates may get closed without a response. + +## Pull Request Conventions + +### Commits + +We use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). + +When opening a pull request please be sure that either the pull request title, or each commit in the pull request, has one of the following prefixes: + + - \`feat\`: For when introducing a new feature. The result will be a new semver minor version of the package when it is next published. + - \`fix\`: For bug fixes. The result will be a new semver patch version of the package when it is next published. + - \`docs\`: For documentation updates. The result will be a new semver patch version of the package when it is next published. + - \`chore\`: For changes that do not affect the published module. Often these are changes to tests. The result will be *no* change to the version of the package when it is next published (as the commit does not affect the published version). + +### Test Coverage + +Pull requests made against this repo will run \`npm test\` automatically. Please make sure tests pass locally before submitting a PR. + +Every new feature or bug fix should come with a corresponding test or tests that validate the solutions. Testing also reports on code coverage and will fail if code coverage drops. + +### Linting + +Linting is also done automatically once tests pass. \`npm run lintfix\` will fix most linting errors automatically. + +Please make sure linting passes before submitting a PR. + +## What _not_ to contribute? + +### Dependencies + +It should be noted that our team does not accept third-party dependency updates/PRs. If you submit a PR trying to update our dependencies we will close it with or without a reference to these contribution guidelines. + +### Tools/Automation + +Our core team is responsible for the maintenance of the tooling/automation in this project and we ask contributors to not make changes to these when contributing (e.g. \`.github/*\`, \`.eslintrc.json\`, \`.licensee.json\`). Most of those files also have a header at the top to remind folks they are automatically generated. Pull requests that alter these will not be accepted. + package.json ======================================== { @@ -1514,6 +1599,35 @@ blank_issues_enabled: true ] } +.github/settings.yml +======================================== +# This file is automatically added by @npmcli/template-oss. Do not edit. + +repository: + allow_merge_commit: false + allow_rebase_merge: true + allow_squash_merge: true + squash_merge_commit_title: PR_TITLE + squash_merge_commit_message: PR_BODY + delete_branch_on_merge: true + enable_automated_security_fixes: true + enable_vulnerability_alerts: true + +branches: + - name: main + protection: + required_status_checks: null + enforce_admins: true + required_pull_request_reviews: + required_approving_review_count: 1 + require_code_owner_reviews: true + require_last_push_approval: true + dismiss_stale_reviews: true + restrictions: + apps: [] + users: [] + teams: [ "cli-team" ] + .github/workflows/audit.yml ======================================== # This file is automatically added by @npmcli/template-oss. Do not edit. @@ -1849,7 +1963,7 @@ jobs: return { summary } - name: Create Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 id: check if: inputs.check-sha with: @@ -1881,7 +1995,7 @@ jobs: - name: Post Lint run: npm run postlint --ignore-scripts -ws -iwr --if-present - name: Conclude Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 if: steps.check.outputs.check_id && always() with: token: \${{ secrets.GITHUB_TOKEN }} @@ -1950,7 +2064,7 @@ jobs: return { summary } - name: Create Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 id: check if: inputs.check-sha with: @@ -1996,7 +2110,7 @@ jobs: - name: Test run: npm test --ignore-scripts -ws -iwr --if-present - name: Conclude Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 if: steps.check.outputs.check_id && always() with: token: \${{ secrets.GITHUB_TOKEN }} @@ -2332,8 +2446,10 @@ jobs: npx --offline commitlint -V --from 'origin/\${{ github.base_ref }}' --to \${{ github.event.pull_request.head.sha }} - name: Run Commitlint on PR Title if: steps.commit.outcome == 'failure' + env: + PR_TITLE: \${{ github.event.pull_request.title }} run: | - echo '\${{ github.event.pull_request.title }}' | npx --offline commitlint -V + echo '$PR_TITLE' | npx --offline commitlint -V .github/workflows/release.yml ======================================== @@ -2463,7 +2579,7 @@ jobs: return { summary } - name: Create Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 id: check if: steps.release.outputs.pr-sha with: @@ -2554,7 +2670,7 @@ jobs: return { summary } - name: Create Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 id: check if: steps.commit.outputs.sha with: @@ -2564,7 +2680,7 @@ jobs: sha: \${{ steps.commit.outputs.sha }} output: \${{ steps.check-output.outputs.result }} - name: Conclude Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 if: needs.release.outputs.check-id && always() with: token: \${{ secrets.GITHUB_TOKEN }} @@ -2602,7 +2718,7 @@ jobs: fi echo "result=$result" >> $GITHUB_OUTPUT - name: Conclude Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 if: needs.update.outputs.check-id && always() with: token: \${{ secrets.GITHUB_TOKEN }} @@ -2771,6 +2887,7 @@ jobs: !/bin/ !/CHANGELOG* !/CODE_OF_CONDUCT.md +!/CONTRIBUTING.md !/docs/ !/lib/ !/LICENSE* @@ -2811,6 +2928,59 @@ Conduct](https://docs.npmjs.com/policies/conduct) The npm cli team may, at its own discretion, moderate, remove, or edit any interactions such as pull requests, issues, and comments. +CONTRIBUTING.md +======================================== + + +# Contributing + +## Code of Conduct + +All interactions in the **npm** organization on GitHub are considered to be covered by our standard [Code of Conduct](https://docs.npmjs.com/policies/conduct). + +## Reporting Bugs + +Before submitting a new bug report please search for an existing or similar report. + +Use one of our existing issue templates if you believe you've come across a unique problem. + +Duplicate issues, or issues that don't use one of our templates may get closed without a response. + +## Pull Request Conventions + +### Commits + +We use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). + +When opening a pull request please be sure that either the pull request title, or each commit in the pull request, has one of the following prefixes: + + - \`feat\`: For when introducing a new feature. The result will be a new semver minor version of the package when it is next published. + - \`fix\`: For bug fixes. The result will be a new semver patch version of the package when it is next published. + - \`docs\`: For documentation updates. The result will be a new semver patch version of the package when it is next published. + - \`chore\`: For changes that do not affect the published module. Often these are changes to tests. The result will be *no* change to the version of the package when it is next published (as the commit does not affect the published version). + +### Test Coverage + +Pull requests made against this repo will run \`npm test\` automatically. Please make sure tests pass locally before submitting a PR. + +Every new feature or bug fix should come with a corresponding test or tests that validate the solutions. Testing also reports on code coverage and will fail if code coverage drops. + +### Linting + +Linting is also done automatically once tests pass. \`npm run lintfix\` will fix most linting errors automatically. + +Please make sure linting passes before submitting a PR. + +## What _not_ to contribute? + +### Dependencies + +It should be noted that our team does not accept third-party dependency updates/PRs. If you submit a PR trying to update our dependencies we will close it with or without a reference to these contribution guidelines. + +### Tools/Automation + +Our core team is responsible for the maintenance of the tooling/automation in this project and we ask contributors to not make changes to these when contributing (e.g. \`.github/*\`, \`.eslintrc.json\`, \`.licensee.json\`). Most of those files also have a header at the top to remind folks they are automatically generated. Pull requests that alter these will not be accepted. + package.json ======================================== { @@ -3141,6 +3311,35 @@ updates: ] } +.github/settings.yml +======================================== +# This file is automatically added by @npmcli/template-oss. Do not edit. + +repository: + allow_merge_commit: false + allow_rebase_merge: true + allow_squash_merge: true + squash_merge_commit_title: PR_TITLE + squash_merge_commit_message: PR_BODY + delete_branch_on_merge: true + enable_automated_security_fixes: true + enable_vulnerability_alerts: true + +branches: + - name: main + protection: + required_status_checks: null + enforce_admins: true + required_pull_request_reviews: + required_approving_review_count: 1 + require_code_owner_reviews: true + require_last_push_approval: true + dismiss_stale_reviews: true + restrictions: + apps: [] + users: [] + teams: [ "cli-team" ] + .github/workflows/ci-a.yml ======================================== # This file is automatically added by @npmcli/template-oss. Do not edit. @@ -3434,7 +3633,7 @@ jobs: return { summary } - name: Create Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 id: check if: inputs.check-sha with: @@ -3466,7 +3665,7 @@ jobs: - name: Post Lint run: npm run postlint --ignore-scripts -ws -iwr --if-present - name: Conclude Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 if: steps.check.outputs.check_id && always() with: token: \${{ secrets.GITHUB_TOKEN }} @@ -3535,7 +3734,7 @@ jobs: return { summary } - name: Create Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 id: check if: inputs.check-sha with: @@ -3581,7 +3780,7 @@ jobs: - name: Test run: npm test --ignore-scripts -ws -iwr --if-present - name: Conclude Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 if: steps.check.outputs.check_id && always() with: token: \${{ secrets.GITHUB_TOKEN }} @@ -3760,8 +3959,10 @@ jobs: npx --offline commitlint -V --from 'origin/\${{ github.base_ref }}' --to \${{ github.event.pull_request.head.sha }} - name: Run Commitlint on PR Title if: steps.commit.outcome == 'failure' + env: + PR_TITLE: \${{ github.event.pull_request.title }} run: | - echo '\${{ github.event.pull_request.title }}' | npx --offline commitlint -V + echo '$PR_TITLE' | npx --offline commitlint -V .github/workflows/release.yml ======================================== @@ -3891,7 +4092,7 @@ jobs: return { summary } - name: Create Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 id: check if: steps.release.outputs.pr-sha with: @@ -3982,7 +4183,7 @@ jobs: return { summary } - name: Create Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 id: check if: steps.commit.outputs.sha with: @@ -3992,7 +4193,7 @@ jobs: sha: \${{ steps.commit.outputs.sha }} output: \${{ steps.check-output.outputs.result }} - name: Conclude Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 if: needs.release.outputs.check-id && always() with: token: \${{ secrets.GITHUB_TOKEN }} @@ -4030,7 +4231,7 @@ jobs: fi echo "result=$result" >> $GITHUB_OUTPUT - name: Conclude Check - uses: LouisBrunner/checks-action@v1.3.1 + uses: LouisBrunner/checks-action@v1.6.0 if: needs.update.outputs.check-id && always() with: token: \${{ secrets.GITHUB_TOKEN }} diff --git a/tap-snapshots/test/check/snapshots.js.test.cjs b/tap-snapshots/test/check/snapshots.js.test.cjs index 0e317bad..c7bdff3f 100644 --- a/tap-snapshots/test/check/snapshots.js.test.cjs +++ b/tap-snapshots/test/check/snapshots.js.test.cjs @@ -35,6 +35,7 @@ The following repo files need to be added: .github/ISSUE_TEMPLATE/bug.yml .github/ISSUE_TEMPLATE/config.yml .github/matchers/tap.json + .github/settings.yml .github/workflows/audit.yml .github/workflows/ci-release.yml .github/workflows/ci.yml @@ -55,6 +56,7 @@ The following module files need to be added: .gitignore .npmrc CODE_OF_CONDUCT.md + CONTRIBUTING.md SECURITY.md To correct it: npx template-oss-apply --force @@ -132,6 +134,7 @@ To correct it: move files to not match one of the following patterns: !/bin/ !/CHANGELOG* !/CODE_OF_CONDUCT.md + !/CONTRIBUTING.md !/docs/ !/lib/ !/LICENSE* @@ -170,6 +173,7 @@ To correct it: move files to not match one of the following patterns: !/bin/ !/CHANGELOG* !/CODE_OF_CONDUCT.md + !/CONTRIBUTING.md !/docs/ !/lib/ !/LICENSE* @@ -282,6 +286,7 @@ The following repo files need to be added: .github/ISSUE_TEMPLATE/bug.yml .github/ISSUE_TEMPLATE/config.yml .github/matchers/tap.json + .github/settings.yml .github/workflows/audit.yml .github/workflows/ci-release.yml .github/workflows/ci.yml @@ -302,6 +307,7 @@ The following module files need to be added: .gitignore .npmrc CODE_OF_CONDUCT.md + CONTRIBUTING.md SECURITY.md To correct it: npx template-oss-apply --force @@ -365,6 +371,7 @@ The following repo files need to be added: .github/dependabot.yml .github/matchers/tap.json + .github/settings.yml .github/workflows/ci-name-aaaa.yml .github/workflows/ci-release.yml .github/workflows/post-dependabot.yml @@ -436,6 +443,7 @@ The following repo files need to be added: .github/dependabot.yml .github/matchers/tap.json + .github/settings.yml .github/workflows/ci-bbb.yml .github/workflows/ci-release.yml .github/workflows/post-dependabot.yml diff --git a/test/bin/apply.js b/test/bin/apply.js index 40f958fe..ab4d2981 100644 --- a/test/bin/apply.js +++ b/test/bin/apply.js @@ -27,21 +27,21 @@ t.afterEach(() => { t.test('when npm_config_local_prefix is unset, does nothing', async (t) => { await templateApply() - t.equal(process.exitCode, undefined, 'exitCode is unset') + t.notOk(process.exitCode, 'exitCode is unset') }) t.test('when npm_config_global is true, does nothing', async (t) => { process.env.npm_config_global = 'true' await templateApply() - t.equal(process.exitCode, undefined, 'exitCode is unset') + t.notOk(process.exitCode, 'exitCode is unset') }) t.test('with mocks', async (t) => { process.env.npm_config_local_prefix = 'heynow' await templateApply(() => {}) - t.equal(process.exitCode, undefined, 'exitCode is unset') + t.notOk(process.exitCode, 'exitCode is unset') }) t.test('error', async (t) => { @@ -50,5 +50,5 @@ t.test('error', async (t) => { await templateApply(() => { throw new Error('apply') }) - t.equal(process.exitCode, 1, 'exitCode is unset') + t.ok(process.exitCode, 'exitCode is unset') }) diff --git a/test/bin/check.js b/test/bin/check.js index 6841ceea..12aba611 100644 --- a/test/bin/check.js +++ b/test/bin/check.js @@ -44,7 +44,7 @@ t.test('problems', async (t) => { solution: 'solution2', }]) - t.equal(process.exitCode, 1, 'exit code') + t.ok(process.exitCode, 'exit code') t.matchSnapshot(errors.join('\n')) }) @@ -53,6 +53,6 @@ t.test('no problems', async (t) => { await templateCheck(() => []) - t.equal(process.exitCode, undefined, 'exit code') + t.notOk(process.exitCode, 'exit code') t.strictSame(errors, [], 'errors') }) diff --git a/test/setup.js b/test/setup.js index 5885f28c..5593ffca 100644 --- a/test/setup.js +++ b/test/setup.js @@ -150,7 +150,7 @@ const setupGit = async (...args) => { const gca = async () => { await git('add -A .') - await git('commit -m "init"') + await git('commit --no-gpg-sign -m "init"') } await git('init')