@flarum/cli 2.0.0-beta.13 → 2.0.0-beta.16

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.
Files changed (125) hide show
  1. package/README.md +136 -39
  2. package/bin/run +2 -1
  3. package/bin/splitsh-lite-darwin +0 -0
  4. package/bin/splitsh-lite-linux +0 -0
  5. package/boilerplate/skeleton/extension/.gitattributes +16 -14
  6. package/boilerplate/skeleton/extension/.github/workflows/backend.yml +1 -1
  7. package/boilerplate/skeleton/extension/.github/workflows/frontend.yml +3 -1
  8. package/boilerplate/skeleton/extension/LICENSE.md +1 -1
  9. package/boilerplate/skeleton/extension/composer.json +6 -4
  10. package/boilerplate/skeleton/extension/js/package.json +5 -1
  11. package/boilerplate/skeleton/extension/js/tsconfig.json +10 -2
  12. package/boilerplate/skeleton/extension/locale/en.yml +1 -1
  13. package/boilerplate/skeleton/extension/tests/phpunit.integration.xml +1 -0
  14. package/lib/base-command.d.ts +3 -1
  15. package/lib/base-command.js +44 -31
  16. package/lib/boilersmith/io.d.ts +28 -8
  17. package/lib/boilersmith/io.js +4 -2
  18. package/lib/boilersmith/paths.d.ts +2 -2
  19. package/lib/boilersmith/paths.js +7 -7
  20. package/lib/boilersmith/scaffolding/audit-step-factory.js +11 -11
  21. package/lib/boilersmith/scaffolding/infra-step-factory.js +2 -2
  22. package/lib/boilersmith/scaffolding/init-step-factory.js +5 -5
  23. package/lib/boilersmith/scaffolding/module.d.ts +19 -8
  24. package/lib/boilersmith/scaffolding/module.js +56 -19
  25. package/lib/boilersmith/scaffolding/scaffolder.d.ts +4 -1
  26. package/lib/boilersmith/scaffolding/scaffolder.js +32 -32
  27. package/lib/boilersmith/scaffolding/template-param.d.ts +1 -1
  28. package/lib/boilersmith/scaffolding/template-param.js +2 -2
  29. package/lib/boilersmith/step-manager.d.ts +0 -1
  30. package/lib/boilersmith/step-manager.js +10 -20
  31. package/lib/boilersmith/steps/stub-base.js +3 -3
  32. package/lib/boilersmith/utils/clone-and-fill.js +1 -1
  33. package/lib/boilersmith/utils/commit-async.d.ts +2 -0
  34. package/lib/boilersmith/utils/commit-async.js +15 -0
  35. package/lib/boilersmith/utils/read-tpl.js +2 -2
  36. package/lib/commands/audit/infra.d.ts +1 -1
  37. package/lib/commands/audit/infra.js +30 -8
  38. package/lib/commands/infra.d.ts +2 -2
  39. package/lib/commands/infra.js +18 -12
  40. package/lib/commands/init.d.ts +1 -1
  41. package/lib/commands/init.js +4 -2
  42. package/lib/commands/make/backend/api-controller.js +1 -2
  43. package/lib/commands/make/backend/api-serializer-attributes.js +1 -2
  44. package/lib/commands/make/backend/command.js +1 -2
  45. package/lib/commands/make/backend/event-listener.js +1 -2
  46. package/lib/commands/make/backend/handler.js +2 -5
  47. package/lib/commands/make/backend/integration-test.js +2 -4
  48. package/lib/commands/make/backend/migration.js +1 -2
  49. package/lib/commands/make/backend/model.js +1 -2
  50. package/lib/commands/make/backend/policy.js +1 -2
  51. package/lib/commands/make/backend/route.js +1 -2
  52. package/lib/commands/make/backend/service-provider.js +1 -2
  53. package/lib/commands/make/frontend/model.js +2 -5
  54. package/lib/commands/monorepo/create.d.ts +15 -0
  55. package/lib/commands/monorepo/create.js +20 -0
  56. package/lib/commands/monorepo/split.d.ts +15 -0
  57. package/lib/commands/monorepo/split.js +19 -0
  58. package/lib/commands/update/js-imports.js +1 -2
  59. package/lib/help.js +1 -1
  60. package/lib/providers/php-provider.js +2 -2
  61. package/lib/steps/gen-ext-scaffolder.d.ts +1 -1
  62. package/lib/steps/gen-ext-scaffolder.js +114 -64
  63. package/lib/steps/js/base.js +2 -4
  64. package/lib/steps/js/model.js +4 -4
  65. package/lib/steps/misc/composer.js +2 -2
  66. package/lib/steps/misc/git.d.ts +1 -1
  67. package/lib/steps/misc/git.js +2 -2
  68. package/lib/steps/misc/npm.d.ts +11 -0
  69. package/lib/steps/misc/npm.js +19 -0
  70. package/lib/steps/misc/yarn.js +2 -2
  71. package/lib/steps/monorepo/create.d.ts +17 -0
  72. package/lib/steps/monorepo/create.js +186 -0
  73. package/lib/steps/monorepo/split.d.ts +14 -0
  74. package/lib/steps/monorepo/split.js +95 -0
  75. package/lib/steps/stubs/backend/api-controller.d.ts +1 -1
  76. package/lib/steps/stubs/backend/api-controller.js +3 -0
  77. package/lib/steps/stubs/backend/api-serializer.d.ts +1 -1
  78. package/lib/steps/stubs/backend/api-serializer.js +3 -0
  79. package/lib/steps/stubs/backend/command.d.ts +0 -5
  80. package/lib/steps/stubs/backend/command.js +1 -0
  81. package/lib/steps/stubs/backend/event-listener.d.ts +1 -1
  82. package/lib/steps/stubs/backend/event-listener.js +2 -0
  83. package/lib/steps/stubs/backend/handler-command.d.ts +1 -1
  84. package/lib/steps/stubs/backend/handler-command.js +1 -0
  85. package/lib/steps/stubs/backend/handler.d.ts +1 -1
  86. package/lib/steps/stubs/backend/handler.js +4 -0
  87. package/lib/steps/stubs/backend/integration-test.d.ts +1 -1
  88. package/lib/steps/stubs/backend/integration-test.js +2 -0
  89. package/lib/steps/stubs/backend/job.d.ts +1 -1
  90. package/lib/steps/stubs/backend/job.js +1 -0
  91. package/lib/steps/stubs/backend/migration.js +6 -3
  92. package/lib/steps/stubs/backend/model.d.ts +1 -1
  93. package/lib/steps/stubs/backend/model.js +1 -0
  94. package/lib/steps/stubs/backend/policy.d.ts +1 -1
  95. package/lib/steps/stubs/backend/policy.js +2 -0
  96. package/lib/steps/stubs/backend/repository.d.ts +1 -1
  97. package/lib/steps/stubs/backend/repository.js +2 -0
  98. package/lib/steps/stubs/backend/service-provider.d.ts +1 -1
  99. package/lib/steps/stubs/backend/service-provider.js +1 -0
  100. package/lib/steps/stubs/backend/validator.d.ts +1 -1
  101. package/lib/steps/stubs/backend/validator.js +1 -0
  102. package/lib/steps/stubs/flarum-base.js +1 -1
  103. package/lib/steps/stubs/frontend/component.d.ts +0 -5
  104. package/lib/steps/stubs/frontend/component.js +1 -0
  105. package/lib/steps/stubs/frontend/modal.d.ts +0 -5
  106. package/lib/steps/stubs/frontend/modal.js +1 -0
  107. package/lib/steps/stubs/frontend/model.d.ts +0 -5
  108. package/lib/steps/stubs/frontend/model.js +1 -0
  109. package/lib/steps/stubs/js-base.js +8 -5
  110. package/lib/steps/stubs/php-base.js +10 -8
  111. package/lib/steps/update/js-imports.js +8 -2
  112. package/lib/utils/composer.d.ts +1 -0
  113. package/lib/utils/migration.js +3 -1
  114. package/lib/utils/monorepo.d.ts +24 -0
  115. package/lib/utils/monorepo.js +24 -0
  116. package/lib/utils/validation.d.ts +2 -0
  117. package/lib/utils/validation.js +6 -0
  118. package/oclif.manifest.json +1 -1
  119. package/package.json +7 -3
  120. package/php-subsystem/composer.json +9 -9
  121. package/php-subsystem/composer.lock +64 -71
  122. package/php-subsystem/vendor/composer/installed.json +54 -61
  123. package/php-subsystem/vendor/nikic/php-parser/README.md +55 -59
  124. package/php-subsystem/vendor/nikic/php-parser/composer.json +39 -39
  125. package/php-subsystem/vendor/nikic/php-parser/grammar/README.md +17 -20
