Skip to content

Commit

Permalink
Improve Turbo deps & caching rules (faster builds, lints, etc.)
Browse files Browse the repository at this point in the history
Fixes #137
  • Loading branch information
benvinegar committed Dec 29, 2024
1 parent 7a4de15 commit 7806efa
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
14 changes: 4 additions & 10 deletions packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,21 @@
"sideEffects": false,
"type": "module",
"version": "2.3.0",
"engines": {
"node": ">=20.0.0"
},
"scripts": {
"predev": "npm run copy-tracker",
"dev": "remix vite:dev",
"prebuild": "npm run copy-tracker",
"build": "remix vite:build",
"prepreview": "remix vite:build",
"preview": "wrangler pages dev ./build/client",
"predeploy": "npm run build",
"deploy": "wrangler pages deploy ./build/client",
"prelint": "npm run build",
"lint": "eslint --ignore-path ../../.gitignore --cache --cache-location ./node_modules/.cache/eslint .",
"test": "TZ=EST vitest run",
"test-ci": "TZ=EST vitest run --coverage",
"pretypecheck": "npm run build",
"typecheck": "tsc",
"prepare": "husky",
"types:gen": "wrangler types",
"copy-tracker": "cp ../tracker/dist/tracker.js ./public/tracker.js"
"copytracker": "cp ../tracker/dist/tracker.js ./public/tracker.js"
},
"dependencies": {
"@cloudflare/kv-asset-handler": "^0.3.3",
Expand Down Expand Up @@ -79,9 +76,6 @@
"vitest-dom": "^0.1.1",
"wrangler": "^3.61.0"
},
"engines": {
"node": ">=20.0.0"
},
"postcss": {
"plugins": {
"tailwindcss": {},
Expand Down
1 change: 0 additions & 1 deletion packages/tracker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"scripts": {
"build": "vite build",
"lint": "eslint --ignore-path ../../.gitignore --cache --cache-location ./node_modules/.cache/eslint .",
"pretest": "npm run build",
"test": "playwright test",
"start": "node ./integration/server.cjs",
"typecheck": "tsc"
Expand Down
17 changes: 13 additions & 4 deletions turbo.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
{
"$schema": "https://turbo.build/schema.json",
"tasks": {
"build": {
"dependsOn": ["^build"],
"inputs": ["$TURBO_DEFAULT$", ".env*"]
"@counterscale/tracker#build": {
"outputs": ["dist/**"]
},
"@counterscale/server#build": {
"dependsOn": ["^build", "@counterscale/server#copytracker"],
"inputs": ["$TURBO_DEFAULT$", ".dev.vars"],
"outputs": ["build/**"]
},
"@counterscale/server#copytracker": {
"dependsOn": ["^@counterscale/tracker#build"],
"outputs": ["public/tracker.js"]
},
"dev": {
"dependsOn": ["build"],
"dependsOn": ["^@counterscale/server#copytracker"],
"inputs": ["$TURBO_DEFAULT$", ".dev.vars"],
"cache": false,
"persistent": true
},
Expand Down

0 comments on commit 7806efa

Please sign in to comment.