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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -51,7 +51,7 @@ $ npm install -g @flarum/cli
51
51
  $ flarum-cli COMMAND
52
52
  running command...
53
53
  $ flarum-cli (-v|--version|version)
54
- @flarum/cli/2.0.0-beta.15 linux-x64 node-v16.14.0
54
+ @flarum/cli/2.0.0-beta.16 linux-x64 node-v16.14.2
55
55
  $ flarum-cli --help [COMMAND]
56
56
  USAGE
57
57
  $ flarum-cli COMMAND
@@ -1,19 +1,20 @@
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
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
9
9
 
10
- phpunit.xml export-ignore
11
- tests export-ignore
10
+ **/phpunit.xml export-ignore
11
+ **/tests export-ignore
12
12
 
13
- js/dist/* -diff
14
- js/dist/* linguist-generated
15
- js/dist-typings/* linguist-generated
16
- js/yarn.lock -diff
17
- js/package-lock.json -diff
13
+ **/js/dist/**/* -diff
14
+ **/js/dist/**/* linguist-generated
15
+ **/js/dist-typings/**/* -diff
16
+ **/js/dist-typings/**/* linguist-generated
17
+ **/js/yarn.lock -diff
18
+ **/js/package-lock.json -diff
18
19
 
19
20
  * text=auto eol=lf
@@ -22,13 +22,13 @@
22
22
  <% if (params.packageNamespace) { %>
23
23
  "autoload": {
24
24
  "psr-4": {
25
- "<%= params.packageNamespaceEscapedSlash %>\\": "src/"
25
+ "<%= params.packageNamespace %>\\": "src/"
26
26
  }
27
27
  },
28
28
  <% } %>
29
29
  "autoload-dev": {
30
30
  "psr-4": {
31
- "<%= params.packageNamespaceEscapedSlash %>\\Tests\\": "tests/"
31
+ "<%= params.packageNamespace %>\\Tests\\": "tests/"
32
32
  }
33
33
  },
34
34
  "extra": {
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@<%= params.packageName %>",
3
3
  "private": true,
4
+ "version": "0.0.0",
4
5
  "prettier": "@flarum/prettier-config",
5
6
  "dependencies": {
6
7
  },
@@ -21,7 +22,7 @@
21
22
  "format": "prettier --write src",
22
23
  "format-check": "prettier --check src",
23
24
  "clean-typings": "npx rimraf dist-typings && mkdir dist-typings",
24
- "build-typings": "<%= params.jsPackageManager %> run clean-typings && [ -e src/@types ] && cp -r src/@types dist-typings/@types && tsc && <%= params.jsPackageManager %> run post-build-typings",
25
+ "build-typings": "<%= params.jsPackageManager %> run clean-typings && ([ -e src/@types ] && cp -r src/@types dist-typings/@types || true) && tsc && <%= params.jsPackageManager %> run post-build-typings",
25
26
  "post-build-typings": "find dist-typings -type f -name '*.d.ts' -print0 | xargs -0 sed -i 's,../src/@types,@types,g'",
26
27
  "check-typings": "tsc --noEmit --emitDeclarationOnly false",
27
28
  "check-typings-coverage": "typescript-coverage-report"
@@ -4,13 +4,21 @@
4
4
  // This will match all .ts, .tsx, .d.ts, .js, .jsx files in your `src` folder
5
5
  // and also tells your Typescript server to read core's global typings for
6
6
  // access to `dayjs` and `$` in the global namespace.
7
- "include": ["src/**/*", "../vendor/flarum/core/js/dist-typings/@types/**/*", "@types/**/*"],
7
+ "include": [
8
+ "src/**/*",
9
+ "../vendor/*/*/js/dist-typings/@types/**/*",
10
+ // <CUSTOM-1>
11
+ // </CUSTOM-1>
12
+ "@types/**/*"
13
+ ],
8
14
  "compilerOptions": {
9
15
  // This will output typings to `dist-typings`
10
16
  "declarationDir": "./dist-typings",
11
17
  "baseUrl": ".",
12
18
  "paths": {
13
- "flarum/*": ["../vendor/flarum/core/js/dist-typings/*"]
19
+ "flarum/*": ["../vendor/flarum/core/js/dist-typings/*"],
20
+ // <CUSTOM-2>
21
+ // </CUSTOM-2>
14
22
  }
15
23
  }
16
24
  }
@@ -1,6 +1,6 @@
1
1
  <%= params.extensionId %>:
2
2
  # For more details on the format
