@7k-inari/ui-plugin-sdk 0.1.1
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/README.md +46 -0
- package/bin/create-inari-ui-extension.mjs +10 -0
- package/bin/inari-ui-ext.mjs +38 -0
- package/dist/api-CJrl4sLH.d.cts +167 -0
- package/dist/api-CJrl4sLH.d.ts +167 -0
- package/dist/chunk-OCKSMPCZ.js +103 -0
- package/dist/chunk-OCKSMPCZ.js.map +1 -0
- package/dist/harness/index.cjs +197 -0
- package/dist/harness/index.cjs.map +1 -0
- package/dist/harness/index.d.cts +32 -0
- package/dist/harness/index.d.ts +32 -0
- package/dist/harness/index.js +169 -0
- package/dist/harness/index.js.map +1 -0
- package/dist/index.cjs +268 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +80 -0
- package/dist/index.d.ts +80 -0
- package/dist/index.js +137 -0
- package/dist/index.js.map +1 -0
- package/dist/testing/index.cjs +164 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +11 -0
- package/dist/testing/index.d.ts +11 -0
- package/dist/testing/index.js +52 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/tokens/index.cjs +60 -0
- package/dist/tokens/index.cjs.map +1 -0
- package/dist/tokens/index.d.cts +41 -0
- package/dist/tokens/index.d.ts +41 -0
- package/dist/tokens/index.js +35 -0
- package/dist/tokens/index.js.map +1 -0
- package/harness/shell/index.html +12 -0
- package/harness/shell/main.tsx +222 -0
- package/harness/shell/vite.config.ts +6 -0
- package/package.json +80 -0
- package/src/tokens/tokens.css +26 -0
- package/templates/extension/package.json +21 -0
- package/templates/extension/src/index.tsx +29 -0
- package/templates/extension/tsconfig.json +12 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// harness/index.ts
|
|
21
|
+
var harness_exports = {};
|
|
22
|
+
__export(harness_exports, {
|
|
23
|
+
createMockControlPlane: () => createMockControlPlane,
|
|
24
|
+
startDevHarness: () => startDevHarness,
|
|
25
|
+
startMockControlPlane: () => startMockControlPlane
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(harness_exports);
|
|
28
|
+
var import_node_fs = require("fs");
|
|
29
|
+
var import_node_url = require("url");
|
|
30
|
+
var import_vite = require("vite");
|
|
31
|
+
|
|
32
|
+
// harness/server.ts
|
|
33
|
+
var import_node_http = require("http");
|
|
34
|
+
var defaultFixtures = {
|
|
35
|
+
tenants: [
|
|
36
|
+
{ orgId: "org:acme", orgName: "Acme", team: "platform-team" },
|
|
37
|
+
{ orgId: "org:globex", orgName: "Globex" }
|
|
38
|
+
],
|
|
39
|
+
clusters: [
|
|
40
|
+
{
|
|
41
|
+
id: "cluster-1",
|
|
42
|
+
name: "dev-eu-1",
|
|
43
|
+
tenantId: "org:acme",
|
|
44
|
+
state: "Active",
|
|
45
|
+
kubernetesVersion: "1.31",
|
|
46
|
+
labels: { env: "dev", region: "eu-west-1" }
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
catalogItems: [
|
|
50
|
+
{
|
|
51
|
+
id: "item-1",
|
|
52
|
+
name: "namespace-as-a-service",
|
|
53
|
+
source: "curated",
|
|
54
|
+
version: "1.0.0",
|
|
55
|
+
description: "Golden-path namespace"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
resources: [
|
|
59
|
+
{
|
|
60
|
+
id: "res-1",
|
|
61
|
+
catalogItemId: "item-1",
|
|
62
|
+
clusterId: "cluster-1",
|
|
63
|
+
name: "demo-ns",
|
|
64
|
+
namespace: "demo-ns",
|
|
65
|
+
health: "Healthy",
|
|
66
|
+
ownerTeam: "platform-team"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
approvals: []
|
|
70
|
+
};
|
|
71
|
+
function readBody(req) {
|
|
72
|
+
return new Promise((resolve) => {
|
|
73
|
+
let data = "";
|
|
74
|
+
req.on("data", (c) => data += c);
|
|
75
|
+
req.on("end", () => resolve(data));
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
function createMockControlPlane(fixtures = {}) {
|
|
79
|
+
const fx = { ...defaultFixtures, ...fixtures };
|
|
80
|
+
return (0, import_node_http.createServer)(async (req, res) => {
|
|
81
|
+
const url = new URL(req.url ?? "/", "http://localhost");
|
|
82
|
+
const path = url.pathname;
|
|
83
|
+
res.setHeader("content-type", "application/json");
|
|
84
|
+
res.setHeader("access-control-allow-origin", "*");
|
|
85
|
+
res.setHeader("access-control-allow-headers", "content-type, authorization");
|
|
86
|
+
res.setHeader("access-control-allow-methods", "GET,POST,OPTIONS");
|
|
87
|
+
if (req.method === "OPTIONS") {
|
|
88
|
+
res.statusCode = 204;
|
|
89
|
+
res.end();
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const send = (body, status = 200) => {
|
|
93
|
+
res.statusCode = status;
|
|
94
|
+
res.end(JSON.stringify(body));
|
|
95
|
+
};
|
|
96
|
+
if (req.method === "GET" && path === "/api/v1/tenants") return send(fx.tenants);
|
|
97
|
+
if (req.method === "GET" && path === "/api/v1/clusters") return send(fx.clusters);
|
|
98
|
+
if (req.method === "GET" && path === "/api/v1/catalog/items") return send(fx.catalogItems);
|
|
99
|
+
if (req.method === "GET" && path === "/api/v1/resources") return send(fx.resources);
|
|
100
|
+
if (req.method === "GET" && path === "/api/v1/approvals") return send(fx.approvals);
|
|
101
|
+
const clusterMatch = path.match(/^\/api\/v1\/clusters\/([^/]+)$/);
|
|
102
|
+
if (req.method === "GET" && clusterMatch) {
|
|
103
|
+
const c = fx.clusters.find((x) => x.id === clusterMatch[1]);
|
|
104
|
+
return c ? send(c) : send({ message: "not found" }, 404);
|
|
105
|
+
}
|
|
106
|
+
const resMatch = path.match(/^\/api\/v1\/resources\/([^/]+)$/);
|
|
107
|
+
if (req.method === "GET" && resMatch) {
|
|
108
|
+
const r = fx.resources.find((x) => x.id === resMatch[1]);
|
|
109
|
+
return r ? send(r) : send({ message: "not found" }, 404);
|
|
110
|
+
}
|
|
111
|
+
const approveMatch = path.match(/^\/api\/v1\/approvals\/([^/]+)\/approve$/);
|
|
112
|
+
if (req.method === "POST" && approveMatch) {
|
|
113
|
+
await readBody(req);
|
|
114
|
+
return send({ id: approveMatch[1], state: "approved" });
|
|
115
|
+
}
|
|
116
|
+
send({ message: "not found" }, 404);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
function startMockControlPlane(port, fixtures) {
|
|
120
|
+
const server = createMockControlPlane(fixtures);
|
|
121
|
+
return new Promise((resolve) => {
|
|
122
|
+
server.listen(port, () => {
|
|
123
|
+
const addr = server.address();
|
|
124
|
+
const actualPort = typeof addr === "object" && addr ? addr.port : port;
|
|
125
|
+
resolve({
|
|
126
|
+
server,
|
|
127
|
+
url: `http://localhost:${actualPort}`,
|
|
128
|
+
close: () => new Promise((r) => server.close(() => r()))
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// harness/index.ts
|
|
135
|
+
var import_meta = {};
|
|
136
|
+
function resolveShellRoot() {
|
|
137
|
+
const srcLayout = (0, import_node_url.fileURLToPath)(new URL("./shell", import_meta.url));
|
|
138
|
+
if ((0, import_node_fs.existsSync)(srcLayout)) return srcLayout;
|
|
139
|
+
return (0, import_node_url.fileURLToPath)(new URL("../../harness/shell", import_meta.url));
|
|
140
|
+
}
|
|
141
|
+
function resolveSdkEntry() {
|
|
142
|
+
const srcLayout = (0, import_node_url.fileURLToPath)(new URL("../src/index.ts", import_meta.url));
|
|
143
|
+
if ((0, import_node_fs.existsSync)(srcLayout)) return srcLayout;
|
|
144
|
+
return (0, import_node_url.fileURLToPath)(new URL("../index.js", import_meta.url));
|
|
145
|
+
}
|
|
146
|
+
async function startDevHarness(options) {
|
|
147
|
+
const port = options.port ?? 5173;
|
|
148
|
+
const apiPort = options.apiPort ?? 9099;
|
|
149
|
+
const api = await startMockControlPlane(apiPort, options.fixtures);
|
|
150
|
+
const shellRoot = resolveShellRoot();
|
|
151
|
+
const sdkEntry = resolveSdkEntry();
|
|
152
|
+
const vite = await (0, import_vite.createServer)({
|
|
153
|
+
root: shellRoot,
|
|
154
|
+
server: { port },
|
|
155
|
+
plugins: [
|
|
156
|
+
{
|
|
157
|
+
name: "inari-harness-config",
|
|
158
|
+
transformIndexHtml() {
|
|
159
|
+
return [
|
|
160
|
+
{
|
|
161
|
+
tag: "script",
|
|
162
|
+
injectTo: "head-prepend",
|
|
163
|
+
children: [
|
|
164
|
+
`window.__INARI_API_URL__ = ${JSON.stringify(api.url)};`,
|
|
165
|
+
`window.__INARI_EXTENSION_ENTRY__ = ${JSON.stringify(`/@fs${options.extensionEntry}`)};`
|
|
166
|
+
].join("\n")
|
|
167
|
+
}
|
|
168
|
+
];
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
],
|
|
172
|
+
resolve: {
|
|
173
|
+
alias: [{ find: "@inari/ui-plugin-sdk", replacement: sdkEntry }],
|
|
174
|
+
dedupe: ["react", "react-dom", "react-router-dom", "zod"]
|
|
175
|
+
},
|
|
176
|
+
optimizeDeps: { noDiscovery: true },
|
|
177
|
+
logLevel: "warn"
|
|
178
|
+
});
|
|
179
|
+
await vite.listen();
|
|
180
|
+
const actualUrl = vite.resolvedUrls?.local[0] ?? `http://localhost:${port}/`;
|
|
181
|
+
return {
|
|
182
|
+
url: actualUrl.replace(/\/$/, ""),
|
|
183
|
+
apiUrl: api.url,
|
|
184
|
+
vite,
|
|
185
|
+
close: async () => {
|
|
186
|
+
await vite.close();
|
|
187
|
+
await api.close();
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
192
|
+
0 && (module.exports = {
|
|
193
|
+
createMockControlPlane,
|
|
194
|
+
startDevHarness,
|
|
195
|
+
startMockControlPlane
|
|
196
|
+
});
|
|
197
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../harness/index.ts","../../harness/server.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { fileURLToPath } from 'node:url';\nimport { createServer as createViteServer, type ViteDevServer } from 'vite';\nimport { startMockControlPlane, type MockFixtures } from './server.js';\n\nfunction resolveShellRoot(): string {\n const srcLayout = fileURLToPath(new URL('./shell', import.meta.url));\n if (existsSync(srcLayout)) return srcLayout;\n return fileURLToPath(new URL('../../harness/shell', import.meta.url));\n}\n\nfunction resolveSdkEntry(): string {\n const srcLayout = fileURLToPath(new URL('../src/index.ts', import.meta.url));\n if (existsSync(srcLayout)) return srcLayout;\n return fileURLToPath(new URL('../index.js', import.meta.url));\n}\n\nexport interface DevHarnessOptions {\n extensionEntry: string;\n port?: number;\n apiPort?: number;\n fixtures?: MockFixtures;\n}\n\nexport interface DevHarness {\n url: string;\n apiUrl: string;\n vite: ViteDevServer;\n close: () => Promise<void>;\n}\n\nexport async function startDevHarness(options: DevHarnessOptions): Promise<DevHarness> {\n const port = options.port ?? 5173;\n const apiPort = options.apiPort ?? 9099;\n const api = await startMockControlPlane(apiPort, options.fixtures);\n const shellRoot = resolveShellRoot();\n const sdkEntry = resolveSdkEntry();\n const vite = await createViteServer({\n root: shellRoot,\n server: { port },\n plugins: [\n {\n name: 'inari-harness-config',\n transformIndexHtml() {\n return [\n {\n tag: 'script',\n injectTo: 'head-prepend',\n children: [\n `window.__INARI_API_URL__ = ${JSON.stringify(api.url)};`,\n `window.__INARI_EXTENSION_ENTRY__ = ${JSON.stringify(`/@fs${options.extensionEntry}`)};`,\n ].join('\\n'),\n },\n ];\n },\n },\n ],\n resolve: {\n alias: [{ find: '@inari/ui-plugin-sdk', replacement: sdkEntry }],\n dedupe: ['react', 'react-dom', 'react-router-dom', 'zod'],\n },\n optimizeDeps: { noDiscovery: true },\n logLevel: 'warn',\n });\n await vite.listen();\n const actualUrl = vite.resolvedUrls?.local[0] ?? `http://localhost:${port}/`;\n return {\n url: actualUrl.replace(/\\/$/, ''),\n apiUrl: api.url,\n vite,\n close: async () => {\n await vite.close();\n await api.close();\n },\n };\n}\n\nexport { createMockControlPlane, startMockControlPlane } from './server.js';\nexport type { MockFixtures } from './server.js';\n","import { createServer, type IncomingMessage, type Server, type ServerResponse } from 'node:http';\n\nexport interface MockFixtures {\n clusters?: unknown[];\n catalogItems?: unknown[];\n resources?: unknown[];\n approvals?: unknown[];\n tenants?: unknown[];\n}\n\nexport const defaultFixtures: Required<MockFixtures> = {\n tenants: [\n { orgId: 'org:acme', orgName: 'Acme', team: 'platform-team' },\n { orgId: 'org:globex', orgName: 'Globex' },\n ],\n clusters: [\n {\n id: 'cluster-1',\n name: 'dev-eu-1',\n tenantId: 'org:acme',\n state: 'Active',\n kubernetesVersion: '1.31',\n labels: { env: 'dev', region: 'eu-west-1' },\n },\n ],\n catalogItems: [\n {\n id: 'item-1',\n name: 'namespace-as-a-service',\n source: 'curated',\n version: '1.0.0',\n description: 'Golden-path namespace',\n },\n ],\n resources: [\n {\n id: 'res-1',\n catalogItemId: 'item-1',\n clusterId: 'cluster-1',\n name: 'demo-ns',\n namespace: 'demo-ns',\n health: 'Healthy',\n ownerTeam: 'platform-team',\n },\n ],\n approvals: [],\n};\n\nfunction readBody(req: IncomingMessage): Promise<string> {\n return new Promise((resolve) => {\n let data = '';\n req.on('data', (c) => (data += c));\n req.on('end', () => resolve(data));\n });\n}\n\nexport function createMockControlPlane(fixtures: MockFixtures = {}): Server {\n const fx: Required<MockFixtures> = { ...defaultFixtures, ...fixtures };\n return createServer(async (req: IncomingMessage, res: ServerResponse) => {\n const url = new URL(req.url ?? '/', 'http://localhost');\n const path = url.pathname;\n res.setHeader('content-type', 'application/json');\n res.setHeader('access-control-allow-origin', '*');\n res.setHeader('access-control-allow-headers', 'content-type, authorization');\n res.setHeader('access-control-allow-methods', 'GET,POST,OPTIONS');\n if (req.method === 'OPTIONS') {\n res.statusCode = 204;\n res.end();\n return;\n }\n const send = (body: unknown, status = 200) => {\n res.statusCode = status;\n res.end(JSON.stringify(body));\n };\n if (req.method === 'GET' && path === '/api/v1/tenants') return send(fx.tenants);\n if (req.method === 'GET' && path === '/api/v1/clusters') return send(fx.clusters);\n if (req.method === 'GET' && path === '/api/v1/catalog/items') return send(fx.catalogItems);\n if (req.method === 'GET' && path === '/api/v1/resources') return send(fx.resources);\n if (req.method === 'GET' && path === '/api/v1/approvals') return send(fx.approvals);\n const clusterMatch = path.match(/^\\/api\\/v1\\/clusters\\/([^/]+)$/);\n if (req.method === 'GET' && clusterMatch) {\n const c = fx.clusters.find((x) => (x as { id: string }).id === clusterMatch[1]);\n return c ? send(c) : send({ message: 'not found' }, 404);\n }\n const resMatch = path.match(/^\\/api\\/v1\\/resources\\/([^/]+)$/);\n if (req.method === 'GET' && resMatch) {\n const r = fx.resources.find((x) => (x as { id: string }).id === resMatch[1]);\n return r ? send(r) : send({ message: 'not found' }, 404);\n }\n const approveMatch = path.match(/^\\/api\\/v1\\/approvals\\/([^/]+)\\/approve$/);\n if (req.method === 'POST' && approveMatch) {\n await readBody(req);\n return send({ id: approveMatch[1], state: 'approved' });\n }\n send({ message: 'not found' }, 404);\n });\n}\n\nexport function startMockControlPlane(\n port: number,\n fixtures?: MockFixtures,\n): Promise<{ server: Server; url: string; close: () => Promise<void> }> {\n const server = createMockControlPlane(fixtures);\n return new Promise((resolve) => {\n server.listen(port, () => {\n const addr = server.address();\n const actualPort = typeof addr === 'object' && addr ? addr.port : port;\n resolve({\n server,\n url: `http://localhost:${actualPort}`,\n close: () => new Promise((r) => server.close(() => r())),\n });\n });\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA2B;AAC3B,sBAA8B;AAC9B,kBAAqE;;;ACFrE,uBAAqF;AAU9E,IAAM,kBAA0C;AAAA,EACrD,SAAS;AAAA,IACP,EAAE,OAAO,YAAY,SAAS,QAAQ,MAAM,gBAAgB;AAAA,IAC5D,EAAE,OAAO,cAAc,SAAS,SAAS;AAAA,EAC3C;AAAA,EACA,UAAU;AAAA,IACR;AAAA,MACE,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,UAAU;AAAA,MACV,OAAO;AAAA,MACP,mBAAmB;AAAA,MACnB,QAAQ,EAAE,KAAK,OAAO,QAAQ,YAAY;AAAA,IAC5C;AAAA,EACF;AAAA,EACA,cAAc;AAAA,IACZ;AAAA,MACE,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,aAAa;AAAA,IACf;AAAA,EACF;AAAA,EACA,WAAW;AAAA,IACT;AAAA,MACE,IAAI;AAAA,MACJ,eAAe;AAAA,MACf,WAAW;AAAA,MACX,MAAM;AAAA,MACN,WAAW;AAAA,MACX,QAAQ;AAAA,MACR,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EACA,WAAW,CAAC;AACd;AAEA,SAAS,SAAS,KAAuC;AACvD,SAAO,IAAI,QAAQ,CAAC,YAAY;AA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+1,32 @@
|
|
|
1
|
+
import { ViteDevServer } from 'vite';
|
|
2
|
+
import { Server } from 'node:http';
|
|
3
|
+
|
|
4
|
+
interface MockFixtures {
|
|
5
|
+
clusters?: unknown[];
|
|
6
|
+
catalogItems?: unknown[];
|
|
7
|
+
resources?: unknown[];
|
|
8
|
+
approvals?: unknown[];
|
|
9
|
+
tenants?: unknown[];
|
|
10
|
+
}
|
|
11
|
+
declare function createMockControlPlane(fixtures?: MockFixtures): Server;
|
|
12
|
+
declare function startMockControlPlane(port: number, fixtures?: MockFixtures): Promise<{
|
|
13
|
+
server: Server;
|
|
14
|
+
url: string;
|
|
15
|
+
close: () => Promise<void>;
|
|
16
|
+
}>;
|
|
17
|
+
|
|
18
|
+
interface DevHarnessOptions {
|
|
19
|
+
extensionEntry: string;
|
|
20
|
+
port?: number;
|
|
21
|
+
apiPort?: number;
|
|
22
|
+
fixtures?: MockFixtures;
|
|
23
|
+
}
|
|
24
|
+
interface DevHarness {
|
|
25
|
+
url: string;
|
|
26
|
+
apiUrl: string;
|
|
27
|
+
vite: ViteDevServer;
|
|
28
|
+
close: () => Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
declare function startDevHarness(options: DevHarnessOptions): Promise<DevHarness>;
|
|
31
|
+
|
|
32
|
+
export { type DevHarness, type DevHarnessOptions, type MockFixtures, createMockControlPlane, startDevHarness, startMockControlPlane };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ViteDevServer } from 'vite';
|
|
2
|
+
import { Server } from 'node:http';
|
|
3
|
+
|
|
4
|
+
interface MockFixtures {
|
|
5
|
+
clusters?: unknown[];
|
|
6
|
+
catalogItems?: unknown[];
|
|
7
|
+
resources?: unknown[];
|
|
8
|
+
approvals?: unknown[];
|
|
9
|
+
tenants?: unknown[];
|
|
10
|
+
}
|
|
11
|
+
declare function createMockControlPlane(fixtures?: MockFixtures): Server;
|
|
12
|
+
declare function startMockControlPlane(port: number, fixtures?: MockFixtures): Promise<{
|
|
13
|
+
server: Server;
|
|
14
|
+
url: string;
|
|
15
|
+
close: () => Promise<void>;
|
|
16
|
+
}>;
|
|
17
|
+
|
|
18
|
+
interface DevHarnessOptions {
|
|
19
|
+
extensionEntry: string;
|
|
20
|
+
port?: number;
|
|
21
|
+
apiPort?: number;
|
|
22
|
+
fixtures?: MockFixtures;
|
|
23
|
+
}
|
|
24
|
+
interface DevHarness {
|
|
25
|
+
url: string;
|
|
26
|
+
apiUrl: string;
|
|
27
|
+
vite: ViteDevServer;
|
|
28
|
+
close: () => Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
declare function startDevHarness(options: DevHarnessOptions): Promise<DevHarness>;
|
|
31
|
+
|
|
32
|
+
export { type DevHarness, type DevHarnessOptions, type MockFixtures, createMockControlPlane, startDevHarness, startMockControlPlane };
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// harness/index.ts
|
|
2
|
+
import { existsSync } from "fs";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
|
+
import { createServer as createViteServer } from "vite";
|
|
5
|
+
|
|
6
|
+
// harness/server.ts
|
|
7
|
+
import { createServer } from "http";
|
|
8
|
+
var defaultFixtures = {
|
|
9
|
+
tenants: [
|
|
10
|
+
{ orgId: "org:acme", orgName: "Acme", team: "platform-team" },
|
|
11
|
+
{ orgId: "org:globex", orgName: "Globex" }
|
|
12
|
+
],
|
|
13
|
+
clusters: [
|
|
14
|
+
{
|
|
15
|
+
id: "cluster-1",
|
|
16
|
+
name: "dev-eu-1",
|
|
17
|
+
tenantId: "org:acme",
|
|
18
|
+
state: "Active",
|
|
19
|
+
kubernetesVersion: "1.31",
|
|
20
|
+
labels: { env: "dev", region: "eu-west-1" }
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
catalogItems: [
|
|
24
|
+
{
|
|
25
|
+
id: "item-1",
|
|
26
|
+
name: "namespace-as-a-service",
|
|
27
|
+
source: "curated",
|
|
28
|
+
version: "1.0.0",
|
|
29
|
+
description: "Golden-path namespace"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
resources: [
|
|
33
|
+
{
|
|
34
|
+
id: "res-1",
|
|
35
|
+
catalogItemId: "item-1",
|
|
36
|
+
clusterId: "cluster-1",
|
|
37
|
+
name: "demo-ns",
|
|
38
|
+
namespace: "demo-ns",
|
|
39
|
+
health: "Healthy",
|
|
40
|
+
ownerTeam: "platform-team"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
approvals: []
|
|
44
|
+
};
|
|
45
|
+
function readBody(req) {
|
|
46
|
+
return new Promise((resolve) => {
|
|
47
|
+
let data = "";
|
|
48
|
+
req.on("data", (c) => data += c);
|
|
49
|
+
req.on("end", () => resolve(data));
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function createMockControlPlane(fixtures = {}) {
|
|
53
|
+
const fx = { ...defaultFixtures, ...fixtures };
|
|
54
|
+
return createServer(async (req, res) => {
|
|
55
|
+
const url = new URL(req.url ?? "/", "http://localhost");
|
|
56
|
+
const path = url.pathname;
|
|
57
|
+
res.setHeader("content-type", "application/json");
|
|
58
|
+
res.setHeader("access-control-allow-origin", "*");
|
|
59
|
+
res.setHeader("access-control-allow-headers", "content-type, authorization");
|
|
60
|
+
res.setHeader("access-control-allow-methods", "GET,POST,OPTIONS");
|
|
61
|
+
if (req.method === "OPTIONS") {
|
|
62
|
+
res.statusCode = 204;
|
|
63
|
+
res.end();
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const send = (body, status = 200) => {
|
|
67
|
+
res.statusCode = status;
|
|
68
|
+
res.end(JSON.stringify(body));
|
|
69
|
+
};
|
|
70
|
+
if (req.method === "GET" && path === "/api/v1/tenants") return send(fx.tenants);
|
|
71
|
+
if (req.method === "GET" && path === "/api/v1/clusters") return send(fx.clusters);
|
|
72
|
+
if (req.method === "GET" && path === "/api/v1/catalog/items") return send(fx.catalogItems);
|
|
73
|
+
if (req.method === "GET" && path === "/api/v1/resources") return send(fx.resources);
|
|
74
|
+
if (req.method === "GET" && path === "/api/v1/approvals") return send(fx.approvals);
|
|
75
|
+
const clusterMatch = path.match(/^\/api\/v1\/clusters\/([^/]+)$/);
|
|
76
|
+
if (req.method === "GET" && clusterMatch) {
|
|
77
|
+
const c = fx.clusters.find((x) => x.id === clusterMatch[1]);
|
|
78
|
+
return c ? send(c) : send({ message: "not found" }, 404);
|
|
79
|
+
}
|
|
80
|
+
const resMatch = path.match(/^\/api\/v1\/resources\/([^/]+)$/);
|
|
81
|
+
if (req.method === "GET" && resMatch) {
|
|
82
|
+
const r = fx.resources.find((x) => x.id === resMatch[1]);
|
|
83
|
+
return r ? send(r) : send({ message: "not found" }, 404);
|
|
84
|
+
}
|
|
85
|
+
const approveMatch = path.match(/^\/api\/v1\/approvals\/([^/]+)\/approve$/);
|
|
86
|
+
if (req.method === "POST" && approveMatch) {
|
|
87
|
+
await readBody(req);
|
|
88
|
+
return send({ id: approveMatch[1], state: "approved" });
|
|
89
|
+
}
|
|
90
|
+
send({ message: "not found" }, 404);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function startMockControlPlane(port, fixtures) {
|
|
94
|
+
const server = createMockControlPlane(fixtures);
|
|
95
|
+
return new Promise((resolve) => {
|
|
96
|
+
server.listen(port, () => {
|
|
97
|
+
const addr = server.address();
|
|
98
|
+
const actualPort = typeof addr === "object" && addr ? addr.port : port;
|
|
99
|
+
resolve({
|
|
100
|
+
server,
|
|
101
|
+
url: `http://localhost:${actualPort}`,
|
|
102
|
+
close: () => new Promise((r) => server.close(() => r()))
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// harness/index.ts
|
|
109
|
+
function resolveShellRoot() {
|
|
110
|
+
const srcLayout = fileURLToPath(new URL("./shell", import.meta.url));
|
|
111
|
+
if (existsSync(srcLayout)) return srcLayout;
|
|
112
|
+
return fileURLToPath(new URL("../../harness/shell", import.meta.url));
|
|
113
|
+
}
|
|
114
|
+
function resolveSdkEntry() {
|
|
115
|
+
const srcLayout = fileURLToPath(new URL("../src/index.ts", import.meta.url));
|
|
116
|
+
if (existsSync(srcLayout)) return srcLayout;
|
|
117
|
+
return fileURLToPath(new URL("../index.js", import.meta.url));
|
|
118
|
+
}
|
|
119
|
+
async function startDevHarness(options) {
|
|
120
|
+
const port = options.port ?? 5173;
|
|
121
|
+
const apiPort = options.apiPort ?? 9099;
|
|
122
|
+
const api = await startMockControlPlane(apiPort, options.fixtures);
|
|
123
|
+
const shellRoot = resolveShellRoot();
|
|
124
|
+
const sdkEntry = resolveSdkEntry();
|
|
125
|
+
const vite = await createViteServer({
|
|
126
|
+
root: shellRoot,
|
|
127
|
+
server: { port },
|
|
128
|
+
plugins: [
|
|
129
|
+
{
|
|
130
|
+
name: "inari-harness-config",
|
|
131
|
+
transformIndexHtml() {
|
|
132
|
+
return [
|
|
133
|
+
{
|
|
134
|
+
tag: "script",
|
|
135
|
+
injectTo: "head-prepend",
|
|
136
|
+
children: [
|
|
137
|
+
`window.__INARI_API_URL__ = ${JSON.stringify(api.url)};`,
|
|
138
|
+
`window.__INARI_EXTENSION_ENTRY__ = ${JSON.stringify(`/@fs${options.extensionEntry}`)};`
|
|
139
|
+
].join("\n")
|
|
140
|
+
}
|
|
141
|
+
];
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
resolve: {
|
|
146
|
+
alias: [{ find: "@inari/ui-plugin-sdk", replacement: sdkEntry }],
|
|
147
|
+
dedupe: ["react", "react-dom", "react-router-dom", "zod"]
|
|
148
|
+
},
|
|
149
|
+
optimizeDeps: { noDiscovery: true },
|
|
150
|
+
logLevel: "warn"
|
|
151
|
+
});
|
|
152
|
+
await vite.listen();
|
|
153
|
+
const actualUrl = vite.resolvedUrls?.local[0] ?? `http://localhost:${port}/`;
|
|
154
|
+
return {
|
|
155
|
+
url: actualUrl.replace(/\/$/, ""),
|
|
156
|
+
apiUrl: api.url,
|
|
157
|
+
vite,
|
|
158
|
+
close: async () => {
|
|
159
|
+
await vite.close();
|
|
160
|
+
await api.close();
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
export {
|
|
165
|
+
createMockControlPlane,
|
|
166
|
+
startDevHarness,
|
|
167
|
+
startMockControlPlane
|
|
168
|
+
};
|
|
169
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../harness/index.ts","../../harness/server.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { fileURLToPath } from 'node:url';\nimport { createServer as createViteServer, type ViteDevServer } from 'vite';\nimport { startMockControlPlane, type MockFixtures } from './server.js';\n\nfunction resolveShellRoot(): string {\n const srcLayout = fileURLToPath(new URL('./shell', import.meta.url));\n if (existsSync(srcLayout)) return srcLayout;\n return fileURLToPath(new URL('../../harness/shell', import.meta.url));\n}\n\nfunction resolveSdkEntry(): string {\n const srcLayout = fileURLToPath(new URL('../src/index.ts', import.meta.url));\n if (existsSync(srcLayout)) return srcLayout;\n return fileURLToPath(new URL('../index.js', import.meta.url));\n}\n\nexport interface DevHarnessOptions {\n extensionEntry: string;\n port?: number;\n apiPort?: number;\n fixtures?: MockFixtures;\n}\n\nexport interface DevHarness {\n url: string;\n apiUrl: string;\n vite: ViteDevServer;\n close: () => Promise<void>;\n}\n\nexport async function startDevHarness(options: DevHarnessOptions): Promise<DevHarness> {\n const port = options.port ?? 5173;\n const apiPort = options.apiPort ?? 9099;\n const api = await startMockControlPlane(apiPort, options.fixtures);\n const shellRoot = resolveShellRoot();\n const sdkEntry = resolveSdkEntry();\n const vite = await createViteServer({\n root: shellRoot,\n server: { port },\n plugins: [\n {\n name: 'inari-harness-config',\n transformIndexHtml() {\n return [\n {\n tag: 'script',\n injectTo: 'head-prepend',\n children: [\n `window.__INARI_API_URL__ = ${JSON.stringify(api.url)};`,\n `window.__INARI_EXTENSION_ENTRY__ = ${JSON.stringify(`/@fs${options.extensionEntry}`)};`,\n ].join('\\n'),\n },\n ];\n },\n },\n ],\n resolve: {\n alias: [{ find: '@inari/ui-plugin-sdk', replacement: sdkEntry }],\n dedupe: ['react', 'react-dom', 'react-router-dom', 'zod'],\n },\n optimizeDeps: { noDiscovery: true },\n logLevel: 'warn',\n });\n await vite.listen();\n const actualUrl = vite.resolvedUrls?.local[0] ?? `http://localhost:${port}/`;\n return {\n url: actualUrl.replace(/\\/$/, ''),\n apiUrl: api.url,\n vite,\n close: async () => {\n await vite.close();\n await api.close();\n },\n };\n}\n\nexport { createMockControlPlane, startMockControlPlane } from './server.js';\nexport type { MockFixtures } from './server.js';\n","import { createServer, type IncomingMessage, type Server, type ServerResponse } from 'node:http';\n\nexport interface MockFixtures {\n clusters?: unknown[];\n catalogItems?: unknown[];\n resources?: unknown[];\n approvals?: unknown[];\n tenants?: unknown[];\n}\n\nexport const defaultFixtures: Required<MockFixtures> = {\n tenants: [\n { orgId: 'org:acme', orgName: 'Acme', team: 'platform-team' },\n { orgId: 'org:globex', orgName: 'Globex' },\n ],\n clusters: [\n {\n id: 'cluster-1',\n name: 'dev-eu-1',\n tenantId: 'org:acme',\n state: 'Active',\n kubernetesVersion: '1.31',\n labels: { env: 'dev', region: 'eu-west-1' },\n },\n ],\n catalogItems: [\n {\n id: 'item-1',\n name: 'namespace-as-a-service',\n source: 'curated',\n version: '1.0.0',\n description: 'Golden-path namespace',\n },\n ],\n resources: [\n {\n id: 'res-1',\n catalogItemId: 'item-1',\n clusterId: 'cluster-1',\n name: 'demo-ns',\n namespace: 'demo-ns',\n health: 'Healthy',\n ownerTeam: 'platform-team',\n },\n ],\n approvals: [],\n};\n\nfunction readBody(req: IncomingMessage): Promise<string> {\n return new Promise((resolve) => {\n let data = '';\n req.on('data', (c) => (data += c));\n req.on('end', () => resolve(data));\n });\n}\n\nexport function createMockControlPlane(fixtures: MockFixtures = {}): Server {\n const fx: Required<MockFixtures> = { ...defaultFixtures, ...fixtures };\n return createServer(async (req: IncomingMessage, res: ServerResponse) => {\n const url = new URL(req.url ?? '/', 'http://localhost');\n const path = url.pathname;\n res.setHeader('content-type', 'application/json');\n res.setHeader('access-control-allow-origin', '*');\n res.setHeader('access-control-allow-headers', 'content-type, authorization');\n res.setHeader('access-control-allow-methods', 'GET,POST,OPTIONS');\n if (req.method === 'OPTIONS') {\n res.statusCode = 204;\n res.end();\n return;\n }\n const send = (body: unknown, status = 200) => {\n res.statusCode = status;\n res.end(JSON.stringify(body));\n };\n if (req.method === 'GET' && path === '/api/v1/tenants') return send(fx.tenants);\n if (req.method === 'GET' && path === '/api/v1/clusters') return send(fx.clusters);\n if (req.method === 'GET' && path === '/api/v1/catalog/items') return send(fx.catalogItems);\n if (req.method === 'GET' && path === '/api/v1/resources') return send(fx.resources);\n if (req.method === 'GET' && path === '/api/v1/approvals') return send(fx.approvals);\n const clusterMatch = path.match(/^\\/api\\/v1\\/clusters\\/([^/]+)$/);\n if (req.method === 'GET' && clusterMatch) {\n const c = fx.clusters.find((x) => (x as { id: string }).id === clusterMatch[1]);\n return c ? send(c) : send({ message: 'not found' }, 404);\n }\n const resMatch = path.match(/^\\/api\\/v1\\/resources\\/([^/]+)$/);\n if (req.method === 'GET' && resMatch) {\n const r = fx.resources.find((x) => (x as { id: string }).id === resMatch[1]);\n return r ? send(r) : send({ message: 'not found' }, 404);\n }\n const approveMatch = path.match(/^\\/api\\/v1\\/approvals\\/([^/]+)\\/approve$/);\n if (req.method === 'POST' && approveMatch) {\n await readBody(req);\n return send({ id: approveMatch[1], state: 'approved' });\n }\n send({ message: 'not found' }, 404);\n });\n}\n\nexport function startMockControlPlane(\n port: number,\n fixtures?: MockFixtures,\n): Promise<{ server: Server; url: string; close: () => Promise<void> }> {\n const server = createMockControlPlane(fixtures);\n return new Promise((resolve) => {\n server.listen(port, () => {\n const addr = server.address();\n const actualPort = typeof addr === 'object' && addr ? addr.port : port;\n resolve({\n server,\n url: `http://localhost:${actualPort}`,\n close: () => new Promise((r) => server.close(() => r())),\n });\n });\n });\n}\n"],"mapp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