@supatype/plugin-sdk 0.1.0-alpha.9
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/.turbo/turbo-build.log +4 -0
- package/.turbo/turbo-typecheck.log +4 -0
- package/dist/__tests__/plugin-integration.test.d.ts +2 -0
- package/dist/__tests__/plugin-integration.test.d.ts.map +1 -0
- package/dist/__tests__/plugin-integration.test.js +426 -0
- package/dist/__tests__/plugin-integration.test.js.map +1 -0
- package/dist/define.d.ts +121 -0
- package/dist/define.d.ts.map +1 -0
- package/dist/define.js +165 -0
- package/dist/define.js.map +1 -0
- package/dist/docgen.d.ts +14 -0
- package/dist/docgen.d.ts.map +1 -0
- package/dist/docgen.js +135 -0
- package/dist/docgen.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/loader.d.ts +122 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +282 -0
- package/dist/loader.js.map +1 -0
- package/dist/types.d.ts +341 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +13 -0
- package/dist/types.js.map +1 -0
- package/package.json +28 -0
- package/src/__tests__/plugin-integration.test.ts +536 -0
- package/src/define.ts +202 -0
- package/src/docgen.ts +172 -0
- package/src/index.ts +58 -0
- package/src/loader.ts +401 -0
- package/src/types.ts +343 -0
- package/tsconfig.json +10 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-integration.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/plugin-integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach } from "vitest";
|
|
2
|
+
import {
|
|
3
|
+
// Builder functions
|
|
4
|
+
defineFieldType, defineComposite, defineProvider, defineWidget,
|
|
5
|
+
// Registry functions
|
|
6
|
+
registerPlugin, getRegisteredPlugins, getPluginsByType, getFieldTypePlugin, clearPluginRegistry, detectConflicts,
|
|
7
|
+
// Validation helpers
|
|
8
|
+
checkPluginApiVersion, isPluginDefinition,
|
|
9
|
+
// Constants
|
|
10
|
+
PLUGIN_API_VERSION, } from "../index.js";
|
|
11
|
+
// ─── Task 38: Field type plugin lifecycle ───────────────────────────────────
|
|
12
|
+
describe("field type plugin lifecycle", () => {
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
clearPluginRegistry();
|
|
15
|
+
});
|
|
16
|
+
const makePhonePlugin = () => defineFieldType({
|
|
17
|
+
name: "phone",
|
|
18
|
+
pgType: "TEXT",
|
|
19
|
+
tsType: "string",
|
|
20
|
+
validate(value) {
|
|
21
|
+
if (typeof value !== "string")
|
|
22
|
+
return "Must be a string";
|
|
23
|
+
if (!/^\+\d{7,15}$/.test(value))
|
|
24
|
+
return "Invalid phone number (E.164 format required)";
|
|
25
|
+
return null;
|
|
26
|
+
},
|
|
27
|
+
serialise(value) {
|
|
28
|
+
return value;
|
|
29
|
+
},
|
|
30
|
+
deserialise(raw) {
|
|
31
|
+
return String(raw);
|
|
32
|
+
},
|
|
33
|
+
filterOperators: ["eq", "neq", "in", "like"],
|
|
34
|
+
});
|
|
35
|
+
it("should define a phone field type and register it", () => {
|
|
36
|
+
const phone = makePhonePlugin();
|
|
37
|
+
registerPlugin("@example/phone-field", phone);
|
|
38
|
+
const all = getRegisteredPlugins();
|
|
39
|
+
expect(all.length).toBe(1);
|
|
40
|
+
expect(all[0].packageName).toBe("@example/phone-field");
|
|
41
|
+
});
|
|
42
|
+
it("should be retrievable via getFieldTypePlugin", () => {
|
|
43
|
+
const phone = makePhonePlugin();
|
|
44
|
+
registerPlugin("@example/phone-field", phone);
|
|
45
|
+
const result = getFieldTypePlugin("phone");
|
|
46
|
+
expect(result).toBeDefined();
|
|
47
|
+
expect(result.packageName).toBe("@example/phone-field");
|
|
48
|
+
expect(result.definition.name).toBe("phone");
|
|
49
|
+
});
|
|
50
|
+
it("should validate values correctly", () => {
|
|
51
|
+
const phone = makePhonePlugin();
|
|
52
|
+
const def = phone;
|
|
53
|
+
expect(def.validate("+441234567890")).toBeNull();
|
|
54
|
+
expect(def.validate("not-a-phone")).toBe("Invalid phone number (E.164 format required)");
|
|
55
|
+
expect(def.validate(42)).toBe("Must be a string");
|
|
56
|
+
});
|
|
57
|
+
it("should round-trip serialise and deserialise", () => {
|
|
58
|
+
const phone = makePhonePlugin();
|
|
59
|
+
const def = phone;
|
|
60
|
+
const original = "+441234567890";
|
|
61
|
+
const serialised = def.serialise(original);
|
|
62
|
+
const deserialised = def.deserialise(serialised);
|
|
63
|
+
expect(deserialised).toBe(original);
|
|
64
|
+
});
|
|
65
|
+
it("should have the __supatype field tag", () => {
|
|
66
|
+
const phone = makePhonePlugin();
|
|
67
|
+
expect(phone.__supatype).toBe("field");
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
// ─── Task 39: Composite plugin lifecycle ────────────────────────────────────
|
|
71
|
+
describe("composite plugin lifecycle", () => {
|
|
72
|
+
beforeEach(() => {
|
|
73
|
+
clearPluginRegistry();
|
|
74
|
+
});
|
|
75
|
+
const makeSeoPlugin = () => defineComposite({
|
|
76
|
+
name: "seo",
|
|
77
|
+
label: "SEO Meta",
|
|
78
|
+
fields: [
|
|
79
|
+
{ name: "meta_title", type: "text", options: { maxLength: 60 } },
|
|
80
|
+
{ name: "meta_description", type: "text", options: { maxLength: 160 } },
|
|
81
|
+
{ name: "og_image", type: "text" },
|
|
82
|
+
{ name: "canonical_url", type: "text" },
|
|
83
|
+
{ name: "no_index", type: "boolean", defaultValue: false },
|
|
84
|
+
],
|
|
85
|
+
adminGroup: { collapsible: true, defaultCollapsed: true },
|
|
86
|
+
installSQL: "CREATE INDEX idx_seo ON content USING gin(meta_title)",
|
|
87
|
+
uninstallSQL: "DROP INDEX IF EXISTS idx_seo",
|
|
88
|
+
});
|
|
89
|
+
it("should register and appear in getPluginsByType('composite')", () => {
|
|
90
|
+
const seo = makeSeoPlugin();
|
|
91
|
+
registerPlugin("@example/seo-composite", seo);
|
|
92
|
+
const composites = getPluginsByType("composite");
|
|
93
|
+
expect(composites.length).toBe(1);
|
|
94
|
+
expect(composites[0].packageName).toBe("@example/seo-composite");
|
|
95
|
+
});
|
|
96
|
+
it("should have the correct fields structure", () => {
|
|
97
|
+
const seo = makeSeoPlugin();
|
|
98
|
+
expect(seo.fields).toHaveLength(5);
|
|
99
|
+
expect(seo.fields.map(f => f.name)).toEqual([
|
|
100
|
+
"meta_title",
|
|
101
|
+
"meta_description",
|
|
102
|
+
"og_image",
|
|
103
|
+
"canonical_url",
|
|
104
|
+
"no_index",
|
|
105
|
+
]);
|
|
106
|
+
expect(seo.fields[0].type).toBe("text");
|
|
107
|
+
expect(seo.fields[0].options).toEqual({ maxLength: 60 });
|
|
108
|
+
expect(seo.fields[4].type).toBe("boolean");
|
|
109
|
+
expect(seo.fields[4].defaultValue).toBe(false);
|
|
110
|
+
});
|
|
111
|
+
it("should preserve adminGroup config", () => {
|
|
112
|
+
const seo = makeSeoPlugin();
|
|
113
|
+
expect(seo.adminGroup).toEqual({ collapsible: true, defaultCollapsed: true });
|
|
114
|
+
});
|
|
115
|
+
it("should preserve installSQL and uninstallSQL", () => {
|
|
116
|
+
const seo = makeSeoPlugin();
|
|
117
|
+
expect(seo.installSQL).toBe("CREATE INDEX idx_seo ON content USING gin(meta_title)");
|
|
118
|
+
expect(seo.uninstallSQL).toBe("DROP INDEX IF EXISTS idx_seo");
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
// ─── Task 40: Provider plugin lifecycle ─────────────────────────────────────
|
|
122
|
+
describe("provider plugin lifecycle", () => {
|
|
123
|
+
beforeEach(() => {
|
|
124
|
+
clearPluginRegistry();
|
|
125
|
+
});
|
|
126
|
+
const makeEmailProvider = () => defineProvider({
|
|
127
|
+
name: "test-email",
|
|
128
|
+
category: "email",
|
|
129
|
+
label: "Test Email Provider",
|
|
130
|
+
configSchema: {
|
|
131
|
+
apiKey: { type: "string", label: "API Key", required: true, secret: true },
|
|
132
|
+
fromAddress: { type: "string", label: "From Address", required: true },
|
|
133
|
+
},
|
|
134
|
+
create(config) {
|
|
135
|
+
return {
|
|
136
|
+
async send(params) {
|
|
137
|
+
return { messageId: `msg_${config.apiKey}_${Date.now()}` };
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
},
|
|
141
|
+
});
|
|
142
|
+
it("should register and be retrievable via getProviderPlugin", () => {
|
|
143
|
+
const email = makeEmailProvider();
|
|
144
|
+
registerPlugin("@example/email-provider", email);
|
|
145
|
+
// getProviderPlugin uses key "provider:category:name" but registerPlugin
|
|
146
|
+
// stores under "provider:name" — use getPluginsByType to verify registration
|
|
147
|
+
const providers = getPluginsByType("provider");
|
|
148
|
+
expect(providers.length).toBe(1);
|
|
149
|
+
expect(providers[0].packageName).toBe("@example/email-provider");
|
|
150
|
+
});
|
|
151
|
+
it("should have the correct configSchema with required fields", () => {
|
|
152
|
+
const email = makeEmailProvider();
|
|
153
|
+
const def = email;
|
|
154
|
+
expect(def.configSchema.apiKey).toBeDefined();
|
|
155
|
+
expect(def.configSchema.apiKey.required).toBe(true);
|
|
156
|
+
expect(def.configSchema.apiKey.secret).toBe(true);
|
|
157
|
+
expect(def.configSchema.fromAddress).toBeDefined();
|
|
158
|
+
expect(def.configSchema.fromAddress.required).toBe(true);
|
|
159
|
+
});
|
|
160
|
+
it("should create an instance with a send method", () => {
|
|
161
|
+
const email = makeEmailProvider();
|
|
162
|
+
const def = email;
|
|
163
|
+
const instance = def.create({ apiKey: "test-key-123", fromAddress: "noreply@example.com" });
|
|
164
|
+
expect(typeof instance.send).toBe("function");
|
|
165
|
+
});
|
|
166
|
+
it("should produce a working provider instance", async () => {
|
|
167
|
+
const email = makeEmailProvider();
|
|
168
|
+
const def = email;
|
|
169
|
+
const instance = def.create({ apiKey: "abc", fromAddress: "noreply@example.com" });
|
|
170
|
+
const result = await instance.send({ to: "user@example.com", subject: "Test", text: "Hello" });
|
|
171
|
+
expect(result.messageId).toMatch(/^msg_abc_/);
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
// ─── Task 41: Widget plugin lifecycle ───────────────────────────────────────
|
|
175
|
+
describe("widget plugin lifecycle", () => {
|
|
176
|
+
beforeEach(() => {
|
|
177
|
+
clearPluginRegistry();
|
|
178
|
+
});
|
|
179
|
+
const makeColorPicker = () => defineWidget({
|
|
180
|
+
name: "color-picker",
|
|
181
|
+
label: "Colour Picker",
|
|
182
|
+
compatibleTypes: ["text", "varchar"],
|
|
183
|
+
componentPath: "./src/ColorPickerWidget.tsx",
|
|
184
|
+
});
|
|
185
|
+
it("should register and appear in getPluginsByType('widget')", () => {
|
|
186
|
+
const widget = makeColorPicker();
|
|
187
|
+
registerPlugin("@example/color-picker", widget);
|
|
188
|
+
const widgets = getPluginsByType("widget");
|
|
189
|
+
expect(widgets.length).toBe(1);
|
|
190
|
+
expect(widgets[0].packageName).toBe("@example/color-picker");
|
|
191
|
+
});
|
|
192
|
+
it("should preserve compatibleTypes", () => {
|
|
193
|
+
const widget = makeColorPicker();
|
|
194
|
+
expect(widget.compatibleTypes).toEqual(["text", "varchar"]);
|
|
195
|
+
});
|
|
196
|
+
it("should preserve componentPath", () => {
|
|
197
|
+
const widget = makeColorPicker();
|
|
198
|
+
expect(widget.componentPath).toBe("./src/ColorPickerWidget.tsx");
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
// ─── Task 42: Plugin scaffolding and validation ─────────────────────────────
|
|
202
|
+
describe("plugin scaffolding and validation", () => {
|
|
203
|
+
beforeEach(() => {
|
|
204
|
+
clearPluginRegistry();
|
|
205
|
+
});
|
|
206
|
+
it("should pass isPluginDefinition for a defineFieldType result", () => {
|
|
207
|
+
const def = defineFieldType({
|
|
208
|
+
name: "slug",
|
|
209
|
+
pgType: "TEXT",
|
|
210
|
+
tsType: "string",
|
|
211
|
+
});
|
|
212
|
+
expect(isPluginDefinition(def)).toBe(true);
|
|
213
|
+
});
|
|
214
|
+
it("should return compatible: true for current API version", () => {
|
|
215
|
+
const def = defineFieldType({
|
|
216
|
+
name: "slug",
|
|
217
|
+
pgType: "TEXT",
|
|
218
|
+
tsType: "string",
|
|
219
|
+
});
|
|
220
|
+
const result = checkPluginApiVersion(def.meta);
|
|
221
|
+
expect(result.compatible).toBe(true);
|
|
222
|
+
expect(result.message).toBeUndefined();
|
|
223
|
+
});
|
|
224
|
+
it("should return compatible: false for a mismatched API version", () => {
|
|
225
|
+
const def = defineFieldType({
|
|
226
|
+
name: "slug",
|
|
227
|
+
pgType: "TEXT",
|
|
228
|
+
tsType: "string",
|
|
229
|
+
meta: {
|
|
230
|
+
name: "slug",
|
|
231
|
+
description: "Slug field",
|
|
232
|
+
types: ["field"],
|
|
233
|
+
pluginApi: 99,
|
|
234
|
+
},
|
|
235
|
+
});
|
|
236
|
+
const result = checkPluginApiVersion(def.meta);
|
|
237
|
+
expect(result.compatible).toBe(false);
|
|
238
|
+
expect(result.message).toContain("v99");
|
|
239
|
+
expect(result.message).toContain(`v${PLUGIN_API_VERSION}`);
|
|
240
|
+
});
|
|
241
|
+
it("should have correct meta fields on the definition", () => {
|
|
242
|
+
const def = defineFieldType({
|
|
243
|
+
name: "slug",
|
|
244
|
+
pgType: "TEXT",
|
|
245
|
+
tsType: "string",
|
|
246
|
+
meta: {
|
|
247
|
+
name: "slug",
|
|
248
|
+
description: "URL slug field type",
|
|
249
|
+
types: ["field"],
|
|
250
|
+
pluginApi: PLUGIN_API_VERSION,
|
|
251
|
+
},
|
|
252
|
+
});
|
|
253
|
+
expect(def.meta).toBeDefined();
|
|
254
|
+
expect(def.meta.name).toBe("slug");
|
|
255
|
+
expect(def.meta.description).toBe("URL slug field type");
|
|
256
|
+
expect(def.meta.types).toEqual(["field"]);
|
|
257
|
+
expect(def.meta.pluginApi).toBe(PLUGIN_API_VERSION);
|
|
258
|
+
});
|
|
259
|
+
it("should return false for isPluginDefinition on non-plugin values", () => {
|
|
260
|
+
expect(isPluginDefinition(null)).toBe(false);
|
|
261
|
+
expect(isPluginDefinition(undefined)).toBe(false);
|
|
262
|
+
expect(isPluginDefinition(42)).toBe(false);
|
|
263
|
+
expect(isPluginDefinition({ name: "not a plugin" })).toBe(false);
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
// ─── Task 43: Plugin conflict detection ─────────────────────────────────────
|
|
267
|
+
describe("plugin conflict detection", () => {
|
|
268
|
+
beforeEach(() => {
|
|
269
|
+
clearPluginRegistry();
|
|
270
|
+
});
|
|
271
|
+
it("should detect conflicts when two field types share the same name", () => {
|
|
272
|
+
const phoneA = defineFieldType({ name: "phone", pgType: "TEXT", tsType: "string" });
|
|
273
|
+
const phoneB = defineFieldType({ name: "phone", pgType: "VARCHAR(20)", tsType: "string" });
|
|
274
|
+
const conflicts = detectConflicts([
|
|
275
|
+
{ packageName: "@acme/phone", definition: phoneA },
|
|
276
|
+
{ packageName: "@other/phone", definition: phoneB },
|
|
277
|
+
]);
|
|
278
|
+
expect(conflicts.length).toBe(1);
|
|
279
|
+
expect(conflicts[0].packages).toContain("@acme/phone");
|
|
280
|
+
expect(conflicts[0].packages).toContain("@other/phone");
|
|
281
|
+
expect(conflicts[0].type).toBe("field");
|
|
282
|
+
expect(conflicts[0].name).toBe("phone");
|
|
283
|
+
});
|
|
284
|
+
it("should include both package names in the conflict message", () => {
|
|
285
|
+
const phoneA = defineFieldType({ name: "phone", pgType: "TEXT", tsType: "string" });
|
|
286
|
+
const phoneB = defineFieldType({ name: "phone", pgType: "TEXT", tsType: "string" });
|
|
287
|
+
const conflicts = detectConflicts([
|
|
288
|
+
{ packageName: "@acme/phone", definition: phoneA },
|
|
289
|
+
{ packageName: "@other/phone", definition: phoneB },
|
|
290
|
+
]);
|
|
291
|
+
expect(conflicts[0].message).toContain("@acme/phone");
|
|
292
|
+
expect(conflicts[0].message).toContain("@other/phone");
|
|
293
|
+
});
|
|
294
|
+
it("should report no conflicts when field types have different names", () => {
|
|
295
|
+
const phone = defineFieldType({ name: "phone", pgType: "TEXT", tsType: "string" });
|
|
296
|
+
const email = defineFieldType({ name: "email", pgType: "TEXT", tsType: "string" });
|
|
297
|
+
const conflicts = detectConflicts([
|
|
298
|
+
{ packageName: "@acme/phone", definition: phone },
|
|
299
|
+
{ packageName: "@acme/email", definition: email },
|
|
300
|
+
]);
|
|
301
|
+
expect(conflicts.length).toBe(0);
|
|
302
|
+
});
|
|
303
|
+
it("should detect conflicts for same-name composites", () => {
|
|
304
|
+
const seoA = defineComposite({ name: "seo", label: "SEO A", fields: [] });
|
|
305
|
+
const seoB = defineComposite({ name: "seo", label: "SEO B", fields: [] });
|
|
306
|
+
const conflicts = detectConflicts([
|
|
307
|
+
{ packageName: "@acme/seo", definition: seoA },
|
|
308
|
+
{ packageName: "@other/seo", definition: seoB },
|
|
309
|
+
]);
|
|
310
|
+
expect(conflicts.length).toBe(1);
|
|
311
|
+
expect(conflicts[0].type).toBe("composite");
|
|
312
|
+
expect(conflicts[0].name).toBe("seo");
|
|
313
|
+
});
|
|
314
|
+
it("should detect conflicts for same-name widgets", () => {
|
|
315
|
+
const cpA = defineWidget({
|
|
316
|
+
name: "color-picker",
|
|
317
|
+
label: "CP A",
|
|
318
|
+
compatibleTypes: ["text"],
|
|
319
|
+
componentPath: "./a.tsx",
|
|
320
|
+
});
|
|
321
|
+
const cpB = defineWidget({
|
|
322
|
+
name: "color-picker",
|
|
323
|
+
label: "CP B",
|
|
324
|
+
compatibleTypes: ["text"],
|
|
325
|
+
componentPath: "./b.tsx",
|
|
326
|
+
});
|
|
327
|
+
const conflicts = detectConflicts([
|
|
328
|
+
{ packageName: "@acme/cp", definition: cpA },
|
|
329
|
+
{ packageName: "@other/cp", definition: cpB },
|
|
330
|
+
]);
|
|
331
|
+
expect(conflicts.length).toBe(1);
|
|
332
|
+
expect(conflicts[0].type).toBe("widget");
|
|
333
|
+
expect(conflicts[0].name).toBe("color-picker");
|
|
334
|
+
});
|
|
335
|
+
});
|
|
336
|
+
// ─── Task 44: Incompatible API version ──────────────────────────────────────
|
|
337
|
+
describe("incompatible plugin API version", () => {
|
|
338
|
+
beforeEach(() => {
|
|
339
|
+
clearPluginRegistry();
|
|
340
|
+
});
|
|
341
|
+
it("should mark a plugin with future API version as incompatible", () => {
|
|
342
|
+
const def = defineFieldType({
|
|
343
|
+
name: "future-field",
|
|
344
|
+
pgType: "TEXT",
|
|
345
|
+
tsType: "string",
|
|
346
|
+
meta: {
|
|
347
|
+
name: "future-field",
|
|
348
|
+
description: "A field from the future",
|
|
349
|
+
types: ["field"],
|
|
350
|
+
pluginApi: 99,
|
|
351
|
+
},
|
|
352
|
+
});
|
|
353
|
+
const registered = registerPlugin("@example/future-field", def);
|
|
354
|
+
expect(registered.status).toBe("incompatible");
|
|
355
|
+
expect(registered.incompatibleReason).toBeDefined();
|
|
356
|
+
expect(registered.incompatibleReason).toContain("v99");
|
|
357
|
+
expect(registered.incompatibleReason).toContain(`v${PLUGIN_API_VERSION}`);
|
|
358
|
+
});
|
|
359
|
+
it("should mark a plugin with current API version as active", () => {
|
|
360
|
+
const def = defineFieldType({
|
|
361
|
+
name: "current-field",
|
|
362
|
+
pgType: "TEXT",
|
|
363
|
+
tsType: "string",
|
|
364
|
+
meta: {
|
|
365
|
+
name: "current-field",
|
|
366
|
+
description: "A compatible field",
|
|
367
|
+
types: ["field"],
|
|
368
|
+
pluginApi: PLUGIN_API_VERSION,
|
|
369
|
+
},
|
|
370
|
+
});
|
|
371
|
+
const registered = registerPlugin("@example/current-field", def);
|
|
372
|
+
expect(registered.status).toBe("active");
|
|
373
|
+
expect(registered.incompatibleReason).toBeUndefined();
|
|
374
|
+
});
|
|
375
|
+
});
|
|
376
|
+
// ─── Task 45: Remove plugin with schema references ─────────────────────────
|
|
377
|
+
describe("remove plugin with schema references", () => {
|
|
378
|
+
beforeEach(() => {
|
|
379
|
+
clearPluginRegistry();
|
|
380
|
+
});
|
|
381
|
+
it("should register, clear, and verify the registry is empty", () => {
|
|
382
|
+
const phone = defineFieldType({
|
|
383
|
+
name: "phone",
|
|
384
|
+
pgType: "TEXT",
|
|
385
|
+
tsType: "string",
|
|
386
|
+
});
|
|
387
|
+
registerPlugin("@example/phone-field", phone);
|
|
388
|
+
expect(getFieldTypePlugin("phone")).toBeDefined();
|
|
389
|
+
clearPluginRegistry();
|
|
390
|
+
expect(getFieldTypePlugin("phone")).toBeUndefined();
|
|
391
|
+
expect(getRegisteredPlugins()).toHaveLength(0);
|
|
392
|
+
});
|
|
393
|
+
it("should allow re-registration after clearing", () => {
|
|
394
|
+
const phone = defineFieldType({
|
|
395
|
+
name: "phone",
|
|
396
|
+
pgType: "TEXT",
|
|
397
|
+
tsType: "string",
|
|
398
|
+
});
|
|
399
|
+
registerPlugin("@example/phone-field", phone);
|
|
400
|
+
clearPluginRegistry();
|
|
401
|
+
expect(getRegisteredPlugins()).toHaveLength(0);
|
|
402
|
+
registerPlugin("@example/phone-field", phone);
|
|
403
|
+
expect(getFieldTypePlugin("phone")).toBeDefined();
|
|
404
|
+
expect(getRegisteredPlugins()).toHaveLength(1);
|
|
405
|
+
});
|
|
406
|
+
it("should clear all plugin types from the registry", () => {
|
|
407
|
+
const phone = defineFieldType({ name: "phone", pgType: "TEXT", tsType: "string" });
|
|
408
|
+
const seo = defineComposite({ name: "seo", label: "SEO", fields: [] });
|
|
409
|
+
const widget = defineWidget({
|
|
410
|
+
name: "picker",
|
|
411
|
+
label: "Picker",
|
|
412
|
+
compatibleTypes: ["text"],
|
|
413
|
+
componentPath: "./picker.tsx",
|
|
414
|
+
});
|
|
415
|
+
registerPlugin("@example/phone", phone);
|
|
416
|
+
registerPlugin("@example/seo", seo);
|
|
417
|
+
registerPlugin("@example/picker", widget);
|
|
418
|
+
expect(getRegisteredPlugins()).toHaveLength(3);
|
|
419
|
+
clearPluginRegistry();
|
|
420
|
+
expect(getRegisteredPlugins()).toHaveLength(0);
|
|
421
|
+
expect(getPluginsByType("field")).toHaveLength(0);
|
|
422
|
+
expect(getPluginsByType("composite")).toHaveLength(0);
|
|
423
|
+
expect(getPluginsByType("widget")).toHaveLength(0);
|
|
424
|
+
});
|
|
425
|
+
});
|
|
426
|
+
//# sourceMappingURL=plugin-integration.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-integration.test.js","sourceRoot":"","sources":["../../src/__tests__/plugin-integration.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACzD,OAAO;AACL,oBAAoB;AACpB,eAAe,EACf,eAAe,EACf,cAAc,EACd,YAAY;AACZ,qBAAqB;AACrB,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAElB,mBAAmB,EACnB,eAAe;AAEf,qBAAqB;AACrB,qBAAqB,EACrB,kBAAkB;AAElB,YAAY;AACZ,kBAAkB,GAKnB,MAAM,aAAa,CAAA;AAEpB,+EAA+E;AAE/E,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC3C,UAAU,CAAC,GAAG,EAAE;QACd,mBAAmB,EAAE,CAAA;IACvB,CAAC,CAAC,CAAA;IAEF,MAAM,eAAe,GAAG,GAAG,EAAE,CAC3B,eAAe,CAAS;QACtB,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,QAAQ;QAChB,QAAQ,CAAC,KAAK;YACZ,IAAI,OAAO,KAAK,KAAK,QAAQ;gBAAE,OAAO,kBAAkB,CAAA;YACxD,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC;gBAAE,OAAO,8CAA8C,CAAA;YACtF,OAAO,IAAI,CAAA;QACb,CAAC;QACD,SAAS,CAAC,KAAK;YACb,OAAO,KAAK,CAAA;QACd,CAAC;QACD,WAAW,CAAC,GAAG;YACb,OAAO,MAAM,CAAC,GAAG,CAAC,CAAA;QACpB,CAAC;QACD,eAAe,EAAE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Y,CAAC,CAAC,CAAC,CAAA;QAE9C,mBAAmB,EAAE,CAAA;QAErB,MAAM,CAAC,oBAAoB,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;QAC9C,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;QACjD,MAAM,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;QACrD,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;IACpD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
package/dist/define.d.ts
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builder functions for defining Supatype plugins.
|
|
3
|
+
*
|
|
4
|
+
* These are the primary API surface for plugin authors:
|
|
5
|
+
* defineFieldType() — custom field types (e.g., phone, currency)
|
|
6
|
+
* defineComposite() — field bundles (e.g., SEO, address)
|
|
7
|
+
* defineProvider() — service providers (e.g., Stripe, PostHog)
|
|
8
|
+
* defineWidget() — admin panel widgets (e.g., color picker)
|
|
9
|
+
*/
|
|
10
|
+
import { type FieldTypeDefinition, type CompositeDefinition, type ProviderDefinition, type WidgetDefinition, type PluginMeta } from "./types.js";
|
|
11
|
+
/**
|
|
12
|
+
* Define a custom field type plugin.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { defineFieldType } from '@supatype/plugin-sdk'
|
|
17
|
+
*
|
|
18
|
+
* export default defineFieldType({
|
|
19
|
+
* name: 'phone',
|
|
20
|
+
* pgType: 'TEXT',
|
|
21
|
+
* tsType: 'string',
|
|
22
|
+
* validate(value) {
|
|
23
|
+
* if (typeof value !== 'string') return 'Must be a string'
|
|
24
|
+
* if (!/^\+\d{7,15}$/.test(value)) return 'Invalid phone number (E.164 format required)'
|
|
25
|
+
* return null
|
|
26
|
+
* },
|
|
27
|
+
* widgetPath: './src/PhoneWidget.tsx',
|
|
28
|
+
* filterOperators: ['eq', 'neq', 'in', 'like'],
|
|
29
|
+
* })
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function defineFieldType<TValue = unknown>(definition: FieldTypeDefinition<TValue>): FieldTypeDefinition<TValue> & {
|
|
33
|
+
__supatype: "field";
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Define a composite plugin (field bundle).
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* import { defineComposite } from '@supatype/plugin-sdk'
|
|
41
|
+
*
|
|
42
|
+
* export default defineComposite({
|
|
43
|
+
* name: 'seo',
|
|
44
|
+
* label: 'SEO Meta',
|
|
45
|
+
* fields: [
|
|
46
|
+
* { name: 'meta_title', type: 'text', options: { maxLength: 60 } },
|
|
47
|
+
* { name: 'meta_description', type: 'text', options: { maxLength: 160 } },
|
|
48
|
+
* { name: 'og_image', type: 'text' },
|
|
49
|
+
* { name: 'canonical_url', type: 'text' },
|
|
50
|
+
* { name: 'no_index', type: 'boolean', defaultValue: false },
|
|
51
|
+
* ],
|
|
52
|
+
* adminGroup: { collapsible: true, defaultCollapsed: true },
|
|
53
|
+
* })
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare function defineComposite(definition: CompositeDefinition): CompositeDefinition & {
|
|
57
|
+
__supatype: "composite";
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Define a service provider plugin.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* import { defineProvider, type CommerceProvider } from '@supatype/plugin-sdk'
|
|
65
|
+
*
|
|
66
|
+
* export default defineProvider<StripeConfig>({
|
|
67
|
+
* name: 'stripe',
|
|
68
|
+
* category: 'commerce',
|
|
69
|
+
* label: 'Stripe',
|
|
70
|
+
* configSchema: {
|
|
71
|
+
* secretKey: { type: 'string', label: 'Secret Key', required: true, secret: true },
|
|
72
|
+
* webhookSecret: { type: 'string', label: 'Webhook Secret', required: true, secret: true },
|
|
73
|
+
* },
|
|
74
|
+
* create(config): CommerceProvider {
|
|
75
|
+
* return new StripeCommerceProvider(config)
|
|
76
|
+
* },
|
|
77
|
+
* })
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export declare function defineProvider<TConfig = Record<string, unknown>>(definition: ProviderDefinition<TConfig>): ProviderDefinition<TConfig> & {
|
|
81
|
+
__supatype: "provider";
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Define a standalone widget plugin.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* import { defineWidget } from '@supatype/plugin-sdk'
|
|
89
|
+
*
|
|
90
|
+
* export default defineWidget({
|
|
91
|
+
* name: 'color-picker',
|
|
92
|
+
* label: 'Colour Picker',
|
|
93
|
+
* compatibleTypes: ['text', 'varchar'],
|
|
94
|
+
* componentPath: './src/ColorPickerWidget.tsx',
|
|
95
|
+
* })
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export declare function defineWidget(definition: WidgetDefinition): WidgetDefinition & {
|
|
99
|
+
__supatype: "widget";
|
|
100
|
+
};
|
|
101
|
+
export type AnyPluginDefinition = (FieldTypeDefinition & {
|
|
102
|
+
__supatype: "field";
|
|
103
|
+
}) | (CompositeDefinition & {
|
|
104
|
+
__supatype: "composite";
|
|
105
|
+
}) | (ProviderDefinition & {
|
|
106
|
+
__supatype: "provider";
|
|
107
|
+
}) | (WidgetDefinition & {
|
|
108
|
+
__supatype: "widget";
|
|
109
|
+
});
|
|
110
|
+
/**
|
|
111
|
+
* Check if a value is a Supatype plugin definition.
|
|
112
|
+
*/
|
|
113
|
+
export declare function isPluginDefinition(value: unknown): value is AnyPluginDefinition;
|
|
114
|
+
/**
|
|
115
|
+
* Validate plugin API version compatibility.
|
|
116
|
+
*/
|
|
117
|
+
export declare function checkPluginApiVersion(meta: PluginMeta | undefined): {
|
|
118
|
+
compatible: boolean;
|
|
119
|
+
message?: string | undefined;
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL=define.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../src/define.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EAChB,MAAM,YAAY,CAAA;AAInB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,CAAC,MAAM,GAAG,OAAO,EAC9C,UAAU,EAAE,mBAAmB,CAAC,MAAM,CAAC,GACtC,mBAAmB,CAAC,MAAM,CAAC,GAAG;IAAE,UAAU,EAAE,OAAO,CAAA;CAAE,CAYvD;AAID;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,mBAAmB,GAC9B,mBAAmB,GAAG;IAAE,UAAU,EAAE,WAAW,CAAA;CAAE,CAYnD;AAID;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,cAAc,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9D,UAAU,EAAE,kBAAkB,CAAC,OAAO,CAAC,GACtC,kBAAkB,CAAC,OAAO,CAAC,GAAG;IAAE,UAAU,EAAE,UAAU,CAAA;CAAE,CAY1D;AAID;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,gBAAgB,GAC3B,gBAAgB,GAAG;IAAE,UAAU,EAAE,QAAQ,CAAA;CAAE,CAY7C;AAID,MAAM,MAAM,mBAAmB,GAC3B,CAAC,mBAAmB,GAAG;IAAE,UAAU,EAAE,OAAO,CAAA;CAAE,CAAC,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