Giter VIP home page Giter VIP logo

cli's Introduction

Total Downloads Latest Stable Version License

About Flarum

Flarum is a delightfully simple discussion platform for your website. It's fast and easy to use, with all the features you need to run a successful community. It is designed to be:

  • Fast and simple. No clutter, no bloat, no complex dependencies. Flarum is built with PHP so it’s quick and easy to deploy. The interface is powered by Mithril, a performant JavaScript framework with a tiny footprint.

  • Beautiful and responsive. This is forum software for humans. Flarum is carefully designed to be consistent and intuitive across platforms, out-of-the-box.

  • Powerful and extensible. Customize, extend, and integrate Flarum to suit your community. Flarum’s architecture is amazingly flexible, with a powerful Extension API.

screenshot

Installation

Read the Installation guide to get started. For support, refer to the documentation, and ask questions on the community forum or Discord chat.

Contributing

Thank you for considering contributing to Flarum! Please read the Contributing guide to learn how you can help.

This repository only holds the Flarum skeleton application. Most development happens in flarum/core.

Security Vulnerabilities

If you discover a security vulnerability within Flarum, please follow our security policy so we can address it promptly.

License

Flarum is open-source software licensed under the MIT License.

cli's People

Contributors

askvortsov1 avatar datlechin avatar davwheat avatar matteocontrini avatar ralkage avatar rob006 avatar soobinrho avatar sycho9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cli's Issues

fl make failed

php7.4
flarum-li last version

`
root@4a29d7657b5b:/data/www/packages/test# flarum-cli make backend model
✔ Work in Flarum package located at /data/www/packages/test? … yes
✔ Model class name … Test
✔ Table name (Optional) … test
✔ Generate corresponding Migration? … yes
✔ Generate corresponding API Serializer? … yes
✔ Generate corresponding Validator? … yes
✔ Generate corresponding Repository? … yes
✔ Generate corresponding Policy? … yes

Error occurred, and could not complete:
Command failed: php /usr/local/lib/node_modules/@flarum/cli/php-subsystem/index.php
Error: Command failed: php /usr/local/lib/node_modules/@flarum/cli/php-subsystem/index.php
at StepManager.run (/usr/local/lib/node_modules/@flarum/cli/lib/boilersmith/step-manager.js:84:31)
at async Model.run (/usr/local/lib/node_modules/@flarum/cli/lib/base-command.js:57:21)
at async Model._run (/usr/local/lib/node_modules/@flarum/cli/node_modules/@oclif/core/lib/command.js:74:22)
at async Config.runCommand (/usr/local/lib/node_modules/@flarum/cli/node_modules/@oclif/core/lib/config/config.js:268:25)
at async Object.run (/usr/local/lib/node_modules/@flarum/cli/node_modules/@oclif/core/lib/main.js:78:5)
`

I have some questions

