-
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
e304e47
commit ccb5376
Showing
40 changed files
with
5,626 additions
and
8,181 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
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 |
---|---|---|
|
@@ -41,13 +41,14 @@ jobs: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 16 | ||
cache: 'npm' | ||
|
||
- run: npm ci | ||
env: | ||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | ||
|
||
- run: npm run lint --if-present | ||
- run: pnpm --if-present run lint | ||
|
||
# This job just check code style for in-template contributions. | ||
code-style: | ||
|
@@ -57,7 +58,9 @@ jobs: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
cache: 'npm' | ||
node-version: 16 | ||
cache: 'pnpm' | ||
|
||
- run: npm i prettier | ||
- run: npm i [email protected] | ||
- run: pnpm i prettier | ||
- run: npx prettier --check "**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue}" |
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,24 +1,25 @@ | ||
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}) => { | ||
'{pnpm-lock.yaml,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']; | ||
if (filenames.some(f => f.endsWith('pnpm-lock.yaml'))) { | ||
return ['pnpm --if-present run typecheck']; | ||
} | ||
|
||
|
||
// 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`, | ||
p => `pnpm --if-present run typecheck:${p}`, | ||
); | ||
}, | ||
}; |
Oops, something went wrong.