@reckona/mreact-shared 0.0.81 → 0.0.83

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,77 @@
1
+ export declare const compilerOutputContractVersion = 1;
2
+ export type ServerOutputMode = "string" | "stream";
3
+ export interface HtmlSink {
4
+ append(chunk: string): void;
5
+ backpressure?(): Promise<void>;
6
+ defer?(task: PromiseLike<void>): void;
7
+ signal?: AbortSignal;
8
+ }
9
+ export interface TransformOutput {
10
+ code: string;
11
+ map?: string | null;
12
+ diagnostics: Diagnostic[];
13
+ metadata: ModuleMetadata;
14
+ }
15
+ export interface Diagnostic {
16
+ level: "info" | "warn" | "error";
17
+ code: string;
18
+ message: string;
19
+ loc?: SourceLocation;
20
+ suggestion?: DiagnosticSuggestion;
21
+ }
22
+ export interface DiagnosticSuggestion {
23
+ title: string;
24
+ replacement?: string;
25
+ link?: string;
26
+ }
27
+ export interface SourceLocation {
28
+ line: number;
29
+ column: number;
30
+ }
31
+ export interface ModuleMetadata {
32
+ filename: string;
33
+ target: CompileTarget;
34
+ compiler: CompilerMetadata;
35
+ serverOutput?: ServerOutputMode;
36
+ serverBootstrap?: ServerBootstrapMode;
37
+ serverBootstrapNonce?: string;
38
+ serverBootstrapSrc?: string;
39
+ serverHydration?: boolean;
40
+ reactSuspenseRevealScriptSrc?: string;
41
+ components: ComponentMetadata[];
42
+ imports: RuntimeImport[];
43
+ clientReferences?: string[];
44
+ clientReferenceManifest?: ClientReferenceMetadata[];
45
+ serverReferences?: string[];
46
+ eventHydrationManifest?: EventHydrationManifestMetadata;
47
+ }
48
+ export type CompileTarget = "client" | "server";
49
+ export type ServerBootstrapMode = "none" | "out-of-order-reorder";
50
+ export type CompilerFrontend = "oxc";
51
+ export interface CompilerMetadata {
52
+ frontend: CompilerFrontend;
53
+ typescriptFallback: boolean;
54
+ }
55
+ export interface ClientReferenceMetadata {
56
+ name: string;
57
+ moduleId: string;
58
+ exportName: string;
59
+ }
60
+ export interface ComponentMetadata {
61
+ name: string;
62
+ exportName: string;
63
+ }
64
+ export interface RuntimeImport {
65
+ source: string;
66
+ specifiers: string[];
67
+ }
68
+ export interface EventHydrationManifestMetadata {
69
+ version: 1;
70
+ events: EventHydrationEntryMetadata[];
71
+ }
72
+ export interface EventHydrationEntryMetadata {
73
+ id: string;
74
+ event: string;
75
+ handler: string;
76
+ }
77
+ //# sourceMappingURL=compiler-contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compiler-contract.d.ts","sourceRoot":"","sources":["../src/compiler-contract.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B,IAAI,CAAC;AAE/C,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEnD,MAAM,WAAW,QAAQ;IACvB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,YAAY,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,KAAK,CAAC,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACtC,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,QAAQ,EAAE,cAAc,CAAC;CAC1B;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,UAAU,CAAC,EAAE,oBAAoB,CAAC;CACnC;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,C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MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,8BAA8B;IAC7C,OAAO,EAAE,CAAC,CAAC;IACX,MAAM,EAAE,2BAA2B,EAAE,CAAC;CACvC;AAED,MAAM,WAAW,2BAA2B;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,2 @@
1
+ export const compilerOutputContractVersion = 1;
2
+ //# sourceMappingURL=compiler-contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compiler-contract.js","sourceRoot":"","sources":["../src/compiler-contract.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC","sourcesContent":["export const compilerOutputContractVersion = 1;\n\nexport type ServerOutputMode = \"string\" | \"stream\";\n\nexport interface HtmlSink {\n append(chunk: string): void;\n backpressure?(): Promise<void>;\n defer?(task: PromiseLike<void>): void;\n signal?: AbortSignal;\n}\n\nexport interface TransformOutput {\n code: string;\n map?: string | null;\n diagnostics: Diagnostic[];\n metadata: ModuleMetadata;\n}\n\nexport interface Diagnostic {\n level: \"info\" | \"warn\" | \"error\";\n code: string;\n message: string;\n loc?: SourceLocation;\n suggestion?: DiagnosticSuggestion;\n}\n\nexport interface DiagnosticSuggestion {\n title: string;\n replacement?: string;\n link?: string;\n}\n\nexport interface SourceLocation {\n line: number;\n column: number;\n}\n\nexport interface ModuleMetadata {\n filename: string;\n target: CompileTarget;\n compiler: CompilerMetadata;\n serverOutput?: ServerOutputMode;\n serverBootstrap?: ServerBootstrapMode;\n serverBootstrapNonce?: string;\n serverBootstrapSrc?: string;\n serverHydration?: boolean;\n reactSuspenseRevealScriptSrc?: string;\n components: ComponentMetadata[];\n imports: RuntimeImport[];\n clientReferences?: string[];\n clientReferenceManifest?: ClientReferenceMetadata[];\n serverReferences?: string[];\n eventHydrationManifest?: EventHydrationManifestMetadata;\n}\n\nexport type CompileTarget = \"client\" | \"server\";\nexport type ServerBootstrapMode = \"none\" | \"out-of-order-reorder\";\nexport type CompilerFrontend = \"oxc\";\n\nexport interface CompilerMetadata {\n frontend: CompilerFrontend;\n typescriptFallback: boolean;\n}\n\nexport interface ClientReferenceMetadata {\n name: string;\n moduleId: string;\n exportName: string;\n}\n\nexport interface ComponentMetadata {\n name: string;\n exportName: string;\n}\n\nexport interface RuntimeImport {\n source: string;\n specifiers: string[];\n}\n\nexport interface EventHydrationManifestMetadata {\n version: 1;\n events: EventHydrationEntryMetadata[];\n}\n\nexport interface EventHydrationEntryMetadata {\n id: string;\n event: string;\n handler: string;\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from "./html-escape.js";
2
2
  export * from "./url-safety.js";
