@use-stall/extensions 0.0.0-stage → 0.1.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/cli/types.ts ADDED
@@ -0,0 +1,285 @@
1
+ import { basename, dirname, resolve } from "node:path";
2
+ import { Refusal, exists, read_json, read_text, safe, write_file } from "./paths";
3
+
4
+ type Schema = { [key: string]: any } | boolean;
5
+
6
+ type Doc = { file: string; root: Schema };
7
+
8
+ export const OUTPUT = "src/endpoints.gen.d.ts";
9
+
10
+ const METHODS = ["GET", "POST", "PUT", "PATCH", "DELETE"];
11
+ const PARTS = ["params", "query", "body", "response"] as const;
12
+ const IDENTIFIER = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
13
+ const PATH = /^(?!.*\/\.{1,2}(\/|$))\/([A-Za-z0-9._~-]+|:[a-z_][a-z0-9_]*)?(\/([A-Za-z0-9._~-]+|:[a-z_][a-z0-9_]*))*$/;
14
+ const FORBIDDEN = new Set(["__proto__", "constructor", "prototype"]);
15
+ const DEPTH = 32;
16
+ const NAMES = 2000;
17
+
18
+ const own = (value: unknown, key: string): any =>
19
+ value && typeof value === "object" && Object.hasOwn(value, key) ? (value as any)[key] : undefined;
20
+
21
+ const is_object = (value: unknown): value is Record<string, any> =>
22
+ !!value && typeof value === "object" && !Array.isArray(value);
23
+
24
+ const pascal = (value: string) => {
25
+ const name =
26
+ value
27
+ .split(/[^A-Za-z0-9]+/)
28
+ .filter(Boolean)
29
+ .map((part) => part[0]!.toUpperCase() + part.slice(1))
30
+ .join("") || "Schema";
31
+ return /^[0-9]/.test(name) ? `T${name}` : name;
32
+ };
33
+
34
+ const key_of = (name: string) => (IDENTIFIER.test(name) ? name : JSON.stringify(name));
35
+
36
+ const pad = (depth: number) => " ".repeat(depth);
37
+
38
+ const wrap = (type: string) => (/[|&]/.test(type) && !/^[\[{(]/.test(type) ? `(${type})` : type);
39
+
40
+ const unescape = (part: string) => {
41
+ let text = part;
42
+ try {
43
+ text = decodeURIComponent(part);
44
+ } catch {
45
+ throw new Refusal(`$ref pointer part '${part}' is malformed`);
46
+ }
47
+ return text.replace(/~1/g, "/").replace(/~0/g, "~");
48
+ };
49
+
50
+ const at = (root: Schema, pointer: string): Schema => {
51
+ let node: any = root;
52
+ for (const part of pointer.split("/").filter(Boolean).map(unescape)) {
53
+ if (FORBIDDEN.has(part)) throw new Refusal(`$ref pointer '#${pointer}' uses a reserved key`);
54
+ if (Array.isArray(node) && /^\d+$/.test(part) && Number(part) < node.length) node = node[Number(part)];
55
+ else if (is_object(node) && Object.hasOwn(node, part)) node = node[part];
56
+ else throw new Refusal(`$ref pointer '#${pointer}' doesn't exist`);
57
+ }
58
+ return node;
59
+ };
60
+
61
+ class Generator {
62
+ private docs = new Map<string, Doc>();
63
+ private names = new Map<string, string>();
64
+ private taken = new Set<string>();
65
+ private decls: string[] = [];
66
+
67
+ constructor(private src: string) {}
68
+
69
+ private load(file: string): Doc {
70
+ const cached = this.docs.get(file);
71
+ if (cached) return cached;
72
+ if (!file.endsWith(".json")) throw new Refusal(`$ref must point to a .json file inside src`);
73
+ const real = safe(this.src, file);
74
+ if (!exists(this.src, real)) throw new Refusal(`$ref '${basename(file)}' doesn't exist`);
75
+ const doc = { file: real, root: read_json<Schema>(this.src, real) };
76
+ this.docs.set(file, doc);
77
+ return doc;
78
+ }
79
+
80
+ private target(ref: string, doc: Doc) {
81
+ const index = ref.indexOf("#");
82
+ const path = index < 0 ? ref : ref.slice(0, index);
83
+ const pointer = index < 0 ? "" : ref.slice(index + 1);
84
+ return { doc: path ? this.load(resolve(dirname(doc.file), path)) : doc, pointer };
85
+ }
86
+
87
+ private claim(base: string, fallback: string) {
88
+ if (this.taken.size > NAMES) throw new Refusal("Endpoint schemas declare too many types");
89
+ let name = base;
90
+ if (this.taken.has(name)) name = `${fallback}${base}`;
91
+ let index = 2;
92
+ while (this.taken.has(name)) name = `${base}${index++}`;
93
+ this.taken.add(name);
94
+ return name;
95
+ }
96
+
97
+ named(name: string, schema: Schema, doc: Doc) {
98
+ const claimed = this.claim(name, "");
99
+ this.decls.push(`export type ${claimed} = ${this.render(schema, doc, 0)};`);
100
+ return claimed;
101
+ }
102
+
103
+ private ref(ref: string, doc: Doc) {
104
+ const { doc: target, pointer } = this.target(ref, doc);
105
+ const id = `${target.file}#${pointer}`;
106
+ const known = this.names.get(id);
107
+ if (known) return known;
108
+ const file = pascal(basename(target.file, ".json"));
109
+ const last = pointer.split("/").filter(Boolean).pop();
110
+ const name = this.claim(last ? pascal(unescape(last)) : file, file);
111
+ this.names.set(id, name);
112
+ const slot = this.decls.push("") - 1;
113
+ this.decls[slot] = `export type ${name} = ${this.render(at(target.root, pointer), target, 0)};`;
114
+ return name;
115
+ }
116
+
117
+ render(schema: Schema, doc: Doc, depth: number): string {
118
+ if (depth > DEPTH) throw new Refusal("Endpoint schemas are nested too deeply");
119
+ if (schema === true) return "unknown";
120
+ if (schema === false) return "never";
121
+ if (!is_object(schema)) return "unknown";
122
+ const ref = own(schema, "$ref");
123
+ if (typeof ref === "string") return this.ref(ref, doc);
124
+ if (Object.hasOwn(schema, "const")) return JSON.stringify(schema.const) ?? "unknown";
125
+ const values = own(schema, "enum");
126
+ if (Array.isArray(values)) return values.map((value) => JSON.stringify(value) ?? "unknown").join(" | ") || "never";
127
+ for (const [key, joiner] of [
128
+ ["anyOf", " | "],
129
+ ["oneOf", " | "],
130
+ ["allOf", " & "],
131
+ ] as const) {
132
+ const items = own(schema, key);
133
+ if (Array.isArray(items)) return items.map((item: Schema) => wrap(this.render(item, doc, depth + 1))).join(joiner) || "never";
134
+ }
135
+ const type = own(schema, "type");
136
+ if (Array.isArray(type))
137
+ return type.map((item) => wrap(this.render({ ...schema, type: String(item) }, doc, depth + 1))).join(" | ");
138
+
139
+ switch (type) {
140
+ case "string":
141
+ return "string";
142
+ case "number":
143
+ case "integer":
144
+ return "number";
145
+ case "boolean":
146
+ return "boolean";
147
+ case "null":
148
+ return "null";
149
+ case "array":
150
+ return this.array(schema, doc, depth);
151
+ case "object":
152
+ return this.object(schema, doc, depth);
153
+ }
154
+ if (own(schema, "properties")) return this.object(schema, doc, depth);
155
+ if (own(schema, "items") || own(schema, "prefixItems")) return this.array(schema, doc, depth);
156
+ return "unknown";
157
+ }
158
+
159
+ private array(schema: Record<string, any>, doc: Doc, depth: number) {
160
+ const prefix = own(schema, "prefixItems");
161
+ const items = own(schema, "items");
162
+ if (Array.isArray(prefix)) {
163
+ const parts = prefix.map((item: Schema) => this.render(item, doc, depth + 1));
164
+ if (items && items !== false) parts.push(`...${wrap(this.render(items, doc, depth + 1))}[]`);
165
+ return `[${parts.join(", ")}]`;
166
+ }
167
+ if (items === undefined) return "unknown[]";
168
+ return `${wrap(this.render(items, doc, depth + 1))}[]`;
169
+ }
170
+
171
+ private object(schema: Record<string, any>, doc: Doc, depth: number) {
172
+ const properties = is_object(own(schema, "properties")) ? own(schema, "properties") : {};
173
+ const listed = own(schema, "required");
174
+ const required = new Set<string>(Array.isArray(listed) ? listed.filter((item) => typeof item === "string") : []);
175
+ const extra = own(schema, "additionalProperties");
176
+ const lines = Object.keys(properties).map((name) => {
177
+ if (FORBIDDEN.has(name)) throw new Refusal(`Endpoint schemas can't declare a '${name}' property`);
178
+ return `${pad(depth + 1)}${key_of(name)}${required.has(name) ? "" : "?"}: ${this.render(properties[name], doc, depth + 1)};`;
179
+ });
180
+ if (extra && typeof extra === "object") {
181
+ const value = lines.length ? "unknown" : this.render(extra, doc, depth + 1);
182
+ lines.push(`${pad(depth + 1)}[key: string]: ${value};`);
183
+ } else if (extra !== false && !lines.length) {
184
+ return "Record<string, unknown>";
185
+ }
186
+ if (!lines.length) return "Record<string, never>";
187
+ return `{\n${lines.join("\n")}\n${pad(depth)}}`;
188
+ }
189
+
190
+ output(endpoints: string) {
191
+ const head = "// Generated from src/extension.json by `stall-extensions types`. Don't edit.";
192
+ const types = this.decls.length ? `${this.decls.join("\n\n")}\n\n` : "";
193
+ return `${head}\n\n${types}declare module "@use-stall/extensions" {\n interface Endpoints {\n${endpoints} }\n}\n\nexport {};\n`;
194
+ }
195
+ }
196
+
197
+ const param = (name: string, schema: Schema) => {
198
+ const properties = own(schema, "properties");
199
+ const property = is_object(properties) ? own(properties, name) : undefined;
200
+ const values = own(property, "enum");
201
+ if (Array.isArray(values) && values.length && values.every((value: unknown) => typeof value === "string" && !/[`$\\]/.test(value)))
202
+ return `\${${values.map((value: string) => JSON.stringify(value)).join(" | ")}}`;
203
+ return "${string}";
204
+ };
205
+
206
+ const has_required = (schema: Schema) => {
207
+ const listed = own(schema, "required");
208
+ return Array.isArray(listed) && listed.length > 0;
209
+ };
210
+
211
+ const manifest_of = (root: string) => read_json<Record<string, unknown>>(root, "src/extension.json");
212
+
213
+ const endpoints_of = (manifest: Record<string, unknown>) => {
214
+ const value = own(manifest, "endpoints");
215
+ if (value === undefined || value === null) return {};
216
+ if (!is_object(value)) throw new Refusal("src/extension.json.endpoints must be an object");
217
+ return value;
218
+ };
219
+
220
+ export const render = (root: string) => {
221
+ const src = safe(root, "src");
222
+ const manifest = manifest_of(root);
223
+ const endpoints = endpoints_of(manifest);
224
+ const gen = new Generator(src);
225
+ const doc: Doc = { file: safe(root, "src/extension.json"), root: manifest as Schema };
226
+
227
+ const blocks = Object.keys(endpoints).map((key) => {
228
+ if (!/^[a-z0-9-]+$/.test(key)) throw new Refusal(`Endpoint key '${key.slice(0, 40)}' must be a lowercase slug`);
229
+ const paths = own(endpoints[key], "paths");
230
+ const methods = (Array.isArray(paths) ? paths : [])
231
+ .filter((entry) => METHODS.includes(own(entry, "method")))
232
+ .map((entry, index) => {
233
+ const method: string = own(entry, "method");
234
+ const route = own(entry, "path");
235
+ if (typeof route !== "string" || route.length > 256 || !PATH.test(route))
236
+ throw new Refusal(`Endpoint '${key}' has an invalid path`);
237
+ const schema = is_object(own(entry, "schema")) ? own(entry, "schema") : {};
238
+ const base = `${pascal(key)}${pascal(method.toLowerCase())}${pascal(route) === "Schema" ? "" : pascal(route)}`;
239
+ const part = (name: (typeof PARTS)[number]) => {
240
+ const value = own(schema, name);
241
+ if (!value || (is_object(value) && !Object.keys(value).length)) return "";
242
+ const local: Doc = { file: `${doc.file}::${key}.${index}.${name}`, root: value };
243
+ if (is_object(value) && typeof own(value, "$ref") === "string") return gen.render(value, local, 2);
244
+ return gen.named(`${base}${pascal(name)}`, value, local);
245
+ };
246
+ const params = own(schema, "params") ?? {};
247
+ const path = route
248
+ .split("/")
249
+ .map((segment) => (segment.startsWith(":") ? param(segment.slice(1), params) : segment))
250
+ .join("/");
251
+ const literal = path.includes("${") ? `\`${path}\`` : JSON.stringify(path);
252
+ const body = part("body");
253
+ const query = part("query");
254
+ const response = part("response") || "unknown";
255
+ const fields = [
256
+ body ? `body: ${body}` : "",
257
+ query ? `query${has_required(own(schema, "query")) ? "" : "?"}: ${query}` : "",
258
+ ].filter(Boolean);
259
+ const optional = !body && !has_required(own(schema, "query"));
260
+ const init = fields.length ? `, init${optional ? "?" : ""}: { ${fields.join("; ")} }` : "";
261
+ return ` ${method.toLowerCase()}(path: ${literal}${init}): Promise<${response}>;`;
262
+ });
263
+ return ` ${key_of(key)}: {\n${methods.join("\n")}\n };\n`;
264
+ });
265
+
266
+ return gen.output(blocks.join(""));
267
+ };
268
+
269
+ const declared = (root: string) => Object.keys(endpoints_of(manifest_of(root))).length > 0;
270
+
271
+ export const write = (root: string) => {
272
+ if (!exists(root, OUTPUT) && !declared(root)) return false;
273
+ const next = render(root);
274
+ if (exists(root, OUTPUT) && read_text(root, OUTPUT) === next) return false;
275
+ write_file(root, OUTPUT, next);
276
+ return true;
277
+ };
278
+
279
+ export const verify = (root: string) => {
280
+ if (!exists(root, OUTPUT)) {
281
+ if (declared(root)) throw new Refusal(`${OUTPUT} is missing; run stall-extensions types`);
282
+ return;
283
+ }
284
+ if (read_text(root, OUTPUT) !== render(root)) throw new Refusal(`${OUTPUT} is out of date; run stall-extensions types`);
285
+ };
package/host.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import type { Host } from "./index";
2
+
3
+ export declare const host: Host;
package/host.js ADDED
@@ -0,0 +1,7 @@
1
+ const unbound = () => {
2
+ throw new Error(
3
+ "@use-stall/extensions/host is provided by Flex or the sandbox at runtime. Build with stall-extensions so it stays external.",
4
+ );
5
+ };
6
+
7
+ export const host = new Proxy(Object.freeze({}), { get: unbound, has: unbound, ownKeys: unbound });
package/index.d.ts ADDED
@@ -0,0 +1,177 @@
1
+ import type {
2
+ ExtensionTable,
3
+ HostQuotes,
4
+ HostScan,
5
+ HostStore,
6
+ HostTaxes,
7
+ PermissionAction,
8
+ PermissionModule,
9
+ StallExtensionConfig,
10
+ UnifiedPaymentCollectionType,
11
+ } from "@use-stall/types";
12
+
13
+ export declare const HOST_VERSION: "2026-12";
14
+ export declare const HOST_MODULE: "@use-stall/extensions/host";
15
+ export declare const REGISTRY: "__STALL_SHARED_MODULES__";
16
+ export declare const SHARED_MODULES: readonly string[];
17
+ export declare const SCOPES: Readonly<Record<string, readonly ExtensionTable[]>>;
18
+
19
+ export declare const parse_scope: (value: string) => { name: string; write: boolean };
20
+ export declare const has_scope: (scopes: readonly string[], name: string, write?: boolean) => boolean;
21
+ export declare const can_read: (scopes: readonly string[], table: string) => boolean;
22
+ export declare const valid_scope: (value: string) => boolean;
23
+
24
+ export type HostVersion = `${number}-${number}`;
25
+
26
+ export type Row = Record<string, any>;
27
+
28
+ export interface Writer<T = Row> {
29
+ get: (id: string) => Promise<T | undefined>;
30
+ create: (row: T) => Promise<T>;
31
+ update: (id: string, patch: Partial<T>) => Promise<T>;
32
+ delete: (id: string) => Promise<void>;
33
+ }
34
+
35
+ export interface Collection<T = Row> {
36
+ toArray: () => Promise<T[]>;
37
+ first: () => Promise<T | undefined>;
38
+ last: () => Promise<T | undefined>;
39
+ count: () => Promise<number>;
40
+ filter: (fn: (row: T) => boolean) => Collection<T>;
41
+ and: (fn: (row: T) => boolean) => Collection<T>;
42
+ limit: (count: number) => Collection<T>;
43
+ offset: (count: number) => Collection<T>;
44
+ reverse: () => Collection<T>;
45
+ sortBy: (key: string) => Promise<T[]>;
46
+ primaryKeys: () => Promise<string[]>;
47
+ }
48
+
49
+ export interface Where<T = Row> {
50
+ equals: (value: unknown) => Collection<T>;
51
+ anyOf: (values: unknown[]) => Collection<T>;
52
+ noneOf: (values: unknown[]) => Collection<T>;
53
+ above: (value: unknown) => Collection<T>;
54
+ below: (value: unknown) => Collection<T>;
55
+ between: (lower: unknown, upper: unknown) => Collection<T>;
56
+ startsWith: (prefix: string) => Collection<T>;
57
+ startsWithIgnoreCase: (prefix: string) => Collection<T>;
58
+ }
59
+
60
+ export interface ReadTable<T = Row> extends Collection<T> {
61
+ get: (id: string) => Promise<T | undefined>;
62
+ bulkGet: (ids: string[]) => Promise<(T | undefined)[]>;
63
+ where: (index: string | Row) => Where<T> & Collection<T>;
64
+ orderBy: (index: string) => Collection<T>;
65
+ toCollection: () => Collection<T>;
66
+ }
67
+
68
+ export interface PayInput {
69
+ order_id: string;
70
+ amount: number;
71
+ currency: string;
72
+ note: string;
73
+ done: string | (() => void);
74
+ }
75
+
76
+ export interface PayResult {
77
+ status: "completed" | "pending" | "cancelled";
78
+ paid: number;
79
+ payments: UnifiedPaymentCollectionType[];
80
+ }
81
+
82
+ export interface RefundInput {
83
+ order_id: string;
84
+ refund_type: "amount" | "line_items";
85
+ reason: string;
86
+ amount?: number;
87
+ line_items?: { id: string; quantity: number; restock: boolean }[];
88
+ allocations?: { payment_id: string; amount: number; tender_id: string }[];
89
+ }
90
+
91
+ export interface RefundQuote {
92
+ currency: string;
93
+ paid: number;
94
+ refunded: number;
95
+ refundable: number;
96
+ amount: number;
97
+ lines: {
98
+ id: string;
99
+ name: string;
100
+ ordered: number;
101
+ refunded: number;
102
+ available: number;
103
+ unit: number;
104
+ quantity: number;
105
+ total: number;
106
+ restock: boolean;
107
+ }[];
108
+ allocations: {
109
+ payment_id: string;
110
+ name: string;
111
+ logo: string;
112
+ currency: string;
113
+ route: "provider" | "manual";
114
+ tender_id: string;
115
+ amount: number;
116
+ value: number;
117
+ refundable: number;
118
+ }[];
119
+ tenders: { id: string; title: string; logo: string }[];
120
+ issues: string[];
121
+ }
122
+
123
+ export interface SessionUser {
124
+ id: string;
125
+ fullname: string;
126
+ email: string;
127
+ role: string;
128
+ locations: string[];
129
+ }
130
+
131
+ export interface SessionDevice {
132
+ id: string;
133
+ name: string;
134
+ locations: string[];
135
+ }
136
+
137
+ export interface Endpoints {}
138
+
139
+ export interface Host {
140
+ extension: () => { id: string; scopes: string[] };
141
+ db: Record<ExtensionTable, ReadTable>;
142
+ useLiveQuery: {
143
+ <T>(query: () => Promise<T> | T, deps?: unknown[]): T | undefined;
144
+ <T, D>(query: () => Promise<T> | T, deps: unknown[], initial: D): T | D;
145
+ };
146
+ offline_id: () => string;
147
+ customers: Writer;
148
+ orders: Writer;
149
+ payments: Pick<Writer, "get">;
150
+ pay: (input: PayInput) => Promise<PayResult>;
151
+ fulfillments: Writer & HostQuotes;
152
+ taxes: HostTaxes;
153
+ store: HostStore;
154
+ scan: HostScan;
155
+ endpoints: Endpoints;
156
+ refunds: {
157
+ quote: (input: RefundInput) => Promise<RefundQuote>;
158
+ create: (input: RefundInput) => Promise<Row>;
159
+ };
160
+ reports: {
161
+ orders: (query?: Record<string, string>) => Promise<unknown>;
162
+ payments: (query?: Record<string, string>) => Promise<unknown>;
163
+ };
164
+ session: {
165
+ user: () => SessionUser | null;
166
+ location: () => Row | null;
167
+ device: () => SessionDevice | null;
168
+ currency: () => string;
169
+ active_currency: () => string;
170
+ rates: () => Record<string, number>;
171
+ };
172
+ can: (module: PermissionModule, action: PermissionAction) => Promise<boolean>;
173
+ }
174
+
175
+ export interface ExtensionManifest extends StallExtensionConfig {
176
+ host: string;
177
+ }
package/index.js ADDED
@@ -0,0 +1,59 @@
1
+ export const HOST_VERSION = "2026-12";
2
+
3
+ export const HOST_MODULE = "@use-stall/extensions/host";
4
+
5
+ export const REGISTRY = "__STALL_SHARED_MODULES__";
6
+
7
+ export const SHARED_MODULES = Object.freeze([
8
+ "react",
9
+ "react-dom",
10
+ "react/jsx-runtime",
11
+ "react/jsx-dev-runtime",
12
+ "react-router-dom",
13
+ "sonner",
14
+ "framer-motion",
15
+ "@use-stall/icons",
16
+ "@use-stall/types",
17
+ "@use-stall/ui",
18
+ "zustand",
19
+ "zustand/middleware",
20
+ HOST_MODULE,
21
+ ]);
22
+
23
+ export const SCOPES = Object.freeze({
24
+ locations: Object.freeze(["locations"]),
25
+ catalog: Object.freeze(["catalog"]),
26
+ products: Object.freeze(["products"]),
27
+ variants: Object.freeze(["variants"]),
28
+ categories: Object.freeze(["categories"]),
29
+ collections: Object.freeze(["collections"]),
30
+ inventory: Object.freeze(["inventory_levels"]),
31
+ customers: Object.freeze(["customers"]),
32
+ orders: Object.freeze(["orders", "parked_orders"]),
33
+ refunds: Object.freeze(["refunds"]),
34
+ payments: Object.freeze(["payments"]),
35
+ payment_methods: Object.freeze(["payment_methods"]),
36
+ fulfillments: Object.freeze(["fulfillments"]),
37
+ fulfillment_methods: Object.freeze(["fulfillment_methods"]),
38
+ taxes: Object.freeze(["tax_classes", "tax_rates"]),
39
+ sales_channels: Object.freeze([]),
40
+ register_sessions: Object.freeze(["register_sessions", "register_transactions"]),
41
+ reports: Object.freeze([]),
42
+ });
43
+
44
+ export const parse_scope = (value) => {
45
+ const [name = "", mode = ""] = String(value).split(":");
46
+ return { name, write: mode === "write" };
47
+ };
48
+
49
+ export const has_scope = (scopes, name, write = false) =>
50
+ scopes.some((value) => {
51
+ const scope = parse_scope(value);
52
+ return scope.name === name && (!write || scope.write);
53
+ });
54
+
55
+ export const can_read = (scopes, table) =>
56
+ scopes.some((value) => (SCOPES[parse_scope(value).name] ?? []).includes(table));
57
+
58
+ export const valid_scope = (value) =>
59
+ /^[a-z_]+(:write)?$/.test(String(value)) && Object.hasOwn(SCOPES, parse_scope(value).name);
package/package.json CHANGED
@@ -1,6 +1,73 @@
1
1
  {
2
2
  "name": "@use-stall/extensions",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "SDK for building Stall Flex extensions: host contract, stall-extensions CLI and sandbox",
5
+ "author": "Stall",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "types": "./index.d.ts",
9
+ "main": "./index.js",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./index.d.ts",
13
+ "default": "./index.js"
14
+ },
15
+ "./host": {
16
+ "types": "./host.d.ts",
17
+ "default": "./host.js"
18
+ },
19
+ "./schema.json": "./schema/extension.schema.json",
20
+ "./package.json": "./package.json"
21
+ },
22
+ "bin": {
23
+ "stall-extensions": "./cli/bin.js"
24
+ },
25
+ "files": [
26
+ "index.js",
27
+ "index.d.ts",
28
+ "host.js",
29
+ "host.d.ts",
30
+ "bunfig.toml",
31
+ "cli",
32
+ "sandbox",
33
+ "schema",
34
+ "README.md"
35
+ ],
36
+ "engines": {
37
+ "bun": ">=1.2.0"
38
+ },
39
+ "keywords": [
40
+ "stall",
41
+ "stall-flex",
42
+ "extensions",
43
+ "pos"
44
+ ],
45
+ "scripts": {
46
+ "test": "bun test",
47
+ "typecheck": "tsc --noEmit",
48
+ "styles": "bun scripts/styles.ts",
49
+ "prepublishOnly": "bun test && tsc --noEmit"
50
+ },
51
+ "peerDependencies": {
52
+ "@use-stall/icons": ">=0.2.4",
53
+ "@use-stall/types": ">=0.11.3",
54
+ "@use-stall/ui": ">=0.2.5",
55
+ "react": "^19.0.0",
56
+ "react-dom": "^19.0.0",
57
+ "react-router-dom": "^7.0.0",
58
+ "sonner": "^2.0.0"
59
+ },
60
+ "devDependencies": {
61
+ "@types/bun": "1.4.5",
62
+ "@types/react": "19.2.14",
63
+ "@types/react-dom": "19.2.3",
64
+ "@use-stall/icons": "0.2.4",
65
+ "@use-stall/types": "0.11.3",
66
+ "@use-stall/ui": "0.2.5",
67
+ "react": "19.2.4",
68
+ "react-dom": "19.2.4",
69
+ "react-router-dom": "7.13.0",
70
+ "sonner": "2.0.7",
71
+ "typescript": "5.9.3"
72
+ }
73
+ }