diff --git a/crates/turborepo-lib/src/boundaries/mod.rs b/crates/turborepo-lib/src/boundaries/mod.rs index 8dc6fde012914..ce3d4866c7a00 100644 --- a/crates/turborepo-lib/src/boundaries/mod.rs +++ b/crates/turborepo-lib/src/boundaries/mod.rs @@ -434,6 +434,7 @@ impl Run { } else { Syntax::Es(EsSyntax { jsx: true, + import_attributes: true, ..Default::default() }) }; diff --git a/crates/turborepo/tests/snapshots/boundaries__boundaries_get_boundaries_lints_(npm@10.5.0).snap b/crates/turborepo/tests/snapshots/boundaries__boundaries_get_boundaries_lints_(npm@10.5.0).snap index 11af823ba0c75..c47bb0e7fb266 100644 --- a/crates/turborepo/tests/snapshots/boundaries__boundaries_get_boundaries_lints_(npm@10.5.0).snap +++ b/crates/turborepo/tests/snapshots/boundaries__boundaries_get_boundaries_lints_(npm@10.5.0).snap @@ -26,6 +26,10 @@ expression: query_output "message": "import `../../packages/another/index.jsx` leaves the package", "import": "../../packages/another/index.jsx" }, + { + "message": "import `../../packages/utils/data.json` leaves the package", + "import": "../../packages/utils/data.json" + }, { "message": "import `@/../../packages/another/index.jsx` leaves the package", "import": "@/../../packages/another/index.jsx" diff --git a/turborepo-tests/integration/fixtures/boundaries/apps/my-app/import-attributes.js b/turborepo-tests/integration/fixtures/boundaries/apps/my-app/import-attributes.js new file mode 100644 index 0000000000000..cb53488f8d255 --- /dev/null +++ b/turborepo-tests/integration/fixtures/boundaries/apps/my-app/import-attributes.js @@ -0,0 +1,6 @@ +// Test import attributes parsing +import pkg from './package.json' with { type: 'json' }; +import data from '../../packages/utils/data.json' with { type: 'json' }; + +console.log(pkg.name); +console.log(data); diff --git a/turborepo-tests/integration/fixtures/boundaries/packages/utils/data.json b/turborepo-tests/integration/fixtures/boundaries/packages/utils/data.json new file mode 100644 index 0000000000000..47e9a07af0d5c --- /dev/null +++ b/turborepo-tests/integration/fixtures/boundaries/packages/utils/data.json @@ -0,0 +1,4 @@ +{ + "name": "test-data", + "value": 42 +} diff --git a/turborepo-tests/integration/tests/command-boundaries.t b/turborepo-tests/integration/tests/command-boundaries.t deleted file mode 100644 index a93dcbc13c810..0000000000000 --- a/turborepo-tests/integration/tests/command-boundaries.t +++ /dev/null @@ -1,41 +0,0 @@ -Setup - $ . ${TESTDIR}/../../helpers/setup_integration_test.sh boundaries - -Ignore all errors - $ ${TURBO} boundaries --ignore=all - Checking packages... - patching apps(\\|/)my-app(\\|/)(index|types).ts (re) - patching apps(\\|/)my-app(\\|/)(index|types).ts (re) - [1] - - $ git diff - diff --git a/apps/my-app/index.ts b/apps/my-app/index.ts - index 6baec29..d4c7af6 100644 - --- a/apps/my-app/index.ts - +++ b/apps/my-app/index.ts - @@ -1,9 +1,13 @@ - // Import directly from a file instead of via package name - +// @boundaries-ignore automatically added by `turbo boundaries --ignore=all` - import { blackbeard } from "../../packages/another/index.jsx"; - // Import type without "type" specifier in import - +// @boundaries-ignore automatically added by `turbo boundaries --ignore=all` - import { Ship } from "ship"; - +// @boundaries-ignore automatically added by `turbo boundaries --ignore=all` - import { Ship } from "@types/ship"; - // Import package that is not specified - +// @boundaries-ignore automatically added by `turbo boundaries --ignore=all` - import { walkThePlank } from "module-package"; - - // Import from a package that is not specified, but we have `@boundaries-ignore` on it - diff --git a/apps/my-app/types.ts b/apps/my-app/types.ts - index ce28692..3615d9c 100644 - --- a/apps/my-app/types.ts - +++ b/apps/my-app/types.ts - @@ -1,4 +1,6 @@ - +// @boundaries-ignore automatically added by `turbo boundaries --ignore=all` - import { blackbeard } from "@/../../packages/another/index.jsx"; - +// @boundaries-ignore automatically added by `turbo boundaries --ignore=all` - import { blackbead } from "!"; - - export interface Pirate { -