@shivaedev/quality 0.41.0 → 0.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +12 -8
  3. package/biome/plugins/effect-test-bodies.grit +1 -1
  4. package/dist/appTestConfig.js +1 -1
  5. package/dist/appTestConfig.js.map +1 -1
  6. package/dist/biome/withoutEntryPointImports.d.ts +4 -0
  7. package/dist/biome/withoutEntryPointImports.d.ts.map +1 -0
  8. package/dist/biome/withoutEntryPointImports.js +46 -0
  9. package/dist/biome/withoutEntryPointImports.js.map +1 -0
  10. package/dist/imports/pnpmWorkspacePatterns.d.ts +1 -0
  11. package/dist/imports/pnpmWorkspacePatterns.d.ts.map +1 -1
  12. package/dist/imports/pnpmWorkspacePatterns.js +28 -22
  13. package/dist/imports/pnpmWorkspacePatterns.js.map +1 -1
  14. package/dist/imports/runtime.d.ts +6 -0
  15. package/dist/imports/runtime.d.ts.map +1 -1
  16. package/dist/imports/runtime.js +54 -8
  17. package/dist/imports/runtime.js.map +1 -1
  18. package/dist/manifests/entryPoints.d.ts +15 -0
  19. package/dist/manifests/entryPoints.d.ts.map +1 -0
  20. package/dist/manifests/entryPoints.js +60 -0
  21. package/dist/manifests/entryPoints.js.map +1 -0
  22. package/dist/rules/biome.d.ts.map +1 -1
  23. package/dist/rules/biome.js +4 -2
  24. package/dist/rules/biome.js.map +1 -1
  25. package/dist/rules/builtIn.d.ts +1 -1
  26. package/dist/rules/builtIn.d.ts.map +1 -1
  27. package/dist/rules/builtIn.js +2 -0
  28. package/dist/rules/builtIn.js.map +1 -1
  29. package/dist/rules/imports/fences.d.ts +1 -1
  30. package/dist/rules/imports/manifest.d.ts.map +1 -1
  31. package/dist/rules/imports/manifest.js +27 -14
  32. package/dist/rules/imports/manifest.js.map +1 -1
  33. package/dist/rules/imports/runtime.d.ts.map +1 -1
  34. package/dist/rules/imports/runtime.js +10 -4
  35. package/dist/rules/imports/runtime.js.map +1 -1
  36. package/dist/rules/manifestsApplication.d.ts +2 -0
  37. package/dist/rules/manifestsApplication.d.ts.map +1 -0
  38. package/dist/rules/manifestsApplication.js +99 -0
  39. package/dist/rules/manifestsApplication.js.map +1 -0
  40. package/dist/rules/manifestsExportsShape.d.ts.map +1 -1
  41. package/dist/rules/manifestsExportsShape.js +5 -2
  42. package/dist/rules/manifestsExportsShape.js.map +1 -1
  43. package/dist/rules/stories/engineOf.js +1 -1
  44. package/dist/rules/stories/engineOf.js.map +1 -1
  45. package/dist/rules/test-names/colocated.d.ts.map +1 -1
  46. package/dist/rules/test-names/colocated.js +10 -6
  47. package/dist/rules/test-names/colocated.js.map +1 -1
  48. package/package.json +1 -1
  49. package/src/appTestConfig.ts +1 -1
  50. package/src/biome/withoutEntryPointImports.ts +52 -0
  51. package/src/imports/pnpmWorkspacePatterns.ts +29 -22
  52. package/src/imports/runtime.ts +69 -9
  53. package/src/manifests/entryPoints.ts +87 -0
  54. package/src/rules/biome.ts +4 -2
  55. package/src/rules/builtIn.ts +2 -0
  56. package/src/rules/imports/manifest.ts +42 -14
  57. package/src/rules/imports/runtime.ts +10 -4
  58. package/src/rules/manifestsApplication.ts +117 -0
  59. package/src/rules/manifestsExportsShape.ts +6 -2
  60. package/src/rules/stories/engineOf.ts +1 -1
  61. package/src/rules/test-names/colocated.ts +13 -6
  62. package/tsconfig/package.json +2 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.42.0 - 2026-10-27
4
+
5
+ ### Added
6
+
7
+ - A package whose code all runs in one runtime declares it in its manifest with `"quality": { "runtime": "server" }` or `"client"`. `imports/runtime` then treats every source file as that runtime without `src/server/` or `src/client/` folders, and reports a declaration beside runtime folders or an unknown value on the manifest.
8
+ - `manifests/exports-shape` accepts a package without modules, such as a dependency shell, whose exports hold only exact assets like `./package.json`.
9
+ - Applications, packages that depend on `@shivaedev/platform`, import the pieces their entry points bring by their own names: `imports/manifest` and the `biome` rule's undeclared-dependency check accept a piece that `@shivaedev/platform` brings for any code or `@shivaedev/test-story` brings for test code, and a private package missing that entry point is told which one to add.
10
+ - `manifests/application` asks an application for `publicHoistPattern: ["@shivaedev/*"]` in its nearest `pnpm-workspace.yaml` and rejects a dependency entry beside the entry point that already brings it.
11
+
12
+ ### Changed
13
+
14
+ - `@shivaedev/quality/tsconfig/package.json` resolves modules as `NodeNext`, so package builds emit declarations whose relative imports name resolvable files. Remove per-package `module` and `moduleResolution` overrides from build configs; type-checking through `tsconfig/base.json` is unchanged.
15
+ - `appTestConfig` inlines every `@shivaedev` package for the test server instead of `@shivaedev/platform` alone, because an application now imports each framework piece by its own name.
16
+
17
+ ## 0.41.1 - 2026-10-26
18
+
19
+ ### Changed
20
+
21
+ - Treat `test`, `tests` and `spec` as test folders only when their directly contained checked files are all tests or test support, allowing colocated specs in product folders that also contain source. `__tests__` remains a test folder everywhere.
22
+
3
23
  ## 0.41.0 - 2026-10-26
