@dowel-ui/registry 0.4.0 → 0.7.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/dist/build.d.ts CHANGED
@@ -1,11 +1,16 @@
1
- import { o as RegistryItem } from "./schema-Cc32v3R-.js";
1
+ import { s as RegistryItem } from "./schema-BmYeKe9e.js";
2
2
  //#region src/build.d.ts
3
3
  declare function buildRegistry(): RegistryItem[];
4
+ /** Items whose source anyone may fetch. */
5
+ declare function freeItems(items: RegistryItem[]): RegistryItem[];
6
+ /** Items whose source requires a licence. */
7
+ declare function proItems(items: RegistryItem[]): RegistryItem[];
4
8
  declare function buildIndex(items: RegistryItem[]): {
5
9
  registryVersion: 1;
6
10
  generatedFrom: string;
7
11
  items: {
8
12
  type: "registry:ui" | "registry:lib" | "registry:hook" | "registry:theme" | "registry:block";
13
+ access: "free" | "pro";
9
14
  name: string;
10
15
  title: string;
11
16
  description: string;
@@ -17,10 +22,33 @@ declare function buildIndex(items: RegistryItem[]): {
17
22
  }[];
18
23
  $schema?: string | undefined;
19
24
  };
20
- declare function writeRegistry(outDir: string): {
25
+ interface WriteResult {
21
26
  items: number;
22
27
  files: number;
23
- };
28
+ /** Items whose body was withheld from the public directory. */
29
+ licensed: number;
30
+ }
31
+ /**
32
+ * Writes the public registry.
33
+ *
34
+ * The index lists everything, including licensed items — that is the catalogue,
35
+ * and an item nobody can see is an item nobody buys. What it does *not* write is
36
+ * a licensed item's body: those files never touch the directory a CDN serves,
37
+ * because a paywall that can be stepped around by fetching the JSON directly is
38
+ * not a paywall. Their bodies go to `writeLicensedModule` instead, behind a
39
+ * request the server can refuse.
40
+ */
41
+ declare function writeRegistry(outDir: string): WriteResult;
42
+ /**
43
+ * Writes the licensed item bodies as a TypeScript module.
44
+ *
45
+ * A module rather than a directory of JSON, because the server that serves
46
+ * these runs on a platform that traces imports to decide what to deploy. A file
47
+ * read at runtime from a path the bundler never saw is a file that is not there
48
+ * in production — and the failure appears only once someone with a valid
49
+ * licence tries to install something.
50
+ */
51
+ declare function writeLicensedModule(outFile: string): number;
24
52
  //#endregion
25
- export { buildIndex, buildRegistry, writeRegistry };
53
+ export { WriteResult, buildIndex, buildRegistry, freeItems, proItems, writeLicensedModule, writeRegistry };
26
54
  //# sourceMappingURL=build.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","names":[],"sources":["../src/build.ts"],"mappings":";;iBA4IgB,iBAAiB;iBASjB,WAAW,OAAO;;;;;;;;;;;;;;;;iBAuBlB,cAAc;EAAmB;EAAe"}
1
+ {"version":3,"file":"build.d.ts","names":[],"sources":["../src/build.ts"],"mappings":";;iBA6IgB,iBAAiB;;iBAUjB,UAAU,OAAO,iBAAiB;;iBAKlC,SAAS,OAAO,iBAAiB;iBAIjC,WAAW,OAAO;;;;;;;;;;;;;;;;;UAwBjB;EACf;EACA;;EAEA;;;;;;;;;;;;iBAac,cAAc,iBAAiB;;;;;;;;;;iBA6B/B,oBAAoB"}