@flarum/cli 2.0.0-beta.10 → 2.0.0-beta.11

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 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.10 linux-x64 node-v16.13.0
40
+ @flarum/cli/2.0.0-beta.11 linux-x64 node-v16.13.0
41
41
  $ flarum-cli --help [COMMAND]
42
42
  USAGE
43
43
  $ flarum-cli COMMAND
@@ -0,0 +1,2 @@
1
+ <% if (modules.jsCommon) { %>export * from './src/common';
2
+ <% } %>export * from './src/admin';
@@ -0,0 +1,2 @@
1
+ <% if (modules.jsCommon) { %>export * from './src/common';
2
+ <% } %>export * from './src/forum';
@@ -0,0 +1,5 @@
1
+ import app from 'flarum/admin/app';
2
+
3
+ app.initializers.add('<%= params.packageName %>', () => {
4
+ console.log('[<%= params.packageName %>] Hello, admin!');
5
+ });
@@ -0,0 +1,5 @@
1
+ import app from 'flarum/common/app';
2
+
3
+ app.initializers.add('<%= params.packageName %>', () => {
4
+ console.log('[<%= params.packageName %>] Hello, forum and admin!');
5
+ });
@@ -0,0 +1,5 @@
1
+ import app from 'flarum/forum/app';
2
+
3
+ app.initializers.add('<%= params.packageName %>', () => {
4
+ console.log('[<%= params.packageName %>] Hello, forum!');
5
+ });
@@ -11,9 +11,12 @@ interface FileOwnership {
11
11
  */
12
12
  destPath?: string;
13
13
  /**
14
- * If any of the needed modules aren't enabled, the file won't be updated.
14
+ * Depends on other modules being enabled (or disabled).
15
15
  */
16
- needsOtherModules?: string[];
16
+ moduleDeps?: (string | {
17
+ module: string;
18
+ enabled: boolean;
19
+ })[];
17
20
  /**
18
21
  * If in a monorepo, should the file be placed relative to the monorepo root, and if so, where?
19
22
  * If provided, takes priority over destPath.
@@ -60,6 +63,12 @@ interface TogglableModule<N extends string> extends CommonModule<N> {
60
63
  * Can only be enabled if these other modules are enabled.
61
64
  */
62
65
  dependsOn: string[];
66
+ /**
67
+ * On an existing installation, if no information about whether this
68
+ * module is enabled or disabled is cached, infer whether it's enabled
69
+ * based on the current installation's state.
70
+ */
71
+ inferEnabled?: (fs: Store, paths: Paths) => Promise<boolean | undefined>;
63
72
  }
64
73
  export declare type Module<N extends string = string> = UntoggleableModule<N> | TogglableModule<N>;