I apologize if they might seem foolish. I'm just a beginner who is learning.
`flarum-cli init ksluntan.top

 _-----_     ╭──────────────────────────╮
|       |    │    Welcome to a Flarum   │
|--(o)--|    │    extension generator   │

---------´ │ │ ( _´U_ ) │ - Flarum Team │
/A\ /╰──────────────────────────╯
| ~ |
'..'_
´ |° ´ Y

✔ Directory not empty. Overwrite? … yes
✔ Run git init? (recommended) … yes
✔ Package (vendor/extension-name) … vendor/Myobject
✔ Package description … something should be used for a anime doujin forum
✔ Package namespace (Vendor\ExtensionName) … Vendor\useing
✔ Author name … Dooooove
✔ Author email … [email protected]
✔ Extension name … Dooooove
✔ License › MIT
✔ Main git branch (JS will automatically build when changes are pushed to GitHub on this branch) … flarum
✔ JS Package Manager › Yarn
✔ Advanced Initialization (fine-tune which features are enabled) … yes
✔ Admin Frontend … yes
✔ Forum Frontend … yes
✔ Javascript (Files, tools, and scripts to build Flarum's frontend.) … yes
✔ JS common code (Shared code between the forum and the admin frontends) … yes
✔ CSS (LESS starter files for Flarum's frontend styling.) … yes
✔ Locale (Translation starter files.) … yes
✔ Git Configuration (Git config files (e.g. .gitignore, .gitattributes).) … yes
✔ GitHub Actions CI (Automatically run checks via GitHub Actions CI. Free for open source projects.) … yes
✔ Auto-format frontend code with Prettier. … yes
✔ Support TypeScript in frontend code. … yes
✔ Enable Bundlewatch Checks … yes
✔ Backend PHP unit and integration testing via PHPUnit. … yes
✔ EditorConfig setup … yes
✔ StyleCI config file … yes
✔ Run composer install? (recommended) … yes
Composer plugins have been disabled for safety in this non-interactive session. Set COMPOSER_ALLOW_SUPERUSER=1 if you want to allow plugins to run as root/super user.
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Updating dependencies
Lock file operations: 150 installs, 0 updates, 0 removals

  • Locking axy/backtrace (2.0.0)
  • Locking brick/math (0.11.0)
  • Locking carbonphp/carbon-doctrine-types (1.0.0)
  • Locking components/font-awesome (5.15.4)
  • Locking dflydev/dot-access-data (v3.0.2)
  • Locking dflydev/fig-cookies (v3.1.0)
  • Locking doctrine/cache (2.2.0)
  • Locking doctrine/dbal (2.13.9)
  • Locking doctrine/deprecations (1.1.2)
  • Locking doctrine/event-manager (1.2.0)
  • Locking doctrine/inflector (2.0.8)
  • Locking doctrine/instantiator (2.0.0)
  • Locking doctrine/lexer (1.2.3)
  • Locking dragonmantank/cron-expression (v3.3.3)
  • Locking egulias/email-validator (2.1.25)
  • Locking fig/http-message-util (1.1.5)
  • Locking filp/whoops (2.15.4)
  • Locking flarum/core (v1.8.3)
  • Locking flarum/testing (v1.8.0)
  • Locking franzl/whoops-middleware (2.0.0)
  • Locking guzzlehttp/guzzle (7.8.1)
  • Locking guzzlehttp/promises (2.0.2)
  • Locking guzzlehttp/psr7 (2.6.2)
  • Locking hamcrest/hamcrest-php (v2.0.1)
  • Locking illuminate/bus (v8.83.27)
  • Locking illuminate/cache (v8.83.27)
  • Locking illuminate/collections (v8.83.27)
  • Locking illuminate/config (v8.83.27)
  • Locking illuminate/console (v8.83.27)
  • Locking illuminate/container (v8.83.27)
  • Locking illuminate/contracts (v8.83.27)
  • Locking illuminate/database (v8.83.27)
  • Locking illuminate/events (v8.83.27)
  • Locking illuminate/filesystem (v8.83.27)
  • Locking illuminate/hashing (v8.83.27)
  • Locking illuminate/macroable (v8.83.27)
  • Locking illuminate/mail (v8.83.27)
  • Locking illuminate/pipeline (v8.83.27)
  • Locking illuminate/queue (v8.83.27)
  • Locking illuminate/session (v8.83.27)
  • Locking illuminate/support (v8.83.27)
  • Locking illuminate/translation (v8.83.27)
  • Locking illuminate/validation (v8.83.27)
  • Locking illuminate/view (v8.83.27)
  • Locking intervention/image (2.7.2)
  • Locking jaybizzle/crawler-detect (v1.2.116)
  • Locking jenssegers/agent (v2.6.4)
  • Locking laminas/laminas-diactoros (2.26.0)
  • Locking laminas/laminas-escaper (2.13.0)
  • Locking laminas/laminas-httphandlerrunner (2.9.0)
  • Locking laminas/laminas-stratigility (3.11.0)
  • Locking laravel/serializable-closure (v1.3.3)
  • Locking league/commonmark (2.4.1)
  • Locking league/config (v1.2.0)
  • Locking league/flysystem (1.1.10)
  • Locking league/mime-type-detection (1.14.0)
  • Locking matthiasmullie/minify (1.3.71)
  • Locking matthiasmullie/path-converter (1.1.3)
  • Locking middlewares/base-path (v2.1.0)
  • Locking middlewares/base-path-router (v2.0.1)
  • Locking middlewares/request-handler (v2.0.2)
  • Locking middlewares/utils (v3.3.0)
  • Locking mobiledetect/mobiledetectlib (2.8.45)
  • Locking mockery/mockery (1.6.7)
  • Locking monolog/monolog (1.27.1)
  • Locking myclabs/deep-copy (1.11.1)
  • Locking nesbot/carbon (2.72.1)
  • Locking nette/schema (v1.2.5)
  • Locking nette/utils (v4.0.3)
  • Locking nikic/fast-route (v0.6.0)
  • Locking nikic/php-parser (v4.18.0)
  • Locking opis/closure (3.6.3)
  • Locking phar-io/manifest (2.0.3)
  • Locking phar-io/version (3.2.1)
  • Locking phpunit/php-code-coverage (9.2.29)
  • Locking phpunit/php-file-iterator (3.0.6)
  • Locking phpunit/php-invoker (3.1.1)
  • Locking phpunit/php-text-template (2.0.4)
  • Locking phpunit/php-timer (5.0.3)
  • Locking phpunit/phpunit (9.6.15)
  • Locking psr/clock (1.0.0)
  • Locking psr/container (1.1.2)
  • Locking psr/event-dispatcher (1.0.0)
  • Locking psr/http-client (1.0.3)
  • Locking psr/http-factory (1.0.2)
  • Locking psr/http-message (1.1)
  • Locking psr/http-server-handler (1.0.2)
  • Locking psr/http-server-middleware (1.0.2)
  • Locking psr/log (1.1.4)
  • Locking psr/simple-cache (1.0.1)
  • Locking ralouphie/getallheaders (3.0.3)
  • Locking ramsey/collection (2.0.0)
  • Locking ramsey/uuid (4.7.5)
  • Locking s9e/regexp-builder (1.4.6)
  • Locking s9e/sweetdom (3.2.0)
  • Locking s9e/text-formatter (2.15.0)
  • Locking sebastian/cli-parser (1.0.1)
  • Locking sebastian/code-unit (1.0.8)
  • Locking sebastian/code-unit-reverse-lookup (2.0.3)
  • Locking sebastian/comparator (4.0.8)
  • Locking sebastian/complexity (2.0.2)
  • Locking sebastian/diff (4.0.5)
  • Locking sebastian/environment (5.1.5)
  • Locking sebastian/exporter (4.0.5)
  • Locking sebastian/global-state (5.0.6)
  • Locking sebastian/lines-of-code (1.0.3)
  • Locking sebastian/object-enumerator (4.0.4)
  • Locking sebastian/object-reflector (2.0.4)
  • Locking sebastian/recursion-context (4.0.5)
  • Locking sebastian/resource-operations (3.0.3)
  • Locking sebastian/type (3.2.1)
  • Locking sebastian/version (3.0.2)
  • Locking staudenmeir/eloquent-eager-limit (v1.6.1)
  • Locking swiftmailer/swiftmailer (v6.3.0)
  • Locking sycho/codecs-base64vlq (2.0.0)
  • Locking sycho/errors (3.0.0)
  • Locking sycho/json-api (v0.5.2)
  • Locking sycho/sourcemap (2.0.0)
  • Locking symfony/config (v5.4.31)
  • Locking symfony/console (v5.4.32)
  • Locking symfony/css-selector (v6.4.0)
  • Locking symfony/deprecation-contracts (v3.4.0)
  • Locking symfony/event-dispatcher (v5.4.26)
  • Locking symfony/event-dispatcher-contracts (v3.4.0)
  • Locking symfony/filesystem (v6.4.0)
  • Locking symfony/finder (v5.4.27)
  • Locking symfony/http-foundation (v5.4.32)
  • Locking symfony/mime (v5.4.26)
  • Locking symfony/polyfill-ctype (v1.28.0)
  • Locking symfony/polyfill-iconv (v1.28.0)
  • Locking symfony/polyfill-intl-grapheme (v1.28.0)
  • Locking symfony/polyfill-intl-idn (v1.28.0)
  • Locking symfony/polyfill-intl-messageformatter (v1.28.0)
  • Locking symfony/polyfill-intl-normalizer (v1.28.0)
  • Locking symfony/polyfill-mbstring (v1.28.0)
  • Locking symfony/polyfill-php72 (v1.28.0)
  • Locking symfony/polyfill-php73 (v1.28.0)
  • Locking symfony/polyfill-php80 (v1.28.0)
  • Locking symfony/polyfill-php81 (v1.28.0)
  • Locking symfony/process (v5.4.28)
  • Locking symfony/service-contracts (v2.5.2)
  • Locking symfony/string (v6.4.0)
  • Locking symfony/translation (v5.4.31)
  • Locking symfony/translation-contracts (v2.5.2)
  • Locking symfony/yaml (v5.4.31)
  • Locking theseer/tokenizer (1.2.2)
  • Locking tijsverkoyen/css-to-inline-styles (v2.2.7)
  • Locking voku/portable-ascii (1.6.1)
  • Locking webmozart/assert (1.11.0)
  • Locking wikimedia/less.php (v3.2.1)
    Writing lock file
    Installing dependencies from lock file (including require-dev)
    Package operations: 150 installs, 0 updates, 0 removals
  • Downloading symfony/yaml (v5.4.31)
  • Downloading symfony/translation (v5.4.31)
  • Downloading symfony/string (v6.4.0)
  • Downloading symfony/console (v5.4.32)
  • Downloading symfony/filesystem (v6.4.0)
  • Downloading symfony/config (v5.4.31)
  • Downloading carbonphp/carbon-doctrine-types (1.0.0)
  • Downloading nesbot/carbon (2.72.1)
  • Downloading s9e/sweetdom (3.2.0)
  • Downloading s9e/text-formatter (2.15.0)
  • Downloading laminas/laminas-stratigility (3.11.0)
  • Downloading guzzlehttp/psr7 (2.6.2)
  • Downloading laminas/laminas-diactoros (2.26.0)
  • Downloading mobiledetect/mobiledetectlib (2.8.45)
  • Downloading symfony/http-foundation (v5.4.32)
  • Downloading ramsey/uuid (4.7.5)
  • Downloading laravel/serializable-closure (v1.3.3)
  • Downloading symfony/css-selector (v6.4.0)
  • Downloading tijsverkoyen/css-to-inline-styles (v2.2.7)
  • Downloading nette/utils (v4.0.3)
  • Downloading guzzlehttp/promises (2.0.2)
  • Downloading guzzlehttp/guzzle (7.8.1)
  • Downloading filp/whoops (2.15.4)
  • Downloading theseer/tokenizer (1.2.2)
  • Downloading nikic/php-parser (v4.18.0)
  • Downloading phpunit/phpunit (9.6.15)
  • Downloading mockery/mockery (1.6.7)
    0/27 [>---------------------------] 0%
    3/27 [===>------------------------] 11%
    7/27 [=======>--------------------] 25%
    11/27 [===========>----------------] 40%
    15/27 [===============>------------] 55%
    17/27 [=================>----------] 62%
    22/27 [======================>-----] 81%
    26/27 [==========================>-] 96%
    27/27 [============================] 100%
  • Installing axy/backtrace (2.0.0): Extracting archive
  • Installing doctrine/cache (2.2.0): Extracting archive
  • Installing doctrine/deprecations (1.1.2): Extracting archive
  • Installing doctrine/event-manager (1.2.0): Extracting archive
  • Installing doctrine/inflector (2.0.8): Extracting archive
  • Installing doctrine/lexer (1.2.3): Extracting archive
  • Installing wikimedia/less.php (v3.2.1): Extracting archive
  • Installing symfony/polyfill-ctype (v1.28.0): Extracting archive
  • Installing symfony/deprecation-contracts (v3.4.0): Extracting archive
  • Installing symfony/yaml (v5.4.31): Extracting archive
  • Installing symfony/translation-contracts (v2.5.2): Extracting archive
  • Installing symfony/polyfill-php80 (v1.28.0): Extracting archive
  • Installing symfony/polyfill-mbstring (v1.28.0): Extracting archive
  • Installing symfony/translation (v5.4.31): Extracting archive
  • Installing symfony/polyfill-intl-messageformatter (v1.28.0): Extracting archive
  • Installing symfony/polyfill-php72 (v1.28.0): Extracting archive
  • Installing symfony/polyfill-intl-normalizer (v1.28.0): Extracting archive
  • Installing symfony/polyfill-intl-idn (v1.28.0): Extracting archive
  • Installing symfony/mime (v5.4.26): Extracting archive
  • Installing psr/event-dispatcher (1.0.0): Extracting archive
  • Installing symfony/event-dispatcher-contracts (v3.4.0): Extracting archive
  • Installing symfony/event-dispatcher (v5.4.26): Extracting archive
  • Installing symfony/polyfill-intl-grapheme (v1.28.0): Extracting archive
  • Installing symfony/string (v6.4.0): Extracting archive
  • Installing psr/container (1.1.2): Extracting archive
  • Installing symfony/service-contracts (v2.5.2): Extracting archive
  • Installing symfony/polyfill-php73 (v1.28.0): Extracting archive
  • Installing symfony/console (v5.4.32): Extracting archive
  • Installing symfony/polyfill-php81 (v1.28.0): Extracting archive
  • Installing symfony/filesystem (v6.4.0): Extracting archive
  • Installing symfony/config (v5.4.31): Extracting archive
  • Installing sycho/errors (3.0.0): Extracting archive
  • Installing sycho/codecs-base64vlq (2.0.0): Extracting archive
  • Installing sycho/sourcemap (2.0.0): Extracting archive
  • Installing sycho/json-api (v0.5.2): Extracting archive
  • Installing voku/portable-ascii (1.6.1): Extracting archive
  • Installing psr/clock (1.0.0): Extracting archive
  • Installing carbonphp/carbon-doctrine-types (1.0.0): Extracting archive
  • Installing nesbot/carbon (2.72.1): Extracting archive
  • Installing illuminate/macroable (v8.83.27): Extracting archive
  • Installing psr/simple-cache (1.0.1): Extracting archive
  • Installing illuminate/contracts (v8.83.27): Extracting archive
  • Installing illuminate/collections (v8.83.27): Extracting archive
  • Installing illuminate/support (v8.83.27): Extracting archive
  • Installing illuminate/container (v8.83.27): Extracting archive
  • Installing illuminate/database (v8.83.27): Extracting archive
  • Installing staudenmeir/eloquent-eager-limit (v1.6.1): Extracting archive
  • Installing s9e/sweetdom (3.2.0): Extracting archive
  • Installing s9e/regexp-builder (1.4.6): Extracting archive
  • Installing s9e/text-formatter (2.15.0): Extracting archive
  • Installing psr/http-message (1.1): Extracting archive
  • Installing psr/http-server-handler (1.0.2): Extracting archive
  • Installing psr/http-server-middleware (1.0.2): Extracting archive
  • Installing nikic/fast-route (v0.6.0): Extracting archive
  • Installing psr/log (1.1.4): Extracting archive
  • Installing monolog/monolog (1.27.1): Extracting archive
  • Installing psr/http-factory (1.0.2): Extracting archive
  • Installing middlewares/utils (v3.3.0): Extracting archive
  • Installing middlewares/request-handler (v2.0.2): Extracting archive
  • Installing middlewares/base-path-router (v2.0.1): Extracting archive
  • Installing middlewares/base-path (v2.1.0): Extracting archive
  • Installing matthiasmullie/path-converter (1.1.3): Extracting archive
  • Installing matthiasmullie/minify (1.3.71): Extracting archive
  • Installing league/mime-type-detection (1.14.0): Extracting archive
  • Installing league/flysystem (1.1.10): Extracting archive
  • Installing laminas/laminas-escaper (2.13.0): Extracting archive
  • Installing fig/http-message-util (1.1.5): Extracting archive
  • Installing laminas/laminas-stratigility (3.11.0): Extracting archive
  • Installing ralouphie/getallheaders (3.0.3): Extracting archive
  • Installing guzzlehttp/psr7 (2.6.2): Extracting archive
  • Installing laminas/laminas-diactoros (2.26.0): Extracting archive
  • Installing laminas/laminas-httphandlerrunner (2.9.0): Extracting archive
  • Installing mobiledetect/mobiledetectlib (2.8.45): Extracting archive
  • Installing jaybizzle/crawler-detect (v1.2.116): Extracting archive
  • Installing jenssegers/agent (v2.6.4): Extracting archive
  • Installing intervention/image (2.7.2): Extracting archive
  • Installing symfony/finder (v5.4.27): Extracting archive
  • Installing illuminate/filesystem (v8.83.27): Extracting archive
  • Installing illuminate/pipeline (v8.83.27): Extracting archive
  • Installing illuminate/bus (v8.83.27): Extracting archive
  • Installing illuminate/events (v8.83.27): Extracting archive
  • Installing illuminate/view (v8.83.27): Extracting archive
  • Installing symfony/http-foundation (v5.4.32): Extracting archive
  • Installing illuminate/translation (v8.83.27): Extracting archive
  • Installing egulias/email-validator (2.1.25): Extracting archive
  • Installing illuminate/validation (v8.83.27): Extracting archive
  • Installing illuminate/session (v8.83.27): Extracting archive
  • Installing symfony/process (v5.4.28): Extracting archive
  • Installing ramsey/collection (2.0.0): Extracting archive
  • Installing brick/math (0.11.0): Extracting archive
  • Installing ramsey/uuid (4.7.5): Extracting archive
  • Installing opis/closure (3.6.3): Extracting archive
  • Installing laravel/serializable-closure (v1.3.3): Extracting archive
  • Installing illuminate/console (v8.83.27): Extracting archive
  • Installing illuminate/queue (v8.83.27): Extracting archive
  • Installing symfony/css-selector (v6.4.0): Extracting archive
  • Installing tijsverkoyen/css-to-inline-styles (v2.2.7): Extracting archive
  • Installing symfony/polyfill-iconv (v1.28.0): Extracting archive
  • Installing swiftmailer/swiftmailer (v6.3.0): Extracting archive
  • Installing nette/utils (v4.0.3): Extracting archive
  • Installing nette/schema (v1.2.5): Extracting archive
  • Installing dflydev/dot-access-data (v3.0.2): Extracting archive
  • Installing league/config (v1.2.0): Extracting archive
  • Installing league/commonmark (2.4.1): Extracting archive
  • Installing illuminate/mail (v8.83.27): Extracting archive
  • Installing illuminate/hashing (v8.83.27): Extracting archive
  • Installing illuminate/config (v8.83.27): Extracting archive
  • Installing illuminate/cache (v8.83.27): Extracting archive
  • Installing psr/http-client (1.0.3): Extracting archive
  • Installing guzzlehttp/promises (2.0.2): Extracting archive
  • Installing guzzlehttp/guzzle (7.8.1): Extracting archive
  • Installing filp/whoops (2.15.4): Extracting archive
  • Installing franzl/whoops-middleware (2.0.0): Extracting archive
  • Installing webmozart/assert (1.11.0): Extracting archive
  • Installing dragonmantank/cron-expression (v3.3.3): Extracting archive
  • Installing doctrine/dbal (2.13.9): Extracting archive
  • Installing dflydev/fig-cookies (v3.1.0): Extracting archive
  • Installing components/font-awesome (5.15.4): Extracting archive
  • Installing flarum/core (v1.8.3): Extracting archive
  • Installing sebastian/version (3.0.2): Extracting archive
  • Installing sebastian/type (3.2.1): Extracting archive
  • Installing sebastian/resource-operations (3.0.3): Extracting archive
  • Installing sebastian/recursion-context (4.0.5): Extracting archive
  • Installing sebastian/object-reflector (2.0.4): Extracting archive
  • Installing sebastian/object-enumerator (4.0.4): Extracting archive
  • Installing sebastian/global-state (5.0.6): Extracting archive
  • Installing sebastian/exporter (4.0.5): Extracting archive
  • Installing sebastian/environment (5.1.5): Extracting archive
  • Installing sebastian/diff (4.0.5): Extracting archive
  • Installing sebastian/comparator (4.0.8): Extracting archive
  • Installing sebastian/code-unit (1.0.8): Extracting archive
  • Installing sebastian/cli-parser (1.0.1): Extracting archive
  • Installing phpunit/php-timer (5.0.3): Extracting archive
  • Installing phpunit/php-text-template (2.0.4): Extracting archive
  • Installing phpunit/php-invoker (3.1.1): Extracting archive
  • Installing phpunit/php-file-iterator (3.0.6): Extracting archive
  • Installing theseer/tokenizer (1.2.2): Extracting archive
  • Installing nikic/php-parser (v4.18.0): Extracting archive
  • Installing sebastian/lines-of-code (1.0.3): Extracting archive
  • Installing sebastian/complexity (2.0.2): Extracting archive
  • Installing sebastian/code-unit-reverse-lookup (2.0.3): Extracting archive
  • Installing phpunit/php-code-coverage (9.2.29): Extracting archive
  • Installing phar-io/version (3.2.1): Extracting archive
  • Installing phar-io/manifest (2.0.3): Extracting archive
  • Installing myclabs/deep-copy (1.11.1): Extracting archive
  • Installing doctrine/instantiator (2.0.0): Extracting archive
  • Installing phpunit/phpunit (9.6.15): Extracting archive
  • Installing hamcrest/hamcrest-php (v2.0.1): Extracting archive
  • Installing mockery/mockery (1.6.7): Extracting archive
  • Installing flarum/testing (v1.8.0): Extracting archive
    0/150 [>---------------------------] 0%
    20/150 [===>------------------------] 13%
    30/150 [=====>----------------------] 20%
    49/150 [=========>------------------] 32%
    60/150 [===========>----------------] 40%
    77/150 [==============>-------------] 51%
    97/150 [==================>---------] 64%
    107/150 [===================>--------] 71%
    125/150 [=======================>----] 83%
    135/150 [=========================>--] 90%
    150/150 [============================] 100%
    57 package suggestions were added by new dependencies, use composer suggest to see details.
    Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.
    Generating autoload files
    86 packages you are using are looking for funding.
    Use the composer fund command to find out more!
    No security vulnerability advisories found
    ✔ Run yarn? (recommended) … yes
    /bin/sh: yarn: command not found

Error occurred, and could not complete:
Command failed: yarn install
/bin/sh: yarn: command not found

Error: Command failed: yarn install
/bin/sh: yarn: command not found

at checkExecSyncError (child_process.js:760:11)
at execSync (child_process.js:833:15)
at YarnInstall.run (/usr/local/lib/node_modules/@flarum/cli/lib/steps/misc/yarn.js:12:38)
at StepManager.runStep (/usr/local/lib/node_modules/@flarum/cli/lib/boilersmith/step-manager.js:153:45)
at checkAndRun (/usr/local/lib/node_modules/@flarum/cli/lib/boilersmith/step-manager.js:73:35)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async StepManager.run (/usr/local/lib/node_modules/@flarum/cli/lib/boilersmith/step-manager.js:94:21)
at async Init.run (/usr/local/lib/node_modules/@flarum/cli/lib/base-command.js:57:21)
at async Init._run (/usr/local/lib/node_modules/@flarum/cli/node_modules/@oclif/core/lib/command.js:80:22)
at async Config.runCommand (/usr/local/lib/node_modules/@flarum/cli/node_modules/@oclif/core/lib/config/config.js:301:25)

Before the error, the following steps were completed:

  • Run git init
  • Generate package skeleton
  • Run composer install/update`

