sb-mig 4.0.4 → 4.0.5
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 +46 -8
- package/dist/cli-descriptions.d.ts +1 -1
- package/dist/cli-descriptions.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,6 +7,12 @@ If you've found an issue or you have feature request - <a href="https://github.c
|
|
|
7
7
|
[](ttps://img.shields.io/npm/dt/sb-mig.svg)
|
|
8
8
|
[](https://github.com/sb-mig/sb-mig/issues?q=is%3Aopen+is%3Aissue)
|
|
9
9
|
|
|
10
|
+
# 4.x.x version released!
|
|
11
|
+
|
|
12
|
+
- Whole deployment now, is handled by [semantic-release](https://github.com/semantic-release/semantic-release). And is just normal repository, instead of Lerna monorepo which is not needed anymore, and it was recently unmaintained (now it was passed to `nrwl` to maintain (https://github.com/lerna/lerna/issues/3121) will see what will happen in future with it :)
|
|
13
|
+
- Fromt the code perspective, there are no **breaking changes** between **3.x.x** and **4.x.x** but i'm going to fix some stuff now and add some more functionalities to it. So stay tuned!
|
|
14
|
+
- This Readme, which is also kinda documentation, will also be updated. Cause in some places there is misleading information. The best documentation though is just `sb-mig --help` command.
|
|
15
|
+
|
|
10
16
|
# 3.x.x version released!
|
|
11
17
|
|
|
12
18
|
- completely rewritten to simple [Meow](https://github.com/sindresorhus/meow) lib with help of Typescript. Check [migration guide](https://github.com/sb-mig/sb-mig/blob/oclif-research/MIGRATION-GUIDE-v3.md)
|
|
@@ -37,11 +43,19 @@ If you've found an issue or you have feature request - <a href="https://github.c
|
|
|
37
43
|
npm install --global sb-mig
|
|
38
44
|
```
|
|
39
45
|
|
|
40
|
-
|
|
46
|
+
In your working directory (usually root of your repo where u have your app/webpage using Storyblok), you have to create a `.env` file with your variables:
|
|
41
47
|
|
|
42
48
|
```
|
|
43
49
|
STORYBLOK_OAUTH_TOKEN=1234567890qwertyuiop
|
|
44
50
|
STORYBLOK_SPACE_ID=12345
|
|
51
|
+
|
|
52
|
+
# For nextjs
|
|
53
|
+
# NEXT_PUBLIC_STORYBLOK_ACCESS_TOKEN=zxcvbnmasdfghjkl
|
|
54
|
+
|
|
55
|
+
# For gatsby
|
|
56
|
+
# GATSBY_STORYBLOK_ACCESS_TOKEN=zxcvbnmasdfghjkl
|
|
57
|
+
|
|
58
|
+
# any other (you have to handle '.env' access in frontend yourself (for example with dotenv package)
|
|
45
59
|
STORYBLOK_ACCESS_TOKEN=zxcvbnmasdfghjkl
|
|
46
60
|
```
|
|
47
61
|
|
|
@@ -88,13 +102,13 @@ $ sb-mig --help
|
|
|
88
102
|
help This screen
|
|
89
103
|
|
|
90
104
|
Examples
|
|
91
|
-
$ sb-
|
|
105
|
+
$ sb-mig sync components --all
|
|
92
106
|
$ sb-mig debug
|
|
93
107
|
```
|
|
94
108
|
|
|
95
109
|
# Commands
|
|
96
110
|
|
|
97
|
-
* [`sb-mig version`](#sb-mig-version)
|
|
111
|
+
* [`sb-mig --version`](#sb-mig-version)
|
|
98
112
|
* [`sb-mig backup`](#sb-mig-backup)
|
|
99
113
|
* [`sb-mig debug`](#sb-mig-debug)
|
|
100
114
|
* [`sb-mig sync`](#sb-mig-sync)
|
|
@@ -103,7 +117,7 @@ $ sb-mig --help
|
|
|
103
117
|
```
|
|
104
118
|
$ sb-mig --version
|
|
105
119
|
|
|
106
|
-
|
|
120
|
+
4.0.4
|
|
107
121
|
```
|
|
108
122
|
|
|
109
123
|
## `sb-mig backup`
|
|
@@ -118,7 +132,7 @@ $ sb-mig backup --help
|
|
|
118
132
|
CLI to rule the world. (and handle stuff related to Storyblok CMS)
|
|
119
133
|
|
|
120
134
|
Usage
|
|
121
|
-
$ sb-mig
|
|
135
|
+
$ sb-mig backup [components|component-groups|roles|datasources|presets|component-presets] component-name --one or --all
|
|
122
136
|
Description
|
|
123
137
|
Command for backing up anything related to Storyblok
|
|
124
138
|
|
|
@@ -148,6 +162,7 @@ Output extra debugging.
|
|
|
148
162
|
```
|
|
149
163
|
$ sb-mig debug
|
|
150
164
|
|
|
165
|
+
✓ Found storyblok.config.js!
|
|
151
166
|
storyblok.config.js: {
|
|
152
167
|
componentsMatchFile: 'src/components/components.js',
|
|
153
168
|
storyblokComponentsListfile: 'src/components/storyblok-components.componentList.js',
|
|
@@ -197,8 +212,14 @@ CLI to rule the world. (and handle stuff related to Storyblok CMS)
|
|
|
197
212
|
|
|
198
213
|
EXAMPLES
|
|
199
214
|
$ sb-mig sync components --all
|
|
215
|
+
$ sb-mig sync components --all --presets
|
|
200
216
|
$ sb-mig sync components accordion accordion-item
|
|
217
|
+
$ sb-mig sync components accordion accordion-item --presets
|
|
201
218
|
$ sb-mig sync components @storyblok-components/accordion --packageName
|
|
219
|
+
$ sb-mig sync components @storyblok-components/accordion --packageName --presets
|
|
220
|
+
$ sb-mig sync roles --all
|
|
221
|
+
$ sb-mig sync datasources --all
|
|
222
|
+
|
|
202
223
|
```
|
|
203
224
|
|
|
204
225
|
# Schema documentation:
|
|
@@ -267,7 +288,7 @@ There is also support for `sections` inside components:
|
|
|
267
288
|
|
|
268
289
|
The main purpose of `sb-mig` is to sync your `.sb.js` component schema files with your `Storyblok` space.
|
|
269
290
|
|
|
270
|
-
In
|
|
291
|
+
In v4.x.x There is 1 way to sync your schemas, which is to name all your schemas with `.sb.js` extension. You can have them in any place of your repositories, as long as this place is pointed in `storyblok.config.js` `componentDirectories` field, which is set to `componentsDirectories: ["src", "storyblok"],` by default:
|
|
271
292
|
|
|
272
293
|
```
|
|
273
294
|
sb-mig sync components row column
|
|
@@ -398,7 +419,7 @@ export default {
|
|
|
398
419
|
Now, sync your component
|
|
399
420
|
|
|
400
421
|
```
|
|
401
|
-
sb-mig sync components
|
|
422
|
+
sb-mig sync components text-block --presets
|
|
402
423
|
```
|
|
403
424
|
|
|
404
425
|
output:
|
|
@@ -431,12 +452,29 @@ Install packages
|
|
|
431
452
|
yarn
|
|
432
453
|
```
|
|
433
454
|
|
|
434
|
-
|
|
455
|
+
Run development command
|
|
456
|
+
```bash
|
|
457
|
+
yarn build:dev
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
It will watch a file change, and on every change, will rebuild typescript and build the whole lib/cli.
|
|
461
|
+
|
|
462
|
+
The you can use
|
|
463
|
+
```
|
|
464
|
+
node dist/index.js debug
|
|
465
|
+
```
|
|
466
|
+
to access `sb-mig`
|
|
435
467
|
|
|
468
|
+
For your conveniece, you can also, link it to proper `sb-mi` name:
|
|
436
469
|
```
|
|
437
470
|
yarn link
|
|
438
471
|
```
|
|
439
472
|
|
|
473
|
+
And then you can use it like that:
|
|
474
|
+
```
|
|
475
|
+
sb-mig debug
|
|
476
|
+
```
|
|
477
|
+
|
|
440
478
|
## Roadmap
|
|
441
479
|
|
|
442
480
|
- [ ] Sync / Migrate content (stories)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const mainDescription = "\n USAGE\n $ sb-mig [command]\n \n COMMANDS\n sync
|
|
1
|
+
export declare const mainDescription = "\n USAGE\n $ sb-mig [command]\n \n COMMANDS\n sync Synchronize components, datasources or roles with Storyblok space.\n backup Command for backing up anything related to Storyblok\n debug Output extra debugging information\n help This screen\n \n Examples\n $ sb-mig sync components --all\n $ sb-mig debug \n";
|
|
2
2
|
export declare const syncDescription = "\n Usage\n $ sb-mig sync [components|roles|datasources] [space separated file names] or --all --packageName\n \n Description\n Synchronize components or roles with Storyblok space.\n \n COMMANDS\n components - sync components\n roles - sync roles\n datasources - sync datasources\n \n FLAGS\n --all - Sync all components\n --packageName - Sync based on package name, instead of file name (package can have multiple schema files to sync)\n --presets - Pass it, if u want to sync also with presets (will take longer) \n \n EXAMPLES\n $ sb-mig sync components --all\n $ sb-mig sync components --all --presets\n $ sb-mig sync components accordion accordion-item\n $ sb-mig sync components accordion accordion-item --presets\n $ sb-mig sync components @storyblok-components/accordion --packageName\n $ sb-mig sync components @storyblok-components/accordion --packageName --presets\n $ sb-mig sync roles --all\n $ sb-mig sync datasources --all\n";
|
|
3
3
|
export declare const backupDescription = "\n Usage\n $ sb-mig backup [components|component-groups|roles|datasources|presets|component-presets] component-name --one 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 \n FLAGS\n --all - Backup all \n --one - Backup one \n \n EXAMPLES\n $ sb-mig backup components --all\n $ sb-mig backup components accordion --one \n $ sb-mig backup datasources --all\n $ sb-mig backup roles admin --one\n";
|
|
4
4
|
export declare const debugDescription = "\n Usage\n $ sb-mig debug\n Description\n Output extra debugging information\n";
|
package/dist/cli-descriptions.js
CHANGED
|
@@ -3,13 +3,13 @@ export const mainDescription = `
|
|
|
3
3
|
$ sb-mig [command]
|
|
4
4
|
|
|
5
5
|
COMMANDS
|
|
6
|
-
sync
|
|
6
|
+
sync Synchronize components, datasources or roles with Storyblok space.
|
|
7
7
|
backup Command for backing up anything related to Storyblok
|
|
8
8
|
debug Output extra debugging information
|
|
9
9
|
help This screen
|
|
10
10
|
|
|
11
11
|
Examples
|
|
12
|
-
$ sb-mig sync
|
|
12
|
+
$ sb-mig sync components --all
|
|
13
13
|
$ sb-mig debug
|
|
14
14
|
`;
|
|
15
15
|
export const syncDescription = `
|