@supernovaio/cli 2.0.38 → 2.0.39

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.
Files changed (43) hide show
  1. package/README.md +1 -0
  2. package/dist/commands/analyze/adoption.d.ts +15 -0
  3. package/dist/commands/analyze/adoption.d.ts.map +1 -0
  4. package/dist/commands/analyze/adoption.js +34 -0
  5. package/dist/commands/analyze/adoption.js.map +1 -0
  6. package/dist/commands/analyze/components.d.ts +15 -0
  7. package/dist/commands/analyze/components.d.ts.map +1 -0
  8. package/dist/commands/analyze/components.js +34 -0
  9. package/dist/commands/analyze/components.js.map +1 -0
  10. package/dist/commands/analyze/status.d.ts +24 -0
  11. package/dist/commands/analyze/status.d.ts.map +1 -0
  12. package/dist/commands/analyze/status.js +54 -0
  13. package/dist/commands/analyze/status.js.map +1 -0
  14. package/dist/commands/analyze.d.ts +15 -0
  15. package/dist/commands/analyze.d.ts.map +1 -0
  16. package/dist/commands/analyze.js +34 -0
  17. package/dist/commands/analyze.js.map +1 -0
  18. package/dist/commands/components-import.d.ts +3 -3
  19. package/dist/commands/components-import.d.ts.map +1 -1
  20. package/dist/commands/components-import.js +8 -2
  21. package/dist/commands/components-import.js.map +1 -1
  22. package/dist/types/config.d.ts +36 -0
  23. package/dist/types/config.d.ts.map +1 -1
  24. package/dist/types/config.js +9 -2
  25. package/dist/types/config.js.map +1 -1
  26. package/dist/utils/analyze-command.d.ts +42 -0
  27. package/dist/utils/analyze-command.d.ts.map +1 -0
  28. package/dist/utils/analyze-command.js +606 -0
  29. package/dist/utils/analyze-command.js.map +1 -0
  30. package/dist/utils/analyze-status.d.ts +7 -0
  31. package/dist/utils/analyze-status.d.ts.map +1 -0
  32. package/dist/utils/analyze-status.js +94 -0
  33. package/dist/utils/analyze-status.js.map +1 -0
  34. package/dist/utils/config.service.d.ts +1 -2
  35. package/dist/utils/config.service.d.ts.map +1 -1
  36. package/dist/utils/config.service.js +5 -7
  37. package/dist/utils/config.service.js.map +1 -1
  38. package/dist/utils/http-client.d.ts +4 -0
  39. package/dist/utils/http-client.d.ts.map +1 -0
  40. package/dist/utils/http-client.js +18 -0
  41. package/dist/utils/http-client.js.map +1 -0
  42. package/oclif.manifest.json +216 -1
  43. package/package.json +5 -2
package/README.md CHANGED
@@ -205,6 +205,7 @@ See the additional use cases section for more information about available comman
205
205
  Following is the list of use cases for Supernova CLI. We will be adding more over time, stay tuned!
206
206
 
207
207
  - [Host private storybook](./docs/storybook-hosting.md)
208
+ - [Analyze code and push snapshots](./docs/code-analysis.md)
208
209
  - [Synchronize Figma Token Plugin data](./docs/figma-tokens-sync.md)
209
210
  - [List workspaces, design systems, brands and themes](./docs/list-workspaces.md)
210
211
 
