@flarum/cli 2.0.0-beta.1 → 2.0.0-beta.5
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/.github/workflows/backend.yml +1 -1
- package/boilerplate/skeleton/extension/.github/workflows/frontend.yml +1 -1
- package/boilerplate/skeleton/extension/gitignore +12 -0
- 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/boilersmith/scaffolding/audit-step-factory.js +5 -0
- package/lib/boilersmith/scaffolding/infra-step-factory.js +1 -1
- package/lib/boilersmith/scaffolding/module.d.ts +6 -1
- package/lib/boilersmith/scaffolding/module.js +1 -1
- package/lib/steps/gen-ext-scaffolder.js +5 -3
- package/lib/steps/js/base.js +3 -2
- package/lib/steps/update/js-imports.js +4 -3
- package/oclif.manifest.json +1 -1
- package/package.json +4 -7
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.5 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": {
|
|
@@ -43,6 +43,11 @@ function auditStepFactory(dry, scaffoldDir, modules, templateParams, excludeScaf
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
+
for (const m of modules) {
|
|
47
|
+
if (moduleStatusCache && m.updatable && (actionableModules.includes(m) || m.togglable)) {
|
|
48
|
+
(0, module_1.setModuleValue)(m, actionableModules.includes(m), _fs, paths, moduleStatusCache);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
46
51
|
return _fs;
|
|
47
52
|
},
|
|
48
53
|
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
|
}
|
|
@@ -6,12 +6,17 @@ interface FileOwnership {
|
|
|
6
6
|
* The path to the file
|
|
7
7
|
*/
|
|
8
8
|
path: string;
|
|
9
|
+
/**
|
|
10
|
+
* Where the file should go. Defaults to path.
|
|
11
|
+
*/
|
|
12
|
+
destPath?: string;
|
|
9
13
|
/**
|
|
10
14
|
* If any of the needed modules aren't enabled, the file won't be updated.
|
|
11
15
|
*/
|
|
12
16
|
needsOtherModules?: string[];
|
|
13
17
|
/**
|
|
14
|
-
* If in a monorepo, should the file be placed relative to the monorepo root?
|
|
18
|
+
* If in a monorepo, should the file be placed relative to the monorepo root, and if so, where?
|
|
19
|
+
* If provided, takes priority over destPath.
|
|
15
20
|
*/
|
|
16
21
|
monorepoPath?: string;
|
|
17
22
|
}
|
|
@@ -94,7 +94,7 @@ async function applyModule(module, modulesEnabled, paramVals, scaffoldDir, fs, p
|
|
|
94
94
|
const needsOtherModules = typeof file === 'string' ? [] : (_a = file.needsOtherModules) !== null && _a !== void 0 ? _a : [];
|
|
95
95
|
if (!excludeFiles.includes(path) && !needsOtherModules.some(dep => !modulesEnabled[dep])) {
|
|
96
96
|
const copyToIfMonorepo = typeof file !== 'string' && file.monorepoPath ? paths.monorepo((0, clone_and_fill_1.cloneAndFill)(file.monorepoPath, tplDataFlat)) : undefined;
|
|
97
|
-
const copyTo = copyToIfMonorepo !== null && copyToIfMonorepo !== void 0 ? copyToIfMonorepo : paths.package(path);
|
|
97
|
+
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
98
|
fsEditor.copyTpl((0, node_path_1.resolve)(scaffoldDir, path), copyTo, tplData);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
@@ -119,6 +119,8 @@ function paramNamesToDef(name) {
|
|
|
119
119
|
getCurrVal: async (fs, paths) => {
|
|
120
120
|
var _a, _b, _c;
|
|
121
121
|
const json = (0, composer_1.getComposerJson)(fs, paths);
|
|
122
|
+
if (json.name === 'flarum/core')
|
|
123
|
+
return 'Core';
|
|
122
124
|
return (_c = (_b = (_a = json === null || json === void 0 ? void 0 : json.extra) === null || _a === void 0 ? void 0 : _a['flarum-extension']) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '';
|
|
123
125
|
},
|
|
124
126
|
};
|
|
@@ -340,7 +342,7 @@ function moduleNameToDef(name) {
|
|
|
340
342
|
shortDescription: 'Git Configuration',
|
|
341
343
|
longDescription: 'Git config files (e.g. .gitignore, .gitattributes).',
|
|
342
344
|
dependsOn: [],
|
|
343
|
-
filesToReplace: ['.gitignore', '.gitattributes'],
|
|
345
|
+
filesToReplace: [{ path: 'gitignore', destPath: '.gitignore' }, { path: 'js/gitignore', needsOtherModules: ['js'], destPath: 'js/.gitignore' }, '.gitattributes'],
|
|
344
346
|
jsonToAugment: {},
|
|
345
347
|
needsTemplateParams: [],
|
|
346
348
|
};
|
|
@@ -358,7 +360,7 @@ function moduleNameToDef(name) {
|
|
|
358
360
|
{ path: '.github/workflows/backend.yml', monorepoPath: '.github/workflows/${params.extensionId}-backend.yml' },
|
|
359
361
|
],
|
|
360
362
|
jsonToAugment: {},
|
|
361
|
-
needsTemplateParams: ['frontendDirectory', 'backendDirectory', 'mainGitBranch', 'extensionId'],
|
|
363
|
+
needsTemplateParams: ['frontendDirectory', 'backendDirectory', 'mainGitBranch', 'extensionId', 'extensionName'],
|
|
362
364
|
};
|
|
363
365
|
case 'prettier':
|
|
364
366
|
return {
|
|
@@ -403,7 +405,7 @@ function moduleNameToDef(name) {
|
|
|
403
405
|
defaultEnabled: false,
|
|
404
406
|
shortDescription: 'Enable Bundlewatch Checks',
|
|
405
407
|
dependsOn: ['js'],
|
|
406
|
-
filesToReplace: [],
|
|
408
|
+
filesToReplace: ['js/.bundlewatch.config.json'],
|
|
407
409
|
jsonToAugment: {},
|
|
408
410
|
needsTemplateParams: [],
|
|
409
411
|
};
|
package/lib/steps/js/base.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BaseJsStep = void 0;
|
|
4
|
-
const
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const globby_1 = (0, tslib_1.__importDefault)(require("globby"));
|
|
5
6
|
const mem_fs_editor_1 = require("mem-fs-editor");
|
|
6
7
|
const IMPORTS_REGEX = /((^import\s+(?:([\s\w*,{}]+)\s+from)?\s*["']?([\s\w./@\\-]+)\3?["']?\s*;?\s*)*)(.*)/m;
|
|
7
8
|
const INIT_REGEX = /^(app\.initializers\.add\('[^']+',\s*\(\)\s*=>\s*{)$/m;
|
|
@@ -18,7 +19,7 @@ class BaseJsStep {
|
|
|
18
19
|
frontends = ['admin', 'forum'];
|
|
19
20
|
}
|
|
20
21
|
for (const frontend of frontends) {
|
|
21
|
-
const fsSrcFilePaths =
|
|
22
|
+
const fsSrcFilePaths = globby_1.default.sync(paths.package(`js/src/${frontend}/*.{js,jsx,ts,tsx}`));
|
|
22
23
|
fsSrcFilePaths.forEach(async (match) => {
|
|
23
24
|
/**
|
|
24
25
|
* @TODO look into using https://esprima.org/ instead
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UpdateJSImports = void 0;
|
|
4
|
-
const
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const globby_1 = (0, tslib_1.__importDefault)(require("globby"));
|
|
5
6
|
const mem_fs_editor_1 = require("mem-fs-editor");
|
|
6
7
|
const CORE_JS_NAMESPACES = ['admin', 'common', 'forum'];
|
|
7
8
|
const CORE_NAMESPACE_REGEX = new RegExp(`^(${CORE_JS_NAMESPACES.join('|')})/`);
|
|
@@ -18,7 +19,7 @@ class UpdateJSImports {
|
|
|
18
19
|
const jsSrcDir = paths.package('vendor/flarum/core/js/src');
|
|
19
20
|
const vendorRegex = new RegExp(`${jsSrcDir}/.*(js|jsx|ts|tsx)`);
|
|
20
21
|
const fsVendorFilePaths = fs.all().map(file => file.path).filter(path => path && vendorRegex.test(path));
|
|
21
|
-
const persistedVendorFilePaths =
|
|
22
|
+
const persistedVendorFilePaths = globby_1.default.sync(`${jsSrcDir}/**/*.{js,jsx,ts,tsx}`);
|
|
22
23
|
for (const currPath of [...fsVendorFilePaths, ...persistedVendorFilePaths]) {
|
|
23
24
|
const withNamespace = currPath.slice(jsSrcDir.length + 1).replace(/\.(js|jsx|ts|tsx)$/, '');
|
|
24
25
|
const noNamespace = withNamespace.replace(CORE_NAMESPACE_REGEX, '');
|
|
@@ -26,7 +27,7 @@ class UpdateJSImports {
|
|
|
26
27
|
}
|
|
27
28
|
const srcRegex = new RegExp(`${paths.package('js/src')}/.*(js|jsx|ts|tsx)`);
|
|
28
29
|
const fsSrcFilePaths = fs.all().map(file => file.path).filter(path => path && srcRegex.test(path));
|
|
29
|
-
const persistedSrcFilePaths =
|
|
30
|
+
const persistedSrcFilePaths = globby_1.default.sync(paths.package('js/src/**/*.{js,jsx,ts,tsx}'));
|
|
30
31
|
for (const match of [...fsSrcFilePaths, ...persistedSrcFilePaths]) {
|
|
31
32
|
let fileCounted = false;
|
|
32
33
|
const currContents = fsEditor.read(match);
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"2.0.0-beta.1","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.5","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?"}]}}}
|
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.
|
|
4
|
+
"version": "2.0.0-beta.5",
|
|
5
5
|
"author": "Flarum Team",
|
|
6
6
|
"bin": {
|
|
7
7
|
"fl": "bin/run",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
},
|
|
10
10
|
"bugs": "https://github.com/flarum/cli/issues",
|
|
11
11
|
"devDependencies": {
|
|
12
|
-
"@babel/core": "^7",
|
|
12
|
+
"@babel/core": "^7.0.0",
|
|
13
|
+
"@babel/preset-env": "^7.14.2",
|
|
13
14
|
"@oclif/dev-cli": "^1.26.0",
|
|
14
15
|
"@oclif/test": "^1.2.8",
|
|
15
16
|
"@types/chai": "^4.2.20",
|
|
@@ -32,7 +33,6 @@
|
|
|
32
33
|
"eslint-import-resolver-babel-module": "^5.3.1",
|
|
33
34
|
"eslint-import-resolver-typescript": "^2.5.0",
|
|
34
35
|
"eslint-plugin-import": "^2.25.3",
|
|
35
|
-
"globby": "^10.0.2",
|
|
36
36
|
"jest": "^27.4.5",
|
|
37
37
|
"jest-extended": "^1.2.0",
|
|
38
38
|
"ts-jest": "^27.1.2",
|
|
@@ -101,7 +101,6 @@
|
|
|
101
101
|
},
|
|
102
102
|
"types": "lib/index.d.ts",
|
|
103
103
|
"dependencies": {
|
|
104
|
-
"@babel/preset-env": "^7.14.2",
|
|
105
104
|
"@oclif/core": "^1.0.11",
|
|
106
105
|
"@oclif/errors": "^1.3.5",
|
|
107
106
|
"@oclif/plugin-help": "^5",
|
|
@@ -110,11 +109,9 @@
|
|
|
110
109
|
"chalk": "^2.4.2",
|
|
111
110
|
"cli-ux": "^6.0.6",
|
|
112
111
|
"ejs": "^3.1.6",
|
|
113
|
-
"
|
|
114
|
-
"just-safe-get": "^2.1.2",
|
|
112
|
+
"globby": "^10.0.2",
|
|
115
113
|
"mem-fs": "^2.2.1",
|
|
116
114
|
"mem-fs-editor": "^8.0.0",
|
|
117
|
-
"modern-async": "^1.0.2",
|
|
118
115
|
"module-alias": "^2.2.2",
|
|
119
116
|
"pick-deep": "^1.0.0",
|
|
120
117
|
"pluralize": "^8.0.0",
|