@superblocksteam/cli 1.9.3 → 1.12.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.
Files changed (59) hide show
  1. package/LICENSE.txt +87 -0
  2. package/README.md +6 -6
  3. package/assets/custom-components/setup/package.json +1 -1
  4. package/assets/custom-components/setup/tsconfig.json +0 -1
  5. package/assets/injectedReactShim17.jsx +15 -0
  6. package/assets/injectedReactShim18.jsx +16 -0
  7. package/assets/injectedReactShimShared.jsx +140 -0
  8. package/bin/dev +5 -7
  9. package/bin/run +1 -3
  10. package/dist/appendHotReloadEventPlugin.d.mts +2 -0
  11. package/dist/appendHotReloadEventPlugin.mjs +43 -0
  12. package/dist/commands/commits.d.mts +18 -0
  13. package/dist/commands/{commits.js → commits.mjs} +59 -67
  14. package/dist/commands/components/{create.d.ts → create.d.mts} +2 -2
  15. package/dist/commands/components/{create.js → create.mjs} +84 -93
  16. package/dist/commands/components/{register.d.ts → register.d.mts} +1 -1
  17. package/dist/commands/components/register.mjs +12 -0
  18. package/dist/commands/components/{upload.d.ts → upload.d.mts} +2 -2
  19. package/dist/commands/components/{upload.js → upload.mjs} +39 -43
  20. package/dist/commands/components/{watch.d.ts → watch.d.mts} +1 -1
  21. package/dist/commands/components/{watch.js → watch.mjs} +29 -36
  22. package/dist/commands/config/{set.d.ts → set.d.mts} +2 -2
  23. package/dist/commands/config/{set.js → set.mjs} +28 -32
  24. package/dist/commands/{init.d.ts → init.d.mts} +4 -4
  25. package/dist/commands/{init.js → init.mjs} +63 -65
  26. package/dist/commands/{login.d.ts → login.d.mts} +1 -1
  27. package/dist/commands/login.mjs +55 -0
  28. package/dist/commands/{migrate.d.ts → migrate.d.mts} +1 -1
  29. package/dist/commands/{migrate.js → migrate.mjs} +38 -46
  30. package/dist/commands/pull.d.mts +17 -0
  31. package/dist/commands/{pull.js → pull.mjs} +74 -80
  32. package/dist/commands/push.d.mts +15 -0
  33. package/dist/commands/{push.js → push.mjs} +81 -90
  34. package/dist/commands/{rm.d.ts → rm.d.mts} +2 -2
  35. package/dist/commands/{rm.js → rm.mjs} +34 -40
  36. package/dist/common/{authenticated-command.js → authenticated-command.mjs} +65 -75
  37. package/dist/common/defaults/{create-component-defaults.js → create-component-defaults.mjs} +2 -7
  38. package/dist/common/{version-control.d.ts → version-control.d.mts} +13 -6
  39. package/dist/common/version-control.mjs +1064 -0
  40. package/dist/index.js +1 -5
  41. package/dist/productionCssPlugin.d.mts +2 -0
  42. package/dist/productionCssPlugin.mjs +50 -0
  43. package/dist/reactShimPlugin.d.mts +2 -0
  44. package/dist/reactShimPlugin.mjs +127 -0
  45. package/dist/util/migrationWarningsForApplications.mjs +47 -0
  46. package/dist/util/{migrationsForDotfiles.js → migrationsForDotfiles.mjs} +10 -17
  47. package/oclif.manifest.json +274 -161
  48. package/package.json +45 -45
  49. package/dist/commands/commits.d.ts +0 -18
  50. package/dist/commands/components/register.js +0 -15
  51. package/dist/commands/login.js +0 -61
  52. package/dist/commands/pull.d.ts +0 -17
  53. package/dist/commands/push.d.ts +0 -15
  54. package/dist/common/version-control.js +0 -716
  55. package/dist/util/migrationWarningsForApplications.js +0 -52
  56. /package/dist/common/{authenticated-command.d.ts → authenticated-command.d.mts} +0 -0
  57. /package/dist/common/defaults/{create-component-defaults.d.ts → create-component-defaults.d.mts} +0 -0
  58. /package/dist/util/{migrationWarningsForApplications.d.ts → migrationWarningsForApplications.d.mts} +0 -0
  59. /package/dist/util/{migrationsForDotfiles.d.ts → migrationsForDotfiles.d.mts} +0 -0
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@superblocksteam/cli",
3
- "version": "1.9.3",
3
+ "version": "1.12.0",
4
4
  "description": "Official Superblocks CLI",