4
24
 
5
25
  ### Added
package/README.md CHANGED
@@ -102,11 +102,15 @@ An app says where its code runs through folder names. A package adopts the runti
102
102
 
103
103
  `imports/runtime` rejects client imports of server code or Node built-ins. Shared code may import neither client nor server code, use browser globals such as `window`, `document` or `localStorage`, or import Node built-ins. Both client and server code may import shared code. The check includes type imports and re-exports and resolves aliases through the shared import graph. Locally bound names and property names are not browser globals; portable web APIs such as `URL`, `fetch` and `AbortController` remain available to shared code. Test files and `test-support/` ship nowhere and are outside this runtime policy.
104
104
 
105
- A package with a nonempty `bin` entry and no runtime folders is server code throughout. Runtime folders take precedence when a package also ships browser code. A Node library without a CLI uses `src/server/`; `engines.node` alone does not say that a package is Node-only. Packages without runtime folders or a `bin` entry retain their existing source policies. Existing explicit fences continue to run in every package. Runtime folders are detected independently of `sources`, including empty folders; `sources` still selects the code that is checked.
105
+ A package whose code all runs in one runtime declares it in its manifest instead of nesting everything in one folder: `"quality": { "runtime": "server" }` makes every source file server code, and `"client"` makes every file browser code. Package-root tooling stays server code. A declaration beside `src/client/` or `src/server/` is reported on the manifest, as is any value other than `"client"` or `"server"`; choose one convention per package.
106
+
107
+ A package with a nonempty `bin` entry and no runtime folders is server code throughout. Runtime folders take precedence when a package also ships browser code. A Node library without a CLI declares `"runtime": "server"` or uses `src/server/`; `engines.node` alone does not say that a package is Node-only. Packages without runtime folders or a `bin` entry retain their existing source policies. Existing explicit fences continue to run in every package. Runtime folders are detected independently of `sources`, including empty folders; `sources` still selects the code that is checked.
106
108
 
107
109
  Tooling is server code in every package, including the workspace root: files under its top-level `script/`, `scripts/` and `tooling/` folders, and top-level JavaScript or TypeScript config files such as `vitest.config.ts`. A tooling folder or config file nested under `src/` follows the source runtime policy. Browser and shared code cannot import package-root tooling.
108
110
 
109
- The manifest owns ordinary workspace dependencies. When a package promises more, put `quality.fences.config.ts` beside its `package.json`, exporting an array of fences as the default. Quality discovers this file at the repository root and in workspace packages, even when `sources` includes only their source folders. The root config does not list boundary files.
111
+ The manifest owns ordinary workspace dependencies. An **application** is a package whose manifest depends on `@shivaedev/platform`, the dependency shell that brings every runtime piece of the ShivaeDev framework. It imports each piece by its own name without listing it: `imports/manifest` and the `biome` rule's undeclared-dependency check count an import as declared when an entry point the application declares lists the piece among its dependencies. `@shivaedev/platform` is the entry point for any code and `@shivaedev/test-story` for test code, tooling and test support only. When a private package's import would be covered by an entry point it lacks, the finding names the entry point to add. `manifests/application` asks an application for `publicHoistPattern: ["@shivaedev/*"]` in the nearest `pnpm-workspace.yaml`, searching upward from the package, because pnpm does not link the pieces where the application can resolve them otherwise. It also rejects a dependency entry beside the entry point that already brings it, such as `@shivaedev/sql` beside `@shivaedev/platform`, and names the entry to remove. A library never depends on platform, so it declares every piece it imports.
112
+
113
+ When a package promises more, put `quality.fences.config.ts` beside its `package.json`, exporting an array of fences as the default. Quality discovers this file at the repository root and in workspace packages, even when `sources` includes only their source folders. The root config does not list boundary files.
110
114
 
111
115
  A **fence** is a prohibition on imports, with a reason and one illegal and one legal example. Quality validates all discovered fences together, so duplicate names or contradictory examples stop the run. An unreadable file or invalid default export also stops the run. Fences remain an internal `imports/fences` module of Quality and use its shared import graph, resolver and report.
112
116
 
@@ -217,10 +221,10 @@ Git calls `quality baseline merge <ancestor> <current> <other>`. Entries are key
217
221
  - **Structure:** `structure/max-lines` allows 150 lines in a source file and 300 in test code, `nesting/max-depth` rejects lines indented eight tabs deep, and `structure/no-barrel` rejects `index` modules. The preset rejects every re-export, types included; when `noExportedImports` suggests `export … from`, import the name where it is used instead. A module does one job.
218
222
  - **Comments:** the `comments/*` rules reject JSDoc, TODOs, banners, line and pull request references, environment pragmas and more than two comments per file. A comment says why, never what the code already says or what it used to be. A tool pragma such as `@jsxImportSource` counts as a comment until both `comments/no-jsdoc` and `comments/max-per-file` list its tag in their `allow` option.
219
223
  - **Suppressions:** the `suppressions/*` rules reject inline lint and compiler directives, casts through `unknown`, `any` or `never`, Biome settings that weaken a check, recommended Biome rules the preset leaves below `error`, and `ignoreDeprecations`. None of them takes exceptions. A type test (`*.typecheck.test.ts`) may use `@ts-expect-error`; a test that must pass a rejected value at run time calls the API through `Reflect.apply`.
