Skip to content

Commit

Permalink
Bumped to latest templating
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Nov 13, 2023
1 parent f6be8fa commit 4f55ef5
Show file tree
Hide file tree
Showing 29 changed files with 1,426 additions and 1,071 deletions.
10 changes: 6 additions & 4 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"badgeTemplate": "<img alt=\"All Contributors: <%= contributors.length %>\" src=\"https://img.shields.io/badge/all_contributors-<%= contributors.length %>-21bb42.svg\" />",
"badgeTemplate": "<img alt=\"All Contributors: <%= contributors.length %> 👪\" src=\"https://img.shields.io/badge/all_contributors-<%= contributors.length %>_👪-21bb42.svg\" />",
"commit": false,
"commitConvention": "angular",
"contributors": [
Expand Down Expand Up @@ -135,11 +135,12 @@
"avatar_url": "https://avatars.githubusercontent.com/u/668674?v=4",
"profile": "https://omnidan.net/",
"contributions": [
"ideas",
"fundingFinding",
"tool",
"bug",
"code",
"fundingFinding",
"ideas",
"infra",
"tool",
"maintenance"
]
},
Expand Down Expand Up @@ -244,3 +245,4 @@
"repoHost": "https://github.com",
"repoType": "github"
}

14 changes: 9 additions & 5 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module.exports = {
'plugin:perfectionist/recommended-natural',
'plugin:regexp/recommended',
'plugin:vitest/recommended',
'prettier',
],
overrides: [
{
Expand Down Expand Up @@ -44,6 +43,12 @@ module.exports = {
'jsdoc/require-returns': 'off',
},
},
{
files: '**/*.md/*.*s',
rules: {
'n/no-missing-import': ['error', { allowModules: ['node-emoji'] }],
},
},
{
excludedFiles: ['**/*.md/*.ts'],
extends: [
Expand Down Expand Up @@ -83,7 +88,6 @@ module.exports = {
'@typescript-eslint/no-unsafe-call': 'off',
},
},

{
extends: ['plugin:yml/standard', 'plugin:yml/prettier'],
files: ['**/*.{yml,yaml}'],
Expand Down Expand Up @@ -111,7 +115,6 @@ module.exports = {
plugins: [
'@typescript-eslint',
'deprecation',
'import',
'jsdoc',
'no-only-tests',
'perfectionist',
Expand All @@ -123,20 +126,21 @@ module.exports = {
rules: {
// These off/less-strict-by-default rules work well for this repo and we like them on.
'@typescript-eslint/no-unused-vars': ['error', { caughtErrors: 'all' }],
'import/extensions': ['error', 'ignorePackages'],
'no-only-tests/no-only-tests': 'error',

// These on-by-default rules don't work well for this repo and we like them off.
'n/no-missing-import': 'off',
'no-case-declarations': 'off',
'no-constant-condition': 'off',
'no-inner-declarations': 'off',
'no-mixed-spaces-and-tabs': 'off',

// Stylistic concerns that don't interfere with Prettier
'@typescript-eslint/padding-line-between-statements': [
'error',
{ blankLine: 'always', next: '*', prev: 'block-like' },
],
'no-useless-rename': 'error',
'object-shorthand': 'error',
'perfectionist/sort-objects': [
'error',
{
Expand Down
10 changes: 5 additions & 5 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@ There are two steps involved:

### Finding an Issue

With the exception of very small typos, all changes to this repository generally need to correspond to an [open issue marked as `accepting prs` on the issue tracker](https://github.com/omnidan/node-emoji/issues?q=is%3Aopen+is%3Aissue+label%3A%22accepting+prs%22).
If this is your first time contributing, consider searching for [unassigned issues that also have the `good first issue` label](https://github.com/omnidan/node-emoji/issues?q=is%3Aopen+is%3Aissue+label%3A%22accepting+prs%22+label%3A%22good+first+issue%22+no%3Aassignee).
With the exception of very small typos, all changes to this repository generally need to correspond to an [unassigned open issue marked as `status: accepting prs` on the issue tracker](https://github.com/omnidan/node-emoji/issues?q=is%3Aissue+is%3Aopen+label%3A%22status%3A+accepting+prs%22+no%3Aassignee+).
If this is your first time contributing, consider searching for [unassigned issues that also have the `good first issue` label](https://github.com/omnidan/node-emoji/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22+label%3A%22status%3A+accepting+prs%22+no%3Aassignee+).
If the issue you'd like to fix isn't found on the issue, see [Reporting Issues](#reporting-issues) for filing your own (please do!).

#### Issue Claiming

We don't use any kind of issue claiming system.
We've found in the past that they result in accidental ["licked cookie"](https://devblogs.microsoft.com/oldnewthing/20091201-00/?p=15843) situations where contributors claim an issue but run out of time or energy trying before sending a PR.

If an issue has been marked as `accepting prs` and an open PR does not exist, feel free to send a PR.
You don't need to ask for permission.
If an unassigned issue has been marked as `status: accepting prs` and an open PR does not exist, feel free to send a PR.
Please don't post comments asking for permission or stating you will work on an issue.

### Sending a Pull Request

Once you've identified an open issue accepting PRs that doesn't yet have a PR sent, you're free to send a pull request.
Be sure to fill out the pull request template's requested information -- otherwise your PR will likely be closed.

PRs are also expected to have a title that adheres to [commitlint](https://github.com/conventional-changelog/commitlint).
PRs are also expected to have a title that adheres to [conventional commits](https://www.conventionalcommits.org/en/v1.0.0).
Only PR titles need to be in that format, not individual commits.
Don't worry if you get this wrong: you can always change the PR title after sending it.
Check [previously merged PRs](https://github.com/omnidan/node-emoji/pulls?q=is%3Apr+is%3Amerged+-label%3Adependencies+) for reference.
Expand Down
2 changes: 1 addition & 1 deletion .github/Development.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ It should be applied automatically when you save files in VS Code or make a Git
To manually reformat all files, you can run:

```shell
pnpm format:write
pnpm format --write
```

## Linting
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Prepare
runs:
steps:
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
cache: pnpm
node-version: '18'
Expand Down
4 changes: 2 additions & 2 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"automerge": true,
"internalChecksFilter": "strict",
"labels": ["dependencies"],
"postUpdateOptions": ["pnpmDedupe"],
"stabilityDays": 3
"minimumReleaseAge": "3 days",
"postUpdateOptions": ["pnpmDedupe"]
}
25 changes: 25 additions & 0 deletions .github/workflows/accessibility-alt-text-bot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
jobs:
accessibility_alt_text_bot:
runs-on: ubuntu-latest
steps:
- uses: github/[email protected]

name: Accessibility Alt Text Bot

on:
issue_comment:
types:
- created
- edited
issues:
types:
- edited
- opened
pull_request:
types:
- edited
- opened

permissions:
issues: write
pull-requests: write
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm build
- run: node ./lib/index.js
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ jobs:
contributors:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/prepare
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-knip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ jobs:
lint_knip:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm lint:knip

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ jobs:
lint_markdown:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm lint:md

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-package-json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ jobs:
lint_package_json:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm lint:package-json

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ jobs:
lint_packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm lint:packages

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-spelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ jobs:
lint_spelling:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm lint:spelling

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm lint

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ jobs:
post_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: echo "npm_version=$(npm pkg get version | tr -d '"')" >> "$GITHUB_ENV"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ jobs:
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm format --list-different

Expand Down
69 changes: 4 additions & 65 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,81 +1,20 @@
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
- uses: ./.github/actions/prepare
- run: pnpm build
- run: git config user.name "${GITHUB_ACTOR}"
- run: git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
- name: Delete branch protection on main
uses: actions/[email protected]
with:
github-token: ${{ secrets.ACCESS_TOKEN }}
script: |
try {
await github.request(
`DELETE /repos/omnidan/node-emoji/branches/main/protection`,
);
} catch (error) {
if (!error.message?.includes?.("Branch not protected")) {
throw error;
}
}
- env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
if pnpm run should-semantic-release ; then
pnpm release-it --verbose
gh workflow run post-release.yml
fi
- if: always()
name: Recreate branch protection on main
uses: actions/[email protected]
with:
github-token: ${{ secrets.ACCESS_TOKEN }}
script: |
github.request(
`PUT /repos/omnidan/node-emoji/branches/main/protection`,
{
allow_deletions: false,
allow_force_pushes: true,
allow_fork_pushes: false,
allow_fork_syncing: true,
block_creations: false,
branch: "main",
enforce_admins: false,
owner: "omnidan",
repo: "node-emoji",
required_conversation_resolution: true,
required_linear_history: false,
required_pull_request_reviews: null,
required_status_checks: {
checks: [
{ context: "build" },
{ context: "compliance" },
{ context: "lint" },
{ context: "lint_knip" },
{ context: "lint_markdown" },
{ context: "lint_package_json" },
{ context: "lint_packages" },
{ context: "lint_spelling" },
{ context: "prettier" },
{ context: "test" },
],
strict: false,
},
restrictions: null,
}
);
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
uses: omnidan/[email protected]

name: Release

Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm run test --coverage
- name: Codecov
uses: codecov/codecov-action@v3

name: Test

on:
pull_request: ~
push:
branches:
- main
2 changes: 1 addition & 1 deletion .github/workflows/tsc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ jobs:
type_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm tsc

Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.17.1
20.9.0
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.all-contributorsrc
coverage/
lib/
pnpm-lock.yaml
7 changes: 7 additions & 0 deletions .release-it.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,12 @@
"autoGenerate": true,
"release": true,
"releaseName": "v${version}"
},
"npm": { "publishArgs": ["--access public", "--provenance"] },
"plugins": {
"@release-it/conventional-changelog": {
"infile": "CHANGELOG.md",
"preset": "angular"
}
}
}
Loading

0 comments on commit 4f55ef5

Please sign in to comment.