Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(internals): implemented turbo watch on dev command #258

Merged
merged 2 commits into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/silent-balloons-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'eslint-config-sheriff': patch
'@sherifforg/create-config': patch
'@sheriff/utils': patch
---

chore(internals): implemented turbo watch on dev command
Fixes #227
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
"name": "sheriff-monorepo",
"private": true,
"scripts": {
"dev": "turbo watch build-watch start",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I ask why you couldn't just watch build, but needed a new task? Just curious. :)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lishaduck actually cannot remember. Looking at it now, indeed i dont see much sense for it.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lishaduck actually, after revisioning this, yes, there is a reason for this.
Docs and webservices also have build command, but we dont want to rebuild them in dev, we want to just use the start command on them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I realized that when I tried to fix it. Turbo did just add a way to do it, though it's not released yet: vercel/turborepo#9339 (comment).

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, to be fair, i stopped using the watch command because it is broken (atleast on my Windows machine). Not sure what the problem is. It's unconvenient, but nothing major, i just have to rebuild the docs manually whenever i change a package.
I'll fix this sometimes.

"build": "turbo run build",
"start:docs": "turbo run start --filter=docs-website --filter=sheriff-webservices",
"playground": "pnpm --filter=cli-playground exec create-config",
"playground:mimic-monorepo": "pnpm exec create-config --filter=cli-playground",
"webservices:dev": "turbo run start --filter=sheriff-webservices",
"webservices:deploy": "turbo run serve --filter=sheriff-webservices",
"preview-docs": "turbo run serve --filter=docs-website",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
Expand Down Expand Up @@ -35,7 +34,7 @@
"@turbo/gen": "^2.0.9",
"knip": "^5.25.1",
"prettier": "^3.3.2",
"turbo": "^2.0.9",
"turbo": "^2.1.2",
"typesync": "^0.13.0"
},
"packageManager": "[email protected]",
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-config-sheriff/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"preinstall": "npx only-allow pnpm",
"clean": "rm -rf .turbo dist",
"build": "tsup",
"build-watch": "tsup",
"typecheck": "tsc --noEmit",
"publint": "publint",
"typesync": "typesync --dry=fail",
Expand Down
1 change: 1 addition & 0 deletions packages/sheriff-create-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"dev": "tsx ./src/index.ts",
"clean": "rm -rf .turbo dist",
"build": "tsup",
"build-watch": "tsup",
"typecheck": "tsc --noEmit",
"lint": "eslint . --max-warnings=0 --cache --cache-location=node_modules/.cache/.eslintcache",
"publint": "publint",
Expand Down
1 change: 0 additions & 1 deletion packages/sheriff-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
}
},
"scripts": {
"start": "tsx watch ./src/generateRulesDataset.ts",
"rulesgen": "tsx ./src/generateRulesDataset.ts",
"publint": "publint",
"clean": "rm -rf .turb dist"
Expand Down
58 changes: 29 additions & 29 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
"dependsOn": ["^build"],
"outputs": [".docusaurus/**", "dist/**"]
},
"build-watch": {
"dependsOn": ["^build"],
"outputs": ["dist/**"]
},
"start": {
"cache": false,
"persistent": true,
Expand Down