@@ -0,0 +1,15 @@
1
+ import { AnalyzeCommandBase } from "../../utils/analyze-command.js";
2
+ export default class AnalyzeAdoption extends AnalyzeCommandBase {
3
+ static hidden: boolean;
4
+ static description: string;
5
+ static examples: string[];
6
+ static flags: {
7
+ designSystemId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ package: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ exclude: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ dryRun: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ noWait: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
+ };
13
+ run(): Promise<void>;
14
+ }
15
+ //# sourceMappingURL=adoption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adoption.d.ts","sourceRoot":"","sources":["../../../src/commands/analyze/adoption.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAgB,MAAM,gCAAgC,CAAA;AAEjF,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,kBAAkB;IAC7D,OAAgB,MAAM,UAAO;IAC7B,OAAgB,WAAW,SAAsE;IACjG,OAAgB,QAAQ,WAGvB;IACD,OAAgB,KAAK;;;;;;MAAe;IAGvB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAIlC"}
@@ -0,0 +1,34 @@
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]="1312306f-3ab0-5d68-a8b3-7bccb1df5b10")}catch(e){}}();
3
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
4
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
6
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
7
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
8
+ };
9
+ var __metadata = (this && this.__metadata) || function (k, v) {
10
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
11
+ };
12
+ import { SentryTraced } from "@sentry/nestjs";
13
+ import { AnalyzeCommandBase, analyzeFlags } from "../../utils/analyze-command.js";
14
+ export default class AnalyzeAdoption extends AnalyzeCommandBase {
15
+ static hidden = true;
16
+ static description = "Analyze package adoption and push adoption snapshots to Supernova";
17
+ static examples = [
18
+ "<%= config.bin %> <%= command.id %> --designSystemId 123 --package @acme/ds",
19
+ "<%= config.bin %> <%= command.id %> --package @acme/ds --dry-run",
20
+ ];
21
+ static flags = analyzeFlags;
22
+ async run() {
23
+ const { flags } = await this.parse(AnalyzeAdoption);
24
+ await this.executeAnalyze(flags, "usage");
25
+ }
26
+ }
27
+ __decorate([
28
+ SentryTraced(),
29
+ __metadata("design:type", Function),
30
+ __metadata("design:paramtypes", []),
31
+ __metadata("design:returntype", Promise)
32
+ ], AnalyzeAdoption.prototype, "run", null);
33
+ //# sourceMappingURL=adoption.js.map
34
+ //# debugId=1312306f-3ab0-5d68-a8b3-7bccb1df5b10
@@ -0,0 +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","debug_id":"1312306f-3ab0-5d68-a8b3-7bccb1df5b10"}
@@ -0,0 +1,15 @@
1
+ import { AnalyzeCommandBase } from "../../utils/analyze-command.js";
2
+ export default class AnalyzeComponents extends AnalyzeCommandBase {
3
+ static hidden: boolean;
4
+ static description: string;
5
+ static examples: string[];
6
+ static flags: {
7
+ designSystemId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ package: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ exclude: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ dryRun: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ noWait: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
+ };
13
+ run(): Promise<void>;
14
+ }
15
+ //# sourceMappingURL=components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/commands/analyze/components.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAgB,MAAM,gCAAgC,CAAA;AAEjF,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,kBAAkB;IAC/D,OAAgB,MAAM,UAAO;IAC7B,OAAgB,WAAW,SAA+E;IAC1G,OAAgB,QAAQ,WAGvB;IACD,OAAgB,KAAK;;;;;;MAAe;IAGvB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAIlC"}
@@ -0,0 +1,34 @@
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]="e15aba56-cfab-5cc4-84bf-1599ee1cfdb8")}catch(e){}}();
3
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
4
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
6
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
7
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
8
+ };
9
+ var __metadata = (this && this.__metadata) || function (k, v) {
10
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
11
+ };
12
+ import { SentryTraced } from "@sentry/nestjs";
13
+ import { AnalyzeCommandBase, analyzeFlags } from "../../utils/analyze-command.js";
14
+ export default class AnalyzeComponents extends AnalyzeCommandBase {
15
+ static hidden = true;
16
+ static description = "Analyze design system components and push component snapshots to Supernova";
17
+ static examples = [
18
+ "<%= config.bin %> <%= command.id %> --designSystemId 123 --package @acme/ds",
19
+ "<%= config.bin %> <%= command.id %> --package @acme/ds --dry-run",
20
+ ];
21
+ static flags = analyzeFlags;
22
+ async run() {
23
+ const { flags } = await this.parse(AnalyzeComponents);
24
+ await this.executeAnalyze(flags, "components");
25
+ }
26
+ }
27
+ __decorate([
28
+ SentryTraced(),
29
+ __metadata("design:type", Function),
30
+ __metadata("design:paramtypes", []),
31
+ __metadata("design:returntype", Promise)
32
+ ], AnalyzeComponents.prototype, "run", null);
33
+ //# sourceMappingURL=components.js.map
34
+ //# debugId=e15aba56-cfab-5cc4-84bf-1599ee1cfdb8
@@ -0,0 +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","debug_id":"e15aba56-cfab-5cc4-84bf-1599ee1cfdb8"}
@@ -0,0 +1,24 @@
1
+ import { z, ZodType } from "zod";
2
+ import { SentryCommand } from "../../types/index.js";
3
+ declare const AnalyzeStatusConfig: z.ZodObject<{
4
+ designSystemId: z.ZodOptional<z.ZodString>;
5
+ }, "strip", z.ZodTypeAny, {
6
+ designSystemId?: string | undefined;
7
+ }, {
8
+ designSystemId?: string | undefined;
9
+ }>;
10
+ type AnalyzeStatusConfig = z.infer<typeof AnalyzeStatusConfig>;
11
+ export default class AnalyzeStatus extends SentryCommand<AnalyzeStatusConfig> {
12
+ static hidden: boolean;
13
+ static args: {};
14
+ static description: string;
15
+ static examples: string[];
16
+ static flags: {
17
+ designSystemId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
+ };
19
+ get commandId(): string;
20
+ get configSchema(): ZodType<AnalyzeStatusConfig>;
21
+ run(): Promise<void>;
22
+ }
23
+ export {};
24
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/commands/analyze/status.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAIpD,QAAA,MAAM,mBAAmB;;;;;;EAEvB,CAAA;AAEF,KAAK,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE9D,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,aAAa,CAAC,mBAAmB,CAAC;IAC3E,OAAgB,MAAM,UAAO;IAC7B,OAAgB,IAAI,KAAK;IACzB,OAAgB,WAAW,SAA0D;IACrF,OAAgB,QAAQ,WAA+D;IACvF,OAAgB,KAAK;;MAEpB;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,YAAY,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAE/C;IAGY,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAYlC"}
@@ -0,0 +1,54 @@
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]="9b414a25-ffd6-56d4-9196-e9ef1b31464d")}catch(e){}}();
3
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
4
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
6
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
7
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
8
+ };
9
+ var __metadata = (this && this.__metadata) || function (k, v) {
10
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
11
+ };
12
+ import { Flags } from "@oclif/core";
13
+ import { SentryTraced } from "@sentry/nestjs";
14
+ import { z } from "zod";
15
+ import { SentryCommand } from "../../types/index.js";
16
+ import { watchAnalyzeStatus } from "../../utils/analyze-status.js";
17
+ import { createApiClient } from "../../utils/http-client.js";
18
+ const AnalyzeStatusConfig = z.object({
19
+ designSystemId: z.string().optional(),
20
+ });
21
+ export default class AnalyzeStatus extends SentryCommand {
22
+ static hidden = true;
23
+ static args = {};
24
+ static description = "Show code snapshot processing status for current user";
25
+ static examples = ["<%= config.bin %> <%= command.id %> --designSystemId 123"];
26
+ static flags = {
27
+ designSystemId: Flags.string({ char: "d", description: "Design system ID" }),
28
+ };
29
+ get commandId() {
30
+ return AnalyzeStatus.id;
31
+ }
32
+ get configSchema() {
33
+ return AnalyzeStatusConfig;
34
+ }
35
+ async run() {
36
+ const { flags } = await this.parse(AnalyzeStatus);
37
+ const config = this.configService.get();
38
+ const designSystemId = flags.designSystemId ?? config?.designSystemId ?? (await this.promptDesignSystemId());
39
+ const apiClient = await createApiClient(this.env);
40
+ await watchAnalyzeStatus({
41
+ apiClient,
42
+ designSystemId,
43
+ error: message => this.error(message),
44
+ });
45
+ }
46
+ }
47
+ __decorate([
48
+ SentryTraced(),
49
+ __metadata("design:type", Function),
50
+ __metadata("design:paramtypes", []),
51
+ __metadata("design:returntype", Promise)
52
+ ], AnalyzeStatus.prototype, "run", null);
53
+ //# sourceMappingURL=status.js.map
54
+ //# debugId=9b414a25-ffd6-56d4-9196-e9ef1b31464d
@@ -0,0 +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;A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196-e9ef1b31464d"}
@@ -0,0 +1,15 @@
1
+ import { AnalyzeCommandBase } from "../utils/analyze-command.js";
2
+ export default class Analyze extends AnalyzeCommandBase {
3
+ static hidden: boolean;
4
+ static description: string;
5
+ static examples: string[];
6
+ static flags: {
7
+ designSystemId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ package: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ exclude: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ dryRun: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ noWait: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
+ };
13
+ run(): Promise<void>;
14
+ }
15
+ //# sourceMappingURL=analyze.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../src/commands/analyze.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAgB,MAAM,6BAA6B,CAAA;AAE9E,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,kBAAkB;IACrD,OAAgB,MAAM,UAAO;IAC7B,OAAgB,WAAW,SAA0E;IACrG,OAAgB,QAAQ,WAGvB;IACD,OAAgB,KAAK;;;;;;MAAe;IAGvB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAIlC"}
@@ -0,0 +1,34 @@
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]="72f138af-8f7b-5b85-8570-234d6a37d37d")}catch(e){}}();
3
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
4
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
6
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
7
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
8
+ };
9
+ var __metadata = (this && this.__metadata) || function (k, v) {
10
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
11
+ };
12
+ import { SentryTraced } from "@sentry/nestjs";
13
+ import { AnalyzeCommandBase, analyzeFlags } from "../utils/analyze-command.js";
14
+ export default class Analyze extends AnalyzeCommandBase {
15
+ static hidden = true;
16
+ static description = "Analyze components and adoption, then push all snapshots to Supernova";
17
+ static examples = [
18
+ "<%= config.bin %> <%= command.id %> --designSystemId 123 --package @acme/ds",
19
+ "<%= config.bin %> <%= command.id %> --package @acme/ds --package @acme/icons",
20
+ ];
21
+ static flags = analyzeFlags;
22
+ async run() {
23
+ const { flags } = await this.parse(Analyze);
24
+ await this.executeAnalyze(flags, "all");
25
+ }
26
+ }
27
+ __decorate([
28
+ SentryTraced(),
29
+ __metadata("design:type", Function),
30
+ __metadata("design:paramtypes", []),
31
+ __metadata("design:returntype", Promise)
32
+ ], Analyze.prototype, "run", null);
33
+ //# sourceMappingURL=analyze.js.map
34
+ //# debugId=72f138af-8f7b-5b85-8570-234d6a37d37d
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyze.js","sources":["../../src/commands/analyze.ts"],"sourceRoot":"","sourcesContent":["import { SentryTraced } from \"@sentry/nestjs\"\n\nimport { AnalyzeCommandBase, analyzeFlags } from \"../utils/analyze-command.js\"\n\nexport default class Analyze extends AnalyzeCommandBase {\n static override hidden = true\n static override description = \"Analyze components and adoption, then push all 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 --package @acme/icons\",\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;AAE7C,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAE9E,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,kBAAkB;IACrD,MAAM,CAAU,MAAM,GAAG,IAAI,CAAA;IAC7B,MAAM,CAAU,WAAW,GAAG,uEAAuE,CAAA;IACrG,MAAM,CAAU,QAAQ,GAAG;QACzB,6EAA6E;QAC7E,8EAA8E;KAC/E,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","debug_id":"72f138af-8f7b-5b85-8570-234d6a37d37d"}
@@ -7,13 +7,13 @@ declare const ImportComponentsConfigSchema: z.ZodEffects<z.ZodObject<{
7
7
  versionId: z.ZodString;
8
8
  }, "strip", z.ZodTypeAny, {
9
9
  designSystemId: string;
10
- importFrom: string;
11
10
  rootDir: string;
11
+ importFrom: string;
12
12
  versionId: string;
13
13
  }, {
14
14
  designSystemId: string;
15
- importFrom: string;
16
15
  rootDir: string;
16
+ importFrom: string;
17
17
  versionId: string;
18
18
  }>, {
19
19
  rootDir: string;
@@ -22,8 +22,8 @@ declare const ImportComponentsConfigSchema: z.ZodEffects<z.ZodObject<{
22
22
  versionId: string;
23
23
  }, {
24
24
  designSystemId: string;
25
- importFrom: string;
26
25
  rootDir: string;
26
+ importFrom: string;
27
27
  versionId: string;
28
28
  }>;
29
29
  type ImportComponentsConfig = z.infer<typeof ImportComponentsConfigSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"components-import.d.ts","sourceRoot":"","sources":["../../src/commands/components-import.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,QAAA,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;EAU7B,CAAA;AAEL,KAAK,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AAE1E,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,aAAa,CAAC,sBAAsB,CAAC;IACjF,OAAgB,IAAI,KAAK;IACzB,OAAgB,WAAW,SAA+E;IAC1G,OAAgB,QAAQ,WAGvB;IACD,OAAgB,KAAK;;;;;MAcpB;IACD,OAAgB,MAAM,UAAO;IAE7B,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,YAAY,IAAI,OAAO,CAAC,sBAAsB,CAAC,CAElD;IAGY,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA8ClC"}
1
+ {"version":3,"file":"components-import.d.ts","sourceRoot":"","sources":["../../src/commands/components-import.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,QAAA,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;EAU7B,CAAA;AAEL,KAAK,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AAM1E,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,aAAa,CAAC,sBAAsB,CAAC;IACjF,OAAgB,IAAI,KAAK;IACzB,OAAgB,WAAW,SAA+E;IAC1G,OAAgB,QAAQ,WAGvB;IACD,OAAgB,KAAK;;;;;MAcpB;IACD,OAAgB,MAAM,UAAO;IAE7B,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,YAAY,IAAI,OAAO,CAAC,sBAAsB,CAAC,CAElD;IAGY,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAkDlC"}
@@ -1,5 +1,5 @@
1
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]="c8903c25-f445-5364-bfe9-74efbeac1ceb")}catch(e){}}();
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]="e7b627d2-dc90-561a-907c-4a3200d9df7e")}catch(e){}}();
3
3
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
4
4
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5
5
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -25,6 +25,9 @@ const ImportComponentsConfigSchema = z
25
25
  ...data,
