From de032905c07d1b039f1560b90f78bf731e1d066a Mon Sep 17 00:00:00 2001 From: Dimitar Kalaydzhiev Date: Mon, 17 Jun 2024 13:52:05 +0300 Subject: [PATCH] chore: setup tasks --- nx.json | 44 ++++++++++++++++++++++++++++++++++++++++++-- package.json | 33 +++++++++++++-------------------- 2 files changed, 55 insertions(+), 22 deletions(-) diff --git a/nx.json b/nx.json index e81c17f3ffc..89fe3f2f5b2 100644 --- a/nx.json +++ b/nx.json @@ -1,4 +1,44 @@ { "$schema": "./node_modules/nx/schemas/nx-schema.json", - "defaultBase": "develop" -} \ No newline at end of file + "defaultBase": "develop", + "workspaceLayout": { + "libsDir": "packages" + }, + "targetDefaults": { + "lint": { + "cache": true, + "executor": "nx:run-script", + "options": { + "script": "lint" + } + }, + "build": { + "cache": true + }, + "build:tests": { + "cache": true + }, + "sass": { + "cache": true, + "outputs": [ + "{projectRoot}/dist/**/*.css" + ] + }, + "sass:flat": { + "cache": true, + "outputs": [ + "{projectRoot}/dist/**/*.scss" + ] + }, + "sass:swatches": { + "cache": true, + "outputs": [ + "{projectRoot}/dist/**/*.css", + "{projectRoot}/dist/**/*.scss" + ] + }, + "docs": { + "cache": true + } + } +} diff --git a/package.json b/package.json index a81c63fcad0..eadd3aaef51 100644 --- a/package.json +++ b/package.json @@ -56,30 +56,24 @@ "scripts": { "prepare": "husky install", "start": "node ./scripts/start-dev-server.js", - - "build": "npm run build -w packages/html", - "build:tests": "npm run build:tests -w packages/html", - - "sass": "npm run sass -ws --if-present", - "sass:flat": "npm run sass:flat -ws --if-present", - "sass:swatches": "npm run sass:swatches -ws --if-present", - "sass:swatches:dist": "npm run sass:swatches:dist -ws --if-present", - "sass:standalone": "npm run sass:standalone -ws --if-present", - "lint": "npm run lint:scripts && npm run lint:styles", "lint:scripts": "eslint \"**/*.{js,jsx,ts,tsx,mjs}\"", "lint:styles": "stylelint \"**/*.scss\"", "lint:staged": "lint-staged --verbose", - - "docs": "npm run docs -ws --if-present", - "docs:check": "npm run docs -ws --if-present -- git diff --exit-code --quiet -- docs/", - + "build": "nx run @progress/kendo-themes-html:build", + "build:tests": "nx run @progress/kendo-themes-html:build:tests", + "sass": "nx run-many -t sass", + "sass:flat": "nx run-many -t sass:flat", + "sass:swatches": "nx run-many -t sass:swatches", + "sass:swatches:dist": "nx run-many -t sass:swatches:dist", + "sass:standalone": "nx run-many -t sass:standalone", + "docs": "nx run-many -t docs", + "docs:check": "npm run docs -- git diff --exit-code -- docs/", + "test:render-test-pages": "node ./scripts/render-test-pages.mjs", "test:contrast": "node ./scripts/test-contrast.mjs", - "test:integrations": "npm run build --prefix integrations", "test:create-screenshots": "./build/create-screenshots.sh", - "test:render-test-pages": "node ./scripts/render-test-pages.mjs", - - "clean": "find . -name \"node_modules\" -type d -prune | xargs rm -rf", + "test:integrations": "npm run build --prefix integrations", + "clean": "nx reset && find . -name \"node_modules\" -type d -prune | xargs rm -rf", "clean:dist": "find ./packages -name \"dist\" -type d -prune -maxdepth 2 | xargs rm -rf", "clean:tests": "node ./scripts/cleanup-test-results.js" }, @@ -89,6 +83,5 @@ "lint-staged": { "*.{js,jsx,ts,tsx,mjs}": "eslint", "*.{css,scss}": "stylelint" - }, - "nx": {} + } }