@supernovaio/cli 2.0.41 → 2.0.43
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/dist/code-analyzer/analyzers/component-usage.js.map +1 -1
- package/dist/code-analyzer/analyzers/helpers.js.map +1 -1
- package/dist/code-analyzer/analyzers/index.js.map +1 -1
- package/dist/code-analyzer/analyzers/jsdoc.js.map +1 -1
- package/dist/code-analyzer/analyzers/static-components.js.map +1 -1
- package/dist/code-analyzer/analyzers/storybook-docs.js.map +1 -1
- package/dist/code-analyzer/analyzers/storybook-stories.js.map +1 -1
- package/dist/code-analyzer/analyzers/types.js.map +1 -1
- package/dist/code-analyzer/analyzers/typescript-api.js.map +1 -1
- package/dist/code-analyzer/components/analyze.js.map +1 -1
- package/dist/code-analyzer/components/mappers/component.js.map +1 -1
- package/dist/code-analyzer/components/mappers/property.js.map +1 -1
- package/dist/code-analyzer/components/parser/index.js.map +1 -1
- package/dist/code-analyzer/components/parser/module-parser.js.map +1 -1
- package/dist/code-analyzer/components/parser/parser.js.map +1 -1
- package/dist/code-analyzer/components/parser/types.js.map +1 -1
- package/dist/code-analyzer/components/parser/utils/build-filter.js.map +1 -1
- package/dist/code-analyzer/components/parser/utils/filter-duplicates.js.map +1 -1
- package/dist/code-analyzer/components/parser/utils/is-react-component.js.map +1 -1
- package/dist/code-analyzer/components/parser/utils/trim-file-name.js.map +1 -1
- package/dist/code-analyzer/components/types.js.map +1 -1
- package/dist/code-analyzer/components/utils/get-module-exports-path.js.map +1 -1
- package/dist/code-analyzer/index.js.map +1 -1
- package/dist/code-analyzer/orchestrator/index.js.map +1 -1
- package/dist/code-analyzer/orchestrator/run-analysis.js.map +1 -1
- package/dist/code-analyzer/snapshot/index.js.map +1 -1
- package/dist/code-analyzer/snapshot/write-snapshot.js.map +1 -1
- package/dist/commands/analyze/adoption.js.map +1 -1
- package/dist/commands/analyze/components.js.map +1 -1
- package/dist/commands/analyze/status.js.map +1 -1
- package/dist/commands/analyze.js.map +1 -1
- package/dist/commands/components-import.js.map +1 -1
- package/dist/commands/describe-design-system.js.map +1 -1
- package/dist/commands/describe-workspaces.js.map +1 -1
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logout.js.map +1 -1
- package/dist/commands/publish-documentation.js.map +1 -1
- package/dist/commands/run-local-exporter.js.map +1 -1
- package/dist/commands/storybook-import.js.map +1 -1
- package/dist/commands/sync-tokens.js.map +1 -1
- package/dist/commands/template-upload.d.ts +4 -1
- package/dist/commands/template-upload.d.ts.map +1 -1
- package/dist/commands/template-upload.js +83 -48
- package/dist/commands/template-upload.js.map +1 -1
- package/dist/commands/whoami.js.map +1 -1
- package/dist/hooks/postrun/save-config.js.map +1 -1
- package/dist/hooks/prerun/load-config.js.map +1 -1
- package/dist/hooks/prerun/sentry.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/services/auth.service.js.map +1 -1
- package/dist/services/index.js.map +1 -1
- package/dist/services/user.service.d.ts.map +1 -1
- package/dist/services/user.service.js.map +1 -1
- package/dist/services/vault.service.js.map +1 -1
- package/dist/types/base-command.js.map +1 -1
- package/dist/types/config.js.map +1 -1
- package/dist/types/environment.js.map +1 -1
- package/dist/types/flags.js.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/login.js.map +1 -1
- package/dist/types/not-authorized.error.js.map +1 -1
- package/dist/types/sentry-command.js.map +1 -1
- package/dist/types/types.js.map +1 -1
- package/dist/utils/analyze-command.js.map +1 -1
- package/dist/utils/analyze-status.js.map +1 -1
- package/dist/utils/api-client.js.map +1 -1
- package/dist/utils/common.js.map +1 -1
- package/dist/utils/config.service.js.map +1 -1
- package/dist/utils/discover.d.ts +1 -1
- package/dist/utils/discover.d.ts.map +1 -1
- package/dist/utils/discover.js +5 -5
- package/dist/utils/discover.js.map +1 -1
- package/dist/utils/figma-tokens-data-loader.js.map +1 -1
- package/dist/utils/http-client.js.map +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/run-exporter/exporter-utils.js.map +1 -1
- package/dist/utils/sdk.js.map +1 -1
- package/dist/utils/validate-templates.js.map +1 -1
- package/oclif.manifest.json +24 -7
- package/package.json +10 -10
- package/dist/docker-scripts/extract-private-packages.js +0 -74
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-snapshot.js","sources":["../../../src/code-analyzer/snapshot/write-snapshot.ts"],"sourceRoot":"","sourcesContent":["import { mkdir, writeFile } from \"node:fs/promises\"\nimport path from \"node:path\"\n\nimport { AnalyzerArtifacts, UsageRecord } from \"../analyzers/types.js\"\n\ntype Input = {\n artifacts: AnalyzerArtifacts\n rawArtifacts?: RawArtifactName[]\n snapshotRoot: string\n usageImportFromPackages?: string[]\n}\n\ntype RawArtifactName =\n | \"static-components\"\n | \"typescript-api\"\n | \"storybook-stories\"\n | \"storybook-docs\"\n | \"jsdoc\"\n | \"component-usage\"\n\nexport type ComponentUsageSnapshot = {\n meta: {\n importFromPackages: string[]\n }\n records: Record<string, UsageRecord>\n}\n\nasync function ensureSnapshotLayout(snapshotRoot: string): Promise<void> {\n await mkdir(path.join(snapshotRoot, \"raw\"), { recursive: true })\n}\n\nfunction isEmptyJsonPayload(payload: unknown): boolean {\n if (payload === null || payload === undefined) {\n return true\n }\n\n if (Array.isArray(payload)) {\n return payload.length === 0\n }\n\n if (typeof payload === \"object\") {\n return Object.keys(payload as Record<string, unknown>).length === 0\n }\n\n return false\n}\n\nasync function writeJson(filePath: string, payload: unknown): Promise<void> {\n if (isEmptyJsonPayload(payload)) {\n return\n }\n\n await writeFile(filePath, `${JSON.stringify(payload, null, 2)}\\n`, \"utf8\")\n}\n\nexport async function writeSnapshot(input: Input): Promise<void> {\n const { artifacts, snapshotRoot } = input\n await ensureSnapshotLayout(snapshotRoot)\n\n const rawArtifacts = new Set<RawArtifactName>(\n input.rawArtifacts ?? [\"static-components\", \"typescript-api\", \"storybook-stories\", \"storybook-docs\", \"jsdoc\", \"component-usage\"],\n )\n\n if (rawArtifacts.has(\"static-components\")) {\n await writeJson(path.join(snapshotRoot, \"raw\", \"static-components.json\"), artifacts.staticComponents)\n }\n\n if (rawArtifacts.has(\"typescript-api\")) {\n await writeJson(path.join(snapshotRoot, \"raw\", \"typescript-api.json\"), artifacts.typescriptApi)\n }\n\n if (rawArtifacts.has(\"storybook-stories\")) {\n await writeJson(path.join(snapshotRoot, \"raw\", \"storybook-stories.json\"), artifacts.storybookStories)\n }\n\n if (rawArtifacts.has(\"storybook-docs\")) {\n await writeJson(path.join(snapshotRoot, \"raw\", \"storybook-docs.json\"), artifacts.storybookDocs)\n }\n\n if (rawArtifacts.has(\"jsdoc\")) {\n await writeJson(path.join(snapshotRoot, \"raw\", \"jsdoc.json\"), artifacts.jsdoc)\n }\n\n if (rawArtifacts.has(\"component-usage\")) {\n const usageRecords = artifacts.componentUsage\n if (isEmptyJsonPayload(usageRecords)) {\n return\n }\n\n const payload: ComponentUsageSnapshot = {\n meta: {\n importFromPackages: [...new Set((input.usageImportFromPackages ?? []).map(item => item.trim()).filter(Boolean))].sort(\n (a, b) => a.localeCompare(b),\n ),\n },\n records: usageRecords,\n }\n\n await writeJson(path.join(snapshotRoot, \"raw\", \"component-usage.json\"), payload)\n }\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,IAAI,MAAM,WAAW,CAAA;AA0B5B,KAAK,UAAU,oBAAoB,CAAC,YAAoB;IACtD,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;AAClE,CAAC;AAED,SAAS,kBAAkB,CAAC,OAAgB;IAC1C,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC9C,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC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BAAsB,CAAC,EAAE,OAAO,CAAC,CAAA;IAClF,CAAC;AACH,CAAC","
|
|
1
|
+
{"version":3,"file":"write-snapshot.js","sources":["../../../src/code-analyzer/snapshot/write-snapshot.ts"],"sourceRoot":"","sourcesContent":["import { mkdir, writeFile } from \"node:fs/promises\"\nimport path from \"node:path\"\n\nimport { AnalyzerArtifacts, UsageRecord } from \"../analyzers/types.js\"\n\ntype Input = {\n artifacts: AnalyzerArtifacts\n rawArtifacts?: RawArtifactName[]\n snapshotRoot: string\n usageImportFromPackages?: string[]\n}\n\ntype RawArtifactName =\n | \"static-components\"\n | \"typescript-api\"\n | \"storybook-stories\"\n | \"storybook-docs\"\n | \"jsdoc\"\n | \"component-usage\"\n\nexport type ComponentUsageSnapshot = {\n meta: {\n importFromPackages: string[]\n }\n records: Record<string, UsageRecord>\n}\n\nasync function ensureSnapshotLayout(snapshotRoot: string): Promise<void> {\n await mkdir(path.join(snapshotRoot, \"raw\"), { recursive: true })\n}\n\nfunction isEmptyJsonPayload(payload: unknown): boolean {\n if (payload === null || payload === undefined) {\n return true\n }\n\n if (Array.isArray(payload)) {\n return payload.length === 0\n }\n\n if (typeof payload === \"object\") {\n return Object.keys(payload as Record<string, unknown>).length === 0\n }\n\n return false\n}\n\nasync function writeJson(filePath: string, payload: unknown): Promise<void> {\n if (isEmptyJsonPayload(payload)) {\n return\n }\n\n await writeFile(filePath, `${JSON.stringify(payload, null, 2)}\\n`, \"utf8\")\n}\n\nexport async function writeSnapshot(input: Input): Promise<void> {\n const { artifacts, snapshotRoot } = input\n await ensureSnapshotLayout(snapshotRoot)\n\n const rawArtifacts = new Set<RawArtifactName>(\n input.rawArtifacts ?? [\"static-components\", \"typescript-api\", \"storybook-stories\", \"storybook-docs\", \"jsdoc\", \"component-usage\"],\n )\n\n if (rawArtifacts.has(\"static-components\")) {\n await writeJson(path.join(snapshotRoot, \"raw\", \"static-components.json\"), artifacts.staticComponents)\n }\n\n if (rawArtifacts.has(\"typescript-api\")) {\n await writeJson(path.join(snapshotRoot, \"raw\", \"typescript-api.json\"), artifacts.typescriptApi)\n }\n\n if (rawArtifacts.has(\"storybook-stories\")) {\n await writeJson(path.join(snapshotRoot, \"raw\", \"storybook-stories.json\"), artifacts.storybookStories)\n }\n\n if (rawArtifacts.has(\"storybook-docs\")) {\n await writeJson(path.join(snapshotRoot, \"raw\", \"storybook-docs.json\"), artifacts.storybookDocs)\n }\n\n if (rawArtifacts.has(\"jsdoc\")) {\n await writeJson(path.join(snapshotRoot, \"raw\", \"jsdoc.json\"), artifacts.jsdoc)\n }\n\n if (rawArtifacts.has(\"component-usage\")) {\n const usageRecords = artifacts.componentUsage\n if (isEmptyJsonPayload(usageRecords)) {\n return\n }\n\n const payload: ComponentUsageSnapshot = {\n meta: {\n importFromPackages: [...new Set((input.usageImportFromPackages ?? []).map(item => item.trim()).filter(Boolean))].sort(\n (a, b) => a.localeCompare(b),\n ),\n },\n records: usageRecords,\n }\n\n await writeJson(path.join(snapshotRoot, \"raw\", \"component-usage.json\"), payload)\n }\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,IAAI,MAAM,WAAW,CAAA;AA0B5B,KAAK,UAAU,oBAAoB,CAAC,YAAoB;IACtD,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;AAClE,CAAC;AAED,SAAS,kBAAkB,CAAC,OAAgB;IAC1C,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC9C,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,OAAO,OAAO,CAAC,MAAM,KAAK,CAAC,CAAA;IAC7B,CAAC;IAED,IAAI,OAAO,OAAO,KAAK,QAAQ,EA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@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adoption.js","sources":["../../../src/commands/analyze/adoption.ts"],"sourceRoot":"","sourcesContent":["import { SentryTraced } from \"@sentry/nestjs\"\n\nimport { AnalyzeCommandBase, analyzeFlags } from \"../../utils/analyze-command.js\"\n\nexport default class AnalyzeAdoption extends AnalyzeCommandBase {\n static override hidden = true\n static override description = \"Analyze package adoption and push adoption snapshots to Supernova\"\n static override examples = [\n \"<%= config.bin %> <%= command.id %> --designSystemId 123 --package @acme/ds\",\n \"<%= config.bin %> <%= command.id %> --package @acme/ds --dry-run\",\n ]\n static override flags = analyzeFlags\n\n @SentryTraced()\n public async run(): Promise<void> {\n const { flags } = await this.parse(AnalyzeAdoption)\n await this.executeAnalyze(flags, \"usage\")\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAEjF,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,kBAAkB;IAC7D,MAAM,CAAU,MAAM,GAAG,IAAI,CAAA;IAC7B,MAAM,CAAU,WAAW,GAAG,mEAAmE,CAAA;IACjG,MAAM,CAAU,QAAQ,GAAG;QACzB,6EAA6E;QAC7E,kEAAkE;KACnE,CAAA;IACD,MAAM,CAAU,KAAK,GAAG,YAAY,CAAA;IAGvB,AAAN,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;QACnD,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IAC3C,CAAC;;AAHY;IADZ,YAAY,EAAE;;;;0CAId","
|
|
1
|
+
{"version":3,"file":"adoption.js","sources":["../../../src/commands/analyze/adoption.ts"],"sourceRoot":"","sourcesContent":["import { SentryTraced } from \"@sentry/nestjs\"\n\nimport { AnalyzeCommandBase, analyzeFlags } from \"../../utils/analyze-command.js\"\n\nexport default class AnalyzeAdoption extends AnalyzeCommandBase {\n static override hidden = true\n static override description = \"Analyze package adoption and push adoption snapshots to Supernova\"\n static override examples = [\n \"<%= config.bin %> <%= command.id %> --designSystemId 123 --package @acme/ds\",\n \"<%= config.bin %> <%= command.id %> --package @acme/ds --dry-run\",\n ]\n static override flags = analyzeFlags\n\n @SentryTraced()\n public async run(): Promise<void> {\n const { flags } = await this.parse(AnalyzeAdoption)\n await this.executeAnalyze(flags, \"usage\")\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAEjF,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,kBAAkB;IAC7D,MAAM,CAAU,MAAM,GAAG,IAAI,CAAA;IAC7B,MAAM,CAAU,WAAW,GAAG,mEAAmE,CAAA;IACjG,MAAM,CAAU,QAAQ,GAAG;QACzB,6EAA6E;QAC7E,kEAAkE;KACnE,CAAA;IACD,MAAM,CAAU,KAAK,GAAG,YAAY,CAAA;IAGvB,AAAN,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;QACnD,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IAC3C,CAAC;;AAHY;IADZ,YAAY,EAAE;;;;0CAId","debugId":"1312306f-3ab0-5d68-a8b3-7bccb1df5b10"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sources":["../../../src/commands/analyze/components.ts"],"sourceRoot":"","sourcesContent":["import { SentryTraced } from \"@sentry/nestjs\"\n\nimport { AnalyzeCommandBase, analyzeFlags } from \"../../utils/analyze-command.js\"\n\nexport default class AnalyzeComponents extends AnalyzeCommandBase {\n static override hidden = true\n static override description = \"Analyze design system components and push component snapshots to Supernova\"\n static override examples = [\n \"<%= config.bin %> <%= command.id %> --designSystemId 123 --package @acme/ds\",\n \"<%= config.bin %> <%= command.id %> --package @acme/ds --dry-run\",\n ]\n static override flags = analyzeFlags\n\n @SentryTraced()\n public async run(): Promise<void> {\n const { flags } = await this.parse(AnalyzeComponents)\n await this.executeAnalyze(flags, \"components\")\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAEjF,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,kBAAkB;IAC/D,MAAM,CAAU,MAAM,GAAG,IAAI,CAAA;IAC7B,MAAM,CAAU,WAAW,GAAG,4EAA4E,CAAA;IAC1G,MAAM,CAAU,QAAQ,GAAG;QACzB,6EAA6E;QAC7E,kEAAkE;KACnE,CAAA;IACD,MAAM,CAAU,KAAK,GAAG,YAAY,CAAA;IAGvB,AAAN,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAA;QACrD,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,YAAY,CAAC,CAAA;IAChD,CAAC;;AAHY;IADZ,YAAY,EAAE;;;;4CAId","
|
|
1
|
+
{"version":3,"file":"components.js","sources":["../../../src/commands/analyze/components.ts"],"sourceRoot":"","sourcesContent":["import { SentryTraced } from \"@sentry/nestjs\"\n\nimport { AnalyzeCommandBase, analyzeFlags } from \"../../utils/analyze-command.js\"\n\nexport default class AnalyzeComponents extends AnalyzeCommandBase {\n static override hidden = true\n static override description = \"Analyze design system components and push component snapshots to Supernova\"\n static override examples = [\n \"<%= config.bin %> <%= command.id %> --designSystemId 123 --package @acme/ds\",\n \"<%= config.bin %> <%= command.id %> --package @acme/ds --dry-run\",\n ]\n static override flags = analyzeFlags\n\n @SentryTraced()\n public async run(): Promise<void> {\n const { flags } = await this.parse(AnalyzeComponents)\n await this.executeAnalyze(flags, \"components\")\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAEjF,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,kBAAkB;IAC/D,MAAM,CAAU,MAAM,GAAG,IAAI,CAAA;IAC7B,MAAM,CAAU,WAAW,GAAG,4EAA4E,CAAA;IAC1G,MAAM,CAAU,QAAQ,GAAG;QACzB,6EAA6E;QAC7E,kEAAkE;KACnE,CAAA;IACD,MAAM,CAAU,KAAK,GAAG,YAAY,CAAA;IAGvB,AAAN,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAA;QACrD,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,YAAY,CAAC,CAAA;IAChD,CAAC;;AAHY;IADZ,YAAY,EAAE;;;;4CAId","debugId":"e15aba56-cfab-5cc4-84bf-1599ee1cfdb8"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sources":["../../../src/commands/analyze/status.ts"],"sourceRoot":"","sourcesContent":["import { Flags } from \"@oclif/core\"\nimport { SentryTraced } from \"@sentry/nestjs\"\nimport { z, ZodType } from \"zod\"\n\nimport { SentryCommand } from \"../../types/index.js\"\nimport { watchAnalyzeStatus } from \"../../utils/analyze-status.js\"\nimport { createApiClient } from \"../../utils/http-client.js\"\n\nconst AnalyzeStatusConfig = z.object({\n designSystemId: z.string().optional(),\n})\n\ntype AnalyzeStatusConfig = z.infer<typeof AnalyzeStatusConfig>\n\nexport default class AnalyzeStatus extends SentryCommand<AnalyzeStatusConfig> {\n static override hidden = true\n static override args = {}\n static override description = \"Show code snapshot processing status for current user\"\n static override examples = [\"<%= config.bin %> <%= command.id %> --designSystemId 123\"]\n static override flags = {\n designSystemId: Flags.string({ char: \"d\", description: \"Design system ID\" }),\n }\n\n get commandId(): string {\n return AnalyzeStatus.id\n }\n\n get configSchema(): ZodType<AnalyzeStatusConfig> {\n return AnalyzeStatusConfig\n }\n\n @SentryTraced()\n public async run(): Promise<void> {\n const { flags } = await this.parse(AnalyzeStatus)\n const config = this.configService.get()\n const designSystemId = flags.designSystemId ?? config?.designSystemId ?? (await this.promptDesignSystemId())\n const apiClient = await createApiClient(this.env)\n\n await watchAnalyzeStatus({\n apiClient,\n designSystemId,\n error: message => this.error(message),\n })\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,CAAC,EAAW,MAAM,KAAK,CAAA;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAE5D,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACtC,CAAC,CAAA;AAIF,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,aAAkC;IAC3E,MAAM,CAAU,MAAM,GAAG,IAAI,CAAA;IAC7B,MAAM,CAAU,IAAI,GAAG,EAAE,CAAA;IACzB,MAAM,CAAU,WAAW,GAAG,uDAAuD,CAAA;IACrF,MAAM,CAAU,QAAQ,GAAG,CAAC,0DAA0D,CAAC,CAAA;IACvF,MAAM,CAAU,KAAK,GAAG;QACtB,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;KAC7E,CAAA;IAED,IAAI,SAAS;QACX,OAAO,aAAa,CAAC,EAAE,CAAA;IACzB,CAAC;IAED,IAAI,YAAY;QACd,OAAO,mBAAmB,CAAA;IAC5B,CAAC;IAGY,AAAN,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;QACjD,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,CAAA;QACvC,MAAM,cAAc,GAAG,KAAK,CAAC,cAAc,IAAI,MAAM,EAAE,cAAc,IAAI,CAAC,MAAM,IAAI,CAAC,oBAAoB,EAAE,CAAC,CAAA;QAC5G,MAAM,SAAS,GAAG,MAAM,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAEjD,MAAM,kBAAkB,CAAC;YACvB,SAAS;YACT,cAAc;YACd,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;SACtC,CAAC,CAAA;IACJ,CAAC;;AAXY;IADZ,YAAY,EAAE;;;;wCAYd","
|
|
1
|
+
{"version":3,"file":"status.js","sources":["../../../src/commands/analyze/status.ts"],"sourceRoot":"","sourcesContent":["import { Flags } from \"@oclif/core\"\nimport { SentryTraced } from \"@sentry/nestjs\"\nimport { z, ZodType } from \"zod\"\n\nimport { SentryCommand } from \"../../types/index.js\"\nimport { watchAnalyzeStatus } from \"../../utils/analyze-status.js\"\nimport { createApiClient } from \"../../utils/http-client.js\"\n\nconst AnalyzeStatusConfig = z.object({\n designSystemId: z.string().optional(),\n})\n\ntype AnalyzeStatusConfig = z.infer<typeof AnalyzeStatusConfig>\n\nexport default class AnalyzeStatus extends SentryCommand<AnalyzeStatusConfig> {\n static override hidden = true\n static override args = {}\n static override description = \"Show code snapshot processing status for current user\"\n static override examples = [\"<%= config.bin %> <%= command.id %> --designSystemId 123\"]\n static override flags = {\n designSystemId: Flags.string({ char: \"d\", description: \"Design system ID\" }),\n }\n\n get commandId(): string {\n return AnalyzeStatus.id\n }\n\n get configSchema(): ZodType<AnalyzeStatusConfig> {\n return AnalyzeStatusConfig\n }\n\n @SentryTraced()\n public async run(): Promise<void> {\n const { flags } = await this.parse(AnalyzeStatus)\n const config = this.configService.get()\n const designSystemId = flags.designSystemId ?? config?.designSystemId ?? (await this.promptDesignSystemId())\n const apiClient = await createApiClient(this.env)\n\n await watchAnalyzeStatus({\n apiClient,\n designSystemId,\n error: message => this.error(message),\n })\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,CAAC,EAAW,MAAM,KAAK,CAAA;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAE5D,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACtC,CAAC,CAAA;AAIF,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,aAAkC;IAC3E,MAAM,CAAU,MAAM,GAAG,IAAI,CAAA;IAC7B,MAAM,CAAU,IAAI,GAAG,EAAE,CAAA;IACzB,MAAM,CAAU,WAAW,GAAG,uDAAuD,CAAA;IACrF,MAAM,CAAU,QAAQ,GAAG,CAAC,0DAA0D,CAAC,CAAA;IACvF,MAAM,CAAU,KAAK,GAAG;QACtB,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;KAC7E,CAAA;IAED,IAAI,SAAS;QACX,OAAO,aAAa,CAAC,EAAE,CAAA;IACzB,CAAC;IAED,IAAI,YAAY;QACd,OAAO,mBAAmB,CAAA;IAC5B,CAAC;IAGY,AAAN,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;QACjD,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,CAAA;QACvC,MAAM,cAAc,GAAG,KAAK,CAAC,cAAc,IAAI,MAAM,EAAE,cAAc,IAAI,CAAC,MAAM,IAAI,CAAC,oBAAoB,EAAE,CAAC,CAAA;QAC5G,MAAM,SAAS,GAAG,MAAM,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAEjD,MAAM,kBAAkB,CAAC;YACvB,SAAS;YACT,cAAc;YACd,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;SACtC,CAAC,CAAA;IACJ,CAAC;;AAXY;IADZ,YAAY,EAAE;;;;wCAYd","debugId":"9b414a25-ffd6-56d4-9196-e9ef1b31464d"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyze.js","sources":["../../src/commands/analyze.ts"],"sourceRoot":"","sourcesContent":["import { SentryTraced } from \"@sentry/nestjs\"\nimport fs from \"node:fs\"\nimport path from \"node:path\"\nimport { fileURLToPath } from \"node:url\"\n\nimport { AnalyzeCommandBase, analyzeFlags } from \"../utils/analyze-command.js\"\n\nconst fallbackAnalyzeHelpDescription = [\n \"Analyze components and package adoption for one or more packages.\",\n \"Runs both scanners (`components` and `usage`) for each package target.\",\n \"By default, generated snapshots are uploaded to Supernova and processing is tracked until completion.\",\n \"Use `--dryRun` to keep results local only and skip upload, or `--noWait` to exit after processing starts.\",\n].join(\"\\n\")\n\nconst loadAnalyzeHelpDescription = (): string => {\n const commandFilePath = fileURLToPath(import.meta.url)\n const docsPath = path.resolve(path.dirname(commandFilePath), \"../../docs/code-analysis.md\")\n\n try {\n return fs.readFileSync(docsPath, \"utf8\").trim()\n } catch {\n return fallbackAnalyzeHelpDescription\n }\n}\n\nexport default class Analyze extends AnalyzeCommandBase {\n static override description = loadAnalyzeHelpDescription()\n static override examples = [\n \"<%= config.bin %> <%= command.id %> --package @acme/ds --dryRun\",\n \"<%= config.bin %> <%= command.id %> --designSystemId 1234 --package @acme/ds\",\n \"<%= config.bin %> <%= command.id %> --package @acme/ds --package @acme/icons\",\n \"<%= config.bin %> analyze status --designSystemId 1234\",\n ]\n static override flags = analyzeFlags\n\n @SentryTraced()\n public async run(): Promise<void> {\n const { flags } = await this.parse(Analyze)\n await this.executeAnalyze(flags, \"all\")\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAE9E,MAAM,8BAA8B,GAAG;IACrC,mEAAmE;IACnE,wEAAwE;IACxE,uGAAuG;IACvG,2GAA2G;CAC5G,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAEZ,MAAM,0BAA0B,GAAG,GAAW,EAAE;IAC9C,MAAM,eAAe,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACtD,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,6BAA6B,CAAC,CAAA;IAE3F,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAA;IACjD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,8BAA8B,CAAA;IACvC,CAAC;AACH,CAAC,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,kBAAkB;IACrD,MAAM,CAAU,WAAW,GAAG,0BAA0B,EAAE,CAAA;IAC1D,MAAM,CAAU,QAAQ,GAAG;QACzB,iEAAiE;QACjE,8EAA8E;QAC9E,8EAA8E;QAC9E,wDAAwD;KACzD,CAAA;IACD,MAAM,CAAU,KAAK,GAAG,YAAY,CAAA;IAGvB,AAAN,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAC3C,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;IACzC,CAAC;;AAHY;IADZ,YAAY,EAAE;;;;kCAId","
|
|
1
|
+
{"version":3,"file":"analyze.js","sources":["../../src/commands/analyze.ts"],"sourceRoot":"","sourcesContent":["import { SentryTraced } from \"@sentry/nestjs\"\nimport fs from \"node:fs\"\nimport path from \"node:path\"\nimport { fileURLToPath } from \"node:url\"\n\nimport { AnalyzeCommandBase, analyzeFlags } from \"../utils/analyze-command.js\"\n\nconst fallbackAnalyzeHelpDescription = [\n \"Analyze components and package adoption for one or more packages.\",\n \"Runs both scanners (`components` and `usage`) for each package target.\",\n \"By default, generated snapshots are uploaded to Supernova and processing is tracked until completion.\",\n \"Use `--dryRun` to keep results local only and skip upload, or `--noWait` to exit after processing starts.\",\n].join(\"\\n\")\n\nconst loadAnalyzeHelpDescription = (): string => {\n const commandFilePath = fileURLToPath(import.meta.url)\n const docsPath = path.resolve(path.dirname(commandFilePath), \"../../docs/code-analysis.md\")\n\n try {\n return fs.readFileSync(docsPath, \"utf8\").trim()\n } catch {\n return fallbackAnalyzeHelpDescription\n }\n}\n\nexport default class Analyze extends AnalyzeCommandBase {\n static override description = loadAnalyzeHelpDescription()\n static override examples = [\n \"<%= config.bin %> <%= command.id %> --package @acme/ds --dryRun\",\n \"<%= config.bin %> <%= command.id %> --designSystemId 1234 --package @acme/ds\",\n \"<%= config.bin %> <%= command.id %> --package @acme/ds --package @acme/icons\",\n \"<%= config.bin %> analyze status --designSystemId 1234\",\n ]\n static override flags = analyzeFlags\n\n @SentryTraced()\n public async run(): Promise<void> {\n const { flags } = await this.parse(Analyze)\n await this.executeAnalyze(flags, \"all\")\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAE9E,MAAM,8BAA8B,GAAG;IACrC,mEAAmE;IACnE,wEAAwE;IACxE,uGAAuG;IACvG,2GAA2G;CAC5G,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAEZ,MAAM,0BAA0B,GAAG,GAAW,EAAE;IAC9C,MAAM,eAAe,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACtD,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,6BAA6B,CAAC,CAAA;IAE3F,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAA;IACjD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,8BAA8B,CAAA;IACvC,CAAC;AACH,CAAC,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,kBAAkB;IACrD,MAAM,CAAU,WAAW,GAAG,0BAA0B,EAAE,CAAA;IAC1D,MAAM,CAAU,QAAQ,GAAG;QACzB,iEAAiE;QACjE,8EAA8E;QAC9E,8EAA8E;QAC9E,wDAAwD;KACzD,CAAA;IACD,MAAM,CAAU,KAAK,GAAG,YAAY,CAAA;IAGvB,AAAN,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAC3C,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;IACzC,CAAC;;AAHY;IADZ,YAAY,EAAE;;;;kCAId","debugId":"3f3af4ca-e4e7-5c00-a85c-e086b173db13"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components-import.js","sources":["../../src/commands/components-import.ts"],"sourceRoot":"","sourcesContent":["import { Flags } from \"@oclif/core\"\nimport { SentryTraced } from \"@sentry/nestjs\"\nimport { analyzeComponents } from \"../code-analyzer/components/analyze.js\"\nimport { z, ZodType } from \"zod\"\n\nimport { SentryCommand } from \"../types/index.js\"\n\nconst ImportComponentsConfigSchema = z\n .object({\n designSystemId: z.string(),\n importFrom: z.string(),\n rootDir: z.string(),\n versionId: z.string(),\n })\n .transform(data => ({\n ...data,\n rootDir: data.rootDir ?? process.cwd(),\n }))\n\ntype ImportComponentsConfig = z.infer<typeof ImportComponentsConfigSchema>\n\nfunction isComponentsImportDisabled(): boolean {\n return true\n}\n\nexport default class ImportComponents extends SentryCommand<ImportComponentsConfig> {\n static override args = {}\n static override description = \"Analyze react components from given package and import them into Supernova\"\n static override examples = [\n \"<%= config.bin %> <%= command.id %> --importFrom components-package --rootDir ./src\",\n \"<%= config.bin %> <%= command.id %> --importFrom @mui/material\",\n ]\n static override flags = {\n designSystemId: Flags.string({ description: \"Import code components to design system of\", required: true }),\n importFrom: Flags.string({\n char: \"i\",\n description: \"Package or directory path to import components from\",\n required: true,\n }),\n rootDir: Flags.string({\n char: \"r\",\n default: process.cwd(), // Defaults to the current directory\n description:\n \"Root directory of the package where the import should resolve from. Defaults to the current directory\",\n }),\n versionId: Flags.string({ description: \"Import code components to version of\", required: true }),\n }\n static override hidden = true\n\n get commandId(): string {\n return ImportComponents.id\n }\n\n get configSchema(): ZodType<ImportComponentsConfig> {\n return ImportComponentsConfigSchema\n }\n\n @SentryTraced()\n public async run(): Promise<void> {\n if (isComponentsImportDisabled()) {\n this.error(\"Command 'components-import' is temporarily disabled. use 'analyze' instead.\")\n }\n\n const { flags } = await this.parse(ImportComponents)\n\n const { designSystemId, importFrom, rootDir, versionId } = flags\n\n this.log(\"📦 Component Import Summary\")\n this.log(\"========================\")\n this.log(`Source: ${importFrom}`)\n this.log(`Root Directory: ${rootDir}`)\n\n const components = await analyzeComponents({ importFrom, rootDir })\n\n if (components.length > 0) {\n this.log(\"\\nComponent Summary Table:\")\n this.log(\"━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\")\n this.log(\"Component Name Props.Num Required Props Names \")\n this.log(\"──────────────────────────────────────────────────────────\")\n\n for (const component of components) {\n const propsCount = Object.keys(component.properties).length\n const requiredCount = Object.values(component.properties).filter(prop => prop.required).length\n const propsNames = new Set(Object.values(component.properties).map(prop => prop.name))\n\n // Format each row with fixed width columns\n const name = component.exportName.padEnd(16, \" \").slice(0, 16)\n const propsNum = String(propsCount).padStart(5, \" \")\n const required = String(requiredCount).padStart(10, \" \")\n const props = [...propsNames].slice(0, 2).join(\", \") + (propsNames.size > 2 ? \", ...\" : \"\")\n\n this.log(`${name} ${propsNum} ${required} ${props}`)\n }\n\n this.log(\"━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\")\n this.log(\"Importing to Supernova...\")\n const client = await this.apiClient()\n const result = await client.designSystems.versions.codeComponents.import(designSystemId, versionId, {\n codeComponents: components.map(c => ({\n ...c,\n persistentId: `${designSystemId}-${versionId}${c.exportName}}`,\n })),\n })\n this.log(`Total: ${result.created} components imported`)\n } else {\n this.log(\"\\n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0DAA0D,CAAC,CAAA;YACpE,IAAI,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAA;YACrC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE,CAAA;YACrC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,cAAc,EAAE,SAAS,EAAE;gBAClG,cAAc,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;oBACnC,GAAG,CAAC;oBACJ,YAAY,EAAE,GAAG,cAAc,IAAI,SAAS,GAAG,CAAC,CAAC,UAAU,GAAG;iBAC/D,CAAC,CAAC;aACJ,CAAC,CAAA;YACF,IAAI,CAAC,GAAG,CAAC,UAAU,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAA;QAC1D,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAA;QAC/C,CAAC;IACH,CAAC;;AAjDY;IADZ,YAAY,EAAE;;;;2CAkDd","
|
|
1
|
+
{"version":3,"file":"components-import.js","sources":["../../src/commands/components-import.ts"],"sourceRoot":"","sourcesContent":["import { Flags } from \"@oclif/core\"\nimport { SentryTraced } from \"@sentry/nestjs\"\nimport { analyzeComponents } from \"../code-analyzer/components/analyze.js\"\nimport { z, ZodType } from \"zod\"\n\nimport { SentryCommand } from \"../types/index.js\"\n\nconst ImportComponentsConfigSchema = z\n .object({\n designSystemId: z.string(),\n importFrom: z.string(),\n rootDir: z.string(),\n versionId: z.string(),\n })\n .transform(data => ({\n ...data,\n rootDir: data.rootDir ?? process.cwd(),\n }))\n\ntype ImportComponentsConfig = z.infer<typeof ImportComponentsConfigSchema>\n\nfunction isComponentsImportDisabled(): boolean {\n return true\n}\n\nexport default class ImportComponents extends SentryCommand<ImportComponentsConfig> {\n static override args = {}\n static override description = \"Analyze react components from given package and import them into Supernova\"\n static override examples = [\n \"<%= config.bin %> <%= command.id %> --importFrom components-package --rootDir ./src\",\n \"<%= config.bin %> <%= command.id %> --importFrom @mui/material\",\n ]\n static override flags = {\n designSystemId: Flags.string({ description: \"Import code components to design system of\", required: true }),\n importFrom: Flags.string({\n char: \"i\",\n description: \"Package or directory path to import components from\",\n required: true,\n }),\n rootDir: Flags.string({\n char: \"r\",\n default: process.cwd(), // Defaults to the current directory\n description:\n \"Root directory of the package where the import should resolve from. Defaults to the current directory\",\n }),\n versionId: Flags.string({ description: \"Import code components to version of\", required: true }),\n }\n static override hidden = true\n\n get commandId(): string {\n return ImportComponents.id\n }\n\n get configSchema(): ZodType<ImportComponentsConfig> {\n return ImportComponentsConfigSchema\n }\n\n @SentryTraced()\n public async run(): Promise<void> {\n if (isComponentsImportDisabled()) {\n this.error(\"Command 'components-import' is temporarily disabled. use 'analyze' instead.\")\n }\n\n const { flags } = await this.parse(ImportComponents)\n\n const { designSystemId, importFrom, rootDir, versionId } = flags\n\n this.log(\"📦 Component Import Summary\")\n this.log(\"========================\")\n this.log(`Source: ${importFrom}`)\n this.log(`Root Directory: ${rootDir}`)\n\n const components = await analyzeComponents({ importFrom, rootDir })\n\n if (components.length > 0) {\n this.log(\"\\nComponent Summary Table:\")\n this.log(\"━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\")\n this.log(\"Component Name Props.Num Required Props Names \")\n this.log(\"──────────────────────────────────────────────────────────\")\n\n for (const component of components) {\n const propsCount = Object.keys(component.properties).length\n const requiredCount = Object.values(component.properties).filter(prop => prop.required).length\n const propsNames = new Set(Object.values(component.properties).map(prop => prop.name))\n\n // Format each row with fixed width columns\n const name = component.exportName.padEnd(16, \" \").slice(0, 16)\n const propsNum = String(propsCount).padStart(5, \" \")\n const required = String(requiredCount).padStart(10, \" \")\n const props = [...propsNames].slice(0, 2).join(\", \") + (propsNames.size > 2 ? \", ...\" : \"\")\n\n this.log(`${name} ${propsNum} ${required} ${props}`)\n }\n\n this.log(\"━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\")\n this.log(\"Importing to Supernova...\")\n const client = await this.apiClient()\n const result = await client.designSystems.versions.codeComponents.import(designSystemId, versionId, {\n codeComponents: components.map(c => ({\n ...c,\n persistentId: `${designSystemId}-${versionId}${c.exportName}}`,\n })),\n })\n this.log(`Total: ${result.created} components imported`)\n } else {\n this.log(\"\\n⚠️ No components were imported\")\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC1E,OAAO,EAAE,CAAC,EAAW,MAAM,KAAK,CAAA;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,MAAM,4BAA4B,GAAG,CAAC;KACnC,MAAM,CAAC;IACN,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC;KACD,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClB,GAAG,IAAI;IACP,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,GAAG,EAAE;CACvC,CAAC,CAAC,CAAA;AAIL,SAAS,0BAA0B;IACjC,OAAO,IAAI,CAAA;AACb,CAAC;AAED,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,aAAqC;IACjF,MAAM,CAAU,IAAI,GAAG,EAAE,CAAA;IACzB,MAAM,CAAU,WAAW,GAAG,4EAA4E,CAAA;IAC1G,MAAM,CAAU,QAAQ,GAAG;QACzB,qFAAqF;QACrF,gEAAgE;KACjE,CAAA;IACD,MAAM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CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;gBAE3F,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,IAAI,QAAQ,IAAI,QAAQ,KAAK,KAAK,EAAE,CAAC,CAAA;YACvD,CAAC;YAED,IAAI,CAAC,GAAG,CAAC,0DAA0D,CAAC,CAAA;YACpE,IAAI,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAA;YACrC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE,CAAA;YACrC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,cAAc,EAAE,SAAS,EAAE;gBAClG,cAAc,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;oBACnC,GAAG,CAAC;oBACJ,YAAY,EAAE,GAAG,cAAc,IAAI,SAAS,GAAG,CAAC,CAAC,UAAU,GAAG;iBAC/D,CAAC,CAAC;aACJ,CAAC,CAAA;YACF,IAAI,CAAC,GAAG,CAAC,UAAU,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAA;QAC1D,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAA;QAC/C,CAAC;IACH,CAAC;;AAjDY;IADZ,YAAY,EAAE;;;;2CAkDd","debugId":"ae5b58ad-8f2a-5c93-9f0d-ca24127407f4"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe-design-system.js","sources":["../../src/commands/describe-design-system.ts"],"sourceRoot":"","sourcesContent":["//\n// describe-design-system.ts\n// Supernova CLI\n//\n// Created by Jiri Trecak.\n// Copyright © Supernova.io. All rights reserved.\n//\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Imports\n\nimport { Flags } from \"@oclif/core\"\nimport { SentryTraced } from \"@sentry/nestjs\"\nimport { z } from \"zod\"\n\nimport { commonFlags, SentryCommand } from \"../types/index.js\"\nimport { getWritableVersion } from \"../utils/sdk.js\"\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Definition\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Configuration\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Tool implementation\n\nconst DescribeDesignSystemConfigSchema = z\n .object({\n apiKey: z.string(),\n designSystemId: z.string(),\n proxyUrl: z.string().url().optional(),\n })\n .transform(data => ({\n ...data,\n }))\n\ntype DescribeDesignSystemConfig = z.infer<typeof DescribeDesignSystemConfigSchema>\n\n/** Command that describes the structure of provided design system */\nexport class DescribeDesignSystem extends SentryCommand<DescribeDesignSystemConfig> {\n // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n // MARK: - Command configuration\n\n // How this command can be run\n static override aliases = [\"describe-design-system\"]\n // Command help description\n static override description = \"Describe structure of single design system by provided ID\"\n // Examples how to use the command\n static override examples = [\n `$ @supernovaio/cli describe-design-system --apiKey=\"{xxx-xxx-xxx}\" --designSystemId=\"{1234}\"`,\n ]\n // Static flags to enable / disable features\n static override flags = {\n ...commonFlags,\n apiKey: Flags.string({ description: \"API key to use for accessing Supernova instance\", required: true }),\n designSystemId: Flags.string({ description: \"Design System to describe structure of\", required: true }),\n proxyUrl: Flags.string({\n description: \"When set, CLI will use provided proxy URL for all requests\",\n hidden: true,\n required: false,\n }),\n }\n\n get commandId(): string {\n return DescribeDesignSystem.id\n }\n\n get configSchema(): z.ZodType<DescribeDesignSystemConfig> {\n return DescribeDesignSystemConfigSchema\n }\n\n // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n // MARK: - Command runtime\n\n @SentryTraced()\n async run(): Promise<void> {\n const { flags } = await this.parse(DescribeDesignSystem)\n\n // Get workspace -> design system –> version\n const { designSystem, id, instance } = await getWritableVersion(flags)\n\n // Get brands and themes\n const brands = await instance.brands.getBrands(id)\n const themes = await instance.tokens.getTokenThemes(id)\n\n this.log(`\\n↳ Design system \"${designSystem.name}\", id: ${designSystem.id}`)\n for (const brand of brands) {\n this.log(` ↳ Brand: \"${brand.name}\", id: ${brand.id}`)\n const brandThemes = themes.filter(t => t.brandId === brand.id)\n if (brandThemes.length > 0) {\n for (const theme of brandThemes) {\n this.log(` ↳ Theme: \"${theme.name}\", id: ${theme.id}`)\n }\n } else {\n this.log(` ↳ No themes defined in this brand`)\n }\n }\n\n this.log(\"\\nDone\")\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAWA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAWpD,MAAM,gCAAgC,GAAG,CAAC;KACvC,MAAM,CAAC;IACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CACtC,CAAC;KACD,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClB,GAAG,IAAI;CACR,CAAC,CAAC,CAAA;AAKL,MAAM,OAAO,oBAAqB,SAAQ,aAAyC;IAKjF,MAAM,CAAU,OAAO,GAAG,CAAC,wBAA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I,UAAU,KAAK,CAAC,EAAE,EAAE,CAAC,CAAA;YACvD,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,KAAK,CAAC,EAAE,CAAC,CAAA;YAC9D,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC3B,KAAK,MAAM,KAAK,IAAI,WAAW,EAAE,CAAC;oBAChC,IAAI,CAAC,GAAG,CAAC,iBAAiB,KAAK,CAAC,IAAI,UAAU,KAAK,CAAC,EAAE,EAAE,CAAC,CAAA;gBAC3D,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAA;YACnD,CAAC;QACH,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IACpB,CAAC;;AAxBK;IADL,YAAY,EAAE;;;;+CAyBd","
|
|
1
|
+
{"version":3,"file":"describe-design-system.js","sources":["../../src/commands/describe-design-system.ts"],"sourceRoot":"","sourcesContent":["//\n// describe-design-system.ts\n// Supernova CLI\n//\n// Created by Jiri Trecak.\n// Copyright © Supernova.io. All rights reserved.\n//\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Imports\n\nimport { Flags } from \"@oclif/core\"\nimport { SentryTraced } from \"@sentry/nestjs\"\nimport { z } from \"zod\"\n\nimport { commonFlags, SentryCommand } from \"../types/index.js\"\nimport { getWritableVersion } from \"../utils/sdk.js\"\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Definition\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Configuration\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Tool implementation\n\nconst DescribeDesignSystemConfigSchema = z\n .object({\n apiKey: z.string(),\n designSystemId: z.string(),\n proxyUrl: z.string().url().optional(),\n })\n .transform(data => ({\n ...data,\n }))\n\ntype DescribeDesignSystemConfig = z.infer<typeof DescribeDesignSystemConfigSchema>\n\n/** Command that describes the structure of provided design system */\nexport class DescribeDesignSystem extends SentryCommand<DescribeDesignSystemConfig> {\n // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n // MARK: - Command configuration\n\n // How this command can be run\n static override aliases = [\"describe-design-system\"]\n // Command help description\n static override description = \"Describe structure of single design system by provided ID\"\n // Examples how to use the command\n static override examples = [\n `$ @supernovaio/cli describe-design-system --apiKey=\"{xxx-xxx-xxx}\" --designSystemId=\"{1234}\"`,\n ]\n // Static flags to enable / disable features\n static override flags = {\n ...commonFlags,\n apiKey: Flags.string({ description: \"API key to use for accessing Supernova instance\", required: true }),\n designSystemId: Flags.string({ description: \"Design System to describe structure of\", required: true }),\n proxyUrl: Flags.string({\n description: \"When set, CLI will use provided proxy URL for all requests\",\n hidden: true,\n required: false,\n }),\n }\n\n get commandId(): string {\n return DescribeDesignSystem.id\n }\n\n get configSchema(): z.ZodType<DescribeDesignSystemConfig> {\n return DescribeDesignSystemConfigSchema\n }\n\n // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n // MARK: - Command runtime\n\n @SentryTraced()\n async run(): Promise<void> {\n const { flags } = await this.parse(DescribeDesignSystem)\n\n // Get workspace -> design system –> version\n const { designSystem, id, instance } = await getWritableVersion(flags)\n\n // Get brands and themes\n const brands = await instance.brands.getBrands(id)\n const themes = await instance.tokens.getTokenThemes(id)\n\n this.log(`\\n↳ Design system \"${designSystem.name}\", id: ${designSystem.id}`)\n for (const brand of brands) {\n this.log(` ↳ Brand: \"${brand.name}\", id: ${brand.id}`)\n const brandThemes = themes.filter(t => t.brandId === brand.id)\n if (brandThemes.length > 0) {\n for (const theme of brandThemes) {\n this.log(` ↳ Theme: \"${theme.name}\", id: ${theme.id}`)\n }\n } else {\n this.log(` ↳ No themes defined in this brand`)\n }\n }\n\n this.log(\"\\nDone\")\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAWA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAWpD,MAAM,gCAAgC,GAAG,CAAC;KACvC,MAAM,CAAC;IACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CACtC,CAAC;KACD,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClB,GAAG,IAAI;CACR,CAAC,CAAC,CAAA;AAKL,MAAM,OAAO,oBAAqB,SAAQ,aAAyC;IAKjF,MAAM,CAAU,OAAO,GAAG,CAAC,wBAAwB,CAAC,CAAA;IAEpD,MAAM,CAAU,WAAW,GAAG,2DAA2D,CAAA;IAEzF,MAAM,CAAU,QAAQ,GAAG;QACzB,8FAA8F;KAC/F,CAAA;IAED,MAAM,CAAU,KAAK,GAAG;QACtB,GAAG,WAAW;QACd,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,iDAAiD,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QACxG,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,wCAAwC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QACvG,QAAQ,EAAE,KAAK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BAAM,CAAC;gBACN,IAAI,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAA;YACnD,CAAC;QACH,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IACpB,CAAC;;AAxBK;IADL,YAAY,EAAE;;;;+CAyBd","debugId":"abe7e738-7203-575d-bff4-733b92263d1b"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe-workspaces.js","sources":["../../src/commands/describe-workspaces.ts"],"sourceRoot":"","sourcesContent":["//\n// describe-workspaces.ts\n// Supernova CLI\n//\n// Created by Jiri Trecak.\n// Copyright © Supernova.io. All rights reserved.\n//\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Imports\n\nimport { Flags } from \"@oclif/core\"\nimport { SentryTraced } from \"@sentry/nestjs\"\nimport * as sdkTypes from \"@supernovaio/sdk\"\nimport { createRequire } from \"node:module\"\nimport { z, ZodType } from \"zod\"\n\nimport { apiUrlForEnvironment, commonFlags, getTargetEnv, SentryCommand } from \"../types/index.js\"\n\nconst require = createRequire(import.meta.url)\nconst sdkProvider = require(\"@supernovaio/sdk\") as typeof sdkTypes\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Definition\n\ninterface DescribeWorkspacesFlags {\n apiKey: string\n proxyUrl?: string\n}\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Configuration\n\nconst DescribeWorkspaceConfigSchema = z\n .object({\n apiKey: z.string(),\n proxyUrl: z.string().url().optional(),\n workspaceId: z.string(),\n })\n .transform(data => ({\n ...data,\n }))\n\ntype DescribeWorkspaceConfig = z.infer<typeof DescribeWorkspaceConfigSchema>\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Tool implementation\n\n/** Command that describes the structure of provided design system */\nexport class DescribeWorkspaces extends SentryCommand<DescribeWorkspaceConfig> {\n // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n // MARK: - Command configuration\n\n // How this command can be run\n static aliases = [\"describe-workspaces\"]\n // Command help description\n static description =\n \"Describe structure of all workspaces and design systems available under those workspaces available for specified API key\"\n // Examples how to use the command\n static examples = [`$ @supernovaio/cli describe-workspaces --apiKey=\"{xxx-xxx-xxx}\"`]\n // Static flags to enable / disable features\n static flags = {\n ...commonFlags,\n apiKey: Flags.string({ description: \"API key to use for accessing Supernova instance\", required: true }),\n proxyUrl: Flags.string({\n description: \"When set, CLI will use provided proxy URL for all requests\",\n hidden: true,\n required: false,\n }),\n }\n\n // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n // MARK: - Command runtime\n\n get commandId(): string {\n return DescribeWorkspaces.id\n }\n\n get configSchema(): ZodType<DescribeWorkspaceConfig> {\n return DescribeWorkspaceConfigSchema\n }\n\n @SentryTraced()\n async getWorkspaces(flags: DescribeWorkspacesFlags): Promise<{\n instance: sdkTypes.Supernova\n workspaces: Array<sdkTypes.Workspace>\n }> {\n if (!flags.apiKey || flags.apiKey.length === 0) {\n throw new Error(`API key must not be empty`)\n }\n\n // Create instance for prod / dev\n const apiUrl = apiUrlForEnvironment(getTargetEnv())\n const sdkInstance = new sdkProvider.Supernova(flags.apiKey, {\n apiUrl,\n })\n const user = await sdkInstance.me.me()\n const workspaces = await sdkInstance.workspaces.workspaces(user.id)\n return {\n instance: sdkInstance,\n workspaces,\n }\n }\n\n @SentryTraced()\n async run(): Promise<void> {\n const { flags } = await this.parse(DescribeWorkspaces)\n\n // Get workspaces\n const { instance, workspaces } = await this.getWorkspaces(flags)\n this.log(`\\n`)\n\n for (const workspace of workspaces) {\n // Get design systems and log\n const designSystems = await instance.designSystems.designSystems(workspace.id)\n this.log(`↳ Workspace \"${workspace.profile.name}\", id: ${workspace.id}`)\n for (const designSystem of designSystems) {\n this.log(` ↳ Design system \"${designSystem.name}\", id: ${designSystem.id}`)\n\n const version = await instance.versions.getActiveVersion(designSystem.id)\n if (!version) {\n this.log(`Design system ${designSystem.id} active version not found or not available under provided API key`)\n continue\n }\n\n const id: sdkTypes.RemoteVersionIdentifier = { designSystemId: designSystem.id, versionId: version.id }\n const brands = await instance.brands.getBrands(id)\n const themes = await instance.tokens.getTokenThemes(id)\n for (const brand of brands) {\n this.log(` ↳ Brand: \"${brand.name}\", id: ${brand.id}`)\n const brandThemes = themes.filter(t => t.brandId === brand.id)\n if (brandThemes.length > 0) {\n // eslint-disable-next-line max-depth\n for (const theme of brandThemes) {\n this.log(` ↳ Theme: \"${theme.name}\", id: ${theme.id}`)\n }\n } else {\n this.log(` ↳ No themes defined in this brand`)\n }\n }\n }\n }\n\n this.log(\"\\nDone\")\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAWA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,CAAC,EAAW,MAAM,KAAK,CAAA;AAEhC,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAElG,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC9C,MAAM,WAAW,GAAG,OAAO,CAAC,kBAAkB,CAAoB,CAAA;AAalE,MAAM,6BAA6B,GAAG,CAAC;KACpC,MAAM,CAAC;IACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACrC,WAAW,EAAE,CAAC,CAAC,MAA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MAAM,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,CAAA;gBACvD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;oBAC3B,IAAI,CAAC,GAAG,CAAC,iBAAiB,KAAK,CAAC,IAAI,UAAU,KAAK,CAAC,EAAE,EAAE,CAAC,CAAA;oBACzD,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,KAAK,CAAC,EAAE,CAAC,CAAA;oBAC9D,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;wBAE3B,KAAK,MAAM,KAAK,IAAI,WAAW,EAAE,CAAC;4BAChC,IAAI,CAAC,GAAG,CAAC,mBAAmB,KAAK,CAAC,IAAI,UAAU,KAAK,CAAC,EAAE,EAAE,CAAC,CAAA;wBAC7D,CAAC;oBACH,CAAC;yBAAM,CAAC;wBACN,IAAI,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAA;oBACrD,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IACpB,CAAC;;AA7DK;IADL,YAAY,EAAE;;;;uDAoBd;AAGK;IADL,YAAY,EAAE;;;;6CAwCd","
|
|
1
|
+
{"version":3,"file":"describe-workspaces.js","sources":["../../src/commands/describe-workspaces.ts"],"sourceRoot":"","sourcesContent":["//\n// describe-workspaces.ts\n// Supernova CLI\n//\n// Created by Jiri Trecak.\n// Copyright © Supernova.io. All rights reserved.\n//\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Imports\n\nimport { Flags } from \"@oclif/core\"\nimport { SentryTraced } from \"@sentry/nestjs\"\nimport * as sdkTypes from \"@supernovaio/sdk\"\nimport { createRequire } from \"node:module\"\nimport { z, ZodType } from \"zod\"\n\nimport { apiUrlForEnvironment, commonFlags, getTargetEnv, SentryCommand } from \"../types/index.js\"\n\nconst require = createRequire(import.meta.url)\nconst sdkProvider = require(\"@supernovaio/sdk\") as typeof sdkTypes\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Definition\n\ninterface DescribeWorkspacesFlags {\n apiKey: string\n proxyUrl?: string\n}\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Configuration\n\nconst DescribeWorkspaceConfigSchema = z\n .object({\n apiKey: z.string(),\n proxyUrl: z.string().url().optional(),\n workspaceId: z.string(),\n })\n .transform(data => ({\n ...data,\n }))\n\ntype DescribeWorkspaceConfig = z.infer<typeof DescribeWorkspaceConfigSchema>\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Tool implementation\n\n/** Command that describes the structure of provided design system */\nexport class DescribeWorkspaces extends SentryCommand<DescribeWorkspaceConfig> {\n // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n // MARK: - Command configuration\n\n // How this command can be run\n static aliases = [\"describe-workspaces\"]\n // Command help description\n static description =\n \"Describe structure of all workspaces and design systems available under those workspaces available for specified API key\"\n // Examples how to use the command\n static examples = [`$ @supernovaio/cli describe-workspaces --apiKey=\"{xxx-xxx-xxx}\"`]\n // Static flags to enable / disable features\n static flags = {\n ...commonFlags,\n apiKey: Flags.string({ description: \"API key to use for accessing Supernova instance\", required: true }),\n proxyUrl: Flags.string({\n description: \"When set, CLI will use provided proxy URL for all requests\",\n hidden: true,\n required: false,\n }),\n }\n\n // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n // MARK: - Command runtime\n\n get commandId(): string {\n return DescribeWorkspaces.id\n }\n\n get configSchema(): ZodType<DescribeWorkspaceConfig> {\n return DescribeWorkspaceConfigSchema\n }\n\n @SentryTraced()\n async getWorkspaces(flags: DescribeWorkspacesFlags): Promise<{\n instance: sdkTypes.Supernova\n workspaces: Array<sdkTypes.Workspace>\n }> {\n if (!flags.apiKey || flags.apiKey.length === 0) {\n throw new Error(`API key must not be empty`)\n }\n\n // Create instance for prod / dev\n const apiUrl = apiUrlForEnvironment(getTargetEnv())\n const sdkInstance = new sdkProvider.Supernova(flags.apiKey, {\n apiUrl,\n })\n const user = await sdkInstance.me.me()\n const workspaces = await sdkInstance.workspaces.workspaces(user.id)\n return {\n instance: sdkInstance,\n workspaces,\n }\n }\n\n @SentryTraced()\n async run(): Promise<void> {\n const { flags } = await this.parse(DescribeWorkspaces)\n\n // Get workspaces\n const { instance, workspaces } = await this.getWorkspaces(flags)\n this.log(`\\n`)\n\n for (const workspace of workspaces) {\n // Get design systems and log\n const designSystems = await instance.designSystems.designSystems(workspace.id)\n this.log(`↳ Workspace \"${workspace.profile.name}\", id: ${workspace.id}`)\n for (const designSystem of designSystems) {\n this.log(` ↳ Design system \"${designSystem.name}\", id: ${designSystem.id}`)\n\n const version = await instance.versions.getActiveVersion(designSystem.id)\n if (!version) {\n this.log(`Design system ${designSystem.id} active version not found or not available under provided API key`)\n continue\n }\n\n const id: sdkTypes.RemoteVersionIdentifier = { designSystemId: designSystem.id, versionId: version.id }\n const brands = await instance.brands.getBrands(id)\n const themes = await instance.tokens.getTokenThemes(id)\n for (const brand of brands) {\n this.log(` ↳ Brand: \"${brand.name}\", id: ${brand.id}`)\n const brandThemes = themes.filter(t => t.brandId === brand.id)\n if (brandThemes.length > 0) {\n // eslint-disable-next-line max-depth\n for (const theme of brandThemes) {\n this.log(` ↳ Theme: \"${theme.name}\", id: ${theme.id}`)\n }\n } else {\n this.log(` ↳ No themes defined in this brand`)\n }\n }\n }\n }\n\n this.log(\"\\nDone\")\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAWA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,C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AA;oBACrD,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IACpB,CAAC;;AA7DK;IADL,YAAY,EAAE;;;;uDAoBd;AAGK;IADL,YAAY,EAAE;;;;6CAwCd","debugId":"e9052c27-231c-56fd-820d-205df2bdcc63"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.js","sources":["../../src/commands/login.ts"],"sourceRoot":"","sourcesContent":["import { SentryTraced } from \"@sentry/nestjs\"\nimport open from \"open\"\nimport pkceChallenge from \"pkce-challenge\"\nimport { z } from \"zod\"\n\nimport { AuthService, VaultService } from \"../services/index.js\"\nimport { commonFlags, getTargetEnv, SentryCommand } from \"../types/index.js\"\n\nexport default class Login extends SentryCommand<object> {\n static override args = {}\n static override description = \"Login to the Supernova\"\n static override examples = [\"<%= config.bin %> <%= command.id %>\"]\n static override flags = commonFlags\n private readonly authService: AuthService = new AuthService()\n private readonly vaultService: VaultService = new VaultService()\n\n get commandId(): string {\n return Login.id\n }\n\n get configSchema() {\n return z.object({})\n }\n\n @SentryTraced()\n public async run(): Promise<void> {\n const env = getTargetEnv()\n\n const { code_challenge: codeChallenge, code_verifier: codeVerifier } = await pkceChallenge()\n\n this.log(\"\\n🔐 Authentication Process\\n\")\n this.log(\"1. Opening browser for authentication...\")\n const { authorizeUrl, readKey } = await this.authService.getAuthUrlFromServer(env, codeChallenge)\n await this.openBrowser(authorizeUrl)\n this.log(\"2. Waiting for authentication to complete...\")\n const tokens = await this.authService.getTokensFromServer(env, codeVerifier, readKey)\n if (tokens) {\n this.log(\"3. Login successful!\")\n this.log(\"4. Storing tokens...\")\n await this.vaultService.storeTokensToVault(tokens, env)\n this.log(\"5. You are now logged in\")\n } else {\n this.log(\"3. Login timed out\")\n }\n }\n\n @SentryTraced()\n private async openBrowser(url: string) {\n try {\n await open(url)\n } catch {\n this.log(\"Unable to open browser automatically - please visit the URL manually\")\n this.log(`\\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G,EAAE,aAAa,CAAC,CAAA;QACjG,MAAM,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAA;QACpC,IAAI,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAA;QACxD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,GAAG,EAAE,YAAY,EAAE,OAAO,CAAC,CAAA;QACrF,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAA;YAChC,IAAI,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAA;YAChC,MAAM,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;YACvD,IAAI,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAA;QACtC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAA;QAChC,CAAC;IACH,CAAC;IAGa,AAAN,KAAK,CAAC,WAAW,CAAC,GAAW;QACnC,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,GAAG,CAAC,CAAA;QACjB,CAAC;QAAC,MAAM,CAAC;YACP,IAAI,CAAC,GAAG,CAAC,sEAAsE,CAAC,CAAA;YAChF,IAAI,CAAC,GAAG,CAAC,sBAAsB,GAAG,aAAa,CAAC,CAAA;QAClD,CAAC;IACH,CAAC;;AA7BY;IADZ,YAAY,EAAE;;;;gCAoBd;AAGa;IADb,YAAY,EAAE;;;;wCAQd","
|
|
1
|
+
{"version":3,"file":"login.js","sources":["../../src/commands/login.ts"],"sourceRoot":"","sourcesContent":["import { SentryTraced } from \"@sentry/nestjs\"\nimport open from \"open\"\nimport pkceChallenge from \"pkce-challenge\"\nimport { z } from \"zod\"\n\nimport { AuthService, VaultService } from \"../services/index.js\"\nimport { commonFlags, getTargetEnv, SentryCommand } from \"../types/index.js\"\n\nexport default class Login extends SentryCommand<object> {\n static override args = {}\n static override description = \"Login to the Supernova\"\n static override examples = [\"<%= config.bin %> <%= command.id %>\"]\n static override flags = commonFlags\n private readonly authService: AuthService = new AuthService()\n private readonly vaultService: VaultService = new VaultService()\n\n get commandId(): string {\n return Login.id\n }\n\n get configSchema() {\n return z.object({})\n }\n\n @SentryTraced()\n public async run(): Promise<void> {\n const env = getTargetEnv()\n\n const { code_challenge: codeChallenge, code_verifier: codeVerifier } = await pkceChallenge()\n\n this.log(\"\\n🔐 Authentication Process\\n\")\n this.log(\"1. Opening browser for authentication...\")\n const { authorizeUrl, readKey } = await this.authService.getAuthUrlFromServer(env, codeChallenge)\n await this.openBrowser(authorizeUrl)\n this.log(\"2. Waiting for authentication to complete...\")\n const tokens = await this.authService.getTokensFromServer(env, codeVerifier, readKey)\n if (tokens) {\n this.log(\"3. Login successful!\")\n this.log(\"4. Storing tokens...\")\n await this.vaultService.storeTokensToVault(tokens, env)\n this.log(\"5. You are now logged in\")\n } else {\n this.log(\"3. Login timed out\")\n }\n }\n\n @SentryTraced()\n private async openBrowser(url: string) {\n try {\n await open(url)\n } catch {\n this.log(\"Unable to open browser automatically - please visit the URL manually\")\n this.log(`\\u001B[4m\\u001B[34m${url}\\u001B[0m\\n`)\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,aAAa,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAE5E,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,aAAqB;IACtD,MAAM,CAAU,IAAI,GAAG,EAAE,CAAA;IACzB,MAAM,CAAU,WAAW,GAAG,wBAAwB,CAAA;IACtD,M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,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAA;QAChC,CAAC;IACH,CAAC;IAGa,AAAN,KAAK,CAAC,WAAW,CAAC,GAAW;QACnC,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,GAAG,CAAC,CAAA;QACjB,CAAC;QAAC,MAAM,CAAC;YACP,IAAI,CAAC,GAAG,CAAC,sEAAsE,CAAC,CAAA;YAChF,IAAI,CAAC,GAAG,CAAC,sBAAsB,GAAG,aAAa,CAAC,CAAA;QAClD,CAAC;IACH,CAAC;;AA7BY;IADZ,YAAY,EAAE;;;;gCAoBd;AAGa;IADb,YAAY,EAAE;;;;wCAQd","debugId":"da88e2e1-d3c3-52a2-9bd8-370e65f493ad"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logout.js","sources":["../../src/commands/logout.ts"],"sourceRoot":"","sourcesContent":["import { SentryTraced } from \"@sentry/nestjs\"\nimport { z } from \"zod\"\n\nimport { VaultService } from \"../services/index.js\"\nimport { commonFlags, getTargetEnv, SentryCommand } from \"../types/index.js\"\n\nexport default class Logout extends SentryCommand<object> {\n static override args = {}\n static override description = \"Logout from the Supernova\"\n static override examples = [\"<%= config.bin %> <%= command.id %>\"]\n static override flags = commonFlags\n private vaultService = new VaultService()\n\n get commandId(): string {\n return Logout.id\n }\n\n get configSchema() {\n return z.object({})\n }\n\n @SentryTraced()\n public async run(): Promise<void> {\n await this.vaultService.deleteTokensFromVault(getTargetEnv())\n this.log(\"You have been logged out\")\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAE5E,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,aAAqB;IACvD,MAAM,CAAU,IAAI,GAAG,EAAE,CAAA;IACzB,MAAM,CAAU,WAAW,GAAG,2BAA2B,CAAA;IACzD,MAAM,CAAU,QAAQ,GAAG,CAAC,qCAAqC,CAAC,CAAA;IAClE,MAAM,CAAU,KAAK,GAAG,WAAW,CAAA;IAC3B,YAAY,GAAG,IAAI,YAAY,EAAE,CAAA;IAEzC,IAAI,SAAS;QACX,OAAO,MAAM,CAAC,EAAE,CAAA;IAClB,CAAC;IAED,IAAI,YAAY;QACd,OAAO,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IACrB,CAAC;IAGY,AAAN,KAAK,CAAC,GAAG;QACd,MAAM,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC,YAAY,EAAE,CAAC,CAAA;QAC7D,IAAI,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAA;IACtC,CAAC;;AAHY;IADZ,YAAY,EAAE;;;;iCAId","
|
|
1
|
+
{"version":3,"file":"logout.js","sources":["../../src/commands/logout.ts"],"sourceRoot":"","sourcesContent":["import { SentryTraced } from \"@sentry/nestjs\"\nimport { z } from \"zod\"\n\nimport { VaultService } from \"../services/index.js\"\nimport { commonFlags, getTargetEnv, SentryCommand } from \"../types/index.js\"\n\nexport default class Logout extends SentryCommand<object> {\n static override args = {}\n static override description = \"Logout from the Supernova\"\n static override examples = [\"<%= config.bin %> <%= command.id %>\"]\n static override flags = commonFlags\n private vaultService = new VaultService()\n\n get commandId(): string {\n return Logout.id\n }\n\n get configSchema() {\n return z.object({})\n }\n\n @SentryTraced()\n public async run(): Promise<void> {\n await this.vaultService.deleteTokensFromVault(getTargetEnv())\n this.log(\"You have been logged out\")\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAE5E,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,aAAqB;IACvD,MAAM,CAAU,IAAI,GAAG,EAAE,CAAA;IACzB,MAAM,CAAU,WAAW,GAAG,2BAA2B,CAAA;IACzD,MAAM,CAAU,QAAQ,GAAG,CAAC,qCAAqC,CAAC,CAAA;IAClE,MAAM,CAAU,KAAK,GAAG,WAAW,CAAA;IAC3B,YAAY,GAAG,IAAI,YAAY,EAAE,CAAA;IAEzC,IAAI,SAAS;QACX,OAAO,MAAM,CAAC,EAAE,CAAA;IAClB,CAAC;IAED,IAAI,YAAY;QACd,OAAO,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IACrB,CAAC;IAGY,AAAN,KAAK,CAAC,GAAG;QACd,MAAM,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC,YAAY,EAAE,CAAC,CAAA;QAC7D,IAAI,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAA;IACtC,CAAC;;AAHY;IADZ,YAAY,EAAE;;;;iCAId","debugId":"4d7556fb-dc54-5513-91d4-1e36e7d0c62d"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish-documentation.js","sources":["../../src/commands/publish-documentation.ts"],"sourceRoot":"","sourcesContent":["//\n// publish-documentation.ts\n// Supernova CLI\n//\n// Created by Jiri Trecak.\n// Copyright © Supernova.io. All rights reserved.\n//\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Imports\n\nimport { Flags } from \"@oclif/core\"\nimport { SentryTraced } from \"@sentry/nestjs\"\nimport sdkTypes from \"@supernovaio/sdk\"\nimport { z, ZodType } from \"zod\"\n\nimport { SentryCommand } from \"../types/index.js\"\nimport { sleep } from \"../utils/common.js\"\nimport { getWritableVersion } from \"../utils/sdk.js\"\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Definition\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Configuration\n\nconst PublishDocumentationConfigSchema = z.object({\n apiKey: z.string(),\n awaitPublishJob: z.boolean(),\n designSystemId: z.string(),\n dev: z.boolean(),\n proxyUrl: z.string().url().optional(),\n target: z.string(),\n})\n\ntype PublishDocumentationConfig = z.infer<typeof PublishDocumentationConfigSchema>\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Tool implementation\n\n/** Command that publishes documentation */\nexport class PublishDocumentation extends SentryCommand<PublishDocumentationConfig> {\n // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n // MARK: - Command configuration\n\n // How this command can be run\n static aliases = [\"publish-documentation\"]\n // Command help description\n static description = \"Publish latest version of the documentation\"\n // Examples how to use the command\n static examples = [`$ @supernovaio/cli publish-documentation --apiKey=\"{xxx-xxx-xxx}\" --designSystemId=\"{1234}\"`]\n // Static flags to enable / disable features\n static flags = {\n apiKey: Flags.string({ description: \"API key to use for accessing Supernova instance\", required: true }),\n awaitPublishJob: Flags.boolean({\n default: true,\n description:\n \"Whether to block the process until the publishing is done. \" +\n \"Setting the flag to false will exit with success as long as documentation publish was successfully triggered, \" +\n \"but before the publish is completed. Setting the flag to true will exit once the publish is complete and will \" +\n \"throw if documentation publish is not successful.\",\n }),\n designSystemId: Flags.string({ description: \"Design System to publish the documentation\", required: true }),\n dev: Flags.boolean({ default: false, description: \"When enabled, CLI will target dev server\", hidden: true }),\n proxyUrl: Flags.string({\n description: \"When set, CLI will use provided proxy URL for all requests\",\n hidden: true,\n required: false,\n }),\n target: Flags.string({\n default: \"Live\",\n description: \"Environment to use for publishing: Live or Preview\",\n required: false,\n }),\n }\n\n // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n // MARK: - Command runtime\n\n get commandId(): string {\n return PublishDocumentation.id\n }\n\n get configSchema(): ZodType<PublishDocumentationConfig> {\n return PublishDocumentationConfigSchema\n }\n\n @SentryTraced()\n async run(): Promise<void> {\n const { flags } = await this.parse(PublishDocumentation)\n\n const environment = tryParseDocsEnvironment(flags.target)\n if (!environment) {\n const supportedEnvs = [sdkTypes.DocumentationEnvironment.live, sdkTypes.DocumentationEnvironment.preview]\n this.error(`Unknown target ${flags.target}, must be one of [${supportedEnvs.join(\", \")}]`)\n }\n\n // Get workspace -> design system –> version\n const { designSystem, id, instance } = await getWritableVersion(flags)\n\n this.log(`Queueing documentation publish in ${designSystem.name}...`)\n\n let publishJob = await instance.documentation.publishDrafts(id, environment, undefined)\n\n this.log(`Documentation queued for publishing`)\n\n if (!flags.awaitPublishJob) {\n this.log(`Documentation publish await is disabled, exiting before the publish is finished.`)\n return\n }\n\n this.log(`Waiting for the documentation publish to be finished...`)\n\n // Timeout is roughly 30 minutes\n for (let i = 0; i < 30 * 60; i++) {\n await sleep(1000)\n publishJob = await instance.documentation.getDocumentationBuild(designSystem.workspaceId, publishJob.id)\n if (isJobStatusDone(publishJob.status)) break\n }\n\n switch (publishJob.status) {\n case \"Success\": {\n this.log(\"\\nDone: Documentation queued for publishing\")\n\n break\n }\n\n case \"Failed\": {\n throw new Error(`Documentation publish failed`)\n }\n\n case \"Timeout\": {\n throw new Error(`Documentation publish timed out`)\n }\n\n default: {\n throw new Error(`Error awaiting publish job`)\n }\n }\n }\n}\n\nfunction tryParseDocsEnvironment(targetArg: string) {\n switch (targetArg.toLowerCase()) {\n case \"live\": {\n return sdkTypes.DocumentationEnvironment.live\n }\n\n case \"preview\": {\n return sdkTypes.DocumentationEnvironment.preview\n }\n\n default: {\n return null\n }\n }\n}\n\nfunction isJobStatusDone(status: sdkTypes.ExportBuildStatus): boolean {\n return (\n status === sdkTypes.ExportBuildStatus.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C;IACH,CAAC;;AAnDK;IADL,YAAY,EAAE;;;;+CAoDd;AAGH,SAAS,uBAAuB,CAAC,SAAiB;IAChD,QAAQ,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC;QAChC,KAAK,MAAM,CAAC,CAAC,CAAC;YACZ,OAAO,QAAQ,CAAC,wBAAwB,CAAC,IAAI,CAAA;QAC/C,CAAC;QAED,KAAK,SAAS,CAAC,CAAC,CAAC;YACf,OAAO,QAAQ,CAAC,wBAAwB,CAAC,OAAO,CAAA;QAClD,CAAC;QAED,OAAO,CAAC,CAAC,CAAC;YACR,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,MAAkC;IACzD,OAAO,CACL,MAAM,KAAK,QAAQ,CAAC,iBAAiB,CAAC,MAAM;QAC5C,MAAM,KAAK,QAAQ,CAAC,iBAAiB,CAAC,OAAO;QAC7C,MAAM,KAAK,QAAQ,CAAC,iBAAiB,CAAC,OAAO,CAC9C,CAAA;AACH,CAAC","
|
|
1
|
+
{"version":3,"file":"publish-documentation.js","sources":["../../src/commands/publish-documentation.ts"],"sourceRoot":"","sourcesContent":["//\n// publish-documentation.ts\n// Supernova CLI\n//\n// Created by Jiri Trecak.\n// Copyright © Supernova.io. All rights reserved.\n//\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Imports\n\nimport { Flags } from \"@oclif/core\"\nimport { SentryTraced } from \"@sentry/nestjs\"\nimport sdkTypes from \"@supernovaio/sdk\"\nimport { z, ZodType } from \"zod\"\n\nimport { SentryCommand } from \"../types/index.js\"\nimport { sleep } from \"../utils/common.js\"\nimport { getWritableVersion } from \"../utils/sdk.js\"\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Definition\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Configuration\n\nconst PublishDocumentationConfigSchema = z.object({\n apiKey: z.string(),\n awaitPublishJob: z.boolean(),\n designSystemId: z.string(),\n dev: z.boolean(),\n proxyUrl: z.string().url().optional(),\n target: z.string(),\n})\n\ntype PublishDocumentationConfig = z.infer<typeof PublishDocumentationConfigSchema>\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Tool implementation\n\n/** Command that publishes documentation */\nexport class PublishDocumentation extends SentryCommand<PublishDocumentationConfig> {\n // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n // MARK: - Command configuration\n\n // How this command can be run\n static aliases = [\"publish-documentation\"]\n // Command help description\n static description = \"Publish latest version of the documentation\"\n // Examples how to use the command\n static examples = [`$ @supernovaio/cli publish-documentation --apiKey=\"{xxx-xxx-xxx}\" --designSystemId=\"{1234}\"`]\n // Static flags to enable / disable features\n static flags = {\n apiKey: Flags.string({ description: \"API key to use for accessing Supernova instance\", required: true }),\n awaitPublishJob: Flags.boolean({\n default: true,\n description:\n \"Whether to block the process until the publishing is done. \" +\n \"Setting the flag to false will exit with success as long as documentation publish was successfully triggered, \" +\n \"but before the publish is completed. Setting the flag to true will exit once the publish is complete and will \" +\n \"throw if documentation publish is not successful.\",\n }),\n designSystemId: Flags.string({ description: \"Design System to publish the documentation\", required: true }),\n dev: Flags.boolean({ default: false, description: \"When enabled, CLI will target dev server\", hidden: true }),\n proxyUrl: Flags.string({\n description: \"When set, CLI will use provided proxy URL for all requests\",\n hidden: true,\n required: false,\n }),\n target: Flags.string({\n default: \"Live\",\n description: \"Environment to use for publishing: Live or Preview\",\n required: false,\n }),\n }\n\n // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n // MARK: - Command runtime\n\n get commandId(): string {\n return PublishDocumentation.id\n }\n\n get configSchema(): ZodType<PublishDocumentationConfig> {\n return PublishDocumentationConfigSchema\n }\n\n @SentryTraced()\n async run(): Promise<void> {\n const { flags } = await this.parse(PublishDocumentation)\n\n const environment = tryParseDocsEnvironment(flags.target)\n if (!environment) {\n const supportedEnvs = [sdkTypes.DocumentationEnvironment.live, sdkTypes.DocumentationEnvironment.preview]\n this.error(`Unknown target ${flags.target}, must be one of [${supportedEnvs.join(\", \")}]`)\n }\n\n // Get workspace -> design system –> version\n const { designSystem, id, instance } = await getWritableVersion(flags)\n\n this.log(`Queueing documentation publish in ${designSystem.name}...`)\n\n let publishJob = await instance.documentation.publishDrafts(id, environment, undefined)\n\n this.log(`Documentation queued for publishing`)\n\n if (!flags.awaitPublishJob) {\n this.log(`Documentation publish await is disabled, exiting before the publish is finished.`)\n return\n }\n\n this.log(`Waiting for the documentation publish to be finished...`)\n\n // Timeout is roughly 30 minutes\n for (let i = 0; i < 30 * 60; i++) {\n await sleep(1000)\n publishJob = await instance.documentation.getDocumentationBuild(designSystem.workspaceId, publishJob.id)\n if (isJobStatusDone(publishJob.status)) break\n }\n\n switch (publishJob.status) {\n case \"Success\": {\n this.log(\"\\nDone: Documentation queued for publishing\")\n\n break\n }\n\n case \"Failed\": {\n throw new Error(`Documentation publish failed`)\n }\n\n case \"Timeout\": {\n throw new Error(`Documentation publish timed out`)\n }\n\n default: {\n throw new Error(`Error awaiting publish job`)\n }\n }\n }\n}\n\nfunction tryParseDocsEnvironment(targetArg: string) {\n switch (targetArg.toLowerCase()) {\n case \"live\": {\n return sdkTypes.DocumentationEnvironment.live\n }\n\n case \"preview\": {\n return sdkTypes.DocumentationEnvironment.preview\n }\n\n default: {\n return null\n }\n }\n}\n\nfunction isJobStatusDone(status: sdkTypes.ExportBuildStatus): boolean {\n return (\n status === sdkTypes.ExportBuildStatus.Failed ||\n status === sdkTypes.ExportBuildStatus.Success ||\n status === sdkTypes.ExportBuildStatus.Timeout\n )\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAWA,OAAO,EAAE,KAAK,EAAE,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;QAChC,KAAK,MAAM,CAAC,CAAC,CAAC;YACZ,OAAO,QAAQ,CAAC,wBAAwB,CAAC,IAAI,CAAA;QAC/C,CAAC;QAED,KAAK,SAAS,CAAC,CAAC,CAAC;YACf,OAAO,QAAQ,CAAC,wBAAwB,CAAC,OAAO,CAAA;QAClD,CAAC;QAED,OAAO,CAAC,CAAC,CAAC;YACR,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,MAAkC;IACzD,OAAO,CACL,MAAM,KAAK,QAAQ,CAAC,iBAAiB,CAAC,MAAM;QAC5C,MAAM,KAAK,QAAQ,CAAC,iBAAiB,CAAC,OAAO;QAC7C,MAAM,KAAK,QAAQ,CAAC,iBAAiB,CAAC,OAAO,CAC9C,CAAA;AACH,CAAC","debugId":"026fa867-aa69-519e-bcf5-23f4066933f3"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-local-exporter.js","sources":["../../src/commands/run-local-exporter.ts"],"sourceRoot":"","sourcesContent":["//\n// run-exporter.ts\n// Supernova CLI\n//\n// Created by Jiri Trecak.\n// Copyright © Supernova.io. All rights reserved.\n//\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Imports\n\nimport { Flags } from \"@oclif/core\"\nimport { SentryTraced } from \"@sentry/nestjs\"\nimport pulsarCoreTypes from \"@supernova-studio/pulsar-core\"\n \nimport pulsarLanguageTypes from \"@supernova-studio/pulsar-language\"\nimport axios from \"axios\"\nimport * as fs from \"node:fs\"\nimport { createRequire } from \"node:module\"\nimport path from \"node:path\"\n \nimport { z } from \"zod\"\n\nimport { SentryCommand } from \"../types/index.js\"\nimport { exportConfiguration } from \"../utils/run-exporter/exporter-utils.js\"\nimport { getWritableVersion } from \"../utils/sdk.js\"\n\nconst require = createRequire(import.meta.url)\nconst pulsarCoreProvider = require(\"@supernova-studio/pulsar-core\") as typeof pulsarCoreTypes\nconst pulsarLanguageProvider = require(\"@supernova-studio/pulsar-language\") as typeof pulsarLanguageTypes\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Definition\n\ninterface RunLocalExporterFlags {\n allowOverridingOutput: boolean\n apiKey: string\n brandId?: string\n designSystemId: string\n exporterDir: string\n outputDir: string\n proxyUrl?: string\n themeId?: string\n}\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Configuration\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Tool implementation\n\n/** Command that describes the structure of provided design system */\nexport class RunLocalExporter extends SentryCommand<object> {\n // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n // MARK: - Command configuration\n\n // How this command can be run\n static aliases = [\"run-local-exporter\"]\n // Command help description\n static description = \"Run local exporter package\"\n // Examples how to use the command\n static examples = [\n `$ @supernovaio/cli run-local-exporter \\\n --apiKey=\"[API_KEY]\" \\\n --designSystemId=\"[DESIGN_SYSTEM_ID]\" \\\n --themeId=\"[THEME_ID]\" \\\n --brandId=\"[BRAND_ID]\" \\\n --exporterDir=\"[./path/to/exporter/dir]\" \\\n --outputDir=\"[./path/to/output/dir]\" \\\n --allowOverridingOutput\n `,\n ]\n // Static flags to enable / disable features\n static flags = {\n allowOverridingOutput: Flags.boolean({\n default: false,\n description:\n \"When enabled, CLI will override output in the output directory if same files where present. When disabled, encountering the same file with throw an error.\",\n required: false,\n }),\n apiKey: Flags.string({ description: \"API key to use for accessing Supernova instance\", required: true }),\n brandId: Flags.string({\n description:\n \"Brand to export. Will only be used when exporter has usesBrands: true, but then it is required to be provided\",\n required: false,\n }),\n designSystemId: Flags.string({ description: \"Design System to export from\", required: true }),\n exporterDir: Flags.string({ description: \"Path to exporter package\", required: true }),\n outputDir: Flags.string({\n description: \"Path to output folder. Must be empty, unless `forceClearOutputDir` is set\",\n required: true,\n }),\n proxyUrl: Flags.string({\n description: \"When set, CLI will use provided proxy URL for all requests\",\n hidden: true,\n required: false,\n }),\n themeId: Flags.string({\n description: \"Theme to export. Will only be used when exporter has usesThemes: true, and is optional\",\n required: false,\n }),\n }\n\n get commandId(): string {\n return RunLocalExporter.id\n }\n\n get configSchema() {\n return z.object({})\n }\n\n // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n // MARK: - Command runtime\n\n @SentryTraced()\n async executeExporter(\n flags: RunLocalExporterFlags,\n versionId: string,\n ): Promise<{\n logger: pulsarLanguageTypes.PLLogger\n result: Error | pulsarCoreTypes.PCEngineExporterProcessingResult\n success: boolean\n }> {\n // Log engine\n const logger = new pulsarLanguageProvider.PLLogger()\n\n // Initialize pulsar engine and export\n const pulsarEngine = new pulsarCoreProvider.PCPulsar(pulsarCoreTypes.PCPulsarExporterMode.full, logger)\n try {\n // Load pulsar with local URL\n await pulsarEngine.initiateWithLocalFolderURL(flags.exporterDir, pulsarCoreTypes.PCExporterEnvironment.ci)\n\n // Prepare configuration\n const config = exportConfiguration({\n apiKey: flags.apiKey,\n brandId: flags.brandId,\n dsId: flags.designSystemId,\n environment: this.env,\n exportPath: flags.exporterDir,\n logger,\n proxyUrl: flags.proxyUrl,\n themeId: flags.themeId,\n versionId,\n })\n\n // Set logo overrides\n const result = await pulsarEngine.executeExporter(config, false)\n return {\n logger,\n result,\n success: true,\n }\n } catch (error) {\n // Return error\n return {\n logger,\n result: error as Error,\n success: false,\n }\n }\n }\n\n @SentryTraced()\n async run(): Promise<void> {\n const { flags } = await this.parse(RunLocalExporter)\n\n // Execute exporter\n // Get workspace -> design system –> version\n const { version } = await getWritableVersion(flags)\n const result = await this.executeExporter(flags, version.id)\n\n // Log user logs from the execution\n // Note this is currently not used because console.log is directly routed to the stdout and we have no control over it. Pulsar must be updated before this is doable\n if (flags.log) {\n this.logRun(result.logger)\n }\n\n if (result.success) {\n // Write result to output\n await this.writeToBuildPath(result.result as pulsarCoreTypes.PCEngineExporterProcessingResult, flags)\n this.log(\"Export finished successfully\")\n } else {\n // Catch write error\n this.error(`Export failed: ${(result.result as Error).message}`, {\n code: \"ERR_EXPORT_FAILED\",\n })\n }\n }\n\n /** Download file into memory using Axios */\n @SentryTraced()\n private async downloadFileToMemory(fileUrl: string): Promise<Buffer> {\n const response = await axios({\n method: \"get\",\n responseType: \"arraybuffer\",\n url: fileUrl,\n })\n\n return Buffer.from(response.data)\n }\n\n /** Ensure directory exists - if it doesn't create it, recursively */\n @SentryTraced()\n private ensureDirectoryExists(filePath: string, forceLastFragmentIsDirectory: boolean = false) {\n // If the last fragment of path is forced, even paths without / are treated as dirs\n if (forceLastFragmentIsDirectory && !filePath.endsWith(\"/\")) {\n filePath += \"/\"\n }\n\n // Only make directory if it doesn't exist\n if (fs.existsSync(filePath)) {\n return\n }\n\n fs.mkdirSync(filePath, { recursive: true })\n }\n\n /** Log run to output */\n private logRun(logger: pulsarLanguageTypes.PLLogger) {\n for (const log of logger.logs) {\n let message = log.message.trim()\n if (message.startsWith('\"')) {\n message = message.slice(1)\n }\n\n if (message.endsWith('\"')) {\n message = message.slice(0, Math.max(0, message.length - 1))\n }\n\n console.log(`[user]` + message)\n }\n }\n\n @SentryTraced()\n private async writeToBuildPath(\n result: pulsarCoreTypes.PCEngineExporterProcessingResult,\n flags: RunLocalExporterFlags,\n ) {\n // Create build directory if it doesn't exist, otherwise keep as it is. It should never be deleted!\n if (!fs.existsSync(flags.outputDir)) {\n this.ensureDirectoryExists(flags.outputDir)\n }\n\n // If overriding is disabled, test every possible file and if it exists, throw an error\n if (!flags.allowOverridingOutput) {\n for (const file of result.emittedFiles) {\n const destination = path.join(flags.outputDir, file.path)\n if (fs.existsSync(destination)) {\n throw new Error(\n `Exporter produced file for destination ${destination} but that file already exists. Enable --allowOverridingOutput option to allow overriding`,\n )\n }\n }\n }\n\n // Temporary structure to hold file contents\n const filesToWrite: { content: Buffer | string; filePath: string }[] = []\n\n // Function to process a single file\n const processFile = async (file: pulsarCoreTypes.PCEngineFileDescriptor) => {\n const filePath = path.join(flags.outputDir, ...file.path.split(\"/\"))\n const fileDirectory = path.dirname(filePath)\n this.ensureDirectoryExists(fileDirectory)\n\n switch (file.type) {\n case \"copy_file\": {\n const fileContent = fs.readFileSync(file.content)\n filesToWrite.push({ content: fileContent, filePath })\n\n break\n }\n\n case \"copy_file_remote\": {\n const fileContent = await this.downloadFileToMemory(file.content)\n filesToWrite.push({ content: fileContent, filePath })\n\n break\n }\n\n case \"string\": {\n filesToWrite.push({ content: file.content, filePath })\n\n break\n }\n // No default\n }\n }\n\n // Process all files in chunks to speed up the process\n const chunkSize = 4\n for (let i = 0; i < result.emittedFiles.length; i += chunkSize) {\n const chunk = result.emittedFiles.slice(i, i + chunkSize)\n await Promise.all(chunk.map(file => processFile(file)))\n }\n\n // Write all files from the temporary structure to the filesystem as a final step - this is to avoid partial writes\n for (const { content, filePath } of filesToWrite) {\n fs.writeFileSync(filePath, content)\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAWA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,eAAe,MAAM,+BAA+B,CAAA;AAG3D,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAA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IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC;YAC/D,MAAM,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,CAAA;YACzD,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACzD,CAAC;QAGD,KAAK,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,YAAY,EAAE,CAAC;YACjD,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QACrC,CAAC;IACH,CAAC;;AAxLK;IADL,YAAY,EAAE;;;;uDA8Cd;AAGK;IADL,YAAY,EAAE;;;;2CAyBd;AAIa;IADb,YAAY,EAAE;;;;4DASd;AAIO;IADP,YAAY,EAAE;;;;6DAad;AAmBa;IADb,YAAY,EAAE;;;;wDAkEd","debug_id":"7748230d-2c61-5564-8be1-3d3f1df02a86"}
|
|
1
|
+
{"version":3,"file":"run-local-exporter.js","sources":["../../src/commands/run-local-exporter.ts"],"sourceRoot":"","sourcesContent":["//\n// run-exporter.ts\n// Supernova CLI\n//\n// Created by Jiri Trecak.\n// Copyright © Supernova.io. All rights reserved.\n//\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Imports\n\nimport { Flags } from \"@oclif/core\"\nimport { SentryTraced } from \"@sentry/nestjs\"\nimport pulsarCoreTypes from \"@supernova-studio/pulsar-core\"\n \nimport pulsarLanguageTypes from \"@supernova-studio/pulsar-language\"\nimport axios from \"axios\"\nimport * as fs from \"node:fs\"\nimport { createRequire } from \"node:module\"\nimport path from \"node:path\"\n \nimport { z } from \"zod\"\n\nimport { SentryCommand } from \"../types/index.js\"\nimport { exportConfiguration } from \"../utils/run-exporter/exporter-utils.js\"\nimport { getWritableVersion } from \"../utils/sdk.js\"\n\nconst require = createRequire(import.meta.url)\nconst pulsarCoreProvider = require(\"@supernova-studio/pulsar-core\") as typeof pulsarCoreTypes\nconst pulsarLanguageProvider = require(\"@supernova-studio/pulsar-language\") as typeof pulsarLanguageTypes\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Definition\n\ninterface RunLocalExporterFlags {\n allowOverridingOutput: boolean\n apiKey: string\n brandId?: string\n designSystemId: string\n exporterDir: string\n outputDir: string\n proxyUrl?: string\n themeId?: string\n}\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Configuration\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Tool implementation\n\n/** Command that describes the structure of provided design system */\nexport class RunLocalExporter extends SentryCommand<object> {\n // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n // MARK: - Command configuration\n\n // How this command can be run\n static aliases = [\"run-local-exporter\"]\n // Command help description\n static description = \"Run local exporter package\"\n // Examples how to use the command\n static examples = [\n `$ @supernovaio/cli run-local-exporter \\\n --apiKey=\"[API_KEY]\" \\\n --designSystemId=\"[DESIGN_SYSTEM_ID]\" \\\n --themeId=\"[THEME_ID]\" \\\n --brandId=\"[BRAND_ID]\" \\\n --exporterDir=\"[./path/to/exporter/dir]\" \\\n --outputDir=\"[./path/to/output/dir]\" \\\n --allowOverridingOutput\n `,\n ]\n // Static flags to enable / disable features\n static flags = {\n allowOverridingOutput: Flags.boolean({\n default: false,\n description:\n \"When enabled, CLI will override output in the output directory if same files where present. When disabled, encountering the same file with throw an error.\",\n required: false,\n }),\n apiKey: Flags.string({ description: \"API key to use for accessing Supernova instance\", required: true }),\n brandId: Flags.string({\n description:\n \"Brand to export. Will only be used when exporter has usesBrands: true, but then it is required to be provided\",\n required: false,\n }),\n designSystemId: Flags.string({ description: \"Design System to export from\", required: true }),\n exporterDir: Flags.string({ description: \"Path to exporter package\", required: true }),\n outputDir: Flags.string({\n description: \"Path to output folder. Must be empty, unless `forceClearOutputDir` is set\",\n required: true,\n }),\n proxyUrl: Flags.string({\n description: \"When set, CLI will use provided proxy URL for all requests\",\n hidden: true,\n required: false,\n }),\n themeId: Flags.string({\n description: \"Theme to export. Will only be used when exporter has usesThemes: true, and is optional\",\n required: false,\n }),\n }\n\n get commandId(): string {\n return RunLocalExporter.id\n }\n\n get configSchema() {\n return z.object({})\n }\n\n // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n // MARK: - Command runtime\n\n @SentryTraced()\n async executeExporter(\n flags: RunLocalExporterFlags,\n versionId: string,\n ): Promise<{\n logger: pulsarLanguageTypes.PLLogger\n result: Error | pulsarCoreTypes.PCEngineExporterProcessingResult\n success: boolean\n }> {\n // Log engine\n const logger = new pulsarLanguageProvider.PLLogger()\n\n // Initialize pulsar engine and export\n const pulsarEngine = new pulsarCoreProvider.PCPulsar(pulsarCoreTypes.PCPulsarExporterMode.full, logger)\n try {\n // Load pulsar with local URL\n await pulsarEngine.initiateWithLocalFolderURL(flags.exporterDir, pulsarCoreTypes.PCExporterEnvironment.ci)\n\n // Prepare configuration\n const config = exportConfiguration({\n apiKey: flags.apiKey,\n brandId: flags.brandId,\n dsId: flags.designSystemId,\n environment: this.env,\n exportPath: flags.exporterDir,\n logger,\n proxyUrl: flags.proxyUrl,\n themeId: flags.themeId,\n versionId,\n })\n\n // Set logo overrides\n const result = await pulsarEngine.executeExporter(config, false)\n return {\n logger,\n result,\n success: true,\n }\n } catch (error) {\n // Return error\n return {\n logger,\n result: error as Error,\n success: false,\n }\n }\n }\n\n @SentryTraced()\n async run(): Promise<void> {\n const { flags } = await this.parse(RunLocalExporter)\n\n // Execute exporter\n // Get workspace -> design system –> version\n const { version } = await getWritableVersion(flags)\n const result = await this.executeExporter(flags, version.id)\n\n // Log user logs from the execution\n // Note this is currently not used because console.log is directly routed to the stdout and we have no control over it. Pulsar must be updated before this is doable\n if (flags.log) {\n this.logRun(result.logger)\n }\n\n if (result.success) {\n // Write result to output\n await this.writeToBuildPath(result.result as pulsarCoreTypes.PCEngineExporterProcessingResult, flags)\n this.log(\"Export finished successfully\")\n } else {\n // Catch write error\n this.error(`Export failed: ${(result.result as Error).message}`, {\n code: \"ERR_EXPORT_FAILED\",\n })\n }\n }\n\n /** Download file into memory using Axios */\n @SentryTraced()\n private async downloadFileToMemory(fileUrl: string): Promise<Buffer> {\n const response = await axios({\n method: \"get\",\n responseType: \"arraybuffer\",\n url: fileUrl,\n })\n\n return Buffer.from(response.data)\n }\n\n /** Ensure directory exists - if it doesn't create it, recursively */\n @SentryTraced()\n private ensureDirectoryExists(filePath: string, forceLastFragmentIsDirectory: boolean = false) {\n // If the last fragment of path is forced, even paths without / are treated as dirs\n if (forceLastFragmentIsDirectory && !filePath.endsWith(\"/\")) {\n filePath += \"/\"\n }\n\n // Only make directory if it doesn't exist\n if (fs.existsSync(filePath)) {\n return\n }\n\n fs.mkdirSync(filePath, { recursive: true })\n }\n\n /** Log run to output */\n private logRun(logger: pulsarLanguageTypes.PLLogger) {\n for (const log of logger.logs) {\n let message = log.message.trim()\n if (message.startsWith('\"')) {\n message = message.slice(1)\n }\n\n if (message.endsWith('\"')) {\n message = message.slice(0, Math.max(0, message.length - 1))\n }\n\n console.log(`[user]` + message)\n }\n }\n\n @SentryTraced()\n private async writeToBuildPath(\n result: pulsarCoreTypes.PCEngineExporterProcessingResult,\n flags: RunLocalExporterFlags,\n ) {\n // Create build directory if it doesn't exist, otherwise keep as it is. It should never be deleted!\n if (!fs.existsSync(flags.outputDir)) {\n this.ensureDirectoryExists(flags.outputDir)\n }\n\n // If overriding is disabled, test every possible file and if it exists, throw an error\n if (!flags.allowOverridingOutput) {\n for (const file of result.emittedFiles) {\n const destination = path.join(flags.outputDir, file.path)\n if (fs.existsSync(destination)) {\n throw new Error(\n `Exporter produced file for destination ${destination} but that file already exists. Enable --allowOverridingOutput option to allow overriding`,\n )\n }\n }\n }\n\n // Temporary structure to hold file contents\n const filesToWrite: { content: Buffer | string; filePath: string }[] = []\n\n // Function to process a single file\n const processFile = async (file: pulsarCoreTypes.PCEngineFileDescriptor) => {\n const filePath = path.join(flags.outputDir, ...file.path.split(\"/\"))\n const fileDirectory = path.dirname(filePath)\n this.ensureDirectoryExists(fileDirectory)\n\n switch (file.type) {\n case \"copy_file\": {\n const fileContent = fs.readFileSync(file.content)\n filesToWrite.push({ content: fileContent, filePath })\n\n break\n }\n\n case \"copy_file_remote\": {\n const fileContent = await this.downloadFileToMemory(file.content)\n filesToWrite.push({ content: fileContent, filePath })\n\n break\n }\n\n case \"string\": {\n filesToWrite.push({ content: file.content, filePath })\n\n break\n }\n // No default\n }\n }\n\n // Process all files in chunks to speed up the process\n const chunkSize = 4\n for (let i = 0; i < result.emittedFiles.length; i += chunkSize) {\n const chunk = result.emittedFiles.slice(i, i + chunkSize)\n await Promise.all(chunk.map(file => processFile(file)))\n }\n\n // Write all files from the temporary structure to the filesystem as a final step - this is to avoid partial writes\n for (const { content, filePath } of filesToWrite) {\n fs.writeFileSync(filePath, content)\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAWA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,eAAe,MAAM,+BAA+B,CAAA;AAG3D,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;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AE,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAA;oBAEtD,MAAK;gBACP,CAAC;YAEH,CAAC;QACH,CAAC,CAAA;QAGD,MAAM,SAAS,GAAG,CAAC,CAAA;QACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC;YAC/D,MAAM,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,CAAA;YACzD,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACzD,CAAC;QAGD,KAAK,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,YAAY,EAAE,CAAC;YACjD,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QACrC,CAAC;IACH,CAAC;;AAxLK;IADL,YAAY,EAAE;;;;uDA8Cd;AAGK;IADL,YAAY,EAAE;;;;2CAyBd;AAIa;IADb,YAAY,EAAE;;;;4DASd;AAIO;IADP,YAAY,EAAE;;;;6DAad;AAmBa;IADb,YAAY,EAAE;;;;wDAkEd","debugId":"7748230d-2c61-5564-8be1-3d3f1df02a86"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storybook-import.js","sources":["../../src/commands/storybook-import.ts"],"sourceRoot":"","sourcesContent":["import { Flags } from \"@oclif/core\"\nimport { action } from \"@oclif/core/ux\"\nimport { SentryTraced } from \"@sentry/nestjs\"\nimport slugify from \"@sindresorhus/slugify\"\nimport { DesignSystemSourcesEndpoint, DTODataSourceStorybook, SupernovaApiClient } from \"@supernova-studio/client\"\nimport AdmZip from \"adm-zip\"\nimport axios from \"axios\"\nimport cliProgress from \"cli-progress\"\nimport inquirer from \"inquirer\"\nimport * as fs from \"node:fs\"\nimport path from \"node:path\"\nimport terminalLink from \"terminal-link\"\nimport { z, ZodType } from \"zod\"\n\nimport { SupernovaConfigStorybook } from \"../types/config.js\"\nimport { commonFlags, SentryCommand, storybookUrlForEnvironment, TargetEnv } from \"../types/index.js\"\nimport { sleep } from \"../utils/common.js\"\n\n// Maximum allowed size for storybook zip file (500MB)\nconst MAX_ZIP_SIZE_BYTES = 500 * 1024 * 1024\n\nconst bytesToKB = (bytes: number) => (bytes / 1024).toFixed(2)\nconst bytesToMB = (bytes: number) => (bytes / (1024 * 1024)).toFixed(2)\n\nconst ImportStorybookConfig = z.object({\n brandId: z.string().optional(),\n designSystemId: z.string().optional(),\n from: z.string().optional(),\n name: z.string().optional(),\n sourceId: z.string().optional(),\n publicAccess: z.boolean().optional(),\n})\n\ntype ImportStorybookConfig = z.infer<typeof ImportStorybookConfig>\n\nconst storybookEndpoint = (\n environment: TargetEnv,\n designSystemId: string,\n name: string,\n format: \"html\" | \"json\" = \"html\",\n): string => {\n const host = storybookUrlForEnvironment(environment)\n return `${host}/design-systems/${designSystemId}/alias/${name}/index.${format}`\n}\n\nexport default class ImportStorybook extends SentryCommand<ImportStorybookConfig> {\n static override args = {}\n static override description = \"Import storybook static export to Supernova\"\n static override examples = [\"<%= config.bin %> <%= command.id %> import-storybook \"]\n static override flags = {\n ...commonFlags,\n brandId: Flags.string({ char: \"b\", description: \"Import storybooks to brand of\" }),\n designSystemId: Flags.string({ char: \"d\", description: \"Import storybooks to design system of\" }),\n from: Flags.string({\n char: \"f\",\n description: \"Directory with storybook static export to import.\",\n }),\n name: Flags.string({ char: \"n\", description: \"Import storybooks with name of\" }),\n sourceId: Flags.string({ char: \"s\", description: \"Import storybooks to source of\" }),\n publicAccess: Flags.boolean({\n required: false,\n description:\n \"Allow public access to the published Storybook website. \" +\n \"Can be used in combination with public documentation.\",\n }),\n }\n\n get commandId(): string {\n return ImportStorybook.id\n }\n\n get configSchema(): ZodType<ImportStorybookConfig> {\n return ImportStorybookConfig\n }\n\n @SentryTraced()\n public async run(): Promise<void> {\n const { flags } = await this.parse()\n const config = this.configService.get()\n const storybookConfig = config?.storybook ?? {}\n\n const { sourceId } = { ...storybookConfig, ...flags }\n\n const storybookDirectory = this.getStorybookDirectory(flags, storybookConfig)\n const storybookName = await this.getStorybookName(flags, storybookConfig)\n const designSystemId = await this.getDesignSystemId(flags, storybookConfig)\n const brandPersistentId = await this.getBrandId(flags, storybookConfig, designSystemId)\n const isPublic = this.getIsPublic(flags, storybookConfig)\n\n const apiClient = await this.apiClient()\n\n const { designSystems, storybookSites } = apiClient\n\n await this.validateDatasource(designSystems.sources, sourceId, designSystemId)\n\n this.log(`Preparing Storybook files from ${storybookDirectory}...`)\n const { sizeBytes, zipPath } = await this.createZipFromDirectory(storybookDirectory)\n\n const sizeValidation = this.validateZipSize(zipPath, sizeBytes)\n if (!sizeValidation.isValid) {\n this.error(sizeValidation.error!)\n }\n\n const { storybookSiteVersion, uploadUrl } = await storybookSites.uploadInit({\n designSystemId,\n isPublic,\n name: storybookName,\n })\n\n await this.uploadArchiveToSignedUrl({ uploadUrl, zipPath })\n this.log(\"✅ Upload complete.\")\n\n const accessType = isPublic ? \"Public\" : \"Private\"\n await runAsAction({\n start: \"Deploying Storybook to private Supernova hosting service\",\n done: \"\\n✅ \" + accessType + \" Storybook deployed successfully!\",\n fn: () => this.publishRemoteSite({ apiClient, storybookSiteVersionId: storybookSiteVersion.id }),\n })\n\n const { sourceId: finalSourceId } = await runAsAction({\n start: \"Updating Storybook stories\",\n done: \"\\n✅ Storybook stories have been updated!\",\n fn: () =>\n this.importStorybookStories({\n apiClient,\n designSystemId,\n brandPersistentId,\n sourceId,\n storybookDirectory,\n storybookName,\n }),\n })\n\n this.configService.update({\n storybook: {\n designSystemId,\n from: storybookDirectory,\n name: storybookName,\n brandId: brandPersistentId,\n sourceId: finalSourceId,\n publicAccess: isPublic,\n },\n })\n }\n\n //\n // Argument parsing\n //\n\n private async getStorybookName(flags: ImportStorybookConfig, config: SupernovaConfigStorybook) {\n let result = flags.name ?? config.name\n\n if (!result) {\n const choice = await inquirer.prompt([\n {\n message: \"Enter name of your storybook instance (it will be part of the URL)\",\n name: \"name\",\n type: \"input\",\n },\n ])\n\n if (typeof choice.name === \"string\") {\n result = choice.name\n }\n }\n\n if (!result) {\n this.error(\"Parameter `name` is required\")\n }\n\n return slugify(result, { lowercase: true })\n }\n\n private async getDesignSystemId(flags: ImportStorybookConfig, config: SupernovaConfigStorybook) {\n let designSystemId = flags.designSystemId ?? config.designSystemId\n\n if (!designSystemId) {\n designSystemId = await this.promptDesignSystemId()\n }\n\n if (!designSystemId) this.error(\"Parameter `designSystemId` is required\")\n\n return designSystemId\n }\n\n private async getBrandId(flags: ImportStorybookConfig, config: SupernovaConfigStorybook, designSystemId: string) {\n let brandId = flags.brandId ?? config.brandId\n\n if (!brandId) {\n brandId = await this.promptBrandId(designSystemId)\n }\n\n if (!brandId) this.error(\"Parameter `brandId` is required\")\n\n return brandId\n }\n\n private getStorybookDirectory(flags: ImportStorybookConfig, config: SupernovaConfigStorybook) {\n const from = flags.from ?? config.from\n if (!from) this.error(\"Parameter `from` is required\")\n\n const directoryValidation = this.validateStorybookDirectory(from)\n if (!directoryValidation.isValid) {\n this.error(directoryValidation.error)\n }\n\n return from\n }\n\n private getIsPublic(flags: ImportStorybookConfig, config: SupernovaConfigStorybook): boolean {\n return flags.publicAccess ?? config.publicAccess ?? false\n }\n\n //\n // Upload to hosting\n //\n\n /**\n * Creates a zip archive from a directory\n * @param directoryPath Path to the directory to zip\n * @returns Path to the created zip file and its size\n */\n private async createZipFromDirectory(directoryPath: string): Promise<{ sizeBytes: number; zipPath: string }> {\n const zip = new AdmZip()\n\n let totalFiles = 0\n let processedFiles = 0\n\n const countFiles = (currentPath: string) => {\n const files = fs.readdirSync(currentPath)\n\n for (const file of files) {\n const filePath = path.join(currentPath, file)\n const stat = fs.statSync(filePath)\n\n if (stat.isDirectory()) {\n countFiles(filePath)\n } else {\n totalFiles++\n }\n }\n }\n\n countFiles(directoryPath)\n\n const progressBar = new cliProgress.SingleBar(\n {\n barCompleteChar: \"\\u2588\",\n barIncompleteChar: \"\\u2591\",\n format: \"Creating zip [{bar}] {percentage}% | {value}/{total} files | Current: {filename}\",\n hideCursor: true,\n },\n cliProgress.Presets.shades_classic,\n )\n\n progressBar.start(totalFiles, 0, {\n filename: \"Initializing...\",\n })\n\n const addFilesToZip = (currentPath: string, relativePath = \"\") => {\n const files = fs.readdirSync(currentPath)\n\n for (const file of files) {\n const filePath = path.join(currentPath, file)\n const stat = fs.statSync(filePath)\n const displayPath = path.join(relativePath, file)\n\n if (stat.isDirectory()) {\n addFilesToZip(filePath, displayPath)\n } else {\n // Update the progress bar with the current file\n processedFiles++\n progressBar.update(processedFiles, {\n filename:\n displayPath.length > 40 ? \"...\" + displayPath.slice(Math.max(0, displayPath.length - 37)) : displayPath,\n })\n\n zip.addLocalFile(filePath, relativePath)\n }\n }\n }\n\n try {\n addFilesToZip(directoryPath)\n } finally {\n progressBar.stop()\n }\n\n const zipPath = `${directoryPath}.zip`\n await zip.writeZipPromise(zipPath)\n\n const sizeBytes = fs.statSync(zipPath).size\n\n return { sizeBytes, zipPath }\n }\n\n private getIndexJson(directoryPath: string) {\n const indexJsonPath = path.join(directoryPath, \"index.json\")\n if (fs.existsSync(indexJsonPath)) {\n return JSON.parse(fs.readFileSync(indexJsonPath, \"utf8\"))\n }\n\n const storiesJsonPath = path.join(directoryPath, \"stories.json\")\n if (fs.existsSync(storiesJsonPath)) {\n return JSON.parse(fs.readFileSync(storiesJsonPath, \"utf8\"))\n }\n\n throw new Error(`Can't open \"index.json\" or \"stories.json\" in path ${directoryPath}`)\n }\n\n /**\n * Uploads the zip archive to the provided signed URL\n */\n private async uploadArchiveToSignedUrl(input: { uploadUrl: string; zipPath: string }): Promise<void> {\n const { uploadUrl, zipPath } = input\n this.log(`Securely uploading ${zipPath} to Supernova...`)\n\n const fileBuffer = fs.readFileSync(zipPath)\n const fileSize = fileBuffer.byteLength\n const fileSizeKB = Number.parseFloat(bytesToKB(fileSize))\n\n // Create a new progress bar\n const progressBar = new cliProgress.SingleBar(\n {\n barCompleteChar: \"\\u2588\",\n barIncompleteChar: \"\\u2591\",\n format: \"Uploading |{bar}| {percentage}% || {value}/{total} kB\",\n hideCursor: true,\n },\n cliProgress.Presets.shades_classic,\n )\n\n // Start the progress bar\n progressBar.start(fileSizeKB, 0)\n\n try {\n await axios.put(uploadUrl, fileBuffer, {\n headers: {\n \"Content-Length\": fileSize,\n \"Content-Type\": \"application/zip\",\n },\n onUploadProgress(progressEvent) {\n const loaded = progressEvent.loaded || 0\n const loadedKB = Number.parseFloat(bytesToKB(loaded))\n progressBar.update(loadedKB)\n },\n })\n\n // Complete the progress bar\n progressBar.update(fileSizeKB)\n progressBar.stop()\n } catch (error) {\n // Make sure to stop the progress bar if there's an error\n progressBar.stop()\n throw error\n }\n }\n\n private async publishRemoteSite(input: {\n apiClient: SupernovaApiClient\n storybookSiteVersionId: string\n }): Promise<void> {\n const { apiClient, storybookSiteVersionId } = input\n\n const getStatus = async () => {\n const { storybookSiteVersion } = await apiClient.storybookSites.getVersion(storybookSiteVersionId)\n return storybookSiteVersion.uploadStatus\n }\n\n const { storybookSiteVersion: finalizedVersion } =\n await apiClient.storybookSites.uploadFinailize(storybookSiteVersionId)\n\n let lastStatus = finalizedVersion.uploadStatus\n\n // Wait for publishing to complete\n // Do 15 * 60 tries roughly correspond to at least 15 minutes\n for (let i = 0; i < 60; i++) {\n lastStatus = await getStatus()\n\n // Unknown status means the upload hasn't been picked up yet, we tolerate it for very limited amount of time\n if (lastStatus !== \"InProgress\" && lastStatus !== \"PendingUpload\") break\n\n await sleep(1000)\n }\n\n // React to publishing status\n switch (lastStatus) {\n case \"PendingUpload\":\n return this.error(\"Storybook deployment initialization failed\")\n case \"Timeout\":\n return this.error(\"Storybook deployment initialization has timed out\")\n case \"Failed\":\n return this.error(\"Storybook deployment has failed\")\n case \"InProgress\":\n return this.error(\"Storybook deployment has timed out\")\n }\n }\n\n private async importStorybookStories(input: {\n apiClient: SupernovaApiClient\n brandPersistentId: string\n designSystemId: string\n sourceId: string | undefined\n storybookDirectory: string\n storybookName: string\n }): Promise<{ sourceId: string }> {\n const { apiClient, brandPersistentId, designSystemId, storybookDirectory, storybookName } = input\n let { sourceId } = input\n\n const sourcesEndpoint = apiClient.designSystems.sources\n const storybookUrl = storybookEndpoint(this.env, designSystemId, storybookName)\n\n let storiesCount = 0\n if (sourceId) {\n const sourceUpdateResult = await sourcesEndpoint.updateStorybookImport(designSystemId, \"head\", {\n payload: this.getIndexJson(storybookDirectory),\n sourceId,\n })\n storiesCount = sourceUpdateResult.storiesCount\n } else {\n const { source } = await sourcesEndpoint.create(designSystemId, {\n brandPersistentId,\n description: \"CLI\",\n indexUrl: storybookEndpoint(this.env, designSystemId, storybookName, \"json\"),\n payload: this.getIndexJson(storybookDirectory),\n type: \"Storybook\",\n userUrl: storybookUrl,\n fileName: storybookName,\n })\n\n storiesCount = (source as unknown as DTODataSourceStorybook).storybook.storiesCount\n sourceId = source.id\n }\n\n this.log(`✅ Imported ${storiesCount} component stories into Supernova!`)\n const link = terminalLink(\"here\", storybookUrl, { fallback: (_, url) => url })\n this.log(`🔒 Access your Storybook ${link}`)\n\n return { sourceId }\n }\n\n /**\n * Validates if a directory is a valid storybook static export\n * @param directoryPath Path to the storybook directory\n * @returns An object indicating if the directory is valid and an error message if not\n */\n private validateStorybookDirectory(directoryPath: string): { error: string; isValid: false } | { isValid: true } {\n if (!fs.existsSync(directoryPath)) {\n return { error: `Directory not found: ${directoryPath}`, isValid: false }\n }\n\n if (!fs.statSync(directoryPath).isDirectory()) {\n return { error: `Not a directory: ${directoryPath}`, isValid: false }\n }\n\n // Check for essential storybook files\n const requiredFiles = [\"index.html\", \"iframe.html\"]\n const missingFiles = requiredFiles.filter(file => !fs.existsSync(path.join(directoryPath, file)))\n\n if (missingFiles.length > 0) {\n return {\n error: `Directory does not appear to be a valid Storybook export. Missing files: ${missingFiles.join(\", \")}`,\n isValid: false,\n }\n }\n\n // Check for Stories index file\n const requiredAtLeastOneFile = [\"index.json\", \"stories.json\"]\n if (!requiredAtLeastOneFile.some(file => fs.existsSync(path.join(directoryPath, file)))) {\n return {\n error:\n `Storybook directory is missing \"index.json\" or \"stories.json\".\\n` +\n `Tip: if running Storybook 6 or lower, you might need to enable \"buildStoriesJson: true\" in your Storybook config.`,\n isValid: false,\n }\n }\n\n return { isValid: true }\n }\n\n /**\n * Validates if a zip file size is within the allowed limits\n * @param zipPath Path to the zip file\n * @param sizeBytes Size of the zip file in bytes\n * @returns An object indicating if the zip is valid and an error message if not\n */\n private validateZipSize(zipPath: string, sizeBytes: number): { error?: string; isValid: boolean } {\n if (sizeBytes > MAX_ZIP_SIZE_BYTES) {\n // Delete the zip file if it's too large\n try {\n fs.unlinkSync(zipPath)\n } catch {\n // Ignore errors during cleanup\n }\n\n return {\n error: `Zip file is too large: ${bytesToMB(sizeBytes)}MB. Maximum allowed size is ${bytesToMB(MAX_ZIP_SIZE_BYTES)}MB`,\n isValid: false,\n }\n }\n\n return { isValid: true }\n }\n\n private async validateDatasource(\n sourcesEndpoint: DesignSystemSourcesEndpoint,\n sourceId: string | undefined,\n designSystemId: string,\n ) {\n if (sourceId) {\n const storybookDatasource = await sourcesEndpoint.get(designSystemId, sourceId).catch(() => null)\n if (!storybookDatasource) {\n this.error(\n \"This data source was deleted. Remove supernova.config.json and try again to create a new data source.\",\n )\n }\n }\n }\n}\n\nasync function runAsAction<T>(args: { start: string; done: string; fn: () => Promise<T> }): Promise<T> {\n action.start(args.start)\n try {\n const result = await args.fn()\n action.stop(args.done)\n return result\n } catch (error) {\n action.stop()\n throw error\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,YAAY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467d-951c-52b9-b28f-b48f19426407"}
|
|
1
|
+
{"version":3,"file":"storybook-import.js","sources":["../../src/commands/storybook-import.ts"],"sourceRoot":"","sourcesContent":["import { Flags } from \"@oclif/core\"\nimport { action } from \"@oclif/core/ux\"\nimport { SentryTraced } from \"@sentry/nestjs\"\nimport slugify from \"@sindresorhus/slugify\"\nimport { DesignSystemSourcesEndpoint, DTODataSourceStorybook, SupernovaApiClient } from \"@supernova-studio/client\"\nimport AdmZip from \"adm-zip\"\nimport axios from \"axios\"\nimport cliProgress from \"cli-progress\"\nimport inquirer from \"inquirer\"\nimport * as fs from \"node:fs\"\nimport path from \"node:path\"\nimport terminalLink from \"terminal-link\"\nimport { z, ZodType } from \"zod\"\n\nimport { SupernovaConfigStorybook } from \"../types/config.js\"\nimport { commonFlags, SentryCommand, storybookUrlForEnvironment, TargetEnv } from \"../types/index.js\"\nimport { sleep } from \"../utils/common.js\"\n\n// Maximum allowed size for storybook zip file (500MB)\nconst MAX_ZIP_SIZE_BYTES = 500 * 1024 * 1024\n\nconst bytesToKB = (bytes: number) => (bytes / 1024).toFixed(2)\nconst bytesToMB = (bytes: number) => (bytes / (1024 * 1024)).toFixed(2)\n\nconst ImportStorybookConfig = z.object({\n brandId: z.string().optional(),\n designSystemId: z.string().optional(),\n from: z.string().optional(),\n name: z.string().optional(),\n sourceId: z.string().optional(),\n publicAccess: z.boolean().optional(),\n})\n\ntype ImportStorybookConfig = z.infer<typeof ImportStorybookConfig>\n\nconst storybookEndpoint = (\n environment: TargetEnv,\n designSystemId: string,\n name: string,\n format: \"html\" | \"json\" = \"html\",\n): string => {\n const host = storybookUrlForEnvironment(environment)\n return `${host}/design-systems/${designSystemId}/alias/${name}/index.${format}`\n}\n\nexport default class ImportStorybook extends SentryCommand<ImportStorybookConfig> {\n static override args = {}\n static override description = \"Import storybook static export to Supernova\"\n static override examples = [\"<%= config.bin %> <%= command.id %> import-storybook \"]\n static override flags = {\n ...commonFlags,\n brandId: Flags.string({ char: \"b\", description: \"Import storybooks to brand of\" }),\n designSystemId: Flags.string({ char: \"d\", description: \"Import storybooks to design system of\" }),\n from: Flags.string({\n char: \"f\",\n description: \"Directory with storybook static export to import.\",\n }),\n name: Flags.string({ char: \"n\", description: \"Import storybooks with name of\" }),\n sourceId: Flags.string({ char: \"s\", description: \"Import storybooks to source of\" }),\n publicAccess: Flags.boolean({\n required: false,\n description:\n \"Allow public access to the published Storybook website. \" +\n \"Can be used in combination with public documentation.\",\n }),\n }\n\n get commandId(): string {\n return ImportStorybook.id\n }\n\n get configSchema(): ZodType<ImportStorybookConfig> {\n return ImportStorybookConfig\n }\n\n @SentryTraced()\n public async run(): Promise<void> {\n const { flags } = await this.parse()\n const config = this.configService.get()\n const storybookConfig = config?.storybook ?? {}\n\n const { sourceId } = { ...storybookConfig, ...flags }\n\n const storybookDirectory = this.getStorybookDirectory(flags, storybookConfig)\n const storybookName = await this.getStorybookName(flags, storybookConfig)\n const designSystemId = await this.getDesignSystemId(flags, storybookConfig)\n const brandPersistentId = await this.getBrandId(flags, storybookConfig, designSystemId)\n const isPublic = this.getIsPublic(flags, storybookConfig)\n\n const apiClient = await this.apiClient()\n\n const { designSystems, storybookSites } = apiClient\n\n await this.validateDatasource(designSystems.sources, sourceId, designSystemId)\n\n this.log(`Preparing Storybook files from ${storybookDirectory}...`)\n const { sizeBytes, zipPath } = await this.createZipFromDirectory(storybookDirectory)\n\n const sizeValidation = this.validateZipSize(zipPath, sizeBytes)\n if (!sizeValidation.isValid) {\n this.error(sizeValidation.error!)\n }\n\n const { storybookSiteVersion, uploadUrl } = await storybookSites.uploadInit({\n designSystemId,\n isPublic,\n name: storybookName,\n })\n\n await this.uploadArchiveToSignedUrl({ uploadUrl, zipPath })\n this.log(\"✅ Upload complete.\")\n\n const accessType = isPublic ? \"Public\" : \"Private\"\n await runAsAction({\n start: \"Deploying Storybook to private Supernova hosting service\",\n done: \"\\n✅ \" + accessType + \" Storybook deployed successfully!\",\n fn: () => this.publishRemoteSite({ apiClient, storybookSiteVersionId: storybookSiteVersion.id }),\n })\n\n const { sourceId: finalSourceId } = await runAsAction({\n start: \"Updating Storybook stories\",\n done: \"\\n✅ Storybook stories have been updated!\",\n fn: () =>\n this.importStorybookStories({\n apiClient,\n designSystemId,\n brandPersistentId,\n sourceId,\n storybookDirectory,\n storybookName,\n }),\n })\n\n this.configService.update({\n storybook: {\n designSystemId,\n from: storybookDirectory,\n name: storybookName,\n brandId: brandPersistentId,\n sourceId: finalSourceId,\n publicAccess: isPublic,\n },\n })\n }\n\n //\n // Argument parsing\n //\n\n private async getStorybookName(flags: ImportStorybookConfig, config: SupernovaConfigStorybook) {\n let result = flags.name ?? config.name\n\n if (!result) {\n const choice = await inquirer.prompt([\n {\n message: \"Enter name of your storybook instance (it will be part of the URL)\",\n name: \"name\",\n type: \"input\",\n },\n ])\n\n if (typeof choice.name === \"string\") {\n result = choice.name\n }\n }\n\n if (!result) {\n this.error(\"Parameter `name` is required\")\n }\n\n return slugify(result, { lowercase: true })\n }\n\n private async getDesignSystemId(flags: ImportStorybookConfig, config: SupernovaConfigStorybook) {\n let designSystemId = flags.designSystemId ?? config.designSystemId\n\n if (!designSystemId) {\n designSystemId = await this.promptDesignSystemId()\n }\n\n if (!designSystemId) this.error(\"Parameter `designSystemId` is required\")\n\n return designSystemId\n }\n\n private async getBrandId(flags: ImportStorybookConfig, config: SupernovaConfigStorybook, designSystemId: string) {\n let brandId = flags.brandId ?? config.brandId\n\n if (!brandId) {\n brandId = await this.promptBrandId(designSystemId)\n }\n\n if (!brandId) this.error(\"Parameter `brandId` is required\")\n\n return brandId\n }\n\n private getStorybookDirectory(flags: ImportStorybookConfig, config: SupernovaConfigStorybook) {\n const from = flags.from ?? config.from\n if (!from) this.error(\"Parameter `from` is required\")\n\n const directoryValidation = this.validateStorybookDirectory(from)\n if (!directoryValidation.isValid) {\n this.error(directoryValidation.error)\n }\n\n return from\n }\n\n private getIsPublic(flags: ImportStorybookConfig, config: SupernovaConfigStorybook): boolean {\n return flags.publicAccess ?? config.publicAccess ?? false\n }\n\n //\n // Upload to hosting\n //\n\n /**\n * Creates a zip archive from a directory\n * @param directoryPath Path to the directory to zip\n * @returns Path to the created zip file and its size\n */\n private async createZipFromDirectory(directoryPath: string): Promise<{ sizeBytes: number; zipPath: string }> {\n const zip = new AdmZip()\n\n let totalFiles = 0\n let processedFiles = 0\n\n const countFiles = (currentPath: string) => {\n const files = fs.readdirSync(currentPath)\n\n for (const file of files) {\n const filePath = path.join(currentPath, file)\n const stat = fs.statSync(filePath)\n\n if (stat.isDirectory()) {\n countFiles(filePath)\n } else {\n totalFiles++\n }\n }\n }\n\n countFiles(directoryPath)\n\n const progressBar = new cliProgress.SingleBar(\n {\n barCompleteChar: \"\\u2588\",\n barIncompleteChar: \"\\u2591\",\n format: \"Creating zip [{bar}] {percentage}% | {value}/{total} files | Current: {filename}\",\n hideCursor: true,\n },\n cliProgress.Presets.shades_classic,\n )\n\n progressBar.start(totalFiles, 0, {\n filename: \"Initializing...\",\n })\n\n const addFilesToZip = (currentPath: string, relativePath = \"\") => {\n const files = fs.readdirSync(currentPath)\n\n for (const file of files) {\n const filePath = path.join(currentPath, file)\n const stat = fs.statSync(filePath)\n const displayPath = path.join(relativePath, file)\n\n if (stat.isDirectory()) {\n addFilesToZip(filePath, displayPath)\n } else {\n // Update the progress bar with the current file\n processedFiles++\n progressBar.update(processedFiles, {\n filename:\n displayPath.length > 40 ? \"...\" + displayPath.slice(Math.max(0, displayPath.length - 37)) : displayPath,\n })\n\n zip.addLocalFile(filePath, relativePath)\n }\n }\n }\n\n try {\n addFilesToZip(directoryPath)\n } finally {\n progressBar.stop()\n }\n\n const zipPath = `${directoryPath}.zip`\n await zip.writeZipPromise(zipPath)\n\n const sizeBytes = fs.statSync(zipPath).size\n\n return { sizeBytes, zipPath }\n }\n\n private getIndexJson(directoryPath: string) {\n const indexJsonPath = path.join(directoryPath, \"index.json\")\n if (fs.existsSync(indexJsonPath)) {\n return JSON.parse(fs.readFileSync(indexJsonPath, \"utf8\"))\n }\n\n const storiesJsonPath = path.join(directoryPath, \"stories.json\")\n if (fs.existsSync(storiesJsonPath)) {\n return JSON.parse(fs.readFileSync(storiesJsonPath, \"utf8\"))\n }\n\n throw new Error(`Can't open \"index.json\" or \"stories.json\" in path ${directoryPath}`)\n }\n\n /**\n * Uploads the zip archive to the provided signed URL\n */\n private async uploadArchiveToSignedUrl(input: { uploadUrl: string; zipPath: string }): Promise<void> {\n const { uploadUrl, zipPath } = input\n this.log(`Securely uploading ${zipPath} to Supernova...`)\n\n const fileBuffer = fs.readFileSync(zipPath)\n const fileSize = fileBuffer.byteLength\n const fileSizeKB = Number.parseFloat(bytesToKB(fileSize))\n\n // Create a new progress bar\n const progressBar = new cliProgress.SingleBar(\n {\n barCompleteChar: \"\\u2588\",\n barIncompleteChar: \"\\u2591\",\n format: \"Uploading |{bar}| {percentage}% || {value}/{total} kB\",\n hideCursor: true,\n },\n cliProgress.Presets.shades_classic,\n )\n\n // Start the progress bar\n progressBar.start(fileSizeKB, 0)\n\n try {\n await axios.put(uploadUrl, fileBuffer, {\n headers: {\n \"Content-Length\": fileSize,\n \"Content-Type\": \"application/zip\",\n },\n onUploadProgress(progressEvent) {\n const loaded = progressEvent.loaded || 0\n const loadedKB = Number.parseFloat(bytesToKB(loaded))\n progressBar.update(loadedKB)\n },\n })\n\n // Complete the progress bar\n progressBar.update(fileSizeKB)\n progressBar.stop()\n } catch (error) {\n // Make sure to stop the progress bar if there's an error\n progressBar.stop()\n throw error\n }\n }\n\n private async publishRemoteSite(input: {\n apiClient: SupernovaApiClient\n storybookSiteVersionId: string\n }): Promise<void> {\n const { apiClient, storybookSiteVersionId } = input\n\n const getStatus = async () => {\n const { storybookSiteVersion } = await apiClient.storybookSites.getVersion(storybookSiteVersionId)\n return storybookSiteVersion.uploadStatus\n }\n\n const { storybookSiteVersion: finalizedVersion } =\n await apiClient.storybookSites.uploadFinailize(storybookSiteVersionId)\n\n let lastStatus = finalizedVersion.uploadStatus\n\n // Wait for publishing to complete\n // Do 15 * 60 tries roughly correspond to at least 15 minutes\n for (let i = 0; i < 60; i++) {\n lastStatus = await getStatus()\n\n // Unknown status means the upload hasn't been picked up yet, we tolerate it for very limited amount of time\n if (lastStatus !== \"InProgress\" && lastStatus !== \"PendingUpload\") break\n\n await sleep(1000)\n }\n\n // React to publishing status\n switch (lastStatus) {\n case \"PendingUpload\":\n return this.error(\"Storybook deployment initialization failed\")\n case \"Timeout\":\n return this.error(\"Storybook deployment initialization has timed out\")\n case \"Failed\":\n return this.error(\"Storybook deployment has failed\")\n case \"InProgress\":\n return this.error(\"Storybook deployment has timed out\")\n }\n }\n\n private async importStorybookStories(input: {\n apiClient: SupernovaApiClient\n brandPersistentId: string\n designSystemId: string\n sourceId: string | undefined\n storybookDirectory: string\n storybookName: string\n }): Promise<{ sourceId: string }> {\n const { apiClient, brandPersistentId, designSystemId, storybookDirectory, storybookName } = input\n let { sourceId } = input\n\n const sourcesEndpoint = apiClient.designSystems.sources\n const storybookUrl = storybookEndpoint(this.env, designSystemId, storybookName)\n\n let storiesCount = 0\n if (sourceId) {\n const sourceUpdateResult = await sourcesEndpoint.updateStorybookImport(designSystemId, \"head\", {\n payload: this.getIndexJson(storybookDirectory),\n sourceId,\n })\n storiesCount = sourceUpdateResult.storiesCount\n } else {\n const { source } = await sourcesEndpoint.create(designSystemId, {\n brandPersistentId,\n description: \"CLI\",\n indexUrl: storybookEndpoint(this.env, designSystemId, storybookName, \"json\"),\n payload: this.getIndexJson(storybookDirectory),\n type: \"Storybook\",\n userUrl: storybookUrl,\n fileName: storybookName,\n })\n\n storiesCount = (source as unknown as DTODataSourceStorybook).storybook.storiesCount\n sourceId = source.id\n }\n\n this.log(`✅ Imported ${storiesCount} component stories into Supernova!`)\n const link = terminalLink(\"here\", storybookUrl, { fallback: (_, url) => url })\n this.log(`🔒 Access your Storybook ${link}`)\n\n return { sourceId }\n }\n\n /**\n * Validates if a directory is a valid storybook static export\n * @param directoryPath Path to the storybook directory\n * @returns An object indicating if the directory is valid and an error message if not\n */\n private validateStorybookDirectory(directoryPath: string): { error: string; isValid: false } | { isValid: true } {\n if (!fs.existsSync(directoryPath)) {\n return { error: `Directory not found: ${directoryPath}`, isValid: false }\n }\n\n if (!fs.statSync(directoryPath).isDirectory()) {\n return { error: `Not a directory: ${directoryPath}`, isValid: false }\n }\n\n // Check for essential storybook files\n const requiredFiles = [\"index.html\", \"iframe.html\"]\n const missingFiles = requiredFiles.filter(file => !fs.existsSync(path.join(directoryPath, file)))\n\n if (missingFiles.length > 0) {\n return {\n error: `Directory does not appear to be a valid Storybook export. Missing files: ${missingFiles.join(\", \")}`,\n isValid: false,\n }\n }\n\n // Check for Stories index file\n const requiredAtLeastOneFile = [\"index.json\", \"stories.json\"]\n if (!requiredAtLeastOneFile.some(file => fs.existsSync(path.join(directoryPath, file)))) {\n return {\n error:\n `Storybook directory is missing \"index.json\" or \"stories.json\".\\n` +\n `Tip: if running Storybook 6 or lower, you might need to enable \"buildStoriesJson: true\" in your Storybook config.`,\n isValid: false,\n }\n }\n\n return { isValid: true }\n }\n\n /**\n * Validates if a zip file size is within the allowed limits\n * @param zipPath Path to the zip file\n * @param sizeBytes Size of the zip file in bytes\n * @returns An object indicating if the zip is valid and an error message if not\n */\n private validateZipSize(zipPath: string, sizeBytes: number): { error?: string; isValid: boolean } {\n if (sizeBytes > MAX_ZIP_SIZE_BYTES) {\n // Delete the zip file if it's too large\n try {\n fs.unlinkSync(zipPath)\n } catch {\n // Ignore errors during cleanup\n }\n\n return {\n error: `Zip file is too large: ${bytesToMB(sizeBytes)}MB. Maximum allowed size is ${bytesToMB(MAX_ZIP_SIZE_BYTES)}MB`,\n isValid: false,\n }\n }\n\n return { isValid: true }\n }\n\n private async validateDatasource(\n sourcesEndpoint: DesignSystemSourcesEndpoint,\n sourceId: string | undefined,\n designSystemId: string,\n ) {\n if (sourceId) {\n const storybookDatasource = await sourcesEndpoint.get(designSystemId, sourceId).catch(() => null)\n if (!storybookDatasource) {\n this.error(\n \"This data source was deleted. Remove supernova.config.json and try again to create a new data source.\",\n )\n }\n }\n }\n}\n\nasync function runAsAction<T>(args: { start: string; done: string; fn: () => Promise<T> }): Promise<T> {\n action.start(args.start)\n try {\n const result = await args.fn()\n action.stop(args.done)\n return result\n } catch (error) {\n action.stop()\n throw error\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,OAAO,MAAM,uBAAuB,CAAA;AAE3C,OAAO,MAAM,MAAM,SAAS,CAAA;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,WAAW,MAAM,cAAc,CAAA;AACtC,OAAO,QAAQ,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAC7B,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,YAAY,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,CAAC,EAAW,MAAM,KAAK,CAAA;AAGhC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,0BAA0B,EAAa,MAAM,mBAAmB,CAAA;AACrG,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAG1C,MAAM,kBAAkB,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAA;AAE5C,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AAC9D,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AAEvE,MAAM,qBAAqB,GAAG,CAA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