65
74
  export declare type ModuleStatusCache<N extends string> = {
@@ -43,12 +43,13 @@ async function promptModulesEnabled(modules, io) {
43
43
  }
44
44
  exports.promptModulesEnabled = promptModulesEnabled;
45
45
  async function currModulesEnabled(modules, fs, paths, cache) {
46
+ var _a, _b;
46
47
  const modulesEnabled = {};
47
48
  for (const m of modules) {
48
49
  if (m.togglable) {
49
50
  // eslint-disable-next-line no-await-in-loop
50
- const cacheVal = await (cache === null || cache === void 0 ? void 0 : cache.get(m, fs, paths));
51
- modulesEnabled[m.name] = cacheVal !== null && cacheVal !== void 0 ? cacheVal : m.defaultEnabled;
51
+ const isEnabled = (_a = await (cache === null || cache === void 0 ? void 0 : cache.get(m, fs, paths))) !== null && _a !== void 0 ? _a : await ((_b = m.inferEnabled) === null || _b === void 0 ? void 0 : _b.call(m, fs, paths));
52
+ modulesEnabled[m.name] = isEnabled !== null && isEnabled !== void 0 ? isEnabled : m.defaultEnabled;
52
53
  }
53
54
  else {
54
55
  modulesEnabled[m.name] = true;
@@ -91,8 +92,12 @@ async function applyModule(module, modulesEnabled, paramVals, scaffoldDir, fs, p
91
92
  const tplDataFlat = Object.assign(Object.assign({}, (0, rename_keys_1.renameKeys)(tplData.modules, k => `modules.${k}`)), (0, rename_keys_1.renameKeys)(tplData.params, k => `params.${k}`));
92
93
  for (const file of module.filesToReplace) {
93
94
  const path = typeof file === 'string' ? file : file.path;
94
- const needsOtherModules = typeof file === 'string' ? [] : (_a = file.needsOtherModules) !== null && _a !== void 0 ? _a : [];
95
- if (!excludeFiles.includes(path) && !needsOtherModules.some(dep => !modulesEnabled[dep])) {
95
+ const moduleDeps = typeof file === 'string' ? [] : (_a = file.moduleDeps) !== null && _a !== void 0 ? _a : [];
96
+ if (!excludeFiles.includes(path) && !moduleDeps.some(dep => {
97
+ const depName = typeof dep === 'string' ? dep : dep.module;
98
+ const enabled = modulesEnabled[depName];
99
+ return typeof dep === 'string' || dep.enabled ? !enabled : enabled;
100
+ })) {
96
101
  const copyToIfMonorepo = typeof file !== 'string' && file.monorepoPath ? paths.monorepo((0, clone_and_fill_1.cloneAndFill)(file.monorepoPath, tplDataFlat)) : undefined;
97
102
  const copyTo = copyToIfMonorepo !== null && copyToIfMonorepo !== void 0 ? copyToIfMonorepo : paths.package(typeof file !== 'string' && file.destPath ? (0, clone_and_fill_1.cloneAndFill)(file.destPath, tplDataFlat) : path);
98
103
  fsEditor.copyTpl((0, node_path_1.resolve)(scaffoldDir, path), copyTo, tplData);
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const scaffolder_1 = require("boilersmith/scaffolding/scaffolder");
6
6
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
7
7
  const mem_fs_editor_1 = require("mem-fs-editor");
8
+ const node_fs_1 = require("node:fs");
8
9
  const node_path_1 = require("node:path");
9
10
  const simple_git_1 = (0, tslib_1.__importDefault)(require("simple-git"));
10
11
  const simple_1 = (0, tslib_1.__importDefault)(require("spdx-license-list/simple"));
@@ -226,9 +227,12 @@ function moduleNameToDef(name) {
226
227
  'extend.php',
227
228
  'README.md',
228
229
  'LICENSE.md',
229
- { path: 'js/src/admin/index.js', needsOtherModules: ['js'] },
230
- { path: 'js/src/forum/index.js', needsOtherModules: ['js'] },
231
- { path: 'js/src/common/index.js', needsOtherModules: ['js', 'jsCommon'] },
230
+ { path: 'js/src/admin/index.js', moduleDeps: ['js', { module: 'typescript', enabled: false }] },
231
+ { path: 'js/src/forum/index.js', moduleDeps: ['js', { module: 'typescript', enabled: false }] },
232
+ { path: 'js/src/common/index.js', moduleDeps: ['js', 'jsCommon', { module: 'typescript', enabled: false }] },
233
+ { path: 'js/src/admin/index.ts', moduleDeps: ['js', { module: 'typescript', enabled: true }] },
234
+ { path: 'js/src/forum/index.ts', moduleDeps: ['js', { module: 'typescript', enabled: true }] },
235
+ { path: 'js/src/common/index.ts', moduleDeps: ['js', 'jsCommon', { module: 'typescript', enabled: true }] },
232
236
  ],
233
237
  jsonToAugment: {
234
238
  'composer.json': [
@@ -279,7 +283,13 @@ function moduleNameToDef(name) {
279
283
  shortDescription: 'Javascript',
280
284
  longDescription: "Files, tools, and scripts to build Flarum's frontend.",
281
285
  dependsOn: [],
282
- filesToReplace: ['js/webpack.config.js', 'js/admin.js', 'js/forum.js'],
286
+ filesToReplace: [
287
+ 'js/webpack.config.js',
288
+ { path: 'js/admin.js', moduleDeps: [{ module: 'typescript', enabled: false }] },
289
+ { path: 'js/forum.js', moduleDeps: [{ module: 'typescript', enabled: false }] },
290
+ { path: 'js/admin.ts', moduleDeps: [{ module: 'typescript', enabled: true }] },
291
+ { path: 'js/forum.ts', moduleDeps: [{ module: 'typescript', enabled: true }] },
292
+ ],
283
293
  jsonToAugment: {
284
294
  'js/package.json': [
285
295
  'name',
@@ -293,6 +303,9 @@ function moduleNameToDef(name) {
293
303
  ],
294
304
  },
295
305
  needsTemplateParams: ['packageName'],
306
+ inferEnabled: async (_fs, paths) => {
307
+ return (0, node_fs_1.existsSync)(paths.package('js'));
308
+ },
296
309
  };
297
310
  case 'jsCommon':
298
311
  return {
@@ -303,9 +316,17 @@ function moduleNameToDef(name) {
303
316
  shortDescription: 'JS common code',
304
317
  longDescription: 'Shared code between the forum and the admin frontends',
305
318
  dependsOn: ['js'],
306
- filesToReplace: ['js/admin.js', 'js/forum.js'],
319
+ filesToReplace: [
320
+ { path: 'js/admin.js', moduleDeps: [{ module: 'typescript', enabled: false }] },
321
+ { path: 'js/forum.js', moduleDeps: [{ module: 'typescript', enabled: false }] },
322
+ { path: 'js/admin.ts', moduleDeps: [{ module: 'typescript', enabled: true }] },
323
+ { path: 'js/forum.ts', moduleDeps: [{ module: 'typescript', enabled: true }] },
324
+ ],
307
325
  jsonToAugment: {},
308
326
  needsTemplateParams: [],
327
+ inferEnabled: async (_fs, paths) => {
328
+ return (0, node_fs_1.existsSync)(paths.package('js/src/common'));
329
+ },
309
330
  };
310
331
  case 'css':
311
332
  return {
@@ -319,6 +340,9 @@ function moduleNameToDef(name) {
319
340
  filesToReplace: ['less/admin.less', 'less/forum.less'],
320
341
  jsonToAugment: {},
321
342
  needsTemplateParams: [],
343
+ inferEnabled: async (_fs, paths) => {
344
+ return (0, node_fs_1.existsSync)(paths.package('less'));
345
+ },
322
346
  };
323
347
  case 'locale':
324
348
  return {
@@ -332,6 +356,9 @@ function moduleNameToDef(name) {
332
356
  filesToReplace: ['locale/en.yml'],
333
357
  jsonToAugment: {},
334
358
  needsTemplateParams: [],
359
+ inferEnabled: async (_fs, paths) => {
360
+ return (0, node_fs_1.existsSync)(paths.package('locale'));
361
+ },
335
362
  };
336
363
  case 'gitConf':
337
364
  return {
@@ -342,7 +369,7 @@ function moduleNameToDef(name) {
342
369
  shortDescription: 'Git Configuration',
343
370
  longDescription: 'Git config files (e.g. .gitignore, .gitattributes).',
344
371
  dependsOn: [],
345
- filesToReplace: [{ path: 'gitignore', destPath: '.gitignore' }, { path: 'js/gitignore', needsOtherModules: ['js'], destPath: 'js/.gitignore' }, '.gitattributes'],
372
+ filesToReplace: [{ path: 'gitignore', destPath: '.gitignore' }, { path: 'js/gitignore', moduleDeps: ['js'], destPath: 'js/.gitignore' }, '.gitattributes'],
346
373
  jsonToAugment: {},
347
374
  needsTemplateParams: [],
348
375
  };
@@ -375,6 +402,12 @@ function moduleNameToDef(name) {
375
402
  'js/package.json': ['prettier', 'devDependencies.prettier', 'devDependencies.@flarum/prettier-config', 'scripts.format', 'scripts.format-check'],
376
403
  },
377
404
  needsTemplateParams: [],
405
+ inferEnabled: async (_fs, paths) => {
406
+ if (!(0, node_fs_1.existsSync)(paths.package('js/package.json'))) {
407
+ return false;
408
+ }
409
+ return (0, node_fs_1.readFileSync)('js/package.json').includes('prettier');
410
+ },
378
411
  };
379
412
  case 'typescript':
380
413
  return {
@@ -396,6 +429,9 @@ function moduleNameToDef(name) {
396
429
  ],
397
430
  },
398
431
  needsTemplateParams: [],
432
+ inferEnabled: async (_fs, paths) => {
433
+ return (0, node_fs_1.existsSync)(paths.package('js/tsconfig.json'));
434
+ },
399
435
  };
400
436
  case 'bundlewatch':
401
437
  return {
@@ -408,6 +444,9 @@ function moduleNameToDef(name) {
408
444
  filesToReplace: ['js/.bundlewatch.config.json'],
409
445
  jsonToAugment: {},
410
446
  needsTemplateParams: [],
447
+ inferEnabled: async (_fs, paths) => {
448
+ return (0, node_fs_1.existsSync)(paths.package('js/.bundlewatch.config.json'));
449
+ },
411
450
  };
412
451
  case 'backendTesting':
413
452
  return {
@@ -439,6 +478,9 @@ function moduleNameToDef(name) {
439
478
  ],
440
479
  },
441
480
  needsTemplateParams: ['packageNamespaceEscapedSlash'],
481
+ inferEnabled: async (_fs, paths) => {
482
+ return (0, node_fs_1.existsSync)(paths.package('tests'));
483
+ },
442
484
  };
443
485
  case 'editorConfig':
444
486
  return {
@@ -475,9 +517,9 @@ function genExtScaffolder() {
475
517
  return cached;
476
518
  const moduleStatusCache = {
477
519
  get: async (module, fs, paths) => {
478
- var _a, _b, _c, _d;
520
+ var _a, _b, _c;
479
521
  const json = (0, composer_1.getComposerJson)(fs, paths);
480
- return !module.togglable || ((_d = (_c = (_b = (_a = json === null || json === void 0 ? void 0 : json.extra) === null || _a === void 0 ? void 0 : _a['flarum-cli']) === null || _b === void 0 ? void 0 : _b.modules) === null || _c === void 0 ? void 0 : _c[module.name]) !== null && _d !== void 0 ? _d : module.defaultEnabled);
522
+ return !module.togglable || ((_c = (_b = (_a = json === null || json === void 0 ? void 0 : json.extra) === null || _a === void 0 ? void 0 : _a['flarum-cli']) === null || _b === void 0 ? void 0 : _b.modules) === null || _c === void 0 ? void 0 : _c[module.name]);
481
523
  },
482
524
  set: async (module, enabled, fs, paths) => {
483
525
  const json = {
@@ -1 +1 @@
1
- {"version":"2.0.0-beta.10","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?"}]}}}
1
+ {"version":"2.0.0-beta.11","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?"}]}}}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@flarum/cli",
3
3
  "description": "A CLI for developing Flarum extensions",
4
- "version": "2.0.0-beta.10",
4
+ "version": "2.0.0-beta.11",
5
5
  "author": "Flarum Team",
6
6
  "bin": {
7
7
  "fl": "bin/run",