26
26
  rootDir: data.rootDir ?? process.cwd(),
27
27
  }));
28
+ function isComponentsImportDisabled() {
29
+ return true;
30
+ }
28
31
  export default class ImportComponents extends SentryCommand {
29
32
  static args = {};
30
33
  static description = "Analyze react components from given package and import them into Supernova";
@@ -54,6 +57,9 @@ export default class ImportComponents extends SentryCommand {
54
57
  return ImportComponentsConfigSchema;
55
58
  }
56
59
  async run() {
60
+ if (isComponentsImportDisabled()) {
61
+ this.error("Command 'components-import' is temporarily disabled. use 'analyze' instead.");
62
+ }
57
63
  const { flags } = await this.parse(ImportComponents);
58
64
  const { designSystemId, importFrom, rootDir, versionId } = flags;
59
65
  this.log("📦 Component Import Summary");
@@ -99,4 +105,4 @@ __decorate([
99
105
  __metadata("design:returntype", Promise)
100
106
  ], ImportComponents.prototype, "run", null);
101
107
  //# sourceMappingURL=components-import.js.map
102
- //# debugId=c8903c25-f445-5364-bfe9-74efbeac1ceb
108
+ //# debugId=e7b627d2-dc90-561a-907c-4a3200d9df7e
@@ -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 \"@supernovaio/code-analyzer\"\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 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 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,4BAA4B,CAAA;AAC9D,OAAO,EAAE,CA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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;;AA7CY;IADZ,YAAY,EAAE;;;;2CA8Cd","debug_id":"c8903c25-f445-5364-bfe9-74efbeac1ceb"}
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 \"@supernovaio/code-analyzer\"\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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,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","debug_id":"e7b627d2-dc90-561a-907c-4a3200d9df7e"}
@@ -21,7 +21,34 @@ export declare const SupernovaConfigStorybook: z.ZodObject<{
21
21
  from?: unknown;
22
22
  publicAccess?: unknown;
23
23
  }>;
