sb-mig 2.9.2 → 3.1.1

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 (53) hide show
  1. package/README.md +51 -27
  2. package/dist/index.js +52 -0
  3. package/package.json +40 -76
  4. package/CHANGELOG.md +0 -986
  5. package/bin/run +0 -5
  6. package/bin/run.cmd +0 -3
  7. package/lib/api/apiConfig.d.ts +0 -2
  8. package/lib/api/apiConfig.js +0 -9
  9. package/lib/api/componentPresets.d.ts +0 -1
  10. package/lib/api/componentPresets.js +0 -22
  11. package/lib/api/components.d.ts +0 -5
  12. package/lib/api/components.js +0 -71
  13. package/lib/api/datasources.d.ts +0 -24
  14. package/lib/api/datasources.js +0 -193
  15. package/lib/api/migrate.d.ts +0 -19
  16. package/lib/api/migrate.js +0 -220
  17. package/lib/api/mutateComponents.d.ts +0 -2
  18. package/lib/api/mutateComponents.js +0 -50
  19. package/lib/api/presets.d.ts +0 -4
  20. package/lib/api/presets.js +0 -59
  21. package/lib/api/resolvePresets.d.ts +0 -2
  22. package/lib/api/resolvePresets.js +0 -40
  23. package/lib/api/roles.d.ts +0 -14
  24. package/lib/api/roles.js +0 -133
  25. package/lib/api/spaces.d.ts +0 -2
  26. package/lib/api/spaces.js +0 -29
  27. package/lib/commands/backup.d.ts +0 -22
  28. package/lib/commands/backup.js +0 -217
  29. package/lib/commands/debug.d.ts +0 -9
  30. package/lib/commands/debug.js +0 -20
  31. package/lib/commands/sync.d.ts +0 -26
  32. package/lib/commands/sync.js +0 -93
  33. package/lib/config/StoryblokComponentsConfig.d.ts +0 -68
  34. package/lib/config/StoryblokComponentsConfig.js +0 -220
  35. package/lib/config/config.d.ts +0 -37
  36. package/lib/config/config.js +0 -36
  37. package/lib/core.d.ts +0 -16
  38. package/lib/core.js +0 -75
  39. package/lib/index.d.ts +0 -1
  40. package/lib/index.js +0 -5
  41. package/lib/types/storyblokTypes.d.ts +0 -171
  42. package/lib/types/storyblokTypes.js +0 -3
  43. package/lib/utils/discover.d.ts +0 -4
  44. package/lib/utils/discover.js +0 -96
  45. package/lib/utils/discover2.d.ts +0 -63
  46. package/lib/utils/discover2.js +0 -424
  47. package/lib/utils/files.d.ts +0 -6
  48. package/lib/utils/files.js +0 -54
  49. package/lib/utils/logger.d.ts +0 -11
  50. package/lib/utils/logger.js +0 -30
  51. package/lib/utils/others.d.ts +0 -1
  52. package/lib/utils/others.js +0 -5
  53. 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: [src/commands/backup.ts](https://github.com/sb-mig/sb-mig/blob/v2.9.2/src/commands/backup.ts)_
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: [src/commands/debug.ts](https://github.com/sb-mig/sb-mig/blob/v2.9.2/src/commands/debug.ts)_
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
- list installed plugins
377
+ List installed plugins.
377
378
 
378
379
  ```
379
- list installed plugins
380
+ List installed plugins.
380
381
 
381
382
  USAGE
382
383
  $ sb-mig plugins
383
384
 
384
385
  OPTIONS
385
- --core show core plugins
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/v1.9.5/src/commands/plugins/index.ts)_
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
- installs a plugin into the CLI
419
+ Installs a plugin into the CLI.
396
420
 
397
421
  ```
398
- installs a plugin into the CLI
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 plugin to install
434
+ PLUGIN Plugin to install.
411
435
 
412
436
  OPTIONS
413
- -f, --force yarn install with force flag
414
- -h, --help show CLI 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/v1.9.5/src/commands/plugins/install.ts)_
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
- links a plugin into the CLI for development
463
+ Links a plugin into the CLI for development.
440
464
 
441
465
  ```
442
- links a plugin into the CLI for development
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 show CLI 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/v1.9.5/src/commands/plugins/link.ts)_
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
- removes a plugin from the CLI
496
+ Removes a plugin from the CLI.
473
497
 
474
498
  ```
475
- removes a plugin from the CLI
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 show CLI 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/v1.9.5/src/commands/plugins/uninstall.ts)_
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
- update installed plugins
520
+ Update installed plugins.
497
521
 