@@ -1,65 +1,58 @@
1
1
  {
2
- "packages": [
2
+ "packages": [
3
+ {
4
+ "name": "nikic/php-parser",
5
+ "version": "v4.10.5",
6
+ "version_normalized": "4.10.5.0",
7
+ "source": {
8
+ "type": "git",
9
+ "url": "https://github.com/nikic/PHP-Parser.git",
10
+ "reference": "4432ba399e47c66624bc73c8c0f811e5c109576f"
11
+ },
12
+ "dist": {
13
+ "type": "zip",
14
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4432ba399e47c66624bc73c8c0f811e5c109576f",
15
+ "reference": "4432ba399e47c66624bc73c8c0f811e5c109576f",
16
+ "shasum": ""
17
+ },
18
+ "require": {
19
+ "ext-tokenizer": "*",
20
+ "php": ">=7.0"
21
+ },
22
+ "require-dev": {
23
+ "ircmaxell/php-yacc": "^0.0.7",
24
+ "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0"
25
+ },
26
+ "time": "2021-05-03T19:11:20+00:00",
27
+ "bin": ["bin/php-parse"],
28
+ "type": "library",
29
+ "extra": {
30
+ "branch-alias": {
31
+ "dev-master": "4.9-dev"
32
+ }
33
+ },
34
+ "installation-source": "dist",
35
+ "autoload": {
36
+ "psr-4": {
37
+ "PhpParser\\": "lib/PhpParser"
38
+ }
39
+ },
40
+ "notification-url": "https://packagist.org/downloads/",
41
+ "license": ["BSD-3-Clause"],
42
+ "authors": [
3
43
  {
4
- "name": "nikic/php-parser",
5
- "version": "v4.10.5",
6
- "version_normalized": "4.10.5.0",
7
- "source": {
8
- "type": "git",
9
- "url": "https://github.com/nikic/PHP-Parser.git",
10
- "reference": "4432ba399e47c66624bc73c8c0f811e5c109576f"
11
- },
12
- "dist": {
13
- "type": "zip",
14
- "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4432ba399e47c66624bc73c8c0f811e5c109576f",
15
- "reference": "4432ba399e47c66624bc73c8c0f811e5c109576f",
16
- "shasum": ""
17
- },
18
- "require": {
19
- "ext-tokenizer": "*",
20
- "php": ">=7.0"
21
- },
22
- "require-dev": {
23
- "ircmaxell/php-yacc": "^0.0.7",
24
- "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0"
25
- },
26
- "time": "2021-05-03T19:11:20+00:00",
27
- "bin": [
28
- "bin/php-parse"
29
- ],
30
- "type": "library",
31
- "extra": {
32
- "branch-alias": {
33
- "dev-master": "4.9-dev"
34
- }
35
- },
36
- "installation-source": "dist",
37
- "autoload": {
38
- "psr-4": {
39
- "PhpParser\\": "lib/PhpParser"
40
- }
41
- },
42
- "notification-url": "https://packagist.org/downloads/",
43
- "license": [
44
- "BSD-3-Clause"
45
- ],
46
- "authors": [
47
- {
48
- "name": "Nikita Popov"
49
- }
50
- ],
51
- "description": "A PHP parser written in PHP",
52
- "keywords": [
53
- "parser",
54
- "php"
55
- ],
56
- "support": {
57
- "issues": "https://github.com/nikic/PHP-Parser/issues",
58
- "source": "https://github.com/nikic/PHP-Parser/tree/v4.10.5"
59
- },
60
- "install-path": "../nikic/php-parser"
44
+ "name": "Nikita Popov"
61
45
  }
62
- ],
63
- "dev": true,
64
- "dev-package-names": []
46
+ ],
47
+ "description": "A PHP parser written in PHP",
48
+ "keywords": ["parser", "php"],
49
+ "support": {
50
+ "issues": "https://github.com/nikic/PHP-Parser/issues",
51
+ "source": "https://github.com/nikic/PHP-Parser/tree/v4.10.5"
52
+ },
53
+ "install-path": "../nikic/php-parser"
54
+ }
55
+ ],
56
+ "dev": true,
57
+ "dev-package-names": []
65
58
  }