fl [COMMAND] doesn't respond on Powershell.

Problem:

I installed flarum-cli everything works fine when I run flarum-cli COMMAND but fl COMMAND doesn't do anything...

Image explaining the problem:

Environment:

  • Windows 11
  • PowerShell
  • Node v14.17.2
  • NPM v7.20.5
  • Flarum CLI v1.0.0

Notes: I'm not sure whether this is a bug or installation/configuration fault.

🔼 Extension 2.0 Upgrade

Brainstorm

Most of the changes will be simple pattern replacements, to do that we need to take into account some base behavior/abilities.

  • Before we read and change code, we need to format it to ensure no missed patterns due to unexpected formatting.
  • For every file we visit (JS or PHP) before we get to the petterns, we need to parse the imports and have solid logic (using lexers) to add/remove imports. Then we can read the pattern replacements and apply any import changes that come with based on what the replacement needs.
  • Detective steps (:p) where we look into code, gather information, delete code, regenerate new code based on gathered info in hopes that no info was lost (tricky, might drop this idea).

Dependencies ✅

  • composer.json.require.flarum/* ^2.0 (when not set to*)
  • composer.json.require-dev.flarum/* ^2.0 (when not set to*)

Infra ✅

  • flarum/framework/.github/workflows/REUSABLE_backend.yml@main or @1.x => @2.x
  • flarum/framework/.github/workflows/REUSABLE_frontend.yml@main or @1.x => @2.x
  • phpstan

Frontend

mithril 2.0 -> 2.2

can't find exact instances of this in the code, but the more common instance is a copy from core of:

before

return [  
  <li className="Dropdown-header">{app.translator.trans('core.forum.search.users_heading')}</li>,  
  ...results.map((user) => {  
    const name = username(user);  
  
    const children = [highlight(name.text as string, query)];  
  
    return (  
      <li className="UserSearchResult" data-index={'users' + user.id()}>  
        <Link href={app.route.user(user)}>  
          {avatar(user)}  
          {{ ...name, text: undefined, children }}  
        </Link>  
      </li>    );  
  }),  
];

after

return [  
  <li className="Dropdown-header">{app.translator.trans('core.forum.search.users_heading')}</li>,  
  ...results.map((user) => {  
    const name = username(user, (name: string) => highlight(name, query));  
  
    return (  
      <li className="UserSearchResult" data-index={'users' + user.id()}>  
        <Link href={app.route.user(user)}>  
          {avatar(user)}  
          {name}  
        </Link>  
      </li>    );  
  }),  
];

Export Registry

Compat API ✅

compat API no longer works, instead all modules must be imported

before
https://github.com/flarum/framework/blob/1.x/extensions/tags/js/src/forum/compat.js
after
https://github.com/flarum/framework/blob/2.x/extensions/tags/js/src/forum/forum.ts

Importing Modules ✅

// Before  
import Tag from 'flarum/tags/common/models/Tag';  
  
// After  
import Tag from 'ext:flarum/tags/common/models/Tag';
  • warn of existing usage of @flarum/core imports (must remove/replace). ✅
  • warn of usage of useExtensions must use new import format of ext: instead ✅

Code splitting ✅

  • auto replace app.modal.show calls for lazy loaded modules ✅
  • auto replace extend/override of flarum lazy loaded modules ✅
// before
extend(LogInModal.prototype, 'oninit', function() {  
  console.log('LogInModal is loaded');  
});

// after
extend('flarum/forum/components/LogInModal', 'oninit', function() {  
  console.log('LogInModal is loaded');  
});

forum
Composer
DiscussionsUserPage
ForgotPasswordModal
NotificationsPage
PostStreamScrubber
SearchModal
SignUpModal
DiscussionComposer
EditPostComposer
LogInModal
PostStream
ReplyComposer
SettingsPage
UserSecurityPage

common
EditUserModal

Misc

  • if inherits NotificationsDropdown => HeaderDropdown
// before
 ... extends NotificationsDropdown

  getMenu() {
    return (
      <div className={'Dropdown-menu ' + this.attrs.menuClassName} onclick={this.menuClick.bind(this)}>
        {this.showing && <FlagList state={this.attrs.state} />}
      </div>
    );
  }

// after
 ... extends HeaderDropdown

  getContent() {
    return <FlagList state={this.attrs.state} />;
  }
  • Form: ✅
// before
<div className="Form$1">$2</div>

// after
import Form from 'flarum/common/components/Form';

<Form className="$1">$2</Form>
  • initializers.has('lock') => initializers.has('flarum-lock')
  • initializers.has('subscriptions') => initializers.has('flarum-subscriptions')
  • initializers.has('flarum/nicknames') => initializers.add('flarum-nicknames')

Backend

Misc

  • (Extend\Notification)->type() remove second arg. ✅
$dates
// before
$dates = [...]

// after
$casts = [... => 'datetime']

Filesystem

NullAdapter
// before
League\Flysystem\Adapter\NullAdapter

NullAdapter

// after
League\Flysystem\InMemory\InMemoryFilesystemAdapter

InMemoryFilesystemAdapter

// Before
League\Flysystem\Adpter\Local

Local

// after
League\Flysystem\Local\LocalFilesystemAdapter

LocalFilesystemAdapter

// before
new FilesystemAdapter(new Filesystem(new LocalAdapter($path)));

// after
new FilesystemAdapter(new Filesystem($adapter = new LocalAdapter($path)), $adapter);

Mailer

JSON:API

Attempt to use advanced steps for this, but likely not possible to do any automated upgrading. warn instead to read:

http://localhost:3000/extend/update-2_0#jsonapi

  • add before and after changes as an example (use the tags extension) ✅
  • create an api resource class for each type of serialized model ✅
  • Pre-fill the API resource with endpoints based on the current controllers ✅
  • Pre-fill the API resource with relationship declarations based on the Serializer ✅
  • auto insert the extender that registers the new api resource class ✅
  • add TODO comments on old classes (Serializers and Controllers) and old extenders, so the author knows to migrate their logic to the new api resource class. ✅

Search

  • Gambits (back to front) (produced js gambit based on pattern) ✅
// before
class TagFilterGambit extends AbstractRegexGambit implements FilterInterface
{
    use ValidateFilterTrait;

    /**
     * @var SlugManager
     */
    protected $slugger;

    public function __construct(SlugManager $slugger)
    {
        $this->slugger = $slugger;
    }

    protected function getGambitPattern()
    {
        return 'tag:(.+)';
    }

    protected function conditions(SearchState $search, array $matches, $negate)
    {
        ...
    }

    public function getFilterKey(): string
    {
        return 'tag';
    }

    public function filter(FilterState $filterState, $filterValue, bool $negate)
    {
        $this->constrain($filterState->getQuery(), $filterValue, $negate, $filterState->getActor());
    }

    protected function constrain(Builder $query, $rawSlugs, $negate, User $actor)
    {
        ...
    }
}