24
+ export declare const SupernovaConfigAnalyze: z.ZodObject<{
25
+ repoId: z.ZodCatch<z.ZodOptional<z.ZodString>>;
26
+ packages: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
27
+ excludedPackages: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
28
+ }, "strip", z.ZodTypeAny, {
29
+ repoId?: string | undefined;
30
+ packages?: string[] | undefined;
31
+ excludedPackages?: string[] | undefined;
32
+ }, {
33
+ repoId?: unknown;
34
+ packages?: unknown;
35
+ excludedPackages?: unknown;
36
+ }>;
24
37
  export declare const SupernovaConfig: z.ZodCatch<z.ZodObject<{
38
+ designSystemId: z.ZodCatch<z.ZodOptional<z.ZodString>>;
39
+ analyze: z.ZodCatch<z.ZodOptional<z.ZodObject<{
40
+ repoId: z.ZodCatch<z.ZodOptional<z.ZodString>>;
41
+ packages: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
42
+ excludedPackages: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
43
+ }, "strip", z.ZodTypeAny, {
44
+ repoId?: string | undefined;
45
+ packages?: string[] | undefined;
46
+ excludedPackages?: string[] | undefined;
47
+ }, {
48
+ repoId?: unknown;
49
+ packages?: unknown;
50
+ excludedPackages?: unknown;
51
+ }>>>;
25
52
  storybook: z.ZodCatch<z.ZodOptional<z.ZodObject<{
26
53
  designSystemId: z.ZodCatch<z.ZodOptional<z.ZodString>>;
27
54
  sourceId: z.ZodCatch<z.ZodOptional<z.ZodString>>;
@@ -45,6 +72,12 @@ export declare const SupernovaConfig: z.ZodCatch<z.ZodObject<{
45
72
  publicAccess?: unknown;
46
73
  }>>>;
47
74
  }, "strip", z.ZodTypeAny, {
75
+ designSystemId?: string | undefined;
76
+ analyze?: {
77
+ repoId?: string | undefined;
78
+ packages?: string[] | undefined;
79
+ excludedPackages?: string[] | undefined;
80
+ } | undefined;
48
81
  storybook?: {
49
82
  designSystemId?: string | undefined;
50
83
  sourceId?: string | undefined;
@@ -54,8 +87,11 @@ export declare const SupernovaConfig: z.ZodCatch<z.ZodObject<{
54
87
  publicAccess?: boolean | undefined;
55
88
  } | undefined;
56
89
  }, {
90
+ designSystemId?: unknown;
91
+ analyze?: unknown;
57
92
  storybook?: unknown;
58
93
  }>>;
94
+ export type SupernovaConfigAnalyze = z.infer<typeof SupernovaConfigAnalyze>;
59
95
  export type SupernovaConfigStorybook = z.infer<typeof SupernovaConfigStorybook>;
60
96
  export type SupernovaConfig = z.infer<typeof SupernovaConfig>;
61
97
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;EAOnC,CAAA;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAIhB,CAAA;AAEZ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAC/E,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;EAOnC,CAAA;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;EAIjC,CAAA;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAMhB,CAAA;AAEZ,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAC3E,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAC/E,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA"}
@@ -1,5 +1,5 @@
1
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]="72ec9ebe-7073-517c-8a21-84e291f3268e")}catch(e){}}();
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]="9b045bdf-c47c-5f62-b737-feb24a9c85bf")}catch(e){}}();
3
3
  import { z } from "zod";
