-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Wryn (yage) Wagner <[email protected]>
- Loading branch information
Showing
28 changed files
with
3,855 additions
and
0 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,16 @@ | ||
root=true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
|
||
[*.{mjs,cjs,js,mts,cts,ts,json,vue,html,scss,css,toml,md}] | ||
indent_style = tab | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.{yml,yaml}] | ||
indent_style = space |
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 @@ | ||
dist/** -diff linguist-generated=true |
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: Setup | ||
description: Configure Node.js + pnpm and install dependencies | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: package.json | ||
|
||
- uses: pnpm/action-setup@v4 | ||
name: Setup pnpm | ||
id: pnpm-install | ||
with: | ||
run_install: false | ||
|
||
- name: Get pnpm cache dir | ||
id: pnpm-cache-dir | ||
shell: bash | ||
run: echo "pnpm-cache-dir=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
|
||
- uses: actions/cache@v4 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ steps.pnpm-cache-dir.outputs.pnpm-cache-dir }} | ||
key: | ||
${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Install dependencies | ||
shell: bash | ||
run: pnpm install |
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,35 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup env | ||
uses: ./.github/actions/setup | ||
|
||
- name: Build | ||
run: pnpm run build | ||
|
||
- name: Commit changes | ||
run: | | ||
author='${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>' | ||
message='Update build artifacts [skip ci]' | ||
git config user.name 'github-actions[bot]' | ||
git config user.email '41898282+github-actions[bot]@users.noreply.github.com' | ||
git commit --all --author "$author" --message "$message" || true | ||
git push |
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,81 @@ | ||
name: Check | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup env | ||
uses: ./.github/actions/setup | ||
|
||
- name: Run linter | ||
run: pnpm run lint | ||
|
||
typecheck: | ||
name: Typecheck | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup env | ||
uses: ./.github/actions/setup | ||
|
||
- name: Run typecheck | ||
run: pnpm run typecheck | ||
|
||
test-unit: | ||
name: Unit Tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup env | ||
uses: ./.github/actions/setup | ||
|
||
- name: Run tests | ||
run: pnpm test | ||
|
||
test-action: | ||
name: Action Test | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: read | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup env | ||
uses: ./.github/actions/setup | ||
|
||
- name: Build | ||
run: pnpm run build | ||
|
||
- name: Run action | ||
id: action | ||
uses: ./ | ||
with: | ||
stale-label: stale | ||
days-before-close: 7 | ||
close-message: Closing this issue as it has become stale. | ||
dry-run: true | ||
|
||
- name: Check output | ||
run: | | ||
echo 'closed-issues=${{ steps.action.outputs.closed-issues }}' | ||
${{ startsWith(steps.action.outputs.closed-issues, '[') }} || { echo '::error::Expected "closed-issues" output to start with ['; exit 1; } | ||
${{ endsWith(steps.action.outputs.closed-issues, ']') }} || { echo '::error::Expected "closed-issues" output to end with ]'; exit 1; } |
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,91 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: SemVer for the release, for example "1.0.0" | ||
required: true | ||
type: string | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
check-version: | ||
name: Check Version | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.version.outputs.release }} | ||
major-version: ${{ steps.version.outputs.major }} | ||
is-prerelease: ${{ steps.version.outputs.prerelease && true || false }} | ||
steps: | ||
- name: Check version | ||
uses: madhead/semver-utils@v4 | ||
id: version | ||
with: | ||
version: ${{ inputs.version }} | ||
lenient: false | ||
|
||
create-version: | ||
name: Create Version | ||
runs-on: ubuntu-latest | ||
needs: check-version | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup env | ||
uses: ./.github/actions/setup | ||
|
||
- name: Build | ||
run: pnpm run build | ||
|
||
- name: Update version in readme | ||
run: | | ||
version='${{ needs.check-version.outputs.major-version }}' | ||
sed \ | ||
-i 's/\(<!-- version:start -->\).*\(<!-- version:end -->\)/\1'"$version"'\2/g' \ | ||
readme.md | ||
- name: Create version commit & tags | ||
run: | | ||
author='${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>' | ||
version='v${{ needs.check-version.outputs.version }}' | ||
majorVersion='v${{ needs.check-version.outputs.major-version }}' | ||
branch='${{ github.ref }}' | ||
isPrerelease='${{ needs.check-version.outputs.is-prerelease }}' | ||
git config user.name 'github-actions[bot]' | ||
git config user.email '41898282+github-actions[bot]@users.noreply.github.com' | ||
git commit --all --author "$author" --message "$version" || true | ||
git tag --annotate "$version" --message "$version" | ||
git push --atomic origin "$branch" "$version" | ||
if [ "$isPrerelease" = false ]; then | ||
git tag --force --annotate "$majorVersion" --message "$majorVersion" | ||
git push --force origin "$majorVersion" | ||
fi | ||
create-release: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
needs: | ||
- check-version | ||
- create-version | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Create release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh release create \ | ||
'v${{ needs.check-version.outputs.version }}' \ | ||
--verify-tag \ | ||
--generate-notes \ | ||
${{ needs.check-version.outputs.is-prerelease == 'true' && '--prerelease' || '' }} |
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,17 @@ | ||
# User preferences | ||
.DS_Store | ||
|
||
# Dependencies | ||
node_modules/ | ||
|
||
# Builds / Caches | ||
coverage/ | ||
*.tsbuildinfo | ||
.eslintcache | ||
|
||
# IDEs / Editors | ||
.idea/ | ||
*.code-workspace | ||
.history/ | ||
*.sublime-settings | ||
.*.swp |
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,3 @@ | ||
engine-strict=true | ||
shell-emulator=true | ||
save-prefix='' |
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,3 @@ | ||
{ | ||
"recommendations": ["dbaeumer.vscode-eslint", "editorconfig.editorconfig"] | ||
} |
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,49 @@ | ||
{ | ||
// Disable the default formatter, use eslint instead | ||
"prettier.enable": false, | ||
"editor.formatOnSave": false, | ||
|
||
// Auto fix | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "explicit", | ||
"source.organizeImports": "never" | ||
}, | ||
|
||
// Silent the stylistic rules in you IDE, but still auto fix them | ||
"eslint.rules.customizations": [ | ||
{ "rule": "style/*", "severity": "off", "fixable": true }, | ||
{ "rule": "format/*", "severity": "off", "fixable": true }, | ||
{ "rule": "*-indent", "severity": "off", "fixable": true }, | ||
{ "rule": "*-spacing", "severity": "off", "fixable": true }, | ||
{ "rule": "*-spaces", "severity": "off", "fixable": true }, | ||
{ "rule": "*-order", "severity": "off", "fixable": true }, | ||
{ "rule": "*-dangle", "severity": "off", "fixable": true }, | ||
{ "rule": "*-newline", "severity": "off", "fixable": true }, | ||
{ "rule": "*quotes", "severity": "off", "fixable": true }, | ||
{ "rule": "*semi", "severity": "off", "fixable": true } | ||
], | ||
|
||
// Enable eslint for all supported languages | ||
"eslint.validate": [ | ||
"javascript", | ||
"javascriptreact", | ||
"typescript", | ||
"typescriptreact", | ||
"vue", | ||
"html", | ||
"markdown", | ||
"json", | ||
"jsonc", | ||
"yaml", | ||
"toml", | ||
"xml", | ||
"gql", | ||
"graphql", | ||
"astro", | ||
"css", | ||
"less", | ||
"scss", | ||
"pcss", | ||
"postcss" | ||
] | ||
} |
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,37 @@ | ||
name: Close Stale Issues | ||
description: Close issues certain days after a stale label has been added | ||
author: Directus | ||
|
||
branding: | ||
icon: calendar | ||
color: red | ||
|
||
inputs: | ||
github-token: | ||
required: true | ||
description: GitHub token with read access and issue update access to github-repo | ||
default: ${{ github.token }} | ||
github-repo: | ||
required: true | ||
description: GitHub `owner/repository` for which stale issues are paused | ||
default: ${{ github.repository }} | ||
stale-label: | ||
required: true | ||
description: Label which marks an issue as stale | ||
days-before-close: | ||
required: true | ||
description: Days before an issue is closed after the stale label has been added to it | ||
close-comment: | ||
required: true | ||
description: Comment which will be added to issues when closing | ||
dry-run: | ||
description: Run the action without effectively closing stale issues | ||
default: 'false' | ||
|
||
outputs: | ||
closed-issues: | ||
description: List with numbers of all issues that have been closed | ||
|
||
runs: | ||
using: node20 | ||
main: dist/index.js |
Oops, something went wrong.