220
- - **Imports:** cycles, unresolvable imports, workspace imports missing from the manifest, relative imports that leave their folder, production imports of test code, runtime folders and fences, as described above.
224
+ - **Imports:** cycles, unresolvable imports, workspace imports missing from the manifest or an entry point, relative imports that leave their folder, production imports of test code, runtime folders and fences, as described above.
221
225
  - **Names and files:** the Biome preset's naming rules and plugins, and the `files/*` rules, which name a file after its main export with its folders as the prefix. No naming rule renames anything; the author picks the name. A name an outside system owns, such as a query parameter or an environment variable, is written as a quoted key, which the naming rules skip. A `Schema.Struct` field stays camelCase even when quoted and maps to the outside name with `Schema.encodeKeys`. Biome's naming messages print only a pattern: spell acronyms as words (`HttpClient`, `userId`, `parseUrl`) rather than turning off `strictCase` as its hint suggests, give a type no `I` prefix, and name a type parameter `T`, `T` plus a PascalCase name (`TItem`), or Effect's `A`, `E` and `R`. No rule checks these, so review does: a boolean reads as a question (`isOpen`, `canRetry`) unless the DOM or React names it (`open`, `disabled`); a schema shares its name with its type (`type Item = typeof Item.Type`); an unused parameter is removed rather than renamed with the `_` prefix TypeScript accepts. The naming rules take repository facts: `toolOwned` lists `.gitignore` patterns whose names a tool fixes, and a configured list extends the rule's defaults, so list only repository-specific additions; `content` lists snake_case content folders and files; `tests/follow` and `tests/colocated` take `suites` for test folders with their own layout, such as a Playwright suite.
222
- - **Tests:** `tests/follow` and `tests/colocated` keep a test beside the code it covers, named `<file>[.<modifier>].test.ts` or `<behaviour>[.<modifier>].spec.ts` with at most one modifier of `dom`, `slow`, `typecheck` and `unit`; a unit test runs without the DOM, so `.unit.dom` is rejected. The story rules above keep setup in the kit.
223
- - **Manifests:** `manifests/sorted` keeps every `package.json` in sort-package-json order, and `manifests/source-first` puts the `source` condition first in `exports` and `imports`. `manifests/exports-shape` checks the package root and workspace members with exports. They use one file-preserving TypeScript wildcard: for example, `./*.ts` maps to `./src/*.ts`, `./dist/*.d.ts` and `./dist/*.js` under `source`, `types` and `default`. A subtree pattern such as `./server/*.ts` keeps that same subtree in its targets. An optional root entry, exact-path non-code assets such as JSON presets, `./package.json` and `null` blocks are allowed. Import each module at its path under `src/`; named aliases, flattened paths, per-file module lists and additional non-null wildcards fail.
226
+ - **Tests:** `tests/follow` and `tests/colocated` keep a test beside the code it covers, named `<file>[.<modifier>].test.ts` or `<behaviour>[.<modifier>].spec.ts` with at most one modifier of `dom`, `slow`, `typecheck` and `unit`; a unit test runs without the DOM, so `.unit.dom` is rejected. `tests/colocated` always treats `__tests__/` as a test folder. It treats `test/`, `tests/` and `spec/` as test folders only when their directly contained checked files are all tests or test support; a product folder with source beside its specs is an ordinary source folder. Declared `suites` keep their own layout. Shared test support belongs in `test-support/`, the sanctioned test-only folder. A test covering a whole module may sit at its root or directly beside its folder. The story rules above keep setup in the kit.
227
+ - **Manifests:** `manifests/sorted` keeps every `package.json` in sort-package-json order, and `manifests/source-first` puts the `source` condition first in `exports` and `imports`. `manifests/exports-shape` checks the package root and workspace members with exports. They use one file-preserving TypeScript wildcard: for example, `./*.ts` maps to `./src/*.ts`, `./dist/*.d.ts` and `./dist/*.js` under `source`, `types` and `default`. A subtree pattern such as `./server/*.ts` keeps that same subtree in its targets. An optional root entry, exact-path non-code assets such as JSON presets, `./package.json` and `null` blocks are allowed. A package without modules, such as a dependency shell, exports only exact assets and needs no wildcard. Import each module at its path under `src/`; named aliases, flattened paths, per-file module lists and additional non-null wildcards fail. `manifests/application` keeps an application on its entry points, as described above.
224
228
  - **Biome:** the `biome` rule reports Biome's error findings as `biome/<category>`. A Biome run that fails without an error finding, such as one whose config leaves no file to check, fails lint and fix with Biome's message. The preset leaves out the `.worktrees` folder at the root, so a checkout does not lint its linked worktrees, while a worktree inside it lints all of its own files. The preset's plugins ban ambient time, randomness, `console` and `process.env` in favour of Effect's services.
225
229
 
226
230
  ### API
@@ -303,7 +307,7 @@ pnpm add --save-dev @shivaedev/quality @effect/platform-node@4.0.5 @effect/platf
303
307
 
304
308
  Node 24 or later is required. The CLI loads the TypeScript config through Node's native import; use erasable syntax and `.ts` extensions for relative TypeScript imports.
305
309
 
306
- The package includes `@shivaedev/quality/biome/preset.json`, `@shivaedev/quality/tsconfig/base.json` for type-checking with `noEmit`, and `@shivaedev/quality/tsconfig/package.json` for package builds, which adds declarations, maps and `rewriteRelativeImportExtensions` so relative `.ts` imports are emitted as `.js`. Read the preset files for their settings. The preset's plugins load from `./node_modules/@shivaedev/quality/biome/preset.json/plugins`, so install the package at the repository root. Biome sorts a specifier that starts with `#`, `@/`, `~`, `$` or `%` as an alias; a tsconfig path such as `@app/*` sorts with the packages and Biome's `noUndeclaredDependencies` takes it for one, so name aliases in a form Biome recognizes.
310
+ The package includes `@shivaedev/quality/biome/preset.json`, `@shivaedev/quality/tsconfig/base.json` for type-checking with `noEmit`, and `@shivaedev/quality/tsconfig/package.json` for package builds, which adds declarations, maps and `rewriteRelativeImportExtensions` so relative `.ts` imports are emitted as `.js`, and resolves modules as `NodeNext` so emitted declarations name the files Node and TypeScript consumers resolve. Type-checking stays on `bundler` resolution, so an emit problem surfaces in the build rather than in `tsc --noEmit`. Read the preset files for their settings. The preset's plugins load from `./node_modules/@shivaedev/quality/biome/preset.json/plugins`, so install the package at the repository root. Biome sorts a specifier that starts with `#`, `@/`, `~`, `$` or `%` as an alias; a tsconfig path such as `@app/*` sorts with the packages and Biome's `noUndeclaredDependencies` takes it for one, so name aliases in a form Biome recognizes.
307
311
 
