-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
1,104 additions
and
31 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,40 @@ | ||
name: Setup | ||
description: Configure Node.js + pnpm and install dependencies | ||
|
||
inputs: | ||
registry: | ||
description: NPM registry to set up for auth | ||
required: false | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: .node-version | ||
registry-url: ${{ inputs.registry }} | ||
|
||
- 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,37 @@ | ||
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 | ||
|
||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup env | ||
uses: ./.github/actions/setup | ||
|
||
- name: Run test | ||
run: pnpm test |
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,105 @@ | ||
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 }} | ||
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: Bump version | ||
run: pnpm version --no-git-tag-version '${{ needs.check-version.outputs.version }}' | ||
|
||
- name: Create version commit & tag | ||
run: | | ||
author='${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>' | ||
version='v${{ needs.check-version.outputs.version }}' | ||
branch='${{ github.ref }}' | ||
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" | ||
git tag --annotate "$version" --message "$version" | ||
git push --atomic origin "$branch" "$version" | ||
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' || '' }} | ||
publish-npm: | ||
name: Publish to NPM | ||
runs-on: ubuntu-latest | ||
needs: | ||
- check-version | ||
- create-version | ||
permissions: | ||
id-token: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: refs/tags/v${{ needs.check-version.outputs.version }} | ||
|
||
- name: Setup env | ||
uses: ./.github/actions/setup | ||
with: | ||
registry: https://registry.npmjs.org | ||
|
||
- name: Publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
NPM_CONFIG_PROVENANCE: true | ||
run: | | ||
pnpm publish \ | ||
--access=public \ | ||
--no-git-checks \ | ||
--tag ${{ needs.check-version.outputs.is-prerelease == 'true' && 'canary' || 'latest' }} |
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,18 @@ | ||
# User preferences | ||
.DS_Store | ||
|
||
# Dependencies | ||
node_modules/ | ||
|
||
# Builds / Caches | ||
dist/ | ||
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 @@ | ||
20 |
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
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
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
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
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 @@ | ||
import directusConfig from '@directus/eslint-config'; | ||
|
||
export default directusConfig(); |
Oops, something went wrong.