generated from stacksjs/ts-starter
-
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
1 parent
56ff003
commit 4d53e0d
Showing
14 changed files
with
103 additions
and
96 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,3 @@ | ||
* text=auto | ||
*.* text eol=lf | ||
*.lockb binary diff=lockb |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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 |
---|---|---|
|
@@ -9,13 +9,6 @@ on: | |
branches: | ||
- main | ||
|
||
env: | ||
PR_NUMBER: '${{ github.event.number }}' | ||
SOURCE_BRANCH: $GITHUB_HEAD_REF | ||
FIXER_BRANCH: auto-fixed/$GITHUB_HEAD_REF | ||
TITLE: Apply fixes from JS-CS-Fixer | ||
DESCRIPTION: This merge request applies JS code style fixes from an analysis carried out through GitHub Actions. | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
@@ -27,14 +20,22 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install bun | ||
- name: Install Bun | ||
uses: oven-sh/setup-bun@v1 | ||
|
||
- name: Install dependencies | ||
- name: Use cached node_modules | ||
uses: actions/cache@v4 | ||
with: | ||
path: node_modules | ||
key: node-modules-${{ hashFiles('**/bun.lockb') }} | ||
restore-keys: | | ||
node-modules- | ||
- name: Install Dependencies | ||
run: bun install | ||
|
||
- name: Lint | ||
run: bun --bun run lint | ||
run: bun run lint | ||
|
||
typecheck: | ||
runs-on: ubuntu-latest | ||
|
@@ -45,7 +46,15 @@ jobs: | |
- name: Install bun | ||
uses: oven-sh/setup-bun@v1 | ||
|
||
- name: Install dependencies | ||
- name: Use cached node_modules | ||
uses: actions/cache@v4 | ||
with: | ||
path: node_modules | ||
key: node-modules-${{ hashFiles('**/bun.lockb') }} | ||
restore-keys: | | ||
node-modules- | ||
- name: Install Dependencies | ||
run: bun install | ||
|
||
- name: Typecheck | ||
|
@@ -60,51 +69,16 @@ jobs: | |
- name: Install bun | ||
uses: oven-sh/setup-bun@v1 | ||
|
||
- name: Use cached node_modules | ||
uses: actions/cache@v4 | ||
with: | ||
path: node_modules | ||
key: node-modules-${{ hashFiles('**/bun.lockb') }} | ||
restore-keys: | | ||
node-modules- | ||
- name: Install Dependencies | ||
run: bun install | ||
|
||
- name: Unit Test | ||
run: bun test | ||
|
||
js-cs-fixer: | ||
runs-on: ubuntu-latest | ||
|
||
if: github.event_name == 'pull_request' && ! startsWith(github.ref, 'refs/heads/auto-fixed/') | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install bun | ||
uses: oven-sh/setup-bun@v1 | ||
|
||
- name: Install Dependencies | ||
run: bun install | ||
|
||
- name: Prepare Git User | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "[email protected]" | ||
git checkout -B "${{ env.FIXER_BRANCH }}" | ||
- name: Apply auto-fixers | ||
run: bun run lint:fix | ||
|
||
- name: Create Fixer PR | ||
run: | | ||
if [[ -z $(git status --porcelain) ]]; then | ||
echo "Nothing to fix... Exiting." | ||
exit 0 | ||
fi | ||
OPEN_PRS=`curl --silent -H "Accept: application/vnd.github.v3+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/$GITHUB_REPOSITORY/pulls?state=open"` | ||
OPEN_FIXER_PRS=`echo ${OPEN_PRS} | grep -o "\"ref\": \"${{ env.FIXER_BRANCH }}\"" | wc -l` | ||
git commit -am "${{ env.TITLE }}" | ||
git push origin "${{ env.FIXER_BRANCH }}" --force | ||
if [ ${OPEN_FIXER_PRS} -eq "0" ]; then | ||
curl -X POST \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | ||
"https://api.github.com/repos/$GITHUB_REPOSITORY/pulls" \ | ||
-d "{ \"head\":\"${{ env.FIXER_BRANCH }}\", \"base\":\"${{ env.SOURCE_BRANCH }}\", \"title\":\"${{ env.TITLE }}\", \"body\":\"${{ env.DESCRIPTION }}\n\nTriggered by #${{ env.PR_NUMBER }}\" }" | ||
fi | ||
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
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,8 @@ | ||
import stacks from '@stacksjs/eslint-config' | ||
|
||
export default stacks({ | ||
stylistic: { | ||
indent: 2, // 4, or 'tab' | ||
quotes: 'single', // or 'double' | ||
}, | ||
}) |
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
{ | ||
"name": "bun-plugin-dts-auto", | ||
"type": "module", | ||
"version": "0.2.2", | ||
"description": "Automatically generate d.ts files for Bun packages.", | ||
"description": "A Bun Bundler plugin that auto generates your d.ts types.", | ||
"author": "Chris Breuer <[email protected]>", | ||
"license": "MIT", | ||
"homepage": "https://github.com/stacksjs/bun-plugin-dts-auto#readme", | ||
|
@@ -17,6 +18,7 @@ | |
"generation", | ||
"typescript", | ||
"types", | ||
"auto", | ||
"bun", | ||
"package" | ||
], | ||
|
@@ -25,43 +27,46 @@ | |
"bun": "./src/index.ts", | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.js" | ||
}, | ||
"./*": { | ||
"bun": "./src/*", | ||
"import": "./dist/*" | ||
} | ||
}, | ||
"module": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
"dist", | ||
"src" | ||
], | ||
"scripts": { | ||
"build": "bun --bun build.ts", | ||
"lint": "eslint .", | ||
"lint:fix": "eslint . --fix", | ||
"fresh": "rimraf node_modules/ bun.lock && bun i", | ||
"build": "bun build.ts", | ||
"lint": "bunx eslint .", | ||
"lint:fix": "bunx eslint . --fix", | ||
"fresh": "bunx rimraf node_modules/ bun.lock && bun i", | ||
"commit": "git cz", | ||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0", | ||
"prepublishOnly": "bun --bun run build", | ||
"release": "bunx --bun bumpp package.json --all", | ||
"start": "bun --bun src/index.ts", | ||
"changelog": "bunx changelogen --output CHANGELOG.md", | ||
"prepublishOnly": "bun run build", | ||
"release": "bun run changelog && bunx bumpp package.json --all", | ||
"test": "bun test", | ||
"typecheck": "tsc --noEmit" | ||
}, | ||
"devDependencies": { | ||
"@ow3/eslint-config": "^0.47.3", | ||
"@commitlint/cli": "^18.6.1", | ||
"@stacksjs/eslint-config": "^0.58.73", | ||
"@types/node": "^20.11.20", | ||
"bumpp": "^9.3.0", | ||
"bun-types": "^0.8.1", | ||
"changelogen": "^0.5.5", | ||
"commitizen": "^4.3.0", | ||
"conventional-changelog-cli": "^3.0.0", | ||
"cz-git": "^1.8.0", | ||
"eslint": "^8.56.0", | ||
"lint-staged": "^15.2.2", | ||
"rimraf": "^5.0.5", | ||
"simple-git-hooks": "^2.9.0", | ||
"typescript": "^5.3.3" | ||
}, | ||
"simple-git-hooks": { | ||
"pre-commit": "npx --no-install lint-staged", | ||
"commit-msg": "npx --no -- commitlint --edit $1" | ||
"pre-commit": "bun lint-staged", | ||
"commit-msg": "bunx --no -- commitlint --edit $1" | ||
}, | ||
"lint-staged": { | ||
"*.{js,jsx,ts,tsx,vue}": "eslint --fix" | ||
|
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 |
---|---|---|
@@ -1,28 +1,27 @@ | ||
{ | ||
"compilerOptions": { | ||
"incremental": true, | ||
"target": "esnext", | ||
"module": "esnext", | ||
"lib": [ | ||
"esnext" | ||
], | ||
"moduleDetection": "force", | ||
"module": "esnext", | ||
"moduleResolution": "bundler", | ||
"noEmit": true, | ||
"resolveJsonModule": true, | ||
"types": [ | ||
"node" | ||
], | ||
"allowImportingTsExtensions": true, | ||
"moduleDetection": "force", | ||
"esModuleInterop": true, | ||
"strict": true, | ||
"strictNullChecks": true, | ||
"resolveJsonModule": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"skipLibCheck": true, | ||
"declaration": true, | ||
"declarationMap": true, | ||
"incremental": true, | ||
"noEmit": true, | ||
"outDir": "./dist", | ||
"esModuleInterop": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"skipDefaultLibCheck": true, | ||
"types": [ | ||
"node", | ||
"bun-types" | ||
] | ||
"skipLibCheck": true | ||
} | ||
} |