308
312
  The TypeScript base leaves `types`, `jsx`, `paths`, `include` and output directories to each project. A project that needs more built-ins, such as the DOM, sets `lib` itself and keeps `ESNext` in it. A package that type-checks its tests with one config and builds `src` with another extends both, the package preset last:
309
313
 
@@ -335,7 +339,7 @@ import { appTestConfig } from "@shivaedev/quality/appTestConfig.ts";
335
339
  export default appTestConfig();
336
340
  ```
337
341
 
338
- Use this in `vitest.config.ts`. It composes `testProjects` with browser and server resolution and inlines Platform for the test server. Both helpers accept extra export conditions for workspace development: `appViteConfig(plugins, ["source"])` and `appTestConfig(["source"])`. Published apps use the defaults.
342
+ Use this in `vitest.config.ts`. It composes `testProjects` with browser and server resolution and inlines the `@shivaedev` packages for the test server, since an application imports each framework piece by its own name. Both helpers accept extra export conditions for workspace development: `appViteConfig(plugins, ["source"])` and `appTestConfig(["source"])`. Published apps use the defaults.
339
343
 
340
344
  For Vitest, install `vitest`, and add `@shivaedev/test-story` and `happy-dom` when the repository has DOM tests, then use:
341
345
 
@@ -376,7 +380,7 @@ export default defineConfig({
376
380
 
377
381
  A skipped test proves nothing. `noSkippedTests` reports unconditional skips as errors, and its automatic fix is disabled: repair the test or remove a claim it cannot prove. Slow tests belong in the slow project.
378
382
 
379
- The **PostgreSQL URL gate** is the only permitted skip convention: a test that needs real PostgreSQL registers conditionally on its `PLATFORM_EFFECT_*_TEST_DATABASE_URL`. Skip only when that URL is absent; with a URL, execute the body against PostgreSQL and let connection or setup failures fail the test. Nothing else may skip. Keep the condition next to the database setup, either in the test file or its shared `test-support` module:
383
+ The **PostgreSQL URL gate** is the only permitted skip convention: a test that needs real PostgreSQL registers conditionally on its `PLATFORM_*_TEST_DATABASE_URL`. Skip only when that URL is absent; with a URL, execute the body against PostgreSQL and let connection or setup failures fail the test. Nothing else may skip. Keep the condition next to the database setup, either in the test file or its shared `test-support` module:
380
384
 
381
385
  ```ts
382
386
  import { test } from "vitest";
@@ -8,5 +8,5 @@ language js(typescript, jsx)
8
8
  `Effect.gen(function* () { $... })`,
9
9
  JsFunctionBody(statements=[JsReturnStatement(argument=`Effect.gen(function* () { $... })`)])
10
10
  },
11
- register_diagnostic(span=$callback, message="A test body that is only Effect.gen is the generator itself: pass the function* to the test, as in it.effect('loads the item', function* () { ... }), and the test helper runs it with Effect.gen. @shivaedev/effect-test/it.ts provides an it whose effect and live testers take one.")
11
+ register_diagnostic(span=$callback, message="A test body that is only Effect.gen is the generator itself: pass the function* to the test, as in it.effect('loads the item', function* () { ... }), and the test helper runs it with Effect.gen. @shivaedev/test/it.ts provides an it whose effect and live testers take one.")
12
12
  }
