Skip to content

Commit 6c336b6

Browse files
committed
pre commit git hook
1 parent 93e7a94 commit 6c336b6

File tree

9 files changed

+1229
-698
lines changed

9 files changed

+1229
-698
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,11 @@ jobs:
1212
- uses: actions/checkout@v2
1313
with:
1414
fetch-depth: 0
15-
- uses: nrwl/nx-set-shas@v3
16-
with:
17-
main-branch-name: master
15+
- run: echo "NX_BASE=$(git rev-parse origin/$GITHUB_BASE_REF)" >> $GITHUB_ENV
16+
- run: echo "NX_HEAD=$(git rev-parse origin/$GITHUB_HEAD_REF)" >> $GITHUB_ENV
17+
- run: echo "base=$NX_BASE head=$NX_HEAD"
1818
- run: npm ci
19-
2019
- run: npx nx workspace-lint
21-
# TODO(sancheez): temporarily disabled checking with prettier,
22-
# before uncommenting the command needs to run format write command
23-
# - run: npx nx format:check
20+
- run: npx nx format:check
2421
- run: npx nx affected --target=lint --parallel=3
2522
- run: npx nx affected --target=build --parallel=3

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx lint-staged --config .lintstagedrc

.lintstagedrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
'{libs,apps}/**/*.{ts,json,md,html,?(s)css}': [
3+
'npm run affected:lint:write',
4+
'npm run format:write'
5+
]
6+
}

angular.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
"kirjs": "apps/kirjs",
1616
"live": "libs/live",
1717
"playground": "apps/playground",
18+
"sandbox-runner": "libs/sandbox-runner",
1819
"slides": "libs/slides",
1920
"sync": "libs/sync",
20-
"utils": "libs/utils",
21-
"sandbox-runner": "libs/sandbox-runner"
22-
},
23-
"defaultProject": "codelab"
21+
"utils": "libs/utils"
22+
}
2423
}

libs/browser/src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
export { BrowserWindowComponent } from './lib/browser-window/browser-window.component';
22
export { TerminalWindowComponent } from './lib/terminal-window/terminal-window.component';
3-
export { PreviewWindowComponent, PreviewWindowType } from './lib/preview-window/preview-window.component';
3+
export {
4+
PreviewWindowComponent,
5+
PreviewWindowType,
6+
} from './lib/preview-window/preview-window.component';
47

58
export * from './lib/browser.module';

nx.json

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,50 +8,27 @@
88
"default": {
99
"runner": "nx/tasks-runners/default",
1010
"options": {
11-
"cacheableOperations": [
12-
"build",
13-
"lint",
14-
"test",
15-
"e2e"
16-
]
11+
"cacheableOperations": ["build", "lint", "test", "e2e"]
1712
}
1813
}
1914
},
2015
"targetDefaults": {
2116
"build": {
22-
"dependsOn": [
23-
"^build"
24-
],
25-
"inputs": [
26-
"production",
27-
"^production"
28-
]
17+
"dependsOn": ["^build"],
18+
"inputs": ["production", "^production"]
2919
},
3020
"test": {
31-
"inputs": [
32-
"default",
33-
"^production",
34-
"{workspaceRoot}/jest.preset.js"
35-
]
21+
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"]
3622
},
3723
"e2e": {
38-
"inputs": [
39-
"default",
40-
"^production"
41-
]
24+
"inputs": ["default", "^production"]
4225
},
4326
"lint": {
44-
"inputs": [
45-
"default",
46-
"{workspaceRoot}/.eslintrc.json"
47-
]
27+
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"]
4828
}
4929
},
5030
"namedInputs": {
51-
"default": [
52-
"{projectRoot}/**/*",
53-
"sharedGlobals"
54-
],
31+
"default": ["{projectRoot}/**/*", "sharedGlobals"],
5532
"production": [
5633
"default",
5734
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",

0 commit comments

Comments
 (0)