@flarum/cli 2.0.0-beta.9 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +178 -48
- package/bin/run +2 -1
- package/bin/splitsh-lite-darwin +0 -0
- package/bin/splitsh-lite-linux +0 -0
- package/boilerplate/skeleton/extension/.gitattributes +16 -14
- package/boilerplate/skeleton/extension/.github/workflows/backend.yml +2 -6
- package/boilerplate/skeleton/extension/.github/workflows/frontend.yml +5 -6
- package/boilerplate/skeleton/extension/.github/workflows/phpstan.yml +12 -0
- package/boilerplate/skeleton/extension/LICENSE.md +1 -1
- package/boilerplate/skeleton/extension/README.md +1 -1
- package/boilerplate/skeleton/extension/composer.json +13 -7
- package/boilerplate/skeleton/extension/extend.php +2 -2
- package/boilerplate/skeleton/extension/gitignore +1 -0
- package/boilerplate/skeleton/extension/js/admin.ts +2 -0
- package/boilerplate/skeleton/extension/js/forum.ts +2 -0
- package/boilerplate/skeleton/extension/js/jest.config.cjs +1 -0
- package/boilerplate/skeleton/extension/js/package.json +11 -4
- package/boilerplate/skeleton/extension/js/src/admin/extend.js +8 -0
- package/boilerplate/skeleton/extension/js/src/admin/extend.ts +8 -0
- package/boilerplate/skeleton/extension/js/src/admin/index.js +2 -0
- package/boilerplate/skeleton/extension/js/src/admin/index.ts +7 -0
- package/boilerplate/skeleton/extension/js/src/common/extend.js +5 -0
- package/boilerplate/skeleton/extension/js/src/common/extend.ts +5 -0
- package/boilerplate/skeleton/extension/js/src/common/index.ts +5 -0
- package/boilerplate/skeleton/extension/js/src/forum/extend.js +8 -0
- package/boilerplate/skeleton/extension/js/src/forum/extend.ts +8 -0
- package/boilerplate/skeleton/extension/js/src/forum/index.js +2 -0
- package/boilerplate/skeleton/extension/js/src/forum/index.ts +7 -0
- package/boilerplate/skeleton/extension/js/tests/unit/.gitkeep +0 -0
- package/boilerplate/skeleton/extension/js/tsconfig.json +10 -2
- package/boilerplate/skeleton/extension/js/tsconfig.test.json +10 -0
- package/boilerplate/skeleton/extension/locale/en.yml +1 -1
- package/boilerplate/skeleton/extension/phpstan.neon +12 -0
- package/boilerplate/skeleton/extension/tests/phpunit.integration.xml +6 -7
- package/boilerplate/skeleton/extension/tests/phpunit.unit.xml +5 -10
- package/boilerplate/stubs/backend/advanced-api-resource.php +85 -0
- package/boilerplate/stubs/backend/api-resource.php +73 -0
- package/boilerplate/stubs/backend/command.php +2 -2
- package/boilerplate/stubs/backend/controller.php +19 -0
- package/boilerplate/stubs/backend/event-listener.php +1 -1
- package/boilerplate/stubs/backend/filter.php +25 -0
- package/boilerplate/stubs/backend/handler/command.php +6 -20
- package/boilerplate/stubs/backend/handler/handler.php +6 -14
- package/boilerplate/stubs/backend/integration-test.php +10 -7
- package/boilerplate/stubs/backend/job.php +6 -11
- package/boilerplate/stubs/backend/mail-driver.php +36 -0
- package/boilerplate/stubs/backend/middleware.php +19 -0
- package/boilerplate/stubs/backend/model.php +1 -1
- package/boilerplate/stubs/backend/notification-blueprint.php +42 -0
- package/boilerplate/stubs/backend/notification-driver.php +32 -0
- package/boilerplate/stubs/backend/policy.php +1 -1
- package/boilerplate/stubs/backend/post-type.php +35 -0
- package/boilerplate/stubs/backend/repository.php +2 -10
- package/boilerplate/stubs/backend/search/driver.php +13 -0
- package/boilerplate/stubs/backend/search/searcher.php +41 -0
- package/boilerplate/stubs/backend/service-provider.php +1 -1
- package/boilerplate/stubs/backend/validator.php +1 -1
- package/boilerplate/stubs/frontend/component.js +1 -1
- package/boilerplate/stubs/frontend/forum-page.js +68 -0
- package/boilerplate/stubs/frontend/gambit/boolean.js +12 -0
- package/boilerplate/stubs/frontend/gambit/key-value.js +16 -0
- package/boilerplate/stubs/frontend/modal.js +1 -1
- package/boilerplate/stubs/frontend/model.js +1 -1
- package/boilerplate/stubs/frontend/notification.js +22 -0
- package/boilerplate/stubs/frontend/post-type.js +13 -0
- package/boilerplate/stubs/migration.php +1 -1
- package/boilerplate/stubs/views/email/html/information.blade.php +8 -0
- package/boilerplate/stubs/views/email/html/notification.blade.php +8 -0
- package/boilerplate/stubs/views/email/plain/information.blade.php +7 -0
- package/boilerplate/stubs/views/email/plain/notification.blade.php +6 -0
- package/lib/base-command.d.ts +22 -6
- package/lib/base-command.js +114 -56
- package/lib/boilersmith/io.d.ts +33 -11
- package/lib/boilersmith/io.js +32 -17
- package/lib/boilersmith/paths.d.ts +3 -3
- package/lib/boilersmith/paths.js +7 -7
- package/lib/boilersmith/scaffolding/audit-step-factory.js +12 -12
- package/lib/boilersmith/scaffolding/infra-step-factory.js +2 -2
- package/lib/boilersmith/scaffolding/init-step-factory.js +5 -5
- package/lib/boilersmith/scaffolding/module.d.ts +30 -10
- package/lib/boilersmith/scaffolding/module.js +61 -19
- package/lib/boilersmith/scaffolding/scaffolder.d.ts +4 -1
- package/lib/boilersmith/scaffolding/scaffolder.js +33 -33
- package/lib/boilersmith/scaffolding/template-param.d.ts +2 -2
- package/lib/boilersmith/scaffolding/template-param.js +2 -2
- package/lib/boilersmith/step-manager.d.ts +15 -11
- package/lib/boilersmith/step-manager.js +45 -29
- package/lib/boilersmith/steps/stub-base.js +4 -4
- package/lib/boilersmith/utils/clone-and-fill.js +1 -1
- package/lib/boilersmith/utils/commit-async.d.ts +2 -0
- package/lib/boilersmith/utils/commit-async.js +15 -0
- package/lib/boilersmith/utils/json-leaf-paths.d.ts +2 -2
- package/lib/boilersmith/utils/read-tpl.js +2 -2
- package/lib/commands/audit/infra.d.ts +2 -5
- package/lib/commands/audit/infra.js +31 -9
- package/lib/commands/infra.d.ts +2 -10
- package/lib/commands/infra.js +20 -14
- package/lib/commands/init.d.ts +2 -5
- package/lib/commands/init.js +7 -5
- package/lib/commands/make/backend/{api-serializer.d.ts → api-resource.d.ts} +2 -5
- package/lib/commands/make/backend/api-resource.js +26 -0
- package/lib/commands/make/backend/command.d.ts +1 -4
- package/lib/commands/make/backend/command.js +3 -4
- package/lib/commands/make/backend/{api-controller.d.ts → controller.d.ts} +2 -5
- package/lib/commands/make/backend/controller.js +31 -0
- package/lib/commands/make/backend/event-listener.d.ts +1 -4
- package/lib/commands/make/backend/event-listener.js +2 -3
- package/lib/commands/make/backend/{api-serializer-attributes.d.ts → filter.d.ts} +3 -6
- package/lib/commands/make/backend/filter.js +26 -0
- package/lib/commands/make/backend/handler.d.ts +2 -5
- package/lib/commands/make/backend/handler.js +8 -11
- package/lib/commands/make/backend/integration-test.d.ts +1 -4
- package/lib/commands/make/backend/integration-test.js +4 -6
- package/lib/commands/make/backend/job.d.ts +1 -4
- package/lib/commands/make/backend/job.js +2 -2
- package/lib/commands/make/backend/mail-driver.d.ts +12 -0
- package/lib/commands/make/backend/mail-driver.js +29 -0
- package/lib/commands/make/backend/middleware.d.ts +11 -0
- package/lib/commands/make/backend/middleware.js +26 -0
- package/lib/commands/make/backend/migration.d.ts +1 -4
- package/lib/commands/make/backend/migration.js +10 -4
- package/lib/commands/make/backend/model.d.ts +6 -7
- package/lib/commands/make/backend/model.js +69 -449
- package/lib/commands/make/backend/notification-blueprint.d.ts +12 -0
- package/lib/commands/make/backend/notification-blueprint.js +29 -0
- package/lib/commands/make/backend/notification-driver.d.ts +12 -0
- package/lib/commands/make/backend/notification-driver.js +29 -0
- package/lib/commands/make/backend/policy.d.ts +1 -4
- package/lib/commands/make/backend/policy.js +2 -3
- package/lib/commands/make/backend/post-type.d.ts +12 -0
- package/lib/commands/make/backend/post-type.js +29 -0
- package/lib/commands/make/backend/repository.d.ts +1 -4
- package/lib/commands/make/backend/repository.js +1 -1
- package/lib/commands/make/backend/route.d.ts +1 -4
- package/lib/commands/make/backend/route.js +2 -3
- package/lib/commands/make/backend/search-driver.d.ts +11 -0
- package/lib/commands/make/backend/search-driver.js +51 -0
- package/lib/commands/make/backend/service-provider.d.ts +1 -4
- package/lib/commands/make/backend/service-provider.js +3 -4
- package/lib/commands/make/backend/validator.d.ts +1 -4
- package/lib/commands/make/backend/validator.js +2 -2
- package/lib/commands/make/frontend/component.d.ts +4 -5
- package/lib/commands/make/frontend/component.js +7 -2
- package/lib/commands/make/frontend/forum-page.d.ts +11 -0
- package/lib/commands/make/frontend/forum-page.js +92 -0
- package/lib/commands/make/frontend/gambit.d.ts +11 -0
- package/lib/commands/make/frontend/gambit.js +30 -0
- package/lib/commands/make/frontend/modal.d.ts +1 -4
- package/lib/commands/make/frontend/modal.js +3 -2
- package/lib/commands/make/frontend/model.d.ts +6 -7
- package/lib/commands/make/frontend/model.js +27 -28
- package/lib/commands/make/frontend/notification.d.ts +12 -0
- package/lib/commands/make/frontend/notification.js +62 -0
- package/lib/commands/make/frontend/post-type.d.ts +12 -0
- package/lib/commands/make/frontend/post-type.js +59 -0
- package/lib/commands/make/locale.d.ts +11 -0
- package/lib/commands/make/locale.js +27 -0
- package/lib/commands/make/model.d.ts +12 -0
- package/lib/commands/make/model.js +29 -0
- package/lib/commands/make/notification.d.ts +11 -0
- package/lib/commands/make/notification.js +33 -0
- package/lib/commands/make/post-type.d.ts +11 -0
- package/lib/commands/make/post-type.js +31 -0
- package/lib/commands/monorepo/create.d.ts +12 -0
- package/lib/commands/monorepo/create.js +20 -0
- package/lib/commands/monorepo/split.d.ts +12 -0
- package/lib/commands/monorepo/split.js +19 -0
- package/lib/commands/update/js-imports.d.ts +1 -4
- package/lib/commands/update/js-imports.js +2 -3
- package/lib/commands/upgrade/2.0.d.ts +17 -0
- package/lib/commands/upgrade/2.0.js +113 -0
- package/lib/help.js +2 -2
- package/lib/providers/php-provider.d.ts +7 -1
- package/lib/providers/php-provider.js +18 -5
- package/lib/steps/extenders/{api-serializer.d.ts → api-resource.d.ts} +1 -1
- package/lib/steps/extenders/api-resource.js +38 -0
- package/lib/steps/extenders/base.d.ts +1 -1
- package/lib/steps/extenders/base.js +13 -1
- package/lib/steps/extenders/console-command.js +1 -1
- package/lib/steps/extenders/event.js +1 -1
- package/lib/steps/extenders/mail-driver.d.ts +5 -0
- package/lib/steps/extenders/mail-driver.js +58 -0
- package/lib/steps/extenders/middleware.d.ts +5 -0
- package/lib/steps/extenders/middleware.js +57 -0
- package/lib/steps/extenders/notification-driver.d.ts +5 -0
- package/lib/steps/extenders/notification-driver.js +58 -0
- package/lib/steps/extenders/notification-type.d.ts +5 -0
- package/lib/steps/extenders/notification-type.js +55 -0
- package/lib/steps/extenders/policy.js +1 -1
- package/lib/steps/extenders/post-type.d.ts +5 -0
- package/lib/steps/extenders/post-type.js +42 -0
- package/lib/steps/extenders/route.js +11 -2
- package/lib/steps/extenders/search-driver.d.ts +5 -0
- package/lib/steps/extenders/search-driver.js +38 -0
- package/lib/steps/extenders/search-filter.d.ts +5 -0
- package/lib/steps/extenders/search-filter.js +67 -0
- package/lib/steps/extenders/service-provider.js +1 -1
- package/lib/steps/gen-ext-scaffolder.d.ts +4 -4
- package/lib/steps/gen-ext-scaffolder.js +262 -56
- package/lib/steps/js/base.d.ts +14 -5
- package/lib/steps/js/base.js +101 -27
- package/lib/steps/js/model.d.ts +4 -7
- package/lib/steps/js/model.js +45 -19
- package/lib/steps/js/notification.d.ts +7 -0
- package/lib/steps/js/notification.js +58 -0
- package/lib/steps/js/post-type.d.ts +8 -0
- package/lib/steps/js/post-type.js +60 -0
- package/lib/steps/js/routes.d.ts +7 -0
- package/lib/steps/js/routes.js +63 -0
- package/lib/steps/js/search-driver-locale.d.ts +8 -0
- package/lib/steps/js/search-driver-locale.js +36 -0
- package/lib/steps/js/search-gambit.d.ts +7 -0
- package/lib/steps/js/search-gambit.js +51 -0
- package/lib/steps/locale/base.d.ts +32 -0
- package/lib/steps/locale/base.js +97 -0
- package/lib/steps/misc/composer.js +2 -2
- package/lib/steps/misc/git.d.ts +1 -1
- package/lib/steps/misc/git.js +3 -3
- package/lib/steps/misc/npm.d.ts +11 -0
- package/lib/steps/misc/npm.js +19 -0
- package/lib/steps/misc/yarn.js +2 -2
- package/lib/steps/monorepo/create.d.ts +19 -0
- package/lib/steps/monorepo/create.js +187 -0
- package/lib/steps/monorepo/split.d.ts +14 -0
- package/lib/steps/monorepo/split.js +99 -0
- package/lib/steps/stubs/backend/advanced-api-resource.d.ts +13 -0
- package/lib/steps/stubs/backend/advanced-api-resource.js +81 -0
- package/lib/steps/stubs/backend/{api-serializer.d.ts → api-resource.d.ts} +2 -2
- package/lib/steps/stubs/backend/{api-serializer.js → api-resource.js} +12 -9
- package/lib/steps/stubs/backend/command.d.ts +2 -21
- package/lib/steps/stubs/backend/command.js +15 -1
- package/lib/steps/stubs/backend/{api-controller.d.ts → controller.d.ts} +4 -14
- package/lib/steps/stubs/backend/controller.js +40 -0
- package/lib/steps/stubs/backend/event-listener.d.ts +1 -1
- package/lib/steps/stubs/backend/event-listener.js +3 -1
- package/lib/steps/stubs/backend/filter.d.ts +8 -0
- package/lib/steps/stubs/backend/filter.js +44 -0
- package/lib/steps/stubs/backend/handler-command.d.ts +2 -27
- package/lib/steps/stubs/backend/handler-command.js +3 -1
- package/lib/steps/stubs/backend/handler.d.ts +1 -1
- package/lib/steps/stubs/backend/handler.js +5 -1
- package/lib/steps/stubs/backend/integration-test.d.ts +1 -1
- package/lib/steps/stubs/backend/integration-test.js +1 -4
- package/lib/steps/stubs/backend/job.d.ts +1 -1
- package/lib/steps/stubs/backend/job.js +1 -0
- package/lib/steps/stubs/backend/mail-driver.d.ts +7 -0
- package/lib/steps/stubs/backend/mail-driver.js +30 -0
- package/lib/steps/stubs/backend/middleware.d.ts +22 -0
- package/lib/steps/stubs/backend/middleware.js +31 -0
- package/lib/steps/stubs/backend/migration.js +6 -3
- package/lib/steps/stubs/backend/model.d.ts +2 -24
- package/lib/steps/stubs/backend/model.js +3 -5
- package/lib/steps/stubs/backend/notification-blueprint.d.ts +7 -0
- package/lib/steps/stubs/backend/notification-blueprint.js +44 -0
- package/lib/steps/stubs/backend/notification-driver.d.ts +7 -0
- package/lib/steps/stubs/backend/notification-driver.js +30 -0
- package/lib/steps/stubs/backend/policy.d.ts +1 -1
- package/lib/steps/stubs/backend/policy.js +3 -1
- package/lib/steps/stubs/backend/post-type.d.ts +7 -0
- package/lib/steps/stubs/backend/post-type.js +44 -0
- package/lib/steps/stubs/backend/repository.d.ts +1 -1
- package/lib/steps/stubs/backend/repository.js +3 -1
- package/lib/steps/stubs/backend/search-driver-searcher.d.ts +24 -0
- package/lib/steps/stubs/backend/search-driver-searcher.js +32 -0
- package/lib/steps/stubs/backend/search-driver.d.ts +8 -0
- package/lib/steps/stubs/backend/search-driver.js +49 -0
- package/lib/steps/stubs/backend/service-provider.d.ts +1 -1
- package/lib/steps/stubs/backend/service-provider.js +1 -0
- package/lib/steps/stubs/backend/validator.d.ts +1 -1
- package/lib/steps/stubs/backend/validator.js +1 -0
- package/lib/steps/stubs/flarum-base.js +1 -1
- package/lib/steps/stubs/frontend/component.d.ts +0 -5
- package/lib/steps/stubs/frontend/component.js +1 -0
- package/lib/steps/stubs/frontend/forum-page.d.ts +25 -0
- package/lib/steps/stubs/frontend/forum-page.js +37 -0
- package/lib/steps/stubs/frontend/gambit.d.ts +7 -0
- package/lib/steps/stubs/frontend/gambit.js +50 -0
- package/lib/steps/stubs/frontend/modal.d.ts +0 -5
- package/lib/steps/stubs/frontend/modal.js +1 -0
- package/lib/steps/stubs/frontend/model.d.ts +8 -1
- package/lib/steps/stubs/frontend/model.js +6 -0
- package/lib/steps/stubs/frontend/notification.d.ts +11 -0
- package/lib/steps/stubs/frontend/notification.js +48 -0
- package/lib/steps/stubs/frontend/post-type.d.ts +11 -0
- package/lib/steps/stubs/frontend/post-type.js +48 -0
- package/lib/steps/stubs/js-base.js +12 -5
- package/lib/steps/stubs/php-base.js +13 -9
- package/lib/steps/update/js-imports.js +9 -3
- package/lib/steps/upgrade/twopointoh/backend/email-views.d.ts +18 -0
- package/lib/steps/upgrade/twopointoh/backend/email-views.js +81 -0
- package/lib/steps/upgrade/twopointoh/backend/filesystem.d.ts +8 -0
- package/lib/steps/upgrade/twopointoh/backend/filesystem.js +40 -0
- package/lib/steps/upgrade/twopointoh/backend/intervention-image.d.ts +8 -0
- package/lib/steps/upgrade/twopointoh/backend/intervention-image.js +44 -0
- package/lib/steps/upgrade/twopointoh/backend/json-api.d.ts +12 -0
- package/lib/steps/upgrade/twopointoh/backend/json-api.js +111 -0
- package/lib/steps/upgrade/twopointoh/backend/mailer.d.ts +8 -0
- package/lib/steps/upgrade/twopointoh/backend/mailer.js +37 -0
- package/lib/steps/upgrade/twopointoh/backend/misc.d.ts +8 -0
- package/lib/steps/upgrade/twopointoh/backend/misc.js +42 -0
- package/lib/steps/upgrade/twopointoh/backend/phpunit.d.ts +8 -0
- package/lib/steps/upgrade/twopointoh/backend/phpunit.js +52 -0
- package/lib/steps/upgrade/twopointoh/backend/search.d.ts +28 -0
- package/lib/steps/upgrade/twopointoh/backend/search.js +200 -0
- package/lib/steps/upgrade/twopointoh/base.d.ts +58 -0
- package/lib/steps/upgrade/twopointoh/base.js +284 -0
- package/lib/steps/upgrade/twopointoh/dependencies.d.ts +10 -0
- package/lib/steps/upgrade/twopointoh/dependencies.js +108 -0
- package/lib/steps/upgrade/twopointoh/frontend/code-splitting/usage-of-lazy-modules.d.ts +26 -0
- package/lib/steps/upgrade/twopointoh/frontend/code-splitting/usage-of-lazy-modules.js +418 -0
- package/lib/steps/upgrade/twopointoh/frontend/export-registry/compat.d.ts +12 -0
- package/lib/steps/upgrade/twopointoh/frontend/export-registry/compat.js +75 -0
- package/lib/steps/upgrade/twopointoh/frontend/export-registry/import-ext.d.ts +13 -0
- package/lib/steps/upgrade/twopointoh/frontend/export-registry/import-ext.js +126 -0
- package/lib/steps/upgrade/twopointoh/frontend/format.d.ts +8 -0
- package/lib/steps/upgrade/twopointoh/frontend/format.js +32 -0
- package/lib/steps/upgrade/twopointoh/frontend/misc.d.ts +17 -0
- package/lib/steps/upgrade/twopointoh/frontend/misc.js +433 -0
- package/lib/steps/upgrade/twopointoh/infra.d.ts +10 -0
- package/lib/steps/upgrade/twopointoh/infra.js +51 -0
- package/lib/steps/upgrade/twopointoh/less.d.ts +12 -0
- package/lib/steps/upgrade/twopointoh/less.js +217 -0
- package/lib/utils/add-extenders.d.ts +2 -0
- package/lib/utils/add-extenders.js +115 -0
- package/lib/utils/ast.d.ts +22 -0
- package/lib/utils/ast.js +235 -0
- package/lib/utils/composer.d.ts +2 -1
- package/lib/utils/migration.js +3 -1
- package/lib/utils/model-name.d.ts +1 -0
- package/lib/utils/model-name.js +7 -3
- package/lib/utils/monorepo.d.ts +24 -0
- package/lib/utils/monorepo.js +24 -0
- package/lib/utils/validation.d.ts +6 -1
- package/lib/utils/validation.js +15 -0
- package/oclif.manifest.json +1 -1
- package/package.json +27 -14
- package/php-subsystem/composer.json +11 -9
- package/php-subsystem/composer.lock +66 -71
- package/php-subsystem/index.php +41 -6
- package/php-subsystem/src/CustomPrettyPrinter.php +1 -1
- package/php-subsystem/src/ExtenderUtil.php +7 -13
- package/php-subsystem/src/NodeUtil.php +72 -0
- package/php-subsystem/src/NodeVisitors/AddExtender.php +28 -12
- package/php-subsystem/src/NodeVisitors/AddUses.php +24 -0
- package/php-subsystem/src/NodeVisitors/ChangeSignatures.php +200 -0
- package/php-subsystem/src/NodeVisitors/ReplaceUses.php +175 -0
- package/php-subsystem/src/Upgrade/Replacement.php +51 -0
- package/php-subsystem/src/Upgrade/ReplacementResult.php +17 -0
- package/php-subsystem/src/Upgrade/TwoPointOh/EmailViews.php +94 -0
- package/php-subsystem/src/Upgrade/TwoPointOh/Filesystem.php +88 -0
- package/php-subsystem/src/Upgrade/TwoPointOh/InterventionImage.php +86 -0
- package/php-subsystem/src/Upgrade/TwoPointOh/JsonApi.php +186 -0
- package/php-subsystem/src/Upgrade/TwoPointOh/Misc.php +564 -0
- package/php-subsystem/src/Upgrade/TwoPointOh/PhpUnit.php +241 -0
- package/php-subsystem/src/Upgrade/TwoPointOh/Search.php +589 -0
- package/php-subsystem/vendor/autoload.php +18 -0
- package/php-subsystem/vendor/bin/php-parse +119 -0
- package/php-subsystem/vendor/composer/ClassLoader.php +166 -32
- package/php-subsystem/vendor/composer/InstalledVersions.php +350 -209
- package/php-subsystem/vendor/composer/autoload_classmap.php +1 -1
- package/php-subsystem/vendor/composer/autoload_namespaces.php +1 -1
- package/php-subsystem/vendor/composer/autoload_psr4.php +1 -1
- package/php-subsystem/vendor/composer/autoload_real.php +3 -22
- package/php-subsystem/vendor/composer/installed.json +56 -61
- package/php-subsystem/vendor/composer/installed.php +29 -30
- package/php-subsystem/vendor/composer/platform_check.php +2 -2
- package/php-subsystem/vendor/nikic/php-parser/README.md +21 -13
- package/php-subsystem/vendor/nikic/php-parser/bin/php-parse +12 -11
- package/php-subsystem/vendor/nikic/php-parser/composer.json +41 -39
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php +58 -11
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Class_.php +54 -25
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Declaration.php +11 -4
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php +87 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Enum_.php +116 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php +8 -9
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Function_.php +22 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Interface_.php +26 -7
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Method.php +31 -13
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php +5 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php +69 -26
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php +47 -18
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php +6 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php +25 -28
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Trait_.php +31 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder/Use_.php +8 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Builder.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php +85 -70
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php +119 -71
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Comment/Doc.php +1 -2
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Comment.php +35 -67
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluationException.php +3 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluator.php +17 -9
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Error.php +24 -33
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Collecting.php +6 -9
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Internal/DiffElem.php +11 -7
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Internal/Differ.php +36 -22
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php +24 -14
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenPolyfill.php +237 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php +63 -69
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/JsonDecoder.php +15 -10
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php +74 -92
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php +11 -18
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php +10 -15
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php +45 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php +19 -25
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php +6 -10
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.php +22 -29
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyFunctionTokenEmulator.php +31 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php +31 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php +6 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php +10 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer.php +70 -491
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Modifiers.php +69 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NameContext.php +23 -24
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php +13 -14
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/ArrayItem.php +43 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Attribute.php +9 -10
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php +5 -7
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/ClosureUse.php +36 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/ComplexType.php +13 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Const_.php +12 -13
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/DeclareItem.php +37 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php +10 -11
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php +1 -39
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php +11 -11
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php +35 -30
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php +9 -10
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseOr.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseXor.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Coalesce.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Concat.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Div.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Minus.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mod.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mul.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Plus.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Pow.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftLeft.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftRight.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php +9 -10
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Coalesce.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Concat.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Div.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Equal.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Greater.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalXor.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Minus.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mod.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mul.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotEqual.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotIdentical.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Plus.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Pow.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftRight.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Spaceship.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php +8 -11
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php +35 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Bool_.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Double.php +5 -6
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Int_.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Object_.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/String_.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Unset_.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php +5 -6
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php +12 -12
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php +34 -27
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php +1 -32
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php +5 -6
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php +10 -11
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php +15 -12
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php +13 -14
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php +11 -11
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php +12 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php +8 -7
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php +18 -13
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php +17 -12
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php +18 -13
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php +10 -10
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php +6 -7
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php +10 -10
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php +9 -9
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php +19 -14
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php +11 -11
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php +12 -13
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php +6 -7
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php +6 -7
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php +10 -11
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php +1 -2
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php +6 -9
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Identifier.php +13 -13
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/InterpolatedStringPart.php +32 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php +27 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/MatchArm.php +8 -9
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php +8 -9
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php +8 -9
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php +80 -53
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php +10 -11
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php +47 -23
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/PropertyItem.php +37 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.php +1 -68
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php +1 -29
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.php +1 -28
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Float_.php +78 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Int_.php +82 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/InterpolatedString.php +34 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php +1 -71
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Dir.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/File.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Function_.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Line.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Method.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Trait_.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php +44 -24
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar.php +1 -2
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/StaticVar.php +39 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Block.php +29 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php +8 -9
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php +10 -11
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php +11 -12
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php +33 -27
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php +15 -15
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php +66 -71
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php +48 -61
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php +8 -9
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php +1 -32
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php +12 -12
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php +9 -10
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php +9 -10
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php +11 -12
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php +17 -13
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php +19 -15
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php +20 -17
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php +31 -27
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php +16 -14
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php +18 -15
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php +13 -10
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php +11 -12
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php +35 -36
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php +1 -32
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php +8 -9
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php +1 -35
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php +8 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php +9 -10
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php +8 -9
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php +12 -13
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php +9 -10
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php +3 -4
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php +10 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php +11 -12
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php +7 -8
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php +1 -50
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php +16 -16
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php +9 -10
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt.php +1 -2
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php +8 -11
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/UseItem.php +55 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php +27 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node.php +24 -29
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php +20 -20
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php +169 -82
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeFinder.php +28 -19
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php +71 -84
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php +4 -7
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php +1 -2
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CommentAnnotatingVisitor.php +82 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php +4 -5
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php +6 -7
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php +40 -24
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php +2 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php +8 -11
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor.php +59 -7
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php +1 -2
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php +2011 -2058
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Parser/Php8.php +2717 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Parser.php +9 -3
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php +466 -248
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php +31 -33
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/PhpVersion.php +164 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php +419 -338
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter.php +51 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php +587 -431
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Token.php +18 -0
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/compatibility_tokens.php +63 -0
- package/boilerplate/stubs/backend/api-controller/create.php +0 -53
- package/boilerplate/stubs/backend/api-controller/delete.php +0 -52
- package/boilerplate/stubs/backend/api-controller/list.php +0 -61
- package/boilerplate/stubs/backend/api-controller/normal.php +0 -29
- package/boilerplate/stubs/backend/api-controller/show.php +0 -48
- package/boilerplate/stubs/backend/api-controller/update.php +0 -54
- package/boilerplate/stubs/backend/api-serializer.php +0 -36
- package/lib/commands/make/backend/api-controller.js +0 -27
- package/lib/commands/make/backend/api-serializer-attributes.js +0 -15
- package/lib/commands/make/backend/api-serializer.js +0 -15
- package/lib/steps/extenders/api-serializer.js +0 -77
- package/lib/steps/stubs/backend/api-controller.js +0 -62
- package/lib/steps/stubs/frontend/migration.js +0 -1
- package/php-subsystem/vendor/nikic/php-parser/.editorconfig +0 -9
- package/php-subsystem/vendor/nikic/php-parser/grammar/README.md +0 -30
- package/php-subsystem/vendor/nikic/php-parser/grammar/parser.template +0 -106
- package/php-subsystem/vendor/nikic/php-parser/grammar/php5.y +0 -1026
- package/php-subsystem/vendor/nikic/php-parser/grammar/php7.y +0 -1152
- package/php-subsystem/vendor/nikic/php-parser/grammar/phpyLang.php +0 -192
- package/php-subsystem/vendor/nikic/php-parser/grammar/rebuildParsers.php +0 -81
- package/php-subsystem/vendor/nikic/php-parser/grammar/tokens.template +0 -17
- package/php-subsystem/vendor/nikic/php-parser/grammar/tokens.y +0 -115
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/CoaleseEqualTokenEmulator.php +0 -47
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php +0 -76
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php +0 -23
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php +0 -105
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Throw_.php +0 -30
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Parser/Multiple.php +0 -55
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php +0 -2630
- package/php-subsystem/vendor/nikic/php-parser/lib/PhpParser/Parser/Tokens.php +0 -145
- /package/{lib/steps/stubs/frontend/migration.d.ts → boilerplate/skeleton/extension/js/tests/integration/.gitkeep} +0 -0
- /package/boilerplate/skeleton/extension/js/{webpack.config.js → webpack.config.cjs} +0 -0
package/lib/base-command.js
CHANGED
|
@@ -3,17 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.LocationType = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
|
-
const cli_ux_1 =
|
|
7
|
-
const
|
|
8
|
-
const globby_1 =
|
|
9
|
-
const
|
|
10
|
-
const
|
|
6
|
+
const cli_ux_1 = tslib_1.__importDefault(require("cli-ux"));
|
|
7
|
+
const path_1 = require("path");
|
|
8
|
+
const globby_1 = tslib_1.__importDefault(require("globby"));
|
|
9
|
+
const child_process_1 = require("child_process");
|
|
10
|
+
const fs_1 = require("fs");
|
|
11
11
|
const io_1 = require("boilersmith/io");
|
|
12
12
|
const step_manager_1 = require("boilersmith/step-manager");
|
|
13
13
|
const paths_1 = require("boilersmith/paths");
|
|
14
14
|
const php_provider_1 = require("./providers/php-provider");
|
|
15
|
-
const chalk_1 =
|
|
15
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
16
16
|
const errors_1 = require("@oclif/errors");
|
|
17
|
+
const monorepo_1 = require("./utils/monorepo");
|
|
18
|
+
const mem_fs_1 = require("mem-fs");
|
|
17
19
|
var LocationType;
|
|
18
20
|
(function (LocationType) {
|
|
19
21
|
LocationType[LocationType["FLARUM_EXTENSION"] = 0] = "FLARUM_EXTENSION";
|
|
@@ -23,19 +25,24 @@ var LocationType;
|
|
|
23
25
|
class BaseCommand extends core_1.Command {
|
|
24
26
|
constructor() {
|
|
25
27
|
super(...arguments);
|
|
26
|
-
this.STUB_PATH = (0,
|
|
28
|
+
this.STUB_PATH = (0, path_1.resolve)(__dirname, '../boilerplate/stubs/');
|
|
27
29
|
this.dry = false;
|
|
28
30
|
this.requireExistingExtension = true;
|
|
31
|
+
this.skipFinalMessage = false;
|
|
32
|
+
this.confirmed = false;
|
|
29
33
|
}
|
|
30
|
-
async
|
|
31
|
-
const { args
|
|
34
|
+
async runSteps(steps) {
|
|
35
|
+
const { args } = await this.parse(this.constructor);
|
|
32
36
|
this.args = args;
|
|
33
|
-
this.flags = flags;
|
|
34
37
|
const path = args.path;
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
this.
|
|
38
|
-
}
|
|
38
|
+
const paths = new paths_1.NodePaths({
|
|
39
|
+
requestedDir: path,
|
|
40
|
+
package: await this.extRoot(path),
|
|
41
|
+
});
|
|
42
|
+
const phpProvider = new php_provider_1.PhpSubsystemProvider((0, path_1.resolve)(__dirname, '../php-subsystem/index.php'));
|
|
43
|
+
return steps.run(paths, this.genIO(), { php: phpProvider }, this.dry, args);
|
|
44
|
+
}
|
|
45
|
+
async extRoot(path) {
|
|
39
46
|
let extRoot;
|
|
40
47
|
if (this.requireExistingExtension) {
|
|
41
48
|
const rootData = await this.getFlarumExtensionRoot(path || process.cwd());
|
|
@@ -46,36 +53,52 @@ class BaseCommand extends core_1.Command {
|
|
|
46
53
|
else {
|
|
47
54
|
extRoot = path || process.cwd();
|
|
48
55
|
}
|
|
56
|
+
return extRoot;
|
|
57
|
+
}
|
|
58
|
+
async run() {
|
|
59
|
+
var _a;
|
|
60
|
+
const { args, flags } = await this.parse(this.constructor);
|
|
61
|
+
this.args = args;
|
|
62
|
+
this.flags = flags;
|
|
63
|
+
const path = args.path;
|
|
64
|
+
const welcomeMessage = this.welcomeMessage();
|
|
65
|
+
if (welcomeMessage) {
|
|
66
|
+
this.log(welcomeMessage);
|
|
67
|
+
await this.continueWhenReady(this.genIO());
|
|
68
|
+
}
|
|
69
|
+
const extRoot = await this.extRoot(path);
|
|
49
70
|
await this.additionalPreRunChecks(extRoot);
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const phpProvider = new php_provider_1.PhpSubsystemProvider((0, node_path_1.resolve)(__dirname, '../php-subsystem/index.php'));
|
|
55
|
-
const out = await this.steps(new step_manager_1.StepManager())
|
|
56
|
-
.run(paths, this.genIO(), { php: phpProvider }, this.dry);
|
|
57
|
-
const errorMessages = out.messages.filter(m => m.type === 'error');
|
|
58
|
-
this.log('\n\n');
|
|
59
|
-
if (out.succeeded && errorMessages.length === 0) {
|
|
71
|
+
const out = await this.runSteps(this.steps(new step_manager_1.StepManager(), extRoot));
|
|
72
|
+
const errorMessages = out.messages.filter((m) => m.type === 'error');
|
|
73
|
+
// this.log('\n\n');
|
|
74
|
+
if (!this.skipFinalMessage && out.succeeded && errorMessages.length === 0) {
|
|
60
75
|
this.log(chalk_1.default.bold(chalk_1.default.underline(chalk_1.default.green('Success! The following steps were completed:'))));
|
|
61
76
|
}
|
|
62
|
-
else if (out.succeeded) {
|
|
77
|
+
else if (!this.skipFinalMessage && out.succeeded) {
|
|
63
78
|
this.log(chalk_1.default.bold(chalk_1.default.underline(chalk_1.default.yellow('All steps completed, but with some errors:'))));
|
|
64
79
|
for (const message of errorMessages) {
|
|
65
80
|
this.log(chalk_1.default.dim(chalk_1.default.red(message.message)));
|
|
66
81
|
}
|
|
67
82
|
this.log(chalk_1.default.bold(chalk_1.default.yellow('The steps that completed were:')));
|
|
68
83
|
}
|
|
69
|
-
else if (out.
|
|
84
|
+
else if (!out.succeeded && out.error.startsWith('EEXIT:')) {
|
|
70
85
|
this.log(chalk_1.default.bold(chalk_1.default.underline(chalk_1.default.red('Exiting.'))));
|
|
71
|
-
if (out.stepsRan.length > 0) {
|
|
86
|
+
if (!this.skipFinalMessage && out.stepsRan.length > 0) {
|
|
72
87
|
this.log(chalk_1.default.bold(chalk_1.default.yellow('Before the exit, the following steps were completed:')));
|
|
73
88
|
}
|
|
74
89
|
}
|
|
75
|
-
else {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
90
|
+
else if (!out.succeeded) {
|
|
91
|
+
const prettyPrint = ((_a = out.e) === null || _a === void 0 ? void 0 : _a.code) === 'FL_ERR';
|
|
92
|
+
if (!prettyPrint)
|
|
93
|
+
this.log(chalk_1.default.bold(chalk_1.default.underline(chalk_1.default.red('Error occurred, and could not complete:'))));
|
|
94
|
+
if (prettyPrint) {
|
|
95
|
+
this.log('\n');
|
|
96
|
+
this.log('\u001B[A => ' + chalk_1.default.bgRed.bold(' ERROR ') + ' ' + chalk_1.default.red(out.error));
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
this.log(chalk_1.default.red(out.error));
|
|
100
|
+
}
|
|
101
|
+
if (out.errorTrace && !prettyPrint) {
|
|
79
102
|
this.log(chalk_1.default.dim(chalk_1.default.red(out.errorTrace)));
|
|
80
103
|
}
|
|
81
104
|
if (out.stepsRan.length > 0) {
|
|
@@ -83,10 +106,12 @@ class BaseCommand extends core_1.Command {
|
|
|
83
106
|
this.log(chalk_1.default.bold(chalk_1.default.yellow('Before the error, the following steps were completed:')));
|
|
84
107
|
}
|
|
85
108
|
}
|
|
86
|
-
|
|
87
|
-
|
|
109
|
+
if (!this.skipFinalMessage) {
|
|
110
|
+
for (const stepName of out.stepsRan)
|
|
111
|
+
this.log(`- ${chalk_1.default.dim(stepName)}`);
|
|
112
|
+
}
|
|
88
113
|
this.log('');
|
|
89
|
-
const nonErrorMessages = out.messages.filter(m => m.type !== 'error');
|
|
114
|
+
const nonErrorMessages = out.messages.filter((m) => m.type !== 'error');
|
|
90
115
|
if (nonErrorMessages.length > 0) {
|
|
91
116
|
this.log('');
|
|
92
117
|
this.log('The following messages were generated during execution:');
|
|
@@ -115,64 +140,75 @@ class BaseCommand extends core_1.Command {
|
|
|
115
140
|
// Confirmation
|
|
116
141
|
// ----------------------------------------------------------------
|
|
117
142
|
genIO() {
|
|
118
|
-
return new io_1.PromptsIO(
|
|
143
|
+
return new io_1.PromptsIO(this.args, [], this.flags['no-interaction'], errors_1.exit);
|
|
119
144
|
}
|
|
120
145
|
monorepoPaths(options) {
|
|
146
|
+
var _a, _b;
|
|
121
147
|
try {
|
|
122
|
-
const monorepoConfig = (0,
|
|
123
|
-
const contents = JSON.parse(monorepoConfig.toString());
|
|
148
|
+
const monorepoConfig = (0, monorepo_1.getMonorepoConf)((0, mem_fs_1.create)(), new paths_1.NodePaths({ package: process.cwd() }));
|
|
124
149
|
return [
|
|
125
|
-
...(options.includeCore ? [
|
|
126
|
-
...(options.includeExtensions ?
|
|
127
|
-
...(options.includePhpPackages ?
|
|
128
|
-
...(options.includeJSPackages ?
|
|
150
|
+
...(options.includeCore && monorepoConfig.packages.core ? [(0, monorepo_1.corePath)(monorepoConfig.packages.core.name)] : []),
|
|
151
|
+
...(options.includeExtensions ? monorepoConfig.packages.extensions : []).map((ext) => (0, monorepo_1.extensionPath)(ext.name)),
|
|
152
|
+
...(options.includePhpPackages ? (_a = monorepoConfig.packages.composer) !== null && _a !== void 0 ? _a : [] : []).map((lib) => (0, monorepo_1.composerPath)(lib.name)),
|
|
153
|
+
...(options.includeJSPackages ? (_b = monorepoConfig.packages.npm) !== null && _b !== void 0 ? _b : [] : []).map((lib) => (0, monorepo_1.npmPath)(lib.name)),
|
|
129
154
|
];
|
|
130
155
|
}
|
|
131
|
-
catch (
|
|
156
|
+
catch (_c) {
|
|
132
157
|
this.error('Could not run monorepo command: `flarum-monorepo.json` file is missing or invalid.');
|
|
133
158
|
}
|
|
134
159
|
}
|
|
160
|
+
isFlarumMonorepo(path) {
|
|
161
|
+
return (0, fs_1.existsSync)((0, path_1.resolve)(path, 'flarum-monorepo.json'));
|
|
162
|
+
}
|
|
135
163
|
isFlarumCore(path) {
|
|
136
164
|
try {
|
|
137
|
-
const composerJsonPath = (0,
|
|
138
|
-
const val = JSON.parse((0,
|
|
165
|
+
const composerJsonPath = (0, path_1.resolve)(path, 'composer.json');
|
|
166
|
+
const val = JSON.parse((0, fs_1.readFileSync)(composerJsonPath, 'utf8'));
|
|
139
167
|
return val.name === 'flarum/core';
|
|
140
168
|
}
|
|
141
169
|
catch (_a) {
|
|
142
170
|
return false;
|
|
143
171
|
}
|
|
144
172
|
}
|
|
173
|
+
jsPackageManager(currDir) {
|
|
174
|
+
if (!(0, fs_1.existsSync)((0, path_1.resolve)(currDir, 'js')))
|
|
175
|
+
return null;
|
|
176
|
+
return (0, fs_1.existsSync)((0, path_1.resolve)(currDir, 'js/yarn.lock')) ? 'yarn' : 'npm';
|
|
177
|
+
}
|
|
145
178
|
async getFlarumExtensionRoot(currDir) {
|
|
146
|
-
let currPath = (0,
|
|
179
|
+
let currPath = (0, path_1.resolve)(currDir);
|
|
147
180
|
while (currPath !== '/') {
|
|
148
|
-
if ((0,
|
|
181
|
+
if ((0, fs_1.existsSync)((0, path_1.resolve)(currPath, 'flarum-monorepo.json'))) {
|
|
149
182
|
return { path: currPath, type: LocationType.FLARUM_MONOREPO };
|
|
150
183
|
}
|
|
151
|
-
if ((0,
|
|
184
|
+
if ((0, fs_1.existsSync)((0, path_1.resolve)(currPath, 'composer.json')) && (0, fs_1.existsSync)((0, path_1.resolve)(currPath, 'extend.php'))) {
|
|
152
185
|
return { path: currPath, type: LocationType.FLARUM_EXTENSION };
|
|
153
186
|
}
|
|
154
187
|
if (this.isFlarumCore(currPath)) {
|
|
155
188
|
return { path: currPath, type: LocationType.FLARUM_CORE };
|
|
156
189
|
}
|
|
157
|
-
currPath = (0,
|
|
190
|
+
currPath = (0, path_1.resolve)(currPath, '..');
|
|
158
191
|
}
|
|
159
|
-
this.error(`${(0,
|
|
192
|
+
this.error(`${(0, path_1.resolve)(currDir)} is not located in a valid Flarum package!
|
|
160
193
|
- Flarum extensions must contain (at a minimum) 'extend.php' and 'composer.json' files.
|
|
161
194
|
- Flarum core must contain a 'composer.json' file with the name 'flarum/core'.
|
|
162
195
|
- Flarum monorepos must have a valid 'flarum-monorepo.json' file`);
|
|
163
196
|
}
|
|
164
197
|
async confirmExtDir(extRoot) {
|
|
198
|
+
if (this.confirmed)
|
|
199
|
+
return;
|
|
165
200
|
const verify = await this.genIO().getParam({
|
|
166
201
|
name: 'verify',
|
|
167
202
|
type: 'confirm',
|
|
168
|
-
message: `Work in Flarum package located at ${(0,
|
|
203
|
+
message: `Work in Flarum package located at ${(0, path_1.resolve)(extRoot)}?`,
|
|
169
204
|
initial: true,
|
|
170
205
|
});
|
|
171
206
|
if (!verify)
|
|
172
207
|
this.exit();
|
|
208
|
+
this.confirmed = true;
|
|
173
209
|
}
|
|
174
210
|
async ensureComposerInstallRan(extRoot) {
|
|
175
|
-
if ((0,
|
|
211
|
+
if ((0, fs_1.existsSync)((0, path_1.resolve)(extRoot, 'vendor/flarum/core/composer.json')))
|
|
176
212
|
return;
|
|
177
213
|
this.log("This command requires `composer install` to have been ran in your extension's root directory.");
|
|
178
214
|
const composer = await this.genIO().getParam({
|
|
@@ -183,13 +219,26 @@ class BaseCommand extends core_1.Command {
|
|
|
183
219
|
});
|
|
184
220
|
if (composer) {
|
|
185
221
|
cli_ux_1.default.action.start('Installing composer packages');
|
|
186
|
-
(0,
|
|
222
|
+
(0, child_process_1.execSync)('composer install', { cwd: extRoot });
|
|
187
223
|
cli_ux_1.default.action.stop();
|
|
188
224
|
}
|
|
189
225
|
else {
|
|
190
226
|
this.error("Run `composer install` in your extension's root directory, then try again.");
|
|
191
227
|
}
|
|
192
228
|
}
|
|
229
|
+
async continueWhenReady(io) {
|
|
230
|
+
const continueUpgrade = await io.getParam({
|
|
231
|
+
name: 'continue',
|
|
232
|
+
type: 'confirm',
|
|
233
|
+
message: 'Ready to continue?',
|
|
234
|
+
initial: true,
|
|
235
|
+
});
|
|
236
|
+
if (!continueUpgrade) {
|
|
237
|
+
this.log('');
|
|
238
|
+
this.log('Aborted.');
|
|
239
|
+
this.exit();
|
|
240
|
+
}
|
|
241
|
+
}
|
|
193
242
|
/**
|
|
194
243
|
* If false, files do not exist so no need to override.
|
|
195
244
|
* If true, files should be overriden.
|
|
@@ -197,7 +246,7 @@ class BaseCommand extends core_1.Command {
|
|
|
197
246
|
*/
|
|
198
247
|
async confirmOverrideFiles(dir, pattern, confirmationMessage) {
|
|
199
248
|
const paths = Array.isArray(pattern) ? pattern : [pattern];
|
|
200
|
-
const files = await (0, globby_1.default)(paths.map(p => (0,
|
|
249
|
+
const files = await (0, globby_1.default)(paths.map((p) => (0, path_1.resolve)(dir, p)));
|
|
201
250
|
const empty = files.length === 0 || (files.length === 1 && files[0] === '.git');
|
|
202
251
|
if (empty)
|
|
203
252
|
return false;
|
|
@@ -212,13 +261,17 @@ class BaseCommand extends core_1.Command {
|
|
|
212
261
|
return true;
|
|
213
262
|
}
|
|
214
263
|
async deleteFiles(dir, pattern) {
|
|
215
|
-
const pathsToDelete = await (0, globby_1.default)((0,
|
|
216
|
-
pathsToDelete.forEach(
|
|
264
|
+
const pathsToDelete = await (0, globby_1.default)((0, path_1.resolve)(dir, pattern));
|
|
265
|
+
pathsToDelete.forEach(fs_1.unlinkSync);
|
|
217
266
|
}
|
|
218
267
|
}
|
|
219
268
|
exports.default = BaseCommand;
|
|
220
269
|
BaseCommand.flags = {
|
|
221
|
-
'no-interaction': core_1.Flags.boolean({
|
|
270
|
+
'no-interaction': core_1.Flags.boolean({
|
|
271
|
+
char: 'n',
|
|
272
|
+
description: 'Do not ask any interactive questions, assume defaults. When impossible, error.',
|
|
273
|
+
default: false,
|
|
274
|
+
}),
|
|
222
275
|
help: core_1.Flags.help({ char: 'h' }),
|
|
223
276
|
};
|
|
224
277
|
BaseCommand.args = [
|
|
@@ -227,3 +280,8 @@ BaseCommand.args = [
|
|
|
227
280
|
description: 'Where should this command be executed?',
|
|
228
281
|
},
|
|
229
282
|
];
|
|
283
|
+
BaseCommand.classNameArg = {
|
|
284
|
+
name: 'className',
|
|
285
|
+
description: 'The name of the class to generate',
|
|
286
|
+
required: false,
|
|
287
|
+
};
|
package/lib/boilersmith/io.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import { PromptObject } from 'prompts';
|
|
2
|
-
|
|
1
|
+
import { PromptObject, PromptType } from 'prompts';
|
|
2
|
+
type BooleanPromptType = PromptType & ('confirm' | 'toggle');
|
|
3
|
+
type StringPromptType = PromptType & ('text' | 'password' | 'invisible' | 'autocomplete');
|
|
4
|
+
type DatePromptType = PromptType & 'date';
|
|
5
|
+
type ListPromptType = PromptType & 'list';
|
|
6
|
+
export type ParamDef<N extends string = string> = Omit<PromptObject<N>, 'name'> & {
|
|
3
7
|
name: N;
|
|
8
|
+
message: string;
|
|
4
9
|
};
|
|
5
|
-
export
|
|
10
|
+
export type Message = {
|
|
6
11
|
type: 'info' | 'warning' | 'error';
|
|
7
12
|
message: string;
|
|
8
13
|
};
|
|
@@ -11,7 +16,19 @@ export interface IO {
|
|
|
11
16
|
/**
|
|
12
17
|
* Prompt the user for some input data.
|
|
13
18
|
*/
|
|
14
|
-
getParam
|
|
19
|
+
getParam(param: ParamDef & {
|
|
20
|
+
type: BooleanPromptType;
|
|
21
|
+
}, noCache?: boolean): Promise<boolean>;
|
|
22
|
+
getParam(param: ParamDef & {
|
|
23
|
+
type: StringPromptType;
|
|
24
|
+
}, noCache?: boolean): Promise<string>;
|
|
25
|
+
getParam(param: ParamDef & {
|
|
26
|
+
type: DatePromptType;
|
|
27
|
+
}, noCache?: boolean): Promise<Date>;
|
|
28
|
+
getParam(param: ParamDef & {
|
|
29
|
+
type: ListPromptType;
|
|
30
|
+
}, noCache?: boolean): Promise<string[]>;
|
|
31
|
+
getParam<T>(param: ParamDef, noCache?: boolean): Promise<T>;
|
|
15
32
|
/**
|
|
16
33
|
* Check if some data has already been prompted for.
|
|
17
34
|
*/
|
|
@@ -28,22 +45,27 @@ export interface IO {
|
|
|
28
45
|
*/
|
|
29
46
|
getOutput(): Message[];
|
|
30
47
|
newInstance(cache: Record<string, unknown>, messages: Message[]): IO;
|
|
48
|
+
pushCache(params: Record<string, unknown>): void;
|
|
31
49
|
}
|
|
32
|
-
|
|
50
|
+
type OnCancel = () => void;
|
|
33
51
|
export declare class PromptsIO implements IO {
|
|
34
52
|
supportsAnsiColor: boolean;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
53
|
+
protected cache: Map<string, unknown>;
|
|
54
|
+
protected messages: Message[];
|
|
55
|
+
protected noInteraction: boolean;
|
|
56
|
+
protected onCancel?: OnCancel;
|
|
57
|
+
protected prev?: {
|
|
58
|
+
val: any;
|
|
59
|
+
prompt: ParamDef;
|
|
60
|
+
};
|
|
40
61
|
constructor(initial?: Record<string, unknown>, messages?: Message[], noInteraction?: boolean, onCancel?: OnCancel);
|
|
41
|
-
getParam<T>(paramDef: ParamDef): Promise<T>;
|
|
62
|
+
getParam<T>(paramDef: ParamDef, noCache?: boolean): Promise<T>;
|
|
42
63
|
hasCached(name: string): boolean;
|
|
43
64
|
/**
|
|
44
65
|
* @internal
|
|
45
66
|
*/
|
|
46
67
|
cached(): Record<string, unknown>;
|
|
68
|
+
pushCache(params: Record<string, unknown>): void;
|
|
47
69
|
info(message: string, immediate: boolean): void;
|
|
48
70
|
warning(message: string, immediate: boolean): void;
|
|
49
71
|
error(message: string, immediate: false): void;
|
package/lib/boilersmith/io.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PromptsIO = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const prompts_1 =
|
|
6
|
-
const chalk_1 =
|
|
5
|
+
const prompts_1 = tslib_1.__importDefault(require("prompts"));
|
|
6
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
7
|
class PromptsIO {
|
|
8
8
|
constructor(initial = {}, messages = [], noInteraction = false, onCancel = () => {
|
|
9
9
|
throw new Error('EEXIT: 0');
|
|
@@ -15,26 +15,34 @@ class PromptsIO {
|
|
|
15
15
|
this.noInteraction = noInteraction;
|
|
16
16
|
this.onCancel = onCancel;
|
|
17
17
|
}
|
|
18
|
-
async getParam(paramDef) {
|
|
18
|
+
async getParam(paramDef, noCache = false) {
|
|
19
19
|
var _a, _b, _c;
|
|
20
20
|
const paramName = paramDef.name;
|
|
21
21
|
if (this.cache.has(paramName)) {
|
|
22
22
|
return this.cache.get(paramName);
|
|
23
23
|
}
|
|
24
|
+
let initial = null;
|
|
25
|
+
if (paramDef.initial && paramDef.initial instanceof Function) {
|
|
26
|
+
initial = paramDef.initial((_a = this.prev) === null || _a === void 0 ? void 0 : _a.val, this.cache, (_b = this.prev) === null || _b === void 0 ? void 0 : _b.prompt);
|
|
27
|
+
}
|
|
28
|
+
else if (paramDef.type === 'confirm' || paramDef.type === 'toggle') {
|
|
29
|
+
initial = ((_c = paramDef.initial) !== null && _c !== void 0 ? _c : false);
|
|
30
|
+
}
|
|
31
|
+
else if ('initial' in paramDef) {
|
|
32
|
+
initial = paramDef.initial;
|
|
33
|
+
}
|
|
34
|
+
else if ('choices' in paramDef) {
|
|
35
|
+
initial = paramDef.choices.filter((c) => c.selected).map((c) => c.value);
|
|
36
|
+
}
|
|
37
|
+
else if (this.noInteraction) {
|
|
38
|
+
return this.error(`No-Interaction mode is on, but input is required for param "${paramName}".`, true);
|
|
39
|
+
}
|
|
40
|
+
if (initial) {
|
|
41
|
+
paramDef.initial = initial;
|
|
42
|
+
}
|
|
24
43
|
let resValue;
|
|
25
|
-
if (this.noInteraction) {
|
|
26
|
-
|
|
27
|
-
resValue = paramDef.initial((_a = this.prev) === null || _a === void 0 ? void 0 : _a.val, this.cache, (_b = this.prev) === null || _b === void 0 ? void 0 : _b.prompt);
|
|
28
|
-
}
|
|
29
|
-
else if (paramDef.type === 'confirm' || paramDef.type === 'toggle') {
|
|
30
|
-
resValue = ((_c = paramDef.initial) !== null && _c !== void 0 ? _c : false);
|
|
31
|
-
}
|
|
32
|
-
else if ('initial' in paramDef) {
|
|
33
|
-
resValue = paramDef.initial;
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
return this.error(`No-Interaction mode is on, but input is required for param "${paramName}".`, true);
|
|
37
|
-
}
|
|
44
|
+
if (initial !== null && this.noInteraction) {
|
|
45
|
+
resValue = initial;
|
|
38
46
|
}
|
|
39
47
|
else {
|
|
40
48
|
const res = (await (0, prompts_1.default)(paramDef, {
|
|
@@ -42,7 +50,9 @@ class PromptsIO {
|
|
|
42
50
|
}));
|
|
43
51
|
resValue = res[paramName];
|
|
44
52
|
}
|
|
45
|
-
|
|
53
|
+
if (!noCache) {
|
|
54
|
+
this.cache.set(paramName, resValue);
|
|
55
|
+
}
|
|
46
56
|
this.prev = {
|
|
47
57
|
val: resValue,
|
|
48
58
|
prompt: paramDef,
|
|
@@ -61,6 +71,11 @@ class PromptsIO {
|
|
|
61
71
|
return obj;
|
|
62
72
|
}, {});
|
|
63
73
|
}
|
|
74
|
+
pushCache(params) {
|
|
75
|
+
for (const [key, value] of Object.entries(params)) {
|
|
76
|
+
this.cache.set(key, value);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
64
79
|
info(message, immediate) {
|
|
65
80
|
if (immediate) {
|
|
66
81
|
console.log(message);
|
|
@@ -3,9 +3,9 @@ export interface Paths {
|
|
|
3
3
|
package(...path: string[]): string;
|
|
4
4
|
requestedDir(...path: string[]): string | null;
|
|
5
5
|
monorepo(...path: string[]): string | null;
|
|
6
|
-
onMonorepoSub(packagePath: string): Paths;
|
|
6
|
+
onMonorepoSub(packagePath: string, monorepoPath?: string): Paths;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
type InternalPaths = {
|
|
9
9
|
package: string;
|
|
10
10
|
monorepo?: string | null;
|
|
11
11
|
requestedDir?: string | null;
|
|
@@ -17,6 +17,6 @@ export declare class NodePaths implements Paths {
|
|
|
17
17
|
package(...path: string[]): string;
|
|
18
18
|
requestedDir(...path: string[]): string | null;
|
|
19
19
|
monorepo(...path: string[]): string | null;
|
|
20
|
-
onMonorepoSub(packagePath: string): NodePaths;
|
|
20
|
+
onMonorepoSub(packagePath: string, monorepoPath?: string): NodePaths;
|
|
21
21
|
}
|
|
22
22
|
export {};
|
package/lib/boilersmith/paths.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NodePaths = void 0;
|
|
4
|
-
const
|
|
4
|
+
const path_1 = require("path");
|
|
5
5
|
class NodePaths {
|
|
6
6
|
constructor(paths) {
|
|
7
7
|
this.paths = paths;
|
|
8
8
|
}
|
|
9
9
|
cwd(...path) {
|
|
10
|
-
return (0,
|
|
10
|
+
return (0, path_1.resolve)(process.cwd(), ...path);
|
|
11
11
|
}
|
|
12
12
|
package(...path) {
|
|
13
|
-
return (0,
|
|
13
|
+
return (0, path_1.resolve)(this.paths.package, ...path);
|
|
14
14
|
}
|
|
15
15
|
requestedDir(...path) {
|
|
16
16
|
if (!this.paths.requestedDir)
|
|
17
17
|
return null;
|
|
18
|
-
return (0,
|
|
18
|
+
return (0, path_1.resolve)(this.paths.requestedDir, ...path);
|
|
19
19
|
}
|
|
20
20
|
monorepo(...path) {
|
|
21
21
|
if (!this.paths.monorepo)
|
|
22
22
|
return null;
|
|
23
|
-
return (0,
|
|
23
|
+
return (0, path_1.resolve)(this.paths.monorepo, ...path);
|
|
24
24
|
}
|
|
25
|
-
onMonorepoSub(packagePath) {
|
|
26
|
-
return new NodePaths(Object.assign(Object.assign({}, this.paths), { monorepo: this.paths.package, package: packagePath }));
|
|
25
|
+
onMonorepoSub(packagePath, monorepoPath) {
|
|
26
|
+
return new NodePaths(Object.assign(Object.assign({}, this.paths), { monorepo: monorepoPath !== null && monorepoPath !== void 0 ? monorepoPath : this.paths.package, package: packagePath }));
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
exports.NodePaths = NodePaths;
|
|
@@ -7,8 +7,8 @@ const rename_keys_1 = require("../utils/rename-keys");
|
|
|
7
7
|
const module_1 = require("./module");
|
|
8
8
|
const template_param_1 = require("./template-param");
|
|
9
9
|
const cond_format_1 = require("boilersmith/utils/cond-format");
|
|
10
|
-
const chalk_1 =
|
|
11
|
-
const
|
|
10
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
11
|
+
const fs_1 = require("fs");
|
|
12
12
|
function auditStepFactory(dry, scaffoldDir, modules, templateParams, excludeScaffoldingFunc, moduleStatusCache) {
|
|
13
13
|
let modulesEnabled;
|
|
14
14
|
return {
|
|
@@ -17,28 +17,28 @@ function auditStepFactory(dry, scaffoldDir, modules, templateParams, excludeScaf
|
|
|
17
17
|
async run(_fs, paths, io, _providers) {
|
|
18
18
|
const paramVals = await (0, template_param_1.currParamValues)(templateParams, _fs, paths, io);
|
|
19
19
|
modulesEnabled = await (0, module_1.currModulesEnabled)(modules, _fs, paths, moduleStatusCache);
|
|
20
|
-
const actionableModules = modules.filter(m => m.updatable && modulesEnabled[m.name] && (!m.togglable || !m.dependsOn.some(dep => !modulesEnabled[dep])));
|
|
21
|
-
io.info((0, cond_format_1.condFormat)(io.supportsAnsiColor, m => chalk_1.default.yellow(chalk_1.default.bold(chalk_1.default.underline(m))), `Auditing infrastructure for ${actionableModules.length} enabled modules:`), true);
|
|
20
|
+
const actionableModules = modules.filter((m) => m.updatable && modulesEnabled[m.name] && (!m.togglable || !m.dependsOn.some((dep) => !modulesEnabled[dep])));
|
|
21
|
+
io.info((0, cond_format_1.condFormat)(io.supportsAnsiColor, (m) => chalk_1.default.yellow(chalk_1.default.bold(chalk_1.default.underline(m))), `Auditing infrastructure for ${actionableModules.length} enabled modules:`), true);
|
|
22
22
|
for (const m of modules) {
|
|
23
23
|
if (actionableModules.includes(m)) {
|
|
24
|
-
io.info((0, cond_format_1.condFormat)(io.supportsAnsiColor, m => chalk_1.default.dim(chalk_1.default.green(m)), `✓ ${m.name}: ${m.shortDescription}`), true);
|
|
24
|
+
io.info((0, cond_format_1.condFormat)(io.supportsAnsiColor, (m) => chalk_1.default.dim(chalk_1.default.green(m)), `✓ ${m.name}: ${m.shortDescription}`), true);
|
|
25
25
|
}
|
|
26
26
|
else if (m.updatable) {
|
|
27
|
-
io.info((0, cond_format_1.condFormat)(io.supportsAnsiColor, m => chalk_1.default.dim(chalk_1.default.red(m)),
|
|
27
|
+
io.info((0, cond_format_1.condFormat)(io.supportsAnsiColor, (m) => chalk_1.default.dim(chalk_1.default.red(m)), `✕ ${m.name}: ${m.shortDescription} (disabled)`), true);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
for (const m of actionableModules) {
|
|
31
31
|
const fs = dry ? (0, mem_fs_1.create)() : _fs;
|
|
32
|
-
const excludeScaffolding = excludeScaffoldingFunc ? excludeScaffoldingFunc(fs, paths) : [];
|
|
32
|
+
const excludeScaffolding = excludeScaffoldingFunc ? excludeScaffoldingFunc(fs, paths) : { files: [], configKeys: {} };
|
|
33
33
|
(0, module_1.applyModule)(m, modulesEnabled, paramVals, scaffoldDir, fs, paths, excludeScaffolding, true);
|
|
34
34
|
if (dry) {
|
|
35
35
|
const filesWithChanges = fs
|
|
36
36
|
.all()
|
|
37
|
-
.filter(f => f.state && f.state !== 'deleted')
|
|
38
|
-
.filter(f => { var _a; return !(0,
|
|
37
|
+
.filter((f) => f.state && f.state !== 'deleted')
|
|
38
|
+
.filter((f) => { var _a; return !(0, fs_1.existsSync)(f.path) || (0, fs_1.readFileSync)(f.path, 'utf8').toString() !== ((_a = f.contents) === null || _a === void 0 ? void 0 : _a.toString()); });
|
|
39
39
|
if (filesWithChanges.length > 0) {
|
|
40
40
|
io.error(`Module ${m.name} has ${filesWithChanges.length} changed files: ${filesWithChanges
|
|
41
|
-
.map(f => f.path.replace(paths.package() + '/', ''))
|
|
41
|
+
.map((f) => f.path.replace(paths.package() + '/', ''))
|
|
42
42
|
.join(', ')}`, false);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -52,9 +52,9 @@ function auditStepFactory(dry, scaffoldDir, modules, templateParams, excludeScaf
|
|
|
52
52
|
}
|
|
53
53
|
return _fs;
|
|
54
54
|
},
|
|
55
|
-
exposes: modules.map(m => `modules.${m.name}`),
|
|
55
|
+
exposes: modules.map((m) => `modules.${m.name}`),
|
|
56
56
|
getExposed(_paths, _paramProvider) {
|
|
57
|
-
return (0, rename_keys_1.renameKeys)(modulesEnabled, k => `modules.${k}`);
|
|
57
|
+
return (0, rename_keys_1.renameKeys)(modulesEnabled, (k) => `modules.${k}`);
|
|
58
58
|
},
|
|
59
59
|
};
|
|
60
60
|
}
|
|
@@ -4,7 +4,7 @@ exports.infraStepFactory = void 0;
|
|
|
4
4
|
const module_1 = require("./module");
|
|
5
5
|
const template_param_1 = require("./template-param");
|
|
6
6
|
function infraStepFactory(scaffoldDir, moduleName, modules, templateParams, excludeScaffoldingFunc, moduleStatusCache) {
|
|
7
|
-
const module = modules.find(m => m.name === moduleName);
|
|
7
|
+
const module = modules.find((m) => m.name === moduleName);
|
|
8
8
|
if (!module) {
|
|
9
9
|
throw new Error(`Module ${moduleName} not found`);
|
|
10
10
|
}
|
|
@@ -17,7 +17,7 @@ function infraStepFactory(scaffoldDir, moduleName, modules, templateParams, excl
|
|
|
17
17
|
if (!module.updatable) {
|
|
18
18
|
io.error(`${module.name} is not updatable.`, true);
|
|
19
19
|
}
|
|
20
|
-
const excludeScaffolding = excludeScaffoldingFunc ? excludeScaffoldingFunc(fs, paths) : [];
|
|
20
|
+
const excludeScaffolding = excludeScaffoldingFunc ? excludeScaffoldingFunc(fs, paths) : { files: [], configKeys: {} };
|
|
21
21
|
const initializing = !modulesEnabled[module.name];
|
|
22
22
|
(0, module_1.applyModule)(module, Object.assign(Object.assign({}, modulesEnabled), { [module.name]: true }), paramVals, scaffoldDir, fs, paths, excludeScaffolding, initializing);
|
|
23
23
|
if (moduleStatusCache) {
|
|
@@ -12,22 +12,22 @@ function initStepFactory(scaffoldDir, modules, templateParams, excludeScaffoldin
|
|
|
12
12
|
async run(fs, paths, io, _providers) {
|
|
13
13
|
const paramVals = await (0, template_param_1.promptParamValues)(templateParams, paths, io);
|
|
14
14
|
modulesEnabled = await (0, module_1.promptModulesEnabled)(modules, io);
|
|
15
|
-
const excludeScaffolding = excludeScaffoldingFunc ? excludeScaffoldingFunc(fs, paths) : [];
|
|
15
|
+
const excludeScaffolding = excludeScaffoldingFunc ? excludeScaffoldingFunc(fs, paths) : { files: [], configKeys: {} };
|
|
16
16
|
for (const m of modules) {
|
|
17
|
-
if (modulesEnabled[m.name] && (!m.togglable || !m.dependsOn.some(dep => !modulesEnabled[dep]))) {
|
|
17
|
+
if (modulesEnabled[m.name] && (!m.togglable || !m.dependsOn.some((dep) => !modulesEnabled[dep]))) {
|
|
18
18
|
(0, module_1.applyModule)(m, modulesEnabled, paramVals, scaffoldDir, fs, paths, excludeScaffolding, true);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
if (moduleStatusCache) {
|
|
22
|
-
modules.forEach(m => {
|
|
22
|
+
modules.forEach((m) => {
|
|
23
23
|
(0, module_1.setModuleValue)(m, modulesEnabled[m.name], fs, paths, moduleStatusCache);
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
return fs;
|
|
27
27
|
},
|
|
28
|
-
exposes: modules.map(m => `modules.${m.name}`),
|
|
28
|
+
exposes: modules.map((m) => `modules.${m.name}`),
|
|
29
29
|
getExposed(_paths, _paramProvider) {
|
|
30
|
-
return (0, rename_keys_1.renameKeys)(modulesEnabled, k => `modules.${k}`);
|
|
30
|
+
return (0, rename_keys_1.renameKeys)(modulesEnabled, (k) => `modules.${k}`);
|
|
31
31
|
},
|
|
32
32
|
};
|
|
33
33
|
}
|