4
4
  const safeString = z.string().optional().catch(undefined);
5
5
  const safeBoolean = z.boolean().optional().catch(undefined);
@@ -11,10 +11,17 @@ export const SupernovaConfigStorybook = z.object({
11
11
  from: safeString,
12
12
  publicAccess: safeBoolean,
13
13
  });
14
+ export const SupernovaConfigAnalyze = z.object({
15
+ repoId: safeString,
16
+ packages: z.array(z.string()).optional().catch(undefined),
17
+ excludedPackages: z.array(z.string()).optional().catch(undefined),
18
+ });
14
19
  export const SupernovaConfig = z
15
20
  .object({
21
+ designSystemId: safeString,
22
+ analyze: SupernovaConfigAnalyze.optional().catch(undefined),
16
23
  storybook: SupernovaConfigStorybook.optional().catch(undefined),
17
24
  })
18
25
  .catch({});
19
26
  //# sourceMappingURL=config.js.map
20
- //# debugId=72ec9ebe-7073-517c-8a21-84e291f3268e
27
+ //# debugId=9b045bdf-c47c-5f62-b737-feb24a9c85bf
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sources":["../../src/types/config.ts"],"sourceRoot":"","sourcesContent":["import { z } from \"zod\"\n\nconst safeString = z.string().optional().catch(undefined)\nconst safeBoolean = z.boolean().optional().catch(undefined)\n\nexport const SupernovaConfigStorybook = z.object({\n designSystemId: safeString,\n sourceId: safeString,\n brandId: safeString,\n name: safeString,\n from: safeString,\n publicAccess: safeBoolean,\n})\n\nexport const SupernovaConfig = z\n .object({\n storybook: SupernovaConfigStorybook.optional().catch(undefined),\n })\n .catch({})\n\nexport type SupernovaConfigStorybook = z.infer<typeof SupernovaConfigStorybook>\nexport type SupernovaConfig = z.infer<typeof SupernovaConfig>\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;AACzD,MAAM,WAAW,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;AAE3D,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,cAAc,EAAE,UAAU;IAC1B,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,UAAU;IACnB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;IAChB,YAAY,EAAE,WAAW;CAC1B,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC;KAC7B,MAAM,CAAC;IACN,SAAS,EAAE,wBAAwB,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC;CAChE,CAAC;KACD,KAAK,CAAC,EAAE,CAAC,CAAA","debug_id":"72ec9ebe-7073-517c-8a21-84e291f3268e"}
1
+ {"version":3,"file":"config.js","sources":["../../src/types/config.ts"],"sourceRoot":"","sourcesContent":["import { z } from \"zod\"\n\nconst safeString = z.string().optional().catch(undefined)\nconst safeBoolean = z.boolean().optional().catch(undefined)\n\nexport const SupernovaConfigStorybook = z.object({\n designSystemId: safeString,\n sourceId: safeString,\n brandId: safeString,\n name: safeString,\n from: safeString,\n publicAccess: safeBoolean,\n})\n\nexport const SupernovaConfigAnalyze = z.object({\n repoId: safeString,\n packages: z.array(z.string()).optional().catch(undefined),\n excludedPackages: z.array(z.string()).optional().catch(undefined),\n})\n\nexport const SupernovaConfig = z\n .object({\n designSystemId: safeString,\n analyze: SupernovaConfigAnalyze.optional().catch(undefined),\n storybook: SupernovaConfigStorybook.optional().catch(undefined),\n })\n .catch({})\n\nexport type SupernovaConfigAnalyze = z.infer<typeof SupernovaConfigAnalyze>\nexport type SupernovaConfigStorybook = z.infer<typeof SupernovaConfigStorybook>\nexport type SupernovaConfig = z.infer<typeof SupernovaConfig>\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KA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ZodObject<{
4
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
5
+ designSystemId: z.ZodOptional<z.ZodString>;
6
+ package: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
7
+ dryRun: z.ZodOptional<z.ZodBoolean>;
8
+ noWait: z.ZodOptional<z.ZodBoolean>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ designSystemId?: string | undefined;
11
+ exclude?: string[] | undefined;
12
+ package?: string | string[] | undefined;
13
+ dryRun?: boolean | undefined;
14
+ noWait?: boolean | undefined;
15
+ }, {
16
+ designSystemId?: string | undefined;
17
+ exclude?: string[] | undefined;
18
+ package?: string | string[] | undefined;
19
+ dryRun?: boolean | undefined;
20
+ noWait?: boolean | undefined;
21
+ }>;
22
+ export type AnalyzeCommandConfig = z.infer<typeof AnalyzeCommandConfigSchema>;
23
+ export type ScannerType = "all" | "components" | "usage";
24
+ export declare const analyzeFlags: {
25
+ designSystemId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
26
+ package: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
27
+ exclude: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
28
+ dryRun: import("@oclif/core/interfaces").BooleanFlag<boolean>;
29
+ noWait: import("@oclif/core/interfaces").BooleanFlag<boolean>;
30
+ };
31
+ export declare abstract class AnalyzeCommandBase extends SentryCommand<AnalyzeCommandConfig> {
32
+ get commandId(): string;
33
+ get configSchema(): ZodType<AnalyzeCommandConfig>;
34
+ protected executeAnalyze(flags: AnalyzeCommandConfig, scannerType: ScannerType): Promise<void>;
35
+ private logPhase;
36
+ private persistAnalyzeConfig;
37
+ private uploadSnapshot;
38
+ private startProcessingRun;
39
+ private createArchiveFromSnapshotRoot;
40
+ private logHttpError;
41
+ }
42
+ //# sourceMappingURL=analyze-command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyze-command.d.ts","sourceRoot":"","sources":["../../src/utils/analyze-command.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAKjD,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;EAMrC,CAAA;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAC7E,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,YAAY,GAAG,OAAO,CAAA;AAwDxD,eAAO,MAAM,YAAY;;;;;;CAmBxB,CAAA;AAED,8BAAsB,kBAAmB,SAAQ,aAAa,CAAC,oBAAoB,CAAC;IAClF,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,YAAY,IAAI,OAAO,CAAC,oBAAoB,CAAC,CAEhD;cAEe,cAAc,CAAC,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAmOpG,OAAO,CAAC,QAAQ;IAKhB,OAAO,CAAC,oBAAoB;YAoBd,cAAc;YAkFd,kBAAkB;YAuBlB,6BAA6B;IAgB3C,OAAO,CAAC,YAAY;CAWrB"}