@ekanos/cli 0.25.0 → 0.26.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 +4 -0
- package/dist/catalog-api.d.ts +8 -1
- package/dist/catalog-api.js +26 -1
- package/dist/catalog-api.js.map +1 -1
- package/dist/commands/add.js +2 -1
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/apps.js +6 -4
- package/dist/commands/apps.js.map +1 -1
- package/dist/commands/dev.d.ts +5 -0
- package/dist/commands/dev.js +25 -9
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/routes.js +7 -1
- package/dist/commands/routes.js.map +1 -1
- package/dist/commands/sources.js +11 -8
- package/dist/commands/sources.js.map +1 -1
- package/dist/commands/sync.js +3 -2
- package/dist/commands/sync.js.map +1 -1
- package/dist/commands/teams-events.js +9 -1
- package/dist/commands/teams-events.js.map +1 -1
- package/dist/commands/teams-lifecycle.js +9 -1
- package/dist/commands/teams-lifecycle.js.map +1 -1
- package/dist/commands/teams-onboard.js +9 -1
- package/dist/commands/teams-onboard.js.map +1 -1
- package/dist/commands/teams-overview.d.ts +1 -1
- package/dist/commands/teams-overview.js +41 -14
- package/dist/commands/teams-overview.js.map +1 -1
- package/dist/commands/teams.js +9 -1
- package/dist/commands/teams.js.map +1 -1
- package/dist/compatibility.d.ts +7 -1
- package/dist/compatibility.js +7 -1
- package/dist/compatibility.js.map +1 -1
- package/dist/contracts-api.d.ts +32 -0
- package/dist/contracts-api.js +66 -0
- package/dist/contracts-api.js.map +1 -0
- package/dist/experience/host-contract-source.d.ts +35 -0
- package/dist/experience/host-contract-source.js +121 -0
- package/dist/experience/host-contract-source.js.map +1 -0
- package/dist/experience/publish.js +7 -11
- package/dist/experience/publish.js.map +1 -1
- package/dist/harness-scaffold.js +5 -0
- package/dist/harness-scaffold.js.map +1 -1
- package/dist/host-snapshots.d.ts +66 -0
- package/dist/host-snapshots.js +273 -0
- package/dist/host-snapshots.js.map +1 -0
- package/dist/product-slug.d.ts +8 -0
- package/dist/product-slug.js +13 -0
- package/dist/product-slug.js.map +1 -0
- package/package.json +2 -2
- package/templates/experience/package.json.tmpl +4 -4
- package/templates/harness/app/catalog/[slug]/page.tsx.tmpl +1 -0
- package/templates/harness/app/catalog/layout.tsx.tmpl +1 -0
- package/templates/harness/app/catalog/page.tsx.tmpl +1 -0
- package/templates/harness/app/experience/publishes/page.tsx.tmpl +1 -0
- package/templates/harness/app/integrations/[slug]/publishes/page.tsx.tmpl +1 -0
- package/templates/package.json.tmpl +4 -4
- package/templates/skills/build-integration/references/widget-design.md +24 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-snapshots.js","sourceRoot":"","sources":["../src/host-snapshots.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,qBAAqB,EACrB,2BAA2B,GAG5B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAGlC,OAAO,EAEL,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,qBAAqB,CAAC,CAAC;AAC/E,MAAM,CAAC,MAAM,oBAAoB,GAAG,iBAAiB,C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IAAI,QAAQ,KAAK,oBAAoB;gBAAE,KAAK,OAAO,EAAE,CAAC;QACxD,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,KAAK,EAAE,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,GAAG,CAAC,GAAG,CACZ,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CACf,mEAAmE,SAAS,CAAC,KAAK,CAAC,EAAE,CACtF,CACF,CAAC;IACJ,CAAC;IAED,KAAK,OAAO,EAAE,CAAC;IAEf,OAAO,GAAG,EAAE;QACV,OAAO,GAAG,IAAI,CAAC;QACf,IAAI,KAAK;YAAE,YAAY,CAAC,KAAK,CAAC,CAAC;QAC/B,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,EAAE,CAAC;IACnB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {\n type CatalogProduct,\n type CatalogSnapshot,\n CatalogSnapshotSchema,\n PublishStatusSnapshotSchema,\n type PublishStatusSnapshot,\n type PublishedPackage,\n} from '@ekanos/integration-schema';\nimport * as fs from 'node:fs';\nimport * as path from 'node:path';\n\nimport type { StoredSession } from './auth/credential-store';\nimport {\n type AuthEnvironment,\n refreshStoredSession,\n resolveAuthEnvironment,\n} from './auth/session';\nimport { fetchPublicCatalog, fetchSourceCatalog } from './catalog-api';\nimport { readActiveSource } from './commands/sources';\nimport type { CliContext } from './context';\nimport { CliError } from './errors';\nimport { listSubmissions } from './publish-api';\nimport { resolveSourceTarget } from './source-target';\n\n/**\n * What `ekanos dev` hands the harness about the host, beside the session\n * catalog: the catalog a developer browses (`catalog.json`) and the Source's\n * published packages (`publish-status.json`). The CLI holds the login, so the\n * harness never sees a token and never refreshes one (a second refresher would\n * race the CLI for the rotating refresh token). The harness asks for a fresh\n * read by writing `refresh-request`.\n */\nexport const CATALOG_SNAPSHOT_FILE = path.join('.ekanos', 'catalog.json');\nexport const PUBLISH_STATUS_FILE = path.join('.ekanos', 'publish-status.json');\nexport const REFRESH_REQUEST_FILE = 'refresh-request';\n\n/** Poll fast while a version is still moving through the pipeline. */\nconst IN_FLIGHT_STATES = new Set(['submitted', 'gated']);\nexport const IN_FLIGHT_INTERVAL_MS = 30_000;\nexport const IDLE_INTERVAL_MS = 300_000;\n\ntype Unavailable = NonNullable<CatalogSnapshot['unavailable']>;\n\nexport interface HostSnapshots {\n catalog: CatalogSnapshot;\n publish: PublishStatusSnapshot;\n}\n\n/** The network calls, injectable for tests. */\nexport interface HostSnapshotDeps {\n fetchSourceCatalog: typeof fetchSourceCatalog;\n fetchPublicCatalog: typeof fetchPublicCatalog;\n listSubmissions: typeof listSubmissions;\n resolveSourceTarget: typeof resolveSourceTarget;\n refreshStoredSession: typeof refreshStoredSession;\n now: () => Date;\n}\n\nconst DEFAULT_DEPS: HostSnapshotDeps = {\n fetchSourceCatalog,\n fetchPublicCatalog,\n listSubmissions,\n resolveSourceTarget,\n refreshStoredSession,\n now: () => new Date(),\n};\n\nfunction messageOf(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\n/** The error's message and, for a CLI error, what to do about it. */\nfunction messageWithHint(error: unknown): string {\n if (error instanceof CliError) return `${error.message} ${error.hint}`;\n return messageOf(error);\n}\n\n/**\n * Read both snapshots from the host, never throwing: every way it can fail is\n * written down as `unavailable`, in words the harness shows as is.\n */\nexport async function readHostSnapshots(params: {\n ctx: CliContext;\n env: Record<string, string | undefined>;\n projectDir: string;\n /** The Source to read when the project itself names none (a repo's packages' shared one). */\n fallbackSource?: string | null;\n deps?: Partial<HostSnapshotDeps>;\n}): Promise<HostSnapshots> {\n const deps = { ...DEFAULT_DEPS, ...params.deps };\n const fetchedAt = deps.now().toISOString();\n\n const empty = (\n host: string | null,\n unavailable: Unavailable | null,\n ): HostSnapshots => ({\n catalog: {\n fetchedAt,\n host,\n scope: null,\n source: null,\n unavailable,\n products: [],\n },\n publish: {\n fetchedAt,\n host,\n source: null,\n unavailable,\n packages: [],\n },\n });\n\n let auth: AuthEnvironment;\n try {\n auth = resolveAuthEnvironment(params.ctx, undefined, params.env, {\n projectDir: params.projectDir,\n });\n } catch {\n return empty(null, {\n reason: 'not-logged-in',\n message:\n 'No Ekanos host is known for this project. Run \"ekanos login\" to see the catalog and your publishes.',\n });\n }\n const host = auth.host;\n\n /** The host's public catalog, for a developer with no Source to read. */\n const publicCatalog = async (\n unavailable: Unavailable,\n ): Promise<HostSnapshots> => {\n const result = empty(host, unavailable);\n try {\n const catalog = await deps.fetchPublicCatalog(host);\n if (catalog) {\n result.catalog = {\n ...result.catalog,\n scope: 'public',\n unavailable: null,\n products: catalog.products,\n };\n }\n } catch (error) {\n result.catalog.unavailable = {\n reason: 'host-error',\n message: `Could not read the public catalog from ${host}: ${messageOf(error)}`,\n };\n }\n return result;\n };\n\n let session: StoredSession | null = auth.store.read(host);\n if (!session) {\n return publicCatalog({\n reason: 'not-logged-in',\n message: `Not logged in to ${host}. Run \"ekanos login\" to see your Source's catalog and your publishes.`,\n });\n }\n\n let source: string;\n try {\n const target = await deps.resolveSourceTarget(auth, session, {\n dir: params.projectDir,\n ...(params.fallbackSource && !readActiveSource(params.projectDir)\n ? { source: params.fallbackSource }\n : {}),\n });\n source = target.source;\n session = target.session;\n } catch (error) {\n return publicCatalog({\n reason: 'no-source',\n message: messageWithHint(error),\n });\n }\n\n /** One call, retried once with a refreshed session on a 401. */\n async function withSession<T extends { status: string }>(\n call: (token: string) => Promise<T>,\n ): Promise<T> {\n const current = session!;\n const first = await call(current.accessToken);\n if (first.status !== 'unauthorized') return first;\n session = await deps.refreshStoredSession(auth, current);\n return call(session.accessToken);\n }\n\n const result = empty(host, null);\n result.publish.source = source;\n\n try {\n const catalog = await withSession((token) =>\n deps.fetchSourceCatalog(host, token, { source }),\n );\n if (catalog.status === 'ok') {\n result.catalog = {\n fetchedAt,\n host,\n scope: 'source',\n source: {\n slug: catalog.catalog.source.slug,\n name: catalog.catalog.source.name,\n },\n unavailable: null,\n products: catalog.catalog.products satisfies CatalogProduct[],\n };\n } else {\n result.catalog.unavailable = {\n reason: 'not-logged-in',\n message: `The session for ${host} has expired. Run \"ekanos login\".`,\n };\n }\n } catch (error) {\n result.catalog.unavailable = {\n reason: 'host-error',\n message: `Could not read the catalog for ${source}: ${messageOf(error)}`,\n };\n }\n\n try {\n const listed = await withSession((token) =>\n deps.listSubmissions(host, token, source, { detail: 'findings' }),\n );\n if (listed.status === 'ok') {\n result.publish.packages = listed.integrations as PublishedPackage[];\n } else {\n result.publish.unavailable = {\n reason: 'not-logged-in',\n message: `The session for ${host} has expired. Run \"ekanos login\".`,\n };\n }\n } catch (error) {\n result.publish.unavailable = {\n reason: 'host-error',\n message: `Could not read the publishes for ${source}: ${messageOf(error)}`,\n };\n }\n\n return result;\n}\n\n/**\n * The one Source every package of a repo names in its `ekanos.json`, or null\n * when they name none or disagree (then the account's seats decide, as for\n * any project).\n */\nexport function sharedPackageSource(dirs: readonly string[]): string | null {\n const named = new Set(\n dirs.map((dir) => readActiveSource(dir)).filter((v): v is string => !!v),\n );\n return named.size === 1 ? [...named][0]! : null;\n}\n\n/** Write both snapshots for the harness, owner-only, never a token. */\nexport function writeHostSnapshots(\n projectDir: string,\n snapshots: HostSnapshots,\n): void {\n const write = (file: string, value: unknown) => {\n const target = path.join(projectDir, file);\n fs.mkdirSync(path.dirname(target), { recursive: true });\n const temp = `${target}.tmp`;\n fs.writeFileSync(temp, `${JSON.stringify(value)}\\n`, { mode: 0o600 });\n fs.renameSync(temp, target);\n };\n const catalog = CatalogSnapshotSchema.safeParse(snapshots.catalog);\n if (catalog.success) write(CATALOG_SNAPSHOT_FILE, catalog.data);\n const publish = PublishStatusSnapshotSchema.safeParse(snapshots.publish);\n if (publish.success) write(PUBLISH_STATUS_FILE, publish.data);\n}\n\n/** How long to wait before the next read: fast while a version is in flight. */\nexport function nextRefreshDelay(publish: PublishStatusSnapshot): number {\n const inFlight = publish.packages.some((pkg) =>\n pkg.versions.some((version) => IN_FLIGHT_STATES.has(version.state)),\n );\n return inFlight ? IN_FLIGHT_INTERVAL_MS : IDLE_INTERVAL_MS;\n}\n\n/**\n * Keep both snapshots fresh while the harness runs: read now, then again on a\n * timer (30 s while a version is in flight, 5 min otherwise) and whenever the\n * harness writes `.ekanos/refresh-request`. Returns a stop function.\n */\nexport function startHostSnapshotRefresher(params: {\n ctx: CliContext;\n env: Record<string, string | undefined>;\n projectDir: string;\n fallbackSource?: string | null;\n deps?: Partial<HostSnapshotDeps>;\n}): () => void {\n const dir = path.join(params.projectDir, '.ekanos');\n fs.mkdirSync(dir, { recursive: true });\n\n let stopped = false;\n let running = false;\n let queued = false;\n let timer: NodeJS.Timeout | null = null;\n\n const schedule = (delay: number) => {\n if (stopped) return;\n if (timer) clearTimeout(timer);\n timer = setTimeout(() => void refresh(), delay);\n timer.unref();\n };\n\n const refresh = async () => {\n if (stopped) return;\n if (running) {\n queued = true;\n return;\n }\n running = true;\n let delay = IDLE_INTERVAL_MS;\n try {\n const snapshots = await readHostSnapshots(params);\n if (!stopped) writeHostSnapshots(params.projectDir, snapshots);\n delay = nextRefreshDelay(snapshots.publish);\n } catch (error) {\n params.ctx.log(\n params.ctx.ui.dim(\n `Could not refresh the catalog and publish status: ${messageOf(error)}`,\n ),\n );\n } finally {\n running = false;\n }\n if (queued) {\n queued = false;\n void refresh();\n return;\n }\n schedule(delay);\n };\n\n let watcher: fs.FSWatcher | null = null;\n try {\n watcher = fs.watch(dir, (_event, filename) => {\n if (filename === REFRESH_REQUEST_FILE) void refresh();\n });\n watcher.unref();\n } catch (error) {\n params.ctx.log(\n params.ctx.ui.dim(\n `The harness's Refresh button will wait for the next timed read: ${messageOf(error)}`,\n ),\n );\n }\n\n void refresh();\n\n return () => {\n stopped = true;\n if (timer) clearTimeout(timer);\n watcher?.close();\n };\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A product slug as the server names one: a bare slug (`linear`) or a
|
|
3
|
+
* partner package's token, namespaced by its publishing Source
|
|
4
|
+
* (`vastly-dev__linear`). Only operands a person typed go through this;
|
|
5
|
+
* slugs the server returned are used as they are.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isProductSlug(value: string): boolean;
|
|
8
|
+
export declare const PRODUCT_SLUG_SHAPE = "A product slug is kebab-case (\"linear\", \"google-workspace\"), or namespaced by the Source that publishes it (\"vastly-dev__linear\").";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { isValidToken } from '@ekanos/integration-schema';
|
|
2
|
+
const MAX_LENGTH = 128;
|
|
3
|
+
/**
|
|
4
|
+
* A product slug as the server names one: a bare slug (`linear`) or a
|
|
5
|
+
* partner package's token, namespaced by its publishing Source
|
|
6
|
+
* (`vastly-dev__linear`). Only operands a person typed go through this;
|
|
7
|
+
* slugs the server returned are used as they are.
|
|
8
|
+
*/
|
|
9
|
+
export function isProductSlug(value) {
|
|
10
|
+
return value.length <= MAX_LENGTH && isValidToken(value);
|
|
11
|
+
}
|
|
12
|
+
export const PRODUCT_SLUG_SHAPE = 'A product slug is kebab-case ("linear", "google-workspace"), or namespaced by the Source that publishes it ("vastly-dev__linear").';
|
|
13
|
+
//# sourceMappingURL=product-slug.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-slug.js","sourceRoot":"","sources":["../src/product-slug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,MAAM,UAAU,GAAG,GAAG,CAAC;AAEvB;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,OAAO,KAAK,CAAC,MAAM,IAAI,UAAU,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC;AAC3D,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAC7B,oIAAoI,CAAC","sourcesContent":["import { isValidToken } from '@ekanos/integration-schema';\n\nconst MAX_LENGTH = 128;\n\n/**\n * A product slug as the server names one: a bare slug (`linear`) or a\n * partner package's token, namespaced by its publishing Source\n * (`vastly-dev__linear`). Only operands a person typed go through this;\n * slugs the server returned are used as they are.\n */\nexport function isProductSlug(value: string): boolean {\n return value.length <= MAX_LENGTH && isValidToken(value);\n}\n\nexport const PRODUCT_SLUG_SHAPE =\n 'A product slug is kebab-case (\"linear\", \"google-workspace\"), or namespaced by the Source that publishes it (\"vastly-dev__linear\").';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ekanos/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Ekanos partner toolchain CLI: scaffold, validate, and test an Ekanos integration against the published @ekanos packages. Agent-native — every verb speaks JSON with a stable exit-code taxonomy.",
|
|
6
6
|
"keywords": [
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@clack/prompts": "1.9.0",
|
|
38
|
-
"@ekanos/integration-schema": "0.
|
|
38
|
+
"@ekanos/integration-schema": "0.31.0",
|
|
39
39
|
"esbuild": "0.28.2",
|
|
40
40
|
"picocolors": "1.1.1"
|
|
41
41
|
},
|
|
@@ -22,16 +22,16 @@
|
|
|
22
22
|
"build": "npx ekanos build"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@ekanos/sdk": "^0.
|
|
26
|
-
"@ekanos/ui": "^0.
|
|
25
|
+
"@ekanos/sdk": "^0.31.0",
|
|
26
|
+
"@ekanos/ui": "^0.31.0",
|
|
27
27
|
"@tanstack/react-query": "^5.101.4",
|
|
28
28
|
"react": "^19.2.8",
|
|
29
29
|
"react-dom": "^19.2.8",
|
|
30
30
|
"zod": "^4.6.7"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@ekanos/cli": "^0.
|
|
34
|
-
"@ekanos/harness": "^0.
|
|
33
|
+
"@ekanos/cli": "^0.26.1",
|
|
34
|
+
"@ekanos/harness": "^0.31.0",
|
|
35
35
|
"@tailwindcss/postcss": "^4.3.3",
|
|
36
36
|
"@typescript-eslint/parser": "^8.46.2",
|
|
37
37
|
"@types/react": "^19.2.0",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CatalogProductPage as default } from '@ekanos/harness/routes';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CatalogLayout as default } from '@ekanos/harness/routes';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CatalogPage as default } from '@ekanos/harness/routes';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ExperiencePublishesPage as default } from '@ekanos/harness/routes';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { IntegrationPublishesPage as default } from '@ekanos/harness/routes';
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
"prepare": "node scripts/setup-hooks.mjs"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@ekanos/sdk": "^0.
|
|
16
|
-
"@ekanos/ui": "^0.
|
|
15
|
+
"@ekanos/sdk": "^0.31.0",
|
|
16
|
+
"@ekanos/ui": "^0.31.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@ekanos/cli": "^0.
|
|
20
|
-
"@ekanos/harness": "^0.
|
|
19
|
+
"@ekanos/cli": "^0.26.1",
|
|
20
|
+
"@ekanos/harness": "^0.31.0",
|
|
21
21
|
"@hookform/resolvers": "^5.2.2",
|
|
22
22
|
"@tailwindcss/postcss": "^4.3.3",
|
|
23
23
|
"@tanstack/react-query": "^5.101.4",
|
|
@@ -227,6 +227,28 @@ high; lists and feeds 4–6 × 10–14; charts 6–8 × 10–12 (grid units, lg
|
|
|
227
227
|
breakpoint). Give md/sm the same content priority order — cut columns, not
|
|
228
228
|
meaning.
|
|
229
229
|
|
|
230
|
+
## Load each widget on demand
|
|
231
|
+
|
|
232
|
+
The host loads every integration's definition for every page, so a widget
|
|
233
|
+
that `src/integration.ts` imports directly ships to the browser on every
|
|
234
|
+
page, whether it is on screen or not. Declare widgets, pages, the activation
|
|
235
|
+
form and the marketplace tile from one `'use client'` file through
|
|
236
|
+
`lazyComponent`, and import them from there:
|
|
237
|
+
|
|
238
|
+
```tsx
|
|
239
|
+
// src/components/lazy.tsx
|
|
240
|
+
'use client';
|
|
241
|
+
|
|
242
|
+
import { lazyComponent } from '@ekanos/sdk/components';
|
|
243
|
+
|
|
244
|
+
export const ForecastWidget = lazyComponent(() =>
|
|
245
|
+
import('./widgets/forecast-widget').then((m) => m.ForecastWidget),
|
|
246
|
+
);
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Keep the `'use client'` line and the literal `import()` path: without either,
|
|
250
|
+
the component is not split out.
|
|
251
|
+
|
|
230
252
|
## Checklist before calling a widget done
|
|
231
253
|
|
|
232
254
|
- [ ] Four states render in the harness; user has seen them
|
|
@@ -239,6 +261,8 @@ meaning.
|
|
|
239
261
|
- [ ] Mock data replaced by real data (or the mock is clearly temporary and
|
|
240
262
|
the wiring phase is next)
|
|
241
263
|
- [ ] Widget id is slug-prefixed and globally unique
|
|
264
|
+
- [ ] `integration.ts` takes the widget from your `lazyComponent` file, not
|
|
265
|
+
from the widget's own file
|
|
242
266
|
|
|
243
267
|
A styling review of existing widgets — worst-first findings, before→after
|
|
244
268
|
fixes, the tile — is the `polish-widgets` skill; use it rather than
|