@supernovaio/cli-next 2.3.4-alpha0 → 2.3.6
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/commands/components-import.js +1 -4
- package/dist/commands/components-import.js.map +1 -1
- package/dist/commands/describe-design-system.js +1 -4
- package/dist/commands/describe-design-system.js.map +1 -1
- package/dist/commands/describe-workspaces.js +1 -4
- package/dist/commands/describe-workspaces.js.map +1 -1
- package/dist/commands/login.js +1 -4
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logout.js +1 -4
- package/dist/commands/logout.js.map +1 -1
- package/dist/commands/publish-documentation.js +1 -4
- package/dist/commands/publish-documentation.js.map +1 -1
- package/dist/commands/storybook-import.d.ts.map +1 -1
- package/dist/commands/storybook-import.js +9 -9
- package/dist/commands/storybook-import.js.map +1 -1
- package/dist/commands/sync-tokens.js +1 -4
- package/dist/commands/sync-tokens.js.map +1 -1
- package/dist/commands/whoami.js +1 -4
- package/dist/commands/whoami.js.map +1 -1
- package/dist/hooks/postrun/save-config.js +1 -4
- package/dist/hooks/postrun/save-config.js.map +1 -1
- package/dist/hooks/prerun/load-config.js +1 -4
- package/dist/hooks/prerun/load-config.js.map +1 -1
- package/dist/hooks/prerun/sentry.js +1 -4
- package/dist/hooks/prerun/sentry.js.map +1 -1
- package/dist/index.js +1 -4
- package/dist/index.js.map +1 -1
- package/dist/services/auth.service.js +1 -4
- package/dist/services/auth.service.js.map +1 -1
- package/dist/services/index.js +1 -4
- package/dist/services/index.js.map +1 -1
- package/dist/services/user.service.js +1 -4
- package/dist/services/user.service.js.map +1 -1
- package/dist/services/vault.service.js +1 -4
- package/dist/services/vault.service.js.map +1 -1
- package/dist/types/base-command.d.ts +1 -0
- package/dist/types/base-command.d.ts.map +1 -1
- package/dist/types/base-command.js +5 -4
- package/dist/types/base-command.js.map +1 -1
- package/dist/types/config.js +1 -4
- package/dist/types/config.js.map +1 -1
- package/dist/types/environment.js +1 -4
- package/dist/types/environment.js.map +1 -1
- package/dist/types/flags.js +1 -4
- package/dist/types/flags.js.map +1 -1
- package/dist/types/index.js +1 -4
- package/dist/types/index.js.map +1 -1
- package/dist/types/login.js +1 -4
- package/dist/types/login.js.map +1 -1
- package/dist/types/not-authorized.error.js +1 -4
- package/dist/types/not-authorized.error.js.map +1 -1
- package/dist/types/sentry-command.js +1 -4
- package/dist/types/sentry-command.js.map +1 -1
- package/dist/types/types.d.ts +0 -14
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/types.js +1 -4
- package/dist/types/types.js.map +1 -1
- package/dist/utils/api-client.js +1 -4
- package/dist/utils/api-client.js.map +1 -1
- package/dist/utils/common.js +1 -4
- package/dist/utils/common.js.map +1 -1
- package/dist/utils/config.service.js +2 -5
- package/dist/utils/config.service.js.map +1 -1
- package/dist/utils/figma-tokens-data-loader.js +1 -4
- package/dist/utils/figma-tokens-data-loader.js.map +1 -1
- package/dist/utils/index.js +1 -4
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/run-exporter/exporter-utils.d.ts +1 -13
- package/dist/utils/run-exporter/exporter-utils.d.ts.map +1 -1
- package/dist/utils/run-exporter/exporter-utils.js +2 -19
- package/dist/utils/run-exporter/exporter-utils.js.map +1 -1
- package/dist/utils/sdk.js +1 -4
- package/dist/utils/sdk.js.map +1 -1
- package/oclif.manifest.json +2 -89
- package/package.json +4 -4
- package/dist/commands/run-local-exporter.d.ts +0 -44
- package/dist/commands/run-local-exporter.d.ts.map +0 -1
- package/dist/commands/run-local-exporter.js +0 -226
- package/dist/commands/run-local-exporter.js.map +0 -1
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e4811896-c858-590e-986d-df4e23df9e48")}catch(e){}}();
|
|
3
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
4
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -90,5 +88,4 @@ __decorate([
|
|
|
90
88
|
__metadata("design:paramtypes", []),
|
|
91
89
|
__metadata("design:returntype", Promise)
|
|
92
90
|
], ImportComponents.prototype, "run", null);
|
|
93
|
-
//# sourceMappingURL=components-import.js.map
|
|
94
|
-
//# debugId=e4811896-c858-590e-986d-df4e23df9e48
|
|
91
|
+
//# sourceMappingURL=components-import.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components-import.js","sources":["../../src/commands/components-import.ts"],"
|
|
1
|
+
{"version":3,"file":"components-import.js","sourceRoot":"","sources":["../../src/commands/components-import.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,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,OAA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,GAAG,CAAC,CAAA;gBACxD,MAAM,KAAK,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,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;QAUvC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,CAAC,mCAAmC,CAAC,KAAK,CAAC,CAAA;QACrD,CAAC;IACH,CAAC;;AA9CY;IADZ,YAAY,EAAE;;;;2CA+Cd","sourcesContent":["import { Flags } from \"@oclif/core\"\nimport { SentryTraced } from \"@sentry/nestjs\"\n// eslint-disable-next-line n/no-extraneous-import\nimport { analyzeComponents } from \"@supernovaio/code-analyzer\"\nimport * as process from \"node:process\"\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\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\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 const { flags } = await this.parse(ImportComponents)\n\n const { importFrom, rootDir } = flags\n\n this.log(\"📦 Component Import Summary\".green)\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 /*\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`.green)\n */\n } else {\n this.log(\"\\n⚠️ No components were imported\".green)\n }\n }\n}\n"]}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5eacd001-51f8-5396-9f86-37435839168a")}catch(e){}}();
|
|
3
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
4
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -72,5 +70,4 @@ __decorate([
|
|
|
72
70
|
__metadata("design:paramtypes", []),
|
|
73
71
|
__metadata("design:returntype", Promise)
|
|
74
72
|
], DescribeDesignSystem.prototype, "run", null);
|
|
75
|
-
//# sourceMappingURL=describe-design-system.js.map
|
|
76
|
-
//# debugId=5eacd001-51f8-5396-9f86-37435839168a
|
|
73
|
+
//# sourceMappingURL=describe-design-system.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe-design-system.js","sources":["../../src/commands/describe-design-system.ts"],"
|
|
1
|
+
{"version":3,"file":"describe-design-system.js","sourceRoot":"","sources":["../../src/commands/describe-design-system.ts"],"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;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QAGtE,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QAClD,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,CAAA;QAEvD,IAAI,CAAC,GAAG,CAAC,sBAAsB,YAAY,CAAC,IAAI,UAAU,YAAY,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAA;QACjF,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,IAAI,CAAC,GAAG,CAAC,eAAe,KAAK,CAAC,IAAI,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,IAAI,CAAC,CAAA;YACxD,CAAC;QACH,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC1B,CAAC;;AAxBK;IADL,YAAY,EAAE;;;;+CAyBd","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}`.cyan)\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`.gray)\n }\n }\n\n this.log(\"\\nDone\".green)\n }\n}\n"]}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1556f9fd-cee7-51b2-b02f-00fd7c18ba09")}catch(e){}}();
|
|
3
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
4
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -107,5 +105,4 @@ __decorate([
|
|
|
107
105
|
__metadata("design:paramtypes", []),
|
|
108
106
|
__metadata("design:returntype", Promise)
|
|
109
107
|
], DescribeWorkspaces.prototype, "run", null);
|
|
110
|
-
//# sourceMappingURL=describe-workspaces.js.map
|
|
111
|
-
//# debugId=1556f9fd-cee7-51b2-b02f-00fd7c18ba09
|
|
108
|
+
//# sourceMappingURL=describe-workspaces.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe-workspaces.js","sources":["../../src/commands/describe-workspaces.ts"],"
|
|
1
|
+
{"version":3,"file":"describe-workspaces.js","sourceRoot":"","sources":["../../src/commands/describe-workspaces.ts"],"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,MAAM,EAAE;CACxB,CAAC;KACD,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClB,GAAG,IAAI;CACR,CAAC,CAAC,CAAA;AAQL,MAAM,OAAO,kBAAmB,SAAQ,aAAsC;IAK5E,MAAM,CAAC,OAAO,CAAyB;IAEvC,MAAM,CAAC,WAAW,GAChB,0HAA0H,CAAA;IAE5H,MAAM,CAAC,QAAQ,GAAG,CAAC,iEAAiE,CAAC,CAAA;IAErF,MAAM,CAAC,KAAK,GAAG;QACb,GAAG,WAAW;QACd,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,iDAAiD,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;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C,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,IAAI,CAAC,CAAA;wBAClE,CAAC;oBACH,CAAC;yBAAM,CAAC;wBACN,IAAI,CAAC,GAAG,CAAC,yCAAyC,CAAC,IAAI,CAAC,CAAA;oBAC1D,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC1B,CAAC;;AA/DK;IADL,YAAY,EAAE;;;;uDAsBd;AAGK;IADL,YAAY,EAAE;;;;6CAwCd","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 bypassEnvFetch: true,\n proxyUrl: flags.proxyUrl,\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}`.magenta)\n for (const designSystem of designSystems) {\n this.log(` ↳ Design system \"${designSystem.name}\", id: ${designSystem.id}`.cyan)\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}`.gray)\n }\n } else {\n this.log(` ↳ No themes defined in this brand`.gray)\n }\n }\n }\n }\n\n this.log(\"\\nDone\".green)\n }\n}\n"]}
|
package/dist/commands/login.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a02834d3-1815-5c6c-85da-2de716666fac")}catch(e){}}();
|
|
3
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
4
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -69,5 +67,4 @@ __decorate([
|
|
|
69
67
|
__metadata("design:paramtypes", [String]),
|
|
70
68
|
__metadata("design:returntype", Promise)
|
|
71
69
|
], Login.prototype, "openBrowser", null);
|
|
72
|
-
//# sourceMappingURL=login.js.map
|
|
73
|
-
//# debugId=a02834d3-1815-5c6c-85da-2de716666fac
|
|
70
|
+
//# sourceMappingURL=login.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.js","sources":["../../src/commands/login.ts"],"
|
|
1
|
+
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.ts"],"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,MAAM,CAAU,QAAQ,GAAG,CAAC,qCAAqC,CAAC,CAAA;IAClE,MAAM,CAAU,KAAK,GAAG,WAAW,CAAA;IAClB,WAAW,GAAgB,IAAI,WAAW,EAAE,CAAA;IAC5C,YAAY,GAAiB,IAAI,YAAY,EAAE,CAAA;IAEhE,IAAI,SAAS;QACX,OAAO,KAAK,CAAC,EAAE,CAAA;IACjB,CAAC;IAED,IAAI,YAAY;QACd,OAAO,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IACrB,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AG,aAAa,CAAC,CAAA;QAClD,CAAC;IACH,CAAC;;AA7BY;IADZ,YAAY,EAAE;;;;gCAoBd;AAGa;IADb,YAAY,EAAE;;;;wCAQd","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\".green)\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\".green)\n } else {\n this.log(\"3. Login timed out\".red)\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"]}
|
package/dist/commands/logout.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4d7556fb-dc54-5513-91d4-1e36e7d0c62d")}catch(e){}}();
|
|
3
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
4
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -36,5 +34,4 @@ __decorate([
|
|
|
36
34
|
__metadata("design:paramtypes", []),
|
|
37
35
|
__metadata("design:returntype", Promise)
|
|
38
36
|
], Logout.prototype, "run", null);
|
|
39
|
-
//# sourceMappingURL=logout.js.map
|
|
40
|
-
//# debugId=4d7556fb-dc54-5513-91d4-1e36e7d0c62d
|
|
37
|
+
//# sourceMappingURL=logout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logout.js","sources":["../../src/commands/logout.ts"],"
|
|
1
|
+
{"version":3,"file":"logout.js","sourceRoot":"","sources":["../../src/commands/logout.ts"],"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","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"]}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="293a0102-935c-5dcc-9dd8-9ca3420487cd")}catch(e){}}();
|
|
3
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
4
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -122,5 +120,4 @@ function isJobStatusDone(status) {
|
|
|
122
120
|
status === sdkTypes.ExportBuildStatus.Success ||
|
|
123
121
|
status === sdkTypes.ExportBuildStatus.Timeout);
|
|
124
122
|
}
|
|
125
|
-
//# sourceMappingURL=publish-documentation.js.map
|
|
126
|
-
//# debugId=293a0102-935c-5dcc-9dd8-9ca3420487cd
|
|
123
|
+
//# sourceMappingURL=publish-documentation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish-documentation.js","sources":["../../src/commands/publish-documentation.ts"],"
|
|
1
|
+
{"version":3,"file":"publish-documentation.js","sourceRoot":"","sources":["../../src/commands/publish-documentation.ts"],"names":[],"mappings":";;;;;;;;;AAWA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,CAAC,EAAW,MAAM,KAAK,CAAA;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAQpD,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE;IAC5B,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,GAAG,EAAE,CAAC,CAAC,OAAO,EAAE;IAChB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACrC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;CACnB,CAAC,CAAA;AAQF,MAAM,OAAO,oBAAqB,SAAQ,aAAyC;IAKjF,MAAM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E,CAAC;YAC1B,KAAK,SAAS,CAAC,CAAC,CAAC;gBACf,IAAI,CAAC,GAAG,CAAC,6CAA6C,CAAC,KAAK,CAAC,CAAA;gBAE7D,MAAK;YACP,CAAC;YAED,KAAK,QAAQ,CAAC,CAAC,CAAC;gBACd,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAA;YACjD,CAAC;YAED,KAAK,SAAS,CAAC,CAAC,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;YACpD,CAAC;YAED,OAAO,CAAC,CAAC,CAAC;gBACR,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAA;YAC/C,CAAC;QACH,CAAC;IACH,CAAC;;AAtDK;IADL,YAAY,EAAE;;;;+CAuDd;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","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 * as 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, {\n groupPersistentIds: [],\n pagePersistentIds: [],\n })\n\n this.log(`Documentation queued for publishing`.green)\n\n if (!flags.awaitPublishJob) {\n this.log(`Documentation publish await is disabled, exiting before the publish is finished.`.yellow)\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\".green)\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storybook-import.d.ts","sourceRoot":"","sources":["../../src/commands/storybook-import.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"storybook-import.d.ts","sourceRoot":"","sources":["../../src/commands/storybook-import.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAGhC,OAAO,EAAe,aAAa,EAAyC,MAAM,mBAAmB,CAAA;AASrG,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;EAM/B,CAAA;AAEF,KAAK,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAcxE,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,aAAa,CAAC,qBAAqB,CAAC;IAC/E,OAAgB,IAAI,KAAK;IACzB,OAAgB,WAAW,SAAgD;IAC3E,OAAgB,QAAQ,WAA4D;IACpF,OAAgB,KAAK;;;;;;MAUpB;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,YAAY,IAAI,OAAO,CAAC,qBAAqB,CAAC,CAEjD;IAGY,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;YA6DnB,gBAAgB;YAwBhB,iBAAiB;YAYjB,UAAU;YAYV,qBAAqB;IAqBnC,OAAO,CAAC,sBAAsB;IA0E9B,OAAO,CAAC,YAAY;YAYN,wBAAwB;YAuDxB,iBAAiB;YA2CjB,sBAAsB;IAyDpC,OAAO,CAAC,0BAA0B;IA6BlC,OAAO,CAAC,eAAe;CAiBxB"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="33195738-ec1c-56be-a5e2-4147e0e178a2")}catch(e){}}();
|
|
3
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
4
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -19,6 +17,7 @@ import cliProgress from "cli-progress";
|
|
|
19
17
|
import inquirer from "inquirer";
|
|
20
18
|
import * as fs from "node:fs";
|
|
21
19
|
import path from "node:path";
|
|
20
|
+
import terminalLink from "terminal-link";
|
|
22
21
|
import { z } from "zod";
|
|
23
22
|
import { commonFlags, SentryCommand, storybookUrlForEnvironment } from "../types/index.js";
|
|
24
23
|
import { sleep } from "../utils/common.js";
|
|
@@ -32,10 +31,10 @@ const ImportStorybookConfigSchema = z.object({
|
|
|
32
31
|
name: z.string().optional(),
|
|
33
32
|
sourceId: z.string().optional(),
|
|
34
33
|
});
|
|
35
|
-
const storybookEndpoint = (environment, designSystemId, name, accessToken) => {
|
|
34
|
+
const storybookEndpoint = (environment, designSystemId, name, accessToken, format = "html") => {
|
|
36
35
|
const host = storybookUrlForEnvironment(environment);
|
|
37
36
|
const encodedAccessToken = encodeURIComponent(accessToken);
|
|
38
|
-
return `${host}/design-systems/${designSystemId}/alias/${name}/index
|
|
37
|
+
return `${host}/design-systems/${designSystemId}/alias/${name}/index.${format}?authorization=${encodedAccessToken}`;
|
|
39
38
|
};
|
|
40
39
|
export default class ImportStorybook extends SentryCommand {
|
|
41
40
|
static args = {};
|
|
@@ -62,7 +61,7 @@ export default class ImportStorybook extends SentryCommand {
|
|
|
62
61
|
const { flags } = await this.parse();
|
|
63
62
|
const config = this.configService.get();
|
|
64
63
|
const storybookConfig = config?.storybook ?? {};
|
|
65
|
-
const { sourceId } = flags;
|
|
64
|
+
const { sourceId } = { ...storybookConfig, ...flags };
|
|
66
65
|
const storybookDirectory = await this.getStorybookDirectory(flags, storybookConfig);
|
|
67
66
|
const storybookName = await this.getStorybookName(flags, storybookConfig);
|
|
68
67
|
const designSystemId = await this.getDesignSystemId(flags, storybookConfig);
|
|
@@ -298,16 +297,18 @@ export default class ImportStorybook extends SentryCommand {
|
|
|
298
297
|
const { source } = await sourcesEndpoint.create(designSystemId, {
|
|
299
298
|
brandPersistentId,
|
|
300
299
|
description: "CLI",
|
|
301
|
-
indexUrl:
|
|
300
|
+
indexUrl: storybookEndpoint(this.env, designSystemId, storybookName, accessToken, "json"),
|
|
302
301
|
payload: this.getIndexJson(storybookDirectory),
|
|
303
302
|
type: "Storybook",
|
|
304
303
|
userUrl: storybookUrl,
|
|
304
|
+
fileName: storybookName,
|
|
305
305
|
});
|
|
306
306
|
storiesCount = source.storybook.storiesCount;
|
|
307
307
|
sourceId = source.id;
|
|
308
308
|
}
|
|
309
309
|
this.log(`✅ Imported ${storiesCount} component stories into Supernova!`);
|
|
310
|
-
|
|
310
|
+
const link = terminalLink("here", storybookUrl, { fallback: (_, url) => url });
|
|
311
|
+
this.log(`🔒 Access your Storybook at ${link}`);
|
|
311
312
|
return { sourceId };
|
|
312
313
|
}
|
|
313
314
|
catch (error) {
|
|
@@ -352,5 +353,4 @@ __decorate([
|
|
|
352
353
|
__metadata("design:paramtypes", []),
|
|
353
354
|
__metadata("design:returntype", Promise)
|
|
354
355
|
], ImportStorybook.prototype, "run", null);
|
|
355
|
-
//# sourceMappingURL=storybook-import.js.map
|
|
356
|
-
//# debugId=33195738-ec1c-56be-a5e2-4147e0e178a2
|
|
356
|
+
//# sourceMappingURL=storybook-import.js.map
|
|
@@ -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 { 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 { 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 ImportStorybookConfigSchema = 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})\n\ntype ImportStorybookConfig = z.infer<typeof ImportStorybookConfigSchema>\n\nconst storybookEndpoint = (\n environment: TargetEnv,\n designSystemId: string,\n name: string,\n accessToken: string,\n): string => {\n const host = storybookUrlForEnvironment(environment)\n const encodedAccessToken = encodeURIComponent(accessToken)\n return `${host}/design-systems/${designSystemId}/alias/${name}/index.html?authorization=${encodedAccessToken}`\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 }\n\n get commandId(): string {\n return ImportStorybook.id\n }\n\n get configSchema(): ZodType<ImportStorybookConfig> {\n return ImportStorybookConfigSchema\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 } = flags\n\n const storybookDirectory = await 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\n const apiClient = await this.apiClient()\n const { designSystems } = apiClient\n const { storybookHosting } = designSystems\n\n this.log(`Preparing Storybook files from ${storybookDirectory}...`)\n const { sizeBytes, zipPath } = this.createZipFromDirectory(storybookDirectory)\n\n const sizeValidation = this.validateZipSize(zipPath, sizeBytes)\n if (!sizeValidation.isValid) {\n this.error(sizeValidation.error!)\n }\n\n const { signedUrl, storybookUploadId } = await storybookHosting.getSignedUploadUrl(designSystemId, {\n name: storybookName,\n })\n\n await this.uploadArchiveToSignedUrl({ designSystemId, storybookName, signedUrl, storybookUploadId, zipPath })\n this.log(\"✅ Upload complete.\")\n\n action.start(\"Deploying Storybook to private Supernova hosting service...\")\n await this.waitForPublishing({ apiClient, designSystemId, storybookUploadId })\n action.stop(\"\\n✅ Private Storybook deployed successfully!\")\n\n action.start(\"Updating Storybook stories...\")\n const { sourceId: finalSourceId } = await this.importStorybookStories({\n apiClient,\n designSystemId,\n brandPersistentId,\n sourceId,\n storybookDirectory,\n storybookName,\n })\n action.stop(\"\\n✅ Storybook stories have been updated!\")\n\n this.configService.update({\n storybook: {\n designSystemId,\n from: storybookDirectory,\n name: storybookName,\n brandId: brandPersistentId,\n sourceId: finalSourceId,\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 async 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 //\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 createZipFromDirectory(directoryPath: string): { 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 zip.writeZip(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 \"{}\"\n }\n\n return JSON.parse(fs.readFileSync(indexJsonPath, \"utf8\"))\n }\n\n /**\n * Uploads the zip archive to the provided signed URL\n */\n private async uploadArchiveToSignedUrl(input: {\n designSystemId: string\n signedUrl: string\n storybookName?: string\n storybookUploadId: string\n zipPath: string\n }): Promise<void> {\n const { designSystemId, storybookName, signedUrl, storybookUploadId, zipPath } = input\n this.log(`Securely uploading ${zipPath} to Supernova...`)\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 const fileStream = fs.createReadStream(zipPath)\n const stats = fs.statSync(zipPath)\n const fileSize = stats.size\n const fileSizeKB = Number.parseFloat(bytesToKB(fileSize))\n\n // Start the progress bar\n progressBar.start(fileSizeKB, 0)\n\n try {\n await axios.put(signedUrl, fileStream, {\n headers: {\n \"Content-Length\": fileSize,\n \"Content-Type\": \"application/zip\",\n designSystemId,\n storybookUploadId,\n ...(storybookName && { name: storybookName }),\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 waitForPublishing(input: {\n apiClient: SupernovaApiClient\n designSystemId: string\n storybookUploadId: string\n }): Promise<void> {\n const { apiClient, designSystemId, storybookUploadId } = input\n\n const getStatus = async () => {\n const { status } = await apiClient.designSystems.storybookHosting.getUploadStatus(\n designSystemId,\n storybookUploadId,\n )\n return status\n }\n\n let lastStatus: Awaited<ReturnType<typeof getStatus>> = \"Unknown\"\n let unknownStatusCount = 0\n\n // Wait for publishing to complete\n // Do 15 * 60 tries roughly correspond to at least 15 minutes\n for (let i = 0; unknownStatusCount < 10 && i < 15 * 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 === \"Unknown\") unknownStatusCount++\n else unknownStatusCount = 0\n\n if (lastStatus === \"Completed\" || lastStatus === \"Failed\") break\n\n await sleep(1000)\n }\n\n // React to publishing status\n switch (lastStatus) {\n case \"Unknown\":\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 storybookHostingEndpoint = apiClient.designSystems.storybookHosting\n\n const { accessToken } = await storybookHostingEndpoint.getAccessToken(designSystemId, storybookName)\n const storybookUrl = storybookEndpoint(this.env, designSystemId, storybookName, accessToken)\n\n try {\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: storybookUrl,\n payload: this.getIndexJson(storybookDirectory),\n type: \"Storybook\",\n userUrl: storybookUrl,\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 this.log(`🔒 Access your Storybook at: ${storybookUrl}`)\n\n return { sourceId }\n } catch (error) {\n this.error(\n `Failed to connect Storybook as data source: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\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 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"],"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,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,C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BAAkB,EAAE,CAAC;YAEnC,IAAI,CAAC;gBACH,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;YACxB,CAAC;YAAC,MAAM,CAAC;YAET,CAAC;YAED,OAAO;gBACL,KAAK,EAAE,0BAA0B,SAAS,CAAC,SAAS,CAAC,+BAA+B,SAAS,CAAC,kBAAkB,CAAC,IAAI;gBACrH,OAAO,EAAE,KAAK;aACf,CAAA;QACH,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IAC1B,CAAC;;AA9ZY;IADZ,YAAY,EAAE;;;;0CAwDd","debug_id":"33195738-ec1c-56be-a5e2-4147e0e178a2"}
|
|
1
|
+
{"version":3,"file":"storybook-import.js","sourceRoot":"","sources":["../../src/commands/storybook-import.ts"],"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,C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EAAE,4EAA4E,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;gBAC5G,OAAO,EAAE,KAAK;aACf,CAAA;QACH,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IAC1B,CAAC;IAQO,eAAe,CAAC,OAAe,EAAE,SAAiB;QACxD,IAAI,SAAS,GAAG,kBAAkB,EAAE,CAAC;YAEnC,IAAI,CAAC;gBACH,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;YACxB,CAAC;YAAC,MAAM,CAAC;YAET,CAAC;YAED,OAAO;gBACL,KAAK,EAAE,0BAA0B,SAAS,CAAC,SAAS,CAAC,+BAA+B,SAAS,CAAC,kBAAkB,CAAC,IAAI;gBACrH,OAAO,EAAE,KAAK;aACf,CAAA;QACH,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IAC1B,CAAC;;AAhaY;IADZ,YAAY,EAAE;;;;0CAwDd","sourcesContent":["import { Flags } from \"@oclif/core\"\nimport { action } from \"@oclif/core/ux\"\nimport { SentryTraced } from \"@sentry/nestjs\"\nimport slugify from \"@sindresorhus/slugify\"\nimport { 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 ImportStorybookConfigSchema = 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})\n\ntype ImportStorybookConfig = z.infer<typeof ImportStorybookConfigSchema>\n\nconst storybookEndpoint = (\n environment: TargetEnv,\n designSystemId: string,\n name: string,\n accessToken: string,\n format: \"html\" | \"json\" = \"html\",\n): string => {\n const host = storybookUrlForEnvironment(environment)\n const encodedAccessToken = encodeURIComponent(accessToken)\n return `${host}/design-systems/${designSystemId}/alias/${name}/index.${format}?authorization=${encodedAccessToken}`\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 }\n\n get commandId(): string {\n return ImportStorybook.id\n }\n\n get configSchema(): ZodType<ImportStorybookConfig> {\n return ImportStorybookConfigSchema\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 = await 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\n const apiClient = await this.apiClient()\n const { designSystems } = apiClient\n const { storybookHosting } = designSystems\n\n this.log(`Preparing Storybook files from ${storybookDirectory}...`)\n const { sizeBytes, zipPath } = this.createZipFromDirectory(storybookDirectory)\n\n const sizeValidation = this.validateZipSize(zipPath, sizeBytes)\n if (!sizeValidation.isValid) {\n this.error(sizeValidation.error!)\n }\n\n const { signedUrl, storybookUploadId } = await storybookHosting.getSignedUploadUrl(designSystemId, {\n name: storybookName,\n })\n\n await this.uploadArchiveToSignedUrl({ designSystemId, storybookName, signedUrl, storybookUploadId, zipPath })\n this.log(\"✅ Upload complete.\")\n\n action.start(\"Deploying Storybook to private Supernova hosting service...\")\n await this.waitForPublishing({ apiClient, designSystemId, storybookUploadId })\n action.stop(\"\\n✅ Private Storybook deployed successfully!\")\n\n action.start(\"Updating Storybook stories...\")\n const { sourceId: finalSourceId } = await this.importStorybookStories({\n apiClient,\n designSystemId,\n brandPersistentId,\n sourceId,\n storybookDirectory,\n storybookName,\n })\n action.stop(\"\\n✅ Storybook stories have been updated!\")\n\n this.configService.update({\n storybook: {\n designSystemId,\n from: storybookDirectory,\n name: storybookName,\n brandId: brandPersistentId,\n sourceId: finalSourceId,\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 async 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 //\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 createZipFromDirectory(directoryPath: string): { 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 zip.writeZip(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 \"{}\"\n }\n\n return JSON.parse(fs.readFileSync(indexJsonPath, \"utf8\"))\n }\n\n /**\n * Uploads the zip archive to the provided signed URL\n */\n private async uploadArchiveToSignedUrl(input: {\n designSystemId: string\n signedUrl: string\n storybookName?: string\n storybookUploadId: string\n zipPath: string\n }): Promise<void> {\n const { designSystemId, storybookName, signedUrl, storybookUploadId, zipPath } = input\n this.log(`Securely uploading ${zipPath} to Supernova...`)\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 const fileStream = fs.createReadStream(zipPath)\n const stats = fs.statSync(zipPath)\n const fileSize = stats.size\n const fileSizeKB = Number.parseFloat(bytesToKB(fileSize))\n\n // Start the progress bar\n progressBar.start(fileSizeKB, 0)\n\n try {\n await axios.put(signedUrl, fileStream, {\n headers: {\n \"Content-Length\": fileSize,\n \"Content-Type\": \"application/zip\",\n designSystemId,\n storybookUploadId,\n ...(storybookName && { name: storybookName }),\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 waitForPublishing(input: {\n apiClient: SupernovaApiClient\n designSystemId: string\n storybookUploadId: string\n }): Promise<void> {\n const { apiClient, designSystemId, storybookUploadId } = input\n\n const getStatus = async () => {\n const { status } = await apiClient.designSystems.storybookHosting.getUploadStatus(\n designSystemId,\n storybookUploadId,\n )\n return status\n }\n\n let lastStatus: Awaited<ReturnType<typeof getStatus>> = \"Unknown\"\n let unknownStatusCount = 0\n\n // Wait for publishing to complete\n // Do 15 * 60 tries roughly correspond to at least 15 minutes\n for (let i = 0; unknownStatusCount < 10 && i < 15 * 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 === \"Unknown\") unknownStatusCount++\n else unknownStatusCount = 0\n\n if (lastStatus === \"Completed\" || lastStatus === \"Failed\") break\n\n await sleep(1000)\n }\n\n // React to publishing status\n switch (lastStatus) {\n case \"Unknown\":\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 storybookHostingEndpoint = apiClient.designSystems.storybookHosting\n\n const { accessToken } = await storybookHostingEndpoint.getAccessToken(designSystemId, storybookName)\n const storybookUrl = storybookEndpoint(this.env, designSystemId, storybookName, accessToken)\n\n try {\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, accessToken, \"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 at ${link}`)\n\n return { sourceId }\n } catch (error) {\n this.error(\n `Failed to connect Storybook as data source: ${error instanceof Error ? error.message : String(error)}`,\n )\n }\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 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"]}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d4efae13-80eb-519c-8eef-8fe339647e5b")}catch(e){}}();
|
|
3
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
4
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -95,5 +93,4 @@ __decorate([
|
|
|
95
93
|
__metadata("design:paramtypes", []),
|
|
96
94
|
__metadata("design:returntype", Promise)
|
|
97
95
|
], SyncDesignTokens.prototype, "run", null);
|
|
98
|
-
//# sourceMappingURL=sync-tokens.js.map
|
|
99
|
-
//# debugId=d4efae13-80eb-519c-8eef-8fe339647e5b
|
|
96
|
+
//# sourceMappingURL=sync-tokens.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-tokens.js","sources":["../../src/commands/sync-tokens.ts"],"
|
|
1
|
+
{"version":3,"file":"sync-tokens.js","sourceRoot":"","sources":["../../src/commands/sync-tokens.ts"],"names":[],"mappings":";;;;;;;;;AAWA,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,mBAAmB,CAAA;AAGjD,OAAO,QAAQ,CAAA;AAEf,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAA;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAQpD,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAA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MAAM,eAAe,GAAG,KAAK,CAAC,YAAY;YACxC,CAAC,CAAC,MAAM,UAAU,CAAC,uBAAuB,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,cAAc,CAAC;YACpF,CAAC,CAAC,MAAM,UAAU,CAAC,kBAAkB,CAAC,KAAK,CAAC,aAAc,CAAC,CAAA;QAC7D,MAAM,QAAQ,GAAG,CAAC,MAAM,QAAQ,CAAC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC,CAE7F,CAAA;QACD,IAAI,QAAQ,EAAE,MAAM,EAAE,IAAI,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC9D,KAAK,MAAM,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;gBACvC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YACf,CAAC;QACH,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAA;IACzC,CAAC;;AAnCK;IADL,YAAY,EAAE;;;;2CAoCd","sourcesContent":["//\n// sync-tokens.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, ZodType } from \"zod\"\n\nimport { SentryCommand } from \"../types/index.js\"\n\n// eslint-disable-next-line no-restricted-imports\nimport \"colors\"\n\nimport { FigmaTokensDataLoader } from \"../utils/figma-tokens-data-loader.js\"\nimport { getWritableVersion } from \"../utils/sdk.js\"\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Definition\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Configuration\n\nconst SyncDesignTokensConfigSchema = z.object({\n apiKey: z.string(),\n apiUrl: z.string().url().optional(),\n configFilePath: z.string(),\n designSystemId: z.string(),\n proxyUrl: z.string().url().optional(),\n tokenDirPath: z.string().optional(),\n tokenFilePath: z.string().optional(),\n})\n\ntype SyncDesignTokensConfig = z.infer<typeof SyncDesignTokensConfigSchema>\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Tool implementation\n\n/** Command that handles synchronization with design tokens plugin */\nexport class SyncDesignTokens extends SentryCommand<SyncDesignTokensConfig> {\n // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n // MARK: - Command configuration\n\n // How this command can be run\n static aliases: [\"sync-tokens\"]\n // Command help description\n static description = \"Synchronize tokens from Figma Tokens plugin to Supernova workspaces\"\n // Examples how to use the command\n static examples = [\n `$ @supernovaio/cli sync-tokens --apiKey=\"{xxx-xxx-xxx}\" --designSystemId={1234} --tokenFilePath \"/path/to/tokens.json\" --configFilePath \"/path/to/config.json\"`,\n `$ @supernovaio/cli sync-tokens --apiKey=\"{xxx-xxx-xxx}\" --designSystemId={1234} --tokenDirPath \"/path/to/tokens/\" --configFilePath \"/path/to/config.json\"`,\n ]\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 apiUrl: Flags.string({\n description: \"API url to use for accessing Supernova instance, would ignore defaults\",\n hidden: true,\n }),\n configFilePath: Flags.string({ description: \"Path to configuration JSON file\", exclusive: [], required: true }),\n designSystemId: Flags.string({ description: \"Design System to synchronize contents with\", 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 tokenDirPath: Flags.string({\n description: \"Path to directory of JSON files containing token definitions\",\n exactlyOne: [\"tokenDirPath\", \"tokenFilePath\"],\n }),\n tokenFilePath: Flags.string({\n description: \"Path to JSON file containing token definitions\",\n exactlyOne: [\"tokenDirPath\", \"tokenFilePath\"],\n }),\n }\n\n // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n // MARK: - Command runtime\n\n get commandId(): string {\n return SyncDesignTokens.id\n }\n\n get configSchema(): ZodType<SyncDesignTokensConfig> {\n return SyncDesignTokensConfigSchema\n }\n\n @SentryTraced()\n async run(): Promise<void> {\n const { flags } = await this.parse(SyncDesignTokens)\n\n // Get workspace -> design system –> version\n const { id, instance } = await getWritableVersion(flags)\n const dataLoader = new FigmaTokensDataLoader()\n const configDefinition = dataLoader.loadConfigFromPath(flags.configFilePath)\n const { settings } = configDefinition\n if (flags.dry) {\n settings.dryRun = true\n }\n\n const buildData = (payload: unknown) => ({\n connection: { name: \"CLI\" },\n ...dataLoader.loadConfigFromPathAsIs(flags.configFilePath),\n payload,\n })\n\n if (!flags.tokenFilePath && !flags.tokenDirPath) {\n throw new Error(`Either tokenFilePath or tokenDirPath must be provided`)\n }\n\n const tokenDefinition = flags.tokenDirPath\n ? await dataLoader.loadTokensFromDirectory(flags.tokenDirPath, flags.configFilePath)\n : await dataLoader.loadTokensFromPath(flags.tokenFilePath!)\n const response = (await instance.versions.writeTokenStudioData(id, buildData(tokenDefinition))) as {\n result: { logs: string[] }\n }\n if (response?.result?.logs && response.result.logs.length > 0) {\n for (const log of response.result.logs) {\n this.log(log)\n }\n }\n\n this.log(`\\nTokens synchronized`.green)\n }\n}\n"]}
|
package/dist/commands/whoami.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e882d651-9ed2-57b7-8758-17ac93858321")}catch(e){}}();
|
|
3
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
4
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
5
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -63,5 +61,4 @@ __decorate([
|
|
|
63
61
|
__metadata("design:paramtypes", []),
|
|
64
62
|
__metadata("design:returntype", Promise)
|
|
65
63
|
], WhoAmICommand.prototype, "run", null);
|
|
66
|
-
//# sourceMappingURL=whoami.js.map
|
|
67
|
-
//# debugId=e882d651-9ed2-57b7-8758-17ac93858321
|
|
64
|
+
//# sourceMappingURL=whoami.js.map
|