3
- # Checkout https://docs.flarum.org/extend/i18n.html#appendix-a-standard-key-format
3
+ # Checkout https://docs.flarum.org/extend/i18n/#appendix-a-standard-key-format
4
4
  admin:
5
5
  my_cool_key: My Cool Key
6
6
 
@@ -92,6 +92,8 @@ excludeScaffolding = { files: [], configKeys: {} }, isInitial = false) {
92
92
  modules: modulesEnabled,
93
93
  };
94
94
  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}`));
95
+ // This is necessary because one layer of escaped backslashes is lost on template population.
96
+ tplData.params = Object.fromEntries(Object.entries(paramVals).map(([k, v]) => [k, typeof v === 'string' ? v.replace('\\', '\\\\') : v]));
95
97
  for (const file of module.filesToReplace) {
96
98
  const path = typeof file === 'string' ? file : file.path;
97
99
  const moduleDeps = typeof file === 'string' ? [] : (_a = file.moduleDeps) !== null && _a !== void 0 ? _a : [];
@@ -113,7 +115,11 @@ excludeScaffolding = { files: [], configKeys: {} }, isInitial = false) {
113
115
  })) {
114
116
  continue;
115
117
  }
116
- fsEditor.copyTpl((0, path_1.resolve)(scaffoldDir, path), copyTo, tplData);
118
+ let source = (0, read_tpl_1.readTpl)((0, path_1.resolve)(scaffoldDir, path), tplData);
119
+ if (fsEditor.exists(copyTo)) {
120
+ source = applyCustomizations(source, fsEditor.read(copyTo));
121
+ }
122
+ fsEditor.write(copyTo, source);
117
123
  }
118
124
  const jsonPaths = (0, clone_and_fill_1.cloneAndFill)(module.jsonToAugment, tplDataFlat);
119
125
  for (const jsonPath of Object.keys(jsonPaths)) {
@@ -127,3 +133,21 @@ excludeScaffolding = { files: [], configKeys: {} }, isInitial = false) {
127
133
  return fs;
128
134
  }
129
135
  exports.applyModule = applyModule;
136
+ function applyCustomizations(source, curr) {
137
+ const commentStructures = [
138
+ ['//', '\n'],
139
+ ['/*', ' */'],
140
+ ['<!--', '-->'],
141
+ ['#', '\n'],
142
+ ];
143
+ commentStructures.forEach((x) => x);
144
+ return commentStructures.reduce((acc, [start, end]) => {
145
+ const CUSTOMIZATION_REGEX = new RegExp(`(${start}\\s*<CUSTOM-(?<id>.*)>\\s*${end})(?<contents>.*)(${start}\\s*</CUSTOM-\\k<id>>\\s*${end})`, 'gs');
146
+ const matches = curr.matchAll(CUSTOMIZATION_REGEX);
147
+ const customizations = Object.fromEntries([...matches]
148
+ .map((m) => m.groups)
149
+ .filter(Boolean)
150
+ .map((g) => [g === null || g === void 0 ? void 0 : g.id, g === null || g === void 0 ? void 0 : g.contents]));
151
+ return acc.replace(CUSTOMIZATION_REGEX, (_m, open, id, _c, close) => { var _a; return `${open}${(_a = customizations[id]) !== null && _a !== void 0 ? _a : ''}${close}`; });
152
+ }, source);
153
+ }
@@ -4,7 +4,7 @@ import { FlarumProviders } from '../../providers';
4
4
  export default class Split extends BaseCommand {
5
5
  static description: string;
6
6
  static flags: {
7
- config: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
7
+ force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
8
  };
9
9
  static args: {
10
10
  name: string;
@@ -10,10 +10,10 @@ class Split extends base_command_1.default {
10
10
  this.requireExistingExtension = false;
11
11
  }
12
12
  steps(stepManager) {
13
- return stepManager.step(new split_1.MonorepoSplit());
13
+ return stepManager.step(new split_1.MonorepoSplit(this.flags.force));
14
14
  }
15
15
  }
16
16
  exports.default = Split;
17
17
  Split.description = 'Split monorepo changes into subrepos.';
18
- Split.flags = Object.assign({ config: core_1.Flags.string({ char: 'c', required: false }) }, base_command_1.default.flags);
18
+ Split.flags = Object.assign({ force: core_1.Flags.boolean({ char: 'f', required: false }) }, base_command_1.default.flags);
19
19
  Split.args = [...base_command_1.default.args];
@@ -1,5 +1,5 @@
1
1
  import { Scaffolder } from 'boilersmith/scaffolding/scaffolder';
2
- export declare const EXTENSION_PARAMS: readonly ["packageName", "packageDescription", "packageNamespace", "authorName", "authorEmail", "extensionName", "licenseType", "mainGitBranch", "jsPackageManager", "licenseText", "packageNamespaceEscapedSlash", "extensionId", "year", "backendDirectory", "frontendDirectory"];
2
+ export declare const EXTENSION_PARAMS: readonly ["packageName", "packageDescription", "packageNamespace", "authorName", "authorEmail", "extensionName", "licenseType", "mainGitBranch", "jsPackageManager", "licenseText", "extensionId", "year", "backendDirectory", "frontendDirectory"];
3
3
  export declare type ExtensionParams = typeof EXTENSION_PARAMS[number];
4
4
  export declare const EXTENSION_MODULES: readonly ["core", "icon", "admin", "forum", "js", "jsCommon", "css", "locale", "gitConf", "githubActions", "prettier", "typescript", "bundlewatch", "backendTesting", "editorConfig", "styleci"];
5
5
  export declare type ExtensionModules = typeof EXTENSION_MODULES[number];
@@ -25,7 +25,6 @@ exports.EXTENSION_PARAMS = [
25
25
  'mainGitBranch',
26
26
  'jsPackageManager',
27
27
  'licenseText',
28
- 'packageNamespaceEscapedSlash',
29
28
  'extensionId',
30
29
  'year',
31
30
  'backendDirectory',
@@ -147,12 +146,6 @@ function paramNamesToDef(name) {
147
146
  uses: ['licenseType'],
148
147
  compute: async (_paths, licenseType) => (licenseType ? require(`spdx-license-list/licenses/${licenseType}`).licenseText : ''),
149
148
  };
150
- case 'packageNamespaceEscapedSlash':
151
- return {
152
- name,
153
- uses: ['packageNamespace'],
154
- compute: async (_paths, packageNamespace) => packageNamespace.replace('\\', '\\\\'),
155
- };
156
149
  case 'extensionId':
157
150
  return {
158
151
  name,
@@ -182,11 +175,11 @@ function paramNamesToDef(name) {
182
175
  try {
183
176
  const remotes = (0, child_process_1.execSync)('git remote', { cwd, timeout: 2000 }).toString().split('\n');
184
177
  if (remotes.includes('origin')) {
185
- return (0, child_process_1.execSync)("git remote show origin | grep 'HEAD branch' | cut -d' ' -f5", { cwd }).toString();
178
+ return (0, child_process_1.execSync)("git remote show origin | grep 'HEAD branch' | cut -d' ' -f5", { cwd, timeout: 2000 }).toString();
186
179
  }
187
180
  }
188
181
  catch (_c) { }
189
- return (_b = (await (0, simple_git_1.default)(cwd).getConfig('init.defaultBranch')).value) !== null && _b !== void 0 ? _b : 'main';
182
+ return (_b = (await (0, simple_git_1.default)(cwd, { timeout: { block: 2000 } }).getConfig('init.defaultBranch')).value) !== null && _b !== void 0 ? _b : 'main';
190
183
  },
191
184
  };
192
185
  case 'jsPackageManager':
@@ -262,7 +255,7 @@ function moduleNameToDef(name) {
262
255
  'license',
263
256
  'require.flarum/core',
264
257
  'authors',
265
- 'autoload.psr-4.${params.packageNamespaceEscapedSlash}\\',
258
+ 'autoload.psr-4.${params.packageNamespace}\\',
266
259
  'extra.flarum-extension.title',
267
260
  'extra.flarum-extension.category',
268
261
  'minimum-stability',
@@ -272,7 +265,7 @@ function moduleNameToDef(name) {
272
265
  needsTemplateParams: [
273
266
  'packageName',
274
267
  'packageNamespace',
275
- 'packageNamespaceEscapedSlash',
268
+ 'packageNamespace',
276
269
  'packageDescription',
277
270
  'extensionName',
278
271
  'licenseType',
@@ -365,6 +358,7 @@ function moduleNameToDef(name) {
365
358
  'js/package.json': [
366
359
  'name',
367
360
  'private',
361
+ 'version',
368
362
  'devDependencies.flarum-webpack-config',
369
363
  'devDependencies.webpack',
370
364
  'devDependencies.webpack-cli',
@@ -448,7 +442,7 @@ function moduleNameToDef(name) {
448
442
  filesToReplace: [
449
443
  { path: 'gitignore', destPath: '.gitignore' },
450
444
  { path: 'js/gitignore', moduleDeps: ['js'], destPath: 'js/.gitignore' },
451
- '.gitattributes',
445
+ { path: '.gitattributes', monorepoPath: '.gitattributes' },
452
446
  ],
453
447
  jsonToAugment: {},
454
448
  needsTemplateParams: [],
@@ -562,7 +556,7 @@ function moduleNameToDef(name) {
562
556
  ],
563
557
  jsonToAugment: {
564
558
  'composer.json': [
565
- 'autoload-dev.psr-4.${params.packageNamespaceEscapedSlash}\\Tests\\',
559
+ 'autoload-dev.psr-4.${params.packageNamespace}\\Tests\\',
566
560
  'scripts.test',
567
561
  'scripts.test:unit',
568
562
  'scripts.test:integration',
@@ -574,7 +568,7 @@ function moduleNameToDef(name) {
574
568
  'require-dev.flarum/testing',
575
569
  ],
576
570
  },
577
- needsTemplateParams: ['packageNamespaceEscapedSlash'],
571
+ needsTemplateParams: ['packageNamespace'],
578
572
  inferEnabled: async (_fs, paths) => {
579
573
  return (0, fs_1.existsSync)(paths.package('tests'));
580
574
  },
@@ -7,6 +7,8 @@ export declare class MonorepoSplit implements Step<FlarumProviders> {
7
7
  type: string;
8
8
  composable: boolean;
9
9
  exposes: never[];
10
+ force?: boolean;
11
+ constructor(force: boolean);
10
12
  run(fs: Store, paths: Paths, io: IO, _providers: FlarumProviders): Promise<Store>;
11
13
  getExposed(): Record<string, unknown>;
12
14
  }
@@ -9,25 +9,41 @@ const monorepo_1 = require("../../utils/monorepo");
9
9
  async function addRemote(cwd, name, remote) {
10
10
  try {
11
11
  await (0, simple_git_1.default)(cwd).addRemote(name, remote);
12
+ await (0, simple_git_1.default)(cwd).fetch(name);
12
13
  }
13
14
  catch (_a) {
14
15
  // ignore, remote already exists.
15
16
  }
16
17
  }
17
- async function splitAndPush(cwd, splitExecPath, splitPath, remoteName, remoteBranch) {
18
+ async function splitAndPush(cwd, splitExecPath, splitPath, remoteName, remoteBranch, force = false) {
19
+ const currBranch = (0, child_process_1.execSync)('git rev-parse --abbrev-ref HEAD', { cwd }).toString().trim();
18
20
  const sha1 = (0, child_process_1.execSync)(`${splitExecPath} --prefix=${splitPath}`, { cwd, stdio: ['pipe', 'pipe', 'ignore'] })
19
21
  .toString()
20
22
  .trim();
21
- (0, child_process_1.execSync)(`git push ${remoteName} "${sha1}:refs/heads/${remoteBranch || 'main'}"`, { cwd });
23
+ const branch = remoteBranch || 'main';
24
+ const pushArgs = `${remoteName} "${sha1}:refs/heads/${branch}"`;
25
+ if (force) {
26
+ (0, child_process_1.execSync)(`git push --force ${pushArgs}`, { cwd });
27
+ }
28
+ else {
29
+ const tmpBranch = `${remoteName}-tmp`;
30
+ (0, child_process_1.execSync)(`git switch -c ${tmpBranch} ${sha1}`, { cwd });
31
+ (0, child_process_1.execSync)(`git pull ${remoteName} ${branch} --rebase`, { cwd });
32
+ (0, child_process_1.execSync)(`git push ${pushArgs}`, { cwd });
33
+ (0, child_process_1.execSync)(`git switch ${currBranch}`, { cwd });
34
+ }
22
35
  }
23
- async function removeRemote(cwd, name) {
36
+ async function cleanupBranchAndRemote(cwd, name) {
24
37
  await (0, simple_git_1.default)(cwd).removeRemote(name);
38
+ const tmpBranch = `${name}-tmp`;
39
+ (0, child_process_1.execSync)(`git branch -D ${tmpBranch}`, { cwd });
25
40
  }
26
41
  class MonorepoSplit {
27
- constructor() {
42
+ constructor(force) {
28
43
  this.type = 'Split monorepo changes to the respective cloned repos.';
29
44
  this.composable = false;
30
45
  this.exposes = [];
46
+ this.force = force;
31
47
  }
32
48
  async run(fs, paths, io, _providers) {
33
49
  var _a, _b, _c, _d;
@@ -36,35 +52,39 @@ class MonorepoSplit {
36
52
  io.error(`Your platform, "${platform}", is not supported. Split can only be run on linux and mac`, true);
37
53
  return fs;
38
54
  }
55
+ if (this.force && !(await io.getParam({ type: 'confirm', name: 'confirm', initial: false, message: 'Are you sure you want to force split?' }))) {
56
+ io.error('Decided not to force push', true);
57
+ return fs;
58
+ }
39
59
  const splitExec = (0, path_1.resolve)(__dirname, `../../../bin/splitsh-lite-${platform}`);
40
60
  const target = (_a = paths.requestedDir()) !== null && _a !== void 0 ? _a : paths.package();
41
61
  await (0, simple_git_1.default)(target).pull();
42
62
  const conf = (0, monorepo_1.getMonorepoConf)(fs, paths);
43
63
  const corePkg = conf.packages.core;
64
+ const clean = [];
44
65
  // Add Remotes
45
66
  for (const lib of (_b = conf.packages.npm) !== null && _b !== void 0 ? _b : []) {
46
67
  await addRemote(target, lib.name, lib.gitRemote);
47
- await splitAndPush(target, splitExec, (0, monorepo_1.npmPath)(lib.name), lib.name, lib.mainBranch).finally(() => {
48
- return removeRemote(target, lib.name);
49
- });
68
+ await splitAndPush(target, splitExec, (0, monorepo_1.npmPath)(lib.name), lib.name, lib.mainBranch, this.force);
69
+ clean.push(lib.name);
50
70
  }
51
71
  for (const lib of (_c = conf.packages.composer) !== null && _c !== void 0 ? _c : []) {
52
72
  await addRemote(target, lib.name, lib.gitRemote);
53
- await splitAndPush(target, splitExec, (0, monorepo_1.composerPath)(lib.name), lib.name, lib.mainBranch).finally(() => {
54
- return removeRemote(target, lib.name);
55
- });
73
+ await splitAndPush(target, splitExec, (0, monorepo_1.composerPath)(lib.name), lib.name, lib.mainBranch, this.force);
74
+ clean.push(lib.name);
56
75
  }
57
76
  for (const ext of (_d = conf.packages.extensions) !== null && _d !== void 0 ? _d : []) {
58
77
  await addRemote(target, ext.name, ext.gitRemote);
59
- await splitAndPush(target, splitExec, (0, monorepo_1.extensionPath)(ext.name), ext.name, ext.mainBranch).finally(() => {
60
- return removeRemote(target, ext.name);
61
- });
78
+ await splitAndPush(target, splitExec, (0, monorepo_1.extensionPath)(ext.name), ext.name, ext.mainBranch, this.force);
79
+ clean.push(ext.name);
62
80
  }
63
81
  if (corePkg) {
64
82
  await addRemote(target, corePkg.name, corePkg.gitRemote);
65
- await splitAndPush(target, splitExec, (0, monorepo_1.corePath)(corePkg.name), corePkg.name, corePkg.mainBranch).finally(() => {
66
- return removeRemote(target, corePkg.name);
67
- });
83
+ await splitAndPush(target, splitExec, (0, monorepo_1.corePath)(corePkg.name), corePkg.name, corePkg.mainBranch, this.force);
84
+ clean.push(corePkg.name);
85
+ }
86
+ for (const name of clean) {
87
+ await cleanupBranchAndRemote(target, name);
68
88
  }
69
89
  return fs;
70
90
  }
@@ -1 +1 @@
1
- {"version":"2.0.0-beta.15","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","admin","forum","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?"}]},"monorepo:create":{"id":"monorepo:create","description":"Create a monorepo of Flarum extensions.","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"config":{"name":"config","type":"option","char":"c","required":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?"}]},"monorepo:split":{"id":"monorepo:split","description":"Split monorepo changes into subrepos.","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"config":{"name":"config","type":"option","char":"c","required":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.16","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","admin","forum","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?"}]},"monorepo:create":{"id":"monorepo:create","description":"Create a monorepo of Flarum extensions.","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"config":{"name":"config","type":"option","char":"c","required":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?"}]},"monorepo:split":{"id":"monorepo:split","description":"Split monorepo changes into subrepos.","pluginName":"@flarum/cli","pluginType":"core","aliases":[],"flags":{"force":{"name":"force","type":"boolean","char":"f","required":false,"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.15",
4
+ "version": "2.0.0-beta.16",
5
5
  "author": "Flarum Team",
6
6
  "bin": {
7
7
  "fl": "bin/run",