// after
class TagFilter implements FilterInterface
{
    use ValidateFilterTrait;

    /**
     * @var SlugManager
     */
    protected $slugger;

    public function __construct(SlugManager $slugger)
    {
        $this->slugger = $slugger;
    }

    public function getFilterKey(): string
    {
        return 'tag';
    }

    public function filter(FilterState $filterState, $filterValue, bool $negate)
    {
        $this->constrain($filterState->getQuery(), $filterValue, $negate, $filterState->getActor());
    }

    protected function constrain(Builder $query, $rawSlugs, $negate, User $actor)
    {
        ...
    }
}
export default class TagGambit extends KeyValueGambit {
  predicates = true;

  key(): string {
    return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.key', {}, true);
  }

  hint(): string {
    return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.hint', {}, true);
  }

  filterKey(): string {
    return 'tag';
  }

  gambitValueToFilterValue(value: string): string[] {
    return [value];
  }

  fromFilter(value: any, negate: boolean): string {
    let gambits = [];

    if (Array.isArray(value)) {
      gambits = value.map((value) => this.fromFilter(value.toString(), negate));
    } else {
      return `${negate ? '-' : ''}${this.key()}:${this.filterValueToGambitValue(value)}`;
    }

    return gambits.join(' ');
  }

  filterValueToGambitValue(value: string): string {
    return value;
  }
}
// before
(new Extend\Filter(PostFilterer::class))
	->addFilter(PostTagFilter::class),