5
5
  "bin": {
6
- "superblocks": "bin/run"
6
+ "superblocks": "./bin/run"
7
7
  },
8
8
  "homepage": "https://www.superblocks.com",
9
9
  "license": "Superblocks Community Software License",
@@ -15,67 +15,54 @@
15
15
  "/oclif.manifest.json"
16
16
  ],
17
17
  "dependencies": {
18
- "@oclif/core": "^2.11.7",
19
- "@oclif/plugin-help": "^5.2.16",
20
- "@oclif/plugin-plugins": "^3.1.10",
21
- "@superblocksteam/css-plugin": "1.9.3",
22
- "@superblocksteam/react-shim": "1.9.3",
23
- "@superblocksteam/sdk": "1.9.3",
24
- "@superblocksteam/util": "1.9.3",
25
- "@superblocksteam/vite-custom-component-reload-plugin": "1.9.3",
26
- "@vitejs/plugin-react": "^4.1.0",
27
- "colorette": "^2.0.19",
28
- "enquirer": "^2.3.6",
18
+ "@oclif/core": "^4.2.8",
19
+ "@oclif/plugin-help": "^6.2.26",
20
+ "@vitejs/plugin-react": "^4.3.4",
21
+ "axios": "^1.4.0",
22
+ "colorette": "^2.0.20",
23
+ "enquirer": "^2.4.1",
29
24
  "fs-extra": "^11.1.1",
30
25
  "listr2": "6.6.0",
31
- "lodash": "^4.17.21",
26
+ "lodash-es": "^4.17.21",
32
27
  "semver": "^7.5.4",
33
28
  "simple-git": "^3.20.0",
34
29
  "slugify": "^1.6.6",
35
- "vite": "^4.4.8",
36
- "vite-plugin-inspect": "^0.7.28",
37
- "yaml": "2.3.1"
30
+ "vite": "^6.2.0",
31
+ "yaml": "^2.6.1",
32
+ "@superblocksteam/sdk": "1.12.0",
33
+ "@superblocksteam/util": "1.12.0"
38
34
  },