@@ -4,7 +4,7 @@ export function appTestConfig(conditions = []) {
4
4
  return defineConfig({
5
5
  resolve: { conditions: [...conditions, "module", "browser", "development|production"] },
6
6
  ssr: { resolve: { conditions: [...conditions, "node", "development|production"] } },
7
- test: { ...testProjects(), server: { deps: { inline: ["@shivaedev/platform"] } } },
7
+ test: { ...testProjects(), server: { deps: { inline: [/^@shivaedev\//u] } } },
8
8
  });
9
9
  }
10
10
  //# sourceMappingURL=appTestConfig.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"appTestConfig.js","sourceRoot":"","sources":["../src/appTestConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,MAAM,UAAU,aAAa,CAAC,UAAU,GAAa,EAAE;IACtD,OAAO,YAAY,CAAC;QACnB,OAAO,EAAE,EAAE,UAAU,EAAE,CAAC,GAAG,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,wBAAwB,CAAC,EAAE;QACvF,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,CAAC,GAAG,UAAU,EAAE,MAAM,EAAE,wBAAwB,CAAC,EAAE,EAAE;QACnF,IAAI,EAAE,EAAE,GAAG,YAAY,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,qBAAqB,CAAC,EAAE,EAAE,EAAE;KAClF,CAAC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"appTestConfig.js","sourceRoot":"","sources":["../src/appTestConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,MAAM,UAAU,aAAa,CAAC,UAAU,GAAa,EAAE;IACtD,OAAO,YAAY,CAAC;QACnB,OAAO,EAAE,EAAE,UAAU,EAAE,CAAC,GAAG,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,wBAAwB,CAAC,EAAE;QACvF,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,CAAC,GAAG,UAAU,EAAE,MAAM,EAAE,wBAAwB,CAAC,EAAE,EAAE;QACnF,IAAI,EAAE,EAAE,GAAG,YAAY,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,gBAAgB,CAAC,EAAE,EAAE,EAAE;KAC7E,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { RuleInputs } from "#rule.ts";
2
+ import type { Diagnostic } from "./report.ts";
3
+ export declare function withoutEntryPointImports(readText: RuleInputs["readText"], diagnostics: readonly Diagnostic[]): Promise<readonly Diagnostic[]>;
4
+ //# sourceMappingURL=withoutEntryPointImports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withoutEntryPointImports.d.ts","sourceRoot":"","sources":["../../src/biome/withoutEntryPointImports.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA2C9C,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,EAAE,WAAW,EAAE,SAAS,UAAU,EAAE,GAAG,OAAO,CAAC,SAAS,UAAU,EAAE,CAAC,CAGnJ"}
@@ -0,0 +1,46 @@
1
+ import { posix } from "node:path";
2
+ import { isTooling } from "#imports/isTooling.ts";
3
+ import { entryPointsOf, isApplication, provider } from "#manifests/entryPoints.ts";
4
+ import { isTestCode } from "#naming/testName.ts";
5
+ const UNDECLARED = "lint/correctness/noUndeclaredDependencies";
6
+ const DEPENDENCY = /^Dependency (?<name>\S+) isn't specified in /u;
7
+ function parsed(text) {
8
+ if (text === undefined) {
9
+ return undefined;
10
+ }
11
+ try {
12
+ return JSON.parse(text);
13
+ }
14
+ catch {
15
+ return undefined;
16
+ }
17
+ }
18
+ async function ownerOf(readText, path) {
19
+ let directory = posix.dirname(path);
20
+ for (;;) {
21
+ const manifest = parsed(await readText(posix.join(directory, "package.json")));
22
+ if (manifest !== undefined || directory === ".") {
23
+ return { directory, manifest };
24
+ }
25
+ directory = posix.dirname(directory);
26
+ }
27
+ }
28
+ async function brought(readText, diagnostic) {
29
+ const name = DEPENDENCY.exec(diagnostic.message)?.groups?.name;
30
+ const path = diagnostic.location.path;
31
+ if (diagnostic.category !== UNDECLARED || name === undefined || path === undefined) {
32
+ return false;
33
+ }
34
+ const owner = await ownerOf(readText, path);
35
+ if (!isApplication(owner.manifest)) {
36
+ return false;
37
+ }
38
+ const entryPoints = await entryPointsOf({ readText }, owner.directory, owner.manifest, new Map());
39
+ const development = isTestCode(path) || isTooling(owner.directory, path);
40
+ return provider(entryPoints, name, development, true) !== undefined;
41
+ }
42
+ export async function withoutEntryPointImports(readText, diagnostics) {
43
+ const covered = await Promise.all(diagnostics.map((diagnostic) => brought(readText, diagnostic)));
44
+ return diagnostics.filter((_, index) => !covered[index]);
45
+ }
46
+ //# sourceMappingURL=withoutEntryPointImports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withoutEntryPointImports.js","sourceRoot":"","sources":["../../src/biome/withoutEntryPointImports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAIjD,MAAM,UAAU,GAAG,2CAA2C,CAAC;AAE/D,MAAM,UAAU,GAAG,+CAA+C,CAAC;AAEnE,SAAS,MAAM,CAAC,IAAwB;IACvC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,IAAI,CAAC;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,SAAS,CAAC;IAClB,CAAC;AACF,CAAC;AAED,KAAK,UAAU,OAAO,CAAC,QAAgC,EAAE,IAAY;IACpE,IAAI,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,SAAS,CAAC;QACT,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;QAC/E,IAAI,QAAQ,KAAK,SAAS,IAAI,SAAS,KAAK,GAAG,EAAE,CAAC;YACjD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;QAChC,CAAC;QACD,SAAS,GAAG,K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KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;AAC1D,CAAC"}
@@ -1,2 +1,3 @@
1
+ export declare function pnpmWorkspaceList(text: string, key: string): readonly string[];
1
2
  export declare function pnpmWorkspacePatterns(text: string): readonly string[];
2
3
  //# sourceMappingURL=pnpmWorkspacePatterns.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pnpmWorkspacePatterns.d.ts","sourceRoot":"","sources":["../../src/imports/pnpmWorkspacePatterns.ts"],"names":[],"mappings":"AAqHA,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAgBrE"}
1
+ {"version":3,"file":"pnpmWorkspacePatterns.d.ts","sourceRoot":"","sources":["../../src/imports/pnpmWorkspacePatterns.ts"],"names":[],"mappings":"AAuHA,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAiB9E;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAErE"}
@@ -1,4 +1,6 @@
1
- const KEY = /^(?:packages|"packages"|'packages')\s*:/u;
1
+ function keyPattern(key) {
2
+ return new RegExp(`^(?:${key}|"${key}"|'${key}')\\s*:`, "u");
3
+ }
2
4
  const ITEM = "-";
3
5
  const SPACE = /\s/u;
4
6
  const LINE_BREAK = /\r?\n/u;
@@ -21,38 +23,38 @@ function withoutComment(line) {
21
23
  }
22
24
  return line.trimEnd();
23
25
  }
24
- function scalar(raw) {
26
+ function scalar(raw, key) {
25
27
  const value = raw.trim();
26
28
  if (value.startsWith('"') && value.endsWith('"') && value.length > 1) {
27
29
  try {
28
30
  return String(JSON.parse(value));
29
31
  }
30
32
  catch (error) {
31
- throw failure(`cannot read "${value}" in packages`, error);
33
+ throw failure(`cannot read "${value}" in ${key}`, error);
32
34
  }
33
35
  }
34
36
  if (value.startsWith("'") && value.endsWith("'") && value.length > 1) {
35
37
  return value.slice(1, -1).replaceAll("''", "'");
36
38
  }
37
39
  if (value === "" || value.includes(": ") || value.endsWith(":") || ["[", "{", "'", '"'].some((opening) => value.startsWith(opening))) {
38
- throw failure(`cannot read "${value}" in packages`);
40
+ throw failure(`cannot read "${value}" in ${key}`);
39
41
  }
40
42
  return value;
41
43
  }
42
44
  const FLOW_INDICATOR = /[{}[\]]/u;
43
- function flowScalar(raw) {
45
+ function flowScalar(raw, key) {
44
46
  const value = raw.trim();
45
47
  const quoted = value.startsWith('"') || value.startsWith("'");
46
48
  if (!quoted && FLOW_INDICATOR.test(value)) {
47
- throw failure(`cannot read "${value}" in packages; quote a pattern that holds { } [ ] or ,`);
49
+ throw failure(`cannot read "${value}" in ${key}; quote a pattern that holds { } [ ] or ,`);
48
50
  }
49
- return scalar(value);
51
+ return scalar(value, key);
50
52
  }
51
- function closed(scan, rest) {
53
+ function closed(scan, rest, key) {
52
54
  if (rest.trim() !== "") {
53
- throw failure(`cannot read "${rest.trim()}" after the packages list`);
55
+ throw failure(`cannot read "${rest.trim()}" after the ${key} list`);
54
56
  }
55
- return [...scan.entries, scan.current].filter((entry) => entry.trim() !== "").map(flowScalar);
57
+ return [...scan.entries, scan.current].filter((entry) => entry.trim() !== "").map((entry) => flowScalar(entry, key));
56
58
  }
57
59
  function scanned(scan, char) {
58
60
  if (scan.quote !== undefined) {
@@ -72,19 +74,19 @@ function scanned(scan, char) {
72
74
  scan.current += char;
73
75
  return undefined;
74
76
  }
75
- function flowList(lines) {
77
+ function flowList(lines, key) {
76
78
  const scan = { current: "", entries: [], quote: undefined };
77
79
  for (const [number, line] of lines.map(withoutComment).entries()) {
78
80
  for (let index = number === 0 ? 1 : 0; index < line.length; index += 1) {
79
81
  if (scanned(scan, line[index] ?? "") === "close") {
80
- return closed(scan, line.slice(index + 1));
82
+ return closed(scan, line.slice(index + 1), key);
81
83
  }
82
84
  }
83
85
  scan.current += " ";
84
86
  }
85
- throw failure("the packages list never closes");
87
+ throw failure(`the ${key} list never closes`);
86
88
  }
87
- function blockList(lines) {
89
+ function blockList(lines, key) {
88
90
  const patterns = [];
89
91
  for (const line of lines.map(withoutComment)) {
90
92
  const trimmed = line.trim();
@@ -96,27 +98,31 @@ function blockList(lines) {
96
98
  break;
97
99
  }
98
100
  if (!item) {
99
- throw failure(`cannot read "${trimmed}" in packages`);
101
+ throw failure(`cannot read "${trimmed}" in ${key}`);
100
102
  }
101
- patterns.push(scalar(trimmed.slice(ITEM.length)));
103
+ patterns.push(scalar(trimmed.slice(ITEM.length), key));
102
104
  }
103
105
  return patterns;
104
106
  }
105
- export function pnpmWorkspacePatterns(text) {
107
+ export function pnpmWorkspaceList(text, key) {
108
+ const pattern = keyPattern(key);
106
109
  const lines = text.split(LINE_BREAK);
107
- const start = lines.findIndex((line) => KEY.test(line));
110
+ const start = lines.findIndex((line) => pattern.test(line));
108
111
  if (start === -1) {
109
112
  return [];
110
113
  }
111
114
  const rest = withoutComment(lines[start] ?? "")
112
- .replace(KEY, "")
115
+ .replace(pattern, "")
113
116
  .trim();
114
117
  if (rest.startsWith("[")) {
115
- return flowList([rest, ...lines.slice(start + 1)]);
118
+ return flowList([rest, ...lines.slice(start + 1)], key);
116
119
  }
117
120
  if (rest !== "") {
118
- throw failure(`cannot read "${rest}" in packages`);
121
+ throw failure(`cannot read "${rest}" in ${key}`);
119
122
  }
120
- return blockList(lines.slice(start + 1));
123
+ return blockList(lines.slice(start + 1), key);
124
+ }
125
+ export function pnpmWorkspacePatterns(text) {
126
+ return pnpmWorkspaceList(text, "packages");
121
127
  }
122
128
  //# sourceMappingURL=pnpmWorkspacePatterns.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pnpmWorkspacePatterns.js","sourceRoot":"","sources":["../../src/imports/pnpmWorkspacePatterns.ts"],"names":[],"mappings":"AAAA,MAAM,GAAG,GAAG,0CAA0C,CAAC;AAEvD,MAAM,IAAI,GAAG,GAAG,CAAC;AAEjB,MAAM,KAAK,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AQ,CAAC,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACzD,CAAC;IACD,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;QACjB,MAAM,OAAO,CAAC,gBAAgB,IAAI,QAAQ,GAAG,EAAE,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,IAAY;IACjD,OAAO,iBAAiB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AAC5C,CAAC"}
@@ -1,5 +1,11 @@
1
1
  import type { RuleInputs } from "#rule.ts";
2
2
  import { type WorkspacePackage } from "./workspace.ts";
3
3
  export type Runtime = "client" | "server" | "shared";
4
+ export type DeclaredRuntime = "client" | "server";
5
+ export interface RuntimeDeclarationProblem {
6
+ readonly directory: string;
7
+ readonly message: string;
8
+ }
9
+ export declare function runtimeDeclarationProblems(inputs: RuleInputs, packages: readonly WorkspacePackage[]): readonly RuntimeDeclarationProblem[];
4
10
  export declare function runtimeOf(inputs: RuleInputs, packages: readonly WorkspacePackage[]): (path: string) => Runtime | undefined;
5
11
  //# sourceMappingURL=runtime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/imports/runtime.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,OAAO,EAAa,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElE,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAkCrD,wBAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,gBAAgB,EAAE,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAAG,SAAS,CAsB1H"}
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/imports/runtime.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,OAAO,EAAa,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElE,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAErD,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAsDlD,MAAM,WAAW,yBAAyB;IACzC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,gBAAgB,EAAE,GAAG,SAAS,yBAAyB,EAAE,CAwB1I;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,gBAAgB,EAAE,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAAG,SAAS,CA6B1H"}
@@ -5,23 +5,34 @@ import { packageOf } from "./workspace.js";
5
5
  function executablePath(value) {
6
6
  return typeof value === "string" && value.trim().length > 0;
7
7
  }
8
- function hasExecutable(root, directory) {
8
+ function readManifest(root, directory) {
9
9
  const path = join(root, directory, "package.json");
10
10
  try {
11
11
  const manifest = JSON.parse(readFileSync(path, "utf8"));
12
12
  if (typeof manifest !== "object" || manifest === null || Array.isArray(manifest)) {
13
13
  throw new Error("the manifest must be an object");
14
14
  }
15
- const bin = Reflect.get(manifest, "bin");
16
- return executablePath(bin) || (typeof bin === "object" && bin !== null && !Array.isArray(bin) && Object.values(bin).some(executablePath));
15
+ return manifest;
17
16
  }
18
17
  catch (cause) {
19
18
  if (cause instanceof Error && "code" in cause && cause.code === "ENOENT") {
20
- return false;
19
+ return undefined;
21
20
  }
22
21
  throw new Error(`cannot read runtime policy at ${path}`, { cause });
23
22
  }
24
23
  }
24
+ function hasExecutable(manifest) {
25
+ const bin = manifest === undefined ? undefined : Reflect.get(manifest, "bin");
26
+ return executablePath(bin) || (typeof bin === "object" && bin !== null && !Array.isArray(bin) && Object.values(bin).some(executablePath));
27
+ }
28
+ function declaredValue(manifest) {
29
+ const quality = manifest === undefined ? undefined : Reflect.get(manifest, "quality");
30
+ return typeof quality === "object" && quality !== null ? Reflect.get(quality, "runtime") : undefined;
31
+ }
32
+ function declaredRuntime(manifest) {
33
+ const value = declaredValue(manifest);
34
+ return value === "client" || value === "server" ? value : undefined;
35
+ }
25
36
  function directoryExists(path) {
26
37
  try {
27
38
  return statSync(path).isDirectory();
@@ -33,17 +44,52 @@ function directoryExists(path) {
33
44
  throw cause;
34
45
  }
35
46
  }
47
+ function runtimeFoldersOf(root, owner) {
48
+ return ["client", "server"].filter((folder) => directoryExists(join(root, owner.directory, "src", folder)));
49
+ }
50
+ export function runtimeDeclarationProblems(inputs, packages) {
51
+ return [...packages, { directory: ".", name: "." }].flatMap((owner) => {
52
+ const value = declaredValue(readManifest(inputs.root, owner.directory));
53
+ if (value === undefined) {
54
+ return [];
55
+ }
56
+ if (value !== "client" && value !== "server") {
57
+ return [
58
+ {
59
+ directory: owner.directory,
60
+ message: `"quality.runtime" is ${JSON.stringify(value)}. Declare "client" or "server" for a package whose code runs in one runtime, or remove the field and use src/client/ and src/server/.`,
61
+ },
62
+ ];
63
+ }
64
+ const folders = runtimeFoldersOf(inputs.root, owner);
65
+ return folders.length === 0
66
+ ? []
67
+ : [
68
+ {
69
+ directory: owner.directory,
70
+ message: `"quality.runtime" declares the whole package ${value} code, but it also has ${folders.map((folder) => `src/${folder}/`).join(" and ")}. Keep one convention: remove the declaration and classify code by runtime folders, or move the code out of the runtime folders.`,
71
+ },
72
+ ];
73
+ });
74
+ }
36
75
  export function runtimeOf(inputs, packages) {
37
76
  const owners = [...packages, { directory: ".", name: "." }];
38
- const adopted = new Set(owners
39
- .filter((owner) => ["client", "server"].some((folder) => directoryExists(join(inputs.root, owner.directory, "src", folder))))
40
- .map((owner) => owner.directory));
41
- const executable = new Set(owners.filter((owner) => hasExecutable(inputs.root, owner.directory)).map((owner) => owner.directory));
77
+ const manifests = new Map(owners.map((owner) => [owner.directory, readManifest(inputs.root, owner.directory)]));
78
+ const adopted = new Set(owners.filter((owner) => runtimeFoldersOf(inputs.root, owner).length > 0).map((owner) => owner.directory));
79
+ const declared = new Map(owners.flatMap((owner) => {
80
+ const runtime = declaredRuntime(manifests.get(owner.directory));
81
+ return runtime === undefined || adopted.has(owner.directory) ? [] : [[owner.directory, runtime]];
82
+ }));
83
+ const executable = new Set(owners.filter((owner) => hasExecutable(manifests.get(owner.directory))).map((owner) => owner.directory));
42
84
  return (path) => {
43
85
  const owner = packageOf(packages, path)?.directory ?? ".";
44
86
  if (isTooling(owner, path)) {
45
87
  return "server";
46
88
  }
89
+ const whole = declared.get(owner);
90
+ if (whole !== undefined) {
91
+ return whole;
92
+ }
47
93
  if (!adopted.has(owner)) {
48
94
  return executable.has(owner) ? "server" : undefined;
49
95
  }
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/imports/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAyB,MAAM,gBAAgB,CAAC;AAIlE,SAAS,cAAc,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,aAAa,CAAC,IAAY,EAAE,SAAiB;IACrD,M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yBAAyB,EAAE,MAAM,CAAC,CAAC;QACrF,IAAI,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;YACrC,OAAO,QAAQ,CAAC;QACjB,CAAC;QACD,OAAO,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC9D,CAAC,CAAC;AACH,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { RuleInputs } from "#rule.ts";
2
+ export declare const SHIPPED_FIELDS: readonly ["dependencies", "peerDependencies", "optionalDependencies"];
3
+ export declare const DEPENDENCY_FIELDS: readonly ["dependencies", "peerDependencies", "optionalDependencies", "devDependencies"];
4
+ export declare const PLATFORM = "@shivaedev/platform";
5
+ export interface EntryPoint {
6
+ readonly declared: "development" | "shipped" | undefined;
7
+ readonly name: string;
8
+ readonly provides: ReadonlySet<string>;
9
+ readonly testOnly: boolean;
10
+ }
11
+ export declare function dependencyNames(manifest: unknown, field: string): readonly string[];
12
+ export declare function entryPointsOf(inputs: Pick<RuleInputs, "readText">, directory: string, manifest: unknown, workspace: ReadonlyMap<string, string>): Promise<readonly EntryPoint[]>;
13
+ export declare function isApplication(manifest: unknown): boolean;
14
+ export declare function provider(entryPoints: readonly EntryPoint[], target: string, development: boolean, declaredOnly: boolean): EntryPoint | undefined;
15
+ //# sourceMappingURL=entryPoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entryPoints.d.ts","sourceRoot":"","sources":["../../src/manifests/entryPoints.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,eAAO,MAAM,cAAc,YAAI,cAAc,EAAE,kBAAkB,EAAE,sBAAsB,CAAU,CAAC;AAEpG,eAAO,MAAM,iBAAiB,0FAAkD,CAAC;AAEjF,eAAO,MAAM,QAAQ,wBAAwB,CAAC;AAO9C,MAAM,WAAW,UAAU;IAC1B,QAAQ,CAAC,QAAQ,EAAE,aAAa,GAAG,SAAS,GAAG,SAAS,CAAC;IACzD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACvC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC3B;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAGnF;AAmCD,wBAAgB,aAAa,CAC5B,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,EACpC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,OAAO,EACjB,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACpC,OAAO,CAAC,SAAS,UAAU,EAAE,CAAC,CAShC;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAExD;AAED,wBAAgB,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,0BAOvH"}
@@ -0,0 +1,60 @@
1
+ import { posix } from "node:path";
2
+ export const SHIPPED_FIELDS = ["dependencies", "peerDependencies", "optionalDependencies"];
3
+ export const DEPENDENCY_FIELDS = [...SHIPPED_FIELDS, "devDependencies"];
4
+ export const PLATFORM = "@shivaedev/platform";
5
+ const ENTRY_POINTS = [
6
+ { name: PLATFORM, testOnly: false },
7
+ { name: "@shivaedev/test-story", testOnly: true },
8
+ ];
9
+ export function dependencyNames(manifest, field) {
10
+ const value = typeof manifest === "object" && manifest !== null ? Reflect.get(manifest, field) : undefined;
11
+ return typeof value === "object" && value !== null && !Array.isArray(value) ? Object.keys(value) : [];
12
+ }
13
+ function parsed(text) {
14
+ if (text === undefined) {
15
+ return undefined;
16
+ }
17
+ try {
18
+ return JSON.parse(text);
19
+ }
20
+ catch {
21
+ return undefined;
22
+ }
23
+ }
24
+ async function installedManifest(inputs, directory, name, workspace) {
25
+ const candidates = [
26
+ ...(workspace.has(name) ? [posix.join(workspace.get(name) ?? ".", "package.json")] : []),
27
+ posix.join(directory, "node_modules", name, "package.json"),
28
+ posix.join("node_modules", name, "package.json"),
29
+ ];
30
+ for (const candidate of candidates) {
31
+ const manifest = parsed(await inputs.readText(candidate));
32
+ if (manifest !== undefined) {
33
+ return manifest;
34
+ }
35
+ }
36
+ return undefined;
37
+ }
38
+ function declaration(manifest, name) {
39
+ if (SHIPPED_FIELDS.some((field) => dependencyNames(manifest, field).includes(name))) {
40
+ return "shipped";
41
+ }
42
+ return dependencyNames(manifest, "devDependencies").includes(name) ? "development" : undefined;
43
+ }
44
+ export function entryPointsOf(inputs, directory, manifest, workspace) {
45
+ return Promise.all(ENTRY_POINTS.map(async ({ name, testOnly }) => ({
46
+ declared: declaration(manifest, name),
47
+ name,
48
+ provides: new Set(dependencyNames(await installedManifest(inputs, directory, name, workspace), "dependencies")),
49
+ testOnly,
50
+ })));
51
+ }
52
+ export function isApplication(manifest) {
53
+ return DEPENDENCY_FIELDS.some((field) => dependencyNames(manifest, field).includes(PLATFORM));
54
+ }
55
+ export function provider(entryPoints, target, development, declaredOnly) {
56
+ return entryPoints.find((entry) => entry.provides.has(target)
57
+ && (development || !entry.testOnly)
58
+ && (declaredOnly ? entry.declared === "shipped" || (entry.declared === "development" && development) : entry.declared === undefined));
59
+ }
60
+ //# sourceMappingURL=entryPoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entryPoints.js","sourceRoot":"","sources":["../../src/manifests/entryPoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAGlC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,cAAc,EAAE,kBAAkB,EAAE,sBAAsB,CAAU,CAAC;AAEpG,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,GAAG,cAAc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../src/rules/biome.ts"],"names":[],"mappings":"AAEA,OAAO,EAA4B,KAAK,IAAI,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAGhF,eAAO,MAAM,MAAM,yCAAyC,CAAC;AAoB7D,UAAU,UAAU;IACnB,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACtB;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAMtF;AAmBD,eAAO,MAAM,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,CAA+B,CAAC"}