(new Extend\Filter(DiscussionFilterer::class))
	->addFilter(TagFilterGambit::class)
	->addFilterMutator(HideHiddenTagsFromAllDiscussionsPage::class),

(new Extend\SimpleFlarumSearch(DiscussionSearcher::class))
	->addGambit(TagFilterGambit::class),

(new Extend\SimpleFlarumSearch(TagSearcher::class))
	->setFullTextGambit(FullTextGambit::class),

// after
(new Extend\SearchDriver(DatabaseSearchDriver::class))
	->addFilter(PostSearcher::class, PostTagFilter::class)
	->addFilter(DiscussionSearcher::class, TagFilter::class)
	->addMutator(DiscussionSearcher::class, HideHiddenTagsFromAllDiscussionsPage::class)
	->addSearcher(Tag::class, TagSearcher::class)
	->setFulltext(TagSearcher::class, FulltextFilter::class),
  • Flarum\Search\AbstractSearcher => Flarum\Search\Database\AbstractSearcher
  • Flarum\Filter\FilterState => Flarum\Search\SearchState
  • Flarum\Query => Flarum\Search
  • Flarum\Filter => Flarum\Search\Filter

LESS ✅

// before  
& when (@config-dark-mode) {  
  background: black;  
}  
  
// after  
[data-theme^=dark] & {  
  background: black;  
}
// before  
& when (@config-colored-header) {  
  background: black;  
}  
  
// after  
[data-colored-header^=true] & {  
  background: black;  
}

Global policy option

The policy generation command only deals with model policies, we should add the ability to choose a global policy instead.

Git Action JS BundleWatch Error #127

Hi everyone, first time using Flarum-CLI.

I was resolving all dependencies in Github Actions that were auto generated but ran into this issue that I couldn't fix with a simple:
flarum-cli infra command.

image

I'm getting an Error 127: No such File or Directory error but looking at my file structure the file was created as a git submodule that points to an existing file.

image
Git submodule shown above, points to path shown below.

image

Anyone know how to resolve this?

Missing autoload

The autoload on the composer.json file is not included after running flarum-cli init

Recommend:
Adds option to choose add autoload or not

Controller generation

We have API controller generation, but not standard controller that directly implements the proper interface.

`.gitignore` not being copied by extension creator

The /.gitignore file from the extension boilerplate doesn't get copied to the created extension, leading node_modules to be added to git.

This is because npm removes .gitignore files when publishing packages, meaning that even when globOptions.dot is true when calling copyTpl, the file won't be copied.

The recommended solution appears to be to rename the files to something else, such as gitignore and renaming them to .gitignore after copying them.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.