Skip to content

Commit

Permalink
chore: bump deps and fix hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
gengjiawen committed Sep 29, 2021
1 parent 27bee51 commit 0419d0b
Show file tree
Hide file tree
Showing 6 changed files with 385 additions and 490 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn format
2 changes: 1 addition & 1 deletion libs/entity/urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ export class Urls extends BaseEntity {
@CreateDateColumn()
created_at!: Date

@UpdateDateColumn({ onUpdate: "CURRENT_TIMESTAMP" })
@UpdateDateColumn({ onUpdate: 'CURRENT_TIMESTAMP' })
updated_at!: Date
}
10 changes: 8 additions & 2 deletions libs/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import * as fs from 'fs'
import { getArticle, getData, getUrlEntity, initDB, patchDom, toMarkdown } from './index'
import {
getArticle,
getData,
getUrlEntity,
initDB,
patchDom,
toMarkdown,
} from './index'

try {
fs.mkdirSync('build')
} catch (error) {}


test('test record update', async () => {
let url = 'https://httpbin.org/get'
await initDB()
Expand Down
2 changes: 1 addition & 1 deletion libs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export async function getData(url: string, options?: CrawlerOptions) {
content = JSON.stringify(content)
}
if (cache) {
const urls = getUrlEntity();
const urls = getUrlEntity()
const record = urls.create({
url,
content,
Expand Down
18 changes: 8 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"format": "prettier --write \"{examples,libs,script,test,bin}/**/*.{js,ts}\" \"*.yml\"",
"format:check": "prettier --list-different \"{examples,libs,script,test,bin}/**/*.{js,ts}\" \"*.yml\"",
"test": "jest",
"build": "npm run clean && tsc -p ./tsconfig.json"
"build": "npm run clean && tsc -p ./tsconfig.json",
"prepare": "husky install"
},
"dependencies": {
"@mozilla/readability": "^0.4.1",
Expand All @@ -39,18 +40,15 @@
"access": "public"
},
"devDependencies": {
"@types/jest": "27.0.1",
"@types/node": "16.7.13",
"jest": "27.1.0",
"@types/jest": "27.0.2",
"@types/node": "16.10.1",
"jest": "27.2.3",
"lint-staged": "^11.1.2",
"prettier": "2.3.2",
"prettier": "2.4.1",
"rimraf": "3.0.2",
"ts-jest": "27.0.5",
"typescript": "4.4.2",
"yorkie": "^2.0.0"
},
"gitHooks": {
"pre-commit": "lint-staged"
"typescript": "4.4.3",
"husky": "^7.0.2"
},
"lint-staged": {
"*.{js,ts,tsx,md,css,html,yml}": [
Expand Down
Loading

0 comments on commit 0419d0b

Please sign in to comment.