3
+ export * from "./compiler-contract.js";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC"}
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from "./html-escape.js";
2
2
  export * from "./url-safety.js";
3
+ export * from "./compiler-contract.js";
3
4
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC","sourcesContent":["export * from \"./html-escape.js\";\nexport * from \"./url-safety.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC","sourcesContent":["export * from \"./html-escape.js\";\nexport * from \"./url-safety.js\";\nexport * from \"./compiler-contract.js\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reckona/mreact-shared",
3
- "version": "0.0.81",
3
+ "version": "0.0.83",
4
4
  "description": "Shared runtime utilities used by mreact packages.",
5
5
  "keywords": [
6
6
  "jsx",
@@ -41,6 +41,10 @@
41
41
  "./html-escape": {
42
42
  "types": "./dist/html-escape.d.ts",
43
43
  "default": "./dist/html-escape.js"
44
+ },
45
+ "./compiler-contract": {
46
+ "types": "./dist/compiler-contract.d.ts",
47
+ "default": "./dist/compiler-contract.js"
44
48
  }
45
49
  },
46
50
  "publishConfig": {
@@ -0,0 +1,90 @@
1
+ export const compilerOutputContractVersion = 1;
2
+
3
+ export type ServerOutputMode = "string" | "stream";
4
+
5
+ export interface HtmlSink {
6
+ append(chunk: string): void;
7
+ backpressure?(): Promise<void>;
8
+ defer?(task: PromiseLike<void>): void;
9
+ signal?: AbortSignal;
10
+ }
11
+
12
+ export interface TransformOutput {
13
+ code: string;
14
+ map?: string | null;
15
+ diagnostics: Diagnostic[];
16
+ metadata: ModuleMetadata;
17
+ }
18
+
19
+ export interface Diagnostic {
20
+ level: "info" | "warn" | "error";
21
+ code: string;
22
+ message: string;
23
+ loc?: SourceLocation;
24
+ suggestion?: DiagnosticSuggestion;
25
+ }
26
+
27
+ export interface DiagnosticSuggestion {
28
+ title: string;
29
+ replacement?: string;
30
+ link?: string;
31
+ }
32
+
33
+ export interface SourceLocation {
34
+ line: number;
35
+ column: number;
36
+ }
37
+
38
+ export interface ModuleMetadata {
39
+ filename: string;
40
+ target: CompileTarget;
41
+ compiler: CompilerMetadata;
42
+ serverOutput?: ServerOutputMode;
43
+ serverBootstrap?: ServerBootstrapMode;
44
+ serverBootstrapNonce?: string;
45
+ serverBootstrapSrc?: string;
46
+ serverHydration?: boolean;
47
+ reactSuspenseRevealScriptSrc?: string;
48
+ components: ComponentMetadata[];
49
+ imports: RuntimeImport[];
50
+ clientReferences?: string[];
51
+ clientReferenceManifest?: ClientReferenceMetadata[];
52
+ serverReferences?: string[];
53
+ eventHydrationManifest?: EventHydrationManifestMetadata;
54
+ }
55
+
56
+ export type CompileTarget = "client" | "server";
57
+ export type ServerBootstrapMode = "none" | "out-of-order-reorder";
58
+ export type CompilerFrontend = "oxc";
59
+
60
+ export interface CompilerMetadata {
61
+ frontend: CompilerFrontend;
62
+ typescriptFallback: boolean;
63
+ }
64
+
65
+ export interface ClientReferenceMetadata {
66
+ name: string;
67
+ moduleId: string;
68
+ exportName: string;
69
+ }
70
+
71
+ export interface ComponentMetadata {
72
+ name: string;
73
+ exportName: string;
74
+ }
75
+
76
+ export interface RuntimeImport {
77
+ source: string;
78
+ specifiers: string[];
79
+ }
80
+
81
+ export interface EventHydrationManifestMetadata {
82
+ version: 1;
83
+ events: EventHydrationEntryMetadata[];
84
+ }
85
+
86
+ export interface EventHydrationEntryMetadata {
87
+ id: string;
88
+ event: string;
89
+ handler: string;
90
+ }
package/src/index.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from "./html-escape.js";
2
2
  export * from "./url-safety.js";
3
+ export * from "./compiler-contract.js";