Repository: sveltejs/kit
Pull request #8732 (2023-01-26 00:34:20)

chore: remove turbo
The caching that Turbo offers does not buy us a lot. If I change any code or tests I want the tests to run and not be cached. If I just change the docs, I don't necessarily need to wait for the tests to finish running before merging, so the caching isn't much of a win.

While using Turbo does not provide much benefit for our particular use case, it does impose significant costs. The configuration is inherently brittle - it's easy to add something that's written to disk, change project configuration, etc. and forget to update the Turbo config or incorrectly update it. It's extremely difficult to debug. There have been numerous occasions where we see that it's just returning from cache rather than rerunning and it's impossible to tell why it's made the decision that it has and whether it's a misconfiguration on our part or a bug in Turbo. Even when the caching works, it can sometimes be frustrating - e.g. it becomes very difficult to tell if I've fixed a flaky test because I can't just rerun the tests since they will just return from the cache.

There was recently a proposal to setup Nx for Vite and the Vite team decided they didn't yet need the extra layer of complexity. I think that'd be a good call for us too. We don't have a build step, so we don't have much need for caching. There are a few hard things in computer science like naming things and caching. Let's remove this source of difficulty

[What Vite did instead](https://github.com/vitejs/vite/pull/11548) was just check for changed files. If we do need some sort of perf boost, I think that would be a simpler solution in our case. Since we don't have a build step, we don't need to retrieve the output of any build jobs, so it removes the need to talk to external services, etc. But I'm not sure we need even that extra layer of complexity

changeset-bot[bot]: ###  ⚠️  No Changeset found

Latest commit: 90825b822e90842c9454fcb3c64e3e5c4cdca68b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. **If these changes should result in a version bump, you need to add a changeset.**

<details><summary>This PR includes no changesets</summary>

  When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

</details>

[Click here to learn what changesets are, and how to add one](https://github.com/changesets/changesets/blob/master/docs/adding-a-changeset.md).

[Click here if you're a maintainer who wants to add a changeset to this PR](https://github.com/sveltejs/kit/new/rm-turbo?filename=.changeset/spicy-horses-drive.md&value=---%0A%0A---%0A%0Achore%3A%20remove%20turbo%0A)



Patch:
diff --git a/.changeset/heavy-poems-retire.md b/.changeset/heavy-poems-retire.md
deleted file mode 100644
index 161890a71..000000000
--- a/.changeset/heavy-poems-retire.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@sveltejs/kit': patch
----
-
-fix: only fetch `__data.json` files for routes with a server `load` function
diff --git a/.changeset/nervous-bags-jog.md b/.changeset/nervous-bags-jog.md
deleted file mode 100644
index 97160be2a..000000000
--- a/.changeset/nervous-bags-jog.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@sveltejs/kit': patch
----
-
-fix: add `ignoreDeprecations` flag for TS 5.x
diff --git a/.changeset/young-planes-flash.md b/.changeset/young-planes-flash.md
deleted file mode 100644
index cdc2e8f35..000000000
--- a/.changeset/young-planes-flash.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@sveltejs/kit': patch
----
-
-fix: install polyfills when analysing code
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 1e96eb26a..ce20c4a0e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -7,8 +7,6 @@ on:
   pull_request:
 
 env:
-  TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
-  TURBO_TEAM: svelte
   # we call `pnpm playwright install` instead
   PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
 
@@ -31,7 +29,8 @@ jobs:
           node-version: '16.x'
           cache: pnpm
       - run: pnpm install --frozen-lockfile
-      - run: pnpm turbo run lint check
+      - run: pnpm run lint
+      - run: pnpm run check
   Tests:
     runs-on: ${{ matrix.os }}
     timeout-minutes: 30
@@ -46,7 +45,6 @@ jobs:
             os: ubuntu-latest
             e2e-browser: 'chromium'
     env:
-      TURBO_CACHE_KEY: ${{ matrix.os }}-${{ matrix.node-version }}
       KIT_E2E_BROWSER: ${{matrix.e2e-browser}}
     steps:
       - run: git config --global core.autocrlf false
@@ -84,7 +82,6 @@ jobs:
             os: macOS-latest
             e2e-browser: 'webkit'
     env:
-      TURBO_CACHE_KEY: ${{ matrix.os }}-${{ matrix.node-version }}
       KIT_E2E_BROWSER: ${{matrix.e2e-browser}}
     steps:
       - run: git config --global core.autocrlf false
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 1403abb6b..c6e40316e 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -5,11 +5,6 @@ on:
     branches:
       - master
 
-env:
-  TURBO_CACHE_KEY: ubuntu-latest-16 # reuse cache key from ci workflow
-  TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
-  TURBO_TEAM: svelte
-
 permissions: {}
 jobs:
   release:
diff --git a/package.json b/package.json
index 190a29e70..c4f878da5 100644
--- a/package.json
+++ b/package.json
@@ -4,13 +4,13 @@
 	"description": "monorepo for @sveltejs/kit and friends",
 	"private": true,
 	"scripts": {
-		"test": "turbo run test --filter=./packages/* --force",
-		"test:cross-platform": "turbo run test:cross-platform --filter=./packages/* --force",
+		"test": "pnpm test -r --filter=./packages/*",
+		"test:cross-platform": "pnpm -r test:cross-platform --filter=./packages/*",
 		"test:vite-ecosystem-ci": "pnpm test --dir packages/kit",
-		"check": "turbo run check --force",
-		"lint": "turbo run lint --force",
-		"format": "turbo run format",
-		"precommit": "turbo run precommit",
+		"check": "pnpm -r check",
+		"lint": "pnpm -r lint",
+		"format": "pnpm -r format",
+		"precommit": "pnpm format && pnpm lint",
 		"release": "changeset publish"
 	},
 	"repository": {
@@ -34,7 +34,6 @@
 		"rollup": "^3.7.0",
 		"svelte": "^3.55.1",
 		"tiny-glob": "^0.2.9",
-		"turbo": "^1.6.3",
 		"typescript": "^4.9.4"
 	},
 	"packageManager": "pnpm@7.26.0",
diff --git a/packages/kit/CHANGELOG.md b/packages/kit/CHANGELOG.md
index dde596b85..bd3fbd2cd 100644
--- a/packages/kit/CHANGELOG.md
+++ b/packages/kit/CHANGELOG.md
@@ -1,5 +1,15 @@
 # @sveltejs/kit
 
+## 1.3.1
+
+### Patch Changes
+
+- fix: only fetch `__data.json` files for routes with a server `load` function ([#8636](https://github.com/sveltejs/kit/pull/8636))
+
+- fix: add `ignoreDeprecations` flag for TS 5.x ([#8718](https://github.com/sveltejs/kit/pull/8718))
+
+- fix: install polyfills when analysing code ([#8636](https://github.com/sveltejs/kit/pull/8636))
+
 ## 1.3.0
 
 ### Minor Changes
diff --git a/packages/kit/package.json b/packages/kit/package.json
index 1a9ef0f44..bbf858c0e 100644
--- a/packages/kit/package.json
+++ b/packages/kit/package.json
@@ -1,6 +1,6 @@
 {
 	"name": "@sveltejs/kit",
-	"version": "1.3.0",
+	"version": "1.3.1",
 	"repository": {
 		"type": "git",
 		"url": "https://github.com/sveltejs/kit",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 1c1c6a00c..a1b2e8931 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -14,7 +14,6 @@ importers:
       rollup: ^3.7.0
       svelte: ^3.55.1
       tiny-glob: ^0.2.9
-      turbo: ^1.6.3
       typescript: ^4.9.4
     devDependencies:
       '@changesets/cli': 2.25.2
@@ -27,7 +26,6 @@ importers:
       rollup: 3.7.0
       svelte: 3.55.1
       tiny-glob: 0.2.9
-      turbo: 1.6.3
       typescript: 4.9.4
 
   packages/adapter-auto:
@@ -4389,67 +4387,6 @@ packages:
       safe-buffer: 5.2.1
     dev: true
 
-  /turbo-darwin-64/1.6.3:
-    resolution: {integrity: sha512-QmDIX0Yh1wYQl0bUS0gGWwNxpJwrzZU2GIAYt3aOKoirWA2ecnyb3R6ludcS1znfNV2MfunP+l8E3ncxUHwtjA==}
-    cpu: [x64]
-    os: [darwin]
-    requiresBuild: true
-    dev: true
-    optional: true
-
-  /turbo-darwin-arm64/1.6.3:
-    resolution: {integrity: sha512-75DXhFpwE7CinBbtxTxH08EcWrxYSPFow3NaeFwsG8aymkWXF+U2aukYHJA6I12n9/dGqf7yRXzkF0S/9UtdyQ==}
-    cpu: [arm64]
-    os: [darwin]
-    requiresBuild: true
-    dev: true
-    optional: true
-
-  /turbo-linux-64/1.6.3:
-    resolution: {integrity: sha512-O9uc6J0yoRPWdPg9THRQi69K6E2iZ98cRHNvus05lZbcPzZTxJYkYGb5iagCmCW/pq6fL4T4oLWAd6evg2LGQA==}
-    cpu: [x64]
-    os: [linux]
-    requiresBuild: true
-    dev: true
-    optional: true
-
-  /turbo-linux-arm64/1.6.3:
-    resolution: {integrity: sha512-dCy667qqEtZIhulsRTe8hhWQNCJO0i20uHXv7KjLHuFZGCeMbWxB8rsneRoY+blf8+QNqGuXQJxak7ayjHLxiA==}
-    cpu: [arm64]
-    os: [linux]
-    requiresBuild: true
-    dev: true
-    optional: true
-
-  /turbo-windows-64/1.6.3:
-    resolution: {integrity: sha512-lKRqwL3mrVF09b9KySSaOwetehmGknV9EcQTF7d2dxngGYYX1WXoQLjFP9YYH8ZV07oPm+RUOAKSCQuDuMNhiA==}
-    cpu: [x64]
-    os: [win32]
-    requiresBuild: true
-    dev: true
-    optional: true
-
-  /turbo-windows-arm64/1.6.3:
-    resolution: {integrity: sha512-BXY1sDPEA1DgPwuENvDCD8B7Hb0toscjus941WpL8CVd10hg9pk/MWn9CNgwDO5Q9ks0mw+liDv2EMnleEjeNA==}
-    cpu: [arm64]
-    os: [win32]
-    requiresBuild: true
-    dev: true
-    optional: true
-
-  /turbo/1.6.3:
-    resolution: {integrity: sha512-FtfhJLmEEtHveGxW4Ye/QuY85AnZ2ZNVgkTBswoap7UMHB1+oI4diHPNyqrQLG4K1UFtCkjOlVoLsllUh/9QRw==}
-    hasBin: true
-    requiresBuild: true
-    optionalDependencies:
-      turbo-darwin-64: 1.6.3
-      turbo-darwin-arm64: 1.6.3
-      turbo-linux-64: 1.6.3
-      turbo-linux-arm64: 1.6.3
-      turbo-windows-64: 1.6.3
-      turbo-windows-arm64: 1.6.3
-    dev: true
-
   /type-fest/0.13.1:
     resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==}
     engines: {node: '>=10'}
diff --git a/turbo.json b/turbo.json
deleted file mode 100644
index 7a422b757..000000000
--- a/turbo.json
+++ /dev/null
@@ -1,73 +0,0 @@
-{
-	"$schema": "https://turborepo.org/schema.json",
-	"pipeline": {
-		"kit.svelte.dev#build": {
-			"dependsOn": ["^build"],
-			"inputs": ["src/**", "../../packages/kit/docs/**", "../../documentation/**"],
-			"outputs": [".vercel/output/**"],
-			"outputMode": "new-only",
-			"env": ["VERCEL"]
-		},
-		"create-svelte#build": {
-			"dependsOn": ["^build"],
-			"inputs": ["src/**", "scripts/**", "shared/**", "templates/**"],
-			"outputs": ["dist/**"],
-			"outputMode": "new-only",
-			"env": ["VERCEL"]
-		},
-		"build": {
-			"dependsOn": ["^build"],
-			"inputs": ["src/**"],
-			"outputs": ["files/**", "dist/**", ".svelte-kit/**", ".vercel/output/**"],
-			"outputMode": "new-only",
-			"env": ["VERCEL"]
-		},
-		"check": {
-			"inputs": [
-				"index.js",
-				"index.d.ts",
-				"ambient.d.ts",
-				"src/**",
-				"source/**",
-				"types/**",
-				".svelte-kit/types/**",
-				".custom-out-dir/types/**",
-				".svelte-kit/tsconfig.json"
-			],
-			"outputs": [],
-			"outputMode": "new-only"
-		},
-		"format": {
-			"cache": false,
-			"outputs": [],
-			"outputMode": "new-only"
-		},
-		"test": {
-			"dependsOn": ["^build"],
-			"inputs": ["src/**", "scripts/**", "shared/**", "templates/**", "test/**"],
-			"outputs": ["coverage/", "test-results/**"],
-			"outputMode": "new-only",
-			"env": ["CI", "TURBO_CACHE_KEY"]
-		},
-		"test:cross-platform": {
-			"inputs": ["src/**", "scripts/**", "shared/**", "templates/**", "test/**"],
-			"outputs": ["coverage/", "test-results/**"],
-			"outputMode": "new-only",
-			"env": ["CI", "TURBO_CACHE_KEY"]
-		},
-		"lint": {
-			"outputs": [],
-			"outputMode": "new-only"
-		},
-		"precommit": {
-			"dependsOn": ["format", "lint"],
-			"outputs": [],
-			"outputMode": "new-only"
-		},
-		"dev": {
-			"cache": false,
-			"outputMode": "new-only"
-		}
-	},
-	"globalDependencies": [".eslintrc.json", ".prettierrc", "tsconfig.json"]
-}


Test patch:
diff --git a/packages/kit/test/build-errors/env.spec.js b/packages/kit/test/build-errors/env.spec.js
index c0fec16a4..929d32136 100644
--- a/packages/kit/test/build-errors/env.spec.js
+++ b/packages/kit/test/build-errors/env.spec.js
@@ -9,7 +9,7 @@ test('$env/dynamic/private is not statically importable from the client', () =>
 			execSync('pnpm build', {
 				cwd: path.join(process.cwd(), 'apps/private-dynamic-env'),
 				stdio: 'pipe',
-				timeout: 15000
+				timeout: 60000
 			}),
 		/.*Cannot import \0\$env\/dynamic\/private into client-side code:.*/gs
 	);
@@ -21,7 +21,7 @@ test('$env/dynamic/private is not dynamically importable from the client', () =>
 			execSync('pnpm build', {
 				cwd: path.join(process.cwd(), 'apps/private-dynamic-env-dynamic-import'),
 				stdio: 'pipe',
-				timeout: 15000
+				timeout: 60000
 			}),
 		/.*Cannot import \0\$env\/dynamic\/private into client-side code:.*/gs
 	);
@@ -33,7 +33,7 @@ test('$env/static/private is not statically importable from the client', () => {
 			execSync('pnpm build', {
 				cwd: path.join(process.cwd(), 'apps/private-static-env'),
 				stdio: 'pipe',
-				timeout: 15000
+				timeout: 60000
 			}),
 		/.*Cannot import \0\$env\/static\/private into client-side code:.*/gs
 	);
@@ -45,7 +45,7 @@ test('$env/static/private is not dynamically importable from the client', () =>
 			execSync('pnpm build', {
 				cwd: path.join(process.cwd(), 'apps/private-static-env-dynamic-import'),
 				stdio: 'pipe',
-				timeout: 15000
+				timeout: 60000
 			}),
 		/.*Cannot import \0\$env\/static\/private into client-side code:.*/gs
 	);
diff --git a/packages/kit/test/build-errors/prerender.spec.js b/packages/kit/test/build-errors/prerender.spec.js
index d646b9990..e71ad1226 100644
--- a/packages/kit/test/build-errors/prerender.spec.js
+++ b/packages/kit/test/build-errors/prerender.spec.js
@@ -9,7 +9,7 @@ test('prerenderable routes must be prerendered', () => {
 			execSync('pnpm build', {
 				cwd: path.join(process.cwd(), 'apps/prerenderable-not-prerendered'),
 				stdio: 'pipe',
-				timeout: 15000
+				timeout: 60000
 			}),
 		/The following routes were marked as prerenderable, but were not prerendered because they were not found while crawling your app:\r?\n  - \/\[x\]/gs
 	);
diff --git a/packages/kit/test/build-errors/server-only.spec.js b/packages/kit/test/build-errors/server-only.spec.js
index 7e620820e..c84ca3bb5 100644
--- a/packages/kit/test/build-errors/server-only.spec.js
+++ b/packages/kit/test/build-errors/server-only.spec.js
@@ -4,51 +4,71 @@ import { execSync } from 'node:child_process';
 import path from 'node:path';
 
 test('$lib/*.server.* is not statically importable from the client', () => {
-	assert.throws(
-		() =>
-			execSync('pnpm build', {
-				cwd: path.join(process.cwd(), 'apps/server-only-module'),
-				stdio: 'pipe',
-				timeout: 15000
-			}),
-		/.*Cannot import \$lib\/test.server.js into client-side code:.*/gs
-	);
+	try {
+		execSync('pnpm build', {
+			cwd: path.join(process.cwd(), 'apps/server-only-module'),
+			stdio: 'pipe',
+			timeout: 60000
+		});
+	} catch (err) {
+		assert.ok(
+			err.message.includes('Cannot import $lib/test.server.js into client-side code'),
+			`received unexpected exception message ${err.message}`
+		);
+		return;
+	}
+	assert.unreachable();
 });
 
 test('$lib/*.server.* is not dynamically importable from the client', () => {
-	assert.throws(
-		() =>
-			execSync('pnpm build', {
-				cwd: path.join(process.cwd(), 'apps/server-only-module-dynamic-import'),
-				stdio: 'pipe',
-				timeout: 15000
-			}),
-		/.*Cannot import \$lib\/test.server.js into client-side code:.*/gs
-	);
+	try {
+		execSync('pnpm build', {
+			cwd: path.join(process.cwd(), 'apps/server-only-module-dynamic-import'),
+			stdio: 'pipe',
+			timeout: 60000
+		});
+	} catch (err) {
+		assert.ok(
+			err.message.includes('Cannot import $lib/test.server.js into client-side code'),
+			`received unexpected exception message ${err.message}`
+		);
+		return;
+	}
+	assert.unreachable();
 });
 
 test('$lib/server/* is not statically importable from the client', () => {
-	assert.throws(
-		() =>
-			execSync('pnpm build', {
-				cwd: path.join(process.cwd(), 'apps/server-only-folder'),
-				stdio: 'pipe',
-				timeout: 15000
-			}),
-		/.*Cannot import \$lib\/server\/something\/test.js into client-side code:.*/gs
-	);
+	try {
+		execSync('pnpm build', {
+			cwd: path.join(process.cwd(), 'apps/server-only-folder'),
+			stdio: 'pipe',
+			timeout: 60000
+		});
+	} catch (err) {
+		assert.ok(
+			err.message.includes('Cannot import $lib/server/something/test.js into client-side code'),
+			`received unexpected exception message ${err.message}`
+		);
+		return;
+	}
+	assert.unreachable();
 });
 
 test('$lib/server/* is not dynamically importable from the client', () => {
-	assert.throws(
-		() =>
-			execSync('pnpm build', {
-				cwd: path.join(process.cwd(), 'apps/server-only-folder-dynamic-import'),
-				stdio: 'pipe',
-				timeout: 15000
-			}),
-		/.*Cannot import \$lib\/server\/something\/test.js into client-side code:.*/gs
-	);
+	try {
+		execSync('pnpm build', {
+			cwd: path.join(process.cwd(), 'apps/server-only-folder-dynamic-import'),
+			stdio: 'pipe',
+			timeout: 60000
+		});
+	} catch (err) {
+		assert.ok(
+			err.message.includes('Cannot import $lib/server/something/test.js into client-side code'),
+			`received unexpected exception message ${err.message}`
+		);
+		return;
+	}
+	assert.unreachable();
 });
 
 test.run();