@@ -1,5 +1,4 @@
1
- PHP Parser
2
- ==========
1
+ # PHP Parser
3
2
 
4
3
  [![Coverage Status](https://coveralls.io/repos/github/nikic/PHP-Parser/badge.svg?branch=master)](https://coveralls.io/github/nikic/PHP-Parser?branch=master)
5
4
 
@@ -10,25 +9,23 @@ manipulation.
10
9
 
11
10
  [Documentation for version 3.x][doc_3_x] (unsupported; for running on PHP >= 5.5; for parsing PHP 5.2 to PHP 7.2).
12
11
 
13
- Features
14
- --------
12
+ ## Features
15
13
 
16
14
  The main features provided by this library are:
17
15
 
18
- * Parsing PHP 5, PHP 7, and PHP 8 code into an abstract syntax tree (AST).
19
- * Invalid code can be parsed into a partial AST.
20
- * The AST contains accurate location information.
21
- * Dumping the AST in human-readable form.
22
- * Converting an AST back to PHP code.
23
- * Experimental: Formatting can be preserved for partially changed ASTs.
24
- * Infrastructure to traverse and modify ASTs.
25
- * Resolution of namespaced names.
26
- * Evaluation of constant expressions.
27
- * Builders to simplify AST construction for code generation.
28
- * Converting an AST into JSON and back.
29
-
30
- Quick Start
31
- -----------
16
+ - Parsing PHP 5, PHP 7, and PHP 8 code into an abstract syntax tree (AST).
17
+ - Invalid code can be parsed into a partial AST.
18
+ - The AST contains accurate location information.
19
+ - Dumping the AST in human-readable form.
20
+ - Converting an AST back to PHP code.
21
+ - Experimental: Formatting can be preserved for partially changed ASTs.
22
+ - Infrastructure to traverse and modify ASTs.
23
+ - Resolution of namespaced names.
24
+ - Evaluation of constant expressions.
25
+ - Builders to simplify AST construction for code generation.
26
+ - Converting an AST into JSON and back.
27
+
28
+ ## Quick Start
32
29
 
33
30
  Install the library using [composer](https://getcomposer.org):
34
31
 
@@ -178,48 +175,47 @@ function test($foo)
178
175
 
179
176
  For a more comprehensive introduction, see the documentation.
180
177
 
181
- Documentation
182
- -------------
178
+ ## Documentation
183
179
 
184
- 1. [Introduction](doc/0_Introduction.markdown)
185
- 2. [Usage of basic components](doc/2_Usage_of_basic_components.markdown)
180
+ 1. [Introduction](doc/0_Introduction.markdown)
181
+ 2. [Usage of basic components](doc/2_Usage_of_basic_components.markdown)
186
182
 
187
183
  Component documentation:
188
184
 
189
- * [Walking the AST](doc/component/Walking_the_AST.markdown)
190
- * Node visitors
191
- * Modifying the AST from a visitor
192
- * Short-circuiting traversals
193
- * Interleaved visitors
194
- * Simple node finding API
195
- * Parent and sibling references
196
- * [Name resolution](doc/component/Name_resolution.markdown)
197
- * Name resolver options
198
- * Name resolution context
199
- * [Pretty printing](doc/component/Pretty_printing.markdown)
200
- * Converting AST back to PHP code
201
- * Customizing formatting
202
- * Formatting-preserving code transformations
203
- * [AST builders](doc/component/AST_builders.markdown)
204
- * Fluent builders for AST nodes
205
- * [Lexer](doc/component/Lexer.markdown)
206
- * Lexer options
207
- * Token and file positions for nodes
208
- * Custom attributes
209
- * [Error handling](doc/component/Error_handling.markdown)
210
- * Column information for errors
211
- * Error recovery (parsing of syntactically incorrect code)
212
- * [Constant expression evaluation](doc/component/Constant_expression_evaluation.markdown)
213
- * Evaluating constant/property/etc initializers
214
- * Handling errors and unsupported expressions
215
- * [JSON representation](doc/component/JSON_representation.markdown)
216
- * JSON encoding and decoding of ASTs
217
- * [Performance](doc/component/Performance.markdown)
218
- * Disabling XDebug
219
- * Reusing objects
220
- * Garbage collection impact
221
- * [Frequently asked questions](doc/component/FAQ.markdown)
222
- * Parent and sibling references
223
-
224
- [doc_3_x]: https://github.com/nikic/PHP-Parser/tree/3.x/doc
225
- [doc_master]: https://github.com/nikic/PHP-Parser/tree/master/doc
185
+ - [Walking the AST](doc/component/Walking_the_AST.markdown)
186
+ - Node visitors
187
+ - Modifying the AST from a visitor
188
+ - Short-circuiting traversals
189
+ - Interleaved visitors
190
+ - Simple node finding API
191
+ - Parent and sibling references
192
+ - [Name resolution](doc/component/Name_resolution.markdown)
193
+ - Name resolver options
194
+ - Name resolution context
195
+ - [Pretty printing](doc/component/Pretty_printing.markdown)
196
+ - Converting AST back to PHP code
197
+ - Customizing formatting
198
+ - Formatting-preserving code transformations
199
+ - [AST builders](doc/component/AST_builders.markdown)
200
+ - Fluent builders for AST nodes
201
+ - [Lexer](doc/component/Lexer.markdown)
202
+ - Lexer options
203
+ - Token and file positions for nodes
204
+ - Custom attributes
205
+ - [Error handling](doc/component/Error_handling.markdown)
206
+ - Column information for errors
207
+ - Error recovery (parsing of syntactically incorrect code)
208
+ - [Constant expression evaluation](doc/component/Constant_expression_evaluation.markdown)
209
+ - Evaluating constant/property/etc initializers
210
+ - Handling errors and unsupported expressions
211
+ - [JSON representation](doc/component/JSON_representation.markdown)
212
+ - JSON encoding and decoding of ASTs
213
+ - [Performance](doc/component/Performance.markdown)
214
+ - Disabling XDebug
215
+ - Reusing objects
216
+ - Garbage collection impact
217
+ - [Frequently asked questions](doc/component/FAQ.markdown)
218
+ - Parent and sibling references
219
+
220
+ [doc_3_x]: https://github.com/nikic/PHP-Parser/tree/3.x/doc
221
+ [doc_master]: https://github.com/nikic/PHP-Parser/tree/master/doc
@@ -1,41 +1,41 @@
1
1
  {
2
- "name": "nikic/php-parser",
3
- "type": "library",
4
- "description": "A PHP parser written in PHP",
5
- "keywords": [
6
- "php",
7
- "parser"
8
- ],
9
- "license": "BSD-3-Clause",
10
- "authors": [
11
- {
12
- "name": "Nikita Popov"
13
- }
14
- ],
15
- "require": {
16
- "php": ">=7.0",
17
- "ext-tokenizer": "*"
18
- },
19
- "require-dev": {
20
- "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0",
21
- "ircmaxell/php-yacc": "^0.0.7"
22
- },
23
- "extra": {
24
- "branch-alias": {
25
- "dev-master": "4.9-dev"
26
- }
27
- },
28
- "autoload": {
29
- "psr-4": {
30
- "PhpParser\\": "lib/PhpParser"
31
- }
32
- },
33
- "autoload-dev": {
34
- "psr-4": {
35
- "PhpParser\\": "test/PhpParser/"
36
- }
37
- },
38
- "bin": [
39
- "bin/php-parse"
40
- ]
2
+ "name": "nikic/php-parser",
3
+ "type": "library",
4
+ "description": "A PHP parser written in PHP",
5
+ "keywords": [
6
+ "php",
7
+ "parser"
8
+ ],
9
+ "license": "BSD-3-Clause",
10
+ "authors": [
11
+ {
12
+ "name": "Nikita Popov"
13
+ }
14
+ ],
15
+ "require": {
16
+ "php": ">=7.0",
17
+ "ext-tokenizer": "*"
18
+ },
19
+ "require-dev": {
20
+ "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0",
21
+ "ircmaxell/php-yacc": "^0.0.7"
22
+ },
23
+ "extra": {
24
+ "branch-alias": {
25
+ "dev-master": "4.9-dev"
26
+ }
27
+ },
28
+ "autoload": {
29
+ "psr-4": {
30
+ "PhpParser\\": "lib/PhpParser"
31
+ }
32
+ },
33
+ "autoload-dev": {
34
+ "psr-4": {
35
+ "PhpParser\\": "test/PhpParser/"
36
+ }
37
+ },
38
+ "bin": [
39
+ "bin/php-parse"
40
+ ]
41
41
  }
@@ -1,30 +1,27 @@
1
- What do all those files mean?
2
- =============================
1
+ # What do all those files mean?
3
2
 
4
- * `php5.y`: PHP 5 grammar written in a pseudo language
5
- * `php7.y`: PHP 7 grammar written in a pseudo language
6
- * `tokens.y`: Tokens definition shared between PHP 5 and PHP 7 grammars
7
- * `parser.template`: A `kmyacc` parser prototype file for PHP
8
- * `tokens.template`: A `kmyacc` prototype file for the `Tokens` class
9
- * `rebuildParsers.php`: Preprocesses the grammar and builds the parser using `kmyacc`
3
+ - `php5.y`: PHP 5 grammar written in a pseudo language
4
+ - `php7.y`: PHP 7 grammar written in a pseudo language
5
+ - `tokens.y`: Tokens definition shared between PHP 5 and PHP 7 grammars
6
+ - `parser.template`: A `kmyacc` parser prototype file for PHP
7
+ - `tokens.template`: A `kmyacc` prototype file for the `Tokens` class
8
+ - `rebuildParsers.php`: Preprocesses the grammar and builds the parser using `kmyacc`
10
9
 
11
- .phpy pseudo language
12
- =====================
10
+ # .phpy pseudo language
13
11
 
14
12
  The `.y` file is a normal grammar in `kmyacc` (`yacc`) style, with some transformations
15
13
  applied to it:
16
14
 
17
- * Nodes are created using the syntax `Name[..., ...]`. This is transformed into
18
- `new Name(..., ..., attributes())`
19
- * Some function-like constructs are resolved (see `rebuildParsers.php` for a list)
15
+ - Nodes are created using the syntax `Name[..., ...]`. This is transformed into
16
+ `new Name(..., ..., attributes())`
17
+ - Some function-like constructs are resolved (see `rebuildParsers.php` for a list)
20
18
 
21
- Building the parser
22
- ===================
19
+ # Building the parser
23
20
 
24
21
  Run `php grammar/rebuildParsers.php` to rebuild the parsers. Additional options:
25
22
 
26
- * The `KMYACC` environment variable can be used to specify an alternative `kmyacc` binary.
27
- By default the `phpyacc` dev dependency will be used. To use the original `kmyacc`, you
28
- need to compile [moriyoshi's fork](https://github.com/moriyoshi/kmyacc-forked).
29
- * The `--debug` option enables emission of debug symbols and creates the `y.output` file.
30
- * The `--keep-tmp-grammar` option preserves the preprocessed grammar file.
23
+ - The `KMYACC` environment variable can be used to specify an alternative `kmyacc` binary.
24
+ By default the `phpyacc` dev dependency will be used. To use the original `kmyacc`, you
25
+ need to compile [moriyoshi's fork](https://github.com/moriyoshi/kmyacc-forked).
26
+ - The `--debug` option enables emission of debug symbols and creates the `y.output` file.
27
+ - The `--keep-tmp-grammar` option preserves the preprocessed grammar file.