diff --git a/.oxfmtrc.jsonc b/.oxfmtrc.jsonc index fab08f92e8677..200a032c159a1 100644 --- a/.oxfmtrc.jsonc +++ b/.oxfmtrc.jsonc @@ -1,11 +1,29 @@ +// Ultracite oxfmt Configuration +// https://oxc.rs/docs/guide/usage/formatter/config-file-reference.html { "$schema": "./node_modules/oxfmt/configuration_schema.json", - // Use Prettier v2 defaults (the repo was on v2.8.7) "printWidth": 80, - // No trailing commas - required for JSON compatibility + "tabWidth": 2, + "useTabs": false, + "semi": true, + "singleQuote": false, + "quoteProps": "as-needed", + "jsxSingleQuote": false, "trailingComma": "none", - // Disable formatting of embedded code blocks (JSON in markdown) - "embeddedLanguageFormatting": "off", - // Disable features that differ from Prettier defaults - "experimentalSortPackageJson": false + "bracketSpacing": true, + "bracketSameLine": false, + "arrowParens": "always", + "endOfLine": "lf", + "ignorePatterns": [ + "build/", + "crates/", + "cli/", + "examples/", + "packages/eslint-plugin-turbo/__fixtures__", + "packages/create-turbo/templates", + "turborepo-tests/", + "buildcontainer/", + "scripts/", + "apps/docs" + ] } diff --git a/.oxlintrc.json b/.oxlintrc.json index 9a9695f325081..cadde89228961 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -1,5 +1,6 @@ { - "$schema": "https://raw.githubusercontent.com/oxc-project/oxlint/main/npm/oxlint/configuration_schema.json", + "$schema": "./node_modules/oxlint/configuration_schema.json", + "extends": ["./node_modules/ultracite/config/oxlint/core/.oxlintrc.json"], "ignorePatterns": [ "build/", "crates/", @@ -10,41 +11,139 @@ "turborepo-tests/", "buildcontainer/", "scripts/", - ".github/", - ".devcontainer/", - ".cargo/", - ".config/", - ".cursor/", - ".vscode/", - ".husky/", - ".conductor/" + "apps/docs" ], "rules": { - "no-unused-vars": [ - "warn", - { - "vars": "all", - "varsIgnorePattern": "^_", - "args": "after-used", - "argsIgnorePattern": "^_", - "caughtErrors": "none", - "destructuredArrayIgnorePattern": "^_" - } - ], - "unicorn/no-empty-file": "off" - }, - "overrides": [ - { - "files": ["**/__fixtures__/**/*", "**/fixtures/**/*"], - "rules": { - "no-unused-expressions": "off" - } - }, - { - "files": ["**/next-env.d.ts"], - "rules": { - "@typescript-eslint/triple-slash-reference": "off" - } - } - ] + "jest/no-confusing-set-timeout": "off", + "jest/no-untyped-mock-factory": "off", + "func-style": "off", + "sort-keys": "off", + "import/no-relative-parent-imports": "off", + "import/no-nodejs-modules": "off", + "max-statements": "off", + "jest/no-conditional-in-test": "off", + "jest/require-hook": "off", + "no-inline-comments": "off", + "unicorn/numeric-separators-style": "off", + "typescript/consistent-type-definitions": "off", + "no-use-before-define": "off", + "promise/prefer-await-to-then": "off", + "jsdoc/check-tag-names": "off", + "jest/no-conditional-expect": "off", + "promise/prefer-await-to-callbacks": "off", + "require-await": "off", + "jest/valid-title": "off", + "jest/max-expects": "off", + "jest/no-hooks": "off", + "typescript/no-explicit-any": "off", + "no-unused-vars": "off", + "no-plusplus": "off", + "prefer-template": "off", + "prefer-destructuring": "off", + "no-shadow": "off", + "no-negated-condition": "off", + "typescript/no-non-null-assertion": "off", + "unicorn/consistent-function-scoping": "off", + "vitest/no-import-node-test": "off", + "no-useless-return": "off", + "no-unused-expressions": "off", + "promise/avoid-new": "off", + "class-methods-use-this": "off", + "no-empty-function": "off", + "no-new": "off", + "unicorn/no-empty-file": "off", + "default-case": "off", + "typescript/consistent-type-imports": "off", + "unicorn/prefer-spread": "off", + "no-alert": "off", + "vitest/consistent-test-filename": "off", + "jest/require-top-level-describe": "off", + "import/no-named-as-default-member": "off", + "complexity": "off", + "no-void": "off", + "no-warning-comments": "off", + "unicorn/prefer-logical-operator-over-ternary": "off", + "unicorn/no-await-expression-member": "off", + "unicorn/prefer-add-event-listener": "off", + "unicorn/no-immediate-mutation": "off", + "import/no-named-as-default": "off", + "no-nested-ternary": "off", + "unicorn/no-array-reduce": "off", + "jsdoc/require-param-type": "off", + "typescript/ban-types": "off", + "import/no-absolute-path": "off", + "unicorn/new-for-builtins": "off", + "promise/no-nesting": "off", + "typescript/parameter-properties": "off", + "no-promise-executor-return": "off", + "jest/prefer-each": "off", + "unicorn/no-useless-error-capture-stack-trace": "off", + "unicorn/no-abusive-eslint-disable": "off", + "unicorn/no-object-as-default-parameter": "off", + "oxc/no-accumulating-spread": "off", + "jsdoc/require-returns-type": "off", + "promise/param-names": "off", + "typescript/no-unsafe-function-type": "off", + "node/global-require": "off", + "jest/expect-expect": "off", + "import/default": "off", + "import/no-cycle": "off", + "import/no-duplicates": "off", + "no-duplicate-imports": "off", + "typescript/no-extraneous-class": "off", + "unicorn/no-lonely-if": "off", + "typescript/no-empty-object-type": "off", + "eqeqeq": "off", + "unicorn/prefer-response-static-json": "off", + "array-callback-return": "off", + "import/no-webpack-loader-syntax": "off", + "unicorn/prefer-object-from-entries": "off", + "unicorn/prefer-array-find": "off", + "promise/no-multiple-resolved": "off", + "unicorn/prefer-modern-math-apis": "off", + "unicorn/no-useless-switch-case": "off", + "typescript/no-inferrable-types": "off", + "func-names": "off", + "guard-for-in": "off", + "typescript/ban-ts-comment": "off", + "jest/no-done-callback": "off", + "no-eq-null": "off", + "no-param-reassign": "off", + "unicorn/no-document-cookie": "off", + "unicorn/no-useless-collection-argument": "off", + "oxc/no-barrel-file": "off", + "unicorn/require-post-message-target-origin": "off", + "jest/prefer-to-be": "off", + "unicorn/prefer-string-replace-all": "off", + "vitest/prefer-to-be-truthy": "off", + "typescript/array-type": "off", + "jest/consistent-test-it": "off", + "unicorn/text-encoding-identifier-case": "off", + "unicorn/no-nested-ternary": "off", + "unicorn/no-array-sort": "off", + "arrow-body-style": "off", + "curly": "off", + "unicorn/no-useless-undefined": "off", + "unicorn/catch-error-name": "off", + "unicorn/prefer-optional-catch-binding": "off", + "import/consistent-type-specifier-style": "off", + "typescript/no-import-type-side-effects": "off", + "typescript/consistent-indexed-object-style": "off", + "unicorn/prefer-set-has": "off", + "vars-on-top": "off", + "unicorn/throw-new-error": "off", + "typescript/prefer-ts-expect-error": "off", + "unicorn/no-console-spaces": "off", + "preserve-caught-error": "off", + "vitest/prefer-to-be-falsy": "off", + "typescript/prefer-function-type": "off", + "jest/prefer-strict-equal": "off", + "vitest/prefer-called-once": "off", + "vitest/prefer-describe-function-title": "off", + "jest/prefer-called-with": "off", + "vitest/prefer-import-in-mock": "off", + "jest/prefer-lowercase-title": "off", + "unicorn/prefer-string-slice": "off", + "typescript/ban-tslint-comment": "off" + } } diff --git a/.prettierignore b/.prettierignore index d99021e592414..0d7df53cbbe23 100644 --- a/.prettierignore +++ b/.prettierignore @@ -33,3 +33,6 @@ __generated__/ *.toml apps/docs/content/openapi/**/*.mdx + +# oxfmt parse error +packages/turbo-utils/__tests__/convertCase.test.ts diff --git a/.vscode/settings.json b/.vscode/settings.json index 72f8e97302afa..2f462917e95f8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,11 +1,4 @@ { - "eslint.validate": [ - "javascript", - "javascriptreact", - "typescript", - "typescriptreact" - ], - "eslint.workingDirectories": [{ "mode": "auto" }], "debug.javascript.unmapMissingSources": true, "files.associations": { "libturbo.h": "c", @@ -18,11 +11,66 @@ "files.insertFinalNewline": false, "files.trimTrailingWhitespace": false }, + "editor.defaultFormatter": "esbenp.prettier-vscode", "typescript.tsdk": "node_modules/typescript/lib", "json.schemas": [ { "fileMatch": ["turbo.json"], "url": "./packages/turbo-types/schemas/schema.json" } - ] + ], + "editor.formatOnSave": true, + "editor.formatOnPaste": true, + "emmet.showExpandedAbbreviation": "never", + "[javascript]": { + "editor.defaultFormatter": "oxc.oxc-vscode" + }, + "[javascriptreact]": { + "editor.defaultFormatter": "oxc.oxc-vscode" + }, + "[typescript]": { + "editor.defaultFormatter": "oxc.oxc-vscode" + }, + "[typescriptreact]": { + "editor.defaultFormatter": "oxc.oxc-vscode" + }, + "[json]": { + "editor.defaultFormatter": "oxc.oxc-vscode" + }, + "[jsonc]": { + "editor.defaultFormatter": "oxc.oxc-vscode" + }, + "[yaml]": { + "editor.defaultFormatter": "oxc.oxc-vscode" + }, + "[html]": { + "editor.defaultFormatter": "oxc.oxc-vscode" + }, + "[vue]": { + "editor.defaultFormatter": "oxc.oxc-vscode" + }, + "[vue-html]": { + "editor.defaultFormatter": "oxc.oxc-vscode" + }, + "[handlebars]": { + "editor.defaultFormatter": "oxc.oxc-vscode" + }, + "[css]": { + "editor.defaultFormatter": "oxc.oxc-vscode" + }, + "[scss]": { + "editor.defaultFormatter": "oxc.oxc-vscode" + }, + "[less]": { + "editor.defaultFormatter": "oxc.oxc-vscode" + }, + "[graphql]": { + "editor.defaultFormatter": "oxc.oxc-vscode" + }, + "[markdown]": { + "editor.defaultFormatter": "oxc.oxc-vscode" + }, + "editor.codeActionsOnSave": { + "source.fixAll.oxc": "explicit" + } } diff --git a/apps/agents/app/api/slack/actions/route.ts b/apps/agents/app/api/slack/actions/route.ts index ab1c909791123..99e6bad6cb6f9 100644 --- a/apps/agents/app/api/slack/actions/route.ts +++ b/apps/agents/app/api/slack/actions/route.ts @@ -38,7 +38,7 @@ export async function POST(request: Request) { switch (action.action_id) { case "approve_repro_request": { - const issueNumber = parseInt(action.value ?? "0", 10); + const issueNumber = Number.parseInt(action.value ?? "0", 10); if (!issueNumber) break; await addComment(issueNumber, REPRODUCTION_REQUEST); @@ -51,7 +51,7 @@ export async function POST(request: Request) { } case "repro_dismiss": { - const issueNumber = parseInt(action.value ?? "0", 10); + const issueNumber = Number.parseInt(action.value ?? "0", 10); const issueRef = issueNumber ? ` for ` : ""; @@ -63,8 +63,9 @@ export async function POST(request: Request) { break; } - default: + default: { break; + } } return new Response("OK", { status: 200 }); diff --git a/apps/agents/lib/slack.ts b/apps/agents/lib/slack.ts index aea9bcb34fa94..7ab40e0da8672 100644 --- a/apps/agents/lib/slack.ts +++ b/apps/agents/lib/slack.ts @@ -22,7 +22,7 @@ export async function verifySlackRequest( } const fiveMinutesAgo = Math.floor(Date.now() / 1000) - 60 * 5; - if (parseInt(timestamp, 10) < fiveMinutesAgo) { + if (Number.parseInt(timestamp, 10) < fiveMinutesAgo) { throw new Error("Slack request too old"); } diff --git a/apps/agents/sandbox/audit-fix-agent.mjs b/apps/agents/sandbox/audit-fix-agent.mjs index aae73534c7d8a..fa1b2b93e35a2 100644 --- a/apps/agents/sandbox/audit-fix-agent.mjs +++ b/apps/agents/sandbox/audit-fix-agent.mjs @@ -115,7 +115,7 @@ const agent = new ToolLoopAgent({ ), execute: async function ({ command, cwd, allowFailure }) { console.log("$ " + command); - var output = shell(command, { + const output = shell(command, { cwd: cwd ?? REPO_DIR, allowFailure: allowFailure ?? false }); @@ -131,7 +131,7 @@ const agent = new ToolLoopAgent({ }) ), execute: async function ({ path }) { - var fullPath = REPO_DIR + "/" + path; + const fullPath = REPO_DIR + "/" + path; if (!existsSync(fullPath)) { return "File not found: " + path; } @@ -148,7 +148,7 @@ const agent = new ToolLoopAgent({ }) ), execute: async function ({ path, content }) { - var fullPath = REPO_DIR + "/" + path; + const fullPath = REPO_DIR + "/" + path; writeFileSync(fullPath, content, "utf-8"); return "Wrote " + content.length + " bytes to " + path; } @@ -164,7 +164,7 @@ const agent = new ToolLoopAgent({ }) ), execute: async function ({ pattern }) { - var output = shell("find . -path './" + pattern + "' | head -50", { + const output = shell("find . -path './" + pattern + "' | head -50", { allowFailure: true }); return output || "(no matches)"; @@ -201,14 +201,14 @@ async function main() { console.log("Starting audit fix agent..."); try { - var result = await agent.generate({ + const result = await agent.generate({ prompt: "Run security audits on this repo and fix the vulnerabilities. Follow the strategy in your instructions exactly — audit, fix manifests, reinstall, verify, report. Do not over-analyze. Act quickly." }); console.log("\nAgent finished."); - var reportCall = result.steps + const reportCall = result.steps .flatMap(function (s) { return s.toolCalls ?? []; }) diff --git a/apps/coverage-reporter/app/api/badge/route.ts b/apps/coverage-reporter/app/api/badge/route.ts index 63340a5ce5716..3969220f5036d 100644 --- a/apps/coverage-reporter/app/api/badge/route.ts +++ b/apps/coverage-reporter/app/api/badge/route.ts @@ -17,18 +17,21 @@ export async function GET(request: NextRequest) { if (summary) { switch (metric) { - case "functions": + case "functions": { percent = summary.functions.percent; label = "functions"; break; - case "branches": + } + case "branches": { percent = summary.branches.percent; label = "branches"; break; + } case "lines": - default: + default: { percent = summary.lines.percent; label = "coverage"; + } } } diff --git a/apps/coverage-reporter/app/page.tsx b/apps/coverage-reporter/app/page.tsx index 8056b8fc8f8c1..17eb5ec55e30c 100644 --- a/apps/coverage-reporter/app/page.tsx +++ b/apps/coverage-reporter/app/page.tsx @@ -25,7 +25,7 @@ export default async function Dashboard() { functions: r.summary.functions.percent, branches: r.summary.branches.percent })) - .reverse(); + .toReversed(); // Calculate delta from previous const previousCommit = mainHistory[1]; diff --git a/apps/coverage-reporter/lib/coverage.ts b/apps/coverage-reporter/lib/coverage.ts index f68de7dc7b4f7..6b6a8f6340e00 100644 --- a/apps/coverage-reporter/lib/coverage.ts +++ b/apps/coverage-reporter/lib/coverage.ts @@ -64,7 +64,7 @@ function convertSummary(summary: LlvmCovSummary): CoverageSummary { * Segments format: [line, col, count, hasCount, isRegionEntry, isGapRegion] */ function extractUncoveredLines(file: LlvmCovFile): number[] { - const uncovered: Set = new Set(); + const uncovered = new Set(); let currentLine = 0; let currentCount = 0; diff --git a/docs/link-checker/package.json b/docs/link-checker/package.json index c0782a86f86c8..0324abe81e4b6 100644 --- a/docs/link-checker/package.json +++ b/docs/link-checker/package.json @@ -1,18 +1,14 @@ { "name": "@repo/docs-link-checker", "private": true, - "type": "module", - "exports": "./dist/index.js", "files": [ "src" ], + "type": "module", + "exports": "./dist/index.js", "scripts": { "check-links": "cd ../../apps/docs/content && node --experimental-strip-types ../../link-checker/src/validate-docs-links.ts" }, - "devDependencies": { - "@types/node": "22.7.8", - "typescript": "5.5.4" - }, "dependencies": { "github-slugger": "2.0.0", "gray-matter": "4.0.3", @@ -23,5 +19,9 @@ "remark-rehype": "11.1.2", "unified": "11.0.5", "unist-util-visit": "5.0.0" + }, + "devDependencies": { + "@types/node": "22.7.8", + "typescript": "5.5.4" } } diff --git a/docs/link-checker/src/markdown.ts b/docs/link-checker/src/markdown.ts index 2241a18764058..f6e81ad439fa5 100644 --- a/docs/link-checker/src/markdown.ts +++ b/docs/link-checker/src/markdown.ts @@ -1,4 +1,4 @@ -import fs from "fs/promises"; +import fs from "node:fs/promises"; import { unified } from "unified"; import remarkParse from "remark-parse"; import remarkRehype from "remark-rehype"; @@ -191,7 +191,7 @@ const validateInternalLink = foundPage = documentMap.get(`${link}/index`); } - let errors: LinkError[] = []; + const errors: LinkError[] = []; if (!foundPage) { errors.push({ @@ -251,7 +251,7 @@ const validateHashLink = (doc: Document, href: string) => { return []; } - let linkError: LinkError = { + const linkError: LinkError = { type: "hash", href, doc @@ -265,7 +265,7 @@ const traverseTreeAndValidateLinks = ( tree: unknown, doc: Document ): LinkError[] => { - let errors: LinkError[] = []; + const errors: LinkError[] = []; try { visit(tree, (node: any) => { diff --git a/docs/link-checker/src/validate-docs-links.ts b/docs/link-checker/src/validate-docs-links.ts index 8a9c8dad1aa3f..773f40c7f5295 100644 --- a/docs/link-checker/src/validate-docs-links.ts +++ b/docs/link-checker/src/validate-docs-links.ts @@ -19,7 +19,7 @@ import { collectLinkErrors } from "./markdown.ts"; /** Main function that triggers link validation across .mdx files */ const validateAllInternalLinks = async (): Promise => { - let errorReports = await collectLinkErrors(); + const errorReports = await collectLinkErrors(); if (errorReports.length === 0) { console.log("Link validation was successful."); return; diff --git a/examples/basic/apps/docs/tsconfig.json b/examples/basic/apps/docs/tsconfig.json index 7aef056980d56..efd817de77baa 100644 --- a/examples/basic/apps/docs/tsconfig.json +++ b/examples/basic/apps/docs/tsconfig.json @@ -5,7 +5,8 @@ { "name": "next" } - ] + ], + "strictNullChecks": true }, "include": [ "**/*.ts", diff --git a/examples/basic/apps/web/tsconfig.json b/examples/basic/apps/web/tsconfig.json index 7aef056980d56..efd817de77baa 100644 --- a/examples/basic/apps/web/tsconfig.json +++ b/examples/basic/apps/web/tsconfig.json @@ -5,7 +5,8 @@ { "name": "next" } - ] + ], + "strictNullChecks": true }, "include": [ "**/*.ts", diff --git a/examples/basic/packages/ui/tsconfig.json b/examples/basic/packages/ui/tsconfig.json index ca86687c4bb77..ed023ce414ae3 100644 --- a/examples/basic/packages/ui/tsconfig.json +++ b/examples/basic/packages/ui/tsconfig.json @@ -1,7 +1,8 @@ { "extends": "@repo/typescript-config/react-library.json", "compilerOptions": { - "outDir": "dist" + "outDir": "dist", + "strictNullChecks": true }, "include": ["src"], "exclude": ["node_modules", "dist"] diff --git a/examples/design-system/apps/docs/tsconfig.json b/examples/design-system/apps/docs/tsconfig.json index b31464b46520b..cf07022ad29f3 100644 --- a/examples/design-system/apps/docs/tsconfig.json +++ b/examples/design-system/apps/docs/tsconfig.json @@ -1,5 +1,12 @@ { "extends": "@repo/typescript-config/react-app.json", "include": ["."], - "exclude": ["dist", "build", "node_modules"] + "exclude": [ + "dist", + "build", + "node_modules" + ], + "compilerOptions": { + "strictNullChecks": true + } } diff --git a/examples/design-system/packages/ui/tsconfig.json b/examples/design-system/packages/ui/tsconfig.json index 1a0e3e8583394..82301fe47b4db 100644 --- a/examples/design-system/packages/ui/tsconfig.json +++ b/examples/design-system/packages/ui/tsconfig.json @@ -1,5 +1,12 @@ { "extends": "@repo/typescript-config/react-library.json", "include": ["."], - "exclude": ["dist", "build", "node_modules"] + "exclude": [ + "dist", + "build", + "node_modules" + ], + "compilerOptions": { + "strictNullChecks": true + } } diff --git a/examples/kitchen-sink/apps/admin/tsconfig.node.json b/examples/kitchen-sink/apps/admin/tsconfig.node.json index 42872c59f5b01..ef0fd3f5032d7 100644 --- a/examples/kitchen-sink/apps/admin/tsconfig.node.json +++ b/examples/kitchen-sink/apps/admin/tsconfig.node.json @@ -4,7 +4,8 @@ "skipLibCheck": true, "module": "ESNext", "moduleResolution": "bundler", - "allowSyntheticDefaultImports": true + "allowSyntheticDefaultImports": true, + "strictNullChecks": true }, "include": ["vite.config.ts"] } diff --git a/examples/kitchen-sink/apps/api/tsconfig.json b/examples/kitchen-sink/apps/api/tsconfig.json index 6713bc99eb5dc..41b8bf2bcaf45 100644 --- a/examples/kitchen-sink/apps/api/tsconfig.json +++ b/examples/kitchen-sink/apps/api/tsconfig.json @@ -2,7 +2,8 @@ "extends": "@repo/typescript-config/base.json", "compilerOptions": { "lib": ["ES2015"], - "outDir": "./dist" + "outDir": "./dist", + "strictNullChecks": true }, "exclude": ["node_modules"], "include": ["."] diff --git a/examples/kitchen-sink/apps/storefront/tsconfig.json b/examples/kitchen-sink/apps/storefront/tsconfig.json index d87d332259500..f28c8b3e12d0b 100644 --- a/examples/kitchen-sink/apps/storefront/tsconfig.json +++ b/examples/kitchen-sink/apps/storefront/tsconfig.json @@ -7,7 +7,8 @@ { "name": "next" } - ] + ], + "strictNullChecks": true }, "include": ["src", "next.config.ts", "next-env.d.ts", ".next/types/**/*.ts"] } diff --git a/examples/kitchen-sink/packages/logger/tsconfig.json b/examples/kitchen-sink/packages/logger/tsconfig.json index a7f4e49078e2a..fa1f75ada7108 100644 --- a/examples/kitchen-sink/packages/logger/tsconfig.json +++ b/examples/kitchen-sink/packages/logger/tsconfig.json @@ -3,7 +3,11 @@ "compilerOptions": { "lib": ["ES2015"], "outDir": "./dist", - "types": ["jest", "node"] + "types": [ + "jest", + "node" + ], + "strictNullChecks": true }, "include": ["."], "exclude": ["node_modules", "dist"], diff --git a/examples/kitchen-sink/packages/ui/tsconfig.json b/examples/kitchen-sink/packages/ui/tsconfig.json index d049e2d3726ba..8a15b2df4fc06 100644 --- a/examples/kitchen-sink/packages/ui/tsconfig.json +++ b/examples/kitchen-sink/packages/ui/tsconfig.json @@ -3,7 +3,11 @@ "compilerOptions": { "lib": ["dom", "ES2015"], "sourceMap": true, - "types": ["jest", "node"] + "types": [ + "jest", + "node" + ], + "strictNullChecks": true }, "include": ["."], "exclude": ["dist", "build", "node_modules"] diff --git a/examples/with-angular/apps/docs/tsconfig.app.json b/examples/with-angular/apps/docs/tsconfig.app.json index 374cc9d294aab..ddb3575139e0e 100644 --- a/examples/with-angular/apps/docs/tsconfig.app.json +++ b/examples/with-angular/apps/docs/tsconfig.app.json @@ -3,7 +3,8 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "./out-tsc/app", - "types": [] + "types": [], + "strictNullChecks": true }, "files": [ "src/main.ts" diff --git a/examples/with-angular/apps/docs/tsconfig.spec.json b/examples/with-angular/apps/docs/tsconfig.spec.json index be7e9da76f7b2..b55354cdcb1f0 100644 --- a/examples/with-angular/apps/docs/tsconfig.spec.json +++ b/examples/with-angular/apps/docs/tsconfig.spec.json @@ -5,7 +5,8 @@ "outDir": "./out-tsc/spec", "types": [ "jasmine" - ] + ], + "strictNullChecks": true }, "include": [ "src/**/*.spec.ts", diff --git a/examples/with-angular/apps/web/tsconfig.app.json b/examples/with-angular/apps/web/tsconfig.app.json index 374cc9d294aab..ddb3575139e0e 100644 --- a/examples/with-angular/apps/web/tsconfig.app.json +++ b/examples/with-angular/apps/web/tsconfig.app.json @@ -3,7 +3,8 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "./out-tsc/app", - "types": [] + "types": [], + "strictNullChecks": true }, "files": [ "src/main.ts" diff --git a/examples/with-angular/apps/web/tsconfig.spec.json b/examples/with-angular/apps/web/tsconfig.spec.json index be7e9da76f7b2..b55354cdcb1f0 100644 --- a/examples/with-angular/apps/web/tsconfig.spec.json +++ b/examples/with-angular/apps/web/tsconfig.spec.json @@ -5,7 +5,8 @@ "outDir": "./out-tsc/spec", "types": [ "jasmine" - ] + ], + "strictNullChecks": true }, "include": [ "src/**/*.spec.ts", diff --git a/examples/with-angular/packages/ui/projects/ui/tsconfig.lib.json b/examples/with-angular/packages/ui/projects/ui/tsconfig.lib.json index e8e5445269a96..9306753056e60 100644 --- a/examples/with-angular/packages/ui/projects/ui/tsconfig.lib.json +++ b/examples/with-angular/packages/ui/projects/ui/tsconfig.lib.json @@ -6,7 +6,8 @@ "declaration": true, "declarationMap": true, "inlineSources": true, - "types": [] + "types": [], + "strictNullChecks": true }, "exclude": ["**/*.spec.ts"] } diff --git a/examples/with-angular/packages/ui/projects/ui/tsconfig.lib.prod.json b/examples/with-angular/packages/ui/projects/ui/tsconfig.lib.prod.json index 06de549e10727..6251f916ae4e8 100644 --- a/examples/with-angular/packages/ui/projects/ui/tsconfig.lib.prod.json +++ b/examples/with-angular/packages/ui/projects/ui/tsconfig.lib.prod.json @@ -2,7 +2,8 @@ { "extends": "./tsconfig.lib.json", "compilerOptions": { - "declarationMap": false + "declarationMap": false, + "strictNullChecks": true }, "angularCompilerOptions": { "compilationMode": "partial" diff --git a/examples/with-angular/packages/ui/projects/ui/tsconfig.spec.json b/examples/with-angular/packages/ui/projects/ui/tsconfig.spec.json index ce7048bc2c709..029f6e00a8cb7 100644 --- a/examples/with-angular/packages/ui/projects/ui/tsconfig.spec.json +++ b/examples/with-angular/packages/ui/projects/ui/tsconfig.spec.json @@ -5,7 +5,8 @@ "outDir": "../../out-tsc/spec", "types": [ "jasmine" - ] + ], + "strictNullChecks": true }, "include": [ "**/*.spec.ts", diff --git a/examples/with-berry/apps/docs/tsconfig.json b/examples/with-berry/apps/docs/tsconfig.json index 1a615f6e00c9f..36efe2bb5ac87 100644 --- a/examples/with-berry/apps/docs/tsconfig.json +++ b/examples/with-berry/apps/docs/tsconfig.json @@ -1,7 +1,12 @@ { "extends": "@repo/typescript-config/nextjs.json", "compilerOptions": { - "plugins": [{ "name": "next" }] + "plugins": [ + { + "name": "next" + } + ], + "strictNullChecks": true }, "include": [ "next-env.d.ts", diff --git a/examples/with-berry/apps/web/tsconfig.json b/examples/with-berry/apps/web/tsconfig.json index 1a615f6e00c9f..36efe2bb5ac87 100644 --- a/examples/with-berry/apps/web/tsconfig.json +++ b/examples/with-berry/apps/web/tsconfig.json @@ -1,7 +1,12 @@ { "extends": "@repo/typescript-config/nextjs.json", "compilerOptions": { - "plugins": [{ "name": "next" }] + "plugins": [ + { + "name": "next" + } + ], + "strictNullChecks": true }, "include": [ "next-env.d.ts", diff --git a/examples/with-berry/packages/ui/tsconfig.json b/examples/with-berry/packages/ui/tsconfig.json index 1a0e3e8583394..82301fe47b4db 100644 --- a/examples/with-berry/packages/ui/tsconfig.json +++ b/examples/with-berry/packages/ui/tsconfig.json @@ -1,5 +1,12 @@ { "extends": "@repo/typescript-config/react-library.json", "include": ["."], - "exclude": ["dist", "build", "node_modules"] + "exclude": [ + "dist", + "build", + "node_modules" + ], + "compilerOptions": { + "strictNullChecks": true + } } diff --git a/examples/with-biome/apps/docs/tsconfig.json b/examples/with-biome/apps/docs/tsconfig.json index 97f2df7116fdb..6d598a6a2163b 100644 --- a/examples/with-biome/apps/docs/tsconfig.json +++ b/examples/with-biome/apps/docs/tsconfig.json @@ -5,7 +5,8 @@ { "name": "next" } - ] + ], + "strictNullChecks": true }, "include": [ "**/*.ts", diff --git a/examples/with-biome/apps/web/tsconfig.json b/examples/with-biome/apps/web/tsconfig.json index 97f2df7116fdb..6d598a6a2163b 100644 --- a/examples/with-biome/apps/web/tsconfig.json +++ b/examples/with-biome/apps/web/tsconfig.json @@ -5,7 +5,8 @@ { "name": "next" } - ] + ], + "strictNullChecks": true }, "include": [ "**/*.ts", diff --git a/examples/with-biome/packages/ui/tsconfig.json b/examples/with-biome/packages/ui/tsconfig.json index fa5b1b3f9d353..5793262545022 100644 --- a/examples/with-biome/packages/ui/tsconfig.json +++ b/examples/with-biome/packages/ui/tsconfig.json @@ -1,7 +1,8 @@ { "extends": "@repo/typescript-config/react-library.json", "compilerOptions": { - "outDir": "dist" + "outDir": "dist", + "strictNullChecks": true }, "include": ["src"], "exclude": ["node_modules", "dist"] diff --git a/examples/with-changesets/apps/docs/tsconfig.json b/examples/with-changesets/apps/docs/tsconfig.json index 033334d97e6d8..f16e55c2932a3 100644 --- a/examples/with-changesets/apps/docs/tsconfig.json +++ b/examples/with-changesets/apps/docs/tsconfig.json @@ -8,7 +8,8 @@ { "name": "next" } - ] + ], + "strictNullChecks": true }, "include": ["src", "next-env.d.ts", ".next/types/**/*.ts"] } diff --git a/examples/with-changesets/packages/acme-core/tsconfig.json b/examples/with-changesets/packages/acme-core/tsconfig.json index 9be70c06b4493..bbc6d43ee8701 100644 --- a/examples/with-changesets/packages/acme-core/tsconfig.json +++ b/examples/with-changesets/packages/acme-core/tsconfig.json @@ -1,5 +1,12 @@ { "extends": "@acme/tsconfig/react-library.json", "include": ["."], - "exclude": ["dist", "build", "node_modules"] + "exclude": [ + "dist", + "build", + "node_modules" + ], + "compilerOptions": { + "strictNullChecks": true + } } diff --git a/examples/with-changesets/packages/acme-utils/tsconfig.json b/examples/with-changesets/packages/acme-utils/tsconfig.json index 9be70c06b4493..bbc6d43ee8701 100644 --- a/examples/with-changesets/packages/acme-utils/tsconfig.json +++ b/examples/with-changesets/packages/acme-utils/tsconfig.json @@ -1,5 +1,12 @@ { "extends": "@acme/tsconfig/react-library.json", "include": ["."], - "exclude": ["dist", "build", "node_modules"] + "exclude": [ + "dist", + "build", + "node_modules" + ], + "compilerOptions": { + "strictNullChecks": true + } } diff --git a/examples/with-docker/apps/api/tsconfig.json b/examples/with-docker/apps/api/tsconfig.json index 46881a0092175..5c8f747e2eba2 100644 --- a/examples/with-docker/apps/api/tsconfig.json +++ b/examples/with-docker/apps/api/tsconfig.json @@ -3,7 +3,8 @@ "compilerOptions": { "lib": ["ES2015"], "outDir": "./dist", - "rootDir": "./src" + "rootDir": "./src", + "strictNullChecks": true }, "exclude": ["node_modules"], "include": ["src"] diff --git a/examples/with-docker/apps/web/tsconfig.json b/examples/with-docker/apps/web/tsconfig.json index 8a4ebc47a37db..b5fd6f7072d4c 100644 --- a/examples/with-docker/apps/web/tsconfig.json +++ b/examples/with-docker/apps/web/tsconfig.json @@ -1,7 +1,12 @@ { "extends": "@repo/typescript-config/nextjs.json", "compilerOptions": { - "plugins": [{ "name": "next" }] + "plugins": [ + { + "name": "next" + } + ], + "strictNullChecks": true }, "include": ["next-env.d.ts", "next.config.js", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], "exclude": ["node_modules"] diff --git a/examples/with-docker/packages/logger/tsconfig.json b/examples/with-docker/packages/logger/tsconfig.json index 0ebbe11121b89..7a773f67154da 100644 --- a/examples/with-docker/packages/logger/tsconfig.json +++ b/examples/with-docker/packages/logger/tsconfig.json @@ -4,7 +4,11 @@ "lib": ["ES2015", "DOM"], "outDir": "./dist", "rootDir": "./src", - "types": ["jest", "node"] + "types": [ + "jest", + "node" + ], + "strictNullChecks": true }, "include": ["src"], "exclude": ["node_modules"] diff --git a/examples/with-docker/packages/ui/tsconfig.json b/examples/with-docker/packages/ui/tsconfig.json index 1a0e3e8583394..82301fe47b4db 100644 --- a/examples/with-docker/packages/ui/tsconfig.json +++ b/examples/with-docker/packages/ui/tsconfig.json @@ -1,5 +1,12 @@ { "extends": "@repo/typescript-config/react-library.json", "include": ["."], - "exclude": ["dist", "build", "node_modules"] + "exclude": [ + "dist", + "build", + "node_modules" + ], + "compilerOptions": { + "strictNullChecks": true + } } diff --git a/examples/with-gatsby/apps/docs/tsconfig.json b/examples/with-gatsby/apps/docs/tsconfig.json index fc21b73eade0e..b854fd78856f3 100644 --- a/examples/with-gatsby/apps/docs/tsconfig.json +++ b/examples/with-gatsby/apps/docs/tsconfig.json @@ -1,5 +1,10 @@ { "extends": "@repo/typescript-config/nextjs.json", "include": ["next-env.d.ts", "next.config.js", "**/*.ts", "**/*.tsx"], - "exclude": ["node_modules"] + "exclude": [ + "node_modules" + ], + "compilerOptions": { + "strictNullChecks": true + } } diff --git a/examples/with-gatsby/apps/web/tsconfig.json b/examples/with-gatsby/apps/web/tsconfig.json index 00063ad99f37a..68aef3d9b4b63 100644 --- a/examples/with-gatsby/apps/web/tsconfig.json +++ b/examples/with-gatsby/apps/web/tsconfig.json @@ -1,5 +1,10 @@ { "extends": "@repo/typescript-config/gatsby.json", "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], - "exclude": ["node_modules"] + "exclude": [ + "node_modules" + ], + "compilerOptions": { + "strictNullChecks": true + } } diff --git a/examples/with-gatsby/packages/ui/tsconfig.json b/examples/with-gatsby/packages/ui/tsconfig.json index 1a0e3e8583394..82301fe47b4db 100644 --- a/examples/with-gatsby/packages/ui/tsconfig.json +++ b/examples/with-gatsby/packages/ui/tsconfig.json @@ -1,5 +1,12 @@ { "extends": "@repo/typescript-config/react-library.json", "include": ["."], - "exclude": ["dist", "build", "node_modules"] + "exclude": [ + "dist", + "build", + "node_modules" + ], + "compilerOptions": { + "strictNullChecks": true + } } diff --git a/examples/with-microfrontends/apps/docs/tsconfig.json b/examples/with-microfrontends/apps/docs/tsconfig.json index 7aef056980d56..efd817de77baa 100644 --- a/examples/with-microfrontends/apps/docs/tsconfig.json +++ b/examples/with-microfrontends/apps/docs/tsconfig.json @@ -5,7 +5,8 @@ { "name": "next" } - ] + ], + "strictNullChecks": true }, "include": [ "**/*.ts", diff --git a/examples/with-microfrontends/apps/vite/tsconfig.node.json b/examples/with-microfrontends/apps/vite/tsconfig.node.json index 42872c59f5b01..ef0fd3f5032d7 100644 --- a/examples/with-microfrontends/apps/vite/tsconfig.node.json +++ b/examples/with-microfrontends/apps/vite/tsconfig.node.json @@ -4,7 +4,8 @@ "skipLibCheck": true, "module": "ESNext", "moduleResolution": "bundler", - "allowSyntheticDefaultImports": true + "allowSyntheticDefaultImports": true, + "strictNullChecks": true }, "include": ["vite.config.ts"] } diff --git a/examples/with-microfrontends/apps/web/tsconfig.json b/examples/with-microfrontends/apps/web/tsconfig.json index 7aef056980d56..efd817de77baa 100644 --- a/examples/with-microfrontends/apps/web/tsconfig.json +++ b/examples/with-microfrontends/apps/web/tsconfig.json @@ -5,7 +5,8 @@ { "name": "next" } - ] + ], + "strictNullChecks": true }, "include": [ "**/*.ts", diff --git a/examples/with-microfrontends/packages/ui/tsconfig.json b/examples/with-microfrontends/packages/ui/tsconfig.json index ca86687c4bb77..ed023ce414ae3 100644 --- a/examples/with-microfrontends/packages/ui/tsconfig.json +++ b/examples/with-microfrontends/packages/ui/tsconfig.json @@ -1,7 +1,8 @@ { "extends": "@repo/typescript-config/react-library.json", "compilerOptions": { - "outDir": "dist" + "outDir": "dist", + "strictNullChecks": true }, "include": ["src"], "exclude": ["node_modules", "dist"] diff --git a/examples/with-nestjs/apps/api/tsconfig.build.json b/examples/with-nestjs/apps/api/tsconfig.build.json index 131a9fd186e29..e3635d65b742c 100644 --- a/examples/with-nestjs/apps/api/tsconfig.build.json +++ b/examples/with-nestjs/apps/api/tsconfig.build.json @@ -1,4 +1,16 @@ { "extends": "./tsconfig.json", - "exclude": ["node_modules", "test", "dist", "**/*spec.ts", ".prettierrc.mjs", "eslint.config.mjs", "jest.config.mjs", "jest.config.ts"] + "exclude": [ + "node_modules", + "test", + "dist", + "**/*spec.ts", + ".prettierrc.mjs", + "eslint.config.mjs", + "jest.config.mjs", + "jest.config.ts" + ], + "compilerOptions": { + "strictNullChecks": true + } } diff --git a/examples/with-nestjs/apps/api/tsconfig.json b/examples/with-nestjs/apps/api/tsconfig.json index a471e64843ed8..89df443633cd7 100644 --- a/examples/with-nestjs/apps/api/tsconfig.json +++ b/examples/with-nestjs/apps/api/tsconfig.json @@ -2,6 +2,7 @@ "extends": "@repo/typescript-config/nestjs.json", "compilerOptions": { "baseUrl": "./", - "outDir": "./dist" + "outDir": "./dist", + "strictNullChecks": true } } diff --git a/examples/with-nestjs/apps/web/tsconfig.json b/examples/with-nestjs/apps/web/tsconfig.json index 7aef056980d56..efd817de77baa 100644 --- a/examples/with-nestjs/apps/web/tsconfig.json +++ b/examples/with-nestjs/apps/web/tsconfig.json @@ -5,7 +5,8 @@ { "name": "next" } - ] + ], + "strictNullChecks": true }, "include": [ "**/*.ts", diff --git a/examples/with-nestjs/packages/api/tsconfig.json b/examples/with-nestjs/packages/api/tsconfig.json index 667e5d6bdd559..480b23eaf5556 100644 --- a/examples/with-nestjs/packages/api/tsconfig.json +++ b/examples/with-nestjs/packages/api/tsconfig.json @@ -6,7 +6,10 @@ "esModuleInterop": true, "incremental": false, "outDir": "dist", - "types": ["node"] + "types": [ + "node" + ], + "strictNullChecks": true }, "include": ["src"], "exclude": ["node_modules", "test", "dist", "**/*spec.ts"] diff --git a/examples/with-nestjs/packages/jest-config/tsconfig.json b/examples/with-nestjs/packages/jest-config/tsconfig.json index 0a7a0dd2b6e52..045f8613dac41 100644 --- a/examples/with-nestjs/packages/jest-config/tsconfig.json +++ b/examples/with-nestjs/packages/jest-config/tsconfig.json @@ -9,7 +9,8 @@ "module": "commonjs", "moduleResolution": "Node10", "outDir": "dist", - "baseUrl": "src" + "baseUrl": "src", + "strictNullChecks": true }, "include": ["src"], "exclude": ["node_modules", "test", "dist", "**/*spec.ts"] diff --git a/examples/with-nestjs/packages/ui/tsconfig.json b/examples/with-nestjs/packages/ui/tsconfig.json index ca86687c4bb77..ed023ce414ae3 100644 --- a/examples/with-nestjs/packages/ui/tsconfig.json +++ b/examples/with-nestjs/packages/ui/tsconfig.json @@ -1,7 +1,8 @@ { "extends": "@repo/typescript-config/react-library.json", "compilerOptions": { - "outDir": "dist" + "outDir": "dist", + "strictNullChecks": true }, "include": ["src"], "exclude": ["node_modules", "dist"] diff --git a/examples/with-nestjs/tsconfig.json b/examples/with-nestjs/tsconfig.json index c8a018d0fd8d8..40bae8b0d66c6 100644 --- a/examples/with-nestjs/tsconfig.json +++ b/examples/with-nestjs/tsconfig.json @@ -1,3 +1,6 @@ { - "extends": "@repo/typescript-config/base.json" + "extends": "@repo/typescript-config/base.json", + "compilerOptions": { + "strictNullChecks": true + } } diff --git a/examples/with-npm/apps/docs/tsconfig.json b/examples/with-npm/apps/docs/tsconfig.json index 24e754815b408..36efe2bb5ac87 100644 --- a/examples/with-npm/apps/docs/tsconfig.json +++ b/examples/with-npm/apps/docs/tsconfig.json @@ -5,7 +5,8 @@ { "name": "next" } - ] + ], + "strictNullChecks": true }, "include": [ "next-env.d.ts", diff --git a/examples/with-npm/apps/web/tsconfig.json b/examples/with-npm/apps/web/tsconfig.json index 24e754815b408..36efe2bb5ac87 100644 --- a/examples/with-npm/apps/web/tsconfig.json +++ b/examples/with-npm/apps/web/tsconfig.json @@ -5,7 +5,8 @@ { "name": "next" } - ] + ], + "strictNullChecks": true }, "include": [ "next-env.d.ts", diff --git a/examples/with-npm/packages/ui/tsconfig.json b/examples/with-npm/packages/ui/tsconfig.json index ca86687c4bb77..ed023ce414ae3 100644 --- a/examples/with-npm/packages/ui/tsconfig.json +++ b/examples/with-npm/packages/ui/tsconfig.json @@ -1,7 +1,8 @@ { "extends": "@repo/typescript-config/react-library.json", "compilerOptions": { - "outDir": "dist" + "outDir": "dist", + "strictNullChecks": true }, "include": ["src"], "exclude": ["node_modules", "dist"] diff --git a/examples/with-npm/packages/ui/tsconfig.lint.json b/examples/with-npm/packages/ui/tsconfig.lint.json index df2762ee5f6a6..99248a4eac515 100644 --- a/examples/with-npm/packages/ui/tsconfig.lint.json +++ b/examples/with-npm/packages/ui/tsconfig.lint.json @@ -1,7 +1,8 @@ { "extends": "@repo/typescript-config/react-library.json", "compilerOptions": { - "outDir": "dist" + "outDir": "dist", + "strictNullChecks": true }, "include": ["src", "turbo"], "exclude": ["node_modules", "dist"] diff --git a/examples/with-prisma/apps/web/tsconfig.json b/examples/with-prisma/apps/web/tsconfig.json index 695a455599dd2..36efe2bb5ac87 100644 --- a/examples/with-prisma/apps/web/tsconfig.json +++ b/examples/with-prisma/apps/web/tsconfig.json @@ -1,6 +1,13 @@ { "extends": "@repo/typescript-config/nextjs.json", - "compilerOptions": { "plugins": [{ "name": "next" }] }, + "compilerOptions": { + "plugins": [ + { + "name": "next" + } + ], + "strictNullChecks": true + }, "include": [ "next-env.d.ts", "next.config.js", diff --git a/examples/with-prisma/packages/database/tsconfig.json b/examples/with-prisma/packages/database/tsconfig.json index a7f7fdee249be..1e719c3b07d4a 100644 --- a/examples/with-prisma/packages/database/tsconfig.json +++ b/examples/with-prisma/packages/database/tsconfig.json @@ -1,5 +1,10 @@ { "extends": "@repo/typescript-config/base.json", "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "tsup.config.ts"], - "exclude": ["node_modules"] + "exclude": [ + "node_modules" + ], + "compilerOptions": { + "strictNullChecks": true + } } diff --git a/examples/with-react-native-web/apps/web/tsconfig.json b/examples/with-react-native-web/apps/web/tsconfig.json index 4b6db576751f6..f458ab99482b5 100644 --- a/examples/with-react-native-web/apps/web/tsconfig.json +++ b/examples/with-react-native-web/apps/web/tsconfig.json @@ -1,7 +1,12 @@ { "extends": "@repo/typescript-config/nextjs.json", "compilerOptions": { - "plugins": [{ "name": "next" }] + "plugins": [ + { + "name": "next" + } + ], + "strictNullChecks": true }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], "exclude": ["node_modules"] diff --git a/examples/with-rollup/apps/web/tsconfig.json b/examples/with-rollup/apps/web/tsconfig.json index 4ad59adf6a9b5..97afba9e2b5f6 100644 --- a/examples/with-rollup/apps/web/tsconfig.json +++ b/examples/with-rollup/apps/web/tsconfig.json @@ -1,7 +1,12 @@ { "extends": "@repo/typescript-config/nextjs.json", "compilerOptions": { - "plugins": [{ "name": "next" }] + "plugins": [ + { + "name": "next" + } + ], + "strictNullChecks": true }, "include": [ "next-env.d.ts", diff --git a/examples/with-rollup/packages/ui/tsconfig.json b/examples/with-rollup/packages/ui/tsconfig.json index 1a0e3e8583394..82301fe47b4db 100644 --- a/examples/with-rollup/packages/ui/tsconfig.json +++ b/examples/with-rollup/packages/ui/tsconfig.json @@ -1,5 +1,12 @@ { "extends": "@repo/typescript-config/react-library.json", "include": ["."], - "exclude": ["dist", "build", "node_modules"] + "exclude": [ + "dist", + "build", + "node_modules" + ], + "compilerOptions": { + "strictNullChecks": true + } } diff --git a/examples/with-solid/packages/ui/tsconfig.json b/examples/with-solid/packages/ui/tsconfig.json index d1d15697783a2..14521c4e18596 100644 --- a/examples/with-solid/packages/ui/tsconfig.json +++ b/examples/with-solid/packages/ui/tsconfig.json @@ -8,6 +8,7 @@ "compilerOptions": { "esModuleInterop": true, "jsx": "preserve", - "jsxImportSource": "solid-js" + "jsxImportSource": "solid-js", + "strictNullChecks": true } } diff --git a/examples/with-svelte/apps/docs/tsconfig.json b/examples/with-svelte/apps/docs/tsconfig.json index a4804deb86134..896810bd50a75 100644 --- a/examples/with-svelte/apps/docs/tsconfig.json +++ b/examples/with-svelte/apps/docs/tsconfig.json @@ -1,3 +1,9 @@ { - "extends": ["@repo/typescript-config/svelte.json", "./.svelte-kit/tsconfig.json"] + "extends": [ + "@repo/typescript-config/svelte.json", + "./.svelte-kit/tsconfig.json" + ], + "compilerOptions": { + "strictNullChecks": true + } } diff --git a/examples/with-svelte/apps/web/tsconfig.json b/examples/with-svelte/apps/web/tsconfig.json index a4804deb86134..896810bd50a75 100644 --- a/examples/with-svelte/apps/web/tsconfig.json +++ b/examples/with-svelte/apps/web/tsconfig.json @@ -1,3 +1,9 @@ { - "extends": ["@repo/typescript-config/svelte.json", "./.svelte-kit/tsconfig.json"] + "extends": [ + "@repo/typescript-config/svelte.json", + "./.svelte-kit/tsconfig.json" + ], + "compilerOptions": { + "strictNullChecks": true + } } diff --git a/examples/with-svelte/packages/ui/tsconfig.json b/examples/with-svelte/packages/ui/tsconfig.json index c8ef003b3fcab..762895acee90e 100644 --- a/examples/with-svelte/packages/ui/tsconfig.json +++ b/examples/with-svelte/packages/ui/tsconfig.json @@ -3,7 +3,8 @@ "compilerOptions": { "declaration": true, "declarationMap": true, - "allowArbitraryExtensions": true + "allowArbitraryExtensions": true, + "strictNullChecks": true }, "include": ["dist", "./src/**/*.svelte", "./src/**/*.ts"], "exclude": ["node_modules", ".svelte-kit"] diff --git a/examples/with-tailwind/apps/docs/tsconfig.json b/examples/with-tailwind/apps/docs/tsconfig.json index df214c3cd94a7..a3508e44b310b 100644 --- a/examples/with-tailwind/apps/docs/tsconfig.json +++ b/examples/with-tailwind/apps/docs/tsconfig.json @@ -5,7 +5,8 @@ { "name": "next" } - ] + ], + "strictNullChecks": true }, "include": [ "**/*.ts", diff --git a/examples/with-tailwind/apps/web/tsconfig.json b/examples/with-tailwind/apps/web/tsconfig.json index df214c3cd94a7..a3508e44b310b 100644 --- a/examples/with-tailwind/apps/web/tsconfig.json +++ b/examples/with-tailwind/apps/web/tsconfig.json @@ -5,7 +5,8 @@ { "name": "next" } - ] + ], + "strictNullChecks": true }, "include": [ "**/*.ts", diff --git a/examples/with-tailwind/packages/ui/tsconfig.json b/examples/with-tailwind/packages/ui/tsconfig.json index fbb9950d4d04b..37743d50a03a4 100644 --- a/examples/with-tailwind/packages/ui/tsconfig.json +++ b/examples/with-tailwind/packages/ui/tsconfig.json @@ -1,7 +1,8 @@ { "extends": "@repo/typescript-config/react-library.json", "compilerOptions": { - "outDir": "dist" + "outDir": "dist", + "strictNullChecks": true }, "include": ["src"], "exclude": ["dist", "build", "node_modules"] diff --git a/examples/with-typeorm/apps/docs/tsconfig.json b/examples/with-typeorm/apps/docs/tsconfig.json index 24e754815b408..36efe2bb5ac87 100644 --- a/examples/with-typeorm/apps/docs/tsconfig.json +++ b/examples/with-typeorm/apps/docs/tsconfig.json @@ -5,7 +5,8 @@ { "name": "next" } - ] + ], + "strictNullChecks": true }, "include": [ "next-env.d.ts", diff --git a/examples/with-typeorm/apps/web/tsconfig.json b/examples/with-typeorm/apps/web/tsconfig.json index 24e754815b408..36efe2bb5ac87 100644 --- a/examples/with-typeorm/apps/web/tsconfig.json +++ b/examples/with-typeorm/apps/web/tsconfig.json @@ -5,7 +5,8 @@ { "name": "next" } - ] + ], + "strictNullChecks": true }, "include": [ "next-env.d.ts", diff --git a/examples/with-typeorm/packages/typeorm-service/tsconfig.json b/examples/with-typeorm/packages/typeorm-service/tsconfig.json index ceba884094692..7ebf7afe8e0c3 100755 --- a/examples/with-typeorm/packages/typeorm-service/tsconfig.json +++ b/examples/with-typeorm/packages/typeorm-service/tsconfig.json @@ -5,6 +5,7 @@ "compilerOptions": { "emitDecoratorMetadata": true, "experimentalDecorators": true, - "esModuleInterop": true + "esModuleInterop": true, + "strictNullChecks": true } } diff --git a/examples/with-typeorm/packages/ui/tsconfig.json b/examples/with-typeorm/packages/ui/tsconfig.json index ca86687c4bb77..ed023ce414ae3 100644 --- a/examples/with-typeorm/packages/ui/tsconfig.json +++ b/examples/with-typeorm/packages/ui/tsconfig.json @@ -1,7 +1,8 @@ { "extends": "@repo/typescript-config/react-library.json", "compilerOptions": { - "outDir": "dist" + "outDir": "dist", + "strictNullChecks": true }, "include": ["src"], "exclude": ["node_modules", "dist"] diff --git a/examples/with-typeorm/packages/ui/tsconfig.lint.json b/examples/with-typeorm/packages/ui/tsconfig.lint.json index df2762ee5f6a6..99248a4eac515 100644 --- a/examples/with-typeorm/packages/ui/tsconfig.lint.json +++ b/examples/with-typeorm/packages/ui/tsconfig.lint.json @@ -1,7 +1,8 @@ { "extends": "@repo/typescript-config/react-library.json", "compilerOptions": { - "outDir": "dist" + "outDir": "dist", + "strictNullChecks": true }, "include": ["src", "turbo"], "exclude": ["node_modules", "dist"] diff --git a/examples/with-typeorm/tsconfig.json b/examples/with-typeorm/tsconfig.json index c8a018d0fd8d8..40bae8b0d66c6 100644 --- a/examples/with-typeorm/tsconfig.json +++ b/examples/with-typeorm/tsconfig.json @@ -1,3 +1,6 @@ { - "extends": "@repo/typescript-config/base.json" + "extends": "@repo/typescript-config/base.json", + "compilerOptions": { + "strictNullChecks": true + } } diff --git a/examples/with-vite-react/apps/web/tsconfig.json b/examples/with-vite-react/apps/web/tsconfig.json index 9e7332df04643..0fcc7fec7bc9a 100644 --- a/examples/with-vite-react/apps/web/tsconfig.json +++ b/examples/with-vite-react/apps/web/tsconfig.json @@ -2,6 +2,7 @@ "extends": "@repo/typescript-config/vite.json", "include": ["src"], "compilerOptions": { - "jsx": "react-jsx" + "jsx": "react-jsx", + "strictNullChecks": true } } \ No newline at end of file diff --git a/examples/with-vite-react/packages/ui/tsconfig.json b/examples/with-vite-react/packages/ui/tsconfig.json index 2ce5e4d6e55ee..646d66dc025f9 100644 --- a/examples/with-vite-react/packages/ui/tsconfig.json +++ b/examples/with-vite-react/packages/ui/tsconfig.json @@ -1,5 +1,10 @@ { "extends": "@repo/typescript-config/react-library.json", "include": ["."], - "exclude": ["node_modules"] + "exclude": [ + "node_modules" + ], + "compilerOptions": { + "strictNullChecks": true + } } diff --git a/examples/with-vite/apps/docs/tsconfig.json b/examples/with-vite/apps/docs/tsconfig.json index 140bfb51d9e9b..64ec97e51a190 100644 --- a/examples/with-vite/apps/docs/tsconfig.json +++ b/examples/with-vite/apps/docs/tsconfig.json @@ -1,4 +1,9 @@ { "extends": "@repo/typescript-config/vite.json", - "include": ["src"] + "include": [ + "src" + ], + "compilerOptions": { + "strictNullChecks": true + } } diff --git a/examples/with-vite/apps/web/tsconfig.json b/examples/with-vite/apps/web/tsconfig.json index 140bfb51d9e9b..64ec97e51a190 100644 --- a/examples/with-vite/apps/web/tsconfig.json +++ b/examples/with-vite/apps/web/tsconfig.json @@ -1,4 +1,9 @@ { "extends": "@repo/typescript-config/vite.json", - "include": ["src"] + "include": [ + "src" + ], + "compilerOptions": { + "strictNullChecks": true + } } diff --git a/examples/with-vite/packages/ui/tsconfig.json b/examples/with-vite/packages/ui/tsconfig.json index 317a25af71c59..1b2c9012501d7 100644 --- a/examples/with-vite/packages/ui/tsconfig.json +++ b/examples/with-vite/packages/ui/tsconfig.json @@ -1,5 +1,10 @@ { "extends": "@repo/typescript-config/base.json", "include": ["."], - "exclude": ["node_modules"] + "exclude": [ + "node_modules" + ], + "compilerOptions": { + "strictNullChecks": true + } } diff --git a/examples/with-vitest/apps/docs/tsconfig.json b/examples/with-vitest/apps/docs/tsconfig.json index 7aef056980d56..efd817de77baa 100644 --- a/examples/with-vitest/apps/docs/tsconfig.json +++ b/examples/with-vitest/apps/docs/tsconfig.json @@ -5,7 +5,8 @@ { "name": "next" } - ] + ], + "strictNullChecks": true }, "include": [ "**/*.ts", diff --git a/examples/with-vitest/apps/web/tsconfig.json b/examples/with-vitest/apps/web/tsconfig.json index 7aef056980d56..efd817de77baa 100644 --- a/examples/with-vitest/apps/web/tsconfig.json +++ b/examples/with-vitest/apps/web/tsconfig.json @@ -5,7 +5,8 @@ { "name": "next" } - ] + ], + "strictNullChecks": true }, "include": [ "**/*.ts", diff --git a/examples/with-vitest/packages/math/tsconfig.json b/examples/with-vitest/packages/math/tsconfig.json index c6daff1842515..c87ed37cf389d 100644 --- a/examples/with-vitest/packages/math/tsconfig.json +++ b/examples/with-vitest/packages/math/tsconfig.json @@ -2,7 +2,8 @@ "extends": "@repo/typescript-config/base.json", "compilerOptions": { "outDir": "dist", - "rootDir": "src" + "rootDir": "src", + "strictNullChecks": true }, "include": ["src"], "exclude": ["node_modules", "dist"] diff --git a/examples/with-vitest/packages/ui/tsconfig.json b/examples/with-vitest/packages/ui/tsconfig.json index ca86687c4bb77..ed023ce414ae3 100644 --- a/examples/with-vitest/packages/ui/tsconfig.json +++ b/examples/with-vitest/packages/ui/tsconfig.json @@ -1,7 +1,8 @@ { "extends": "@repo/typescript-config/react-library.json", "compilerOptions": { - "outDir": "dist" + "outDir": "dist", + "strictNullChecks": true }, "include": ["src"], "exclude": ["node_modules", "dist"] diff --git a/examples/with-vitest/packages/vitest-config/tsconfig.json b/examples/with-vitest/packages/vitest-config/tsconfig.json index 35ad0d9dd8785..52c8f27e25f51 100644 --- a/examples/with-vitest/packages/vitest-config/tsconfig.json +++ b/examples/with-vitest/packages/vitest-config/tsconfig.json @@ -2,7 +2,8 @@ "extends": "@repo/typescript-config/base.json", "compilerOptions": { "outDir": "dist", - "rootDir": "src" + "rootDir": "src", + "strictNullChecks": true }, "include": ["src"], "exclude": ["dist", "node_modules"] diff --git a/examples/with-vue-nuxt/apps/docs/server/tsconfig.json b/examples/with-vue-nuxt/apps/docs/server/tsconfig.json index b9ed69c19eaf3..f90142ece268d 100644 --- a/examples/with-vue-nuxt/apps/docs/server/tsconfig.json +++ b/examples/with-vue-nuxt/apps/docs/server/tsconfig.json @@ -1,3 +1,6 @@ { - "extends": "../.nuxt/tsconfig.server.json" + "extends": "../.nuxt/tsconfig.server.json", + "compilerOptions": { + "strictNullChecks": true + } } diff --git a/examples/with-vue-nuxt/apps/docs/tsconfig.json b/examples/with-vue-nuxt/apps/docs/tsconfig.json index a746f2a70c289..bff7515c8944e 100644 --- a/examples/with-vue-nuxt/apps/docs/tsconfig.json +++ b/examples/with-vue-nuxt/apps/docs/tsconfig.json @@ -1,4 +1,7 @@ { // https://nuxt.com/docs/guide/concepts/typescript - "extends": "./.nuxt/tsconfig.json" + "extends": "./.nuxt/tsconfig.json", + "compilerOptions": { + "strictNullChecks": true + } } diff --git a/examples/with-vue-nuxt/apps/web/tsconfig.app.json b/examples/with-vue-nuxt/apps/web/tsconfig.app.json index a76b43304e85d..b309faf4a73cc 100644 --- a/examples/with-vue-nuxt/apps/web/tsconfig.app.json +++ b/examples/with-vue-nuxt/apps/web/tsconfig.app.json @@ -7,6 +7,7 @@ "baseUrl": ".", "paths": { "@/*": ["./src/*"] - } + }, + "strictNullChecks": true } } diff --git a/examples/with-vue-nuxt/apps/web/tsconfig.json b/examples/with-vue-nuxt/apps/web/tsconfig.json index 66b5e5703e83c..c431bf10d38db 100644 --- a/examples/with-vue-nuxt/apps/web/tsconfig.json +++ b/examples/with-vue-nuxt/apps/web/tsconfig.json @@ -7,5 +7,8 @@ { "path": "./tsconfig.app.json" } - ] + ], + "compilerOptions": { + "strictNullChecks": true + } } diff --git a/examples/with-vue-nuxt/apps/web/tsconfig.node.json b/examples/with-vue-nuxt/apps/web/tsconfig.node.json index dee96bed470be..e761336ed5e85 100644 --- a/examples/with-vue-nuxt/apps/web/tsconfig.node.json +++ b/examples/with-vue-nuxt/apps/web/tsconfig.node.json @@ -11,6 +11,9 @@ "composite": true, "module": "ESNext", "moduleResolution": "Bundler", - "types": ["node"] + "types": [ + "node" + ], + "strictNullChecks": true } } diff --git a/examples/with-vue-nuxt/packages/ui/tsconfig.json b/examples/with-vue-nuxt/packages/ui/tsconfig.json index e1e7a92bf720e..cd4939c345376 100644 --- a/examples/with-vue-nuxt/packages/ui/tsconfig.json +++ b/examples/with-vue-nuxt/packages/ui/tsconfig.json @@ -1,5 +1,12 @@ { "extends": "tsconfig/vue.json", "include": ["."], - "exclude": ["dist", "build", "node_modules"] + "exclude": [ + "dist", + "build", + "node_modules" + ], + "compilerOptions": { + "strictNullChecks": true + } } diff --git a/examples/with-yarn/apps/docs/tsconfig.json b/examples/with-yarn/apps/docs/tsconfig.json index 24e754815b408..36efe2bb5ac87 100644 --- a/examples/with-yarn/apps/docs/tsconfig.json +++ b/examples/with-yarn/apps/docs/tsconfig.json @@ -5,7 +5,8 @@ { "name": "next" } - ] + ], + "strictNullChecks": true }, "include": [ "next-env.d.ts", diff --git a/examples/with-yarn/apps/web/tsconfig.json b/examples/with-yarn/apps/web/tsconfig.json index 24e754815b408..36efe2bb5ac87 100644 --- a/examples/with-yarn/apps/web/tsconfig.json +++ b/examples/with-yarn/apps/web/tsconfig.json @@ -5,7 +5,8 @@ { "name": "next" } - ] + ], + "strictNullChecks": true }, "include": [ "next-env.d.ts", diff --git a/examples/with-yarn/packages/ui/tsconfig.json b/examples/with-yarn/packages/ui/tsconfig.json index ca86687c4bb77..ed023ce414ae3 100644 --- a/examples/with-yarn/packages/ui/tsconfig.json +++ b/examples/with-yarn/packages/ui/tsconfig.json @@ -1,7 +1,8 @@ { "extends": "@repo/typescript-config/react-library.json", "compilerOptions": { - "outDir": "dist" + "outDir": "dist", + "strictNullChecks": true }, "include": ["src"], "exclude": ["node_modules", "dist"] diff --git a/examples/with-yarn/packages/ui/tsconfig.lint.json b/examples/with-yarn/packages/ui/tsconfig.lint.json index df2762ee5f6a6..99248a4eac515 100644 --- a/examples/with-yarn/packages/ui/tsconfig.lint.json +++ b/examples/with-yarn/packages/ui/tsconfig.lint.json @@ -1,7 +1,8 @@ { "extends": "@repo/typescript-config/react-library.json", "compilerOptions": { - "outDir": "dist" + "outDir": "dist", + "strictNullChecks": true }, "include": ["src", "turbo"], "exclude": ["node_modules", "dist"] diff --git a/lockfile-tests/check-lockfiles.ts b/lockfile-tests/check-lockfiles.ts index 134e13b6fcb24..69bf82acc9352 100644 --- a/lockfile-tests/check-lockfiles.ts +++ b/lockfile-tests/check-lockfiles.ts @@ -18,9 +18,9 @@ * pnpm check-lockfiles --turbo-path ./path/to/turbo # Custom turbo binary */ -import * as fs from "fs"; -import * as path from "path"; -import { fileURLToPath } from "url"; +import * as fs from "node:fs"; +import * as path from "node:path"; +import { fileURLToPath } from "node:url"; import type { PackageManagerType, TestCase } from "./types"; import { LocalRunner } from "./runners/local"; @@ -80,7 +80,7 @@ function parseArgs(): CliArgs { args.turboPath = next; i++; } else if (arg === "--concurrency" && next) { - args.concurrency = parseInt(next, 10); + args.concurrency = Number.parseInt(next, 10); i++; } } diff --git a/lockfile-tests/fixtures/berry-builtin/package.json b/lockfile-tests/fixtures/berry-builtin/package.json index 87044b60db339..42228a94d42b4 100644 --- a/lockfile-tests/fixtures/berry-builtin/package.json +++ b/lockfile-tests/fixtures/berry-builtin/package.json @@ -2,8 +2,8 @@ "name": "prune-edge", "version": "0.0.0", "private": true, - "packageManager": "yarn@3.6.0", "workspaces": [ "packages/*" - ] + ], + "packageManager": "yarn@3.6.0" } diff --git a/lockfile-tests/fixtures/berry-protocol-collision/package.json b/lockfile-tests/fixtures/berry-protocol-collision/package.json index 87044b60db339..42228a94d42b4 100644 --- a/lockfile-tests/fixtures/berry-protocol-collision/package.json +++ b/lockfile-tests/fixtures/berry-protocol-collision/package.json @@ -2,8 +2,8 @@ "name": "prune-edge", "version": "0.0.0", "private": true, - "packageManager": "yarn@3.6.0", "workspaces": [ "packages/*" - ] + ], + "packageManager": "yarn@3.6.0" } diff --git a/lockfile-tests/fixtures/berry/package.json b/lockfile-tests/fixtures/berry/package.json index fe462f3bcbca6..c7c0566805797 100644 --- a/lockfile-tests/fixtures/berry/package.json +++ b/lockfile-tests/fixtures/berry/package.json @@ -2,7 +2,6 @@ "name": "berry-patch", "version": "0.0.0", "private": true, - "packageManager": "yarn@3.6.0", "workspaces": [ "apps/*", "packages/*" @@ -11,5 +10,6 @@ "eslint-config-custom": "*", "prettier": "latest", "turbo": "latest" - } + }, + "packageManager": "yarn@3.6.0" } diff --git a/lockfile-tests/fixtures/berry_semver/package.json b/lockfile-tests/fixtures/berry_semver/package.json index 8d61ccbe0aee9..700dd396b48db 100644 --- a/lockfile-tests/fixtures/berry_semver/package.json +++ b/lockfile-tests/fixtures/berry_semver/package.json @@ -2,8 +2,8 @@ "name": "root", "version": "0.0.0", "private": true, - "packageManager": "yarn@3.6.0", "workspaces": [ "packages/*" - ] + ], + "packageManager": "yarn@3.6.0" } diff --git a/lockfile-tests/fixtures/bun-basic/package.json b/lockfile-tests/fixtures/bun-basic/package.json index e9e555d1b589b..ecd09f6d13499 100644 --- a/lockfile-tests/fixtures/bun-basic/package.json +++ b/lockfile-tests/fixtures/bun-basic/package.json @@ -1,9 +1,9 @@ { "name": "bun-basic", "private": true, - "packageManager": "bun@1.2.0", "workspaces": [ "apps/*", "packages/*" - ] + ], + "packageManager": "bun@1.2.0" } diff --git a/lockfile-tests/fixtures/bun-catalog/package.json b/lockfile-tests/fixtures/bun-catalog/package.json index 24a0dda431517..6b44e7956b04e 100644 --- a/lockfile-tests/fixtures/bun-catalog/package.json +++ b/lockfile-tests/fixtures/bun-catalog/package.json @@ -1,7 +1,6 @@ { "name": "bun-catalog", "private": true, - "packageManager": "bun@1.3.5", "workspaces": { "packages": [ "apps/*", @@ -11,5 +10,6 @@ "lodash": "^4.17.21", "is-odd": "^3.0.1" } - } + }, + "packageManager": "bun@1.3.5" } diff --git a/lockfile-tests/fixtures/bun-peer-dep/package.json b/lockfile-tests/fixtures/bun-peer-dep/package.json index 8828f57234869..896f6979da4ff 100644 --- a/lockfile-tests/fixtures/bun-peer-dep/package.json +++ b/lockfile-tests/fixtures/bun-peer-dep/package.json @@ -1,9 +1,9 @@ { "name": "bun-peer-dep", "private": true, - "packageManager": "bun@1.2.0", "workspaces": [ "apps/*", "packages/*" - ] + ], + "packageManager": "bun@1.2.0" } diff --git a/lockfile-tests/fixtures/bun-peer-dep/packages/api/package.json b/lockfile-tests/fixtures/bun-peer-dep/packages/api/package.json index 97bd5442f170e..d3dd16cf1a0c2 100644 --- a/lockfile-tests/fixtures/bun-peer-dep/packages/api/package.json +++ b/lockfile-tests/fixtures/bun-peer-dep/packages/api/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "dependencies": { - "@repo/shared": "*", - "@better-auth/expo": "^1.2.0" + "@better-auth/expo": "^1.2.0", + "@repo/shared": "*" } } diff --git a/lockfile-tests/fixtures/bun-v1-1/package.json b/lockfile-tests/fixtures/bun-v1-1/package.json index d1f7d9be70b15..0da5e01fd2c69 100644 --- a/lockfile-tests/fixtures/bun-v1-1/package.json +++ b/lockfile-tests/fixtures/bun-v1-1/package.json @@ -2,12 +2,12 @@ "name": "bun-v1-test", "version": "0.0.0", "private": true, - "packageManager": "bun@1.2.0", "workspaces": [ "apps/*", "packages/*" ], "devDependencies": { "turbo": "^2.3.3" - } + }, + "packageManager": "bun@1.2.0" } diff --git a/lockfile-tests/fixtures/bun-v1-create-turbo/package.json b/lockfile-tests/fixtures/bun-v1-create-turbo/package.json index 41b1e185b83a2..e033f1a199de2 100644 --- a/lockfile-tests/fixtures/bun-v1-create-turbo/package.json +++ b/lockfile-tests/fixtures/bun-v1-create-turbo/package.json @@ -2,7 +2,6 @@ "name": "bunny", "version": "0.0.0", "private": true, - "packageManager": "bun@1.2.0", "workspaces": [ "apps/*", "packages/*" @@ -11,5 +10,6 @@ "prettier": "^3.6.2", "turbo": "^2.5.8", "typescript": "5.9.2" - } + }, + "packageManager": "bun@1.2.0" } diff --git a/lockfile-tests/fixtures/bun-v1-issue-10410/package.json b/lockfile-tests/fixtures/bun-v1-issue-10410/package.json index 41b1e185b83a2..e033f1a199de2 100644 --- a/lockfile-tests/fixtures/bun-v1-issue-10410/package.json +++ b/lockfile-tests/fixtures/bun-v1-issue-10410/package.json @@ -2,7 +2,6 @@ "name": "bunny", "version": "0.0.0", "private": true, - "packageManager": "bun@1.2.0", "workspaces": [ "apps/*", "packages/*" @@ -11,5 +10,6 @@ "prettier": "^3.6.2", "turbo": "^2.5.8", "typescript": "5.9.2" - } + }, + "packageManager": "bun@1.2.0" } diff --git a/lockfile-tests/fixtures/bun/package.json b/lockfile-tests/fixtures/bun/package.json index 870bbdcff1f99..c5284f91f8295 100644 --- a/lockfile-tests/fixtures/bun/package.json +++ b/lockfile-tests/fixtures/bun/package.json @@ -1,9 +1,9 @@ { "name": "bun-fixture", "private": true, - "packageManager": "bun@1.2.0", "workspaces": [ "apps/*", "packages/*" - ] + ], + "packageManager": "bun@1.2.0" } diff --git a/lockfile-tests/fixtures/issue-10985/package.json b/lockfile-tests/fixtures/issue-10985/package.json index 965216f259186..8bb94f1164bf6 100644 --- a/lockfile-tests/fixtures/issue-10985/package.json +++ b/lockfile-tests/fixtures/issue-10985/package.json @@ -2,9 +2,9 @@ "name": "monorepo", "version": "0.0.0", "private": true, - "packageManager": "npm@10.0.0", "workspaces": [ "apps/*", "packages/*" - ] + ], + "packageManager": "npm@10.0.0" } diff --git a/lockfile-tests/fixtures/minimal-berry-resolutions/package.json b/lockfile-tests/fixtures/minimal-berry-resolutions/package.json index cffc92ebc783c..e3ec62a201bc6 100644 --- a/lockfile-tests/fixtures/minimal-berry-resolutions/package.json +++ b/lockfile-tests/fixtures/minimal-berry-resolutions/package.json @@ -2,8 +2,8 @@ "name": "test", "version": "0.0.0", "private": true, - "packageManager": "yarn@3.6.0", "workspaces": [ "packages/*" - ] + ], + "packageManager": "yarn@3.6.0" } diff --git a/lockfile-tests/fixtures/minimal-berry/package.json b/lockfile-tests/fixtures/minimal-berry/package.json index 83998deadbaf1..518dff85f64d1 100644 --- a/lockfile-tests/fixtures/minimal-berry/package.json +++ b/lockfile-tests/fixtures/minimal-berry/package.json @@ -2,8 +2,8 @@ "name": "minimal-berry", "version": "0.0.0", "private": true, - "packageManager": "yarn@3.6.0", "workspaces": [ "packages/*" - ] + ], + "packageManager": "yarn@3.6.0" } diff --git a/lockfile-tests/fixtures/npm-basic/package.json b/lockfile-tests/fixtures/npm-basic/package.json index 4d3efa0f89d94..be8db0a702584 100644 --- a/lockfile-tests/fixtures/npm-basic/package.json +++ b/lockfile-tests/fixtures/npm-basic/package.json @@ -1,9 +1,9 @@ { "name": "npm-basic", "private": true, - "packageManager": "npm@10.0.0", "workspaces": [ "apps/*", "packages/*" - ] + ], + "packageManager": "npm@10.0.0" } diff --git a/lockfile-tests/fixtures/npm-lock-workspace-variation/package.json b/lockfile-tests/fixtures/npm-lock-workspace-variation/package.json index afac2904c9901..7762f2382e218 100644 --- a/lockfile-tests/fixtures/npm-lock-workspace-variation/package.json +++ b/lockfile-tests/fixtures/npm-lock-workspace-variation/package.json @@ -2,7 +2,6 @@ "name": "npm-prune", "version": "0.0.0", "private": true, - "packageManager": "npm@8.19.0", "workspaces": [ "apps/*", "packages/*" @@ -11,5 +10,6 @@ "eslint-config-custom": "*", "prettier": "latest", "turbo": "latest" - } + }, + "packageManager": "npm@8.19.0" } diff --git a/lockfile-tests/fixtures/npm-lock/package.json b/lockfile-tests/fixtures/npm-lock/package.json index afac2904c9901..7762f2382e218 100644 --- a/lockfile-tests/fixtures/npm-lock/package.json +++ b/lockfile-tests/fixtures/npm-lock/package.json @@ -2,7 +2,6 @@ "name": "npm-prune", "version": "0.0.0", "private": true, - "packageManager": "npm@8.19.0", "workspaces": [ "apps/*", "packages/*" @@ -11,5 +10,6 @@ "eslint-config-custom": "*", "prettier": "latest", "turbo": "latest" - } + }, + "packageManager": "npm@8.19.0" } diff --git a/lockfile-tests/fixtures/npm-peer-dep/package.json b/lockfile-tests/fixtures/npm-peer-dep/package.json index 5bc8d8c672022..7cc78b4372fe0 100644 --- a/lockfile-tests/fixtures/npm-peer-dep/package.json +++ b/lockfile-tests/fixtures/npm-peer-dep/package.json @@ -1,9 +1,9 @@ { "name": "npm-peer-dep", "private": true, - "packageManager": "npm@10.0.0", "workspaces": [ "apps/*", "packages/*" - ] + ], + "packageManager": "npm@10.0.0" } diff --git a/lockfile-tests/fixtures/npm/package.json b/lockfile-tests/fixtures/npm/package.json index 410549389d1c5..ef52c862f408b 100644 --- a/lockfile-tests/fixtures/npm/package.json +++ b/lockfile-tests/fixtures/npm/package.json @@ -1,9 +1,9 @@ { "name": "npm-fixture", "private": true, - "packageManager": "npm@10.0.0", "workspaces": [ "apps/*", "packages/*" - ] + ], + "packageManager": "npm@10.0.0" } diff --git a/lockfile-tests/fixtures/pnpm-catalog/package.json b/lockfile-tests/fixtures/pnpm-catalog/package.json index 6e3c182e2b766..902b1aae29896 100644 --- a/lockfile-tests/fixtures/pnpm-catalog/package.json +++ b/lockfile-tests/fixtures/pnpm-catalog/package.json @@ -2,10 +2,10 @@ "name": "root", "version": "0.0.0", "private": true, - "packageManager": "pnpm@9.15.0", "devDependencies": { "prettier": "^3.5.3", "turbo": "^2.5.3", "typescript": "5.8.2" - } + }, + "packageManager": "pnpm@9.15.0" } diff --git a/lockfile-tests/fixtures/pnpm-inject-workspace/package.json b/lockfile-tests/fixtures/pnpm-inject-workspace/package.json index 6e234b8864cb8..9eea2f5792483 100644 --- a/lockfile-tests/fixtures/pnpm-inject-workspace/package.json +++ b/lockfile-tests/fixtures/pnpm-inject-workspace/package.json @@ -2,8 +2,8 @@ "name": "root", "version": "0.0.0", "private": true, - "packageManager": "pnpm@9.15.0", "devDependencies": { "prettier": "3.5.3" - } + }, + "packageManager": "pnpm@9.15.0" } diff --git a/lockfile-tests/fixtures/pnpm-multiple-catalogs/package.json b/lockfile-tests/fixtures/pnpm-multiple-catalogs/package.json index 0076ad75b96df..07aa8bf0d7263 100644 --- a/lockfile-tests/fixtures/pnpm-multiple-catalogs/package.json +++ b/lockfile-tests/fixtures/pnpm-multiple-catalogs/package.json @@ -2,9 +2,9 @@ "name": "root", "version": "0.0.0", "private": true, - "packageManager": "pnpm@9.15.0", "devDependencies": { "prettier": "^3.5.3", "turbo": "^2.5.3" - } + }, + "packageManager": "pnpm@9.15.0" } diff --git a/lockfile-tests/fixtures/pnpm-patch/package.json b/lockfile-tests/fixtures/pnpm-patch/package.json index 6d04588cbf76f..fb926df9eb760 100644 --- a/lockfile-tests/fixtures/pnpm-patch/package.json +++ b/lockfile-tests/fixtures/pnpm-patch/package.json @@ -2,10 +2,10 @@ "name": "root", "version": "0.0.0", "private": true, - "packageManager": "pnpm@7.33.0", "dependencies": { "moleculer": "0.14.28" }, + "packageManager": "pnpm@7.33.0", "pnpm": { "patchedDependencies": { "is-odd@3.0.1": "patches/is-odd@3.0.1.patch", diff --git a/lockfile-tests/fixtures/pnpm-patch/packages/dependency/package.json b/lockfile-tests/fixtures/pnpm-patch/packages/dependency/package.json index 8037158bc6522..203d7a72cd49f 100644 --- a/lockfile-tests/fixtures/pnpm-patch/packages/dependency/package.json +++ b/lockfile-tests/fixtures/pnpm-patch/packages/dependency/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "dependencies": { - "is-odd": "^3.0.1", - "@babel/core": "^7.20.12" + "@babel/core": "^7.20.12", + "is-odd": "^3.0.1" } } diff --git a/lockfile-tests/fixtures/pnpm-v9/package.json b/lockfile-tests/fixtures/pnpm-v9/package.json index 4505e82fd669d..0a7e4788d2f75 100644 --- a/lockfile-tests/fixtures/pnpm-v9/package.json +++ b/lockfile-tests/fixtures/pnpm-v9/package.json @@ -2,8 +2,8 @@ "name": "root", "version": "0.0.0", "private": true, - "packageManager": "pnpm@9.15.0", "devDependencies": { "turbo": "canary" - } + }, + "packageManager": "pnpm@9.15.0" } diff --git a/lockfile-tests/fixtures/pnpm6-workspace/package.json b/lockfile-tests/fixtures/pnpm6-workspace/package.json index e7c0bd1bd6ba1..edb049596deb3 100644 --- a/lockfile-tests/fixtures/pnpm6-workspace/package.json +++ b/lockfile-tests/fixtures/pnpm6-workspace/package.json @@ -2,8 +2,8 @@ "name": "root", "version": "0.0.0", "private": true, - "packageManager": "pnpm@7.33.0", "devDependencies": { "@pnpm/make-dedicated-lockfile": "^0.3.19" - } + }, + "packageManager": "pnpm@7.33.0" } diff --git a/lockfile-tests/fixtures/pnpm6turbo/package.json b/lockfile-tests/fixtures/pnpm6turbo/package.json index 8a048d04bcfec..6b95071709823 100644 --- a/lockfile-tests/fixtures/pnpm6turbo/package.json +++ b/lockfile-tests/fixtures/pnpm6turbo/package.json @@ -2,8 +2,8 @@ "name": "root", "version": "0.0.0", "private": true, - "packageManager": "pnpm@8.15.0", "devDependencies": { "turbo": "^2.0.3" - } + }, + "packageManager": "pnpm@8.15.0" } diff --git a/lockfile-tests/fixtures/pnpm7-workspace/package.json b/lockfile-tests/fixtures/pnpm7-workspace/package.json index 41149badaea02..76443c0111c70 100644 --- a/lockfile-tests/fixtures/pnpm7-workspace/package.json +++ b/lockfile-tests/fixtures/pnpm7-workspace/package.json @@ -2,12 +2,12 @@ "name": "root", "version": "0.0.0", "private": true, - "packageManager": "pnpm@7.33.0", "devDependencies": { "eslint-config-custom": "workspace:*", "prettier": "latest", "turbo": "latest" }, + "packageManager": "pnpm@7.33.0", "pnpm": { "patchedDependencies": { "lodash@4.17.21": "patches/lodash@4.17.21.patch", diff --git a/lockfile-tests/fixtures/pnpm8turbo/package.json b/lockfile-tests/fixtures/pnpm8turbo/package.json index 8a048d04bcfec..6b95071709823 100644 --- a/lockfile-tests/fixtures/pnpm8turbo/package.json +++ b/lockfile-tests/fixtures/pnpm8turbo/package.json @@ -2,8 +2,8 @@ "name": "root", "version": "0.0.0", "private": true, - "packageManager": "pnpm@8.15.0", "devDependencies": { "turbo": "^2.0.3" - } + }, + "packageManager": "pnpm@8.15.0" } diff --git a/lockfile-tests/fixtures/robust-berry-resolutions/package.json b/lockfile-tests/fixtures/robust-berry-resolutions/package.json index a212d57a193d4..672e25d4d716b 100644 --- a/lockfile-tests/fixtures/robust-berry-resolutions/package.json +++ b/lockfile-tests/fixtures/robust-berry-resolutions/package.json @@ -2,7 +2,6 @@ "name": "monorepo", "version": "0.0.0", "private": true, - "packageManager": "yarn@3.6.0", "workspaces": [ "apps/*", "packages/*" @@ -11,5 +10,6 @@ "eslint-config-custom": "*", "prettier": "latest", "turbo": "1.6.3" - } + }, + "packageManager": "yarn@3.6.0" } diff --git a/lockfile-tests/fixtures/workspace-peer-dependency/package.json b/lockfile-tests/fixtures/workspace-peer-dependency/package.json index 2772710c96dff..6bef7b4012257 100644 --- a/lockfile-tests/fixtures/workspace-peer-dependency/package.json +++ b/lockfile-tests/fixtures/workspace-peer-dependency/package.json @@ -2,8 +2,8 @@ "name": "npm-test", "version": "0.0.0", "private": true, - "packageManager": "npm@8.19.0", "workspaces": [ "packages/**" - ] + ], + "packageManager": "npm@8.19.0" } diff --git a/lockfile-tests/fixtures/yarn-berry-basic/package.json b/lockfile-tests/fixtures/yarn-berry-basic/package.json index 88ad6fb69d9e8..b8c92e00a7cc2 100644 --- a/lockfile-tests/fixtures/yarn-berry-basic/package.json +++ b/lockfile-tests/fixtures/yarn-berry-basic/package.json @@ -1,9 +1,9 @@ { "name": "yarn-berry-basic", "private": true, - "packageManager": "yarn@4.1.0", "workspaces": [ "apps/*", "packages/*" - ] + ], + "packageManager": "yarn@4.1.0" } diff --git a/lockfile-tests/fixtures/yarn-berry-resolution/package.json b/lockfile-tests/fixtures/yarn-berry-resolution/package.json index 09b908fad5d59..c4b976e02547c 100644 --- a/lockfile-tests/fixtures/yarn-berry-resolution/package.json +++ b/lockfile-tests/fixtures/yarn-berry-resolution/package.json @@ -1,12 +1,12 @@ { "name": "yarn-berry-resolution", "private": true, - "packageManager": "yarn@4.1.0", "workspaces": [ "apps/*", "packages/*" ], "resolutions": { "is-number": "^7.0.0" - } + }, + "packageManager": "yarn@4.1.0" } diff --git a/lockfile-tests/fixtures/yarn-berry/package.json b/lockfile-tests/fixtures/yarn-berry/package.json index 636bb4f1526c4..968ce40b20163 100644 --- a/lockfile-tests/fixtures/yarn-berry/package.json +++ b/lockfile-tests/fixtures/yarn-berry/package.json @@ -1,9 +1,9 @@ { "name": "yarn-berry-fixture", "private": true, - "packageManager": "yarn@4.1.0", "workspaces": [ "apps/*", "packages/*" - ] + ], + "packageManager": "yarn@4.1.0" } diff --git a/lockfile-tests/fixtures/yarn4-catalog/package.json b/lockfile-tests/fixtures/yarn4-catalog/package.json index 991ceccbff794..27f594f54ea78 100644 --- a/lockfile-tests/fixtures/yarn4-catalog/package.json +++ b/lockfile-tests/fixtures/yarn4-catalog/package.json @@ -2,12 +2,12 @@ "name": "my-turborepo", "version": "0.0.0", "private": true, - "packageManager": "yarn@4.1.0", "workspaces": [ "apps/*", "packages/*" ], "dependencies": { "turbo": "npm:^2.6.1" - } + }, + "packageManager": "yarn@4.1.0" } diff --git a/lockfile-tests/fixtures/yarn4-direct-and-indirect/package.json b/lockfile-tests/fixtures/yarn4-direct-and-indirect/package.json index f4395bafe9854..368bcd51689a0 100644 --- a/lockfile-tests/fixtures/yarn4-direct-and-indirect/package.json +++ b/lockfile-tests/fixtures/yarn4-direct-and-indirect/package.json @@ -2,8 +2,8 @@ "name": "small-yarn4", "version": "0.0.0", "private": true, - "packageManager": "yarn@4.1.0", "workspaces": [ "packages/*" - ] + ], + "packageManager": "yarn@4.1.0" } diff --git a/lockfile-tests/fixtures/yarn4-mixed-protocol/package.json b/lockfile-tests/fixtures/yarn4-mixed-protocol/package.json index da6e5c3fa8b76..f5d6c5eac5596 100644 --- a/lockfile-tests/fixtures/yarn4-mixed-protocol/package.json +++ b/lockfile-tests/fixtures/yarn4-mixed-protocol/package.json @@ -2,8 +2,8 @@ "name": "yarn4-test", "version": "0.0.0", "private": true, - "packageManager": "yarn@4.1.0", "workspaces": [ "pkgs/*" - ] + ], + "packageManager": "yarn@4.1.0" } diff --git a/lockfile-tests/fixtures/yarn4-patch/package.json b/lockfile-tests/fixtures/yarn4-patch/package.json index 6c7c1fd9ac0e0..aea7be1cd5b4b 100644 --- a/lockfile-tests/fixtures/yarn4-patch/package.json +++ b/lockfile-tests/fixtures/yarn4-patch/package.json @@ -2,8 +2,8 @@ "name": "yarn4-patch", "version": "0.0.0", "private": true, - "packageManager": "yarn@4.1.0", "workspaces": [ "packages/*" - ] + ], + "packageManager": "yarn@4.1.0" } diff --git a/lockfile-tests/fixtures/yarn4-resolution/package.json b/lockfile-tests/fixtures/yarn4-resolution/package.json index b980b9c69ef82..c79852d1cb5af 100644 --- a/lockfile-tests/fixtures/yarn4-resolution/package.json +++ b/lockfile-tests/fixtures/yarn4-resolution/package.json @@ -2,8 +2,8 @@ "name": "reproduce", "version": "0.0.0", "private": true, - "packageManager": "yarn@4.1.0", "workspaces": [ "packages/*" - ] + ], + "packageManager": "yarn@4.1.0" } diff --git a/lockfile-tests/runners/local.ts b/lockfile-tests/runners/local.ts index 7b7ab9bab39ec..d8a9e0c60dafa 100644 --- a/lockfile-tests/runners/local.ts +++ b/lockfile-tests/runners/local.ts @@ -1,7 +1,7 @@ -import { exec as execCb } from "child_process"; -import * as fs from "fs"; -import * as os from "os"; -import * as path from "path"; +import { exec as execCb } from "node:child_process"; +import * as fs from "node:fs"; +import * as os from "node:os"; +import * as path from "node:path"; import type { TestCase, TestResult } from "../types"; function exec( @@ -152,7 +152,7 @@ export class LocalRunner { await exec(`corepack enable --install-directory "${corepackBin}"`, tmpDir); let fullPath = `${corepackBin}:${localBin}:${process.env.PATH}`; - let installCmd = fixture.frozenInstallCommand.join(" "); + const installCmd = fixture.frozenInstallCommand.join(" "); if (fixture.packageManager === "bun") { const bunVersion = fixture.packageManagerVersion.replace("bun@", ""); diff --git a/package.json b/package.json index bee7c3df8a9b1..6d34e50783114 100644 --- a/package.json +++ b/package.json @@ -2,12 +2,6 @@ "name": "turbo-monorepo", "version": "0.0.0", "private": true, - "pnpm": { - "overrides": { - "fast-xml-parser": ">=5.3.4", - "lodash-es": ">=4.17.23" - } - }, "scripts": { "build": "turbo run build", "build:turbo": "pnpm run --filter=@turbo/cli build", @@ -25,25 +19,34 @@ "test": "turbo run test", "test:integration": "pnpm --filter turborepo-tests-integration exec prysk", "rustdoc": "RUSTDOCFLAGS=\"-Z unstable-options --enable-index-page\" cargo doc --workspace --no-deps --keep-going || true", - "rustdoc:open": "RUSTDOCFLAGS=\"-Z unstable-options --enable-index-page\" cargo doc --workspace --no-deps --keep-going --open" + "rustdoc:open": "RUSTDOCFLAGS=\"-Z unstable-options --enable-index-page\" cargo doc --workspace --no-deps --keep-going --open", + "check": "ultracite check", + "fix": "ultracite fix" }, "devDependencies": { "@taplo/cli": "0.5.2", "@types/node": "22.15.3", "husky": "8.0.3", "lint-staged": "13.1.0", - "oxfmt": "^0.23.0", - "oxlint": "^1.35.0", + "oxfmt": "^0.34.0", + "oxlint": "^1.49.0", "semver": "7.5.2", - "typescript": "5.5.4" + "typescript": "5.5.4", + "ultracite": "7.2.3" }, "lint-staged": { "*.{js,jsx,ts,tsx,md,mdx,mjs,yml,yaml,css,json,jsonc}": "oxfmt --no-error-on-unmatched-pattern", "*.toml": "taplo format", "*.rs": "bash -c 'cargo fmt'" }, - "packageManager": "pnpm@10.28.0", "engines": { "node": "22.x" + }, + "packageManager": "pnpm@10.28.0", + "pnpm": { + "overrides": { + "fast-xml-parser": ">=5.3.4", + "lodash-es": ">=4.17.23" + } } } diff --git a/packages/create-turbo/__tests__/git.test.ts b/packages/create-turbo/__tests__/git.test.ts index 57b4b0e621b1e..1fd9bac0601f1 100644 --- a/packages/create-turbo/__tests__/git.test.ts +++ b/packages/create-turbo/__tests__/git.test.ts @@ -56,12 +56,12 @@ describe("git", () => { ["git", ["commit", "-m", "Initial commit from create-turbo"]] ]; expect(mockSpawnSync).toHaveBeenCalledTimes(expectedCalls.length); - expectedCalls.forEach(([cmd, args]) => { + for (const [cmd, args] of expectedCalls) { expect(mockSpawnSync).toHaveBeenCalledWith(cmd, args, { stdio: "ignore", cwd: root }); - }); + } mockSpawnSync.mockRestore(); }); @@ -160,12 +160,12 @@ describe("git", () => { ]; expect(mockSpawnSync).toHaveBeenCalledTimes(expectedCalls.length); - expectedCalls.forEach(([cmd, args]) => { + for (const [cmd, args] of expectedCalls) { expect(mockSpawnSync).toHaveBeenCalledWith(cmd, args, { stdio: "ignore", cwd: root }); - }); + } mockSpawnSync.mockRestore(); }); diff --git a/packages/create-turbo/__tests__/index.test.ts b/packages/create-turbo/__tests__/index.test.ts index 8680a3c95f02a..c1a6942196311 100644 --- a/packages/create-turbo/__tests__/index.test.ts +++ b/packages/create-turbo/__tests__/index.test.ts @@ -118,13 +118,13 @@ describe("create-turbo", () => { "- Run commands with Turborepo:" ); - availableScripts.forEach((script) => { + for (const script of availableScripts) { expect(mockConsole.log).toHaveBeenCalledWith( expect.stringContaining( picocolors.cyan(`${packageManager} run ${script}`) ) ); - }); + } expect(mockConsole.log).toHaveBeenCalledWith( "- Run a command twice to hit cache" @@ -212,13 +212,13 @@ describe("create-turbo", () => { "- Run commands with Turborepo:" ); - availableScripts.forEach((script) => { + for (const script of availableScripts) { expect(mockConsole.log).toHaveBeenCalledWith( expect.stringContaining( picocolors.cyan(`${packageManager} run ${script}`) ) ); - }); + } expect(mockConsole.log).toHaveBeenCalledWith( "- Run a command twice to hit cache" diff --git a/packages/create-turbo/__tests__/test-utils.ts b/packages/create-turbo/__tests__/test-utils.ts index a1b5a61eb4015..cdde88e0142e1 100644 --- a/packages/create-turbo/__tests__/test-utils.ts +++ b/packages/create-turbo/__tests__/test-utils.ts @@ -1,4 +1,4 @@ -import path from "path"; +import path from "node:path"; import type { PackageManager } from "@turbo/utils"; export function getWorkspaceDetailsMockReturnValue({ diff --git a/packages/create-turbo/package.json b/packages/create-turbo/package.json index 582e6c7e32bad..ca2c7bf97fd83 100644 --- a/packages/create-turbo/package.json +++ b/packages/create-turbo/package.json @@ -3,18 +3,21 @@ "version": "2.8.11-canary.22", "description": "Create a new Turborepo", "homepage": "https://turborepo.dev", + "bugs": { + "url": "https://github.com/vercel/turborepo/issues" + }, "license": "MIT", "repository": { "type": "git", "url": "https://github.com/vercel/turborepo", "directory": "packages/create-turbo" }, - "bugs": { - "url": "https://github.com/vercel/turborepo/issues" - }, "bin": { "create-turbo": "dist/cli.js" }, + "files": [ + "dist" + ], "scripts": { "build": "tsdown", "test": "jest", @@ -22,9 +25,9 @@ "lint:prettier": "prettier -c . --cache --ignore-path=../../.prettierignore" }, "dependencies": { + "@inquirer/prompts": "^7.10.1", "commander": "11.0.0", "fs-extra": "11.1.1", - "@inquirer/prompts": "^7.10.1", "picocolors": "1.0.1", "proxy-agent": "6.5.0", "semver": "7.7.3", @@ -44,8 +47,5 @@ "ts-jest": "29.4.6", "tsdown": "0.12.0", "typescript": "5.5.4" - }, - "files": [ - "dist" - ] + } } diff --git a/packages/create-turbo/src/commands/create/index.ts b/packages/create-turbo/src/commands/create/index.ts index 76a3fcebaa09f..18f4208c19e5b 100644 --- a/packages/create-turbo/src/commands/create/index.ts +++ b/packages/create-turbo/src/commands/create/index.ts @@ -14,10 +14,10 @@ import { logger } from "@turbo/utils"; import { tryGitInit, removeGitDirectory } from "../../utils/git"; -import { isOnline } from "../../utils/isOnline"; +import { isOnline } from "../../utils/is-online"; import { transforms } from "../../transforms"; import { TransformError } from "../../transforms/errors"; -import { isDefaultExample } from "../../utils/isDefaultExample"; +import { isDefaultExample } from "../../utils/is-default-example"; import * as prompts from "./prompts"; import type { CreateCommandArgument, CreateCommandOptions } from "./types"; @@ -196,7 +196,10 @@ export async function create( .sort((a, b) => a.title.localeCompare(b.title)); let lastGroup: string | undefined; - workspacesForDisplay.forEach(({ group, title, description }, idx) => { + for (const [ + idx, + { group, title, description } + ] of workspacesForDisplay.entries()) { if (idx === 0 || group !== lastGroup) { logger.log(picocolors.cyan(group)); } @@ -204,7 +207,7 @@ export async function create( ` - ${picocolors.bold(title)}${description ? `: ${description}` : ""}` ); lastGroup = group; - }); + } } else { logger.log(picocolors.cyan("apps")); logger.log(` - ${picocolors.bold(projectName)}`); @@ -283,15 +286,16 @@ export async function create( logger.log(" - Learn more: https://turborepo.dev/remote-cache"); logger.log(); logger.log("- Run commands with Turborepo:"); - availableScripts - .filter((script) => SCRIPTS_TO_DISPLAY[script]) - .forEach((script) => { - logger.log( - ` - ${picocolors.cyan( - `${packageManagerMeta.command} run ${script}` - )}: ${SCRIPTS_TO_DISPLAY[script]} all apps and packages` - ); - }); + const scriptsToDisplay = availableScripts.filter( + (script) => SCRIPTS_TO_DISPLAY[script] + ); + for (const script of scriptsToDisplay) { + logger.log( + ` - ${picocolors.cyan( + `${packageManagerMeta.command} run ${script}` + )}: ${SCRIPTS_TO_DISPLAY[script]} all apps and packages` + ); + } logger.log("- Run a command twice to hit cache"); } diff --git a/packages/create-turbo/src/transforms/official-starter.ts b/packages/create-turbo/src/transforms/official-starter.ts index f2caf4dbb5d4a..254a4f7fa05dd 100644 --- a/packages/create-turbo/src/transforms/official-starter.ts +++ b/packages/create-turbo/src/transforms/official-starter.ts @@ -1,7 +1,7 @@ import path from "node:path"; import fs from "fs-extra"; import type { PackageJson } from "@turbo/utils"; -import { isDefaultExample } from "../utils/isDefaultExample"; +import { isDefaultExample } from "../utils/is-default-example"; import type { TransformInput, TransformResult, MetaJson } from "./types"; import { TransformError } from "./errors"; diff --git a/packages/create-turbo/src/utils/isDefaultExample.ts b/packages/create-turbo/src/utils/is-default-example.ts similarity index 100% rename from packages/create-turbo/src/utils/isDefaultExample.ts rename to packages/create-turbo/src/utils/is-default-example.ts diff --git a/packages/create-turbo/src/utils/isOnline.ts b/packages/create-turbo/src/utils/is-online.ts similarity index 100% rename from packages/create-turbo/src/utils/isOnline.ts rename to packages/create-turbo/src/utils/is-online.ts diff --git a/packages/create-turbo/tsconfig.json b/packages/create-turbo/tsconfig.json index b43047806aa35..b872b26e5eea2 100644 --- a/packages/create-turbo/tsconfig.json +++ b/packages/create-turbo/tsconfig.json @@ -3,6 +3,7 @@ "exclude": ["templates"], "compilerOptions": { "rootDir": ".", - "lib": ["ES2022", "DOM"] + "lib": ["ES2022", "DOM"], + "strictNullChecks": true } } diff --git a/packages/eslint-config-turbo/README.md b/packages/eslint-config-turbo/README.md index 4808da7359272..4fa9c17952f58 100644 --- a/packages/eslint-config-turbo/README.md +++ b/packages/eslint-config-turbo/README.md @@ -22,7 +22,7 @@ npm install eslint-config-turbo --save-dev import turboConfig from "eslint-config-turbo/flat"; export default [ - ...turboConfig, + ...turboConfig // Other configuration ]; ``` @@ -40,11 +40,11 @@ export default [ "turbo/no-undeclared-env-vars": [ "error", { - allowList: ["^ENV_[A-Z]+$"], - }, - ], - }, - }, + allowList: ["^ENV_[A-Z]+$"] + } + ] + } + } ]; ``` diff --git a/packages/eslint-config-turbo/package.json b/packages/eslint-config-turbo/package.json index 972e2399e192e..2b33b21f98486 100644 --- a/packages/eslint-config-turbo/package.json +++ b/packages/eslint-config-turbo/package.json @@ -1,8 +1,17 @@ { "name": "eslint-config-turbo", "version": "2.8.11-canary.22", - "type": "commonjs", "description": "ESLint config for Turborepo", + "keywords": [ + "eslint", + "eslint-config", + "eslintconfig", + "turbo", + "turborepo" + ], + "bugs": { + "url": "https://github.com/vercel/turborepo/issues" + }, "license": "MIT", "author": "Vercel", "repository": { @@ -10,24 +19,10 @@ "url": "git+https://github.com/vercel/turborepo.git", "directory": "packages/eslint-config-turbo" }, - "bugs": { - "url": "https://github.com/vercel/turborepo/issues" - }, - "scripts": { - "build": "bunchee", - "lint:prettier": "prettier -c . --cache --ignore-path=../../.prettierignore", - "package:types": "attw --profile node16 --pack" - }, - "keywords": [ - "turbo", - "eslint", - "turborepo", - "eslintconfig", - "eslint-config" - ], "files": [ "dist" ], + "type": "commonjs", "main": "./dist/cjs/index.js", "types": "./dist/cjs/index.d.ts", "exports": { @@ -52,13 +47,14 @@ } } }, + "scripts": { + "build": "bunchee", + "lint:prettier": "prettier -c . --cache --ignore-path=../../.prettierignore", + "package:types": "attw --profile node16 --pack" + }, "dependencies": { "eslint-plugin-turbo": "workspace:*" }, - "peerDependencies": { - "eslint": ">6.6.0", - "turbo": ">2.0.0" - }, "devDependencies": { "@arethetypeswrong/cli": "0.18.2", "@eslint/core": "^1.1.0", @@ -66,5 +62,9 @@ "@types/node": "20.11.30", "bunchee": "6.3.4", "eslint": "10.0.0" + }, + "peerDependencies": { + "eslint": ">6.6.0", + "turbo": ">2.0.0" } } diff --git a/packages/eslint-config-turbo/tsconfig.json b/packages/eslint-config-turbo/tsconfig.json index c7acf6efe4f1f..6a922cff094cf 100644 --- a/packages/eslint-config-turbo/tsconfig.json +++ b/packages/eslint-config-turbo/tsconfig.json @@ -1,7 +1,8 @@ { "extends": "@turbo/tsconfig/library.json", "compilerOptions": { - "outDir": "dist" + "outDir": "dist", + "strictNullChecks": true }, "include": ["src"], "exclude": ["dist"] diff --git a/packages/eslint-plugin-turbo/README.md b/packages/eslint-plugin-turbo/README.md index cc8f6367ffdb4..ff3d54af40679 100644 --- a/packages/eslint-plugin-turbo/README.md +++ b/packages/eslint-plugin-turbo/README.md @@ -34,12 +34,12 @@ import turbo from "eslint-plugin-turbo"; export default [ { plugins: { - turbo, + turbo }, rules: { - "turbo/no-undeclared-env-vars": "error", - }, - }, + "turbo/no-undeclared-env-vars": "error" + } + } ]; ``` @@ -51,17 +51,17 @@ import turbo from "eslint-plugin-turbo"; export default [ { plugins: { - turbo, + turbo }, rules: { "turbo/no-undeclared-env-vars": [ "error", { - allowList: ["^ENV_[A-Z]+$"], - }, - ], - }, - }, + allowList: ["^ENV_[A-Z]+$"] + } + ] + } + } ]; ``` diff --git a/packages/eslint-plugin-turbo/__tests__/cwdFlat.test.ts b/packages/eslint-plugin-turbo/__tests__/cwd-flat.test.ts similarity index 100% rename from packages/eslint-plugin-turbo/__tests__/cwdFlat.test.ts rename to packages/eslint-plugin-turbo/__tests__/cwd-flat.test.ts diff --git a/packages/eslint-plugin-turbo/__tests__/lib/no-undeclared-env-vars/workspace-configs/reload.test.ts b/packages/eslint-plugin-turbo/__tests__/lib/no-undeclared-env-vars/workspace-configs/reload.test.ts index fa5927e169c9f..8d66a1afc0283 100644 --- a/packages/eslint-plugin-turbo/__tests__/lib/no-undeclared-env-vars/workspace-configs/reload.test.ts +++ b/packages/eslint-plugin-turbo/__tests__/lib/no-undeclared-env-vars/workspace-configs/reload.test.ts @@ -44,7 +44,7 @@ describe("Project reload functionality", () => { // Verify that configurations were reloaded expect(project.allConfigs).not.toBe(initialConfigs); - expect(project.allConfigs.length).toBe(initialConfigs.length); + expect(project.allConfigs).toHaveLength(initialConfigs.length); // Verify that project root and workspaces were updated expect(project.projectRoot).toBeDefined(); @@ -112,7 +112,7 @@ describe("Project reload functionality", () => { project.reload(); // Verify that the final state is consistent - expect(project.allConfigs.length).toBe(initialConfigs.length); + expect(project.allConfigs).toHaveLength(initialConfigs.length); expect(project.projectRoot).toBeDefined(); expect(project.projectWorkspaces.length).toBeGreaterThan(0); }); diff --git a/packages/eslint-plugin-turbo/lib/rules/no-undeclared-env-vars.ts b/packages/eslint-plugin-turbo/lib/rules/no-undeclared-env-vars.ts index db1c6bbe27c3d..41a4727c5c89f 100644 --- a/packages/eslint-plugin-turbo/lib/rules/no-undeclared-env-vars.ts +++ b/packages/eslint-plugin-turbo/lib/rules/no-undeclared-env-vars.ts @@ -295,14 +295,14 @@ function create(context: RuleContextWithOptions): Rule.RuleListener { const allowList: Array = options[0]?.allowList || []; let regexAllowList: Array = []; - allowList.forEach((allowed) => { + for (const allowed of allowList) { try { regexAllowList.push(new RegExp(allowed)); } catch (err) { // log the error, but just move on without this allowList entry logger.error(`Unable to convert "${allowed}" to regex`); } - }); + } const filename = context.filename; debug(`Checking file: ${filename}`); @@ -471,11 +471,11 @@ function create(context: RuleContextWithOptions): Rule.RuleListener { // destructuring from process.env if ("id" in node.parent && node.parent.id?.type === "ObjectPattern") { const values = node.parent.id.properties.values(); - Array.from(values).forEach((item) => { + for (const item of Array.from(values)) { if ("key" in item && "name" in item.key) { checkKey(node.parent, item.key.name); } - }); + } } // accessing key on process.env diff --git a/packages/eslint-plugin-turbo/lib/utils/calculate-inputs.ts b/packages/eslint-plugin-turbo/lib/utils/calculate-inputs.ts index ed4157be2a53e..b9c2074cd0665 100644 --- a/packages/eslint-plugin-turbo/lib/utils/calculate-inputs.ts +++ b/packages/eslint-plugin-turbo/lib/utils/calculate-inputs.ts @@ -4,7 +4,7 @@ import path from "node:path"; import type { WorkspaceConfig } from "@turbo/utils"; import { getWorkspaceConfigs } from "@turbo/utils"; import type { PipelineV1, RootSchemaV1, RootSchemaV2 } from "@turbo/types"; -import { forEachTaskDef } from "@turbo/utils/src/getTurboConfigs"; +import { forEachTaskDef } from "@turbo/utils/src/get-turbo-configs"; import { dotEnv } from "./dotenv-processing"; import { wildcardTests } from "./wildcard-processing"; @@ -58,12 +58,15 @@ function processLegacyConfig( // After processing length is 0, 1, or more than 1. switch (processed.length) { - case 0: + case 0: { return []; - case 1: + } + case 1: { return processed; - default: + } + default: { return [...new Set(processed)].sort(); + } } } @@ -73,12 +76,15 @@ function processEnv(env: Array | undefined): Array { } switch (env.length) { - case 0: + case 0: { return []; - case 1: + } + case 1: { return [env[0]]; - default: + } + default: { return [...new Set(env)].sort(); + } } } @@ -90,12 +96,15 @@ function processPassThroughEnv( } switch (passThroughEnv.length) { - case 0: + case 0: { return []; - case 1: + } + case 1: { return [passThroughEnv[0]]; - default: + } + default: { return [...new Set(passThroughEnv)].sort(); + } } } @@ -340,9 +349,9 @@ export class Project { ); } - this.projectWorkspaces.forEach((projectWorkspace) => { + for (const projectWorkspace of this.projectWorkspaces) { if (!projectWorkspace.turboConfig) { - return; + continue; } forEachTaskDef( @@ -367,7 +376,7 @@ export class Project { ); } ); - }); + } return { global, diff --git a/packages/eslint-plugin-turbo/lib/utils/dotenv-processing.ts b/packages/eslint-plugin-turbo/lib/utils/dotenv-processing.ts index ac39bf1bf6460..358c81eda36eb 100644 --- a/packages/eslint-plugin-turbo/lib/utils/dotenv-processing.ts +++ b/packages/eslint-plugin-turbo/lib/utils/dotenv-processing.ts @@ -16,19 +16,19 @@ export function dotEnv( } const outputSet = new Set(); - config.filePaths.forEach((filePath) => { + for (const filePath of config.filePaths) { try { const dotEnvFileContents = fs.readFileSync( path.join(workspacePath, filePath), "utf8" ); - Object.keys(parse(dotEnvFileContents)).forEach((envVarName) => - outputSet.add(envVarName) - ); + for (const envVarName of Object.keys(parse(dotEnvFileContents))) { + outputSet.add(envVarName); + } } catch (_) { // ignore } - }); + } return outputSet; } diff --git a/packages/eslint-plugin-turbo/lib/utils/wildcard-processing.ts b/packages/eslint-plugin-turbo/lib/utils/wildcard-processing.ts index d90b7178f021c..803b1d68c585e 100644 --- a/packages/eslint-plugin-turbo/lib/utils/wildcard-processing.ts +++ b/packages/eslint-plugin-turbo/lib/utils/wildcard-processing.ts @@ -35,7 +35,7 @@ function wildcardToRegexPattern(pattern: string): string { regexString.push(escapeRegExp(pattern.slice(previousIndex, i))); // Add a dynamic segment if it isn't adjacent to another dynamic segment. - if (regexString[regexString.length - 1] !== regexWildcardSegment) { + if (regexString.at(-1) !== regexWildcardSegment) { regexString.push(regexWildcardSegment); } } @@ -74,7 +74,7 @@ export function wildcardTests( const includePatterns: Array = []; const excludePatterns: Array = []; - wildcardPatterns.forEach((wildcardPattern) => { + for (const wildcardPattern of wildcardPatterns) { const isExclude = wildcardPattern.startsWith("!"); const isLiteralLeadingExclamation = wildcardPattern.startsWith("\\!"); @@ -88,7 +88,7 @@ export function wildcardTests( const includePattern = wildcardToRegexPattern(wildcardPattern); includePatterns.push(includePattern); } - }); + } // Set some defaults. let inclusions = NO_PATTERNS; diff --git a/packages/eslint-plugin-turbo/package.json b/packages/eslint-plugin-turbo/package.json index 73c5ffa55e7c3..694384ec17712 100644 --- a/packages/eslint-plugin-turbo/package.json +++ b/packages/eslint-plugin-turbo/package.json @@ -3,26 +3,27 @@ "version": "2.8.11-canary.22", "description": "ESLint plugin for Turborepo", "keywords": [ - "turbo", "eslint", - "turborepo", + "eslint-plugin", "eslintplugin", - "eslint-plugin" + "turbo", + "turborepo" ], + "bugs": { + "url": "https://github.com/vercel/turborepo/issues" + }, + "license": "MIT", + "author": "Vercel", "repository": { "type": "git", "url": "https://github.com/vercel/turborepo", "directory": "packages/eslint-plugin-turbo" }, - "bugs": { - "url": "https://github.com/vercel/turborepo/issues" - }, - "author": "Vercel", - "main": "./dist/index.js", - "types": "./dist/index.d.ts", "files": [ "dist/**" ], + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "scripts": { "test": "jest", "build": "tsdown && tsc -p tsconfig.build.json", @@ -51,6 +52,5 @@ "peerDependencies": { "eslint": ">6.6.0", "turbo": ">2.0.0" - }, - "license": "MIT" + } } diff --git a/packages/eslint-plugin-turbo/tsconfig.build.json b/packages/eslint-plugin-turbo/tsconfig.build.json index 66ec57b896817..8dd87708affe2 100644 --- a/packages/eslint-plugin-turbo/tsconfig.build.json +++ b/packages/eslint-plugin-turbo/tsconfig.build.json @@ -4,7 +4,8 @@ "declaration": true, "emitDeclarationOnly": true, "outDir": "dist", - "rootDir": "lib" + "rootDir": "lib", + "strictNullChecks": true }, "include": ["lib"] } diff --git a/packages/eslint-plugin-turbo/tsconfig.json b/packages/eslint-plugin-turbo/tsconfig.json index 346f471206b4e..7bb7b58233833 100644 --- a/packages/eslint-plugin-turbo/tsconfig.json +++ b/packages/eslint-plugin-turbo/tsconfig.json @@ -2,7 +2,8 @@ "extends": "@turbo/tsconfig/library.json", "compilerOptions": { "rootDir": ".", - "lib": ["ES2022", "DOM"] + "lib": ["ES2022", "DOM"], + "strictNullChecks": true }, "exclude": ["dist"] } diff --git a/packages/prysk/index.mjs b/packages/prysk/index.mjs index 2a94b52688a8b..b9ce746680d4d 100755 --- a/packages/prysk/index.mjs +++ b/packages/prysk/index.mjs @@ -1,4 +1,4 @@ -import { execFileSync } from "child_process"; +import { execFileSync } from "node:child_process"; import path from "node:path"; // TODO: make this customizable? diff --git a/packages/prysk/package.json b/packages/prysk/package.json index c6359014b637e..7b53c85f42c73 100644 --- a/packages/prysk/package.json +++ b/packages/prysk/package.json @@ -1,6 +1,6 @@ { "name": "prysk", - "description": "Wraps the python test runner prysk", "private": true, + "description": "Wraps the python test runner prysk", "bin": "index.mjs" } diff --git a/packages/top-issues/src/index.mjs b/packages/top-issues/src/index.mjs index c769d8c68d287..038a439cd9685 100644 --- a/packages/top-issues/src/index.mjs +++ b/packages/top-issues/src/index.mjs @@ -61,12 +61,12 @@ function generateWorkflowPayload(issues) { prelude: `Top ${NUM_OF_ISSUES} issues sorted by :+1: reactions (last ${NUM_OF_DAYS} days).*\nNote: This :github2: workflow will run every Monday at 1PM UTC (9AM EST)._"` }; - issues.forEach((issue, index) => { + for (const [index, issue] of issues.entries()) { payload[`issue${index + 1}URL`] = issue.html_url; const count = issue.reactions["+1"]; payload[`issue${index + 1}Text`] = `:+1: ${count}: ${issue.title}`; - }); + } return payload; } diff --git a/packages/turbo-codemod/__tests__/__fixtures__/add-package-names/correct-names/package.json b/packages/turbo-codemod/__tests__/__fixtures__/add-package-names/correct-names/package.json index 4da92049f9be5..5b5548f462eed 100644 --- a/packages/turbo-codemod/__tests__/__fixtures__/add-package-names/correct-names/package.json +++ b/packages/turbo-codemod/__tests__/__fixtures__/add-package-names/correct-names/package.json @@ -1,9 +1,9 @@ { "name": "root", + "version": "1.0.0", "workspaces": [ "packages/*" ], - "version": "1.0.0", "dependencies": {}, "devDependencies": {}, "packageManager": "npm@1.2.3" diff --git a/packages/turbo-codemod/__tests__/__fixtures__/add-package-names/duplicate-names/package.json b/packages/turbo-codemod/__tests__/__fixtures__/add-package-names/duplicate-names/package.json index 4da92049f9be5..5b5548f462eed 100644 --- a/packages/turbo-codemod/__tests__/__fixtures__/add-package-names/duplicate-names/package.json +++ b/packages/turbo-codemod/__tests__/__fixtures__/add-package-names/duplicate-names/package.json @@ -1,9 +1,9 @@ { "name": "root", + "version": "1.0.0", "workspaces": [ "packages/*" ], - "version": "1.0.0", "dependencies": {}, "devDependencies": {}, "packageManager": "npm@1.2.3" diff --git a/packages/turbo-codemod/__tests__/__fixtures__/add-package-names/ignored-packages/package.json b/packages/turbo-codemod/__tests__/__fixtures__/add-package-names/ignored-packages/package.json index 27bb15f33630d..c8cce757d7d5d 100644 --- a/packages/turbo-codemod/__tests__/__fixtures__/add-package-names/ignored-packages/package.json +++ b/packages/turbo-codemod/__tests__/__fixtures__/add-package-names/ignored-packages/package.json @@ -1,10 +1,10 @@ { "name": "root", + "version": "1.0.0", "workspaces": [ "packages/*", "!packages/ui" ], - "version": "1.0.0", "dependencies": {}, "devDependencies": {}, "packageManager": "pnpm@8.15.4" diff --git a/packages/turbo-codemod/__tests__/__fixtures__/add-package-names/missing-names/package.json b/packages/turbo-codemod/__tests__/__fixtures__/add-package-names/missing-names/package.json index 4da92049f9be5..5b5548f462eed 100644 --- a/packages/turbo-codemod/__tests__/__fixtures__/add-package-names/missing-names/package.json +++ b/packages/turbo-codemod/__tests__/__fixtures__/add-package-names/missing-names/package.json @@ -1,9 +1,9 @@ { "name": "root", + "version": "1.0.0", "workspaces": [ "packages/*" ], - "version": "1.0.0", "dependencies": {}, "devDependencies": {}, "packageManager": "npm@1.2.3" diff --git a/packages/turbo-codemod/__tests__/clean-globs.test.ts b/packages/turbo-codemod/__tests__/clean-globs.test.ts index 4a8dc549229f5..9d301e3ad1771 100644 --- a/packages/turbo-codemod/__tests__/clean-globs.test.ts +++ b/packages/turbo-codemod/__tests__/clean-globs.test.ts @@ -44,9 +44,9 @@ describe("clean-globs", () => { ]; // Now let's test the function - badGlobPatterns.forEach(([input, output]) => { + for (const [input, output] of badGlobPatterns) { expect(fixGlobPattern(input)).toBe(output); - }); + } }); it("doesn't update valid globs and prints a message", () => { @@ -66,9 +66,9 @@ describe("clean-globs", () => { ]; // Now let's test the function - badGlobPatterns.forEach(([input, output]) => { + for (const [input, output] of badGlobPatterns) { expect(fixGlobPattern(input)).toBe(output); - }); + } }); it("transforms 'pre**' to pre*/**", () => { @@ -81,9 +81,9 @@ describe("clean-globs", () => { ]; // Now let's test the function - badGlobPatterns.forEach(([input, output]) => { + for (const [input, output] of badGlobPatterns) { expect(fixGlobPattern(input)).toBe(output); - }); + } }); it("should collapse back-to-back doublestars to a single doublestar", () => { @@ -131,6 +131,7 @@ describe("clean-globs", () => { expect(fixGlobPattern("src/中文/**/*.json")).toBe("src/中文/**/*.json"); expect(fixGlobPattern("src/русский/**/*.ts")).toBe("src/русский/**/*.ts"); }); + it("should handle glob patterns with emojis", () => { expect(fixGlobPattern("src/👋**/*.js")).toBe("src/👋*/**/*.js"); expect(fixGlobPattern("src/🌎**/*.json")).toBe("src/🌎*/**/*.json"); diff --git a/packages/turbo-codemod/__tests__/get-transforms-for-migration.test.ts b/packages/turbo-codemod/__tests__/get-transforms-for-migration.test.ts index f62c98e0c6391..8bad53c53e724 100644 --- a/packages/turbo-codemod/__tests__/get-transforms-for-migration.test.ts +++ b/packages/turbo-codemod/__tests__/get-transforms-for-migration.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect } from "@jest/globals"; -import { getTransformsForMigration } from "../src/commands/migrate/steps/getTransformsForMigration"; +import { getTransformsForMigration } from "../src/commands/migrate/steps/get-transforms-for-migration"; describe("get-transforms-for-migration", () => { it("ordering", () => { diff --git a/packages/turbo-codemod/__tests__/get-turbo-upgrade-command.test.ts b/packages/turbo-codemod/__tests__/get-turbo-upgrade-command.test.ts index b89f7154a57e1..dbb4101bd5115 100644 --- a/packages/turbo-codemod/__tests__/get-turbo-upgrade-command.test.ts +++ b/packages/turbo-codemod/__tests__/get-turbo-upgrade-command.test.ts @@ -2,7 +2,7 @@ import * as turboWorkspaces from "@turbo/workspaces"; import * as turboUtils from "@turbo/utils"; import { setupTestFixtures } from "@turbo/test-utils"; import { describe, it, expect, jest, afterEach } from "@jest/globals"; -import { getTurboUpgradeCommand } from "../src/commands/migrate/steps/getTurboUpgradeCommand"; +import { getTurboUpgradeCommand } from "../src/commands/migrate/steps/get-turbo-upgrade-command"; import * as utils from "../src/commands/migrate/utils"; import { getWorkspaceDetailsMockReturnValue } from "./test-utils"; diff --git a/packages/turbo-codemod/__tests__/migrate-dot-env.test.ts b/packages/turbo-codemod/__tests__/migrate-dot-env.test.ts index bbbd6c61f10b6..16d689ec147bf 100644 --- a/packages/turbo-codemod/__tests__/migrate-dot-env.test.ts +++ b/packages/turbo-codemod/__tests__/migrate-dot-env.test.ts @@ -8,6 +8,7 @@ describe("migrate-dot-env", () => { directory: __dirname, test: "migrate-dot-env" }); + it("migrates turbo.json dot-env - basic", () => { // load the fixture for the test const { root, read } = useFixture({ diff --git a/packages/turbo-codemod/__tests__/migrate.test.ts b/packages/turbo-codemod/__tests__/migrate.test.ts index ce8c620d2de70..8bfd99af183d2 100644 --- a/packages/turbo-codemod/__tests__/migrate.test.ts +++ b/packages/turbo-codemod/__tests__/migrate.test.ts @@ -4,10 +4,10 @@ import * as turboWorkspaces from "@turbo/workspaces"; import { setupTestFixtures, spyExit } from "@turbo/test-utils"; import { describe, it, expect, jest } from "@jest/globals"; import { migrate } from "../src/commands/migrate"; -import * as checkGitStatus from "../src/utils/checkGitStatus"; -import * as getCurrentVersion from "../src/commands/migrate/steps/getCurrentVersion"; -import * as getLatestVersion from "../src/commands/migrate/steps/getLatestVersion"; -import * as getTurboUpgradeCommand from "../src/commands/migrate/steps/getTurboUpgradeCommand"; +import * as checkGitStatus from "../src/utils/check-git-status"; +import * as getCurrentVersion from "../src/commands/migrate/steps/get-current-version"; +import * as getLatestVersion from "../src/commands/migrate/steps/get-latest-version"; +import * as getTurboUpgradeCommand from "../src/commands/migrate/steps/get-turbo-upgrade-command"; import { getWorkspaceDetailsMockReturnValue } from "./test-utils"; jest.mock("@turbo/workspaces", () => ({ diff --git a/packages/turbo-codemod/__tests__/rename-output-mode.test.ts b/packages/turbo-codemod/__tests__/rename-output-mode.test.ts index 85bc6d575fd59..919d006416a3f 100644 --- a/packages/turbo-codemod/__tests__/rename-output-mode.test.ts +++ b/packages/turbo-codemod/__tests__/rename-output-mode.test.ts @@ -8,6 +8,7 @@ describe("rename-output-mode", () => { directory: __dirname, test: "rename-output-mode" }); + it("migrates turbo.json outputs - basic", () => { // load the fixture for the test const { root, read } = useFixture({ diff --git a/packages/turbo-codemod/__tests__/transform-env-literals-to-wildcards.test.ts b/packages/turbo-codemod/__tests__/transform-env-literals-to-wildcards.test.ts index ffee1aeb1a534..dc27a903b7d26 100644 --- a/packages/turbo-codemod/__tests__/transform-env-literals-to-wildcards.test.ts +++ b/packages/turbo-codemod/__tests__/transform-env-literals-to-wildcards.test.ts @@ -7,7 +7,7 @@ import { migrateRootConfig } from "../src/transforms/transform-env-literals-to-wildcards"; -describe.only("transform-env-literals-to-wildcards", () => { +describe("transform-env-literals-to-wildcards", () => { const { useFixture } = setupTestFixtures({ directory: __dirname, test: "transform-env-literals-to-wildcards" diff --git a/packages/turbo-codemod/__tests__/transform.test.ts b/packages/turbo-codemod/__tests__/transform.test.ts index c0b8cd2841989..832ee09121196 100644 --- a/packages/turbo-codemod/__tests__/transform.test.ts +++ b/packages/turbo-codemod/__tests__/transform.test.ts @@ -3,7 +3,7 @@ import * as turboUtils from "@turbo/utils"; import { setupTestFixtures, spyExit } from "@turbo/test-utils"; import { describe, it, expect, jest } from "@jest/globals"; import { transform } from "../src/commands/transform"; -import * as checkGitStatus from "../src/utils/checkGitStatus"; +import * as checkGitStatus from "../src/utils/check-git-status"; import type { MigrateCommandArgument } from "../src/commands"; import { getWorkspaceDetailsMockReturnValue } from "./test-utils"; diff --git a/packages/turbo-codemod/__tests__/update-versioned-schema-json.test.ts b/packages/turbo-codemod/__tests__/update-versioned-schema-json.test.ts index 0378c398c5df9..4d0f424eb25d2 100644 --- a/packages/turbo-codemod/__tests__/update-versioned-schema-json.test.ts +++ b/packages/turbo-codemod/__tests__/update-versioned-schema-json.test.ts @@ -372,7 +372,7 @@ describe("update-versioned-schema-json", () => { expect(result.fatalError).toBeUndefined(); // Should have 3 modified files - expect(Object.keys(result.changes).length).toBe(3); + expect(Object.keys(result.changes)).toHaveLength(3); expect(result.changes["turbo.json"].action).toBe("modified"); }); diff --git a/packages/turbo-codemod/package.json b/packages/turbo-codemod/package.json index 121763cf49702..5047057bd1ac9 100644 --- a/packages/turbo-codemod/package.json +++ b/packages/turbo-codemod/package.json @@ -3,16 +3,22 @@ "version": "2.8.11-canary.22", "description": "Provides Codemod transformations to help upgrade your Turborepo codebase when a feature is deprecated.", "homepage": "https://turborepo.dev", + "bugs": { + "url": "https://github.com/vercel/turborepo/issues" + }, "license": "MIT", "repository": { "type": "git", "url": "https://github.com/vercel/turborepo", "directory": "packages/turbo-codemod" }, - "bugs": { - "url": "https://github.com/vercel/turborepo/issues" - }, "bin": "dist/cli.js", + "files": [ + "dist" + ], + "publishConfig": { + "access": "public" + }, "scripts": { "build": "tsdown", "test": "jest", @@ -20,14 +26,14 @@ "lint:prettier": "prettier -c . --cache --ignore-path=../../.prettierignore" }, "dependencies": { + "@inquirer/prompts": "^7.10.1", "commander": "9.5.0", "diff": "5.2.2", "find-up": "4.1.0", "fs-extra": "10.1.0", "gradient-string": "2.0.1", - "@inquirer/prompts": "^7.10.1", - "json5": "2.2.3", "is-git-clean": "1.1.0", + "json5": "2.2.3", "ora": "4.1.1", "picocolors": "1.0.1", "semver": "7.5.2", @@ -52,11 +58,5 @@ "ts-jest": "29.4.6", "tsdown": "0.12.0", "typescript": "5.5.4" - }, - "files": [ - "dist" - ], - "publishConfig": { - "access": "public" } } diff --git a/packages/turbo-codemod/src/commands/migrate/index.ts b/packages/turbo-codemod/src/commands/migrate/index.ts index 44d91f489ac2d..e44ae47ec66da 100644 --- a/packages/turbo-codemod/src/commands/migrate/index.ts +++ b/packages/turbo-codemod/src/commands/migrate/index.ts @@ -4,17 +4,17 @@ import picocolors from "picocolors"; import { input } from "@inquirer/prompts"; import { getWorkspaceDetails, type Project } from "@turbo/workspaces"; import { logger } from "@turbo/utils"; -import { checkGitStatus } from "../../utils/checkGitStatus"; -import { directoryInfo } from "../../utils/directoryInfo"; -import { Runner } from "../../runner/Runner"; -import { looksLikeRepo } from "../../utils/looksLikeRepo"; +import { checkGitStatus } from "../../utils/check-git-status"; +import { directoryInfo } from "../../utils/directory-info"; +import { Runner } from "../../runner/runner"; +import { looksLikeRepo } from "../../utils/looks-like-repo"; import type { TransformerResults } from "../../runner"; -import { getCurrentVersion } from "./steps/getCurrentVersion"; -import { getLatestVersion } from "./steps/getLatestVersion"; -import { getTransformsForMigration } from "./steps/getTransformsForMigration"; -import { getTurboUpgradeCommand } from "./steps/getTurboUpgradeCommand"; +import { getCurrentVersion } from "./steps/get-current-version"; +import { getLatestVersion } from "./steps/get-latest-version"; +import { getTransformsForMigration } from "./steps/get-transforms-for-migration"; +import { getTurboUpgradeCommand } from "./steps/get-turbo-upgrade-command"; import type { MigrateCommandArgument, MigrateCommandOptions } from "./types"; -import { shutdownDaemon } from "./steps/shutdownDaemon"; +import { shutdownDaemon } from "./steps/shutdown-daemon"; function endMigration({ message, diff --git a/packages/turbo-codemod/src/commands/migrate/steps/getCurrentVersion.ts b/packages/turbo-codemod/src/commands/migrate/steps/get-current-version.ts similarity index 100% rename from packages/turbo-codemod/src/commands/migrate/steps/getCurrentVersion.ts rename to packages/turbo-codemod/src/commands/migrate/steps/get-current-version.ts diff --git a/packages/turbo-codemod/src/commands/migrate/steps/getLatestVersion.ts b/packages/turbo-codemod/src/commands/migrate/steps/get-latest-version.ts similarity index 100% rename from packages/turbo-codemod/src/commands/migrate/steps/getLatestVersion.ts rename to packages/turbo-codemod/src/commands/migrate/steps/get-latest-version.ts diff --git a/packages/turbo-codemod/src/commands/migrate/steps/getTransformsForMigration.ts b/packages/turbo-codemod/src/commands/migrate/steps/get-transforms-for-migration.ts similarity index 95% rename from packages/turbo-codemod/src/commands/migrate/steps/getTransformsForMigration.ts rename to packages/turbo-codemod/src/commands/migrate/steps/get-transforms-for-migration.ts index e5fd75785c45b..6ed8d47a745b7 100644 --- a/packages/turbo-codemod/src/commands/migrate/steps/getTransformsForMigration.ts +++ b/packages/turbo-codemod/src/commands/migrate/steps/get-transforms-for-migration.ts @@ -1,5 +1,5 @@ import { gt, lte, eq } from "semver"; -import { loadTransformers } from "../../../utils/loadTransformers"; +import { loadTransformers } from "../../../utils/load-transformers"; import type { Transformer } from "../../../types"; /** diff --git a/packages/turbo-codemod/src/commands/migrate/steps/getTurboUpgradeCommand.ts b/packages/turbo-codemod/src/commands/migrate/steps/get-turbo-upgrade-command.ts similarity index 95% rename from packages/turbo-codemod/src/commands/migrate/steps/getTurboUpgradeCommand.ts rename to packages/turbo-codemod/src/commands/migrate/steps/get-turbo-upgrade-command.ts index 773f243c43e85..6a24450f02c3b 100644 --- a/packages/turbo-codemod/src/commands/migrate/steps/getTurboUpgradeCommand.ts +++ b/packages/turbo-codemod/src/commands/migrate/steps/get-turbo-upgrade-command.ts @@ -18,14 +18,18 @@ function getGlobalUpgradeCommand( to = "latest" ) { switch (packageManager) { - case "yarn": + case "yarn": { return `yarn global add turbo@${to}`; - case "npm": + } + case "npm": { return `npm install turbo@${to} --global`; - case "pnpm": + } + case "pnpm": { return `pnpm add turbo@${to} --global`; - case "bun": + } + case "bun": { return `bun add turbo@${to} --global`; + } } } @@ -47,7 +51,7 @@ function getLocalUpgradeCommand({ ): string => command.filter(Boolean).join(" "); switch (packageManager) { // yarn command differs depending on the version - case "yarn": + case "yarn": { // yarn 2.x and 3.x (berry) if (gte(packageManagerVersion, "2.0.0")) { return renderCommand([ @@ -65,15 +69,17 @@ function getLocalUpgradeCommand({ installType === "devDependencies" && "--dev", isUsingWorkspaces && "-W" ]); + } - case "npm": + case "npm": { return renderCommand([ "npm", "install", `turbo@${to}`, installType === "devDependencies" && "--save-dev" ]); - case "pnpm": + } + case "pnpm": { return renderCommand([ "pnpm", "add", @@ -81,13 +87,15 @@ function getLocalUpgradeCommand({ installType === "devDependencies" && "--save-dev", isUsingWorkspaces && "-w" ]); - case "bun": + } + case "bun": { return renderCommand([ "bun", "add", `turbo@${to}`, installType === "devDependencies" && "--dev" ]); + } } } diff --git a/packages/turbo-codemod/src/commands/migrate/steps/shutdownDaemon.ts b/packages/turbo-codemod/src/commands/migrate/steps/shutdown-daemon.ts similarity index 100% rename from packages/turbo-codemod/src/commands/migrate/steps/shutdownDaemon.ts rename to packages/turbo-codemod/src/commands/migrate/steps/shutdown-daemon.ts diff --git a/packages/turbo-codemod/src/commands/transform/index.ts b/packages/turbo-codemod/src/commands/transform/index.ts index 251a7bf89f484..67adbea6ac964 100644 --- a/packages/turbo-codemod/src/commands/transform/index.ts +++ b/packages/turbo-codemod/src/commands/transform/index.ts @@ -1,9 +1,9 @@ import picocolors from "picocolors"; import { input, select } from "@inquirer/prompts"; import { logger } from "@turbo/utils"; -import { loadTransformers } from "../../utils/loadTransformers"; -import { checkGitStatus } from "../../utils/checkGitStatus"; -import { directoryInfo } from "../../utils/directoryInfo"; +import { loadTransformers } from "../../utils/load-transformers"; +import { checkGitStatus } from "../../utils/check-git-status"; +import { directoryInfo } from "../../utils/directory-info"; import { Runner } from "../../runner"; import type { TransformCommandOptions, diff --git a/packages/turbo-codemod/src/runner/FileTransform.ts b/packages/turbo-codemod/src/runner/file-transform.ts similarity index 98% rename from packages/turbo-codemod/src/runner/FileTransform.ts rename to packages/turbo-codemod/src/runner/file-transform.ts index 14eee845228fb..f999521a004ea 100644 --- a/packages/turbo-codemod/src/runner/FileTransform.ts +++ b/packages/turbo-codemod/src/runner/file-transform.ts @@ -83,7 +83,7 @@ export class FileTransform { log(args: LogFileArgs): void { if (args.diff) { - this.changes.forEach((part) => { + for (const part of this.changes) { if (part.added) { process.stdout.write(picocolors.green(part.value)); } else if (part.removed) { @@ -91,7 +91,7 @@ export class FileTransform { } else { process.stdout.write(picocolors.dim(part.value)); } - }); + } logger.log(os.EOL); } else { logger.log(this.after); diff --git a/packages/turbo-codemod/src/runner/index.ts b/packages/turbo-codemod/src/runner/index.ts index 34d836f2382aa..cc168bc8823ae 100644 --- a/packages/turbo-codemod/src/runner/index.ts +++ b/packages/turbo-codemod/src/runner/index.ts @@ -1,3 +1,3 @@ -export { Runner } from "./Runner"; +export { Runner } from "./runner"; export type { TransformerResults, FileDiffer, FileWriter } from "./types"; diff --git a/packages/turbo-codemod/src/runner/Runner.ts b/packages/turbo-codemod/src/runner/runner.ts similarity index 95% rename from packages/turbo-codemod/src/runner/Runner.ts rename to packages/turbo-codemod/src/runner/runner.ts index f4d4b1bed8af6..5183078f5764a 100644 --- a/packages/turbo-codemod/src/runner/Runner.ts +++ b/packages/turbo-codemod/src/runner/runner.ts @@ -2,7 +2,7 @@ import picocolors from "picocolors"; import { logger } from "@turbo/utils"; import { Logger } from "../utils/logger"; import type { UtilityArgs } from "../types"; -import { FileTransform } from "./FileTransform"; +import { FileTransform } from "./file-transform"; import type { FileResult, ModifyFileArgs, @@ -46,7 +46,7 @@ export class Runner { finish(): TransformerResults { const results: TransformerResults = { changes: {} }; // perform all actions and track results - Object.keys(this.modifications).forEach((filePath) => { + for (const filePath of Object.keys(this.modifications)) { const mod = this.modifications[filePath]; const result: FileResult = { action: "unchanged", @@ -82,7 +82,7 @@ export class Runner { } results.changes[mod.fileName()] = result; - }); + } const encounteredError = Object.keys(results.changes).some((fileName) => { return results.changes[fileName].action === "error"; @@ -113,7 +113,7 @@ export class Runner { } > = {}; - changedFiles.forEach((fileName) => { + for (const fileName of changedFiles) { const fileChanges = results.changes[fileName]; table[fileName] = { action: fileChanges.action, @@ -121,7 +121,7 @@ export class Runner { deletions: fileChanges.deletions, error: fileChanges.error?.message || "None" }; - }); + } // eslint-disable-next-line no-console -- CLI utility console.table(table); diff --git a/packages/turbo-codemod/src/transforms/add-package-manager.ts b/packages/turbo-codemod/src/transforms/add-package-manager.ts index ce141f33e7977..762e59617f6e0 100644 --- a/packages/turbo-codemod/src/transforms/add-package-manager.ts +++ b/packages/turbo-codemod/src/transforms/add-package-manager.ts @@ -2,7 +2,7 @@ import path from "node:path"; import fs from "fs-extra"; import { getWorkspaceDetails, type Project } from "@turbo/workspaces"; import { type PackageJson, getAvailablePackageManagers } from "@turbo/utils"; -import { getTransformerHelpers } from "../utils/getTransformerHelpers"; +import { getTransformerHelpers } from "../utils/get-transformer-helpers"; import type { TransformerResults } from "../runner"; import type { Transformer, TransformerArgs } from "../types"; diff --git a/packages/turbo-codemod/src/transforms/add-package-names.ts b/packages/turbo-codemod/src/transforms/add-package-names.ts index 68ab02730e1ac..29a0e0185229f 100644 --- a/packages/turbo-codemod/src/transforms/add-package-names.ts +++ b/packages/turbo-codemod/src/transforms/add-package-names.ts @@ -3,7 +3,7 @@ import { getWorkspaceDetails, type Project } from "@turbo/workspaces"; import fs from "fs-extra"; import type { Transformer, TransformerArgs } from "../types"; import type { TransformerResults } from "../runner"; -import { getTransformerHelpers } from "../utils/getTransformerHelpers"; +import { getTransformerHelpers } from "../utils/get-transformer-helpers"; // transformer details const TRANSFORMER = "add-package-names"; @@ -75,11 +75,11 @@ export async function transformer({ ]; // add all workspace package.json files - project.workspaceData.workspaces.forEach((workspace) => { + for (const workspace of project.workspaceData.workspaces) { const pkgJsonPath = workspace.paths.packageJson; packagePaths.push(pkgJsonPath); packagePromises.push(readPkgJson(pkgJsonPath)); - }); + } // await, and then zip the paths and promise results together const packageContent = await Promise.all(packagePromises); diff --git a/packages/turbo-codemod/src/transforms/clean-globs.ts b/packages/turbo-codemod/src/transforms/clean-globs.ts index 0ad6e6bee28f8..d74ab96e55975 100644 --- a/packages/turbo-codemod/src/transforms/clean-globs.ts +++ b/packages/turbo-codemod/src/transforms/clean-globs.ts @@ -3,8 +3,8 @@ import type { SchemaV1 } from "@turbo/types"; import { getTurboConfigs } from "@turbo/utils"; import type { TransformerArgs, Transformer } from "../types"; import type { TransformerResults } from "../runner"; -import { getTransformerHelpers } from "../utils/getTransformerHelpers"; -import { loadTurboJson } from "../utils/loadTurboJson"; +import { getTransformerHelpers } from "../utils/get-transformer-helpers"; +import { loadTurboJson } from "../utils/load-turbo-json"; // transformer details const TRANSFORMER = "clean-globs"; @@ -32,7 +32,7 @@ export function transformer({ // find and migrate any workspace configs const workspaceConfigs = getTurboConfigs(root); - workspaceConfigs.forEach((workspaceConfig) => { + for (const workspaceConfig of workspaceConfigs) { const { config, turboConfigPath: filePath } = workspaceConfig; if ("pipeline" in config) { runner.modifyFile({ @@ -40,7 +40,7 @@ export function transformer({ after: migrateConfig(config) }); } - }); + } return runner.finish(); } diff --git a/packages/turbo-codemod/src/transforms/create-turbo-config.ts b/packages/turbo-codemod/src/transforms/create-turbo-config.ts index 174bdffc3033e..b1899c1890b31 100644 --- a/packages/turbo-codemod/src/transforms/create-turbo-config.ts +++ b/packages/turbo-codemod/src/transforms/create-turbo-config.ts @@ -3,7 +3,7 @@ import fs from "fs-extra"; import { type PackageJson } from "@turbo/utils"; import type { Schema } from "@turbo/types"; import type { TransformerResults } from "../runner"; -import { getTransformerHelpers } from "../utils/getTransformerHelpers"; +import { getTransformerHelpers } from "../utils/get-transformer-helpers"; import type { Transformer, TransformerArgs } from "../types"; // transformer details diff --git a/packages/turbo-codemod/src/transforms/migrate-dot-env.ts b/packages/turbo-codemod/src/transforms/migrate-dot-env.ts index 40e666c09bcbe..58740eaa2f64c 100644 --- a/packages/turbo-codemod/src/transforms/migrate-dot-env.ts +++ b/packages/turbo-codemod/src/transforms/migrate-dot-env.ts @@ -7,9 +7,9 @@ import { } from "@turbo/utils"; import type { SchemaV1 } from "@turbo/types"; import type { Transformer, TransformerArgs } from "../types"; -import { getTransformerHelpers } from "../utils/getTransformerHelpers"; +import { getTransformerHelpers } from "../utils/get-transformer-helpers"; import type { TransformerResults } from "../runner"; -import { loadTurboJson } from "../utils/loadTurboJson"; +import { loadTurboJson } from "../utils/load-turbo-json"; // transformer details const TRANSFORMER = "migrate-dot-env"; @@ -86,13 +86,13 @@ export function transformer({ // find and migrate any workspace configs const workspaceConfigs = getTurboConfigs(root); - workspaceConfigs.forEach((workspaceConfig) => { + for (const workspaceConfig of workspaceConfigs) { const { config, turboConfigPath: filePath } = workspaceConfig; runner.modifyFile({ filePath, after: migrateConfig(config) }); - }); + } return runner.finish(); } diff --git a/packages/turbo-codemod/src/transforms/migrate-env-var-dependencies.ts b/packages/turbo-codemod/src/transforms/migrate-env-var-dependencies.ts index b92348622fc25..3ffe05ecbc552 100644 --- a/packages/turbo-codemod/src/transforms/migrate-env-var-dependencies.ts +++ b/packages/turbo-codemod/src/transforms/migrate-env-var-dependencies.ts @@ -2,10 +2,10 @@ import path from "node:path"; import fs from "fs-extra"; import { type PackageJson, getTurboConfigs } from "@turbo/utils"; import type { Pipeline, SchemaV1 } from "@turbo/types"; -import { getTransformerHelpers } from "../utils/getTransformerHelpers"; +import { getTransformerHelpers } from "../utils/get-transformer-helpers"; import type { TransformerResults } from "../runner"; import type { Transformer, TransformerArgs } from "../types"; -import { loadTurboJson } from "../utils/loadTurboJson"; +import { loadTurboJson } from "../utils/load-turbo-json"; import { isPipelineKeyMissing } from "../utils/is-pipeline-key-missing"; // transformer details @@ -38,13 +38,15 @@ export function migrateDependencies({ }) { const envDeps = new Set(env); const otherDeps: Array = []; - deps?.forEach((dep) => { - if (dep.startsWith("$")) { - envDeps.add(dep.slice(1)); - } else { - otherDeps.push(dep); + if (deps) { + for (const dep of deps) { + if (dep.startsWith("$")) { + envDeps.add(dep.slice(1)); + } else { + otherDeps.push(dep); + } } - }); + } if (envDeps.size) { return { deps: otherDeps, @@ -103,7 +105,7 @@ export function migrateConfig(config: SchemaV1) { } const migratedConfig = migrateGlobal(config); - Object.keys(config.pipeline).forEach((pipelineKey) => { + for (const pipelineKey of Object.keys(config.pipeline)) { if (pipelineKey in config.pipeline) { const pipeline = migratedConfig.pipeline[pipelineKey]; migratedConfig.pipeline[pipelineKey] = { @@ -111,7 +113,7 @@ export function migrateConfig(config: SchemaV1) { ...migratePipeline(pipeline) }; } - }); + } return migratedConfig; } @@ -165,7 +167,7 @@ export function transformer({ // find and migrate any workspace configs const workspaceConfigs = getTurboConfigs(root); - workspaceConfigs.forEach((workspaceConfig) => { + for (const workspaceConfig of workspaceConfigs) { const { config, turboConfigPath: filePath } = workspaceConfig; if ("pipeline" in config && hasLegacyEnvVarDependencies(config).hasKeys) { runner.modifyFile({ @@ -173,7 +175,7 @@ export function transformer({ after: migrateConfig(config) }); } - }); + } return runner.finish(); } diff --git a/packages/turbo-codemod/src/transforms/rename-output-mode.ts b/packages/turbo-codemod/src/transforms/rename-output-mode.ts index 6488c42d00bde..7bb96e796cc14 100644 --- a/packages/turbo-codemod/src/transforms/rename-output-mode.ts +++ b/packages/turbo-codemod/src/transforms/rename-output-mode.ts @@ -3,9 +3,9 @@ import fs from "fs-extra"; import { type PackageJson, getTurboConfigs } from "@turbo/utils"; import type { PipelineV2, SchemaV1 } from "@turbo/types"; import type { Transformer, TransformerArgs } from "../types"; -import { getTransformerHelpers } from "../utils/getTransformerHelpers"; +import { getTransformerHelpers } from "../utils/get-transformer-helpers"; import type { TransformerResults } from "../runner"; -import { loadTurboJson } from "../utils/loadTurboJson"; +import { loadTurboJson } from "../utils/load-turbo-json"; // transformer details const TRANSFORMER = "rename-output-mode"; @@ -15,7 +15,7 @@ const INTRODUCED_IN = "2.0.0-canary.0"; function migrateConfig(config: SchemaV1) { for (const [_, taskDef] of Object.entries(config.pipeline)) { - if (Object.prototype.hasOwnProperty.call(taskDef, "outputMode")) { + if (Object.hasOwn(taskDef, "outputMode")) { (taskDef as PipelineV2).outputLogs = taskDef.outputMode; delete taskDef.outputMode; } @@ -68,7 +68,7 @@ export function transformer({ // find and migrate any workspace configs const workspaceConfigs = getTurboConfigs(root); - workspaceConfigs.forEach((workspaceConfig) => { + for (const workspaceConfig of workspaceConfigs) { const { config, turboConfigPath: filePath } = workspaceConfig; if ("pipeline" in config) { runner.modifyFile({ @@ -76,7 +76,7 @@ export function transformer({ after: migrateConfig(config) }); } - }); + } return runner.finish(); } diff --git a/packages/turbo-codemod/src/transforms/rename-pipeline.ts b/packages/turbo-codemod/src/transforms/rename-pipeline.ts index 84b96f647096c..6362301c507f7 100644 --- a/packages/turbo-codemod/src/transforms/rename-pipeline.ts +++ b/packages/turbo-codemod/src/transforms/rename-pipeline.ts @@ -3,9 +3,9 @@ import fs from "fs-extra"; import { getTurboConfigs } from "@turbo/utils"; import type { SchemaV2, SchemaV1 } from "@turbo/types"; import type { Transformer, TransformerArgs } from "../types"; -import { getTransformerHelpers } from "../utils/getTransformerHelpers"; +import { getTransformerHelpers } from "../utils/get-transformer-helpers"; import type { TransformerResults } from "../runner"; -import { loadTurboJson } from "../utils/loadTurboJson"; +import { loadTurboJson } from "../utils/load-turbo-json"; // transformer details const TRANSFORMER = "rename-pipeline"; @@ -51,7 +51,7 @@ export function transformer({ // find and migrate any workspace configs const workspaceConfigs = getTurboConfigs(root); - workspaceConfigs.forEach((workspaceConfig) => { + for (const workspaceConfig of workspaceConfigs) { const { config, turboConfigPath: filePath } = workspaceConfig; if ("pipeline" in config) { runner.modifyFile({ @@ -59,7 +59,7 @@ export function transformer({ after: migrateConfig(config) }); } - }); + } return runner.finish(); } diff --git a/packages/turbo-codemod/src/transforms/set-default-outputs.ts b/packages/turbo-codemod/src/transforms/set-default-outputs.ts index 8eafba00818aa..b67cb9e68be71 100644 --- a/packages/turbo-codemod/src/transforms/set-default-outputs.ts +++ b/packages/turbo-codemod/src/transforms/set-default-outputs.ts @@ -3,9 +3,9 @@ import fs from "fs-extra"; import { type PackageJson, getTurboConfigs } from "@turbo/utils"; import type { SchemaV1 } from "@turbo/types"; import type { Transformer, TransformerArgs } from "../types"; -import { getTransformerHelpers } from "../utils/getTransformerHelpers"; +import { getTransformerHelpers } from "../utils/get-transformer-helpers"; import type { TransformerResults } from "../runner"; -import { loadTurboJson } from "../utils/loadTurboJson"; +import { loadTurboJson } from "../utils/load-turbo-json"; import { isPipelineKeyMissing } from "../utils/is-pipeline-key-missing"; const DEFAULT_OUTPUTS = ["dist/**", "build/**"]; @@ -82,7 +82,7 @@ export function transformer({ // find and migrate any workspace configs const workspaceConfigs = getTurboConfigs(root); - workspaceConfigs.forEach((workspaceConfig) => { + for (const workspaceConfig of workspaceConfigs) { const { config, turboConfigPath: filePath } = workspaceConfig; if ("pipeline" in config) { runner.modifyFile({ @@ -90,7 +90,7 @@ export function transformer({ after: migrateConfig(config) }); } - }); + } return runner.finish(); } diff --git a/packages/turbo-codemod/src/transforms/stabilize-env-mode.ts b/packages/turbo-codemod/src/transforms/stabilize-env-mode.ts index 12001092672fe..bf93cff454543 100644 --- a/packages/turbo-codemod/src/transforms/stabilize-env-mode.ts +++ b/packages/turbo-codemod/src/transforms/stabilize-env-mode.ts @@ -3,9 +3,9 @@ import fs from "fs-extra"; import { type PackageJson, getTurboConfigs } from "@turbo/utils"; import type { SchemaV1, RootSchemaV1, Pipeline } from "@turbo/types"; import type { Transformer, TransformerArgs } from "../types"; -import { getTransformerHelpers } from "../utils/getTransformerHelpers"; +import { getTransformerHelpers } from "../utils/get-transformer-helpers"; import type { TransformerResults } from "../runner"; -import { loadTurboJson } from "../utils/loadTurboJson"; +import { loadTurboJson } from "../utils/load-turbo-json"; import { isPipelineKeyMissing } from "../utils/is-pipeline-key-missing"; // transformer details @@ -149,7 +149,7 @@ export function transformer({ // find and migrate any workspace configs const allTurboJsons = getTurboConfigs(root); - allTurboJsons.forEach((workspaceConfig) => { + for (const workspaceConfig of allTurboJsons) { const { config, turboConfigPath: filePath, isRootConfig } = workspaceConfig; if (!isRootConfig && "pipeline" in config) { runner.modifyFile({ @@ -157,7 +157,7 @@ export function transformer({ after: migrateTaskConfigs(config) }); } - }); + } return runner.finish(); } diff --git a/packages/turbo-codemod/src/transforms/stabilize-ui.ts b/packages/turbo-codemod/src/transforms/stabilize-ui.ts index a886001cec3c6..3d0de67310dfd 100644 --- a/packages/turbo-codemod/src/transforms/stabilize-ui.ts +++ b/packages/turbo-codemod/src/transforms/stabilize-ui.ts @@ -2,9 +2,9 @@ import path from "node:path"; import fs from "fs-extra"; import type { RootSchema } from "@turbo/types"; import type { Transformer, TransformerArgs } from "../types"; -import { getTransformerHelpers } from "../utils/getTransformerHelpers"; +import { getTransformerHelpers } from "../utils/get-transformer-helpers"; import type { TransformerResults } from "../runner"; -import { loadTurboJson } from "../utils/loadTurboJson"; +import { loadTurboJson } from "../utils/load-turbo-json"; // transformer details const TRANSFORMER = "stabilize-ui"; diff --git a/packages/turbo-codemod/src/transforms/transform-env-literals-to-wildcards.ts b/packages/turbo-codemod/src/transforms/transform-env-literals-to-wildcards.ts index ed8a1692670e8..92e2670dcdfcc 100644 --- a/packages/turbo-codemod/src/transforms/transform-env-literals-to-wildcards.ts +++ b/packages/turbo-codemod/src/transforms/transform-env-literals-to-wildcards.ts @@ -3,9 +3,9 @@ import fs from "fs-extra"; import { type PackageJson, getTurboConfigs } from "@turbo/utils"; import type { RootSchemaV1, SchemaV1, EnvWildcard } from "@turbo/types"; import type { Transformer, TransformerArgs } from "../types"; -import { getTransformerHelpers } from "../utils/getTransformerHelpers"; +import { getTransformerHelpers } from "../utils/get-transformer-helpers"; import type { TransformerResults } from "../runner"; -import { loadTurboJson } from "../utils/loadTurboJson"; +import { loadTurboJson } from "../utils/load-turbo-json"; import { isPipelineKeyMissing } from "../utils/is-pipeline-key-missing"; // transformer details @@ -111,7 +111,7 @@ export function transformer({ // find and migrate any workspace configs const allTurboJsons = getTurboConfigs(root); - allTurboJsons.forEach((workspaceConfig) => { + for (const workspaceConfig of allTurboJsons) { const { config, turboConfigPath: filePath, isRootConfig } = workspaceConfig; if (!isRootConfig && "pipeline" in config) { runner.modifyFile({ @@ -119,7 +119,7 @@ export function transformer({ after: migrateTaskConfigs(config) }); } - }); + } return runner.finish(); } diff --git a/packages/turbo-codemod/src/transforms/update-schema-json-url.ts b/packages/turbo-codemod/src/transforms/update-schema-json-url.ts index 146a4bf41005b..1e686d5800c20 100644 --- a/packages/turbo-codemod/src/transforms/update-schema-json-url.ts +++ b/packages/turbo-codemod/src/transforms/update-schema-json-url.ts @@ -1,7 +1,7 @@ import path from "node:path"; import fs from "fs-extra"; import type { TransformerResults } from "../runner"; -import { getTransformerHelpers } from "../utils/getTransformerHelpers"; +import { getTransformerHelpers } from "../utils/get-transformer-helpers"; import type { Transformer, TransformerArgs } from "../types"; // transformer details diff --git a/packages/turbo-codemod/src/transforms/update-versioned-schema-json.ts b/packages/turbo-codemod/src/transforms/update-versioned-schema-json.ts index 4a3cb13f04b70..9ee6f48a1b356 100644 --- a/packages/turbo-codemod/src/transforms/update-versioned-schema-json.ts +++ b/packages/turbo-codemod/src/transforms/update-versioned-schema-json.ts @@ -39,7 +39,7 @@ import fs from "fs-extra"; import { gte, coerce } from "semver"; import { getTurboConfigs } from "@turbo/utils"; import type { TransformerResults } from "../runner"; -import { getTransformerHelpers } from "../utils/getTransformerHelpers"; +import { getTransformerHelpers } from "../utils/get-transformer-helpers"; import type { Transformer, TransformerArgs } from "../types"; // transformer details diff --git a/packages/turbo-codemod/src/utils/checkGitStatus.ts b/packages/turbo-codemod/src/utils/check-git-status.ts similarity index 100% rename from packages/turbo-codemod/src/utils/checkGitStatus.ts rename to packages/turbo-codemod/src/utils/check-git-status.ts diff --git a/packages/turbo-codemod/src/utils/directoryInfo.ts b/packages/turbo-codemod/src/utils/directory-info.ts similarity index 100% rename from packages/turbo-codemod/src/utils/directoryInfo.ts rename to packages/turbo-codemod/src/utils/directory-info.ts diff --git a/packages/turbo-codemod/src/utils/getTransformerHelpers.ts b/packages/turbo-codemod/src/utils/get-transformer-helpers.ts similarity index 100% rename from packages/turbo-codemod/src/utils/getTransformerHelpers.ts rename to packages/turbo-codemod/src/utils/get-transformer-helpers.ts diff --git a/packages/turbo-codemod/src/utils/loadTransformers.ts b/packages/turbo-codemod/src/utils/load-transformers.ts similarity index 100% rename from packages/turbo-codemod/src/utils/loadTransformers.ts rename to packages/turbo-codemod/src/utils/load-transformers.ts diff --git a/packages/turbo-codemod/src/utils/loadTurboJson.ts b/packages/turbo-codemod/src/utils/load-turbo-json.ts similarity index 100% rename from packages/turbo-codemod/src/utils/loadTurboJson.ts rename to packages/turbo-codemod/src/utils/load-turbo-json.ts diff --git a/packages/turbo-codemod/src/utils/looksLikeRepo.ts b/packages/turbo-codemod/src/utils/looks-like-repo.ts similarity index 100% rename from packages/turbo-codemod/src/utils/looksLikeRepo.ts rename to packages/turbo-codemod/src/utils/looks-like-repo.ts diff --git a/packages/turbo-codemod/tsconfig.json b/packages/turbo-codemod/tsconfig.json index 65e03f1b24f63..5f5b85755f719 100644 --- a/packages/turbo-codemod/tsconfig.json +++ b/packages/turbo-codemod/tsconfig.json @@ -2,6 +2,7 @@ "extends": "@turbo/tsconfig/library.json", "compilerOptions": { "rootDir": ".", - "lib": ["ES2022", "DOM"] + "lib": ["ES2022", "DOM"], + "strictNullChecks": true } } diff --git a/packages/turbo-exe-stub/package.json b/packages/turbo-exe-stub/package.json index 9732b223d47ed..abbcc2e7880aa 100644 --- a/packages/turbo-exe-stub/package.json +++ b/packages/turbo-exe-stub/package.json @@ -1,7 +1,7 @@ { "name": "@turbo/exe-stub", - "description": "Stub for turbo.exe", "private": true, + "description": "Stub for turbo.exe", "scripts": { "build": "bash build.sh" } diff --git a/packages/turbo-gen/__tests__/raw.test.ts b/packages/turbo-gen/__tests__/raw.test.ts index bcf5d500eac8e..85d9be64e0238 100644 --- a/packages/turbo-gen/__tests__/raw.test.ts +++ b/packages/turbo-gen/__tests__/raw.test.ts @@ -136,6 +136,7 @@ describe("raw", () => { } } ]; + it.each(testMatrix)( "$command and $options calls $target with $calledWith", async ({ diff --git a/packages/turbo-gen/bump-version.js b/packages/turbo-gen/bump-version.js index 4fce11b909258..1bf2a9cd245d6 100644 --- a/packages/turbo-gen/bump-version.js +++ b/packages/turbo-gen/bump-version.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -const fs = require("fs"); +const fs = require("node:fs"); const pkg = require("./package.json"); const file = require.resolve("./package.json"); diff --git a/packages/turbo-gen/package.json b/packages/turbo-gen/package.json index a48a7a9be9deb..343f11024a442 100644 --- a/packages/turbo-gen/package.json +++ b/packages/turbo-gen/package.json @@ -3,17 +3,25 @@ "version": "2.8.11-canary.22", "description": "Extend a Turborepo", "homepage": "https://turborepo.dev", + "bugs": { + "url": "https://github.com/vercel/turborepo/issues" + }, "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/vercel/turborepo.git", "directory": "packages/turbo-gen" }, - "bugs": { - "url": "https://github.com/vercel/turborepo/issues" - }, "bin": "bin/turbo-gen", + "files": [ + "bin", + "dist/types.d.ts", + "dist/types.js" + ], "types": "dist/types.d.ts", + "publishConfig": { + "access": "public" + }, "scripts": { "postversion": "node bump-version.js", "build": "bun run scripts/build.ts", @@ -49,14 +57,6 @@ "update-check": "1.5.4", "validate-npm-package-name": "5.0.0" }, - "files": [ - "bin", - "dist/types.d.ts", - "dist/types.js" - ], - "publishConfig": { - "access": "public" - }, "optionalDependencies": { "@turbo/gen-darwin-64": "2.8.11-canary.22", "@turbo/gen-darwin-arm64": "2.8.11-canary.22", diff --git a/packages/turbo-gen/src/commands/run/index.ts b/packages/turbo-gen/src/commands/run/index.ts index 918f8c163de75..bd5d6f6c08622 100644 --- a/packages/turbo-gen/src/commands/run/index.ts +++ b/packages/turbo-gen/src/commands/run/index.ts @@ -1,5 +1,5 @@ import { logger } from "@turbo/utils"; -import { getProject } from "../../utils/getProject"; +import { getProject } from "../../utils/get-project"; import { custom } from "../../generators"; export interface CustomGeneratorCLIOptions { diff --git a/packages/turbo-gen/src/commands/run/prompts.ts b/packages/turbo-gen/src/commands/run/prompts.ts index 8e29e76eac77d..090aa961ff670 100644 --- a/packages/turbo-gen/src/commands/run/prompts.ts +++ b/packages/turbo-gen/src/commands/run/prompts.ts @@ -15,7 +15,7 @@ export async function customGenerators({ }) { if (generator) { if ( - generators.find((g) => !(g instanceof Separator) && g.name === generator) + generators.some((g) => !(g instanceof Separator) && g.name === generator) ) { return { selectedGenerator: generator diff --git a/packages/turbo-gen/src/commands/workspace/index.ts b/packages/turbo-gen/src/commands/workspace/index.ts index d657afe2b75fa..169119ef255eb 100644 --- a/packages/turbo-gen/src/commands/workspace/index.ts +++ b/packages/turbo-gen/src/commands/workspace/index.ts @@ -1,5 +1,5 @@ import { logger } from "@turbo/utils"; -import { getProject } from "../../utils/getProject"; +import { getProject } from "../../utils/get-project"; import { copy as GenFromCopy, empty as GenEmpty } from "../../generators"; import type { TurboGeneratorOptions, diff --git a/packages/turbo-gen/src/commands/workspace/prompts.ts b/packages/turbo-gen/src/commands/workspace/prompts.ts index 53d55f9cabf12..495a0c96448bb 100644 --- a/packages/turbo-gen/src/commands/workspace/prompts.ts +++ b/packages/turbo-gen/src/commands/workspace/prompts.ts @@ -16,9 +16,9 @@ import { type DependencyGroups, type PackageJson } from "@turbo/utils"; -import { getWorkspaceStructure } from "../../utils/getWorkspaceStructure"; +import { getWorkspaceStructure } from "../../utils/get-workspace-structure"; import type { WorkspaceType } from "../../generators/types"; -import { getWorkspaceList } from "../../utils/getWorkspaceList"; +import { getWorkspaceList } from "../../utils/get-workspace-list"; export async function name({ override, @@ -249,12 +249,12 @@ export async function dependencies({ if (Object.keys(newDependencyGroup).length) { const existingDependencyKeys = new Set(Object.keys(newDependencyGroup)); - selected.forEach((dep) => { + for (const dep of selected) { if (!existingDependencyKeys.has(dep)) { newDependencyGroup[dep] = project.packageManager === "pnpm" ? "workspace:*" : "*"; } - }); + } selectedDependencies[group] = newDependencyGroup; } else { diff --git a/packages/turbo-gen/src/generators/copy.ts b/packages/turbo-gen/src/generators/copy.ts index 85030086e51a0..e3d4656452199 100644 --- a/packages/turbo-gen/src/generators/copy.ts +++ b/packages/turbo-gen/src/generators/copy.ts @@ -8,7 +8,7 @@ import { type DependencyGroups, type PackageJson } from "@turbo/utils"; -import { gatherAddRequirements } from "../utils/gatherAddRequirements"; +import { gatherAddRequirements } from "../utils/gather-add-requirements"; import type { TurboGeneratorArguments } from "./types"; export async function generate({ project, opts }: TurboGeneratorArguments) { @@ -65,7 +65,7 @@ export async function generate({ project, opts }: TurboGeneratorArguments) { } } else if (source) { const filterFunc: CopyFilterAsync = async (src) => - Promise.resolve(!src.includes("node_modules")); + !src.includes("node_modules"); const loader = logger.turboLoader( `Creating "${name}" from "${source.name}"...` @@ -82,12 +82,12 @@ export async function generate({ project, opts }: TurboGeneratorArguments) { packageJson.name = name; // update dependencies - Object.keys(dependencies).forEach((group) => { + for (const group of Object.keys(dependencies)) { const deps = dependencies[group as keyof DependencyGroups]; if (deps && Object.keys(deps).length > 0) { packageJson[group as keyof DependencyGroups] = deps; } - }); + } await fs.writeJSON(newPackageJsonPath, packageJson, { spaces: 2 }); logger.log(); diff --git a/packages/turbo-gen/src/generators/custom.ts b/packages/turbo-gen/src/generators/custom.ts index c29807418aea8..4a2ee33137a84 100644 --- a/packages/turbo-gen/src/generators/custom.ts +++ b/packages/turbo-gen/src/generators/custom.ts @@ -2,7 +2,7 @@ import { logger } from "@turbo/utils"; import { getCustomGenerators, runCustomGenerator } from "../utils/plop"; import * as prompts from "../commands/run/prompts"; import { GeneratorError } from "../utils/error"; -import { setupFromTemplate } from "../utils/setupFromTemplate"; +import { setupFromTemplate } from "../utils/setup-from-template"; import type { CustomGeneratorArguments } from "./types"; export async function generate({ diff --git a/packages/turbo-gen/src/generators/empty.ts b/packages/turbo-gen/src/generators/empty.ts index 62cc40094b2a3..c9aac796d3e26 100644 --- a/packages/turbo-gen/src/generators/empty.ts +++ b/packages/turbo-gen/src/generators/empty.ts @@ -2,7 +2,7 @@ import path from "node:path"; import fs from "fs-extra"; import picocolors from "picocolors"; import { logger, type PackageJson, type DependencyGroups } from "@turbo/utils"; -import { gatherAddRequirements } from "../utils/gatherAddRequirements"; +import { gatherAddRequirements } from "../utils/gather-add-requirements"; import type { TurboGeneratorArguments } from "./types"; export async function generate({ project, opts }: TurboGeneratorArguments) { @@ -24,12 +24,12 @@ export async function generate({ project, opts }: TurboGeneratorArguments) { }; // update dependencies - Object.keys(dependencies).forEach((group) => { + for (const group of Object.keys(dependencies)) { const deps = dependencies[group as keyof DependencyGroups]; if (deps && Object.keys(deps).length > 0) { packageJson[group as keyof DependencyGroups] = deps; } - }); + } // write the directory fs.mkdirSync(location.absolute, { recursive: true }); diff --git a/packages/turbo-gen/src/utils/gatherAddRequirements.ts b/packages/turbo-gen/src/utils/gather-add-requirements.ts similarity index 96% rename from packages/turbo-gen/src/utils/gatherAddRequirements.ts rename to packages/turbo-gen/src/utils/gather-add-requirements.ts index 561872016f80e..7c98ff5f16634 100644 --- a/packages/turbo-gen/src/utils/gatherAddRequirements.ts +++ b/packages/turbo-gen/src/utils/gather-add-requirements.ts @@ -1,7 +1,7 @@ import type { Workspace } from "@turbo/workspaces"; import type { TurboGeneratorArguments } from "../generators/types"; import * as prompts from "../commands/workspace/prompts"; -import { getWorkspaceList } from "./getWorkspaceList"; +import { getWorkspaceList } from "./get-workspace-list"; export async function gatherAddRequirements({ project, diff --git a/packages/turbo-gen/src/utils/getProject.ts b/packages/turbo-gen/src/utils/get-project.ts similarity index 100% rename from packages/turbo-gen/src/utils/getProject.ts rename to packages/turbo-gen/src/utils/get-project.ts diff --git a/packages/turbo-gen/src/utils/getWorkspaceList.ts b/packages/turbo-gen/src/utils/get-workspace-list.ts similarity index 93% rename from packages/turbo-gen/src/utils/getWorkspaceList.ts rename to packages/turbo-gen/src/utils/get-workspace-list.ts index 028f9cfcbf332..9fa80cc256287 100644 --- a/packages/turbo-gen/src/utils/getWorkspaceList.ts +++ b/packages/turbo-gen/src/utils/get-workspace-list.ts @@ -4,7 +4,7 @@ import type { WorkspaceType } from "../generators/types"; import { getWorkspaceStructure, getGroupFromWorkspace -} from "./getWorkspaceStructure"; +} from "./get-workspace-structure"; export function getWorkspaceList({ project, @@ -29,14 +29,14 @@ export function getWorkspaceList({ // build final list with separators between groups let lastGroup: string | undefined; - workspacesForDisplay.forEach((workspace) => { + for (const workspace of workspacesForDisplay) { const group = getGroupFromWorkspace({ project, workspace }); if (group !== lastGroup) { workspaceChoices.push(new Separator(group)); } lastGroup = group; workspaceChoices.push(workspace); - }); + } return workspaceChoices; } diff --git a/packages/turbo-gen/src/utils/getWorkspaceStructure.ts b/packages/turbo-gen/src/utils/get-workspace-structure.ts similarity index 92% rename from packages/turbo-gen/src/utils/getWorkspaceStructure.ts rename to packages/turbo-gen/src/utils/get-workspace-structure.ts index 3c4bb3610a6c5..88d8114a44104 100644 --- a/packages/turbo-gen/src/utils/getWorkspaceStructure.ts +++ b/packages/turbo-gen/src/utils/get-workspace-structure.ts @@ -1,6 +1,6 @@ import path from "node:path"; import type { Project, Workspace } from "@turbo/workspaces"; -import { getWorkspaceRoots } from "./workspaceRoots"; +import { getWorkspaceRoots } from "./workspace-roots"; interface WorkspaceStructure { hasRootApps: boolean; @@ -34,7 +34,7 @@ export function getWorkspaceStructure({ const workspacesByGroup: WorkspaceStructure["workspacesByGroup"] = {}; const nonAppWorkspaces: WorkspaceStructure["nonAppWorkspaces"] = []; - project.workspaceData.workspaces.forEach((w) => { + for (const w of project.workspaceData.workspaces) { const group = getGroupFromWorkspace({ project, workspace: w }); if (group !== "apps") { nonAppWorkspaces.push(w); @@ -45,7 +45,7 @@ export function getWorkspaceStructure({ workspacesByGroup[group] = []; } workspacesByGroup[group].push(w); - }); + } return { hasRootApps, diff --git a/packages/turbo-gen/src/utils/plop.ts b/packages/turbo-gen/src/utils/plop.ts index 6b8736ae1cc99..346f822422632 100644 --- a/packages/turbo-gen/src/utils/plop.ts +++ b/packages/turbo-gen/src/utils/plop.ts @@ -131,7 +131,7 @@ export async function getCustomGenerators({ const gensWithDetails = gens.map((g) => plop.getGenerator(g.name)); const gensByWorkspace: Record> = {}; - gensWithDetails.forEach((g) => { + for (const g of gensWithDetails) { const generatorDetails = g as Generator; const gensWorkspace = project.workspaceData.workspaces.find((w) => { if (generatorDetails.basePath === project.paths.root) { @@ -155,14 +155,14 @@ export async function getCustomGenerators({ } gensByWorkspace.root.push(generatorDetails); } - }); + } const gensWithSeparators: Array> = []; - Object.keys(gensByWorkspace).forEach((group) => { + for (const group of Object.keys(gensByWorkspace)) { gensWithSeparators.push(new Separator(group)); gensWithSeparators.push(...gensByWorkspace[group]); - }); + } return gensWithSeparators; } @@ -413,7 +413,7 @@ function getWorkspaceGeneratorConfigs({ project }: { project: Project }) { config: string; root: string; }> = []; - project.workspaceData.workspaces.forEach((w) => { + for (const w of project.workspaceData.workspaces) { for (const configPath of SUPPORTED_WORKSPACE_GENERATOR_CONFIGS) { if (fs.existsSync(path.join(w.paths.root, configPath))) { workspaceGeneratorConfigs.push({ @@ -422,7 +422,7 @@ function getWorkspaceGeneratorConfigs({ project }: { project: Project }) { }); } } - }); + } return workspaceGeneratorConfigs; } @@ -462,13 +462,13 @@ export async function runCustomGenerator({ ); if (results.failures.length > 0) { - results.failures.forEach((f) => { + for (const f of results.failures) { if (f instanceof Error) { logger.error(`Error - ${f.message}`); } else { logger.error(`Error - ${f.error}. Unable to ${f.type} to "${f.path}"`); } - }); + } throw new GeneratorError(`Failed to run "${generator}" generator`, { type: "plop_error_running_generator" }); @@ -476,10 +476,10 @@ export async function runCustomGenerator({ if (results.changes.length > 0) { logger.info("Changes made:"); - results.changes.forEach((c) => { + for (const c of results.changes) { if (c.path) { logger.item(`${c.path} (${c.type})`); } - }); + } } } diff --git a/packages/turbo-gen/src/utils/setupFromTemplate.ts b/packages/turbo-gen/src/utils/setup-from-template.ts similarity index 100% rename from packages/turbo-gen/src/utils/setupFromTemplate.ts rename to packages/turbo-gen/src/utils/setup-from-template.ts diff --git a/packages/turbo-gen/src/utils/workspaceRoots.ts b/packages/turbo-gen/src/utils/workspace-roots.ts similarity index 94% rename from packages/turbo-gen/src/utils/workspaceRoots.ts rename to packages/turbo-gen/src/utils/workspace-roots.ts index c71bf43a6785a..022250e8a2631 100644 --- a/packages/turbo-gen/src/utils/workspaceRoots.ts +++ b/packages/turbo-gen/src/utils/workspace-roots.ts @@ -16,7 +16,7 @@ export function getWorkspaceRoots({ // find valid workspace locations const workspaceRoots = new Set(); - project.workspaceData.globs.forEach((glob) => { + for (const glob of project.workspaceData.globs) { if (allWorkspacePaths.includes(glob)) { // do nothing } else if (glob.startsWith("!")) { @@ -26,7 +26,7 @@ export function getWorkspaceRoots({ const globRoot = globParts[0]; workspaceRoots.add(globRoot); } - }); + } return Array.from(workspaceRoots); } diff --git a/packages/turbo-gen/tsconfig.json b/packages/turbo-gen/tsconfig.json index cc5b3204eb3d1..877593a78c160 100644 --- a/packages/turbo-gen/tsconfig.json +++ b/packages/turbo-gen/tsconfig.json @@ -3,6 +3,7 @@ "exclude": ["src/templates", "scripts", "dist", "node_modules"], "compilerOptions": { "rootDir": ".", - "lib": ["ES2022", "DOM"] + "lib": ["ES2022", "DOM"], + "strictNullChecks": true } } diff --git a/packages/turbo-ignore/__fixtures__/app/package.json b/packages/turbo-ignore/__fixtures__/app/package.json index 17d7c56314b6d..cb0f8b222c757 100644 --- a/packages/turbo-ignore/__fixtures__/app/package.json +++ b/packages/turbo-ignore/__fixtures__/app/package.json @@ -1,11 +1,11 @@ { "name": "test-app", - "private": true, "version": "1.0.0", + "private": true, "description": "", + "author": "vercel", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "vercel" + } } diff --git a/packages/turbo-ignore/__fixtures__/invalid-app/package.json b/packages/turbo-ignore/__fixtures__/invalid-app/package.json index ee2f59bce648e..263375713bdbb 100644 --- a/packages/turbo-ignore/__fixtures__/invalid-app/package.json +++ b/packages/turbo-ignore/__fixtures__/invalid-app/package.json @@ -1,10 +1,10 @@ { - "private": true, "version": "1.0.0", + "private": true, "description": "", + "author": "vercel", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "vercel" + } } diff --git a/packages/turbo-ignore/__fixtures__/invalid_turbo_json/package.json b/packages/turbo-ignore/__fixtures__/invalid_turbo_json/package.json index 17d7c56314b6d..cb0f8b222c757 100644 --- a/packages/turbo-ignore/__fixtures__/invalid_turbo_json/package.json +++ b/packages/turbo-ignore/__fixtures__/invalid_turbo_json/package.json @@ -1,11 +1,11 @@ { "name": "test-app", - "private": true, "version": "1.0.0", + "private": true, "description": "", + "author": "vercel", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "vercel" + } } diff --git a/packages/turbo-ignore/__fixtures__/no_turbo_deps/package.json b/packages/turbo-ignore/__fixtures__/no_turbo_deps/package.json index 17d7c56314b6d..cb0f8b222c757 100644 --- a/packages/turbo-ignore/__fixtures__/no_turbo_deps/package.json +++ b/packages/turbo-ignore/__fixtures__/no_turbo_deps/package.json @@ -1,11 +1,11 @@ { "name": "test-app", - "private": true, "version": "1.0.0", + "private": true, "description": "", + "author": "vercel", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "vercel" + } } diff --git a/packages/turbo-ignore/__fixtures__/no_turbo_deps_v1/package.json b/packages/turbo-ignore/__fixtures__/no_turbo_deps_v1/package.json index 17d7c56314b6d..cb0f8b222c757 100644 --- a/packages/turbo-ignore/__fixtures__/no_turbo_deps_v1/package.json +++ b/packages/turbo-ignore/__fixtures__/no_turbo_deps_v1/package.json @@ -1,11 +1,11 @@ { "name": "test-app", - "private": true, "version": "1.0.0", + "private": true, "description": "", + "author": "vercel", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "vercel" + } } diff --git a/packages/turbo-ignore/__fixtures__/turbo_catalog/package.json b/packages/turbo-ignore/__fixtures__/turbo_catalog/package.json index a5b1e703f050b..39e9952743aec 100644 --- a/packages/turbo-ignore/__fixtures__/turbo_catalog/package.json +++ b/packages/turbo-ignore/__fixtures__/turbo_catalog/package.json @@ -1,13 +1,13 @@ { "name": "test-app", - "private": true, "version": "1.0.0", + "private": true, "description": "", + "author": "vercel", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, - "author": "vercel", "dependencies": { "turbo": "catalog:" } diff --git a/packages/turbo-ignore/__fixtures__/turbo_catalog/turbo_in_deps/package.json b/packages/turbo-ignore/__fixtures__/turbo_catalog/turbo_in_deps/package.json index 5ecef8f856f45..39ca8b1603c77 100644 --- a/packages/turbo-ignore/__fixtures__/turbo_catalog/turbo_in_deps/package.json +++ b/packages/turbo-ignore/__fixtures__/turbo_catalog/turbo_in_deps/package.json @@ -1,13 +1,13 @@ { "name": "test-app", - "private": true, "version": "1.0.0", + "private": true, "description": "", + "author": "vercel", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, - "author": "vercel", "dependencies": { "turbo": "^99" } diff --git a/packages/turbo-ignore/__fixtures__/turbo_in_deps/package.json b/packages/turbo-ignore/__fixtures__/turbo_in_deps/package.json index 5ecef8f856f45..39ca8b1603c77 100644 --- a/packages/turbo-ignore/__fixtures__/turbo_in_deps/package.json +++ b/packages/turbo-ignore/__fixtures__/turbo_in_deps/package.json @@ -1,13 +1,13 @@ { "name": "test-app", - "private": true, "version": "1.0.0", + "private": true, "description": "", + "author": "vercel", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, - "author": "vercel", "dependencies": { "turbo": "^99" } diff --git a/packages/turbo-ignore/__tests__/checkCommit.test.ts b/packages/turbo-ignore/__tests__/check-commit.test.ts similarity index 99% rename from packages/turbo-ignore/__tests__/checkCommit.test.ts rename to packages/turbo-ignore/__tests__/check-commit.test.ts index 0e04324515ec3..c9af8e7e39b12 100644 --- a/packages/turbo-ignore/__tests__/checkCommit.test.ts +++ b/packages/turbo-ignore/__tests__/check-commit.test.ts @@ -2,7 +2,7 @@ import child_process from "node:child_process"; import { mockEnv } from "@turbo/test-utils"; import { describe, it, expect, jest } from "@jest/globals"; -import { checkCommit } from "../src/checkCommit"; +import { checkCommit } from "../src/check-commit"; describe("checkCommit()", () => { describe("on Vercel", () => { diff --git a/packages/turbo-ignore/__tests__/getComparison.test.ts b/packages/turbo-ignore/__tests__/get-comparison.test.ts similarity index 98% rename from packages/turbo-ignore/__tests__/getComparison.test.ts rename to packages/turbo-ignore/__tests__/get-comparison.test.ts index 4972a341dc914..7db2db53c5bb5 100644 --- a/packages/turbo-ignore/__tests__/getComparison.test.ts +++ b/packages/turbo-ignore/__tests__/get-comparison.test.ts @@ -2,11 +2,12 @@ import child_process from "node:child_process"; import { spyConsole, mockEnv, validateLogs } from "@turbo/test-utils"; import { describe, it, expect, jest } from "@jest/globals"; -import { getComparison } from "../src/getComparison"; +import { getComparison } from "../src/get-comparison"; describe("getComparison()", () => { mockEnv(); const mockConsole = spyConsole(); + it("uses headRelative comparison when not running Vercel CI", () => { expect(getComparison({ workspace: "test-workspace" })) .toMatchInlineSnapshot(` @@ -15,7 +16,7 @@ describe("getComparison()", () => { "type": "headRelative", } `); - expect(mockConsole.log).toHaveBeenCalledTimes(0); + expect(mockConsole.log).not.toHaveBeenCalled(); }); it("uses fallback comparison if provided when not running Vercel CI", () => { diff --git a/packages/turbo-ignore/__tests__/getTask.test.ts b/packages/turbo-ignore/__tests__/get-task.test.ts similarity index 94% rename from packages/turbo-ignore/__tests__/getTask.test.ts rename to packages/turbo-ignore/__tests__/get-task.test.ts index 32e30f58d971e..cbc79a135e851 100644 --- a/packages/turbo-ignore/__tests__/getTask.test.ts +++ b/packages/turbo-ignore/__tests__/get-task.test.ts @@ -1,9 +1,10 @@ import { spyConsole } from "@turbo/test-utils"; import { describe, it, expect } from "@jest/globals"; -import { getTask } from "../src/getTask"; +import { getTask } from "../src/get-task"; describe("getWorkspace()", () => { const mockConsole = spyConsole(); + it("getTask defaults to build", () => { expect(getTask({})).toEqual("build"); expect(mockConsole.log).toHaveBeenNthCalledWith( diff --git a/packages/turbo-ignore/__tests__/getTurboVersion.test.ts b/packages/turbo-ignore/__tests__/get-turbo-version.test.ts similarity index 97% rename from packages/turbo-ignore/__tests__/getTurboVersion.test.ts rename to packages/turbo-ignore/__tests__/get-turbo-version.test.ts index 1bddb3215aba0..29a135e1777a1 100644 --- a/packages/turbo-ignore/__tests__/getTurboVersion.test.ts +++ b/packages/turbo-ignore/__tests__/get-turbo-version.test.ts @@ -1,9 +1,10 @@ import { spyConsole } from "@turbo/test-utils"; import { describe, it, expect } from "@jest/globals"; -import { getTurboVersion } from "../src/getTurboVersion"; +import { getTurboVersion } from "../src/get-turbo-version"; describe("getWorkspace()", () => { const mockConsole = spyConsole(); + it("getTurboVersion returns turboVersion from arg", () => { expect( getTurboVersion( diff --git a/packages/turbo-ignore/__tests__/getWorkspace.test.ts b/packages/turbo-ignore/__tests__/get-workspace.test.ts similarity index 97% rename from packages/turbo-ignore/__tests__/getWorkspace.test.ts rename to packages/turbo-ignore/__tests__/get-workspace.test.ts index 76bc4e739c5e7..c3d4fd10c555f 100644 --- a/packages/turbo-ignore/__tests__/getWorkspace.test.ts +++ b/packages/turbo-ignore/__tests__/get-workspace.test.ts @@ -1,9 +1,10 @@ import { spyConsole } from "@turbo/test-utils"; import { describe, it, expect } from "@jest/globals"; -import { getWorkspace } from "../src/getWorkspace"; +import { getWorkspace } from "../src/get-workspace"; describe("getWorkspace()", () => { const mockConsole = spyConsole(); + it("getWorkspace returns workspace from arg", () => { expect( getWorkspace({ diff --git a/packages/turbo-ignore/package.json b/packages/turbo-ignore/package.json index b47e9019b69f8..65080b5b03d9e 100644 --- a/packages/turbo-ignore/package.json +++ b/packages/turbo-ignore/package.json @@ -2,22 +2,22 @@ "name": "turbo-ignore", "version": "2.8.11-canary.22", "description": "", - "homepage": "https://turborepo.dev", "keywords": [], - "author": "Jared Palmer", + "homepage": "https://turborepo.dev", + "bugs": { + "url": "https://github.com/vercel/turborepo/issues" + }, "license": "MIT", + "author": "Jared Palmer", "repository": { "type": "git", "url": "https://github.com/vercel/turborepo", "directory": "packages/turbo-ignore" }, - "bugs": { - "url": "https://github.com/vercel/turborepo/issues" - }, + "bin": "dist/cli.js", "files": [ "dist" ], - "bin": "dist/cli.js", "scripts": { "build": "tsdown", "test": "jest", diff --git a/packages/turbo-ignore/src/checkCommit.ts b/packages/turbo-ignore/src/check-commit.ts similarity index 98% rename from packages/turbo-ignore/src/checkCommit.ts rename to packages/turbo-ignore/src/check-commit.ts index 4a8843e614b97..6f1f203ecf6e2 100644 --- a/packages/turbo-ignore/src/checkCommit.ts +++ b/packages/turbo-ignore/src/check-commit.ts @@ -46,7 +46,7 @@ export function checkCommit({ workspace }: { workspace: string }): { const onlyWorkspaceDeployMatch = onlyWorkspaceRegex.exec(commitMessage)?.[0]; if (onlyWorkspaceDeployMatch) { if ( - onlyWorkspaceCommits({ workspace }).find( + onlyWorkspaceCommits({ workspace }).some( (commit) => commit === onlyWorkspaceDeployMatch ) ) { diff --git a/packages/turbo-ignore/src/cli.ts b/packages/turbo-ignore/src/cli.ts index 840659854678b..cdf9e36723b73 100755 --- a/packages/turbo-ignore/src/cli.ts +++ b/packages/turbo-ignore/src/cli.ts @@ -64,7 +64,7 @@ turboIgnoreCli new Option( "-b, --max-buffer ", "maxBuffer for the child process in KB (default: 1024 KB)" - ).argParser((val) => parseInt(val, 10) * 1024) + ).argParser((val) => Number.parseInt(val, 10) * 1024) ) .version(cliPkg.version, "-v, --version", "Output the current version") .helpOption("-h, --help", "Display help for command") diff --git a/packages/turbo-ignore/src/getComparison.ts b/packages/turbo-ignore/src/get-comparison.ts similarity index 100% rename from packages/turbo-ignore/src/getComparison.ts rename to packages/turbo-ignore/src/get-comparison.ts diff --git a/packages/turbo-ignore/src/getTask.ts b/packages/turbo-ignore/src/get-task.ts similarity index 100% rename from packages/turbo-ignore/src/getTask.ts rename to packages/turbo-ignore/src/get-task.ts diff --git a/packages/turbo-ignore/src/getTurboVersion.ts b/packages/turbo-ignore/src/get-turbo-version.ts similarity index 100% rename from packages/turbo-ignore/src/getTurboVersion.ts rename to packages/turbo-ignore/src/get-turbo-version.ts diff --git a/packages/turbo-ignore/src/getWorkspace.ts b/packages/turbo-ignore/src/get-workspace.ts similarity index 100% rename from packages/turbo-ignore/src/getWorkspace.ts rename to packages/turbo-ignore/src/get-workspace.ts diff --git a/packages/turbo-ignore/src/ignore.ts b/packages/turbo-ignore/src/ignore.ts index 5a5ec5e5c1275..cf411d04547ff 100644 --- a/packages/turbo-ignore/src/ignore.ts +++ b/packages/turbo-ignore/src/ignore.ts @@ -3,14 +3,14 @@ import path from "node:path"; import { existsSync } from "node:fs"; import { getTurboRoot } from "@turbo/utils"; import type { DryRun } from "@turbo/types"; -import { getComparison } from "./getComparison"; -import { getTask } from "./getTask"; -import { getWorkspace } from "./getWorkspace"; -import { getTurboVersion } from "./getTurboVersion"; +import { getComparison } from "./get-comparison"; +import { getTask } from "./get-task"; +import { getWorkspace } from "./get-workspace"; +import { getTurboVersion } from "./get-turbo-version"; import { log, info, warn, error } from "./logger"; import { shouldWarn } from "./errors"; import type { TurboIgnoreArg, TurboIgnoreOptions } from "./types"; -import { checkCommit } from "./checkCommit"; +import { checkCommit } from "./check-commit"; function trackOptions(opts: TurboIgnoreOptions) { opts.telemetry?.trackOptionTask(opts.task); diff --git a/packages/turbo-ignore/tsconfig.json b/packages/turbo-ignore/tsconfig.json index 65e03f1b24f63..5f5b85755f719 100644 --- a/packages/turbo-ignore/tsconfig.json +++ b/packages/turbo-ignore/tsconfig.json @@ -2,6 +2,7 @@ "extends": "@turbo/tsconfig/library.json", "compilerOptions": { "rootDir": ".", - "lib": ["ES2022", "DOM"] + "lib": ["ES2022", "DOM"], + "strictNullChecks": true } } diff --git a/packages/turbo-releaser/package.json b/packages/turbo-releaser/package.json index 47c6fdf8cea92..a918426f23369 100644 --- a/packages/turbo-releaser/package.json +++ b/packages/turbo-releaser/package.json @@ -1,7 +1,7 @@ { "name": "@turbo/releaser", - "private": true, "version": "0.0.1", + "private": true, "bin": { "turboreleaser": "cli/index.cjs" }, @@ -22,8 +22,8 @@ "devDependencies": { "@turbo/tsconfig": "workspace:*", "@types/node": "20.11.30", - "typescript": "5.5.4", "tsdown": "0.9.3", - "tsx": "4.21.0" + "tsx": "4.21.0", + "typescript": "5.5.4" } } diff --git a/packages/turbo-releaser/tsconfig.json b/packages/turbo-releaser/tsconfig.json index e6f9fc6aa70b6..6b519b8220957 100644 --- a/packages/turbo-releaser/tsconfig.json +++ b/packages/turbo-releaser/tsconfig.json @@ -3,6 +3,7 @@ "compilerOptions": { "rootDir": ".", "module": "ESNext", - "lib": ["ESNext"] + "lib": ["ESNext"], + "strictNullChecks": true } } diff --git a/packages/turbo-repository/js/package.json b/packages/turbo-repository/js/package.json index f7d71c8cc146e..c1496d369c565 100644 --- a/packages/turbo-repository/js/package.json +++ b/packages/turbo-repository/js/package.json @@ -2,26 +2,26 @@ "name": "@turbo/repository", "version": "0.0.1-canary.17", "description": "", - "bugs": "https://github.com/vercel/turborepo/issues", "homepage": "https://turborepo.dev", + "bugs": "https://github.com/vercel/turborepo/issues", "license": "MIT", - "main": "dist/index.js", - "scripts": { - "build": "mkdir -p dist && cp index.js dist/index.js && cp index.d.ts dist/index.d.ts" - }, "files": [ "dist/index.js", "dist/index.d.ts" ], + "main": "dist/index.js", "types": "dist/index.d.ts", + "scripts": { + "build": "mkdir -p dist && cp index.js dist/index.js && cp index.d.ts dist/index.d.ts" + }, "optionalDependencies": { - "@turbo/repository-darwin-x64": "0.0.1-canary.17", "@turbo/repository-darwin-arm64": "0.0.1-canary.17", - "@turbo/repository-linux-x64-gnu": "0.0.1-canary.17", + "@turbo/repository-darwin-x64": "0.0.1-canary.17", "@turbo/repository-linux-arm64-gnu": "0.0.1-canary.17", - "@turbo/repository-linux-x64-musl": "0.0.1-canary.17", "@turbo/repository-linux-arm64-musl": "0.0.1-canary.17", - "@turbo/repository-win32-x64-msvc": "0.0.1-canary.17", - "@turbo/repository-win32-arm64-msvc": "0.0.1-canary.17" + "@turbo/repository-linux-x64-gnu": "0.0.1-canary.17", + "@turbo/repository-linux-x64-musl": "0.0.1-canary.17", + "@turbo/repository-win32-arm64-msvc": "0.0.1-canary.17", + "@turbo/repository-win32-x64-msvc": "0.0.1-canary.17" } } diff --git a/packages/turbo-repository/npm/darwin-arm64/package.json b/packages/turbo-repository/npm/darwin-arm64/package.json index f9d96bd0115e8..e01c36ea685c1 100644 --- a/packages/turbo-repository/npm/darwin-arm64/package.json +++ b/packages/turbo-repository/npm/darwin-arm64/package.json @@ -1,11 +1,15 @@ { "name": "@turbo/repository-darwin-arm64", "version": "0.0.1-canary.17", + "license": "MIT", "repository": { "type": "git", "url": "https://github.com/vercel/turborepo", "directory": "packages/turbo-repository/npm/darwin-arm64" }, + "files": [ + "repository.darwin-arm64.node" + ], "os": [ "darwin" ], @@ -13,10 +17,6 @@ "arm64" ], "main": "repository.darwin-arm64.node", - "files": [ - "repository.darwin-arm64.node" - ], - "license": "MIT", "engines": { "node": ">= 10" } diff --git a/packages/turbo-repository/npm/darwin-x64/package.json b/packages/turbo-repository/npm/darwin-x64/package.json index e93367d9f7884..c57c78f0e05cd 100644 --- a/packages/turbo-repository/npm/darwin-x64/package.json +++ b/packages/turbo-repository/npm/darwin-x64/package.json @@ -1,11 +1,15 @@ { "name": "@turbo/repository-darwin-x64", "version": "0.0.1-canary.17", + "license": "MIT", "repository": { "type": "git", "url": "https://github.com/vercel/turborepo", "directory": "packages/turbo-repository/npm/darwin-x64" }, + "files": [ + "repository.darwin-x64.node" + ], "os": [ "darwin" ], @@ -13,10 +17,6 @@ "x64" ], "main": "repository.darwin-x64.node", - "files": [ - "repository.darwin-x64.node" - ], - "license": "MIT", "engines": { "node": ">= 10" } diff --git a/packages/turbo-repository/npm/linux-arm64-gnu/package.json b/packages/turbo-repository/npm/linux-arm64-gnu/package.json index 4694c6061aa1b..9f51cb59b217b 100644 --- a/packages/turbo-repository/npm/linux-arm64-gnu/package.json +++ b/packages/turbo-repository/npm/linux-arm64-gnu/package.json @@ -1,11 +1,15 @@ { "name": "@turbo/repository-linux-arm64-gnu", "version": "0.0.1-canary.17", + "license": "MIT", "repository": { "type": "git", "url": "https://github.com/vercel/turborepo", "directory": "packages/turbo-repository/npm/linux-arm64-gnu" }, + "files": [ + "repository.linux-arm64-gnu.node" + ], "os": [ "linux" ], @@ -16,10 +20,6 @@ "glibc" ], "main": "repository.linux-arm64-gnu.node", - "files": [ - "repository.linux-arm64-gnu.node" - ], - "license": "MIT", "engines": { "node": ">= 10" } diff --git a/packages/turbo-repository/npm/linux-arm64-musl/package.json b/packages/turbo-repository/npm/linux-arm64-musl/package.json index 99368b21d7eeb..d1f4d35c269dd 100644 --- a/packages/turbo-repository/npm/linux-arm64-musl/package.json +++ b/packages/turbo-repository/npm/linux-arm64-musl/package.json @@ -1,11 +1,15 @@ { "name": "@turbo/repository-linux-arm64-musl", "version": "0.0.1-canary.17", + "license": "MIT", "repository": { "type": "git", "url": "https://github.com/vercel/turborepo", "directory": "packages/turbo-repository/npm/linux-arm64-musl" }, + "files": [ + "repository.linux-arm64-musl.node" + ], "os": [ "linux" ], @@ -16,10 +20,6 @@ "musl" ], "main": "repository.linux-arm64-musl.node", - "files": [ - "repository.linux-arm64-musl.node" - ], - "license": "MIT", "engines": { "node": ">= 10" } diff --git a/packages/turbo-repository/npm/linux-x64-gnu/package.json b/packages/turbo-repository/npm/linux-x64-gnu/package.json index 8ff5ef5352333..f33ea1850ec51 100644 --- a/packages/turbo-repository/npm/linux-x64-gnu/package.json +++ b/packages/turbo-repository/npm/linux-x64-gnu/package.json @@ -1,11 +1,15 @@ { "name": "@turbo/repository-linux-x64-gnu", "version": "0.0.1-canary.17", + "license": "MIT", "repository": { "type": "git", "url": "https://github.com/vercel/turborepo", "directory": "packages/turbo-repository/npm/linux-x64-gnu" }, + "files": [ + "repository.linux-x64-gnu.node" + ], "os": [ "linux" ], @@ -16,10 +20,6 @@ "glibc" ], "main": "repository.linux-x64-gnu.node", - "files": [ - "repository.linux-x64-gnu.node" - ], - "license": "MIT", "engines": { "node": ">= 10" } diff --git a/packages/turbo-repository/npm/linux-x64-musl/package.json b/packages/turbo-repository/npm/linux-x64-musl/package.json index 1cfb85d86fd9c..3ad0ef3ab240e 100644 --- a/packages/turbo-repository/npm/linux-x64-musl/package.json +++ b/packages/turbo-repository/npm/linux-x64-musl/package.json @@ -1,11 +1,15 @@ { "name": "@turbo/repository-linux-x64-musl", "version": "0.0.1-canary.17", + "license": "MIT", "repository": { "type": "git", "url": "https://github.com/vercel/turborepo", "directory": "packages/turbo-repository/npm/linux-x64-musl" }, + "files": [ + "repository.linux-x64-musl.node" + ], "os": [ "linux" ], @@ -16,10 +20,6 @@ "musl" ], "main": "repository.linux-x64-musl.node", - "files": [ - "repository.linux-x64-musl.node" - ], - "license": "MIT", "engines": { "node": ">= 10" } diff --git a/packages/turbo-repository/npm/win32-arm64-msvc/package.json b/packages/turbo-repository/npm/win32-arm64-msvc/package.json index c957d057db4e8..9c5c4f683b165 100644 --- a/packages/turbo-repository/npm/win32-arm64-msvc/package.json +++ b/packages/turbo-repository/npm/win32-arm64-msvc/package.json @@ -1,11 +1,15 @@ { "name": "@turbo/repository-win32-arm64-msvc", "version": "0.0.1-canary.17", + "license": "MIT", "repository": { "type": "git", "url": "https://github.com/vercel/turborepo", "directory": "packages/turbo-repository/npm/win32-x64-msvc" }, + "files": [ + "repository.win32-arm64-msvc.node" + ], "os": [ "win32" ], @@ -13,10 +17,6 @@ "arm64" ], "main": "repository.win32-arm64-msvc.node", - "files": [ - "repository.win32-arm64-msvc.node" - ], - "license": "MIT", "engines": { "node": ">= 10" } diff --git a/packages/turbo-repository/npm/win32-x64-msvc/package.json b/packages/turbo-repository/npm/win32-x64-msvc/package.json index bbaafb701cfef..ae2c0dceeb9be 100644 --- a/packages/turbo-repository/npm/win32-x64-msvc/package.json +++ b/packages/turbo-repository/npm/win32-x64-msvc/package.json @@ -1,11 +1,15 @@ { "name": "@turbo/repository-win32-x64-msvc", "version": "0.0.1-canary.17", + "license": "MIT", "repository": { "type": "git", "url": "https://github.com/vercel/turborepo", "directory": "packages/turbo-repository/npm/win32-x64-msvc" }, + "files": [ + "repository.win32-x64-msvc.node" + ], "os": [ "win32" ], @@ -13,10 +17,6 @@ "x64" ], "main": "repository.win32-x64-msvc.node", - "files": [ - "repository.win32-x64-msvc.node" - ], - "license": "MIT", "engines": { "node": ">= 10" } diff --git a/packages/turbo-repository/package.json b/packages/turbo-repository/package.json index 31094c0316d81..8a044f643ad31 100644 --- a/packages/turbo-repository/package.json +++ b/packages/turbo-repository/package.json @@ -2,17 +2,18 @@ "name": "turborepo-repository", "version": "0.0.1", "description": "", - "bugs": "https://github.com/vercel/turborepo/issues", + "keywords": [], "homepage": "https://turborepo.dev", + "bugs": "https://github.com/vercel/turborepo/issues", + "license": "MIT", + "author": "", + "main": "dist/index.js", "scripts": { "build": "bash scripts/build.sh --dts ../js/index.d.ts", "build:release": "bash scripts/build.sh --release", "package": "node scripts/publish.mjs", "test": "node --import tsx --test __tests__/*.test.ts" }, - "keywords": [], - "author": "", - "license": "MIT", "devDependencies": { "@napi-rs/cli": "2.16.3", "execa": "8.0.1", @@ -20,7 +21,6 @@ "prettier": "3.3.3", "tsx": "4.21.0" }, - "main": "dist/index.js", "napi": { "name": "@turbo/repository", "triples": { diff --git a/packages/turbo-telemetry/README.md b/packages/turbo-telemetry/README.md index 94386b6750ec4..171cc645ec2a3 100644 --- a/packages/turbo-telemetry/README.md +++ b/packages/turbo-telemetry/README.md @@ -23,7 +23,7 @@ import pkgJson from "../package.json"; const { telemetry } = await initTelemetry({ name: pkgJson.name, - version: pkgJson.version, + version: pkgJson.version }); ``` diff --git a/packages/turbo-telemetry/package.json b/packages/turbo-telemetry/package.json index 28b25ef6690d1..e4aab3c65d5f6 100644 --- a/packages/turbo-telemetry/package.json +++ b/packages/turbo-telemetry/package.json @@ -3,20 +3,20 @@ "version": "0.0.0", "private": true, "description": "", - "homepage": "https://turborepo.dev", "keywords": [], - "author": "Vercel", + "homepage": "https://turborepo.dev", + "bugs": { + "url": "https://github.com/vercel/turborepo/issues" + }, "license": "MIT", + "author": "Vercel", "repository": { "type": "git", "url": "https://github.com/vercel/turborepo", "directory": "packages/turbo-telemetry" }, - "bugs": { - "url": "https://github.com/vercel/turborepo/issues" - }, - "module": "src/index.ts", "main": "src/index.ts", + "module": "src/index.ts", "types": "src/index.ts", "scripts": { "test": "node --import tsx --test src/*.test.ts", diff --git a/packages/turbo-telemetry/tsconfig.json b/packages/turbo-telemetry/tsconfig.json index 65e03f1b24f63..5f5b85755f719 100644 --- a/packages/turbo-telemetry/tsconfig.json +++ b/packages/turbo-telemetry/tsconfig.json @@ -2,6 +2,7 @@ "extends": "@turbo/tsconfig/library.json", "compilerOptions": { "rootDir": ".", - "lib": ["ES2022", "DOM"] + "lib": ["ES2022", "DOM"], + "strictNullChecks": true } } diff --git a/packages/turbo-test-utils/package.json b/packages/turbo-test-utils/package.json index 46d221f18464a..8266a60526985 100644 --- a/packages/turbo-test-utils/package.json +++ b/packages/turbo-test-utils/package.json @@ -3,23 +3,28 @@ "version": "0.0.0", "private": true, "description": "", - "homepage": "https://turborepo.dev", "keywords": [], - "author": "Vercel", - "main": "src/index.ts", + "homepage": "https://turborepo.dev", + "bugs": { + "url": "https://github.com/vercel/turborepo/issues" + }, "license": "MIT", + "author": "Vercel", "repository": { "type": "git", "url": "https://github.com/vercel/turborepo", "directory": "packages/turbo-test-utils" }, - "bugs": { - "url": "https://github.com/vercel/turborepo/issues" - }, + "main": "src/index.ts", "scripts": { "check-types": "tsc --noEmit", "lint:prettier": "prettier -c . --cache --ignore-path=../../.prettier-ignore" }, + "dependencies": { + "fs-extra": "11.1.1", + "js-yaml": "4.1.1", + "json5": "2.2.3" + }, "devDependencies": { "@jest/globals": "30.2.0", "@turbo/tsconfig": "workspace:*", @@ -30,10 +35,5 @@ "jest-mock": "30.2.0", "ts-jest": "29.4.6", "typescript": "5.5.4" - }, - "dependencies": { - "fs-extra": "11.1.1", - "js-yaml": "4.1.1", - "json5": "2.2.3" } } diff --git a/packages/turbo-test-utils/src/index.ts b/packages/turbo-test-utils/src/index.ts index 9551af450b2c7..40ac64644d4f2 100644 --- a/packages/turbo-test-utils/src/index.ts +++ b/packages/turbo-test-utils/src/index.ts @@ -1,9 +1,9 @@ -export { setupTestFixtures } from "./useFixtures"; -export { validateLogs } from "./validateLogs"; -export { mockEnv } from "./mockEnv"; +export { setupTestFixtures } from "./use-fixtures"; +export { validateLogs } from "./validate-logs"; +export { mockEnv } from "./mock-env"; -export { spyExit } from "./spyExit"; -export type { SpyExit } from "./spyExit"; +export { spyExit } from "./spy-exit"; +export type { SpyExit } from "./spy-exit"; -export { spyConsole } from "./spyConsole"; -export type { SpyConsole } from "./spyConsole"; +export { spyConsole } from "./spy-console"; +export type { SpyConsole } from "./spy-console"; diff --git a/packages/turbo-test-utils/src/mockEnv.ts b/packages/turbo-test-utils/src/mock-env.ts similarity index 100% rename from packages/turbo-test-utils/src/mockEnv.ts rename to packages/turbo-test-utils/src/mock-env.ts diff --git a/packages/turbo-test-utils/src/spyConsole.ts b/packages/turbo-test-utils/src/spy-console.ts similarity index 100% rename from packages/turbo-test-utils/src/spyConsole.ts rename to packages/turbo-test-utils/src/spy-console.ts diff --git a/packages/turbo-test-utils/src/spyExit.ts b/packages/turbo-test-utils/src/spy-exit.ts similarity index 81% rename from packages/turbo-test-utils/src/spyExit.ts rename to packages/turbo-test-utils/src/spy-exit.ts index 59b4429fca725..bbdadd3c29c94 100644 --- a/packages/turbo-test-utils/src/spyExit.ts +++ b/packages/turbo-test-utils/src/spy-exit.ts @@ -11,9 +11,7 @@ export function spyExit() { }; beforeEach(() => { - spy.exit = jest - .spyOn(process, "exit") - .mockImplementation(() => undefined as never); + spy.exit = jest.spyOn(process, "exit").mockReturnValue(undefined as never); }); afterEach(() => { diff --git a/packages/turbo-test-utils/src/useFixtures.ts b/packages/turbo-test-utils/src/use-fixtures.ts similarity index 100% rename from packages/turbo-test-utils/src/useFixtures.ts rename to packages/turbo-test-utils/src/use-fixtures.ts diff --git a/packages/turbo-test-utils/src/validateLogs.ts b/packages/turbo-test-utils/src/validate-logs.ts similarity index 73% rename from packages/turbo-test-utils/src/validateLogs.ts rename to packages/turbo-test-utils/src/validate-logs.ts index 8e11015fa7568..b9a767d0bde09 100644 --- a/packages/turbo-test-utils/src/validateLogs.ts +++ b/packages/turbo-test-utils/src/validate-logs.ts @@ -1,5 +1,5 @@ import { expect } from "@jest/globals"; -import type { SpyConsole } from "./spyConsole"; +import type { SpyConsole } from "./spy-console"; type Matcher = ReturnType; @@ -7,7 +7,7 @@ export function validateLogs( spy: SpyConsole[keyof SpyConsole], args: Array> ) { - args.forEach((arg, idx) => { + for (const [idx, arg] of args.entries()) { expect(spy).toHaveBeenNthCalledWith(idx + 1, ...arg); - }); + } } diff --git a/packages/turbo-test-utils/tsconfig.json b/packages/turbo-test-utils/tsconfig.json index 0620a3c25ef39..5e258541b1950 100644 --- a/packages/turbo-test-utils/tsconfig.json +++ b/packages/turbo-test-utils/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "@turbo/tsconfig/library.json", "compilerOptions": { - "rootDir": "." + "rootDir": ".", + "strictNullChecks": true } } diff --git a/packages/turbo-types/package.json b/packages/turbo-types/package.json index a4882c78c707a..d3bf6d9f08187 100644 --- a/packages/turbo-types/package.json +++ b/packages/turbo-types/package.json @@ -2,19 +2,26 @@ "name": "@turbo/types", "version": "2.8.11-canary.22", "description": "Turborepo types", - "type": "commonjs", "homepage": "https://turborepo.dev", + "bugs": { + "url": "https://github.com/vercel/turborepo/issues" + }, "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/vercel/turborepo.git", "directory": "packages/turbo-types" }, - "bugs": { - "url": "https://github.com/vercel/turborepo/issues" - }, + "files": [ + "src", + "schemas" + ], + "type": "commonjs", "main": "src/index.ts", "types": "src/index.ts", + "publishConfig": { + "access": "public" + }, "scripts": { "build": "tsc", "lint:prettier": "prettier -c . --cache", @@ -30,12 +37,5 @@ "@types/node": "20.11.30", "ts-json-schema-generator": "2.5.0", "tsx": "4.21.0" - }, - "files": [ - "src", - "schemas" - ], - "publishConfig": { - "access": "public" } } diff --git a/packages/turbo-types/tsconfig.json b/packages/turbo-types/tsconfig.json index e6f9fc6aa70b6..6b519b8220957 100644 --- a/packages/turbo-types/tsconfig.json +++ b/packages/turbo-types/tsconfig.json @@ -3,6 +3,7 @@ "compilerOptions": { "rootDir": ".", "module": "ESNext", - "lib": ["ESNext"] + "lib": ["ESNext"], + "strictNullChecks": true } } diff --git a/packages/turbo-utils/__tests__/convertCase.test.ts b/packages/turbo-utils/__tests__/convert-case.test.ts similarity index 90% rename from packages/turbo-utils/__tests__/convertCase.test.ts rename to packages/turbo-utils/__tests__/convert-case.test.ts index 2a859bb5f46ce..429907e9baa4c 100644 --- a/packages/turbo-utils/__tests__/convertCase.test.ts +++ b/packages/turbo-utils/__tests__/convert-case.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect } from "@jest/globals"; -import { convertCase, type CaseOptions } from "../src/convertCase"; +import { convertCase, type CaseOptions } from "../src/convert-case"; interface TestCase { input: string; diff --git a/packages/turbo-utils/__tests__/getTurboConfigs.test.ts b/packages/turbo-utils/__tests__/get-turbo-configs.test.ts similarity index 97% rename from packages/turbo-utils/__tests__/getTurboConfigs.test.ts rename to packages/turbo-utils/__tests__/get-turbo-configs.test.ts index b2e9e2d175226..0fc10f81b8287 100644 --- a/packages/turbo-utils/__tests__/getTurboConfigs.test.ts +++ b/packages/turbo-utils/__tests__/get-turbo-configs.test.ts @@ -2,8 +2,8 @@ import path from "node:path"; import { setupTestFixtures } from "@turbo/test-utils"; import { describe, it, expect } from "@jest/globals"; import JSON5 from "json5"; -import type { TurboConfigs } from "../src/getTurboConfigs"; -import { getTurboConfigs } from "../src/getTurboConfigs"; +import type { TurboConfigs } from "../src/get-turbo-configs"; +import { getTurboConfigs } from "../src/get-turbo-configs"; describe("getTurboConfigs", () => { const { useFixture } = setupTestFixtures({ diff --git a/packages/turbo-utils/__tests__/getTurboRoot.test.ts b/packages/turbo-utils/__tests__/get-turbo-root.test.ts similarity index 94% rename from packages/turbo-utils/__tests__/getTurboRoot.test.ts rename to packages/turbo-utils/__tests__/get-turbo-root.test.ts index 44d05e7ba5a44..e370a48067f27 100644 --- a/packages/turbo-utils/__tests__/getTurboRoot.test.ts +++ b/packages/turbo-utils/__tests__/get-turbo-root.test.ts @@ -1,7 +1,7 @@ import path from "node:path"; import { setupTestFixtures } from "@turbo/test-utils"; import { describe, it, expect } from "@jest/globals"; -import { getTurboRoot } from "../src/getTurboRoot"; +import { getTurboRoot } from "../src/get-turbo-root"; describe("getTurboConfigs", () => { const { useFixture } = setupTestFixtures({ diff --git a/packages/turbo-utils/__tests__/isFolderEmpty.test.ts b/packages/turbo-utils/__tests__/is-folder-empty.test.ts similarity index 96% rename from packages/turbo-utils/__tests__/isFolderEmpty.test.ts rename to packages/turbo-utils/__tests__/is-folder-empty.test.ts index 0317fb02f5053..028d2ec895529 100644 --- a/packages/turbo-utils/__tests__/isFolderEmpty.test.ts +++ b/packages/turbo-utils/__tests__/is-folder-empty.test.ts @@ -2,7 +2,7 @@ import path from "node:path"; import fs from "fs-extra"; import { setupTestFixtures } from "@turbo/test-utils"; import { describe, it, expect } from "@jest/globals"; -import { isFolderEmpty } from "../src/isFolderEmpty"; +import { isFolderEmpty } from "../src/is-folder-empty"; describe("isFolderEmpty", () => { const { useFixture } = setupTestFixtures({ diff --git a/packages/turbo-utils/__tests__/isWritable.test.ts b/packages/turbo-utils/__tests__/is-writable.test.ts similarity index 95% rename from packages/turbo-utils/__tests__/isWritable.test.ts rename to packages/turbo-utils/__tests__/is-writable.test.ts index ea7a9050f6b11..55e990ec6d959 100644 --- a/packages/turbo-utils/__tests__/isWritable.test.ts +++ b/packages/turbo-utils/__tests__/is-writable.test.ts @@ -2,7 +2,7 @@ import path from "node:path"; import fs from "fs-extra"; import { setupTestFixtures } from "@turbo/test-utils"; import { describe, it, expect, jest } from "@jest/globals"; -import { isWriteable } from "../src/isWriteable"; +import { isWriteable } from "../src/is-writeable"; describe("isWriteable", () => { const { useFixture } = setupTestFixtures({ diff --git a/packages/turbo-utils/__tests__/managers.test.ts b/packages/turbo-utils/__tests__/managers.test.ts index d9838ebc9c547..dc31ea4992e8d 100644 --- a/packages/turbo-utils/__tests__/managers.test.ts +++ b/packages/turbo-utils/__tests__/managers.test.ts @@ -10,7 +10,7 @@ import { jest.mock("execa"); jest.mock("node:os"); -const mockExeca = execa as jest.MockedFunction; +const mockExeca = jest.mocked(execa); const mockOs = os as jest.Mocked; describe("managers", () => { diff --git a/packages/turbo-utils/__tests__/searchUp.test.ts b/packages/turbo-utils/__tests__/search-up.test.ts similarity index 97% rename from packages/turbo-utils/__tests__/searchUp.test.ts rename to packages/turbo-utils/__tests__/search-up.test.ts index cd72959fdaaa7..a20d98b1ce48e 100644 --- a/packages/turbo-utils/__tests__/searchUp.test.ts +++ b/packages/turbo-utils/__tests__/search-up.test.ts @@ -1,7 +1,7 @@ import fs from "node:fs"; import path from "node:path"; import { describe, test, expect, beforeEach, jest } from "@jest/globals"; -import { searchUp } from "../src/searchUp"; +import { searchUp } from "../src/search-up"; // Mock fs module jest.mock("node:fs"); diff --git a/packages/turbo-utils/__tests__/validateDirectory.test.ts b/packages/turbo-utils/__tests__/validate-directory.test.ts similarity index 93% rename from packages/turbo-utils/__tests__/validateDirectory.test.ts rename to packages/turbo-utils/__tests__/validate-directory.test.ts index 1dfce411290ff..106fc281ea567 100644 --- a/packages/turbo-utils/__tests__/validateDirectory.test.ts +++ b/packages/turbo-utils/__tests__/validate-directory.test.ts @@ -1,17 +1,15 @@ import { describe, test, expect, beforeEach, jest } from "@jest/globals"; import path from "node:path"; import fs from "fs-extra"; -import { validateDirectory } from "../src/validateDirectory"; -import { isFolderEmpty } from "../src/isFolderEmpty"; +import { validateDirectory } from "../src/validate-directory"; +import { isFolderEmpty } from "../src/is-folder-empty"; // Mock dependencies jest.mock("fs-extra"); -jest.mock("../src/isFolderEmpty"); +jest.mock("../src/is-folder-empty"); const mockFs = fs as jest.Mocked; -const mockIsFolderEmpty = isFolderEmpty as jest.MockedFunction< - typeof isFolderEmpty ->; +const mockIsFolderEmpty = jest.mocked(isFolderEmpty); describe("validateDirectory", () => { beforeEach(() => { diff --git a/packages/turbo-utils/package.json b/packages/turbo-utils/package.json index d45b8b1f69b8b..c28324008615c 100644 --- a/packages/turbo-utils/package.json +++ b/packages/turbo-utils/package.json @@ -2,31 +2,34 @@ "name": "@turbo/utils", "version": "0.0.0", "private": true, - "type": "commonjs", "description": "", - "homepage": "https://turborepo.dev", "keywords": [], - "author": "Vercel", + "homepage": "https://turborepo.dev", + "bugs": { + "url": "https://github.com/vercel/turborepo/issues" + }, "license": "MIT", - "files": [ - "src" - ], + "author": "Vercel", "repository": { "type": "git", "url": "git+https://github.com/vercel/turborepo.git", "directory": "packages/turbo-utils" }, - "bugs": { - "url": "https://github.com/vercel/turborepo/issues" - }, - "module": "src/index.ts", + "files": [ + "src" + ], + "type": "commonjs", "main": "src/index.ts", + "module": "src/index.ts", "types": "src/index.ts", "scripts": { "test": "jest", "check-types": "tsc --noEmit", "lint:prettier": "prettier -c . --cache --ignore-path=../../.prettierignore" }, + "dependencies": { + "undici": "^6.21.0" + }, "devDependencies": { "@arethetypeswrong/cli": "0.18.2", "@jest/globals": "30.2.0", @@ -53,8 +56,5 @@ "ts-jest": "29.4.6", "typescript": "5.5.4", "update-check": "1.5.4" - }, - "dependencies": { - "undici": "^6.21.0" } } diff --git a/packages/turbo-utils/src/convertCase.ts b/packages/turbo-utils/src/convert-case.ts similarity index 88% rename from packages/turbo-utils/src/convertCase.ts rename to packages/turbo-utils/src/convert-case.ts index bdefd426b7fc7..39c174935e79d 100644 --- a/packages/turbo-utils/src/convertCase.ts +++ b/packages/turbo-utils/src/convert-case.ts @@ -4,11 +4,13 @@ export interface CaseOptions { export function convertCase(str: string, opts: CaseOptions = { to: "camel" }) { switch (opts.to) { - case "camel": + case "camel": { return str.replace(/(?:[-_][a-z])/g, (group) => group.toUpperCase().replace("-", "").replace("_", "") ); - default: + } + default: { throw new Error("Not implemented"); + } } } diff --git a/packages/turbo-utils/src/createProject.ts b/packages/turbo-utils/src/create-project.ts similarity index 98% rename from packages/turbo-utils/src/createProject.ts rename to packages/turbo-utils/src/create-project.ts index 1bfb2725bb3ed..693d9b52980fc 100644 --- a/packages/turbo-utils/src/createProject.ts +++ b/packages/turbo-utils/src/create-project.ts @@ -11,8 +11,8 @@ import { hasRepo, type RepoInfo } from "./examples"; -import { isWriteable } from "./isWriteable"; -import { isFolderEmpty } from "./isFolderEmpty"; +import { isWriteable } from "./is-writeable"; +import { isFolderEmpty } from "./is-folder-empty"; import type { PackageJson } from "./types"; function isErrorLike(err: unknown): err is { message: string } { diff --git a/packages/turbo-utils/src/getTurboConfigs.ts b/packages/turbo-utils/src/get-turbo-configs.ts similarity index 96% rename from packages/turbo-utils/src/getTurboConfigs.ts rename to packages/turbo-utils/src/get-turbo-configs.ts index 901eb8af56afb..61f3ce41e81ae 100644 --- a/packages/turbo-utils/src/getTurboConfigs.ts +++ b/packages/turbo-utils/src/get-turbo-configs.ts @@ -11,7 +11,7 @@ import type { PipelineV2 } from "@turbo/types"; import * as logger from "./logger"; -import { getTurboRoot, clearTurboRootCache } from "./getTurboRoot"; +import { getTurboRoot, clearTurboRootCache } from "./get-turbo-root"; import type { PackageJson, PNPMWorkspaceConfig } from "./types"; const ROOT_GLOB = "{turbo.json,turbo.jsonc}"; @@ -287,20 +287,24 @@ export function forEachTaskDef( ) => void ): void { if ("pipeline" in config) { - Object.entries(config.pipeline).forEach(f); + for (const entry of Object.entries(config.pipeline)) { + f(entry); + } } else { - Object.entries(config.tasks).forEach(f); + for (const entry of Object.entries(config.tasks)) { + f(entry); + } } } export function clearConfigCaches(): void { - Object.keys(turboConfigsCache).forEach((key) => { + for (const key of Object.keys(turboConfigsCache)) { // eslint-disable-next-line @typescript-eslint/no-dynamic-delete -- This is safe. delete turboConfigsCache[key]; - }); - Object.keys(workspaceConfigCache).forEach((key) => { + } + for (const key of Object.keys(workspaceConfigCache)) { // eslint-disable-next-line @typescript-eslint/no-dynamic-delete -- This is safe. delete workspaceConfigCache[key]; - }); + } clearTurboRootCache(); } diff --git a/packages/turbo-utils/src/getTurboRoot.ts b/packages/turbo-utils/src/get-turbo-root.ts similarity index 92% rename from packages/turbo-utils/src/getTurboRoot.ts rename to packages/turbo-utils/src/get-turbo-root.ts index 9e3c792ec1902..c5cc08e9628fa 100644 --- a/packages/turbo-utils/src/getTurboRoot.ts +++ b/packages/turbo-utils/src/get-turbo-root.ts @@ -1,7 +1,7 @@ import type { Schema } from "@turbo/types"; import { findRootSync } from "@manypkg/find-root"; import json5 from "json5"; -import { searchUp } from "./searchUp"; +import { searchUp } from "./search-up"; interface Options { cache?: boolean; @@ -15,10 +15,10 @@ function contentCheck(content: string): boolean { const configCache: Record = {}; export function clearTurboRootCache(): void { - Object.keys(configCache).forEach((key) => { + for (const key of Object.keys(configCache)) { // eslint-disable-next-line @typescript-eslint/no-dynamic-delete -- This is safe. delete configCache[key]; - }); + } } export function getTurboRoot(cwd?: string, opts?: Options): string | null { diff --git a/packages/turbo-utils/src/index.ts b/packages/turbo-utils/src/index.ts index e318bcb19ee43..ef4fdddbee795 100644 --- a/packages/turbo-utils/src/index.ts +++ b/packages/turbo-utils/src/index.ts @@ -1,18 +1,18 @@ // utils -export { getTurboRoot, clearTurboRootCache } from "./getTurboRoot"; +export { getTurboRoot, clearTurboRootCache } from "./get-turbo-root"; export { getTurboConfigs, getWorkspaceConfigs, forEachTaskDef, clearConfigCaches -} from "./getTurboConfigs"; -export { searchUp } from "./searchUp"; +} from "./get-turbo-configs"; +export { searchUp } from "./search-up"; export { getAvailablePackageManagers, getPackageManagersBinPaths } from "./managers"; -export { isFolderEmpty } from "./isFolderEmpty"; -export { validateDirectory } from "./validateDirectory"; +export { isFolderEmpty } from "./is-folder-empty"; +export { validateDirectory } from "./validate-directory"; export { isUrlOk, getRepoInfo, @@ -21,10 +21,10 @@ export { downloadAndExtractRepo, downloadAndExtractExample } from "./examples"; -export { isWriteable } from "./isWriteable"; -export { createProject, DownloadError } from "./createProject"; -export { convertCase } from "./convertCase"; -export { createNotifyUpdate } from "./notifyUpdate"; +export { isWriteable } from "./is-writeable"; +export { createProject, DownloadError } from "./create-project"; +export { convertCase } from "./convert-case"; +export { createNotifyUpdate } from "./notify-update"; export * as logger from "./logger"; @@ -34,5 +34,5 @@ export type { TurboConfig, TurboConfigs, WorkspaceConfig -} from "./getTurboConfigs"; +} from "./get-turbo-configs"; export * from "./types"; diff --git a/packages/turbo-utils/src/isFolderEmpty.ts b/packages/turbo-utils/src/is-folder-empty.ts similarity index 100% rename from packages/turbo-utils/src/isFolderEmpty.ts rename to packages/turbo-utils/src/is-folder-empty.ts diff --git a/packages/turbo-utils/src/isWriteable.ts b/packages/turbo-utils/src/is-writeable.ts similarity index 100% rename from packages/turbo-utils/src/isWriteable.ts rename to packages/turbo-utils/src/is-writeable.ts diff --git a/packages/turbo-utils/src/logger.ts b/packages/turbo-utils/src/logger.ts index 00af8555254d7..df60894c3e1d4 100644 --- a/packages/turbo-utils/src/logger.ts +++ b/packages/turbo-utils/src/logger.ts @@ -14,7 +14,7 @@ const YELLOW = "#FFFF00"; const hex = (color: string): ((text: string) => string) => { const ansiColor = hexToAnsi256(color); - return (text: string) => `\x1b[38;5;${ansiColor}m${text}${reset("")}`; + return (text: string) => `\u001B[38;5;${ansiColor}m${text}${reset("")}`; }; export const turboGradient = gradient(BLUE, RED); @@ -70,7 +70,7 @@ export const error = (...args: Array) => { }; function hexToAnsi256(sHex: string): number { - const rgb = parseInt(sHex.slice(1), 16); + const rgb = Number.parseInt(sHex.slice(1), 16); const r = Math.floor(rgb / (256 * 256)) % 256; const g = Math.floor(rgb / 256) % 256; const b = rgb % 256; diff --git a/packages/turbo-utils/src/notifyUpdate.ts b/packages/turbo-utils/src/notify-update.ts similarity index 100% rename from packages/turbo-utils/src/notifyUpdate.ts rename to packages/turbo-utils/src/notify-update.ts diff --git a/packages/turbo-utils/src/searchUp.ts b/packages/turbo-utils/src/search-up.ts similarity index 100% rename from packages/turbo-utils/src/searchUp.ts rename to packages/turbo-utils/src/search-up.ts diff --git a/packages/turbo-utils/src/validateDirectory.ts b/packages/turbo-utils/src/validate-directory.ts similarity index 97% rename from packages/turbo-utils/src/validateDirectory.ts rename to packages/turbo-utils/src/validate-directory.ts index 2ab03d818e735..0fbcc2ddebc6a 100644 --- a/packages/turbo-utils/src/validateDirectory.ts +++ b/packages/turbo-utils/src/validate-directory.ts @@ -1,7 +1,7 @@ import path from "node:path"; import fs from "fs-extra"; import picocolors from "picocolors"; -import { isFolderEmpty } from "./isFolderEmpty"; +import { isFolderEmpty } from "./is-folder-empty"; export function validateDirectory(directory: string): { valid: boolean; diff --git a/packages/turbo-utils/tsconfig.json b/packages/turbo-utils/tsconfig.json index 65e03f1b24f63..5f5b85755f719 100644 --- a/packages/turbo-utils/tsconfig.json +++ b/packages/turbo-utils/tsconfig.json @@ -2,6 +2,7 @@ "extends": "@turbo/tsconfig/library.json", "compilerOptions": { "rootDir": ".", - "lib": ["ES2022", "DOM"] + "lib": ["ES2022", "DOM"], + "strictNullChecks": true } } diff --git a/packages/turbo-vsc/package.json b/packages/turbo-vsc/package.json index d691a68df9ccc..8b0c8f0c2aacc 100644 --- a/packages/turbo-vsc/package.json +++ b/packages/turbo-vsc/package.json @@ -3,8 +3,27 @@ "displayName": "Turborepo LSP", "version": "2.0.0", "description": "Tools and instant feedback for your build system", - "main": "out/main.js", + "categories": [ + "Linters" + ], + "keywords": [ + "monorepo", + "turbo", + "turborepo", + "vercel" + ], + "bugs": { + "url": "https://github.com/vercel/turborepo/issues" + }, + "license": "MIT", + "author": "Vercel", + "repository": { + "type": "git", + "url": "https://github.com/vercel/turborepo", + "directory": "packages/turbo-vsc" + }, "publisher": "Vercel", + "main": "out/main.js", "scripts": { "vscode:prepublish": "npm run esbuild-base -- --minify", "esbuild-base": "esbuild ./src/extension.ts --bundle --main-fields=module,main --outfile=out/main.js --external:vscode --format=cjs --platform=node", @@ -20,39 +39,15 @@ "copy": "pnpm run copy-darwin-arm64 && pnpm run copy-darwin-x64 && pnpm run copy-win32-x64 && pnpm run copy-linux-arm64 && pnpm run copy-linux-x64", "test-compile": "tsc -p ./" }, - "keywords": [ - "turbo", - "turborepo", - "monorepo", - "vercel" - ], - "readme": "README.md", - "categories": [ - "Linters" - ], - "icon": "resources/icon.png", - "bugs": { - "url": "https://github.com/vercel/turborepo/issues" - }, - "repository": { - "type": "git", - "url": "https://github.com/vercel/turborepo", - "directory": "packages/turbo-vsc" - }, - "author": "Vercel", - "license": "MIT", "dependencies": { "jsonc-parser": "3.2.0", "vscode-languageclient": "9.0.1" }, - "engines": { - "vscode": "^1.84.2" - }, "devDependencies": { + "@turbo/tsconfig": "workspace:*", "@types/node": "20.10.8", "@types/vscode": "1.85.0", - "esbuild": "0.27.2", - "@turbo/tsconfig": "workspace:*" + "esbuild": "0.27.2" }, "contributes": { "commands": [ @@ -90,13 +85,18 @@ } } }, + "activationEvents": [ + "workspaceContains:**/turbo.json" + ], + "icon": "resources/icon.png", + "engines": { + "vscode": "^1.84.2" + }, "capabilities": { "virtualWorkspaces": { "supported": "limited", "description": "The language server requires a turbo daemon to function correctly." } }, - "activationEvents": [ - "workspaceContains:**/turbo.json" - ] + "readme": "README.md" } diff --git a/packages/turbo-vsc/src/extension.ts b/packages/turbo-vsc/src/extension.ts index 29ce423b427cd..0ba8b89a64c1a 100644 --- a/packages/turbo-vsc/src/extension.ts +++ b/packages/turbo-vsc/src/extension.ts @@ -10,9 +10,9 @@ import { Uri, env } from "vscode"; -import * as cp from "child_process"; -import * as path from "path"; -import * as fs from "fs"; +import * as cp from "node:child_process"; +import * as path from "node:path"; +import * as fs from "node:fs"; import { LanguageClient, @@ -42,9 +42,9 @@ const logs = window.createOutputChannel("Turborepo Extension"); function rainbowRgb(i: number) { const f = 0.5; - const r = Math.sin(f * i + (4.0 * Math.PI) / 3.0) * 127.0 + 128.0; + const r = Math.sin(f * i + (4 * Math.PI) / 3) * 127 + 128; const g = 45; - const b = Math.sin(f * i) * 127.0 + 128.0; + const b = Math.sin(f * i) * 127 + 128; return `#${Math.round(r).toString(16).padStart(2, "0")}${Math.round(g) .toString(16) diff --git a/packages/turbo-vsc/tsconfig.json b/packages/turbo-vsc/tsconfig.json index cb22be3cd2455..248d27f7fd049 100644 --- a/packages/turbo-vsc/tsconfig.json +++ b/packages/turbo-vsc/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "@turbo/tsconfig/base.json", "compilerOptions": { - "rootDir": "." + "rootDir": ".", + "strictNullChecks": true } } diff --git a/packages/turbo-workspaces/README.md b/packages/turbo-workspaces/README.md index e1a6327985a08..52f9864af19c2 100644 --- a/packages/turbo-workspaces/README.md +++ b/packages/turbo-workspaces/README.md @@ -28,7 +28,7 @@ import { convert, getWorkspaceDetails } from "@turbo/workspaces"; // detect the package manager const project = getWorkspaceDetails({ - root: process.cwd(), + root: process.cwd() }); // if the package manager is not pnpm, convert to pnpm @@ -38,8 +38,8 @@ if (project.packageManager !== "pnpm") { to: "pnpm", options: { dry: false, - install: true, - }, + install: true + } }); } ``` diff --git a/packages/turbo-workspaces/__fixtures__/bun/monorepo/package.json b/packages/turbo-workspaces/__fixtures__/bun/monorepo/package.json index c48ab8db099b2..5f7ce3233b998 100644 --- a/packages/turbo-workspaces/__fixtures__/bun/monorepo/package.json +++ b/packages/turbo-workspaces/__fixtures__/bun/monorepo/package.json @@ -6,9 +6,9 @@ "apps/*", "packages/*" ], + "dependencies": {}, "engines": { "node": ">=14.0.0" }, - "dependencies": {}, "packageManager": "bun@1.0.1" } diff --git a/packages/turbo-workspaces/__fixtures__/npm/monorepo/package.json b/packages/turbo-workspaces/__fixtures__/npm/monorepo/package.json index b1242c72d8d38..45d0927eac6ef 100644 --- a/packages/turbo-workspaces/__fixtures__/npm/monorepo/package.json +++ b/packages/turbo-workspaces/__fixtures__/npm/monorepo/package.json @@ -6,9 +6,9 @@ "apps/*", "packages/*" ], + "dependencies": {}, "engines": { "node": ">=14.0.0" }, - "dependencies": {}, "packageManager": "npm@8.19.4" } diff --git a/packages/turbo-workspaces/__fixtures__/pnpm/monorepo/package.json b/packages/turbo-workspaces/__fixtures__/pnpm/monorepo/package.json index e3627d8ac2738..f1c6d5e6a5bab 100644 --- a/packages/turbo-workspaces/__fixtures__/pnpm/monorepo/package.json +++ b/packages/turbo-workspaces/__fixtures__/pnpm/monorepo/package.json @@ -2,9 +2,9 @@ "name": "pnpm-workspaces", "version": "0.0.0", "private": true, + "dependencies": {}, "engines": { "node": ">=14.0.0" }, - "dependencies": {}, "packageManager": "pnpm@7.12.1" } diff --git a/packages/turbo-workspaces/__fixtures__/yarn/monorepo/package.json b/packages/turbo-workspaces/__fixtures__/yarn/monorepo/package.json index 002944bd73343..1e7375109bd3c 100644 --- a/packages/turbo-workspaces/__fixtures__/yarn/monorepo/package.json +++ b/packages/turbo-workspaces/__fixtures__/yarn/monorepo/package.json @@ -6,9 +6,9 @@ "apps/*", "packages/*" ], + "dependencies": {}, "engines": { "node": ">=14.0.0" }, - "dependencies": {}, "packageManager": "yarn@1.22.19" } diff --git a/packages/turbo-workspaces/__tests__/index.test.ts b/packages/turbo-workspaces/__tests__/index.test.ts index a9ef1c8332ae5..a70b46ffa8a78 100644 --- a/packages/turbo-workspaces/__tests__/index.test.ts +++ b/packages/turbo-workspaces/__tests__/index.test.ts @@ -15,7 +15,7 @@ describe("Node entrypoint", () => { beforeEach(() => { jest.clearAllMocks(); - (execa as jest.MockedFunction).mockResolvedValue({ + jest.mocked(execa).mockResolvedValue({ stdout: "", stderr: "", exitCode: 0, diff --git a/packages/turbo-workspaces/__tests__/managers.test.ts b/packages/turbo-workspaces/__tests__/managers.test.ts index f2bdd7008bd01..3dada0c9512e2 100644 --- a/packages/turbo-workspaces/__tests__/managers.test.ts +++ b/packages/turbo-workspaces/__tests__/managers.test.ts @@ -60,13 +60,13 @@ describe("managers", () => { }); if (dry) { - expect( - await MANAGERS[project].detect({ workspaceRoot: root }) - ).toEqual(true); + await expect( + MANAGERS[project].detect({ workspaceRoot: root }) + ).resolves.toEqual(true); } else { - expect( - await MANAGERS[manager].detect({ workspaceRoot: root }) - ).toEqual(true); + await expect( + MANAGERS[manager].detect({ workspaceRoot: root }) + ).resolves.toEqual(true); } } ); @@ -208,7 +208,7 @@ describe("managers", () => { expect(project.workspaceData.globs).toEqual([]); } else { expect(project.workspaceData.globs).toEqual(["apps/*", "packages/*"]); - project.workspaceData.workspaces.forEach((workspace) => { + for (const workspace of project.workspaceData.workspaces) { const type = ["web", "docs"].includes(workspace.name) ? "apps" : "packages"; @@ -220,7 +220,7 @@ describe("managers", () => { expect(workspace.paths.root).toMatch( new RegExp(`^.*${directoryName}/${type}/${workspace.name}$`) ); - }); + } } } ); @@ -290,7 +290,7 @@ describe("managers", () => { expect(project.workspaceData.globs).toEqual([]); } else { expect(project.workspaceData.globs).toEqual(["apps/*", "packages/*"]); - project.workspaceData.workspaces.forEach((workspace) => { + for (const workspace of project.workspaceData.workspaces) { const type = ["web", "docs"].includes(workspace.name) ? "apps" : "packages"; @@ -302,7 +302,7 @@ describe("managers", () => { expect(workspace.paths.root).toMatch( new RegExp(`^.*${directoryName}/${type}/${workspace.name}$`) ); - }); + } } } ); diff --git a/packages/turbo-workspaces/package.json b/packages/turbo-workspaces/package.json index 93e6cf9076583..57bfe6ae7e0c3 100644 --- a/packages/turbo-workspaces/package.json +++ b/packages/turbo-workspaces/package.json @@ -3,19 +3,25 @@ "version": "2.8.11-canary.22", "description": "Tools for working with package managers", "homepage": "https://turborepo.dev", + "bugs": { + "url": "https://github.com/vercel/turborepo/issues" + }, "license": "MIT", "repository": { "type": "git", "url": "https://github.com/vercel/turborepo", "directory": "packages/turbo-workspaces" }, - "bugs": { - "url": "https://github.com/vercel/turborepo/issues" - }, "bin": "dist/cli.js", - "module": "dist/index.mjs", + "files": [ + "dist" + ], "main": "dist/index.js", + "module": "dist/index.mjs", "types": "dist/index.d.ts", + "publishConfig": { + "access": "public" + }, "scripts": { "build": "tsdown", "dev": "tsdown --watch", @@ -24,12 +30,12 @@ "lint:prettier": "prettier -c . --cache --ignore-path=../../.prettierignore" }, "dependencies": { + "@inquirer/prompts": "^7.10.1", "commander": "10.0.0", "execa": "5.1.1", "fast-glob": "3.2.12", "fs-extra": "10.1.0", "gradient-string": "2.0.1", - "@inquirer/prompts": "^7.10.1", "js-yaml": "4.1.1", "ora": "4.1.1", "picocolors": "1.0.1", @@ -50,11 +56,5 @@ "ts-jest": "29.4.6", "tsdown": "0.9.3", "typescript": "5.5.4" - }, - "files": [ - "dist" - ], - "publishConfig": { - "access": "public" } } diff --git a/packages/turbo-workspaces/src/commands/convert/index.ts b/packages/turbo-workspaces/src/commands/convert/index.ts index 495cb79f9351a..19b8fbedb2ea8 100644 --- a/packages/turbo-workspaces/src/commands/convert/index.ts +++ b/packages/turbo-workspaces/src/commands/convert/index.ts @@ -3,7 +3,7 @@ import picocolors from "picocolors"; import { getAvailablePackageManagers, type PackageManager } from "@turbo/utils"; import { Logger } from "../../logger"; import { directoryInfo } from "../../utils"; -import { getWorkspaceDetails } from "../../getWorkspaceDetails"; +import { getWorkspaceDetails } from "../../get-workspace-details"; import { convertProject } from "../../convert"; import type { ConvertCommandArgument, ConvertCommandOptions } from "./types"; diff --git a/packages/turbo-workspaces/src/commands/summary/index.ts b/packages/turbo-workspaces/src/commands/summary/index.ts index 207e3b4bcd508..09432a0eccf4e 100644 --- a/packages/turbo-workspaces/src/commands/summary/index.ts +++ b/packages/turbo-workspaces/src/commands/summary/index.ts @@ -3,7 +3,7 @@ import { input } from "@inquirer/prompts"; import picocolors from "picocolors"; import { Logger } from "../../logger"; import { directoryInfo } from "../../utils"; -import { getWorkspaceDetails } from "../../getWorkspaceDetails"; +import { getWorkspaceDetails } from "../../get-workspace-details"; import type { Workspace } from "../../types"; import type { SummaryCommandArgument } from "./types"; @@ -42,14 +42,14 @@ export async function summaryCommand(directory: SummaryCommandArgument) { const hasWorkspaces = numWorkspaces > 0; // group workspaces const workspacesByDirectory: Record> = {}; - project.workspaceData.workspaces.forEach((workspace) => { + for (const workspace of project.workspaceData.workspaces) { const workspacePath = path.relative(root, workspace.paths.root); const rootDirectory = workspacePath.split(path.sep)[0]; if (!(rootDirectory in workspacesByDirectory)) { workspacesByDirectory[rootDirectory] = []; } workspacesByDirectory[rootDirectory].push(workspace); - }); + } const renderWorkspace = (w: Workspace) => { return `${w.name} (${picocolors.italic( @@ -67,9 +67,9 @@ export async function summaryCommand(directory: SummaryCommandArgument) { workspaces: Array; }) => { logger.indented(2, `${number}. ${picocolors.bold(dir)}`); - workspaces.forEach((workspace, idx) => { + for (const [idx, workspace] of workspaces.entries()) { logger.indented(3, `${idx + 1}. ${renderWorkspace(workspace)}`); - }); + } }; // repo header @@ -88,13 +88,13 @@ export async function summaryCommand(directory: SummaryCommandArgument) { 1, `Workspaces (${picocolors.bold(numWorkspaces.toString())}):` ); - Object.keys(workspacesByDirectory).forEach((dir, idx) => { + for (const [idx, dir] of Object.keys(workspacesByDirectory).entries()) { renderDirectory({ number: idx + 1, workspaces: workspacesByDirectory[dir], dir }); - }); + } logger.blankLine(); } } diff --git a/packages/turbo-workspaces/src/getWorkspaceDetails.ts b/packages/turbo-workspaces/src/get-workspace-details.ts similarity index 100% rename from packages/turbo-workspaces/src/getWorkspaceDetails.ts rename to packages/turbo-workspaces/src/get-workspace-details.ts diff --git a/packages/turbo-workspaces/src/index.ts b/packages/turbo-workspaces/src/index.ts index b0c644eeb9b42..882f41f96961a 100644 --- a/packages/turbo-workspaces/src/index.ts +++ b/packages/turbo-workspaces/src/index.ts @@ -1,5 +1,5 @@ import { getAvailablePackageManagers, type PackageManager } from "@turbo/utils"; -import { getWorkspaceDetails } from "./getWorkspaceDetails"; +import { getWorkspaceDetails } from "./get-workspace-details"; import { convertProject } from "./convert"; import { Logger } from "./logger"; import { install, getPackageManagerMeta } from "./install"; diff --git a/packages/turbo-workspaces/src/managers/bun.ts b/packages/turbo-workspaces/src/managers/bun.ts index 96a341fb19d06..3bb9379c0b0bc 100644 --- a/packages/turbo-workspaces/src/managers/bun.ts +++ b/packages/turbo-workspaces/src/managers/bun.ts @@ -1,7 +1,7 @@ import path from "node:path"; import fs from "fs-extra"; import { ConvertError } from "../errors"; -import { updateDependencies } from "../updateDependencies"; +import { updateDependencies } from "../update-dependencies"; import type { DetectArgs, ReadArgs, @@ -149,9 +149,9 @@ async function create(args: CreateArgs): Promise { // workspace dependencies logger.workspaceHeader(); - project.workspaceData.workspaces.forEach((workspace) => { + for (const workspace of project.workspaceData.workspaces) { updateDependencies({ workspace, project, to, logger, options }); - }); + } } else if (!options?.dry) { fs.writeJSONSync(project.paths.packageJson, packageJson, { spaces: 2 }); } @@ -240,21 +240,25 @@ async function convertLock(args: ConvertArgs): Promise { // handle moving lockfile from `packageManager` to npm switch (project.packageManager) { - case "pnpm": + case "pnpm": { // can't convert from pnpm to bun - just remove the lock removeLockFile({ project, options }); break; - case "bun": + } + case "bun": { // we're already using bun, so we don't need to convert break; - case "npm": + } + case "npm": { // can't convert from npm to bun - just remove the lock removeLockFile({ project, options }); break; - case "yarn": + } + case "yarn": { // can't convert from yarn to bun - just remove the lock removeLockFile({ project, options }); break; + } } } diff --git a/packages/turbo-workspaces/src/managers/npm.ts b/packages/turbo-workspaces/src/managers/npm.ts index cf5e3d178f954..3581ba3cc80cf 100644 --- a/packages/turbo-workspaces/src/managers/npm.ts +++ b/packages/turbo-workspaces/src/managers/npm.ts @@ -1,7 +1,7 @@ import path from "node:path"; import fs from "fs-extra"; import { ConvertError } from "../errors"; -import { updateDependencies } from "../updateDependencies"; +import { updateDependencies } from "../update-dependencies"; import type { DetectArgs, ReadArgs, @@ -138,9 +138,9 @@ async function create(args: CreateArgs): Promise { // workspace dependencies logger.workspaceHeader(); - project.workspaceData.workspaces.forEach((workspace) => { + for (const workspace of project.workspaceData.workspaces) { updateDependencies({ workspace, project, to, logger, options }); - }); + } } else if (!options?.dry) { fs.writeJSONSync(project.paths.packageJson, packageJson, { spaces: 2 }); } @@ -228,21 +228,25 @@ async function convertLock(args: ConvertArgs): Promise { // handle moving lockfile from `packageManager` to npm switch (project.packageManager) { - case "pnpm": + case "pnpm": { // can't convert from pnpm to npm - just remove the lock removeLockFile({ project, options }); break; - case "bun": + } + case "bun": { // can't convert from bun to npm - just remove the lock removeLockFile({ project, options }); break; - case "npm": + } + case "npm": { // we're already using npm, so we don't need to convert break; - case "yarn": + } + case "yarn": { // can't convert from yarn to npm - just remove the lock removeLockFile({ project, options }); break; + } } } diff --git a/packages/turbo-workspaces/src/managers/pnpm.ts b/packages/turbo-workspaces/src/managers/pnpm.ts index 33260d3b8251b..710fb157dd2b0 100644 --- a/packages/turbo-workspaces/src/managers/pnpm.ts +++ b/packages/turbo-workspaces/src/managers/pnpm.ts @@ -2,7 +2,7 @@ import path from "node:path"; import fs from "fs-extra"; import execa from "execa"; import { ConvertError } from "../errors"; -import { updateDependencies } from "../updateDependencies"; +import { updateDependencies } from "../update-dependencies"; import type { DetectArgs, ReadArgs, @@ -137,9 +137,9 @@ async function create(args: CreateArgs): Promise { // workspace dependencies logger.workspaceHeader(); - project.workspaceData.workspaces.forEach((workspace) => { + for (const workspace of project.workspaceData.workspaces) { updateDependencies({ workspace, project, to, logger, options }); - }); + } } } @@ -253,10 +253,11 @@ async function convertLock(args: ConvertArgs): Promise { // handle moving lockfile from `packageManager` to npm switch (project.packageManager) { - case "pnpm": + case "pnpm": { // we're already using pnpm, so we don't need to convert break; - case "bun": + } + case "bun": { logLockConversionStep(); // convert bun -> yarn -> pnpm await bunLockToYarnLock({ project, options }); @@ -264,16 +265,19 @@ async function convertLock(args: ConvertArgs): Promise { // remove the intermediate yarn lockfile fs.rmSync(path.join(project.paths.root, "yarn.lock"), { force: true }); break; - case "npm": + } + case "npm": { // convert npm -> pnpm logLockConversionStep(); await importLockfile(); break; - case "yarn": + } + case "yarn": { // convert yarn -> pnpm logLockConversionStep(); await importLockfile(); break; + } } } diff --git a/packages/turbo-workspaces/src/managers/yarn.ts b/packages/turbo-workspaces/src/managers/yarn.ts index ce338da984855..aa1446e20f712 100644 --- a/packages/turbo-workspaces/src/managers/yarn.ts +++ b/packages/turbo-workspaces/src/managers/yarn.ts @@ -1,7 +1,7 @@ import path from "node:path"; import fs from "fs-extra"; import { ConvertError } from "../errors"; -import { updateDependencies } from "../updateDependencies"; +import { updateDependencies } from "../update-dependencies"; import type { DetectArgs, ReadArgs, @@ -138,9 +138,9 @@ async function create(args: CreateArgs): Promise { // workspace dependencies logger.workspaceHeader(); - project.workspaceData.workspaces.forEach((workspace) => { + for (const workspace of project.workspaceData.workspaces) { updateDependencies({ workspace, project, to, logger, options }); - }); + } } else if (!options?.dry) { fs.writeJSONSync(project.paths.packageJson, packageJson, { spaces: 2 }); } @@ -237,22 +237,26 @@ async function convertLock(args: ConvertArgs): Promise { // handle moving lockfile from `packageManager` to yarn switch (project.packageManager) { - case "pnpm": + case "pnpm": { // can't convert from pnpm to yarn - just remove the lock removeLockFile({ project, options }); break; - case "bun": + } + case "bun": { // convert from bun lockfile to yarn logLockConversionStep(); await bunLockToYarnLock({ project, options }); break; - case "npm": + } + case "npm": { // can't convert from npm to yarn - just remove the lock removeLockFile({ project, options }); break; - case "yarn": + } + case "yarn": { // we're already using yarn, so we don't need to convert break; + } } } diff --git a/packages/turbo-workspaces/src/updateDependencies.ts b/packages/turbo-workspaces/src/update-dependencies.ts similarity index 95% rename from packages/turbo-workspaces/src/updateDependencies.ts rename to packages/turbo-workspaces/src/update-dependencies.ts index 5ae56fd6b0a63..0907a7eba44cb 100644 --- a/packages/turbo-workspaces/src/updateDependencies.ts +++ b/packages/turbo-workspaces/src/update-dependencies.ts @@ -21,7 +21,7 @@ function updateDependencyList({ to: AvailablePackageManagerDetails; }): { dependencyList: DependencyList; updated: Array } { const updated: Array = []; - project.workspaceData.workspaces.forEach((workspace) => { + for (const workspace of project.workspaceData.workspaces) { const { name } = workspace; if (dependencyList[name]) { const workspaceVersion = dependencyList[name]; @@ -32,7 +32,7 @@ function updateDependencyList({ to.name === "pnpm" ? `workspace:${version}` : version; updated.push(name); } - }); + } return { dependencyList, updated }; } @@ -82,7 +82,7 @@ export function updateDependencies({ "optionalDependencies" ]; - allDependencyKeys.forEach((depKey) => { + for (const depKey of allDependencyKeys) { const depList = workspacePackageJson[depKey]; if (depList) { const { updated, dependencyList } = updateDependencyList({ @@ -94,7 +94,7 @@ export function updateDependencies({ workspacePackageJson[depKey] = dependencyList; stats[depKey] = updated; } - }); + } const toLog = (key: keyof DependencyGroups) => { const total = stats[key].length; @@ -113,7 +113,7 @@ export function updateDependencies({ )}`; if (allChanges.length >= 1) { let logLine = "updating"; - allChanges.forEach((stat, idx) => { + for (const [idx, stat] of allChanges.entries()) { if (allChanges.length === 1) { logLine += ` ${stat} in ${workspaceLocation}`; } else if (idx === allChanges.length - 1) { @@ -121,7 +121,7 @@ export function updateDependencies({ } else { logLine += ` ${stat}, `; } - }); + } logger.workspaceStep(logLine); } else { diff --git a/packages/turbo-workspaces/tsconfig.json b/packages/turbo-workspaces/tsconfig.json index 65e03f1b24f63..5f5b85755f719 100644 --- a/packages/turbo-workspaces/tsconfig.json +++ b/packages/turbo-workspaces/tsconfig.json @@ -2,6 +2,7 @@ "extends": "@turbo/tsconfig/library.json", "compilerOptions": { "rootDir": ".", - "lib": ["ES2022", "DOM"] + "lib": ["ES2022", "DOM"], + "strictNullChecks": true } } diff --git a/packages/turbo/bump-version.js b/packages/turbo/bump-version.js index a7b17f8f63981..2b16952a744f3 100644 --- a/packages/turbo/bump-version.js +++ b/packages/turbo/bump-version.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -const fs = require("fs"); +const fs = require("node:fs"); const pkg = require("./package.json"); const file = require.resolve("./package.json"); diff --git a/packages/turbo/package.json b/packages/turbo/package.json index 2c55a069c0d21..374392640cc51 100644 --- a/packages/turbo/package.json +++ b/packages/turbo/package.json @@ -2,14 +2,10 @@ "name": "turbo", "version": "2.8.11-canary.22", "description": "Turborepo is a high-performance build system for JavaScript and TypeScript codebases.", - "repository": "https://github.com/vercel/turborepo", - "bugs": "https://github.com/vercel/turborepo/issues", "homepage": "https://turborepo.dev", + "bugs": "https://github.com/vercel/turborepo/issues", "license": "MIT", - "main": "./bin/turbo", - "scripts": { - "postversion": "node bump-version.js" - }, + "repository": "https://github.com/vercel/turborepo", "bin": { "turbo": "./bin/turbo" }, @@ -17,6 +13,10 @@ "bin", "schema.json" ], + "main": "./bin/turbo", + "scripts": { + "postversion": "node bump-version.js" + }, "optionalDependencies": { "turbo-darwin-64": "2.8.11-canary.22", "turbo-darwin-arm64": "2.8.11-canary.22", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1309851ad039b..a69a1919ba0f2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,17 +25,20 @@ importers: specifier: 13.1.0 version: 13.1.0 oxfmt: - specifier: ^0.23.0 - version: 0.23.0 + specifier: ^0.34.0 + version: 0.34.0 oxlint: - specifier: ^1.35.0 - version: 1.43.0 + specifier: ^1.49.0 + version: 1.49.0 semver: specifier: 7.5.2 version: 7.5.2 typescript: specifier: 5.5.4 version: 5.5.4 + ultracite: + specifier: 7.2.3 + version: 7.2.3(oxlint@1.49.0) apps/agents: dependencies: @@ -1389,6 +1392,12 @@ packages: '@chevrotain/utils@11.0.3': resolution: {integrity: sha512-YslZMgtJUyuMbZ+aKvfF3x1f5liK4mWNxghFRv7jqRR9C3R3fAOGTTKvxXDa2Y1s9zSbcpuO0cAxDYsc9SrXoQ==} + '@clack/core@1.0.1': + resolution: {integrity: sha512-WKeyK3NOBwDOzagPR5H08rFk9D/WuN705yEbuZvKqlkmoLM2woKtXb10OO2k1NoSU4SFG947i2/SCYh+2u5e4g==} + + '@clack/prompts@1.0.1': + resolution: {integrity: sha512-/42G73JkuYdyWZ6m8d/CJtBrGl1Hegyc7Fy78m5Ob+jF85TOUmLR5XLce/U3LxYAw0kJ8CT5aI99RIvPHcGp/Q==} + '@colors/colors@1.5.0': resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==} engines: {node: '>=0.1.90'} @@ -2450,83 +2459,231 @@ packages: cpu: [x64] os: [win32] - '@oxfmt/darwin-arm64@0.23.0': - resolution: {integrity: sha512-shGng2EjBspvuqtFtcjcKf0WoZ9QCdL8iLYgdOoKSiSQ9pPyLJ4jQf62yhm4b2PpZNVcV/20gV6d8SyKzg6SZQ==} + '@oxfmt/binding-android-arm-eabi@0.34.0': + resolution: {integrity: sha512-sqkqjh/Z38l+duOb1HtVqJTAj1grt2ttkobCopC/72+a4Xxz4xUgZPFyQ4HxrYMvyqO/YA0tvM1QbfOu70Gk1Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@oxfmt/binding-android-arm64@0.34.0': + resolution: {integrity: sha512-1KRCtasHcVcGOMwfOP9d5Bus2NFsN8yAYM5cBwi8LBg5UtXC3C49WHKrlEa8iF1BjOS6CR2qIqiFbGoA0DJQNQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@oxfmt/binding-darwin-arm64@0.34.0': + resolution: {integrity: sha512-b+Rmw9Bva6e/7PBES2wLO8sEU7Mi0+/Kv+pXSe/Y8i4fWNftZZlGwp8P01eECaUqpXATfSgNxdEKy7+ssVNz7g==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] - '@oxfmt/darwin-x64@0.23.0': - resolution: {integrity: sha512-DxQ7Hm7B+6JiIkiRU3CSJmM15nTJDDezyaAv+x9NN8BfU0C49O8JuZIFu1Lr9AKEPV+ECIYM2X4HU0xm6IdiMQ==} + '@oxfmt/binding-darwin-x64@0.34.0': + resolution: {integrity: sha512-QGjpevWzf1T9COEokZEWt80kPOtthW1zhRbo7x4Qoz646eTTfi6XsHG2uHeDWJmTbgBoJZPMgj2TAEV/ppEZaA==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] - '@oxfmt/linux-arm64-gnu@0.23.0': - resolution: {integrity: sha512-7qTXPpENi45sEKsaYFit4VRywPVkX+ZJc5JVA17KW1coJ/SLUuRAdLjRipU+QTZsr1TF93HCmGFSlUjB7lmEVQ==} + '@oxfmt/binding-freebsd-x64@0.34.0': + resolution: {integrity: sha512-VMSaC02cG75qL59M9M/szEaqq/RsLfgpzQ4nqUu8BUnX1zkiZIW2gTpUv3ZJ6qpWnHxIlAXiRZjQwmcwpvtbcg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@oxfmt/binding-linux-arm-gnueabihf@0.34.0': + resolution: {integrity: sha512-Klm367PFJhH6vYK3vdIOxFepSJZHPaBfIuqwxdkOcfSQ4qqc/M8sgK0UTFnJWWTA/IkhMIh1kW6uEqiZ/xtQqg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxfmt/binding-linux-arm-musleabihf@0.34.0': + resolution: {integrity: sha512-nqn0QueVXRfbN9m58/E9Zij0Ap8lzayx591eWBYn0sZrGzY1IRv9RYS7J/1YUXbb0Ugedo0a8qIWzUHU9bWQuA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxfmt/binding-linux-arm64-gnu@0.34.0': + resolution: {integrity: sha512-DDn+dcqW+sMTCEjvLoQvC/VWJjG7h8wcdN/J+g7ZTdf/3/Dx730pQElxPPGsCXPhprb11OsPyMp5FwXjMY3qvA==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] - '@oxfmt/linux-arm64-musl@0.23.0': - resolution: {integrity: sha512-qkFXbf+K01B++j69o9mLvvyfhmmL4+qX7hGPA2PRDkE5xxuUTWdqboQQc1FgGI0teUlIYYyxjamq9UztL2A7NA==} + '@oxfmt/binding-linux-arm64-musl@0.34.0': + resolution: {integrity: sha512-H+F8+71gHQoGTFPPJ6z4dD0Fzfzi0UP8Zx94h5kUmIFThLvMq5K1Y/bUUubiXwwHfwb5C3MPjUpYijiy0rj51Q==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] - '@oxfmt/linux-x64-gnu@0.23.0': - resolution: {integrity: sha512-J7Q13Ujyn8IgjHD96urA377GOy8HerxC13OrEyYaM8iwH3gc/EoboK9AKu0bxp9qai4btPFDhnkRnpCwJE9pAw==} + '@oxfmt/binding-linux-ppc64-gnu@0.34.0': + resolution: {integrity: sha512-dIGnzTNhCXqQD5pzBwduLg8pClm+t8R53qaE9i5h8iua1iaFAJyLffh4847CNZSlASb7gn1Ofuv7KoG/EpoGZg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + + '@oxfmt/binding-linux-riscv64-gnu@0.34.0': + resolution: {integrity: sha512-FGQ2GTTooilDte/ogwWwkHuuL3lGtcE3uKM2EcC7kOXNWdUfMY6Jx3JCodNVVbFoybv4A+HuCj8WJji2uu1Ceg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + + '@oxfmt/binding-linux-riscv64-musl@0.34.0': + resolution: {integrity: sha512-2dGbGneJ7ptOIVKMwEIHdCkdZEomh74X3ggo4hCzEXL/rl9HwfsZDR15MkqfQqAs6nVXMvtGIOMxjDYa5lwKaA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + + '@oxfmt/binding-linux-s390x-gnu@0.34.0': + resolution: {integrity: sha512-cCtGgmrTrxq3OeSG0UAO+w6yLZTMeOF4XM9SAkNrRUxYhRQELSDQ/iNPCLyHhYNi38uHJQbS5RQweLUDpI4ajA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + + '@oxfmt/binding-linux-x64-gnu@0.34.0': + resolution: {integrity: sha512-7AvMzmeX+k7GdgitXp99GQoIV/QZIpAS7rwxQvC/T541yWC45nwvk4mpnU8N+V6dE5SPEObnqfhCjO80s7qIsg==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] - '@oxfmt/linux-x64-musl@0.23.0': - resolution: {integrity: sha512-3gb25Zk2/y4An8fi399KdpLkDYFTJEB5Nq/sSHmeXG0pZlR/jnKoXEFHsjU+9nqF2wsuZ+tmkoi/swcaGG8+Qg==} + '@oxfmt/binding-linux-x64-musl@0.34.0': + resolution: {integrity: sha512-uNiglhcmivJo1oDMh3hoN/Z0WsbEXOpRXZdQ3W/IkOpyV8WF308jFjSC1ZxajdcNRXWej0zgge9QXba58Owt+g==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] - '@oxfmt/win32-arm64@0.23.0': - resolution: {integrity: sha512-JKfRP2ENWwRZ73rMZFyChvRi/+oDEW+3obp1XIwecot8gvDHgGZ4nX3hTp4VPiBFL89JORMpWSKzJvjRDucJIw==} + '@oxfmt/binding-openharmony-arm64@0.34.0': + resolution: {integrity: sha512-5eFsTjCyji25j6zznzlMc+wQAZJoL9oWy576xhqd2efv+N4g1swIzuSDcb1dz4gpcVC6veWe9pAwD7HnrGjLwg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@oxfmt/binding-win32-arm64-msvc@0.34.0': + resolution: {integrity: sha512-6id8kK0t5hKfbV6LHDzRO21wRTA6ctTlKGTZIsG/mcoir0rssvaYsedUymF4HDj7tbCUlnxCX/qOajKlEuqbIw==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] - '@oxfmt/win32-x64@0.23.0': - resolution: {integrity: sha512-vgqtYK1X1n/KexCNQKWXao3hyOnmWuCzk2sQyCSpkLhjSNIDPm7dmnEkvOXhf1t0O5RjCwHpk2VB6Fuaq3GULg==} + '@oxfmt/binding-win32-ia32-msvc@0.34.0': + resolution: {integrity: sha512-QHaz+w673mlYqn9v/+fuiKZpjkmagleXQ+NygShDv8tdHpRYX2oYhTJwwt9j1ZfVhRgza1EIUW3JmzCXmtPdhQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ia32] + os: [win32] + + '@oxfmt/binding-win32-x64-msvc@0.34.0': + resolution: {integrity: sha512-CXKQM/VaF+yuvGru8ktleHLJoBdjBtTFmAsLGePiESiTN0NjCI/PiaiOCfHMJ1HdP1LykvARUwMvgaN3tDhcrg==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] - '@oxlint/darwin-arm64@1.43.0': - resolution: {integrity: sha512-C/GhObv/pQZg34NOzB6Mk8x0wc9AKj8fXzJF8ZRKTsBPyHusC6AZ6bba0QG0TUufw1KWuD0j++oebQfWeiFXNw==} + '@oxlint/binding-android-arm-eabi@1.49.0': + resolution: {integrity: sha512-2WPoh/2oK9r/i2R4o4J18AOrm3HVlWiHZ8TnuCaS4dX8m5ZzRmHW0I3eLxEurQLHWVruhQN7fHgZnah+ag5iQg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@oxlint/binding-android-arm64@1.49.0': + resolution: {integrity: sha512-YqJAGvNB11EzoKm1euVhZntb79alhMvWW/j12bYqdvVxn6xzEQWrEDCJg9BPo3A3tBCSUBKH7bVkAiCBqK/L1w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@oxlint/binding-darwin-arm64@1.49.0': + resolution: {integrity: sha512-WFocCRlvVkMhChCJ2qpJfp1Gj/IjvyjuifH9Pex8m8yHonxxQa3d8DZYreuDQU3T4jvSY8rqhoRqnpc61Nlbxw==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] - '@oxlint/darwin-x64@1.43.0': - resolution: {integrity: sha512-4NjfUtEEH8ewRQ2KlZGmm6DyrvypMdHwBnQT92vD0dLScNOQzr0V9O8Ua4IWXdeCNl/XMVhAV3h4/3YEYern5A==} + '@oxlint/binding-darwin-x64@1.49.0': + resolution: {integrity: sha512-BN0KniwvehbUfYztOMwEDkYoojGm/narf5oJf+/ap+6PnzMeWLezMaVARNIS0j3OdMkjHTEP8s3+GdPJ7WDywQ==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] - '@oxlint/linux-arm64-gnu@1.43.0': - resolution: {integrity: sha512-75tf1HvwdZ3ebk83yMbSB+moAEWK98mYqpXiaFAi6Zshie7r+Cx5PLXZFUEqkscenoZ+fcNXakHxfn94V6nf1g==} + '@oxlint/binding-freebsd-x64@1.49.0': + resolution: {integrity: sha512-SnkAc/DPIY6joMCiP/+53Q+N2UOGMU6ULvbztpmvPJNF/jYPGhNbKtN982uj2Gs6fpbxYkmyj08QnpkD4fbHJA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@oxlint/binding-linux-arm-gnueabihf@1.49.0': + resolution: {integrity: sha512-6Z3EzRvpQVIpO7uFhdiGhdE8Mh3S2VWKLL9xuxVqD6fzPhyI3ugthpYXlCChXzO8FzcYIZ3t1+Kau+h2NY1hqA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxlint/binding-linux-arm-musleabihf@1.49.0': + resolution: {integrity: sha512-wdjXaQYAL/L25732mLlngfst4Jdmi/HLPVHb3yfCoP5mE3lO/pFFrmOJpqWodgv29suWY74Ij+RmJ/YIG5VuzQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxlint/binding-linux-arm64-gnu@1.49.0': + resolution: {integrity: sha512-oSHpm8zmSvAG1BWUumbDRSg7moJbnwoEXKAkwDf/xTQJOzvbUknq95NVQdw/AduZr5dePftalB8rzJNGBogUMg==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] - '@oxlint/linux-arm64-musl@1.43.0': - resolution: {integrity: sha512-BHV4fb36T2p/7bpA9fiJ5ayt7oJbiYX10nklW5arYp4l9/9yG/FQC5J4G1evzbJ/YbipF9UH0vYBAm5xbqGrvw==} + '@oxlint/binding-linux-arm64-musl@1.49.0': + resolution: {integrity: sha512-xeqkMOARgGBlEg9BQuPDf6ZW711X6BT5qjDyeM5XNowCJeTSdmMhpePJjTEiVbbr3t21sIlK8RE6X5bc04nWyQ==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] - '@oxlint/linux-x64-gnu@1.43.0': - resolution: {integrity: sha512-1l3nvnzWWse1YHibzZ4HQXdF/ibfbKZhp9IguElni3bBqEyPEyurzZ0ikWynDxKGXqZa+UNXTFuU1NRVX1RJ3g==} + '@oxlint/binding-linux-ppc64-gnu@1.49.0': + resolution: {integrity: sha512-uvcqRO6PnlJGbL7TeePhTK5+7/JXbxGbN+C6FVmfICDeeRomgQqrfVjf0lUrVpUU8ii8TSkIbNdft3M+oNlOsQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + + '@oxlint/binding-linux-riscv64-gnu@1.49.0': + resolution: {integrity: sha512-Dw1HkdXAwHNH+ZDserHP2RzXQmhHtpsYYI0hf8fuGAVCIVwvS6w1+InLxpPMY25P8ASRNiFN3hADtoh6lI+4lg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + + '@oxlint/binding-linux-riscv64-musl@1.49.0': + resolution: {integrity: sha512-EPlMYaA05tJ9km/0dI9K57iuMq3Tw+nHst7TNIegAJZrBPtsOtYaMFZEaWj02HA8FI5QvSnRHMt+CI+RIhXJBQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + + '@oxlint/binding-linux-s390x-gnu@1.49.0': + resolution: {integrity: sha512-yZiQL9qEwse34aMbnMb5VqiAWfDY+fLFuoJbHOuzB1OaJZbN1MRF9Nk+W89PIpGr5DNPDipwjZb8+Q7wOywoUQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + + '@oxlint/binding-linux-x64-gnu@1.49.0': + resolution: {integrity: sha512-CcCDwMMXSchNkhdgvhVn3DLZ4EnBXAD8o8+gRzahg+IdSt/72y19xBgShJgadIRF0TsRcV/MhDUMwL5N/W54aQ==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] - '@oxlint/linux-x64-musl@1.43.0': - resolution: {integrity: sha512-+jNYgLGRFTJxJuaSOZJBwlYo5M0TWRw0+3y5MHOL4ArrIdHyCthg6r4RbVWrsR1qUfUE1VSSHQ2bfbC99RXqMg==} + '@oxlint/binding-linux-x64-musl@1.49.0': + resolution: {integrity: sha512-u3HfKV8BV6t6UCCbN0RRiyqcymhrnpunVmLFI8sEa5S/EBu+p/0bJ3D7LZ2KT6PsBbrB71SWq4DeFrskOVgIZg==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] - '@oxlint/win32-arm64@1.43.0': - resolution: {integrity: sha512-dvs1C/HCjCyGTURMagiHprsOvVTT3omDiSzi5Qw0D4QFJ1pEaNlfBhVnOUYgUfS6O7Mcmj4+G+sidRsQcWQ/kA==} + '@oxlint/binding-openharmony-arm64@1.49.0': + resolution: {integrity: sha512-dRDpH9fw+oeUMpM4br0taYCFpW6jQtOuEIec89rOgDA1YhqwmeRcx0XYeCv7U48p57qJ1XZHeMGM9LdItIjfzA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@oxlint/binding-win32-arm64-msvc@1.49.0': + resolution: {integrity: sha512-6rrKe/wL9tn0qnOy76i1/0f4Dc3dtQnibGlU4HqR/brVHlVjzLSoaH0gAFnLnznh9yQ6gcFTBFOPrcN/eKPDGA==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] - '@oxlint/win32-x64@1.43.0': - resolution: {integrity: sha512-bSuItSU8mTSDsvmmLTepTdCL2FkJI6dwt9tot/k0EmiYF+ArRzmsl4lXVLssJNRV5lJEc5IViyTrh7oiwrjUqA==} + '@oxlint/binding-win32-ia32-msvc@1.49.0': + resolution: {integrity: sha512-CXHLWAtLs2xG/aVy1OZiYJzrULlq0QkYpI6cd7VKMrab+qur4fXVE/B1Bp1m0h1qKTj5/FTGg6oU4qaXMjS/ug==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ia32] + os: [win32] + + '@oxlint/binding-win32-x64-msvc@1.49.0': + resolution: {integrity: sha512-VteIelt78kwzSglOozaQcs6BCS4Lk0j+QA+hGV0W8UeyaqQ3XpbZRhDU55NW1PPvCy1tg4VXsTlEaPovqto7nQ==} + engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] @@ -4721,6 +4878,10 @@ packages: balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + balanced-match@4.0.3: + resolution: {integrity: sha512-1pHv8LX9CpKut1Zp4EXey7Z8OfH11ONNH6Dhi2WDUt31VVZFXZzKwXcysBgqSumFCmR+0dqjMK5v5JiFHzi0+g==} + engines: {node: 20 || >=22} + bare-events@2.8.2: resolution: {integrity: sha512-riJjyv1/mHLIPX4RwiK+oW9/4c3TEUeORHKefKAKnZ5kyslbN+HXowtbaVEqt4IMUB7OXlfixcs6gsFeo/jhiQ==} peerDependencies: @@ -4765,6 +4926,10 @@ packages: brace-expansion@2.0.2: resolution: {integrity: sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==} + brace-expansion@5.0.2: + resolution: {integrity: sha512-Pdk8c9poy+YhOgVWw1JNN22/HcivgKWwpxKq04M/jTmHyCZn12WPJebZxdjSa5TmBqISrUSgNYU3eRORljfCCw==} + engines: {node: 20 || >=22} + braces@3.0.3: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} @@ -4915,6 +5080,9 @@ packages: resolution: {integrity: sha512-77PSwercCZU2Fc4sX94eF8k8Pxte6JAwL4/ICZLFjJLqegs7kCuAsqqj/70NQF6TvDpgFjkubQB2FW2ZZddvQg==} engines: {node: '>=8'} + citty@0.2.1: + resolution: {integrity: sha512-kEV95lFBhQgtogAPlQfJJ0WGVSokvLr/UEoFPiKKOXF7pl98HfUVUD0ejsuTCld/9xH9vogSywZ5KqHzXrZpqg==} + cjs-module-lexer@1.4.3: resolution: {integrity: sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==} @@ -6060,6 +6228,10 @@ packages: deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me hasBin: true + glob@13.0.6: + resolution: {integrity: sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==} + engines: {node: 18 || 20 || >=22} + glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me @@ -6662,6 +6834,9 @@ packages: jsonc-parser@3.2.0: resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} + jsonc-parser@3.3.1: + resolution: {integrity: sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==} + jsonfile@4.0.0: resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} @@ -7188,6 +7363,10 @@ packages: resolution: {integrity: sha512-fu656aJ0n2kcXwsnwnv9g24tkU5uSmOlTjd6WyyaKm2Z+h1qmY6bAjrcaIxF/BslFqbZ8UBtbJi7KgQOZD2PTw==} engines: {node: 20 || >=22} + minimatch@10.2.2: + resolution: {integrity: sha512-+G4CpNBxa5MprY+04MbgOw1v7So6n5JY166pFi9KfYwT78fxScCeSNQSNzp6dpPSW2rONOps6Ocam1wFhCgoVw==} + engines: {node: 18 || 20 || >=22} + minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} @@ -7210,6 +7389,10 @@ packages: resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} engines: {node: '>=16 || 14 >=14.17'} + minipass@7.1.3: + resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} + engines: {node: '>=16 || 14 >=14.17'} + minizlib@3.1.0: resolution: {integrity: sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==} engines: {node: '>= 18'} @@ -7371,6 +7554,11 @@ packages: nth-check@2.1.1: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} + nypm@0.6.5: + resolution: {integrity: sha512-K6AJy1GMVyfyMXRVB88700BJqNUkByijGJM8kEHpLdcAt+vSQAVfkWWHYzuRXHSY6xA2sNc5RjTj0p9rE2izVQ==} + engines: {node: '>=18'} + hasBin: true + object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} @@ -7434,17 +7622,17 @@ packages: resolution: {integrity: sha512-vfs0oVJAAgX8GrZ5jO1sQp29c4HYSZ4MTtievyqawSeNpqF0yj69tpAwpDZ+MxYt3dqZ8lrGh9Ji80YlG0hpoA==} engines: {node: '>=14.0.0'} - oxfmt@0.23.0: - resolution: {integrity: sha512-dh4rlNBua93aVf2ZaDecbQxVLMnUUTvDi1K1fdvBdontQeEf6K22Z1KQg5QKl2D9aNFeFph+wOVwcjjYUIO6Mw==} + oxfmt@0.34.0: + resolution: {integrity: sha512-t+zTE4XGpzPTK+Zk9gSwcJcFi4pqjl6PwO/ZxPBJiJQ2XCKMucwjPlHxvPHyVKJtkMSyrDGfQ7Ntg/hUr4OgHQ==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true - oxlint@1.43.0: - resolution: {integrity: sha512-xiqTCsKZch+R61DPCjyqUVP2MhkQlRRYxLRBeBDi+dtQJ90MOgdcjIktvDCgXz0bgtx94EQzHEndsizZjMX2OA==} + oxlint@1.49.0: + resolution: {integrity: sha512-YZffp0gM+63CJoRhHjtjRnwKtAgUnXM6j63YQ++aigji2NVvLGsUlrXo9gJUXZOdcbfShLYtA6RuTu8GZ4lzOQ==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: - oxlint-tsgolint: '>=0.11.2' + oxlint-tsgolint: '>=0.14.1' peerDependenciesMeta: oxlint-tsgolint: optional: true @@ -7572,6 +7760,10 @@ packages: resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} engines: {node: '>=16 || 14 >=14.18'} + path-scurry@2.0.2: + resolution: {integrity: sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==} + engines: {node: 18 || 20 || >=22} + path-to-regexp@8.3.0: resolution: {integrity: sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==} @@ -8141,6 +8333,9 @@ packages: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} + sisteransi@1.0.5: + resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + skin-tone@2.0.0: resolution: {integrity: sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==} engines: {node: '>=8'} @@ -8399,8 +8594,8 @@ packages: tinygradient@1.1.5: resolution: {integrity: sha512-8nIfc2vgQ4TeLnk2lFj4tRLvvJwEfQuabdsmvDdQPT0xlk9TaNtpGd6nNRxXoK6vQhN6RSzj+Cnp5tTQmpxmbw==} - tinypool@2.0.0: - resolution: {integrity: sha512-/RX9RzeH2xU5ADE7n2Ykvmi9ED3FBGPAjw9u3zucrNNaEBIO0HPSYgL0NT7+3p147ojeSdaVu08F6hjpv31HJg==} + tinypool@2.1.0: + resolution: {integrity: sha512-Pugqs6M0m7Lv1I7FtxN4aoyToKg1C4tu+/381vH35y8oENM/Ai7f7C4StcoK4/+BSw9ebcS8jRiVrORFKCALLw==} engines: {node: ^20.0.0 || >=22.0.0} title-case@2.1.1: @@ -8606,6 +8801,15 @@ packages: uhyphen@0.2.0: resolution: {integrity: sha512-qz3o9CHXmJJPGBdqzab7qAYuW8kQGKNEuoHFYrBwV6hWIMcpAmxDLXojcHfFr9US1Pe6zUswEIJIbLI610fuqA==} + ultracite@7.2.3: + resolution: {integrity: sha512-WKNS2sKAZe4BHu+JGbZebXvy/A1QagDaBnndrK/zwOJAze/mQ8jeHfdG2bPlv3qcJ5fdS3w2Kd7c/eIcH78HvA==} + hasBin: true + peerDependencies: + oxlint: ^1.0.0 + peerDependenciesMeta: + oxlint: + optional: true + unconfig-core@7.4.2: resolution: {integrity: sha512-VgPCvLWugINbXvMQDf8Jh0mlbvNjNC6eSUziHsBCMpxR05OPrNrvDnyatdMjRgcHaaNsCqz+wjNXxNw1kRLHUg==} @@ -9273,6 +9477,17 @@ snapshots: '@chevrotain/utils@11.0.3': {} + '@clack/core@1.0.1': + dependencies: + picocolors: 1.0.1 + sisteransi: 1.0.5 + + '@clack/prompts@1.0.1': + dependencies: + '@clack/core': 1.0.1 + picocolors: 1.0.1 + sisteransi: 1.0.5 + '@colors/colors@1.5.0': optional: true @@ -10259,52 +10474,118 @@ snapshots: '@oxc-transform/binding-win32-x64-msvc@0.66.0': optional: true - '@oxfmt/darwin-arm64@0.23.0': + '@oxfmt/binding-android-arm-eabi@0.34.0': + optional: true + + '@oxfmt/binding-android-arm64@0.34.0': + optional: true + + '@oxfmt/binding-darwin-arm64@0.34.0': + optional: true + + '@oxfmt/binding-darwin-x64@0.34.0': + optional: true + + '@oxfmt/binding-freebsd-x64@0.34.0': + optional: true + + '@oxfmt/binding-linux-arm-gnueabihf@0.34.0': + optional: true + + '@oxfmt/binding-linux-arm-musleabihf@0.34.0': + optional: true + + '@oxfmt/binding-linux-arm64-gnu@0.34.0': + optional: true + + '@oxfmt/binding-linux-arm64-musl@0.34.0': + optional: true + + '@oxfmt/binding-linux-ppc64-gnu@0.34.0': + optional: true + + '@oxfmt/binding-linux-riscv64-gnu@0.34.0': + optional: true + + '@oxfmt/binding-linux-riscv64-musl@0.34.0': + optional: true + + '@oxfmt/binding-linux-s390x-gnu@0.34.0': + optional: true + + '@oxfmt/binding-linux-x64-gnu@0.34.0': + optional: true + + '@oxfmt/binding-linux-x64-musl@0.34.0': + optional: true + + '@oxfmt/binding-openharmony-arm64@0.34.0': + optional: true + + '@oxfmt/binding-win32-arm64-msvc@0.34.0': + optional: true + + '@oxfmt/binding-win32-ia32-msvc@0.34.0': + optional: true + + '@oxfmt/binding-win32-x64-msvc@0.34.0': + optional: true + + '@oxlint/binding-android-arm-eabi@1.49.0': + optional: true + + '@oxlint/binding-android-arm64@1.49.0': + optional: true + + '@oxlint/binding-darwin-arm64@1.49.0': optional: true - '@oxfmt/darwin-x64@0.23.0': + '@oxlint/binding-darwin-x64@1.49.0': optional: true - '@oxfmt/linux-arm64-gnu@0.23.0': + '@oxlint/binding-freebsd-x64@1.49.0': optional: true - '@oxfmt/linux-arm64-musl@0.23.0': + '@oxlint/binding-linux-arm-gnueabihf@1.49.0': optional: true - '@oxfmt/linux-x64-gnu@0.23.0': + '@oxlint/binding-linux-arm-musleabihf@1.49.0': optional: true - '@oxfmt/linux-x64-musl@0.23.0': + '@oxlint/binding-linux-arm64-gnu@1.49.0': optional: true - '@oxfmt/win32-arm64@0.23.0': + '@oxlint/binding-linux-arm64-musl@1.49.0': optional: true - '@oxfmt/win32-x64@0.23.0': + '@oxlint/binding-linux-ppc64-gnu@1.49.0': optional: true - '@oxlint/darwin-arm64@1.43.0': + '@oxlint/binding-linux-riscv64-gnu@1.49.0': optional: true - '@oxlint/darwin-x64@1.43.0': + '@oxlint/binding-linux-riscv64-musl@1.49.0': optional: true - '@oxlint/linux-arm64-gnu@1.43.0': + '@oxlint/binding-linux-s390x-gnu@1.49.0': optional: true - '@oxlint/linux-arm64-musl@1.43.0': + '@oxlint/binding-linux-x64-gnu@1.49.0': optional: true - '@oxlint/linux-x64-gnu@1.43.0': + '@oxlint/binding-linux-x64-musl@1.49.0': optional: true - '@oxlint/linux-x64-musl@1.43.0': + '@oxlint/binding-openharmony-arm64@1.49.0': optional: true - '@oxlint/win32-arm64@1.43.0': + '@oxlint/binding-win32-arm64-msvc@1.49.0': optional: true - '@oxlint/win32-x64@1.43.0': + '@oxlint/binding-win32-ia32-msvc@1.49.0': + optional: true + + '@oxlint/binding-win32-x64-msvc@1.49.0': optional: true '@pkgjs/parseargs@0.11.0': @@ -12428,6 +12709,8 @@ snapshots: balanced-match@1.0.2: {} + balanced-match@4.0.3: {} + bare-events@2.8.2: {} baseline-browser-mapping@2.9.19: {} @@ -12464,6 +12747,10 @@ snapshots: dependencies: balanced-match: 1.0.2 + brace-expansion@5.0.2: + dependencies: + balanced-match: 4.0.3 + braces@3.0.3: dependencies: fill-range: 7.1.1 @@ -12650,6 +12937,8 @@ snapshots: ci-info@4.4.0: {} + citty@0.2.1: {} + cjs-module-lexer@1.4.3: {} cjs-module-lexer@2.2.0: {} @@ -13866,6 +14155,12 @@ snapshots: package-json-from-dist: 1.0.1 path-scurry: 1.11.1 + glob@13.0.6: + dependencies: + minimatch: 10.2.2 + minipass: 7.1.3 + path-scurry: 2.0.2 + glob@7.2.3: dependencies: fs.realpath: 1.0.0 @@ -14747,6 +15042,8 @@ snapshots: jsonc-parser@3.2.0: {} + jsonc-parser@3.3.1: {} + jsonfile@4.0.0: optionalDependencies: graceful-fs: 4.2.11 @@ -15534,6 +15831,10 @@ snapshots: dependencies: '@isaacs/brace-expansion': 5.0.1 + minimatch@10.2.2: + dependencies: + brace-expansion: 5.0.2 + minimatch@3.1.2: dependencies: brace-expansion: 1.1.12 @@ -15554,6 +15855,8 @@ snapshots: minipass@7.1.2: {} + minipass@7.1.3: {} + minizlib@3.1.0: dependencies: minipass: 7.1.2 @@ -15705,6 +16008,12 @@ snapshots: dependencies: boolbase: 1.0.0 + nypm@0.6.5: + dependencies: + citty: 0.2.1 + pathe: 2.0.3 + tinyexec: 1.0.2 + object-assign@4.1.1: {} object-inspect@1.13.4: {} @@ -15819,29 +16128,51 @@ snapshots: '@oxc-transform/binding-win32-arm64-msvc': 0.66.0 '@oxc-transform/binding-win32-x64-msvc': 0.66.0 - oxfmt@0.23.0: + oxfmt@0.34.0: dependencies: - tinypool: 2.0.0 + tinypool: 2.1.0 optionalDependencies: - '@oxfmt/darwin-arm64': 0.23.0 - '@oxfmt/darwin-x64': 0.23.0 - '@oxfmt/linux-arm64-gnu': 0.23.0 - '@oxfmt/linux-arm64-musl': 0.23.0 - '@oxfmt/linux-x64-gnu': 0.23.0 - '@oxfmt/linux-x64-musl': 0.23.0 - '@oxfmt/win32-arm64': 0.23.0 - '@oxfmt/win32-x64': 0.23.0 - - oxlint@1.43.0: + '@oxfmt/binding-android-arm-eabi': 0.34.0 + '@oxfmt/binding-android-arm64': 0.34.0 + '@oxfmt/binding-darwin-arm64': 0.34.0 + '@oxfmt/binding-darwin-x64': 0.34.0 + '@oxfmt/binding-freebsd-x64': 0.34.0 + '@oxfmt/binding-linux-arm-gnueabihf': 0.34.0 + '@oxfmt/binding-linux-arm-musleabihf': 0.34.0 + '@oxfmt/binding-linux-arm64-gnu': 0.34.0 + '@oxfmt/binding-linux-arm64-musl': 0.34.0 + '@oxfmt/binding-linux-ppc64-gnu': 0.34.0 + '@oxfmt/binding-linux-riscv64-gnu': 0.34.0 + '@oxfmt/binding-linux-riscv64-musl': 0.34.0 + '@oxfmt/binding-linux-s390x-gnu': 0.34.0 + '@oxfmt/binding-linux-x64-gnu': 0.34.0 + '@oxfmt/binding-linux-x64-musl': 0.34.0 + '@oxfmt/binding-openharmony-arm64': 0.34.0 + '@oxfmt/binding-win32-arm64-msvc': 0.34.0 + '@oxfmt/binding-win32-ia32-msvc': 0.34.0 + '@oxfmt/binding-win32-x64-msvc': 0.34.0 + + oxlint@1.49.0: optionalDependencies: - '@oxlint/darwin-arm64': 1.43.0 - '@oxlint/darwin-x64': 1.43.0 - '@oxlint/linux-arm64-gnu': 1.43.0 - '@oxlint/linux-arm64-musl': 1.43.0 - '@oxlint/linux-x64-gnu': 1.43.0 - '@oxlint/linux-x64-musl': 1.43.0 - '@oxlint/win32-arm64': 1.43.0 - '@oxlint/win32-x64': 1.43.0 + '@oxlint/binding-android-arm-eabi': 1.49.0 + '@oxlint/binding-android-arm64': 1.49.0 + '@oxlint/binding-darwin-arm64': 1.49.0 + '@oxlint/binding-darwin-x64': 1.49.0 + '@oxlint/binding-freebsd-x64': 1.49.0 + '@oxlint/binding-linux-arm-gnueabihf': 1.49.0 + '@oxlint/binding-linux-arm-musleabihf': 1.49.0 + '@oxlint/binding-linux-arm64-gnu': 1.49.0 + '@oxlint/binding-linux-arm64-musl': 1.49.0 + '@oxlint/binding-linux-ppc64-gnu': 1.49.0 + '@oxlint/binding-linux-riscv64-gnu': 1.49.0 + '@oxlint/binding-linux-riscv64-musl': 1.49.0 + '@oxlint/binding-linux-s390x-gnu': 1.49.0 + '@oxlint/binding-linux-x64-gnu': 1.49.0 + '@oxlint/binding-linux-x64-musl': 1.49.0 + '@oxlint/binding-openharmony-arm64': 1.49.0 + '@oxlint/binding-win32-arm64-msvc': 1.49.0 + '@oxlint/binding-win32-ia32-msvc': 1.49.0 + '@oxlint/binding-win32-x64-msvc': 1.49.0 p-cancelable@2.1.1: {} @@ -15972,6 +16303,11 @@ snapshots: lru-cache: 10.4.3 minipass: 7.1.2 + path-scurry@2.0.2: + dependencies: + lru-cache: 11.2.5 + minipass: 7.1.3 + path-to-regexp@8.3.0: {} path-type@4.0.0: {} @@ -16729,6 +17065,8 @@ snapshots: signal-exit@4.1.0: {} + sisteransi@1.0.5: {} + skin-tone@2.0.0: dependencies: unicode-emoji-modifier-base: 1.0.0 @@ -17001,7 +17339,7 @@ snapshots: '@types/tinycolor2': 1.4.6 tinycolor2: 1.6.0 - tinypool@2.0.0: {} + tinypool@2.1.0: {} title-case@2.1.1: dependencies: @@ -17186,6 +17524,17 @@ snapshots: uhyphen@0.2.0: {} + ultracite@7.2.3(oxlint@1.49.0): + dependencies: + '@clack/prompts': 1.0.1 + commander: 14.0.3 + deepmerge: 4.3.1 + glob: 13.0.6 + jsonc-parser: 3.3.1 + nypm: 0.6.5 + optionalDependencies: + oxlint: 1.49.0 + unconfig-core@7.4.2: dependencies: '@quansync/fs': 1.0.0 diff --git a/skills/turborepo/references/best-practices/RULE.md b/skills/turborepo/references/best-practices/RULE.md index d2f52808ef6ed..4870784d22795 100644 --- a/skills/turborepo/references/best-practices/RULE.md +++ b/skills/turborepo/references/best-practices/RULE.md @@ -192,10 +192,10 @@ export * from './modal'; ```typescript // BAD: Reaching into another package -import { Button } from '../../packages/ui/src/button'; +import { Button } from "../../packages/ui/src/button"; // GOOD: Install and import properly -import { Button } from '@repo/ui/button'; +import { Button } from "@repo/ui/button"; ``` ### Shared Code in Apps diff --git a/skills/turborepo/references/best-practices/dependencies.md b/skills/turborepo/references/best-practices/dependencies.md index 7a6fd2b8a51ce..90902e2970cb2 100644 --- a/skills/turborepo/references/best-practices/dependencies.md +++ b/skills/turborepo/references/best-practices/dependencies.md @@ -161,7 +161,7 @@ catalog: // Any package.json { "dependencies": { - "react": "catalog:" // Uses version from catalog + "react": "catalog:" // Uses version from catalog } } ``` @@ -200,7 +200,7 @@ For library packages that expect the consumer to provide dependencies: "react-dom": "^18.0.0" }, "devDependencies": { - "react": "^18.0.0", // For development/testing + "react": "^18.0.0", // For development/testing "react-dom": "^18.0.0" } } diff --git a/skills/turborepo/references/best-practices/packages.md b/skills/turborepo/references/best-practices/packages.md index 29800a13d830d..85cdf040e4460 100644 --- a/skills/turborepo/references/best-practices/packages.md +++ b/skills/turborepo/references/best-practices/packages.md @@ -93,9 +93,9 @@ Package handles its own compilation. ```json { "exports": { - ".": "./src/index.ts", // @repo/ui - "./button": "./src/button.tsx", // @repo/ui/button - "./card": "./src/card.tsx", // @repo/ui/card + ".": "./src/index.ts", // @repo/ui + "./button": "./src/button.tsx", // @repo/ui/button + "./card": "./src/card.tsx", // @repo/ui/card "./hooks": "./src/hooks/index.ts" // @repo/ui/hooks } } @@ -124,7 +124,7 @@ Package handles its own compilation. // apps/web/package.json { "dependencies": { - "@repo/ui": "workspace:*" // pnpm/bun + "@repo/ui": "workspace:*" // pnpm/bun // "@repo/ui": "*" // npm/yarn } } @@ -287,7 +287,7 @@ TypeScript `compilerOptions.paths` breaks with JIT packages. Use Node.js subpath ```typescript // packages/ui/button.tsx -import { MY_STRING } from "#utils.ts"; // Uses .ts extension +import { MY_STRING } from "#utils.ts"; // Uses .ts extension ``` **Compiled Package:** @@ -303,7 +303,7 @@ import { MY_STRING } from "#utils.ts"; // Uses .ts extension ```typescript // packages/ui/button.tsx -import { MY_STRING } from "#utils.js"; // Uses .js extension +import { MY_STRING } from "#utils.js"; // Uses .js extension ``` ### Use `tsc` for Internal Packages diff --git a/skills/turborepo/references/best-practices/structure.md b/skills/turborepo/references/best-practices/structure.md index 8e31de314202f..57c01e684ceae 100644 --- a/skills/turborepo/references/best-practices/structure.md +++ b/skills/turborepo/references/best-practices/structure.md @@ -124,8 +124,8 @@ You can group packages by adding more workspace paths: packages: - "apps/*" - "packages/*" - - "packages/config/*" # Grouped configs - - "packages/features/*" # Feature packages + - "packages/config/*" # Grouped configs + - "packages/features/*" # Feature packages ``` This allows: @@ -148,7 +148,7 @@ packages/ ```yaml # BAD: Nested wildcards cause ambiguous behavior packages: - - "packages/**" # Don't do this! + - "packages/**" # Don't do this! ``` ## Package Anatomy @@ -167,10 +167,11 @@ packages/ui/ ```json { - "name": "@repo/ui", // Unique, namespaced name - "version": "0.0.0", // Version (can be 0.0.0 for internal) - "private": true, // Prevents accidental publishing - "exports": { // Entry points + "name": "@repo/ui", // Unique, namespaced name + "version": "0.0.0", // Version (can be 0.0.0 for internal) + "private": true, // Prevents accidental publishing + "exports": { + // Entry points "./button": "./src/button.tsx" } } @@ -254,7 +255,7 @@ packages/ ```js // apps/web/.eslintrc.js module.exports = { - extends: ["@repo/eslint-config/next"], + extends: ["@repo/eslint-config/next"] }; ``` diff --git a/skills/turborepo/references/caching/gotchas.md b/skills/turborepo/references/caching/gotchas.md index 17d44995f0cb0..695c783ee1dc9 100644 --- a/skills/turborepo/references/caching/gotchas.md +++ b/skills/turborepo/references/caching/gotchas.md @@ -109,7 +109,7 @@ Task uses an env var not listed in `env`: ```javascript // build.js -const apiUrl = process.env.API_URL; // not tracked! +const apiUrl = process.env.API_URL; // not tracked! ``` Fix: add to task config: @@ -134,7 +134,7 @@ Task reads a file outside default inputs: "build": { "inputs": [ "$TURBO_DEFAULT$", - "../../shared-config.json" // file outside package + "../../shared-config.json" // file outside package ] } } diff --git a/skills/turborepo/references/ci/RULE.md b/skills/turborepo/references/ci/RULE.md index 0e21933fd031b..f331c2cf66064 100644 --- a/skills/turborepo/references/ci/RULE.md +++ b/skills/turborepo/references/ci/RULE.md @@ -49,7 +49,7 @@ This requires Git history to compute what changed. # GitHub Actions - uses: actions/checkout@v4 with: - fetch-depth: 2 # Minimum for --affected + fetch-depth: 2 # Minimum for --affected # Use 0 for full history if merge base is far ``` @@ -60,7 +60,7 @@ Turborepo compares the current HEAD to the merge base with `main`. If that commi For PRs with many commits, consider: ```yaml -fetch-depth: 0 # Full history +fetch-depth: 0 # Full history ``` ## Environment Variables Reference diff --git a/skills/turborepo/references/ci/github-actions.md b/skills/turborepo/references/ci/github-actions.md index 7e5d4ccc4c752..1cdb34f33f1d0 100644 --- a/skills/turborepo/references/ci/github-actions.md +++ b/skills/turborepo/references/ci/github-actions.md @@ -44,7 +44,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 20 - cache: 'pnpm' + cache: "pnpm" - run: pnpm install --frozen-lockfile ``` @@ -55,7 +55,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 20 - cache: 'yarn' + cache: "yarn" - run: yarn install --frozen-lockfile ``` @@ -146,7 +146,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 20 - cache: 'pnpm' + cache: "pnpm" - name: Install dependencies run: pnpm install --frozen-lockfile diff --git a/skills/turborepo/references/configuration/RULE.md b/skills/turborepo/references/configuration/RULE.md index 1edb07d2d8edd..33327b1f85ca2 100644 --- a/skills/turborepo/references/configuration/RULE.md +++ b/skills/turborepo/references/configuration/RULE.md @@ -188,7 +188,7 @@ Use `extends: false` to exclude a task from a package: "extends": ["//"], "tasks": { "e2e": { - "extends": false // UI package doesn't have e2e tests + "extends": false // UI package doesn't have e2e tests } } } diff --git a/skills/turborepo/references/environment/gotchas.md b/skills/turborepo/references/environment/gotchas.md index eff77a447568a..e25f145056399 100644 --- a/skills/turborepo/references/environment/gotchas.md +++ b/skills/turborepo/references/environment/gotchas.md @@ -118,11 +118,7 @@ If you use `.env.development` and `.env.production`, both should be in inputs. "tasks": { "build": { "dependsOn": ["^build"], - "env": [ - "DATABASE_URL", - "NEXT_PUBLIC_*", - "!NEXT_PUBLIC_ANALYTICS_ID" - ], + "env": ["DATABASE_URL", "NEXT_PUBLIC_*", "!NEXT_PUBLIC_ANALYTICS_ID"], "passThroughEnv": ["SENTRY_AUTH_TOKEN"], "inputs": [ "$TURBO_DEFAULT$", diff --git a/turborepo-tests/integration/fixtures/boundaries/apps/my-app/tsconfig.json b/turborepo-tests/integration/fixtures/boundaries/apps/my-app/tsconfig.json index b0d4a7b0783dc..b835cde1e71e8 100644 --- a/turborepo-tests/integration/fixtures/boundaries/apps/my-app/tsconfig.json +++ b/turborepo-tests/integration/fixtures/boundaries/apps/my-app/tsconfig.json @@ -5,6 +5,7 @@ "./*" ], "!": ["../../packages/another/index.jsx"] - } + }, + "strictNullChecks": true } } \ No newline at end of file diff --git a/turborepo-tests/integration/fixtures/turbo_trace/tsconfig.json b/turborepo-tests/integration/fixtures/turbo_trace/tsconfig.json index 51d884f8a82d0..687c92b33af6e 100644 --- a/turborepo-tests/integration/fixtures/turbo_trace/tsconfig.json +++ b/turborepo-tests/integration/fixtures/turbo_trace/tsconfig.json @@ -4,6 +4,7 @@ "@*": [ ".*" ] - } + }, + "strictNullChecks": true } } \ No newline at end of file diff --git a/turborepo-tests/integration/fixtures/turbo_trace_monorepo/apps/my-app/tsconfig.json b/turborepo-tests/integration/fixtures/turbo_trace_monorepo/apps/my-app/tsconfig.json index c199498e2ce9f..1d261b3a47884 100644 --- a/turborepo-tests/integration/fixtures/turbo_trace_monorepo/apps/my-app/tsconfig.json +++ b/turborepo-tests/integration/fixtures/turbo_trace_monorepo/apps/my-app/tsconfig.json @@ -4,6 +4,7 @@ "@/*": [ "./*" ] - } + }, + "strictNullChecks": true } } \ No newline at end of file