@gjsify/resolve-npm 0.44.0 → 0.45.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.
package/lib/index.d.ts CHANGED
@@ -5,68 +5,92 @@ export declare const EXTERNALS_NODE: string[];
5
5
  export declare const EXTERNALS_NPM: string[];
6
6
 
7
7
  /** General record of modules for Gjs */
8
- export declare const ALIASES_GENERAL_FOR_GJS: {[alias:string]: string};
8
+ export declare const ALIASES_GENERAL_FOR_GJS: { [alias: string]: string };
9
9
 
10
10
  /** Record of Node.js modules (build in or not) and his replacement for Gjs */
11
- export declare const ALIASES_NODE_FOR_GJS: {[alias:string]: string};
11
+ export declare const ALIASES_NODE_FOR_GJS: { [alias: string]: string };
12
12
 
13
13
  /**
14
14
  * Record of Node.js modules (build in or not) and his replacement for `--app browser`.
15
15
  * Unwired in this PR — exported for future consumption by browser.ts.
16
16
  */
17
- export declare const ALIASES_NODE_FOR_BROWSER: {[alias:string]: string};
18
- export declare const ALIASES_NODE_FOR_NATIVESCRIPT: {[alias:string]: string};
17
+ export declare const ALIASES_NODE_FOR_BROWSER: { [alias: string]: string };
18
+ export declare const ALIASES_NODE_FOR_NATIVESCRIPT: { [alias: string]: string };
19
19
 
20
20
  /** Record of Web modules and his replacement for Gjs */
21
- export declare const ALIASES_WEB_FOR_GJS: {[alias:string]: string};
21
+ export declare const ALIASES_WEB_FOR_GJS: { [alias: string]: string };
22
22
 
23
23
  /** General record of modules for Deno */
24
- export declare const ALIASES_GENERAL_FOR_DENO: {[alias:string]: string};
24
+ export declare const ALIASES_GENERAL_FOR_DENO: { [alias: string]: string };
25
25
 
26
26
  /** Record of Gjs modules (build in or not) and his replacement for Deno */
27
- export declare const ALIASES_GJS_FOR_DENO: {[alias:string]: string};
27
+ export declare const ALIASES_GJS_FOR_DENO: { [alias: string]: string };
28
28
 
29
29
  /** Record of Node.js modules (build in or not) and his replacement for Deno */
30
- export declare const ALIASES_NODE_FOR_DENO: {[alias:string]: string};
30
+ export declare const ALIASES_NODE_FOR_DENO: { [alias: string]: string };
31
31
 
32
32
  /** General record of modules for Node */
33
- export declare const ALIASES_GENERAL_FOR_NODE: {[alias:string]: string};
33
+ export declare const ALIASES_GENERAL_FOR_NODE: { [alias: string]: string };
34
34
 
35
35
  /** Record of Gjs modules (build in or not) and his replacement for Node */
36
- export declare const ALIASES_GJS_FOR_NODE: {[alias:string]: string};
36
+ export declare const ALIASES_GJS_FOR_NODE: { [alias: string]: string };
37
37
 
38
38
  /** Record of Web modules and his replacement for Node */
39
- export declare const ALIASES_WEB_FOR_NODE: {[alias:string]: string};
39
+ export declare const ALIASES_WEB_FOR_NODE: { [alias: string]: string };
40
40
 
41
41
  /** Runtime-slot type carried by `package.json#gjsify.runtimes.<target>`. */
42
42
  export type RuntimeSlot = 'polyfill' | 'native' | 'partial' | 'none';
43
43
 
44
- /** Per-package runtime triplet — `{gjs, node, browser}` × {RuntimeSlot}. */
44
+ /**
45
+ * Per-package runtime quintuplet — `{gjs, node, browser, nativescript,
46
+ * react-native}` × {RuntimeSlot}. The name is legacy; `runtime-aliases.mjs`'s
47
+ * `VALID_TARGETS` is the canonical list.
48
+ *
49
+ * `nativescript` was missing here for the whole life of the 4th slot: the runtime
50
+ * read it, the type denied it, and nothing compared the two — which is why the 5th
51
+ * arrives with both halves in one change.
52
+ */
45
53
  export interface RuntimeTriplet {
46
54
  gjs?: RuntimeSlot;
47
55
  node?: RuntimeSlot;
48
56
  browser?: RuntimeSlot;
57
+ nativescript?: RuntimeSlot;
58
+ 'react-native'?: RuntimeSlot;
49
59
  }
50
60
 
61
+ /** The runtimes a package can declare a slot for. */
62
+ export type RuntimeTarget = 'gjs' | 'node' | 'browser' | 'nativescript' | 'react-native';
63
+
51
64
  /**
52
65
  * Build a derived `@gjsify/<X>` alias map for the given target runtime, driven
53
66
  * by each workspace package's declared `gjsify.runtimes` triplet. See
54
67
  * `runtime-aliases.mjs` for the routing semantics.
55
68
  */
56
- export declare function getDerivedAliasesSync(target: 'gjs' | 'node' | 'browser' | 'nativescript'): {[alias: string]: string};
69
+ export declare function getDerivedAliasesSync(target: RuntimeTarget): { [alias: string]: string };
57
70
 
58
71
  /** Async variant of {@link getDerivedAliasesSync}. */
59
- export declare function getDerivedAliases(
60
- target: 'gjs' | 'node' | 'browser' | 'nativescript',
61
- ): Promise<{[alias: string]: string}>;
72
+ export declare function getDerivedAliases(target: RuntimeTarget): Promise<{ [alias: string]: string }>;
62
73
 
63
74
  /** Reset the in-memory cache. Test-only. */
64
75
  export declare function resetRuntimeAliasesCache(): void;
65
76
 
66
- /** Diagnostic — list every declared runtime triplet keyed by package name. */
67
- export declare function listDeclaredRuntimes(): Promise<Map<string, {
68
- name: string;
69
- dir: string;
70
- runtimes: RuntimeTriplet;
71
- hasGlobals: boolean;
72
- }>>;
77
+ /**
78
+ * Diagnostic — list every declared runtime triplet keyed by package name.
79
+ *
80
+ * `platformEntries` (the `./<target>` subpaths the package's `exports` declares, which is
81
+ * what `polyfill` routes to under ADR 0014) was missing here for the same reason
82
+ * `nativescript` was missing from {@link RuntimeTriplet}: the record is built in
83
+ * `runtime-aliases.mjs` and restated here by hand.
84
+ */
85
+ export declare function listDeclaredRuntimes(): Promise<
86
+ Map<
87
+ string,
88
+ {
89
+ name: string;
90
+ dir: string;
91
+ runtimes: RuntimeTriplet;
92
+ hasGlobals: boolean;
93
+ platformEntries: Set<string>;
94
+ }
95
+ >
96
+ >;