39
35
  "devDependencies": {
40
- "@oclif/test": "^2.4.4",
36
+ "@oclif/test": "^4.1.11",
41
37
  "@types/babel__core": "^7.20.0",
42
38
  "@types/chai": "^4",
43
39
  "@types/fs-extra": "^11.0.1",
40
+ "@types/lodash-es": "^4.17.12",
44
41
  "@types/mocha": "^9.0.0",
45
42
  "@types/node": "^20.17.0",
46
- "@typescript-eslint/eslint-plugin": "^5.60.1",
47
- "@typescript-eslint/parser": "^5.60.1",
43
+ "@types/semver": "^7.5.8",
44
+ "@typescript-eslint/eslint-plugin": "^8.25.0",
45
+ "@typescript-eslint/parser": "^8.25.0",
48
46
  "chai": "^4",
49
- "eslint": "^8.48.0",
50
- "eslint-config-prettier": "8.8.0",
51
- "eslint-plugin-import": "2.27.5",
52
- "eslint-plugin-prettier": "4.2.1",
47
+ "eslint": "^9.21.0",
48
+ "eslint-config-prettier": "10.0.2",
49
+ "eslint-plugin-import": "2.31.0",
50
+ "eslint-plugin-mocha": "^10.5.0",
51
+ "eslint-plugin-prettier": "5.2.3",
53
52
  "eslint-plugin-unicorn": "^47.0.0",
53
+ "globals": "^15.9.0",
54
54
  "mocha": "^9",
55
- "oclif": "^3.11.3",
56
- "prettier": "^2.8.8",
55
+ "oclif": "^4.17.32",
56
+ "prettier": "^3.5.2",
57
57
  "shx": "^0.3.3",
58
58
  "ts-node": "^10.9.1",
59
- "tslib": "^2.5.0",
60
- "typescript": "^5.1.6"
61
- },
62
- "scripts": {
63
- "preinstall": "node -e \"if (process.versions.node.split('.')[0] < 16) { console.error('Incompatible Node version: Please use Node.js v16 or higher'); process.exit(1);}\"",
64
- "build": "tsc --build",
65
- "clean": "npm run clean:build && rm -rf node_modules",
66
- "clean:build": "tsc --build --clean && rm -rf dist tsconfig.tsbuildinfo",
67
- "lint": "eslint . --ext .ts --config .eslintrc.json",
68
- "lint:fix": "eslint . --ext .ts --config .eslintrc.json --fix",
69
- "postpack": "shx rm -f oclif.manifest.json",
70
- "posttest": "npm run lint",
71
- "prepack": "npm run build && oclif manifest && oclif readme",
72
- "test": "mocha --forbid-only \"test/**/*.test.ts\"",
73
- "typecheck": "tsc --noEmit",
74
- "update-readme": "oclif readme"
59
+ "tslib": "^2.8.0",
60
+ "typescript": "^5.7.0",
61
+ "vite-plugin-inspect": "^11.0.0"
75
62
  },
76
63
  "engines": {
77
- "node": ">=16.0.0",
78
- "npm": ">=8.0.0"
64
+ "node": ">=20.0.0",
65
+ "npm": ">=9.0.0"
79
66
  },
80
67
  "keywords": [
81
68
  "oclif"
@@ -100,5 +87,18 @@
100
87
  "description": "Manage Superblocks configuration"
101
88
  }
102
89
  }
90
+ },
91
+ "scripts": {
92
+ "preinstall": "node -e \"if (process.versions.node.split('.')[0] < 20) { console.error('Incompatible Node version: Please use Node.js v20 or higher'); process.exit(1);}\"",
93
+ "build": "tsc --build",
94
+ "clean": "npm run clean:build && rm -rf node_modules",
95
+ "clean:build": "rm -rf dist tsconfig.tsbuildinfo",
96
+ "lint": "eslint .",
97
+ "lint:fix": "eslint . --fix",
98
+ "check": "pnpm run lint && pnpm run typecheck",
99
+ "posttest": "npm run lint",
100
+ "test": "NODE_OPTIONS='--loader ts-node/esm' mocha --forbid-only \"test/**/*.test.*ts\"",
101
+ "typecheck": "tsc --noEmit",
102
+ "update-readme": "oclif readme"
103
103
  }
