@botpress/cli 2.0.2 → 2.0.4
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/e2e/tests/install-interfaces.ts +1 -0
- package/e2e/tests/install-package.ts +1 -0
- package/package.json +3 -3
- package/templates/empty-bot/package.json +2 -2
- package/templates/empty-integration/package.json +2 -2
- package/templates/empty-plugin/package.json +1 -1
- package/templates/hello-world/package.json +2 -2
- package/templates/webhook-message/package.json +2 -2
- package/.turbo/turbo-build.log +0 -22
- package/dist/api/bot-body.js +0 -89
- package/dist/api/bot-body.js.map +0 -7
- package/dist/api/client.js +0 -162
- package/dist/api/client.js.map +0 -7
- package/dist/api/find-previous-version.js +0 -66
- package/dist/api/find-previous-version.js.map +0 -7
- package/dist/api/find-previous-version.test.js +0 -76
- package/dist/api/find-previous-version.test.js.map +0 -7
- package/dist/api/index.js +0 -23
- package/dist/api/index.js.map +0 -7
- package/dist/api/integration-body.js +0 -146
- package/dist/api/integration-body.js.map +0 -7
- package/dist/api/interface-body.js +0 -95
- package/dist/api/interface-body.js.map +0 -7
- package/dist/api/paging.js +0 -42
- package/dist/api/paging.js.map +0 -7
- package/dist/api/plugin-body.js +0 -84
- package/dist/api/plugin-body.js.map +0 -7
- package/dist/api/types.js +0 -17
- package/dist/api/types.js.map +0 -7
- package/dist/code-generation/bot-implementation/bot-implementation.js +0 -116
- package/dist/code-generation/bot-implementation/bot-implementation.js.map +0 -7
- package/dist/code-generation/bot-implementation/bot-plugins/index.js +0 -80
- package/dist/code-generation/bot-implementation/bot-plugins/index.js.map +0 -7
- package/dist/code-generation/bot-implementation/bot-plugins/plugin-module.js +0 -129
- package/dist/code-generation/bot-implementation/bot-plugins/plugin-module.js.map +0 -7
- package/dist/code-generation/bot-implementation/bot-typings/actions-module.js +0 -88
- package/dist/code-generation/bot-implementation/bot-typings/actions-module.js.map +0 -7
- package/dist/code-generation/bot-implementation/bot-typings/events-module.js +0 -63
- package/dist/code-generation/bot-implementation/bot-typings/events-module.js.map +0 -7
- package/dist/code-generation/bot-implementation/bot-typings/index.js +0 -109
- package/dist/code-generation/bot-implementation/bot-typings/index.js.map +0 -7
- package/dist/code-generation/bot-implementation/bot-typings/states-module.js +0 -64
- package/dist/code-generation/bot-implementation/bot-typings/states-module.js.map +0 -7
- package/dist/code-generation/bot-implementation/index.js +0 -66
- package/dist/code-generation/bot-implementation/index.js.map +0 -7
- package/dist/code-generation/consts.js +0 -45
- package/dist/code-generation/consts.js.map +0 -7
- package/dist/code-generation/generators.js +0 -81
- package/dist/code-generation/generators.js.map +0 -7
- package/dist/code-generation/index.js +0 -49
- package/dist/code-generation/index.js.map +0 -7
- package/dist/code-generation/integration-implementation/index.js +0 -70
- package/dist/code-generation/integration-implementation/index.js.map +0 -7
- package/dist/code-generation/integration-implementation/integration-implementation.js +0 -114
- package/dist/code-generation/integration-implementation/integration-implementation.js.map +0 -7
- package/dist/code-generation/integration-implementation/integration-secret.js +0 -78
- package/dist/code-generation/integration-implementation/integration-secret.js.map +0 -7
- package/dist/code-generation/integration-implementation/integration-typings/actions-module.js +0 -88
- package/dist/code-generation/integration-implementation/integration-typings/actions-module.js.map +0 -7
- package/dist/code-generation/integration-implementation/integration-typings/channels-module.js +0 -107
- package/dist/code-generation/integration-implementation/integration-typings/channels-module.js.map +0 -7
- package/dist/code-generation/integration-implementation/integration-typings/configuration-module.js +0 -62
- package/dist/code-generation/integration-implementation/integration-typings/configuration-module.js.map +0 -7
- package/dist/code-generation/integration-implementation/integration-typings/configurations-module.js +0 -70
- package/dist/code-generation/integration-implementation/integration-typings/configurations-module.js.map +0 -7
- package/dist/code-generation/integration-implementation/integration-typings/entities-module.js +0 -63
- package/dist/code-generation/integration-implementation/integration-typings/entities-module.js.map +0 -7
- package/dist/code-generation/integration-implementation/integration-typings/events-module.js +0 -63
- package/dist/code-generation/integration-implementation/integration-typings/events-module.js.map +0 -7
- package/dist/code-generation/integration-implementation/integration-typings/index.js +0 -128
- package/dist/code-generation/integration-implementation/integration-typings/index.js.map +0 -7
- package/dist/code-generation/integration-implementation/integration-typings/states-module.js +0 -64
- package/dist/code-generation/integration-implementation/integration-typings/states-module.js.map +0 -7
- package/dist/code-generation/integration-package/index.js +0 -94
- package/dist/code-generation/integration-package/index.js.map +0 -7
- package/dist/code-generation/integration-package/integration-package-definition/actions-module.js +0 -88
- package/dist/code-generation/integration-package/integration-package-definition/actions-module.js.map +0 -7
- package/dist/code-generation/integration-package/integration-package-definition/channels-module.js +0 -107
- package/dist/code-generation/integration-package/integration-package-definition/channels-module.js.map +0 -7
- package/dist/code-generation/integration-package/integration-package-definition/configuration-module.js +0 -63
- package/dist/code-generation/integration-package/integration-package-definition/configuration-module.js.map +0 -7
- package/dist/code-generation/integration-package/integration-package-definition/configurations-module.js +0 -70
- package/dist/code-generation/integration-package/integration-package-definition/configurations-module.js.map +0 -7
- package/dist/code-generation/integration-package/integration-package-definition/entities-module.js +0 -63
- package/dist/code-generation/integration-package/integration-package-definition/entities-module.js.map +0 -7
- package/dist/code-generation/integration-package/integration-package-definition/events-module.js +0 -66
- package/dist/code-generation/integration-package/integration-package-definition/events-module.js.map +0 -7
- package/dist/code-generation/integration-package/integration-package-definition/index.js +0 -140
- package/dist/code-generation/integration-package/integration-package-definition/index.js.map +0 -7
- package/dist/code-generation/integration-package/integration-package-definition/states-module.js +0 -66
- package/dist/code-generation/integration-package/integration-package-definition/states-module.js.map +0 -7
- package/dist/code-generation/integration-package/integration-package-definition/typings.js +0 -17
- package/dist/code-generation/integration-package/integration-package-definition/typings.js.map +0 -7
- package/dist/code-generation/interface-implementation/index.js +0 -29
- package/dist/code-generation/interface-implementation/index.js.map +0 -7
- package/dist/code-generation/interface-implementation/integration-typings/actions-module.js +0 -88
- package/dist/code-generation/interface-implementation/integration-typings/actions-module.js.map +0 -7
- package/dist/code-generation/interface-implementation/integration-typings/channels-module.js +0 -107
- package/dist/code-generation/interface-implementation/integration-typings/channels-module.js.map +0 -7
- package/dist/code-generation/interface-implementation/integration-typings/entities-module.js +0 -63
- package/dist/code-generation/interface-implementation/integration-typings/entities-module.js.map +0 -7
- package/dist/code-generation/interface-implementation/integration-typings/events-module.js +0 -63
- package/dist/code-generation/interface-implementation/integration-typings/events-module.js.map +0 -7
- package/dist/code-generation/interface-implementation/integration-typings/index.js +0 -121
- package/dist/code-generation/interface-implementation/integration-typings/index.js.map +0 -7
- package/dist/code-generation/interface-package/index.js +0 -94
- package/dist/code-generation/interface-package/index.js.map +0 -7
- package/dist/code-generation/interface-package/interface-package-definition/actions-module.js +0 -88
- package/dist/code-generation/interface-package/interface-package-definition/actions-module.js.map +0 -7
- package/dist/code-generation/interface-package/interface-package-definition/channels-module.js +0 -98
- package/dist/code-generation/interface-package/interface-package-definition/channels-module.js.map +0 -7
- package/dist/code-generation/interface-package/interface-package-definition/entities-module.js +0 -63
- package/dist/code-generation/interface-package/interface-package-definition/entities-module.js.map +0 -7
- package/dist/code-generation/interface-package/interface-package-definition/events-module.js +0 -66
- package/dist/code-generation/interface-package/interface-package-definition/events-module.js.map +0 -7
- package/dist/code-generation/interface-package/interface-package-definition/index.js +0 -104
- package/dist/code-generation/interface-package/interface-package-definition/index.js.map +0 -7
- package/dist/code-generation/interface-package/interface-package-definition/typings.js +0 -17
- package/dist/code-generation/interface-package/interface-package-definition/typings.js.map +0 -7
- package/dist/code-generation/module.js +0 -183
- package/dist/code-generation/module.js.map +0 -7
- package/dist/code-generation/plugin-implementation/index.js +0 -60
- package/dist/code-generation/plugin-implementation/index.js.map +0 -7
- package/dist/code-generation/plugin-implementation/plugin-implementation.js +0 -90
- package/dist/code-generation/plugin-implementation/plugin-implementation.js.map +0 -7
- package/dist/code-generation/plugin-implementation/plugin-typings/actions-module.js +0 -88
- package/dist/code-generation/plugin-implementation/plugin-typings/actions-module.js.map +0 -7
- package/dist/code-generation/plugin-implementation/plugin-typings/configuration-module.js +0 -61
- package/dist/code-generation/plugin-implementation/plugin-typings/configuration-module.js.map +0 -7
- package/dist/code-generation/plugin-implementation/plugin-typings/events-module.js +0 -63
- package/dist/code-generation/plugin-implementation/plugin-typings/events-module.js.map +0 -7
- package/dist/code-generation/plugin-implementation/plugin-typings/index.js +0 -150
- package/dist/code-generation/plugin-implementation/plugin-typings/index.js.map +0 -7
- package/dist/code-generation/plugin-implementation/plugin-typings/states-module.js +0 -64
- package/dist/code-generation/plugin-implementation/plugin-typings/states-module.js.map +0 -7
- package/dist/code-generation/plugin-package/index.js +0 -151
- package/dist/code-generation/plugin-package/index.js.map +0 -7
- package/dist/code-generation/plugin-package/plugin-package-definition/actions-module.js +0 -88
- package/dist/code-generation/plugin-package/plugin-package-definition/actions-module.js.map +0 -7
- package/dist/code-generation/plugin-package/plugin-package-definition/configuration-module.js +0 -56
- package/dist/code-generation/plugin-package/plugin-package-definition/configuration-module.js.map +0 -7
- package/dist/code-generation/plugin-package/plugin-package-definition/events-module.js +0 -66
- package/dist/code-generation/plugin-package/plugin-package-definition/events-module.js.map +0 -7
- package/dist/code-generation/plugin-package/plugin-package-definition/index.js +0 -107
- package/dist/code-generation/plugin-package/plugin-package-definition/index.js.map +0 -7
- package/dist/code-generation/plugin-package/plugin-package-definition/states-module.js +0 -66
- package/dist/code-generation/plugin-package/plugin-package-definition/states-module.js.map +0 -7
- package/dist/code-generation/plugin-package/plugin-package-definition/typings.js +0 -17
- package/dist/code-generation/plugin-package/plugin-package-definition/typings.js.map +0 -7
- package/dist/code-generation/strings.js +0 -115
- package/dist/code-generation/strings.js.map +0 -7
- package/dist/code-generation/typings.js +0 -17
- package/dist/code-generation/typings.js.map +0 -7
- package/dist/command-definitions.js +0 -84
- package/dist/command-definitions.js.map +0 -7
- package/dist/command-implementations/add-command.js +0 -249
- package/dist/command-implementations/add-command.js.map +0 -7
- package/dist/command-implementations/base-command.js +0 -69
- package/dist/command-implementations/base-command.js.map +0 -7
- package/dist/command-implementations/bot-commands.js +0 -117
- package/dist/command-implementations/bot-commands.js.map +0 -7
- package/dist/command-implementations/build-command.js +0 -53
- package/dist/command-implementations/build-command.js.map +0 -7
- package/dist/command-implementations/bundle-command.js +0 -87
- package/dist/command-implementations/bundle-command.js.map +0 -7
- package/dist/command-implementations/deploy-command.js +0 -481
- package/dist/command-implementations/deploy-command.js.map +0 -7
- package/dist/command-implementations/dev-command.js +0 -345
- package/dist/command-implementations/dev-command.js.map +0 -7
- package/dist/command-implementations/gen-command.js +0 -110
- package/dist/command-implementations/gen-command.js.map +0 -7
- package/dist/command-implementations/global-command.js +0 -137
- package/dist/command-implementations/global-command.js.map +0 -7
- package/dist/command-implementations/index.js +0 -103
- package/dist/command-implementations/index.js.map +0 -7
- package/dist/command-implementations/init-command.js +0 -162
- package/dist/command-implementations/init-command.js.map +0 -7
- package/dist/command-implementations/integration-commands.js +0 -130
- package/dist/command-implementations/integration-commands.js.map +0 -7
- package/dist/command-implementations/interface-commands.js +0 -110
- package/dist/command-implementations/interface-commands.js.map +0 -7
- package/dist/command-implementations/lint-command.js +0 -151
- package/dist/command-implementations/lint-command.js.map +0 -7
- package/dist/command-implementations/login-command.js +0 -82
- package/dist/command-implementations/login-command.js.map +0 -7
- package/dist/command-implementations/logout-command.js +0 -35
- package/dist/command-implementations/logout-command.js.map +0 -7
- package/dist/command-implementations/plugin-commands.js +0 -111
- package/dist/command-implementations/plugin-commands.js.map +0 -7
- package/dist/command-implementations/project-command.js +0 -383
- package/dist/command-implementations/project-command.js.map +0 -7
- package/dist/command-implementations/read-command.js +0 -70
- package/dist/command-implementations/read-command.js.map +0 -7
- package/dist/command-implementations/serve-command.js +0 -68
- package/dist/command-implementations/serve-command.js.map +0 -7
- package/dist/command-tree.js +0 -60
- package/dist/command-tree.js.map +0 -7
- package/dist/config.js +0 -332
- package/dist/config.js.map +0 -7
- package/dist/consts.js +0 -124
- package/dist/consts.js.map +0 -7
- package/dist/errors.js +0 -202
- package/dist/errors.js.map +0 -7
- package/dist/index.js +0 -51
- package/dist/index.js.map +0 -7
- package/dist/init.js +0 -50
- package/dist/init.js.map +0 -7
- package/dist/linter/base-linter.js +0 -75
- package/dist/linter/base-linter.js.map +0 -7
- package/dist/linter/base-linter.test.js +0 -187
- package/dist/linter/base-linter.test.js.map +0 -7
- package/dist/linter/bot-linter.js +0 -35
- package/dist/linter/bot-linter.js.map +0 -7
- package/dist/linter/integration-linter.js +0 -35
- package/dist/linter/integration-linter.js.map +0 -7
- package/dist/linter/interface-linter.js +0 -35
- package/dist/linter/interface-linter.js.map +0 -7
- package/dist/linter/ruleset-tests/bot.ruleset.test.js +0 -358
- package/dist/linter/ruleset-tests/bot.ruleset.test.js.map +0 -7
- package/dist/linter/ruleset-tests/common.js +0 -37
- package/dist/linter/ruleset-tests/common.js.map +0 -7
- package/dist/linter/ruleset-tests/integration.ruleset.test.js +0 -887
- package/dist/linter/ruleset-tests/integration.ruleset.test.js.map +0 -7
- package/dist/linter/ruleset-tests/interface.ruleset.test.js +0 -383
- package/dist/linter/ruleset-tests/interface.ruleset.test.js.map +0 -7
- package/dist/linter/rulesets/bot.ruleset.js +0 -191
- package/dist/linter/rulesets/bot.ruleset.js.map +0 -7
- package/dist/linter/rulesets/integration.ruleset.js +0 -378
- package/dist/linter/rulesets/integration.ruleset.js.map +0 -7
- package/dist/linter/rulesets/interface.ruleset.js +0 -157
- package/dist/linter/rulesets/interface.ruleset.js.map +0 -7
- package/dist/linter/spectral-functions.js +0 -36
- package/dist/linter/spectral-functions.js.map +0 -7
- package/dist/logger/base-logger.js +0 -170
- package/dist/logger/base-logger.js.map +0 -7
- package/dist/logger/index.js +0 -86
- package/dist/logger/index.js.map +0 -7
- package/dist/package-ref.js +0 -107
- package/dist/package-ref.js.map +0 -7
- package/dist/package-ref.test.js +0 -109
- package/dist/package-ref.test.js.map +0 -7
- package/dist/register-yargs.js +0 -91
- package/dist/register-yargs.js.map +0 -7
- package/dist/root.js +0 -41
- package/dist/root.js.map +0 -7
- package/dist/sdk/index.js +0 -22
- package/dist/sdk/index.js.map +0 -7
- package/dist/sdk/resolve-bot-interfaces.js +0 -43
- package/dist/sdk/resolve-bot-interfaces.js.map +0 -7
- package/dist/sdk/resolve-integration-interfaces.js +0 -161
- package/dist/sdk/resolve-integration-interfaces.js.map +0 -7
- package/dist/sdk/validate-bot.js +0 -88
- package/dist/sdk/validate-bot.js.map +0 -7
- package/dist/sdk/validate-integration.js +0 -72
- package/dist/sdk/validate-integration.js.map +0 -7
- package/dist/typings.js +0 -17
- package/dist/typings.js.map +0 -7
- package/dist/utils/cache-utils.js +0 -104
- package/dist/utils/cache-utils.js.map +0 -7
- package/dist/utils/case-utils.js +0 -84
- package/dist/utils/case-utils.js.map +0 -7
- package/dist/utils/case-utils.test.js +0 -75
- package/dist/utils/case-utils.test.js.map +0 -7
- package/dist/utils/esbuild-utils.js +0 -92
- package/dist/utils/esbuild-utils.js.map +0 -7
- package/dist/utils/event-emitter.js +0 -63
- package/dist/utils/event-emitter.js.map +0 -7
- package/dist/utils/file-watcher.js +0 -73
- package/dist/utils/file-watcher.js.map +0 -7
- package/dist/utils/guard-utils.js +0 -32
- package/dist/utils/guard-utils.js.map +0 -7
- package/dist/utils/id-utils.js +0 -59
- package/dist/utils/id-utils.js.map +0 -7
- package/dist/utils/index.js +0 -99
- package/dist/utils/index.js.map +0 -7
- package/dist/utils/object-utils.js +0 -32
- package/dist/utils/object-utils.js.map +0 -7
- package/dist/utils/path-utils.js +0 -106
- package/dist/utils/path-utils.js.map +0 -7
- package/dist/utils/path-utils.test.js +0 -72
- package/dist/utils/path-utils.test.js.map +0 -7
- package/dist/utils/pkgjson-utils.js +0 -57
- package/dist/utils/pkgjson-utils.js.map +0 -7
- package/dist/utils/promise-utils.js +0 -33
- package/dist/utils/promise-utils.js.map +0 -7
- package/dist/utils/promise-utils.test.js +0 -14
- package/dist/utils/promise-utils.test.js.map +0 -7
- package/dist/utils/prompt-utils.js +0 -105
- package/dist/utils/prompt-utils.js.map +0 -7
- package/dist/utils/record-utils.js +0 -118
- package/dist/utils/record-utils.js.map +0 -7
- package/dist/utils/record-utils.test.js +0 -38
- package/dist/utils/record-utils.test.js.map +0 -7
- package/dist/utils/require-utils.js +0 -90
- package/dist/utils/require-utils.js.map +0 -7
- package/dist/utils/require-utils.test.js +0 -54
- package/dist/utils/require-utils.test.js.map +0 -7
- package/dist/utils/schema-utils.js +0 -64
- package/dist/utils/schema-utils.js.map +0 -7
- package/dist/utils/schema-utils.test.js +0 -50
- package/dist/utils/schema-utils.test.js.map +0 -7
- package/dist/utils/semver-utils.js +0 -45
- package/dist/utils/semver-utils.js.map +0 -7
- package/dist/utils/string-utils.js +0 -42
- package/dist/utils/string-utils.js.map +0 -7
- package/dist/utils/template-utils.js +0 -51
- package/dist/utils/template-utils.js.map +0 -7
- package/dist/utils/tunnel-utils.js +0 -129
- package/dist/utils/tunnel-utils.js.map +0 -7
- package/dist/utils/type-utils.js +0 -17
- package/dist/utils/type-utils.js.map +0 -7
- package/dist/utils/url-utils.js +0 -67
- package/dist/utils/url-utils.js.map +0 -7
- package/dist/worker/child-entrypoint.js +0 -58
- package/dist/worker/child-entrypoint.js.map +0 -7
- package/dist/worker/child-wrapper.js +0 -119
- package/dist/worker/child-wrapper.js.map +0 -7
- package/dist/worker/config.js +0 -44
- package/dist/worker/config.js.map +0 -7
- package/dist/worker/index.js +0 -32
- package/dist/worker/index.js.map +0 -7
- package/dist/worker/is-child.js +0 -55
- package/dist/worker/is-child.js.map +0 -7
- package/dist/worker/worker-state.js +0 -71
- package/dist/worker/worker-state.js.map +0 -7
- package/dist/worker/worker.js +0 -91
- package/dist/worker/worker.js.map +0 -7
- package/templates/empty-bot/.botpress/implementation/index.ts +0 -50
- package/templates/empty-bot/.botpress/implementation/plugins/index.ts +0 -11
- package/templates/empty-bot/.botpress/implementation/typings/actions/index.ts +0 -6
- package/templates/empty-bot/.botpress/implementation/typings/events/index.ts +0 -6
- package/templates/empty-bot/.botpress/implementation/typings/index.ts +0 -20
- package/templates/empty-bot/.botpress/implementation/typings/integrations/index.ts +0 -6
- package/templates/empty-bot/.botpress/implementation/typings/states/index.ts +0 -6
- package/templates/empty-bot/.botpress/index.ts +0 -5
- package/templates/empty-integration/.botpress/implementation/index.ts +0 -57
- package/templates/empty-integration/.botpress/implementation/typings/actions/index.ts +0 -6
- package/templates/empty-integration/.botpress/implementation/typings/channels/index.ts +0 -6
- package/templates/empty-integration/.botpress/implementation/typings/configuration/index.ts +0 -2
- package/templates/empty-integration/.botpress/implementation/typings/configurations/index.ts +0 -6
- package/templates/empty-integration/.botpress/implementation/typings/entities/index.ts +0 -6
- package/templates/empty-integration/.botpress/implementation/typings/events/index.ts +0 -6
- package/templates/empty-integration/.botpress/implementation/typings/index.ts +0 -31
- package/templates/empty-integration/.botpress/implementation/typings/states/index.ts +0 -6
- package/templates/empty-integration/.botpress/index.ts +0 -2
- package/templates/empty-integration/.botpress/secrets/index.ts +0 -6
- package/templates/empty-plugin/.botpress/implementation/index.ts +0 -35
- package/templates/empty-plugin/.botpress/implementation/typings/actions/index.ts +0 -6
- package/templates/empty-plugin/.botpress/implementation/typings/configuration/index.ts +0 -2
- package/templates/empty-plugin/.botpress/implementation/typings/events/index.ts +0 -6
- package/templates/empty-plugin/.botpress/implementation/typings/index.ts +0 -26
- package/templates/empty-plugin/.botpress/implementation/typings/integrations/index.ts +0 -6
- package/templates/empty-plugin/.botpress/implementation/typings/interfaces/index.ts +0 -6
- package/templates/empty-plugin/.botpress/implementation/typings/states/index.ts +0 -6
- package/templates/empty-plugin/.botpress/index.ts +0 -1
- package/templates/hello-world/.botpress/implementation/index.ts +0 -57
- package/templates/hello-world/.botpress/implementation/typings/actions/helloWorld/index.ts +0 -12
- package/templates/hello-world/.botpress/implementation/typings/actions/helloWorld/input.ts +0 -5
- package/templates/hello-world/.botpress/implementation/typings/actions/helloWorld/output.ts +0 -5
- package/templates/hello-world/.botpress/implementation/typings/actions/index.ts +0 -9
- package/templates/hello-world/.botpress/implementation/typings/channels/index.ts +0 -6
- package/templates/hello-world/.botpress/implementation/typings/configuration/index.ts +0 -2
- package/templates/hello-world/.botpress/implementation/typings/configurations/index.ts +0 -6
- package/templates/hello-world/.botpress/implementation/typings/entities/index.ts +0 -6
- package/templates/hello-world/.botpress/implementation/typings/events/index.ts +0 -6
- package/templates/hello-world/.botpress/implementation/typings/index.ts +0 -31
- package/templates/hello-world/.botpress/implementation/typings/states/index.ts +0 -6
- package/templates/hello-world/.botpress/index.ts +0 -2
- package/templates/hello-world/.botpress/secrets/index.ts +0 -6
- package/templates/webhook-message/.botpress/implementation/index.ts +0 -57
- package/templates/webhook-message/.botpress/implementation/typings/actions/index.ts +0 -6
- package/templates/webhook-message/.botpress/implementation/typings/channels/index.ts +0 -9
- package/templates/webhook-message/.botpress/implementation/typings/channels/webhook/index.ts +0 -12
- package/templates/webhook-message/.botpress/implementation/typings/channels/webhook/messages/index.ts +0 -9
- package/templates/webhook-message/.botpress/implementation/typings/channels/webhook/messages/text.ts +0 -5
- package/templates/webhook-message/.botpress/implementation/typings/configuration/index.ts +0 -8
- package/templates/webhook-message/.botpress/implementation/typings/configurations/index.ts +0 -6
- package/templates/webhook-message/.botpress/implementation/typings/entities/index.ts +0 -6
- package/templates/webhook-message/.botpress/implementation/typings/events/index.ts +0 -6
- package/templates/webhook-message/.botpress/implementation/typings/index.ts +0 -31
- package/templates/webhook-message/.botpress/implementation/typings/states/index.ts +0 -6
- package/templates/webhook-message/.botpress/index.ts +0 -2
- package/templates/webhook-message/.botpress/secrets/index.ts +0 -6
package/dist/utils/id-utils.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var id_utils_exports = {};
|
|
30
|
-
__export(id_utils_exports, {
|
|
31
|
-
isPrefixedULID: () => isPrefixedULID,
|
|
32
|
-
isValidID: () => isValidID
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(id_utils_exports);
|
|
35
|
-
var import_const = require("@bpinternal/const");
|
|
36
|
-
var uuid = __toESM(require("uuid"));
|
|
37
|
-
const ULID_LENGTH = 26;
|
|
38
|
-
function isValidID(id) {
|
|
39
|
-
return isPrefixedULID(id) || uuid.validate(id);
|
|
40
|
-
}
|
|
41
|
-
function isPrefixedULID(id) {
|
|
42
|
-
const [prefix, identifier] = id.split("_");
|
|
43
|
-
if (!(prefix && identifier)) {
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
if (!Object.keys(import_const.prefixToObjectMap).includes(prefix)) {
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
if (identifier.length < ULID_LENGTH) {
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
55
|
-
0 && (module.exports = {
|
|
56
|
-
isPrefixedULID,
|
|
57
|
-
isValidID
|
|
58
|
-
});
|
|
59
|
-
//# sourceMappingURL=id-utils.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/utils/id-utils.ts"],
|
|
4
|
-
"sourcesContent": ["import { prefixToObjectMap } from '@bpinternal/const'\nimport * as uuid from 'uuid'\n\nconst ULID_LENGTH = 26 // Reference: https://github.com/ulid/spec#canonical-string-representation\n\nexport function isValidID(id: string) {\n // Note: UUIDs were used first and then prefixed ULIDs were introduced.\n return isPrefixedULID(id) || uuid.validate(id)\n}\n\nexport function isPrefixedULID(id: string) {\n const [prefix, identifier] = id.split('_')\n\n if (!(prefix && identifier)) {\n return false\n }\n\n if (!Object.keys(prefixToObjectMap).includes(prefix)) {\n return false\n }\n\n if (identifier.length < ULID_LENGTH) {\n return false\n }\n\n return true\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkC;AAClC,WAAsB;AAEtB,MAAM,cAAc;AAEb,SAAS,UAAU,IAAY;AAEpC,SAAO,eAAe,EAAE,KAAK,KAAK,SAAS,EAAE;AAC/C;AAEO,SAAS,eAAe,IAAY;AACzC,QAAM,CAAC,QAAQ,UAAU,IAAI,GAAG,MAAM,GAAG;AAEzC,MAAI,EAAE,UAAU,aAAa;AAC3B,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,OAAO,KAAK,8BAAiB,EAAE,SAAS,MAAM,GAAG;AACpD,WAAO;AAAA,EACT;AAEA,MAAI,WAAW,SAAS,aAAa;AACnC,WAAO;AAAA,EACT;AAEA,SAAO;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/utils/index.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var utils_exports = {};
|
|
30
|
-
__export(utils_exports, {
|
|
31
|
-
cache: () => cache,
|
|
32
|
-
casing: () => casing,
|
|
33
|
-
emitter: () => emitter,
|
|
34
|
-
esbuild: () => esbuild,
|
|
35
|
-
filewatcher: () => filewatcher,
|
|
36
|
-
guards: () => guards,
|
|
37
|
-
id: () => id,
|
|
38
|
-
object: () => object,
|
|
39
|
-
path: () => path,
|
|
40
|
-
pkgJson: () => pkgJson,
|
|
41
|
-
promises: () => promises,
|
|
42
|
-
prompt: () => prompt,
|
|
43
|
-
records: () => records,
|
|
44
|
-
require: () => require2,
|
|
45
|
-
schema: () => schema,
|
|
46
|
-
semver: () => semver,
|
|
47
|
-
string: () => string,
|
|
48
|
-
template: () => template,
|
|
49
|
-
tunnel: () => tunnel,
|
|
50
|
-
types: () => types,
|
|
51
|
-
url: () => url
|
|
52
|
-
});
|
|
53
|
-
module.exports = __toCommonJS(utils_exports);
|
|
54
|
-
var cache = __toESM(require("./cache-utils"));
|
|
55
|
-
var casing = __toESM(require("./case-utils"));
|
|
56
|
-
var emitter = __toESM(require("./event-emitter"));
|
|
57
|
-
var esbuild = __toESM(require("./esbuild-utils"));
|
|
58
|
-
var filewatcher = __toESM(require("./file-watcher"));
|
|
59
|
-
var guards = __toESM(require("./guard-utils"));
|
|
60
|
-
var id = __toESM(require("./id-utils"));
|
|
61
|
-
var object = __toESM(require("./object-utils"));
|
|
62
|
-
var path = __toESM(require("./path-utils"));
|
|
63
|
-
var pkgJson = __toESM(require("./pkgjson-utils"));
|
|
64
|
-
var promises = __toESM(require("./promise-utils"));
|
|
65
|
-
var prompt = __toESM(require("./prompt-utils"));
|
|
66
|
-
var records = __toESM(require("./record-utils"));
|
|
67
|
-
var require2 = __toESM(require("./require-utils"));
|
|
68
|
-
var schema = __toESM(require("./schema-utils"));
|
|
69
|
-
var semver = __toESM(require("./semver-utils"));
|
|
70
|
-
var string = __toESM(require("./string-utils"));
|
|
71
|
-
var template = __toESM(require("./template-utils"));
|
|
72
|
-
var tunnel = __toESM(require("./tunnel-utils"));
|
|
73
|
-
var types = __toESM(require("./type-utils"));
|
|
74
|
-
var url = __toESM(require("./url-utils"));
|
|
75
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
76
|
-
0 && (module.exports = {
|
|
77
|
-
cache,
|
|
78
|
-
casing,
|
|
79
|
-
emitter,
|
|
80
|
-
esbuild,
|
|
81
|
-
filewatcher,
|
|
82
|
-
guards,
|
|
83
|
-
id,
|
|
84
|
-
object,
|
|
85
|
-
path,
|
|
86
|
-
pkgJson,
|
|
87
|
-
promises,
|
|
88
|
-
prompt,
|
|
89
|
-
records,
|
|
90
|
-
require,
|
|
91
|
-
schema,
|
|
92
|
-
semver,
|
|
93
|
-
string,
|
|
94
|
-
template,
|
|
95
|
-
tunnel,
|
|
96
|
-
types,
|
|
97
|
-
url
|
|
98
|
-
});
|
|
99
|
-
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/utils/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * as cache from './cache-utils'\nexport * as casing from './case-utils'\nexport * as emitter from './event-emitter'\nexport * as esbuild from './esbuild-utils'\nexport * as filewatcher from './file-watcher'\nexport * as guards from './guard-utils'\nexport * as id from './id-utils'\nexport * as object from './object-utils'\nexport * as path from './path-utils'\nexport * as pkgJson from './pkgjson-utils'\nexport * as promises from './promise-utils'\nexport * as prompt from './prompt-utils'\nexport * as records from './record-utils'\nexport * as require from './require-utils'\nexport * as schema from './schema-utils'\nexport * as semver from './semver-utils'\nexport * as string from './string-utils'\nexport * as template from './template-utils'\nexport * as tunnel from './tunnel-utils'\nexport * as types from './type-utils'\nexport * as url from './url-utils'\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAAuB;AACvB,aAAwB;AACxB,cAAyB;AACzB,cAAyB;AACzB,kBAA6B;AAC7B,aAAwB;AACxB,SAAoB;AACpB,aAAwB;AACxB,WAAsB;AACtB,cAAyB;AACzB,eAA0B;AAC1B,aAAwB;AACxB,cAAyB;AACzB,IAAAA,WAAyB;AACzB,aAAwB;AACxB,aAAwB;AACxB,aAAwB;AACxB,eAA0B;AAC1B,aAAwB;AACxB,YAAuB;AACvB,UAAqB;",
|
|
6
|
-
"names": ["require"]
|
|
7
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var object_utils_exports = {};
|
|
20
|
-
__export(object_utils_exports, {
|
|
21
|
-
omit: () => omit
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(object_utils_exports);
|
|
24
|
-
const omit = (obj, property) => {
|
|
25
|
-
const { [property]: _, ...rest } = obj;
|
|
26
|
-
return rest;
|
|
27
|
-
};
|
|
28
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
-
0 && (module.exports = {
|
|
30
|
-
omit
|
|
31
|
-
});
|
|
32
|
-
//# sourceMappingURL=object-utils.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/utils/object-utils.ts"],
|
|
4
|
-
"sourcesContent": ["export const omit = <O extends object, K extends keyof O>(obj: O, property: K): Omit<O, K> => {\n const { [property]: _, ...rest } = obj\n return rest\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,OAAO,CAAsC,KAAQ,aAA4B;AAC5F,QAAM,EAAE,CAAC,QAAQ,GAAG,GAAG,GAAG,KAAK,IAAI;AACnC,SAAO;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/utils/path-utils.js
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var path_utils_exports = {};
|
|
30
|
-
__export(path_utils_exports, {
|
|
31
|
-
PathStore: () => PathStore,
|
|
32
|
-
absoluteFrom: () => absoluteFrom,
|
|
33
|
-
cwd: () => cwd,
|
|
34
|
-
isAbsolutePath: () => isAbsolutePath,
|
|
35
|
-
isPath: () => isPath,
|
|
36
|
-
join: () => join,
|
|
37
|
-
posix: () => posix,
|
|
38
|
-
relativeFrom: () => relativeFrom,
|
|
39
|
-
rmExtension: () => rmExtension,
|
|
40
|
-
toUnix: () => toUnix,
|
|
41
|
-
win32: () => win32
|
|
42
|
-
});
|
|
43
|
-
module.exports = __toCommonJS(path_utils_exports);
|
|
44
|
-
var import_lodash = __toESM(require("lodash"));
|
|
45
|
-
var import_os = __toESM(require("os"));
|
|
46
|
-
var import_path = __toESM(require("path"));
|
|
47
|
-
var posix;
|
|
48
|
-
((posix2) => {
|
|
49
|
-
posix2.isPath = (path) => (0, posix2.isAbsolutePath)(path) || (0, posix2.isRelativePath)(path);
|
|
50
|
-
posix2.isRelativePath = (path) => path.startsWith("./") || path.startsWith("../");
|
|
51
|
-
posix2.isAbsolutePath = (path) => import_path.default.posix.isAbsolute(path);
|
|
52
|
-
})(posix || (posix = {}));
|
|
53
|
-
var win32;
|
|
54
|
-
((win322) => {
|
|
55
|
-
win322.isPath = (path) => (0, win322.isAbsolutePath)(path) || (0, win322.isRelativePath)(path);
|
|
56
|
-
win322.isRelativePath = (path) => path.startsWith(".\\") || path.startsWith("..\\");
|
|
57
|
-
win322.isAbsolutePath = (path) => /^[a-zA-Z]:\\/.test(path);
|
|
58
|
-
win322.escapeBackslashes = (path) => path.includes("\\\\") ? path : path.replaceAll("\\", "\\\\");
|
|
59
|
-
})(win32 || (win32 = {}));
|
|
60
|
-
const isPath = (path) => import_os.default.platform() === "win32" ? win32.isPath(path) : posix.isPath(path);
|
|
61
|
-
const isAbsolutePath = (path) => import_os.default.platform() === "win32" ? win32.isAbsolutePath(path) : posix.isAbsolutePath(path);
|
|
62
|
-
const cwd = () => process.cwd();
|
|
63
|
-
const join = (abs, ...paths) => {
|
|
64
|
-
const joined = import_path.default.join(abs, ...paths);
|
|
65
|
-
return import_path.default.normalize(joined);
|
|
66
|
-
};
|
|
67
|
-
const rmExtension = (filename) => filename.replace(/\.[^/.]+$/, "");
|
|
68
|
-
const toUnix = (path) => path.split(import_path.default.sep).join(import_path.default.posix.sep);
|
|
69
|
-
const absoluteFrom = (rootdir, target) => {
|
|
70
|
-
if (isAbsolutePath(target)) {
|
|
71
|
-
return target;
|
|
72
|
-
}
|
|
73
|
-
return import_path.default.join(rootdir, target);
|
|
74
|
-
};
|
|
75
|
-
const relativeFrom = (rootdir, target) => {
|
|
76
|
-
let absPath;
|
|
77
|
-
if (isAbsolutePath(target)) {
|
|
78
|
-
absPath = target;
|
|
79
|
-
} else {
|
|
80
|
-
absPath = import_path.default.resolve(import_path.default.join(rootdir, target));
|
|
81
|
-
}
|
|
82
|
-
return import_path.default.relative(rootdir, absPath);
|
|
83
|
-
};
|
|
84
|
-
class PathStore {
|
|
85
|
-
constructor(abs) {
|
|
86
|
-
this.abs = abs;
|
|
87
|
-
}
|
|
88
|
-
rel(from) {
|
|
89
|
-
return import_lodash.default.mapValues(this.abs, (to) => relativeFrom(this.abs[from], to));
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
93
|
-
0 && (module.exports = {
|
|
94
|
-
PathStore,
|
|
95
|
-
absoluteFrom,
|
|
96
|
-
cwd,
|
|
97
|
-
isAbsolutePath,
|
|
98
|
-
isPath,
|
|
99
|
-
join,
|
|
100
|
-
posix,
|
|
101
|
-
relativeFrom,
|
|
102
|
-
rmExtension,
|
|
103
|
-
toUnix,
|
|
104
|
-
win32
|
|
105
|
-
});
|
|
106
|
-
//# sourceMappingURL=path-utils.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/utils/path-utils.ts"],
|
|
4
|
-
"sourcesContent": ["import _ from 'lodash'\nimport oslib from 'os'\nimport pathlib from 'path'\n\nexport namespace posix {\n export type AbsolutePath = `/${string}`\n export const isPath = (path: string) => isAbsolutePath(path) || isRelativePath(path)\n export const isRelativePath = (path: string) => path.startsWith('./') || path.startsWith('../')\n export const isAbsolutePath = (path: string): path is AbsolutePath => pathlib.posix.isAbsolute(path)\n}\n\nexport namespace win32 {\n export type AbsolutePath = `${string}:\\\\${string}` // C:\\path\n export const isPath = (path: string) => isAbsolutePath(path) || isRelativePath(path)\n export const isRelativePath = (path: string) => path.startsWith('.\\\\') || path.startsWith('..\\\\')\n export const isAbsolutePath = (path: string): path is AbsolutePath => /^[a-zA-Z]:\\\\/.test(path) // bp cli does not allow omitting the drive letter\n export const escapeBackslashes = (path: string) => (path.includes('\\\\\\\\') ? path : path.replaceAll('\\\\', '\\\\\\\\')) // idempotent function\n}\n\nexport type AbsolutePath = posix.AbsolutePath | win32.AbsolutePath\nexport const isPath = (path: string) => (oslib.platform() === 'win32' ? win32.isPath(path) : posix.isPath(path))\nexport const isAbsolutePath = (path: string): path is AbsolutePath =>\n oslib.platform() === 'win32' ? win32.isAbsolutePath(path) : posix.isAbsolutePath(path)\n\nexport const cwd = (): AbsolutePath => process.cwd() as AbsolutePath\nexport const join = (abs: AbsolutePath, ...paths: string[]): AbsolutePath => {\n const joined = pathlib.join(abs, ...paths)\n return pathlib.normalize(joined) as AbsolutePath\n}\n\nexport const rmExtension = (filename: string) => filename.replace(/\\.[^/.]+$/, '')\n\nexport const toUnix = (path: string) => path.split(pathlib.sep).join(pathlib.posix.sep)\n\nexport const absoluteFrom = (rootdir: AbsolutePath, target: string): AbsolutePath => {\n if (isAbsolutePath(target)) {\n return target\n }\n return pathlib.join(rootdir, target) as AbsolutePath\n}\n\nexport const relativeFrom = (rootdir: AbsolutePath, target: string) => {\n let absPath: string\n\n if (isAbsolutePath(target)) {\n absPath = target\n } else {\n absPath = pathlib.resolve(pathlib.join(rootdir, target))\n }\n\n return pathlib.relative(rootdir, absPath)\n}\n\nexport class PathStore<P extends string> {\n public constructor(public readonly abs: Record<P, AbsolutePath>) {}\n public rel(from: Extract<P, `${string}Dir`>) {\n return _.mapValues(this.abs, (to) => relativeFrom(this.abs[from], to))\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAc;AACd,gBAAkB;AAClB,kBAAoB;AAEb,IAAU;AAAA,CAAV,CAAUA,WAAV;AAEE,EAAMA,OAAA,SAAS,CAAC,aAAiBA,OAAA,gBAAe,IAAI,SAAKA,OAAA,gBAAe,IAAI;AAC5E,EAAMA,OAAA,iBAAiB,CAAC,SAAiB,KAAK,WAAW,IAAI,KAAK,KAAK,WAAW,KAAK;AACvF,EAAMA,OAAA,iBAAiB,CAAC,SAAuC,YAAAC,QAAQ,MAAM,WAAW,IAAI;AAAA,GAJpF;AAOV,IAAU;AAAA,CAAV,CAAUC,WAAV;AAEE,EAAMA,OAAA,SAAS,CAAC,aAAiBA,OAAA,gBAAe,IAAI,SAAKA,OAAA,gBAAe,IAAI;AAC5E,EAAMA,OAAA,iBAAiB,CAAC,SAAiB,KAAK,WAAW,KAAK,KAAK,KAAK,WAAW,MAAM;AACzF,EAAMA,OAAA,iBAAiB,CAAC,SAAuC,eAAe,KAAK,IAAI;AACvF,EAAMA,OAAA,oBAAoB,CAAC,SAAkB,KAAK,SAAS,MAAM,IAAI,OAAO,KAAK,WAAW,MAAM,MAAM;AAAA,GALhG;AASV,MAAM,SAAS,CAAC,SAAkB,UAAAC,QAAM,SAAS,MAAM,UAAU,MAAM,OAAO,IAAI,IAAI,MAAM,OAAO,IAAI;AACvG,MAAM,iBAAiB,CAAC,SAC7B,UAAAA,QAAM,SAAS,MAAM,UAAU,MAAM,eAAe,IAAI,IAAI,MAAM,eAAe,IAAI;AAEhF,MAAM,MAAM,MAAoB,QAAQ,IAAI;AAC5C,MAAM,OAAO,CAAC,QAAsB,UAAkC;AAC3E,QAAM,SAAS,YAAAF,QAAQ,KAAK,KAAK,GAAG,KAAK;AACzC,SAAO,YAAAA,QAAQ,UAAU,MAAM;AACjC;AAEO,MAAM,cAAc,CAAC,aAAqB,SAAS,QAAQ,aAAa,EAAE;AAE1E,MAAM,SAAS,CAAC,SAAiB,KAAK,MAAM,YAAAA,QAAQ,GAAG,EAAE,KAAK,YAAAA,QAAQ,MAAM,GAAG;AAE/E,MAAM,eAAe,CAAC,SAAuB,WAAiC;AACnF,MAAI,eAAe,MAAM,GAAG;AAC1B,WAAO;AAAA,EACT;AACA,SAAO,YAAAA,QAAQ,KAAK,SAAS,MAAM;AACrC;AAEO,MAAM,eAAe,CAAC,SAAuB,WAAmB;AACrE,MAAI;AAEJ,MAAI,eAAe,MAAM,GAAG;AAC1B,cAAU;AAAA,EACZ,OAAO;AACL,cAAU,YAAAA,QAAQ,QAAQ,YAAAA,QAAQ,KAAK,SAAS,MAAM,CAAC;AAAA,EACzD;AAEA,SAAO,YAAAA,QAAQ,SAAS,SAAS,OAAO;AAC1C;AAEO,MAAM,UAA4B;AAAA,EAChC,YAA4B,KAA8B;AAA9B;AAAA,EAA+B;AAAA,EAC3D,IAAI,MAAkC;AAC3C,WAAO,cAAAG,QAAE,UAAU,KAAK,KAAK,CAAC,OAAO,aAAa,KAAK,IAAI,IAAI,GAAG,EAAE,CAAC;AAAA,EACvE;AACF;",
|
|
6
|
-
"names": ["posix", "pathlib", "win32", "oslib", "_"]
|
|
7
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
-
mod
|
|
23
|
-
));
|
|
24
|
-
var import_vitest = require("vitest");
|
|
25
|
-
var pathUtils = __toESM(require("./path-utils"));
|
|
26
|
-
(0, import_vitest.describe)("posix", () => {
|
|
27
|
-
(0, import_vitest.test)("isPath with valid relative path should return true", () => {
|
|
28
|
-
(0, import_vitest.expect)(pathUtils.posix.isPath("./src")).toBe(true);
|
|
29
|
-
(0, import_vitest.expect)(pathUtils.posix.isPath("../src")).toBe(true);
|
|
30
|
-
(0, import_vitest.expect)(pathUtils.posix.isPath("./src/services")).toBe(true);
|
|
31
|
-
(0, import_vitest.expect)(pathUtils.posix.isPath("./src/services/index.ts")).toBe(true);
|
|
32
|
-
(0, import_vitest.expect)(pathUtils.posix.isPath("./.././.././../lol.json")).toBe(true);
|
|
33
|
-
});
|
|
34
|
-
(0, import_vitest.test)("isPath with valid absolute path should return true", () => {
|
|
35
|
-
(0, import_vitest.expect)(pathUtils.posix.isPath("/src")).toBe(true);
|
|
36
|
-
(0, import_vitest.expect)(pathUtils.posix.isPath("/src")).toBe(true);
|
|
37
|
-
(0, import_vitest.expect)(pathUtils.posix.isPath("/src/services")).toBe(true);
|
|
38
|
-
(0, import_vitest.expect)(pathUtils.posix.isPath("/src/services/index.ts")).toBe(true);
|
|
39
|
-
});
|
|
40
|
-
(0, import_vitest.test)("isPath with invalid path should return false", () => {
|
|
41
|
-
(0, import_vitest.expect)(pathUtils.posix.isPath("src")).toBe(false);
|
|
42
|
-
(0, import_vitest.expect)(pathUtils.posix.isPath(".src")).toBe(false);
|
|
43
|
-
(0, import_vitest.expect)(pathUtils.posix.isPath("..src")).toBe(false);
|
|
44
|
-
(0, import_vitest.expect)(pathUtils.posix.isPath("src/services")).toBe(false);
|
|
45
|
-
(0, import_vitest.expect)(pathUtils.posix.isPath("src/services/index.ts")).toBe(false);
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
(0, import_vitest.describe)("win32", () => {
|
|
49
|
-
(0, import_vitest.test)("isPath with valid relative path should return true", () => {
|
|
50
|
-
(0, import_vitest.expect)(pathUtils.win32.isPath(".\\src")).toBe(true);
|
|
51
|
-
(0, import_vitest.expect)(pathUtils.win32.isPath("..\\src")).toBe(true);
|
|
52
|
-
(0, import_vitest.expect)(pathUtils.win32.isPath(".\\src\\services")).toBe(true);
|
|
53
|
-
(0, import_vitest.expect)(pathUtils.win32.isPath(".\\src\\services\\index.ts")).toBe(true);
|
|
54
|
-
(0, import_vitest.expect)(pathUtils.win32.isPath(".\\..\\.\\..\\.\\..\\lol.json")).toBe(true);
|
|
55
|
-
});
|
|
56
|
-
(0, import_vitest.test)("isPath with valid absolute path should return true", () => {
|
|
57
|
-
(0, import_vitest.expect)(pathUtils.win32.isPath("C:\\src")).toBe(true);
|
|
58
|
-
(0, import_vitest.expect)(pathUtils.win32.isPath("C:\\src")).toBe(true);
|
|
59
|
-
(0, import_vitest.expect)(pathUtils.win32.isPath("C:\\src\\services")).toBe(true);
|
|
60
|
-
(0, import_vitest.expect)(pathUtils.win32.isPath("C:\\src\\services\\index.ts")).toBe(true);
|
|
61
|
-
});
|
|
62
|
-
(0, import_vitest.test)("isPath with invalid path should return false", () => {
|
|
63
|
-
(0, import_vitest.expect)(pathUtils.win32.isPath("src")).toBe(false);
|
|
64
|
-
(0, import_vitest.expect)(pathUtils.win32.isPath(".src")).toBe(false);
|
|
65
|
-
(0, import_vitest.expect)(pathUtils.win32.isPath("..src")).toBe(false);
|
|
66
|
-
(0, import_vitest.expect)(pathUtils.win32.isPath("src\\services")).toBe(false);
|
|
67
|
-
(0, import_vitest.expect)(pathUtils.win32.isPath("src\\services\\index.ts")).toBe(false);
|
|
68
|
-
(0, import_vitest.expect)(pathUtils.win32.isPath("\\services")).toBe(false);
|
|
69
|
-
(0, import_vitest.expect)(pathUtils.win32.isPath("\\services\\index.ts")).toBe(false);
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
//# sourceMappingURL=path-utils.test.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/utils/path-utils.test.ts"],
|
|
4
|
-
"sourcesContent": ["import { test, expect, describe } from 'vitest'\nimport * as pathUtils from './path-utils'\n\ndescribe('posix', () => {\n test('isPath with valid relative path should return true', () => {\n expect(pathUtils.posix.isPath('./src')).toBe(true)\n expect(pathUtils.posix.isPath('../src')).toBe(true)\n expect(pathUtils.posix.isPath('./src/services')).toBe(true)\n expect(pathUtils.posix.isPath('./src/services/index.ts')).toBe(true)\n expect(pathUtils.posix.isPath('./.././.././../lol.json')).toBe(true)\n })\n\n test('isPath with valid absolute path should return true', () => {\n expect(pathUtils.posix.isPath('/src')).toBe(true)\n expect(pathUtils.posix.isPath('/src')).toBe(true)\n expect(pathUtils.posix.isPath('/src/services')).toBe(true)\n expect(pathUtils.posix.isPath('/src/services/index.ts')).toBe(true)\n })\n\n test('isPath with invalid path should return false', () => {\n // these are technically valid posix paths, but not for the bp cli\n expect(pathUtils.posix.isPath('src')).toBe(false)\n expect(pathUtils.posix.isPath('.src')).toBe(false)\n expect(pathUtils.posix.isPath('..src')).toBe(false)\n expect(pathUtils.posix.isPath('src/services')).toBe(false)\n expect(pathUtils.posix.isPath('src/services/index.ts')).toBe(false)\n })\n})\n\ndescribe('win32', () => {\n test('isPath with valid relative path should return true', () => {\n expect(pathUtils.win32.isPath('.\\\\src')).toBe(true)\n expect(pathUtils.win32.isPath('..\\\\src')).toBe(true)\n expect(pathUtils.win32.isPath('.\\\\src\\\\services')).toBe(true)\n expect(pathUtils.win32.isPath('.\\\\src\\\\services\\\\index.ts')).toBe(true)\n expect(pathUtils.win32.isPath('.\\\\..\\\\.\\\\..\\\\.\\\\..\\\\lol.json')).toBe(true)\n })\n\n test('isPath with valid absolute path should return true', () => {\n expect(pathUtils.win32.isPath('C:\\\\src')).toBe(true)\n expect(pathUtils.win32.isPath('C:\\\\src')).toBe(true)\n expect(pathUtils.win32.isPath('C:\\\\src\\\\services')).toBe(true)\n expect(pathUtils.win32.isPath('C:\\\\src\\\\services\\\\index.ts')).toBe(true)\n })\n\n test('isPath with invalid path should return false', () => {\n // these are technically valid win32 paths, but not for the bp cli\n expect(pathUtils.win32.isPath('src')).toBe(false)\n expect(pathUtils.win32.isPath('.src')).toBe(false)\n expect(pathUtils.win32.isPath('..src')).toBe(false)\n expect(pathUtils.win32.isPath('src\\\\services')).toBe(false)\n expect(pathUtils.win32.isPath('src\\\\services\\\\index.ts')).toBe(false)\n expect(pathUtils.win32.isPath('\\\\services')).toBe(false)\n expect(pathUtils.win32.isPath('\\\\services\\\\index.ts')).toBe(false)\n })\n})\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,oBAAuC;AACvC,gBAA2B;AAAA,IAE3B,wBAAS,SAAS,MAAM;AACtB,0BAAK,sDAAsD,MAAM;AAC/D,8BAAO,UAAU,MAAM,OAAO,OAAO,CAAC,EAAE,KAAK,IAAI;AACjD,8BAAO,UAAU,MAAM,OAAO,QAAQ,CAAC,EAAE,KAAK,IAAI;AAClD,8BAAO,UAAU,MAAM,OAAO,gBAAgB,CAAC,EAAE,KAAK,IAAI;AAC1D,8BAAO,UAAU,MAAM,OAAO,yBAAyB,CAAC,EAAE,KAAK,IAAI;AACnE,8BAAO,UAAU,MAAM,OAAO,yBAAyB,CAAC,EAAE,KAAK,IAAI;AAAA,EACrE,CAAC;AAED,0BAAK,sDAAsD,MAAM;AAC/D,8BAAO,UAAU,MAAM,OAAO,MAAM,CAAC,EAAE,KAAK,IAAI;AAChD,8BAAO,UAAU,MAAM,OAAO,MAAM,CAAC,EAAE,KAAK,IAAI;AAChD,8BAAO,UAAU,MAAM,OAAO,eAAe,CAAC,EAAE,KAAK,IAAI;AACzD,8BAAO,UAAU,MAAM,OAAO,wBAAwB,CAAC,EAAE,KAAK,IAAI;AAAA,EACpE,CAAC;AAED,0BAAK,gDAAgD,MAAM;AAEzD,8BAAO,UAAU,MAAM,OAAO,KAAK,CAAC,EAAE,KAAK,KAAK;AAChD,8BAAO,UAAU,MAAM,OAAO,MAAM,CAAC,EAAE,KAAK,KAAK;AACjD,8BAAO,UAAU,MAAM,OAAO,OAAO,CAAC,EAAE,KAAK,KAAK;AAClD,8BAAO,UAAU,MAAM,OAAO,cAAc,CAAC,EAAE,KAAK,KAAK;AACzD,8BAAO,UAAU,MAAM,OAAO,uBAAuB,CAAC,EAAE,KAAK,KAAK;AAAA,EACpE,CAAC;AACH,CAAC;AAAA,IAED,wBAAS,SAAS,MAAM;AACtB,0BAAK,sDAAsD,MAAM;AAC/D,8BAAO,UAAU,MAAM,OAAO,QAAQ,CAAC,EAAE,KAAK,IAAI;AAClD,8BAAO,UAAU,MAAM,OAAO,SAAS,CAAC,EAAE,KAAK,IAAI;AACnD,8BAAO,UAAU,MAAM,OAAO,kBAAkB,CAAC,EAAE,KAAK,IAAI;AAC5D,8BAAO,UAAU,MAAM,OAAO,4BAA4B,CAAC,EAAE,KAAK,IAAI;AACtE,8BAAO,UAAU,MAAM,OAAO,+BAA+B,CAAC,EAAE,KAAK,IAAI;AAAA,EAC3E,CAAC;AAED,0BAAK,sDAAsD,MAAM;AAC/D,8BAAO,UAAU,MAAM,OAAO,SAAS,CAAC,EAAE,KAAK,IAAI;AACnD,8BAAO,UAAU,MAAM,OAAO,SAAS,CAAC,EAAE,KAAK,IAAI;AACnD,8BAAO,UAAU,MAAM,OAAO,mBAAmB,CAAC,EAAE,KAAK,IAAI;AAC7D,8BAAO,UAAU,MAAM,OAAO,6BAA6B,CAAC,EAAE,KAAK,IAAI;AAAA,EACzE,CAAC;AAED,0BAAK,gDAAgD,MAAM;AAEzD,8BAAO,UAAU,MAAM,OAAO,KAAK,CAAC,EAAE,KAAK,KAAK;AAChD,8BAAO,UAAU,MAAM,OAAO,MAAM,CAAC,EAAE,KAAK,KAAK;AACjD,8BAAO,UAAU,MAAM,OAAO,OAAO,CAAC,EAAE,KAAK,KAAK;AAClD,8BAAO,UAAU,MAAM,OAAO,eAAe,CAAC,EAAE,KAAK,KAAK;AAC1D,8BAAO,UAAU,MAAM,OAAO,yBAAyB,CAAC,EAAE,KAAK,KAAK;AACpE,8BAAO,UAAU,MAAM,OAAO,YAAY,CAAC,EAAE,KAAK,KAAK;AACvD,8BAAO,UAAU,MAAM,OAAO,sBAAsB,CAAC,EAAE,KAAK,KAAK;AAAA,EACnE,CAAC;AACH,CAAC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var pkgjson_utils_exports = {};
|
|
30
|
-
__export(pkgjson_utils_exports, {
|
|
31
|
-
findDependency: () => findDependency,
|
|
32
|
-
readPackageJson: () => readPackageJson
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(pkgjson_utils_exports);
|
|
35
|
-
var import_fs = __toESM(require("fs"));
|
|
36
|
-
var import_path = __toESM(require("path"));
|
|
37
|
-
const FILE_NAME = "package.json";
|
|
38
|
-
const readPackageJson = async (path) => {
|
|
39
|
-
const filePath = import_path.default.basename(path) === FILE_NAME ? path : import_path.default.join(path, FILE_NAME);
|
|
40
|
-
if (!import_fs.default.existsSync(filePath)) {
|
|
41
|
-
return void 0;
|
|
42
|
-
}
|
|
43
|
-
const strContent = await import_fs.default.promises.readFile(filePath, "utf8");
|
|
44
|
-
const jsonContent = JSON.parse(strContent);
|
|
45
|
-
return jsonContent;
|
|
46
|
-
};
|
|
47
|
-
const findDependency = (pkgJson, name) => {
|
|
48
|
-
const { dependencies, devDependencies, peerDependencies } = pkgJson;
|
|
49
|
-
const allDependencies = { ...dependencies ?? {}, ...devDependencies ?? {}, ...peerDependencies ?? {} };
|
|
50
|
-
return allDependencies[name];
|
|
51
|
-
};
|
|
52
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
-
0 && (module.exports = {
|
|
54
|
-
findDependency,
|
|
55
|
-
readPackageJson
|
|
56
|
-
});
|
|
57
|
-
//# sourceMappingURL=pkgjson-utils.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/utils/pkgjson-utils.ts"],
|
|
4
|
-
"sourcesContent": ["import fs from 'fs'\nimport pathlib from 'path'\n\ntype JSON = string | number | boolean | null | JSON[] | { [key: string]: JSON }\n\nexport type PackageJson = {\n name: string\n version?: string\n description?: string\n scripts?: Record<string, string>\n dependencies?: Record<string, string>\n devDependencies?: Record<string, string>\n peerDependencies?: Record<string, string>\n} & {\n [key: string]: JSON\n}\n\nconst FILE_NAME = 'package.json'\n\nexport const readPackageJson = async (path: string): Promise<PackageJson | undefined> => {\n const filePath = pathlib.basename(path) === FILE_NAME ? path : pathlib.join(path, FILE_NAME)\n if (!fs.existsSync(filePath)) {\n return undefined\n }\n\n const strContent: string = await fs.promises.readFile(filePath, 'utf8')\n const jsonContent = JSON.parse(strContent)\n return jsonContent\n}\n\nexport const findDependency = (pkgJson: PackageJson, name: string): string | undefined => {\n const { dependencies, devDependencies, peerDependencies } = pkgJson\n const allDependencies = { ...(dependencies ?? {}), ...(devDependencies ?? {}), ...(peerDependencies ?? {}) }\n return allDependencies[name]\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAe;AACf,kBAAoB;AAgBpB,MAAM,YAAY;AAEX,MAAM,kBAAkB,OAAO,SAAmD;AACvF,QAAM,WAAW,YAAAA,QAAQ,SAAS,IAAI,MAAM,YAAY,OAAO,YAAAA,QAAQ,KAAK,MAAM,SAAS;AAC3F,MAAI,CAAC,UAAAC,QAAG,WAAW,QAAQ,GAAG;AAC5B,WAAO;AAAA,EACT;AAEA,QAAM,aAAqB,MAAM,UAAAA,QAAG,SAAS,SAAS,UAAU,MAAM;AACtE,QAAM,cAAc,KAAK,MAAM,UAAU;AACzC,SAAO;AACT;AAEO,MAAM,iBAAiB,CAAC,SAAsB,SAAqC;AACxF,QAAM,EAAE,cAAc,iBAAiB,iBAAiB,IAAI;AAC5D,QAAM,kBAAkB,EAAE,GAAI,gBAAgB,CAAC,GAAI,GAAI,mBAAmB,CAAC,GAAI,GAAI,oBAAoB,CAAC,EAAG;AAC3G,SAAO,gBAAgB,IAAI;AAC7B;",
|
|
6
|
-
"names": ["pathlib", "fs"]
|
|
7
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var promise_utils_exports = {};
|
|
20
|
-
__export(promise_utils_exports, {
|
|
21
|
-
awaitRecord: () => awaitRecord
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(promise_utils_exports);
|
|
24
|
-
const awaitRecord = async (record) => {
|
|
25
|
-
const keys = Object.keys(record);
|
|
26
|
-
const values = await Promise.all(Object.values(record));
|
|
27
|
-
return keys.reduce((acc, key, index) => ({ ...acc, [key]: values[index] }), {});
|
|
28
|
-
};
|
|
29
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
-
0 && (module.exports = {
|
|
31
|
-
awaitRecord
|
|
32
|
-
});
|
|
33
|
-
//# sourceMappingURL=promise-utils.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/utils/promise-utils.ts"],
|
|
4
|
-
"sourcesContent": ["export const awaitRecord = async <T>(record: Record<string, Promise<T>>): Promise<Record<string, T>> => {\n const keys = Object.keys(record)\n const values = await Promise.all(Object.values(record))\n return keys.reduce((acc, key, index) => ({ ...acc, [key]: values[index] }), {})\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,cAAc,OAAU,WAAmE;AACtG,QAAM,OAAO,OAAO,KAAK,MAAM;AAC/B,QAAM,SAAS,MAAM,QAAQ,IAAI,OAAO,OAAO,MAAM,CAAC;AACtD,SAAO,KAAK,OAAO,CAAC,KAAK,KAAK,WAAW,EAAE,GAAG,KAAK,CAAC,GAAG,GAAG,OAAO,KAAK,EAAE,IAAI,CAAC,CAAC;AAChF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var import_vitest = require("vitest");
|
|
3
|
-
var import_promise_utils = require("./promise-utils");
|
|
4
|
-
(0, import_vitest.test)("awaitRecord", async () => {
|
|
5
|
-
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
6
|
-
const record = {
|
|
7
|
-
a: sleep(30).then(() => "a"),
|
|
8
|
-
b: sleep(20).then(() => "b"),
|
|
9
|
-
c: sleep(10).then(() => "c")
|
|
10
|
-
};
|
|
11
|
-
const result = await (0, import_promise_utils.awaitRecord)(record);
|
|
12
|
-
(0, import_vitest.expect)(result).toEqual({ a: "a", b: "b", c: "c" });
|
|
13
|
-
});
|
|
14
|
-
//# sourceMappingURL=promise-utils.test.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/utils/promise-utils.test.ts"],
|
|
4
|
-
"sourcesContent": ["import { test, expect } from 'vitest'\nimport { awaitRecord } from './promise-utils'\n\ntest('awaitRecord', async () => {\n const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms))\n const record = {\n a: sleep(30).then(() => 'a'),\n b: sleep(20).then(() => 'b'),\n c: sleep(10).then(() => 'c'),\n }\n const result = await awaitRecord(record)\n expect(result).toEqual({ a: 'a', b: 'b', c: 'c' })\n})\n"],
|
|
5
|
-
"mappings": ";AAAA,oBAA6B;AAC7B,2BAA4B;AAAA,IAE5B,oBAAK,eAAe,YAAY;AAC9B,QAAM,QAAQ,CAAC,OAAe,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,EAAE,CAAC;AAC9E,QAAM,SAAS;AAAA,IACb,GAAG,MAAM,EAAE,EAAE,KAAK,MAAM,GAAG;AAAA,IAC3B,GAAG,MAAM,EAAE,EAAE,KAAK,MAAM,GAAG;AAAA,IAC3B,GAAG,MAAM,EAAE,EAAE,KAAK,MAAM,GAAG;AAAA,EAC7B;AACA,QAAM,SAAS,UAAM,kCAAY,MAAM;AACvC,4BAAO,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,GAAG,KAAK,GAAG,IAAI,CAAC;AACnD,CAAC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|