@stardeck-customer-apps/compose 0.2.0 → 0.4.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/SKILL.md +12 -6
- package/dist/cli.js +289 -161
- package/dist/index.d.mts +39 -21
- package/dist/index.d.ts +39 -21
- package/dist/index.js +289 -161
- package/dist/index.mjs +289 -161
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,49 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
-
/** A data store connected to a project, as the composition rail consumes it. */
|
|
3
|
+
/** A data store (database or storage) connected to a project, as the composition rail consumes it. */
|
|
4
4
|
type ConnectedStore = {
|
|
5
5
|
storeId: string;
|
|
6
6
|
slug: string;
|
|
7
7
|
bindingKey: string | null;
|
|
8
8
|
accessLevel: "read" | "write" | "admin";
|
|
9
|
+
type: "database" | "storage";
|
|
9
10
|
};
|
|
10
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Repo-relative inputs file: the platform's two database reads, as JSON.
|
|
14
|
+
*
|
|
15
|
+
* `@stardeck-customer-apps/compose` runs inside a customer app with no platform
|
|
16
|
+
* database, so the two facts the rail reads from one — the data stores connected
|
|
17
|
+
* to the app and each Module's install row — reach it through this file. The
|
|
18
|
+
* platform writes it (`writeComposeInputs`), compose reads it
|
|
19
|
+
* (`readComposeInputs`); the schema below is the single definition both sides
|
|
20
|
+
* parse against, so a drift on the writing side fails in lib rather than as an
|
|
21
|
+
* unexplained empty datastore binding inside a fork's build.
|
|
22
|
+
*/
|
|
23
|
+
declare const COMPOSE_INPUTS_PATH = "apps/web/stardeck.compose.json";
|
|
24
|
+
declare const composeInputsSchema: z.ZodObject<{
|
|
25
|
+
connectedStores: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
26
|
+
storeId: z.ZodString;
|
|
27
|
+
slug: z.ZodString;
|
|
28
|
+
bindingKey: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
29
|
+
accessLevel: z.ZodEnum<{
|
|
30
|
+
read: "read";
|
|
31
|
+
write: "write";
|
|
32
|
+
admin: "admin";
|
|
33
|
+
}>;
|
|
34
|
+
type: z.ZodDefault<z.ZodEnum<{
|
|
35
|
+
database: "database";
|
|
36
|
+
storage: "storage";
|
|
37
|
+
}>>;
|
|
38
|
+
}, z.core.$strict>>>;
|
|
39
|
+
installs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
40
|
+
installedVersion: z.ZodString;
|
|
41
|
+
datastoreBindings: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
42
|
+
}, z.core.$strict>>>;
|
|
43
|
+
}, z.core.$strict>;
|
|
44
|
+
type ComposeInputsFile = z.infer<typeof composeInputsSchema>;
|
|
45
|
+
type ComposeInputsInstall = ComposeInputsFile["installs"][string];
|
|
46
|
+
|
|
11
47
|
interface ComposeOptions {
|
|
12
48
|
/** Repo root of the customer app (the directory holding `apps/web`). */
|
|
13
49
|
cwd: string;
|
|
@@ -30,28 +66,10 @@ interface ComposeResult {
|
|
|
30
66
|
/** Null when a partial (`--enabled`) compose left the committed list untouched. */
|
|
31
67
|
gitignoreEntries: number | null;
|
|
32
68
|
}
|
|
33
|
-
|
|
34
|
-
declare const COMPOSE_INPUTS_PATH = "apps/web/stardeck.compose.json";
|
|
35
|
-
declare const composeInputsSchema: z.ZodObject<{
|
|
36
|
-
connectedStores: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
37
|
-
storeId: z.ZodString;
|
|
38
|
-
slug: z.ZodString;
|
|
39
|
-
bindingKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
40
|
-
accessLevel: z.ZodEnum<{
|
|
41
|
-
read: "read";
|
|
42
|
-
write: "write";
|
|
43
|
-
admin: "admin";
|
|
44
|
-
}>;
|
|
45
|
-
}, z.core.$strict>>>;
|
|
46
|
-
installs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
47
|
-
installedVersion: z.ZodString;
|
|
48
|
-
datastoreBindings: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
49
|
-
}, z.core.$strict>>>;
|
|
50
|
-
}, z.core.$strict>;
|
|
51
|
-
type ComposeInstall = z.infer<typeof composeInputsSchema>["installs"][string];
|
|
69
|
+
|
|
52
70
|
interface ComposeInputs {
|
|
53
71
|
connectedStores: ConnectedStore[];
|
|
54
|
-
installs: Record<string,
|
|
72
|
+
installs: Record<string, ComposeInputsInstall>;
|
|
55
73
|
}
|
|
56
74
|
/**
|
|
57
75
|
* The platform rail resolves data-store bindings and installed versions from
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,49 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
-
/** A data store connected to a project, as the composition rail consumes it. */
|
|
3
|
+
/** A data store (database or storage) connected to a project, as the composition rail consumes it. */
|
|
4
4
|
type ConnectedStore = {
|
|
5
5
|
storeId: string;
|
|
6
6
|
slug: string;
|
|
7
7
|
bindingKey: string | null;
|
|
8
8
|
accessLevel: "read" | "write" | "admin";
|
|
9
|
+
type: "database" | "storage";
|
|
9
10
|
};
|
|
10
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Repo-relative inputs file: the platform's two database reads, as JSON.
|
|
14
|
+
*
|
|
15
|
+
* `@stardeck-customer-apps/compose` runs inside a customer app with no platform
|
|
16
|
+
* database, so the two facts the rail reads from one — the data stores connected
|
|
17
|
+
* to the app and each Module's install row — reach it through this file. The
|
|
18
|
+
* platform writes it (`writeComposeInputs`), compose reads it
|
|
19
|
+
* (`readComposeInputs`); the schema below is the single definition both sides
|
|
20
|
+
* parse against, so a drift on the writing side fails in lib rather than as an
|
|
21
|
+
* unexplained empty datastore binding inside a fork's build.
|
|
22
|
+
*/
|
|
23
|
+
declare const COMPOSE_INPUTS_PATH = "apps/web/stardeck.compose.json";
|
|
24
|
+
declare const composeInputsSchema: z.ZodObject<{
|
|
25
|
+
connectedStores: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
26
|
+
storeId: z.ZodString;
|
|
27
|
+
slug: z.ZodString;
|
|
28
|
+
bindingKey: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
29
|
+
accessLevel: z.ZodEnum<{
|
|
30
|
+
read: "read";
|
|
31
|
+
write: "write";
|
|
32
|
+
admin: "admin";
|
|
33
|
+
}>;
|
|
34
|
+
type: z.ZodDefault<z.ZodEnum<{
|
|
35
|
+
database: "database";
|
|
36
|
+
storage: "storage";
|
|
37
|
+
}>>;
|
|
38
|
+
}, z.core.$strict>>>;
|
|
39
|
+
installs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
40
|
+
installedVersion: z.ZodString;
|
|
41
|
+
datastoreBindings: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
42
|
+
}, z.core.$strict>>>;
|
|
43
|
+
}, z.core.$strict>;
|
|
44
|
+
type ComposeInputsFile = z.infer<typeof composeInputsSchema>;
|
|
45
|
+
type ComposeInputsInstall = ComposeInputsFile["installs"][string];
|
|
46
|
+
|
|
11
47
|
interface ComposeOptions {
|
|
12
48
|
/** Repo root of the customer app (the directory holding `apps/web`). */
|
|
13
49
|
cwd: string;
|
|
@@ -30,28 +66,10 @@ interface ComposeResult {
|
|
|
30
66
|
/** Null when a partial (`--enabled`) compose left the committed list untouched. */
|
|
31
67
|
gitignoreEntries: number | null;
|
|
32
68
|
}
|
|
33
|
-
|
|
34
|
-
declare const COMPOSE_INPUTS_PATH = "apps/web/stardeck.compose.json";
|
|
35
|
-
declare const composeInputsSchema: z.ZodObject<{
|
|
36
|
-
connectedStores: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
37
|
-
storeId: z.ZodString;
|
|
38
|
-
slug: z.ZodString;
|
|
39
|
-
bindingKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
40
|
-
accessLevel: z.ZodEnum<{
|
|
41
|
-
read: "read";
|
|
42
|
-
write: "write";
|
|
43
|
-
admin: "admin";
|
|
44
|
-
}>;
|
|
45
|
-
}, z.core.$strict>>>;
|
|
46
|
-
installs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
47
|
-
installedVersion: z.ZodString;
|
|
48
|
-
datastoreBindings: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
49
|
-
}, z.core.$strict>>>;
|
|
50
|
-
}, z.core.$strict>;
|
|
51
|
-
type ComposeInstall = z.infer<typeof composeInputsSchema>["installs"][string];
|
|
69
|
+
|
|
52
70
|
interface ComposeInputs {
|
|
53
71
|
connectedStores: ConnectedStore[];
|
|
54
|
-
installs: Record<string,
|
|
72
|
+
installs: Record<string, ComposeInputsInstall>;
|
|
55
73
|
}
|
|
56
74
|
/**
|
|
57
75
|
* The platform rail resolves data-store bindings and installed versions from
|