@flarum/cli 2.0.0-beta.4 → 2.0.0-beta.8
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 +1 -1
- package/boilerplate/skeleton/extension/.gitattributes +1 -0
- package/boilerplate/skeleton/extension/gitignore +0 -1
- package/boilerplate/skeleton/extension/js/.bundlewatch.config.json +8 -0
- package/boilerplate/skeleton/extension/js/gitignore +9 -0
- package/boilerplate/skeleton/extension/js/package.json +3 -3
- package/lib/base-command.d.ts +2 -0
- package/lib/base-command.js +28 -32
- package/lib/boilersmith/io.d.ts +8 -4
- package/lib/boilersmith/io.js +33 -8
- package/lib/boilersmith/scaffolding/audit-step-factory.js +7 -0
- package/lib/boilersmith/scaffolding/infra-step-factory.js +1 -1
- package/lib/steps/gen-ext-scaffolder.js +3 -3
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
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/2.0.0-beta.
|
|
40
|
+
@flarum/cli/2.0.0-beta.8 linux-x64 node-v16.13.0
|
|
41
41
|
$ flarum-cli --help [COMMAND]
|
|
42
42
|
USAGE
|
|
43
43
|
$ flarum-cli COMMAND
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
"@flarum/prettier-config": "^1.0.0",
|
|
9
9
|
"flarum-tsconfig": "^1.0.2",
|
|
10
10
|
"flarum-webpack-config": "^2.0.0",
|
|
11
|
-
"prettier": "^2.
|
|
12
|
-
"typescript": "^4.
|
|
11
|
+
"prettier": "^2.5.1",
|
|
12
|
+
"typescript": "^4.5.4",
|
|
13
13
|
"typescript-coverage-report": "^0.6.1",
|
|
14
|
-
"webpack": "^5.
|
|
14
|
+
"webpack": "^5.65.0",
|
|
15
15
|
"webpack-cli": "^4.9.1"
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
package/lib/base-command.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Command, Interfaces } from '@oclif/core';
|
|
2
|
+
import { IO } from 'boilersmith/io';
|
|
2
3
|
import { StepManager } from 'boilersmith/step-manager';
|
|
3
4
|
import { FlarumProviders } from './providers';
|
|
4
5
|
export declare enum LocationType {
|
|
@@ -23,6 +24,7 @@ export default abstract class BaseCommand extends Command {
|
|
|
23
24
|
protected goodbyeMessage(): string;
|
|
24
25
|
protected additionalPreRunChecks(_extRoot: string): Promise<void>;
|
|
25
26
|
protected abstract steps(stepManager: StepManager<FlarumProviders>): StepManager<FlarumProviders>;
|
|
27
|
+
protected genIO(): IO;
|
|
26
28
|
protected monorepoPaths(options: {
|
|
27
29
|
includeCore: boolean;
|
|
28
30
|
includeExtensions: boolean;
|
package/lib/base-command.js
CHANGED
|
@@ -5,7 +5,6 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
6
|
const cli_ux_1 = (0, tslib_1.__importDefault)(require("cli-ux"));
|
|
7
7
|
const node_path_1 = require("node:path");
|
|
8
|
-
const prompts_1 = (0, tslib_1.__importDefault)(require("prompts"));
|
|
9
8
|
const globby_1 = (0, tslib_1.__importDefault)(require("globby"));
|
|
10
9
|
const node_child_process_1 = require("node:child_process");
|
|
11
10
|
const node_fs_1 = require("node:fs");
|
|
@@ -14,6 +13,7 @@ const step_manager_1 = require("boilersmith/step-manager");
|
|
|
14
13
|
const paths_1 = require("boilersmith/paths");
|
|
15
14
|
const php_provider_1 = require("./providers/php-provider");
|
|
16
15
|
const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
|
|
16
|
+
const errors_1 = require("@oclif/errors");
|
|
17
17
|
var LocationType;
|
|
18
18
|
(function (LocationType) {
|
|
19
19
|
LocationType[LocationType["FLARUM_EXTENSION"] = 0] = "FLARUM_EXTENSION";
|
|
@@ -41,9 +41,7 @@ class BaseCommand extends core_1.Command {
|
|
|
41
41
|
const rootData = await this.getFlarumExtensionRoot(path || process.cwd());
|
|
42
42
|
extRoot = rootData.path;
|
|
43
43
|
this.locationType = rootData.type;
|
|
44
|
-
|
|
45
|
-
await this.confirmExtDir(extRoot);
|
|
46
|
-
}
|
|
44
|
+
await this.confirmExtDir(extRoot);
|
|
47
45
|
}
|
|
48
46
|
else {
|
|
49
47
|
extRoot = path || process.cwd();
|
|
@@ -55,7 +53,7 @@ class BaseCommand extends core_1.Command {
|
|
|
55
53
|
});
|
|
56
54
|
const phpProvider = new php_provider_1.PhpSubsystemProvider((0, node_path_1.resolve)(__dirname, '../php-subsystem/index.php'));
|
|
57
55
|
const out = await this.steps(new step_manager_1.StepManager())
|
|
58
|
-
.run(paths,
|
|
56
|
+
.run(paths, this.genIO(), { php: phpProvider }, this.dry);
|
|
59
57
|
const errorMessages = out.messages.filter(m => m.type === 'error');
|
|
60
58
|
this.log('\n\n');
|
|
61
59
|
if (out.succeeded && errorMessages.length === 0) {
|
|
@@ -116,6 +114,9 @@ class BaseCommand extends core_1.Command {
|
|
|
116
114
|
// ----------------------------------------------------------------
|
|
117
115
|
// Confirmation
|
|
118
116
|
// ----------------------------------------------------------------
|
|
117
|
+
genIO() {
|
|
118
|
+
return new io_1.PromptsIO({}, [], this.flags['no-interaction'], errors_1.exit);
|
|
119
|
+
}
|
|
119
120
|
monorepoPaths(options) {
|
|
120
121
|
try {
|
|
121
122
|
const monorepoConfig = (0, node_fs_1.readFileSync)((0, node_path_1.resolve)(process.cwd(), 'flarum-monorepo.json'));
|
|
@@ -161,30 +162,26 @@ class BaseCommand extends core_1.Command {
|
|
|
161
162
|
- Flarum monorepos must have a valid 'flarum-monorepo.json' file`);
|
|
162
163
|
}
|
|
163
164
|
async confirmExtDir(extRoot) {
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
], io_1.PROMPTS_OPTIONS);
|
|
172
|
-
if (!response.verify)
|
|
165
|
+
const verify = await this.genIO().getParam({
|
|
166
|
+
name: 'verify',
|
|
167
|
+
type: 'confirm',
|
|
168
|
+
message: `Work in Flarum package located at ${(0, node_path_1.resolve)(extRoot)}?`,
|
|
169
|
+
initial: true,
|
|
170
|
+
});
|
|
171
|
+
if (!verify)
|
|
173
172
|
this.exit();
|
|
174
173
|
}
|
|
175
174
|
async ensureComposerInstallRan(extRoot) {
|
|
176
175
|
if ((0, node_fs_1.existsSync)((0, node_path_1.resolve)(extRoot, 'vendor/flarum/core/composer.json')))
|
|
177
176
|
return;
|
|
178
177
|
this.log("This command requires `composer install` to have been ran in your extension's root directory.");
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
], io_1.PROMPTS_OPTIONS);
|
|
187
|
-
if (response.composer) {
|
|
178
|
+
const composer = await this.genIO().getParam({
|
|
179
|
+
name: 'composer',
|
|
180
|
+
type: 'confirm',
|
|
181
|
+
message: 'Would you like me to take care of that for you?',
|
|
182
|
+
initial: true,
|
|
183
|
+
});
|
|
184
|
+
if (composer) {
|
|
188
185
|
cli_ux_1.default.action.start('Installing composer packages');
|
|
189
186
|
(0, node_child_process_1.execSync)('composer install', { cwd: extRoot });
|
|
190
187
|
cli_ux_1.default.action.stop();
|
|
@@ -204,14 +201,13 @@ class BaseCommand extends core_1.Command {
|
|
|
204
201
|
const empty = files.length === 0 || (files.length === 1 && files[0] === '.git');
|
|
205
202
|
if (empty)
|
|
206
203
|
return false;
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
if (response.overwrite === false)
|
|
204
|
+
const overwrite = await this.genIO().getParam({
|
|
205
|
+
name: 'overwrite',
|
|
206
|
+
type: 'confirm',
|
|
207
|
+
message: confirmationMessage,
|
|
208
|
+
initial: true,
|
|
209
|
+
});
|
|
210
|
+
if (overwrite === false)
|
|
215
211
|
this.exit();
|
|
216
212
|
return true;
|
|
217
213
|
}
|
|
@@ -222,7 +218,7 @@ class BaseCommand extends core_1.Command {
|
|
|
222
218
|
}
|
|
223
219
|
exports.default = BaseCommand;
|
|
224
220
|
BaseCommand.flags = {
|
|
225
|
-
|
|
221
|
+
'no-interaction': core_1.Flags.boolean({ char: 'n', description: 'Do not ask any interactive questions, assume defaults. When impossible, error.', default: false }),
|
|
226
222
|
help: core_1.Flags.help({ char: 'h' }),
|
|
227
223
|
};
|
|
228
224
|
BaseCommand.args = [
|
package/lib/boilersmith/io.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PromptObject } from 'prompts';
|
|
2
2
|
export declare type ParamDef<N extends string = string> = Omit<PromptObject<N>, 'name'> & {
|
|
3
3
|
name: N;
|
|
4
4
|
};
|
|
@@ -29,12 +29,15 @@ export interface IO {
|
|
|
29
29
|
getOutput(): Message[];
|
|
30
30
|
newInstance(cache: Record<string, unknown>, messages: Message[]): IO;
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
declare type OnCancel = () => void;
|
|
33
33
|
export declare class PromptsIO implements IO {
|
|
34
34
|
supportsAnsiColor: boolean;
|
|
35
35
|
private cache;
|
|
36
36
|
private messages;
|
|
37
|
-
|
|
37
|
+
private noInteraction;
|
|
38
|
+
private onCancel?;
|
|
39
|
+
private prev?;
|
|
40
|
+
constructor(initial?: Record<string, unknown>, messages?: Message[], noInteraction?: boolean, onCancel?: OnCancel);
|
|
38
41
|
getParam<T>(paramDef: ParamDef): Promise<T>;
|
|
39
42
|
hasCached(name: string): boolean;
|
|
40
43
|
/**
|
|
@@ -44,7 +47,8 @@ export declare class PromptsIO implements IO {
|
|
|
44
47
|
info(message: string, immediate: boolean): void;
|
|
45
48
|
warning(message: string, immediate: boolean): void;
|
|
46
49
|
error(message: string, immediate: false): void;
|
|
47
|
-
error(message: string, immediate: true):
|
|
50
|
+
error(message: string, immediate: true): never;
|
|
48
51
|
getOutput(): Message[];
|
|
49
52
|
newInstance(cache: Record<string, unknown>, messages: Message[]): PromptsIO;
|
|
50
53
|
}
|
|
54
|
+
export {};
|
package/lib/boilersmith/io.js
CHANGED
|
@@ -1,27 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PromptsIO =
|
|
3
|
+
exports.PromptsIO = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const prompts_1 = (0, tslib_1.__importDefault)(require("prompts"));
|
|
6
|
-
const errors_1 = require("@oclif/errors");
|
|
7
6
|
const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
|
|
8
|
-
exports.PROMPTS_OPTIONS = { onCancel: () => (0, errors_1.exit)() };
|
|
9
7
|
class PromptsIO {
|
|
10
|
-
constructor(initial = {}, messages = []) {
|
|
8
|
+
constructor(initial = {}, messages = [], noInteraction = false, onCancel = () => {
|
|
9
|
+
throw new Error('EEXIT: 0');
|
|
10
|
+
}) {
|
|
11
11
|
this.supportsAnsiColor = true;
|
|
12
12
|
this.cache = new Map();
|
|
13
|
-
this.messages = [];
|
|
14
13
|
this.cache = new Map(Object.entries(initial));
|
|
15
14
|
this.messages = messages;
|
|
15
|
+
this.noInteraction = noInteraction;
|
|
16
|
+
this.onCancel = onCancel;
|
|
16
17
|
}
|
|
17
18
|
async getParam(paramDef) {
|
|
19
|
+
var _a, _b, _c;
|
|
18
20
|
const paramName = paramDef.name;
|
|
19
21
|
if (this.cache.has(paramName)) {
|
|
20
22
|
return this.cache.get(paramName);
|
|
21
23
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
let resValue;
|
|
25
|
+
if (this.noInteraction) {
|
|
26
|
+
if (paramDef.initial && paramDef.initial instanceof Function) {
|
|
27
|
+
resValue = paramDef.initial((_a = this.prev) === null || _a === void 0 ? void 0 : _a.val, this.cache, (_b = this.prev) === null || _b === void 0 ? void 0 : _b.prompt);
|
|
28
|
+
}
|
|
29
|
+
else if (paramDef.type === 'confirm' || paramDef.type === 'toggle') {
|
|
30
|
+
resValue = ((_c = paramDef.initial) !== null && _c !== void 0 ? _c : false);
|
|
31
|
+
}
|
|
32
|
+
else if ('initial' in paramDef) {
|
|
33
|
+
resValue = paramDef.initial;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
return this.error(`No-Interaction mode is on, but input is required for param "${paramName}".`, true);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
const res = (await (0, prompts_1.default)(paramDef, {
|
|
41
|
+
onCancel: this.onCancel,
|
|
42
|
+
}));
|
|
43
|
+
resValue = res[paramName];
|
|
44
|
+
}
|
|
24
45
|
this.cache.set(paramName, resValue);
|
|
46
|
+
this.prev = {
|
|
47
|
+
val: resValue,
|
|
48
|
+
prompt: paramDef,
|
|
49
|
+
};
|
|
25
50
|
return resValue;
|
|
26
51
|
}
|
|
27
52
|
hasCached(name) {
|
|
@@ -66,7 +91,7 @@ class PromptsIO {
|
|
|
66
91
|
return this.messages;
|
|
67
92
|
}
|
|
68
93
|
newInstance(cache, messages) {
|
|
69
|
-
return new PromptsIO(cache, messages);
|
|
94
|
+
return new PromptsIO(cache, messages, this.noInteraction, this.onCancel);
|
|
70
95
|
}
|
|
71
96
|
}
|
|
72
97
|
exports.PromptsIO = PromptsIO;
|
|
@@ -43,6 +43,13 @@ function auditStepFactory(dry, scaffoldDir, modules, templateParams, excludeScaf
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
+
if (!dry) {
|
|
47
|
+
for (const m of modules) {
|
|
48
|
+
if (moduleStatusCache && m.updatable && (actionableModules.includes(m) || m.togglable)) {
|
|
49
|
+
(0, module_1.setModuleValue)(m, actionableModules.includes(m), _fs, paths, moduleStatusCache);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
46
53
|
return _fs;
|
|
47
54
|
},
|
|
48
55
|
exposes: modules.map(m => `modules.${m.name}`),
|
|
@@ -19,7 +19,7 @@ function infraStepFactory(scaffoldDir, moduleName, modules, templateParams, excl
|
|
|
19
19
|
}
|
|
20
20
|
const excludeScaffolding = excludeScaffoldingFunc ? excludeScaffoldingFunc(fs, paths) : [];
|
|
21
21
|
const initializing = !modulesEnabled[module.name];
|
|
22
|
-
(0, module_1.applyModule)(module, modulesEnabled, paramVals, scaffoldDir, fs, paths, excludeScaffolding, initializing);
|
|
22
|
+
(0, module_1.applyModule)(module, Object.assign(Object.assign({}, modulesEnabled), { [module.name]: true }), paramVals, scaffoldDir, fs, paths, excludeScaffolding, initializing);
|
|
23
23
|
if (moduleStatusCache) {
|
|
24
24
|
(0, module_1.setModuleValue)(module, true, fs, paths, moduleStatusCache);
|
|
25
25
|
}
|
|
@@ -299,7 +299,7 @@ function moduleNameToDef(name) {
|
|
|
299
299
|
name,
|
|
300
300
|
updatable: false,
|
|
301
301
|
togglable: true,
|
|
302
|
-
defaultEnabled:
|
|
302
|
+
defaultEnabled: false,
|
|
303
303
|
shortDescription: 'JS common code',
|
|
304
304
|
longDescription: 'Shared code between the forum and the admin frontends',
|
|
305
305
|
dependsOn: ['js'],
|
|
@@ -342,7 +342,7 @@ function moduleNameToDef(name) {
|
|
|
342
342
|
shortDescription: 'Git Configuration',
|
|
343
343
|
longDescription: 'Git config files (e.g. .gitignore, .gitattributes).',
|
|
344
344
|
dependsOn: [],
|
|
345
|
-
filesToReplace: [{ path: 'gitignore', destPath: '.gitignore' }, '.gitattributes'],
|
|
345
|
+
filesToReplace: [{ path: 'gitignore', destPath: '.gitignore' }, { path: 'js/gitignore', needsOtherModules: ['js'], destPath: 'js/.gitignore' }, '.gitattributes'],
|
|
346
346
|
jsonToAugment: {},
|
|
347
347
|
needsTemplateParams: [],
|
|
348
348
|
};
|
|
@@ -405,7 +405,7 @@ function moduleNameToDef(name) {
|
|
|
405
405
|
defaultEnabled: false,
|
|
406
406
|
shortDescription: 'Enable Bundlewatch Checks',
|
|
407
407
|
dependsOn: ['js'],
|
|
408
|
-
filesToReplace: [],
|
|
408
|
+
filesToReplace: ['js/.bundlewatch.config.json'],
|
|
409
409
|
jsonToAugment: {},
|
|
410
410
|
needsTemplateParams: [],
|
|
411
411
|
};
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"2.0.0-beta.4","commands":{"infra":{"id":"infra","description":"Add/Update infrastructure to the latest scaffolding for some module in an extension. For example, you can use this to add/update TypeScript, backend testing, GitHub Actions, and other features.","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"monorepo":{"name":"monorepo","type":"boolean","char":"m","allowNo":false},"defaults":{"name":"defaults","type":"boolean","char":"d","description":"Assume default responses to prompts where possible.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"module","description":"The name of the module to enable/update.","required":true,"options":["core","icon","js","jsCommon","css","locale","gitConf","githubActions","prettier","typescript","bundlewatch","backendTesting","editorConfig","styleci"]},{"name":"path","description":"Where should this command be executed?"}]},"init":{"id":"init","description":"Create a new Flarum extension","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","char":"d","description":"Assume default responses to prompts where possible.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"audit:infra":{"id":"audit:infra","description":"Check for outdated config files, infrastructure, setup, etc.","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"fix":{"name":"fix","type":"boolean","char":"f","allowNo":false},"monorepo":{"name":"monorepo","type":"boolean","char":"m","allowNo":false},"defaults":{"name":"defaults","type":"boolean","char":"d","description":"Assume default responses to prompts where possible.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"update:js-imports":{"id":"update:js-imports","description":"Updates JS imports from core to use proper namespaces","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","char":"d","description":"Assume default responses to prompts where possible.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:api-controller":{"id":"make:backend:api-controller","description":"Generate an API controller class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","char":"d","description":"Assume default responses to prompts where possible.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:api-serializer-attributes":{"id":"make:backend:api-serializer-attributes","description":"Generate an API serializer attributes extender","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","char":"d","description":"Assume default responses to prompts where possible.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:api-serializer":{"id":"make:backend:api-serializer","description":"Generate an API serializer class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","char":"d","description":"Assume default responses to prompts where possible.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:command":{"id":"make:backend:command","description":"Generate a console command class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","char":"d","description":"Assume default responses to prompts where possible.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:event-listener":{"id":"make:backend:event-listener","description":"Generate an event listener class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","char":"d","description":"Assume default responses to prompts where possible.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:handler":{"id":"make:backend:handler","description":"Generate a domain logic handler class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","char":"d","description":"Assume default responses to prompts where possible.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:integration-test":{"id":"make:backend:integration-test","description":"Generate an integration test class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","char":"d","description":"Assume default responses to prompts where possible.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:job":{"id":"make:backend:job","description":"Generate a job class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","char":"d","description":"Assume default responses to prompts where possible.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:migration":{"id":"make:backend:migration","description":"Generate a migration","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","char":"d","description":"Assume default responses to prompts where possible.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:model":{"id":"make:backend:model","description":"Generate a model class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","char":"d","description":"Assume default responses to prompts where possible.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:policy":{"id":"make:backend:policy","description":"Generate a policy class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","char":"d","description":"Assume default responses to prompts where possible.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:repository":{"id":"make:backend:repository","description":"Generate a repository class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","char":"d","description":"Assume default responses to prompts where possible.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:route":{"id":"make:backend:route","description":"Generate a routes extender","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","char":"d","description":"Assume default responses to prompts where possible.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:service-provider":{"id":"make:backend:service-provider","description":"Generate a service provider class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","char":"d","description":"Assume default responses to prompts where possible.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:validator":{"id":"make:backend:validator","description":"Generate a validator class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","char":"d","description":"Assume default responses to prompts where possible.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:frontend:component":{"id":"make:frontend:component","description":"Generate a frontend component","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","char":"d","description":"Assume default responses to prompts where possible.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:frontend:modal":{"id":"make:frontend:modal","description":"Generate a modal component","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","char":"d","description":"Assume default responses to prompts where possible.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:frontend:model":{"id":"make:frontend:model","description":"Generate a model class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"defaults":{"name":"defaults","type":"boolean","char":"d","description":"Assume default responses to prompts where possible.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]}}}
|
|
1
|
+
{"version":"2.0.0-beta.8","commands":{"infra":{"id":"infra","description":"Add/Update infrastructure to the latest scaffolding for some module in an extension. For example, you can use this to add/update TypeScript, backend testing, GitHub Actions, and other features.","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"monorepo":{"name":"monorepo","type":"boolean","char":"m","allowNo":false},"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"module","description":"The name of the module to enable/update.","required":true,"options":["core","icon","js","jsCommon","css","locale","gitConf","githubActions","prettier","typescript","bundlewatch","backendTesting","editorConfig","styleci"]},{"name":"path","description":"Where should this command be executed?"}]},"init":{"id":"init","description":"Create a new Flarum extension","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"audit:infra":{"id":"audit:infra","description":"Check for outdated config files, infrastructure, setup, etc.","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"fix":{"name":"fix","type":"boolean","char":"f","allowNo":false},"monorepo":{"name":"monorepo","type":"boolean","char":"m","allowNo":false},"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"update:js-imports":{"id":"update:js-imports","description":"Updates JS imports from core to use proper namespaces","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:api-controller":{"id":"make:backend:api-controller","description":"Generate an API controller class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:api-serializer-attributes":{"id":"make:backend:api-serializer-attributes","description":"Generate an API serializer attributes extender","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:api-serializer":{"id":"make:backend:api-serializer","description":"Generate an API serializer class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:command":{"id":"make:backend:command","description":"Generate a console command class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:event-listener":{"id":"make:backend:event-listener","description":"Generate an event listener class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:handler":{"id":"make:backend:handler","description":"Generate a domain logic handler class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:integration-test":{"id":"make:backend:integration-test","description":"Generate an integration test class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:job":{"id":"make:backend:job","description":"Generate a job class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:migration":{"id":"make:backend:migration","description":"Generate a migration","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:model":{"id":"make:backend:model","description":"Generate a model class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:policy":{"id":"make:backend:policy","description":"Generate a policy class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:repository":{"id":"make:backend:repository","description":"Generate a repository class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:route":{"id":"make:backend:route","description":"Generate a routes extender","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:service-provider":{"id":"make:backend:service-provider","description":"Generate a service provider class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:backend:validator":{"id":"make:backend:validator","description":"Generate a validator class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:frontend:component":{"id":"make:frontend:component","description":"Generate a frontend component","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:frontend:modal":{"id":"make:frontend:modal","description":"Generate a modal component","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]},"make:frontend:model":{"id":"make:frontend:model","description":"Generate a model class","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"no-interaction":{"name":"no-interaction","type":"boolean","char":"n","description":"Do not ask any interactive questions, assume defaults. When impossible, error.","allowNo":false},"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[{"name":"path","description":"Where should this command be executed?"}]}}}
|