104
- }
104
+ }
@@ -1,18 +0,0 @@
1
- import { GetCommitsResponseBody } from "@superblocksteam/sdk";
2
- import { AuthenticatedCommand } from "../common/authenticated-command";
3
- export default class Commits extends AuthenticatedCommand {
4
- static description: string;
5
- static examples: string[];
6
- static flags: {
7
- branch: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
8
- limit: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
- offset: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
10
- };
11
- static args: {
12
- resource_path: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
13
- };
14
- run(): Promise<void>;
15
- private createTasks;
16
- private getResourceIdToShowCommits;
17
- printCommits(commits: GetCommitsResponseBody, branch?: string): void;
18
- }
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const util_1 = require("@superblocksteam/util");
4
- const authenticated_command_1 = require("../../common/authenticated-command");
5
- class Register extends authenticated_command_1.AuthenticatedApplicationCommand {
6
- async run() {
7
- const headers = {
8
- [util_1.COMPONENT_EVENT_HEADER]: util_1.ComponentEvent.REGISTER,
9
- };
10
- await this.registerComponents(headers);
11
- }
12
- }
13
- Register.description = "Registers all local component config files";
14
- Register.examples = ["superblocks components register"];
15
- exports.default = Register;
@@ -1,61 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const core_1 = require("@oclif/core");
4
- const sdk_1 = require("@superblocksteam/sdk");
5
- const util_1 = require("@superblocksteam/util");
6
- const colorette_1 = require("colorette");
7
- const enquirer_1 = require("enquirer");
8
- const lodash_1 = require("lodash");
9
- class Login extends core_1.Command {
10
- constructor() {
11
- super(...arguments);
12
- this.DEFAULT_BASE_URL = "https://app.superblocks.com/";
13
- }
14
- async run() {
15
- var _a;
16
- const { flags } = await this.parse(Login);
17
- let token = flags.token;
18
- const result = await (0, util_1.getLocalTokenWithUrlIfExists)();
19
- const superblocksBaseUrl = (_a = result === null || result === void 0 ? void 0 : result.superblocksBaseUrl) !== null && _a !== void 0 ? _a : this.DEFAULT_BASE_URL;
20
- if (!token) {
21
- if (result && "token" in result) {
22
- token = result.token;
23
- }
24
- else {
25
- const tokenPageUrl = new URL("personal-settings#apiKey", superblocksBaseUrl).href;
26
- token = (await (0, enquirer_1.prompt)({
27
- type: "password",
28
- name: "token",
29
- message: `Enter your Superblocks API key (then press Enter) which can be found at ${tokenPageUrl}`,
30
- validate: (response) => !(0, lodash_1.isEmpty)(response.trim()),
31
- })).token;
32
- }
33
- }
34
- this.log();
35
- try {
36
- const sdk = new sdk_1.SuperblocksSdk(token, superblocksBaseUrl, this.config.version);
37
- const user = await sdk.fetchCurrentUser();
38
- await (0, util_1.saveApiToken)(superblocksBaseUrl, token);
39
- this.log((0, colorette_1.green)(`Welcome to the Superblocks 🐨 CLI ${user.user.name}!`));
40
- }
41
- catch (error) {
42
- if (error instanceof util_1.FileAccessError) {
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
- return;
45
- }
46
- if (error.message) {
47
- this.log((0, colorette_1.red)(error.message));
48
- }
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.`));
50
- }
51
- }
52
- }
53
- Login.description = "Authenticate with Superblocks cloud";
54
- Login.flags = {
55
- // flag with a value (-t, --token=VALUE)
56
- token: core_1.Flags.string({
57
- char: "t",
58
- description: "Superblocks user API key",
59
- }),
60
- };
61
- exports.default = Login;
@@ -1,17 +0,0 @@
1
- import { AuthenticatedCommand } from "../common/authenticated-command";
2
- export default class Pull extends AuthenticatedCommand {
3
- static description: string;
4
- static examples: string[];
5
- static flags: {
6
- mode: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
7
- branch: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
8
- "commit-id": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
- "skip-signing-verification": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
- };
11
- static args: {
12
- resource_path: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
13
- };
14
- run(): Promise<void>;
15
- private createTasks;
16
- private getResourceIdsToPull;
17
- }
@@ -1,15 +0,0 @@
1
- import { AuthenticatedCommand } from "../common/authenticated-command";
2
- export default class Push extends AuthenticatedCommand {
3
- static description: string;
4
- static examples: string[];
5
- static flags: {
6
- branch: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
7
- "skip-commit": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
- };
9
- static args: {
10
- resource_path: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
11
- };
12
- run(): Promise<void>;
13
- private createTasks;
14
- private getResourceIdsToPush;
15
- }