@supernovaio/cli 0.9.22 → 0.9.24
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.
|
@@ -8,6 +8,7 @@ interface SyncDesignTokensFlags {
|
|
|
8
8
|
configFilePath: string;
|
|
9
9
|
dev: boolean;
|
|
10
10
|
dry: boolean;
|
|
11
|
+
apiUrl?: string;
|
|
11
12
|
}
|
|
12
13
|
/** Command that handles synchronization with design tokens plugin */
|
|
13
14
|
export declare class SyncDesignTokens extends Command {
|
|
@@ -22,6 +23,7 @@ export declare class SyncDesignTokens extends Command {
|
|
|
22
23
|
configFilePath: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
23
24
|
dev: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
24
25
|
dry: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
26
|
+
apiUrl: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
25
27
|
};
|
|
26
28
|
static args: never[];
|
|
27
29
|
run(): Promise<void>;
|
|
@@ -51,7 +51,8 @@ class SyncDesignTokens extends core_1.Command {
|
|
|
51
51
|
}
|
|
52
52
|
// Create instance for prod / dev
|
|
53
53
|
const devAPIhost = "https://dev.api2.supernova.io/api";
|
|
54
|
-
|
|
54
|
+
const apiUrl = flags.apiUrl && flags.apiUrl.length > 0 ? flags.apiUrl : flags.dev ? devAPIhost : null;
|
|
55
|
+
let sdkInstance = new supernova_sdk_1.Supernova(flags.apiKey, apiUrl, null);
|
|
55
56
|
let designSystem = await sdkInstance.designSystem(flags.designSystemId);
|
|
56
57
|
if (!designSystem) {
|
|
57
58
|
throw new Error(`Design system ${flags.designSystemId} not found or not available under provided API key`);
|
|
@@ -96,6 +97,7 @@ SyncDesignTokens.flags = {
|
|
|
96
97
|
hidden: false,
|
|
97
98
|
default: false,
|
|
98
99
|
}),
|
|
100
|
+
apiUrl: core_1.Flags.string({ description: "API url to use for accessing Supernova instance, would ignore defaults", hidden: true }),
|
|
99
101
|
};
|
|
100
102
|
// Required and optional attributes
|
|
101
103
|
SyncDesignTokens.args = [];
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.9.
|
|
1
|
+
{"version":"0.9.24","commands":{"describe-design-system":{"id":"describe-design-system","description":"Describe structure of single design system by provided ID","strict":true,"pluginName":"@supernovaio/cli","pluginAlias":"@supernovaio/cli","pluginType":"core","aliases":[],"examples":["$ @supernovaio/cli describe-design-system --apiKey=\"{xxx-xxx-xxx}\" --designSystemId=\"{1234}\""],"flags":{"apiKey":{"name":"apiKey","type":"option","description":"API key to use for accessing Supernova instance","required":true,"multiple":false},"designSystemId":{"name":"designSystemId","type":"option","description":"Design System to describe structure of","required":true,"multiple":false},"dev":{"name":"dev","type":"boolean","description":"When enabled, CLI will target dev server","hidden":true,"allowNo":false}},"args":[],"_globalFlags":{}},"describe-workspaces":{"id":"describe-workspaces","description":"Describe structure of all workspaces and design systems available under those workspaces available for specified API key","strict":true,"pluginName":"@supernovaio/cli","pluginAlias":"@supernovaio/cli","pluginType":"core","aliases":[],"examples":["$ @supernovaio/cli describe-workspaces --apiKey=\"{xxx-xxx-xxx}\""],"flags":{"apiKey":{"name":"apiKey","type":"option","description":"API key to use for accessing Supernova instance","required":true,"multiple":false},"dev":{"name":"dev","type":"boolean","description":"When enabled, CLI will target dev server","hidden":true,"allowNo":false}},"args":[],"_globalFlags":{}},"publish-documentation":{"id":"publish-documentation","description":"Publish latest version of the documentation","strict":true,"pluginName":"@supernovaio/cli","pluginAlias":"@supernovaio/cli","pluginType":"core","aliases":[],"examples":["$ @supernovaio/cli publish-documentation --apiKey=\"{xxx-xxx-xxx}\" --designSystemId=\"{1234}\""],"flags":{"apiKey":{"name":"apiKey","type":"option","description":"API key to use for accessing Supernova instance","required":true,"multiple":false},"designSystemId":{"name":"designSystemId","type":"option","description":"Design System to publish the documentation","required":true,"multiple":false},"dev":{"name":"dev","type":"boolean","description":"When enabled, CLI will target dev server","hidden":true,"allowNo":false}},"args":[],"_globalFlags":{}},"sync-tokens":{"id":"sync-tokens","description":"Synchronize tokens from Figma Tokens plugin to Supernova workspaces","strict":true,"pluginName":"@supernovaio/cli","pluginAlias":"@supernovaio/cli","pluginType":"core","aliases":[],"examples":["$ @supernovaio/cli sync-tokens --apiKey=\"{xxx-xxx-xxx}\" --designSystemId={1234} --tokenFilePath \"/path/to/tokens.json\" --configFilePath \"/path/to/config.json\"","$ @supernovaio/cli sync-tokens --apiKey=\"{xxx-xxx-xxx}\" --designSystemId={1234} --tokenDirPath \"/path/to/tokens/\" --configFilePath \"/path/to/config.json\""],"flags":{"apiKey":{"name":"apiKey","type":"option","description":"API key to use for accessing Supernova instance","required":true,"multiple":false},"designSystemId":{"name":"designSystemId","type":"option","description":"Design System to synchronize contents with","required":true,"multiple":false},"tokenFilePath":{"name":"tokenFilePath","type":"option","description":"Path to JSON file containing token definitions","multiple":false},"tokenDirPath":{"name":"tokenDirPath","type":"option","description":"Path to directory of JSON files containing token definitions","multiple":false},"configFilePath":{"name":"configFilePath","type":"option","description":"Path to configuration JSON file","required":true,"multiple":false,"exclusive":[]},"dev":{"name":"dev","type":"boolean","description":"When enabled, CLI will target dev server","hidden":true,"allowNo":false},"dry":{"name":"dry","type":"boolean","description":"When enabled, dry run will be performed and tokens won't write into workspace. This settings overrides settings inside configuration files.","hidden":false,"allowNo":false},"apiUrl":{"name":"apiUrl","type":"option","description":"API url to use for accessing Supernova instance, would ignore defaults","hidden":true,"multiple":false}},"args":[],"_globalFlags":{}}}}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supernovaio/cli",
|
|
3
3
|
"description": "Supernova.io Command Line Interface",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.24",
|
|
5
5
|
"author": "Supernova.io",
|
|
6
6
|
"homepage": "https://supernova.io/",
|
|
7
7
|
"keywords": [
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@oclif/core": "^1",
|
|
26
26
|
"@oclif/plugin-help": "^5",
|
|
27
27
|
"@oclif/plugin-plugins": "^2.0.1",
|
|
28
|
-
"@supernovaio/supernova-sdk": "1.8.
|
|
28
|
+
"@supernovaio/supernova-sdk": "1.8.76",
|
|
29
29
|
"chalk": "^5.0.1",
|
|
30
30
|
"node-fetch": "^3.2.4",
|
|
31
31
|
"dotenv": "^16.0.0"
|