Skip to content

Commit

Permalink
add pre commit checks
Browse files Browse the repository at this point in the history
Signed-off-by: david <[email protected]>
  • Loading branch information
daywiss committed Aug 2, 2024
1 parent b83ee06 commit 381af2d
Show file tree
Hide file tree
Showing 9 changed files with 298 additions and 16 deletions.
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm turbo run fix build test
4 changes: 1 addition & 3 deletions apps/node/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ async function run() {
}
}

run()
.then(console.log)
.catch(console.error);
run().then(console.log).catch(console.error);
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
{
"name":"across-indexer-monorepo",
"name": "across-indexer-monorepo",
"private": true,
"scripts": {
"build": "turbo build",
"dev": "turbo dev",
"fix": "turbo fix",
"check": "turbo check",
"start:template": "APP=template pnpm --filter @repo/node-app start"
"test": "turbo test",
"start:template": "APP=template pnpm --filter @repo/node-app start",
"prepare": "husky"
},
"devDependencies": {
"turbo": "^2.0.10"
"turbo": "^2.0.10",
"husky": "^9.1.4"
},
"packageManager": "[email protected]",
"engines": {
Expand Down
1 change: 1 addition & 0 deletions packages/template/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm
3 changes: 2 additions & 1 deletion packages/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ This template will set you up with typescript, eslint, prettier, some basic scri
- fix - eslint and prettier code fixing
- lint:check - eslint code checking ( no changes )
- format:check - prettier code checking ( no changes )
- check - eslint and prettier code checking ( no changes )
- build:check - run type check without emitting files
- check - eslint and prettier and typescript code checking ( no changes )
- test - run jest testing

5 changes: 3 additions & 2 deletions packages/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
"main": "index.js",
"scripts": {
"build": "tsc -b",
"build:check": "tsc -b --noEmit",
"watch": "tsc -b --watch",
"fix": "pnpm format && pnpm lint",
"format": "prettier --write src",
"format:check": "prettier src --check",
"lint": "eslint --fix",
"lint:check": "eslint",
"check": "pnpm format:check && pnpm lint:check",
"check": "pnpm format:check && pnpm lint:check && build:check",
"test": "jest",
"test:watch": "jest --watch"
},
Expand All @@ -31,7 +32,7 @@
"@types/jest": "^29.5.12",
"eslint": "^8.57.0",
"jest": "^29.7.0",
"prettier": "^3.2.5",
"prettier": "^3.3.3",
"ts-jest": "^29.2.4",
"typescript": "^5.5.4"
}
Expand Down
12 changes: 6 additions & 6 deletions packages/template/src/maint.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// importing these from globals is optional
import {describe, expect, test} from '@jest/globals';
import { describe, expect, test } from "@jest/globals";

import * as main from './main'
import * as main from "./main";

describe('main',()=>{
test("should return true",async ()=>{
describe("main", () => {
test("should return true", async () => {
const result = await main.Main({});
expect(result).toBe(true);
})
})
});
});
Loading

0 comments on commit 381af2d

Please sign in to comment.