@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
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setNested = exports.LocaleStep = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const mem_fs_editor_1 = require("mem-fs-editor");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
const yaml_1 = tslib_1.__importDefault(require("yaml"));
|
|
8
|
+
class LocaleStep {
|
|
9
|
+
getExposed() {
|
|
10
|
+
return {};
|
|
11
|
+
}
|
|
12
|
+
constructor(scaffolder) {
|
|
13
|
+
this.type = 'Generate key-value locale pair';
|
|
14
|
+
this.composable = true;
|
|
15
|
+
this.exposes = [];
|
|
16
|
+
this.scaffolder = scaffolder;
|
|
17
|
+
}
|
|
18
|
+
async run(fs, paths, io, _providers) {
|
|
19
|
+
const fsEditor = (0, mem_fs_editor_1.create)(fs);
|
|
20
|
+
this.params = await this.compileParams(fs, paths, io);
|
|
21
|
+
let path;
|
|
22
|
+
if (fsEditor.exists(paths.package('resources/locale/en.yml'))) {
|
|
23
|
+
path = paths.package('resources/locale/en.yml');
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
path = paths.package('locale/en.yml');
|
|
27
|
+
// Ensure locale/en.yml exists
|
|
28
|
+
if (!fsEditor.exists(path)) {
|
|
29
|
+
const stubFilePath = (0, path_1.resolve)(__dirname, `../../../boilerplate/skeleton/extension/locale/en.yml`);
|
|
30
|
+
fsEditor.copyTpl(stubFilePath, path, { params: this.params });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const doc = yaml_1.default.parseDocument(fsEditor.read(path));
|
|
34
|
+
const key = this.params.key.split('.')[0] === this.params.extensionId ? this.params.key : `${this.params.extensionId}.${this.params.key}`;
|
|
35
|
+
const keys = key.split('.');
|
|
36
|
+
const keyPath = [];
|
|
37
|
+
try {
|
|
38
|
+
// eslint-disable-next-line guard-for-in
|
|
39
|
+
for (const i in keys) {
|
|
40
|
+
const k = keys[i];
|
|
41
|
+
if (doc.hasIn(keyPath) && doc.getIn(keyPath) !== null) {
|
|
42
|
+
keyPath.push(k);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
const remainingKeyPath = keys.slice(Number.parseInt(i, 10));
|
|
46
|
+
const remainingAsNestedObject = {};
|
|
47
|
+
setNested(remainingKeyPath.join('.'), this.params.value, remainingAsNestedObject);
|
|
48
|
+
doc.setIn(keyPath, remainingAsNestedObject);
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (keyPath.join('.') === key) {
|
|
53
|
+
doc.setIn(keyPath, this.params.value);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch (_a) {
|
|
57
|
+
// Do nothing
|
|
58
|
+
}
|
|
59
|
+
fsEditor.write(path, doc.toString({
|
|
60
|
+
lineWidth: 200,
|
|
61
|
+
}));
|
|
62
|
+
return fs;
|
|
63
|
+
}
|
|
64
|
+
async compileParams(fs, paths, io) {
|
|
65
|
+
const params = {};
|
|
66
|
+
params.extensionId = await this.scaffolder.templateParamVal('extensionId', fs, paths, io);
|
|
67
|
+
params.key = await io.getParam({
|
|
68
|
+
name: 'key',
|
|
69
|
+
type: 'text',
|
|
70
|
+
message: 'The nested key of the locale (e.g. `forum.custom_modal.title`).',
|
|
71
|
+
});
|
|
72
|
+
params.value = await io.getParam({
|
|
73
|
+
name: 'value',
|
|
74
|
+
type: 'text',
|
|
75
|
+
message: 'The value of the locale.',
|
|
76
|
+
});
|
|
77
|
+
return params;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.LocaleStep = LocaleStep;
|
|
81
|
+
/**
|
|
82
|
+
* nested key format, e.g: forum.custom_model.title
|
|
83
|
+
* obj: forum: { custom_modal: title: '' }
|
|
84
|
+
*/
|
|
85
|
+
function setNested(key, value, object) {
|
|
86
|
+
const keys = key.split('.');
|
|
87
|
+
let current = object;
|
|
88
|
+
for (let i = 0; i < keys.length - 1; i++) {
|
|
89
|
+
const k = keys[i];
|
|
90
|
+
if (!current[k]) {
|
|
91
|
+
current[k] = {};
|
|
92
|
+
}
|
|
93
|
+
current = current[k];
|
|
94
|
+
}
|
|
95
|
+
current[keys[keys.length - 1]] = value;
|
|
96
|
+
}
|
|
97
|
+
exports.setNested = setNested;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ComposerInstall = void 0;
|
|
4
|
-
const
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
5
|
class ComposerInstall {
|
|
6
6
|
constructor() {
|
|
7
7
|
this.type = 'Run composer install/update';
|
|
@@ -9,7 +9,7 @@ class ComposerInstall {
|
|
|
9
9
|
this.exposes = [];
|
|
10
10
|
}
|
|
11
11
|
async run(fs, paths, _paramProvider, _providers) {
|
|
12
|
-
(0,
|
|
12
|
+
(0, child_process_1.execSync)('composer update', { cwd: paths.package('') });
|
|
13
13
|
return fs;
|
|
14
14
|
}
|
|
15
15
|
getExposed() {
|
package/lib/steps/misc/git.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { DefaultProviders, Step } from 'boilersmith/step-manager';
|
|
|
5
5
|
export declare class GitInit implements Step {
|
|
6
6
|
type: string;
|
|
7
7
|
composable: boolean;
|
|
8
|
-
run(fs: Store,
|
|
8
|
+
run(fs: Store, paths: Paths, _paramProvider: IO, _providers: DefaultProviders): Promise<Store>;
|
|
9
9
|
exposes: never[];
|
|
10
10
|
getExposed(): Record<string, unknown>;
|
|
11
11
|
}
|
package/lib/steps/misc/git.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GitInit = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const simple_git_1 =
|
|
5
|
+
const simple_git_1 = tslib_1.__importDefault(require("simple-git"));
|
|
6
6
|
class GitInit {
|
|
7
7
|
constructor() {
|
|
8
8
|
this.type = 'Run git init';
|
|
9
9
|
this.composable = false;
|
|
10
10
|
this.exposes = [];
|
|
11
11
|
}
|
|
12
|
-
async run(fs,
|
|
13
|
-
(0, simple_git_1.default)().init();
|
|
12
|
+
async run(fs, paths, _paramProvider, _providers) {
|
|
13
|
+
(0, simple_git_1.default)(paths.package()).init();
|
|
14
14
|
return fs;
|
|
15
15
|
}
|
|
16
16
|
getExposed() {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Store } from 'mem-fs';
|
|
2
|
+
import { IO } from 'boilersmith/io';
|
|
3
|
+
import { Paths } from 'boilersmith/paths';
|
|
4
|
+
import { DefaultProviders, Step } from 'boilersmith/step-manager';
|
|
5
|
+
export declare class NpmInstall implements Step {
|
|
6
|
+
type: string;
|
|
7
|
+
composable: boolean;
|
|
8
|
+
run(fs: Store, paths: Paths, _paramProvider: IO, _providers: DefaultProviders): Promise<Store>;
|
|
9
|
+
exposes: never[];
|
|
10
|
+
getExposed(): Record<string, unknown>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NpmInstall = void 0;
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
class NpmInstall {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.type = 'Run npm install';
|
|
8
|
+
this.composable = false;
|
|
9
|
+
this.exposes = [];
|
|
10
|
+
}
|
|
11
|
+
async run(fs, paths, _paramProvider, _providers) {
|
|
12
|
+
(0, child_process_1.execSync)('npm install', { cwd: paths.package('js') });
|
|
13
|
+
return fs;
|
|
14
|
+
}
|
|
15
|
+
getExposed() {
|
|
16
|
+
return {};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.NpmInstall = NpmInstall;
|
package/lib/steps/misc/yarn.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.YarnInstall = void 0;
|
|
4
|
-
const
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
5
|
class YarnInstall {
|
|
6
6
|
constructor() {
|
|
7
7
|
this.type = 'Run yarn install';
|
|
@@ -9,7 +9,7 @@ class YarnInstall {
|
|
|
9
9
|
this.exposes = [];
|
|
10
10
|
}
|
|
11
11
|
async run(fs, paths, _paramProvider, _providers) {
|
|
12
|
-
(0,
|
|
12
|
+
(0, child_process_1.execSync)('yarn install', { cwd: paths.package('js') });
|
|
13
13
|
return fs;
|
|
14
14
|
}
|
|
15
15
|
getExposed() {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Store } from 'mem-fs';
|
|
2
|
+
import { IO } from 'boilersmith/io';
|
|
3
|
+
import { Paths } from 'boilersmith/paths';
|
|
4
|
+
import { Step } from 'boilersmith/step-manager';
|
|
5
|
+
import { FlarumProviders } from '../../providers';
|
|
6
|
+
import { Scaffolder } from 'boilersmith/scaffolding/scaffolder';
|
|
7
|
+
import { ExtensionModules, ExtensionParams } from '../gen-ext-scaffolder';
|
|
8
|
+
import { CommitResult } from 'simple-git';
|
|
9
|
+
export declare function commitAll(cwd: string, message: string | string[]): Promise<CommitResult>;
|
|
10
|
+
export declare class MonorepoCreate implements Step<FlarumProviders> {
|
|
11
|
+
type: string;
|
|
12
|
+
composable: boolean;
|
|
13
|
+
protected monorepoConfPath?: string;
|
|
14
|
+
protected scaffolder: Scaffolder<ExtensionParams, ExtensionModules>;
|
|
15
|
+
constructor(scaffolder: Scaffolder<ExtensionParams, ExtensionModules>, monorepoConfPath?: string);
|
|
16
|
+
run(fs: Store, paths: Paths, io: IO, providers: FlarumProviders): Promise<Store>;
|
|
17
|
+
exposes: never[];
|
|
18
|
+
getExposed(): Record<string, unknown>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MonorepoCreate = exports.commitAll = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
/* eslint-disable no-await-in-loop */
|
|
6
|
+
const child_process_1 = require("child_process");
|
|
7
|
+
const monorepo_1 = require("../../utils/monorepo");
|
|
8
|
+
const cond_format_1 = require("boilersmith/utils/cond-format");
|
|
9
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
10
|
+
const fs_1 = require("fs");
|
|
11
|
+
const path_1 = require("path");
|
|
12
|
+
const os_1 = require("os");
|
|
13
|
+
const simple_git_1 = tslib_1.__importDefault(require("simple-git"));
|
|
14
|
+
const mem_fs_editor_1 = require("mem-fs-editor");
|
|
15
|
+
const commit_async_1 = require("boilersmith/utils/commit-async");
|
|
16
|
+
const validation_1 = require("../../utils/validation");
|
|
17
|
+
async function addGitPackage(cwd, path, remote, mainBranch = 'main') {
|
|
18
|
+
const tmpDir = (0, fs_1.mkdtempSync)((0, path_1.resolve)((0, os_1.tmpdir)(), `${path.replace('/', '_')}-`));
|
|
19
|
+
(0, child_process_1.execSync)(`git clone ${remote} ${tmpDir} --verbose --branch ${mainBranch} --single-branch`, { cwd });
|
|
20
|
+
(0, child_process_1.execSync)(`git filter-repo --to-subdirectory-filter ${path}`, { cwd: tmpDir });
|
|
21
|
+
if (mainBranch) {
|
|
22
|
+
await (0, simple_git_1.default)(tmpDir).checkout(mainBranch);
|
|
23
|
+
}
|
|
24
|
+
await (0, simple_git_1.default)(tmpDir).branch(['REWRITE']);
|
|
25
|
+
await (0, simple_git_1.default)(tmpDir).checkout('REWRITE');
|
|
26
|
+
// Merge from remote
|
|
27
|
+
const remoteName = path.replace('/', '_').replace('-', '_');
|
|
28
|
+
await (0, simple_git_1.default)(cwd).addRemote(remoteName, tmpDir);
|
|
29
|
+
(0, child_process_1.execSync)(`git fetch ${remoteName}`, { cwd });
|
|
30
|
+
(0, child_process_1.execSync)(`git merge ${remoteName}/REWRITE --allow-unrelated-histories --no-edit`, { cwd });
|
|
31
|
+
await (0, simple_git_1.default)(cwd).removeRemote(remoteName);
|
|
32
|
+
(0, fs_1.rmSync)(tmpDir, { recursive: true, force: true });
|
|
33
|
+
}
|
|
34
|
+
function makeRunCommitStep(cwd, fs, io, paths, providers) {
|
|
35
|
+
return async function (packagePaths, step, message) {
|
|
36
|
+
for (const path of packagePaths) {
|
|
37
|
+
await step.run(fs, paths.onMonorepoSub((0, path_1.resolve)(cwd, path), cwd), io, providers);
|
|
38
|
+
}
|
|
39
|
+
await (0, commit_async_1.commitAsync)(fs);
|
|
40
|
+
await commitAll(cwd, message);
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
async function getMonorepoConf(io, monorepoConfPath) {
|
|
44
|
+
var _a;
|
|
45
|
+
if (monorepoConfPath) {
|
|
46
|
+
return JSON.parse((0, fs_1.readFileSync)(monorepoConfPath, 'utf8'));
|
|
47
|
+
}
|
|
48
|
+
const packages = { extensions: [], composer: [], npm: [] };
|
|
49
|
+
// eslint-disable-next-line no-constant-condition
|
|
50
|
+
while (true) {
|
|
51
|
+
const confirm = await io.getParam({
|
|
52
|
+
name: 'confirm',
|
|
53
|
+
type: 'confirm',
|
|
54
|
+
initial: true,
|
|
55
|
+
message: 'Add another package to monorepo?',
|
|
56
|
+
}, true);
|
|
57
|
+
if (!confirm)
|
|
58
|
+
break;
|
|
59
|
+
const packageType = (await io.getParam({
|
|
60
|
+
name: 'packageType',
|
|
61
|
+
message: 'Package Type',
|
|
62
|
+
type: 'select',
|
|
63
|
+
choices: [
|
|
64
|
+
{ title: 'Flarum Extension', value: 'extensions' },
|
|
65
|
+
{ title: 'Composer PHP Package', value: 'composer' },
|
|
66
|
+
{ title: 'NPM JS/TS Package', value: 'npm' },
|
|
67
|
+
{ title: 'Flarum Core', value: 'core' },
|
|
68
|
+
],
|
|
69
|
+
validate: (value) => value !== 'core' || !packages.core || 'A core package has already been specified.',
|
|
70
|
+
}, true));
|
|
71
|
+
const packageName = await io.getParam({
|
|
72
|
+
name: 'name',
|
|
73
|
+
message: 'Package Name (used to generate subdirectory path)',
|
|
74
|
+
type: 'text',
|
|
75
|
+
validate: validation_1.Validator.fileName,
|
|
76
|
+
}, true);
|
|
77
|
+
const gitRemote = await io.getParam({
|
|
78
|
+
name: 'remote',
|
|
79
|
+
message: 'Git remote (e.g. git@github.com:flarum/core.git)',
|
|
80
|
+
type: 'text',
|
|
81
|
+
validate: validation_1.Validator.gitRepo,
|
|
82
|
+
}, true);
|
|
83
|
+
const packageInfo = {
|
|
84
|
+
name: packageName,
|
|
85
|
+
gitRemote,
|
|
86
|
+
};
|
|
87
|
+
if (packageType === 'core') {
|
|
88
|
+
packages.core = packageInfo;
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
const typePackages = (_a = packages[packageType]) !== null && _a !== void 0 ? _a : [];
|
|
92
|
+
typePackages.push(packageInfo);
|
|
93
|
+
packages[packageType] = typePackages;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return { packages };
|
|
97
|
+
}
|
|
98
|
+
async function commitAll(cwd, message) {
|
|
99
|
+
await (0, simple_git_1.default)(cwd).add('.');
|
|
100
|
+
return (0, simple_git_1.default)(cwd).commit(message);
|
|
101
|
+
}
|
|
102
|
+
exports.commitAll = commitAll;
|
|
103
|
+
class MonorepoCreate {
|
|
104
|
+
constructor(scaffolder, monorepoConfPath) {
|
|
105
|
+
this.type = 'Create a monorepo of Flarum extensions';
|
|
106
|
+
this.composable = false;
|
|
107
|
+
this.exposes = [];
|
|
108
|
+
this.scaffolder = scaffolder;
|
|
109
|
+
this.monorepoConfPath = monorepoConfPath;
|
|
110
|
+
}
|
|
111
|
+
async run(fs, paths, io, providers) {
|
|
112
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
113
|
+
const target = (_a = paths.requestedDir()) !== null && _a !== void 0 ? _a : paths.package('flarum_monorepo');
|
|
114
|
+
const confirmTarget = await io.getParam({
|
|
115
|
+
name: 'confirmTarget',
|
|
116
|
+
message: `Create monorepo in directory: "${(0, cond_format_1.condFormat)(io.supportsAnsiColor, chalk_1.default.dim, target)}" (will be overwritten)?`,
|
|
117
|
+
type: 'confirm',
|
|
118
|
+
initial: true,
|
|
119
|
+
});
|
|
120
|
+
if (!confirmTarget) {
|
|
121
|
+
io.error('Target not confirmed', true);
|
|
122
|
+
return fs;
|
|
123
|
+
}
|
|
124
|
+
const conf = await getMonorepoConf(io, this.monorepoConfPath ? paths.cwd(this.monorepoConfPath) : undefined);
|
|
125
|
+
const runCommitStep = makeRunCommitStep(target, fs, io, paths, providers);
|
|
126
|
+
(0, fs_1.rmSync)(target, { recursive: true, force: true });
|
|
127
|
+
(0, fs_1.mkdirSync)(target);
|
|
128
|
+
await (0, simple_git_1.default)(target).init();
|
|
129
|
+
for (const lib of (_b = conf.packages.npm) !== null && _b !== void 0 ? _b : []) {
|
|
130
|
+
await addGitPackage(target, (0, monorepo_1.npmPath)(lib.name), lib.gitRemote, lib.mainBranch);
|
|
131
|
+
}
|
|
132
|
+
for (const lib of (_c = conf.packages.composer) !== null && _c !== void 0 ? _c : []) {
|
|
133
|
+
await addGitPackage(target, (0, monorepo_1.composerPath)(lib.name), lib.gitRemote, lib.mainBranch);
|
|
134
|
+
}
|
|
135
|
+
for (const ext of (_d = conf.packages.extensions) !== null && _d !== void 0 ? _d : []) {
|
|
136
|
+
await addGitPackage(target, (0, monorepo_1.extensionPath)(ext.name), ext.gitRemote, ext.mainBranch);
|
|
137
|
+
}
|
|
138
|
+
const corePkg = conf.packages.core;
|
|
139
|
+
if (corePkg) {
|
|
140
|
+
await addGitPackage(target, (0, monorepo_1.corePath)(corePkg.name), corePkg.gitRemote, corePkg.mainBranch);
|
|
141
|
+
}
|
|
142
|
+
const npmPaths = (_f = (_e = conf.packages.npm) === null || _e === void 0 ? void 0 : _e.map((lib) => (0, monorepo_1.npmPath)(lib.name))) !== null && _f !== void 0 ? _f : [];
|
|
143
|
+
const composerPaths = (_h = (_g = conf.packages.composer) === null || _g === void 0 ? void 0 : _g.map((lib) => (0, monorepo_1.composerPath)(lib.name))) !== null && _h !== void 0 ? _h : [];
|
|
144
|
+
const flarumPaths = (_k = (_j = conf.packages.extensions) === null || _j === void 0 ? void 0 : _j.map((ext) => (0, monorepo_1.extensionPath)(ext.name))) !== null && _k !== void 0 ? _k : [];
|
|
145
|
+
if (corePkg) {
|
|
146
|
+
flarumPaths.push((0, monorepo_1.corePath)(corePkg.name));
|
|
147
|
+
}
|
|
148
|
+
flarumPaths.forEach((path) => {
|
|
149
|
+
(0, fs_1.rmSync)((0, path_1.resolve)(target, path, '.github'), { force: true, recursive: true });
|
|
150
|
+
});
|
|
151
|
+
[...npmPaths, ...composerPaths, ...flarumPaths].forEach((path) => {
|
|
152
|
+
(0, fs_1.rmSync)((0, path_1.resolve)(target, path, '.styleci.yml'), { force: true });
|
|
153
|
+
});
|
|
154
|
+
await commitAll(target, [
|
|
155
|
+
'chore: remove centralizable repo config',
|
|
156
|
+
'- Remove .github conf folder from Flarum packages',
|
|
157
|
+
'- Remove styleci config from all packages',
|
|
158
|
+
]);
|
|
159
|
+
(0, mem_fs_editor_1.create)(fs).writeJSON((0, path_1.resolve)(target, 'flarum-monorepo.json'), conf);
|
|
160
|
+
await (0, commit_async_1.commitAsync)(fs);
|
|
161
|
+
await commitAll(target, 'chore: add monorepo config file');
|
|
162
|
+
[...composerPaths, ...flarumPaths].forEach((path) => {
|
|
163
|
+
const cwd = (0, path_1.resolve)(target, path);
|
|
164
|
+
const relRepoPath = path.includes('/') ? '../../*/*' : './../*/*';
|
|
165
|
+
(0, child_process_1.execSync)(`composer config repositories.0 path "${relRepoPath}"`, { cwd });
|
|
166
|
+
(0, child_process_1.execSync)('composer config minimum-stability dev', { cwd });
|
|
167
|
+
(0, child_process_1.execSync)('composer config prefer-stable true', { cwd });
|
|
168
|
+
const composerJsonPath = (0, path_1.resolve)(cwd, 'composer.json');
|
|
169
|
+
const composerJson = (0, fs_1.readFileSync)(composerJsonPath);
|
|
170
|
+
(0, fs_1.writeFileSync)(composerJsonPath, composerJson.toString().replace('"dev-master": "1.x-dev"', '"dev-main": "1.x-dev"'));
|
|
171
|
+
});
|
|
172
|
+
[...composerPaths, ...flarumPaths].forEach((path) => {
|
|
173
|
+
const cwd = (0, path_1.resolve)(target, path);
|
|
174
|
+
(0, child_process_1.execSync)('composer install --dry-run --no-interaction --no-ansi --no-progress --no-scripts --no-autoloader', { cwd });
|
|
175
|
+
});
|
|
176
|
+
await commitAll(target, 'chore: set up composer path repos');
|
|
177
|
+
(0, mem_fs_editor_1.create)(fs).writeJSON((0, path_1.resolve)(target, 'flarum-monorepo.json'), conf);
|
|
178
|
+
await (0, commit_async_1.commitAsync)(fs);
|
|
179
|
+
await commitAll(target, 'chore: add monorepo config file');
|
|
180
|
+
await runCommitStep(flarumPaths, this.scaffolder.genAuditStep(false), 'chore: flarum-cli audit infra --fix');
|
|
181
|
+
return fs;
|
|
182
|
+
}
|
|
183
|
+
getExposed() {
|
|
184
|
+
return {};
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
exports.MonorepoCreate = MonorepoCreate;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IO } from 'boilersmith/io';
|
|
2
|
+
import { Paths } from 'boilersmith/paths';
|
|
3
|
+
import { Step } from 'boilersmith/step-manager';
|
|
4
|
+
import { Store } from 'mem-fs';
|
|
5
|
+
import { FlarumProviders } from '../../providers';
|
|
6
|
+
export declare class MonorepoSplit implements Step<FlarumProviders> {
|
|
7
|
+
type: string;
|
|
8
|
+
composable: boolean;
|
|
9
|
+
exposes: never[];
|
|
10
|
+
force?: boolean;
|
|
11
|
+
constructor(force: boolean);
|
|
12
|
+
run(fs: Store, paths: Paths, io: IO, _providers: FlarumProviders): Promise<Store>;
|
|
13
|
+
getExposed(): Record<string, unknown>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MonorepoSplit = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const child_process_1 = require("child_process");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
const simple_git_1 = tslib_1.__importDefault(require("simple-git"));
|
|
8
|
+
const monorepo_1 = require("../../utils/monorepo");
|
|
9
|
+
async function addRemote(cwd, name, remote) {
|
|
10
|
+
try {
|
|
11
|
+
await (0, simple_git_1.default)(cwd).addRemote(name, remote);
|
|
12
|
+
await (0, simple_git_1.default)(cwd).fetch(name);
|
|
13
|
+
}
|
|
14
|
+
catch (_a) {
|
|
15
|
+
// ignore, remote already exists.
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
async function splitAndPush(cwd, splitExecPath, splitPath, remoteName, remoteBranch, force = false) {
|
|
19
|
+
const currBranch = (0, child_process_1.execSync)('git rev-parse --abbrev-ref HEAD', { cwd }).toString().trim();
|
|
20
|
+
const sha1 = (0, child_process_1.execSync)(`${splitExecPath} --prefix=${splitPath}`, { cwd, stdio: ['pipe', 'pipe', 'ignore'] })
|
|
21
|
+
.toString()
|
|
22
|
+
.trim();
|
|
23
|
+
const branch = remoteBranch || 'main';
|
|
24
|
+
const pushArgs = `${remoteName} "${sha1}:refs/heads/${branch}"`;
|
|
25
|
+
if (force) {
|
|
26
|
+
(0, child_process_1.execSync)(`git push --force ${pushArgs}`, { cwd });
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
const tmpBranch = `${remoteName}-tmp`;
|
|
30
|
+
(0, child_process_1.execSync)(`git switch -c ${tmpBranch} ${sha1}`, { cwd });
|
|
31
|
+
(0, child_process_1.execSync)(`git pull ${remoteName} ${branch} --rebase`, { cwd });
|
|
32
|
+
(0, child_process_1.execSync)(`git push ${pushArgs}`, { cwd });
|
|
33
|
+
(0, child_process_1.execSync)(`git switch ${currBranch}`, { cwd });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
async function cleanupBranchAndRemote(cwd, name) {
|
|
37
|
+
await (0, simple_git_1.default)(cwd).removeRemote(name);
|
|
38
|
+
const tmpBranch = `${name}-tmp`;
|
|
39
|
+
(0, child_process_1.execSync)(`git branch -D ${tmpBranch}`, { cwd });
|
|
40
|
+
}
|
|
41
|
+
class MonorepoSplit {
|
|
42
|
+
constructor(force) {
|
|
43
|
+
this.type = 'Split monorepo changes to the respective cloned repos.';
|
|
44
|
+
this.composable = false;
|
|
45
|
+
this.exposes = [];
|
|
46
|
+
this.force = force;
|
|
47
|
+
}
|
|
48
|
+
async run(fs, paths, io, _providers) {
|
|
49
|
+
var _a, _b, _c, _d;
|
|
50
|
+
const platform = process.platform;
|
|
51
|
+
if (platform !== 'linux' && platform !== 'darwin') {
|
|
52
|
+
io.error(`Your platform, "${platform}", is not supported. Split can only be run on linux and mac`, true);
|
|
53
|
+
return fs;
|
|
54
|
+
}
|
|
55
|
+
if (this.force && !(await io.getParam({ type: 'confirm', name: 'confirm', initial: false, message: 'Are you sure you want to force split?' }))) {
|
|
56
|
+
io.error('Decided not to force push', true);
|
|
57
|
+
return fs;
|
|
58
|
+
}
|
|
59
|
+
const splitExec = (0, path_1.resolve)(__dirname, `../../../bin/splitsh-lite-${platform}`);
|
|
60
|
+
const target = (_a = paths.requestedDir()) !== null && _a !== void 0 ? _a : paths.package();
|
|
61
|
+
await (0, simple_git_1.default)(target).pull();
|
|
62
|
+
const conf = (0, monorepo_1.getMonorepoConf)(fs, paths);
|
|
63
|
+
const corePkg = conf.packages.core;
|
|
64
|
+
const clean = [];
|
|
65
|
+
try {
|
|
66
|
+
// Add Remotes
|
|
67
|
+
for (const lib of (_b = conf.packages.npm) !== null && _b !== void 0 ? _b : []) {
|
|
68
|
+
await addRemote(target, lib.name, lib.gitRemote);
|
|
69
|
+
await splitAndPush(target, splitExec, (0, monorepo_1.npmPath)(lib.name), lib.name, lib.mainBranch, this.force);
|
|
70
|
+
clean.push(lib.name);
|
|
71
|
+
}
|
|
72
|
+
for (const lib of (_c = conf.packages.composer) !== null && _c !== void 0 ? _c : []) {
|
|
73
|
+
await addRemote(target, lib.name, lib.gitRemote);
|
|
74
|
+
await splitAndPush(target, splitExec, (0, monorepo_1.composerPath)(lib.name), lib.name, lib.mainBranch, this.force);
|
|
75
|
+
clean.push(lib.name);
|
|
76
|
+
}
|
|
77
|
+
for (const ext of (_d = conf.packages.extensions) !== null && _d !== void 0 ? _d : []) {
|
|
78
|
+
await addRemote(target, ext.name, ext.gitRemote);
|
|
79
|
+
await splitAndPush(target, splitExec, (0, monorepo_1.extensionPath)(ext.name), ext.name, ext.mainBranch, this.force);
|
|
80
|
+
clean.push(ext.name);
|
|
81
|
+
}
|
|
82
|
+
if (corePkg) {
|
|
83
|
+
await addRemote(target, corePkg.name, corePkg.gitRemote);
|
|
84
|
+
await splitAndPush(target, splitExec, (0, monorepo_1.corePath)(corePkg.name), corePkg.name, corePkg.mainBranch, this.force);
|
|
85
|
+
clean.push(corePkg.name);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
finally {
|
|
89
|
+
for (const name of clean) {
|
|
90
|
+
await cleanupBranchAndRemote(target, name);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return fs;
|
|
94
|
+
}
|
|
95
|
+
getExposed() {
|
|
96
|
+
throw new Error('Method not implemented.');
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.MonorepoSplit = MonorepoSplit;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IO } from 'boilersmith/io';
|
|
2
|
+
import { Paths } from 'boilersmith/paths';
|
|
3
|
+
import { BasePhpStubStep } from '../php-base';
|
|
4
|
+
import { Store } from 'mem-fs';
|
|
5
|
+
import { StubGenerationSchema } from 'boilersmith/steps/stub-base';
|
|
6
|
+
export declare class GenerateAdvancedApiResourceStub extends BasePhpStubStep {
|
|
7
|
+
type: string;
|
|
8
|
+
protected additionalExposes: string[];
|
|
9
|
+
protected additionalImplicitParams: string[];
|
|
10
|
+
protected phpClassParams: string[];
|
|
11
|
+
protected schema: StubGenerationSchema;
|
|
12
|
+
protected compileParams(fs: Store, paths: Paths, io: IO): Promise<Record<string, unknown>>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GenerateAdvancedApiResourceStub = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
|
+
const validation_1 = require("../../../utils/validation");
|
|
7
|
+
const model_name_1 = require("../../../utils/model-name");
|
|
8
|
+
const php_base_1 = require("../php-base");
|
|
9
|
+
class GenerateAdvancedApiResourceStub extends php_base_1.BasePhpStubStep {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.type = 'Generate Api Resource Class';
|
|
13
|
+
this.additionalExposes = ['className', 'modelClass', 'modelClassName', 'modelType'];
|
|
14
|
+
this.additionalImplicitParams = ['modelType'];
|
|
15
|
+
this.phpClassParams = ['modelClass'];
|
|
16
|
+
this.schema = {
|
|
17
|
+
recommendedSubdir: 'Api/Resource',
|
|
18
|
+
sourceFile: 'backend/advanced-api-resource.php',
|
|
19
|
+
params: [
|
|
20
|
+
{
|
|
21
|
+
name: 'className',
|
|
22
|
+
type: 'text',
|
|
23
|
+
message: 'Resource class name',
|
|
24
|
+
validate: validation_1.Validator.className,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'classNamespace',
|
|
28
|
+
type: 'text',
|
|
29
|
+
message: 'Class Namespace',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'modelClass',
|
|
33
|
+
type: 'text',
|
|
34
|
+
message: `Model Class (${chalk_1.default.dim('Vendor\\Path\\Model')})`,
|
|
35
|
+
validate: validation_1.Validator.class,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'modelClassName',
|
|
39
|
+
type: 'text',
|
|
40
|
+
message: 'Model class name',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'modelType',
|
|
44
|
+
type: 'text',
|
|
45
|
+
message: 'Model type',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'endpoints',
|
|
49
|
+
type: 'multiselect',
|
|
50
|
+
message: 'Endpoints',
|
|
51
|
+
choices: [
|
|
52
|
+
{ title: 'index', value: 'index', selected: true },
|
|
53
|
+
{ title: 'show', value: 'show', selected: true },
|
|
54
|
+
{ title: 'create', value: 'create', selected: true },
|
|
55
|
+
{ title: 'update', value: 'update', selected: true },
|
|
56
|
+
{ title: 'delete', value: 'delete', selected: true },
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'relations',
|
|
61
|
+
type: 'multiselect',
|
|
62
|
+
message: 'Relations',
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
async compileParams(fs, paths, io) {
|
|
68
|
+
const params = await super.compileParams(fs, paths, io);
|
|
69
|
+
const interfaceMap = {
|
|
70
|
+
list: 'Resource\\Contracts\\Listable',
|
|
71
|
+
show: 'Resource\\Contracts\\Findable',
|
|
72
|
+
create: 'Resource\\Contracts\\Creatable',
|
|
73
|
+
update: 'Resource\\Contracts\\Updatable',
|
|
74
|
+
delete: 'Resource\\Contracts\\Deletable',
|
|
75
|
+
};
|
|
76
|
+
params.modelType || (params.modelType = (0, model_name_1.pluralKebabCaseModel)(params.modelClassName));
|
|
77
|
+
params.interfaces = params.endpoints.map((endpoint) => interfaceMap[endpoint]);
|
|
78
|
+
return params;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.GenerateAdvancedApiResourceStub = GenerateAdvancedApiResourceStub;
|
|
@@ -3,7 +3,7 @@ import { Paths } from 'boilersmith/paths';
|
|
|
3
3
|
import { Validator } from '../../../utils/validation';
|
|
4
4
|
import { BasePhpStubStep } from '../php-base';
|
|
5
5
|
import { Store } from 'mem-fs';
|
|
6
|
-
export declare class
|
|
6
|
+
export declare class GenerateApiResourceStub extends BasePhpStubStep {
|
|
7
7
|
type: string;
|
|
8
8
|
protected additionalExposes: string[];
|
|
9
9
|
protected additionalImplicitParams: string[];
|
|
@@ -19,7 +19,7 @@ export declare class GenerateApiSerializerStub extends BasePhpStubStep {
|
|
|
19
19
|
} | {
|
|
20
20
|
name: string;
|
|
21
21
|
type: string;
|
|
22
|
-
message
|
|
22
|
+
message: string;
|
|
23
23
|
validate?: undefined;
|
|
24
24
|
})[];
|
|
25
25
|
};
|