Merge pull request #6697 from backstage/mob/bump-prettier-in-create-app

This commit is contained in:
Himanshu Mishra
2021-08-06 09:39:01 +02:00
committed by GitHub
41 changed files with 145 additions and 51 deletions
+25
View File
@@ -0,0 +1,25 @@
---
'@backstage/core-app-api': patch
'@backstage/core-components': patch
'@backstage/core-plugin-api': patch
'@backstage/dev-utils': patch
'@backstage/test-utils': patch
'@backstage/test-utils-core': patch
'@backstage/plugin-api-docs': patch
'@backstage/plugin-catalog': patch
'@backstage/plugin-catalog-import': patch
'@backstage/plugin-catalog-react': patch
'@backstage/plugin-cost-insights': patch
'@backstage/plugin-explore': patch
'@backstage/plugin-git-release-manager': patch
'@backstage/plugin-lighthouse': patch
'@backstage/plugin-pagerduty': patch
'@backstage/plugin-rollbar': patch
'@backstage/plugin-scaffolder': patch
'@backstage/plugin-search': patch
'@backstage/plugin-sentry': patch
'@backstage/plugin-tech-radar': patch
'@backstage/plugin-techdocs': patch
---
Switched `@types/react` dependency to request `*` rather than a specific version.
+34
View File
@@ -0,0 +1,34 @@
---
'@backstage/create-app': patch
---
Add a complete prettier setup to the created project. Prettier used to only be added as a dependency to create apps, but there wasn't a complete setup included that makes it easy to run prettier. That has now changed, and the new `prettier:check` command can be used to check the formatting of the files in your created project.
To apply this change to an existing app, a couple of changes need to be made.
Create a `.prettierignore` file at the root of your repository with the following contents:
```
dist
dist-types
coverage
.vscode
```
Next update the root `package.json` by bumping the prettier version and adding the new `prettier:check` command:
```diff
"scripts": {
...
+ "prettier:check": "prettier --check .",
...
},
...
"dependencies": {
...
- "prettier": "^1.19.1"
+ "prettier": "^2.3.2"
}
```
Finally run `yarn prettier --write .` on your project to update the existing formatting.
+12
View File
@@ -0,0 +1,12 @@
---
'@backstage/create-app': patch
---
Switched `@types/react-dom` dependency to of the app package to request `*` rather than a specific version.
To apply this change to an existing app, change the following in `packages/app/package.json`:
```diff
- "@types/react-dom": "^16.9.8",
+ "@types/react-dom": "*",
```
+7
View File
@@ -25,6 +25,13 @@ jobs:
name: Node ${{ matrix.node-version }} on ${{ matrix.os }}
steps:
# In order to have the create-app template function as if it was downloaded from NPM
# we need to make sure we checkout files with LF line endings only
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v2
- name: use node.js ${{ matrix.node-version }}
+1 -1
View File
@@ -68,7 +68,7 @@
"@types/jest": "^26.0.7",
"@types/jquery": "^3.3.34",
"@types/node": "^14.14.32",
"@types/react-dom": "^16.9.8",
"@types/react-dom": "*",
"@types/zen-observable": "^0.8.0",
"cross-env": "^7.0.0",
"cypress": "^7.3.0",
+1 -1
View File
@@ -35,7 +35,7 @@
"@backstage/theme": "^0.2.9",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@types/react": "^16.9",
"@types/react": "*",
"@types/prop-types": "^15.7.3",
"prop-types": "^15.7.2",
"react": "^16.12.0",
+1 -1
View File
@@ -39,7 +39,7 @@
"@testing-library/react-hooks": "^3.4.2",
"@types/dagre": "^0.7.44",
"@types/prop-types": "^15.7.3",
"@types/react": "^16.9",
"@types/react": "*",
"@types/react-sparklines": "^1.7.0",
"@types/react-text-truncate": "^0.14.0",
"classnames": "^2.2.6",
+1 -1
View File
@@ -32,7 +32,7 @@
"@backstage/config": "^0.1.6",
"@backstage/theme": "^0.2.9",
"@material-ui/core": "^4.12.2",
"@types/react": "^16.9",
"@types/react": "*",
"history": "^5.0.0",
"prop-types": "^15.7.2",
"react": "^16.12.0",
@@ -0,0 +1,4 @@
dist
dist-types
coverage
.vscode
@@ -7,4 +7,4 @@ To start the app, run:
```sh
yarn install
yarn dev
```
```
@@ -32,9 +32,9 @@ backend:
user: ${POSTGRES_USER}
password: ${POSTGRES_PASSWORD}
# https://node-postgres.com/features/ssl
#ssl: require # see https://www.postgresql.org/docs/current/libpq-ssl.html Table 33.1. SSL Mode Descriptions (e.g. require)
#ca: # if you have a CA file and want to verify it you can uncomment this section
# $file: <file-path>/ca/server.crt
# ssl: require # see https://www.postgresql.org/docs/current/libpq-ssl.html Table 33.1. SSL Mode Descriptions (e.g. require)
# ca: # if you have a CA file and want to verify it you can uncomment this section
# $file: <file-path>/ca/server.crt
{{/if}}
cache:
store: memory
@@ -5,8 +5,8 @@ metadata:
description: An example of a Backstage application.
# Example for optional annotations
# annotations:
# github.com/project-slug: backstage/backstage
# backstage.io/techdocs-ref: dir:.
# github.com/project-slug: backstage/backstage
# backstage.io/techdocs-ref: dir:.
spec:
type: website
owner: john@example.com
@@ -19,6 +19,7 @@
"test:all": "lerna run test -- --coverage",
"lint": "lerna run lint --since origin/master --",
"lint:all": "lerna run lint --",
"prettier:check": "prettier --check .",
"create-plugin": "backstage-cli create-plugin --scope internal --no-private",
"remove-plugin": "backstage-cli remove-plugin"
},
@@ -37,7 +38,7 @@
"@spotify/prettier-config": "^7.0.0",
"concurrently": "^6.0.0",
"lerna": "^4.0.0",
"prettier": "^1.19.1"
"prettier": "^2.3.2"
},
"prettier": "@spotify/prettier-config",
"lint-staged": {
@@ -38,7 +38,7 @@
"@testing-library/user-event": "^12.0.7",
"@types/jest": "^26.0.7",
"@types/node": "^14.14.32",
"@types/react-dom": "^16.9.8",
"@types/react-dom": "*",
"cross-env": "^7.0.0",
"cypress": "^7.3.0",
"eslint-plugin-cypress": "^2.10.3",
@@ -65,7 +65,7 @@
</script>
<% } %>
</head>
<body style="margin: 0;">
<body style="margin: 0">
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
@@ -6,11 +6,11 @@ import {
CatalogIndexPage,
catalogPlugin,
} from '@backstage/plugin-catalog';
import {CatalogImportPage, catalogImportPlugin} from '@backstage/plugin-catalog-import';
import {
ScaffolderPage,
scaffolderPlugin
} from '@backstage/plugin-scaffolder';
import {
CatalogImportPage,
catalogImportPlugin,
} from '@backstage/plugin-catalog-import';
import { ScaffolderPage, scaffolderPlugin } from '@backstage/plugin-scaffolder';
import { SearchPage } from '@backstage/plugin-search';
import { TechRadarPage } from '@backstage/plugin-tech-radar';
import { TechdocsPage } from '@backstage/plugin-techdocs';
@@ -1,7 +1,12 @@
import {
ScmIntegrationsApi, scmIntegrationsApiRef
ScmIntegrationsApi,
scmIntegrationsApiRef,
} from '@backstage/integration-react';
import { AnyApiFactory, configApiRef, createApiFactory } from '@backstage/core-plugin-api';
import {
AnyApiFactory,
configApiRef,
createApiFactory,
} from '@backstage/core-plugin-api';
export const apis: AnyApiFactory[] = [
createApiFactory({
@@ -91,7 +91,7 @@ const overviewContent = (
</Grid>
</EntitySwitch.Case>
</EntitySwitch>
<EntitySwitch>
<EntitySwitch.Case if={hasCatalogProcessingErrors}>
<Grid item xs={12}>
@@ -1,11 +1,13 @@
import {
CatalogBuilder,
createRouter
createRouter,
} from '@backstage/plugin-catalog-backend';
import { Router } from 'express';
import { PluginEnvironment } from '../types';
export default async function createPlugin(env: PluginEnvironment): Promise<Router> {
export default async function createPlugin(
env: PluginEnvironment,
): Promise<Router> {
const builder = await CatalogBuilder.create(env);
const {
entitiesCatalog,
@@ -3,9 +3,7 @@ import {
SingleHostDiscovery,
} from '@backstage/backend-common';
import { CatalogClient } from '@backstage/catalog-client';
import {
createRouter,
} from '@backstage/plugin-scaffolder-backend';
import { createRouter } from '@backstage/plugin-scaffolder-backend';
import Docker from 'dockerode';
import { Router } from 'express';
import type { PluginEnvironment } from '../types';
@@ -12,6 +12,6 @@ export type PluginEnvironment = {
database: PluginDatabaseManager;
cache: PluginCacheManager;
config: Config;
reader: UrlReader
reader: UrlReader;
discovery: PluginEndpointDiscovery;
};
+1 -1
View File
@@ -42,7 +42,7 @@
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
"@types/react": "^16.9",
"@types/react": "*",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-hot-loader": "^4.12.21",
+8 -1
View File
@@ -232,7 +232,14 @@ async function createApp(
print('Test app created');
for (const cmd of ['install', 'tsc', 'build', 'lint:all', 'test:all']) {
for (const cmd of [
'install',
'tsc:full',
'build',
'lint:all',
'prettier:check',
'test:all',
]) {
print(`Running 'yarn ${cmd}' in newly created app`);
await runPlain(['yarn', cmd], { cwd: appDir });
}
+1 -1
View File
@@ -31,7 +31,7 @@
"dependencies": {
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@types/react": "^16.9",
"@types/react": "*",
"react": "^16.12.0",
"react-dom": "^16.12.0"
},
+1 -1
View File
@@ -37,7 +37,7 @@
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
"@types/react": "^16.9",
"@types/react": "*",
"msw": "^0.29.0",
"react": "^16.12.0",
"react-dom": "^16.12.0",
+1 -1
View File
@@ -40,7 +40,7 @@
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"@types/react": "^16.9",
"@types/react": "*",
"graphiql": "^1.0.0-alpha.10",
"graphql": "^15.3.0",
"isomorphic-form-data": "^2.0.0",
+1 -1
View File
@@ -42,7 +42,7 @@
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"@octokit/rest": "^18.5.3",
"@types/react": "^16.9",
"@types/react": "*",
"git-url-parse": "~11.4.4",
"js-base64": "^3.6.0",
"react": "^16.13.1",
+1 -1
View File
@@ -37,7 +37,7 @@
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"@types/react": "^16.9",
"@types/react": "*",
"jwt-decode": "^3.1.0",
"lodash": "^4.17.15",
"qs": "^6.9.4",
+1 -1
View File
@@ -42,7 +42,7 @@
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"@types/react": "^16.9",
"@types/react": "*",
"classnames": "^2.2.6",
"git-url-parse": "~11.4.4",
"lodash": "^4.17.21",
+1 -1
View File
@@ -38,7 +38,7 @@
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"@material-ui/styles": "^4.9.6",
"@types/react": "^16.9",
"@types/react": "*",
"@types/recharts": "^1.8.14",
"classnames": "^2.2.6",
"history": "^5.0.0",
+1 -1
View File
@@ -39,7 +39,7 @@
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"@types/react": "^16.9",
"@types/react": "*",
"classnames": "^2.2.6",
"react": "^16.13.1",
"react-dom": "^16.13.1",
+1 -1
View File
@@ -28,7 +28,7 @@
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"@octokit/rest": "^18.5.3",
"@types/react": "^16.9",
"@types/react": "*",
"luxon": "^1.26.0",
"qs": "^6.10.1",
"react-dom": "^16.13.1",
+1 -1
View File
@@ -56,7 +56,7 @@
"@testing-library/user-event": "^13.1.8",
"@types/jest": "^26.0.7",
"@types/node": "^14.14.32",
"@types/react": "^16.9",
"@types/react": "*",
"cross-fetch": "^3.0.6",
"msw": "^0.29.0"
},
+1 -1
View File
@@ -38,7 +38,7 @@
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"@types/react": "^16.9",
"@types/react": "*",
"classnames": "^2.2.6",
"luxon": "1.25.0",
"react": "^16.13.1",
+1 -1
View File
@@ -58,7 +58,7 @@
"@testing-library/user-event": "^13.1.8",
"@types/jest": "^26.0.7",
"@types/node": "^14.14.32",
"@types/react": "^16.9",
"@types/react": "*",
"cross-fetch": "^3.0.6",
"msw": "^0.29.0"
},
+1 -1
View File
@@ -45,7 +45,7 @@
"@material-ui/lab": "4.0.0-alpha.45",
"@rjsf/core": "^3.0.0",
"@rjsf/material-ui": "^3.0.0",
"@types/react": "^16.9",
"@types/react": "*",
"classnames": "^2.2.6",
"git-url-parse": "~11.4.4",
"humanize-duration": "^3.25.1",
+1 -2
View File
@@ -40,7 +40,7 @@
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"@types/react": "^16.9",
"@types/react": "*",
"qs": "^6.9.4",
"react": "^16.13.1",
"react-dom": "^16.13.1",
@@ -59,7 +59,6 @@
"@testing-library/user-event": "^13.1.8",
"@types/jest": "^26.0.7",
"@types/node": "^14.14.32",
"@types/react": "^16.9",
"cross-fetch": "^3.0.6",
"msw": "^0.29.0"
},
+1 -1
View File
@@ -57,7 +57,7 @@
"@types/jest": "^26.0.7",
"@types/luxon": "^1.27.0",
"@types/node": "^14.14.32",
"@types/react": "^16.9",
"@types/react": "*",
"cross-fetch": "^3.0.6",
"msw": "^0.29.0"
},
+1 -1
View File
@@ -55,7 +55,7 @@
"@types/d3-force": "^2.1.1",
"@types/jest": "^26.0.7",
"@types/node": "^14.14.32",
"@types/react": "^16.9",
"@types/react": "*",
"cross-fetch": "^3.0.6",
"msw": "^0.29.0"
},
+1 -1
View File
@@ -68,7 +68,7 @@
"@types/eventsource": "^1.1.5",
"@types/jest": "^26.0.7",
"@types/node": "^14.14.32",
"@types/react": "^16.9",
"@types/react": "*",
"canvas": "^2.6.1",
"cross-fetch": "^3.0.6",
"msw": "^0.29.0"
+4 -4
View File
@@ -6558,10 +6558,10 @@
"@types/webpack" "^4"
"@types/webpack-dev-server" "*"
"@types/react-dom@^16.9.8":
version "16.9.8"
resolved "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.9.8.tgz#fe4c1e11dfc67155733dfa6aa65108b4971cb423"
integrity sha512-ykkPQ+5nFknnlU6lDd947WbQ6TE3NNzbQAkInC2EKY1qeYdTKp7onFusmYZb+ityzx2YviqT6BXSu+LyWWJwcA==
"@types/react-dom@*":
version "17.0.9"
resolved "https://registry.npmjs.org/@types/react-dom/-/react-dom-17.0.9.tgz#441a981da9d7be117042e1a6fd3dac4b30f55add"
integrity sha512-wIvGxLfgpVDSAMH5utdL9Ngm5Owu0VsGmldro3ORLXV8CShrL8awVj06NuEXFQ5xyaYfdca7Sgbk/50Ri1GdPg==
dependencies:
"@types/react" "*"