Skip to content

Commit

Permalink
feat: Handle retry logic (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyaiox authored Jul 16, 2024
1 parent 11c4a02 commit 44de4a3
Show file tree
Hide file tree
Showing 37 changed files with 1,446 additions and 507 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
- '**.mts'
- '**.cts'
- '**.tsx'
- '**.vue'
pull_request:
paths:
- '**.js'
Expand All @@ -21,7 +20,6 @@ on:
- '**.mts'
- '**.cts'
- '**.tsx'
- '**.vue'

concurrency:
group: lint-${{ github.ref }}
Expand All @@ -36,7 +34,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: 'npm'
Expand All @@ -52,10 +50,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: 'npm'

- run: npm i prettier
- run: npx prettier --check "**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue}"
- run: npx prettier --check "**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}"
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ macos-latest, windows-latest ]
# use macos-14-large to build the app for intel based macs
os: [ macos-latest, macos-14-large, windows-latest ]

runs-on: ${{ matrix.os }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
os: [ windows-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: 'npm'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/typechecking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: 'npm'
Expand Down
13 changes: 5 additions & 8 deletions .nano-staged.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
import {resolve, sep} from 'path';
import { resolve, sep } from 'path';

export default {
'*.{js,mjs,cjs,ts,mts,cts,vue}': 'eslint --cache --fix',
'*.{js,mjs,cjs,ts,tsx,mts,cts}': 'eslint --cache --fix',

/**
* Run typechecking if any type-sensitive files or project dependencies was changed
* @param {string[]} filenames
* @return {string[]}
*/
'{package-lock.json,packages/**/{*.ts,*.vue,tsconfig.json}}': ({filenames}) => {
'{package-lock.json,packages/**/{*.ts,*.tsx,tsconfig.json}}': ({ filenames }) => {
// if dependencies was changed run type checking for all packages
if (filenames.some(f => f.endsWith('package-lock.json'))) {
return ['npm run typecheck --if-present'];
}

// else run type checking for staged packages
const fileNameToPackageName = filename =>
filename.replace(resolve(process.cwd(), 'packages') + sep, '').split(sep)[0];
return [...new Set(filenames.map(fileNameToPackageName))].map(
p => `npm run typecheck:${p} --if-present`,
);
const fileNameToPackageName = filename => filename.replace(resolve(process.cwd(), 'packages') + sep, '').split(sep)[0];
return [...new Set(filenames.map(fileNameToPackageName))].map(p => `npm run typecheck:${p} --if-present`);
},
};
19 changes: 3 additions & 16 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
{
"printWidth": 100,
"semi": true,
"singleQuote": true,
"overrides": [
{
"files": ["**/*.css", "**/*.scss", "**/*.html"],
"options": {
"singleQuote": false
}
}
],
"printWidth": 140,
"tabWidth": 2,
"trailingComma": "all",
"bracketSpacing": false,
"arrowParens": "avoid",
"proseWrap": "never",
"htmlWhitespaceSensitivity": "strict",
"vueIndentScriptAndStyle": false,
"endOfLine": "lf",
"singleAttributePerLine": true
"arrowParens": "avoid"
}
Loading

0 comments on commit 44de4a3

Please sign in to comment.