Skip to content
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
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
auto-install-peers = true
hoist-pattern[]=vfile-message
hoist-pattern[]=react
hoist-pattern[]=react-dom
resolution-mode=highest
dedupe-direct-deps=true
6 changes: 6 additions & 0 deletions docs/site/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ module.exports = {
"!app/.well-known/vercel/flags/route.ts",
".source",
"components/ui/**",
// shadcn/ui-style component wrappers around Radix UI primitives
"components/button.tsx",
"components/dropdown.tsx",
"components/popover.tsx",
"components/nav/navigation-menu.tsx",
"components/docs-layout/sidebar.tsx",
// TODO: Need to fix the JSON inference in this file
"components/examples-table.tsx",
],
Expand Down
2 changes: 1 addition & 1 deletion docs/site/app/api/search/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createSearchAPI } from "fumadocs-core/search/server";
import { repoDocsPages } from "../../source";
import { openapiPages } from "../../(openapi)/docs/openapi/source";
import { createSearchAPI } from "fumadocs-core/search/server";

export const { GET } = createSearchAPI("advanced", {
language: "english",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"cargo fmt --"
]
},
"packageManager": "pnpm@8.14.0",
"packageManager": "pnpm@9.15.9",
"engines": {
"node": "22.x"
}
Expand Down
4 changes: 1 addition & 3 deletions packages/eslint-config-turbo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"build": "bunchee",
"lint": "eslint src",
"lint:prettier": "prettier -c . --cache --ignore-path=../../.prettierignore",
"package:lint": "publint --strict",
"package:types": "attw --profile node16 --pack"
},
"keywords": [
Expand Down Expand Up @@ -67,7 +66,6 @@
"@turbo/tsconfig": "workspace:*",
"@types/eslint": "^8.56.10",
"@types/node": "^20",
"bunchee": "^6.3.4",
"publint": "^0.3.12"
"bunchee": "^6.3.4"
}
}
13 changes: 0 additions & 13 deletions packages/eslint-plugin-turbo/.vscode/launch.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ROOT_DOT_ENV=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default function docs() {
if (process.env.ENV_1 === undefined) {
return "does not exist";
}
return "exists";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "docs",
"version": "1.0.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://turborepo.com/schema.json",
"extends": ["//"],
"pipeline": {
"build": {
"dotEnv": ["missing1.env", "missing2.env"],
"env": ["ENV_3"]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
WEB_DOT_ENV=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export default function web() {
if (!process.env.ENV_2) {
return "bar";
}
if (process.env.NX_DOT_ENV === undefined) {
return "does not exist";
}
if (process.env.ROOT_DOT_ENV === undefined) {
return "does not exist";
}
if (process.env.WEB_DOT_ENV === undefined) {
return "does not exist";
}
return "foo";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "web",
"version": "1.0.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://turborepo.com/schema.json",
"extends": ["//"],
"pipeline": {
"build": {
"dotEnv": [".env"],
"env": ["ENV_2", "NEXT_PUBLIC_*", "!NEXT_PUBLIC_EXCLUDE*"]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"private": true,
"workspaces": [
"apps/*",
"packages/*"
],
"scripts": {
"build": "turbo run build"
},
"devDependencies": {
"turbo": "latest"
},
"packageManager": "[email protected]"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default function foo() {
if (!process.env.IS_SERVER) {
return "bar";
}
return "foo";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "ui",
"version": "1.0.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://turborepo.com/schema.json",
"extends": ["//"],
"pipeline": {
"build": {
"env": ["IS_SERVER"]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://turborepo.com/schema.json",
"globalEnv": ["CI"],
"globalDotEnv": [".env", "missing.env"],
"pipeline": {
"build": {
"env": ["ENV_1"]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ const ruleTester = new RuleTester({
parserOptions: { ecmaVersion: 2020, sourceType: "module" },
});

const cwd = path.join(__dirname, "../../../../__fixtures__/workspace-configs");
// Use a dedicated fixture directory for reload tests to avoid conflicts
// with other tests that read from workspace-configs
const cwd = path.join(
__dirname,
"../../../../__fixtures__/workspace-configs-reload"
);
const webFilename = path.join(cwd, "/apps/web/index.js");

describe("Project reload functionality", () => {
Expand Down
3 changes: 2 additions & 1 deletion packages/eslint-plugin-turbo/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"extends": ["//"],
"tasks": {
"test": {
"dependsOn": ["build"]
"dependsOn": ["build"],
"passThroughEnv": ["!CI"]
}
}
}
2 changes: 0 additions & 2 deletions packages/turbo-gen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"test": "jest",
"lint": "eslint src/",
"check-types": "tsc --noEmit",
"package:lint": "publint --strict",
"package:types": "attw --profile node16 --pack"
},
"dependencies": {
Expand All @@ -47,7 +46,6 @@
"@types/inquirer": "^8.2.5",
"@types/node": "^18.17.2",
"@types/validate-npm-package-name": "^4.0.0",
"publint": "^0.3.12",
"jest": "^29.7.0",
"ts-jest": "^29.2.5",
"tsup": "^6.7.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/turbo-repository/__tests__/workspace.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ describe("Workspace", () => {
it("finds a package manager", async () => {
const workspace = await Workspace.find();
const packageManager: PackageManager = workspace.packageManager;
assert.equal(packageManager.name, "pnpm");
assert.equal(packageManager.name, "pnpm9");
});
});
8 changes: 4 additions & 4 deletions packages/turbo-repository/js/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ export class Workspace {
* Given a path (relative to the workspace root), returns the
* package that contains it.
*
* This is a naive implementation that simply "iterates-up". If this function is
* expected to be called many times for files that are deep within the same
* package, we could optimize this by caching the containing-package of
* every ancestor.
* This is a naive implementation that simply "iterates-up". If this
* function is expected to be called many times for files that are deep
* within the same package, we could optimize this by caching the
* containing-package of every ancestor.
*/
findPackageByPath(path: string): Promise<Package>;
}
2 changes: 0 additions & 2 deletions packages/turbo-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@
"lint:prettier": "prettier -c . --cache",
"generate-schema": "tsx scripts/generate-schema.ts",
"copy-schema": "cp schemas/schema.json ../turbo/schema.json",
"package:lint": "publint --strict",
"package:types": "attw --profile node16 --pack"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.18.2",
"@turbo/eslint-config": "workspace:*",
"@turbo/tsconfig": "workspace:*",
"@types/node": "^20",
"publint": "^0.3.12",
"ts-json-schema-generator": "2.3.0",
"tsx": "4.19.1"
},
Expand Down
5 changes: 1 addition & 4 deletions packages/turbo-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
"test": "jest",
"lint": "eslint src/",
"check-types": "tsc --noEmit",
"lint:prettier": "prettier -c . --cache --ignore-path=../../.prettierignore",
"package:lint": "publint --strict",
"package:types": "attw --profile node16 --pack"
"lint:prettier": "prettier -c . --cache --ignore-path=../../.prettierignore"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"lint:prettier": "prettier -c . --cache --ignore-path=../../.prettierignore"
"lint:prettier": "prettier -c . --cache --ignore-path=../../.prettierignore",
"package:types": "attw --profile node16 --pack"

The package:types script was removed from turbo-utils but the @arethetypeswrong/cli dependency is still present. This inconsistency will leave unused dependencies and break the package-checks task if turbo-utils is expected to have type checking.

View Details

Analysis

Missing package:types script in turbo-utils causes CI failure

What fails: The package-checks task in turbo.json depends on package:types script, but the packages/turbo-utils/package.json is missing this script (only has test, lint, check-types, and lint:prettier). When CI runs turbo run package-checks --filter={./packages/*}, it will fail for turbo-utils.

How to reproduce:

cd packages/turbo-utils
npm run package:types
# Error: Missing script: "package:types"

Or via turbo CI command:

turbo run package-checks --filter="@turbo/utils"
# Task execution fails: package:types script not found

Result: The script execution fails with "Missing script: package:types". The @arethetypeswrong/cli dependency remains in devDependencies but is unused.

Expected: The package:types script should be defined like in other type-checked packages (eslint-config-turbo, turbo-gen, turbo-types), which all define: "package:types": "attw --profile node16 --pack". This is required because turbo.json (line 217) defines a package:types task that is a dependency of package-checks (line 214), which is run in CI against all packages in ./packages/* per the test-js-packages.yml workflow.

Verification: After restoring the missing script, npm run package:types completes successfully with no type issues found.

},
"devDependencies": {
"@arethetypeswrong/cli": "^0.18.2",
Expand All @@ -55,7 +53,6 @@
"json5": "^2.2.3",
"ora": "4.1.1",
"picocolors": "1.0.1",
"publint": "^0.3.12",
"tar": "6.1.13",
"ts-jest": "^29.2.5",
"typescript": "5.5.4",
Expand Down
3 changes: 2 additions & 1 deletion packages/turbo-utils/src/getTurboConfigs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
PipelineV2,
} from "@turbo/types";
import * as logger from "./logger";
import { getTurboRoot } from "./getTurboRoot";
import { getTurboRoot, clearTurboRootCache } from "./getTurboRoot";
import type { PackageJson, PNPMWorkspaceConfig } from "./types";

const ROOT_GLOB = "{turbo.json,turbo.jsonc}";
Expand Down Expand Up @@ -302,4 +302,5 @@ export function clearConfigCaches(): void {
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete -- This is safe.
delete workspaceConfigCache[key];
});
clearTurboRootCache();
}
8 changes: 7 additions & 1 deletion packages/turbo-utils/src/getTurboRoot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ interface Options {
}

function contentCheck(content: string): boolean {
// eslint-disable-next-line import/no-named-as-default-member -- json5 exports different objects depending on if you're using esm or cjs (https://github.com/json5/json5/issues/240)
const result: Schema | undefined = json5.parse(content);
return !(result && "extends" in result);
}

const configCache: Record<string, string> = {};

export function clearTurboRootCache(): void {
Object.keys(configCache).forEach((key) => {
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete -- This is safe.
delete configCache[key];
});
}

export function getTurboRoot(cwd?: string, opts?: Options): string | null {
const cacheEnabled = opts?.cache ?? true;
const currentDir = cwd || process.cwd();
Expand Down
2 changes: 1 addition & 1 deletion packages/turbo-utils/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// utils
export { getTurboRoot } from "./getTurboRoot";
export { getTurboRoot, clearTurboRootCache } from "./getTurboRoot";
export {
getTurboConfigs,
getWorkspaceConfigs,
Expand Down
Loading
Loading