@prisma-next/psl-parser 0.14.0-dev.77 → 0.14.0-dev.79

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.
@@ -19,7 +19,8 @@ interface PslInterpretInput {
19
19
  /**
20
20
  * Declared here — the authoring layer that owns `DocumentAst` / `SourceFile` /
21
21
  * `SymbolTable` — because `@prisma-next/config` (core) cannot name authoring
22
- * types.
22
+ * types. `interpret` must not read disk or `context.resolvedInputs` — those
23
+ * are load-path concerns.
23
24
  */
24
25
  interface PslInterpretCapable extends PslContractSourceProvider {
25
26
  interpret(input: PslInterpretInput, context: ContractSourceContext): Result<Contract, ContractSourceDiagnostics>;
@@ -1 +1 @@
1
- {"version":3,"file":"interpret.d.mts","names":[],"sources":["../src/interpret.ts"],"mappings":";;;;;;;;AAkBA;;;;UAAiB,iBAAA;EAAA,SACN,QAAA,EAAU,WAAA;EAAA,SACV,UAAA,EAAY,UAAA;EAAA,SACZ,WAAA,EAAa,WAAA;EAAA,SACb,QAAA;AAAA;;;;;;UAQM,mBAAA,SAA4B,yBAAA;EAC3C,SAAA,CACE,KAAA,EAAO,iBAAA,EACP,OAAA,EAAS,qBAAA,GACR,MAAA,CAAO,QAAA,EAAU,yBAAA;AAAA;;;;;;;iBASN,mBAAA,CACd,MAAA,EAAQ,MAAA,CAAO,QAAA,EAAU,yBAAA,GACzB,eAAA,WAA0B,wBAAA,KACzB,MAAA,CAAO,QAAA,EAAU,yBAAA;;iBAeJ,iBAAA,CAAkB,MAAA,EAAQ,sBAAA,GAAyB,MAAA,IAAU,mBAAmB"}
1
+ {"version":3,"file":"interpret.d.mts","names":[],"sources":["../src/interpret.ts"],"mappings":";;;;;;;;AAkBA;;;;UAAiB,iBAAA;EAAA,SACN,QAAA,EAAU,WAAA;EAAA,SACV,UAAA,EAAY,UAAA;EAAA,SACZ,WAAA,EAAa,WAAA;EAAA,SACb,QAAA;AAAA;;;;;;;UASM,mBAAA,SAA4B,yBAAA;EAC3C,SAAA,CACE,KAAA,EAAO,iBAAA,EACP,OAAA,EAAS,qBAAA,GACR,MAAA,CAAO,QAAA,EAAU,yBAAA;AAAA;;;;;;;iBASN,mBAAA,CACd,MAAA,EAAQ,MAAA,CAAO,QAAA,EAAU,yBAAA,GACzB,eAAA,WAA0B,wBAAA,KACzB,MAAA,CAAO,QAAA,EAAU,yBAAA;;iBAeJ,iBAAA,CAAkB,MAAA,EAAQ,sBAAA,GAAyB,MAAA,IAAU,mBAAmB"}
@@ -1 +1 @@
1
- {"version":3,"file":"interpret.mjs","names":[],"sources":["../src/interpret.ts"],"sourcesContent":["import type {\n ContractSourceContext,\n ContractSourceDiagnostic,\n ContractSourceDiagnostics,\n ContractSourceProvider,\n PslContractSourceProvider,\n} from '@prisma-next/config/config-types';\nimport type { Contract } from '@prisma-next/contract/types';\nimport { notOk, type Result } from '@prisma-next/utils/result';\nimport type { SourceFile } from './source-file';\nimport type { SymbolTable } from './symbol-table';\nimport type { DocumentAst } from './syntax/ast/declarations';\n\n/**\n * Lets editor tooling that already parses incrementally (e.g. the language\n * server) hand cached artifacts to the interpreter instead of forcing a\n * disk re-parse.\n */\nexport interface PslInterpretInput {\n readonly document: DocumentAst;\n readonly sourceFile: SourceFile;\n readonly symbolTable: SymbolTable;\n readonly sourceId: string;\n}\n\n/**\n * Declared here — the authoring layer that owns `DocumentAst` / `SourceFile` /\n * `SymbolTable` — because `@prisma-next/config` (core) cannot name authoring\n * types.\n */\nexport interface PslInterpretCapable extends PslContractSourceProvider {\n interpret(\n input: PslInterpretInput,\n context: ContractSourceContext,\n ): Result<Contract, ContractSourceDiagnostics>;\n}\n\n/**\n * Merges caller-side diagnostics (e.g. parse / symbol-table findings) into an\n * interpretation result. The authored headline is deliberately uniform — it\n * reports how many errors the schema has, never which pipeline stage found\n * them.\n */\nexport function withSeedDiagnostics(\n result: Result<Contract, ContractSourceDiagnostics>,\n seedDiagnostics: readonly ContractSourceDiagnostic[],\n): Result<Contract, ContractSourceDiagnostics> {\n if (seedDiagnostics.length === 0) {\n return result;\n }\n const diagnostics = result.ok\n ? seedDiagnostics\n : [...seedDiagnostics, ...result.failure.diagnostics];\n return notOk({\n summary: `Schema has ${diagnostics.length} error${diagnostics.length === 1 ? '' : 's'}`,\n diagnostics,\n ...(result.ok || result.failure.meta === undefined ? {} : { meta: result.failure.meta }),\n });\n}\n\n/** The single seam that narrows a contract source to the interpret capability. */\nexport function hasPslInterpreter(source: ContractSourceProvider): source is PslInterpretCapable {\n return (\n source.sourceFormat === 'psl' && 'interpret' in source && typeof source.interpret === 'function'\n );\n}\n"],"mappings":";;;;;;;;AA2CA,SAAgB,oBACd,QACA,iBAC6C;CAC7C,IAAI,gBAAgB,WAAW,GAC7B,OAAO;CAET,MAAM,cAAc,OAAO,KACvB,kBACA,CAAC,GAAG,iBAAiB,GAAG,OAAO,QAAQ,WAAW;CACtD,OAAO,MAAM;EACX,SAAS,cAAc,YAAY,OAAO,QAAQ,YAAY,WAAW,IAAI,KAAK;EAClF;EACA,GAAI,OAAO,MAAM,OAAO,QAAQ,SAAS,KAAA,IAAY,CAAC,IAAI,EAAE,MAAM,OAAO,QAAQ,KAAK;CACxF,CAAC;AACH;;AAGA,SAAgB,kBAAkB,QAA+D;CAC/F,OACE,OAAO,iBAAiB,SAAS,eAAe,UAAU,OAAO,OAAO,cAAc;AAE1F"}
1
+ {"version":3,"file":"interpret.mjs","names":[],"sources":["../src/interpret.ts"],"sourcesContent":["import type {\n ContractSourceContext,\n ContractSourceDiagnostic,\n ContractSourceDiagnostics,\n ContractSourceProvider,\n PslContractSourceProvider,\n} from '@prisma-next/config/config-types';\nimport type { Contract } from '@prisma-next/contract/types';\nimport { notOk, type Result } from '@prisma-next/utils/result';\nimport type { SourceFile } from './source-file';\nimport type { SymbolTable } from './symbol-table';\nimport type { DocumentAst } from './syntax/ast/declarations';\n\n/**\n * Lets editor tooling that already parses incrementally (e.g. the language\n * server) hand cached artifacts to the interpreter instead of forcing a\n * disk re-parse.\n */\nexport interface PslInterpretInput {\n readonly document: DocumentAst;\n readonly sourceFile: SourceFile;\n readonly symbolTable: SymbolTable;\n readonly sourceId: string;\n}\n\n/**\n * Declared here — the authoring layer that owns `DocumentAst` / `SourceFile` /\n * `SymbolTable` — because `@prisma-next/config` (core) cannot name authoring\n * types. `interpret` must not read disk or `context.resolvedInputs` — those\n * are load-path concerns.\n */\nexport interface PslInterpretCapable extends PslContractSourceProvider {\n interpret(\n input: PslInterpretInput,\n context: ContractSourceContext,\n ): Result<Contract, ContractSourceDiagnostics>;\n}\n\n/**\n * Merges caller-side diagnostics (e.g. parse / symbol-table findings) into an\n * interpretation result. The authored headline is deliberately uniform — it\n * reports how many errors the schema has, never which pipeline stage found\n * them.\n */\nexport function withSeedDiagnostics(\n result: Result<Contract, ContractSourceDiagnostics>,\n seedDiagnostics: readonly ContractSourceDiagnostic[],\n): Result<Contract, ContractSourceDiagnostics> {\n if (seedDiagnostics.length === 0) {\n return result;\n }\n const diagnostics = result.ok\n ? seedDiagnostics\n : [...seedDiagnostics, ...result.failure.diagnostics];\n return notOk({\n summary: `Schema has ${diagnostics.length} error${diagnostics.length === 1 ? '' : 's'}`,\n diagnostics,\n ...(result.ok || result.failure.meta === undefined ? {} : { meta: result.failure.meta }),\n });\n}\n\n/** The single seam that narrows a contract source to the interpret capability. */\nexport function hasPslInterpreter(source: ContractSourceProvider): source is PslInterpretCapable {\n return (\n source.sourceFormat === 'psl' && 'interpret' in source && typeof source.interpret === 'function'\n );\n}\n"],"mappings":";;;;;;;;AA4CA,SAAgB,oBACd,QACA,iBAC6C;CAC7C,IAAI,gBAAgB,WAAW,GAC7B,OAAO;CAET,MAAM,cAAc,OAAO,KACvB,kBACA,CAAC,GAAG,iBAAiB,GAAG,OAAO,QAAQ,WAAW;CACtD,OAAO,MAAM;EACX,SAAS,cAAc,YAAY,OAAO,QAAQ,YAAY,WAAW,IAAI,KAAK;EAClF;EACA,GAAI,OAAO,MAAM,OAAO,QAAQ,SAAS,KAAA,IAAY,CAAC,IAAI,EAAE,MAAM,OAAO,QAAQ,KAAK;CACxF,CAAC;AACH;;AAGA,SAAgB,kBAAkB,QAA+D;CAC/F,OACE,OAAO,iBAAiB,SAAS,eAAe,UAAU,OAAO,OAAO,cAAc;AAE1F"}
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@prisma-next/psl-parser",
3
- "version": "0.14.0-dev.77",
3
+ "version": "0.14.0-dev.79",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "description": "Reusable parser for Prisma Schema Language (PSL)",
8
8
  "dependencies": {
9
- "@prisma-next/config": "0.14.0-dev.77",
10
- "@prisma-next/contract": "0.14.0-dev.77",
11
- "@prisma-next/framework-components": "0.14.0-dev.77",
12
- "@prisma-next/utils": "0.14.0-dev.77"
9
+ "@prisma-next/config": "0.14.0-dev.79",
10
+ "@prisma-next/contract": "0.14.0-dev.79",
11
+ "@prisma-next/framework-components": "0.14.0-dev.79",
12
+ "@prisma-next/utils": "0.14.0-dev.79"
13
13
  },
14
14
  "devDependencies": {
15
- "@prisma-next/tsconfig": "0.14.0-dev.77",
16
- "@prisma-next/tsdown": "0.14.0-dev.77",
15
+ "@prisma-next/tsconfig": "0.14.0-dev.79",
16
+ "@prisma-next/tsdown": "0.14.0-dev.79",
17
17
  "tsdown": "0.22.3",
18
18
  "typescript": "5.9.3",
19
19
  "vitest": "4.1.10"
package/src/interpret.ts CHANGED
@@ -26,7 +26,8 @@ export interface PslInterpretInput {
26
26
  /**
27
27
  * Declared here — the authoring layer that owns `DocumentAst` / `SourceFile` /
28
28
  * `SymbolTable` — because `@prisma-next/config` (core) cannot name authoring
29
- * types.
29
+ * types. `interpret` must not read disk or `context.resolvedInputs` — those
30
+ * are load-path concerns.
30
31
  */
31
32
  export interface PslInterpretCapable extends PslContractSourceProvider {
32
33
  interpret(