create-leo-app 0.7.3 → 0.8.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 +3 -3
- package/dist/index.mjs +38 -38
- package/package.json +5 -7
- package/template-extension/package.json +4 -4
- package/template-nextjs-ts/package.json +9 -9
- package/template-node/package.json +2 -2
- package/template-node-ts/package.json +5 -5
- package/template-offline-public-transaction-ts/package.json +5 -5
- package/template-react-leo/README.md +3 -8
- package/template-react-leo/package.json +23 -23
- package/template-react-leo/vite.config.js +2 -1
- package/template-react-managed-worker/README.md +1 -3
- package/template-react-managed-worker/package.json +22 -22
- package/template-react-managed-worker/vite.config.js +2 -1
- package/template-react-ts/README.md +3 -8
- package/template-react-ts/package.json +28 -28
- package/template-react-ts/vite.config.ts +2 -1
- package/template-vanilla/package.json +3 -3
- package/template-vanilla/vite.config.js +3 -1
- package/template-nextjs-ts/node_modules/@types/node/LICENSE +0 -21
- package/template-nextjs-ts/node_modules/@types/node/README.md +0 -15
- package/template-nextjs-ts/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/template-nextjs-ts/node_modules/@types/node/assert.d.ts +0 -1040
- package/template-nextjs-ts/node_modules/@types/node/async_hooks.d.ts +0 -541
- package/template-nextjs-ts/node_modules/@types/node/buffer.d.ts +0 -2301
- package/template-nextjs-ts/node_modules/@types/node/child_process.d.ts +0 -1544
- package/template-nextjs-ts/node_modules/@types/node/cluster.d.ts +0 -578
- package/template-nextjs-ts/node_modules/@types/node/console.d.ts +0 -452
- package/template-nextjs-ts/node_modules/@types/node/constants.d.ts +0 -19
- package/template-nextjs-ts/node_modules/@types/node/crypto.d.ts +0 -4524
- package/template-nextjs-ts/node_modules/@types/node/dgram.d.ts +0 -596
- package/template-nextjs-ts/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
- package/template-nextjs-ts/node_modules/@types/node/dns/promises.d.ts +0 -476
- package/template-nextjs-ts/node_modules/@types/node/dns.d.ts +0 -864
- package/template-nextjs-ts/node_modules/@types/node/dom-events.d.ts +0 -124
- package/template-nextjs-ts/node_modules/@types/node/domain.d.ts +0 -170
- package/template-nextjs-ts/node_modules/@types/node/events.d.ts +0 -931
- package/template-nextjs-ts/node_modules/@types/node/fs/promises.d.ts +0 -1245
- package/template-nextjs-ts/node_modules/@types/node/fs.d.ts +0 -4317
- package/template-nextjs-ts/node_modules/@types/node/globals.d.ts +0 -503
- package/template-nextjs-ts/node_modules/@types/node/globals.global.d.ts +0 -1
- package/template-nextjs-ts/node_modules/@types/node/http.d.ts +0 -1908
- package/template-nextjs-ts/node_modules/@types/node/http2.d.ts +0 -2418
- package/template-nextjs-ts/node_modules/@types/node/https.d.ts +0 -550
- package/template-nextjs-ts/node_modules/@types/node/index.d.ts +0 -89
- package/template-nextjs-ts/node_modules/@types/node/inspector.d.ts +0 -3696
- package/template-nextjs-ts/node_modules/@types/node/module.d.ts +0 -315
- package/template-nextjs-ts/node_modules/@types/node/net.d.ts +0 -999
- package/template-nextjs-ts/node_modules/@types/node/os.d.ts +0 -495
- package/template-nextjs-ts/node_modules/@types/node/package.json +0 -217
- package/template-nextjs-ts/node_modules/@types/node/path.d.ts +0 -191
- package/template-nextjs-ts/node_modules/@types/node/perf_hooks.d.ts +0 -934
- package/template-nextjs-ts/node_modules/@types/node/process.d.ts +0 -1879
- package/template-nextjs-ts/node_modules/@types/node/punycode.d.ts +0 -117
- package/template-nextjs-ts/node_modules/@types/node/querystring.d.ts +0 -153
- package/template-nextjs-ts/node_modules/@types/node/readline/promises.d.ts +0 -150
- package/template-nextjs-ts/node_modules/@types/node/readline.d.ts +0 -540
- package/template-nextjs-ts/node_modules/@types/node/repl.d.ts +0 -430
- package/template-nextjs-ts/node_modules/@types/node/sea.d.ts +0 -153
- package/template-nextjs-ts/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/template-nextjs-ts/node_modules/@types/node/stream/promises.d.ts +0 -83
- package/template-nextjs-ts/node_modules/@types/node/stream/web.d.ts +0 -521
- package/template-nextjs-ts/node_modules/@types/node/stream.d.ts +0 -1707
- package/template-nextjs-ts/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/template-nextjs-ts/node_modules/@types/node/test.d.ts +0 -1874
- package/template-nextjs-ts/node_modules/@types/node/timers/promises.d.ts +0 -97
- package/template-nextjs-ts/node_modules/@types/node/timers.d.ts +0 -240
- package/template-nextjs-ts/node_modules/@types/node/tls.d.ts +0 -1217
- package/template-nextjs-ts/node_modules/@types/node/trace_events.d.ts +0 -197
- package/template-nextjs-ts/node_modules/@types/node/tty.d.ts +0 -208
- package/template-nextjs-ts/node_modules/@types/node/url.d.ts +0 -952
- package/template-nextjs-ts/node_modules/@types/node/util.d.ts +0 -2298
- package/template-nextjs-ts/node_modules/@types/node/v8.d.ts +0 -808
- package/template-nextjs-ts/node_modules/@types/node/vm.d.ts +0 -924
- package/template-nextjs-ts/node_modules/@types/node/wasi.d.ts +0 -181
- package/template-nextjs-ts/node_modules/@types/node/worker_threads.d.ts +0 -694
- package/template-nextjs-ts/node_modules/@types/node/zlib.d.ts +0 -539
- package/template-react-ts/node_modules/@types/node/LICENSE +0 -21
- package/template-react-ts/node_modules/@types/node/README.md +0 -15
- package/template-react-ts/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/template-react-ts/node_modules/@types/node/assert.d.ts +0 -1040
- package/template-react-ts/node_modules/@types/node/async_hooks.d.ts +0 -541
- package/template-react-ts/node_modules/@types/node/buffer.d.ts +0 -2301
- package/template-react-ts/node_modules/@types/node/child_process.d.ts +0 -1544
- package/template-react-ts/node_modules/@types/node/cluster.d.ts +0 -578
- package/template-react-ts/node_modules/@types/node/console.d.ts +0 -452
- package/template-react-ts/node_modules/@types/node/constants.d.ts +0 -19
- package/template-react-ts/node_modules/@types/node/crypto.d.ts +0 -4524
- package/template-react-ts/node_modules/@types/node/dgram.d.ts +0 -596
- package/template-react-ts/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
- package/template-react-ts/node_modules/@types/node/dns/promises.d.ts +0 -476
- package/template-react-ts/node_modules/@types/node/dns.d.ts +0 -864
- package/template-react-ts/node_modules/@types/node/dom-events.d.ts +0 -124
- package/template-react-ts/node_modules/@types/node/domain.d.ts +0 -170
- package/template-react-ts/node_modules/@types/node/events.d.ts +0 -931
- package/template-react-ts/node_modules/@types/node/fs/promises.d.ts +0 -1245
- package/template-react-ts/node_modules/@types/node/fs.d.ts +0 -4317
- package/template-react-ts/node_modules/@types/node/globals.d.ts +0 -503
- package/template-react-ts/node_modules/@types/node/globals.global.d.ts +0 -1
- package/template-react-ts/node_modules/@types/node/http.d.ts +0 -1908
- package/template-react-ts/node_modules/@types/node/http2.d.ts +0 -2418
- package/template-react-ts/node_modules/@types/node/https.d.ts +0 -550
- package/template-react-ts/node_modules/@types/node/index.d.ts +0 -89
- package/template-react-ts/node_modules/@types/node/inspector.d.ts +0 -3696
- package/template-react-ts/node_modules/@types/node/module.d.ts +0 -315
- package/template-react-ts/node_modules/@types/node/net.d.ts +0 -999
- package/template-react-ts/node_modules/@types/node/os.d.ts +0 -495
- package/template-react-ts/node_modules/@types/node/package.json +0 -217
- package/template-react-ts/node_modules/@types/node/path.d.ts +0 -191
- package/template-react-ts/node_modules/@types/node/perf_hooks.d.ts +0 -934
- package/template-react-ts/node_modules/@types/node/process.d.ts +0 -1879
- package/template-react-ts/node_modules/@types/node/punycode.d.ts +0 -117
- package/template-react-ts/node_modules/@types/node/querystring.d.ts +0 -153
- package/template-react-ts/node_modules/@types/node/readline/promises.d.ts +0 -150
- package/template-react-ts/node_modules/@types/node/readline.d.ts +0 -540
- package/template-react-ts/node_modules/@types/node/repl.d.ts +0 -430
- package/template-react-ts/node_modules/@types/node/sea.d.ts +0 -153
- package/template-react-ts/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/template-react-ts/node_modules/@types/node/stream/promises.d.ts +0 -83
- package/template-react-ts/node_modules/@types/node/stream/web.d.ts +0 -521
- package/template-react-ts/node_modules/@types/node/stream.d.ts +0 -1707
- package/template-react-ts/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/template-react-ts/node_modules/@types/node/test.d.ts +0 -1874
- package/template-react-ts/node_modules/@types/node/timers/promises.d.ts +0 -97
- package/template-react-ts/node_modules/@types/node/timers.d.ts +0 -240
- package/template-react-ts/node_modules/@types/node/tls.d.ts +0 -1217
- package/template-react-ts/node_modules/@types/node/trace_events.d.ts +0 -197
- package/template-react-ts/node_modules/@types/node/tty.d.ts +0 -208
- package/template-react-ts/node_modules/@types/node/url.d.ts +0 -952
- package/template-react-ts/node_modules/@types/node/util.d.ts +0 -2298
- package/template-react-ts/node_modules/@types/node/v8.d.ts +0 -808
- package/template-react-ts/node_modules/@types/node/vm.d.ts +0 -924
- package/template-react-ts/node_modules/@types/node/wasi.d.ts +0 -181
- package/template-react-ts/node_modules/@types/node/worker_threads.d.ts +0 -694
- package/template-react-ts/node_modules/@types/node/zlib.d.ts +0 -539
- package/template-react-ts/node_modules/diff/CONTRIBUTING.md +0 -39
- package/template-react-ts/node_modules/diff/LICENSE +0 -31
- package/template-react-ts/node_modules/diff/README.md +0 -207
- package/template-react-ts/node_modules/diff/dist/diff.js +0 -1585
- package/template-react-ts/node_modules/diff/dist/diff.min.js +0 -38
- package/template-react-ts/node_modules/diff/lib/convert/dmp.js +0 -32
- package/template-react-ts/node_modules/diff/lib/convert/xml.js +0 -42
- package/template-react-ts/node_modules/diff/lib/diff/array.js +0 -45
- package/template-react-ts/node_modules/diff/lib/diff/base.js +0 -304
- package/template-react-ts/node_modules/diff/lib/diff/character.js +0 -37
- package/template-react-ts/node_modules/diff/lib/diff/css.js +0 -41
- package/template-react-ts/node_modules/diff/lib/diff/json.js +0 -163
- package/template-react-ts/node_modules/diff/lib/diff/line.js +0 -89
- package/template-react-ts/node_modules/diff/lib/diff/sentence.js +0 -41
- package/template-react-ts/node_modules/diff/lib/diff/word.js +0 -107
- package/template-react-ts/node_modules/diff/lib/index.es6.js +0 -1519
- package/template-react-ts/node_modules/diff/lib/index.js +0 -216
- package/template-react-ts/node_modules/diff/lib/patch/apply.js +0 -243
- package/template-react-ts/node_modules/diff/lib/patch/create.js +0 -247
- package/template-react-ts/node_modules/diff/lib/patch/merge.js +0 -609
- package/template-react-ts/node_modules/diff/lib/patch/parse.js +0 -156
- package/template-react-ts/node_modules/diff/lib/util/array.js +0 -32
- package/template-react-ts/node_modules/diff/lib/util/distance-iterator.js +0 -57
- package/template-react-ts/node_modules/diff/lib/util/params.js +0 -24
- package/template-react-ts/node_modules/diff/package.json +0 -73
- package/template-react-ts/node_modules/diff/release-notes.md +0 -261
- package/template-react-ts/node_modules/diff/runtime.js +0 -3
- package/template-react-ts/node_modules/ts-node/LICENSE +0 -21
- package/template-react-ts/node_modules/ts-node/README.md +0 -1442
- package/template-react-ts/node_modules/ts-node/child-loader.mjs +0 -8
- package/template-react-ts/node_modules/ts-node/dist/bin-cwd.d.ts +0 -2
- package/template-react-ts/node_modules/ts-node/dist/bin-cwd.js +0 -6
- package/template-react-ts/node_modules/ts-node/dist/bin-cwd.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/bin-esm.d.ts +0 -2
- package/template-react-ts/node_modules/ts-node/dist/bin-esm.js +0 -6
- package/template-react-ts/node_modules/ts-node/dist/bin-esm.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/bin-script-deprecated.d.ts +0 -2
- package/template-react-ts/node_modules/ts-node/dist/bin-script-deprecated.js +0 -7
- package/template-react-ts/node_modules/ts-node/dist/bin-script-deprecated.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/bin-script.d.ts +0 -2
- package/template-react-ts/node_modules/ts-node/dist/bin-script.js +0 -6
- package/template-react-ts/node_modules/ts-node/dist/bin-script.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/bin-transpile.d.ts +0 -2
- package/template-react-ts/node_modules/ts-node/dist/bin-transpile.js +0 -6
- package/template-react-ts/node_modules/ts-node/dist/bin-transpile.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/bin.d.ts +0 -11
- package/template-react-ts/node_modules/ts-node/dist/bin.js +0 -581
- package/template-react-ts/node_modules/ts-node/dist/bin.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/child/argv-payload.d.ts +0 -1
- package/template-react-ts/node_modules/ts-node/dist/child/argv-payload.js +0 -19
- package/template-react-ts/node_modules/ts-node/dist/child/argv-payload.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/child/child-entrypoint.d.ts +0 -1
- package/template-react-ts/node_modules/ts-node/dist/child/child-entrypoint.js +0 -24
- package/template-react-ts/node_modules/ts-node/dist/child/child-entrypoint.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/child/child-loader.d.ts +0 -1
- package/template-react-ts/node_modules/ts-node/dist/child/child-loader.js +0 -32
- package/template-react-ts/node_modules/ts-node/dist/child/child-loader.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/child/child-require.d.ts +0 -7
- package/template-react-ts/node_modules/ts-node/dist/child/child-require.js +0 -22
- package/template-react-ts/node_modules/ts-node/dist/child/child-require.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/child/spawn-child.d.ts +0 -1
- package/template-react-ts/node_modules/ts-node/dist/child/spawn-child.js +0 -49
- package/template-react-ts/node_modules/ts-node/dist/child/spawn-child.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/cjs-resolve-hooks.d.ts +0 -1
- package/template-react-ts/node_modules/ts-node/dist/cjs-resolve-hooks.js +0 -29
- package/template-react-ts/node_modules/ts-node/dist/cjs-resolve-hooks.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/configuration.d.ts +0 -1
- package/template-react-ts/node_modules/ts-node/dist/configuration.js +0 -308
- package/template-react-ts/node_modules/ts-node/dist/configuration.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/esm.d.ts +0 -53
- package/template-react-ts/node_modules/ts-node/dist/esm.js +0 -228
- package/template-react-ts/node_modules/ts-node/dist/esm.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/file-extensions.d.ts +0 -1
- package/template-react-ts/node_modules/ts-node/dist/file-extensions.js +0 -133
- package/template-react-ts/node_modules/ts-node/dist/file-extensions.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/index.d.ts +0 -332
- package/template-react-ts/node_modules/ts-node/dist/index.js +0 -953
- package/template-react-ts/node_modules/ts-node/dist/index.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/module-type-classifier.d.ts +0 -1
- package/template-react-ts/node_modules/ts-node/dist/module-type-classifier.js +0 -64
- package/template-react-ts/node_modules/ts-node/dist/module-type-classifier.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/node-module-type-classifier.d.ts +0 -1
- package/template-react-ts/node_modules/ts-node/dist/node-module-type-classifier.js +0 -39
- package/template-react-ts/node_modules/ts-node/dist/node-module-type-classifier.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/repl.d.ts +0 -78
- package/template-react-ts/node_modules/ts-node/dist/repl.js +0 -561
- package/template-react-ts/node_modules/ts-node/dist/repl.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/resolver-functions.d.ts +0 -1
- package/template-react-ts/node_modules/ts-node/dist/resolver-functions.js +0 -143
- package/template-react-ts/node_modules/ts-node/dist/resolver-functions.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/transpilers/swc.d.ts +0 -11
- package/template-react-ts/node_modules/ts-node/dist/transpilers/swc.js +0 -218
- package/template-react-ts/node_modules/ts-node/dist/transpilers/swc.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/transpilers/types.d.ts +0 -35
- package/template-react-ts/node_modules/ts-node/dist/transpilers/types.js +0 -3
- package/template-react-ts/node_modules/ts-node/dist/transpilers/types.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/ts-compiler-types.d.ts +0 -63
- package/template-react-ts/node_modules/ts-node/dist/ts-compiler-types.js +0 -3
- package/template-react-ts/node_modules/ts-node/dist/ts-compiler-types.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/ts-internals.d.ts +0 -6
- package/template-react-ts/node_modules/ts-node/dist/ts-internals.js +0 -321
- package/template-react-ts/node_modules/ts-node/dist/ts-internals.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/ts-transpile-module.d.ts +0 -1
- package/template-react-ts/node_modules/ts-node/dist/ts-transpile-module.js +0 -100
- package/template-react-ts/node_modules/ts-node/dist/ts-transpile-module.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/tsconfig-schema.d.ts +0 -13
- package/template-react-ts/node_modules/ts-node/dist/tsconfig-schema.js +0 -3
- package/template-react-ts/node_modules/ts-node/dist/tsconfig-schema.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/tsconfigs.d.ts +0 -1
- package/template-react-ts/node_modules/ts-node/dist/tsconfigs.js +0 -36
- package/template-react-ts/node_modules/ts-node/dist/tsconfigs.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist/util.d.ts +0 -4
- package/template-react-ts/node_modules/ts-node/dist/util.js +0 -175
- package/template-react-ts/node_modules/ts-node/dist/util.js.map +0 -1
- package/template-react-ts/node_modules/ts-node/dist-raw/NODE-LICENSE.md +0 -24
- package/template-react-ts/node_modules/ts-node/dist-raw/README.md +0 -36
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internal-constants.js +0 -4
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internal-errors.js +0 -82
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internal-modules-cjs-helpers.js +0 -89
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internal-modules-cjs-loader.js +0 -593
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internal-modules-esm-get_format.js +0 -106
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js +0 -962
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internal-modules-package_json_reader.js +0 -44
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internal-repl-await.js +0 -254
- package/template-react-ts/node_modules/ts-node/dist-raw/node-internalBinding-fs.js +0 -58
- package/template-react-ts/node_modules/ts-node/dist-raw/node-nativemodule.js +0 -9
- package/template-react-ts/node_modules/ts-node/dist-raw/node-options.js +0 -103
- package/template-react-ts/node_modules/ts-node/dist-raw/node-primordials.js +0 -37
- package/template-react-ts/node_modules/ts-node/dist-raw/runmain-hack.js +0 -9
- package/template-react-ts/node_modules/ts-node/esm/transpile-only.mjs +0 -8
- package/template-react-ts/node_modules/ts-node/esm.mjs +0 -8
- package/template-react-ts/node_modules/ts-node/node10/tsconfig.json +0 -3
- package/template-react-ts/node_modules/ts-node/node12/tsconfig.json +0 -3
- package/template-react-ts/node_modules/ts-node/node14/tsconfig.json +0 -3
- package/template-react-ts/node_modules/ts-node/node16/tsconfig.json +0 -3
- package/template-react-ts/node_modules/ts-node/package.json +0 -182
- package/template-react-ts/node_modules/ts-node/register/files.js +0 -3
- package/template-react-ts/node_modules/ts-node/register/index.js +0 -1
- package/template-react-ts/node_modules/ts-node/register/transpile-only.js +0 -3
- package/template-react-ts/node_modules/ts-node/register/type-check.js +0 -3
- package/template-react-ts/node_modules/ts-node/transpilers/swc-experimental.js +0 -1
- package/template-react-ts/node_modules/ts-node/transpilers/swc.js +0 -1
- package/template-react-ts/node_modules/ts-node/tsconfig.schema.json +0 -183
- package/template-react-ts/node_modules/ts-node/tsconfig.schemastore-schema.json +0 -1326
package/README.md
CHANGED
|
@@ -13,14 +13,14 @@ npm create leo-app@latest
|
|
|
13
13
|
|
|
14
14
|
Then follow the prompts!
|
|
15
15
|
|
|
16
|
-
You can also directly specify the project name
|
|
16
|
+
You can also directly specify the project name you want to use via additional command line options. For example, to scaffold a Leo project, run:
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
19
|
# npm 6.x
|
|
20
|
-
npm create leo-app@latest my-leo-app
|
|
20
|
+
npm create leo-app@latest my-leo-app
|
|
21
21
|
|
|
22
22
|
# npm 7+, extra double-dash is needed:
|
|
23
|
-
npm create leo-app@latest my-leo-app
|
|
23
|
+
npm create leo-app@latest my-leo-app
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
Currently supported template presets include:
|
package/dist/index.mjs
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import
|
|
1
|
+
import T from"node:fs";import P from"node:path";import{fileURLToPath as ye}from"node:url";import Se from"readline";import xe from"events";function Pt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var V,Ct;function $e(){if(Ct)return V;Ct=1;function e(t,l){var d=t;l.slice(0,-1).forEach(function(m){d=d[m]||{}});var i=l[l.length-1];return i in d}function r(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function c(t,l){return l==="constructor"&&typeof t[l]=="function"||l==="__proto__"}return V=function(t,l){l||(l={});var d={bools:{},strings:{},unknownFn:null};typeof l.unknown=="function"&&(d.unknownFn=l.unknown),typeof l.boolean=="boolean"&&l.boolean?d.allBools=!0:[].concat(l.boolean).filter(Boolean).forEach(function(w){d.bools[w]=!0});var i={};function m(w){return i[w].some(function(M){return d.bools[M]})}Object.keys(l.alias||{}).forEach(function(w){i[w]=[].concat(l.alias[w]),i[w].forEach(function(M){i[M]=[w].concat(i[w].filter(function(R){return M!==R}))})}),[].concat(l.string).filter(Boolean).forEach(function(w){d.strings[w]=!0,i[w]&&[].concat(i[w]).forEach(function(M){d.strings[M]=!0})});var o=l.default||{},n={_:[]};function s(w,M){return d.allBools&&/^--[^=]+$/.test(M)||d.strings[w]||d.bools[w]||i[w]}function u(w,M,R){for(var $=w,N=0;N<M.length-1;N++){var E=M[N];if(c($,E))return;$[E]===void 0&&($[E]={}),($[E]===Object.prototype||$[E]===Number.prototype||$[E]===String.prototype)&&($[E]={}),$[E]===Array.prototype&&($[E]=[]),$=$[E]}var I=M[M.length-1];c($,I)||(($===Object.prototype||$===Number.prototype||$===String.prototype)&&($={}),$===Array.prototype&&($=[]),$[I]===void 0||d.bools[I]||typeof $[I]=="boolean"?$[I]=R:Array.isArray($[I])?$[I].push(R):$[I]=[$[I],R])}function p(w,M,R){if(!(R&&d.unknownFn&&!s(w,R)&&d.unknownFn(R)===!1)){var $=!d.strings[w]&&r(M)?Number(M):M;u(n,w.split("."),$),(i[w]||[]).forEach(function(N){u(n,N.split("."),$)})}}Object.keys(d.bools).forEach(function(w){p(w,o[w]===void 0?!1:o[w])});var a=[];t.indexOf("--")!==-1&&(a=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var h=0;h<t.length;h++){var f=t[h],g,x;if(/^--.+=/.test(f)){var y=f.match(/^--([^=]+)=([\s\S]*)$/);g=y[1];var S=y[2];d.bools[g]&&(S=S!=="false"),p(g,S,f)}else if(/^--no-.+/.test(f))g=f.match(/^--no-(.+)/)[1],p(g,!1,f);else if(/^--.+/.test(f))g=f.match(/^--(.+)/)[1],x=t[h+1],x!==void 0&&!/^(-|--)[^-]/.test(x)&&!d.bools[g]&&!d.allBools&&(!i[g]||!m(g))?(p(g,x,f),h+=1):/^(true|false)$/.test(x)?(p(g,x==="true",f),h+=1):p(g,d.strings[g]?"":!0,f);else if(/^-[^-]+/.test(f)){for(var v=f.slice(1,-1).split(""),b=!1,O=0;O<v.length;O++){if(x=f.slice(O+2),x==="-"){p(v[O],x,f);continue}if(/[A-Za-z]/.test(v[O])&&x[0]==="="){p(v[O],x.slice(1),f),b=!0;break}if(/[A-Za-z]/.test(v[O])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(x)){p(v[O],x,f),b=!0;break}if(v[O+1]&&v[O+1].match(/\W/)){p(v[O],f.slice(O+2),f),b=!0;break}else p(v[O],d.strings[v[O]]?"":!0,f)}g=f.slice(-1)[0],!b&&g!=="-"&&(t[h+1]&&!/^(-|--)[^-]/.test(t[h+1])&&!d.bools[g]&&(!i[g]||!m(g))?(p(g,t[h+1],f),h+=1):t[h+1]&&/^(true|false)$/.test(t[h+1])?(p(g,t[h+1]==="true",f),h+=1):p(g,d.strings[g]?"":!0,f))}else if((!d.unknownFn||d.unknownFn(f)!==!1)&&n._.push(d.strings._||!r(f)?f:Number(f)),l.stopEarly){n._.push.apply(n._,t.slice(h+1));break}}return Object.keys(o).forEach(function(w){e(n,w.split("."))||(u(n,w.split("."),o[w]),(i[w]||[]).forEach(function(M){u(n,M.split("."),o[w])}))}),l["--"]?n["--"]=a.slice():a.forEach(function(w){n._.push(w)}),n},V}var Me=$e();const Oe=Pt(Me);var B={},U,Dt;function C(){if(Dt)return U;Dt=1;const{FORCE_COLOR:e,NODE_DISABLE_COLORS:r,TERM:c}=process.env,t={enabled:!r&&c!=="dumb"&&e!=="0",reset:i(0,0),bold:i(1,22),dim:i(2,22),italic:i(3,23),underline:i(4,24),inverse:i(7,27),hidden:i(8,28),strikethrough:i(9,29),black:i(30,39),red:i(31,39),green:i(32,39),yellow:i(33,39),blue:i(34,39),magenta:i(35,39),cyan:i(36,39),white:i(37,39),gray:i(90,39),grey:i(90,39),bgBlack:i(40,49),bgRed:i(41,49),bgGreen:i(42,49),bgYellow:i(43,49),bgBlue:i(44,49),bgMagenta:i(45,49),bgCyan:i(46,49),bgWhite:i(47,49)};function l(m,o){let n=0,s,u="",p="";for(;n<m.length;n++)s=m[n],u+=s.open,p+=s.close,o.includes(s.close)&&(o=o.replace(s.rgx,s.close+s.open));return u+o+p}function d(m,o){let n={has:m,keys:o};return n.reset=t.reset.bind(n),n.bold=t.bold.bind(n),n.dim=t.dim.bind(n),n.italic=t.italic.bind(n),n.underline=t.underline.bind(n),n.inverse=t.inverse.bind(n),n.hidden=t.hidden.bind(n),n.strikethrough=t.strikethrough.bind(n),n.black=t.black.bind(n),n.red=t.red.bind(n),n.green=t.green.bind(n),n.yellow=t.yellow.bind(n),n.blue=t.blue.bind(n),n.magenta=t.magenta.bind(n),n.cyan=t.cyan.bind(n),n.white=t.white.bind(n),n.gray=t.gray.bind(n),n.grey=t.grey.bind(n),n.bgBlack=t.bgBlack.bind(n),n.bgRed=t.bgRed.bind(n),n.bgGreen=t.bgGreen.bind(n),n.bgYellow=t.bgYellow.bind(n),n.bgBlue=t.bgBlue.bind(n),n.bgMagenta=t.bgMagenta.bind(n),n.bgCyan=t.bgCyan.bind(n),n.bgWhite=t.bgWhite.bind(n),n}function i(m,o){let n={open:`\x1B[${m}m`,close:`\x1B[${o}m`,rgx:new RegExp(`\\x1b\\[${o}m`,"g")};return function(s){return this!==void 0&&this.has!==void 0?(this.has.includes(m)||(this.has.push(m),this.keys.push(n)),s===void 0?this:t.enabled?l(this.keys,s+""):s+""):s===void 0?d([m],[n]):t.enabled?l([n],s+""):s+""}}return U=t,U}var k,Et;function Re(){return Et||(Et=1,k=(e,r)=>{if(!(e.meta&&e.name!=="escape")){if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c"||e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(r){if(e.name==="j")return"down";if(e.name==="k")return"up"}return e.name==="return"||e.name==="enter"?"submit":e.name==="backspace"?"delete":e.name==="delete"?"deleteForward":e.name==="abort"?"abort":e.name==="escape"?"exit":e.name==="tab"?"next":e.name==="pagedown"?"nextPage":e.name==="pageup"?"prevPage":e.name==="home"?"home":e.name==="end"?"end":e.name==="up"?"up":e.name==="down"?"down":e.name==="right"?"right":e.name==="left"?"left":!1}}),k}var J,qt;function z(){return qt||(qt=1,J=e=>{const r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),c=new RegExp(r,"g");return typeof e=="string"?e.replace(c,""):e}),J}var G,It;function D(){if(It)return G;It=1;const e="\x1B",r=`${e}[`,c="\x07",t={to(i,m){return m?`${r}${m+1};${i+1}H`:`${r}${i+1}G`},move(i,m){let o="";return i<0?o+=`${r}${-i}D`:i>0&&(o+=`${r}${i}C`),m<0?o+=`${r}${-m}A`:m>0&&(o+=`${r}${m}B`),o},up:(i=1)=>`${r}${i}A`,down:(i=1)=>`${r}${i}B`,forward:(i=1)=>`${r}${i}C`,backward:(i=1)=>`${r}${i}D`,nextLine:(i=1)=>`${r}E`.repeat(i),prevLine:(i=1)=>`${r}F`.repeat(i),left:`${r}G`,hide:`${r}?25l`,show:`${r}?25h`,save:`${e}7`,restore:`${e}8`},l={up:(i=1)=>`${r}S`.repeat(i),down:(i=1)=>`${r}T`.repeat(i)},d={screen:`${r}2J`,up:(i=1)=>`${r}1J`.repeat(i),down:(i=1)=>`${r}J`.repeat(i),line:`${r}2K`,lineEnd:`${r}K`,lineStart:`${r}1K`,lines(i){let m="";for(let o=0;o<i;o++)m+=this.line+(o<i-1?t.up():"");return i&&(m+=t.left),m}};return G={cursor:t,scroll:l,erase:d,beep:c},G}var K,_t;function Te(){if(_t)return K;_t=1;const e=z(),{erase:r,cursor:c}=D(),t=l=>[...e(l)].length;return K=function(l,d){if(!d)return r.line+c.to(0);let i=0;const m=l.split(/\r?\n/);for(let o of m)i+=1+Math.floor(Math.max(t(o)-1,0)/d);return r.lines(i)},K}var W,At;function jt(){if(At)return W;At=1;const e={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},r={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"};return W=process.platform==="win32"?r:e,W}var Z,Ft;function Pe(){if(Ft)return Z;Ft=1;const e=C(),r=jt(),c=Object.freeze({password:{scale:1,render:o=>"*".repeat(o.length)},emoji:{scale:2,render:o=>"\u{1F603}".repeat(o.length)},invisible:{scale:0,render:o=>""},default:{scale:1,render:o=>`${o}`}}),t=o=>c[o]||c.default,l=Object.freeze({aborted:e.red(r.cross),done:e.green(r.tick),exited:e.yellow(r.cross),default:e.cyan("?")});return Z={styles:c,render:t,symbols:l,symbol:(o,n,s)=>n?l.aborted:s?l.exited:o?l.done:l.default,delimiter:o=>e.gray(o?r.ellipsis:r.pointerSmall),item:(o,n)=>e.gray(o?n?r.pointerSmall:"+":r.line)},Z}var X,Lt;function Ce(){if(Lt)return X;Lt=1;const e=z();return X=function(r,c){let t=String(e(r)||"").split(/\r?\n/);return c?t.map(l=>Math.ceil(l.length/c)).reduce((l,d)=>l+d):t.length},X}var Q,Nt;function De(){return Nt||(Nt=1,Q=(e,r={})=>{const c=Number.isSafeInteger(parseInt(r.margin))?new Array(parseInt(r.margin)).fill(" ").join(""):r.margin||"",t=r.width;return(e||"").split(/\r?\n/g).map(l=>l.split(/\s+/g).reduce((d,i)=>(i.length+c.length>=t||d[d.length-1].length+i.length+1<t?d[d.length-1]+=` ${i}`:d.push(`${c}${i}`),d),[c]).join(`
|
|
2
2
|
`)).join(`
|
|
3
|
-
`)},
|
|
4
|
-
`),this.close()}async validate(){let
|
|
5
|
-
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(
|
|
6
|
-
`).reduce((
|
|
7
|
-
${
|
|
3
|
+
`)}),Q}var tt,Yt;function Ee(){return Yt||(Yt=1,tt=(e,r,c)=>{c=c||r;let t=Math.min(r-c,e-Math.floor(c/2));t<0&&(t=0);let l=Math.min(t+c,r);return{startIndex:t,endIndex:l}}),tt}var et,Ht;function q(){return Ht||(Ht=1,et={action:Re(),clear:Te(),style:Pe(),strip:z(),figures:jt(),lines:Ce(),wrap:De(),entriesToDisplay:Ee()}),et}var it,Vt;function A(){if(Vt)return it;Vt=1;const e=Se,{action:r}=q(),c=xe,{beep:t,cursor:l}=D(),d=C();class i extends c{constructor(o={}){super(),this.firstRender=!0,this.in=o.stdin||process.stdin,this.out=o.stdout||process.stdout,this.onRender=(o.onRender||(()=>{})).bind(this);const n=e.createInterface({input:this.in,escapeCodeTimeout:50});e.emitKeypressEvents(this.in,n),this.in.isTTY&&this.in.setRawMode(!0);const s=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,u=(p,a)=>{let h=r(a,s);h===!1?this._&&this._(p,a):typeof this[h]=="function"?this[h](a):this.bell()};this.close=()=>{this.out.write(l.show),this.in.removeListener("keypress",u),this.in.isTTY&&this.in.setRawMode(!1),n.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",u)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(t)}render(){this.onRender(d),this.firstRender&&(this.firstRender=!1)}}return it=i,it}var st,Bt;function qe(){if(Bt)return st;Bt=1;const e=C(),r=A(),{erase:c,cursor:t}=D(),{style:l,clear:d,lines:i,figures:m}=q();class o extends r{constructor(s={}){super(s),this.transform=l.render(s.style),this.scale=this.transform.scale,this.msg=s.message,this.initial=s.initial||"",this.validator=s.validate||(()=>!0),this.value="",this.errorMsg=s.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=d("",this.out.columns),this.render()}set value(s){!s&&this.initial?(this.placeholder=!0,this.rendered=e.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(s)),this._value=s,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
|
|
4
|
+
`),this.close()}async validate(){let s=await this.validator(this.value);typeof s=="string"&&(this.errorMsg=s,s=!1),this.error=!s}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
5
|
+
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(s){this.placeholder||(this.cursor=this.cursor+s,this.cursorOffset+=s)}_(s,u){let p=this.value.slice(0,this.cursor),a=this.value.slice(this.cursor);this.value=`${p}${s}${a}`,this.red=!1,this.cursor=this.placeholder?0:p.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let s=this.value.slice(0,this.cursor-1),u=this.value.slice(this.cursor);this.value=`${s}${u}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let s=this.value.slice(0,this.cursor),u=this.value.slice(this.cursor+1);this.value=`${s}${u}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(t.down(i(this.outputError,this.out.columns)-1)+d(this.outputError,this.out.columns)),this.out.write(d(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[l.symbol(this.done,this.aborted),e.bold(this.msg),l.delimiter(this.done),this.red?e.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
6
|
+
`).reduce((s,u,p)=>s+`
|
|
7
|
+
${p?" ":m.pointerSmall} ${e.red().italic(u)}`,"")),this.out.write(c.line+t.to(0)+this.outputText+t.save+this.outputError+t.restore+t.move(this.cursorOffset,0)))}}return st=o,st}var rt,Ut;function Ie(){if(Ut)return rt;Ut=1;const e=C(),r=A(),{style:c,clear:t,figures:l,wrap:d,entriesToDisplay:i}=q(),{cursor:m}=D();class o extends r{constructor(s={}){super(s),this.msg=s.message,this.hint=s.hint||"- Use arrow-keys. Return to submit.",this.warn=s.warn||"- This option is disabled",this.cursor=s.initial||0,this.choices=s.choices.map((u,p)=>(typeof u=="string"&&(u={title:u,value:p}),{title:u&&(u.title||u.value||u),value:u&&(u.value===void 0?p:u.value),description:u&&u.description,selected:u&&u.selected,disabled:u&&u.disabled})),this.optionsPerPage=s.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=t("",this.out.columns),this.render()}moveCursor(s){this.cursor=s,this.value=this.choices[s].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
8
8
|
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
9
|
-
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(
|
|
10
|
-
`;for(let
|
|
11
|
-
`+
|
|
12
|
-
`}}this.out.write(this.outputText)}}var
|
|
9
|
+
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(s,u){if(s===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(m.hide):this.out.write(t(this.outputText,this.out.columns)),super.render();let{startIndex:s,endIndex:u}=i(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[c.symbol(this.done,this.aborted),e.bold(this.msg),c.delimiter(!1),this.done?this.selection.title:this.selection.disabled?e.yellow(this.warn):e.gray(this.hint)].join(" "),!this.done){this.outputText+=`
|
|
10
|
+
`;for(let p=s;p<u;p++){let a,h,f="",g=this.choices[p];p===s&&s>0?h=l.arrowUp:p===u-1&&u<this.choices.length?h=l.arrowDown:h=" ",g.disabled?(a=this.cursor===p?e.gray().underline(g.title):e.strikethrough().gray(g.title),h=(this.cursor===p?e.bold().gray(l.pointer)+" ":" ")+h):(a=this.cursor===p?e.cyan().underline(g.title):g.title,h=(this.cursor===p?e.cyan(l.pointer)+" ":" ")+h,g.description&&this.cursor===p&&(f=` - ${g.description}`,(h.length+a.length+f.length>=this.out.columns||g.description.split(/\r?\n/).length>1)&&(f=`
|
|
11
|
+
`+d(g.description,{margin:3,width:this.out.columns})))),this.outputText+=`${h} ${a}${e.gray(f)}
|
|
12
|
+
`}}this.out.write(this.outputText)}}return rt=o,rt}var nt,kt;function _e(){if(kt)return nt;kt=1;const e=C(),r=A(),{style:c,clear:t}=q(),{cursor:l,erase:d}=D();class i extends r{constructor(o={}){super(o),this.msg=o.message,this.value=!!o.initial,this.active=o.active||"on",this.inactive=o.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
13
13
|
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
14
|
-
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(
|
|
15
|
-
`),this.close()}async validate(){let
|
|
16
|
-
`),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let
|
|
17
|
-
`).reduce((
|
|
18
|
-
${
|
|
19
|
-
`),this.close()}async validate(){let
|
|
20
|
-
`),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let
|
|
21
|
-
`).reduce((
|
|
22
|
-
${
|
|
23
|
-
`),this.close()}submit(){const
|
|
24
|
-
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(
|
|
14
|
+
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(o,n){if(o===" ")this.value=!this.value;else if(o==="1")this.value=!0;else if(o==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(l.hide):this.out.write(t(this.outputText,this.out.columns)),super.render(),this.outputText=[c.symbol(this.done,this.aborted),e.bold(this.msg),c.delimiter(this.done),this.value?this.inactive:e.cyan().underline(this.inactive),e.gray("/"),this.value?e.cyan().underline(this.active):this.active].join(" "),this.out.write(d.line+l.to(0)+this.outputText))}}return nt=i,nt}var ot,Jt;function _(){if(Jt)return ot;Jt=1;class e{constructor({token:c,date:t,parts:l,locales:d}){this.token=c,this.date=t||new Date,this.parts=l||[this],this.locales=d||{}}up(){}down(){}next(){const c=this.parts.indexOf(this);return this.parts.find((t,l)=>l>c&&t instanceof e)}setTo(c){}prev(){let c=[].concat(this.parts).reverse();const t=c.indexOf(this);return c.find((l,d)=>d>t&&l instanceof e)}toString(){return String(this.date)}}return ot=e,ot}var lt,zt;function Ae(){if(zt)return lt;zt=1;const e=_();class r extends e{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}}return lt=r,lt}var ht,Gt;function je(){if(Gt)return ht;Gt=1;const e=_(),r=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th");class c extends e{constructor(l={}){super(l)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(l){this.date.setDate(parseInt(l.substr(-2)))}toString(){let l=this.date.getDate(),d=this.date.getDay();return this.token==="DD"?String(l).padStart(2,"0"):this.token==="Do"?l+r(l):this.token==="d"?d+1:this.token==="ddd"?this.locales.weekdaysShort[d]:this.token==="dddd"?this.locales.weekdays[d]:l}}return ht=c,ht}var at,Kt;function Fe(){if(Kt)return at;Kt=1;const e=_();class r extends e{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();return/h/.test(this.token)&&(t=t%12||12),this.token.length>1?String(t).padStart(2,"0"):t}}return at=r,at}var ut,Wt;function Le(){if(Wt)return ut;Wt=1;const e=_();class r extends e{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}return ut=r,ut}var ct,Zt;function Ne(){if(Zt)return ct;Zt=1;const e=_();class r extends e{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}}return ct=r,ct}var dt,Xt;function Ye(){if(Xt)return dt;Xt=1;const e=_();class r extends e{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1,this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth(),l=this.token.length;return l===2?String(t+1).padStart(2,"0"):l===3?this.locales.monthsShort[t]:l===4?this.locales.months[t]:String(t+1)}}return dt=r,dt}var ft,Qt;function He(){if(Qt)return ft;Qt=1;const e=_();class r extends e{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}}return ft=r,ft}var pt,te;function Ve(){if(te)return pt;te=1;const e=_();class r extends e{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?t.substr(-2):t}}return pt=r,pt}var mt,ee;function Be(){return ee||(ee=1,mt={DatePart:_(),Meridiem:Ae(),Day:je(),Hours:Fe(),Milliseconds:Le(),Minutes:Ne(),Month:Ye(),Seconds:He(),Year:Ve()}),mt}var gt,ie;function Ue(){if(ie)return gt;ie=1;const e=C(),r=A(),{style:c,clear:t,figures:l}=q(),{erase:d,cursor:i}=D(),{DatePart:m,Meridiem:o,Day:n,Hours:s,Milliseconds:u,Minutes:p,Month:a,Seconds:h,Year:f}=Be(),g=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,x={1:({token:v})=>v.replace(/\\(.)/g,"$1"),2:v=>new n(v),3:v=>new a(v),4:v=>new f(v),5:v=>new o(v),6:v=>new s(v),7:v=>new p(v),8:v=>new h(v),9:v=>new u(v)},y={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class S extends r{constructor(b={}){super(b),this.msg=b.message,this.cursor=0,this.typed="",this.locales=Object.assign(y,b.locales),this._date=b.initial||new Date,this.errorMsg=b.error||"Please Enter A Valid Value",this.validator=b.validate||(()=>!0),this.mask=b.mask||"YYYY-MM-DD HH:mm:ss",this.clear=t("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(b){b&&this._date.setTime(b.getTime())}set mask(b){let O;for(this.parts=[];O=g.exec(b);){let M=O.shift(),R=O.findIndex($=>$!=null);this.parts.push(R in x?x[R]({token:O[R]||M,date:this.date,parts:this.parts,locales:this.locales}):O[R]||M)}let w=this.parts.reduce((M,R)=>(typeof R=="string"&&typeof M[M.length-1]=="string"?M[M.length-1]+=R:M.push(R),M),[]);this.parts.splice(0),this.parts.push(...w),this.reset()}moveCursor(b){this.typed="",this.cursor=b,this.fire()}reset(){this.moveCursor(this.parts.findIndex(b=>b instanceof m)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
15
|
+
`),this.close()}async validate(){let b=await this.validator(this.value);typeof b=="string"&&(this.errorMsg=b,b=!1),this.error=!b}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
16
|
+
`),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let b=this.parts[this.cursor].prev();if(b==null)return this.bell();this.moveCursor(this.parts.indexOf(b)),this.render()}right(){let b=this.parts[this.cursor].next();if(b==null)return this.bell();this.moveCursor(this.parts.indexOf(b)),this.render()}next(){let b=this.parts[this.cursor].next();this.moveCursor(b?this.parts.indexOf(b):this.parts.findIndex(O=>O instanceof m)),this.render()}_(b){/\d/.test(b)&&(this.typed+=b,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(i.hide):this.out.write(t(this.outputText,this.out.columns)),super.render(),this.outputText=[c.symbol(this.done,this.aborted),e.bold(this.msg),c.delimiter(!1),this.parts.reduce((b,O,w)=>b.concat(w===this.cursor&&!this.done?e.cyan().underline(O.toString()):O),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
|
|
17
|
+
`).reduce((b,O,w)=>b+`
|
|
18
|
+
${w?" ":l.pointerSmall} ${e.red().italic(O)}`,"")),this.out.write(d.line+i.to(0)+this.outputText))}}return gt=S,gt}var vt,se;function ke(){if(se)return vt;se=1;const e=C(),r=A(),{cursor:c,erase:t}=D(),{style:l,figures:d,clear:i,lines:m}=q(),o=/[0-9]/,n=p=>p!==void 0,s=(p,a)=>{let h=Math.pow(10,a);return Math.round(p*h)/h};class u extends r{constructor(a={}){super(a),this.transform=l.render(a.style),this.msg=a.message,this.initial=n(a.initial)?a.initial:"",this.float=!!a.float,this.round=a.round||2,this.inc=a.increment||1,this.min=n(a.min)?a.min:-1/0,this.max=n(a.max)?a.max:1/0,this.errorMsg=a.error||"Please Enter A Valid Value",this.validator=a.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(a){!a&&a!==0?(this.placeholder=!0,this.rendered=e.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${s(a,this.round)}`),this._value=s(a,this.round)),this.fire()}get value(){return this._value}parse(a){return this.float?parseFloat(a):parseInt(a)}valid(a){return a==="-"||a==="."&&this.float||o.test(a)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let a=this.value;this.value=a!==""?a:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
19
|
+
`),this.close()}async validate(){let a=await this.validator(this.value);typeof a=="string"&&(this.errorMsg=a,a=!1),this.error=!a}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let a=this.value;this.value=a!==""?a:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
20
|
+
`),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let a=this.value.toString();if(a.length===0)return this.bell();this.value=this.parse(a=a.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(a,h){if(!this.valid(a))return this.bell();const f=Date.now();if(f-this.lastHit>1e3&&(this.typed=""),this.typed+=a,this.lastHit=f,this.color="cyan",a===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(c.down(m(this.outputError,this.out.columns)-1)+i(this.outputError,this.out.columns)),this.out.write(i(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[l.symbol(this.done,this.aborted),e.bold(this.msg),l.delimiter(this.done),!this.done||!this.done&&!this.placeholder?e[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
21
|
+
`).reduce((a,h,f)=>a+`
|
|
22
|
+
${f?" ":d.pointerSmall} ${e.red().italic(h)}`,"")),this.out.write(t.line+c.to(0)+this.outputText+c.save+this.outputError+c.restore))}}return vt=u,vt}var bt,re;function ne(){if(re)return bt;re=1;const e=C(),{cursor:r}=D(),c=A(),{clear:t,figures:l,style:d,wrap:i,entriesToDisplay:m}=q();class o extends c{constructor(s={}){super(s),this.msg=s.message,this.cursor=s.cursor||0,this.scrollIndex=s.cursor||0,this.hint=s.hint||"",this.warn=s.warn||"- This option is disabled -",this.minSelected=s.min,this.showMinError=!1,this.maxChoices=s.max,this.instructions=s.instructions,this.optionsPerPage=s.optionsPerPage||10,this.value=s.choices.map((u,p)=>(typeof u=="string"&&(u={title:u,value:p}),{title:u&&(u.title||u.value||u),description:u&&u.description,value:u&&(u.value===void 0?p:u.value),selected:u&&u.selected,disabled:u&&u.disabled})),this.clear=t("",this.out.columns),s.overrideRender||this.render()}reset(){this.value.map(s=>!s.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(s=>s.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
23
|
+
`),this.close()}submit(){const s=this.value.filter(u=>u.selected);this.minSelected&&s.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
24
|
+
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(s=>s.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const s=this.value[this.cursor];if(s.selected)s.selected=!1,this.render();else{if(s.disabled||this.value.filter(u=>u.selected).length>=this.maxChoices)return this.bell();s.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();const s=!this.value[this.cursor].selected;this.value.filter(u=>!u.disabled).forEach(u=>u.selected=s),this.render()}_(s,u){if(s===" ")this.handleSpaceToggle();else if(s==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
25
25
|
Instructions:
|
|
26
|
-
${
|
|
27
|
-
${
|
|
26
|
+
${l.arrowUp}/${l.arrowDown}: Highlight option
|
|
27
|
+
${l.arrowLeft}/${l.arrowRight}/[space]: Toggle selection
|
|
28
28
|
`+(this.maxChoices===void 0?` a: Toggle all
|
|
29
|
-
`:"")+" enter/return: Complete answer":""}renderOption(
|
|
30
|
-
`+
|
|
31
|
-
`+
|
|
32
|
-
`)}renderOptions(
|
|
29
|
+
`:"")+" enter/return: Complete answer":""}renderOption(s,u,p,a){const h=(u.selected?e.green(l.radioOn):l.radioOff)+" "+a+" ";let f,g;return u.disabled?f=s===p?e.gray().underline(u.title):e.strikethrough().gray(u.title):(f=s===p?e.cyan().underline(u.title):u.title,s===p&&u.description&&(g=` - ${u.description}`,(h.length+f.length+g.length>=this.out.columns||u.description.split(/\r?\n/).length>1)&&(g=`
|
|
30
|
+
`+i(u.description,{margin:h.length,width:this.out.columns})))),h+f+e.gray(g||"")}paginateOptions(s){if(s.length===0)return e.red("No matches for this query.");let{startIndex:u,endIndex:p}=m(this.cursor,s.length,this.optionsPerPage),a,h=[];for(let f=u;f<p;f++)f===u&&u>0?a=l.arrowUp:f===p-1&&p<s.length?a=l.arrowDown:a=" ",h.push(this.renderOption(this.cursor,s[f],f,a));return`
|
|
31
|
+
`+h.join(`
|
|
32
|
+
`)}renderOptions(s){return this.done?"":this.paginateOptions(s)}renderDoneOrInstructions(){if(this.done)return this.value.filter(u=>u.selected).map(u=>u.title).join(", ");const s=[e.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&s.push(e.yellow(this.warn)),s.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(r.hide),super.render();let s=[d.symbol(this.done,this.aborted),e.bold(this.msg),d.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(s+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),s+=this.renderOptions(this.value),this.out.write(this.clear+s),this.clear=t(s,this.out.columns)}}return bt=o,bt}var wt,oe;function Je(){if(oe)return wt;oe=1;const e=C(),r=A(),{erase:c,cursor:t}=D(),{style:l,clear:d,figures:i,wrap:m,entriesToDisplay:o}=q(),n=(a,h)=>a[h]&&(a[h].value||a[h].title||a[h]),s=(a,h)=>a[h]&&(a[h].title||a[h].value||a[h]),u=(a,h)=>{const f=a.findIndex(g=>g.value===h||g.title===h);return f>-1?f:void 0};class p extends r{constructor(h={}){super(h),this.msg=h.message,this.suggest=h.suggest,this.choices=h.choices,this.initial=typeof h.initial=="number"?h.initial:u(h.choices,h.initial),this.select=this.initial||h.cursor||0,this.i18n={noMatches:h.noMatches||"no matches found"},this.fallback=h.fallback||this.initial,this.clearFirst=h.clearFirst||!1,this.suggestions=[],this.input="",this.limit=h.limit||10,this.cursor=0,this.transform=l.render(h.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=d("",this.out.columns),this.complete(this.render),this.render()}set fallback(h){this._fb=Number.isSafeInteger(parseInt(h))?parseInt(h):h}get fallback(){let h;return typeof this._fb=="number"?h=this.choices[this._fb]:typeof this._fb=="string"&&(h={title:this._fb}),h||this._fb||{title:this.i18n.noMatches}}moveSelect(h){this.select=h,this.suggestions.length>0?this.value=n(this.suggestions,h):this.value=this.fallback.value,this.fire()}async complete(h){const f=this.completing=this.suggest(this.input,this.choices),g=await f;if(this.completing!==f)return;this.suggestions=g.map((y,S,v)=>({title:s(v,S),value:n(v,S),description:y.description})),this.completing=!1;const x=Math.max(g.length-1,0);this.moveSelect(Math.min(x,this.select)),h&&h()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
33
33
|
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
34
34
|
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
35
|
-
`),this.close()}_(
|
|
36
|
-
`+
|
|
35
|
+
`),this.close()}_(h,f){let g=this.input.slice(0,this.cursor),x=this.input.slice(this.cursor);this.input=`${g}${h}${x}`,this.cursor=g.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let h=this.input.slice(0,this.cursor-1),f=this.input.slice(this.cursor);this.input=`${h}${f}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let h=this.input.slice(0,this.cursor),f=this.input.slice(this.cursor+1);this.input=`${h}${f}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(h,f,g,x){let y,S=g?i.arrowUp:x?i.arrowDown:" ",v=f?e.cyan().underline(h.title):h.title;return S=(f?e.cyan(i.pointer)+" ":" ")+S,h.description&&(y=` - ${h.description}`,(S.length+v.length+y.length>=this.out.columns||h.description.split(/\r?\n/).length>1)&&(y=`
|
|
36
|
+
`+m(h.description,{margin:3,width:this.out.columns}))),S+" "+v+e.gray(y||"")}render(){if(this.closed)return;this.firstRender?this.out.write(t.hide):this.out.write(d(this.outputText,this.out.columns)),super.render();let{startIndex:h,endIndex:f}=o(this.select,this.choices.length,this.limit);if(this.outputText=[l.symbol(this.done,this.aborted,this.exited),e.bold(this.msg),l.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const g=this.suggestions.slice(h,f).map((x,y)=>this.renderOption(x,this.select===y+h,y===0&&h>0,y+h===f-1&&f<this.choices.length)).join(`
|
|
37
37
|
`);this.outputText+=`
|
|
38
|
-
`+(
|
|
38
|
+
`+(g||e.gray(this.fallback.title))}this.out.write(c.line+t.to(0)+this.outputText)}}return wt=p,wt}var yt,le;function ze(){if(le)return yt;le=1;const e=C(),{cursor:r}=D(),c=ne(),{clear:t,style:l,figures:d}=q();class i extends c{constructor(o={}){o.overrideRender=!0,super(o),this.inputValue="",this.clear=t("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(o=>o.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){const o=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(s=>this.inputValue?!!(typeof s.title=="string"&&s.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof s.value=="string"&&s.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const n=this.filteredOptions.findIndex(s=>s===o);this.cursor=n<0?0:n,this.render()}handleSpaceToggle(){const o=this.filteredOptions[this.cursor];if(o.selected)o.selected=!1,this.render();else{if(o.disabled||this.value.filter(n=>n.selected).length>=this.maxChoices)return this.bell();o.selected=!0,this.render()}}handleInputChange(o){this.inputValue=this.inputValue+o,this.updateFilteredOptions()}_(o,n){o===" "?this.handleSpaceToggle():this.handleInputChange(o)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
39
39
|
Instructions:
|
|
40
|
-
${
|
|
41
|
-
${
|
|
40
|
+
${d.arrowUp}/${d.arrowDown}: Highlight option
|
|
41
|
+
${d.arrowLeft}/${d.arrowRight}/[space]: Toggle selection
|
|
42
42
|
[a,b,c]/delete: Filter choices
|
|
43
43
|
enter/return: Complete answer
|
|
44
44
|
`:""}renderCurrentInput(){return`
|
|
45
|
-
Filtered results for: ${this.inputValue?this.inputValue:
|
|
46
|
-
`}renderOption(
|
|
45
|
+
Filtered results for: ${this.inputValue?this.inputValue:e.gray("Enter something to filter")}
|
|
46
|
+
`}renderOption(o,n,s){let u;return n.disabled?u=o===s?e.gray().underline(n.title):e.strikethrough().gray(n.title):u=o===s?e.cyan().underline(n.title):n.title,(n.selected?e.green(d.radioOn):d.radioOff)+" "+u}renderDoneOrInstructions(){if(this.done)return this.value.filter(n=>n.selected).map(n=>n.title).join(", ");const o=[e.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&o.push(e.yellow(this.warn)),o.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(r.hide),super.render();let o=[l.symbol(this.done,this.aborted),e.bold(this.msg),l.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(o+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),o+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+o),this.clear=t(o,this.out.columns)}}return yt=i,yt}var St,he;function Ge(){if(he)return St;he=1;const e=C(),r=A(),{style:c,clear:t}=q(),{erase:l,cursor:d}=D();class i extends r{constructor(o={}){super(o),this.msg=o.message,this.value=o.initial,this.initialValue=!!o.initial,this.yesMsg=o.yes||"yes",this.yesOption=o.yesOption||"(Y/n)",this.noMsg=o.no||"no",this.noOption=o.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
47
47
|
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
48
|
-
`),this.close()}_(
|
|
49
|
-
Scaffolding project in ${
|
|
50
|
-
`);const x=
|
|
48
|
+
`),this.close()}_(o,n){return o.toLowerCase()==="y"?(this.value=!0,this.submit()):o.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(d.hide):this.out.write(t(this.outputText,this.out.columns)),super.render(),this.outputText=[c.symbol(this.done,this.aborted),e.bold(this.msg),c.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:e.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(l.line+d.to(0)+this.outputText))}}return St=i,St}var xt,ae;function Ke(){return ae||(ae=1,xt={TextPrompt:qe(),SelectPrompt:Ie(),TogglePrompt:_e(),DatePrompt:Ue(),NumberPrompt:ke(),MultiselectPrompt:ne(),AutocompletePrompt:Je(),AutocompleteMultiselectPrompt:ze(),ConfirmPrompt:Ge()}),xt}var ue;function We(){return ue||(ue=1,function(e){const r=e,c=Ke(),t=i=>i;function l(i,m,o={}){return new Promise((n,s)=>{const u=new c[i](m),p=o.onAbort||t,a=o.onSubmit||t,h=o.onExit||t;u.on("state",m.onState||t),u.on("submit",f=>n(a(f))),u.on("exit",f=>n(h(f))),u.on("abort",f=>s(p(f)))})}r.text=i=>l("TextPrompt",i),r.password=i=>(i.style="password",r.text(i)),r.invisible=i=>(i.style="invisible",r.text(i)),r.number=i=>l("NumberPrompt",i),r.date=i=>l("DatePrompt",i),r.confirm=i=>l("ConfirmPrompt",i),r.list=i=>{const m=i.separator||",";return l("TextPrompt",i,{onSubmit:o=>o.split(m).map(n=>n.trim())})},r.toggle=i=>l("TogglePrompt",i),r.select=i=>l("SelectPrompt",i),r.multiselect=i=>{i.choices=[].concat(i.choices||[]);const m=o=>o.filter(n=>n.selected).map(n=>n.value);return l("MultiselectPrompt",i,{onAbort:m,onSubmit:m})},r.autocompleteMultiselect=i=>{i.choices=[].concat(i.choices||[]);const m=o=>o.filter(n=>n.selected).map(n=>n.value);return l("AutocompleteMultiselectPrompt",i,{onAbort:m,onSubmit:m})};const d=(i,m)=>Promise.resolve(m.filter(o=>o.title.slice(0,i.length).toLowerCase()===i.toLowerCase()));r.autocomplete=i=>(i.suggest=i.suggest||d,i.choices=[].concat(i.choices||[]),l("AutocompletePrompt",i))}(B)),B}var $t,ce;function Ze(){if(ce)return $t;ce=1;const e=We(),r=["suggest","format","onState","validate","onRender","type"],c=()=>{};async function t(m=[],{onSubmit:o=c,onCancel:n=c}={}){const s={},u=t._override||{};m=[].concat(m);let p,a,h,f,g,x;const y=async(S,v,b=!1)=>{if(!(!b&&S.validate&&S.validate(v)!==!0))return S.format?await S.format(v,s):v};for(a of m)if({name:f,type:g}=a,typeof g=="function"&&(g=await g(p,{...s},a),a.type=g),!!g){for(let S in a){if(r.includes(S))continue;let v=a[S];a[S]=typeof v=="function"?await v(p,{...s},x):v}if(x=a,typeof a.message!="string")throw new Error("prompt message is required");if({name:f,type:g}=a,e[g]===void 0)throw new Error(`prompt type (${g}) is not defined`);if(u[a.name]!==void 0&&(p=await y(a,u[a.name]),p!==void 0)){s[f]=p;continue}try{p=t._injected?l(t._injected,a.initial):await e[g](a),s[f]=p=await y(a,p,!0),h=await o(a,p,s)}catch{h=!await n(a,s)}if(h)return s}return s}function l(m,o){const n=m.shift();if(n instanceof Error)throw n;return n===void 0?o:n}function d(m){t._injected=(t._injected||[]).concat(m)}function i(m){t._override=Object.assign({},m)}return $t=Object.assign(t,{prompt:t,prompts:e,inject:d,override:i}),$t}var Xe=Ze();const Qe=Pt(Xe);let j=!0;const L=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let Y=0;if(L.process&&L.process.env&&L.process.stdout){const{FORCE_COLOR:e,NODE_DISABLE_COLORS:r,NO_COLOR:c,TERM:t,COLORTERM:l}=L.process.env;r||c||e==="0"?j=!1:e==="1"||e==="2"||e==="3"?j=!0:t==="dumb"?j=!1:"CI"in L.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(d=>d in L.process.env)?j=!0:j=process.stdout.isTTY,j&&(process.platform==="win32"||l&&(l==="truecolor"||l==="24bit")?Y=3:t&&(t.endsWith("-256color")||t.endsWith("256"))?Y=2:Y=1)}let de={enabled:j,supportLevel:Y};function F(e,r,c=1){const t=`\x1B[${e}m`,l=`\x1B[${r}m`,d=new RegExp(`\\x1b\\[${r}m`,"g");return i=>de.enabled&&de.supportLevel>=c?t+(""+i).replace(d,t)+l:""+i}const H=F(0,0),Mt=F(31,39),fe=F(32,39),pe=F(33,39),ti=F(36,39),ei=F(37,39),ii=F(92,39),Ot=Oe(process.argv.slice(2),{string:["_"]}),Rt=process.cwd(),me=[{name:"vanilla",display:"Vanilla",color:pe,variants:[{name:"vanilla",display:"JavaScript",color:pe}]},{name:"react",display:"React",color:ti,variants:[{name:"react-leo",display:"JavaScript + Leo",color:ii},{name:"react-ts",display:"React + TypeScript",color:Mt},{name:"nextjs-ts",display:"TypeScript + Next.js",color:ei}]},{name:"node",display:"Node.js",color:fe,variants:[{name:"node",display:"Node.js",color:fe}]}],ge=me.map(e=>e.variants&&e.variants.map(r=>r.name)||[e.name]).reduce((e,r)=>e.concat(r),[]),si={_gitignore:".gitignore"},Tt="aleo-project";async function ri(){const e=ve(Ot._[0]),r=Ot.template||Ot.t;let c=e||Tt;const t=()=>c==="."?P.basename(P.resolve()):c;let l;try{l=await Qe([{type:e?null:"text",name:"projectName",message:H("Project name:"),initial:Tt,onState:y=>{c=ve(y.value)||Tt}},{type:()=>!T.existsSync(c)||li(c)?null:"confirm",name:"overwrite",message:()=>(c==="."?"Current directory":`Target directory "${c}"`)+" is not empty. Remove existing files and continue?"},{type:(y,{overwrite:S})=>{if(S===!1)throw new Error(Mt("\u2716")+" Operation cancelled");return null},name:"overwriteChecker"},{type:()=>we(t())?null:"text",name:"packageName",message:H("Package name:"),initial:()=>ni(t()),validate:y=>we(y)||"Invalid package.json name"},{type:r&&ge.includes(r)?null:"select",name:"framework",message:typeof r=="string"&&!ge.includes(r)?H(`"${r}" isn't a valid template. Please choose from below: `):H("Select a framework:"),initial:0,choices:me.map(y=>{const S=y.color;return{title:S(y.display||y.name),value:y}})},{type:y=>y&&y.variants?"select":null,name:"variant",message:H("Select a variant:"),choices:y=>y.variants.map(S=>{const v=S.color;return{title:v(S.display||S.name),value:S.name}})}],{onCancel:()=>{throw new Error(Mt("\u2716")+" Operation cancelled")}})}catch(y){console.log(y.message);return}const{framework:d,overwrite:i,packageName:m,variant:o}=l,n=P.join(Rt,c);i?hi(n):T.existsSync(n)||T.mkdirSync(n,{recursive:!0});let s=o||d?.name||r;const u=ai(process.env.npm_config_user_agent),p=u?u.name:"npm";console.log(`
|
|
49
|
+
Scaffolding project in ${n}...`);const a=P.resolve(ye(import.meta.url),"../..",`template-${s}`),h=(y,S)=>{const v=P.join(n,si[y]??y);S?T.writeFileSync(v,S):be(P.join(a,y),v)},f=T.readdirSync(a);for(const y of f.filter(S=>S!=="package.json"))h(y);const g=JSON.parse(T.readFileSync(P.join(a,"package.json"),"utf-8"));g.name=m||t(),h("package.json",JSON.stringify(g,null,2)+`
|
|
50
|
+
`);const x=P.relative(Rt,n);switch(console.log(`
|
|
51
51
|
Done. Now run:
|
|
52
|
-
`),
|
|
52
|
+
`),n!==Rt&&console.log(` cd ${x.includes(" ")?`"${x}"`:x}`),p){default:console.log(` ${p} install`),console.log(` ${p} run dev`);break}console.log()}function ve(e){return e?.trim().replace(/\/+$/g,"")}function be(e,r){T.statSync(e).isDirectory()?oi(e,r):T.copyFileSync(e,r)}function we(e){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(e)}function ni(e){return e.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z\d\-~]+/g,"-")}function oi(e,r){T.mkdirSync(r,{recursive:!0});for(const c of T.readdirSync(e)){const t=P.resolve(e,c),l=P.resolve(r,c);be(t,l)}}function li(e){const r=T.readdirSync(e);return r.length===0||r.length===1&&r[0]===".git"}function hi(e){if(T.existsSync(e))for(const r of T.readdirSync(e))r!==".git"&&T.rmSync(P.resolve(e,r),{recursive:!0,force:!0})}function ai(e){if(!e)return;const r=e.split(" ")[0].split("/");return{name:r[0],version:r[1]}}ri().catch(e=>{console.error(e)});
|
package/package.json
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-leo-app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"collaborators": [
|
|
7
7
|
"The Provable Team"
|
|
8
8
|
],
|
|
9
|
-
"bin":
|
|
10
|
-
"create-leo-app": "index.js"
|
|
11
|
-
},
|
|
9
|
+
"bin": "index.js",
|
|
12
10
|
"files": [
|
|
13
11
|
"index.js",
|
|
14
12
|
"template-extension",
|
|
@@ -31,11 +29,11 @@
|
|
|
31
29
|
"node": "^14.18.0 || >=16.0.0"
|
|
32
30
|
},
|
|
33
31
|
"devDependencies": {
|
|
34
|
-
"@types/minimist": "^1.2.
|
|
35
|
-
"@types/prompts": "^2.4.
|
|
32
|
+
"@types/minimist": "^1.2.5",
|
|
33
|
+
"@types/prompts": "^2.4.9",
|
|
36
34
|
"kolorist": "^1.8.0",
|
|
37
35
|
"minimist": "^1.2.8",
|
|
38
36
|
"prompts": "^2.4.2",
|
|
39
|
-
"unbuild": "^
|
|
37
|
+
"unbuild": "^3.3.1"
|
|
40
38
|
}
|
|
41
39
|
}
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
"build": "rimraf static/js && rollup --config"
|
|
8
8
|
},
|
|
9
9
|
"devDependencies": {
|
|
10
|
-
"@provablehq/sdk": "^0.
|
|
11
|
-
"@web/rollup-plugin-import-meta-assets": "^2.1
|
|
12
|
-
"rimraf": "^
|
|
13
|
-
"rollup": "^4.
|
|
10
|
+
"@provablehq/sdk": "^0.8.0",
|
|
11
|
+
"@web/rollup-plugin-import-meta-assets": "^2.2.1",
|
|
12
|
+
"rimraf": "^6.0.1",
|
|
13
|
+
"rollup": "^4.32.0"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
"lint": "next lint"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@provablehq/sdk": "^0.
|
|
13
|
-
"next": "
|
|
14
|
-
"react": "^
|
|
15
|
-
"react-dom": "^
|
|
16
|
-
"terser-webpack-plugin": "^5.3.
|
|
12
|
+
"@provablehq/sdk": "^0.8.0",
|
|
13
|
+
"next": "15.1.6",
|
|
14
|
+
"react": "^19.0.0",
|
|
15
|
+
"react-dom": "^19.0.0",
|
|
16
|
+
"terser-webpack-plugin": "^5.3.11"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@types/node": "^
|
|
20
|
-
"@types/react": "^
|
|
21
|
-
"@types/react-dom": "^
|
|
22
|
-
"typescript": "^5"
|
|
19
|
+
"@types/node": "^22.12.0",
|
|
20
|
+
"@types/react": "^19.0.8",
|
|
21
|
+
"@types/react-dom": "^19.0.3",
|
|
22
|
+
"typescript": "^5.7.3"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "rimraf dist/js && rollup --config",
|
|
8
|
-
"
|
|
8
|
+
"dev": "npm run build && node dist/index.js"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@provablehq/sdk": "^0.
|
|
11
|
+
"@provablehq/sdk": "^0.8.0"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"rimraf": "^
|
|
15
|
-
"rollup": "^
|
|
14
|
+
"rimraf": "^6.0.1",
|
|
15
|
+
"rollup": "^4.32.0",
|
|
16
16
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
17
|
-
"typescript": "^5.
|
|
17
|
+
"typescript": "^5.7.3"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "rimraf dist/js && rollup --config",
|
|
8
|
-
"
|
|
8
|
+
"dev": "npm run build && node dist/index.js"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@provablehq/sdk": "^0.
|
|
11
|
+
"@provablehq/sdk": "^0.8.0"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"rimraf": "^
|
|
15
|
-
"rollup": "^
|
|
14
|
+
"rimraf": "^6.0.1",
|
|
15
|
+
"rollup": "^4.32.0",
|
|
16
16
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
17
|
-
"typescript": "^5.
|
|
17
|
+
"typescript": "^5.7.3"
|
|
18
18
|
}
|
|
19
19
|
}
|