498
522
  ```
499
- update installed plugins
523
+ Update installed plugins.
500
524
 
501
525
  USAGE
502
526
  $ sb-mig plugins:update
503
527
 
504
528
  OPTIONS
505
- -h, --help show CLI 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/v1.9.5/src/commands/plugins/update.ts)_
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: [src/commands/sync.ts](https://github.com/sb-mig/sb-mig/blob/v2.9.2/src/commands/sync.ts)_
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,58 +1,19 @@
1
1
  {
2
2
  "name": "sb-mig",
3
- "version": "2.9.2",
3
+ "version": "3.1.1",
4
4
  "description": "CLI to rule the world. (and handle stuff related to Storyblok CMS)",
5
5
  "author": "Marcin Krawczyk <marckraw@icloud.com>",
6
- "bin": {
7
- "sb-mig": "./bin/run"
8
- },
9
- "bugs": "https://github.com/sb-mig/sb-mig/issues",
10
- "dependencies": {
11
- "@oclif/command": "^1.8.0",
12
- "@oclif/config": "^1",
13
- "@oclif/plugin-help": "^2",
14
- "@oclif/plugin-plugins": "^1.7.10",
15
- "@oclif/plugin-warn-if-update-available": "^1.7.0",
16
- "axios": "^0.21.1",
17
- "camelcase": "^5.3.1",
18
- "dotenv": "^8.2.0",
19
- "execa": "^4.0.0",
20
- "figlet": "^1.3.0",
21
- "glob": "^7.1.6",
22
- "ncp": "^2.0.0",
23
- "ora": "^4.0.4",
24
- "rimraf": "^3.0.2",
25
- "storyblok-js-client": "^3.3.1",
26
- "tslib": "^1"
27
- },
28
- "devDependencies": {
29
- "@oclif/dev-cli": "^1",
30
- "@oclif/test": "^1",
31
- "@types/chai": "^4",
32
- "@types/figlet": "^1.2.0",
33
- "@types/mocha": "^5",
34
- "@types/ncp": "^2.0.3",
35
- "@types/node": "^10",
36
- "chai": "^4",
37
- "conventional-changelog-cli": "^2.0.31",
38
- "eslint": "^5.13",
39
- "eslint-config-oclif": "^3.1",
40
- "eslint-config-oclif-typescript": "^0.1",
41
- "globby": "^10",
42
- "mocha": "^5",
43
- "nyc": "^14",
44
- "ts-node": "^8",
45
- "typescript": "^4.2"
6
+ "license": "MIT",
7
+ "bin": "./dist/index.js",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/sb-mig/sb-mig.git"
46
11
  },
47
- "engines": {
48
- "node": ">=8.0.0"
12
+ "publishConfig": {
13
+ "registry": "https://registry.npmjs.org/",
14
+ "access": "public"
49
15
  },
50
- "files": [
51
- "/bin",
52
- "/lib",
53
- "/npm-shrinkwrap.json",
54
- "/oclif.manifest.json"
55
- ],
16
+ "bugs": "https://github.com/sb-mig/sb-mig/issues",
56
17
  "homepage": "https://sb-mig.com",
57
18
  "keywords": [
58
19
  "cli",
@@ -60,34 +21,37 @@
60
21
  "sb",
61
22
  "migrate"
62
23
  ],
63
- "license": "MIT",
64
- "main": "lib/index.js",
65
- "oclif": {
66
- "commands": "./lib/commands",
67
- "bin": "sb-mig",
68
- "scope": "sb-mig",
69
- "plugins": [
70
- "@oclif/plugin-help",
71
- "@oclif/plugin-plugins",
72
- "@oclif/plugin-warn-if-update-available"
73
- ],
74
- "warn-if-update-available": {
75
- "timeoutInDays": 3,
76
- "message": "<%= config.name %> update available from <%= chalk.greenBright(config.version) %> to <%= chalk.greenBright(latest) %>."
77
- }
78
- },
79
- "repository": {
80
- "type": "git",
81
- "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"
82
28
  },
29
+ "files": [
30
+ "./dist"
31
+ ],
83
32
  "scripts": {
84
- "postpack": "rm -f oclif.manifest.json",
85
- "posttest": "eslint . --ext .ts --config .eslintrc",
86
- "build": "rm -rf lib && tsc -b",
87
- "prepack": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme",
88
- "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
89
- "version": "conventional-changelog -p eslint -i CHANGELOG.md -s && oclif-dev readme && git add README.md && git add CHANGELOG.md"
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"
90
55
  },
91
- "types": "lib/index.d.ts",
92
- "gitHead": "bb482da0baa57a87ff4a0199d261b1d937a5e603"
56
+ "gitHead": "9df314574e4660857f67bce198383c26940a2d99"
93
57
  }