Merge remote-tracking branch 'upstream/master' into kaos/cli-config-schema
This commit is contained in:
@@ -1,5 +1,22 @@
|
||||
# @backstage/cli
|
||||
|
||||
## 0.6.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- e780e119c: Add missing `file-loader` dependency which could cause issues with loading images and other assets.
|
||||
- 6266ddd11: 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.
|
||||
- Updated dependencies [a1f5e6545]
|
||||
- @backstage/config@0.1.3
|
||||
|
||||
## 0.6.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 257a753ff: Updated transform of `.esm.js` files to be able to handle dynamic imports.
|
||||
- 9337f509d: Tweak error message in lockfile parsing to include more information.
|
||||
- 532bc0ec0: Upgrading to lerna@4.0.0.
|
||||
|
||||
## 0.6.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -83,10 +83,8 @@ async function getConfig() {
|
||||
},
|
||||
},
|
||||
|
||||
// We build .esm.js files with plugin:build, so to be able to load these in tests they need to be transformed
|
||||
// TODO: jest is working on module support, it's possible that we can remove this in the future
|
||||
transform: {
|
||||
'\\.esm\\.js$': require.resolve('jest-esm-transformer'),
|
||||
'\\.esm\\.js$': require.resolve('./jestEsmTransform.js'), // See jestEsmTransform.js
|
||||
'\\.(js|jsx|ts|tsx)$': require.resolve('ts-jest'),
|
||||
'\\.(bmp|gif|jpg|jpeg|png|frag|xml|svg)$': require.resolve(
|
||||
'./jestFileTransform.js',
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
const babel = require('@babel/core');
|
||||
|
||||
// We build .esm.js files with plugin:build, so to be able to load these in tests they need to be transformed
|
||||
// TODO: jest is working on module support, it's possible that we can remove this in the future
|
||||
module.exports = {
|
||||
process(src) {
|
||||
const result = babel.transform(src, {
|
||||
babelrc: false,
|
||||
compact: false,
|
||||
plugins: [
|
||||
// This transforms the regular ESM syntax, import and export statements
|
||||
require.resolve('@babel/plugin-transform-modules-commonjs'),
|
||||
// This transforms dynamic `import()`, which is not supported yet in the Node.js VM API
|
||||
require.resolve('babel-plugin-dynamic-import-node'),
|
||||
],
|
||||
});
|
||||
|
||||
return result.code;
|
||||
},
|
||||
};
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/cli",
|
||||
"description": "CLI for developing Backstage plugins and apps",
|
||||
"version": "0.6.0",
|
||||
"version": "0.6.2",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
@@ -28,8 +28,10 @@
|
||||
"backstage-cli": "bin/backstage-cli"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.4.4",
|
||||
"@babel/plugin-transform-modules-commonjs": "^7.4.4",
|
||||
"@backstage/cli-common": "^0.1.1",
|
||||
"@backstage/config": "^0.1.2",
|
||||
"@backstage/config": "^0.1.3",
|
||||
"@backstage/config-loader": "^0.5.1",
|
||||
"@hot-loader/react-dom": "^16.13.0",
|
||||
"@lerna/package-graph": "^4.0.0",
|
||||
@@ -53,6 +55,7 @@
|
||||
"@typescript-eslint/eslint-plugin": "^v4.14.0",
|
||||
"@typescript-eslint/parser": "^v4.14.0",
|
||||
"@yarnpkg/lockfile": "^1.1.0",
|
||||
"babel-plugin-dynamic-import-node": "^2.3.3",
|
||||
"bfj": "^7.0.2",
|
||||
"chalk": "^4.0.0",
|
||||
"chokidar": "^3.3.1",
|
||||
@@ -71,6 +74,7 @@
|
||||
"eslint-plugin-react": "^7.12.4",
|
||||
"eslint-plugin-react-hooks": "^4.0.0",
|
||||
"express": "^4.17.1",
|
||||
"file-loader": "^6.2.0",
|
||||
"fork-ts-checker-webpack-plugin": "^4.0.5",
|
||||
"fs-extra": "^9.0.0",
|
||||
"handlebars": "^4.7.3",
|
||||
@@ -78,7 +82,6 @@
|
||||
"inquirer": "^7.0.4",
|
||||
"jest": "^26.0.1",
|
||||
"jest-css-modules": "^2.1.0",
|
||||
"jest-esm-transformer": "^1.0.0",
|
||||
"lodash": "^4.17.19",
|
||||
"mini-css-extract-plugin": "^0.9.0",
|
||||
"ora": "^4.0.3",
|
||||
@@ -113,11 +116,11 @@
|
||||
"yn": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/backend-common": "^0.5.2",
|
||||
"@backstage/config": "^0.1.2",
|
||||
"@backstage/core": "^0.6.0",
|
||||
"@backstage/dev-utils": "^0.1.9",
|
||||
"@backstage/test-utils": "^0.1.6",
|
||||
"@backstage/backend-common": "^0.5.4",
|
||||
"@backstage/config": "^0.1.3",
|
||||
"@backstage/core": "^0.6.3",
|
||||
"@backstage/dev-utils": "^0.1.12",
|
||||
"@backstage/test-utils": "^0.1.8",
|
||||
"@backstage/theme": "^0.2.3",
|
||||
"@types/diff": "^4.0.2",
|
||||
"@types/express": "^4.17.6",
|
||||
|
||||
@@ -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();
|
||||
};
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user