@flarum/cli 1.0.0 → 2.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/bin/run +5 -3
- package/boilerplate/skeleton/extension/.gitattributes +16 -3
- package/boilerplate/skeleton/extension/.github/workflows/backend.yml +15 -0
- package/boilerplate/skeleton/extension/.github/workflows/frontend.yml +20 -0
- package/boilerplate/skeleton/extension/.styleci.yml +14 -0
- package/boilerplate/skeleton/extension/LICENSE.md +1 -0
- package/boilerplate/skeleton/extension/README.md +7 -7
- package/boilerplate/skeleton/extension/composer.json +11 -9
- package/boilerplate/skeleton/extension/extend.php +10 -10
- package/boilerplate/skeleton/extension/gitignore +13 -0
- package/boilerplate/skeleton/extension/js/admin.js +2 -1
- package/boilerplate/skeleton/extension/js/forum.js +2 -1
- package/boilerplate/skeleton/extension/js/package.json +13 -9
- package/boilerplate/skeleton/extension/js/src/admin/index.js +4 -2
- package/boilerplate/skeleton/extension/js/src/common/index.js +5 -0
- package/boilerplate/skeleton/extension/js/src/forum/index.js +4 -2
- package/boilerplate/skeleton/extension/js/tsconfig.json +6 -1
- package/boilerplate/skeleton/extension/locale/en.yml +1 -1
- package/boilerplate/stubs/migration.php +1 -1
- package/lib/base-command.d.ts +27 -6
- package/lib/base-command.js +131 -41
- package/lib/boilersmith/exposed-param-manager.d.ts +8 -0
- package/lib/boilersmith/exposed-param-manager.js +31 -0
- package/lib/boilersmith/io.d.ts +50 -0
- package/lib/boilersmith/io.js +72 -0
- package/lib/boilersmith/paths.d.ts +22 -0
- package/lib/boilersmith/paths.js +29 -0
- package/lib/boilersmith/scaffolding/audit-step-factory.d.ts +5 -0
- package/lib/boilersmith/scaffolding/audit-step-factory.js +54 -0
- package/lib/boilersmith/scaffolding/infra-step-factory.d.ts +5 -0
- package/lib/boilersmith/scaffolding/infra-step-factory.js +34 -0
- package/lib/boilersmith/scaffolding/init-step-factory.d.ts +5 -0
- package/lib/boilersmith/scaffolding/init-step-factory.js +34 -0
- package/lib/boilersmith/scaffolding/module.d.ts +73 -0
- package/lib/boilersmith/scaffolding/module.js +111 -0
- package/lib/boilersmith/scaffolding/scaffolder.d.ts +32 -0
- package/lib/boilersmith/scaffolding/scaffolder.js +203 -0
- package/lib/boilersmith/scaffolding/template-param.d.ts +23 -0
- package/lib/boilersmith/scaffolding/template-param.js +46 -0
- package/lib/boilersmith/step-manager.d.ts +85 -0
- package/lib/boilersmith/step-manager.js +234 -0
- package/lib/boilersmith/steps/stub-base.d.ts +53 -0
- package/lib/boilersmith/steps/stub-base.js +54 -0
- package/lib/{utils → boilersmith/utils}/clone-and-fill.d.ts +0 -0
- package/lib/{utils → boilersmith/utils}/clone-and-fill.js +2 -2
- package/lib/boilersmith/utils/cond-format.d.ts +1 -0
- package/lib/boilersmith/utils/cond-format.js +8 -0
- package/lib/boilersmith/utils/json-leaf-paths.d.ts +7 -0
- package/lib/boilersmith/utils/json-leaf-paths.js +17 -0
- package/lib/boilersmith/utils/read-tpl.d.ts +2 -0
- package/lib/boilersmith/utils/read-tpl.js +10 -0
- package/lib/boilersmith/utils/rename-keys.d.ts +1 -0
- package/lib/boilersmith/utils/rename-keys.js +7 -0
- package/lib/commands/audit/infra.d.ts +16 -0
- package/lib/commands/audit/infra.js +27 -0
- package/lib/commands/infra.d.ts +20 -0
- package/lib/commands/infra.js +55 -0
- package/lib/commands/init.d.ts +4 -3
- package/lib/commands/init.js +8 -6
- package/lib/commands/make/backend/api-controller.d.ts +4 -3
- package/lib/commands/make/backend/api-controller.js +3 -2
- package/lib/commands/make/backend/api-serializer-attributes.d.ts +4 -3
- package/lib/commands/make/backend/api-serializer-attributes.js +1 -1
- package/lib/commands/make/backend/api-serializer.d.ts +4 -3
- package/lib/commands/make/backend/api-serializer.js +3 -2
- package/lib/commands/make/backend/command.d.ts +4 -3
- package/lib/commands/make/backend/command.js +3 -2
- package/lib/commands/make/backend/event-listener.d.ts +4 -3
- package/lib/commands/make/backend/event-listener.js +3 -2
- package/lib/commands/make/backend/handler.d.ts +4 -3
- package/lib/commands/make/backend/handler.js +4 -3
- package/lib/commands/make/backend/integration-test.d.ts +4 -3
- package/lib/commands/make/backend/integration-test.js +3 -2
- package/lib/commands/make/backend/job.d.ts +4 -3
- package/lib/commands/make/backend/job.js +3 -2
- package/lib/commands/make/backend/migration.d.ts +4 -3
- package/lib/commands/make/backend/migration.js +3 -2
- package/lib/commands/make/backend/model.d.ts +4 -3
- package/lib/commands/make/backend/model.js +22 -21
- package/lib/commands/make/backend/policy.d.ts +4 -3
- package/lib/commands/make/backend/policy.js +3 -2
- package/lib/commands/make/backend/repository.d.ts +4 -3
- package/lib/commands/make/backend/repository.js +3 -2
- package/lib/commands/make/backend/route.d.ts +4 -3
- package/lib/commands/make/backend/route.js +1 -1
- package/lib/commands/make/backend/service-provider.d.ts +4 -3
- package/lib/commands/make/backend/service-provider.js +3 -2
- package/lib/commands/make/backend/validator.d.ts +4 -3
- package/lib/commands/make/backend/validator.js +3 -2
- package/lib/commands/make/frontend/component.d.ts +4 -3
- package/lib/commands/make/frontend/component.js +3 -2
- package/lib/commands/make/frontend/modal.d.ts +4 -3
- package/lib/commands/make/frontend/modal.js +3 -2
- package/lib/commands/make/frontend/model.d.ts +4 -3
- package/lib/commands/make/frontend/model.js +3 -2
- package/lib/commands/update/js-imports.d.ts +4 -3
- package/lib/commands/update/js-imports.js +1 -1
- package/lib/help.d.ts +5 -6
- package/lib/help.js +5 -4
- package/lib/index.d.ts +1 -1
- package/lib/index.js +3 -2
- package/lib/providers/index.d.ts +5 -0
- package/lib/providers/index.js +2 -0
- package/lib/{provider → providers}/php-provider.d.ts +0 -0
- package/lib/{provider → providers}/php-provider.js +2 -2
- package/lib/steps/extenders/api-serializer.js +2 -3
- package/lib/steps/extenders/base.d.ts +10 -10
- package/lib/steps/extenders/base.js +11 -11
- package/lib/steps/extenders/console-command.js +2 -3
- package/lib/steps/extenders/event.js +2 -3
- package/lib/steps/extenders/policy.js +2 -3
- package/lib/steps/extenders/route.js +2 -3
- package/lib/steps/extenders/service-provider.js +2 -3
- package/lib/steps/gen-ext-scaffolder.d.ts +6 -0
- package/lib/steps/gen-ext-scaffolder.js +510 -0
- package/lib/steps/js/base.d.ts +9 -9
- package/lib/steps/js/base.js +13 -12
- package/lib/steps/js/model.d.ts +5 -5
- package/lib/steps/js/model.js +8 -13
- package/lib/steps/misc/composer.d.ts +5 -6
- package/lib/steps/misc/composer.js +3 -3
- package/lib/steps/misc/git.d.ts +11 -0
- package/lib/steps/misc/git.js +20 -0
- package/lib/steps/misc/yarn.d.ts +5 -6
- package/lib/steps/misc/yarn.js +3 -3
- package/lib/steps/stubs/backend/api-controller.d.ts +1 -8
- package/lib/steps/stubs/backend/api-controller.js +2 -3
- package/lib/steps/stubs/backend/api-serializer.d.ts +4 -9
- package/lib/steps/stubs/backend/api-serializer.js +4 -4
- package/lib/steps/stubs/backend/command.d.ts +0 -5
- package/lib/steps/stubs/backend/command.js +1 -1
- package/lib/steps/stubs/backend/event-listener.d.ts +0 -5
- package/lib/steps/stubs/backend/event-listener.js +1 -1
- package/lib/steps/stubs/backend/handler-command.js +1 -1
- package/lib/steps/stubs/backend/handler.js +1 -1
- package/lib/steps/stubs/backend/migration.d.ts +4 -5
- package/lib/steps/stubs/backend/migration.js +8 -8
- package/lib/steps/stubs/backend/model.d.ts +4 -4
- package/lib/steps/stubs/backend/model.js +4 -4
- package/lib/steps/stubs/backend/policy.d.ts +0 -5
- package/lib/steps/stubs/backend/policy.js +1 -1
- package/lib/steps/stubs/backend/repository.d.ts +0 -5
- package/lib/steps/stubs/backend/repository.js +1 -1
- package/lib/steps/stubs/flarum-base.d.ts +9 -0
- package/lib/steps/stubs/flarum-base.js +10 -0
- package/lib/steps/stubs/frontend/component.js +0 -1
- package/lib/steps/stubs/frontend/modal.js +0 -1
- package/lib/steps/stubs/frontend/model.d.ts +4 -4
- package/lib/steps/stubs/frontend/model.js +3 -3
- package/lib/steps/stubs/js-base.d.ts +6 -7
- package/lib/steps/stubs/js-base.js +11 -16
- package/lib/steps/stubs/php-base.d.ts +7 -8
- package/lib/steps/stubs/php-base.js +12 -20
- package/lib/steps/update/js-imports.d.ts +5 -6
- package/lib/steps/update/js-imports.js +16 -19
- package/lib/utils/composer.d.ts +64 -0
- package/lib/utils/composer.js +8 -0
- package/lib/utils/migration.js +3 -3
- package/lib/utils/model-name.js +6 -6
- package/lib/utils/validation.d.ts +10 -7
- package/lib/utils/validation.js +9 -6
- package/oclif.manifest.json +1 -1
- package/package.json +55 -36
- package/php-subsystem/src/NodeVisitors/AddExtender.php +2 -1
- package/boilerplate/skeleton/extension/.github/workflows/build.yml +0 -32
- package/boilerplate/skeleton/extension/.github/workflows/lint.yml +0 -32
- package/boilerplate/skeleton/extension/.github/workflows/test.yml +0 -78
- package/lib/commands/infra/backend-testing.d.ts +0 -14
- package/lib/commands/infra/backend-testing.js +0 -26
- package/lib/provider/param-provider.d.ts +0 -15
- package/lib/provider/param-provider.js +0 -39
- package/lib/provider/path-provider.d.ts +0 -19
- package/lib/provider/path-provider.js +0 -24
- package/lib/steps/infra/backend-testing.d.ts +0 -8
- package/lib/steps/infra/backend-testing.js +0 -22
- package/lib/steps/infra/base.d.ts +0 -20
- package/lib/steps/infra/base.js +0 -36
- package/lib/steps/init/extension-skeleton.d.ts +0 -12
- package/lib/steps/init/extension-skeleton.js +0 -142
- package/lib/steps/step-manager.d.ts +0 -71
- package/lib/steps/step-manager.js +0 -173
- package/lib/steps/stubs/base.d.ts +0 -49
- package/lib/steps/stubs/base.js +0 -58
- package/lib/utils/extension-metadata.d.ts +0 -2
- package/lib/utils/extension-metadata.js +0 -21
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ $ npm install -g @flarum/cli
|
|
|
37
37
|
$ flarum-cli COMMAND
|
|
38
38
|
running command...
|
|
39
39
|
$ flarum-cli (-v|--version|version)
|
|
40
|
-
@flarum/cli/
|
|
40
|
+
@flarum/cli/2.0.0-beta.4 linux-x64 node-v16.13.0
|
|
41
41
|
$ flarum-cli --help [COMMAND]
|
|
42
42
|
USAGE
|
|
43
43
|
$ flarum-cli COMMAND
|
|
@@ -192,7 +192,7 @@ For example:
|
|
|
192
192
|
},
|
|
193
193
|
]);
|
|
194
194
|
})
|
|
195
|
-
.run(
|
|
195
|
+
.run(new Paths({...}), new PromptsIO(), {php: new PhpProvider(...)});
|
|
196
196
|
```
|
|
197
197
|
|
|
198
198
|
|
package/bin/run
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
require('
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
require('module-alias').addAlias('boilersmith', `${__dirname}/../lib/boilersmith`);
|
|
4
|
+
|
|
5
|
+
const oclif = require('@oclif/core');
|
|
6
|
+
|
|
7
|
+
oclif.run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle'));
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
.
|
|
1
|
+
.gitattributes export-ignore
|
|
2
|
+
.gitignore export-ignore
|
|
3
|
+
.gitmodules export-ignore
|
|
4
|
+
.github export-ignore
|
|
5
|
+
.travis export-ignore
|
|
6
|
+
.travis.yml export-ignore
|
|
7
|
+
.editorconfig export-ignore
|
|
8
|
+
.styleci.yml export-ignore
|
|
3
9
|
|
|
4
|
-
|
|
10
|
+
phpunit.xml export-ignore
|
|
11
|
+
tests export-ignore
|
|
12
|
+
|
|
13
|
+
js/dist/* -diff
|
|
14
|
+
js/dist/* linguist-generated
|
|
15
|
+
js/dist-typings/* linguist-generated
|
|
16
|
+
|
|
17
|
+
* text=auto eol=lf
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
name: <%= params.extensionName %> PHP
|
|
2
|
+
|
|
3
|
+
on: [workflow_dispatch, push, pull_request]
|
|
4
|
+
|
|
5
|
+
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
|
|
6
|
+
# This will break your current script.
|
|
7
|
+
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
run:
|
|
11
|
+
uses: flarum/.github/.github/workflows/REUSABLE_backend.yml@main
|
|
12
|
+
with:
|
|
13
|
+
enable_backend_testing: <%= modules.backendTesting %>
|
|
14
|
+
|
|
15
|
+
backend_directory: <%= params.backendDirectory %>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: <%= params.extensionName %> JS
|
|
2
|
+
|
|
3
|
+
on: [workflow_dispatch, push, pull_request]
|
|
4
|
+
|
|
5
|
+
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
|
|
6
|
+
# This will break your current script.
|
|
7
|
+
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
run:
|
|
11
|
+
uses: flarum/.github/.github/workflows/REUSABLE_frontend.yml@main
|
|
12
|
+
with:
|
|
13
|
+
enable_bundlewatch: <%= modules.bundlewatch %>
|
|
14
|
+
enable_prettier: <%= modules.prettier %>
|
|
15
|
+
enable_typescript: <%= modules.typescript %>
|
|
16
|
+
|
|
17
|
+
frontend_directory: <%= params.frontendDirectory %>
|
|
18
|
+
main_git_branch: <%= params.mainGitBranch %>
|
|
19
|
+
secrets:
|
|
20
|
+
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
preset: recommended
|
|
2
|
+
|
|
3
|
+
enabled:
|
|
4
|
+
- logical_not_operators_with_successor_space
|
|
5
|
+
|
|
6
|
+
disabled:
|
|
7
|
+
- align_double_arrow
|
|
8
|
+
- blank_line_after_opening_tag
|
|
9
|
+
- multiline_array_trailing_comma
|
|
10
|
+
- new_with_braces
|
|
11
|
+
- phpdoc_align
|
|
12
|
+
- phpdoc_order
|
|
13
|
+
- phpdoc_separation
|
|
14
|
+
- phpdoc_types
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= params.licenseText %>
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
# <%= extensionName %>
|
|
1
|
+
# <%= params.extensionName %>
|
|
2
2
|
|
|
3
|
-
 [](https://packagist.org/packages/<%= packageName %>) [](https://packagist.org/packages/<%= packageName %>)
|
|
3
|
+
 [](https://packagist.org/packages/<%= params.packageName %>) [](https://packagist.org/packages/<%= params.packageName %>)
|
|
4
4
|
|
|
5
|
-
A [Flarum](http://flarum.org) extension. <%= packageDescription %>
|
|
5
|
+
A [Flarum](http://flarum.org) extension. <%= params.packageDescription %>
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
9
9
|
Install with composer:
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
composer require <%= packageName %>:"*"
|
|
12
|
+
composer require <%= params.packageName %>:"*"
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## Updating
|
|
16
16
|
|
|
17
17
|
```sh
|
|
18
|
-
composer update <%= packageName %>:"*"
|
|
18
|
+
composer update <%= params.packageName %>:"*"
|
|
19
19
|
php flarum migrate
|
|
20
20
|
php flarum cache:clear
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Links
|
|
24
24
|
|
|
25
|
-
- [Packagist](https://packagist.org/packages/<%= packageName %>)
|
|
26
|
-
- [GitHub](https://github.com/<%= packageName %>)
|
|
25
|
+
- [Packagist](https://packagist.org/packages/<%= params.packageName %>)
|
|
26
|
+
- [GitHub](https://github.com/<%= params.packageName %>)
|
|
27
27
|
- [Discuss](https://discuss.flarum.org/d/PUT_DISCUSS_SLUG_HERE)
|
|
@@ -1,37 +1,39 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "<%= packageName %>",<% if (packageDescription) { %>
|
|
3
|
-
"description": "<%= packageDescription %>",<% } %>
|
|
2
|
+
"name": "<%= params.packageName %>",<% if (params.packageDescription) { %>
|
|
3
|
+
"description": "<%= params.packageDescription %>",<% } %>
|
|
4
4
|
"keywords": [
|
|
5
5
|
"flarum"
|
|
6
6
|
],
|
|
7
7
|
"type": "flarum-extension",
|
|
8
|
-
"license": "<%= licenseType %>",
|
|
8
|
+
"license": "<%= params.licenseType %>",
|
|
9
9
|
"require": {
|
|
10
10
|
"flarum/core": "^1.0.0"
|
|
11
11
|
},
|
|
12
12
|
"require-dev": {
|
|
13
13
|
"flarum/testing": "^1.0.0"
|
|
14
14
|
},
|
|
15
|
-
"authors": [<% if (authorName
|
|
15
|
+
"authors": [<% if (params.authorName) { %>
|
|
16
16
|
{
|
|
17
|
-
"name": "<%= authorName %>",<% if (authorEmail) { %>
|
|
18
|
-
"email": "<%= authorEmail %>",<% } %>
|
|
17
|
+
"name": "<%= params.authorName %>",<% if (params.authorEmail) { %>
|
|
18
|
+
"email": "<%= params.authorEmail %>",<% } %>
|
|
19
19
|
"role": "Developer"
|
|
20
20
|
}
|
|
21
21
|
<% } %>],
|
|
22
|
+
<% if (params.packageNamespace) { %>
|
|
22
23
|
"autoload": {
|
|
23
24
|
"psr-4": {
|
|
24
|
-
"<%=
|
|
25
|
+
"<%= params.packageNamespaceEscapedSlash %>\\": "src/"
|
|
25
26
|
}
|
|
26
27
|
},
|
|
28
|
+
<% } %>
|
|
27
29
|
"autoload-dev": {
|
|
28
30
|
"psr-4": {
|
|
29
|
-
"<%=
|
|
31
|
+
"<%= params.packageNamespaceEscapedSlash %>\\Tests\\": "tests/"
|
|
30
32
|
}
|
|
31
33
|
},
|
|
32
34
|
"extra": {
|
|
33
35
|
"flarum-extension": {
|
|
34
|
-
"title": "<%= extensionName %>",
|
|
36
|
+
"title": "<%= params.extensionName %>",
|
|
35
37
|
"category": "",
|
|
36
38
|
"icon": {
|
|
37
39
|
"name": "",
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
<?php
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
|
-
* This file is part of <%= packageName %>.
|
|
4
|
+
* This file is part of <%= params.packageName %>.
|
|
5
5
|
*
|
|
6
|
-
* Copyright (c) <%= year %> <%= authorName %>.
|
|
6
|
+
* Copyright (c) <%= params.year %> <%= params.authorName %>.
|
|
7
7
|
*
|
|
8
8
|
* For the full copyright and license information, please view the LICENSE.md
|
|
9
9
|
* file that was distributed with this source code.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
namespace <%=
|
|
12
|
+
namespace <%= params.packageNamespace %>;
|
|
13
13
|
|
|
14
14
|
use Flarum\Extend;
|
|
15
15
|
|
|
16
16
|
return [
|
|
17
|
-
<% if (
|
|
18
|
-
<% if (
|
|
19
|
-
<% if (
|
|
20
|
-
<% if (
|
|
21
|
-
<% if (
|
|
22
|
-
<% if (
|
|
23
|
-
<% if (
|
|
17
|
+
<% if (modules.js || modules.css) { %>(new Extend\Frontend('forum'))
|
|
18
|
+
<% if (modules.js) { %>->js(__DIR__.'/js/dist/forum.js')<% if (!modules.css) { %>,<% } %><% } %>
|
|
19
|
+
<% if (modules.css) { %>->css(__DIR__.'/less/forum.less'),<% } %><% } %>
|
|
20
|
+
<% if (modules.js || modules.css) { %>(new Extend\Frontend('admin'))
|
|
21
|
+
<% if (modules.js) { %>->js(__DIR__.'/js/dist/admin.js')<% if (!modules.css) { %>,<% } %><% } %>
|
|
22
|
+
<% if (modules.css) { %>->css(__DIR__.'/less/admin.less'),<% } %><% } %>
|
|
23
|
+
<% if (modules.locale) { %>new Extend\Locales(__DIR__.'/locale'),<% } %>
|
|
24
24
|
];
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from './src/
|
|
1
|
+
<% if (modules.jsCommon) { %>export * from './src/common';
|
|
2
|
+
<% } %>export * from './src/admin';
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from './src/
|
|
1
|
+
<% if (modules.jsCommon) { %>export * from './src/common';
|
|
2
|
+
<% } %>export * from './src/forum';
|
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "@<%= packageName %>",
|
|
3
|
-
"version": "0.0.0",
|
|
2
|
+
"name": "@<%= params.packageName %>",
|
|
4
3
|
"private": true,
|
|
5
4
|
"prettier": "@flarum/prettier-config",
|
|
6
5
|
"dependencies": {
|
|
7
|
-
"flarum-webpack-config": "^1.0.0",
|
|
8
|
-
"flarum-tsconfig": "^1.0.0",
|
|
9
|
-
"@flarum/prettier-config": "^1.0.0",
|
|
10
|
-
"webpack": "^4.26.0",
|
|
11
|
-
"webpack-cli": "^3.0.7"
|
|
12
6
|
},
|
|
13
7
|
"devDependencies": {
|
|
14
|
-
"prettier": "^
|
|
8
|
+
"@flarum/prettier-config": "^1.0.0",
|
|
9
|
+
"flarum-tsconfig": "^1.0.2",
|
|
10
|
+
"flarum-webpack-config": "^2.0.0",
|
|
11
|
+
"prettier": "^2.4.1",
|
|
12
|
+
"typescript": "^4.4.4",
|
|
13
|
+
"typescript-coverage-report": "^0.6.1",
|
|
14
|
+
"webpack": "^5.61.0",
|
|
15
|
+
"webpack-cli": "^4.9.1"
|
|
15
16
|
},
|
|
16
17
|
"scripts": {
|
|
17
18
|
"dev": "webpack --mode development --watch",
|
|
18
19
|
"build": "webpack --mode production",
|
|
20
|
+
"analyze": "cross-env ANALYZER=true yarn build",
|
|
19
21
|
"format": "prettier --write src",
|
|
20
|
-
"format-check": "prettier --check src"
|
|
22
|
+
"format-check": "prettier --check src",
|
|
23
|
+
"check-typings": "tsc --noEmit --emitDeclarationOnly false",
|
|
24
|
+
"check-typings-coverage": "typescript-coverage-report"
|
|
21
25
|
}
|
|
22
26
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
app
|
|
2
|
-
|
|
1
|
+
import app from 'flarum/admin/app';
|
|
2
|
+
|
|
3
|
+
app.initializers.add('<%= params.packageName %>', () => {
|
|
4
|
+
console.log('[<%= params.packageName %>] Hello, admin!');
|
|
3
5
|
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
app
|
|
2
|
-
|
|
1
|
+
import app from 'flarum/forum/app';
|
|
2
|
+
|
|
3
|
+
app.initializers.add('<%= params.packageName %>', () => {
|
|
4
|
+
console.log('[<%= params.packageName %>] Hello, forum!');
|
|
3
5
|
});
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
+
// Use Flarum's tsconfig as a starting point
|
|
2
3
|
"extends": "flarum-tsconfig",
|
|
3
|
-
|
|
4
|
+
// This will match all .ts, .tsx, .d.ts, .js, .jsx files in your `src` folder
|
|
5
|
+
// and also tells your Typescript server to read core's global typings for
|
|
6
|
+
// access to `dayjs` and `$` in the global namespace.
|
|
7
|
+
"include": ["src/**/*", "../vendor/flarum/core/js/dist-typings/@types/**/*", "@types/**/*"],
|
|
4
8
|
"compilerOptions": {
|
|
9
|
+
// This will output typings to `dist-typings`
|
|
5
10
|
"declarationDir": "./dist-typings",
|
|
6
11
|
"baseUrl": ".",
|
|
7
12
|
"paths": {
|
|
@@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
|
|
|
5
5
|
use Illuminate\Database\Schema\Builder;
|
|
6
6
|
|
|
7
7
|
// HINT: you might want to use a `Flarum\Database\Migration` helper method for simplicity!
|
|
8
|
-
// See https://docs.flarum.org/extend/
|
|
8
|
+
// See https://docs.flarum.org/extend/models.html#migrations to learn more about migrations.
|
|
9
9
|
return [
|
|
10
10
|
'up' => function (Builder $schema) {
|
|
11
11
|
// up migration
|
package/lib/base-command.d.ts
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
import { Command,
|
|
2
|
-
import { StepManager } from '
|
|
1
|
+
import { Command, Interfaces } from '@oclif/core';
|
|
2
|
+
import { StepManager } from 'boilersmith/step-manager';
|
|
3
|
+
import { FlarumProviders } from './providers';
|
|
4
|
+
export declare enum LocationType {
|
|
5
|
+
FLARUM_EXTENSION = 0,
|
|
6
|
+
FLARUM_CORE = 1,
|
|
7
|
+
FLARUM_MONOREPO = 2
|
|
8
|
+
}
|
|
3
9
|
export default abstract class BaseCommand extends Command {
|
|
4
|
-
|
|
10
|
+
protected STUB_PATH: string;
|
|
11
|
+
protected dry: boolean;
|
|
12
|
+
protected locationType?: LocationType;
|
|
13
|
+
protected args: Record<string, any>;
|
|
14
|
+
protected flags: any;
|
|
15
|
+
static flags: Interfaces.FlagInput<any>;
|
|
5
16
|
static args: {
|
|
6
17
|
name: string;
|
|
7
18
|
description: string;
|
|
@@ -11,8 +22,18 @@ export default abstract class BaseCommand extends Command {
|
|
|
11
22
|
protected welcomeMessage(): string;
|
|
12
23
|
protected goodbyeMessage(): string;
|
|
13
24
|
protected additionalPreRunChecks(_extRoot: string): Promise<void>;
|
|
14
|
-
protected abstract steps(stepManager: StepManager): StepManager
|
|
15
|
-
protected
|
|
25
|
+
protected abstract steps(stepManager: StepManager<FlarumProviders>): StepManager<FlarumProviders>;
|
|
26
|
+
protected monorepoPaths(options: {
|
|
27
|
+
includeCore: boolean;
|
|
28
|
+
includeExtensions: boolean;
|
|
29
|
+
includePhpPackages: boolean;
|
|
30
|
+
includeJSPackages: boolean;
|
|
31
|
+
}): string[];
|
|
32
|
+
protected isFlarumCore(path: string): boolean;
|
|
33
|
+
protected getFlarumExtensionRoot(currDir: string): Promise<{
|
|
34
|
+
path: string;
|
|
35
|
+
type: LocationType;
|
|
36
|
+
}>;
|
|
16
37
|
protected confirmExtDir(extRoot: string): Promise<void>;
|
|
17
38
|
protected ensureComposerInstallRan(extRoot: string): Promise<void>;
|
|
18
39
|
/**
|
|
@@ -20,6 +41,6 @@ export default abstract class BaseCommand extends Command {
|
|
|
20
41
|
* If true, files should be overriden.
|
|
21
42
|
* If user says no, will exit and not return anything.
|
|
22
43
|
*/
|
|
23
|
-
protected confirmOverrideFiles(dir: string, pattern: string, confirmationMessage: string): Promise<boolean>;
|
|
44
|
+
protected confirmOverrideFiles(dir: string, pattern: string | string[], confirmationMessage: string): Promise<boolean>;
|
|
24
45
|
protected deleteFiles(dir: string, pattern: string): Promise<void>;
|
|
25
46
|
}
|