From 68b963021cd0074ab8b20215c00f8a5f181f2fcb Mon Sep 17 00:00:00 2001 From: Andrea Carraro Date: Fri, 5 Jul 2024 12:37:50 +0200 Subject: [PATCH] chore: refactor npm scripts (#60) --- package.json | 13 ++++++++----- tsconfig.json | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index eef7694..ab95a21 100644 --- a/package.json +++ b/package.json @@ -15,12 +15,15 @@ "preversion": "npm run prepare", "version": "git add package.json", "postversion": "git push && git push --tags", - "prepare": "npx simple-git-hooks && npm run test:source && npm run build && npm run test:bundles", - "test": "jest", - "test:source": "npm t -- --coverage", + "prepare": "npx simple-git-hooks && npm run source:check && npm run test && npm run build && npm run test:bundles", + "test": "jest --coverage", "test:bundles": "es-check es5 --module './@(dist)/*.js'", "tag": "node ./scripts/tag.js", - "format": "prettier --write \"**/*.{js,json,md}\"", + "prettier:check": "prettier . --check", + "prettier:fix": "npm run prettier:check -- --write", + "type:check": "tsc --noEmit", + "source:check": "npm run prettier:check && npm run type:check", + "source:fix": "npm run prettier:fix", "start": "npm run demo:start", "demo:start": "cd ./demo && next", "demo:build": "npm run build && cd ./demo && BUILD_TARGET=github-pages next build && touch ./out/.nojekyll" @@ -82,6 +85,6 @@ "testEnvironment": "jsdom" }, "simple-git-hooks": { - "pre-commit": "npm run test:source" + "pre-commit": "npm run source:check && npm run test" } } diff --git a/tsconfig.json b/tsconfig.json index a518bd4..8aafc84 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,5 +11,5 @@ "allowJs": true, "jsx": "react" }, - "include": ["./src", "./demo"] + "include": ["./src"] }