Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add static tooling #60

Merged
merged 6 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Validate
on:
push:
branches:
- "**" # all branches
- "!main"
pull_request:
branches:
- main

jobs:
typecheck:
name: Typecheck
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://npm.pkg.github.com
- name: NPM Install
run: npm ci --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.GWM_GH_TOKEN}}
- name: Build
run: npm run build
- name: Check types...
run: npm run typecheck

format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://npm.pkg.github.com
- name: NPM Install
run: npm ci --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.GWM_GH_TOKEN}}
- name: Format...
run: npm run format

- name: Commit and push changes (if any)
uses: stefanzweifel/git-auto-commit-action@v4.2.0
id: auto_commit_action
with:
commit_user_name: seambot
commit_user_email: devops@getseam.com
commit_author: Seam Bot <devops@getseam.com>
commit_message: ci - format code

- name: Success
if: steps.auto_commit_action.outputs.changes_detected == 'false'
run: echo "Format check... PASS!"

- name: Fail
if: steps.auto_commit_action.outputs.changes_detected == 'true'
run: echo "Fixed formatting, and pushed changes" && exit 1
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"semi": false,
"singleQuote": false,
"trailingComma": "es5"
}
}
196 changes: 21 additions & 175 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
},
"dependencies": {
"@seamapi/http": "^0.12.0",
"@seamapi/types": "^1.75.0",
"open": "^10.0.2",
"@seamapi/types": "^1.74.0",
"swagger-parser": "^10.0.3"
}
}
7 changes: 1 addition & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,5 @@
"bun-types" // add Bun global
]
},
"include": [
"lib/**/*.ts",
"cli.ts",
"index.ts",
"package.json"
]
"include": ["lib/**/*.ts", "cli.ts", "index.ts", "package.json"]
}