sb-mig 5.3.0-beta.1 → 5.3.0-beta.3

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.
@@ -7,5 +7,5 @@ export declare const migrationsDescription = "\n Usage\n $ sb-mig migr
7
7
  export declare const removeDescription = "\n Usage\n $ sb-mig remove [components|roles|datasources] [space separated file names] or --all \n \n Description\n Remove components or roles with Storyblok space.\n \n COMMANDS\n components - remove components\n roles - remove roles\n datasources - remove datasources\n \n FLAGS\n --all - Remove all components \n \n EXAMPLES\n $ sb-mig remove components --all\n $ sb-mig remove components accordion accordion-item\n $ sb-mig remove roles --all\n $ sb-mig remove datasources --all\n";
8
8
  export declare const backupDescription = "\n Usage\n $ sb-mig backup [components|component-groups|roles|datasources|presets|component-presets] component-name or --all\n Description\n Command for backing up anything related to Storyblok\n \n COMMANDS\n components - backup components\n component-groups - backup component-groups\n roles - backup components\n datasources - backup components\n presets - backup presets\n component-presets - backup component presets\n plugins - backup plugins\n stories - backup stories (only --all)\n\n \n FLAGS\n --all - Backup all \n \n EXAMPLES\n $ sb-mig backup components --all\n $ sb-mig backup components accordion \n $ sb-mig backup datasources --all\n $ sb-mig backup roles admin\n $ sb-mig backup plugins --all\n $ sb-mig backup plugins my-awesome-plugin\n $ sb-mig backup stories --all\n";
9
9
  export declare const debugDescription = "\n Usage\n $ sb-mig debug\n Description\n Output extra debugging information\n";
10
- export declare const askDescription = "\n !! ALPHA !!!\n Usage\n $ sb-mig ask \"What sb-mig version am I using?\"\n $ sb-mig ask \"What is the schema type i should write?\"\n $ sb-mig ask \"Is debug mode turned on ?\"\n $ sb-mig ask \"What storyblok api urls I am using?\"\n Description\n Ask sb-mig about anything, especially stuff related to sb-mig and storyblok components.\n \n Needs OPENAI_API_KEY= environment set in your project. (Config will pick it up automatically, no need to modify\n storyblok.config.[c|m]js file\n \n Also, right now, you need to install @mrck-labs/anton-sdk in your project, since its not bundled.\n";
10
+ export declare const askDescription = "\n !! ALPHA !!!\n Usage\n $ sb-mig ask \"What sb-mig version am I using?\"\n $ sb-mig ask \"What is the schema type i should write?\"\n $ sb-mig ask \"Is debug mode turned on ?\"\n $ sb-mig ask \"What storyblok api urls I am using?\"\n $ sb-mig ask \"How would I sync just couple components ? what command should i use? I would like to also sync presets for this components\"\n Description\n Ask sb-mig about anything, especially stuff related to sb-mig and storyblok components.\n \n Needs OPENAI_API_KEY= environment set in your project. (Config will pick it up automatically, no need to modify\n storyblok.config.[c|m]js file\n \n Also, right now, you need to install @mrck-labs/anton-sdk in your project, since its not bundled.\n";
11
11
  export declare const initDescription = "\n Usage\n $ sb-mig init\n Description\n Init and update your project\n";
