sb-mig 2.9.3 → 3.1.2
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 +51 -27
- package/dist/index.js +52 -0
- package/package.json +40 -57
- package/CHANGELOG.md +0 -996
- package/bin/run +0 -5
- package/bin/run.cmd +0 -3
- package/lib/api/apiConfig.d.ts +0 -2
- package/lib/api/apiConfig.js +0 -9
- package/lib/api/componentPresets.d.ts +0 -1
- package/lib/api/componentPresets.js +0 -22
- package/lib/api/components.d.ts +0 -5
- package/lib/api/components.js +0 -71
- package/lib/api/datasources.d.ts +0 -24
- package/lib/api/datasources.js +0 -193
- package/lib/api/migrate.d.ts +0 -19
- package/lib/api/migrate.js +0 -220
- package/lib/api/mutateComponents.d.ts +0 -2
- package/lib/api/mutateComponents.js +0 -50
- package/lib/api/presets.d.ts +0 -4
- package/lib/api/presets.js +0 -59
- package/lib/api/resolvePresets.d.ts +0 -2
- package/lib/api/resolvePresets.js +0 -40
- package/lib/api/roles.d.ts +0 -14
- package/lib/api/roles.js +0 -133
- package/lib/api/spaces.d.ts +0 -2
- package/lib/api/spaces.js +0 -29
- package/lib/commands/backup.d.ts +0 -22
- package/lib/commands/backup.js +0 -217
- package/lib/commands/debug.d.ts +0 -9
- package/lib/commands/debug.js +0 -21
- package/lib/commands/sync.d.ts +0 -26
- package/lib/commands/sync.js +0 -93
- package/lib/config/StoryblokComponentsConfig.d.ts +0 -68
- package/lib/config/StoryblokComponentsConfig.js +0 -220
- package/lib/config/config.d.ts +0 -37
- package/lib/config/config.js +0 -36
- package/lib/core.d.ts +0 -16
- package/lib/core.js +0 -75
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -5
- package/lib/types/storyblokTypes.d.ts +0 -171
- package/lib/types/storyblokTypes.js +0 -3
- package/lib/utils/discover.d.ts +0 -4
- package/lib/utils/discover.js +0 -96
- package/lib/utils/discover2.d.ts +0 -63
- package/lib/utils/discover2.js +0 -424
- package/lib/utils/files.d.ts +0 -6
- package/lib/utils/files.js +0 -54
- package/lib/utils/logger.d.ts +0 -11
- package/lib/utils/logger.js +0 -30
- package/lib/utils/others.d.ts +0 -1
- package/lib/utils/others.js +0 -5
- package/oclif.manifest.json +0 -1
package/README.md
CHANGED
|
@@ -302,6 +302,7 @@ COMMANDS
|
|
|
302
302
|
* [`sb-mig debug`](#sb-mig-debug)
|
|
303
303
|
* [`sb-mig help [COMMAND]`](#sb-mig-help-command)
|
|
304
304
|
* [`sb-mig plugins`](#sb-mig-plugins)
|
|
305
|
+
* [`sb-mig plugins:inspect PLUGIN...`](#sb-mig-pluginsinspect-plugin)
|
|
305
306
|
* [`sb-mig plugins:install PLUGIN...`](#sb-mig-pluginsinstall-plugin)
|
|
306
307
|
* [`sb-mig plugins:link PLUGIN`](#sb-mig-pluginslink-plugin)
|
|
307
308
|
* [`sb-mig plugins:uninstall PLUGIN...`](#sb-mig-pluginsuninstall-plugin)
|
|
@@ -334,14 +335,14 @@ OPTIONS
|
|
|
334
335
|
-x, --oneDatasource=oneDatasource Backup one datasource by name.
|
|
335
336
|
```
|
|
336
337
|
|
|
337
|
-
_See code: [lib/commands/backup.js](https://github.com/sb-mig/sb-mig/blob/v2.9.
|
|
338
|
+
_See code: [lib/commands/backup.js](https://github.com/sb-mig/sb-mig/blob/v2.9.11/lib/commands/backup.js)_
|
|
338
339
|
|
|
339
340
|
## `sb-mig debug`
|
|
340
341
|
|
|
341
|
-
Output extra debugging
|
|
342
|
+
Output extra debugging.
|
|
342
343
|
|
|
343
344
|
```
|
|
344
|
-
Output extra debugging
|
|
345
|
+
Output extra debugging.
|
|
345
346
|
|
|
346
347
|
USAGE
|
|
347
348
|
$ sb-mig debug
|
|
@@ -350,7 +351,7 @@ OPTIONS
|
|
|
350
351
|
-h, --help show CLI help
|
|
351
352
|
```
|
|
352
353
|
|
|
353
|
-
_See code: [lib/commands/debug.js](https://github.com/sb-mig/sb-mig/blob/v2.9.
|
|
354
|
+
_See code: [lib/commands/debug.js](https://github.com/sb-mig/sb-mig/blob/v2.9.11/lib/commands/debug.js)_
|
|
354
355
|
|
|
355
356
|
## `sb-mig help [COMMAND]`
|
|
356
357
|
|
|
@@ -373,29 +374,52 @@ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v2.2.3
|
|
|
373
374
|
|
|
374
375
|
## `sb-mig plugins`
|
|
375
376
|
|
|
376
|
-
|
|
377
|
+
List installed plugins.
|
|
377
378
|
|
|
378
379
|
```
|
|
379
|
-
|
|
380
|
+
List installed plugins.
|
|
380
381
|
|
|
381
382
|
USAGE
|
|
382
383
|
$ sb-mig plugins
|
|
383
384
|
|
|
384
385
|
OPTIONS
|
|
385
|
-
--core
|
|
386
|
+
--core Show core plugins.
|
|
386
387
|
|
|
387
388
|
EXAMPLE
|
|
388
389
|
$ sb-mig plugins
|
|
389
390
|
```
|
|
390
391
|
|
|
391
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/
|
|
392
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.0.11/src/commands/plugins/index.ts)_
|
|
393
|
+
|
|
394
|
+
## `sb-mig plugins:inspect PLUGIN...`
|
|
395
|
+
|
|
396
|
+
Displays installation properties of a plugin.
|
|
397
|
+
|
|
398
|
+
```
|
|
399
|
+
Displays installation properties of a plugin.
|
|
400
|
+
|
|
401
|
+
USAGE
|
|
402
|
+
$ sb-mig plugins:inspect PLUGIN...
|
|
403
|
+
|
|
404
|
+
ARGUMENTS
|
|
405
|
+
PLUGIN [default: .] Plugin to inspect.
|
|
406
|
+
|
|
407
|
+
OPTIONS
|
|
408
|
+
-h, --help Show CLI help.
|
|
409
|
+
-v, --verbose
|
|
410
|
+
|
|
411
|
+
EXAMPLE
|
|
412
|
+
$ sb-mig plugins:inspect myplugin
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.0.11/src/commands/plugins/inspect.ts)_
|
|
392
416
|
|
|
393
417
|
## `sb-mig plugins:install PLUGIN...`
|
|
394
418
|
|
|
395
|
-
|
|
419
|
+
Installs a plugin into the CLI.
|
|
396
420
|
|
|
397
421
|
```
|
|
398
|
-
|
|
422
|
+
Installs a plugin into the CLI.
|
|
399
423
|
Can be installed from npm or a git url.
|
|
400
424
|
|
|
401
425
|
Installation of a user-installed plugin will override a core plugin.
|
|
@@ -407,11 +431,11 @@ USAGE
|
|
|
407
431
|
$ sb-mig plugins:install PLUGIN...
|
|
408
432
|
|
|
409
433
|
ARGUMENTS
|
|
410
|
-
PLUGIN
|
|
434
|
+
PLUGIN Plugin to install.
|
|
411
435
|
|
|
412
436
|
OPTIONS
|
|
413
|
-
-f, --force yarn install with force flag
|
|
414
|
-
-h, --help
|
|
437
|
+
-f, --force Run yarn install with force flag.
|
|
438
|
+
-h, --help Show CLI help.
|
|
415
439
|
-v, --verbose
|
|
416
440
|
|
|
417
441
|
DESCRIPTION
|
|
@@ -432,14 +456,14 @@ EXAMPLES
|
|
|
432
456
|
$ sb-mig plugins:install someuser/someplugin
|
|
433
457
|
```
|
|
434
458
|
|
|
435
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/
|
|
459
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.0.11/src/commands/plugins/install.ts)_
|
|
436
460
|
|
|
437
461
|
## `sb-mig plugins:link PLUGIN`
|
|
438
462
|
|
|
439
|
-
|
|
463
|
+
Links a plugin into the CLI for development.
|
|
440
464
|
|
|
441
465
|
```
|
|
442
|
-
|
|
466
|
+
Links a plugin into the CLI for development.
|
|
443
467
|
Installation of a linked plugin will override a user-installed or core plugin.
|
|
444
468
|
|
|
445
469
|
e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello' command will override the user-installed or core plugin implementation. This is useful for development work.
|
|
@@ -452,7 +476,7 @@ ARGUMENTS
|
|
|
452
476
|
PATH [default: .] path to plugin
|
|
453
477
|
|
|
454
478
|
OPTIONS
|
|
455
|
-
-h, --help
|
|
479
|
+
-h, --help Show CLI help.
|
|
456
480
|
-v, --verbose
|
|
457
481
|
|
|
458
482
|
DESCRIPTION
|
|
@@ -465,14 +489,14 @@ EXAMPLE
|
|
|
465
489
|
$ sb-mig plugins:link myplugin
|
|
466
490
|
```
|
|
467
491
|
|
|
468
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/
|
|
492
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.0.11/src/commands/plugins/link.ts)_
|
|
469
493
|
|
|
470
494
|
## `sb-mig plugins:uninstall PLUGIN...`
|
|
471
495
|
|
|
472
|
-
|
|
496
|
+
Removes a plugin from the CLI.
|
|
473
497
|
|
|
474
498
|
```
|
|
475
|
-
|
|
499
|
+
Removes a plugin from the CLI.
|
|
476
500
|
|
|
477
501
|
USAGE
|
|
478
502
|
$ sb-mig plugins:uninstall PLUGIN...
|
|
@@ -481,7 +505,7 @@ ARGUMENTS
|
|
|
481
505
|
PLUGIN plugin to uninstall
|
|
482
506
|
|
|
483
507
|
OPTIONS
|
|
484
|
-
-h, --help
|
|
508
|
+
-h, --help Show CLI help.
|
|
485
509
|
-v, --verbose
|
|
486
510
|
|
|
487
511
|
ALIASES
|
|
@@ -489,24 +513,24 @@ ALIASES
|
|
|
489
513
|
$ sb-mig plugins:remove
|
|
490
514
|
```
|
|
491
515
|
|
|
492
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/
|
|
516
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.0.11/src/commands/plugins/uninstall.ts)_
|
|
493
517
|
|
|
494
518
|
## `sb-mig plugins:update`
|
|
495
519
|
|
|
496
|
-
|
|
520
|
+
Update installed plugins.
|
|
497
521
|
|
|
498
522
|
```
|
|
499
|
-
|
|
523
|
+
Update installed plugins.
|
|
500
524
|
|
|
501
525
|
USAGE
|
|
502
526
|
$ sb-mig plugins:update
|
|
503
527
|
|
|
504
528
|
OPTIONS
|
|
505
|
-
-h, --help
|
|
529
|
+
-h, --help Show CLI help.
|
|
506
530
|
-v, --verbose
|
|
507
531
|
```
|
|
508
532
|
|
|
509
|
-
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/
|
|
533
|
+
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.0.11/src/commands/plugins/update.ts)_
|
|
510
534
|
|
|
511
535
|
## `sb-mig sync TYPE [LIST]`
|
|
512
536
|
|
|
@@ -539,7 +563,7 @@ EXAMPLES
|
|
|
539
563
|
$ sb-mig sync roles
|
|
540
564
|
```
|
|
541
565
|
|
|
542
|
-
_See code: [lib/commands/sync.js](https://github.com/sb-mig/sb-mig/blob/v2.9.
|
|
566
|
+
_See code: [lib/commands/sync.js](https://github.com/sb-mig/sb-mig/blob/v2.9.11/lib/commands/sync.js)_
|
|
543
567
|
<!-- commandsstop -->
|
|
544
568
|
|
|
545
569
|
# Plugins
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#! /usr/bin/env node
|
|
2
|
+
import meow from "meow";
|
|
3
|
+
import { debug } from "./commands/debug.js";
|
|
4
|
+
import { pipe, prop } from "./utils/main.js";
|
|
5
|
+
import { sync } from "./commands/sync.js";
|
|
6
|
+
import { backup } from "./commands/backup.js";
|
|
7
|
+
import { backupDescription, debugDescription, mainDescription, syncDescription, } from "./cli-descriptions.js";
|
|
8
|
+
const app = () => ({
|
|
9
|
+
cli: meow(mainDescription, {
|
|
10
|
+
importMeta: import.meta,
|
|
11
|
+
booleanDefault: undefined,
|
|
12
|
+
}),
|
|
13
|
+
action: (cli) => cli.showHelp(),
|
|
14
|
+
});
|
|
15
|
+
app.sync = () => ({
|
|
16
|
+
cli: meow(syncDescription, {
|
|
17
|
+
importMeta: import.meta,
|
|
18
|
+
booleanDefault: undefined,
|
|
19
|
+
}),
|
|
20
|
+
action: (cli) => {
|
|
21
|
+
sync(cli);
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
app.backup = () => ({
|
|
25
|
+
cli: meow(backupDescription, {
|
|
26
|
+
importMeta: import.meta,
|
|
27
|
+
booleanDefault: undefined,
|
|
28
|
+
}),
|
|
29
|
+
action: (cli) => {
|
|
30
|
+
backup(cli);
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
app.debug = () => ({
|
|
34
|
+
cli: meow(debugDescription, {
|
|
35
|
+
importMeta: import.meta,
|
|
36
|
+
booleanDefault: undefined,
|
|
37
|
+
}),
|
|
38
|
+
action: (cli) => {
|
|
39
|
+
debug(cli);
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
const getSubcommand = (cliObject, level) => pipe(prop("input"), prop(level), (name) => prop(name)(cliObject))(prop("cli")(cliObject()));
|
|
43
|
+
const cli = (cliObject, level = 0) => {
|
|
44
|
+
const { cli: nextCli, action } = cliObject();
|
|
45
|
+
const subCommand = getSubcommand(cliObject, level);
|
|
46
|
+
return subCommand
|
|
47
|
+
? cli(subCommand, level + 1)
|
|
48
|
+
: nextCli.flags.help
|
|
49
|
+
? nextCli.showHelp()
|
|
50
|
+
: action(nextCli);
|
|
51
|
+
};
|
|
52
|
+
cli(app);
|
package/package.json
CHANGED
|
@@ -1,39 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sb-mig",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"description": "CLI to rule the world. (and handle stuff related to Storyblok CMS)",
|
|
5
5
|
"author": "Marcin Krawczyk <marckraw@icloud.com>",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"@oclif/command": "^1.8.0",
|
|
12
|
-
"@oclif/plugin-plugins": "^1.7.10",
|
|
13
|
-
"@oclif/plugin-warn-if-update-available": "^1.7.0",
|
|
14
|
-
"axios": "^0.21.4",
|
|
15
|
-
"camelcase": "^6.2.0",
|
|
16
|
-
"dotenv": "^8.2.0",
|
|
17
|
-
"glob": "^7.1.6",
|
|
18
|
-
"ncp": "^2.0.0",
|
|
19
|
-
"rimraf": "^3.0.2",
|
|
20
|
-
"storyblok-js-client": "^3.3.1"
|
|
21
|
-
},
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"@oclif/dev-cli": "^1",
|
|
24
|
-
"@oclif/test": "^1",
|
|
25
|
-
"conventional-changelog-cli": "^2.0.31",
|
|
26
|
-
"eslint-config-oclif": "^3.1"
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"bin": "./dist/index.js",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/sb-mig/sb-mig.git"
|
|
27
11
|
},
|
|
28
|
-
"
|
|
29
|
-
"
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"registry": "https://registry.npmjs.org/",
|
|
14
|
+
"access": "public"
|
|
30
15
|
},
|
|
31
|
-
"
|
|
32
|
-
"/bin",
|
|
33
|
-
"/lib",
|
|
34
|
-
"/npm-shrinkwrap.json",
|
|
35
|
-
"/oclif.manifest.json"
|
|
36
|
-
],
|
|
16
|
+
"bugs": "https://github.com/sb-mig/sb-mig/issues",
|
|
37
17
|
"homepage": "https://sb-mig.com",
|
|
38
18
|
"keywords": [
|
|
39
19
|
"cli",
|
|
@@ -41,34 +21,37 @@
|
|
|
41
21
|
"sb",
|
|
42
22
|
"migrate"
|
|
43
23
|
],
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"bin": "sb-mig",
|
|
49
|
-
"scope": "sb-mig",
|
|
50
|
-
"plugins": [
|
|
51
|
-
"@oclif/plugin-help",
|
|
52
|
-
"@oclif/plugin-plugins",
|
|
53
|
-
"@oclif/plugin-warn-if-update-available"
|
|
54
|
-
],
|
|
55
|
-
"warn-if-update-available": {
|
|
56
|
-
"timeoutInDays": 3,
|
|
57
|
-
"message": "<%= config.name %> update available from <%= chalk.greenBright(config.version) %> to <%= chalk.greenBright(latest) %>."
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
"repository": {
|
|
61
|
-
"type": "git",
|
|
62
|
-
"url": "git+https://github.com/sb-mig/sb-mig.git"
|
|
24
|
+
"type": "module",
|
|
25
|
+
"exports": "./dist/index.js",
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
|
63
28
|
},
|
|
29
|
+
"files": [
|
|
30
|
+
"./dist/**/*"
|
|
31
|
+
],
|
|
64
32
|
"scripts": {
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
|
|
33
|
+
"build": "rm -rf dist && tsc",
|
|
34
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
35
|
+
"start": "yarn build && ./dist/index.js",
|
|
36
|
+
"debug": "yarn build && ./dist/index.js sync components accordion accordion-item",
|
|
37
|
+
"version": "conventional-changelog -p eslint -i CHANGELOG.md -s"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"axios": "^0.25.0",
|
|
41
|
+
"chalk": "^5.0.0",
|
|
42
|
+
"dotenv": "^14.3.0",
|
|
43
|
+
"glob": "^7.2.0",
|
|
44
|
+
"meow": "^10.1.2",
|
|
45
|
+
"ncp": "^2.0.0",
|
|
46
|
+
"storyblok-js-client": "^4.2.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@sindresorhus/tsconfig": "^2.0.0",
|
|
50
|
+
"@types/glob": "^7.2.0",
|
|
51
|
+
"@types/ncp": "^2.0.5",
|
|
52
|
+
"@types/node": "^17.0.12",
|
|
53
|
+
"conventional-changelog-cli": "^2.0.31",
|
|
54
|
+
"typescript": "^4.5.5"
|
|
71
55
|
},
|
|
72
|
-
"
|
|
73
|
-
"gitHead": "d2d2c915043f6228bbda2117f7393896b867bd60"
|
|
56
|
+
"gitHead": "bd5e65f27fc7cde94cb21878cc9e44256467d524"
|
|
74
57
|
}
|