@superblocksteam/cli 1.4.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,7 +12,7 @@ $ npm install -g @superblocksteam/cli
12
12
  $ superblocks COMMAND
13
13
  running command...
14
14
  $ superblocks (--version)
15
- @superblocksteam/cli/1.4.1 linux-x64 node-v18.18.2
15
+ @superblocksteam/cli/1.5.0 linux-x64 node-v18.19.1
16
16
  $ superblocks --help [COMMAND]
17
17
  USAGE
18
18
  $ superblocks COMMAND
@@ -7,7 +7,7 @@
7
7
  "lint:fix": "npx eslint . --fix"
8
8
  },
9
9
  "dependencies": {
10
- "@superblocksteam/custom-components": "1.4.1",
10
+ "@superblocksteam/custom-components": "1.5.0",
11
11
  "react": "^18",
12
12
  "react-dom": "^18"
13
13
  },
@@ -156,7 +156,7 @@ class Initialize extends authenticated_command_1.AuthenticatedCommand {
156
156
  subtasks.push({
157
157
  title: `Fetching backend ${resource.name}...`,
158
158
  task: async (_ctx, task) => {
159
- const backend = await this.getSdk().fetchApi(resourceId, ctx.viewMode);
159
+ const backend = await this.getSdk().fetchApi(resourceId, ctx.viewMode, version_control_1.DEFAULT_BRANCH);
160
160
  task.title += `: fetched`;
161
161
  ctx.writtenResources[resourceId] =
162
162
  await (0, version_control_1.writeResourceToDisk)("BACKEND", resourceId, backend, process.cwd());
@@ -33,16 +33,19 @@ class Login extends core_1.Command {
33
33
  }
34
34
  this.log();
35
35
  try {
36
- const sdk = new sdk_1.SuperblocksSdk(token, superblocksBaseUrl);
36
+ const sdk = new sdk_1.SuperblocksSdk(token, superblocksBaseUrl, this.config.version);
37
37
  const user = await sdk.fetchCurrentUser();
38
38
  await (0, util_1.saveApiToken)(superblocksBaseUrl, token);
39
- this.log((0, colorette_1.green)(`Welcome to the Superblocks 🐨 CLI ${user.name}!`));
39
+ this.log((0, colorette_1.green)(`Welcome to the Superblocks 🐨 CLI ${user.user.name}!`));
40
40
  }
41
41
  catch (error) {
42
42
  if (error.name === util_1.ERROR_FILE_ACCESS) {
43
43
  this.log((0, colorette_1.red)("Could not save token, ensure the Superblocks CLI has access to create folders in your home directory."));
44
44
  return;
45
45
  }
46
+ if (error.message) {
47
+ this.log((0, colorette_1.red)(error.message));
48
+ }
46
49
  this.log((0, colorette_1.red)(`Login failed. Ensure you've copied the correct token from ${superblocksBaseUrl}. If using a different domain, run "superblocks help config set" for configuration options.`));
47
50
  }
48
51
  }
@@ -195,7 +195,7 @@ Would you like to also delete these resources from your filesystem?`,
195
195
  subtasks.push({
196
196
  title: `Fetching backend ${resource.location}...`,
197
197
  task: async (_ctx, task) => {
198
- const backend = await this.getSdk().fetchApi(resourceId, viewMode);
198
+ const backend = await this.getSdk().fetchApi(resourceId, viewMode, branchName);
199
199
  task.title += `: fetched`;
200
200
  ctx.writtenResources[resourceId] =
201
201
  await (0, version_control_1.writeResourceToDisk)("BACKEND", resourceId, backend, superblocksRootPath, resource.location);
@@ -1,6 +1,6 @@
1
1
  import { Command } from "@oclif/core";
2
2
  import { SuperblocksSdk } from "@superblocksteam/sdk";
3
- import { SuperblocksApplicationConfig, ComponentEvent, SuperblocksResourceType } from "@superblocksteam/util";
3
+ import { ComponentEvent, SuperblocksApplicationConfig, SuperblocksResourceType } from "@superblocksteam/util";
4
4
  export declare abstract class AuthenticatedCommand extends Command {
5
5
  private sdk;
6
6
  protected init(): Promise<void>;
@@ -20,5 +20,5 @@ export declare abstract class AuthenticatedApplicationCommand extends Authentica
20
20
  branchName: string | null;
21
21
  localBranchName: string | null;
22
22
  }>;
23
- protected registerComponents(injectedHeaders?: Record<string, string>): Promise<Record<string, any> | undefined>;
23
+ protected registerComponents(injectedHeaders: Record<string, string>): Promise<Record<string, any> | undefined>;
24
24
  }
@@ -21,7 +21,7 @@ class AuthenticatedCommand extends core_1.Command {
21
21
  throw new Error();
22
22
  }
23
23
  const { token, superblocksBaseUrl } = result;
24
- this.sdk = new sdk_1.SuperblocksSdk(token, superblocksBaseUrl);
24
+ this.sdk = new sdk_1.SuperblocksSdk(token, superblocksBaseUrl, this.config.version);
25
25
  await this.runAutomatedDotfileUpdates();
26
26
  }
27
27
  catch (e) {
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.4.1",
2
+ "version": "1.5.0",
3
3
  "commands": {
4
4
  "init": {
5
5
  "id": "init",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superblocksteam/cli",
3
- "version": "1.4.1",
3
+ "version": "1.5.0",
4
4
  "description": "Official Superblocks CLI",
5
5
  "bin": {
6
6
  "superblocks": "bin/run"
@@ -18,11 +18,11 @@
18
18
  "@oclif/core": "^2.11.7",
19
19
  "@oclif/plugin-help": "^5.2.16",
20
20
  "@oclif/plugin-plugins": "^3.1.10",
21
- "@superblocksteam/css-plugin": "1.4.1",
22
- "@superblocksteam/react-shim": "1.4.1",
23
- "@superblocksteam/sdk": "1.4.1",
24
- "@superblocksteam/util": "1.4.1",
25
- "@superblocksteam/vite-custom-component-reload-plugin": "1.4.1",
21
+ "@superblocksteam/css-plugin": "1.5.0",
22
+ "@superblocksteam/react-shim": "1.5.0",
23
+ "@superblocksteam/sdk": "1.5.0",
24
+ "@superblocksteam/util": "1.5.0",
25
+ "@superblocksteam/vite-custom-component-reload-plugin": "1.5.0",
26
26
  "@vitejs/plugin-react": "^4.1.0",
27
27
  "colorette": "^2.0.19",
28
28
  "enquirer": "^2.3.6",