@@ -192,6 +192,7 @@ export const askDescription = `
192
192
  $ sb-mig ask "What is the schema type i should write?"
193
193
  $ sb-mig ask "Is debug mode turned on ?"
194
194
  $ sb-mig ask "What storyblok api urls I am using?"
195
+ $ sb-mig ask "How would I sync just couple components ? what command should i use? I would like to also sync presets for this components"
195
196
  Description
196
197
  Ask sb-mig about anything, especially stuff related to sb-mig and storyblok components.
197
198
 
@@ -3,6 +3,7 @@ import { Anton } from "@mrck-labs/anton-sdk";
3
3
  import config from "../../config/config.js";
4
4
  import Logger from "../../utils/logger.js";
5
5
  import { getFileContentWithRequire } from "../../utils/main.js";
6
+ import * as descriptions from "../cli-descriptions.js";
6
7
  export const ask = async (props) => {
7
8
  const { input, flags } = props;
8
9
  try {
@@ -13,12 +14,16 @@ export const ask = async (props) => {
13
14
  const question = input[1];
14
15
  const cleanPackageJSON = {
15
16
  ...fileContent,
17
+ scripts: null,
16
18
  };
17
19
  const cleanStoryblokConfig = {
18
20
  ...config,
19
21
  oauthToken: "hidden",
20
22
  openaiToken: "hidden",
21
23
  };
24
+ const cleanAllDescriptions = {
25
+ ...descriptions,
26
+ };
22
27
  Logger.warning("Got it! Thinking...");
23
28
  const data = await anton.chatCompletion({
24
29
  body: {
@@ -29,8 +34,9 @@ export const ask = async (props) => {
29
34
  If u dont know the answet to question, simply say don't know. DO NOT try to generate answers at all cost if the context
30
35
  doesnt give you the answer.
31
36
  ### context start ###
32
- ${JSON.stringify(cleanStoryblokConfig, null, 2)}
33
- ${JSON.stringify(cleanPackageJSON, null, 2)}
37
+ ${JSON.stringify(cleanStoryblokConfig, null, 0)}
38
+ ${JSON.stringify(cleanPackageJSON, null, 0)}
39
+ ${JSON.stringify(cleanAllDescriptions, null, 0)}
34
40
  ### context end ###
35
41
  `,
36
42
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sb-mig",
3
- "version": "5.3.0-beta.1",
3
+ "version": "5.3.0-beta.3",
4
4
  "description": "CLI to rule the world. (and handle stuff related to Storyblok CMS)",
5
5
  "author": "Marcin Krawczyk <marckraw@icloud.com>",
6
6
  "license": "MIT",
@@ -73,23 +73,23 @@
73
73
  "devDependencies": {
74
74
  "@commitlint/cli": "^17.7.1",
75
75
  "@commitlint/config-conventional": "^17.7.0",
76
- "@rollup/plugin-node-resolve": "^15.2.0",
76
+ "@rollup/plugin-node-resolve": "^15.2.3",
77
77
  "@ryansonshine/commitizen": "^4.2.8",
78
78
  "@ryansonshine/cz-conventional-changelog": "^3.3.4",
79
79
  "@semantic-release/changelog": "^6.0.3",
80
80
  "@semantic-release/git": "^10.0.1",
81
81
  "@sindresorhus/tsconfig": "^3.0.1",
82
- "@types/chai": "^4.3.5",
83
- "@types/fs-extra": "^11.0.1",
82
+ "@types/chai": "^4.3.10",
83
+ "@types/fs-extra": "^11.0.4",
84
84
  "@types/glob": "^8.1.0",
85
- "@types/mocha": "^10.0.1",
86
- "@types/ncp": "^2.0.5",
85
+ "@types/mocha": "^10.0.4",
86
+ "@types/ncp": "^2.0.8",
87
87
  "@types/node": "18.16.18",
88
88
  "@types/sinon": "^10.0.16",
89
- "@types/uuid": "^9.0.2",
89
+ "@types/uuid": "^9.0.7",
90
90
  "@typescript-eslint/eslint-plugin": "^6.4.1",
91
91
  "@typescript-eslint/parser": "^6.4.1",
92
- "chai": "^4.3.7",
92
+ "chai": "^4.3.10",
93
93
  "chokidar-cli": "^3.0.0",
94
94
  "eslint": "^8.47.0",
95
95
  "eslint-config-prettier": "^9.0.0",
@@ -98,7 +98,7 @@
98
98
  "husky": "^8.0.3",
99
99
  "lint-staged": "^13.2.3",
100
100
  "mocha": "^10.2.0",
101
- "prettier": "^3.0.2",
101
+ "prettier": "^3.0.3",
102
102
  "semantic-release": "^21.0.9",
103
103
  "semantic-release-slack-bot": "^4.0.1",
104
104
  "sinon": "^15.2.0",