Skip to content

Commit

Permalink
Minor cleanup, task consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
spautz committed Sep 2, 2024
1 parent 10b0fc9 commit 5b763e3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 24 deletions.
6 changes: 1 addition & 5 deletions docs-website/src/pages/demo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,9 @@ export const LiveDemoArea = () => {
// React in Production mode gives us a default export, which causes a syntax error with 'react-live'
// when it tries to bind a local variable for its scope.
delete demoScope.default;

return (
<section>
<LiveProvider
code={demoCode}
scope={demoScope}
>
<LiveProvider code={demoCode} scope={demoScope}>
<LiveEditor />
<LiveError />
<div className="padding-vert--md">
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"changelog:status": "changeset status --verbose",
"changelog:status:ci": "changeset status --since=origin/main --verbose",
"clean": "pnpm run w:test:clean && rimraf --glob ./node_modules/.cache ./.turbo/{cache,runs,*.log} ./*.log && pnpm --parallel -r run clean",
"dev": "turbo run dev",
"docs": "pnpm run --filter=./docs-website dev",
"format": "prettier --write .",
"format:verify": "prettier --list-different .",
Expand All @@ -55,11 +54,10 @@
"w:test:watch": "pnpm run w:test:clean && vitest watch --coverage",
"w:test:ui": "pnpm run w:test:clean && vitest --ui",
"w:typecheck": "tsc -p ./tsconfig.json --noEmit",
"____ UNIFIED COMMANDS ______________________________________________": "",
"____ PACKAGE + WORKSPACE COMMANDS __________________________________": "",
"all": "turbo run w:pipeline-all",
"all:ci": "turbo run w:pipeline-ci",
"all:all": "turbo run pipeline-all w:pipeline-all",
"build": "turbo run build",
"lint": "turbo run w:lint",
"lint:fix": "turbo run w:lint:fix",
"test": "turbo run w:test",
Expand Down
44 changes: 28 additions & 16 deletions turbo.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"$schema": "https://turbo.build/schema.json",
"tasks": {
// Abstract tasks
// Batch scripts: run a series of checks for the package
"pipeline-all": {
"dependsOn": ["typecheck", "lint:fix", "test", "build"]
},
"pipeline-ci": {
"dependsOn": ["typecheck", "lint", "test:ci", "build"]
},
// Workspace batch scripts: run workspace checks (which also run package checks, since the workspace checks
// depends on them), and then run all packages' builds
"//#w:pipeline-all": {
"dependsOn": [
"//#format",
Expand All @@ -26,22 +28,18 @@
"@spautz/all-packages#build"
]
},
"dependencies": {
"dependsOn": ["^build"]
},
"topo": {
"dependsOn": ["^topo"]
},

// Standalone workspace tasks
// Formatting depends on everything, but doesn't run anything in those dependencies
"//#format": {
"dependsOn": ["@spautz/all-packages#topo"]
},
"//#format:verify": {
"dependsOn": ["@spautz/all-packages#topo"]
},

// Workspace tasks that overlap with package tasks
// Workspace tasks that depend on package tasks
// When the packages have their own overlapping tasks, those task are run first, as dependencies,
// so that future changes at the package level will invalidate at the workspace level
"//#w:lint": {
"dependsOn": ["@spautz/all-packages#lint"]
},
Expand All @@ -58,30 +56,44 @@
},
"//#w:test:watch": {
"dependsOn": ["@spautz/all-packages#dependencies"],
"outputs": ["coverage/**"]
"cache": false,
"persistent": true
},
"//#w:test:ui": {
"dependsOn": ["@spautz/all-packages#dependencies"],
"outputs": ["coverage/**"]
"cache": false,
"persistent": true
},
"//#w:typecheck": {
"dependsOn": ["@spautz/all-packages#typecheck"]
},

// Package tasks
// Core package tasks:
// Dependencies require a concrete build
"dependencies": {
"dependsOn": ["^build"]
},
// Topographic dependencies are abstract, since there's no 'topo' task to run
"topo": {
"dependsOn": ["^topo"]
},

// Individual/standalone package tasks
"build": {
"dependsOn": ["dependencies"],
"outputs": [".next/**", "!.next/cache/**", "build/**", "dist/**"]
},
"build:watch": {
"dependsOn": ["dependencies"],
"cache": false,
"persistent": true
"persistent": true,
"interactive": true
},
"dev": {
"dependsOn": ["dependencies"],
"cache": false,
"persistent": true
"persistent": true,
"interactive": true
},
"lint": {},
"lint:fix": {},
Expand All @@ -99,8 +111,8 @@
"test:watch": {
"dependsOn": ["dependencies"],
"cache": false,
"interactive": true,
"persistent": true
"persistent": true,
"interactive": true
}
}
}

0 comments on commit 5b763e3

Please sign in to comment.