@prisma-next/plan 0.3.0-dev.3 → 0.3.0-dev.5

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.
@@ -0,0 +1,4 @@
1
+ import type { RuntimeError } from './types';
2
+ export declare function planInvalid(message: string, details?: Record<string, unknown>, hints?: readonly string[], docs?: readonly string[]): RuntimeError;
3
+ export declare function planUnsupported(message: string, details?: Record<string, unknown>, hints?: readonly string[], docs?: readonly string[]): RuntimeError;
4
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,EACzB,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,GACvB,YAAY,CAgBd;AAED,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,EACzB,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,GACvB,YAAY,CAgBd"}
@@ -1,6 +1,2 @@
1
- import { RuntimeError } from './types.js';
2
-
3
- declare function planInvalid(message: string, details?: Record<string, unknown>, hints?: readonly string[], docs?: readonly string[]): RuntimeError;
4
- declare function planUnsupported(message: string, details?: Record<string, unknown>, hints?: readonly string[], docs?: readonly string[]): RuntimeError;
5
-
6
- export { planInvalid, planUnsupported };
1
+ export { planInvalid, planUnsupported } from '../errors';
2
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/exports/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC"}
@@ -1,11 +1,2 @@
1
- interface RuntimeError extends Error {
2
- readonly code: string;
3
- readonly category: 'PLAN';
4
- readonly severity: 'error';
5
- readonly message: string;
6
- readonly details?: Record<string, unknown>;
7
- readonly hints?: readonly string[];
8
- readonly docs?: readonly string[];
9
- }
10
-
11
- export type { RuntimeError };
1
+ export type { RuntimeError } from '../types';
2
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/exports/types.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- export { planInvalid, planUnsupported } from './exports/errors.js';
2
- export { RuntimeError } from './exports/types.js';
1
+ export * from './exports/errors';
2
+ export * from './exports/types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,10 @@
1
+ export interface RuntimeError extends Error {
2
+ readonly code: string;
3
+ readonly category: 'PLAN';
4
+ readonly severity: 'error';
5
+ readonly message: string;
6
+ readonly details?: Record<string, unknown>;
7
+ readonly hints?: readonly string[];
8
+ readonly docs?: readonly string[];
9
+ }
10
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAa,SAAQ,KAAK;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC"}
package/package.json CHANGED
@@ -1,17 +1,18 @@
1
1
  {
2
2
  "name": "@prisma-next/plan",
3
- "version": "0.3.0-dev.3",
3
+ "version": "0.3.0-dev.5",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "Plan helpers, diagnostics, and shared errors for Prisma Next",
7
7
  "devDependencies": {
8
- "@vitest/coverage-v8": "^4.0.0",
9
- "tsup": "^8.3.0",
10
- "typescript": "^5.9.3",
11
- "vitest": "^4.0.16"
8
+ "@vitest/coverage-v8": "4.0.16",
9
+ "tsup": "8.5.1",
10
+ "typescript": "5.9.3",
11
+ "vitest": "4.0.16"
12
12
  },
13
13
  "files": [
14
- "dist"
14
+ "dist",
15
+ "src"
15
16
  ],
16
17
  "exports": {
17
18
  ".": {
@@ -28,7 +29,7 @@
28
29
  }
29
30
  },
30
31
  "scripts": {
31
- "build": "tsup --config tsup.config.ts",
32
+ "build": "tsup --config tsup.config.ts && tsc --project tsconfig.build.json",
32
33
  "test": "vitest run",
33
34
  "test:coverage": "vitest run --coverage",
34
35
  "typecheck": "tsc --project tsconfig.json --noEmit",
package/src/errors.ts ADDED
@@ -0,0 +1,47 @@
1
+ import type { RuntimeError } from './types';
2
+
3
+ export function planInvalid(
4
+ message: string,
5
+ details?: Record<string, unknown>,
6
+ hints?: readonly string[],
7
+ docs?: readonly string[],
8
+ ): RuntimeError {
9
+ const error = new Error(message) as RuntimeError;
10
+
11
+ Object.defineProperty(error, 'name', {
12
+ value: 'RuntimeError',
13
+ configurable: true,
14
+ });
15
+
16
+ return Object.assign(error, {
17
+ code: 'PLAN.INVALID',
18
+ category: 'PLAN' as const,
19
+ severity: 'error' as const,
20
+ details,
21
+ hints,
22
+ docs,
23
+ });
24
+ }
25
+
26
+ export function planUnsupported(
27
+ message: string,
28
+ details?: Record<string, unknown>,
29
+ hints?: readonly string[],
30
+ docs?: readonly string[],
31
+ ): RuntimeError {
32
+ const error = new Error(message) as RuntimeError;
33
+
34
+ Object.defineProperty(error, 'name', {
35
+ value: 'RuntimeError',
36
+ configurable: true,
37
+ });
38
+
39
+ return Object.assign(error, {
40
+ code: 'PLAN.UNSUPPORTED',
41
+ category: 'PLAN' as const,
42
+ severity: 'error' as const,
43
+ details,
44
+ hints,
45
+ docs,
46
+ });
47
+ }
@@ -0,0 +1 @@
1
+ export { planInvalid, planUnsupported } from '../errors';
@@ -0,0 +1 @@
1
+ export type { RuntimeError } from '../types';
package/src/index.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './exports/errors';
2
+ export * from './exports/types';
package/src/types.ts ADDED
@@ -0,0 +1,9 @@
1
+ export interface RuntimeError extends Error {
2
+ readonly code: string;
3
+ readonly category: 'PLAN';
4
+ readonly severity: 'error';
5
+ readonly message: string;
6
+ readonly details?: Record<string, unknown>;
7
+ readonly hints?: readonly string[];
8
+ readonly docs?: readonly string[];
9
+ }