chore: remove app:diff command from cli

This commit is contained in:
Stefan Buck
2021-02-18 22:00:09 +01:00
parent cf9a229a3e
commit 6266ddd113
4 changed files with 5 additions and 101 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
The `yarn backstage-cli app:diff` has been broken since a couple of months. The command to perform updates `yarn backstage-cli versions:bump` prints change logs which seems to be a good replacement for this command.
-20
View File
@@ -24,7 +24,6 @@ Below is a cleaned up output of `yarn backstage-cli --help`.
```text
app:build Build an app for a production release
app:diff Diff an existing app with the creation template
app:serve Serve an app for local development
backend:build Build a backend plugin
@@ -112,25 +111,6 @@ Options:
-h, --help display help for command
```
## app:diff
Scope: `app`
Diff an existing app with the template used in `@backstage/create-app`. This
will verify that your app package has not diverged from the template, and can be
useful to run after updating the version of `@backstage/cli` in your app.
This command is experimental and may be removed in the future.
```text
Usage: backstage-cli app:diff
Options:
--check Fail if changes are required
--yes Apply all changes
-h, --help display help for command
```
## app:serve
Scope: `app`
-74
View File
@@ -1,74 +0,0 @@
/*
* Copyright 2020 Spotify AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Command } from 'commander';
import {
diffTemplateFiles,
handlers,
handleAllFiles,
inquirerPromptFunc,
makeCheckPromptFunc,
yesPromptFunc,
} from '../../lib/diff';
import { version } from '../../lib/version';
const fileHandlers = [
{
patterns: ['packages/app/package.json'],
handler: handlers.appPackageJson,
},
{
patterns: [/tsconfig\.json$/],
handler: handlers.exactMatch,
},
{
patterns: [
/README\.md$/,
/\.eslintrc\.js$/,
// make sure files in 1st level of src/ and dev/ exist
/^packages\/app\/(src|dev)\/[^/]+$/,
],
handler: handlers.exists,
},
{
patterns: [
'lerna.json',
/^src\//,
/^patches\//,
/^packages\/app\/public\//,
/^packages\/app\/cypress/,
// Let plugin:diff take care of the plugins
/^plugins/,
/package\.json$/,
],
handler: handlers.skip,
},
];
export default async (cmd: Command) => {
let promptFunc = inquirerPromptFunc;
let finalize = () => {};
if (cmd.check) {
[promptFunc, finalize] = makeCheckPromptFunc();
} else if (cmd.yes) {
promptFunc = yesPromptFunc;
}
const templateFiles = await diffTemplateFiles('default-app', { version });
await handleAllFiles(fileHandlers, templateFiles, promptFunc);
await finalize();
};
-7
View File
@@ -76,13 +76,6 @@ export function registerCommands(program: CommanderStatic) {
.option(...configOption)
.action(lazy(() => import('./backend/dev').then(m => m.default)));
program
.command('app:diff')
.option('--check', 'Fail if changes are required')
.option('--yes', 'Apply all changes')
.description('Diff an existing app with the creation template')
.action(lazy(() => import('./app/diff').then(m => m.default)));
program
.command('create-plugin')
.option(