@slicemachine/init 2.3.1-dev-next-release.4 → 2.4.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.
- package/dist/SliceMachineInitProcess.cjs +46 -22
- package/dist/SliceMachineInitProcess.cjs.map +1 -1
- package/dist/SliceMachineInitProcess.d.ts +2 -1
- package/dist/SliceMachineInitProcess.js +44 -20
- package/dist/SliceMachineInitProcess.js.map +1 -1
- package/dist/_node_modules/@babel/code-frame/lib/index.cjs +2 -2
- package/dist/_node_modules/@babel/code-frame/lib/index.js +2 -2
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.cjs +1 -1
- package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.js +1 -1
- package/dist/_node_modules/@babel/highlight/lib/index.cjs +3 -3
- package/dist/_node_modules/@babel/highlight/lib/index.js +3 -3
- package/dist/_node_modules/@nodelib/fs.scandir/out/index.cjs +1 -1
- package/dist/_node_modules/@nodelib/fs.scandir/out/index.js +1 -1
- package/dist/_node_modules/@nodelib/fs.scandir/out/providers/async.cjs +2 -2
- package/dist/_node_modules/@nodelib/fs.scandir/out/providers/async.js +2 -2
- package/dist/_node_modules/@nodelib/fs.scandir/out/providers/sync.cjs +2 -2
- package/dist/_node_modules/@nodelib/fs.scandir/out/providers/sync.js +2 -2
- package/dist/_node_modules/@nodelib/fs.scandir/out/settings.cjs +1 -1
- package/dist/_node_modules/@nodelib/fs.scandir/out/settings.js +1 -1
- package/dist/_node_modules/@nodelib/fs.scandir/out/utils/index.cjs +1 -1
- package/dist/_node_modules/@nodelib/fs.scandir/out/utils/index.js +1 -1
- package/dist/_node_modules/@nodelib/fs.stat/out/index.cjs +1 -1
- package/dist/_node_modules/@nodelib/fs.stat/out/index.js +1 -1
- package/dist/_node_modules/@nodelib/fs.walk/out/index.cjs +1 -1
- package/dist/_node_modules/@nodelib/fs.walk/out/index.js +1 -1
- package/dist/_node_modules/@nodelib/fs.walk/out/readers/async.cjs +3 -3
- package/dist/_node_modules/@nodelib/fs.walk/out/readers/async.cjs.map +1 -1
- package/dist/_node_modules/@nodelib/fs.walk/out/readers/async.js +3 -3
- package/dist/_node_modules/@nodelib/fs.walk/out/readers/async.js.map +1 -1
- package/dist/_node_modules/@nodelib/fs.walk/out/readers/sync.cjs +1 -1
- package/dist/_node_modules/@nodelib/fs.walk/out/readers/sync.js +1 -1
- package/dist/_node_modules/@nodelib/fs.walk/out/settings.cjs +1 -1
- package/dist/_node_modules/@nodelib/fs.walk/out/settings.js +1 -1
- package/dist/_node_modules/cross-spawn/index.cjs +30 -0
- package/dist/_node_modules/cross-spawn/index.cjs.map +1 -0
- package/dist/_node_modules/cross-spawn/index.js +31 -0
- package/dist/_node_modules/cross-spawn/index.js.map +1 -0
- package/dist/_node_modules/cross-spawn/lib/enoent.cjs +47 -0
- package/dist/_node_modules/cross-spawn/lib/enoent.cjs.map +1 -0
- package/dist/_node_modules/cross-spawn/lib/enoent.js +47 -0
- package/dist/_node_modules/cross-spawn/lib/enoent.js.map +1 -0
- package/dist/_node_modules/cross-spawn/lib/parse.cjs +64 -0
- package/dist/_node_modules/cross-spawn/lib/parse.cjs.map +1 -0
- package/dist/_node_modules/cross-spawn/lib/parse.js +64 -0
- package/dist/_node_modules/cross-spawn/lib/parse.js.map +1 -0
- package/dist/_node_modules/cross-spawn/lib/util/escape.cjs +22 -0
- package/dist/_node_modules/cross-spawn/lib/util/escape.cjs.map +1 -0
- package/dist/_node_modules/cross-spawn/lib/util/escape.js +23 -0
- package/dist/_node_modules/cross-spawn/lib/util/escape.js.map +1 -0
- package/dist/_node_modules/cross-spawn/lib/util/readShebang.cjs +21 -0
- package/dist/_node_modules/cross-spawn/lib/util/readShebang.cjs.map +1 -0
- package/dist/_node_modules/cross-spawn/lib/util/readShebang.js +21 -0
- package/dist/_node_modules/cross-spawn/lib/util/readShebang.js.map +1 -0
- package/dist/_node_modules/cross-spawn/lib/util/resolveCommand.cjs +42 -0
- package/dist/_node_modules/cross-spawn/lib/util/resolveCommand.cjs.map +1 -0
- package/dist/_node_modules/cross-spawn/lib/util/resolveCommand.js +42 -0
- package/dist/_node_modules/cross-spawn/lib/util/resolveCommand.js.map +1 -0
- package/dist/_node_modules/dir-glob/index.cjs +2 -2
- package/dist/_node_modules/dir-glob/index.js +2 -2
- package/dist/_node_modules/execa/_node_modules/human-signals/build/src/core.cjs +275 -0
- package/dist/_node_modules/execa/_node_modules/human-signals/build/src/core.cjs.map +1 -0
- package/dist/_node_modules/execa/_node_modules/human-signals/build/src/core.js +275 -0
- package/dist/_node_modules/execa/_node_modules/human-signals/build/src/core.js.map +1 -0
- package/dist/_node_modules/execa/_node_modules/human-signals/build/src/main.cjs +53 -0
- package/dist/_node_modules/execa/_node_modules/human-signals/build/src/main.cjs.map +1 -0
- package/dist/_node_modules/execa/_node_modules/human-signals/build/src/main.js +53 -0
- package/dist/_node_modules/execa/_node_modules/human-signals/build/src/main.js.map +1 -0
- package/dist/_node_modules/execa/_node_modules/human-signals/build/src/realtime.cjs +18 -0
- package/dist/_node_modules/execa/_node_modules/human-signals/build/src/realtime.cjs.map +1 -0
- package/dist/_node_modules/execa/_node_modules/human-signals/build/src/realtime.js +18 -0
- package/dist/_node_modules/execa/_node_modules/human-signals/build/src/realtime.js.map +1 -0
- package/dist/_node_modules/execa/_node_modules/human-signals/build/src/signals.cjs +27 -0
- package/dist/_node_modules/execa/_node_modules/human-signals/build/src/signals.cjs.map +1 -0
- package/dist/_node_modules/execa/_node_modules/human-signals/build/src/signals.js +27 -0
- package/dist/_node_modules/execa/_node_modules/human-signals/build/src/signals.js.map +1 -0
- package/dist/_node_modules/execa/_node_modules/is-stream/index.cjs +11 -0
- package/dist/_node_modules/execa/_node_modules/is-stream/index.cjs.map +1 -0
- package/dist/_node_modules/execa/_node_modules/is-stream/index.js +11 -0
- package/dist/_node_modules/execa/_node_modules/is-stream/index.js.map +1 -0
- package/dist/_node_modules/execa/_node_modules/mimic-fn/index.cjs +46 -0
- package/dist/_node_modules/execa/_node_modules/mimic-fn/index.cjs.map +1 -0
- package/dist/_node_modules/execa/_node_modules/mimic-fn/index.js +47 -0
- package/dist/_node_modules/execa/_node_modules/mimic-fn/index.js.map +1 -0
- package/dist/_node_modules/execa/_node_modules/npm-run-path/index.cjs +34 -0
- package/dist/_node_modules/execa/_node_modules/npm-run-path/index.cjs.map +1 -0
- package/dist/_node_modules/execa/_node_modules/npm-run-path/index.js +34 -0
- package/dist/_node_modules/execa/_node_modules/npm-run-path/index.js.map +1 -0
- package/dist/_node_modules/execa/_node_modules/onetime/index.cjs +32 -0
- package/dist/_node_modules/execa/_node_modules/onetime/index.cjs.map +1 -0
- package/dist/_node_modules/execa/_node_modules/onetime/index.js +33 -0
- package/dist/_node_modules/execa/_node_modules/onetime/index.js.map +1 -0
- package/dist/_node_modules/execa/_node_modules/path-key/index.cjs +13 -0
- package/dist/_node_modules/execa/_node_modules/path-key/index.cjs.map +1 -0
- package/dist/_node_modules/execa/_node_modules/path-key/index.js +14 -0
- package/dist/_node_modules/execa/_node_modules/path-key/index.js.map +1 -0
- package/dist/_node_modules/execa/_node_modules/strip-final-newline/index.cjs +14 -0
- package/dist/_node_modules/execa/_node_modules/strip-final-newline/index.cjs.map +1 -0
- package/dist/_node_modules/execa/_node_modules/strip-final-newline/index.js +15 -0
- package/dist/_node_modules/execa/_node_modules/strip-final-newline/index.js.map +1 -0
- package/dist/_node_modules/execa/index.cjs +147 -0
- package/dist/_node_modules/execa/index.cjs.map +1 -0
- package/dist/_node_modules/execa/index.js +147 -0
- package/dist/_node_modules/execa/index.js.map +1 -0
- package/dist/_node_modules/execa/lib/command.cjs +37 -0
- package/dist/_node_modules/execa/lib/command.cjs.map +1 -0
- package/dist/_node_modules/execa/lib/command.js +37 -0
- package/dist/_node_modules/execa/lib/command.js.map +1 -0
- package/dist/_node_modules/execa/lib/error.cjs +73 -0
- package/dist/_node_modules/execa/lib/error.cjs.map +1 -0
- package/dist/_node_modules/execa/lib/error.js +73 -0
- package/dist/_node_modules/execa/lib/error.js.map +1 -0
- package/dist/_node_modules/execa/lib/kill.cjs +80 -0
- package/dist/_node_modules/execa/lib/kill.cjs.map +1 -0
- package/dist/_node_modules/execa/lib/kill.js +80 -0
- package/dist/_node_modules/execa/lib/kill.js.map +1 -0
- package/dist/_node_modules/execa/lib/pipe.cjs +37 -0
- package/dist/_node_modules/execa/lib/pipe.cjs.map +1 -0
- package/dist/_node_modules/execa/lib/pipe.js +37 -0
- package/dist/_node_modules/execa/lib/pipe.js.map +1 -0
- package/dist/_node_modules/execa/lib/promise.cjs +30 -0
- package/dist/_node_modules/execa/lib/promise.cjs.map +1 -0
- package/dist/_node_modules/execa/lib/promise.js +30 -0
- package/dist/_node_modules/execa/lib/promise.js.map +1 -0
- package/dist/_node_modules/execa/lib/stdio.cjs +26 -0
- package/dist/_node_modules/execa/lib/stdio.cjs.map +1 -0
- package/dist/_node_modules/execa/lib/stdio.js +26 -0
- package/dist/_node_modules/execa/lib/stdio.js.map +1 -0
- package/dist/_node_modules/execa/lib/stream.cjs +81 -0
- package/dist/_node_modules/execa/lib/stream.cjs.map +1 -0
- package/dist/_node_modules/execa/lib/stream.js +81 -0
- package/dist/_node_modules/execa/lib/stream.js.map +1 -0
- package/dist/_node_modules/execa/lib/verbose.cjs +20 -0
- package/dist/_node_modules/execa/lib/verbose.cjs.map +1 -0
- package/dist/_node_modules/execa/lib/verbose.js +20 -0
- package/dist/_node_modules/execa/lib/verbose.js.map +1 -0
- package/dist/_node_modules/fast-glob/out/index.cjs +1 -1
- package/dist/_node_modules/fast-glob/out/index.js +1 -1
- package/dist/_node_modules/fast-glob/out/managers/tasks.cjs +1 -1
- package/dist/_node_modules/fast-glob/out/managers/tasks.js +1 -1
- package/dist/_node_modules/fast-glob/out/providers/filters/deep.cjs +1 -1
- package/dist/_node_modules/fast-glob/out/providers/filters/deep.js +1 -1
- package/dist/_node_modules/fast-glob/out/providers/filters/entry.cjs +1 -1
- package/dist/_node_modules/fast-glob/out/providers/filters/entry.js +1 -1
- package/dist/_node_modules/fast-glob/out/providers/filters/error.cjs +1 -1
- package/dist/_node_modules/fast-glob/out/providers/filters/error.js +1 -1
- package/dist/_node_modules/fast-glob/out/providers/matchers/matcher.cjs +1 -1
- package/dist/_node_modules/fast-glob/out/providers/matchers/matcher.js +1 -1
- package/dist/_node_modules/fast-glob/out/providers/transformers/entry.cjs +1 -1
- package/dist/_node_modules/fast-glob/out/providers/transformers/entry.js +1 -1
- package/dist/_node_modules/fast-glob/out/readers/async.cjs +1 -1
- package/dist/_node_modules/fast-glob/out/readers/async.js +1 -1
- package/dist/_node_modules/fast-glob/out/readers/reader.cjs +2 -2
- package/dist/_node_modules/fast-glob/out/readers/reader.js +2 -2
- package/dist/_node_modules/fast-glob/out/readers/stream.cjs +2 -2
- package/dist/_node_modules/fast-glob/out/readers/stream.js +2 -2
- package/dist/_node_modules/fast-glob/out/readers/sync.cjs +2 -2
- package/dist/_node_modules/fast-glob/out/readers/sync.js +2 -2
- package/dist/_node_modules/fast-glob/out/utils/index.cjs +1 -1
- package/dist/_node_modules/fast-glob/out/utils/index.js +1 -1
- package/dist/_node_modules/get-stream/buffer-stream.cjs +43 -0
- package/dist/_node_modules/get-stream/buffer-stream.cjs.map +1 -0
- package/dist/_node_modules/get-stream/buffer-stream.js +43 -0
- package/dist/_node_modules/get-stream/buffer-stream.js.map +1 -0
- package/dist/_node_modules/get-stream/index.cjs +59 -0
- package/dist/_node_modules/get-stream/index.cjs.map +1 -0
- package/dist/_node_modules/get-stream/index.js +60 -0
- package/dist/_node_modules/get-stream/index.js.map +1 -0
- package/dist/_node_modules/globby/utilities.cjs +2 -2
- package/dist/_node_modules/globby/utilities.cjs.map +1 -1
- package/dist/_node_modules/isexe/index.cjs +56 -0
- package/dist/_node_modules/isexe/index.cjs.map +1 -0
- package/dist/_node_modules/isexe/index.js +56 -0
- package/dist/_node_modules/isexe/index.js.map +1 -0
- package/dist/_node_modules/isexe/mode.cjs +40 -0
- package/dist/_node_modules/isexe/mode.cjs.map +1 -0
- package/dist/_node_modules/isexe/mode.js +40 -0
- package/dist/_node_modules/isexe/mode.js.map +1 -0
- package/dist/_node_modules/isexe/windows.cjs +47 -0
- package/dist/_node_modules/isexe/windows.cjs.map +1 -0
- package/dist/_node_modules/isexe/windows.js +47 -0
- package/dist/_node_modules/isexe/windows.js.map +1 -0
- package/dist/_node_modules/js-tokens/index.cjs +1 -1
- package/dist/_node_modules/js-tokens/index.js +1 -1
- package/dist/_node_modules/lines-and-columns/build/index.cjs +1 -1
- package/dist/_node_modules/lines-and-columns/build/index.js +1 -1
- package/dist/_node_modules/meow/_node_modules/find-up/index.cjs +2 -2
- package/dist/_node_modules/meow/_node_modules/find-up/index.cjs.map +1 -1
- package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/index.cjs +1 -1
- package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/index.js +1 -1
- package/dist/_node_modules/meow/_node_modules/locate-path/index.cjs +2 -2
- package/dist/_node_modules/meow/_node_modules/locate-path/index.cjs.map +1 -1
- package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/hosted-git-info/index.cjs +1 -1
- package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/hosted-git-info/index.js +1 -1
- package/dist/_node_modules/meow/_node_modules/read-pkg/index.cjs +2 -2
- package/dist/_node_modules/meow/_node_modules/read-pkg/index.cjs.map +1 -1
- package/dist/_node_modules/meow/index.cjs +2 -2
- package/dist/_node_modules/meow/index.cjs.map +1 -1
- package/dist/_node_modules/merge-stream/index.cjs +39 -0
- package/dist/_node_modules/merge-stream/index.cjs.map +1 -0
- package/dist/_node_modules/merge-stream/index.js +40 -0
- package/dist/_node_modules/merge-stream/index.js.map +1 -0
- package/dist/_node_modules/parse-json/index.cjs +2 -2
- package/dist/_node_modules/parse-json/index.js +2 -2
- package/dist/_node_modules/path-key/index.cjs +16 -0
- package/dist/_node_modules/path-key/index.cjs.map +1 -0
- package/dist/_node_modules/path-key/index.js +16 -0
- package/dist/_node_modules/path-key/index.js.map +1 -0
- package/dist/_node_modules/path-type/index.cjs +1 -1
- package/dist/_node_modules/path-type/index.js +1 -1
- package/dist/_node_modules/shebang-command/index.cjs +18 -0
- package/dist/_node_modules/shebang-command/index.cjs.map +1 -0
- package/dist/_node_modules/shebang-command/index.js +18 -0
- package/dist/_node_modules/shebang-command/index.js.map +1 -0
- package/dist/_node_modules/shebang-regex/index.cjs +5 -0
- package/dist/_node_modules/shebang-regex/index.cjs.map +1 -0
- package/dist/_node_modules/shebang-regex/index.js +5 -0
- package/dist/_node_modules/shebang-regex/index.js.map +1 -0
- package/dist/_node_modules/signal-exit/index.cjs +150 -0
- package/dist/_node_modules/signal-exit/index.cjs.map +1 -0
- package/dist/_node_modules/signal-exit/index.js +151 -0
- package/dist/_node_modules/signal-exit/index.js.map +1 -0
- package/dist/_node_modules/signal-exit/signals.cjs +45 -0
- package/dist/_node_modules/signal-exit/signals.cjs.map +1 -0
- package/dist/_node_modules/signal-exit/signals.js +45 -0
- package/dist/_node_modules/signal-exit/signals.js.map +1 -0
- package/dist/_node_modules/which/which.cjs +96 -0
- package/dist/_node_modules/which/which.cjs.map +1 -0
- package/dist/_node_modules/which/which.js +96 -0
- package/dist/_node_modules/which/which.js.map +1 -0
- package/dist/_virtual/escape.cjs +5 -0
- package/dist/_virtual/escape.cjs.map +1 -0
- package/dist/_virtual/escape.js +5 -0
- package/dist/_virtual/escape.js.map +1 -0
- package/dist/_virtual/index10.cjs +2 -2
- package/dist/_virtual/index10.js +2 -2
- package/dist/_virtual/index11.cjs +2 -2
- package/dist/_virtual/index11.js +2 -2
- package/dist/_virtual/index12.cjs +2 -2
- package/dist/_virtual/index12.js +2 -2
- package/dist/_virtual/index13.cjs +2 -2
- package/dist/_virtual/index13.js +2 -2
- package/dist/_virtual/index14.cjs +2 -2
- package/dist/_virtual/index14.js +2 -2
- package/dist/_virtual/index15.cjs +2 -2
- package/dist/_virtual/index15.js +2 -2
- package/dist/_virtual/index16.cjs +2 -2
- package/dist/_virtual/index16.js +2 -2
- package/dist/_virtual/index17.cjs +2 -2
- package/dist/_virtual/index17.js +2 -2
- package/dist/_virtual/index18.cjs +5 -0
- package/dist/_virtual/index18.cjs.map +1 -0
- package/dist/_virtual/index18.js +5 -0
- package/dist/_virtual/index18.js.map +1 -0
- package/dist/_virtual/index19.cjs +5 -0
- package/dist/_virtual/index19.cjs.map +1 -0
- package/dist/_virtual/index19.js +5 -0
- package/dist/_virtual/index19.js.map +1 -0
- package/dist/_virtual/index20.cjs +5 -0
- package/dist/_virtual/index20.cjs.map +1 -0
- package/dist/_virtual/index20.js +5 -0
- package/dist/_virtual/index20.js.map +1 -0
- package/dist/_virtual/index21.cjs +5 -0
- package/dist/_virtual/index21.cjs.map +1 -0
- package/dist/_virtual/index21.js +5 -0
- package/dist/_virtual/index21.js.map +1 -0
- package/dist/_virtual/index4.cjs +2 -2
- package/dist/_virtual/index4.js +2 -2
- package/dist/_virtual/index5.cjs +2 -2
- package/dist/_virtual/index5.js +2 -2
- package/dist/_virtual/index6.cjs +2 -2
- package/dist/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.cjs +2 -2
- package/dist/_virtual/index7.js +2 -2
- package/dist/_virtual/index8.cjs +2 -2
- package/dist/_virtual/index8.js +2 -2
- package/dist/_virtual/index9.cjs +2 -2
- package/dist/_virtual/index9.js +2 -2
- package/dist/_virtual/signals.cjs +5 -0
- package/dist/_virtual/signals.cjs.map +1 -0
- package/dist/_virtual/signals.js +5 -0
- package/dist/_virtual/signals.js.map +1 -0
- package/dist/cli.cjs +5 -0
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +5 -0
- package/dist/cli.js.map +1 -1
- package/dist/packages/init/package.json.cjs +5 -5
- package/dist/packages/init/package.json.js +5 -5
- package/package.json +5 -5
- package/src/SliceMachineInitProcess.ts +64 -36
- package/src/cli.ts +5 -0
package/dist/cli.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.cjs","sources":["../../src/cli.ts"],"sourcesContent":["import meow from \"meow\";\n\nimport { name as pkgName, version as pkgVersion } from \"../package.json\";\nimport { createSliceMachineInitProcess } from \"./SliceMachineInitProcess\";\n\nconst cli = meow(\n\t`\nPrismic Slice Machine Init CLI\n\nDOCUMENTATION\n https://prismic.io/docs\n\nVERSION\n ${pkgName}@${pkgVersion}\n\nUSAGE\n $ npx @slicemachine/init\n\nOPTIONS\n --repository, -r Specify a Prismic repository to use\n\n --no-push For starters, prevent anything from being pushed\n --no-push-slices For starters, prevent slices from being pushed\n --no-push-custom-types For starters, prevent types from being pushed\n --no-push-documents For starters, prevent documents from being pushed\n\n --help, -h Display CLI help\n --version, -v Display CLI version\n`,\n\t{\n\t\timportMeta: import.meta,\n\t\tflags: {\n\t\t\trepository: {\n\t\t\t\ttype: \"string\",\n\t\t\t\talias: \"r\",\n\t\t\t},\n\t\t\tpush: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: true,\n\t\t\t},\n\t\t\tpushSlices: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: true,\n\t\t\t},\n\t\t\tpushCustomTypes: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: true,\n\t\t\t},\n\t\t\tpushDocuments: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: true,\n\t\t\t},\n\t\t\thelp: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\talias: \"h\",\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t\tversion: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\talias: \"v\",\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t},\n\t\tdescription: false,\n\t\tautoHelp: false,\n\t\tautoVersion: false,\n\t\tallowUnknownFlags: false,\n\t},\n);\n\nif (cli.flags.help) {\n\tcli.showHelp();\n} else if (cli.flags.version) {\n\t// eslint-disable-next-line no-console\n\tconsole.log(`${pkgName}@${pkgVersion}`);\n\tprocess.exit(0);\n} else {\n\tconst initProcess = createSliceMachineInitProcess({\n\t\t...cli.flags,\n\t\tinput: cli.input,\n\t});\n\n\tinitProcess.run();\n}\n"],"names":["meow","pkgName","pkgVersion","createSliceMachineInitProcess"],"mappings":";;;;AAKA,MAAM,MAAMA,MACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOGC,SAAW,QAAAC
|
|
1
|
+
{"version":3,"file":"cli.cjs","sources":["../../src/cli.ts"],"sourcesContent":["import meow from \"meow\";\n\nimport { name as pkgName, version as pkgVersion } from \"../package.json\";\nimport { createSliceMachineInitProcess } from \"./SliceMachineInitProcess\";\n\nconst cli = meow(\n\t`\nPrismic Slice Machine Init CLI\n\nDOCUMENTATION\n https://prismic.io/docs\n\nVERSION\n ${pkgName}@${pkgVersion}\n\nUSAGE\n $ npx @slicemachine/init\n\nOPTIONS\n --repository, -r Specify a Prismic repository to use\n\n --no-push For starters, prevent anything from being pushed\n --no-push-slices For starters, prevent slices from being pushed\n --no-push-custom-types For starters, prevent types from being pushed\n --no-push-documents For starters, prevent documents from being pushed\n --no-start-slicemachine Prevents init from running SliceMachine\n\n --help, -h Display CLI help\n --version, -v Display CLI version\n`,\n\t{\n\t\timportMeta: import.meta,\n\t\tflags: {\n\t\t\trepository: {\n\t\t\t\ttype: \"string\",\n\t\t\t\talias: \"r\",\n\t\t\t},\n\t\t\tpush: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: true,\n\t\t\t},\n\t\t\tpushSlices: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: true,\n\t\t\t},\n\t\t\tpushCustomTypes: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: true,\n\t\t\t},\n\t\t\tpushDocuments: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: true,\n\t\t\t},\n\t\t\tstartSlicemachine: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: true,\n\t\t\t},\n\t\t\thelp: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\talias: \"h\",\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t\tversion: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\talias: \"v\",\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t},\n\t\tdescription: false,\n\t\tautoHelp: false,\n\t\tautoVersion: false,\n\t\tallowUnknownFlags: false,\n\t},\n);\n\nif (cli.flags.help) {\n\tcli.showHelp();\n} else if (cli.flags.version) {\n\t// eslint-disable-next-line no-console\n\tconsole.log(`${pkgName}@${pkgVersion}`);\n\tprocess.exit(0);\n} else {\n\tconst initProcess = createSliceMachineInitProcess({\n\t\t...cli.flags,\n\t\tinput: cli.input,\n\t});\n\n\tinitProcess.run();\n}\n"],"names":["meow","pkgName","pkgVersion","createSliceMachineInitProcess"],"mappings":";;;;AAKA,MAAM,MAAMA,MACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOGC,SAAW,QAAAC;;;;;;;;;;;;;;;;GAiBd;AAAA,EACC,YAAY,EAAA,KAAA,OAAA,aAAA,cAAA,QAAA,KAAA,EAAA,cAAA,UAAA,EAAA,OAAA,SAAA,iBAAA,SAAA,cAAA,OAAA,IAAA,IAAA,WAAA,SAAA,OAAA,EAAA,KAAA;AAAA,EACZ,OAAO;AAAA,IACN,YAAY;AAAA,MACX,MAAM;AAAA,MACN,OAAO;AAAA,IACP;AAAA,IACD,MAAM;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,IACT;AAAA,IACD,YAAY;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA,IACT;AAAA,IACD,iBAAiB;AAAA,MAChB,MAAM;AAAA,MACN,SAAS;AAAA,IACT;AAAA,IACD,eAAe;AAAA,MACd,MAAM;AAAA,MACN,SAAS;AAAA,IACT;AAAA,IACD,mBAAmB;AAAA,MAClB,MAAM;AAAA,MACN,SAAS;AAAA,IACT;AAAA,IACD,MAAM;AAAA,MACL,MAAM;AAAA,MACN,OAAO;AAAA,MACP,SAAS;AAAA,IACT;AAAA,IACD,SAAS;AAAA,MACR,MAAM;AAAA,MACN,OAAO;AAAA,MACP,SAAS;AAAA,IACT;AAAA,EACD;AAAA,EACD,aAAa;AAAA,EACb,UAAU;AAAA,EACV,aAAa;AAAA,EACb,mBAAmB;AACnB,CAAA;AAGF,IAAI,IAAI,MAAM,MAAM;AACnB,MAAI,SAAQ;AACZ,WAAU,IAAI,MAAM,SAAS;AAErB,UAAA,IAAI,GAAGD,SAAAA,QAAWC,SAAAA,SAAY;AACtC,UAAQ,KAAK,CAAC;AACd,OAAM;AACN,QAAM,cAAcC,wBAAAA,8BAA8B;AAAA,IACjD,GAAG,IAAI;AAAA,IACP,OAAO,IAAI;AAAA,EAAA,CACX;AAED,cAAY,IAAG;AACf;"}
|
package/dist/cli.js
CHANGED
|
@@ -20,6 +20,7 @@ OPTIONS
|
|
|
20
20
|
--no-push-slices For starters, prevent slices from being pushed
|
|
21
21
|
--no-push-custom-types For starters, prevent types from being pushed
|
|
22
22
|
--no-push-documents For starters, prevent documents from being pushed
|
|
23
|
+
--no-start-slicemachine Prevents init from running SliceMachine
|
|
23
24
|
|
|
24
25
|
--help, -h Display CLI help
|
|
25
26
|
--version, -v Display CLI version
|
|
@@ -46,6 +47,10 @@ OPTIONS
|
|
|
46
47
|
type: "boolean",
|
|
47
48
|
default: true
|
|
48
49
|
},
|
|
50
|
+
startSlicemachine: {
|
|
51
|
+
type: "boolean",
|
|
52
|
+
default: true
|
|
53
|
+
},
|
|
49
54
|
help: {
|
|
50
55
|
type: "boolean",
|
|
51
56
|
alias: "h",
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sources":["../../src/cli.ts"],"sourcesContent":["import meow from \"meow\";\n\nimport { name as pkgName, version as pkgVersion } from \"../package.json\";\nimport { createSliceMachineInitProcess } from \"./SliceMachineInitProcess\";\n\nconst cli = meow(\n\t`\nPrismic Slice Machine Init CLI\n\nDOCUMENTATION\n https://prismic.io/docs\n\nVERSION\n ${pkgName}@${pkgVersion}\n\nUSAGE\n $ npx @slicemachine/init\n\nOPTIONS\n --repository, -r Specify a Prismic repository to use\n\n --no-push For starters, prevent anything from being pushed\n --no-push-slices For starters, prevent slices from being pushed\n --no-push-custom-types For starters, prevent types from being pushed\n --no-push-documents For starters, prevent documents from being pushed\n\n --help, -h Display CLI help\n --version, -v Display CLI version\n`,\n\t{\n\t\timportMeta: import.meta,\n\t\tflags: {\n\t\t\trepository: {\n\t\t\t\ttype: \"string\",\n\t\t\t\talias: \"r\",\n\t\t\t},\n\t\t\tpush: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: true,\n\t\t\t},\n\t\t\tpushSlices: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: true,\n\t\t\t},\n\t\t\tpushCustomTypes: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: true,\n\t\t\t},\n\t\t\tpushDocuments: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: true,\n\t\t\t},\n\t\t\thelp: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\talias: \"h\",\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t\tversion: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\talias: \"v\",\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t},\n\t\tdescription: false,\n\t\tautoHelp: false,\n\t\tautoVersion: false,\n\t\tallowUnknownFlags: false,\n\t},\n);\n\nif (cli.flags.help) {\n\tcli.showHelp();\n} else if (cli.flags.version) {\n\t// eslint-disable-next-line no-console\n\tconsole.log(`${pkgName}@${pkgVersion}`);\n\tprocess.exit(0);\n} else {\n\tconst initProcess = createSliceMachineInitProcess({\n\t\t...cli.flags,\n\t\tinput: cli.input,\n\t});\n\n\tinitProcess.run();\n}\n"],"names":["pkgName","pkgVersion"],"mappings":";;;AAKA,MAAM,MAAM,KACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOGA,QAAWC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,
|
|
1
|
+
{"version":3,"file":"cli.js","sources":["../../src/cli.ts"],"sourcesContent":["import meow from \"meow\";\n\nimport { name as pkgName, version as pkgVersion } from \"../package.json\";\nimport { createSliceMachineInitProcess } from \"./SliceMachineInitProcess\";\n\nconst cli = meow(\n\t`\nPrismic Slice Machine Init CLI\n\nDOCUMENTATION\n https://prismic.io/docs\n\nVERSION\n ${pkgName}@${pkgVersion}\n\nUSAGE\n $ npx @slicemachine/init\n\nOPTIONS\n --repository, -r Specify a Prismic repository to use\n\n --no-push For starters, prevent anything from being pushed\n --no-push-slices For starters, prevent slices from being pushed\n --no-push-custom-types For starters, prevent types from being pushed\n --no-push-documents For starters, prevent documents from being pushed\n --no-start-slicemachine Prevents init from running SliceMachine\n\n --help, -h Display CLI help\n --version, -v Display CLI version\n`,\n\t{\n\t\timportMeta: import.meta,\n\t\tflags: {\n\t\t\trepository: {\n\t\t\t\ttype: \"string\",\n\t\t\t\talias: \"r\",\n\t\t\t},\n\t\t\tpush: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: true,\n\t\t\t},\n\t\t\tpushSlices: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: true,\n\t\t\t},\n\t\t\tpushCustomTypes: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: true,\n\t\t\t},\n\t\t\tpushDocuments: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: true,\n\t\t\t},\n\t\t\tstartSlicemachine: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\tdefault: true,\n\t\t\t},\n\t\t\thelp: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\talias: \"h\",\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t\tversion: {\n\t\t\t\ttype: \"boolean\",\n\t\t\t\talias: \"v\",\n\t\t\t\tdefault: false,\n\t\t\t},\n\t\t},\n\t\tdescription: false,\n\t\tautoHelp: false,\n\t\tautoVersion: false,\n\t\tallowUnknownFlags: false,\n\t},\n);\n\nif (cli.flags.help) {\n\tcli.showHelp();\n} else if (cli.flags.version) {\n\t// eslint-disable-next-line no-console\n\tconsole.log(`${pkgName}@${pkgVersion}`);\n\tprocess.exit(0);\n} else {\n\tconst initProcess = createSliceMachineInitProcess({\n\t\t...cli.flags,\n\t\tinput: cli.input,\n\t});\n\n\tinitProcess.run();\n}\n"],"names":["pkgName","pkgVersion"],"mappings":";;;AAKA,MAAM,MAAM,KACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOGA,QAAWC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,GAiBd;AAAA,EACC,YAAY;AAAA,EACZ,OAAO;AAAA,IACN,YAAY;AAAA,MACX,MAAM;AAAA,MACN,OAAO;AAAA,IACP;AAAA,IACD,MAAM;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,IACT;AAAA,IACD,YAAY;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA,IACT;AAAA,IACD,iBAAiB;AAAA,MAChB,MAAM;AAAA,MACN,SAAS;AAAA,IACT;AAAA,IACD,eAAe;AAAA,MACd,MAAM;AAAA,MACN,SAAS;AAAA,IACT;AAAA,IACD,mBAAmB;AAAA,MAClB,MAAM;AAAA,MACN,SAAS;AAAA,IACT;AAAA,IACD,MAAM;AAAA,MACL,MAAM;AAAA,MACN,OAAO;AAAA,MACP,SAAS;AAAA,IACT;AAAA,IACD,SAAS;AAAA,MACR,MAAM;AAAA,MACN,OAAO;AAAA,MACP,SAAS;AAAA,IACT;AAAA,EACD;AAAA,EACD,aAAa;AAAA,EACb,UAAU;AAAA,EACV,aAAa;AAAA,EACb,mBAAmB;AACnB,CAAA;AAGF,IAAI,IAAI,MAAM,MAAM;AACnB,MAAI,SAAQ;AACZ,WAAU,IAAI,MAAM,SAAS;AAErB,UAAA,IAAI,GAAGD,QAAWC,SAAY;AACtC,UAAQ,KAAK,CAAC;AACd,OAAM;AACN,QAAM,cAAc,8BAA8B;AAAA,IACjD,GAAG,IAAI;AAAA,IACP,OAAO,IAAI;AAAA,EAAA,CACX;AAED,cAAY,IAAG;AACf;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const name = "@slicemachine/init";
|
|
4
|
-
const version = "2.
|
|
4
|
+
const version = "2.4.0";
|
|
5
5
|
const description = "Init Prismic Slice Machine in your project";
|
|
6
6
|
const keywords = [
|
|
7
7
|
"typescript",
|
|
@@ -42,7 +42,7 @@ const scripts = {
|
|
|
42
42
|
dev: "vite build --watch",
|
|
43
43
|
format: "prettier --write .",
|
|
44
44
|
lint: "eslint --max-warnings 0 --ext .js,.ts .",
|
|
45
|
-
prepack: "
|
|
45
|
+
prepack: "npm run build",
|
|
46
46
|
size: "size-limit",
|
|
47
47
|
test: "yarn lint && yarn types && yarn unit && yarn build && yarn size",
|
|
48
48
|
types: "tsc --noEmit",
|
|
@@ -54,7 +54,7 @@ const scripts = {
|
|
|
54
54
|
const dependencies = {
|
|
55
55
|
"@antfu/ni": "^0.20.0",
|
|
56
56
|
"@lihbr/listr-update-renderer": "^0.5.3",
|
|
57
|
-
"@slicemachine/manager": "^0.8.1
|
|
57
|
+
"@slicemachine/manager": "^0.8.1",
|
|
58
58
|
chalk: "^4.1.2",
|
|
59
59
|
globby: "^13.1.3",
|
|
60
60
|
listr: "^0.14.3",
|
|
@@ -66,7 +66,7 @@ const dependencies = {
|
|
|
66
66
|
};
|
|
67
67
|
const devDependencies = {
|
|
68
68
|
"@size-limit/preset-small-lib": "8.2.4",
|
|
69
|
-
"@slicemachine/plugin-kit": "0.4.8
|
|
69
|
+
"@slicemachine/plugin-kit": "0.4.8",
|
|
70
70
|
"@types/listr": "0.14.4",
|
|
71
71
|
"@types/prompts": "2.4.3",
|
|
72
72
|
"@types/semver": "7.3.13",
|
|
@@ -92,7 +92,7 @@ const devDependencies = {
|
|
|
92
92
|
"vite-plugin-sdk": "0.1.1",
|
|
93
93
|
vitest: "0.32.0"
|
|
94
94
|
};
|
|
95
|
-
const gitHead = "
|
|
95
|
+
const gitHead = "134dccabe13505d0ad23e410c0146621bff43e7f";
|
|
96
96
|
const pkg = {
|
|
97
97
|
name,
|
|
98
98
|
version,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const name = "@slicemachine/init";
|
|
2
|
-
const version = "2.
|
|
2
|
+
const version = "2.4.0";
|
|
3
3
|
const description = "Init Prismic Slice Machine in your project";
|
|
4
4
|
const keywords = [
|
|
5
5
|
"typescript",
|
|
@@ -40,7 +40,7 @@ const scripts = {
|
|
|
40
40
|
dev: "vite build --watch",
|
|
41
41
|
format: "prettier --write .",
|
|
42
42
|
lint: "eslint --max-warnings 0 --ext .js,.ts .",
|
|
43
|
-
prepack: "
|
|
43
|
+
prepack: "npm run build",
|
|
44
44
|
size: "size-limit",
|
|
45
45
|
test: "yarn lint && yarn types && yarn unit && yarn build && yarn size",
|
|
46
46
|
types: "tsc --noEmit",
|
|
@@ -52,7 +52,7 @@ const scripts = {
|
|
|
52
52
|
const dependencies = {
|
|
53
53
|
"@antfu/ni": "^0.20.0",
|
|
54
54
|
"@lihbr/listr-update-renderer": "^0.5.3",
|
|
55
|
-
"@slicemachine/manager": "^0.8.1
|
|
55
|
+
"@slicemachine/manager": "^0.8.1",
|
|
56
56
|
chalk: "^4.1.2",
|
|
57
57
|
globby: "^13.1.3",
|
|
58
58
|
listr: "^0.14.3",
|
|
@@ -64,7 +64,7 @@ const dependencies = {
|
|
|
64
64
|
};
|
|
65
65
|
const devDependencies = {
|
|
66
66
|
"@size-limit/preset-small-lib": "8.2.4",
|
|
67
|
-
"@slicemachine/plugin-kit": "0.4.8
|
|
67
|
+
"@slicemachine/plugin-kit": "0.4.8",
|
|
68
68
|
"@types/listr": "0.14.4",
|
|
69
69
|
"@types/prompts": "2.4.3",
|
|
70
70
|
"@types/semver": "7.3.13",
|
|
@@ -90,7 +90,7 @@ const devDependencies = {
|
|
|
90
90
|
"vite-plugin-sdk": "0.1.1",
|
|
91
91
|
vitest: "0.32.0"
|
|
92
92
|
};
|
|
93
|
-
const gitHead = "
|
|
93
|
+
const gitHead = "134dccabe13505d0ad23e410c0146621bff43e7f";
|
|
94
94
|
const pkg = {
|
|
95
95
|
name,
|
|
96
96
|
version,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slicemachine/init",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Init Prismic Slice Machine in your project",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dev": "vite build --watch",
|
|
42
42
|
"format": "prettier --write .",
|
|
43
43
|
"lint": "eslint --max-warnings 0 --ext .js,.ts .",
|
|
44
|
-
"prepack": "
|
|
44
|
+
"prepack": "npm run build",
|
|
45
45
|
"size": "size-limit",
|
|
46
46
|
"test": "yarn lint && yarn types && yarn unit && yarn build && yarn size",
|
|
47
47
|
"types": "tsc --noEmit",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@antfu/ni": "^0.20.0",
|
|
55
55
|
"@lihbr/listr-update-renderer": "^0.5.3",
|
|
56
|
-
"@slicemachine/manager": "^0.8.1
|
|
56
|
+
"@slicemachine/manager": "^0.8.1",
|
|
57
57
|
"chalk": "^4.1.2",
|
|
58
58
|
"globby": "^13.1.3",
|
|
59
59
|
"listr": "^0.14.3",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@size-limit/preset-small-lib": "8.2.4",
|
|
68
|
-
"@slicemachine/plugin-kit": "0.4.8
|
|
68
|
+
"@slicemachine/plugin-kit": "0.4.8",
|
|
69
69
|
"@types/listr": "0.14.4",
|
|
70
70
|
"@types/prompts": "2.4.3",
|
|
71
71
|
"@types/semver": "7.3.13",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"vite-plugin-sdk": "0.1.1",
|
|
92
92
|
"vitest": "0.32.0"
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "134dccabe13505d0ad23e410c0146621bff43e7f"
|
|
95
95
|
}
|
|
@@ -2,7 +2,9 @@ import * as fs from "node:fs/promises";
|
|
|
2
2
|
import * as path from "node:path";
|
|
3
3
|
|
|
4
4
|
import chalk from "chalk";
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
import { execaCommand, type ExecaChildProcess } from "execa";
|
|
7
|
+
|
|
6
8
|
import open from "open";
|
|
7
9
|
import logSymbols from "log-symbols";
|
|
8
10
|
import { globby } from "globby";
|
|
@@ -39,6 +41,7 @@ export type SliceMachineInitProcessOptions = {
|
|
|
39
41
|
pushSlices?: boolean;
|
|
40
42
|
pushCustomTypes?: boolean;
|
|
41
43
|
pushDocuments?: boolean;
|
|
44
|
+
startSlicemachine?: boolean;
|
|
42
45
|
cwd?: string;
|
|
43
46
|
} & Record<string, unknown>;
|
|
44
47
|
|
|
@@ -47,6 +50,7 @@ const DEFAULT_OPTIONS: SliceMachineInitProcessOptions = {
|
|
|
47
50
|
pushSlices: true,
|
|
48
51
|
pushCustomTypes: true,
|
|
49
52
|
pushDocuments: true,
|
|
53
|
+
startSlicemachine: true,
|
|
50
54
|
};
|
|
51
55
|
|
|
52
56
|
export const createSliceMachineInitProcess = (
|
|
@@ -174,35 +178,7 @@ export class SliceMachineInitProcess {
|
|
|
174
178
|
);
|
|
175
179
|
|
|
176
180
|
try {
|
|
177
|
-
const
|
|
178
|
-
const wroomHost = new URL(apiEndpoints.PrismicWroom).host;
|
|
179
|
-
|
|
180
|
-
const dashboardURL = new URL(
|
|
181
|
-
`https://${this.context.repository.domain}.${wroomHost}`,
|
|
182
|
-
)
|
|
183
|
-
.toString()
|
|
184
|
-
.replace(/\/$/, "");
|
|
185
|
-
const apiURL = new URL(
|
|
186
|
-
"./api/v2",
|
|
187
|
-
`https://${this.context.repository.domain}.cdn.${wroomHost}`,
|
|
188
|
-
).toString();
|
|
189
|
-
|
|
190
|
-
// We prefer to manually allow console logs despite the app being a CLI to catch wild/unwanted console logs better
|
|
191
|
-
// eslint-disable-next-line no-console
|
|
192
|
-
console.log(`
|
|
193
|
-
YOUR REPOSITORY
|
|
194
|
-
Dashboard ${chalk.cyan(dashboardURL)}
|
|
195
|
-
API ${chalk.cyan(apiURL)}
|
|
196
|
-
|
|
197
|
-
RESOURCES
|
|
198
|
-
Documentation ${chalk.cyan(
|
|
199
|
-
this.context.framework.prismicDocumentation,
|
|
200
|
-
)}
|
|
201
|
-
Getting help ${chalk.cyan("https://community.prismic.io")}
|
|
202
|
-
|
|
203
|
-
GETTING STARTED
|
|
204
|
-
Run Slice Machine ${chalk.cyan(
|
|
205
|
-
this.context.projectInitialization?.patchedScript
|
|
181
|
+
const runSmCommand = this.context.projectInitialization?.patchedScript
|
|
206
182
|
? await getRunScriptCommand({
|
|
207
183
|
agent: this.context.packageManager || "npm",
|
|
208
184
|
script: "slicemachine",
|
|
@@ -210,14 +186,66 @@ export class SliceMachineInitProcess {
|
|
|
210
186
|
: await getExecuteCommand({
|
|
211
187
|
agent: this.context.packageManager || "npm",
|
|
212
188
|
script: "start-slicemachine",
|
|
213
|
-
})
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
await getRunScriptCommand({
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
const runProjectCommand = await getRunScriptCommand({
|
|
217
192
|
agent: this.context.packageManager || "npm",
|
|
218
193
|
script: "dev",
|
|
219
|
-
})
|
|
220
|
-
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
// We prefer to manually allow console logs despite the app being a CLI to catch wild/unwanted console logs better
|
|
197
|
+
// eslint-disable-next-line no-console
|
|
198
|
+
console.log(`
|
|
199
|
+
GETTING STARTED
|
|
200
|
+
Run Slice Machine ${chalk.cyan(runSmCommand)}
|
|
201
|
+
Run your project ${chalk.cyan(runProjectCommand)}
|
|
202
|
+
`);
|
|
203
|
+
|
|
204
|
+
if (this.options.startSlicemachine) {
|
|
205
|
+
const pkgJSONPath = path.join(this.manager.cwd, "package.json");
|
|
206
|
+
const pkg = JSON.parse(await fs.readFile(pkgJSONPath, "utf-8"));
|
|
207
|
+
const scripts = pkg.scripts || {};
|
|
208
|
+
|
|
209
|
+
const finalSmCommand = (() => {
|
|
210
|
+
if (
|
|
211
|
+
scripts["dev"] &&
|
|
212
|
+
typeof scripts["dev"] === "string" &&
|
|
213
|
+
scripts["dev"].includes(":slicemachine")
|
|
214
|
+
) {
|
|
215
|
+
return {
|
|
216
|
+
command: runProjectCommand,
|
|
217
|
+
message: `Would you like to launch your project + Slicemachine (${runProjectCommand})?`,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
return {
|
|
222
|
+
command: runSmCommand,
|
|
223
|
+
message: `Would you like to launch Slicemachine (${runSmCommand})?`,
|
|
224
|
+
};
|
|
225
|
+
})();
|
|
226
|
+
const { startSlicemachine } = await prompt<
|
|
227
|
+
boolean,
|
|
228
|
+
"startSlicemachine"
|
|
229
|
+
>({
|
|
230
|
+
type: "confirm",
|
|
231
|
+
name: "startSlicemachine",
|
|
232
|
+
message: finalSmCommand.message,
|
|
233
|
+
initial: true,
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
if (startSlicemachine) {
|
|
237
|
+
const commandReturnValue = await execaCommand(
|
|
238
|
+
finalSmCommand.command,
|
|
239
|
+
{
|
|
240
|
+
env: { FORCE_COLOR: "true" },
|
|
241
|
+
},
|
|
242
|
+
).pipeStdout?.(process.stdout);
|
|
243
|
+
if (commandReturnValue !== undefined) {
|
|
244
|
+
// eslint-disable-next-line no-console
|
|
245
|
+
console.log(commandReturnValue.stdout);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
221
249
|
} catch {
|
|
222
250
|
// Noop, it's only the final convenience messsage
|
|
223
251
|
}
|
package/src/cli.ts
CHANGED
|
@@ -23,6 +23,7 @@ OPTIONS
|
|
|
23
23
|
--no-push-slices For starters, prevent slices from being pushed
|
|
24
24
|
--no-push-custom-types For starters, prevent types from being pushed
|
|
25
25
|
--no-push-documents For starters, prevent documents from being pushed
|
|
26
|
+
--no-start-slicemachine Prevents init from running SliceMachine
|
|
26
27
|
|
|
27
28
|
--help, -h Display CLI help
|
|
28
29
|
--version, -v Display CLI version
|
|
@@ -50,6 +51,10 @@ OPTIONS
|
|
|
50
51
|
type: "boolean",
|
|
51
52
|
default: true,
|
|
52
53
|
},
|
|
54
|
+
startSlicemachine: {
|
|
55
|
+
type: "boolean",
|
|
56
|
+
default: true,
|
|
57
|
+
},
|
|
53
58
|
help: {
|
|
54
59
|
type: "boolean",
|
|
55
60
|
alias: "h",
|