From c1e2a8dcc530b20ef65f90cc26857a0a20632dba Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 14 Jul 2020 21:16:00 +0200 Subject: [PATCH 01/73] docs(adr): Created an ADR for MSW --- ...adr007-use-msw-to-mock-service-requests.md | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 docs/architecture-decisions/adr007-use-msw-to-mock-service-requests.md diff --git a/docs/architecture-decisions/adr007-use-msw-to-mock-service-requests.md b/docs/architecture-decisions/adr007-use-msw-to-mock-service-requests.md new file mode 100644 index 0000000000..bdb221cea3 --- /dev/null +++ b/docs/architecture-decisions/adr007-use-msw-to-mock-service-requests.md @@ -0,0 +1,60 @@ +# ADR007: Use MSW to mock http requests + +## Context + +Network request mocking can be a total pain sometimes, in all different types of +tests, unit tests to e2e tests always have their own implementation of mocking +these requests. There's been traction in the outer community towards using this +library to mock network requests by using an express style declaration for +routes. react-testing-library suggests using this library instead of mocking +fetch directly wether this be in a browser or in node. + +https://github.com/mswjs/msw + +## Decision + +Moving forward, we have decided that any `fetch` or `XMLHTTPRequest` that +happens, should be mocked by using `msw`. + +Here is an example: + +```ts +import { setupWorker, rest } from 'msw'; + +const worker = setupWorker( + rest.get('*/user/:userId', (req, res, ctx) => { + return res( + ctx.json({ + firstName: 'John', + lastName: 'Maverick', + }), + ); + }), +); + +// Start the Mock Service Worker +worker.start(); +``` + +and in a more real life scenario, taken from +[CatalogClient.test.ts](https://github.com/spotify/backstage/blob/f3245c4f8f0b6b2625c4a6d5d50161b612fb4757/plugins/catalog/src/api/CatalogClient.test.ts) + +```ts +beforeEach(() => { + server.use( + rest.get(`${mockApiOrigin}${mockBasePath}/entities`, (_, res, ctx) => { + return res(ctx.json(defaultResponse)); + }), + ); +}); + +it('should entities from correct endpoint', async () => { + const entities = await client.getEntities(); + expect(entities).toEqual(defaultResponse); +}); +``` + +## Consequences + +- A little more code to write +- Gradually will replace the codebase with `msw` From 191aa0262f4255aecab058589be9371de6a26047 Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 15 Jul 2020 10:02:49 +0200 Subject: [PATCH 02/73] chore(docs): add to doc structure --- mkdocs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/mkdocs.yml b/mkdocs.yml index 46367873e2..5d688edb52 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -85,6 +85,7 @@ nav: - ADR004 - Module Export Structure: 'architecture-decisions/adr004-module-export-structure.md' - ADR005 - Catalog Core Entities: 'architecture-decisions/adr005-catalog-core-entities.md' - ADR006 - Avoid React.FC and React.SFC: 'architecture-decisions/adr006-avoid-react-fc.md' + - ADR007 - Use MSW for Network Request Mocking: 'architecture-decisions/adr007-use-msw-to-mock-service-requests.md' - Contribute: '../CONTRIBUTING.md' - Support: 'overview/support.md' - FAQ: FAQ.md From 2e605f91729b3260bd4f59eda7a3fcb5640f2e68 Mon Sep 17 00:00:00 2001 From: Oliver Sand Date: Thu, 23 Jul 2020 10:49:40 +0200 Subject: [PATCH 03/73] feat: add UrlReaderProcessor to consume entities from a simple URL --- plugins/catalog-backend/package.json | 1 + .../src/ingestion/LocationReaders.ts | 2 + .../processors/UrlReaderProcessor.test.ts | 80 +++++++++++++++++++ .../processors/UrlReaderProcessor.ts | 55 +++++++++++++ plugins/catalog-backend/src/setupTests.ts | 2 - yarn.lock | 2 +- 6 files changed, 139 insertions(+), 3 deletions(-) create mode 100644 plugins/catalog-backend/src/ingestion/processors/UrlReaderProcessor.test.ts create mode 100644 plugins/catalog-backend/src/ingestion/processors/UrlReaderProcessor.ts diff --git a/plugins/catalog-backend/package.json b/plugins/catalog-backend/package.json index 9c7a18087d..b342cae3db 100644 --- a/plugins/catalog-backend/package.json +++ b/plugins/catalog-backend/package.json @@ -46,6 +46,7 @@ "@types/uuid": "^8.0.0", "@types/yup": "^0.28.2", "jest-fetch-mock": "^3.0.3", + "msw": "^0.19.5", "supertest": "^4.0.2" }, "files": [ diff --git a/plugins/catalog-backend/src/ingestion/LocationReaders.ts b/plugins/catalog-backend/src/ingestion/LocationReaders.ts index 8ec575d6ec..2aa41f6c50 100644 --- a/plugins/catalog-backend/src/ingestion/LocationReaders.ts +++ b/plugins/catalog-backend/src/ingestion/LocationReaders.ts @@ -28,6 +28,7 @@ import { FileReaderProcessor } from './processors/FileReaderProcessor'; import { GithubReaderProcessor } from './processors/GithubReaderProcessor'; import { GithubApiReaderProcessor } from './processors/GithubApiReaderProcessor'; import { GitlabReaderProcessor } from './processors/GitlabReaderProcessor'; +import { UrlReaderProcessor } from './processors/UrlReaderProcessor'; import { LocationRefProcessor } from './processors/LocationEntityProcessor'; import * as result from './processors/results'; import { @@ -60,6 +61,7 @@ export class LocationReaders implements LocationReader { new GithubReaderProcessor(), new GithubApiReaderProcessor(), new GitlabReaderProcessor(), + new UrlReaderProcessor(), new YamlProcessor(), new EntityPolicyProcessor(entityPolicy), new LocationRefProcessor(), diff --git a/plugins/catalog-backend/src/ingestion/processors/UrlReaderProcessor.test.ts b/plugins/catalog-backend/src/ingestion/processors/UrlReaderProcessor.test.ts new file mode 100644 index 0000000000..e30b320bf4 --- /dev/null +++ b/plugins/catalog-backend/src/ingestion/processors/UrlReaderProcessor.test.ts @@ -0,0 +1,80 @@ +/* + * 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 { UrlReaderProcessor } from './UrlReaderProcessor'; +import { + LocationProcessorDataResult, + LocationProcessorResult, + LocationProcessorErrorResult, +} from './types'; +import { setupServer } from 'msw/node'; +import { rest } from 'msw'; + +describe('UrlReaderProcessor', () => { + const mockApiOrigin = 'http://localhost:23000'; + const server = setupServer(); + + beforeAll(() => server.listen()); + afterEach(() => server.resetHandlers()); + afterAll(() => server.close()); + + it('should load from url', async () => { + const processor = new UrlReaderProcessor(); + const spec = { + type: 'url', + target: `${mockApiOrigin}/component.yaml`, + }; + + server.use( + rest.get(`${mockApiOrigin}/component.yaml`, (_, res, ctx) => + res(ctx.body('Hello')), + ), + ); + + const generated = (await new Promise(emit => + processor.readLocation(spec, false, emit), + )) as LocationProcessorDataResult; + + expect(generated.type).toBe('data'); + expect(generated.location).toBe(spec); + expect(generated.data.toString('utf8')).toBe('Hello'); + }); + + it('should fail load from url with error', async () => { + const processor = new UrlReaderProcessor(); + const spec = { + type: 'url', + target: `${mockApiOrigin}/component-notfound.yaml`, + }; + + server.use( + rest.get(`${mockApiOrigin}/component-notfound.yaml`, (_, res, ctx) => { + return res(ctx.status(404)); + }), + ); + + const generated = (await new Promise(emit => + processor.readLocation(spec, false, emit), + )) as LocationProcessorErrorResult; + + expect(generated.type).toBe('error'); + expect(generated.location).toBe(spec); + expect(generated.error.name).toBe('NotFoundError'); + expect(generated.error.message).toBe( + `${mockApiOrigin}/component-notfound.yaml could not be read, 404 Not Found`, + ); + }); +}); diff --git a/plugins/catalog-backend/src/ingestion/processors/UrlReaderProcessor.ts b/plugins/catalog-backend/src/ingestion/processors/UrlReaderProcessor.ts new file mode 100644 index 0000000000..0c879ea70c --- /dev/null +++ b/plugins/catalog-backend/src/ingestion/processors/UrlReaderProcessor.ts @@ -0,0 +1,55 @@ +/* + * 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 { LocationSpec } from '@backstage/catalog-model'; +import fetch from 'node-fetch'; +import * as result from './results'; +import { LocationProcessor, LocationProcessorEmit } from './types'; + +export class UrlReaderProcessor implements LocationProcessor { + async readLocation( + location: LocationSpec, + optional: boolean, + emit: LocationProcessorEmit, + ): Promise { + if (location.type !== 'url') { + return false; + } + + try { + const response = await fetch(location.target); + + if (response.ok) { + const data = await response.buffer(); + emit(result.data(location, data)); + } else { + const message = `${location.target} could not be read, ${response.status} ${response.statusText}`; + if (response.status === 404) { + if (!optional) { + emit(result.notFoundError(location, message)); + } + } else { + emit(result.generalError(location, message)); + } + } + } catch (e) { + const message = `Unable to read ${location.type} ${location.target}, ${e}`; + emit(result.generalError(location, message)); + } + + return true; + } +} diff --git a/plugins/catalog-backend/src/setupTests.ts b/plugins/catalog-backend/src/setupTests.ts index f7b6ca962d..ba33cf996b 100644 --- a/plugins/catalog-backend/src/setupTests.ts +++ b/plugins/catalog-backend/src/setupTests.ts @@ -14,6 +14,4 @@ * limitations under the License. */ -require('jest-fetch-mock').enableMocks(); - export {}; diff --git a/yarn.lock b/yarn.lock index 6c0ff99388..ae7f5feabf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13127,7 +13127,7 @@ ms@^2.0.0, ms@^2.1.1: resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -msw@^0.19.0: +msw@^0.19.0, msw@^0.19.5: version "0.19.5" resolved "https://registry.npmjs.org/msw/-/msw-0.19.5.tgz#7d2a1a852ccf1644d3db6735d69fff6777aac33f" integrity sha512-J5eQ++gDVZoHPC8gVXtWcakLjgmPipvFj/sEnlRV/WViXuiq2CamSqO3Wbh6H8bAmj+k2vUWCfcVT1HjMdKB2Q== From 2893daf3b4b2aa5cb92e73610105d509c9381499 Mon Sep 17 00:00:00 2001 From: Ivan Shmidt Date: Thu, 23 Jul 2020 20:51:57 +0200 Subject: [PATCH 04/73] feat(cli): create-app creates backend as well with PG support --- .../cli/src/commands/create-app/createApp.ts | 11 +- .../cli/templates/default-app/app-config.yaml | 16 +++ .../default-app/packages/backend/.eslintrc.js | 3 + .../default-app/packages/backend/Dockerfile | 9 ++ .../default-app/packages/backend/README.md | 70 ++++++++++++ .../packages/backend/package.json.hbs | 51 +++++++++ .../packages/backend/src/index.test.ts | 24 ++++ .../packages/backend/src/index.ts.hbs | 105 ++++++++++++++++++ .../packages/backend/src/plugins/auth.ts | 26 +++++ .../packages/backend/src/plugins/catalog.ts | 56 ++++++++++ .../packages/backend/src/plugins/identity.ts | 22 ++++ .../packages/backend/src/plugins/proxy.ts | 25 +++++ .../backend/src/plugins/scaffolder.ts | 56 ++++++++++ .../packages/backend/src/plugins/techdocs.ts | 22 ++++ .../default-app/packages/backend/src/types.ts | 25 +++++ .../cli/templates/default-app/tsconfig.json | 12 +- 16 files changed, 529 insertions(+), 4 deletions(-) create mode 100644 packages/cli/templates/default-app/packages/backend/.eslintrc.js create mode 100644 packages/cli/templates/default-app/packages/backend/Dockerfile create mode 100644 packages/cli/templates/default-app/packages/backend/README.md create mode 100644 packages/cli/templates/default-app/packages/backend/package.json.hbs create mode 100644 packages/cli/templates/default-app/packages/backend/src/index.test.ts create mode 100644 packages/cli/templates/default-app/packages/backend/src/index.ts.hbs create mode 100644 packages/cli/templates/default-app/packages/backend/src/plugins/auth.ts create mode 100644 packages/cli/templates/default-app/packages/backend/src/plugins/catalog.ts create mode 100644 packages/cli/templates/default-app/packages/backend/src/plugins/identity.ts create mode 100644 packages/cli/templates/default-app/packages/backend/src/plugins/proxy.ts create mode 100644 packages/cli/templates/default-app/packages/backend/src/plugins/scaffolder.ts create mode 100644 packages/cli/templates/default-app/packages/backend/src/plugins/techdocs.ts create mode 100644 packages/cli/templates/default-app/packages/backend/src/types.ts diff --git a/packages/cli/src/commands/create-app/createApp.ts b/packages/cli/src/commands/create-app/createApp.ts index 4f4134957d..d0fc5e4450 100644 --- a/packages/cli/src/commands/create-app/createApp.ts +++ b/packages/cli/src/commands/create-app/createApp.ts @@ -18,7 +18,7 @@ import fs from 'fs-extra'; import { promisify } from 'util'; import chalk from 'chalk'; import { Command } from 'commander'; -import inquirer, { Answers, Question } from 'inquirer'; +import inquirer, { Answers, Question, ChoiceBase, ui } from 'inquirer'; import { exec as execCb } from 'child_process'; import { resolve as resolvePath } from 'path'; import os from 'os'; @@ -104,8 +104,17 @@ export default async (cmd: Command): Promise => { return true; }, }, + { + type: 'list', + name: 'dbType', + message: chalk.blue('Select database for the backend [required]'), + // @ts-ignore + choices: ['PostgreSQL', 'SQLite'], + }, ]; const answers: Answers = await inquirer.prompt(questions); + answers['dbTypePG'] = answers.dbType === 'PostgreSQL'; + answers['dbTypeSqlite'] = answers.dbType === 'SQLite'; const templateDir = paths.resolveOwn('templates/default-app'); const tempDir = resolvePath(os.tmpdir(), answers.name); diff --git a/packages/cli/templates/default-app/app-config.yaml b/packages/cli/templates/default-app/app-config.yaml index 58f7b795ff..0d51cf88ef 100644 --- a/packages/cli/templates/default-app/app-config.yaml +++ b/packages/cli/templates/default-app/app-config.yaml @@ -4,3 +4,19 @@ app: organization: name: Acme Corporation + +backend: + baseUrl: http://localhost:7000 + listen: 0.0.0.0:7000 + cors: + origin: http://localhost:3000 + methods: [GET, POST, PUT, DELETE] + credentials: true + +proxy: + '/test': + target: 'https://example.com' + changeOrigin: true + +techdocs: + storageUrl: https://techdocs-mock-sites.storage.googleapis.com diff --git a/packages/cli/templates/default-app/packages/backend/.eslintrc.js b/packages/cli/templates/default-app/packages/backend/.eslintrc.js new file mode 100644 index 0000000000..16a033dbc6 --- /dev/null +++ b/packages/cli/templates/default-app/packages/backend/.eslintrc.js @@ -0,0 +1,3 @@ +module.exports = { + extends: [require.resolve('@backstage/cli/config/eslint.backend')], +}; diff --git a/packages/cli/templates/default-app/packages/backend/Dockerfile b/packages/cli/templates/default-app/packages/backend/Dockerfile new file mode 100644 index 0000000000..3e8ba36cec --- /dev/null +++ b/packages/cli/templates/default-app/packages/backend/Dockerfile @@ -0,0 +1,9 @@ +FROM node:12 + +WORKDIR /usr/src/app + +COPY . . + +RUN yarn install --frozen-lockfile --production + +CMD ["node", "packages/backend"] diff --git a/packages/cli/templates/default-app/packages/backend/README.md b/packages/cli/templates/default-app/packages/backend/README.md new file mode 100644 index 0000000000..90c70912f0 --- /dev/null +++ b/packages/cli/templates/default-app/packages/backend/README.md @@ -0,0 +1,70 @@ +# example-backend + +This package is an EXAMPLE of a Backstage backend. + +The main purpose of this package is to provide a test bed for Backstage plugins +that have a backend part. Feel free to experiment locally or within your fork +by adding dependencies and routes to this backend, to try things out. + +Our goal is to eventually amend the create-app flow of the CLI, such that a +production ready version of a backend skeleton is made alongside the frontend +app. Until then, feel free to experiment here! + +## Development + +To run the example backend, first go to the project root and run + +```bash +yarn install +yarn tsc +yarn build +``` + +You should only need to do this once. + +After that, go to the `packages/backend` directory and run + +```bash +AUTH_GOOGLE_CLIENT_ID=x AUTH_GOOGLE_CLIENT_SECRET=x \ +AUTH_GITHUB_CLIENT_ID=x AUTH_GITHUB_CLIENT_SECRET=x \ +AUTH_OAUTH2_CLIENT_ID=x AUTH_OAUTH2_CLIENT_SECRET=x \ +AUTH_OAUTH2_AUTH_URL=x AUTH_OAUTH2_TOKEN_URL=x \ +ROLLBAR_ACCOUNT_TOKEN=x \ +SENTRY_TOKEN=x \ +LOG_LEVEL=debug \ +yarn start +``` + +Substitute `x` for actual values, or leave them as +dummy values just to try out the backend without using the auth or sentry features. + +The backend starts up on port 7000 per default. + +## Populating The Catalog + +If you want to use the catalog functionality, you need to add so called locations +to the backend. These are places where the backend can find some entity descriptor +data to consume and serve. + +To get started, you can issue the following after starting the backend, from inside +the `plugins/catalog-backend` directory: + +```bash +yarn mock-data +``` + +You should then start seeing data on `localhost:7000/catalog/entities`. + +The catalog currently runs in-memory only, so feel free to try it out, but it will +need to be re-populated on next startup. + +## Authentication + +We chose [Passport](http://www.passportjs.org/) as authentication platform due to its comprehensive set of supported authentication [strategies](http://www.passportjs.org/packages/). + +Read more about the [auth-backend](https://github.com/spotify/backstage/blob/master/plugins/auth-backend/README.md) and [how to add a new provider](https://github.com/spotify/backstage/blob/master/docs/auth/add-auth-provider.md) + +## Documentation + +- [Backstage Readme](https://github.com/spotify/backstage/blob/master/README.md) +- [Backstage Documentation](https://github.com/spotify/backstage/blob/master/docs/README.md) diff --git a/packages/cli/templates/default-app/packages/backend/package.json.hbs b/packages/cli/templates/default-app/packages/backend/package.json.hbs new file mode 100644 index 0000000000..93c076a967 --- /dev/null +++ b/packages/cli/templates/default-app/packages/backend/package.json.hbs @@ -0,0 +1,51 @@ +{ + "name": "backend", + "version": "0.0.0", + "main": "dist/index.cjs.js", + "types": "src/index.ts", + "private": true, + "engines": { + "node": "12" + }, + "scripts": { + "build": "backstage-cli backend:build", + "build-image": "backstage-cli backend:build-image example-backend", + "start": "backstage-cli backend:dev", + "lint": "backstage-cli lint", + "test": "backstage-cli test", + "clean": "backstage-cli clean", + "migrate:create": "knex migrate:make -x ts" + }, + "dependencies": { + "@backstage/backend-common": "^{{version}}", + "@backstage/catalog-model": "^{{version}}", + "@backstage/config": "^0.1.1-alpha.13", + "@backstage/config-loader": "^0.1.1-alpha.13", + "@backstage/plugin-auth-backend": "^{{version}}", + "@backstage/plugin-catalog-backend": "^{{version}}", + "@backstage/plugin-identity-backend": "^{{version}}", + "@backstage/plugin-proxy-backend": "^{{version}}", + "@backstage/plugin-rollbar-backend": "^{{version}}", + "@backstage/plugin-scaffolder-backend": "^{{version}}", + "@backstage/plugin-sentry-backend": "^{{version}}", + "@backstage/plugin-techdocs-backend": "^{{version}}", + "@octokit/rest": "^18.0.0", + "dockerode": "^3.2.0", + "express": "^4.17.1", + "knex": "^0.21.1", + {{#if dbTypePG}} + "pg": "^8.3.0", + {{/if}} + {{#if dbTypeSqlite}} + "sqlite3": "^4.2.0", + {{/if}} + "winston": "^3.2.1" + }, + "devDependencies": { + "@backstage/cli": "^0.1.1-alpha.15", + "@types/dockerode": "^2.5.32", + "@types/express": "^4.17.6", + "@types/express-serve-static-core": "^4.17.5", + "@types/helmet": "^0.0.47" + } +} diff --git a/packages/cli/templates/default-app/packages/backend/src/index.test.ts b/packages/cli/templates/default-app/packages/backend/src/index.test.ts new file mode 100644 index 0000000000..d18873c1f0 --- /dev/null +++ b/packages/cli/templates/default-app/packages/backend/src/index.test.ts @@ -0,0 +1,24 @@ +/* + * 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 { PluginEnvironment } from './types'; + +describe('test', () => { + it('unbreaks the test runner', () => { + const unbreaker = {} as PluginEnvironment; + expect(unbreaker).toBeTruthy(); + }); +}); diff --git a/packages/cli/templates/default-app/packages/backend/src/index.ts.hbs b/packages/cli/templates/default-app/packages/backend/src/index.ts.hbs new file mode 100644 index 0000000000..d1cf3d1ada --- /dev/null +++ b/packages/cli/templates/default-app/packages/backend/src/index.ts.hbs @@ -0,0 +1,105 @@ +/* + * 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. + */ + +/* + * Hi! + * + * Note that this is an EXAMPLE Backstage backend. Please check the README. + * + * Happy hacking! + */ + +import { + createServiceBuilder, + getRootLogger, + useHotMemoize, +} from '@backstage/backend-common'; +import { ConfigReader, AppConfig } from '@backstage/config'; +import { loadConfig } from '@backstage/config-loader'; +import knex from 'knex'; +import auth from './plugins/auth'; +import catalog from './plugins/catalog'; +import identity from './plugins/identity'; +import scaffolder from './plugins/scaffolder'; +import proxy from './plugins/proxy'; +import techdocs from './plugins/techdocs'; +import { PluginEnvironment } from './types'; + +function makeCreateEnv(loadedConfigs: AppConfig[]) { + const config = ConfigReader.fromConfigs(loadedConfigs); + + return (plugin: string): PluginEnvironment => { + const logger = getRootLogger().child({ type: 'plugin', plugin }); + + {{#if dbTypePG}} + const knexConfig = { + client: 'pg', + useNullAsDefault: true, + connection: { + host: process.env.PG_HOST, + user: process.env.PG_USER, + password: process.env.PG_PASSWORD, + database: `backstage_plugin_${plugin}`, + }, + }; + {{/if}} + {{#if dbTypeSqlite}} + const knexConfig = { + client: 'sqlite3', + connection: ':memory:', + useNullAsDefault: true, + }; + {{/if}} + const database = knex(knexConfig); + database.client.pool.on('createSuccess', (_eventId: any, resource: any) => { + resource.run('PRAGMA foreign_keys = ON', () => {}); + }); + return { logger, database, config }; + }; +} + +async function main() { + const configs = await loadConfig(); + const configReader = ConfigReader.fromConfigs(configs); + const createEnv = makeCreateEnv(configs); + + const catalogEnv = useHotMemoize(module, () => createEnv('catalog')); + const scaffolderEnv = useHotMemoize(module, () => createEnv('scaffolder')); + const authEnv = useHotMemoize(module, () => createEnv('auth')); + const identityEnv = useHotMemoize(module, () => createEnv('identity')); + const proxyEnv = useHotMemoize(module, () => createEnv('proxy')); + const techdocsEnv = useHotMemoize(module, () => createEnv('techdocs')); + + const service = createServiceBuilder(module) + .loadConfig(configReader) + .addRouter('/catalog', await catalog(catalogEnv)) + .addRouter('/scaffolder', await scaffolder(scaffolderEnv)) + .addRouter('/auth', await auth(authEnv)) + .addRouter('/identity', await identity(identityEnv)) + .addRouter('/techdocs', await techdocs(techdocsEnv)) + .addRouter('/proxy', await proxy(proxyEnv)); + + await service.start().catch(err => { + console.log(err); + process.exit(1); + }); +} + +module.hot?.accept(); +main().catch(error => { + console.error(`Backend failed to start up, ${error}`); + process.exit(1); +}); diff --git a/packages/cli/templates/default-app/packages/backend/src/plugins/auth.ts b/packages/cli/templates/default-app/packages/backend/src/plugins/auth.ts new file mode 100644 index 0000000000..b24dd6ca6b --- /dev/null +++ b/packages/cli/templates/default-app/packages/backend/src/plugins/auth.ts @@ -0,0 +1,26 @@ +/* + * 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 { createRouter } from '@backstage/plugin-auth-backend'; +import { PluginEnvironment } from '../types'; + +export default async function createPlugin({ + logger, + database, + config, +}: PluginEnvironment) { + return await createRouter({ logger, config, database }); +} diff --git a/packages/cli/templates/default-app/packages/backend/src/plugins/catalog.ts b/packages/cli/templates/default-app/packages/backend/src/plugins/catalog.ts new file mode 100644 index 0000000000..41e4226001 --- /dev/null +++ b/packages/cli/templates/default-app/packages/backend/src/plugins/catalog.ts @@ -0,0 +1,56 @@ +/* + * 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 { + createRouter, + DatabaseEntitiesCatalog, + DatabaseLocationsCatalog, + DatabaseManager, + HigherOrderOperations, + LocationReaders, + runPeriodically, +} from '@backstage/plugin-catalog-backend'; +import { PluginEnvironment } from '../types'; +import { useHotCleanup } from '@backstage/backend-common'; + +export default async function createPlugin({ + logger, + database, +}: PluginEnvironment) { + const locationReader = new LocationReaders(logger); + + const db = await DatabaseManager.createDatabase(database, { logger }); + const entitiesCatalog = new DatabaseEntitiesCatalog(db); + const locationsCatalog = new DatabaseLocationsCatalog(db); + const higherOrderOperation = new HigherOrderOperations( + entitiesCatalog, + locationsCatalog, + locationReader, + logger, + ); + + useHotCleanup( + module, + runPeriodically(() => higherOrderOperation.refreshAllLocations(), 10000), + ); + + return await createRouter({ + entitiesCatalog, + locationsCatalog, + higherOrderOperation, + logger, + }); +} diff --git a/packages/cli/templates/default-app/packages/backend/src/plugins/identity.ts b/packages/cli/templates/default-app/packages/backend/src/plugins/identity.ts new file mode 100644 index 0000000000..63a326965c --- /dev/null +++ b/packages/cli/templates/default-app/packages/backend/src/plugins/identity.ts @@ -0,0 +1,22 @@ +/* + * 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 { createRouter } from '@backstage/plugin-identity-backend'; +import { PluginEnvironment } from '../types'; + +export default async function createPlugin({ logger }: PluginEnvironment) { + return await createRouter({ logger }); +} diff --git a/packages/cli/templates/default-app/packages/backend/src/plugins/proxy.ts b/packages/cli/templates/default-app/packages/backend/src/plugins/proxy.ts new file mode 100644 index 0000000000..4964de130e --- /dev/null +++ b/packages/cli/templates/default-app/packages/backend/src/plugins/proxy.ts @@ -0,0 +1,25 @@ +/* + * 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. + */ +// @ts-ignore +import { createRouter } from '@backstage/plugin-proxy-backend'; +import { PluginEnvironment } from '../types'; + +export default async function createPlugin({ + logger, + config, +}: PluginEnvironment) { + return await createRouter({ logger, config }); +} diff --git a/packages/cli/templates/default-app/packages/backend/src/plugins/scaffolder.ts b/packages/cli/templates/default-app/packages/backend/src/plugins/scaffolder.ts new file mode 100644 index 0000000000..a9e5f185ec --- /dev/null +++ b/packages/cli/templates/default-app/packages/backend/src/plugins/scaffolder.ts @@ -0,0 +1,56 @@ +/* + * 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 { + CookieCutter, + createRouter, + FilePreparer, + GithubPreparer, + Preparers, + GithubPublisher, + CreateReactAppTemplater, + Templaters, +} from '@backstage/plugin-scaffolder-backend'; +import { Octokit } from '@octokit/rest'; +import type { PluginEnvironment } from '../types'; +import Docker from 'dockerode'; + +export default async function createPlugin({ logger }: PluginEnvironment) { + const cookiecutterTemplater = new CookieCutter(); + const craTemplater = new CreateReactAppTemplater(); + const templaters = new Templaters(); + templaters.register('cookiecutter', cookiecutterTemplater); + templaters.register('cra', craTemplater); + + const filePreparer = new FilePreparer(); + const githubPreparer = new GithubPreparer(); + const preparers = new Preparers(); + + preparers.register('file', filePreparer); + preparers.register('github', githubPreparer); + + const githubClient = new Octokit({ auth: process.env.GITHUB_ACCESS_TOKEN }); + const publisher = new GithubPublisher({ client: githubClient }); + + const dockerClient = new Docker(); + return await createRouter({ + preparers, + templaters, + publisher, + logger, + dockerClient, + }); +} diff --git a/packages/cli/templates/default-app/packages/backend/src/plugins/techdocs.ts b/packages/cli/templates/default-app/packages/backend/src/plugins/techdocs.ts new file mode 100644 index 0000000000..0d03bfabab --- /dev/null +++ b/packages/cli/templates/default-app/packages/backend/src/plugins/techdocs.ts @@ -0,0 +1,22 @@ +/* + * 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 { createRouter } from '@backstage/plugin-techdocs-backend'; +import { PluginEnvironment } from '../types'; + +export default async function createPlugin({ logger }: PluginEnvironment) { + return await createRouter({ logger }); +} diff --git a/packages/cli/templates/default-app/packages/backend/src/types.ts b/packages/cli/templates/default-app/packages/backend/src/types.ts new file mode 100644 index 0000000000..f7df3d05c6 --- /dev/null +++ b/packages/cli/templates/default-app/packages/backend/src/types.ts @@ -0,0 +1,25 @@ +/* + * 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 Knex from 'knex'; +import { Logger } from 'winston'; +import { Config } from '@backstage/config'; + +export type PluginEnvironment = { + logger: Logger; + database: Knex; + config: Config; +}; diff --git a/packages/cli/templates/default-app/tsconfig.json b/packages/cli/templates/default-app/tsconfig.json index 52cdd1e825..9dbc3bbe27 100644 --- a/packages/cli/templates/default-app/tsconfig.json +++ b/packages/cli/templates/default-app/tsconfig.json @@ -1,8 +1,14 @@ { "extends": "@backstage/cli/config/tsconfig.json", - "include": ["packages/*/src", "plugins/*/src", "plugins/*/dev"], - "exclude": ["**/node_modules"], + "include": [ + "packages/*/src", + "plugins/*/src", + "plugins/*/dev", + "plugins/*/migrations" + ], + "exclude": ["node_modules"], "compilerOptions": { - "outDir": "dist" + "outDir": "dist", + "skipLibCheck": true } } From 189e1bf547693b2160ad5b1191660392a2677618 Mon Sep 17 00:00:00 2001 From: Ivan Shmidt Date: Thu, 23 Jul 2020 22:11:25 +0200 Subject: [PATCH 05/73] feat(backend): add support for PG --- packages/backend/package.json | 1 + packages/backend/src/index.ts | 34 +++++++++++++++++++++++++++++----- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/packages/backend/package.json b/packages/backend/package.json index 86d348d2a1..b040c12554 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -34,6 +34,7 @@ "dockerode": "^3.2.0", "express": "^4.17.1", "knex": "^0.21.1", + "pg": "^8.3.0", "sqlite3": "^4.2.0", "winston": "^3.2.1" }, diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index d060791f98..8b9edec327 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -45,11 +45,35 @@ function makeCreateEnv(loadedConfigs: AppConfig[]) { return (plugin: string): PluginEnvironment => { const logger = getRootLogger().child({ type: 'plugin', plugin }); - const database = knex({ - client: 'sqlite3', - connection: ':memory:', - useNullAsDefault: true, - }); + // Supported DBs are sqlite and postgres + const isPg = [ + 'POSTGRES_USER', + 'POSTGRES_HOST', + 'POSTGRES_PASSWORD', + ].every(key => Object.keys(process.env).includes(key)); + + let knexConfig; + + if (isPg) { + knexConfig = { + client: 'pg', + useNullAsDefault: true, + connection: { + host: process.env.PG_HOST, + user: process.env.PG_USER, + password: process.env.PG_PASSWORD, + database: `backstage_plugin_${plugin}`, + }, + }; + } else { + knexConfig = { + client: 'sqlite3', + connection: ':memory:', + useNullAsDefault: true, + }; + } + + const database = knex(knexConfig); database.client.pool.on('createSuccess', (_eventId: any, resource: any) => { resource.run('PRAGMA foreign_keys = ON', () => {}); }); From 5f025442dc05eb4d5f285f3bdb2b98b3d57ac75c Mon Sep 17 00:00:00 2001 From: Ivan Shmidt Date: Thu, 23 Jul 2020 22:12:53 +0200 Subject: [PATCH 06/73] feat(cli): add e2e test for backend --- .github/workflows/cli.yml | 17 ++ packages/cli/e2e-test/cli-e2e-test.js | 98 ++++++- packages/cli/e2e-test/helpers.js | 6 + packages/cli/package.json | 2 + .../cli/src/commands/create-app/createApp.ts | 6 +- .../cli/templates/default-app/.eslintrc.js | 2 +- .../packages/backend/src/index.ts.hbs | 11 +- yarn.lock | 270 +++++++++++++++++- 8 files changed, 399 insertions(+), 13 deletions(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 7704aa36cd..13b84a555f 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -13,6 +13,18 @@ jobs: build: runs-on: ${{ matrix.os }} + services: + postgres: + image: postgres:10.8 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: postgres + ports: + - 5432/tcp + # needed because the postgres container does not provide a healthcheck + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + strategy: matrix: os: [ubuntu-latest] @@ -44,6 +56,11 @@ jobs: - run: yarn tsc - run: yarn build - name: verify app and plugin creation + env: + POSTGRES_HOST: localhost + POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }} + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres run: | sudo sysctl fs.inotify.max_user_watches=524288 node ${{ github.workspace }}/packages/cli/e2e-test/cli-e2e-test.js diff --git a/packages/cli/e2e-test/cli-e2e-test.js b/packages/cli/e2e-test/cli-e2e-test.js index ef5d6ab243..37c1904b6d 100644 --- a/packages/cli/e2e-test/cli-e2e-test.js +++ b/packages/cli/e2e-test/cli-e2e-test.js @@ -16,6 +16,7 @@ const os = require('os'); const fs = require('fs-extra'); +const fetch = require('node-fetch'); const killTree = require('tree-kill'); const { resolve: resolvePath, join: joinPath } = require('path'); const Browser = require('zombie'); @@ -28,6 +29,7 @@ const { waitForExit, print, } = require('./helpers'); +const pgtools = require('pgtools'); async function main() { const rootDir = await fs.mkdtemp(resolvePath(os.tmpdir(), 'backstage-e2e-')); @@ -36,8 +38,9 @@ async function main() { print('Building dist workspace'); const workspaceDir = await buildDistWorkspace('workspace', rootDir); + const isPostgres = Boolean(process.env.POSTGRES_USER); print('Creating a Backstage App'); - const appDir = await createApp('test-app', workspaceDir, rootDir); + const appDir = await createApp('test-app', isPostgres, workspaceDir, rootDir); print('Creating a Backstage Plugin'); const pluginName = await createPlugin('test-plugin', appDir); @@ -45,6 +48,9 @@ async function main() { print('Starting the app'); await testAppServe(pluginName, appDir); + print('Testing the backend startup'); + await testBackendStart(appDir, isPostgres); + print('All tests successful, removing test dir'); await fs.remove(rootDir); } @@ -97,7 +103,7 @@ async function pinYarnVersion(dir) { /** * Creates a new app inside rootDir called test-app, using packages from the workspaceDir */ -async function createApp(appName, workspaceDir, rootDir) { +async function createApp(appName, isPostgres, workspaceDir, rootDir) { const child = spawnPiped( [ 'node', @@ -119,6 +125,14 @@ async function createApp(appName, workspaceDir, rootDir) { await waitFor(() => stdout.includes('Enter a name for the app')); child.stdin.write(`${appName}\n`); + await waitFor(() => stdout.includes('Select database for the backend')); + + if (!isPostgres) { + // Simulate down arrow press + child.stdin.write(`\u001B\u005B\u0042`); + } + child.stdin.write(`\n`); + print('Waiting for app create script to be done'); await waitForExit(child); @@ -250,5 +264,85 @@ async function testAppServe(pluginName, appDir) { } } +/** Creates PG databases (drops if exists before) */ +async function createDB(database) { + const config = { + host: process.env.POSTGRES_HOST, + port: process.env.POSTGRES_PORT, + user: process.env.POSTGRES_USER, + password: process.env.POSTGRES_PASSWORD, + }; + + try { + await pgtools.dropdb({ config }, database); + } catch (_) { + /* do nothing*/ + } + return pgtools.createdb(config, database); +} + +/** + * Start serving the newly created backend and make sure that all db migrations works correctly + */ +async function testBackendStart(appDir, isPostgres) { + if (isPostgres) { + print('Creating DBs'); + await Promise.all( + [ + 'catalog', + 'scaffolder', + 'auth', + 'identity', + 'proxy', + 'techdocs', + ].map(name => createDB(`backstage_plugin_${name}`)), + ); + print('Created DBs'); + } + + const child = spawnPiped(['yarn', 'workspace', 'backend', 'start'], { + cwd: appDir, + }); + + let stdout = ''; + let stderr = ''; + child.stdout.on('data', data => { + stdout = stdout + data.toString('utf8'); + }); + child.stderr.on('data', data => { + stderr = stderr + data.toString('utf8'); + }); + let successful = false; + + try { + await waitFor(() => stdout.includes('Listening on ') || stderr !== ''); + if (stderr !== '') { + // Skipping the whole block + throw new Error(); + } + + print('Try to fetch entities from the backend'); + // Try fetch entities, should be ok + await fetch('http://localhost:7000/catalog/entities').then(res => + res.json(), + ); + print('Entities fetched successfully'); + successful = true; + } finally { + print('Stopping the child process'); + // Kill entire process group, otherwise we'll end up with hanging serve processes + killTree(child.pid); + } + + try { + await waitForExit(child); + } catch (error) { + if (!successful) { + throw error; + } + print('Backend startup test finished successfully'); + } +} + process.on('unhandledRejection', handleError); main(process.argv.slice(2)).catch(handleError); diff --git a/packages/cli/e2e-test/helpers.js b/packages/cli/e2e-test/helpers.js index da2ec343ab..84807119c3 100644 --- a/packages/cli/e2e-test/helpers.js +++ b/packages/cli/e2e-test/helpers.js @@ -76,6 +76,12 @@ function handleError(err) { } } +/** + * Waits for fn() to be true + * Checks every 100ms + * .cancel() is available + * @returns {Promise} Promise of resolution + */ function waitFor(fn) { return new Promise(resolve => { const handle = setInterval(() => { diff --git a/packages/cli/package.json b/packages/cli/package.json index ed7ae9725b..f99f2a7741 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -67,7 +67,9 @@ "jest-css-modules": "^2.1.0", "jest-esm-transformer": "^1.0.0", "mini-css-extract-plugin": "^0.9.0", + "node-fetch": "^2.6.0", "ora": "^4.0.3", + "pgtools": "^0.3.0", "raw-loader": "^4.0.1", "react": "^16.0.0", "react-dev-utils": "^10.2.1", diff --git a/packages/cli/src/commands/create-app/createApp.ts b/packages/cli/src/commands/create-app/createApp.ts index d0fc5e4450..b3ddcd3109 100644 --- a/packages/cli/src/commands/create-app/createApp.ts +++ b/packages/cli/src/commands/create-app/createApp.ts @@ -18,7 +18,7 @@ import fs from 'fs-extra'; import { promisify } from 'util'; import chalk from 'chalk'; import { Command } from 'commander'; -import inquirer, { Answers, Question, ChoiceBase, ui } from 'inquirer'; +import inquirer, { Answers, Question } from 'inquirer'; import { exec as execCb } from 'child_process'; import { resolve as resolvePath } from 'path'; import os from 'os'; @@ -113,8 +113,8 @@ export default async (cmd: Command): Promise => { }, ]; const answers: Answers = await inquirer.prompt(questions); - answers['dbTypePG'] = answers.dbType === 'PostgreSQL'; - answers['dbTypeSqlite'] = answers.dbType === 'SQLite'; + answers.dbTypePG = answers.dbType === 'PostgreSQL'; + answers.dbTypeSqlite = answers.dbType === 'SQLite'; const templateDir = paths.resolveOwn('templates/default-app'); const tempDir = resolvePath(os.tmpdir(), answers.name); diff --git a/packages/cli/templates/default-app/.eslintrc.js b/packages/cli/templates/default-app/.eslintrc.js index 13573efa9c..e351352491 100644 --- a/packages/cli/templates/default-app/.eslintrc.js +++ b/packages/cli/templates/default-app/.eslintrc.js @@ -1,3 +1,3 @@ module.exports = { - extends: [require.resolve('@backstage/cli/config/eslint')], + root: true, }; diff --git a/packages/cli/templates/default-app/packages/backend/src/index.ts.hbs b/packages/cli/templates/default-app/packages/backend/src/index.ts.hbs index d1cf3d1ada..5e98afb6d1 100644 --- a/packages/cli/templates/default-app/packages/backend/src/index.ts.hbs +++ b/packages/cli/templates/default-app/packages/backend/src/index.ts.hbs @@ -29,7 +29,7 @@ import { } from '@backstage/backend-common'; import { ConfigReader, AppConfig } from '@backstage/config'; import { loadConfig } from '@backstage/config-loader'; -import knex from 'knex'; +import knex, { PgConnectionConfig } from 'knex'; import auth from './plugins/auth'; import catalog from './plugins/catalog'; import identity from './plugins/identity'; @@ -49,11 +49,12 @@ function makeCreateEnv(loadedConfigs: AppConfig[]) { client: 'pg', useNullAsDefault: true, connection: { - host: process.env.PG_HOST, - user: process.env.PG_USER, - password: process.env.PG_PASSWORD, + port: process.env.POSTGRES_PORT, + host: process.env.POSTGRES_HOST, + user: process.env.POSTGRES_USER, + password: process.env.POSTGRES_PASSWORD, database: `backstage_plugin_${plugin}`, - }, + } as PgConnectionConfig, }; {{/if}} {{#if dbTypeSqlite}} diff --git a/yarn.lock b/yarn.lock index 6c0ff99388..85f2b5b994 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5669,6 +5669,16 @@ buffer-indexof@^1.0.0: resolved "https://registry.npmjs.org/buffer-indexof/-/buffer-indexof-1.1.1.tgz#52fabcc6a606d1a00302802648ef68f639da268c" integrity sha512-4/rOEg86jivtPTeOUUT61jJO1Ya1TrR/OkqCSZDyq84WJh3LuuiphBYJN+fm5xufIk4XAFcEwte/8WzC8If/1g== +buffer-writer@1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/buffer-writer/-/buffer-writer-1.0.1.tgz#22a936901e3029afcd7547eb4487ceb697a3bf08" + integrity sha1-Iqk2kB4wKa/NdUfrRIfOtpejvwg= + +buffer-writer@2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz#ce7eb81a38f7829db09c873f2fbb792c0c98ec04" + integrity sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw== + buffer-xor@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" @@ -5872,6 +5882,11 @@ camelcase@^2.0.0: resolved "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= +camelcase@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" + integrity sha1-MvxLn82vhF/N9+c7uXysImHwqwo= + camelcase@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" @@ -6169,6 +6184,15 @@ clipboard@^2.0.0: select "^1.1.2" tiny-emitter "^2.0.0" +cliui@^3.2.0: + version "3.2.0" + resolved "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + cliui@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" @@ -7301,7 +7325,7 @@ decamelize-keys@^1.0.0: decamelize "^1.1.0" map-obj "^1.0.0" -decamelize@^1.1.0, decamelize@^1.1.2, decamelize@^1.2.0: +decamelize@^1.1.0, decamelize@^1.1.1, decamelize@^1.1.2, decamelize@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= @@ -9289,6 +9313,11 @@ generic-names@^2.0.1: dependencies: loader-utils "^1.1.0" +generic-pool@2.4.3: + version "2.4.3" + resolved "https://registry.npmjs.org/generic-pool/-/generic-pool-2.4.3.tgz#780c36f69dfad05a5a045dd37be7adca11a4f6ff" + integrity sha1-eAw29p360FpaBF3Te+etyhGk9v8= + genfun@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/genfun/-/genfun-5.0.0.tgz#9dd9710a06900a5c4a5bf57aca5da4e52fe76537" @@ -9299,6 +9328,11 @@ gensync@^1.0.0-beta.1: resolved "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz#58f4361ff987e5ff6e1e7a210827aa371eaac269" integrity sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg== +get-caller-file@^1.0.1: + version "1.0.3" + resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" + integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== + get-caller-file@^2.0.1: version "2.0.5" resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" @@ -10585,6 +10619,11 @@ invariant@^2.2.2, invariant@^2.2.3, invariant@^2.2.4: dependencies: loose-envify "^1.0.0" +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= + ip-regex@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" @@ -11626,6 +11665,11 @@ js-cookie@^2.2.1: resolved "https://registry.npmjs.org/js-cookie/-/js-cookie-2.2.1.tgz#69e106dc5d5806894562902aa5baec3744e9b2b8" integrity sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ== +js-string-escape@1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz#e2625badbc0d67c7533e9edc1068c587ae4137ef" + integrity sha1-4mJbrbwNZ8dTPp7cEGjFh65BN+8= + "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -12034,6 +12078,13 @@ lazy-universal-dotenv@^3.0.1: dotenv "^8.0.0" dotenv-expand "^5.1.0" +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= + dependencies: + invert-kv "^1.0.0" + left-pad@^1.3.0: version "1.3.0" resolved "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" @@ -12303,6 +12354,11 @@ lodash._reinterpolate@^3.0.0: resolved "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0= +lodash.assign@^4.1.0, lodash.assign@^4.2.0: + version "4.2.0" + resolved "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" + integrity sha1-DZnzzNem0mHRm9rrkkUAXShYCOc= + lodash.camelcase@^4.3.0: version "4.3.0" resolved "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" @@ -13659,6 +13715,11 @@ oauth@0.9.x: resolved "https://registry.npmjs.org/oauth/-/oauth-0.9.15.tgz#bd1fefaf686c96b75475aed5196412ff60cfb9c1" integrity sha1-vR/vr2hslrdUda7VGWQS/2DPucE= +object-assign@4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz#7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0" + integrity sha1-ejs9DpgGPUP0wD8uiubNUahog6A= + object-assign@^4, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -13903,6 +13964,13 @@ os-homedir@^1.0.0: resolved "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= +os-locale@^1.4.0: + version "1.4.0" + resolved "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= + dependencies: + lcid "^1.0.0" + os-name@^3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/os-name/-/os-name-3.1.0.tgz#dec19d966296e1cd62d701a5a66ee1ddeae70801" @@ -14076,6 +14144,16 @@ package-json@^6.3.0: registry-url "^5.0.0" semver "^6.2.0" +packet-reader@0.3.1: + version "0.3.1" + resolved "https://registry.npmjs.org/packet-reader/-/packet-reader-0.3.1.tgz#cd62e60af8d7fea8a705ec4ff990871c46871f27" + integrity sha1-zWLmCvjX/qinBexP+ZCHHEaHHyc= + +packet-reader@1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz#9238e5480dedabacfe1fe3f2771063f164157d74" + integrity sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ== + pako@~1.0.5: version "1.0.11" resolved "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" @@ -14444,11 +14522,111 @@ performance-now@^2.1.0: resolved "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= +pg-connection-string@0.1.3, pg-connection-string@^0.1.3: + version "0.1.3" + resolved "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-0.1.3.tgz#da1847b20940e42ee1492beaf65d49d91b245df7" + integrity sha1-2hhHsglA5C7hSSvq9l1J2RskXfc= + pg-connection-string@2.2.0: version "2.2.0" resolved "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.2.0.tgz#caab4d38a9de4fdc29c9317acceed752897de41c" integrity sha512-xB/+wxcpFipUZOQcSzcgkjcNOosGhEoPSjz06jC89lv1dj7mc9bZv6wLVy8M2fVjP0a/xN0N988YDq1L0FhK3A== +pg-connection-string@^2.3.0: + version "2.3.0" + resolved "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.3.0.tgz#c13fcb84c298d0bfa9ba12b40dd6c23d946f55d6" + integrity sha512-ukMTJXLI7/hZIwTW7hGMZJ0Lj0S2XQBCJ4Shv4y1zgQ/vqVea+FLhzywvPj0ujSuofu+yA4MYHGZPTsgjBgJ+w== + +pg-int8@1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz#943bd463bf5b71b4170115f80f8efc9a0c0eb78c" + integrity sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw== + +pg-pool@1.*: + version "1.8.0" + resolved "https://registry.npmjs.org/pg-pool/-/pg-pool-1.8.0.tgz#f7ec73824c37a03f076f51bfdf70e340147c4f37" + integrity sha1-9+xzgkw3oD8Hb1G/33DjQBR8Tzc= + dependencies: + generic-pool "2.4.3" + object-assign "4.1.0" + +pg-pool@^3.2.1: + version "3.2.1" + resolved "https://registry.npmjs.org/pg-pool/-/pg-pool-3.2.1.tgz#5f4afc0f58063659aeefa952d36af49fa28b30e0" + integrity sha512-BQDPWUeKenVrMMDN9opfns/kZo4lxmSWhIqo+cSAF7+lfi9ZclQbr9vfnlNaPr8wYF3UYjm5X0yPAhbcgqNOdA== + +pg-protocol@^1.2.5: + version "1.2.5" + resolved "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.2.5.tgz#28a1492cde11646ff2d2d06bdee42a3ba05f126c" + integrity sha512-1uYCckkuTfzz/FCefvavRywkowa6M5FohNMF5OjKrqo9PSR8gYc8poVmwwYQaBxhmQdBjhtP514eXy9/Us2xKg== + +pg-types@1.*: + version "1.13.0" + resolved "https://registry.npmjs.org/pg-types/-/pg-types-1.13.0.tgz#75f490b8a8abf75f1386ef5ec4455ecf6b345c63" + integrity sha512-lfKli0Gkl/+za/+b6lzENajczwZHc7D5kiUCZfgm914jipD2kIOIvEkAhZ8GrW3/TUoP9w8FHjwpPObBye5KQQ== + dependencies: + pg-int8 "1.0.1" + postgres-array "~1.0.0" + postgres-bytea "~1.0.0" + postgres-date "~1.0.0" + postgres-interval "^1.1.0" + +pg-types@^2.1.0: + version "2.2.0" + resolved "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz#2d0250d636454f7cfa3b6ae0382fdfa8063254a3" + integrity sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA== + dependencies: + pg-int8 "1.0.1" + postgres-array "~2.0.0" + postgres-bytea "~1.0.0" + postgres-date "~1.0.4" + postgres-interval "^1.1.0" + +pg@^6.1.0: + version "6.4.2" + resolved "https://registry.npmjs.org/pg/-/pg-6.4.2.tgz#c364011060eac7a507a2ae063eb857ece910e27f" + integrity sha1-w2QBEGDqx6UHoq4GPrhX7OkQ4n8= + dependencies: + buffer-writer "1.0.1" + js-string-escape "1.0.1" + packet-reader "0.3.1" + pg-connection-string "0.1.3" + pg-pool "1.*" + pg-types "1.*" + pgpass "1.*" + semver "4.3.2" + +pg@^8.3.0: + version "8.3.0" + resolved "https://registry.npmjs.org/pg/-/pg-8.3.0.tgz#941383300d38eef51ecb88a0188cec441ab64d81" + integrity sha512-jQPKWHWxbI09s/Z9aUvoTbvGgoj98AU7FDCcQ7kdejupn/TcNpx56v2gaOTzXkzOajmOEJEdi9eTh9cA2RVAjQ== + dependencies: + buffer-writer "2.0.0" + packet-reader "1.0.0" + pg-connection-string "^2.3.0" + pg-pool "^3.2.1" + pg-protocol "^1.2.5" + pg-types "^2.1.0" + pgpass "1.x" + semver "4.3.2" + +pgpass@1.*, pgpass@1.x: + version "1.0.2" + resolved "https://registry.npmjs.org/pgpass/-/pgpass-1.0.2.tgz#2a7bb41b6065b67907e91da1b07c1847c877b306" + integrity sha1-Knu0G2BltnkH6R2hsHwYR8h3swY= + dependencies: + split "^1.0.0" + +pgtools@^0.3.0: + version "0.3.0" + resolved "https://registry.npmjs.org/pgtools/-/pgtools-0.3.0.tgz#ee7decf4183ada28299c63df71e1e73c95b5bc53" + integrity sha512-8NxDCJ8xJ6hOp9hVNZqxi+TZl7hM1Jc8pQyj8DlAbyaWnk5OsGwf3gB/UyDODdOguiim9QzbzPsslp//apO+Uw== + dependencies: + bluebird "^3.3.5" + pg "^6.1.0" + pg-connection-string "^0.1.3" + yargs "^5.0.0" + picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.1, picomatch@^2.2.2: version "2.2.2" resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" @@ -14980,6 +15158,33 @@ postcss@^6.0.1: source-map "^0.6.1" supports-color "^5.4.0" +postgres-array@~1.0.0: + version "1.0.3" + resolved "https://registry.npmjs.org/postgres-array/-/postgres-array-1.0.3.tgz#c561fc3b266b21451fc6555384f4986d78ec80f5" + integrity sha512-5wClXrAP0+78mcsNX3/ithQ5exKvCyK5lr5NEEEeGwwM6NJdQgzIJBVxLvRW+huFpX92F2QnZ5CcokH0VhK2qQ== + +postgres-array@~2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz#48f8fce054fbc69671999329b8834b772652d82e" + integrity sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA== + +postgres-bytea@~1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz#027b533c0aa890e26d172d47cf9ccecc521acd35" + integrity sha1-AntTPAqokOJtFy1Hz5zOzFIazTU= + +postgres-date@~1.0.0, postgres-date@~1.0.4: + version "1.0.5" + resolved "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.5.tgz#710b27de5f27d550f6e80b5d34f7ba189213c2ee" + integrity sha512-pdau6GRPERdAYUQwkBnGKxEfPyhVZXG/JiS44iZWiNdSOWE09N2lUgN6yshuq6fVSon4Pm0VMXd1srUUkLe9iA== + +postgres-interval@^1.1.0: + version "1.2.0" + resolved "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz#b460c82cb1587507788819a06aa0fffdb3544695" + integrity sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ== + dependencies: + xtend "^4.0.0" + prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" @@ -16304,6 +16509,11 @@ require-directory@^2.1.1: resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= + require-main-filename@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" @@ -16747,6 +16957,11 @@ semver-regex@^2.0.0: resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== +semver@4.3.2: + version "4.3.2" + resolved "https://registry.npmjs.org/semver/-/semver-4.3.2.tgz#c7a07158a80bedd052355b770d82d6640f803be7" + integrity sha1-x6BxWKgL7dBSNVt3DYLWZA+AO+c= + semver@7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" @@ -17524,7 +17739,7 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -string-width@^1.0.1: +string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= @@ -19316,6 +19531,11 @@ whatwg-url@^8.0.0: tr46 "^2.0.2" webidl-conversions "^5.0.0" +which-module@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" + integrity sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8= + which-module@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" @@ -19354,6 +19574,11 @@ widest-line@^3.1.0: dependencies: string-width "^4.0.0" +window-size@^0.2.0: + version "0.2.0" + resolved "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075" + integrity sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU= + windows-release@^3.1.0: version "3.2.0" resolved "https://registry.npmjs.org/windows-release/-/windows-release-3.2.0.tgz#8122dad5afc303d833422380680a79cdfa91785f" @@ -19408,6 +19633,14 @@ worker-rpc@^0.1.0: dependencies: microevent.ts "~0.1.1" +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-3.0.1.tgz#288a04d87eda5c286e060dfe8f135ce8d007f8ba" @@ -19599,6 +19832,11 @@ xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.1: resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== +y18n@^3.2.1: + version "3.2.1" + resolved "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= + y18n@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" @@ -19650,6 +19888,14 @@ yargs-parser@^15.0.1: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@^3.2.0: + version "3.2.0" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-3.2.0.tgz#5081355d19d9d0c8c5d81ada908cb4e6d186664f" + integrity sha1-UIE1XRnZ0MjF2BrakIy05tGGZk8= + dependencies: + camelcase "^3.0.0" + lodash.assign "^4.1.0" + yargs@^13.3.2: version "13.3.2" resolved "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" @@ -19700,6 +19946,26 @@ yargs@^15.3.1: y18n "^4.0.0" yargs-parser "^18.1.1" +yargs@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/yargs/-/yargs-5.0.0.tgz#3355144977d05757dbb86d6e38ec056123b3a66e" + integrity sha1-M1UUSXfQV1fbuG1uOOwFYSOzpm4= + dependencies: + cliui "^3.2.0" + decamelize "^1.1.1" + get-caller-file "^1.0.1" + lodash.assign "^4.2.0" + os-locale "^1.4.0" + read-pkg-up "^1.0.1" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^1.0.2" + which-module "^1.0.0" + window-size "^0.2.0" + y18n "^3.2.1" + yargs-parser "^3.2.0" + yauzl@2.10.0, yauzl@^2.10.0: version "2.10.0" resolved "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" From a6b8602378c0490e8c1bfef4a589717220bb9111 Mon Sep 17 00:00:00 2001 From: Ivan Shmidt Date: Fri, 24 Jul 2020 04:01:21 +0200 Subject: [PATCH 07/73] fix: tsc and pr comments --- packages/backend/src/index.ts | 11 ++++++----- .../default-app/packages/backend/src/index.ts.hbs | 5 +++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index 8b9edec327..0da700d205 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -29,7 +29,7 @@ import { } from '@backstage/backend-common'; import { ConfigReader, AppConfig } from '@backstage/config'; import { loadConfig } from '@backstage/config-loader'; -import knex from 'knex'; +import knex, { PgConnectionConfig } from 'knex'; import auth from './plugins/auth'; import catalog from './plugins/catalog'; import identity from './plugins/identity'; @@ -59,11 +59,12 @@ function makeCreateEnv(loadedConfigs: AppConfig[]) { client: 'pg', useNullAsDefault: true, connection: { - host: process.env.PG_HOST, - user: process.env.PG_USER, - password: process.env.PG_PASSWORD, + port: process.env.POSTGRES_PORT, + host: process.env.POSTGRES_HOST, + user: process.env.POSTGRES_USER, + password: process.env.POSTGRES_PASSWORD, database: `backstage_plugin_${plugin}`, - }, + } as PgConnectionConfig, }; } else { knexConfig = { diff --git a/packages/cli/templates/default-app/packages/backend/src/index.ts.hbs b/packages/cli/templates/default-app/packages/backend/src/index.ts.hbs index 5e98afb6d1..591fa1a28f 100644 --- a/packages/cli/templates/default-app/packages/backend/src/index.ts.hbs +++ b/packages/cli/templates/default-app/packages/backend/src/index.ts.hbs @@ -29,7 +29,12 @@ import { } from '@backstage/backend-common'; import { ConfigReader, AppConfig } from '@backstage/config'; import { loadConfig } from '@backstage/config-loader'; +{{#if dbTypePG}} import knex, { PgConnectionConfig } from 'knex'; +{{/if}} +{{#if dbTypeSqlite}} +import knex from 'knex'; +{{/if}} import auth from './plugins/auth'; import catalog from './plugins/catalog'; import identity from './plugins/identity'; From bdc24ae35e186743b1b73120df3157b27e9b7aab Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 24 Jul 2020 08:49:55 +0000 Subject: [PATCH 08/73] chore(deps-dev): bump @types/jest from 25.2.3 to 26.0.7 Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 25.2.3 to 26.0.7. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) Signed-off-by: dependabot-preview[bot] --- packages/app/package.json | 2 +- packages/catalog-model/package.json | 2 +- packages/config-loader/package.json | 2 +- packages/config/package.json | 2 +- packages/core-api/package.json | 2 +- packages/core/package.json | 2 +- packages/dev-utils/package.json | 2 +- packages/test-utils-core/package.json | 2 +- packages/test-utils/package.json | 2 +- plugins/catalog/package.json | 2 +- plugins/circleci/package.json | 2 +- plugins/explore/package.json | 2 +- plugins/github-actions/package.json | 2 +- plugins/gitops-profiles/package.json | 2 +- plugins/graphiql/package.json | 2 +- plugins/lighthouse/package.json | 2 +- plugins/register-component/package.json | 2 +- plugins/rollbar/package.json | 2 +- plugins/scaffolder/package.json | 2 +- plugins/sentry/package.json | 2 +- plugins/tech-radar/package.json | 2 +- plugins/techdocs/package.json | 2 +- plugins/welcome/package.json | 2 +- yarn.lock | 8 ++++---- 24 files changed, 27 insertions(+), 27 deletions(-) diff --git a/packages/app/package.json b/packages/app/package.json index 4dc2f9c4c1..61f6002883 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -39,7 +39,7 @@ "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", - "@types/jest": "^25.2.2", + "@types/jest": "^26.0.7", "@types/jquery": "^3.3.34", "@types/node": "^12.0.0", "@types/react-dom": "^16.9.8", diff --git a/packages/catalog-model/package.json b/packages/catalog-model/package.json index 14212e84e0..22c090fbe2 100644 --- a/packages/catalog-model/package.json +++ b/packages/catalog-model/package.json @@ -31,7 +31,7 @@ "devDependencies": { "@backstage/cli": "^0.1.1-alpha.16", "@types/express": "^4.17.6", - "@types/jest": "^25.2.2", + "@types/jest": "^26.0.7", "@types/lodash": "^4.14.151", "yaml": "^1.9.2" }, diff --git a/packages/config-loader/package.json b/packages/config-loader/package.json index 25512529b8..e149e9f831 100644 --- a/packages/config-loader/package.json +++ b/packages/config-loader/package.json @@ -36,7 +36,7 @@ "yup": "^0.29.1" }, "devDependencies": { - "@types/jest": "^25.2.2", + "@types/jest": "^26.0.7", "@types/node": "^12.0.0", "@types/yup": "^0.28.2" }, diff --git a/packages/config/package.json b/packages/config/package.json index aac52ab023..afac361a8b 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -33,7 +33,7 @@ "lodash": "^4.17.15" }, "devDependencies": { - "@types/jest": "^25.2.2", + "@types/jest": "^26.0.7", "@types/node": "^12.0.0" }, "files": [ diff --git a/packages/core-api/package.json b/packages/core-api/package.json index 0f0251f23c..69df9cae15 100644 --- a/packages/core-api/package.json +++ b/packages/core-api/package.json @@ -46,7 +46,7 @@ "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", - "@types/jest": "^25.2.2", + "@types/jest": "^26.0.7", "@types/node": "^12.0.0", "@types/zen-observable": "^0.8.0", "jest-fetch-mock": "^3.0.3" diff --git a/packages/core/package.json b/packages/core/package.json index 20a947a202..393f33b7ea 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -61,7 +61,7 @@ "@testing-library/user-event": "^12.0.7", "@types/classnames": "^2.2.9", "@types/google-protobuf": "^3.7.2", - "@types/jest": "^25.2.2", + "@types/jest": "^26.0.7", "@types/node": "^12.0.0", "@types/react-helmet": "^5.0.15", "@types/zen-observable": "^0.8.0", diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json index 24e54a5cbb..07f74acd92 100644 --- a/packages/dev-utils/package.json +++ b/packages/dev-utils/package.json @@ -46,7 +46,7 @@ "react-router-dom": "6.0.0-beta.0" }, "devDependencies": { - "@types/jest": "^25.2.2", + "@types/jest": "^26.0.7", "@types/node": "^12.0.0" }, "files": [ diff --git a/packages/test-utils-core/package.json b/packages/test-utils-core/package.json index 10e5b0ea6b..f13021c00b 100644 --- a/packages/test-utils-core/package.json +++ b/packages/test-utils-core/package.json @@ -36,7 +36,7 @@ "react-dom": "^16.12.0" }, "devDependencies": { - "@types/jest": "^25.2.2", + "@types/jest": "^26.0.7", "@types/node": "^12.0.0" }, "files": [ diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index ef595f53ed..b2bf531355 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -45,7 +45,7 @@ "zen-observable": "^0.8.15" }, "devDependencies": { - "@types/jest": "^25.2.2", + "@types/jest": "^26.0.7", "@types/node": "^12.0.0" }, "files": [ diff --git a/plugins/catalog/package.json b/plugins/catalog/package.json index 4da687b86e..554e66854f 100644 --- a/plugins/catalog/package.json +++ b/plugins/catalog/package.json @@ -45,7 +45,7 @@ "@testing-library/react": "^10.4.1", "@testing-library/react-hooks": "^3.3.0", "@testing-library/user-event": "^12.0.7", - "@types/jest": "^25.2.2", + "@types/jest": "^26.0.7", "@types/node": "^12.0.0", "jest-fetch-mock": "^3.0.3", "msw": "^0.19.0", diff --git a/plugins/circleci/package.json b/plugins/circleci/package.json index b5dfcb3211..3cf357bbce 100644 --- a/plugins/circleci/package.json +++ b/plugins/circleci/package.json @@ -41,7 +41,7 @@ "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", - "@types/jest": "^25.2.2", + "@types/jest": "^26.0.7", "@types/node": "^12.0.0", "@types/react-lazylog": "^4.5.0", "jest-fetch-mock": "^3.0.3" diff --git a/plugins/explore/package.json b/plugins/explore/package.json index 4dc8542a12..6840cf5e52 100644 --- a/plugins/explore/package.json +++ b/plugins/explore/package.json @@ -38,7 +38,7 @@ "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", - "@types/jest": "^25.2.2", + "@types/jest": "^26.0.7", "@types/node": "^12.0.0", "jest-fetch-mock": "^3.0.3" }, diff --git a/plugins/github-actions/package.json b/plugins/github-actions/package.json index ce0068c35a..e6feb1a314 100644 --- a/plugins/github-actions/package.json +++ b/plugins/github-actions/package.json @@ -41,7 +41,7 @@ "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", - "@types/jest": "^25.2.2", + "@types/jest": "^26.0.7", "@types/node": "^12.0.0", "jest-fetch-mock": "^3.0.3" }, diff --git a/plugins/gitops-profiles/package.json b/plugins/gitops-profiles/package.json index 80063c6295..8157cfe519 100644 --- a/plugins/gitops-profiles/package.json +++ b/plugins/gitops-profiles/package.json @@ -37,7 +37,7 @@ "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", - "@types/jest": "^25.2.2", + "@types/jest": "^26.0.7", "@types/node": "^12.0.0", "jest-fetch-mock": "^3.0.3" }, diff --git a/plugins/graphiql/package.json b/plugins/graphiql/package.json index 2d5f727f4e..193fe3d133 100644 --- a/plugins/graphiql/package.json +++ b/plugins/graphiql/package.json @@ -50,7 +50,7 @@ "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", "@types/codemirror": "^0.0.96", - "@types/jest": "^25.2.2", + "@types/jest": "^26.0.7", "@types/node": "^12.0.0", "jest-fetch-mock": "^3.0.3", "react-router-dom": "6.0.0-beta.0" diff --git a/plugins/lighthouse/package.json b/plugins/lighthouse/package.json index f9fd64ee69..eea841c174 100644 --- a/plugins/lighthouse/package.json +++ b/plugins/lighthouse/package.json @@ -39,7 +39,7 @@ "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", - "@types/jest": "^25.2.2", + "@types/jest": "^26.0.7", "@types/node": "^12.0.0", "jest-fetch-mock": "^3.0.3" }, diff --git a/plugins/register-component/package.json b/plugins/register-component/package.json index 1dcbb86a9c..e1a095f1e4 100644 --- a/plugins/register-component/package.json +++ b/plugins/register-component/package.json @@ -41,7 +41,7 @@ "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", - "@types/jest": "^25.2.2", + "@types/jest": "^26.0.7", "@types/node": "^12.0.0", "jest-fetch-mock": "^3.0.3" }, diff --git a/plugins/rollbar/package.json b/plugins/rollbar/package.json index 2055cc9525..d2308b869e 100644 --- a/plugins/rollbar/package.json +++ b/plugins/rollbar/package.json @@ -42,7 +42,7 @@ "@testing-library/react": "^10.4.1", "@testing-library/react-hooks": "^3.3.0", "@testing-library/user-event": "^12.0.7", - "@types/jest": "^25.2.2", + "@types/jest": "^26.0.7", "@types/node": "^12.0.0", "@types/react": "^16.9", "jest-fetch-mock": "^3.0.3" diff --git a/plugins/scaffolder/package.json b/plugins/scaffolder/package.json index a52acfed43..e28387c30e 100644 --- a/plugins/scaffolder/package.json +++ b/plugins/scaffolder/package.json @@ -47,7 +47,7 @@ "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", - "@types/jest": "^25.2.2", + "@types/jest": "^26.0.7", "@types/node": "^12.0.0", "jest-fetch-mock": "^3.0.3" }, diff --git a/plugins/sentry/package.json b/plugins/sentry/package.json index 1557ca409a..3a5cbd5094 100644 --- a/plugins/sentry/package.json +++ b/plugins/sentry/package.json @@ -39,7 +39,7 @@ "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", - "@types/jest": "^25.2.2", + "@types/jest": "^26.0.7", "@types/node": "^12.0.0", "jest-fetch-mock": "^3.0.3" }, diff --git a/plugins/tech-radar/package.json b/plugins/tech-radar/package.json index 1b801beebd..d72be7af8e 100644 --- a/plugins/tech-radar/package.json +++ b/plugins/tech-radar/package.json @@ -42,7 +42,7 @@ "@testing-library/user-event": "^12.0.7", "@types/color": "^3.0.1", "@types/d3-force": "^1.2.1", - "@types/jest": "^25.2.2", + "@types/jest": "^26.0.7", "@types/node": "^12.0.0", "@types/react": "^16.9", "jest-fetch-mock": "^3.0.3" diff --git a/plugins/techdocs/package.json b/plugins/techdocs/package.json index dfd8393b5f..210d297c7d 100644 --- a/plugins/techdocs/package.json +++ b/plugins/techdocs/package.json @@ -41,7 +41,7 @@ "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", - "@types/jest": "^25.2.2", + "@types/jest": "^26.0.7", "@types/node": "^12.0.0", "jest-fetch-mock": "^3.0.3" }, diff --git a/plugins/welcome/package.json b/plugins/welcome/package.json index 71a19d59bc..66fec93779 100644 --- a/plugins/welcome/package.json +++ b/plugins/welcome/package.json @@ -37,7 +37,7 @@ "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", - "@types/jest": "^25.2.2", + "@types/jest": "^26.0.7", "@types/node": "^12.0.0", "jest-fetch-mock": "^3.0.3" }, diff --git a/yarn.lock b/yarn.lock index 6c0ff99388..07a46a31d2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3655,10 +3655,10 @@ "@types/istanbul-lib-coverage" "*" "@types/istanbul-lib-report" "*" -"@types/jest@*", "@types/jest@^25.2.2": - version "25.2.3" - resolved "https://registry.npmjs.org/@types/jest/-/jest-25.2.3.tgz#33d27e4c4716caae4eced355097a47ad363fdcaf" - integrity sha512-JXc1nK/tXHiDhV55dvfzqtmP4S3sy3T3ouV2tkViZgxY/zeUkcpQcQPGRlgF4KmWzWW5oiWYSZwtCB+2RsE4Fw== +"@types/jest@*", "@types/jest@^26.0.7": + version "26.0.7" + resolved "https://registry.npmjs.org/@types/jest/-/jest-26.0.7.tgz#495cb1d1818c1699dbc3b8b046baf1c86ef5e324" + integrity sha512-+x0077/LoN6MjqBcVOe1y9dpryWnfDZ+Xfo3EqGeBcfPRJlQp3Lw62RvNlWxuGv7kOEwlHriAa54updi3Jvvwg== dependencies: jest-diff "^25.2.1" pretty-format "^25.2.1" From 0379324828e168ca003d32288bdc6e3848f87fa6 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 27 Jul 2020 08:48:24 +0000 Subject: [PATCH 09/73] chore(deps): bump rollup from 2.10.9 to 2.23.0 Bumps [rollup](https://github.com/rollup/rollup) from 2.10.9 to 2.23.0. - [Release notes](https://github.com/rollup/rollup/releases) - [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md) - [Commits](https://github.com/rollup/rollup/compare/v2.10.9...v2.23.0) Signed-off-by: dependabot-preview[bot] --- packages/cli/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 6aa3f6458d..dc19175ebd 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -75,7 +75,7 @@ "react-hot-loader": "^4.12.21", "recursive-readdir": "^2.2.2", "replace-in-file": "^6.0.0", - "rollup": "2.10.x", + "rollup": "2.23.x", "rollup-plugin-dts": "^1.4.6", "rollup-plugin-esbuild": "^2.0.0", "rollup-plugin-image-files": "^1.4.2", diff --git a/yarn.lock b/yarn.lock index 182d6ddbaa..b1ec991905 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16562,10 +16562,10 @@ rollup@0.64.1: "@types/estree" "0.0.39" "@types/node" "*" -rollup@2.10.x: - version "2.10.9" - resolved "https://registry.npmjs.org/rollup/-/rollup-2.10.9.tgz#17dcc6753c619efcc1be2cf61d73a87827eebdf9" - integrity sha512-dY/EbjiWC17ZCUSyk14hkxATAMAShkMsD43XmZGWjLrgFj15M3Dw2kEkA9ns64BiLFm9PKN6vTQw8neHwK74eg== +rollup@2.23.x: + version "2.23.0" + resolved "https://registry.npmjs.org/rollup/-/rollup-2.23.0.tgz#b7ab1fee0c0e60132fd0553c4df1e9cdacfada9d" + integrity sha512-vLNmZFUGVwrnqNAJ/BvuLk1MtWzu4IuoqsH9UWK5AIdO3rt8/CSiJNvPvCIvfzrbNsqKbNzPAG1V2O4eTe2XZg== optionalDependencies: fsevents "~2.1.2" From 55666a3acdd59d37b30b6b49cd1652e7fb4c43aa Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 27 Jul 2020 09:22:40 +0000 Subject: [PATCH 10/73] build(deps): bump @svgr/rollup from 4.3.3 to 5.4.0 Bumps [@svgr/rollup](https://github.com/gregberge/svgr) from 4.3.3 to 5.4.0. - [Release notes](https://github.com/gregberge/svgr/releases) - [Changelog](https://github.com/gregberge/svgr/blob/master/CHANGELOG.md) - [Commits](https://github.com/gregberge/svgr/compare/v4.3.3...v5.4.0) Signed-off-by: dependabot-preview[bot] --- packages/cli/package.json | 2 +- yarn.lock | 1200 ++++++++++++++++++++++++------------- 2 files changed, 789 insertions(+), 413 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 6aa3f6458d..a176b346b5 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -42,7 +42,7 @@ "@sucrase/webpack-loader": "^2.0.0", "@svgr/plugin-jsx": "4.3.x", "@svgr/plugin-svgo": "4.3.x", - "@svgr/rollup": "4.3.x", + "@svgr/rollup": "5.4.x", "@svgr/webpack": "4.3.x", "@types/start-server-webpack-plugin": "^2.2.0", "@types/webpack-env": "^1.15.2", diff --git a/yarn.lock b/yarn.lock index 1f6c4c56b4..69f4100f58 100644 --- a/yarn.lock +++ b/yarn.lock @@ -61,12 +61,19 @@ dependencies: "@babel/highlight" "^7.8.3" -"@babel/compat-data@^7.8.6", "@babel/compat-data@^7.9.0": - version "7.9.0" - resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.9.0.tgz#04815556fc90b0c174abd2c0c1bb966faa036a6c" - integrity sha512-zeFQrr+284Ekvd9e7KAX954LkapWiOmQtsfHirhxqfdlX6MEC32iRE+pqUGlYIBchdevaCwvzxWGSy/YBNI85g== +"@babel/code-frame@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a" + integrity sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg== dependencies: - browserslist "^4.9.1" + "@babel/highlight" "^7.10.4" + +"@babel/compat-data@^7.10.4": + version "7.10.5" + resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.10.5.tgz#d38425e67ea96b1480a3f50404d1bf85676301a6" + integrity sha512-mPVoWNzIpYJHbWje0if7Ck36bpbtTvIxOi9+6WSK9wjGEXearAqlwBoTQvVjsAY2VIwgcs8V940geY3okzRCEw== + dependencies: + browserslist "^4.12.0" invariant "^2.2.4" semver "^5.5.0" @@ -92,6 +99,15 @@ semver "^5.4.1" source-map "^0.5.0" +"@babel/generator@^7.10.5": + version "7.10.5" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.10.5.tgz#1b903554bc8c583ee8d25f1e8969732e6b829a69" + integrity sha512-3vXxr3FEW7E7lJZiWQ3bM4+v/Vyr9C+hpolQ8BGFr9Y8Ri2tFLWTixmwKBafDujO1WVah4fhZBeU1bieKdghig== + dependencies: + "@babel/types" "^7.10.5" + jsesc "^2.5.1" + source-map "^0.5.0" + "@babel/generator@^7.9.6": version "7.9.6" resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.9.6.tgz#5408c82ac5de98cda0d77d8124e99fa1f2170a43" @@ -102,6 +118,13 @@ lodash "^4.17.13" source-map "^0.5.0" +"@babel/helper-annotate-as-pure@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.10.4.tgz#5bf0d495a3f757ac3bda48b5bf3b3ba309c72ba3" + integrity sha512-XQlqKQP4vXFB7BN8fEEerrmYvHp3fK/rBkRFz9jaJbzK0B1DSfej9Kc7ZzE8Z/OnId1jpJdNAZ3BFQjWG68rcA== + dependencies: + "@babel/types" "^7.10.4" + "@babel/helper-annotate-as-pure@^7.8.3": version "7.8.3" resolved "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.8.3.tgz#60bc0bc657f63a0924ff9a4b4a0b24a13cf4deee" @@ -109,51 +132,54 @@ dependencies: "@babel/types" "^7.8.3" -"@babel/helper-builder-binary-assignment-operator-visitor@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.8.3.tgz#c84097a427a061ac56a1c30ebf54b7b22d241503" - integrity sha512-5eFOm2SyFPK4Rh3XMMRDjN7lBH0orh3ss0g3rTYZnBQ+r6YPj7lgDyCvPphynHvUrobJmeMignBr6Acw9mAPlw== +"@babel/helper-builder-binary-assignment-operator-visitor@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.10.4.tgz#bb0b75f31bf98cbf9ff143c1ae578b87274ae1a3" + integrity sha512-L0zGlFrGWZK4PbT8AszSfLTM5sDU1+Az/En9VrdT8/LmEiJt4zXt+Jve9DCAnQcbqDhCI+29y/L93mrDzddCcg== dependencies: - "@babel/helper-explode-assignable-expression" "^7.8.3" - "@babel/types" "^7.8.3" + "@babel/helper-explode-assignable-expression" "^7.10.4" + "@babel/types" "^7.10.4" -"@babel/helper-builder-react-jsx-experimental@^7.9.0": - version "7.9.0" - resolved "https://registry.npmjs.org/@babel/helper-builder-react-jsx-experimental/-/helper-builder-react-jsx-experimental-7.9.0.tgz#066d80262ade488f9c1b1823ce5db88a4cedaa43" - integrity sha512-3xJEiyuYU4Q/Ar9BsHisgdxZsRlsShMe90URZ0e6przL26CCs8NJbDoxH94kKT17PcxlMhsCAwZd90evCo26VQ== +"@babel/helper-builder-react-jsx-experimental@^7.10.4": + version "7.10.5" + resolved "https://registry.npmjs.org/@babel/helper-builder-react-jsx-experimental/-/helper-builder-react-jsx-experimental-7.10.5.tgz#f35e956a19955ff08c1258e44a515a6d6248646b" + integrity sha512-Buewnx6M4ttG+NLkKyt7baQn7ScC/Td+e99G914fRU8fGIUivDDgVIQeDHFa5e4CRSJQt58WpNHhsAZgtzVhsg== dependencies: - "@babel/helper-annotate-as-pure" "^7.8.3" - "@babel/helper-module-imports" "^7.8.3" - "@babel/types" "^7.9.0" + "@babel/helper-annotate-as-pure" "^7.10.4" + "@babel/helper-module-imports" "^7.10.4" + "@babel/types" "^7.10.5" -"@babel/helper-builder-react-jsx@^7.9.0": - version "7.9.0" - resolved "https://registry.npmjs.org/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.9.0.tgz#16bf391990b57732700a3278d4d9a81231ea8d32" - integrity sha512-weiIo4gaoGgnhff54GQ3P5wsUQmnSwpkvU0r6ZHq6TzoSzKy4JxHEgnxNytaKbov2a9z/CVNyzliuCOUPEX3Jw== +"@babel/helper-builder-react-jsx@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.10.4.tgz#8095cddbff858e6fa9c326daee54a2f2732c1d5d" + integrity sha512-5nPcIZ7+KKDxT1427oBivl9V9YTal7qk0diccnh7RrcgrT/pGFOjgGw1dgryyx1GvHEpXVfoDF6Ak3rTiWh8Rg== dependencies: - "@babel/helper-annotate-as-pure" "^7.8.3" - "@babel/types" "^7.9.0" + "@babel/helper-annotate-as-pure" "^7.10.4" + "@babel/types" "^7.10.4" -"@babel/helper-call-delegate@^7.8.7": - version "7.8.7" - resolved "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.8.7.tgz#28a279c2e6c622a6233da548127f980751324cab" - integrity sha512-doAA5LAKhsFCR0LAFIf+r2RSMmC+m8f/oQ+URnUET/rWeEzC0yTRmAGyWkD4sSu3xwbS7MYQ2u+xlt1V5R56KQ== +"@babel/helper-compilation-targets@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.10.4.tgz#804ae8e3f04376607cc791b9d47d540276332bd2" + integrity sha512-a3rYhlsGV0UHNDvrtOXBg8/OpfV0OKTkxKPzIplS1zpx7CygDcWWxckxZeDd3gzPzC4kUT0A4nVFDK0wGMh4MQ== dependencies: - "@babel/helper-hoist-variables" "^7.8.3" - "@babel/traverse" "^7.8.3" - "@babel/types" "^7.8.7" - -"@babel/helper-compilation-targets@^7.8.7": - version "7.8.7" - resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.8.7.tgz#dac1eea159c0e4bd46e309b5a1b04a66b53c1dde" - integrity sha512-4mWm8DCK2LugIS+p1yArqvG1Pf162upsIsjE7cNBjez+NjliQpVhj20obE520nao0o14DaTnFJv+Fw5a0JpoUw== - dependencies: - "@babel/compat-data" "^7.8.6" - browserslist "^4.9.1" + "@babel/compat-data" "^7.10.4" + browserslist "^4.12.0" invariant "^2.2.4" levenary "^1.1.1" semver "^5.5.0" +"@babel/helper-create-class-features-plugin@^7.10.4": + version "7.10.5" + resolved "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.10.5.tgz#9f61446ba80e8240b0a5c85c6fdac8459d6f259d" + integrity sha512-0nkdeijB7VlZoLT3r/mY3bUkw3T8WG/hNw+FATs/6+pG2039IJWjTYL0VTISqsNHMUTEnwbVnc89WIJX9Qed0A== + dependencies: + "@babel/helper-function-name" "^7.10.4" + "@babel/helper-member-expression-to-functions" "^7.10.5" + "@babel/helper-optimise-call-expression" "^7.10.4" + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-replace-supers" "^7.10.4" + "@babel/helper-split-export-declaration" "^7.10.4" + "@babel/helper-create-class-features-plugin@^7.8.3": version "7.8.6" resolved "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.8.6.tgz#243a5b46e2f8f0f674dc1387631eb6b28b851de0" @@ -166,6 +192,15 @@ "@babel/helper-replace-supers" "^7.8.6" "@babel/helper-split-export-declaration" "^7.8.3" +"@babel/helper-create-regexp-features-plugin@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.10.4.tgz#fdd60d88524659a0b6959c0579925e425714f3b8" + integrity sha512-2/hu58IEPKeoLF45DBwx3XFqsbCXmkdAay4spVr2x0jYgRxrSNp+ePwvSsy9g6YSaNDcKIQVPXk1Ov8S2edk2g== + dependencies: + "@babel/helper-annotate-as-pure" "^7.10.4" + "@babel/helper-regex" "^7.10.4" + regexpu-core "^4.7.0" + "@babel/helper-create-regexp-features-plugin@^7.8.3", "@babel/helper-create-regexp-features-plugin@^7.8.8": version "7.8.8" resolved "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.8.8.tgz#5d84180b588f560b7864efaeea89243e58312087" @@ -175,22 +210,31 @@ "@babel/helper-regex" "^7.8.3" regexpu-core "^4.7.0" -"@babel/helper-define-map@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.8.3.tgz#a0655cad5451c3760b726eba875f1cd8faa02c15" - integrity sha512-PoeBYtxoZGtct3md6xZOCWPcKuMuk3IHhgxsRRNtnNShebf4C8YonTSblsK4tvDbm+eJAw2HAPOfCr+Q/YRG/g== +"@babel/helper-define-map@^7.10.4": + version "7.10.5" + resolved "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.10.5.tgz#b53c10db78a640800152692b13393147acb9bb30" + integrity sha512-fMw4kgFB720aQFXSVaXr79pjjcW5puTCM16+rECJ/plGS+zByelE8l9nCpV1GibxTnFVmUuYG9U8wYfQHdzOEQ== dependencies: - "@babel/helper-function-name" "^7.8.3" - "@babel/types" "^7.8.3" - lodash "^4.17.13" + "@babel/helper-function-name" "^7.10.4" + "@babel/types" "^7.10.5" + lodash "^4.17.19" -"@babel/helper-explode-assignable-expression@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.8.3.tgz#a728dc5b4e89e30fc2dfc7d04fa28a930653f982" - integrity sha512-N+8eW86/Kj147bO9G2uclsg5pwfs/fqqY5rwgIL7eTBklgXjcOJ3btzS5iM6AitJcftnY7pm2lGsrJVYLGjzIw== +"@babel/helper-explode-assignable-expression@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.10.4.tgz#40a1cd917bff1288f699a94a75b37a1a2dbd8c7c" + integrity sha512-4K71RyRQNPRrR85sr5QY4X3VwG4wtVoXZB9+L3r1Gp38DhELyHCtovqydRi7c1Ovb17eRGiQ/FD5s8JdU0Uy5A== dependencies: - "@babel/traverse" "^7.8.3" - "@babel/types" "^7.8.3" + "@babel/traverse" "^7.10.4" + "@babel/types" "^7.10.4" + +"@babel/helper-function-name@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz#d2d3b20c59ad8c47112fa7d2a94bc09d5ef82f1a" + integrity sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ== + dependencies: + "@babel/helper-get-function-arity" "^7.10.4" + "@babel/template" "^7.10.4" + "@babel/types" "^7.10.4" "@babel/helper-function-name@^7.8.3", "@babel/helper-function-name@^7.9.5": version "7.9.5" @@ -201,6 +245,13 @@ "@babel/template" "^7.8.3" "@babel/types" "^7.9.5" +"@babel/helper-get-function-arity@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz#98c1cbea0e2332f33f9a4661b8ce1505b2c19ba2" + integrity sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A== + dependencies: + "@babel/types" "^7.10.4" + "@babel/helper-get-function-arity@^7.8.3": version "7.8.3" resolved "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz#b894b947bd004381ce63ea1db9f08547e920abd5" @@ -208,12 +259,19 @@ dependencies: "@babel/types" "^7.8.3" -"@babel/helper-hoist-variables@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.8.3.tgz#1dbe9b6b55d78c9b4183fc8cdc6e30ceb83b7134" - integrity sha512-ky1JLOjcDUtSc+xkt0xhYff7Z6ILTAHKmZLHPxAhOP0Nd77O+3nCsd6uSVYur6nJnCI029CrNbYlc0LoPfAPQg== +"@babel/helper-hoist-variables@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.10.4.tgz#d49b001d1d5a68ca5e6604dda01a6297f7c9381e" + integrity sha512-wljroF5PgCk2juF69kanHVs6vrLwIPNp6DLD+Lrl3hoQ3PpPPikaDRNFA+0t81NOoMt2DL6WW/mdU8k4k6ZzuA== dependencies: - "@babel/types" "^7.8.3" + "@babel/types" "^7.10.4" + +"@babel/helper-member-expression-to-functions@^7.10.4", "@babel/helper-member-expression-to-functions@^7.10.5": + version "7.10.5" + resolved "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.10.5.tgz#172f56e7a63e78112f3a04055f24365af702e7ee" + integrity sha512-HiqJpYD5+WopCXIAbQDG0zye5XYVvcO9w/DHp5GsaGkRUaamLj2bEtu6i8rnGGprAhHM3qidCMgp71HF4endhA== + dependencies: + "@babel/types" "^7.10.5" "@babel/helper-member-expression-to-functions@^7.8.3": version "7.8.3" @@ -229,6 +287,26 @@ dependencies: "@babel/types" "^7.8.3" +"@babel/helper-module-imports@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz#4c5c54be04bd31670a7382797d75b9fa2e5b5620" + integrity sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw== + dependencies: + "@babel/types" "^7.10.4" + +"@babel/helper-module-transforms@^7.10.4", "@babel/helper-module-transforms@^7.10.5": + version "7.10.5" + resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.10.5.tgz#120c271c0b3353673fcdfd8c053db3c544a260d6" + integrity sha512-4P+CWMJ6/j1W915ITJaUkadLObmCRRSC234uctJfn/vHrsLNxsR8dwlcXv9ZhJWzl77awf+mWXSZEKt5t0OnlA== + dependencies: + "@babel/helper-module-imports" "^7.10.4" + "@babel/helper-replace-supers" "^7.10.4" + "@babel/helper-simple-access" "^7.10.4" + "@babel/helper-split-export-declaration" "^7.10.4" + "@babel/template" "^7.10.4" + "@babel/types" "^7.10.5" + lodash "^4.17.19" + "@babel/helper-module-transforms@^7.9.0": version "7.9.0" resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.9.0.tgz#43b34dfe15961918707d247327431388e9fe96e5" @@ -242,6 +320,13 @@ "@babel/types" "^7.9.0" lodash "^4.17.13" +"@babel/helper-optimise-call-expression@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz#50dc96413d594f995a77905905b05893cd779673" + integrity sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg== + dependencies: + "@babel/types" "^7.10.4" + "@babel/helper-optimise-call-expression@^7.8.3": version "7.8.3" resolved "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.3.tgz#7ed071813d09c75298ef4f208956006b6111ecb9" @@ -254,6 +339,18 @@ resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz#9ea293be19babc0f52ff8ca88b34c3611b208670" integrity sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ== +"@babel/helper-plugin-utils@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz#2f75a831269d4f677de49986dff59927533cf375" + integrity sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg== + +"@babel/helper-regex@^7.10.4": + version "7.10.5" + resolved "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.10.5.tgz#32dfbb79899073c415557053a19bd055aae50ae0" + integrity sha512-68kdUAzDrljqBrio7DYAEgCoJHxppJOERHOgOrDN7WjOzP0ZQ1LsSDRXcemzVZaLvjaJsJEESb6qt+znNuENDg== + dependencies: + lodash "^4.17.19" + "@babel/helper-regex@^7.8.3": version "7.8.3" resolved "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.8.3.tgz#139772607d51b93f23effe72105b319d2a4c6965" @@ -261,18 +358,28 @@ dependencies: lodash "^4.17.13" -"@babel/helper-remap-async-to-generator@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.8.3.tgz#273c600d8b9bf5006142c1e35887d555c12edd86" - integrity sha512-kgwDmw4fCg7AVgS4DukQR/roGp+jP+XluJE5hsRZwxCYGg+Rv9wSGErDWhlI90FODdYfd4xG4AQRiMDjjN0GzA== +"@babel/helper-remap-async-to-generator@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.10.4.tgz#fce8bea4e9690bbe923056ded21e54b4e8b68ed5" + integrity sha512-86Lsr6NNw3qTNl+TBcF1oRZMaVzJtbWTyTko+CQL/tvNvcGYEFKbLXDPxtW0HKk3McNOk4KzY55itGWCAGK5tg== dependencies: - "@babel/helper-annotate-as-pure" "^7.8.3" - "@babel/helper-wrap-function" "^7.8.3" - "@babel/template" "^7.8.3" - "@babel/traverse" "^7.8.3" - "@babel/types" "^7.8.3" + "@babel/helper-annotate-as-pure" "^7.10.4" + "@babel/helper-wrap-function" "^7.10.4" + "@babel/template" "^7.10.4" + "@babel/traverse" "^7.10.4" + "@babel/types" "^7.10.4" -"@babel/helper-replace-supers@^7.8.3", "@babel/helper-replace-supers@^7.8.6": +"@babel/helper-replace-supers@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz#d585cd9388ea06e6031e4cd44b6713cbead9e6cf" + integrity sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.10.4" + "@babel/helper-optimise-call-expression" "^7.10.4" + "@babel/traverse" "^7.10.4" + "@babel/types" "^7.10.4" + +"@babel/helper-replace-supers@^7.8.6": version "7.8.6" resolved "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.8.6.tgz#5ada744fd5ad73203bf1d67459a27dcba67effc8" integrity sha512-PeMArdA4Sv/Wf4zXwBKPqVj7n9UF/xg6slNRtZW84FM7JpE1CbG8B612FyM4cxrf4fMAMGO0kR7voy1ForHHFA== @@ -282,6 +389,14 @@ "@babel/traverse" "^7.8.6" "@babel/types" "^7.8.6" +"@babel/helper-simple-access@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.4.tgz#0f5ccda2945277a2a7a2d3a821e15395edcf3461" + integrity sha512-0fMy72ej/VEvF8ULmX6yb5MtHG4uH4Dbd6I/aHDb/JVg0bbivwt9Wg+h3uMvX+QSFtwr5MeItvazbrc4jtRAXw== + dependencies: + "@babel/template" "^7.10.4" + "@babel/types" "^7.10.4" + "@babel/helper-simple-access@^7.8.3": version "7.8.3" resolved "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.8.3.tgz#7f8109928b4dab4654076986af575231deb639ae" @@ -290,6 +405,13 @@ "@babel/template" "^7.8.3" "@babel/types" "^7.8.3" +"@babel/helper-split-export-declaration@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.10.4.tgz#2c70576eaa3b5609b24cb99db2888cc3fc4251d1" + integrity sha512-pySBTeoUff56fL5CBU2hWm9TesA4r/rOkI9DyJLvvgz09MB9YtfIYe3iBriVaYNaPe+Alua0vBIOVOLs2buWhg== + dependencies: + "@babel/types" "^7.10.4" + "@babel/helper-split-export-declaration@^7.8.3": version "7.8.3" resolved "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz#31a9f30070f91368a7182cf05f831781065fc7a9" @@ -297,20 +419,25 @@ dependencies: "@babel/types" "^7.8.3" +"@babel/helper-validator-identifier@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz#a78c7a7251e01f616512d31b10adcf52ada5e0d2" + integrity sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw== + "@babel/helper-validator-identifier@^7.9.0", "@babel/helper-validator-identifier@^7.9.5": version "7.9.5" resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz#90977a8e6fbf6b431a7dc31752eee233bf052d80" integrity sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g== -"@babel/helper-wrap-function@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.8.3.tgz#9dbdb2bb55ef14aaa01fe8c99b629bd5352d8610" - integrity sha512-LACJrbUET9cQDzb6kG7EeD7+7doC3JNvUgTEQOx2qaO1fKlzE/Bf05qs9w1oXQMmXlPO65lC3Tq9S6gZpTErEQ== +"@babel/helper-wrap-function@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.10.4.tgz#8a6f701eab0ff39f765b5a1cfef409990e624b87" + integrity sha512-6py45WvEF0MhiLrdxtRjKjufwLL1/ob2qDJgg5JgNdojBAZSAKnAjkyOCNug6n+OBl4VW76XjvgSFTdaMcW0Ug== dependencies: - "@babel/helper-function-name" "^7.8.3" - "@babel/template" "^7.8.3" - "@babel/traverse" "^7.8.3" - "@babel/types" "^7.8.3" + "@babel/helper-function-name" "^7.10.4" + "@babel/template" "^7.10.4" + "@babel/traverse" "^7.10.4" + "@babel/types" "^7.10.4" "@babel/helpers@^7.9.6": version "7.9.6" @@ -330,20 +457,42 @@ chalk "^2.0.0" js-tokens "^4.0.0" +"@babel/highlight@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz#7d1bdfd65753538fabe6c38596cdb76d9ac60143" + integrity sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA== + dependencies: + "@babel/helper-validator-identifier" "^7.10.4" + chalk "^2.0.0" + js-tokens "^4.0.0" + "@babel/parser@^7.1.0", "@babel/parser@^7.7.5", "@babel/parser@^7.8.6", "@babel/parser@^7.9.6": version "7.9.6" resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.9.6.tgz#3b1bbb30dabe600cd72db58720998376ff653bc7" integrity sha512-AoeIEJn8vt+d/6+PXDRPaksYhnlbMIiejioBZvvMQsOjW/JYK6k/0dKnvvP3EhK5GfMBWDPtrxRtegWdAcdq9Q== -"@babel/plugin-proposal-async-generator-functions@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.8.3.tgz#bad329c670b382589721b27540c7d288601c6e6f" - integrity sha512-NZ9zLv848JsV3hs8ryEh7Uaz/0KsmPLqv0+PdkDJL1cJy0K4kOCFa8zc1E3mp+RHPQcpdfb/6GovEsW4VDrOMw== +"@babel/parser@^7.10.4", "@babel/parser@^7.10.5": + version "7.10.5" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.10.5.tgz#e7c6bf5a7deff957cec9f04b551e2762909d826b" + integrity sha512-wfryxy4bE1UivvQKSQDU4/X6dr+i8bctjUjj8Zyt3DQy7NtPizJXT8M52nqpNKL+nq2PW8lxk4ZqLj0fD4B4hQ== + +"@babel/plugin-proposal-async-generator-functions@^7.10.4": + version "7.10.5" + resolved "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.10.5.tgz#3491cabf2f7c179ab820606cec27fed15e0e8558" + integrity sha512-cNMCVezQbrRGvXJwm9fu/1sJj9bHdGAgKodZdLqOQIpfoH3raqmRPBM17+lh7CzhiKRRBrGtZL9WcjxSoGYUSg== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" - "@babel/helper-remap-async-to-generator" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-remap-async-to-generator" "^7.10.4" "@babel/plugin-syntax-async-generators" "^7.8.0" +"@babel/plugin-proposal-class-properties@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.10.4.tgz#a33bf632da390a59c7a8c570045d1115cd778807" + integrity sha512-vhwkEROxzcHGNu2mzUC0OFFNXdZ4M23ib8aRRcJSsW8BZK9pQMD7QB7csl97NBbgGZO7ZyHUyKDnxzOaP4IrCg== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.10.4" + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/plugin-proposal-class-properties@^7.7.0": version "7.8.3" resolved "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.8.3.tgz#5e06654af5cd04b608915aada9b2a6788004464e" @@ -352,39 +501,48 @@ "@babel/helper-create-class-features-plugin" "^7.8.3" "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-proposal-dynamic-import@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.8.3.tgz#38c4fe555744826e97e2ae930b0fb4cc07e66054" - integrity sha512-NyaBbyLFXFLT9FP+zk0kYlUlA8XtCUbehs67F0nnEg7KICgMc2mNkIeu9TYhKzyXMkrapZFwAhXLdnt4IYHy1w== +"@babel/plugin-proposal-dynamic-import@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.10.4.tgz#ba57a26cb98b37741e9d5bca1b8b0ddf8291f17e" + integrity sha512-up6oID1LeidOOASNXgv/CFbgBqTuKJ0cJjz6An5tWD+NVBNlp3VNSBxv2ZdU7SYl3NxJC7agAQDApZusV6uFwQ== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-dynamic-import" "^7.8.0" -"@babel/plugin-proposal-json-strings@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.8.3.tgz#da5216b238a98b58a1e05d6852104b10f9a70d6b" - integrity sha512-KGhQNZ3TVCQG/MjRbAUwuH+14y9q0tpxs1nWWs3pbSleRdDro9SAMMDyye8HhY1gqZ7/NqIc8SKhya0wRDgP1Q== +"@babel/plugin-proposal-json-strings@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.10.4.tgz#593e59c63528160233bd321b1aebe0820c2341db" + integrity sha512-fCL7QF0Jo83uy1K0P2YXrfX11tj3lkpN7l4dMv9Y9VkowkhkQDwFHFd8IiwyK5MZjE8UpbgokkgtcReH88Abaw== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-json-strings" "^7.8.0" -"@babel/plugin-proposal-nullish-coalescing-operator@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.8.3.tgz#e4572253fdeed65cddeecfdab3f928afeb2fd5d2" - integrity sha512-TS9MlfzXpXKt6YYomudb/KU7nQI6/xnapG6in1uZxoxDghuSMZsPb6D2fyUwNYSAp4l1iR7QtFOjkqcRYcUsfw== +"@babel/plugin-proposal-nullish-coalescing-operator@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.10.4.tgz#02a7e961fc32e6d5b2db0649e01bf80ddee7e04a" + integrity sha512-wq5n1M3ZUlHl9sqT2ok1T2/MTt6AXE0e1Lz4WzWBr95LsAZ5qDXe4KnFuauYyEyLiohvXFMdbsOTMyLZs91Zlw== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.0" -"@babel/plugin-proposal-numeric-separator@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.8.3.tgz#5d6769409699ec9b3b68684cd8116cedff93bad8" - integrity sha512-jWioO1s6R/R+wEHizfaScNsAx+xKgwTLNXSh7tTC4Usj3ItsPEhYkEpU4h+lpnBwq7NBVOJXfO6cRFYcX69JUQ== +"@babel/plugin-proposal-numeric-separator@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.10.4.tgz#ce1590ff0a65ad12970a609d78855e9a4c1aef06" + integrity sha512-73/G7QoRoeNkLZFxsoCCvlg4ezE4eM+57PnOqgaPOozd5myfj7p0muD1mRVJvbUWbOzD+q3No2bWbaKy+DJ8DA== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-proposal-object-rest-spread@^7.6.2", "@babel/plugin-proposal-object-rest-spread@^7.9.0": +"@babel/plugin-proposal-object-rest-spread@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.10.4.tgz#50129ac216b9a6a55b3853fdd923e74bf553a4c0" + integrity sha512-6vh4SqRuLLarjgeOf4EaROJAHjvu9Gl+/346PbDH9yWbJyfnJ/ah3jmYKYtswEyCoWZiidvVHjHshd4WgjB9BA== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/plugin-syntax-object-rest-spread" "^7.8.0" + "@babel/plugin-transform-parameters" "^7.10.4" + +"@babel/plugin-proposal-object-rest-spread@^7.6.2": version "7.9.0" resolved "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.9.0.tgz#a28993699fc13df165995362693962ba6b061d6f" integrity sha512-UgqBv6bjq4fDb8uku9f+wcm1J7YxJ5nT7WO/jBr0cl0PLKb7t1O6RNR1kZbjgx2LQtsDI9hwoQVmn0yhXeQyow== @@ -392,23 +550,39 @@ "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-syntax-object-rest-spread" "^7.8.0" -"@babel/plugin-proposal-optional-catch-binding@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.8.3.tgz#9dee96ab1650eed88646ae9734ca167ac4a9c5c9" - integrity sha512-0gkX7J7E+AtAw9fcwlVQj8peP61qhdg/89D5swOkjYbkboA2CVckn3kiyum1DE0wskGb7KJJxBdyEBApDLLVdw== +"@babel/plugin-proposal-optional-catch-binding@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.10.4.tgz#31c938309d24a78a49d68fdabffaa863758554dd" + integrity sha512-LflT6nPh+GK2MnFiKDyLiqSqVHkQnVf7hdoAvyTnnKj9xB3docGRsdPuxp6qqqW19ifK3xgc9U5/FwrSaCNX5g== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-optional-catch-binding" "^7.8.0" -"@babel/plugin-proposal-optional-chaining@^7.9.0": - version "7.9.0" - resolved "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.9.0.tgz#31db16b154c39d6b8a645292472b98394c292a58" - integrity sha512-NDn5tu3tcv4W30jNhmc2hyD5c56G6cXx4TesJubhxrJeCvuuMpttxr0OnNCqbZGhFjLrg+NIhxxC+BK5F6yS3w== +"@babel/plugin-proposal-optional-chaining@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.10.4.tgz#750f1255e930a1f82d8cdde45031f81a0d0adff7" + integrity sha512-ZIhQIEeavTgouyMSdZRap4VPPHqJJ3NEs2cuHs5p0erH+iz6khB0qfgU8g7UuJkG88+fBMy23ZiU+nuHvekJeQ== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-optional-chaining" "^7.8.0" -"@babel/plugin-proposal-unicode-property-regex@^7.4.4", "@babel/plugin-proposal-unicode-property-regex@^7.8.3": +"@babel/plugin-proposal-private-methods@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.10.4.tgz#b160d972b8fdba5c7d111a145fc8c421fc2a6909" + integrity sha512-wh5GJleuI8k3emgTg5KkJK6kHNsGEr0uBTDBuQUBJwckk9xs1ez79ioheEVVxMLyPscB0LfkbVHslQqIzWV6Bw== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.10.4" + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-proposal-unicode-property-regex@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.10.4.tgz#4483cda53041ce3413b7fe2f00022665ddfaa75d" + integrity sha512-H+3fOgPnEXFL9zGYtKQe4IDOPKYlZdF1kqFDQRRb8PK4B8af1vAGK04tF5iQAAsui+mHNBQSAtd2/ndEDe9wuA== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.10.4" + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-proposal-unicode-property-regex@^7.4.4": version "7.8.8" resolved "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.8.8.tgz#ee3a95e90cdc04fe8cd92ec3279fa017d68a0d1d" integrity sha512-EVhjVsMpbhLw9ZfHWSx2iy13Q8Z/eg8e8ccVWt23sWQK5l1UdkoLJPN5w69UA4uITGBnEZD2JOe4QOHycYKv8A== @@ -430,6 +604,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" +"@babel/plugin-syntax-class-properties@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.10.4.tgz#6644e6a0baa55a61f9e3231f6c9eeb6ee46c124c" + integrity sha512-GCSBF7iUle6rNugfURwNmCGG3Z/2+opxAMLs1nND4bhEG5PuxTIggDBoeYYSujAlLtsupzOHYJQgPS3pivwXIA== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/plugin-syntax-class-properties@^7.8.3": version "7.8.3" resolved "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.8.3.tgz#6cb933a8872c8d359bfde69bbeaae5162fd1e8f7" @@ -458,12 +639,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-jsx@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.8.3.tgz#521b06c83c40480f1e58b4fd33b92eceb1d6ea94" - integrity sha512-WxdW9xyLgBdefoo0Ynn3MRSkhe5tFVxxKNVdnZSh318WrG2e2jH+E9wd/++JsqcLJZPfz87njQJ8j2Upjm0M0A== +"@babel/plugin-syntax-jsx@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.10.4.tgz#39abaae3cbf710c4373d8429484e6ba21340166c" + integrity sha512-KCg9mio9jwiARCB7WAcQ7Y1q+qicILjoK8LP/VkPkEKaf5dkaZZK1EcTe91a3JJlZ3qy6L5s9X52boEYi8DM9g== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-logical-assignment-operators@^7.8.3": version "7.8.3" @@ -479,7 +660,14 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-numeric-separator@^7.8.0", "@babel/plugin-syntax-numeric-separator@^7.8.3": +"@babel/plugin-syntax-numeric-separator@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" + integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-numeric-separator@^7.8.3": version "7.8.3" resolved "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.8.3.tgz#0e3fb63e09bea1b11e96467271c8308007e7c41f" integrity sha512-H7dCMAdN83PcCmqmkHB5dtp+Xa9a6LKSvA2hiFBC/5alSHxM5VgWZXFqDi0YFe8XNGT6iCa+z4V4zSt/PdZ7Dw== @@ -507,73 +695,80 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-top-level-await@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.8.3.tgz#3acdece695e6b13aaf57fc291d1a800950c71391" - integrity sha512-kwj1j9lL/6Wd0hROD3b/OZZ7MSrZLqqn9RAZ5+cYYsflQ9HZBIKCUkr3+uL1MEJ1NePiUbf98jjiMQSv0NMR9g== +"@babel/plugin-syntax-top-level-await@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.10.4.tgz#4bbeb8917b54fcf768364e0a81f560e33a3ef57d" + integrity sha512-ni1brg4lXEmWyafKr0ccFWkJG0CeMt4WV1oyeBW6EFObF4oOHclbkj5cARxAPQyAQ2UTuplJyK4nfkXIMMFvsQ== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-arrow-functions@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.8.3.tgz#82776c2ed0cd9e1a49956daeb896024c9473b8b6" - integrity sha512-0MRF+KC8EqH4dbuITCWwPSzsyO3HIWWlm30v8BbbpOrS1B++isGxPnnuq/IZvOX5J2D/p7DQalQm+/2PnlKGxg== +"@babel/plugin-transform-arrow-functions@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.10.4.tgz#e22960d77e697c74f41c501d44d73dbf8a6a64cd" + integrity sha512-9J/oD1jV0ZCBcgnoFWFq1vJd4msoKb/TCpGNFyyLt0zABdcvgK3aYikZ8HjzB14c26bc7E3Q1yugpwGy2aTPNA== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-async-to-generator@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.8.3.tgz#4308fad0d9409d71eafb9b1a6ee35f9d64b64086" - integrity sha512-imt9tFLD9ogt56Dd5CI/6XgpukMwd/fLGSrix2httihVe7LOGVPhyhMh1BU5kDM7iHD08i8uUtmV2sWaBFlHVQ== +"@babel/plugin-transform-async-to-generator@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.10.4.tgz#41a5017e49eb6f3cda9392a51eef29405b245a37" + integrity sha512-F6nREOan7J5UXTLsDsZG3DXmZSVofr2tGNwfdrVwkDWHfQckbQXnXSPfD7iO+c/2HGqycwyLST3DnZ16n+cBJQ== dependencies: - "@babel/helper-module-imports" "^7.8.3" - "@babel/helper-plugin-utils" "^7.8.3" - "@babel/helper-remap-async-to-generator" "^7.8.3" + "@babel/helper-module-imports" "^7.10.4" + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-remap-async-to-generator" "^7.10.4" -"@babel/plugin-transform-block-scoped-functions@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.8.3.tgz#437eec5b799b5852072084b3ae5ef66e8349e8a3" - integrity sha512-vo4F2OewqjbB1+yaJ7k2EJFHlTP3jR634Z9Cj9itpqNjuLXvhlVxgnjsHsdRgASR8xYDrx6onw4vW5H6We0Jmg== +"@babel/plugin-transform-block-scoped-functions@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.10.4.tgz#1afa595744f75e43a91af73b0d998ecfe4ebc2e8" + integrity sha512-WzXDarQXYYfjaV1szJvN3AD7rZgZzC1JtjJZ8dMHUyiK8mxPRahynp14zzNjU3VkPqPsO38CzxiWO1c9ARZ8JA== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-block-scoping@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.8.3.tgz#97d35dab66857a437c166358b91d09050c868f3a" - integrity sha512-pGnYfm7RNRgYRi7bids5bHluENHqJhrV4bCZRwc5GamaWIIs07N4rZECcmJL6ZClwjDz1GbdMZFtPs27hTB06w== +"@babel/plugin-transform-block-scoping@^7.10.4": + version "7.10.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.10.5.tgz#b81b8aafefbfe68f0f65f7ef397b9ece68a6037d" + integrity sha512-6Ycw3hjpQti0qssQcA6AMSFDHeNJ++R6dIMnpRqUjFeBBTmTDPa8zgF90OVfTvAo11mXZTlVUViY1g8ffrURLg== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" - lodash "^4.17.13" + "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-classes@^7.9.0": - version "7.9.2" - resolved "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.9.2.tgz#8603fc3cc449e31fdbdbc257f67717536a11af8d" - integrity sha512-TC2p3bPzsfvSsqBZo0kJnuelnoK9O3welkUpqSqBQuBF6R5MN2rysopri8kNvtlGIb2jmUO7i15IooAZJjZuMQ== +"@babel/plugin-transform-classes@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.10.4.tgz#405136af2b3e218bc4a1926228bc917ab1a0adc7" + integrity sha512-2oZ9qLjt161dn1ZE0Ms66xBncQH4In8Sqw1YWgBUZuGVJJS5c0OFZXL6dP2MRHrkU/eKhWg8CzFJhRQl50rQxA== dependencies: - "@babel/helper-annotate-as-pure" "^7.8.3" - "@babel/helper-define-map" "^7.8.3" - "@babel/helper-function-name" "^7.8.3" - "@babel/helper-optimise-call-expression" "^7.8.3" - "@babel/helper-plugin-utils" "^7.8.3" - "@babel/helper-replace-supers" "^7.8.6" - "@babel/helper-split-export-declaration" "^7.8.3" + "@babel/helper-annotate-as-pure" "^7.10.4" + "@babel/helper-define-map" "^7.10.4" + "@babel/helper-function-name" "^7.10.4" + "@babel/helper-optimise-call-expression" "^7.10.4" + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-replace-supers" "^7.10.4" + "@babel/helper-split-export-declaration" "^7.10.4" globals "^11.1.0" -"@babel/plugin-transform-computed-properties@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.8.3.tgz#96d0d28b7f7ce4eb5b120bb2e0e943343c86f81b" - integrity sha512-O5hiIpSyOGdrQZRQ2ccwtTVkgUDBBiCuK//4RJ6UfePllUTCENOzKxfh6ulckXKc0DixTFLCfb2HVkNA7aDpzA== +"@babel/plugin-transform-computed-properties@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.10.4.tgz#9ded83a816e82ded28d52d4b4ecbdd810cdfc0eb" + integrity sha512-JFwVDXcP/hM/TbyzGq3l/XWGut7p46Z3QvqFMXTfk6/09m7xZHJUN9xHfsv7vqqD4YnfI5ueYdSJtXqqBLyjBw== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-destructuring@^7.8.3": - version "7.8.8" - resolved "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.8.8.tgz#fadb2bc8e90ccaf5658de6f8d4d22ff6272a2f4b" - integrity sha512-eRJu4Vs2rmttFCdhPUM3bV0Yo/xPSdPw6ML9KHs/bjB4bLA5HXlbvYXPOD5yASodGod+krjYx21xm1QmL8dCJQ== +"@babel/plugin-transform-destructuring@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.10.4.tgz#70ddd2b3d1bea83d01509e9bb25ddb3a74fc85e5" + integrity sha512-+WmfvyfsyF603iPa6825mq6Qrb7uLjTOsa3XOFzlYcYDHSS4QmpOWOL0NNBY5qMbvrcf3tq0Cw+v4lxswOBpgA== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-dotall-regex@^7.4.4", "@babel/plugin-transform-dotall-regex@^7.8.3": +"@babel/plugin-transform-dotall-regex@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.10.4.tgz#469c2062105c1eb6a040eaf4fac4b488078395ee" + integrity sha512-ZEAVvUTCMlMFAbASYSVQoxIbHm2OkG2MseW6bV2JjIygOjdVv8tuxrCTzj1+Rynh7ODb8GivUy7dzEXzEhuPaA== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.10.4" + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-transform-dotall-regex@^7.4.4": version "7.8.3" resolved "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.8.3.tgz#c3c6ec5ee6125c6993c5cbca20dc8621a9ea7a6e" integrity sha512-kLs1j9Nn4MQoBYdRXH6AeaXMbEJFaFu/v1nQkvib6QzTj8MZI5OQzqmD83/2jEM1z0DLilra5aWO5YpyC0ALIw== @@ -581,20 +776,20 @@ "@babel/helper-create-regexp-features-plugin" "^7.8.3" "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-duplicate-keys@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.8.3.tgz#8d12df309aa537f272899c565ea1768e286e21f1" - integrity sha512-s8dHiBUbcbSgipS4SMFuWGqCvyge5V2ZeAWzR6INTVC3Ltjig/Vw1G2Gztv0vU/hRG9X8IvKvYdoksnUfgXOEQ== +"@babel/plugin-transform-duplicate-keys@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.10.4.tgz#697e50c9fee14380fe843d1f306b295617431e47" + integrity sha512-GL0/fJnmgMclHiBTTWXNlYjYsA7rDrtsazHG6mglaGSTh0KsrW04qml+Bbz9FL0LcJIRwBWL5ZqlNHKTkU3xAA== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-exponentiation-operator@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.8.3.tgz#581a6d7f56970e06bf51560cd64f5e947b70d7b7" - integrity sha512-zwIpuIymb3ACcInbksHaNcR12S++0MDLKkiqXHl3AzpgdKlFNhog+z/K0+TGW+b0w5pgTq4H6IwV/WhxbGYSjQ== +"@babel/plugin-transform-exponentiation-operator@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.10.4.tgz#5ae338c57f8cf4001bdb35607ae66b92d665af2e" + integrity sha512-S5HgLVgkBcRdyQAHbKj+7KyuWx8C6t5oETmUuwz1pt3WTWJhsUV0WIIXuVvfXMxl/QQyHKlSCNNtaIamG8fysw== dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.8.3" - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.10.4" + "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-transform-flow-strip-types@^7.9.0": version "7.9.0" @@ -604,45 +799,55 @@ "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-syntax-flow" "^7.8.3" -"@babel/plugin-transform-for-of@^7.9.0": - version "7.9.0" - resolved "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.9.0.tgz#0f260e27d3e29cd1bb3128da5e76c761aa6c108e" - integrity sha512-lTAnWOpMwOXpyDx06N+ywmF3jNbafZEqZ96CGYabxHrxNX8l5ny7dt4bK/rGwAh9utyP2b2Hv7PlZh1AAS54FQ== +"@babel/plugin-transform-for-of@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.10.4.tgz#c08892e8819d3a5db29031b115af511dbbfebae9" + integrity sha512-ItdQfAzu9AlEqmusA/65TqJ79eRcgGmpPPFvBnGILXZH975G0LNjP1yjHvGgfuCxqrPPueXOPe+FsvxmxKiHHQ== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-function-name@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.8.3.tgz#279373cb27322aaad67c2683e776dfc47196ed8b" - integrity sha512-rO/OnDS78Eifbjn5Py9v8y0aR+aSYhDhqAwVfsTl0ERuMZyr05L1aFSCJnbv2mmsLkit/4ReeQ9N2BgLnOcPCQ== +"@babel/plugin-transform-function-name@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.10.4.tgz#6a467880e0fc9638514ba369111811ddbe2644b7" + integrity sha512-OcDCq2y5+E0dVD5MagT5X+yTRbcvFjDI2ZVAottGH6tzqjx/LKpgkUepu3hp/u4tZBzxxpNGwLsAvGBvQ2mJzg== dependencies: - "@babel/helper-function-name" "^7.8.3" - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-function-name" "^7.10.4" + "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-literals@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.8.3.tgz#aef239823d91994ec7b68e55193525d76dbd5dc1" - integrity sha512-3Tqf8JJ/qB7TeldGl+TT55+uQei9JfYaregDcEAyBZ7akutriFrt6C/wLYIer6OYhleVQvH/ntEhjE/xMmy10A== +"@babel/plugin-transform-literals@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.10.4.tgz#9f42ba0841100a135f22712d0e391c462f571f3c" + integrity sha512-Xd/dFSTEVuUWnyZiMu76/InZxLTYilOSr1UlHV+p115Z/Le2Fi1KXkJUYz0b42DfndostYlPub3m8ZTQlMaiqQ== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-member-expression-literals@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.8.3.tgz#963fed4b620ac7cbf6029c755424029fa3a40410" - integrity sha512-3Wk2EXhnw+rP+IDkK6BdtPKsUE5IeZ6QOGrPYvw52NwBStw9V1ZVzxgK6fSKSxqUvH9eQPR3tm3cOq79HlsKYA== +"@babel/plugin-transform-member-expression-literals@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.10.4.tgz#b1ec44fcf195afcb8db2c62cd8e551c881baf8b7" + integrity sha512-0bFOvPyAoTBhtcJLr9VcwZqKmSjFml1iVxvPL0ReomGU53CX53HsM4h2SzckNdkQcHox1bpAqzxBI1Y09LlBSw== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-modules-amd@^7.9.0": - version "7.9.0" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.9.0.tgz#19755ee721912cf5bb04c07d50280af3484efef4" - integrity sha512-vZgDDF003B14O8zJy0XXLnPH4sg+9X5hFBBGN1V+B2rgrB+J2xIypSN6Rk9imB2hSTHQi5OHLrFWsZab1GMk+Q== +"@babel/plugin-transform-modules-amd@^7.10.4": + version "7.10.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.10.5.tgz#1b9cddaf05d9e88b3aad339cb3e445c4f020a9b1" + integrity sha512-elm5uruNio7CTLFItVC/rIzKLfQ17+fX7EVz5W0TMgIHFo1zY0Ozzx+lgwhL4plzl8OzVn6Qasx5DeEFyoNiRw== dependencies: - "@babel/helper-module-transforms" "^7.9.0" - "@babel/helper-plugin-utils" "^7.8.3" - babel-plugin-dynamic-import-node "^2.3.0" + "@babel/helper-module-transforms" "^7.10.5" + "@babel/helper-plugin-utils" "^7.10.4" + babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-commonjs@^7.4.4", "@babel/plugin-transform-modules-commonjs@^7.9.0": +"@babel/plugin-transform-modules-commonjs@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.10.4.tgz#66667c3eeda1ebf7896d41f1f16b17105a2fbca0" + integrity sha512-Xj7Uq5o80HDLlW64rVfDBhao6OX89HKUmb+9vWYaLXBZOma4gA6tw4Ni1O5qVDoZWUV0fxMYA0aYzOawz0l+1w== + dependencies: + "@babel/helper-module-transforms" "^7.10.4" + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-simple-access" "^7.10.4" + babel-plugin-dynamic-import-node "^2.3.3" + +"@babel/plugin-transform-modules-commonjs@^7.4.4": version "7.9.6" resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.9.6.tgz#64b7474a4279ee588cacd1906695ca721687c277" integrity sha512-7H25fSlLcn+iYimmsNe3uK1at79IE6SKW9q0/QeEHTMC9MdOZ+4bA+T1VFB5fgOqBWoqlifXRzYD0JPdmIrgSQ== @@ -652,231 +857,249 @@ "@babel/helper-simple-access" "^7.8.3" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-systemjs@^7.9.0": - version "7.9.0" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.9.0.tgz#e9fd46a296fc91e009b64e07ddaa86d6f0edeb90" - integrity sha512-FsiAv/nao/ud2ZWy4wFacoLOm5uxl0ExSQ7ErvP7jpoihLR6Cq90ilOFyX9UXct3rbtKsAiZ9kFt5XGfPe/5SQ== +"@babel/plugin-transform-modules-systemjs@^7.10.4": + version "7.10.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.10.5.tgz#6270099c854066681bae9e05f87e1b9cadbe8c85" + integrity sha512-f4RLO/OL14/FP1AEbcsWMzpbUz6tssRaeQg11RH1BP/XnPpRoVwgeYViMFacnkaw4k4wjRSjn3ip1Uw9TaXuMw== dependencies: - "@babel/helper-hoist-variables" "^7.8.3" - "@babel/helper-module-transforms" "^7.9.0" - "@babel/helper-plugin-utils" "^7.8.3" - babel-plugin-dynamic-import-node "^2.3.0" + "@babel/helper-hoist-variables" "^7.10.4" + "@babel/helper-module-transforms" "^7.10.5" + "@babel/helper-plugin-utils" "^7.10.4" + babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-umd@^7.9.0": - version "7.9.0" - resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.9.0.tgz#e909acae276fec280f9b821a5f38e1f08b480697" - integrity sha512-uTWkXkIVtg/JGRSIABdBoMsoIeoHQHPTL0Y2E7xf5Oj7sLqwVsNXOkNk0VJc7vF0IMBsPeikHxFjGe+qmwPtTQ== +"@babel/plugin-transform-modules-umd@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.10.4.tgz#9a8481fe81b824654b3a0b65da3df89f3d21839e" + integrity sha512-mohW5q3uAEt8T45YT7Qc5ws6mWgJAaL/8BfWD9Dodo1A3RKWli8wTS+WiQ/knF+tXlPirW/1/MqzzGfCExKECA== dependencies: - "@babel/helper-module-transforms" "^7.9.0" - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-module-transforms" "^7.10.4" + "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-named-capturing-groups-regex@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.8.3.tgz#a2a72bffa202ac0e2d0506afd0939c5ecbc48c6c" - integrity sha512-f+tF/8UVPU86TrCb06JoPWIdDpTNSGGcAtaD9mLP0aYGA0OS0j7j7DHJR0GTFrUZPUU6loZhbsVZgTh0N+Qdnw== +"@babel/plugin-transform-named-capturing-groups-regex@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.10.4.tgz#78b4d978810b6f3bcf03f9e318f2fc0ed41aecb6" + integrity sha512-V6LuOnD31kTkxQPhKiVYzYC/Jgdq53irJC/xBSmqcNcqFGV+PER4l6rU5SH2Vl7bH9mLDHcc0+l9HUOe4RNGKA== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.8.3" + "@babel/helper-create-regexp-features-plugin" "^7.10.4" -"@babel/plugin-transform-new-target@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.8.3.tgz#60cc2ae66d85c95ab540eb34babb6434d4c70c43" - integrity sha512-QuSGysibQpyxexRyui2vca+Cmbljo8bcRckgzYV4kRIsHpVeyeC3JDO63pY+xFZ6bWOBn7pfKZTqV4o/ix9sFw== +"@babel/plugin-transform-new-target@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.10.4.tgz#9097d753cb7b024cb7381a3b2e52e9513a9c6888" + integrity sha512-YXwWUDAH/J6dlfwqlWsztI2Puz1NtUAubXhOPLQ5gjR/qmQ5U96DY4FQO8At33JN4XPBhrjB8I4eMmLROjjLjw== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-object-super@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.8.3.tgz#ebb6a1e7a86ffa96858bd6ac0102d65944261725" - integrity sha512-57FXk+gItG/GejofIyLIgBKTas4+pEU47IXKDBWFTxdPd7F80H8zybyAY7UoblVfBhBGs2EKM+bJUu2+iUYPDQ== +"@babel/plugin-transform-object-super@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.10.4.tgz#d7146c4d139433e7a6526f888c667e314a093894" + integrity sha512-5iTw0JkdRdJvr7sY0vHqTpnruUpTea32JHmq/atIWqsnNussbRzjEDyWep8UNztt1B5IusBYg8Irb0bLbiEBCQ== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" - "@babel/helper-replace-supers" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-replace-supers" "^7.10.4" -"@babel/plugin-transform-parameters@^7.8.7": - version "7.8.8" - resolved "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.8.8.tgz#0381de466c85d5404565243660c4496459525daf" - integrity sha512-hC4Ld/Ulpf1psQciWWwdnUspQoQco2bMzSrwU6TmzRlvoYQe4rQFy9vnCZDTlVeCQj0JPfL+1RX0V8hCJvkgBA== +"@babel/plugin-transform-parameters@^7.10.4": + version "7.10.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.10.5.tgz#59d339d58d0b1950435f4043e74e2510005e2c4a" + integrity sha512-xPHwUj5RdFV8l1wuYiu5S9fqWGM2DrYc24TMvUiRrPVm+SM3XeqU9BcokQX/kEUe+p2RBwy+yoiR1w/Blq6ubw== dependencies: - "@babel/helper-call-delegate" "^7.8.7" - "@babel/helper-get-function-arity" "^7.8.3" - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-get-function-arity" "^7.10.4" + "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-property-literals@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.8.3.tgz#33194300d8539c1ed28c62ad5087ba3807b98263" - integrity sha512-uGiiXAZMqEoQhRWMK17VospMZh5sXWg+dlh2soffpkAl96KAm+WZuJfa6lcELotSRmooLqg0MWdH6UUq85nmmg== +"@babel/plugin-transform-property-literals@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.10.4.tgz#f6fe54b6590352298785b83edd815d214c42e3c0" + integrity sha512-ofsAcKiUxQ8TY4sScgsGeR2vJIsfrzqvFb9GvJ5UdXDzl+MyYCaBj/FGzXuv7qE0aJcjWMILny1epqelnFlz8g== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-react-constant-elements@^7.0.0", "@babel/plugin-transform-react-constant-elements@^7.2.0", "@babel/plugin-transform-react-constant-elements@^7.6.3": - version "7.9.0" - resolved "https://registry.npmjs.org/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.9.0.tgz#a75abc936a3819edec42d3386d9f1c93f28d9d9e" - integrity sha512-wXMXsToAUOxJuBBEHajqKLFWcCkOSLshTI2ChCFFj1zDd7od4IOxiwLCOObNUvOpkxLpjIuaIdBMmNt6ocCPAw== +"@babel/plugin-transform-react-constant-elements@^7.0.0", "@babel/plugin-transform-react-constant-elements@^7.2.0", "@babel/plugin-transform-react-constant-elements@^7.6.3", "@babel/plugin-transform-react-constant-elements@^7.7.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.10.4.tgz#0f485260bf1c29012bb973e7e404749eaac12c9e" + integrity sha512-cYmQBW1pXrqBte1raMkAulXmi7rjg3VI6ZLg9QIic8Hq7BtYXaWuZSxsr2siOMI6SWwpxjWfnwhTUrd7JlAV7g== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-react-display-name@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.8.3.tgz#70ded987c91609f78353dd76d2fb2a0bb991e8e5" - integrity sha512-3Jy/PCw8Fe6uBKtEgz3M82ljt+lTg+xJaM4og+eyu83qLT87ZUSckn0wy7r31jflURWLO83TW6Ylf7lyXj3m5A== +"@babel/plugin-transform-react-display-name@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.10.4.tgz#b5795f4e3e3140419c3611b7a2a3832b9aef328d" + integrity sha512-Zd4X54Mu9SBfPGnEcaGcOrVAYOtjT2on8QZkLKEq1S/tHexG39d9XXGZv19VfRrDjPJzFmPfTAqOQS1pfFOujw== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-react-jsx-development@^7.9.0": - version "7.9.0" - resolved "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.9.0.tgz#3c2a130727caf00c2a293f0aed24520825dbf754" - integrity sha512-tK8hWKrQncVvrhvtOiPpKrQjfNX3DtkNLSX4ObuGcpS9p0QrGetKmlySIGR07y48Zft8WVgPakqd/bk46JrMSw== +"@babel/plugin-transform-react-jsx-development@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.10.4.tgz#6ec90f244394604623880e15ebc3c34c356258ba" + integrity sha512-RM3ZAd1sU1iQ7rI2dhrZRZGv0aqzNQMbkIUCS1txYpi9wHQ2ZHNjo5TwX+UD6pvFW4AbWqLVYvKy5qJSAyRGjQ== dependencies: - "@babel/helper-builder-react-jsx-experimental" "^7.9.0" - "@babel/helper-plugin-utils" "^7.8.3" - "@babel/plugin-syntax-jsx" "^7.8.3" + "@babel/helper-builder-react-jsx-experimental" "^7.10.4" + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/plugin-syntax-jsx" "^7.10.4" -"@babel/plugin-transform-react-jsx-self@^7.9.0": - version "7.9.0" - resolved "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.9.0.tgz#f4f26a325820205239bb915bad8e06fcadabb49b" - integrity sha512-K2ObbWPKT7KUTAoyjCsFilOkEgMvFG+y0FqOl6Lezd0/13kMkkjHskVsZvblRPj1PHA44PrToaZANrryppzTvQ== +"@babel/plugin-transform-react-jsx-self@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.10.4.tgz#cd301a5fed8988c182ed0b9d55e9bd6db0bd9369" + integrity sha512-yOvxY2pDiVJi0axdTWHSMi5T0DILN+H+SaeJeACHKjQLezEzhLx9nEF9xgpBLPtkZsks9cnb5P9iBEi21En3gg== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" - "@babel/plugin-syntax-jsx" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/plugin-syntax-jsx" "^7.10.4" -"@babel/plugin-transform-react-jsx-source@^7.9.0": - version "7.9.0" - resolved "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.9.0.tgz#89ef93025240dd5d17d3122294a093e5e0183de0" - integrity sha512-K6m3LlSnTSfRkM6FcRk8saNEeaeyG5k7AVkBU2bZK3+1zdkSED3qNdsWrUgQBeTVD2Tp3VMmerxVO2yM5iITmw== +"@babel/plugin-transform-react-jsx-source@^7.10.4": + version "7.10.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.10.5.tgz#34f1779117520a779c054f2cdd9680435b9222b4" + integrity sha512-wTeqHVkN1lfPLubRiZH3o73f4rfon42HpgxUSs86Nc+8QIcm/B9s8NNVXu/gwGcOyd7yDib9ikxoDLxJP0UiDA== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" - "@babel/plugin-syntax-jsx" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/plugin-syntax-jsx" "^7.10.4" -"@babel/plugin-transform-react-jsx@^7.9.1": - version "7.9.1" - resolved "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.9.1.tgz#d03af29396a6dc51bfa24eefd8005a9fd381152a" - integrity sha512-+xIZ6fPoix7h57CNO/ZeYADchg1tFyX9NDsnmNFFua8e1JNPln156mzS+8AQe1On2X2GLlANHJWHIXbMCqWDkQ== +"@babel/plugin-transform-react-jsx@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.10.4.tgz#673c9f913948764a4421683b2bef2936968fddf2" + integrity sha512-L+MfRhWjX0eI7Js093MM6MacKU4M6dnCRa/QPDwYMxjljzSCzzlzKzj9Pk4P3OtrPcxr2N3znR419nr3Xw+65A== dependencies: - "@babel/helper-builder-react-jsx" "^7.9.0" - "@babel/helper-builder-react-jsx-experimental" "^7.9.0" - "@babel/helper-plugin-utils" "^7.8.3" - "@babel/plugin-syntax-jsx" "^7.8.3" + "@babel/helper-builder-react-jsx" "^7.10.4" + "@babel/helper-builder-react-jsx-experimental" "^7.10.4" + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/plugin-syntax-jsx" "^7.10.4" -"@babel/plugin-transform-regenerator@^7.8.7": - version "7.8.7" - resolved "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.8.7.tgz#5e46a0dca2bee1ad8285eb0527e6abc9c37672f8" - integrity sha512-TIg+gAl4Z0a3WmD3mbYSk+J9ZUH6n/Yc57rtKRnlA/7rcCvpekHXe0CMZHP1gYp7/KLe9GHTuIba0vXmls6drA== +"@babel/plugin-transform-react-pure-annotations@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.10.4.tgz#3eefbb73db94afbc075f097523e445354a1c6501" + integrity sha512-+njZkqcOuS8RaPakrnR9KvxjoG1ASJWpoIv/doyWngId88JoFlPlISenGXjrVacZUIALGUr6eodRs1vmPnF23A== + dependencies: + "@babel/helper-annotate-as-pure" "^7.10.4" + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-transform-regenerator@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.10.4.tgz#2015e59d839074e76838de2159db421966fd8b63" + integrity sha512-3thAHwtor39A7C04XucbMg17RcZ3Qppfxr22wYzZNcVIkPHfpM9J0SO8zuCV6SZa265kxBJSrfKTvDCYqBFXGw== dependencies: regenerator-transform "^0.14.2" -"@babel/plugin-transform-reserved-words@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.8.3.tgz#9a0635ac4e665d29b162837dd3cc50745dfdf1f5" - integrity sha512-mwMxcycN3omKFDjDQUl+8zyMsBfjRFr0Zn/64I41pmjv4NJuqcYlEtezwYtw9TFd9WR1vN5kiM+O0gMZzO6L0A== +"@babel/plugin-transform-reserved-words@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.10.4.tgz#8f2682bcdcef9ed327e1b0861585d7013f8a54dd" + integrity sha512-hGsw1O6Rew1fkFbDImZIEqA8GoidwTAilwCyWqLBM9f+e/u/sQMQu7uX6dyokfOayRuuVfKOW4O7HvaBWM+JlQ== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-shorthand-properties@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.8.3.tgz#28545216e023a832d4d3a1185ed492bcfeac08c8" - integrity sha512-I9DI6Odg0JJwxCHzbzW08ggMdCezoWcuQRz3ptdudgwaHxTjxw5HgdFJmZIkIMlRymL6YiZcped4TTCB0JcC8w== +"@babel/plugin-transform-shorthand-properties@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.10.4.tgz#9fd25ec5cdd555bb7f473e5e6ee1c971eede4dd6" + integrity sha512-AC2K/t7o07KeTIxMoHneyX90v3zkm5cjHJEokrPEAGEy3UCp8sLKfnfOIGdZ194fyN4wfX/zZUWT9trJZ0qc+Q== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-spread@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.8.3.tgz#9c8ffe8170fdfb88b114ecb920b82fb6e95fe5e8" - integrity sha512-CkuTU9mbmAoFOI1tklFWYYbzX5qCIZVXPVy0jpXgGwkplCndQAa58s2jr66fTeQnA64bDox0HL4U56CFYoyC7g== +"@babel/plugin-transform-spread@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.10.4.tgz#4e2c85ea0d6abaee1b24dcfbbae426fe8d674cff" + integrity sha512-1e/51G/Ni+7uH5gktbWv+eCED9pP8ZpRhZB3jOaI3mmzfvJTWHkuyYTv0Z5PYtyM+Tr2Ccr9kUdQxn60fI5WuQ== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-sticky-regex@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.8.3.tgz#be7a1290f81dae767475452199e1f76d6175b100" - integrity sha512-9Spq0vGCD5Bb4Z/ZXXSK5wbbLFMG085qd2vhL1JYu1WcQ5bXqZBAYRzU1d+p79GcHs2szYv5pVQCX13QgldaWw== +"@babel/plugin-transform-sticky-regex@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.10.4.tgz#8f3889ee8657581130a29d9cc91d7c73b7c4a28d" + integrity sha512-Ddy3QZfIbEV0VYcVtFDCjeE4xwVTJWTmUtorAJkn6u/92Z/nWJNV+mILyqHKrUxXYKA2EoCilgoPePymKL4DvQ== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" - "@babel/helper-regex" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/helper-regex" "^7.10.4" -"@babel/plugin-transform-template-literals@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.8.3.tgz#7bfa4732b455ea6a43130adc0ba767ec0e402a80" - integrity sha512-820QBtykIQOLFT8NZOcTRJ1UNuztIELe4p9DCgvj4NK+PwluSJ49we7s9FB1HIGNIYT7wFUJ0ar2QpCDj0escQ== +"@babel/plugin-transform-template-literals@^7.10.4": + version "7.10.5" + resolved "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.10.5.tgz#78bc5d626a6642db3312d9d0f001f5e7639fde8c" + integrity sha512-V/lnPGIb+KT12OQikDvgSuesRX14ck5FfJXt6+tXhdkJ+Vsd0lDCVtF6jcB4rNClYFzaB2jusZ+lNISDk2mMMw== dependencies: - "@babel/helper-annotate-as-pure" "^7.8.3" - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-annotate-as-pure" "^7.10.4" + "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-typeof-symbol@^7.8.4": - version "7.8.4" - resolved "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.8.4.tgz#ede4062315ce0aaf8a657a920858f1a2f35fc412" - integrity sha512-2QKyfjGdvuNfHsb7qnBBlKclbD4CfshH2KvDabiijLMGXPHJXGxtDzwIF7bQP+T0ysw8fYTtxPafgfs/c1Lrqg== +"@babel/plugin-transform-typeof-symbol@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.10.4.tgz#9509f1a7eec31c4edbffe137c16cc33ff0bc5bfc" + integrity sha512-QqNgYwuuW0y0H+kUE/GWSR45t/ccRhe14Fs/4ZRouNNQsyd4o3PG4OtHiIrepbM2WKUBDAXKCAK/Lk4VhzTaGA== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-unicode-regex@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.8.3.tgz#0cef36e3ba73e5c57273effb182f46b91a1ecaad" - integrity sha512-+ufgJjYdmWfSQ+6NS9VGUR2ns8cjJjYbrbi11mZBTaWm+Fui/ncTLFF28Ei1okavY+xkojGr1eJxNsWYeA5aZw== +"@babel/plugin-transform-unicode-escapes@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.10.4.tgz#feae523391c7651ddac115dae0a9d06857892007" + integrity sha512-y5XJ9waMti2J+e7ij20e+aH+fho7Wb7W8rNuu72aKRwCHFqQdhkdU2lo3uZ9tQuboEJcUFayXdARhcxLQ3+6Fg== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.8.3" - "@babel/helper-plugin-utils" "^7.8.3" + "@babel/helper-plugin-utils" "^7.10.4" -"@babel/preset-env@^7.4.5": - version "7.9.0" - resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.9.0.tgz#a5fc42480e950ae8f5d9f8f2bbc03f52722df3a8" - integrity sha512-712DeRXT6dyKAM/FMbQTV/FvRCms2hPCx+3weRjZ8iQVQWZejWWk1wwG6ViWMyqb/ouBbGOl5b6aCk0+j1NmsQ== +"@babel/plugin-transform-unicode-regex@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.10.4.tgz#e56d71f9282fac6db09c82742055576d5e6d80a8" + integrity sha512-wNfsc4s8N2qnIwpO/WP2ZiSyjfpTamT2C9V9FDH/Ljub9zw6P3SjkXcFmc0RQUt96k2fmIvtla2MMjgTwIAC+A== dependencies: - "@babel/compat-data" "^7.9.0" - "@babel/helper-compilation-targets" "^7.8.7" - "@babel/helper-module-imports" "^7.8.3" - "@babel/helper-plugin-utils" "^7.8.3" - "@babel/plugin-proposal-async-generator-functions" "^7.8.3" - "@babel/plugin-proposal-dynamic-import" "^7.8.3" - "@babel/plugin-proposal-json-strings" "^7.8.3" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-proposal-numeric-separator" "^7.8.3" - "@babel/plugin-proposal-object-rest-spread" "^7.9.0" - "@babel/plugin-proposal-optional-catch-binding" "^7.8.3" - "@babel/plugin-proposal-optional-chaining" "^7.9.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.8.3" + "@babel/helper-create-regexp-features-plugin" "^7.10.4" + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/preset-env@^7.4.5", "@babel/preset-env@^7.9.5": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.10.4.tgz#fbf57f9a803afd97f4f32e4f798bb62e4b2bef5f" + integrity sha512-tcmuQ6vupfMZPrLrc38d0sF2OjLT3/bZ0dry5HchNCQbrokoQi4reXqclvkkAT5b+gWc23meVWpve5P/7+w/zw== + dependencies: + "@babel/compat-data" "^7.10.4" + "@babel/helper-compilation-targets" "^7.10.4" + "@babel/helper-module-imports" "^7.10.4" + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/plugin-proposal-async-generator-functions" "^7.10.4" + "@babel/plugin-proposal-class-properties" "^7.10.4" + "@babel/plugin-proposal-dynamic-import" "^7.10.4" + "@babel/plugin-proposal-json-strings" "^7.10.4" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.10.4" + "@babel/plugin-proposal-numeric-separator" "^7.10.4" + "@babel/plugin-proposal-object-rest-spread" "^7.10.4" + "@babel/plugin-proposal-optional-catch-binding" "^7.10.4" + "@babel/plugin-proposal-optional-chaining" "^7.10.4" + "@babel/plugin-proposal-private-methods" "^7.10.4" + "@babel/plugin-proposal-unicode-property-regex" "^7.10.4" "@babel/plugin-syntax-async-generators" "^7.8.0" + "@babel/plugin-syntax-class-properties" "^7.10.4" "@babel/plugin-syntax-dynamic-import" "^7.8.0" "@babel/plugin-syntax-json-strings" "^7.8.0" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.0" - "@babel/plugin-syntax-numeric-separator" "^7.8.0" + "@babel/plugin-syntax-numeric-separator" "^7.10.4" "@babel/plugin-syntax-object-rest-spread" "^7.8.0" "@babel/plugin-syntax-optional-catch-binding" "^7.8.0" "@babel/plugin-syntax-optional-chaining" "^7.8.0" - "@babel/plugin-syntax-top-level-await" "^7.8.3" - "@babel/plugin-transform-arrow-functions" "^7.8.3" - "@babel/plugin-transform-async-to-generator" "^7.8.3" - "@babel/plugin-transform-block-scoped-functions" "^7.8.3" - "@babel/plugin-transform-block-scoping" "^7.8.3" - "@babel/plugin-transform-classes" "^7.9.0" - "@babel/plugin-transform-computed-properties" "^7.8.3" - "@babel/plugin-transform-destructuring" "^7.8.3" - "@babel/plugin-transform-dotall-regex" "^7.8.3" - "@babel/plugin-transform-duplicate-keys" "^7.8.3" - "@babel/plugin-transform-exponentiation-operator" "^7.8.3" - "@babel/plugin-transform-for-of" "^7.9.0" - "@babel/plugin-transform-function-name" "^7.8.3" - "@babel/plugin-transform-literals" "^7.8.3" - "@babel/plugin-transform-member-expression-literals" "^7.8.3" - "@babel/plugin-transform-modules-amd" "^7.9.0" - "@babel/plugin-transform-modules-commonjs" "^7.9.0" - "@babel/plugin-transform-modules-systemjs" "^7.9.0" - "@babel/plugin-transform-modules-umd" "^7.9.0" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.8.3" - "@babel/plugin-transform-new-target" "^7.8.3" - "@babel/plugin-transform-object-super" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.8.7" - "@babel/plugin-transform-property-literals" "^7.8.3" - "@babel/plugin-transform-regenerator" "^7.8.7" - "@babel/plugin-transform-reserved-words" "^7.8.3" - "@babel/plugin-transform-shorthand-properties" "^7.8.3" - "@babel/plugin-transform-spread" "^7.8.3" - "@babel/plugin-transform-sticky-regex" "^7.8.3" - "@babel/plugin-transform-template-literals" "^7.8.3" - "@babel/plugin-transform-typeof-symbol" "^7.8.4" - "@babel/plugin-transform-unicode-regex" "^7.8.3" + "@babel/plugin-syntax-top-level-await" "^7.10.4" + "@babel/plugin-transform-arrow-functions" "^7.10.4" + "@babel/plugin-transform-async-to-generator" "^7.10.4" + "@babel/plugin-transform-block-scoped-functions" "^7.10.4" + "@babel/plugin-transform-block-scoping" "^7.10.4" + "@babel/plugin-transform-classes" "^7.10.4" + "@babel/plugin-transform-computed-properties" "^7.10.4" + "@babel/plugin-transform-destructuring" "^7.10.4" + "@babel/plugin-transform-dotall-regex" "^7.10.4" + "@babel/plugin-transform-duplicate-keys" "^7.10.4" + "@babel/plugin-transform-exponentiation-operator" "^7.10.4" + "@babel/plugin-transform-for-of" "^7.10.4" + "@babel/plugin-transform-function-name" "^7.10.4" + "@babel/plugin-transform-literals" "^7.10.4" + "@babel/plugin-transform-member-expression-literals" "^7.10.4" + "@babel/plugin-transform-modules-amd" "^7.10.4" + "@babel/plugin-transform-modules-commonjs" "^7.10.4" + "@babel/plugin-transform-modules-systemjs" "^7.10.4" + "@babel/plugin-transform-modules-umd" "^7.10.4" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.10.4" + "@babel/plugin-transform-new-target" "^7.10.4" + "@babel/plugin-transform-object-super" "^7.10.4" + "@babel/plugin-transform-parameters" "^7.10.4" + "@babel/plugin-transform-property-literals" "^7.10.4" + "@babel/plugin-transform-regenerator" "^7.10.4" + "@babel/plugin-transform-reserved-words" "^7.10.4" + "@babel/plugin-transform-shorthand-properties" "^7.10.4" + "@babel/plugin-transform-spread" "^7.10.4" + "@babel/plugin-transform-sticky-regex" "^7.10.4" + "@babel/plugin-transform-template-literals" "^7.10.4" + "@babel/plugin-transform-typeof-symbol" "^7.10.4" + "@babel/plugin-transform-unicode-escapes" "^7.10.4" + "@babel/plugin-transform-unicode-regex" "^7.10.4" "@babel/preset-modules" "^0.1.3" - "@babel/types" "^7.9.0" - browserslist "^4.9.1" + "@babel/types" "^7.10.4" + browserslist "^4.12.0" core-js-compat "^3.6.2" invariant "^2.2.2" levenary "^1.1.1" @@ -901,17 +1124,18 @@ "@babel/types" "^7.4.4" esutils "^2.0.2" -"@babel/preset-react@^7.0.0": - version "7.9.1" - resolved "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.9.1.tgz#b346403c36d58c3bb544148272a0cefd9c28677a" - integrity sha512-aJBYF23MPj0RNdp/4bHnAP0NVqqZRr9kl0NAOP4nJCex6OYVio59+dnQzsAWFuogdLyeaKA1hmfUIVZkY5J+TQ== +"@babel/preset-react@^7.0.0", "@babel/preset-react@^7.9.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.10.4.tgz#92e8a66d816f9911d11d4cc935be67adfc82dbcf" + integrity sha512-BrHp4TgOIy4M19JAfO1LhycVXOPWdDbTRep7eVyatf174Hff+6Uk53sDyajqZPu8W1qXRBiYOfIamek6jA7YVw== dependencies: - "@babel/helper-plugin-utils" "^7.8.3" - "@babel/plugin-transform-react-display-name" "^7.8.3" - "@babel/plugin-transform-react-jsx" "^7.9.1" - "@babel/plugin-transform-react-jsx-development" "^7.9.0" - "@babel/plugin-transform-react-jsx-self" "^7.9.0" - "@babel/plugin-transform-react-jsx-source" "^7.9.0" + "@babel/helper-plugin-utils" "^7.10.4" + "@babel/plugin-transform-react-display-name" "^7.10.4" + "@babel/plugin-transform-react-jsx" "^7.10.4" + "@babel/plugin-transform-react-jsx-development" "^7.10.4" + "@babel/plugin-transform-react-jsx-self" "^7.10.4" + "@babel/plugin-transform-react-jsx-source" "^7.10.4" + "@babel/plugin-transform-react-pure-annotations" "^7.10.4" "@babel/runtime-corejs2@^7.8.7": version "7.10.3" @@ -951,6 +1175,15 @@ dependencies: regenerator-runtime "^0.13.4" +"@babel/template@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz#3251996c4200ebc71d1a8fc405fba940f36ba278" + integrity sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA== + dependencies: + "@babel/code-frame" "^7.10.4" + "@babel/parser" "^7.10.4" + "@babel/types" "^7.10.4" + "@babel/template@^7.3.3", "@babel/template@^7.7.4", "@babel/template@^7.8.3", "@babel/template@^7.8.6": version "7.8.6" resolved "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz#86b22af15f828dfb086474f964dcc3e39c43ce2b" @@ -960,7 +1193,7 @@ "@babel/parser" "^7.8.6" "@babel/types" "^7.8.6" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.7.4", "@babel/traverse@^7.8.3", "@babel/traverse@^7.8.6", "@babel/traverse@^7.9.6": +"@babel/traverse@^7.1.0", "@babel/traverse@^7.7.4", "@babel/traverse@^7.8.6", "@babel/traverse@^7.9.6": version "7.9.6" resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.6.tgz#5540d7577697bf619cc57b92aa0f1c231a94f442" integrity sha512-b3rAHSjbxy6VEAvlxM8OV/0X4XrG72zoxme6q1MOoe2vd0bEc+TwayhuC1+Dfgqh1QEG+pj7atQqvUprHIccsg== @@ -975,7 +1208,22 @@ globals "^11.1.0" lodash "^4.17.13" -"@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4", "@babel/types@^7.8.3", "@babel/types@^7.8.6", "@babel/types@^7.8.7", "@babel/types@^7.9.0", "@babel/types@^7.9.5", "@babel/types@^7.9.6": +"@babel/traverse@^7.10.4": + version "7.10.5" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.5.tgz#77ce464f5b258be265af618d8fddf0536f20b564" + integrity sha512-yc/fyv2gUjPqzTz0WHeRJH2pv7jA9kA7mBX2tXl/x5iOE81uaVPuGPtaYk7wmkx4b67mQ7NqI8rmT2pF47KYKQ== + dependencies: + "@babel/code-frame" "^7.10.4" + "@babel/generator" "^7.10.5" + "@babel/helper-function-name" "^7.10.4" + "@babel/helper-split-export-declaration" "^7.10.4" + "@babel/parser" "^7.10.5" + "@babel/types" "^7.10.5" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.19" + +"@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4", "@babel/types@^7.8.3", "@babel/types@^7.8.6", "@babel/types@^7.9.0", "@babel/types@^7.9.5", "@babel/types@^7.9.6": version "7.9.6" resolved "https://registry.npmjs.org/@babel/types/-/types-7.9.6.tgz#2c5502b427251e9de1bd2dff95add646d95cc9f7" integrity sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA== @@ -984,6 +1232,15 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" +"@babel/types@^7.10.4", "@babel/types@^7.10.5": + version "7.10.5" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.10.5.tgz#d88ae7e2fde86bfbfe851d4d81afa70a997b5d15" + integrity sha512-ixV66KWfCI6GKoA/2H9v6bQdbfXEwwpOdQ8cRvb4F+eyvhlaHxWFMQB4+3d9QFJXZsiiiqVrewNV0DFEQpyT4Q== + dependencies: + "@babel/helper-validator-identifier" "^7.10.4" + lodash "^4.17.19" + to-fast-properties "^2.0.0" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -3312,41 +3569,81 @@ resolved "https://registry.npmjs.org/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-4.2.0.tgz#dadcb6218503532d6884b210e7f3c502caaa44b1" integrity sha512-j7KnilGyZzYr/jhcrSYS3FGWMZVaqyCG0vzMCwzvei0coIkczuYMcniK07nI0aHJINciujjH11T72ICW5eL5Ig== +"@svgr/babel-plugin-add-jsx-attribute@^5.4.0": + version "5.4.0" + resolved "https://registry.npmjs.org/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-5.4.0.tgz#81ef61947bb268eb9d50523446f9c638fb355906" + integrity sha512-ZFf2gs/8/6B8PnSofI0inYXr2SDNTDScPXhN7k5EqD4aZ3gi6u+rbmZHVB8IM3wDyx8ntKACZbtXSm7oZGRqVg== + "@svgr/babel-plugin-remove-jsx-attribute@^4.2.0": version "4.2.0" resolved "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-attribute/-/babel-plugin-remove-jsx-attribute-4.2.0.tgz#297550b9a8c0c7337bea12bdfc8a80bb66f85abc" integrity sha512-3XHLtJ+HbRCH4n28S7y/yZoEQnRpl0tvTZQsHqvaeNXPra+6vE5tbRliH3ox1yZYPCxrlqaJT/Mg+75GpDKlvQ== +"@svgr/babel-plugin-remove-jsx-attribute@^5.4.0": + version "5.4.0" + resolved "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-attribute/-/babel-plugin-remove-jsx-attribute-5.4.0.tgz#6b2c770c95c874654fd5e1d5ef475b78a0a962ef" + integrity sha512-yaS4o2PgUtwLFGTKbsiAy6D0o3ugcUhWK0Z45umJ66EPWunAz9fuFw2gJuje6wqQvQWOTJvIahUwndOXb7QCPg== + "@svgr/babel-plugin-remove-jsx-empty-expression@^4.2.0": version "4.2.0" resolved "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-empty-expression/-/babel-plugin-remove-jsx-empty-expression-4.2.0.tgz#c196302f3e68eab6a05e98af9ca8570bc13131c7" integrity sha512-yTr2iLdf6oEuUE9MsRdvt0NmdpMBAkgK8Bjhl6epb+eQWk6abBaX3d65UZ3E3FWaOwePyUgNyNCMVG61gGCQ7w== +"@svgr/babel-plugin-remove-jsx-empty-expression@^5.0.1": + version "5.0.1" + resolved "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-empty-expression/-/babel-plugin-remove-jsx-empty-expression-5.0.1.tgz#25621a8915ed7ad70da6cea3d0a6dbc2ea933efd" + integrity sha512-LA72+88A11ND/yFIMzyuLRSMJ+tRKeYKeQ+mR3DcAZ5I4h5CPWN9AHyUzJbWSYp/u2u0xhmgOe0+E41+GjEueA== + "@svgr/babel-plugin-replace-jsx-attribute-value@^4.2.0": version "4.2.0" resolved "https://registry.npmjs.org/@svgr/babel-plugin-replace-jsx-attribute-value/-/babel-plugin-replace-jsx-attribute-value-4.2.0.tgz#310ec0775de808a6a2e4fd4268c245fd734c1165" integrity sha512-U9m870Kqm0ko8beHawRXLGLvSi/ZMrl89gJ5BNcT452fAjtF2p4uRzXkdzvGJJJYBgx7BmqlDjBN/eCp5AAX2w== +"@svgr/babel-plugin-replace-jsx-attribute-value@^5.0.1": + version "5.0.1" + resolved "https://registry.npmjs.org/@svgr/babel-plugin-replace-jsx-attribute-value/-/babel-plugin-replace-jsx-attribute-value-5.0.1.tgz#0b221fc57f9fcd10e91fe219e2cd0dd03145a897" + integrity sha512-PoiE6ZD2Eiy5mK+fjHqwGOS+IXX0wq/YDtNyIgOrc6ejFnxN4b13pRpiIPbtPwHEc+NT2KCjteAcq33/F1Y9KQ== + "@svgr/babel-plugin-svg-dynamic-title@^4.3.3": version "4.3.3" resolved "https://registry.npmjs.org/@svgr/babel-plugin-svg-dynamic-title/-/babel-plugin-svg-dynamic-title-4.3.3.tgz#2cdedd747e5b1b29ed4c241e46256aac8110dd93" integrity sha512-w3Be6xUNdwgParsvxkkeZb545VhXEwjGMwExMVBIdPQJeyMQHqm9Msnb2a1teHBqUYL66qtwfhNkbj1iarCG7w== +"@svgr/babel-plugin-svg-dynamic-title@^5.4.0": + version "5.4.0" + resolved "https://registry.npmjs.org/@svgr/babel-plugin-svg-dynamic-title/-/babel-plugin-svg-dynamic-title-5.4.0.tgz#139b546dd0c3186b6e5db4fefc26cb0baea729d7" + integrity sha512-zSOZH8PdZOpuG1ZVx/cLVePB2ibo3WPpqo7gFIjLV9a0QsuQAzJiwwqmuEdTaW2pegyBE17Uu15mOgOcgabQZg== + "@svgr/babel-plugin-svg-em-dimensions@^4.2.0": version "4.2.0" resolved "https://registry.npmjs.org/@svgr/babel-plugin-svg-em-dimensions/-/babel-plugin-svg-em-dimensions-4.2.0.tgz#9a94791c9a288108d20a9d2cc64cac820f141391" integrity sha512-C0Uy+BHolCHGOZ8Dnr1zXy/KgpBOkEUYY9kI/HseHVPeMbluaX3CijJr7D4C5uR8zrc1T64nnq/k63ydQuGt4w== +"@svgr/babel-plugin-svg-em-dimensions@^5.4.0": + version "5.4.0" + resolved "https://registry.npmjs.org/@svgr/babel-plugin-svg-em-dimensions/-/babel-plugin-svg-em-dimensions-5.4.0.tgz#6543f69526632a133ce5cabab965deeaea2234a0" + integrity sha512-cPzDbDA5oT/sPXDCUYoVXEmm3VIoAWAPT6mSPTJNbQaBNUuEKVKyGH93oDY4e42PYHRW67N5alJx/eEol20abw== + "@svgr/babel-plugin-transform-react-native-svg@^4.2.0": version "4.2.0" resolved "https://registry.npmjs.org/@svgr/babel-plugin-transform-react-native-svg/-/babel-plugin-transform-react-native-svg-4.2.0.tgz#151487322843359a1ca86b21a3815fd21a88b717" integrity sha512-7YvynOpZDpCOUoIVlaaOUU87J4Z6RdD6spYN4eUb5tfPoKGSF9OG2NuhgYnq4jSkAxcpMaXWPf1cePkzmqTPNw== +"@svgr/babel-plugin-transform-react-native-svg@^5.4.0": + version "5.4.0" + resolved "https://registry.npmjs.org/@svgr/babel-plugin-transform-react-native-svg/-/babel-plugin-transform-react-native-svg-5.4.0.tgz#00bf9a7a73f1cad3948cdab1f8dfb774750f8c80" + integrity sha512-3eYP/SaopZ41GHwXma7Rmxcv9uRslRDTY1estspeB1w1ueZWd/tPlMfEOoccYpEMZU3jD4OU7YitnXcF5hLW2Q== + "@svgr/babel-plugin-transform-svg-component@^4.2.0": version "4.2.0" resolved "https://registry.npmjs.org/@svgr/babel-plugin-transform-svg-component/-/babel-plugin-transform-svg-component-4.2.0.tgz#5f1e2f886b2c85c67e76da42f0f6be1b1767b697" integrity sha512-hYfYuZhQPCBVotABsXKSCfel2slf/yvJY8heTVX1PCTaq/IgASq1IyxPPKJ0chWREEKewIU/JMSsIGBtK1KKxw== +"@svgr/babel-plugin-transform-svg-component@^5.4.0": + version "5.4.0" + resolved "https://registry.npmjs.org/@svgr/babel-plugin-transform-svg-component/-/babel-plugin-transform-svg-component-5.4.0.tgz#a2212b4d018e6075a058bb7e220a66959ef7a03c" + integrity sha512-zLl4Fl3NvKxxjWNkqEcpdSOpQ3LGVH2BNFQ6vjaK6sFo2IrSznrhURIPI0HAphKiiIwNYjAfE0TNoQDSZv0U9A== + "@svgr/babel-preset@^4.3.3": version "4.3.3" resolved "https://registry.npmjs.org/@svgr/babel-preset/-/babel-preset-4.3.3.tgz#a75d8c2f202ac0e5774e6bfc165d028b39a1316c" @@ -3361,6 +3658,20 @@ "@svgr/babel-plugin-transform-react-native-svg" "^4.2.0" "@svgr/babel-plugin-transform-svg-component" "^4.2.0" +"@svgr/babel-preset@^5.4.0": + version "5.4.0" + resolved "https://registry.npmjs.org/@svgr/babel-preset/-/babel-preset-5.4.0.tgz#da21854643e1c4ad2279239baa7d5a8b128c1f15" + integrity sha512-Gyx7cCxua04DBtyILTYdQxeO/pwfTBev6+eXTbVbxe4HTGhOUW6yo7PSbG2p6eJMl44j6XSequ0ZDP7bl0nu9A== + dependencies: + "@svgr/babel-plugin-add-jsx-attribute" "^5.4.0" + "@svgr/babel-plugin-remove-jsx-attribute" "^5.4.0" + "@svgr/babel-plugin-remove-jsx-empty-expression" "^5.0.1" + "@svgr/babel-plugin-replace-jsx-attribute-value" "^5.0.1" + "@svgr/babel-plugin-svg-dynamic-title" "^5.4.0" + "@svgr/babel-plugin-svg-em-dimensions" "^5.4.0" + "@svgr/babel-plugin-transform-react-native-svg" "^5.4.0" + "@svgr/babel-plugin-transform-svg-component" "^5.4.0" + "@svgr/core@^4.3.3": version "4.3.3" resolved "https://registry.npmjs.org/@svgr/core/-/core-4.3.3.tgz#b37b89d5b757dc66e8c74156d00c368338d24293" @@ -3370,6 +3681,15 @@ camelcase "^5.3.1" cosmiconfig "^5.2.1" +"@svgr/core@^5.4.0": + version "5.4.0" + resolved "https://registry.npmjs.org/@svgr/core/-/core-5.4.0.tgz#655378ee43679eb94fee3d4e1976e38252dff8e7" + integrity sha512-hWGm1DCCvd4IEn7VgDUHYiC597lUYhFau2lwJBYpQWDirYLkX4OsXu9IslPgJ9UpP7wsw3n2Ffv9sW7SXJVfqQ== + dependencies: + "@svgr/plugin-jsx" "^5.4.0" + camelcase "^6.0.0" + cosmiconfig "^6.0.0" + "@svgr/hast-util-to-babel-ast@^4.3.2": version "4.3.2" resolved "https://registry.npmjs.org/@svgr/hast-util-to-babel-ast/-/hast-util-to-babel-ast-4.3.2.tgz#1d5a082f7b929ef8f1f578950238f630e14532b8" @@ -3377,6 +3697,13 @@ dependencies: "@babel/types" "^7.4.4" +"@svgr/hast-util-to-babel-ast@^5.4.0": + version "5.4.0" + resolved "https://registry.npmjs.org/@svgr/hast-util-to-babel-ast/-/hast-util-to-babel-ast-5.4.0.tgz#bb5d002e428f510aa5b53ec0a02377a95b367715" + integrity sha512-+U0TZZpPsP2V1WvVhqAOSTk+N+CjYHdZx+x9UBa1eeeZDXwH8pt0CrQf2+SvRl/h2CAPRFkm+Ey96+jKP8Bsgg== + dependencies: + "@babel/types" "^7.9.5" + "@svgr/plugin-jsx@4.3.x", "@svgr/plugin-jsx@^4.3.3": version "4.3.3" resolved "https://registry.npmjs.org/@svgr/plugin-jsx/-/plugin-jsx-4.3.3.tgz#e2ba913dbdfbe85252a34db101abc7ebd50992fa" @@ -3387,6 +3714,16 @@ "@svgr/hast-util-to-babel-ast" "^4.3.2" svg-parser "^2.0.0" +"@svgr/plugin-jsx@^5.4.0": + version "5.4.0" + resolved "https://registry.npmjs.org/@svgr/plugin-jsx/-/plugin-jsx-5.4.0.tgz#ab47504c55615833c6db70fca2d7e489f509787c" + integrity sha512-SGzO4JZQ2HvGRKDzRga9YFSqOqaNrgLlQVaGvpZ2Iht2gwRp/tq+18Pvv9kS9ZqOMYgyix2LLxZMY1LOe9NPqw== + dependencies: + "@babel/core" "^7.7.5" + "@svgr/babel-preset" "^5.4.0" + "@svgr/hast-util-to-babel-ast" "^5.4.0" + svg-parser "^2.0.2" + "@svgr/plugin-svgo@4.3.x", "@svgr/plugin-svgo@^4.3.1": version "4.3.1" resolved "https://registry.npmjs.org/@svgr/plugin-svgo/-/plugin-svgo-4.3.1.tgz#daac0a3d872e3f55935c6588dd370336865e9e32" @@ -3396,19 +3733,28 @@ merge-deep "^3.0.2" svgo "^1.2.2" -"@svgr/rollup@4.3.x": - version "4.3.3" - resolved "https://registry.npmjs.org/@svgr/rollup/-/rollup-4.3.3.tgz#db8bc2746ae0930c14cba2409f417a6ac6aadb38" - integrity sha512-YwgnXN8xPRYFhkfoTUiZktjkjolthaK/lz0okzU09VcBvjx08R7yK1IEwXH3c98sMn8ORdNdiy4Qox78CMjljg== +"@svgr/plugin-svgo@^5.4.0": + version "5.4.0" + resolved "https://registry.npmjs.org/@svgr/plugin-svgo/-/plugin-svgo-5.4.0.tgz#45d9800b7099a6f7b4d85ebac89ab9abe8592f64" + integrity sha512-3Cgv3aYi1l6SHyzArV9C36yo4kgwVdF3zPQUC6/aCDUeXAofDYwE5kk3e3oT5ZO2a0N3lB+lLGvipBG6lnG8EA== dependencies: - "@babel/core" "^7.4.5" - "@babel/plugin-transform-react-constant-elements" "^7.0.0" - "@babel/preset-env" "^7.4.5" - "@babel/preset-react" "^7.0.0" - "@svgr/core" "^4.3.3" - "@svgr/plugin-jsx" "^4.3.3" - "@svgr/plugin-svgo" "^4.3.1" - rollup-pluginutils "^2.8.1" + cosmiconfig "^6.0.0" + merge-deep "^3.0.2" + svgo "^1.2.2" + +"@svgr/rollup@5.4.x": + version "5.4.0" + resolved "https://registry.npmjs.org/@svgr/rollup/-/rollup-5.4.0.tgz#b1946c8d2c13870397af014a105d40945b7371e5" + integrity sha512-hwYjrTddW6mFU9vwqRr1TULNvxiIxGdIbqrD5J7vtoATSfWazq/2JSnT4BmiH+/4kFXLEtjKuSKoDUotkOIAkg== + dependencies: + "@babel/core" "^7.7.5" + "@babel/plugin-transform-react-constant-elements" "^7.7.4" + "@babel/preset-env" "^7.9.5" + "@babel/preset-react" "^7.9.4" + "@svgr/core" "^5.4.0" + "@svgr/plugin-jsx" "^5.4.0" + "@svgr/plugin-svgo" "^5.4.0" + rollup-pluginutils "^2.8.2" "@svgr/webpack@4.3.x", "@svgr/webpack@^4.0.3": version "4.3.3" @@ -5561,7 +5907,7 @@ babel-plugin-add-react-displayname@^0.0.5: resolved "https://registry.npmjs.org/babel-plugin-add-react-displayname/-/babel-plugin-add-react-displayname-0.0.5.tgz#339d4cddb7b65fd62d1df9db9fe04de134122bd5" integrity sha1-M51M3be2X9YtHfnbn+BN4TQSK9U= -babel-plugin-dynamic-import-node@^2.3.0, babel-plugin-dynamic-import-node@^2.3.3: +babel-plugin-dynamic-import-node@^2.3.3: version "2.3.3" resolved "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz#84fda19c976ec5c6defef57f9427b3def66e17a3" integrity sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ== @@ -6111,7 +6457,7 @@ browserify-zlib@^0.2.0: dependencies: pako "~1.0.5" -browserslist@4.10.0, browserslist@^4.0.0, browserslist@^4.8.3, browserslist@^4.9.1: +browserslist@4.10.0, browserslist@^4.0.0, browserslist@^4.8.3: version "4.10.0" resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.10.0.tgz#f179737913eaf0d2b98e4926ac1ca6a15cbcc6a9" integrity sha512-TpfK0TDgv71dzuTsEAlQiHeWQ/tiPqgNZVdv046fvNtBZrjbv2O3TsWCDU0AWGJJKCF/KsjNdLzR9hXOsh/CfA== @@ -6130,6 +6476,16 @@ browserslist@4.7.0: electron-to-chromium "^1.3.247" node-releases "^1.1.29" +browserslist@^4.12.0: + version "4.13.0" + resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.13.0.tgz#42556cba011e1b0a2775b611cba6a8eca18e940d" + integrity sha512-MINatJ5ZNrLnQ6blGvePd/QOz9Xtu+Ne+x29iQSCHfkU5BugKVJwZKn/iiL8UbpIpa3JhviKjz+XxMo0m2caFQ== + dependencies: + caniuse-lite "^1.0.30001093" + electron-to-chromium "^1.3.488" + escalade "^3.0.1" + node-releases "^1.1.58" + bs-logger@0.x: version "0.2.6" resolved "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" @@ -6432,6 +6788,11 @@ caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000989, caniuse-lite@^1.0.30001020, can resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001035.tgz#2bb53b8aa4716b2ed08e088d4dc816a5fe089a1e" integrity sha512-C1ZxgkuA4/bUEdMbU5WrGY4+UhMFFiXrgNAfxiMIqWgFTWfv/xsZCS2xEHT2LMq7xAZfuAnu6mcqyDl0ZR6wLQ== +caniuse-lite@^1.0.30001093: + version "1.0.30001107" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001107.tgz#809360df7a5b3458f627aa46b0f6ed6d5239da9a" + integrity sha512-86rCH+G8onCmdN4VZzJet5uPELII59cUzDphko3thQFgAQG1RNa+sVLDoALIhRYmflo5iSIzWY3vu1XTWtNMQQ== + capture-exit@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4" @@ -8416,6 +8777,11 @@ electron-to-chromium@^1.3.247, electron-to-chromium@^1.3.378: resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.380.tgz#1e1f07091b42b54bccd0ad6d3a14f2b73b60dc9d" integrity sha512-2jhQxJKcjcSpVOQm0NAfuLq8o+130blrcawoumdXT6411xG/xIAOyZodO/y7WTaYlz/NHe3sCCAe/cJLnDsqTw== +electron-to-chromium@^1.3.488: + version "1.3.509" + resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.509.tgz#830fcb89cd66dc2984d18d794973b99e3f00584c" + integrity sha512-cN4lkjNRuTG8rtAqTOVgwpecEC2kbKA04PG6YijcKGHK/kD0xLjiqExcAOmLUwtXZRF8cBeam2I0VZcih919Ug== + elegant-spinner@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" @@ -8660,6 +9026,11 @@ esbuild@0.6.3: resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.6.3.tgz#a957e22f2503c745793514388110f9b55b3a6f83" integrity sha512-4lHgz/EvGLRQnDYzzrvW+eilaPHim5pCLz4mP0k0QIalD/n8Ji2NwQwoIa1uX+yKkbn9R/FAZvaEbodjx55rDg== +escalade@^3.0.1: + version "3.0.2" + resolved "https://registry.npmjs.org/escalade/-/escalade-3.0.2.tgz#6a580d70edb87880f22b4c91d0d56078df6962c4" + integrity sha512-gPYAU37hYCUhW5euPeR+Y74F7BL+IBsV93j5cvGriSaD1aG6MGsqsV1yamRdrWrb2j3aiZvb0X+UBOWpx3JWtQ== + escape-goat@^2.0.0: version "2.1.1" resolved "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz#1b2dc77003676c457ec760b2dc68edb648188675" @@ -13068,7 +13439,7 @@ lodash@4.17.15: resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== -lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.4, lodash@^4.2.1: +lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.4, lodash@^4.2.1: version "4.17.19" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b" integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ== @@ -14128,6 +14499,11 @@ node-releases@^1.1.29, node-releases@^1.1.52: dependencies: semver "^6.3.0" +node-releases@^1.1.58: + version "1.1.60" + resolved "https://registry.npmjs.org/node-releases/-/node-releases-1.1.60.tgz#6948bdfce8286f0b5d0e5a88e8384e954dfe7084" + integrity sha512-gsO4vjEdQaTusZAEebUWp2a5d7dF5DYoIpDG7WySnk7BuZDW+GPpHXoXXuYawRBr/9t5q54tirPz79kFIWg4dA== + node-request-interceptor@^0.2.5: version "0.2.6" resolved "https://registry.npmjs.org/node-request-interceptor/-/node-request-interceptor-0.2.6.tgz#541278d7033bb6a8befb5dd793f83428cf6446a2" @@ -17245,7 +17621,7 @@ rollup-pluginutils@2.4.1: estree-walker "^0.6.0" micromatch "^3.1.10" -rollup-pluginutils@2.8.2, rollup-pluginutils@^2.8.1, rollup-pluginutils@^2.8.2: +rollup-pluginutils@2.8.2, rollup-pluginutils@^2.8.2: version "2.8.2" resolved "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e" integrity sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== @@ -18573,7 +18949,7 @@ supports-hyperlinks@^2.0.0: has-flag "^4.0.0" supports-color "^7.0.0" -svg-parser@^2.0.0: +svg-parser@^2.0.0, svg-parser@^2.0.2: version "2.0.4" resolved "https://registry.npmjs.org/svg-parser/-/svg-parser-2.0.4.tgz#fdc2e29e13951736140b76cb122c8ee6630eb6b5" integrity sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ== From 3aaf4f0200e5906b3495b8ee48c5d318d8df5687 Mon Sep 17 00:00:00 2001 From: blam Date: Mon, 27 Jul 2020 12:52:11 +0200 Subject: [PATCH 11/73] chore(adr): added adr reference to techocs --- docs/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/README.md b/docs/README.md index ee83b24050..c870a144d9 100644 --- a/docs/README.md +++ b/docs/README.md @@ -87,6 +87,7 @@ better yet, a pull request. - [ADR004 - Module Export Structure](architecture-decisions/adr004-module-export-structure.md) - [ADR005 - Catalog Core Entities](architecture-decisions/adr005-catalog-core-entities.md) - [ADR006 - Avoid React.FC and React.SFC](architecture-decisions/adr006-avoid-react-fc.md) + - [ADR007 - Use MSW for Mocking Network Requests](architecture-decisions/adr007-use-msw-to-mock-service-requests.md) - [Contribute](../CONTRIBUTING.md) - [Support](overview/support.md) - [FAQ](FAQ.md) From bf919ca4972cdabe6305747d4f2232d8c7eeb654 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 27 Jul 2020 13:55:50 +0200 Subject: [PATCH 12/73] cli: bump @types/jest in templates --- .../cli/templates/default-app/packages/app/package.json.hbs | 2 +- packages/cli/templates/default-plugin/package.json.hbs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli/templates/default-app/packages/app/package.json.hbs b/packages/cli/templates/default-app/packages/app/package.json.hbs index 26cce2c5e6..f8fd0135ab 100644 --- a/packages/cli/templates/default-app/packages/app/package.json.hbs +++ b/packages/cli/templates/default-app/packages/app/package.json.hbs @@ -22,7 +22,7 @@ "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", - "@types/jest": "^25.2.2", + "@types/jest": "^26.0.7", "@types/node": "^12.0.0", "@types/react-dom": "^16.9.8", "cross-env": "^7.0.0", diff --git a/packages/cli/templates/default-plugin/package.json.hbs b/packages/cli/templates/default-plugin/package.json.hbs index da611a13b7..d5d25b974a 100644 --- a/packages/cli/templates/default-plugin/package.json.hbs +++ b/packages/cli/templates/default-plugin/package.json.hbs @@ -36,7 +36,7 @@ "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", - "@types/jest": "^25.2.2", + "@types/jest": "^26.0.7", "@types/node": "^12.0.0", "jest-fetch-mock": "^3.0.3" }, From e5ed8f95d1e318044eff61f967fe1fd3b8a8a4b9 Mon Sep 17 00:00:00 2001 From: Ivan Shmidt Date: Mon, 27 Jul 2020 14:38:07 +0200 Subject: [PATCH 13/73] fix(cli): e2e backend PR adjustments --- .github/workflows/cli.yml | 2 +- packages/backend/src/index.ts | 10 +++++----- packages/cli/e2e-test/cli-e2e-test.js | 6 ++++-- .../templates/default-app/packages/backend/README.md | 2 -- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 13b84a555f..32fb15d329 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -15,7 +15,7 @@ jobs: services: postgres: - image: postgres:10.8 + image: postgres:latest env: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index 0da700d205..9d2d89a049 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -50,7 +50,7 @@ function makeCreateEnv(loadedConfigs: AppConfig[]) { 'POSTGRES_USER', 'POSTGRES_HOST', 'POSTGRES_PASSWORD', - ].every(key => Object.keys(process.env).includes(key)); + ].every(key => config.getOptional(`backend.${key}`)); let knexConfig; @@ -59,10 +59,10 @@ function makeCreateEnv(loadedConfigs: AppConfig[]) { client: 'pg', useNullAsDefault: true, connection: { - port: process.env.POSTGRES_PORT, - host: process.env.POSTGRES_HOST, - user: process.env.POSTGRES_USER, - password: process.env.POSTGRES_PASSWORD, + port: config.getOptionalNumber('backend.POSTGRES_PORT'), + host: config.getString('backend.POSTGRES_HOST'), + user: config.getString('backend.POSTGRES_USER'), + password: config.getString('backend.POSTGRES_PASSWORD'), database: `backstage_plugin_${plugin}`, } as PgConnectionConfig, }; diff --git a/packages/cli/e2e-test/cli-e2e-test.js b/packages/cli/e2e-test/cli-e2e-test.js index 37c1904b6d..6bab97f66b 100644 --- a/packages/cli/e2e-test/cli-e2e-test.js +++ b/packages/cli/e2e-test/cli-e2e-test.js @@ -318,7 +318,7 @@ async function testBackendStart(appDir, isPostgres) { await waitFor(() => stdout.includes('Listening on ') || stderr !== ''); if (stderr !== '') { // Skipping the whole block - throw new Error(); + throw new Error(stderr); } print('Try to fetch entities from the backend'); @@ -328,6 +328,8 @@ async function testBackendStart(appDir, isPostgres) { ); print('Entities fetched successfully'); successful = true; + } catch (error) { + throw new Error(`Backend failed to startup: ${error}`); } finally { print('Stopping the child process'); // Kill entire process group, otherwise we'll end up with hanging serve processes @@ -338,7 +340,7 @@ async function testBackendStart(appDir, isPostgres) { await waitForExit(child); } catch (error) { if (!successful) { - throw error; + throw new Error(`Backend failed to startup: ${stderr}`); } print('Backend startup test finished successfully'); } diff --git a/packages/cli/templates/default-app/packages/backend/README.md b/packages/cli/templates/default-app/packages/backend/README.md index 90c70912f0..f94904a930 100644 --- a/packages/cli/templates/default-app/packages/backend/README.md +++ b/packages/cli/templates/default-app/packages/backend/README.md @@ -29,8 +29,6 @@ AUTH_GOOGLE_CLIENT_ID=x AUTH_GOOGLE_CLIENT_SECRET=x \ AUTH_GITHUB_CLIENT_ID=x AUTH_GITHUB_CLIENT_SECRET=x \ AUTH_OAUTH2_CLIENT_ID=x AUTH_OAUTH2_CLIENT_SECRET=x \ AUTH_OAUTH2_AUTH_URL=x AUTH_OAUTH2_TOKEN_URL=x \ -ROLLBAR_ACCOUNT_TOKEN=x \ -SENTRY_TOKEN=x \ LOG_LEVEL=debug \ yarn start ``` From 1baccd1304a46f87880aa5f0a794831cc6ed49ed Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 27 Jul 2020 16:06:11 +0200 Subject: [PATCH 14/73] deps: bump ts, express + friends and fix type issue --- .../src/lib/EnvironmentHandler.ts | 2 +- yarn.lock | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/plugins/auth-backend/src/lib/EnvironmentHandler.ts b/plugins/auth-backend/src/lib/EnvironmentHandler.ts index 76c1f40b73..3eab4e793c 100644 --- a/plugins/auth-backend/src/lib/EnvironmentHandler.ts +++ b/plugins/auth-backend/src/lib/EnvironmentHandler.ts @@ -33,7 +33,7 @@ export class EnvironmentHandler implements AuthProviderRouteHandlers { ): AuthProviderRouteHandlers | undefined { const env = req.query.env?.toString(); - if (this.providers.hasOwnProperty(env)) { + if (env && this.providers.hasOwnProperty(env)) { return this.providers[env]; } diff --git a/yarn.lock b/yarn.lock index a31c2a75ae..05014c39b0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3748,17 +3748,18 @@ integrity sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g== "@types/express-serve-static-core@*", "@types/express-serve-static-core@^4.17.5": - version "4.17.5" - resolved "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.5.tgz#a00ac7dadd746ae82477443e4d480a6a93ea083c" - integrity sha512-578YH5Lt88AKoADy0b2jQGwJtrBxezXtVe/MBqWXKZpqx91SnC0pVkVCcxcytz3lWW+cHBYDi3Ysh0WXc+rAYw== + version "4.17.9" + resolved "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.9.tgz#2d7b34dcfd25ec663c25c85d76608f8b249667f1" + integrity sha512-DG0BYg6yO+ePW+XoDENYz8zhNGC3jDDEpComMYn7WJc4mY1Us8Rw9ax2YhJXxpyk2SF47PQAoQ0YyVT1a0bEkA== dependencies: "@types/node" "*" + "@types/qs" "*" "@types/range-parser" "*" "@types/express@*", "@types/express@^4.17.6": - version "4.17.6" - resolved "https://registry.npmjs.org/@types/express/-/express-4.17.6.tgz#6bce49e49570507b86ea1b07b806f04697fac45e" - integrity sha512-n/mr9tZI83kd4azlPG5y997C/M4DNABK9yErhFM6hKdym4kkmd9j0vtsJyjFIwfRBxtrxZtAfGZCNRIBMFLK5w== + version "4.17.7" + resolved "https://registry.npmjs.org/@types/express/-/express-4.17.7.tgz#42045be6475636d9801369cd4418ef65cdb0dd59" + integrity sha512-dCOT5lcmV/uC2J9k0rPafATeeyz+99xTt54ReX11/LObZgfzJqZNcW27zGhYyX+9iSEGXGt5qLPwRSvBZcLvtQ== dependencies: "@types/body-parser" "*" "@types/express-serve-static-core" "*" @@ -4147,9 +4148,9 @@ integrity sha512-ce5d3q03Ex0sy4R14722Rmt6MT07Ua+k4FwDfdcToYJcMKNtRVQvJ6JCAPdAmAnbRb6CsX6aYb9m96NGod9uTw== "@types/qs@*": - version "6.9.1" - resolved "https://registry.npmjs.org/@types/qs/-/qs-6.9.1.tgz#937fab3194766256ee09fcd40b781740758617e7" - integrity sha512-lhbQXx9HKZAPgBkISrBcmAcMpZsmpe/Cd/hY7LGZS5OfkySUBItnPZHgQPssWYUET8elF+yCFBbP1Q0RZPTdaw== + version "6.9.4" + resolved "https://registry.npmjs.org/@types/qs/-/qs-6.9.4.tgz#a59e851c1ba16c0513ea123830dd639a0a15cb6a" + integrity sha512-+wYo+L6ZF6BMoEjtf8zB2esQsqdV6WsjRK/GP9WOgLPrq87PbNWgIxS76dS5uvl/QXtHGakZmwTznIfcPXcKlQ== "@types/range-parser@*": version "1.2.3" From a79b844aee956395debcd11195b3d024c9660c09 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 27 Jul 2020 16:16:13 +0200 Subject: [PATCH 15/73] deps: bump @types/node + fix type issues --- packages/cli/src/lib/run.ts | 2 +- yarn.lock | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/cli/src/lib/run.ts b/packages/cli/src/lib/run.ts index 15b827f0c6..69d3d92640 100644 --- a/packages/cli/src/lib/run.ts +++ b/packages/cli/src/lib/run.ts @@ -92,7 +92,7 @@ export async function runCheck(cmd: string, ...args: string[]) { } export async function waitForExit( - child: ChildProcess & { exitCode?: number }, + child: ChildProcess & { exitCode: number | null }, name?: string, ): Promise { if (typeof child.exitCode === 'number') { diff --git a/yarn.lock b/yarn.lock index 05014c39b0..1464c8e464 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4039,20 +4039,25 @@ "@types/node" "*" form-data "^3.0.0" -"@types/node@*", "@types/node@>= 8", "@types/node@^13.7.2": - version "13.9.2" - resolved "https://registry.npmjs.org/@types/node/-/node-13.9.2.tgz#ace1880c03594cc3e80206d96847157d8e7fa349" - integrity sha512-bnoqK579sAYrQbp73wwglccjJ4sfRdKU7WNEZ5FW4K2U6Kc0/eZ5kvXG0JKsEKFB50zrFmfFt52/cvBbZa7eXg== +"@types/node@*", "@types/node@>= 8": + version "14.0.26" + resolved "https://registry.npmjs.org/@types/node/-/node-14.0.26.tgz#22a3b8a46510da8944b67bfc27df02c34a35331c" + integrity sha512-W+fpe5s91FBGE0pEa0lnqGLL4USgpLgs4nokw16SrBBco/gQxuua7KnArSEOd5iaMqbbSHV10vUDkJYJJqpXKA== "@types/node@^10.1.0": - version "10.17.27" - resolved "https://registry.npmjs.org/@types/node/-/node-10.17.27.tgz#391cb391c75646c8ad2a7b6ed3bbcee52d1bdf19" - integrity sha512-J0oqm9ZfAXaPdwNXMMgAhylw5fhmXkToJd06vuDUSAgEDZ/n/69/69UmyBZbc+zT34UnShuDSBqvim3SPnozJg== + version "10.17.28" + resolved "https://registry.npmjs.org/@types/node/-/node-10.17.28.tgz#0e36d718a29355ee51cec83b42d921299200f6d9" + integrity sha512-dzjES1Egb4c1a89C7lKwQh8pwjYmlOAG9dW1pBgxEk57tMrLnssOfEthz8kdkNaBd7lIqQx7APm5+mZ619IiCQ== "@types/node@^12.0.0": - version "12.12.30" - resolved "https://registry.npmjs.org/@types/node/-/node-12.12.30.tgz#3501e6f09b954de9c404671cefdbcc5d9d7c45f6" - integrity sha512-sz9MF/zk6qVr3pAnM0BSQvYIBK44tS75QC5N+VbWSE4DjCV/pJ+UzCW/F+vVnl7TkOPcuwQureKNtSSwjBTaMg== + version "12.12.53" + resolved "https://registry.npmjs.org/@types/node/-/node-12.12.53.tgz#be0d375933c3d15ef2380dafb3b0350ea7021129" + integrity sha512-51MYTDTyCziHb70wtGNFRwB4l+5JNvdqzFSkbDvpbftEgVUBEE+T5f7pROhWMp/fxp07oNIEQZd5bbfAH22ohQ== + +"@types/node@^13.7.2": + version "13.13.15" + resolved "https://registry.npmjs.org/@types/node/-/node-13.13.15.tgz#fe1cc3aa465a3ea6858b793fd380b66c39919766" + integrity sha512-kwbcs0jySLxzLsa2nWUAGOd/s21WU1jebrEdtzhsj1D4Yps1EOuyI1Qcu+FD56dL7NRNIJtDDjcqIG22NwkgLw== "@types/nodegit@0.26.5": version "0.26.5" @@ -4428,12 +4433,7 @@ "@types/serve-static" "*" "@types/webpack" "*" -"@types/webpack-env@^1.15.0": - version "1.15.1" - resolved "https://registry.npmjs.org/@types/webpack-env/-/webpack-env-1.15.1.tgz#c8e84705e08eed430b5e15b39c65b0944e4d1422" - integrity sha512-eWN5ElDTeBc5lRDh95SqA8x18D0ll2pWudU3uWiyfsRmIZcmUXpEsxPU+7+BsdCrO2vfLRC629u/MmjbmF+2tA== - -"@types/webpack-env@^1.15.2": +"@types/webpack-env@^1.15.0", "@types/webpack-env@^1.15.2": version "1.15.2" resolved "https://registry.npmjs.org/@types/webpack-env/-/webpack-env-1.15.2.tgz#927997342bb9f4a5185a86e6579a0a18afc33b0a" integrity sha512-67ZgZpAlhIICIdfQrB5fnDvaKFcDxpKibxznfYRVAT4mQE41Dido/3Ty+E3xGBmTogc5+0Qb8tWhna+5B8z1iQ== From acbe95224cdf308320b583ddcff5043b04ffb8ad Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 27 Jul 2020 16:16:50 +0200 Subject: [PATCH 16/73] cli: run tsc again after creating plugin --- packages/cli/e2e-test/cli-e2e-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/e2e-test/cli-e2e-test.js b/packages/cli/e2e-test/cli-e2e-test.js index ef5d6ab243..625122715d 100644 --- a/packages/cli/e2e-test/cli-e2e-test.js +++ b/packages/cli/e2e-test/cli-e2e-test.js @@ -201,7 +201,7 @@ async function createPlugin(pluginName, appDir) { await waitForExit(child); const pluginDir = resolvePath(appDir, 'plugins', pluginName); - for (const cmd of [['lint'], ['test', '--no-watch']]) { + for (const cmd of [['tsc'], ['lint'], ['test', '--no-watch']]) { print(`Running 'yarn ${cmd.join(' ')}' in newly created plugin`); await runPlain(['yarn', ...cmd], { cwd: pluginDir }); } From a95e33ffae2b5261dc2a4ad237ec362a121616fd Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 27 Jul 2020 16:17:00 +0200 Subject: [PATCH 17/73] yarn.lock: sync --- yarn.lock | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/yarn.lock b/yarn.lock index 1464c8e464..50c4382286 100644 --- a/yarn.lock +++ b/yarn.lock @@ -20080,6 +20080,11 @@ whatwg-fetch@^2.0.0, whatwg-fetch@^2.0.4: resolved "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" integrity sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng== +whatwg-fetch@^3.2.0: + version "3.2.0" + resolved "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.2.0.tgz#8e134f701f0a4ab5fda82626f113e2b647fd16dc" + integrity sha512-SdGPoQMMnzVYThUbSrEvqTlkvC1Ux27NehaJ/GUHBfNrh5Mjg+1/uRyFMwVnxO2MrikMWvWAqUGgQOfVU4hT7w== + whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0, whatwg-mimetype@^2.3.0: version "2.3.0" resolved "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" From 3975cdbc3cadce15d3275b881175864cea068b65 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 28 Jul 2020 07:02:47 +0000 Subject: [PATCH 18/73] chore(deps-dev): bump http-errors from 1.7.3 to 1.8.0 Bumps [http-errors](https://github.com/jshttp/http-errors) from 1.7.3 to 1.8.0. - [Release notes](https://github.com/jshttp/http-errors/releases) - [Changelog](https://github.com/jshttp/http-errors/blob/master/HISTORY.md) - [Commits](https://github.com/jshttp/http-errors/compare/1.7.3...1.8.0) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4541fdaa69..0f583392b4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10850,14 +10850,14 @@ http-errors@1.7.2: statuses ">= 1.5.0 < 2" toidentifier "1.0.0" -http-errors@^1.7.3, http-errors@~1.7.2: - version "1.7.3" - resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" - integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== +http-errors@^1.7.3: + version "1.8.0" + resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.8.0.tgz#75d1bbe497e1044f51e4ee9e704a62f28d336507" + integrity sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A== dependencies: depd "~1.1.2" inherits "2.0.4" - setprototypeof "1.1.1" + setprototypeof "1.2.0" statuses ">= 1.5.0 < 2" toidentifier "1.0.0" @@ -10871,6 +10871,17 @@ http-errors@~1.6.2: setprototypeof "1.1.0" statuses ">= 1.4.0 < 2" +http-errors@~1.7.2: + version "1.7.3" + resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" + integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== + dependencies: + depd "~1.1.2" + inherits "2.0.4" + setprototypeof "1.1.1" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + "http-parser-js@>=0.4.0 <0.4.11": version "0.4.10" resolved "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.10.tgz#92c9c1374c35085f75db359ec56cc257cbb93fa4" @@ -17819,6 +17830,11 @@ setprototypeof@1.1.1: resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== +setprototypeof@1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" + integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== + sha.js@^2.4.0, sha.js@^2.4.11, sha.js@^2.4.8: version "2.4.11" resolved "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" @@ -20295,11 +20311,6 @@ whatwg-fetch@^2.0.0, whatwg-fetch@^2.0.4: resolved "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" integrity sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng== -whatwg-fetch@^3.2.0: - version "3.2.0" - resolved "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.2.0.tgz#8e134f701f0a4ab5fda82626f113e2b647fd16dc" - integrity sha512-SdGPoQMMnzVYThUbSrEvqTlkvC1Ux27NehaJ/GUHBfNrh5Mjg+1/uRyFMwVnxO2MrikMWvWAqUGgQOfVU4hT7w== - whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0, whatwg-mimetype@^2.3.0: version "2.3.0" resolved "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" From cca7c5a5d111581b29e13c974c97eacfa20d3575 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 28 Jul 2020 07:05:16 +0000 Subject: [PATCH 19/73] chore(deps-dev): bump @types/webpack-dev-server from 3.10.1 to 3.11.0 Bumps [@types/webpack-dev-server](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/webpack-dev-server) from 3.10.1 to 3.11.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/webpack-dev-server) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4541fdaa69..45765b474d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4423,9 +4423,9 @@ integrity sha512-xSQfNcvOiE5f9dyd4Kzxbof1aTrLobL278pGLKOZI6esGfZ7ts9Ka16CzIN6Y8hFHE1C7jIBZokULhK1bOgjRw== "@types/webpack-dev-server@*", "@types/webpack-dev-server@^3.10.0": - version "3.10.1" - resolved "https://registry.npmjs.org/@types/webpack-dev-server/-/webpack-dev-server-3.10.1.tgz#93b7133cc9dab1ca1b76659f5ef8b763ad54c28a" - integrity sha512-2nwwQ/qHRghUirvG/gEDkOQDa+d881UTJM7EG9ok5KNaYCjYVvy7fdaO528Lcym9OQDn75SvruPYVVvMJxqO0g== + version "3.11.0" + resolved "https://registry.npmjs.org/@types/webpack-dev-server/-/webpack-dev-server-3.11.0.tgz#bcc3b85e7dc6ac2db25330610513f2228c2fcfb2" + integrity sha512-3+86AgSzl18n5P1iUP9/lz3G3GMztCp+wxdDvVuNhx1sr1jE79GpYfKHL8k+Vht3N74K2n98CuAEw4YPJCYtDA== dependencies: "@types/connect-history-api-fallback" "*" "@types/express" "*" @@ -20295,11 +20295,6 @@ whatwg-fetch@^2.0.0, whatwg-fetch@^2.0.4: resolved "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" integrity sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng== -whatwg-fetch@^3.2.0: - version "3.2.0" - resolved "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.2.0.tgz#8e134f701f0a4ab5fda82626f113e2b647fd16dc" - integrity sha512-SdGPoQMMnzVYThUbSrEvqTlkvC1Ux27NehaJ/GUHBfNrh5Mjg+1/uRyFMwVnxO2MrikMWvWAqUGgQOfVU4hT7w== - whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0, whatwg-mimetype@^2.3.0: version "2.3.0" resolved "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" From f7ecc32765204105048e61ee577ab0ff6e9101e1 Mon Sep 17 00:00:00 2001 From: Nikita Nek Dudnik Date: Mon, 27 Jul 2020 18:15:33 +0200 Subject: [PATCH 20/73] fix: annotation name --- plugins/github-actions/README.md | 47 ++++++++++--------- plugins/github-actions/scripts/sample.yaml | 2 +- .../src/components/useProjectName.ts | 4 +- 3 files changed, 28 insertions(+), 25 deletions(-) diff --git a/plugins/github-actions/README.md b/plugins/github-actions/README.md index 72f991e814..7d09a67066 100644 --- a/plugins/github-actions/README.md +++ b/plugins/github-actions/README.md @@ -7,29 +7,34 @@ Website: [https://github.com/actions](https://github.com/actions) TBD ## Setup -### Generic Requirements -1. Provide OAuth credentials: - 1. [Create an OAuth App](https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/) with callback URL set to ```https://localhost:3000/auth/github```. - 2. Take Client ID and Client Secret from the newly created app's settings page and put them into ```AUTH_GITHUB_CLIENT_ID``` and ```AUTH_GITHUB_CLIENT_SECRET``` env variables. -2. Annotate your component with a correct GitHub Actions repository and owner: - - The annotation key is ```backstage.io/github-actions-id```. - Example: - ``` - apiVersion: backstage.io/v1alpha1 - kind: Component - metadata: - name: backstage - description: backstage.io - annotations: - backstage.io/github-actions-id: 'spotify/backstage' - spec: - type: website - lifecycle: production - owner: guest - ``` +### Generic Requirements + +1. Provide OAuth credentials: + 1. [Create an OAuth App](https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/) with callback URL set to `https://localhost:3000/auth/github`. + 2. Take Client ID and Client Secret from the newly created app's settings page and put them into `AUTH_GITHUB_CLIENT_ID` and `AUTH_GITHUB_CLIENT_SECRET` env variables. +2. Annotate your component with a correct GitHub Actions repository and owner: + + The annotation key is `github.com/project-slug`. + + Example: + + ``` + apiVersion: backstage.io/v1alpha1 + kind: Component + metadata: + name: backstage + description: backstage.io + annotations: + github.com/project-slug: 'spotify/backstage' + spec: + type: website + lifecycle: production + owner: guest + ``` + ### Standalone app requirements + If you didn't clone this repo you have to do some extra work. 1. Add plugin API to your Backstage instance: diff --git a/plugins/github-actions/scripts/sample.yaml b/plugins/github-actions/scripts/sample.yaml index 3aa75200f5..d582bf9c35 100644 --- a/plugins/github-actions/scripts/sample.yaml +++ b/plugins/github-actions/scripts/sample.yaml @@ -4,7 +4,7 @@ metadata: name: backstage description: backstage.io annotations: - backstage.io/github-actions-id: 'spotify/backstage' + github.com/project-slug: 'spotify/backstage' spec: type: website lifecycle: production diff --git a/plugins/github-actions/src/components/useProjectName.ts b/plugins/github-actions/src/components/useProjectName.ts index d6fe9bd35d..1624b592bd 100644 --- a/plugins/github-actions/src/components/useProjectName.ts +++ b/plugins/github-actions/src/components/useProjectName.ts @@ -23,9 +23,7 @@ export const useProjectName = (name: EntityCompoundName) => { const { value } = useAsync(async () => { const entity = await catalogApi.getEntityByName(name); - return ( - entity?.metadata.annotations?.['backstage.io/github-actions-id'] ?? '' - ); + return entity?.metadata.annotations?.['github.com/project-slug'] ?? ''; }); return value; }; From 7248e9a58122c3e407e05a0b37cb528278971434 Mon Sep 17 00:00:00 2001 From: Ivan Shmidt Date: Tue, 28 Jul 2020 11:29:27 +0200 Subject: [PATCH 21/73] feat(github-actions): widget inside catalog --- plugins/catalog/package.json | 1 + .../src/components/EntityPage/EntityPage.tsx | 8 + .../src/components/useEntityCompoundName.ts | 26 ++ plugins/catalog/src/index.ts | 1 + .../src/api/GithubActionsApi.ts | 2 + .../src/api/GithubActionsClient.ts | 3 + .../src/components/Widget/Widget.tsx | 110 ++++++++ .../src/components/Widget/index.ts | 16 ++ .../WorkflowRunDetails/WorkflowRunDetails.tsx | 236 ++++++++++++++++++ .../components/WorkflowRunDetails/index.ts | 16 ++ .../useWorkflowRunJobs.ts | 0 .../useWorkflowRunsDetails.ts | 14 +- .../WorkflowRunDetailsPage.tsx | 217 +--------------- .../WorkflowRunStatus.tsx} | 26 +- .../index.ts | 2 +- .../WorkflowRunsTable/WorkflowRunsTable.tsx | 42 +++- .../src/components/WorkflowRunsTable/index.ts | 2 +- .../src/components/useProjectName.ts | 4 +- .../useWorkflowRuns.ts | 37 ++- plugins/github-actions/src/index.ts | 1 + yarn.lock | 5 - 21 files changed, 511 insertions(+), 258 deletions(-) create mode 100644 plugins/catalog/src/components/useEntityCompoundName.ts create mode 100644 plugins/github-actions/src/components/Widget/Widget.tsx create mode 100644 plugins/github-actions/src/components/Widget/index.ts create mode 100644 plugins/github-actions/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx create mode 100644 plugins/github-actions/src/components/WorkflowRunDetails/index.ts rename plugins/github-actions/src/components/{WorkflowRunDetailsPage => WorkflowRunDetails}/useWorkflowRunJobs.ts (100%) rename plugins/github-actions/src/components/{WorkflowRunDetailsPage => WorkflowRunDetails}/useWorkflowRunsDetails.ts (85%) rename plugins/github-actions/src/components/{WorkflowRunStatusIcon/WorkflowRunStatusIcon.tsx => WorkflowRunStatus/WorkflowRunStatus.tsx} (71%) rename plugins/github-actions/src/components/{WorkflowRunStatusIcon => WorkflowRunStatus}/index.ts (90%) rename plugins/github-actions/src/components/{WorkflowRunsTable => }/useWorkflowRuns.ts (81%) diff --git a/plugins/catalog/package.json b/plugins/catalog/package.json index f306c03ff8..4ab0decfbe 100644 --- a/plugins/catalog/package.json +++ b/plugins/catalog/package.json @@ -23,6 +23,7 @@ "dependencies": { "@backstage/catalog-model": "^0.1.1-alpha.16", "@backstage/core": "^0.1.1-alpha.16", + "@backstage/plugin-github-actions": "^0.1.1-alpha.16", "@backstage/plugin-scaffolder": "^0.1.1-alpha.16", "@backstage/plugin-sentry": "^0.1.1-alpha.16", "@backstage/theme": "^0.1.1-alpha.16", diff --git a/plugins/catalog/src/components/EntityPage/EntityPage.tsx b/plugins/catalog/src/components/EntityPage/EntityPage.tsx index 1c56924589..ce128777bd 100644 --- a/plugins/catalog/src/components/EntityPage/EntityPage.tsx +++ b/plugins/catalog/src/components/EntityPage/EntityPage.tsx @@ -28,6 +28,7 @@ import { useApi, } from '@backstage/core'; import { SentryIssuesWidget } from '@backstage/plugin-sentry'; +import { Widget as GithubActionsWidget } from '@backstage/plugin-github-actions'; import { Grid, Box } from '@material-ui/core'; import { Alert } from '@material-ui/lab'; import React, { FC, useEffect, useState } from 'react'; @@ -192,6 +193,13 @@ export const EntityPage: FC<{}> = () => { statsFor="24h" /> + {entity.metadata?.annotations?.[ + 'backstage.io/github-actions-id' + ] && ( + + + + )} diff --git a/plugins/catalog/src/components/useEntityCompoundName.ts b/plugins/catalog/src/components/useEntityCompoundName.ts new file mode 100644 index 0000000000..2be23cb6d9 --- /dev/null +++ b/plugins/catalog/src/components/useEntityCompoundName.ts @@ -0,0 +1,26 @@ +/* + * 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 { useParams } from 'react-router'; + +/** + * Grabs entity kind and name + optional namespace from location + */ +export const useEntityCompoundName = () => { + const params = useParams(); + const { kind, optionalNamespaceAndName = '' } = params; + const [name, namespace] = optionalNamespaceAndName.split(':').reverse(); + return { kind, name, namespace }; +}; diff --git a/plugins/catalog/src/index.ts b/plugins/catalog/src/index.ts index 701394df34..36fd69971d 100644 --- a/plugins/catalog/src/index.ts +++ b/plugins/catalog/src/index.ts @@ -18,3 +18,4 @@ export { plugin } from './plugin'; export * from './api/CatalogClient'; export * from './api/types'; export * from './routes'; +export { useEntityCompoundName } from './components/useEntityCompoundName'; diff --git a/plugins/github-actions/src/api/GithubActionsApi.ts b/plugins/github-actions/src/api/GithubActionsApi.ts index bb54fae703..acdfb90cf3 100644 --- a/plugins/github-actions/src/api/GithubActionsApi.ts +++ b/plugins/github-actions/src/api/GithubActionsApi.ts @@ -33,12 +33,14 @@ export type GithubActionsApi = { repo, pageSize, page, + branch, }: { token: string; owner: string; repo: string; pageSize?: number; page?: number; + branch?: string; }) => Promise; getWorkflow: ({ token, diff --git a/plugins/github-actions/src/api/GithubActionsClient.ts b/plugins/github-actions/src/api/GithubActionsClient.ts index a96f5341fd..72f65075e6 100644 --- a/plugins/github-actions/src/api/GithubActionsClient.ts +++ b/plugins/github-actions/src/api/GithubActionsClient.ts @@ -46,12 +46,14 @@ export class GithubActionsClient implements GithubActionsApi { repo, pageSize = 100, page = 0, + branch, }: { token: string; owner: string; repo: string; pageSize?: number; page?: number; + branch?: string; }): Promise { const workflowRuns = await new Octokit({ auth: token, @@ -60,6 +62,7 @@ export class GithubActionsClient implements GithubActionsApi { repo, per_page: pageSize, page, + ...(branch ? { branch } : {}), }); return workflowRuns.data; } diff --git a/plugins/github-actions/src/components/Widget/Widget.tsx b/plugins/github-actions/src/components/Widget/Widget.tsx new file mode 100644 index 0000000000..031364c8ce --- /dev/null +++ b/plugins/github-actions/src/components/Widget/Widget.tsx @@ -0,0 +1,110 @@ +/* + * 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 React, { useEffect } from 'react'; +import { useWorkflowRuns } from '../useWorkflowRuns'; +import { WorkflowRun } from '../WorkflowRunsTable'; +import { Entity } from '@backstage/catalog-model'; +import { WorkflowRunStatus } from '../WorkflowRunStatus'; +import { + Link, + Theme, + makeStyles, + LinearProgress, + Typography, +} from '@material-ui/core'; +import { + InfoCard, + StructuredMetadataTable, + errorApiRef, + useApi, +} from '@backstage/core'; +import ExternalLinkIcon from '@material-ui/icons/Launch'; + +const useStyles = makeStyles({ + externalLinkIcon: { + fontSize: 'inherit', + verticalAlign: 'bottom', + }, +}); + +const WidgetContent = ({ + error, + loading, + lastRun, + branch, +}: { + error?: Error; + loading?: boolean; + lastRun: WorkflowRun; + branch: string; +}) => { + const classes = useStyles(); + if (error) return Couldn't fetch latest {branch} run; + if (loading) return ; + return ( + + + + ), + message: lastRun.message, + url: ( + + See more on GitHub{' '} + + + ), + }} + /> + ); +}; + +export const Widget = ({ + entity, + branch = 'master', +}: { + entity: Entity; + branch: string; +}) => { + const errorApi = useApi(errorApiRef); + const [owner, repo] = ( + entity?.metadata.annotations?.['backstage.io/github-actions-id'] ?? '/' + ).split('/'); + const [{ runs, loading, error }] = useWorkflowRuns({ + owner, + repo, + branch, + }); + const lastRun = runs?.[0] ?? ({} as WorkflowRun); + useEffect(() => { + if (error) { + errorApi.post(error); + } + }, [error, errorApi]); + + return ( + + + + ); +}; diff --git a/plugins/github-actions/src/components/Widget/index.ts b/plugins/github-actions/src/components/Widget/index.ts new file mode 100644 index 0000000000..2b34671ab5 --- /dev/null +++ b/plugins/github-actions/src/components/Widget/index.ts @@ -0,0 +1,16 @@ +/* + * 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. + */ +export { Widget } from './Widget'; diff --git a/plugins/github-actions/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx b/plugins/github-actions/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx new file mode 100644 index 0000000000..8c445ca9f6 --- /dev/null +++ b/plugins/github-actions/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx @@ -0,0 +1,236 @@ +/* + * 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 React from 'react'; +import { useEntityCompoundName } from '@backstage/plugin-catalog'; +import { useWorkflowRunsDetails } from './useWorkflowRunsDetails'; +import { useWorkflowRunJobs } from './useWorkflowRunJobs'; +import { useProjectName } from '../useProjectName'; +import { + makeStyles, + Box, + TableRow, + TableCell, + ListItemText, + ExpansionPanel, + ExpansionPanelSummary, + Typography, + ExpansionPanelDetails, + TableContainer, + Table, + Paper, + TableBody, + LinearProgress, + CircularProgress, + Theme, + Link, +} from '@material-ui/core'; +import { Jobs, Job, Step } from '../../api'; +import moment from 'moment'; +import { WorkflowRunStatus } from '../WorkflowRunStatus'; +import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; +import ExternalLinkIcon from '@material-ui/icons/Launch'; + +const useStyles = makeStyles(theme => ({ + root: { + maxWidth: 720, + margin: theme.spacing(2), + }, + title: { + padding: theme.spacing(1, 0, 2, 0), + }, + table: { + padding: theme.spacing(1), + }, + expansionPanelDetails: { + padding: 0, + }, + button: { + order: -1, + marginRight: 0, + marginLeft: '-20px', + }, + externalLinkIcon: { + fontSize: 'inherit', + verticalAlign: 'bottom', + }, +})); + +const JobsList = ({ jobs }: { jobs?: Jobs }) => { + const classes = useStyles(); + return ( + + {jobs && + jobs.total_count > 0 && + jobs.jobs.map((job: Job) => ( + + ))} + + ); +}; + +const getElapsedTime = (start: string, end: string) => { + const diff = moment(moment(end || moment()).diff(moment(start))); + const timeElapsed = diff.format('m [minutes] s [seconds]'); + return timeElapsed; +}; + +const StepView = ({ step }: { step: Step }) => { + return ( + + + + + + + + + ); +}; + +const JobListItem = ({ job, className }: { job: Job; className: string }) => { + const classes = useStyles(); + return ( + + } + aria-controls={`panel-${name}-content`} + id={`panel-${name}-header`} + IconButtonProps={{ + className: classes.button, + }} + > + + {job.name} ({getElapsedTime(job.started_at, job.completed_at)}) + + + + + + {job.steps.map((step: Step) => ( + + ))} +
+
+
+
+ ); +}; + +export const WorkflowRunDetails = () => { + let entityCompoundName = useEntityCompoundName(); + if (!entityCompoundName.name) { + // TODO(shmidt-i): remove when is fully integrated + // into the entity view + entityCompoundName = { + kind: 'Component', + name: 'backstage', + namespace: 'default', + }; + } + const projectName = useProjectName(entityCompoundName); + + const [owner, repo] = projectName.value ? projectName.value.split('/') : []; + const details = useWorkflowRunsDetails(repo, owner); + const jobs = useWorkflowRunJobs(details.value?.jobs_url); + + const error = projectName.error || (projectName.value && details.error); + const classes = useStyles(); + if (error) { + return ( + + Failed to load build, {error.message} + + ); + } else if (projectName.loading || details.loading) { + return ; + } + return ( +
+ + + + + + Branch + + {details.value?.head_branch} + + + + Message + + {details.value?.head_commit.message} + + + + Commit ID + + {details.value?.head_commit.id} + + + + Status + + + + + + + + Author + + {`${details.value?.head_commit.author.name} (${details.value?.head_commit.author.email})`} + + + + Links + + + {details.value?.html_url && ( + + Workflow runs on GitHub{' '} + + + )} + + + + + Jobs + {jobs.loading ? ( + + ) : ( + + )} + + + +
+
+
+ ); +}; diff --git a/plugins/github-actions/src/components/WorkflowRunDetails/index.ts b/plugins/github-actions/src/components/WorkflowRunDetails/index.ts new file mode 100644 index 0000000000..2886a26740 --- /dev/null +++ b/plugins/github-actions/src/components/WorkflowRunDetails/index.ts @@ -0,0 +1,16 @@ +/* + * 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. + */ +export { WorkflowRunDetails } from './WorkflowRunDetails'; diff --git a/plugins/github-actions/src/components/WorkflowRunDetailsPage/useWorkflowRunJobs.ts b/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunJobs.ts similarity index 100% rename from plugins/github-actions/src/components/WorkflowRunDetailsPage/useWorkflowRunJobs.ts rename to plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunJobs.ts diff --git a/plugins/github-actions/src/components/WorkflowRunDetailsPage/useWorkflowRunsDetails.ts b/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts similarity index 85% rename from plugins/github-actions/src/components/WorkflowRunDetailsPage/useWorkflowRunsDetails.ts rename to plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts index 623f55eea6..b38284d52f 100644 --- a/plugins/github-actions/src/components/WorkflowRunDetailsPage/useWorkflowRunsDetails.ts +++ b/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunsDetails.ts @@ -24,12 +24,14 @@ export const useWorkflowRunsDetails = (repo: string, owner: string) => { const { id } = useParams(); const details = useAsync(async () => { const token = await auth.getAccessToken(['repo']); - return api.getWorkflowRun({ - token, - owner, - repo, - id: parseInt(id, 10), - }); + return repo && owner + ? api.getWorkflowRun({ + token, + owner, + repo, + id: parseInt(id, 10), + }) + : Promise.reject('No repo/owner provided'); }, [repo, owner, id]); return details; }; diff --git a/plugins/github-actions/src/components/WorkflowRunDetailsPage/WorkflowRunDetailsPage.tsx b/plugins/github-actions/src/components/WorkflowRunDetailsPage/WorkflowRunDetailsPage.tsx index 283fd60ec6..ec9a3f484d 100644 --- a/plugins/github-actions/src/components/WorkflowRunDetailsPage/WorkflowRunDetailsPage.tsx +++ b/plugins/github-actions/src/components/WorkflowRunDetailsPage/WorkflowRunDetailsPage.tsx @@ -14,28 +14,7 @@ * limitations under the License. */ -import { - Button, - LinearProgress, - makeStyles, - Paper, - Table, - TableBody, - TableCell, - TableContainer, - TableRow, - Theme, - Typography, - Box, - ExpansionPanelDetails, - ExpansionPanel, - ExpansionPanelSummary, - ListItemText, - CircularProgress, - Grid, - Breadcrumbs, -} from '@material-ui/core'; -import moment from 'moment'; +import { Typography, Grid, Breadcrumbs } from '@material-ui/core'; import React from 'react'; import { @@ -48,133 +27,13 @@ import { SupportButton, pageTheme, } from '@backstage/core'; -import { Job, Step, Jobs } from '../../api/types'; -import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; -import { useWorkflowRunsDetails } from './useWorkflowRunsDetails'; -import { useWorkflowRunJobs } from './useWorkflowRunJobs'; -import { WorkflowRunStatusIcon } from '../WorkflowRunStatusIcon/WorkflowRunStatusIcon'; -import { useProjectName } from '../useProjectName'; -import GitHubIcon from '@material-ui/icons/GitHub'; -const useStyles = makeStyles(theme => ({ - root: { - maxWidth: 720, - margin: theme.spacing(2), - }, - title: { - padding: theme.spacing(1, 0, 2, 0), - }, - table: { - padding: theme.spacing(1), - }, - expansionPanelDetails: { - padding: 0, - }, - button: { - order: -1, - marginRight: 0, - marginLeft: '-20px', - }, -})); - -const JobsList = ({ jobs }: { jobs?: Jobs }) => { - const classes = useStyles(); - return ( - - {jobs && - jobs.total_count > 0 && - jobs.jobs.map((job: Job) => ( - - ))} - - ); -}; - -const getElapsedTime = (start: string, end: string) => { - const diff = moment(moment(end || moment()).diff(moment(start))); - const timeElapsed = diff.format('m [minutes] s [seconds]'); - return timeElapsed; -}; - -const StepView = ({ step }: { step: Step }) => { - return ( - - - - - - - {step.status} - - - ); -}; - -const JobListItem = ({ job, className }: { job: Job; className: string }) => { - const classes = useStyles(); - return ( - - } - aria-controls={`panel-${name}-content`} - id={`panel-${name}-header`} - IconButtonProps={{ - className: classes.button, - }} - > - - {job.name} ({getElapsedTime(job.started_at, job.completed_at)}) - - - - - - {job.steps.map((step: Step) => ( - - ))} -
-
-
-
- ); -}; +import { WorkflowRunDetails } from '../WorkflowRunDetails'; /** * A component for Jobs visualization. Jobs are a property of a Workflow Run. */ export const WorkflowRunDetailsPage = () => { - const [owner, repo] = ( - useProjectName({ - kind: 'Component', - name: 'backstage', - }) ?? '/' - ).split('/'); - const details = useWorkflowRunsDetails(repo, owner); - const jobs = useWorkflowRunJobs(details.value?.jobs_url); - - const classes = useStyles(); - - if (details.loading) { - return ; - } else if (details.error) { - return ( - - Failed to load build, {details.error.message} - - ); - } - return (
{ -
- - - - - - Branch - - {details.value?.head_branch} - - - - Message - - - {details.value?.head_commit.message} - - - - - Commit ID - - {details.value?.head_commit.id} - - - - Status - - - {' '} - {details.value?.status.toUpperCase()} - - - - - Author - - {`${details.value?.head_commit.author.name} (${details.value?.head_commit.author.email})`} - - - - Links - - - {details.value?.html_url && ( - - - - )} - - - - - Jobs - {jobs.loading ? ( - - ) : ( - - )} - - - -
-
-
+
diff --git a/plugins/github-actions/src/components/WorkflowRunStatusIcon/WorkflowRunStatusIcon.tsx b/plugins/github-actions/src/components/WorkflowRunStatus/WorkflowRunStatus.tsx similarity index 71% rename from plugins/github-actions/src/components/WorkflowRunStatusIcon/WorkflowRunStatusIcon.tsx rename to plugins/github-actions/src/components/WorkflowRunStatus/WorkflowRunStatus.tsx index 645224ad24..089c319802 100644 --- a/plugins/github-actions/src/components/WorkflowRunStatusIcon/WorkflowRunStatusIcon.tsx +++ b/plugins/github-actions/src/components/WorkflowRunStatus/WorkflowRunStatus.tsx @@ -17,7 +17,7 @@ import { StatusPending, StatusRunning, StatusOK } from '@backstage/core'; import React from 'react'; -export const WorkflowRunStatusIcon = ({ +export const WorkflowRunStatus = ({ status, }: { status: string | undefined; @@ -25,12 +25,28 @@ export const WorkflowRunStatusIcon = ({ if (status === undefined) return null; switch (status.toLowerCase()) { case 'queued': - return ; + return ( + <> + Queued + + ); case 'in_progress': - return ; + return ( + <> + In progress + + ); case 'completed': - return ; + return ( + <> + Completed + + ); default: - return ; + return ( + <> + Pending + + ); } }; diff --git a/plugins/github-actions/src/components/WorkflowRunStatusIcon/index.ts b/plugins/github-actions/src/components/WorkflowRunStatus/index.ts similarity index 90% rename from plugins/github-actions/src/components/WorkflowRunStatusIcon/index.ts rename to plugins/github-actions/src/components/WorkflowRunStatus/index.ts index 05fff3f46d..8ebca32cbd 100644 --- a/plugins/github-actions/src/components/WorkflowRunStatusIcon/index.ts +++ b/plugins/github-actions/src/components/WorkflowRunStatus/index.ts @@ -14,4 +14,4 @@ * limitations under the License. */ -export { WorkflowRunStatusIcon } from './WorkflowRunStatusIcon'; +export { WorkflowRunStatus } from './WorkflowRunStatus'; diff --git a/plugins/github-actions/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx b/plugins/github-actions/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx index 313a51e28a..a2a6ead9b5 100644 --- a/plugins/github-actions/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx +++ b/plugins/github-actions/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx @@ -17,16 +17,20 @@ import React, { FC } from 'react'; import { Link, Typography, Box, IconButton, Tooltip } from '@material-ui/core'; import RetryIcon from '@material-ui/icons/Replay'; import GitHubIcon from '@material-ui/icons/GitHub'; -import { Link as RouterLink } from 'react-router-dom'; +import { Link as RouterLink, generatePath } from 'react-router-dom'; import { Table, TableColumn } from '@backstage/core'; -import { useWorkflowRuns } from './useWorkflowRuns'; -import { WorkflowRunStatusIcon } from '../WorkflowRunStatusIcon'; +import { useWorkflowRuns } from '../useWorkflowRuns'; +import { WorkflowRunStatus } from '../WorkflowRunStatus'; import SyncIcon from '@material-ui/icons/Sync'; +import { buildRouteRef } from '../../plugin'; +import { useEntityCompoundName } from '@backstage/plugin-catalog'; +import { useProjectName } from '../useProjectName'; export type WorkflowRun = { id: string; message: string; url?: string; + githubUrl?: string; source: { branchName: string; commit: { @@ -52,7 +56,7 @@ const generatedColumns: TableColumn[] = [ render: (row: Partial) => ( {row.message} @@ -69,13 +73,11 @@ const generatedColumns: TableColumn[] = [ }, { title: 'Status', + width: '150px', + render: (row: Partial) => ( - - - - {row.status} - + ), }, @@ -104,7 +106,7 @@ type Props = { onChangePageSize: (pageSize: number) => void; }; -const WorkflowRunsTableView: FC = ({ +export const WorkflowRunsTableView: FC = ({ projectName, loading, pageSize, @@ -145,10 +147,28 @@ const WorkflowRunsTableView: FC = ({ }; export const WorkflowRunsTable = () => { - const [tableProps, { retry, setPage, setPageSize }] = useWorkflowRuns(); + let entityCompoundName = useEntityCompoundName(); + + if (!entityCompoundName.name) { + // TODO(shmidt-i): remove when is fully integrated + // into the entity view + entityCompoundName = { + kind: 'Component', + name: 'backstage', + namespace: 'default', + }; + } + + const { value: projectName, loading } = useProjectName(entityCompoundName); + const [owner, repo] = (projectName ?? '/').split('/'); + const [tableProps, { retry, setPage, setPageSize }] = useWorkflowRuns({ + owner, + repo, + }); return ( { const catalogApi = useApi(catalogApiRef); - const { value } = useAsync(async () => { + const { value, loading, error } = useAsync(async () => { const entity = await catalogApi.getEntityByName(name); return ( entity?.metadata.annotations?.['backstage.io/github-actions-id'] ?? '' ); }); - return value; + return { value, loading, error }; }; diff --git a/plugins/github-actions/src/components/WorkflowRunsTable/useWorkflowRuns.ts b/plugins/github-actions/src/components/useWorkflowRuns.ts similarity index 81% rename from plugins/github-actions/src/components/WorkflowRunsTable/useWorkflowRuns.ts rename to plugins/github-actions/src/components/useWorkflowRuns.ts index 4f72f88de0..f935d57810 100644 --- a/plugins/github-actions/src/components/WorkflowRunsTable/useWorkflowRuns.ts +++ b/plugins/github-actions/src/components/useWorkflowRuns.ts @@ -15,13 +15,20 @@ */ import { useState } from 'react'; import { useAsyncRetry } from 'react-use'; -import { WorkflowRun } from './WorkflowRunsTable'; -import { githubActionsApiRef } from '../../api/GithubActionsApi'; +import { WorkflowRun } from './WorkflowRunsTable/WorkflowRunsTable'; +import { githubActionsApiRef } from '../api/GithubActionsApi'; import { useApi, githubAuthApiRef, errorApiRef } from '@backstage/core'; import { ActionsListWorkflowRunsForRepoResponseData } from '@octokit/types'; -import { useProjectName } from '../useProjectName'; -export function useWorkflowRuns() { +export function useWorkflowRuns({ + owner, + repo, + branch, +}: { + owner: string; + repo: string; + branch?: string; +}) { const api = useApi(githubActionsApiRef); const auth = useApi(githubAuthApiRef); @@ -31,19 +38,21 @@ export function useWorkflowRuns() { const [page, setPage] = useState(0); const [pageSize, setPageSize] = useState(5); - const projectName = useProjectName({ - kind: 'Component', - name: 'backstage', - }); - const { loading, value: runs, retry } = useAsyncRetry< + const { loading, value: runs, retry, error } = useAsyncRetry< WorkflowRun[] >(async () => { const token = await auth.getAccessToken(['repo']); - const [owner, repo] = (projectName ?? '/').split('/'); return ( api // GitHub API pagination count starts from 1 - .listWorkflowRuns({ token, owner, repo, pageSize, page: page + 1 }) + .listWorkflowRuns({ + token, + owner, + repo, + pageSize, + page: page + 1, + branch, + }) .then( ( workflowRunsData: ActionsListWorkflowRunsForRepoResponseData, @@ -77,11 +86,12 @@ export function useWorkflowRuns() { }, status: run.status, url: run.url, + githubUrl: run.html_url, })); }, ) ); - }, [page, pageSize, projectName]); + }, [page, pageSize, repo, owner]); return [ { @@ -89,8 +99,9 @@ export function useWorkflowRuns() { pageSize, loading, runs, - projectName: projectName ?? '', + projectName: `${owner}/${repo}`, total, + error, }, { runs, diff --git a/plugins/github-actions/src/index.ts b/plugins/github-actions/src/index.ts index d67bc6a864..4a69c363cd 100644 --- a/plugins/github-actions/src/index.ts +++ b/plugins/github-actions/src/index.ts @@ -16,3 +16,4 @@ export { plugin } from './plugin'; export * from './api'; +export { Widget } from './components/Widget'; diff --git a/yarn.lock b/yarn.lock index 4541fdaa69..69207fe1d4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -20295,11 +20295,6 @@ whatwg-fetch@^2.0.0, whatwg-fetch@^2.0.4: resolved "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" integrity sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng== -whatwg-fetch@^3.2.0: - version "3.2.0" - resolved "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.2.0.tgz#8e134f701f0a4ab5fda82626f113e2b647fd16dc" - integrity sha512-SdGPoQMMnzVYThUbSrEvqTlkvC1Ux27NehaJ/GUHBfNrh5Mjg+1/uRyFMwVnxO2MrikMWvWAqUGgQOfVU4hT7w== - whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0, whatwg-mimetype@^2.3.0: version "2.3.0" resolved "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" From c678da82ba4b471c0240b10f477247745874c3f0 Mon Sep 17 00:00:00 2001 From: Andrew Thauer <6507159+andrewthauer@users.noreply.github.com> Date: Tue, 28 Jul 2020 06:10:07 -0400 Subject: [PATCH 22/73] feat: add yarn dev to start both app & backend --- package.json | 3 +++ yarn.lock | 48 ++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 45 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 254142a733..8574a65958 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,9 @@ "node": "12" }, "scripts": { + "dev": "concurrently 'yarn start' 'yarn start-backend'", "start": "yarn workspace example-app start", + "start-backend": "yarn workspace example-backend start", "build": "lerna run build", "tsc": "tsc", "clean": "backstage-cli clean && lerna run clean", @@ -35,6 +37,7 @@ "devDependencies": { "@spotify/eslint-config-oss": "^1.0.1", "@spotify/prettier-config": "^8.0.0", + "concurrently": "^5.2.0", "husky": "^4.2.3", "lerna": "^3.20.2", "lint-staged": "^10.1.0", diff --git a/yarn.lock b/yarn.lock index 375885868a..cd8003b1e1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7029,6 +7029,21 @@ concat-with-sourcemaps@^1.1.0: dependencies: source-map "^0.6.1" +concurrently@^5.2.0: + version "5.2.0" + resolved "https://registry.npmjs.org/concurrently/-/concurrently-5.2.0.tgz#ead55121d08a0fc817085584c123cedec2e08975" + integrity sha512-XxcDbQ4/43d6CxR7+iV8IZXhur4KbmEJk1CetVMUqCy34z9l0DkszbY+/9wvmSnToTej0SYomc2WSRH+L0zVJw== + dependencies: + chalk "^2.4.2" + date-fns "^2.0.1" + lodash "^4.17.15" + read-pkg "^4.0.1" + rxjs "^6.5.2" + spawn-command "^0.0.2-1" + supports-color "^6.1.0" + tree-kill "^1.2.2" + yargs "^13.3.0" + config-chain@^1.1.11: version "1.1.12" resolved "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz#0fde8d091200eb5e808caf25fe618c02f48e4efa" @@ -7820,6 +7835,11 @@ date-fns@^2.0.0-alpha.27: resolved "https://registry.npmjs.org/date-fns/-/date-fns-2.12.0.tgz#01754c8a2f3368fc1119cf4625c3dad8c1845ee6" integrity sha512-qJgn99xxKnFgB1qL4jpxU7Q2t0LOn1p8KMIveef3UZD7kqjT3tpFNNdXJelEHhE+rUgffriXriw/sOSU+cS1Hw== +date-fns@^2.0.1: + version "2.15.0" + resolved "https://registry.npmjs.org/date-fns/-/date-fns-2.15.0.tgz#424de6b3778e4e69d3ff27046ec136af58ae5d5f" + integrity sha512-ZCPzAMJZn3rNUvvQIMlXhDr4A+Ar07eLeGsGREoWU19a3Pqf5oYa+ccd+B3F6XVtQY6HANMFdOQ8A+ipFnvJdQ== + dateformat@^3.0.0: version "3.0.3" resolved "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" @@ -16888,6 +16908,15 @@ read-pkg@^3.0.0: normalize-package-data "^2.3.2" path-type "^3.0.0" +read-pkg@^4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/read-pkg/-/read-pkg-4.0.1.tgz#963625378f3e1c4d48c85872b5a6ec7d5d093237" + integrity sha1-ljYlN48+HE1IyFhytabsfV0JMjc= + dependencies: + normalize-package-data "^2.3.2" + parse-json "^4.0.0" + pify "^3.0.0" + read-pkg@^5.2.0: version "5.2.0" resolved "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" @@ -17546,6 +17575,13 @@ rxjs@^6.3.3, rxjs@^6.4.0, rxjs@^6.5.3, rxjs@^6.5.4, rxjs@^6.5.5: dependencies: tslib "^1.9.0" +rxjs@^6.5.2: + version "6.6.0" + resolved "https://registry.npmjs.org/rxjs/-/rxjs-6.6.0.tgz#af2901eedf02e3a83ffa7f886240ff9018bbec84" + integrity sha512-3HMA8z/Oz61DUHe+SdOiQyzIf4tOx5oQHmMir7IZEu6TMqCLHT4LRcmNaUS0NwOz8VLvmmBduMsoaUvMaIiqzg== + dependencies: + tslib "^1.9.0" + safe-buffer@5.1.1: version "5.1.1" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" @@ -18146,6 +18182,11 @@ space-separated-tokens@^1.0.0: resolved "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz#85f32c3d10d9682007e917414ddc5c26d1aa6899" integrity sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA== +spawn-command@^0.0.2-1: + version "0.0.2-1" + resolved "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2-1.tgz#62f5e9466981c1b796dc5929937e11c9c6921bd0" + integrity sha1-YvXpRmmBwbeW3Fkpk34RycaSG9A= + spdx-correct@^3.0.0: version "3.1.0" resolved "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" @@ -20295,11 +20336,6 @@ whatwg-fetch@^2.0.0, whatwg-fetch@^2.0.4: resolved "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" integrity sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng== -whatwg-fetch@^3.2.0: - version "3.2.0" - resolved "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.2.0.tgz#8e134f701f0a4ab5fda82626f113e2b647fd16dc" - integrity sha512-SdGPoQMMnzVYThUbSrEvqTlkvC1Ux27NehaJ/GUHBfNrh5Mjg+1/uRyFMwVnxO2MrikMWvWAqUGgQOfVU4hT7w== - whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0, whatwg-mimetype@^2.3.0: version "2.3.0" resolved "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" @@ -20710,7 +20746,7 @@ yargs-parser@^3.2.0: camelcase "^3.0.0" lodash.assign "^4.1.0" -yargs@^13.3.2: +yargs@^13.3.0, yargs@^13.3.2: version "13.3.2" resolved "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw== From 57c070f1a9d8d1f0bbebb9b916ded2d5dbaacbff Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 29 Jul 2020 05:59:56 +0000 Subject: [PATCH 23/73] chore(deps): bump @rollup/plugin-node-resolve from 8.1.0 to 8.4.0 Bumps [@rollup/plugin-node-resolve](https://github.com/rollup/plugins) from 8.1.0 to 8.4.0. - [Release notes](https://github.com/rollup/plugins/releases) - [Commits](https://github.com/rollup/plugins/compare/node-resolve-v8.1.0...node-resolve-v8.4.0) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/yarn.lock b/yarn.lock index cd8003b1e1..424cac9dcb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2698,17 +2698,17 @@ "@rollup/pluginutils" "^3.0.8" "@rollup/plugin-node-resolve@^8.1.0": - version "8.1.0" - resolved "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-8.1.0.tgz#1da5f3d0ccabc8f66f5e3c74462aad76cfd96c47" - integrity sha512-ovq7ZM3JJYUUmEjjO+H8tnUdmQmdQudJB7xruX8LFZ1W2q8jXdPUS6SsIYip8ByOApu4RR7729Am9WhCeCMiHA== + version "8.4.0" + resolved "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-8.4.0.tgz#261d79a680e9dc3d86761c14462f24126ba83575" + integrity sha512-LFqKdRLn0ShtQyf6SBYO69bGE1upV6wUhBX0vFOUnLAyzx5cwp8svA0eHUnu8+YU57XOkrMtfG63QOpQx25pHQ== dependencies: - "@rollup/pluginutils" "^3.0.8" - "@types/resolve" "0.0.8" + "@rollup/pluginutils" "^3.1.0" + "@types/resolve" "1.17.1" builtin-modules "^3.1.0" deep-freeze "^0.0.1" deepmerge "^4.2.2" is-module "^1.0.0" - resolve "^1.14.2" + resolve "^1.17.0" "@rollup/plugin-yaml@^2.1.1": version "2.1.1" @@ -4258,10 +4258,10 @@ resolved "https://registry.npmjs.org/@types/relateurl/-/relateurl-0.2.28.tgz#6bda7db8653fa62643f5ee69e9f69c11a392e3a6" integrity sha1-a9p9uGU/piZD9e5p6facEaOS46Y= -"@types/resolve@0.0.8": - version "0.0.8" - resolved "https://registry.npmjs.org/@types/resolve/-/resolve-0.0.8.tgz#f26074d238e02659e323ce1a13d041eee280e194" - integrity sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ== +"@types/resolve@1.17.1": + version "1.17.1" + resolved "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" + integrity sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw== dependencies: "@types/node" "*" @@ -17337,7 +17337,7 @@ resolve@1.15.1: dependencies: path-parse "^1.0.6" -resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.14.2, resolve@^1.15.1, resolve@^1.16.1, resolve@^1.17.0, resolve@^1.3.2: +resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.15.1, resolve@^1.16.1, resolve@^1.17.0, resolve@^1.3.2: version "1.17.0" resolved "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== From d1b2a6ccd194cc617baec2ab1033ca74e348dca2 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 29 Jul 2020 11:12:52 +0200 Subject: [PATCH 24/73] Add coding guidelines to CONTRIBUTING --- CONTRIBUTING.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6200f3235b..cf7622d692 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -64,6 +64,14 @@ So...feel ready to jump in? Let's do this. Head over to the [Getting Started gui If you need help, just jump into our [Discord chatroom](https://discord.gg/MUpMjP2). +# Coding Guidelines + +All code is formatted with `prettier` using the configuration in the repo. If possible we recommend configuring your editor to format automatically, but you can also use the `yarn prettier --write ` command to format files. + +If you're contributing to the backend or CLI tooling, be mindful of cross-platform support. [This](https://shapeshed.com/writing-cross-platform-node/) blog post is a good guide of what to keep in mind when writing cross-platform NodeJS. + +Also be sure to skim through our [ADRs](https://github.com/spotify/backstage/tree/master/docs/architecture-decisions) to see if they cover what you're working on. In particular [ADR006: Avoid React.FC and React.SFC](https://github.com/spotify/backstage/blob/master/docs/architecture-decisions/adr006-avoid-react-fc.md) is one to look out for. + # Code of Conduct This project adheres to the [Spotify FOSS Code of Conduct][code-of-conduct]. By participating, you are expected to honor this code. From 315b981cd479230812e768cac1b6d4c5e8ae5fac Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 29 Jul 2020 11:34:37 +0200 Subject: [PATCH 25/73] backend: add clarifying comment to COPY command in Dockerfile --- packages/backend/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/backend/Dockerfile b/packages/backend/Dockerfile index 3e8ba36cec..8d17821101 100644 --- a/packages/backend/Dockerfile +++ b/packages/backend/Dockerfile @@ -2,6 +2,8 @@ FROM node:12 WORKDIR /usr/src/app +# This will copy the contents of the dist-workspace when running the build-image command. +# Do not use this Dockerfile outside of that command, as it will copy in the source code instead. COPY . . RUN yarn install --frozen-lockfile --production From 891b1cebb7b1e80df83753d56ccd711e6212186d Mon Sep 17 00:00:00 2001 From: Sebastian Qvarfordt Date: Wed, 29 Jul 2020 11:49:01 +0200 Subject: [PATCH 26/73] feature(techdocs-core): Initial version of metadata generation of mkdocs data --- packages/techdocs-container/Dockerfile | 2 +- .../techdocs-container/mock-docs/mkdocs.yml | 1 + .../techdocs-container/techdocs-core/setup.py | 2 +- .../techdocs-core/src/core.py | 17 +++++++++++++---- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/packages/techdocs-container/Dockerfile b/packages/techdocs-container/Dockerfile index cfda62c51d..d5eec712a5 100644 --- a/packages/techdocs-container/Dockerfile +++ b/packages/techdocs-container/Dockerfile @@ -15,6 +15,6 @@ FROM python:3.7.7-alpine3.12 RUN apk update && apk --no-cache add gcc musl-dev -RUN pip install --upgrade pip && pip install mkdocs-techdocs-core==0.0.2 mkdocs==1.1.2 mkdocs-material==5.3.2 mkdocs-monorepo-plugin==0.4.5 pymdown-extensions==7.1 +RUN pip install --upgrade pip && pip install mkdocs-techdocs-core==0.0.3 mkdocs==1.1.2 mkdocs-material==5.3.2 mkdocs-monorepo-plugin==0.4.5 pymdown-extensions==7.1 ENTRYPOINT [ "mkdocs" ] diff --git a/packages/techdocs-container/mock-docs/mkdocs.yml b/packages/techdocs-container/mock-docs/mkdocs.yml index fca8418d12..8639c6abef 100644 --- a/packages/techdocs-container/mock-docs/mkdocs.yml +++ b/packages/techdocs-container/mock-docs/mkdocs.yml @@ -1,4 +1,5 @@ site_name: 'mock-docs' +site_description: 'mock-docs site description' nav: - Home: index.md diff --git a/packages/techdocs-container/techdocs-core/setup.py b/packages/techdocs-container/techdocs-core/setup.py index 9429409319..682825624c 100644 --- a/packages/techdocs-container/techdocs-core/setup.py +++ b/packages/techdocs-container/techdocs-core/setup.py @@ -18,7 +18,7 @@ from setuptools import setup, find_packages setup( name='mkdocs-techdocs-core', - version='0.0.2', + version='0.0.3', description='A Mkdocs package that contains TechDocs defaults', long_description='', keywords='mkdocs', diff --git a/packages/techdocs-container/techdocs-core/src/core.py b/packages/techdocs-container/techdocs-core/src/core.py index e6c4a0403d..6129979643 100644 --- a/packages/techdocs-container/techdocs-core/src/core.py +++ b/packages/techdocs-container/techdocs-core/src/core.py @@ -16,16 +16,25 @@ from mkdocs.plugins import BasePlugin, PluginCollection from mkdocs.theme import Theme - from mkdocs.contrib.search import SearchPlugin - from mkdocs_monorepo_plugin.plugin import MonorepoPlugin - +import tempfile +import os class TechDocsCore(BasePlugin): + def on_config(self, config): + fp = open(os.path.join(tempfile.gettempdir(), 'techdocs_metadata.json'), 'w+') + fp.write('{\n "site_name": "{{ config.site_name }}",\n "site_description": "{{ config.site_description }}"\n}') + # Theme - config["theme"] = Theme(name="material") + config["theme"] = Theme( + name="material", + static_templates=[ + "techdocs_metadata.json", + ], + ) + config["theme"].dirs.append(tempfile.gettempdir()) # Plugins del config["plugins"]["techdocs-core"] From 044b1d42011eb769c31f6d1a5595a8ef4619620e Mon Sep 17 00:00:00 2001 From: Sebastian Qvarfordt Date: Wed, 29 Jul 2020 11:55:45 +0200 Subject: [PATCH 27/73] Does not bump mkdocs-techdocs-core in dockerfile yet since it's not published --- packages/techdocs-container/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/techdocs-container/Dockerfile b/packages/techdocs-container/Dockerfile index d5eec712a5..cfda62c51d 100644 --- a/packages/techdocs-container/Dockerfile +++ b/packages/techdocs-container/Dockerfile @@ -15,6 +15,6 @@ FROM python:3.7.7-alpine3.12 RUN apk update && apk --no-cache add gcc musl-dev -RUN pip install --upgrade pip && pip install mkdocs-techdocs-core==0.0.3 mkdocs==1.1.2 mkdocs-material==5.3.2 mkdocs-monorepo-plugin==0.4.5 pymdown-extensions==7.1 +RUN pip install --upgrade pip && pip install mkdocs-techdocs-core==0.0.2 mkdocs==1.1.2 mkdocs-material==5.3.2 mkdocs-monorepo-plugin==0.4.5 pymdown-extensions==7.1 ENTRYPOINT [ "mkdocs" ] From 276dd590f1cfc2f12f2c523ac0303fc97f3e19c9 Mon Sep 17 00:00:00 2001 From: Sebastian Qvarfordt Date: Wed, 29 Jul 2020 12:52:53 +0200 Subject: [PATCH 28/73] fix(techdocs-core): formatting --- .../techdocs-container/techdocs-core/src/core.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/techdocs-container/techdocs-core/src/core.py b/packages/techdocs-container/techdocs-core/src/core.py index 6129979643..0bd992ab7e 100644 --- a/packages/techdocs-container/techdocs-core/src/core.py +++ b/packages/techdocs-container/techdocs-core/src/core.py @@ -21,18 +21,17 @@ from mkdocs_monorepo_plugin.plugin import MonorepoPlugin import tempfile import os -class TechDocsCore(BasePlugin): +class TechDocsCore(BasePlugin): def on_config(self, config): - fp = open(os.path.join(tempfile.gettempdir(), 'techdocs_metadata.json'), 'w+') - fp.write('{\n "site_name": "{{ config.site_name }}",\n "site_description": "{{ config.site_description }}"\n}') - + fp = open(os.path.join(tempfile.gettempdir(), "techdocs_metadata.json"), "w+") + fp.write( + '{\n "site_name": "{{ config.site_name }}",\n "site_description": "{{ config.site_description }}"\n}' + ) + # Theme config["theme"] = Theme( - name="material", - static_templates=[ - "techdocs_metadata.json", - ], + name="material", static_templates=["techdocs_metadata.json",], ) config["theme"].dirs.append(tempfile.gettempdir()) From dc6d2db444d947b9eb6c162f0ff7002021aee1b3 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 29 Jul 2020 16:22:30 +0200 Subject: [PATCH 29/73] catalog-backend: move template mock-data call to scaffolder-backend --- plugins/catalog-backend/scripts/mock-data.sh | 8 -------- plugins/scaffolder-backend/scripts/mock-data.sh | 7 +++++++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/plugins/catalog-backend/scripts/mock-data.sh b/plugins/catalog-backend/scripts/mock-data.sh index 58e2efbe21..76f97ccf3a 100755 --- a/plugins/catalog-backend/scripts/mock-data.sh +++ b/plugins/catalog-backend/scripts/mock-data.sh @@ -17,11 +17,3 @@ for URL in \ --data-raw "{\"type\": \"github\", \"target\": \"https://github.com/spotify/backstage/blob/master/packages/catalog-model/examples/${URL}\"}" echo done - -curl \ - --location \ - --request POST 'localhost:7000/catalog/locations' \ - --header 'Content-Type: application/json' \ - --data-raw "{\"type\": \"github\", \"target\": \"https://github.com/benjdlambert/cookiecutter-golang/blob/master/template.yaml\"}" -echo - diff --git a/plugins/scaffolder-backend/scripts/mock-data.sh b/plugins/scaffolder-backend/scripts/mock-data.sh index 68d011b977..8c73ff9378 100755 --- a/plugins/scaffolder-backend/scripts/mock-data.sh +++ b/plugins/scaffolder-backend/scripts/mock-data.sh @@ -12,3 +12,10 @@ for URL in \ --data-raw "{\"type\": \"file\", \"target\": \"$(pwd)/sample-templates/${URL}/template.yaml\"}" echo done + +curl \ + --location \ + --request POST 'localhost:7000/catalog/locations' \ + --header 'Content-Type: application/json' \ + --data-raw "{\"type\": \"github\", \"target\": \"https://github.com/benjdlambert/cookiecutter-golang/blob/master/template.yaml\"}" +echo From a43d29eb9d307d89ad0a38ce426d2ba22df32a32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20DOREAU?= Date: Sat, 18 Jul 2020 17:02:09 +0200 Subject: [PATCH 30/73] refactor(cli): move create-app into his own package --- packages/cli/src/index.ts | 11 -- packages/create-app/.eslintrc.js | 7 + packages/create-app/README.md | 22 +++ packages/create-app/bin/backstage-create-app | 34 ++++ packages/create-app/package.json | 44 +++++ .../src}/createApp.ts | 8 +- packages/create-app/src/index.ts | 69 ++++++++ packages/create-app/src/lib/errors.ts | 46 ++++++ packages/create-app/src/lib/paths.ts | 150 ++++++++++++++++++ packages/create-app/src/lib/tasks.ts | 105 ++++++++++++ packages/create-app/src/lib/version.ts | 26 +++ 11 files changed, 507 insertions(+), 15 deletions(-) create mode 100644 packages/create-app/.eslintrc.js create mode 100644 packages/create-app/README.md create mode 100755 packages/create-app/bin/backstage-create-app create mode 100644 packages/create-app/package.json rename packages/{cli/src/commands/create-app => create-app/src}/createApp.ts (95%) create mode 100644 packages/create-app/src/index.ts create mode 100644 packages/create-app/src/lib/errors.ts create mode 100644 packages/create-app/src/lib/paths.ts create mode 100644 packages/create-app/src/lib/tasks.ts create mode 100644 packages/create-app/src/lib/version.ts diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index 7521549d96..3123cda613 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -22,17 +22,6 @@ import { version } from './lib/version'; const main = (argv: string[]) => { program.name('backstage-cli').version(version); - program - .command('create-app') - .description('Creates a new app in a new directory') - .option( - '--skip-install', - 'Skip the install and builds steps after creating the app', - ) - .action( - lazyAction(() => import('./commands/create-app/createApp'), 'default'), - ); - program .command('app:build') .description('Build an app for a production release') diff --git a/packages/create-app/.eslintrc.js b/packages/create-app/.eslintrc.js new file mode 100644 index 0000000000..69bec6cd2a --- /dev/null +++ b/packages/create-app/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + extends: [require.resolve('@backstage/cli/config/eslint.backend')], + ignorePatterns: ['templates/**'], + rules: { + 'no-console': 0, + }, +}; diff --git a/packages/create-app/README.md b/packages/create-app/README.md new file mode 100644 index 0000000000..da53c6dd89 --- /dev/null +++ b/packages/create-app/README.md @@ -0,0 +1,22 @@ +# @backstage/create-app + +This package provides a CLI for creating apps. + +## Installation + +Install the package via npm or yarn: + +```sh +$ npm install --save @backstage/create-app +``` + +or + +```sh +$ yarn add @backstage/create-app +``` + +## Documentation + +- [Backstage Readme](https://github.com/spotify/backstage/blob/master/README.md) +- [Backstage Documentation](https://github.com/spotify/backstage/blob/master/docs/README.md) diff --git a/packages/create-app/bin/backstage-create-app b/packages/create-app/bin/backstage-create-app new file mode 100755 index 0000000000..c9baf5d57c --- /dev/null +++ b/packages/create-app/bin/backstage-create-app @@ -0,0 +1,34 @@ +#!/usr/bin/env node +/* + * 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 path = require('path'); + +// Figure out whether we're running inside the backstage repo or as an installed dependency +const isLocal = require('fs').existsSync(path.resolve(__dirname, '../src')); + +if (!isLocal || process.env.BACKSTAGE_E2E_CLI_TEST) { + require('../src'); +} else { + require('ts-node').register({ + transpileOnly: true, + compilerOptions: { + module: 'CommonJS', + }, + }); + + require('../src'); +} diff --git a/packages/create-app/package.json b/packages/create-app/package.json new file mode 100644 index 0000000000..4458daaedf --- /dev/null +++ b/packages/create-app/package.json @@ -0,0 +1,44 @@ +{ + "name": "@backstage/create-app", + "description": "Create app package for Backstage", + "version": "0.1.1", + "private": false, + "publishConfig": { + "access": "public" + }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/spotify/backstage", + "directory": "packages/create-app" + }, + "keywords": [ + "backstage" + ], + "license": "Apache-2.0", + "main": "src/index.ts", + "bin": { + "backstage-create-app": "bin/backstage-create-app" + }, + "dependencies": { + "commander": "^4.1.1", + "chalk": "^4.0.0", + "fs-extra": "^9.0.0", + "react-dev-utils": "^10.2.1", + "inquirer": "^7.0.4", + "recursive-readdir": "^2.2.2", + "ora": "^4.0.3" + }, + "devDependencies": { + "@types/fs-extra": "^9.0.1", + "@types/react-dev-utils": "^9.0.4", + "@types/inquirer": "^6.5.0", + "@types/recursive-readdir": "^2.2.0", + "@types/ora": "^3.2.0", + "ts-node": "^8.6.2" + }, + "nodemonConfig": { + "watch": "./src", + "ext": "ts" + } +} diff --git a/packages/cli/src/commands/create-app/createApp.ts b/packages/create-app/src/createApp.ts similarity index 95% rename from packages/cli/src/commands/create-app/createApp.ts rename to packages/create-app/src/createApp.ts index b3ddcd3109..ebdd7583da 100644 --- a/packages/cli/src/commands/create-app/createApp.ts +++ b/packages/create-app/src/createApp.ts @@ -22,9 +22,9 @@ import inquirer, { Answers, Question } from 'inquirer'; import { exec as execCb } from 'child_process'; import { resolve as resolvePath } from 'path'; import os from 'os'; -import { Task, templatingTask } from '../../lib/tasks'; -import { paths } from '../../lib/paths'; -import { version } from '../../lib/version'; +import { Task, templatingTask } from './lib/tasks'; +import { paths } from './lib/paths'; +import { version } from './lib/version'; const exec = promisify(execCb); @@ -116,7 +116,7 @@ export default async (cmd: Command): Promise => { answers.dbTypePG = answers.dbType === 'PostgreSQL'; answers.dbTypeSqlite = answers.dbType === 'SQLite'; - const templateDir = paths.resolveOwn('templates/default-app'); + const templateDir = paths.resolveOwnRoot('packages/cli/templates/default-app'); const tempDir = resolvePath(os.tmpdir(), answers.name); const appDir = resolvePath(paths.targetDir, answers.name); diff --git a/packages/create-app/src/index.ts b/packages/create-app/src/index.ts new file mode 100644 index 0000000000..2c2106bec2 --- /dev/null +++ b/packages/create-app/src/index.ts @@ -0,0 +1,69 @@ +/* + * 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 program from 'commander'; +import chalk from 'chalk'; +import { exitWithError } from './lib/errors'; +import { version } from './lib/version'; + +const main = (argv: string[]) => { + program.name('backstage-create-app').version(version); + + program + .description('Creates a new app in a new directory') + .option( + '--skip-install', + 'Skip the install and builds steps after creating the app', + ) + .action( + lazyAction(() => import('./createApp'), 'default'), + ); + + if (!process.argv.slice(2).length) { + program.outputHelp(chalk.yellow); + } + + program.parse(argv); +}; + +// Wraps an action function so that it always exits and handles errors +function lazyAction( + actionRequireFunc: () => Promise< + { [name in Export]: (...args: T) => Promise } + >, + exportName: Export, +): (...args: T) => Promise { + return async (...args: T) => { + try { + const module = await actionRequireFunc(); + const actionFunc = module[exportName]; + await actionFunc(...args); + process.exit(0); + } catch (error) { + exitWithError(error); + } + }; +} + +process.on('unhandledRejection', rejection => { + if (rejection instanceof Error) { + exitWithError(rejection); + } else { + exitWithError(new Error(`Unknown rejection: '${rejection}'`)); + } +}); + +main(process.argv); diff --git a/packages/create-app/src/lib/errors.ts b/packages/create-app/src/lib/errors.ts new file mode 100644 index 0000000000..a1eab4c9e5 --- /dev/null +++ b/packages/create-app/src/lib/errors.ts @@ -0,0 +1,46 @@ +/* + * 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 chalk from 'chalk'; + +export class CustomError extends Error { + get name(): string { + return this.constructor.name; + } +} + +export class ExitCodeError extends CustomError { + readonly code: number; + + constructor(code: number, command?: string) { + if (command) { + super(`Command '${command}' exited with code ${code}`); + } else { + super(`Child exited with code ${code}`); + } + this.code = code; + } +} + +export function exitWithError(error: Error): never { + if (error instanceof ExitCodeError) { + process.stderr.write(`\n${chalk.red(error.message)}\n\n`); + process.exit(error.code); + } else { + process.stderr.write(`\n${chalk.red(`${error}`)}\n\n`); + process.exit(1); + } +} diff --git a/packages/create-app/src/lib/paths.ts b/packages/create-app/src/lib/paths.ts new file mode 100644 index 0000000000..be3f3dcee8 --- /dev/null +++ b/packages/create-app/src/lib/paths.ts @@ -0,0 +1,150 @@ +/* + * 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 fs from 'fs-extra'; +import { dirname, resolve as resolvePath } from 'path'; + +export type ResolveFunc = (...paths: string[]) => string; + +// Common paths and resolve functions used by the cli. +// Currently assumes it is being executed within a monorepo. +export type Paths = { + // Root dir of the cli itself, containing package.json + ownDir: string; + + // Monorepo root dir of the cli itself. Only accessible when running inside Backstage repo. + ownRoot: string; + + // The location of the app that the cli is being executed in + targetDir: string; + + // The monorepo root package of the app that the cli is being executed in. + targetRoot: string; + + // Resolve a path relative to own repo + resolveOwn: ResolveFunc; + + // Resolve a path relative to own monorepo root. Only accessible when running inside Backstage repo. + resolveOwnRoot: ResolveFunc; + + // Resolve a path relative to the app + resolveTarget: ResolveFunc; + + // Resolve a path relative to the app repo root + resolveTargetRoot: ResolveFunc; +}; + +// Looks for a package.json that has name: "root" to identify the root of the monorepo +export function findRootPath(topPath: string): string { + let path = topPath; + + // Some sanity check to avoid infinite loop + for (let i = 0; i < 1000; i++) { + const packagePath = resolvePath(path, 'package.json'); + const exists = fs.pathExistsSync(packagePath); + if (exists) { + try { + const data = fs.readJsonSync(packagePath); + if (data.name === 'root' || data.name.includes('backstage-e2e')) { + return path; + } + } catch (error) { + throw new Error( + `Failed to parse package.json file while searching for root, ${error}`, + ); + } + } + + const newPath = dirname(path); + if (newPath === path) { + throw new Error( + `No package.json with name "root" found as a parent of ${topPath}`, + ); + } + path = newPath; + } + + throw new Error( + `Iteration limit reached when searching for root package.json at ${topPath}`, + ); +} + +// Finds the root of the cli package itself +export function findOwnDir() { + // Known relative locations of package in dist/dev + const pathDist = '..'; + const pathDev = '../..'; + + // Check the closest dir first + const pkgInDist = resolvePath(__dirname, pathDist, 'package.json'); + const isDist = fs.pathExistsSync(pkgInDist); + + const path = isDist ? pathDist : pathDev; + return resolvePath(__dirname, path); +} + +// Finds the root of the monorepo that the cli exists in. Only accessible when running inside Backstage repo. +export function findOwnRootPath(ownDir: string) { + const isLocal = fs.pathExistsSync(resolvePath(ownDir, 'src')); + if (!isLocal) { + throw new Error( + 'Tried to access monorepo package root dir outside of Backstage repository', + ); + } + + return resolvePath(ownDir, '../..'); +} + +export function findPaths(): Paths { + const ownDir = findOwnDir(); + const targetDir = fs.realpathSync(process.cwd()); + + // Lazy load this as it will throw an error if we're not inside the Backstage repo. + let ownRoot = ''; + const getOwnRoot = () => { + if (!ownRoot) { + ownRoot = findOwnRootPath(ownDir); + } + return ownRoot; + }; + + // We're not always running in a monorepo, so we lazy init this to only crash commands + // that require a monorepo when we're not in one. + let targetRoot = ''; + const getTargetRoot = () => { + if (!targetRoot) { + targetRoot = findRootPath(targetDir); + } + return targetRoot; + }; + + return { + ownDir, + get ownRoot() { + return getOwnRoot(); + }, + targetDir, + get targetRoot() { + return getTargetRoot(); + }, + resolveOwn: (...paths) => resolvePath(ownDir, ...paths), + resolveOwnRoot: (...paths) => resolvePath(getOwnRoot(), ...paths), + resolveTarget: (...paths) => resolvePath(targetDir, ...paths), + resolveTargetRoot: (...paths) => resolvePath(getTargetRoot(), ...paths), + }; +} + +export const paths = findPaths(); diff --git a/packages/create-app/src/lib/tasks.ts b/packages/create-app/src/lib/tasks.ts new file mode 100644 index 0000000000..0753301b78 --- /dev/null +++ b/packages/create-app/src/lib/tasks.ts @@ -0,0 +1,105 @@ +/* + * 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 chalk from 'chalk'; +import fs from 'fs-extra'; +import handlebars from 'handlebars'; +import ora from 'ora'; +import { basename, dirname } from 'path'; +import recursive from 'recursive-readdir'; + +const TASK_NAME_MAX_LENGTH = 14; + +export class Task { + static log(name: string = '') { + process.stdout.write(`${chalk.green(name)}\n`); + } + + static error(message: string = '') { + process.stdout.write(`\n${chalk.red(message)}\n\n`); + } + + static section(name: string) { + const title = chalk.green(`${name}:`); + process.stdout.write(`\n ${title}\n`); + } + + static exit(code: number = 0) { + process.exit(code); + } + + static async forItem( + task: string, + item: string, + taskFunc: () => Promise, + ): Promise { + const paddedTask = chalk.green(task.padEnd(TASK_NAME_MAX_LENGTH)); + + const spinner = ora({ + prefixText: chalk.green(` ${paddedTask}${chalk.cyan(item)}`), + spinner: 'arc', + color: 'green', + }).start(); + + try { + await taskFunc(); + spinner.succeed(); + } catch (error) { + spinner.fail(); + throw error; + } + } +} + +export async function templatingTask( + templateDir: string, + destinationDir: string, + context: any, +) { + const files = await recursive(templateDir).catch(error => { + throw new Error(`Failed to read template directory: ${error.message}`); + }); + + for (const file of files) { + const destinationFile = file.replace(templateDir, destinationDir); + await fs.ensureDir(dirname(destinationFile)); + + if (file.endsWith('.hbs')) { + await Task.forItem('templating', basename(file), async () => { + const destination = destinationFile.replace(/\.hbs$/, ''); + + const template = await fs.readFile(file); + const compiled = handlebars.compile(template.toString()); + const contents = compiled({ name: basename(destination), ...context }); + + await fs.writeFile(destination, contents).catch(error => { + throw new Error( + `Failed to create file: ${destination}: ${error.message}`, + ); + }); + }); + } else { + await Task.forItem('copying', basename(file), async () => { + await fs.copyFile(file, destinationFile).catch(error => { + const destination = destinationFile; + throw new Error( + `Failed to copy file to ${destination} : ${error.message}`, + ); + }); + }); + } + } +} diff --git a/packages/create-app/src/lib/version.ts b/packages/create-app/src/lib/version.ts new file mode 100644 index 0000000000..24734b87cc --- /dev/null +++ b/packages/create-app/src/lib/version.ts @@ -0,0 +1,26 @@ +/* + * 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 fs from 'fs-extra'; +import { paths } from './paths'; + +export function findVersion() { + const pkgContent = fs.readFileSync(paths.resolveOwn('package.json'), 'utf8'); + return JSON.parse(pkgContent).version; +} + +export const version = findVersion(); +export const isDev = fs.pathExistsSync(paths.resolveOwn('src')); From 5eb1f2d69f2d60a5024fe42d5926d41290fb7242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20DOREAU?= Date: Sun, 26 Jul 2020 16:32:42 +0200 Subject: [PATCH 31/73] refactor(create-app): remove useless extras --- packages/create-app/.eslintrc.js | 1 - packages/create-app/README.md | 1 + packages/create-app/package.json | 4 ---- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/create-app/.eslintrc.js b/packages/create-app/.eslintrc.js index 69bec6cd2a..503c048748 100644 --- a/packages/create-app/.eslintrc.js +++ b/packages/create-app/.eslintrc.js @@ -1,6 +1,5 @@ module.exports = { extends: [require.resolve('@backstage/cli/config/eslint.backend')], - ignorePatterns: ['templates/**'], rules: { 'no-console': 0, }, diff --git a/packages/create-app/README.md b/packages/create-app/README.md index da53c6dd89..09b881e73f 100644 --- a/packages/create-app/README.md +++ b/packages/create-app/README.md @@ -1,6 +1,7 @@ # @backstage/create-app This package provides a CLI for creating apps. +You can use the flag `--skip-install` to skip the install. ## Installation diff --git a/packages/create-app/package.json b/packages/create-app/package.json index 4458daaedf..9ba2dc76d8 100644 --- a/packages/create-app/package.json +++ b/packages/create-app/package.json @@ -36,9 +36,5 @@ "@types/recursive-readdir": "^2.2.0", "@types/ora": "^3.2.0", "ts-node": "^8.6.2" - }, - "nodemonConfig": { - "watch": "./src", - "ext": "ts" } } From 489a57b0c7b92b4afd4fa1f18ead3d3b9b02e9be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20DOREAU?= Date: Thu, 30 Jul 2020 01:08:07 +0200 Subject: [PATCH 32/73] feat(create-app): requested changes --- docs/getting-started/create-an-app.md | 2 +- packages/cli/e2e-test/cli-e2e-test.js | 3 +- .../default-app/plugins/welcome/src/plugin.ts | 9 ------ packages/create-app/README.md | 10 ++----- packages/create-app/package.json | 2 +- packages/create-app/src/createApp.ts | 2 +- packages/create-app/src/index.ts | 24 ++-------------- .../templates/default-app/.eslintrc.js | 0 .../templates/default-app/README.md | 0 .../templates/default-app/app-config.yaml | 0 .../templates/default-app/lerna.json | 0 .../templates/default-app/package.json.hbs | 0 .../default-app/packages/app/.eslintrc.js | 0 .../default-app/packages/app/cypress.json | 0 .../packages/app/cypress/.eslintrc.json | 0 .../packages/app/cypress/integration/app.js | 0 .../default-app/packages/app/package.json.hbs | 0 .../app/public/android-chrome-192x192.png | Bin .../packages/app/public/apple-touch-icon.png | Bin .../packages/app/public/favicon-16x16.png | Bin .../packages/app/public/favicon-32x32.png | Bin .../packages/app/public/favicon.ico | Bin .../packages/app/public/index.html | 0 .../packages/app/public/manifest.json | 0 .../packages/app/public/robots.txt | 0 .../packages/app/public/safari-pinned-tab.svg | 0 .../default-app/packages/app/src/App.test.tsx | 0 .../default-app/packages/app/src/App.tsx | 0 .../default-app/packages/app/src/index.tsx | 0 .../default-app/packages/app/src/plugins.ts | 0 .../packages/app/src/setupTests.ts | 0 .../default-app/plugins/welcome/.eslintrc.js | 0 .../default-app/plugins/welcome/README.md | 0 .../default-app/plugins/welcome/dev/index.tsx | 0 .../plugins/welcome/package.json.hbs | 0 .../welcome/src/components/Timer/Timer.tsx | 0 .../welcome/src/components/Timer/index.ts | 0 .../WelcomePage/WelcomePage.test.tsx | 0 .../components/WelcomePage/WelcomePage.tsx | 0 .../src/components/WelcomePage/index.ts | 0 .../default-app/plugins/welcome/src/index.ts | 0 .../plugins/welcome/src/plugin.test.ts | 0 .../default-app/plugins/welcome/src/plugin.ts | 24 ++++++++++++++++ .../plugins/welcome/src/setupTests.ts | 0 .../templates/default-app/tsconfig.json | 0 .../create-app/templates/serve_index.html | 27 ++++++++++++++++++ 46 files changed, 59 insertions(+), 44 deletions(-) delete mode 100644 packages/cli/templates/default-app/plugins/welcome/src/plugin.ts rename packages/{cli => create-app}/templates/default-app/.eslintrc.js (100%) rename packages/{cli => create-app}/templates/default-app/README.md (100%) rename packages/{cli => create-app}/templates/default-app/app-config.yaml (100%) rename packages/{cli => create-app}/templates/default-app/lerna.json (100%) rename packages/{cli => create-app}/templates/default-app/package.json.hbs (100%) rename packages/{cli => create-app}/templates/default-app/packages/app/.eslintrc.js (100%) rename packages/{cli => create-app}/templates/default-app/packages/app/cypress.json (100%) rename packages/{cli => create-app}/templates/default-app/packages/app/cypress/.eslintrc.json (100%) rename packages/{cli => create-app}/templates/default-app/packages/app/cypress/integration/app.js (100%) rename packages/{cli => create-app}/templates/default-app/packages/app/package.json.hbs (100%) rename packages/{cli => create-app}/templates/default-app/packages/app/public/android-chrome-192x192.png (100%) rename packages/{cli => create-app}/templates/default-app/packages/app/public/apple-touch-icon.png (100%) rename packages/{cli => create-app}/templates/default-app/packages/app/public/favicon-16x16.png (100%) rename packages/{cli => create-app}/templates/default-app/packages/app/public/favicon-32x32.png (100%) rename packages/{cli => create-app}/templates/default-app/packages/app/public/favicon.ico (100%) rename packages/{cli => create-app}/templates/default-app/packages/app/public/index.html (100%) rename packages/{cli => create-app}/templates/default-app/packages/app/public/manifest.json (100%) rename packages/{cli => create-app}/templates/default-app/packages/app/public/robots.txt (100%) rename packages/{cli => create-app}/templates/default-app/packages/app/public/safari-pinned-tab.svg (100%) rename packages/{cli => create-app}/templates/default-app/packages/app/src/App.test.tsx (100%) rename packages/{cli => create-app}/templates/default-app/packages/app/src/App.tsx (100%) rename packages/{cli => create-app}/templates/default-app/packages/app/src/index.tsx (100%) rename packages/{cli => create-app}/templates/default-app/packages/app/src/plugins.ts (100%) rename packages/{cli => create-app}/templates/default-app/packages/app/src/setupTests.ts (100%) rename packages/{cli => create-app}/templates/default-app/plugins/welcome/.eslintrc.js (100%) rename packages/{cli => create-app}/templates/default-app/plugins/welcome/README.md (100%) rename packages/{cli => create-app}/templates/default-app/plugins/welcome/dev/index.tsx (100%) rename packages/{cli => create-app}/templates/default-app/plugins/welcome/package.json.hbs (100%) rename packages/{cli => create-app}/templates/default-app/plugins/welcome/src/components/Timer/Timer.tsx (100%) rename packages/{cli => create-app}/templates/default-app/plugins/welcome/src/components/Timer/index.ts (100%) rename packages/{cli => create-app}/templates/default-app/plugins/welcome/src/components/WelcomePage/WelcomePage.test.tsx (100%) rename packages/{cli => create-app}/templates/default-app/plugins/welcome/src/components/WelcomePage/WelcomePage.tsx (100%) rename packages/{cli => create-app}/templates/default-app/plugins/welcome/src/components/WelcomePage/index.ts (100%) rename packages/{cli => create-app}/templates/default-app/plugins/welcome/src/index.ts (100%) rename packages/{cli => create-app}/templates/default-app/plugins/welcome/src/plugin.test.ts (100%) create mode 100644 packages/create-app/templates/default-app/plugins/welcome/src/plugin.ts rename packages/{cli => create-app}/templates/default-app/plugins/welcome/src/setupTests.ts (100%) rename packages/{cli => create-app}/templates/default-app/tsconfig.json (100%) create mode 100644 packages/create-app/templates/serve_index.html diff --git a/docs/getting-started/create-an-app.md b/docs/getting-started/create-an-app.md index b69ff1508c..ab5e71ad60 100644 --- a/docs/getting-started/create-an-app.md +++ b/docs/getting-started/create-an-app.md @@ -15,7 +15,7 @@ To create a Backstage app, you will need to have With `npx`: ```bash -npx @backstage/cli create-app +npx @backstage/create-app ``` This will create a new Backstage App inside the current folder. The name of the diff --git a/packages/cli/e2e-test/cli-e2e-test.js b/packages/cli/e2e-test/cli-e2e-test.js index 206ea25ccd..e3829a65e6 100644 --- a/packages/cli/e2e-test/cli-e2e-test.js +++ b/packages/cli/e2e-test/cli-e2e-test.js @@ -107,8 +107,7 @@ async function createApp(appName, isPostgres, workspaceDir, rootDir) { const child = spawnPiped( [ 'node', - resolvePath(workspaceDir, 'packages/cli/bin/backstage-cli'), - 'create-app', + resolvePath(workspaceDir, 'packages/cli/bin/backstage-create-app'), '--skip-install', ], { diff --git a/packages/cli/templates/default-app/plugins/welcome/src/plugin.ts b/packages/cli/templates/default-app/plugins/welcome/src/plugin.ts deleted file mode 100644 index a65fad5348..0000000000 --- a/packages/cli/templates/default-app/plugins/welcome/src/plugin.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { createPlugin } from '@backstage/core'; -import WelcomePage from './components/WelcomePage'; - -export const plugin = createPlugin({ - id: 'welcome', - register({ router }) { - router.registerRoute('/', WelcomePage); - }, -}); diff --git a/packages/create-app/README.md b/packages/create-app/README.md index 09b881e73f..b5f231a326 100644 --- a/packages/create-app/README.md +++ b/packages/create-app/README.md @@ -5,16 +5,10 @@ You can use the flag `--skip-install` to skip the install. ## Installation -Install the package via npm or yarn: +With `npx`: ```sh -$ npm install --save @backstage/create-app -``` - -or - -```sh -$ yarn add @backstage/create-app +$ npx @backstage/create-app ``` ## Documentation diff --git a/packages/create-app/package.json b/packages/create-app/package.json index 9ba2dc76d8..74017fe53d 100644 --- a/packages/create-app/package.json +++ b/packages/create-app/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/create-app", "description": "Create app package for Backstage", - "version": "0.1.1", + "version": "0.1.1-alpha.12", "private": false, "publishConfig": { "access": "public" diff --git a/packages/create-app/src/createApp.ts b/packages/create-app/src/createApp.ts index ebdd7583da..b4564b1ff8 100644 --- a/packages/create-app/src/createApp.ts +++ b/packages/create-app/src/createApp.ts @@ -116,7 +116,7 @@ export default async (cmd: Command): Promise => { answers.dbTypePG = answers.dbType === 'PostgreSQL'; answers.dbTypeSqlite = answers.dbType === 'SQLite'; - const templateDir = paths.resolveOwnRoot('packages/cli/templates/default-app'); + const templateDir = paths.resolveOwn('templates/default-app'); const tempDir = resolvePath(os.tmpdir(), answers.name); const appDir = resolvePath(paths.targetDir, answers.name); diff --git a/packages/create-app/src/index.ts b/packages/create-app/src/index.ts index 2c2106bec2..93c10c8c99 100644 --- a/packages/create-app/src/index.ts +++ b/packages/create-app/src/index.ts @@ -18,6 +18,7 @@ import program from 'commander'; import chalk from 'chalk'; import { exitWithError } from './lib/errors'; import { version } from './lib/version'; +import createApp from './createApp'; const main = (argv: string[]) => { program.name('backstage-create-app').version(version); @@ -28,9 +29,7 @@ const main = (argv: string[]) => { '--skip-install', 'Skip the install and builds steps after creating the app', ) - .action( - lazyAction(() => import('./createApp'), 'default'), - ); + .action(createApp) if (!process.argv.slice(2).length) { program.outputHelp(chalk.yellow); @@ -39,25 +38,6 @@ const main = (argv: string[]) => { program.parse(argv); }; -// Wraps an action function so that it always exits and handles errors -function lazyAction( - actionRequireFunc: () => Promise< - { [name in Export]: (...args: T) => Promise } - >, - exportName: Export, -): (...args: T) => Promise { - return async (...args: T) => { - try { - const module = await actionRequireFunc(); - const actionFunc = module[exportName]; - await actionFunc(...args); - process.exit(0); - } catch (error) { - exitWithError(error); - } - }; -} - process.on('unhandledRejection', rejection => { if (rejection instanceof Error) { exitWithError(rejection); diff --git a/packages/cli/templates/default-app/.eslintrc.js b/packages/create-app/templates/default-app/.eslintrc.js similarity index 100% rename from packages/cli/templates/default-app/.eslintrc.js rename to packages/create-app/templates/default-app/.eslintrc.js diff --git a/packages/cli/templates/default-app/README.md b/packages/create-app/templates/default-app/README.md similarity index 100% rename from packages/cli/templates/default-app/README.md rename to packages/create-app/templates/default-app/README.md diff --git a/packages/cli/templates/default-app/app-config.yaml b/packages/create-app/templates/default-app/app-config.yaml similarity index 100% rename from packages/cli/templates/default-app/app-config.yaml rename to packages/create-app/templates/default-app/app-config.yaml diff --git a/packages/cli/templates/default-app/lerna.json b/packages/create-app/templates/default-app/lerna.json similarity index 100% rename from packages/cli/templates/default-app/lerna.json rename to packages/create-app/templates/default-app/lerna.json diff --git a/packages/cli/templates/default-app/package.json.hbs b/packages/create-app/templates/default-app/package.json.hbs similarity index 100% rename from packages/cli/templates/default-app/package.json.hbs rename to packages/create-app/templates/default-app/package.json.hbs diff --git a/packages/cli/templates/default-app/packages/app/.eslintrc.js b/packages/create-app/templates/default-app/packages/app/.eslintrc.js similarity index 100% rename from packages/cli/templates/default-app/packages/app/.eslintrc.js rename to packages/create-app/templates/default-app/packages/app/.eslintrc.js diff --git a/packages/cli/templates/default-app/packages/app/cypress.json b/packages/create-app/templates/default-app/packages/app/cypress.json similarity index 100% rename from packages/cli/templates/default-app/packages/app/cypress.json rename to packages/create-app/templates/default-app/packages/app/cypress.json diff --git a/packages/cli/templates/default-app/packages/app/cypress/.eslintrc.json b/packages/create-app/templates/default-app/packages/app/cypress/.eslintrc.json similarity index 100% rename from packages/cli/templates/default-app/packages/app/cypress/.eslintrc.json rename to packages/create-app/templates/default-app/packages/app/cypress/.eslintrc.json diff --git a/packages/cli/templates/default-app/packages/app/cypress/integration/app.js b/packages/create-app/templates/default-app/packages/app/cypress/integration/app.js similarity index 100% rename from packages/cli/templates/default-app/packages/app/cypress/integration/app.js rename to packages/create-app/templates/default-app/packages/app/cypress/integration/app.js diff --git a/packages/cli/templates/default-app/packages/app/package.json.hbs b/packages/create-app/templates/default-app/packages/app/package.json.hbs similarity index 100% rename from packages/cli/templates/default-app/packages/app/package.json.hbs rename to packages/create-app/templates/default-app/packages/app/package.json.hbs diff --git a/packages/cli/templates/default-app/packages/app/public/android-chrome-192x192.png b/packages/create-app/templates/default-app/packages/app/public/android-chrome-192x192.png similarity index 100% rename from packages/cli/templates/default-app/packages/app/public/android-chrome-192x192.png rename to packages/create-app/templates/default-app/packages/app/public/android-chrome-192x192.png diff --git a/packages/cli/templates/default-app/packages/app/public/apple-touch-icon.png b/packages/create-app/templates/default-app/packages/app/public/apple-touch-icon.png similarity index 100% rename from packages/cli/templates/default-app/packages/app/public/apple-touch-icon.png rename to packages/create-app/templates/default-app/packages/app/public/apple-touch-icon.png diff --git a/packages/cli/templates/default-app/packages/app/public/favicon-16x16.png b/packages/create-app/templates/default-app/packages/app/public/favicon-16x16.png similarity index 100% rename from packages/cli/templates/default-app/packages/app/public/favicon-16x16.png rename to packages/create-app/templates/default-app/packages/app/public/favicon-16x16.png diff --git a/packages/cli/templates/default-app/packages/app/public/favicon-32x32.png b/packages/create-app/templates/default-app/packages/app/public/favicon-32x32.png similarity index 100% rename from packages/cli/templates/default-app/packages/app/public/favicon-32x32.png rename to packages/create-app/templates/default-app/packages/app/public/favicon-32x32.png diff --git a/packages/cli/templates/default-app/packages/app/public/favicon.ico b/packages/create-app/templates/default-app/packages/app/public/favicon.ico similarity index 100% rename from packages/cli/templates/default-app/packages/app/public/favicon.ico rename to packages/create-app/templates/default-app/packages/app/public/favicon.ico diff --git a/packages/cli/templates/default-app/packages/app/public/index.html b/packages/create-app/templates/default-app/packages/app/public/index.html similarity index 100% rename from packages/cli/templates/default-app/packages/app/public/index.html rename to packages/create-app/templates/default-app/packages/app/public/index.html diff --git a/packages/cli/templates/default-app/packages/app/public/manifest.json b/packages/create-app/templates/default-app/packages/app/public/manifest.json similarity index 100% rename from packages/cli/templates/default-app/packages/app/public/manifest.json rename to packages/create-app/templates/default-app/packages/app/public/manifest.json diff --git a/packages/cli/templates/default-app/packages/app/public/robots.txt b/packages/create-app/templates/default-app/packages/app/public/robots.txt similarity index 100% rename from packages/cli/templates/default-app/packages/app/public/robots.txt rename to packages/create-app/templates/default-app/packages/app/public/robots.txt diff --git a/packages/cli/templates/default-app/packages/app/public/safari-pinned-tab.svg b/packages/create-app/templates/default-app/packages/app/public/safari-pinned-tab.svg similarity index 100% rename from packages/cli/templates/default-app/packages/app/public/safari-pinned-tab.svg rename to packages/create-app/templates/default-app/packages/app/public/safari-pinned-tab.svg diff --git a/packages/cli/templates/default-app/packages/app/src/App.test.tsx b/packages/create-app/templates/default-app/packages/app/src/App.test.tsx similarity index 100% rename from packages/cli/templates/default-app/packages/app/src/App.test.tsx rename to packages/create-app/templates/default-app/packages/app/src/App.test.tsx diff --git a/packages/cli/templates/default-app/packages/app/src/App.tsx b/packages/create-app/templates/default-app/packages/app/src/App.tsx similarity index 100% rename from packages/cli/templates/default-app/packages/app/src/App.tsx rename to packages/create-app/templates/default-app/packages/app/src/App.tsx diff --git a/packages/cli/templates/default-app/packages/app/src/index.tsx b/packages/create-app/templates/default-app/packages/app/src/index.tsx similarity index 100% rename from packages/cli/templates/default-app/packages/app/src/index.tsx rename to packages/create-app/templates/default-app/packages/app/src/index.tsx diff --git a/packages/cli/templates/default-app/packages/app/src/plugins.ts b/packages/create-app/templates/default-app/packages/app/src/plugins.ts similarity index 100% rename from packages/cli/templates/default-app/packages/app/src/plugins.ts rename to packages/create-app/templates/default-app/packages/app/src/plugins.ts diff --git a/packages/cli/templates/default-app/packages/app/src/setupTests.ts b/packages/create-app/templates/default-app/packages/app/src/setupTests.ts similarity index 100% rename from packages/cli/templates/default-app/packages/app/src/setupTests.ts rename to packages/create-app/templates/default-app/packages/app/src/setupTests.ts diff --git a/packages/cli/templates/default-app/plugins/welcome/.eslintrc.js b/packages/create-app/templates/default-app/plugins/welcome/.eslintrc.js similarity index 100% rename from packages/cli/templates/default-app/plugins/welcome/.eslintrc.js rename to packages/create-app/templates/default-app/plugins/welcome/.eslintrc.js diff --git a/packages/cli/templates/default-app/plugins/welcome/README.md b/packages/create-app/templates/default-app/plugins/welcome/README.md similarity index 100% rename from packages/cli/templates/default-app/plugins/welcome/README.md rename to packages/create-app/templates/default-app/plugins/welcome/README.md diff --git a/packages/cli/templates/default-app/plugins/welcome/dev/index.tsx b/packages/create-app/templates/default-app/plugins/welcome/dev/index.tsx similarity index 100% rename from packages/cli/templates/default-app/plugins/welcome/dev/index.tsx rename to packages/create-app/templates/default-app/plugins/welcome/dev/index.tsx diff --git a/packages/cli/templates/default-app/plugins/welcome/package.json.hbs b/packages/create-app/templates/default-app/plugins/welcome/package.json.hbs similarity index 100% rename from packages/cli/templates/default-app/plugins/welcome/package.json.hbs rename to packages/create-app/templates/default-app/plugins/welcome/package.json.hbs diff --git a/packages/cli/templates/default-app/plugins/welcome/src/components/Timer/Timer.tsx b/packages/create-app/templates/default-app/plugins/welcome/src/components/Timer/Timer.tsx similarity index 100% rename from packages/cli/templates/default-app/plugins/welcome/src/components/Timer/Timer.tsx rename to packages/create-app/templates/default-app/plugins/welcome/src/components/Timer/Timer.tsx diff --git a/packages/cli/templates/default-app/plugins/welcome/src/components/Timer/index.ts b/packages/create-app/templates/default-app/plugins/welcome/src/components/Timer/index.ts similarity index 100% rename from packages/cli/templates/default-app/plugins/welcome/src/components/Timer/index.ts rename to packages/create-app/templates/default-app/plugins/welcome/src/components/Timer/index.ts diff --git a/packages/cli/templates/default-app/plugins/welcome/src/components/WelcomePage/WelcomePage.test.tsx b/packages/create-app/templates/default-app/plugins/welcome/src/components/WelcomePage/WelcomePage.test.tsx similarity index 100% rename from packages/cli/templates/default-app/plugins/welcome/src/components/WelcomePage/WelcomePage.test.tsx rename to packages/create-app/templates/default-app/plugins/welcome/src/components/WelcomePage/WelcomePage.test.tsx diff --git a/packages/cli/templates/default-app/plugins/welcome/src/components/WelcomePage/WelcomePage.tsx b/packages/create-app/templates/default-app/plugins/welcome/src/components/WelcomePage/WelcomePage.tsx similarity index 100% rename from packages/cli/templates/default-app/plugins/welcome/src/components/WelcomePage/WelcomePage.tsx rename to packages/create-app/templates/default-app/plugins/welcome/src/components/WelcomePage/WelcomePage.tsx diff --git a/packages/cli/templates/default-app/plugins/welcome/src/components/WelcomePage/index.ts b/packages/create-app/templates/default-app/plugins/welcome/src/components/WelcomePage/index.ts similarity index 100% rename from packages/cli/templates/default-app/plugins/welcome/src/components/WelcomePage/index.ts rename to packages/create-app/templates/default-app/plugins/welcome/src/components/WelcomePage/index.ts diff --git a/packages/cli/templates/default-app/plugins/welcome/src/index.ts b/packages/create-app/templates/default-app/plugins/welcome/src/index.ts similarity index 100% rename from packages/cli/templates/default-app/plugins/welcome/src/index.ts rename to packages/create-app/templates/default-app/plugins/welcome/src/index.ts diff --git a/packages/cli/templates/default-app/plugins/welcome/src/plugin.test.ts b/packages/create-app/templates/default-app/plugins/welcome/src/plugin.test.ts similarity index 100% rename from packages/cli/templates/default-app/plugins/welcome/src/plugin.test.ts rename to packages/create-app/templates/default-app/plugins/welcome/src/plugin.test.ts diff --git a/packages/create-app/templates/default-app/plugins/welcome/src/plugin.ts b/packages/create-app/templates/default-app/plugins/welcome/src/plugin.ts new file mode 100644 index 0000000000..3121e982b7 --- /dev/null +++ b/packages/create-app/templates/default-app/plugins/welcome/src/plugin.ts @@ -0,0 +1,24 @@ +/* + * 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 { createPlugin } from '@backstage/core'; +import WelcomePage from './components/WelcomePage'; + +export const plugin = createPlugin({ + id: 'welcome', + register({ router }) { + router.registerRoute('/', WelcomePage); + }, +}); diff --git a/packages/cli/templates/default-app/plugins/welcome/src/setupTests.ts b/packages/create-app/templates/default-app/plugins/welcome/src/setupTests.ts similarity index 100% rename from packages/cli/templates/default-app/plugins/welcome/src/setupTests.ts rename to packages/create-app/templates/default-app/plugins/welcome/src/setupTests.ts diff --git a/packages/cli/templates/default-app/tsconfig.json b/packages/create-app/templates/default-app/tsconfig.json similarity index 100% rename from packages/cli/templates/default-app/tsconfig.json rename to packages/create-app/templates/default-app/tsconfig.json diff --git a/packages/create-app/templates/serve_index.html b/packages/create-app/templates/serve_index.html new file mode 100644 index 0000000000..d7aebb7f4b --- /dev/null +++ b/packages/create-app/templates/serve_index.html @@ -0,0 +1,27 @@ + + + + + + + + Backstage + + + +
+ + + From 7bedd6f2a016c9b1cdb353b05fd5c29cf93f2ba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20DOREAU?= Date: Thu, 30 Jul 2020 09:50:29 +0200 Subject: [PATCH 33/73] fix(cli): e2e tests createApp path --- packages/cli/e2e-test/cli-e2e-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/e2e-test/cli-e2e-test.js b/packages/cli/e2e-test/cli-e2e-test.js index e3829a65e6..0a03e65bdd 100644 --- a/packages/cli/e2e-test/cli-e2e-test.js +++ b/packages/cli/e2e-test/cli-e2e-test.js @@ -107,7 +107,7 @@ async function createApp(appName, isPostgres, workspaceDir, rootDir) { const child = spawnPiped( [ 'node', - resolvePath(workspaceDir, 'packages/cli/bin/backstage-create-app'), + resolvePath(workspaceDir, 'packages/create-app/bin/backstage-create-app'), '--skip-install', ], { From e14962205a81507b52b86c52c0c8ed0828d322be Mon Sep 17 00:00:00 2001 From: ellinors Date: Thu, 30 Jul 2020 10:19:50 +0200 Subject: [PATCH 34/73] fix(techdocs): updated mkdocs-techdocs-core in techdocs-container Docker file. --- packages/techdocs-container/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/techdocs-container/Dockerfile b/packages/techdocs-container/Dockerfile index cfda62c51d..d5eec712a5 100644 --- a/packages/techdocs-container/Dockerfile +++ b/packages/techdocs-container/Dockerfile @@ -15,6 +15,6 @@ FROM python:3.7.7-alpine3.12 RUN apk update && apk --no-cache add gcc musl-dev -RUN pip install --upgrade pip && pip install mkdocs-techdocs-core==0.0.2 mkdocs==1.1.2 mkdocs-material==5.3.2 mkdocs-monorepo-plugin==0.4.5 pymdown-extensions==7.1 +RUN pip install --upgrade pip && pip install mkdocs-techdocs-core==0.0.3 mkdocs==1.1.2 mkdocs-material==5.3.2 mkdocs-monorepo-plugin==0.4.5 pymdown-extensions==7.1 ENTRYPOINT [ "mkdocs" ] From 5749c98e3f61f8bb116e5cb87b0a7c6d69b0e4e1 Mon Sep 17 00:00:00 2001 From: Twisha Saraiya Date: Thu, 30 Jul 2020 14:45:21 +0530 Subject: [PATCH 35/73] techdocs: modify documentation header --- packages/core/src/layout/Header/Header.stories.tsx | 8 ++++++++ packages/core/src/layout/Page/PageThemeProvider.ts | 7 ++++++- .../src/reader/components/TechDocsPageWrapper.tsx | 6 +++--- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/packages/core/src/layout/Header/Header.stories.tsx b/packages/core/src/layout/Header/Header.stories.tsx index 426229e9ed..39b9133c0a 100644 --- a/packages/core/src/layout/Header/Header.stories.tsx +++ b/packages/core/src/layout/Header/Header.stories.tsx @@ -85,6 +85,14 @@ export const App = () => ( ); +export const Documentation = () => ( + +
+ {labels} +
+
+); + export const Other = () => (
diff --git a/packages/core/src/layout/Page/PageThemeProvider.ts b/packages/core/src/layout/Page/PageThemeProvider.ts index 36430021bb..c99509513f 100644 --- a/packages/core/src/layout/Page/PageThemeProvider.ts +++ b/packages/core/src/layout/Page/PageThemeProvider.ts @@ -65,6 +65,11 @@ export const gradients: Record = { waveColor: '#9BF0E1', opacity: ['0.72', '0.0'], }, + pinkSea: { + colors: ['#C8077A', '#C2297D'], + waveColor: '#ea93c3', + opacity: ['0.8', '0.0'], + }, }; export const pageTheme: Record = { @@ -72,7 +77,7 @@ export const pageTheme: Record = { gradient: gradients.teal, }, documentation: { - gradient: gradients.eveningSea, + gradient: gradients.pinkSea, }, tool: { gradient: gradients.purpleSky, diff --git a/plugins/techdocs/src/reader/components/TechDocsPageWrapper.tsx b/plugins/techdocs/src/reader/components/TechDocsPageWrapper.tsx index abb702535b..b511fde1e7 100644 --- a/plugins/techdocs/src/reader/components/TechDocsPageWrapper.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsPageWrapper.tsx @@ -15,7 +15,7 @@ */ import React from 'react'; -import { Header, Content } from '@backstage/core'; +import { Header, Content, Page, pageTheme } from '@backstage/core'; type TechDocsPageWrapperProps = { title: string; @@ -29,9 +29,9 @@ export const TechDocsPageWrapper = ({ subtitle, }: TechDocsPageWrapperProps) => { return ( - <> +
{children} - + ); }; From c485f7375ebc31c4d907d9b74f9f0c1a8e6072f6 Mon Sep 17 00:00:00 2001 From: Paul Pacheco Date: Thu, 30 Jul 2020 04:43:02 -0500 Subject: [PATCH 36/73] Add configuration for github enterprise --- plugins/auth-backend/src/providers/github/provider.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/auth-backend/src/providers/github/provider.ts b/plugins/auth-backend/src/providers/github/provider.ts index 37d661f9ab..2404bd0be1 100644 --- a/plugins/auth-backend/src/providers/github/provider.ts +++ b/plugins/auth-backend/src/providers/github/provider.ts @@ -136,11 +136,17 @@ export function createGithubProvider( const appOrigin = envConfig.getString('appOrigin'); const clientID = envConfig.getString('clientId'); const clientSecret = envConfig.getString('clientSecret'); + const authorizationURL = envConfig.getOptionalString('authorizationURL'); + const tokenURL = envConfig.getOptionalString('tokenURL'); + const userProfileURL = envConfig.getOptionalString('userProfileURL'); const callbackURL = `${baseUrl}/${providerId}/handler/frame?env=${env}`; const opts = { clientID, clientSecret, + authorizationURL, + tokenURL, + userProfileURL, callbackURL, }; From 84d366527ac1d04005a668abfaee019d13d8ac05 Mon Sep 17 00:00:00 2001 From: Paul Pacheco Date: Thu, 30 Jul 2020 04:51:04 -0500 Subject: [PATCH 37/73] Get config from environment variables --- app-config.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app-config.yaml b/app-config.yaml index e5f872201d..6ca9356053 100644 --- a/app-config.yaml +++ b/app-config.yaml @@ -48,6 +48,15 @@ auth: clientSecret: $secret: env: AUTH_GITHUB_CLIENT_SECRET + authorizationURL: + $secret: + env: AUTH_GITHUB_AUTHORIZATION_URL + tokenURL: + $secret: + env: AUTH_GITHUB_TOKEN_URL + userProfileUrl: + $secret: + env: AUTH_GITHUB_USER_PROFILE_URL gitlab: development: appOrigin: "http://localhost:3000/" From c0feeecc29e3ca93b90f777d6a14f75db04ce1de Mon Sep 17 00:00:00 2001 From: Paul Pacheco Date: Thu, 30 Jul 2020 04:53:35 -0500 Subject: [PATCH 38/73] Add documentation --- plugins/auth-backend/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/auth-backend/README.md b/plugins/auth-backend/README.md index ff0b1c7a3d..7b52da4ad0 100644 --- a/plugins/auth-backend/README.md +++ b/plugins/auth-backend/README.md @@ -32,6 +32,16 @@ export AUTH_GITHUB_CLIENT_ID=x export AUTH_GITHUB_CLIENT_SECRET=x ``` +for github enterprise: + +```bash +export AUTH_GITHUB_CLIENT_ID=x +export AUTH_GITHUB_CLIENT_SECRET=x +export AUTH_GITHUB_AUTHORIZATION_URL=https://ENTERPRISE_INSTANCE_URL/login/oauth/authorize +export AUTH_GITHUB_TOKEN_URL=https://ENTERPRISE_INSTANCE_URL/login/oauth/access_token +export AUTH_GITHUB_USER_PROFILE_URL=https://ENTERPRISE_INSTANCE_URL/api/v3/user +``` + ### Gitlab ```bash From c3fc889d1221d99d47fe252b15aa3179a1a7f7bc Mon Sep 17 00:00:00 2001 From: David Sykes Date: Thu, 30 Jul 2020 11:17:24 +0100 Subject: [PATCH 39/73] Exported ErrorPage and reordered exports --- packages/core/src/layout/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/core/src/layout/index.ts b/packages/core/src/layout/index.ts index e8245119f3..d97d30982e 100644 --- a/packages/core/src/layout/index.ts +++ b/packages/core/src/layout/index.ts @@ -17,13 +17,14 @@ export * from './Content'; export * from './ContentHeader'; export * from './ErrorBoundary'; +export * from './ErrorPage'; export * from './Header'; export * from './HeaderLabel'; +export * from './HeaderTabs'; export * from './HomepageTimer'; export * from './InfoCard'; +export * from './ItemCard'; export * from './Page'; export * from './Sidebar'; export * from './SignInPage'; export * from './TabbedCard'; -export * from './HeaderTabs'; -export * from './ItemCard'; From 5ae8479e39a8c5a36a2c728c0f2186e50315d86f Mon Sep 17 00:00:00 2001 From: David Sykes Date: Thu, 30 Jul 2020 11:18:20 +0100 Subject: [PATCH 40/73] Added optional docPath parameter to ErrorPage and used it to display docPath for missing TechDocs --- packages/core/src/layout/ErrorPage/ErrorPage.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/core/src/layout/ErrorPage/ErrorPage.tsx b/packages/core/src/layout/ErrorPage/ErrorPage.tsx index d6620295c1..b382997da3 100644 --- a/packages/core/src/layout/ErrorPage/ErrorPage.tsx +++ b/packages/core/src/layout/ErrorPage/ErrorPage.tsx @@ -24,6 +24,7 @@ import { useNavigate } from 'react-router'; interface IErrorPageProps { status: string; statusMessage: string; + docPath?: string; } const useStyles = makeStyles(theme => ({ @@ -38,7 +39,11 @@ const useStyles = makeStyles(theme => ({ }, })); -export const ErrorPage = ({ status, statusMessage }: IErrorPageProps) => { +export const ErrorPage = ({ + status, + statusMessage, + docPath, +}: IErrorPageProps) => { const classes = useStyles(); const navigate = useNavigate(); @@ -48,6 +53,8 @@ export const ErrorPage = ({ status, statusMessage }: IErrorPageProps) => { ERROR {status}: {statusMessage} +
+ {docPath}
Looks like someone dropped the mic! From fa708d6572098446e277c3ed2e1b5d3c372090df Mon Sep 17 00:00:00 2001 From: David Sykes Date: Thu, 30 Jul 2020 11:19:12 +0100 Subject: [PATCH 41/73] TechDocsNotFound now uses ErrorPage from core with an optional docPath parameter --- .../reader/components/TechDocsNotFound.tsx | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/plugins/techdocs/src/reader/components/TechDocsNotFound.tsx b/plugins/techdocs/src/reader/components/TechDocsNotFound.tsx index 2a961b5bc0..7f50a2861e 100644 --- a/plugins/techdocs/src/reader/components/TechDocsNotFound.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsNotFound.tsx @@ -15,20 +15,16 @@ */ import React from 'react'; -import { Typography, Button } from '@material-ui/core'; -import { TechDocsPageWrapper } from './TechDocsPageWrapper'; +import { ErrorPage } from '@backstage/core'; export const TechDocsNotFound = () => { return ( - - Error: Documentation not found - Path: {window.location.pathname} - - +
+ +
); }; From ea57820c62da7308abccfb8c3fda4394503b170c Mon Sep 17 00:00:00 2001 From: David Sykes Date: Thu, 30 Jul 2020 11:30:01 +0100 Subject: [PATCH 42/73] Removed a div that was no longer needed --- .../src/reader/components/TechDocsNotFound.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/plugins/techdocs/src/reader/components/TechDocsNotFound.tsx b/plugins/techdocs/src/reader/components/TechDocsNotFound.tsx index 7f50a2861e..cbb038c0ce 100644 --- a/plugins/techdocs/src/reader/components/TechDocsNotFound.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsNotFound.tsx @@ -19,12 +19,10 @@ import { ErrorPage } from '@backstage/core'; export const TechDocsNotFound = () => { return ( -
- -
+ ); }; From 4f54f062feb7db40a60636916bbc0a2b816bbb1f Mon Sep 17 00:00:00 2001 From: David Sykes Date: Thu, 30 Jul 2020 11:31:26 +0100 Subject: [PATCH 43/73] Updated test --- .../techdocs/src/reader/components/TechDocsNotFound.test.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/techdocs/src/reader/components/TechDocsNotFound.test.tsx b/plugins/techdocs/src/reader/components/TechDocsNotFound.test.tsx index 7792164b14..70504561ef 100644 --- a/plugins/techdocs/src/reader/components/TechDocsNotFound.test.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsNotFound.test.tsx @@ -21,6 +21,8 @@ import { wrapInTestApp } from '@backstage/test-utils'; describe('TechDocs Not Found', () => { it('should render a Documentation not found page', async () => { const { queryByText } = render(wrapInTestApp()); - expect(queryByText(/error: documentation not found/i)).toBeInTheDocument(); + expect( + queryByText(/Error 404: Documentation not found/i), + ).toBeInTheDocument(); }); }); From 58fa8ce5fbc12471a1728dbd73379df5881930ed Mon Sep 17 00:00:00 2001 From: David Sykes Date: Thu, 30 Jul 2020 11:35:01 +0100 Subject: [PATCH 44/73] Updated test --- .../src/reader/components/TechDocsNotFound.test.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/plugins/techdocs/src/reader/components/TechDocsNotFound.test.tsx b/plugins/techdocs/src/reader/components/TechDocsNotFound.test.tsx index 70504561ef..7b0ec80619 100644 --- a/plugins/techdocs/src/reader/components/TechDocsNotFound.test.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsNotFound.test.tsx @@ -18,11 +18,12 @@ import React from 'react'; import { render } from '@testing-library/react'; import { wrapInTestApp } from '@backstage/test-utils'; -describe('TechDocs Not Found', () => { - it('should render a Documentation not found page', async () => { - const { queryByText } = render(wrapInTestApp()); - expect( - queryByText(/Error 404: Documentation not found/i), - ).toBeInTheDocument(); +describe('', () => { + it('should render with status code, status message and go back link', () => { + const rendered = render(wrapInTestApp()); + rendered.getByText(/Documentation not found/i); + rendered.getByText(/404/i); + rendered.getByText(/Looks like someone dropped the mic!/i); + expect(rendered.getByTestId('go-back-link')).toBeDefined(); }); }); From 54610c9ba481275970e71131da5d9bbf009b2eba Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 30 Jul 2020 12:37:02 +0200 Subject: [PATCH 45/73] auth-backend: set SameSite=Lax for oauth flow cookies --- plugins/auth-backend/src/lib/OAuthProvider.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/auth-backend/src/lib/OAuthProvider.ts b/plugins/auth-backend/src/lib/OAuthProvider.ts index c4996c31a2..7385299722 100644 --- a/plugins/auth-backend/src/lib/OAuthProvider.ts +++ b/plugins/auth-backend/src/lib/OAuthProvider.ts @@ -248,7 +248,7 @@ export class OAuthProvider implements AuthProviderRouteHandlers { res.cookie(`${this.options.providerId}-nonce`, nonce, { maxAge: TEN_MINUTES_MS, secure: this.options.secure, - sameSite: 'none', + sameSite: 'lax', domain: this.domain, path: `${this.basePath}/${this.options.providerId}/handler`, httpOnly: true, @@ -259,7 +259,7 @@ export class OAuthProvider implements AuthProviderRouteHandlers { res.cookie(`${this.options.providerId}-scope`, scope, { maxAge: TEN_MINUTES_MS, secure: this.options.secure, - sameSite: 'none', + sameSite: 'lax', domain: this.domain, path: `${this.basePath}/${this.options.providerId}/handler`, httpOnly: true, @@ -277,7 +277,7 @@ export class OAuthProvider implements AuthProviderRouteHandlers { res.cookie(`${this.options.providerId}-refresh-token`, refreshToken, { maxAge: THOUSAND_DAYS_MS, secure: this.options.secure, - sameSite: 'none', + sameSite: 'lax', domain: this.domain, path: `${this.basePath}/${this.options.providerId}`, httpOnly: true, @@ -288,7 +288,7 @@ export class OAuthProvider implements AuthProviderRouteHandlers { res.cookie(`${this.options.providerId}-refresh-token`, '', { maxAge: 0, secure: false, - sameSite: 'none', + sameSite: 'lax', domain: `${this.domain}`, path: `${this.basePath}/${this.options.providerId}`, httpOnly: true, From 2930e081a5ba19f8e5d68cccf682af5817697e45 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 30 Jul 2020 12:45:36 +0200 Subject: [PATCH 46/73] core-api: ensure instantPopup is synchronous in RefreshingAuthSessionManager --- .../RefreshingAuthSessionManager.test.ts | 4 ++-- .../lib/AuthSessionManager/RefreshingAuthSessionManager.ts | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/core-api/src/lib/AuthSessionManager/RefreshingAuthSessionManager.test.ts b/packages/core-api/src/lib/AuthSessionManager/RefreshingAuthSessionManager.test.ts index 12e7c0a978..9e22e4cd69 100644 --- a/packages/core-api/src/lib/AuthSessionManager/RefreshingAuthSessionManager.test.ts +++ b/packages/core-api/src/lib/AuthSessionManager/RefreshingAuthSessionManager.test.ts @@ -137,7 +137,7 @@ describe('RefreshingAuthSessionManager', () => { expect(refreshSession).toBeCalledTimes(1); }); - it('should forward option to instantly show auth popup', async () => { + it('should forward option to instantly show auth popup and not attempt refresh', async () => { const createSession = jest.fn(); const refreshSession = jest.fn().mockRejectedValue(new Error('NOPE')); const manager = new RefreshingAuthSessionManager({ @@ -151,7 +151,7 @@ describe('RefreshingAuthSessionManager', () => { scopes: new Set(), instantPopup: true, }); - expect(refreshSession).toBeCalledTimes(1); + expect(refreshSession).toBeCalledTimes(0); }); it('should remove session straight away', async () => { diff --git a/packages/core-api/src/lib/AuthSessionManager/RefreshingAuthSessionManager.ts b/packages/core-api/src/lib/AuthSessionManager/RefreshingAuthSessionManager.ts index e46c505c12..a098b384f9 100644 --- a/packages/core-api/src/lib/AuthSessionManager/RefreshingAuthSessionManager.ts +++ b/packages/core-api/src/lib/AuthSessionManager/RefreshingAuthSessionManager.ts @@ -90,7 +90,12 @@ export class RefreshingAuthSessionManager implements SessionManager { // The user may still have a valid refresh token in their cookies. Attempt to // initiate a fresh session through the backend using that refresh token. - if (!this.currentSession) { + // + // We skip this check if an instant login popup is requested, as we need to + // stay in a synchronous call stack from the user interaction. The downside + // is that that the user will sometimes be requested to log in even if they + // already had an existing session. + if (!this.currentSession && !options.instantPopup) { try { const newSession = await this.collapsedSessionRefresh(); this.currentSession = newSession; From 448767712b9912f37a20da6b10a413cba0e5e53d Mon Sep 17 00:00:00 2001 From: Govindarajan Nagarajan Date: Thu, 30 Jul 2020 15:16:54 +0200 Subject: [PATCH 47/73] (auth-backend) Bugfix: Do not throw Exception if scopes dont exist. Refs #1786 Currently, the OAuthProvider library in `auth-backend` throws an Exception if scopes are missing in the `start` (initial) request in the Authorization flow. Scopes are an optional parameter as per the spec, so if scopes are empty, simply forward the empty scopes instead of throwing an Exception --- plugins/auth-backend/src/lib/OAuthProvider.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/plugins/auth-backend/src/lib/OAuthProvider.ts b/plugins/auth-backend/src/lib/OAuthProvider.ts index c4996c31a2..f9d85223a7 100644 --- a/plugins/auth-backend/src/lib/OAuthProvider.ts +++ b/plugins/auth-backend/src/lib/OAuthProvider.ts @@ -104,10 +104,6 @@ export class OAuthProvider implements AuthProviderRouteHandlers { // retrieve scopes from request const scope = req.query.scope?.toString() ?? ''; - if (!scope) { - throw new InputError('missing scope parameter'); - } - if (this.options.persistScopes) { this.setScopesCookie(res, scope); } From 343b922e8f4d77e8f16972dded0b18f9d079c600 Mon Sep 17 00:00:00 2001 From: David J Sykes Date: Thu, 30 Jul 2020 15:17:38 +0100 Subject: [PATCH 48/73] Removed
using seperate Typography element instead --- packages/core/src/layout/ErrorPage/ErrorPage.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/core/src/layout/ErrorPage/ErrorPage.tsx b/packages/core/src/layout/ErrorPage/ErrorPage.tsx index b382997da3..df8323ef46 100644 --- a/packages/core/src/layout/ErrorPage/ErrorPage.tsx +++ b/packages/core/src/layout/ErrorPage/ErrorPage.tsx @@ -53,7 +53,8 @@ export const ErrorPage = ({ ERROR {status}: {statusMessage} -
+
+ {docPath} From 5cde7069cfa01f3bfbabc6d8f97d83e4fd719278 Mon Sep 17 00:00:00 2001 From: Paul Pacheco Date: Thu, 30 Jul 2020 09:33:12 -0500 Subject: [PATCH 49/73] Pass github enterprise base url, derive urls for authentication --- app-config.yaml | 10 ++-------- plugins/auth-backend/README.md | 4 +--- .../auth-backend/src/providers/github/provider.ts | 15 ++++++++++++--- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/app-config.yaml b/app-config.yaml index 6ca9356053..514ba8e3c7 100644 --- a/app-config.yaml +++ b/app-config.yaml @@ -48,15 +48,9 @@ auth: clientSecret: $secret: env: AUTH_GITHUB_CLIENT_SECRET - authorizationURL: + enterpriseInstanceURL: $secret: - env: AUTH_GITHUB_AUTHORIZATION_URL - tokenURL: - $secret: - env: AUTH_GITHUB_TOKEN_URL - userProfileUrl: - $secret: - env: AUTH_GITHUB_USER_PROFILE_URL + env: AUTH_GITHUB_ENTERPRISE_INSTANCE_URL gitlab: development: appOrigin: "http://localhost:3000/" diff --git a/plugins/auth-backend/README.md b/plugins/auth-backend/README.md index 7b52da4ad0..f413d56fbd 100644 --- a/plugins/auth-backend/README.md +++ b/plugins/auth-backend/README.md @@ -37,9 +37,7 @@ for github enterprise: ```bash export AUTH_GITHUB_CLIENT_ID=x export AUTH_GITHUB_CLIENT_SECRET=x -export AUTH_GITHUB_AUTHORIZATION_URL=https://ENTERPRISE_INSTANCE_URL/login/oauth/authorize -export AUTH_GITHUB_TOKEN_URL=https://ENTERPRISE_INSTANCE_URL/login/oauth/access_token -export AUTH_GITHUB_USER_PROFILE_URL=https://ENTERPRISE_INSTANCE_URL/api/v3/user +export AUTH_GITHUB_ENTERPRISE_INSTANCE_URL=https://x ``` ### Gitlab diff --git a/plugins/auth-backend/src/providers/github/provider.ts b/plugins/auth-backend/src/providers/github/provider.ts index 2404bd0be1..ab102bad19 100644 --- a/plugins/auth-backend/src/providers/github/provider.ts +++ b/plugins/auth-backend/src/providers/github/provider.ts @@ -136,9 +136,18 @@ export function createGithubProvider( const appOrigin = envConfig.getString('appOrigin'); const clientID = envConfig.getString('clientId'); const clientSecret = envConfig.getString('clientSecret'); - const authorizationURL = envConfig.getOptionalString('authorizationURL'); - const tokenURL = envConfig.getOptionalString('tokenURL'); - const userProfileURL = envConfig.getOptionalString('userProfileURL'); + const enterpriseInstanceUrl = envConfig.getOptionalString( + 'enterpriseInstanceURL', + ); + const authorizationURL = enterpriseInstanceUrl + ? `${enterpriseInstanceUrl}/login/oauth/authorize` + : undefined; + const tokenURL = enterpriseInstanceUrl + ? `${enterpriseInstanceUrl}/login/oauth/access_token` + : undefined; + const userProfileURL = enterpriseInstanceUrl + ? `${enterpriseInstanceUrl}/api/v3/user` + : undefined; const callbackURL = `${baseUrl}/${providerId}/handler/frame?env=${env}`; const opts = { From b625b19978d796dda98e9f7ae90609dc31868faa Mon Sep 17 00:00:00 2001 From: Paul Pacheco Date: Thu, 30 Jul 2020 09:50:08 -0500 Subject: [PATCH 50/73] use cammel case --- app-config.yaml | 2 +- plugins/auth-backend/src/providers/github/provider.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app-config.yaml b/app-config.yaml index 514ba8e3c7..5f75ff522e 100644 --- a/app-config.yaml +++ b/app-config.yaml @@ -48,7 +48,7 @@ auth: clientSecret: $secret: env: AUTH_GITHUB_CLIENT_SECRET - enterpriseInstanceURL: + enterpriseInstanceUrl: $secret: env: AUTH_GITHUB_ENTERPRISE_INSTANCE_URL gitlab: diff --git a/plugins/auth-backend/src/providers/github/provider.ts b/plugins/auth-backend/src/providers/github/provider.ts index ab102bad19..e9c719ea1c 100644 --- a/plugins/auth-backend/src/providers/github/provider.ts +++ b/plugins/auth-backend/src/providers/github/provider.ts @@ -137,7 +137,7 @@ export function createGithubProvider( const clientID = envConfig.getString('clientId'); const clientSecret = envConfig.getString('clientSecret'); const enterpriseInstanceUrl = envConfig.getOptionalString( - 'enterpriseInstanceURL', + 'enterpriseInstanceUrl', ); const authorizationURL = enterpriseInstanceUrl ? `${enterpriseInstanceUrl}/login/oauth/authorize` From 0fe2ddf70fe68bd1850b1f2dfb7ac05913bb64e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bodil=20Bj=C3=B6rklund?= Date: Thu, 30 Jul 2020 17:04:03 +0200 Subject: [PATCH 51/73] Tweaks to techdocs docs Text editing --- docs/features/techdocs/FAQ.md | 17 +++--- docs/features/techdocs/concepts.md | 21 ++++--- .../techdocs/creating-and-publishing.md | 39 +++++-------- docs/features/techdocs/getting-started.md | 58 +++++++++---------- 4 files changed, 58 insertions(+), 77 deletions(-) diff --git a/docs/features/techdocs/FAQ.md b/docs/features/techdocs/FAQ.md index ee9a40c983..f872e63718 100644 --- a/docs/features/techdocs/FAQ.md +++ b/docs/features/techdocs/FAQ.md @@ -1,20 +1,23 @@ # TechDocs FAQ -This page answer frequently asked questions about [TechDocs]. +This page answers frequently asked questions about [TechDocs](README.md). -#### Technology +_Got a question that you think others might be interested in knowing the answer to? Edit this file +[here](https://github.com/spotify/backstage/edit/master/docs/features/techdocs/FAQ.md)._ + +## Technology - [What static site generator is TechDocs using?](./#what-static-site-generator-is-techdocs-using) - [What is the mkdocs-techdocs-core plugin?](./#what-is-the-mkdocs-techdocs-core-plugin) -## What static site generator is TechDocs using? +#### What static site generator is TechDocs using? TechDocs is using [MkDocs](https://www.mkdocs.org/) to build project -doucmentation under the hood. Documentation built with the +documentation under the hood. Documentation built with the [techdocs-container](https://github.com/spotify/backstage/blob/master/packages/techdocs-container/README.md) is using the MkDocs Material Theme. -## What is the mkdocs-techdocs-core plugin? +#### What is the mkdocs-techdocs-core plugin? The [mkdocs-techdocs-core](https://github.com/spotify/backstage/blob/master/packages/techdocs-container/techdocs-core/README.md) @@ -23,7 +26,3 @@ plugins (e.g. [MkDocs Monorepo Plugin](https://github.com/spotify/mkdocs-monorepo-plugin)) as well as a selection of Python Markdown extensions that TechDocs supports. -_Add a question that you think others might be interested in? Edit the file -[here](https://github.com/spotify/backstage/edit/master/docs/features/techdocs/FAQ.md)._ - -[techdocs]: README.md diff --git a/docs/features/techdocs/concepts.md b/docs/features/techdocs/concepts.md index d0e3c3c0ea..f06ed8b4c0 100644 --- a/docs/features/techdocs/concepts.md +++ b/docs/features/techdocs/concepts.md @@ -1,7 +1,6 @@ # Concepts -This page describes concepts that has been introduced with Spotify's -docs-like-code solution in Backstage. +This page describes concepts that are introduced with Spotify's docs-like-code solution in Backstage. ### TechDocs Core Plugin @@ -20,34 +19,34 @@ MkDocs. [TechDocs Container](../../../packages/techdocs-container/README.md) -### TechDocs publisher (Coming Soon) +### TechDocs publisher (coming soon) ### TechDocs CLI The TechDocs CLI was created to make it easy to write, generate and preview documentation for publishing. Currently it mostly acts as a wrapper around the -TechDocs container and provides a easy to use interface for our docker +TechDocs container and provides an easy-to-use interface for our docker container. [TechDocs CLI](../../../packages/techdocs-cli/README.md) ### TechDocs Reader -Documentation generated by TechDocs is generated as static html sites. The -TechDocs Reader was therefore created to be able to integrate pre-generated html +Documentation generated by TechDocs is generated as static HTML sites. The +TechDocs Reader was therefore created to be able to integrate pre-generated HTML sites with the Backstage UI. The TechDocs Reader purpose is also to open up the opportunity to integrate TechDocs widgets for a customized full-featured TechDocs experience. -([Coming Soon V.2](https://github.com/spotify/backstage/milestone/17)) +([coming soon V.2](https://github.com/spotify/backstage/milestone/17)) [TechDocs Reader](../../../plugins/techdocs/src/reader/README.md) ### Transformers -Transformers is different pieces of functionality used inside the TechDocs -Reader. The reason to why transformers were introduced is to provide a way to -transform the html content on pre and post render. (e.g. rewrite docs links or -modify css) +Transformers are different pieces of functionality used inside the TechDocs +Reader. The reason why transformers were introduced was to provide a way to +transform the HTML content on pre and post render (e.g. rewrite docs links or +modify css). [Transformers API docs](../../../plugins/techdocs/src/reader/transformers/README.md) diff --git a/docs/features/techdocs/creating-and-publishing.md b/docs/features/techdocs/creating-and-publishing.md index 0ac4f054d7..b38fb77b08 100644 --- a/docs/features/techdocs/creating-and-publishing.md +++ b/docs/features/techdocs/creating-and-publishing.md @@ -5,22 +5,18 @@ This section will guide you through: - Creating a basic setup for your documentation - Writing and previewing your documentation in a local Backstage environment - Creating a build ready for publication -- Publishing your documentation and making your Backstage instance read from - your published docs. +- Publishing your documentation and making your Backstage instance read your published docs. ## Prerequisities - [Docker](https://docs.docker.com/get-docker/) - Static file hosting - A working Backstage instance with TechDocs installed - [TechDocs getting started](getting-started.md) + (see [TechDocs getting started](getting-started.md)) ## Create a basic documentation setup -Create a directory that contains your documentation. Inside this directory you -should create a file called `mkdocs.yml`. As an example you can create a -directory called `hello-docs` in your home directory (also known as `~`). Below -is a basic example of how it could look. +In your home directory (also known as `~`), create a directory that contains your documentation (for example, `hello-docs`). Inside this directory, create a file called `mkdocs.yml`. Below is a basic example of how it could look. The `~/hello-docs/mkdocs.yml` file should have the following content: @@ -34,7 +30,7 @@ plugins: - techdocs-core ``` -And then the `~/hello-docs/docs/index.md` should have the following content: +The `~/hello-docs/docs/index.md` should have the following content: ```md # example docs @@ -58,7 +54,7 @@ npx techdocs-cli serve ## Build production ready documentation To get a build suitable for publication you can build your docs using the -`spotify/techdocs` container. +`spotify/techdocs` container: ```bash cd ~/hello-docs/ @@ -69,20 +65,15 @@ You should now have a folder called `~/hello-docs/site/`. ## Deploy to a file server -In order to serve documentation to TechDocs, our Backstage plugin needs to -download the HTML rendered from the -[Create documentation](#create-documentation) step above. This will likely exist -on an external file server, or a storage solution such as Google Cloud Storage. +In order to serve documentation to TechDocs, our Backstage plugin needs to download the HTML rendered from the previous step. This will likely exist on an external file server, or a storage solution such as Google Cloud Storage. -When deploying documentation, it should be deployed on that file server / -storage solution with the following convention: `{id}/{file}`. For example, if -we wanted to upload the `getting-started/index.html` file for the `backstage` +When deploying documentation, it should be deployed on that file server/storage solution with the following convention: `{id}/{file}`. For example, if +you want to upload the `getting-started/index.html` file for the `backstage` documentation site, we would upload it to our file server as `backstage/getting-started/index.html`. -To explain further how this would look like for multiple documentation sites, -take a look at this example file tree that would be represented on your file -server: +To explain further what this would look like for multiple documentation sites, +take a look at this example file tree that would be represented on your file server: ```md /backstage/index.html /backstage/getting-started/index.html @@ -96,7 +87,7 @@ In this file tree, we have two documentation sites available: `backstage` and on `http://example.com` as the server URL. When you configure the TechDocs plugin in Backstage to use `http://example.com` -as the file server / storage solution, it will translate the following URLs to +as the file server/storage solution, it will translate the following URLs to the file server: | Backstage URL | File Server URL | @@ -104,10 +95,8 @@ the file server: | https://demo.backstage.io/docs/backstage/ | http://example.com/backstage/index.html | | https://demo.backstage.io/docs/mkdocs/plugin-development/ | http://example.com/mkdocs/plugin-development/index.html | -Then deploying new sites is easy. It's as simple as copying over the `site/` -folder produced in the [Create documentation](#create-documentation) step above -and copying it over to the file server / storage solution under the ID of the -documentation site. It will then become immediately available in Backstage under +Then deploying new sites is easy: simply copy over the `site/` +folder produced in the [Create documentation](#build-production-ready-documentation) step above to the file server/storage solution under the ID of the documentation site. It will then become immediately available in Backstage under the same ID as you can see in the table above. So, if the URL to your file server is `http://example.com/`, your @@ -120,7 +109,7 @@ In order for Backstage to show your documentation, it needs to know where you uploaded it. Make sure you have Backstage set up using -[TechDocs getting started](getting-started.md) +[TechDocs getting started](getting-started.md). To point Backstage to your docs storage, add or change the following lines in your Backstage `app-config.yaml`: diff --git a/docs/features/techdocs/getting-started.md b/docs/features/techdocs/getting-started.md index 2ea8fc7fa9..90dcd423fa 100644 --- a/docs/features/techdocs/getting-started.md +++ b/docs/features/techdocs/getting-started.md @@ -1,27 +1,27 @@ # Getting Started -> TechDocs is not feature complete and currently you can't set up a complete +> TechDocs is not yet feature complete - currently you can't set up a complete > end-to-end working TechDocs plugin without customizing the plugin itself. -> With TechDocs V.0 you can expect a demonstration of how to integrate docs into -> Backstage. Currently it can create docs using -> [mkdocs](https://www.mkdocs.org/), as well as reading published docs. If you -> publish generated docs and passing in a storageUrl in your `app-config.yaml` -> you can view it in Backstage by going to +> What you can expect from TechDocs V.0 is a demonstration of how to integrate docs into +> Backstage. TechDocs can create docs using +> [mkdocs](https://www.mkdocs.org/), as well as read published docs. If you +> publish generated docs and pass in a `storageUrl` in your `app-config.yaml`, +> you can view them in Backstage by going to > `http://localhost:3000/docs/`. -Getting started with TechDocs is easy. TechDocs functions as a plugin to -Backstage, why you will need to use Backstage to use TechDocs. +TechDocs functions as a plugin to +Backstage, so you will need to use Backstage to use TechDocs. ## What is Backstage? Backstage is an open platform for building developer portals. It’s based on the developer portal we’ve been using internally at Spotify for over four years. -[Read more](https://github.com/spotify/backstage). +[Read more here](https://github.com/spotify/backstage). ## Prerequisities -In order to use Backstage and TechDocs, you will need to have the following +In order to use Backstage and TechDocs, you need to have the following installed: - [Node.js](https://nodejs.org) Active LTS (long term support), currently v12 @@ -29,48 +29,41 @@ installed: ## Creating a new Backstage app -> If you have already created a Backstage application for this purpose, jump to +> If you have already created a Backstage application, jump to > [Installing TechDocs](#installing-techdocs), otherwise complete this step. -To create a new Backstage application for us to set up TechDocs, you will need -to run the following command: +To create a new Backstage application for TechDocs, run the following command: ```bash npx @backstage/cli create-app ``` -You will then be prompted to enter a name for your application. Once you do so, -this will create a new Backstage application for you in a new folder. For -example, if we chose the name `hello-world` for our application, it would create -a new `hello-world` folder containing our new Backstage application. +You will then be prompted to enter a name for your application. Once that's done, a new Backstage application will be created in a new folder. For +example, if you choose the name `hello-world`, a new `hello-world` folder is created containing your new Backstage application. ## Installing TechDocs -Inside of our new Backstage application, TechDocs is not provided by default. -For this reason we will need to manually set up TechDocs. It should take less +TechDocs is not provided with the Backstage application by default, so you will now need to set up TechDocs manually. It should take less than a minute. ### Adding the package -We will need to add our plugin to your Backstage application. To do so, you can -navigate to your new Backstage application folder and then run a single command -to install TechDocs. +The first step is to add the TechDocs plugin to your Backstage application. Navigate to your new Backstage application folder: ```bash cd hello-world/ ``` -Then you need to navigate to your `packages/app` folder to install TechDocs: +Then navigate to your `packages/app` folder to install TechDocs: ```bash cd packages/app yarn add @backstage/plugin-techdocs ``` -After a short while, it should successfully install the TechDocs plugin. Now we -just need to set up some basic configuration! +After a short while, the TechDocs plugin should be successfully installed. -Enter the following command: +Next, you need to set up some basic configuration. Enter the following command: ```bash yarn install @@ -85,7 +78,7 @@ export { plugin as TechDocs } from '@backstage/plugin-techdocs'; ### Setting the configuration TechDocs allows for configuration of the docs storage URL through your -app-config file. The URL provided here is demo docs used to testing. +`app-config` file. The URL provided here is for demo docs to use for testing purposes. To use the demo docs, add the following lines to `app-config.yaml`: @@ -94,16 +87,17 @@ techdocs: storageUrl: https://techdocs-mock-sites.storage.googleapis.com ``` -## Run Backstage Locally +## Run Backstage locally -Change folder to your Backstage application root. +Change folder to your Backstage application root and run the following command: ```bash yarn start ``` -Open browser at [http://localhost:3000/docs/](http://localhost:3000/docs/) +Open your browser at [http://localhost:3000/docs/](http://localhost:3000/docs/). -## Extra Reading +## Additional reading -[Back to Docs](README.md) + * [Creating and publishing your docs](creating-and-publishing.md) + * [Back to README](README.md) From cc905069d10566c80c2875a24d082abc9d1703ee Mon Sep 17 00:00:00 2001 From: David J Sykes Date: Thu, 30 Jul 2020 16:57:38 +0100 Subject: [PATCH 52/73] Changed optional parameter name to allow for more generic uses --- packages/core/src/layout/ErrorPage/ErrorPage.tsx | 6 +++--- plugins/techdocs/src/reader/components/TechDocsNotFound.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core/src/layout/ErrorPage/ErrorPage.tsx b/packages/core/src/layout/ErrorPage/ErrorPage.tsx index df8323ef46..71a24652ba 100644 --- a/packages/core/src/layout/ErrorPage/ErrorPage.tsx +++ b/packages/core/src/layout/ErrorPage/ErrorPage.tsx @@ -24,7 +24,7 @@ import { useNavigate } from 'react-router'; interface IErrorPageProps { status: string; statusMessage: string; - docPath?: string; + additionalInfo?: string; } const useStyles = makeStyles(theme => ({ @@ -42,7 +42,7 @@ const useStyles = makeStyles(theme => ({ export const ErrorPage = ({ status, statusMessage, - docPath, + additionalInfo, }: IErrorPageProps) => { const classes = useStyles(); const navigate = useNavigate(); @@ -55,7 +55,7 @@ export const ErrorPage = ({ ERROR {status}: {statusMessage} - {docPath} + {additionalInfo} Looks like someone dropped the mic! diff --git a/plugins/techdocs/src/reader/components/TechDocsNotFound.tsx b/plugins/techdocs/src/reader/components/TechDocsNotFound.tsx index cbb038c0ce..c774000bd5 100644 --- a/plugins/techdocs/src/reader/components/TechDocsNotFound.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsNotFound.tsx @@ -22,7 +22,7 @@ export const TechDocsNotFound = () => { ); }; From e68e174c3b56527ceb25377d34650a061e95f660 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 30 Jul 2020 18:24:35 +0200 Subject: [PATCH 53/73] plugins/graphql: fix main field in publish config --- plugins/graphql/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/graphql/package.json b/plugins/graphql/package.json index 42f3dc9046..564f69084d 100644 --- a/plugins/graphql/package.json +++ b/plugins/graphql/package.json @@ -7,7 +7,7 @@ "private": true, "publishConfig": { "access": "public", - "main": "dist/index.esm.js", + "main": "dist/index.cjs.js", "types": "dist/index.d.ts" }, "scripts": { From 377bd94338434689e978c70e8b017568a9baa6ea Mon Sep 17 00:00:00 2001 From: Pia Nilsson Date: Fri, 31 Jul 2020 09:23:10 +0200 Subject: [PATCH 54/73] broken link to create an app --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8e7574e128..d401650a66 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Our vision for Backstage is for it to become the trusted standard toolbox (read: The Backstage platform consists of a number of different components: -- **app** - Main web application that users interact with. It's built up by a number of different _Plugins_. This repo contains an example implementation of an app (located in `packages/app`) and you can easily get started with your own app by [creating one](docs/create-an-app.md). +- **app** - Main web application that users interact with. It's built up by a number of different _Plugins_. This repo contains an example implementation of an app (located in `packages/app`) and you can easily get started with your own app by [creating one](docs/getting-started/create-an-app.md). - [**plugins**](https://github.com/spotify/backstage/tree/master/plugins) - Each plugin is treated as a self-contained web app and can include almost any type of content. Plugins all use a common set of platform API's and reusable UI components. Plugins can fetch data either from the _backend_ or through any RESTful API exposed through the _proxy_. - [**service catalog**](https://github.com/spotify/backstage/tree/master/packages/backend) - Service that holds the model of your software ecosystem, including organisational information and what team owns what software. The backend also has a Plugin model for extending its graph. - [**proxy**](https://github.com/spotify/backstage/tree/master/plugins/proxy-backend) - Terminates HTTPS and exposes any RESTful API to Plugins. From 5c79a0d3140a064d2bae13ae077fa0bc61452413 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Fri, 31 Jul 2020 10:19:17 +0200 Subject: [PATCH 55/73] cli: just print warning if postpack fails --- packages/cli/src/commands/pack.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/commands/pack.ts b/packages/cli/src/commands/pack.ts index 1f81b89767..58efece6e4 100644 --- a/packages/cli/src/commands/pack.ts +++ b/packages/cli/src/commands/pack.ts @@ -39,5 +39,12 @@ export const pre = async () => { export const post = async () => { // postpack isn't called by yarn right now, so it needs to be called manually - await fs.move(PKG_BACKUP_PATH, PKG_PATH, { overwrite: true }); + try { + await fs.move(PKG_BACKUP_PATH, PKG_PATH, { overwrite: true }); + } catch (error) { + console.warn( + `Failed to restore package.json during postpack, ${error}. ` + + 'Your package will be fine but you may have ended up with some garbage in the repo.', + ); + } }; From 730d1b21bed43dd926d3bfc541fc49bdbd78fff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20DOREAU?= Date: Fri, 31 Jul 2020 10:34:00 +0200 Subject: [PATCH 56/73] fix(cli): add create-app import to e2e tests --- packages/cli/e2e-test/cli-e2e-test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/cli/e2e-test/cli-e2e-test.js b/packages/cli/e2e-test/cli-e2e-test.js index 0a03e65bdd..e9635de6bb 100644 --- a/packages/cli/e2e-test/cli-e2e-test.js +++ b/packages/cli/e2e-test/cli-e2e-test.js @@ -69,6 +69,7 @@ async function buildDistWorkspace(workspaceName, rootDir) { 'build-workspace', workspaceDir, '@backstage/cli', + '@backstage/create-app', '@backstage/core', '@backstage/dev-utils', '@backstage/test-utils', From 9131b9b5b14fdc0528a2136189e1b74baccfa1d6 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Fri, 31 Jul 2020 11:35:58 +0200 Subject: [PATCH 57/73] yarn.lock: security fix (#1797) --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 157e82721d..9e3c6393ae 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8845,9 +8845,9 @@ element-resize-detector@^1.2.1: batch-processor "1.0.0" elliptic@^6.0.0: - version "6.5.2" - resolved "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz#05c5678d7173c049d8ca433552224a495d0e3762" - integrity sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw== + version "6.5.3" + resolved "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz#cb59eb2efdaf73a0bd78ccd7015a62ad6e0f93d6" + integrity sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw== dependencies: bn.js "^4.4.0" brorand "^1.0.1" From 0bd997d9819bb85ca10e13c4566124980fd15ea0 Mon Sep 17 00:00:00 2001 From: Andrew Thauer <6507159+andrewthauer@users.noreply.github.com> Date: Thu, 30 Jul 2020 21:29:21 -0400 Subject: [PATCH 58/73] feat: fallback to string value if config value is not json --- docker/run.sh | 2 +- packages/config-loader/src/lib/env.test.ts | 51 +++++++++++++++++++--- packages/config-loader/src/lib/env.ts | 10 ++++- 3 files changed, 54 insertions(+), 9 deletions(-) diff --git a/docker/run.sh b/docker/run.sh index 9cecd88f63..fdb1742a07 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -16,7 +16,7 @@ function inject_config() { with_entries(select(.key | startswith("APP_CONFIG_")) | .key |= sub("APP_CONFIG_"; "")) | to_entries | reduce .[] as $item ( - {}; setpath($item.key | split("_"); $item.value | fromjson) + {}; setpath($item.key | split("_"); $item.value | try fromjson catch $item.value) )')" >&2 echo "Runtime app config: $config" diff --git a/packages/config-loader/src/lib/env.test.ts b/packages/config-loader/src/lib/env.test.ts index 9ecc80d29a..93bd962596 100644 --- a/packages/config-loader/src/lib/env.test.ts +++ b/packages/config-loader/src/lib/env.test.ts @@ -40,14 +40,15 @@ describe('readEnv', () => { APP_CONFIG_numbers_a: '1', APP_CONFIG_numbers_b: '2', APP_CONFIG_numbers_c: 'false', - APP_CONFIG_numbers_d: undefined, + APP_CONFIG_numbers_d: 'abc', + APP_CONFIG_numbers_e: undefined, APP_CONFIG_very_deep_nested_config_object: '{}', }), ).toEqual([ { data: { foo: 'bar', - numbers: { a: 1, b: 2, c: false }, + numbers: { a: 1, b: 2, c: false, d: 'abc' }, very: { deep: { nested: { config: { object: {} } } } }, }, context: 'env', @@ -55,6 +56,37 @@ describe('readEnv', () => { ]); }); + it('should accept string values', () => { + expect(readEnv({ APP_CONFIG_foo: '"abc"', APP_CONFIG_bar: 'xyz' })).toEqual( + [ + { + data: { + foo: 'abc', + bar: 'xyz', + }, + context: 'env', + }, + ], + ); + }); + + it('should accept complex objects', () => { + expect( + readEnv({ + APP_CONFIG_foo: '{ "a": 123, "b": "123", "c": [] }', + APP_CONFIG_bar: '[123, "abc", {}]', + }), + ).toEqual([ + { + data: { + foo: { a: 123, b: '123', c: [] }, + bar: [123, 'abc', {}], + }, + context: 'env', + }, + ]); + }); + it.each([ ['APP_CONFIG__foo'], ['APP_CONFIG_foo_'], @@ -68,12 +100,17 @@ describe('readEnv', () => { ); }); - it.each([['hello'], ['"hello'], ['{'], ['}'], ['123abc']])( - 'should reject invalid value %p', + it.each([['hello'], ['"hello'], ['{'], ['}']])( + 'should fallback to string when invalid json value %p', value => { - expect(() => readEnv({ APP_CONFIG_foo: value })).toThrow( - /^Failed to parse JSON-serialized config value for key 'foo', SyntaxError: /, - ); + expect(readEnv({ APP_CONFIG_foo: value })).toEqual([ + { + data: { + foo: value, + }, + context: 'env', + }, + ]); }, ); diff --git a/packages/config-loader/src/lib/env.ts b/packages/config-loader/src/lib/env.ts index aa986931ff..53c6d6c63b 100644 --- a/packages/config-loader/src/lib/env.ts +++ b/packages/config-loader/src/lib/env.ts @@ -72,7 +72,7 @@ export function readEnv(env: { ); } try { - const parsedValue = JSON.parse(value); + const [, parsedValue] = safeJsonParse(value); if (parsedValue === null) { throw new Error('value may not be null'); } @@ -89,3 +89,11 @@ export function readEnv(env: { return data ? [{ data, context: 'env' }] : []; } + +function safeJsonParse(str: string): [Error | null, any] { + try { + return [null, JSON.parse(str)]; + } catch (err) { + return [err, str]; + } +} From 5e78cc108265b33ed08c660048bfc2e1eda0e40f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20DOREAU?= Date: Sun, 2 Aug 2020 13:46:28 +0200 Subject: [PATCH 59/73] fix(create-app): update entrypoint --- packages/create-app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/create-app/package.json b/packages/create-app/package.json index 74017fe53d..390c9cf2cb 100644 --- a/packages/create-app/package.json +++ b/packages/create-app/package.json @@ -16,7 +16,7 @@ "backstage" ], "license": "Apache-2.0", - "main": "src/index.ts", + "main": "dist/index.cjs.js", "bin": { "backstage-create-app": "bin/backstage-create-app" }, From d273c74985cd6ba15b775bd765bcbf5f3e244c4b Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sun, 2 Aug 2020 16:28:27 +0200 Subject: [PATCH 60/73] create-app: packaging fixes --- packages/create-app/bin/backstage-create-app | 2 +- packages/create-app/package.json | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/create-app/bin/backstage-create-app b/packages/create-app/bin/backstage-create-app index c9baf5d57c..2b445ca9af 100755 --- a/packages/create-app/bin/backstage-create-app +++ b/packages/create-app/bin/backstage-create-app @@ -21,7 +21,7 @@ const path = require('path'); const isLocal = require('fs').existsSync(path.resolve(__dirname, '../src')); if (!isLocal || process.env.BACKSTAGE_E2E_CLI_TEST) { - require('../src'); + require('..'); } else { require('ts-node').register({ transpileOnly: true, diff --git a/packages/create-app/package.json b/packages/create-app/package.json index 390c9cf2cb..282a1f692f 100644 --- a/packages/create-app/package.json +++ b/packages/create-app/package.json @@ -20,6 +20,9 @@ "bin": { "backstage-create-app": "bin/backstage-create-app" }, + "scripts": { + "build": "backstage-cli build --outputs cjs" + }, "dependencies": { "commander": "^4.1.1", "chalk": "^4.0.0", @@ -36,5 +39,10 @@ "@types/recursive-readdir": "^2.2.0", "@types/ora": "^3.2.0", "ts-node": "^8.6.2" - } + }, + "files": [ + "bin", + "dist", + "templates" + ] } From 650830cf4f54db4609a0145b67b0c056633e27e0 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sun, 2 Aug 2020 19:29:21 +0200 Subject: [PATCH 61/73] plugins/graphql: fix schema packaging --- plugins/graphql/package.json | 3 ++- plugins/graphql/{src => }/schema.gql | 0 plugins/graphql/src/service/router.ts | 10 ++++++---- 3 files changed, 8 insertions(+), 5 deletions(-) rename plugins/graphql/{src => }/schema.gql (100%) diff --git a/plugins/graphql/package.json b/plugins/graphql/package.json index 564f69084d..5ed22253c3 100644 --- a/plugins/graphql/package.json +++ b/plugins/graphql/package.json @@ -40,6 +40,7 @@ "supertest": "^4.0.2" }, "files": [ - "dist" + "dist", + "schema.gql" ] } diff --git a/plugins/graphql/src/schema.gql b/plugins/graphql/schema.gql similarity index 100% rename from plugins/graphql/src/schema.gql rename to plugins/graphql/schema.gql diff --git a/plugins/graphql/src/service/router.ts b/plugins/graphql/src/service/router.ts index 09ab5270b7..69e2394f11 100644 --- a/plugins/graphql/src/service/router.ts +++ b/plugins/graphql/src/service/router.ts @@ -22,6 +22,11 @@ import fs from 'fs'; import path from 'path'; import { ApolloServer } from 'apollo-server-express'; +const schemaPath = path.resolve( + require.resolve('@backstage/plugin-graphql-backend/package.json'), + '../schema.gql', +); + export interface RouterOptions { logger: Logger; } @@ -29,10 +34,7 @@ export interface RouterOptions { export async function createRouter( options: RouterOptions, ): Promise { - const typeDefs = await fs.promises.readFile( - path.resolve(__dirname, '..', 'schema.gql'), - 'utf-8', - ); + const typeDefs = await fs.promises.readFile(schemaPath, 'utf-8'); const server = new ApolloServer({ typeDefs, logger: options.logger }); const router = Router(); From b5a6d82d5cb188b6b044516901eb5550e92c09cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20DOREAU?= Date: Sun, 2 Aug 2020 20:29:48 +0200 Subject: [PATCH 62/73] feat(create-app): add missing template backend package --- .../templates/default-app/packages/backend/.eslintrc.js | 0 .../templates/default-app/packages/backend/Dockerfile | 0 .../templates/default-app/packages/backend/README.md | 0 .../templates/default-app/packages/backend/package.json.hbs | 0 .../templates/default-app/packages/backend/src/index.test.ts | 0 .../templates/default-app/packages/backend/src/index.ts.hbs | 0 .../templates/default-app/packages/backend/src/plugins/auth.ts | 0 .../templates/default-app/packages/backend/src/plugins/catalog.ts | 0 .../default-app/packages/backend/src/plugins/identity.ts | 0 .../templates/default-app/packages/backend/src/plugins/proxy.ts | 0 .../default-app/packages/backend/src/plugins/scaffolder.ts | 0 .../default-app/packages/backend/src/plugins/techdocs.ts | 0 .../templates/default-app/packages/backend/src/types.ts | 0 13 files changed, 0 insertions(+), 0 deletions(-) rename packages/{cli => create-app}/templates/default-app/packages/backend/.eslintrc.js (100%) rename packages/{cli => create-app}/templates/default-app/packages/backend/Dockerfile (100%) rename packages/{cli => create-app}/templates/default-app/packages/backend/README.md (100%) rename packages/{cli => create-app}/templates/default-app/packages/backend/package.json.hbs (100%) rename packages/{cli => create-app}/templates/default-app/packages/backend/src/index.test.ts (100%) rename packages/{cli => create-app}/templates/default-app/packages/backend/src/index.ts.hbs (100%) rename packages/{cli => create-app}/templates/default-app/packages/backend/src/plugins/auth.ts (100%) rename packages/{cli => create-app}/templates/default-app/packages/backend/src/plugins/catalog.ts (100%) rename packages/{cli => create-app}/templates/default-app/packages/backend/src/plugins/identity.ts (100%) rename packages/{cli => create-app}/templates/default-app/packages/backend/src/plugins/proxy.ts (100%) rename packages/{cli => create-app}/templates/default-app/packages/backend/src/plugins/scaffolder.ts (100%) rename packages/{cli => create-app}/templates/default-app/packages/backend/src/plugins/techdocs.ts (100%) rename packages/{cli => create-app}/templates/default-app/packages/backend/src/types.ts (100%) diff --git a/packages/cli/templates/default-app/packages/backend/.eslintrc.js b/packages/create-app/templates/default-app/packages/backend/.eslintrc.js similarity index 100% rename from packages/cli/templates/default-app/packages/backend/.eslintrc.js rename to packages/create-app/templates/default-app/packages/backend/.eslintrc.js diff --git a/packages/cli/templates/default-app/packages/backend/Dockerfile b/packages/create-app/templates/default-app/packages/backend/Dockerfile similarity index 100% rename from packages/cli/templates/default-app/packages/backend/Dockerfile rename to packages/create-app/templates/default-app/packages/backend/Dockerfile diff --git a/packages/cli/templates/default-app/packages/backend/README.md b/packages/create-app/templates/default-app/packages/backend/README.md similarity index 100% rename from packages/cli/templates/default-app/packages/backend/README.md rename to packages/create-app/templates/default-app/packages/backend/README.md diff --git a/packages/cli/templates/default-app/packages/backend/package.json.hbs b/packages/create-app/templates/default-app/packages/backend/package.json.hbs similarity index 100% rename from packages/cli/templates/default-app/packages/backend/package.json.hbs rename to packages/create-app/templates/default-app/packages/backend/package.json.hbs diff --git a/packages/cli/templates/default-app/packages/backend/src/index.test.ts b/packages/create-app/templates/default-app/packages/backend/src/index.test.ts similarity index 100% rename from packages/cli/templates/default-app/packages/backend/src/index.test.ts rename to packages/create-app/templates/default-app/packages/backend/src/index.test.ts diff --git a/packages/cli/templates/default-app/packages/backend/src/index.ts.hbs b/packages/create-app/templates/default-app/packages/backend/src/index.ts.hbs similarity index 100% rename from packages/cli/templates/default-app/packages/backend/src/index.ts.hbs rename to packages/create-app/templates/default-app/packages/backend/src/index.ts.hbs diff --git a/packages/cli/templates/default-app/packages/backend/src/plugins/auth.ts b/packages/create-app/templates/default-app/packages/backend/src/plugins/auth.ts similarity index 100% rename from packages/cli/templates/default-app/packages/backend/src/plugins/auth.ts rename to packages/create-app/templates/default-app/packages/backend/src/plugins/auth.ts diff --git a/packages/cli/templates/default-app/packages/backend/src/plugins/catalog.ts b/packages/create-app/templates/default-app/packages/backend/src/plugins/catalog.ts similarity index 100% rename from packages/cli/templates/default-app/packages/backend/src/plugins/catalog.ts rename to packages/create-app/templates/default-app/packages/backend/src/plugins/catalog.ts diff --git a/packages/cli/templates/default-app/packages/backend/src/plugins/identity.ts b/packages/create-app/templates/default-app/packages/backend/src/plugins/identity.ts similarity index 100% rename from packages/cli/templates/default-app/packages/backend/src/plugins/identity.ts rename to packages/create-app/templates/default-app/packages/backend/src/plugins/identity.ts diff --git a/packages/cli/templates/default-app/packages/backend/src/plugins/proxy.ts b/packages/create-app/templates/default-app/packages/backend/src/plugins/proxy.ts similarity index 100% rename from packages/cli/templates/default-app/packages/backend/src/plugins/proxy.ts rename to packages/create-app/templates/default-app/packages/backend/src/plugins/proxy.ts diff --git a/packages/cli/templates/default-app/packages/backend/src/plugins/scaffolder.ts b/packages/create-app/templates/default-app/packages/backend/src/plugins/scaffolder.ts similarity index 100% rename from packages/cli/templates/default-app/packages/backend/src/plugins/scaffolder.ts rename to packages/create-app/templates/default-app/packages/backend/src/plugins/scaffolder.ts diff --git a/packages/cli/templates/default-app/packages/backend/src/plugins/techdocs.ts b/packages/create-app/templates/default-app/packages/backend/src/plugins/techdocs.ts similarity index 100% rename from packages/cli/templates/default-app/packages/backend/src/plugins/techdocs.ts rename to packages/create-app/templates/default-app/packages/backend/src/plugins/techdocs.ts diff --git a/packages/cli/templates/default-app/packages/backend/src/types.ts b/packages/create-app/templates/default-app/packages/backend/src/types.ts similarity index 100% rename from packages/cli/templates/default-app/packages/backend/src/types.ts rename to packages/create-app/templates/default-app/packages/backend/src/types.ts From 290905428348abaa08304782869a126dd2e04a44 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sun, 2 Aug 2020 23:20:39 +0200 Subject: [PATCH 63/73] create-app: add lint command --- packages/create-app/.eslintrc.js | 1 + packages/create-app/package.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/create-app/.eslintrc.js b/packages/create-app/.eslintrc.js index 503c048748..69bec6cd2a 100644 --- a/packages/create-app/.eslintrc.js +++ b/packages/create-app/.eslintrc.js @@ -1,5 +1,6 @@ module.exports = { extends: [require.resolve('@backstage/cli/config/eslint.backend')], + ignorePatterns: ['templates/**'], rules: { 'no-console': 0, }, diff --git a/packages/create-app/package.json b/packages/create-app/package.json index 282a1f692f..8b63cbba04 100644 --- a/packages/create-app/package.json +++ b/packages/create-app/package.json @@ -21,7 +21,8 @@ "backstage-create-app": "bin/backstage-create-app" }, "scripts": { - "build": "backstage-cli build --outputs cjs" + "build": "backstage-cli build --outputs cjs", + "lint": "backstage-cli lint" }, "dependencies": { "commander": "^4.1.1", From fb1ee745516d75081fb2f5aeb5d35f941719670b Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sun, 2 Aug 2020 23:57:23 +0200 Subject: [PATCH 64/73] create-app: fix deps --- packages/create-app/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/create-app/package.json b/packages/create-app/package.json index 8b63cbba04..df1951106c 100644 --- a/packages/create-app/package.json +++ b/packages/create-app/package.json @@ -28,10 +28,10 @@ "commander": "^4.1.1", "chalk": "^4.0.0", "fs-extra": "^9.0.0", - "react-dev-utils": "^10.2.1", + "handlebars": "^4.7.3", "inquirer": "^7.0.4", - "recursive-readdir": "^2.2.2", - "ora": "^4.0.3" + "ora": "^4.0.3", + "recursive-readdir": "^2.2.2" }, "devDependencies": { "@types/fs-extra": "^9.0.1", From d1c7d8672a8aac04aa426d378ef329b165b8fbfc Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sun, 2 Aug 2020 23:57:33 +0200 Subject: [PATCH 65/73] create-app: sync version --- packages/create-app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/create-app/package.json b/packages/create-app/package.json index df1951106c..79b14fc379 100644 --- a/packages/create-app/package.json +++ b/packages/create-app/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/create-app", "description": "Create app package for Backstage", - "version": "0.1.1-alpha.12", + "version": "0.1.1-alpha.16", "private": false, "publishConfig": { "access": "public" From 2c4ee49be89fd20a095835b228fa17797e04e23e Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 3 Aug 2020 00:17:21 +0200 Subject: [PATCH 66/73] workflows: run cli checks on changes to create-app --- .github/workflows/cli-win.yml | 1 + .github/workflows/cli.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/cli-win.yml b/.github/workflows/cli-win.yml index 1355ed251e..4e7a186282 100644 --- a/.github/workflows/cli-win.yml +++ b/.github/workflows/cli-win.yml @@ -7,6 +7,7 @@ on: paths: - '.github/workflows/cli-win.yml' - 'packages/cli/**' + - 'packages/create-app/**' jobs: build: diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 32fb15d329..6e4fdad214 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -5,6 +5,7 @@ on: paths: - '.github/workflows/cli.yml' - 'packages/cli/**' + - 'packages/create-app/**' - 'packages/core/**' - 'packages/core-api/**' - 'yarn.lock' From 14cfeb390e419ed07c9792b3b88cb29e242887ba Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 3 Aug 2020 08:25:35 +0000 Subject: [PATCH 67/73] chore(deps): bump react-use from 14.2.0 to 15.3.3 This is a copy of #1731 with fixes --- packages/app/package.json | 2 +- .../templates/default-plugin/package.json.hbs | 2 +- packages/core-api/package.json | 2 +- packages/core/package.json | 2 +- packages/core/src/layout/Sidebar/Intro.tsx | 20 +++++++++----- .../default-app/packages/app/package.json.hbs | 2 +- .../plugins/welcome/package.json.hbs | 2 +- plugins/catalog/package.json | 2 +- .../src/components/EntityPage/EntityPage.tsx | 2 +- plugins/circleci/package.json | 2 +- plugins/explore/package.json | 2 +- plugins/github-actions/package.json | 2 +- .../WorkflowRunDetails/useWorkflowRunJobs.ts | 10 +++++-- .../src/components/useProjectName.ts | 2 +- plugins/gitops-profiles/package.json | 2 +- .../components/ClusterList/ClusterList.tsx | 26 +++++++++---------- .../ProfileCatalog/ProfileCatalog.tsx | 4 +-- plugins/graphiql/package.json | 2 +- plugins/lighthouse/package.json | 2 +- .../src/components/AuditList/index.tsx | 4 +-- .../src/components/AuditView/index.tsx | 2 +- plugins/register-component/package.json | 2 +- plugins/rollbar/package.json | 2 +- plugins/scaffolder/package.json | 2 +- plugins/sentry/package.json | 2 +- plugins/tech-radar/package.json | 2 +- plugins/techdocs/package.json | 2 +- plugins/welcome/package.json | 2 +- yarn.lock | 26 ++++++++++++------- 29 files changed, 77 insertions(+), 59 deletions(-) diff --git a/packages/app/package.json b/packages/app/package.json index 168506d498..006067f28a 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -31,7 +31,7 @@ "react-hot-loader": "^4.12.21", "react-router": "6.0.0-beta.0", "react-router-dom": "6.0.0-beta.0", - "react-use": "^14.2.0", + "react-use": "^15.3.3", "zen-observable": "^0.8.15" }, "devDependencies": { diff --git a/packages/cli/templates/default-plugin/package.json.hbs b/packages/cli/templates/default-plugin/package.json.hbs index d5d25b974a..4e85bf39bd 100644 --- a/packages/cli/templates/default-plugin/package.json.hbs +++ b/packages/cli/templates/default-plugin/package.json.hbs @@ -28,7 +28,7 @@ "@material-ui/lab": "4.0.0-alpha.45", "react": "^16.13.1", "react-dom": "^16.13.1", - "react-use": "^14.2.0" + "react-use": "^15.3.3" }, "devDependencies": { "@backstage/cli": "^{{version}}", diff --git a/packages/core-api/package.json b/packages/core-api/package.json index 5aca780e30..7e14eaec37 100644 --- a/packages/core-api/package.json +++ b/packages/core-api/package.json @@ -37,7 +37,7 @@ "prop-types": "^15.7.2", "react": "^16.12.0", "react-router-dom": "6.0.0-beta.0", - "react-use": "^14.2.0", + "react-use": "^15.3.3", "zen-observable": "^0.8.15" }, "devDependencies": { diff --git a/packages/core/package.json b/packages/core/package.json index 3faaa33ddf..8815c1379b 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -51,7 +51,7 @@ "react-router-dom": "6.0.0-beta.0", "react-sparklines": "^1.7.0", "react-syntax-highlighter": "^12.2.1", - "react-use": "^14.2.0" + "react-use": "^15.3.3" }, "devDependencies": { "@backstage/cli": "^0.1.1-alpha.16", diff --git a/packages/core/src/layout/Sidebar/Intro.tsx b/packages/core/src/layout/Sidebar/Intro.tsx index b4bb56588e..912b343244 100644 --- a/packages/core/src/layout/Sidebar/Intro.tsx +++ b/packages/core/src/layout/Sidebar/Intro.tsx @@ -129,19 +129,27 @@ const recentlyViewedIntroText = export const SidebarIntro: FC = () => { const { isOpen } = useContext(SidebarContext); - const [ - { starredItemsDismissed, recentlyViewedItemsDismissed }, - setDismissedIntro, - ] = useLocalStorage(SIDEBAR_INTRO_LOCAL_STORAGE, { + const defaultValue = { starredItemsDismissed: false, recentlyViewedItemsDismissed: false, - }); + }; + const [dismissedIntro, setDismissedIntro] = useLocalStorage< + SidebarIntroLocalStorage + >(SIDEBAR_INTRO_LOCAL_STORAGE); + + const { starredItemsDismissed, recentlyViewedItemsDismissed } = + dismissedIntro ?? {}; const dismissStarred = () => { - setDismissedIntro(state => ({ ...state, starredItemsDismissed: true })); + setDismissedIntro(state => ({ + ...defaultValue, + ...state, + starredItemsDismissed: true, + })); }; const dismissRecentlyViewed = () => { setDismissedIntro(state => ({ + ...defaultValue, ...state, recentlyViewedItemsDismissed: true, })); diff --git a/packages/create-app/templates/default-app/packages/app/package.json.hbs b/packages/create-app/templates/default-app/packages/app/package.json.hbs index f29453b6dc..c3de7ada80 100644 --- a/packages/create-app/templates/default-app/packages/app/package.json.hbs +++ b/packages/create-app/templates/default-app/packages/app/package.json.hbs @@ -16,7 +16,7 @@ "react-dom": "^16.13.1", "react-router": "6.0.0-beta.0", "react-router-dom": "6.0.0-beta.0", - "react-use": "^14.2.0" + "react-use": "^15.3.3" }, "devDependencies": { "@testing-library/jest-dom": "^5.10.1", diff --git a/packages/create-app/templates/default-app/plugins/welcome/package.json.hbs b/packages/create-app/templates/default-app/plugins/welcome/package.json.hbs index 52e7a04f72..77e57c1a7c 100644 --- a/packages/create-app/templates/default-app/plugins/welcome/package.json.hbs +++ b/packages/create-app/templates/default-app/plugins/welcome/package.json.hbs @@ -25,7 +25,7 @@ "@material-ui/icons": "^4.9.1", "react": "^16.13.1", "react-dom": "^16.13.1", - "react-use": "^14.2.0", + "react-use": "^15.3.3", "react-router-dom": "6.0.0-beta.0" }, "devDependencies": { diff --git a/plugins/catalog/package.json b/plugins/catalog/package.json index 4ab0decfbe..d18aa339ca 100644 --- a/plugins/catalog/package.json +++ b/plugins/catalog/package.json @@ -35,7 +35,7 @@ "react-dom": "^16.13.1", "react-router": "6.0.0-beta.0", "react-router-dom": "6.0.0-beta.0", - "react-use": "^14.2.0", + "react-use": "^15.3.3", "swr": "^0.2.2" }, "devDependencies": { diff --git a/plugins/catalog/src/components/EntityPage/EntityPage.tsx b/plugins/catalog/src/components/EntityPage/EntityPage.tsx index ce128777bd..c11844f722 100644 --- a/plugins/catalog/src/components/EntityPage/EntityPage.tsx +++ b/plugins/catalog/src/components/EntityPage/EntityPage.tsx @@ -87,7 +87,7 @@ export const EntityPage: FC<{}> = () => { const catalogApi = useApi(catalogApiRef); const [confirmationDialogOpen, setConfirmationDialogOpen] = useState(false); - const { value: entity, error, loading } = useAsync( + const { value: entity, error, loading } = useAsync( () => catalogApi.getEntityByName({ kind, namespace, name }), [catalogApi, kind, namespace, name], ); diff --git a/plugins/circleci/package.json b/plugins/circleci/package.json index 3cf357bbce..4902810f4b 100644 --- a/plugins/circleci/package.json +++ b/plugins/circleci/package.json @@ -33,7 +33,7 @@ "react-lazylog": "^4.5.2", "react-router": "6.0.0-beta.0", "react-router-dom": "6.0.0-beta.0", - "react-use": "^14.2.0" + "react-use": "^15.3.3" }, "devDependencies": { "@backstage/cli": "^0.1.1-alpha.16", diff --git a/plugins/explore/package.json b/plugins/explore/package.json index 6840cf5e52..3036425b1b 100644 --- a/plugins/explore/package.json +++ b/plugins/explore/package.json @@ -29,7 +29,7 @@ "classnames": "^2.2.6", "react": "^16.13.1", "react-dom": "^16.13.1", - "react-use": "^14.2.0" + "react-use": "^15.3.3" }, "devDependencies": { "@backstage/cli": "^0.1.1-alpha.16", diff --git a/plugins/github-actions/package.json b/plugins/github-actions/package.json index 55f1aab4de..0466af977a 100644 --- a/plugins/github-actions/package.json +++ b/plugins/github-actions/package.json @@ -36,7 +36,7 @@ "react": "^16.13.1", "react-dom": "^16.13.1", "react-router-dom": "6.0.0-beta.0", - "react-use": "^14.2.0" + "react-use": "^15.3.3" }, "devDependencies": { "@backstage/cli": "^0.1.1-alpha.16", diff --git a/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunJobs.ts b/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunJobs.ts index d4c09abf7d..f471ce1875 100644 --- a/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunJobs.ts +++ b/plugins/github-actions/src/components/WorkflowRunDetails/useWorkflowRunJobs.ts @@ -17,8 +17,14 @@ import { useAsync } from 'react-use'; import { Jobs } from '../../api/types'; export const useWorkflowRunJobs = (jobsUrl?: string) => { - const jobs = useAsync(async () => { - if (jobsUrl === undefined) return []; + const jobs = useAsync(async (): Promise => { + if (jobsUrl === undefined) { + return { + total_count: 0, + jobs: [], + }; + } + const data = await fetch(jobsUrl).then(d => d.json()); return data; }, [jobsUrl]); diff --git a/plugins/github-actions/src/components/useProjectName.ts b/plugins/github-actions/src/components/useProjectName.ts index 165baeead2..4f2651faf2 100644 --- a/plugins/github-actions/src/components/useProjectName.ts +++ b/plugins/github-actions/src/components/useProjectName.ts @@ -21,7 +21,7 @@ import { useApi } from '@backstage/core'; export const useProjectName = (name: EntityCompoundName) => { const catalogApi = useApi(catalogApiRef); - const { value, loading, error } = useAsync(async () => { + const { value, loading, error } = useAsync(async () => { const entity = await catalogApi.getEntityByName(name); return entity?.metadata.annotations?.['github.com/project-slug'] ?? ''; }); diff --git a/plugins/gitops-profiles/package.json b/plugins/gitops-profiles/package.json index 8157cfe519..0b838af358 100644 --- a/plugins/gitops-profiles/package.json +++ b/plugins/gitops-profiles/package.json @@ -29,7 +29,7 @@ "react": "^16.13.1", "react-dom": "^16.13.1", "react-router-dom": "6.0.0-beta.0", - "react-use": "^14.2.0" + "react-use": "^15.3.3" }, "devDependencies": { "@backstage/cli": "^0.1.1-alpha.16", diff --git a/plugins/gitops-profiles/src/components/ClusterList/ClusterList.tsx b/plugins/gitops-profiles/src/components/ClusterList/ClusterList.tsx index 44578560e6..baab018415 100644 --- a/plugins/gitops-profiles/src/components/ClusterList/ClusterList.tsx +++ b/plugins/gitops-profiles/src/components/ClusterList/ClusterList.tsx @@ -31,7 +31,7 @@ import { import ClusterTable from '../ClusterTable/ClusterTable'; import { Button } from '@material-ui/core'; import { useAsync } from 'react-use'; -import { gitOpsApiRef, ListClusterStatusesResponse } from '../../api'; +import { gitOpsApiRef } from '../../api'; import { Alert } from '@material-ui/lab'; const ClusterList: FC<{}> = () => { @@ -39,19 +39,17 @@ const ClusterList: FC<{}> = () => { const githubAuth = useApi(githubAuthApiRef); const [githubUsername, setGithubUsername] = useState(String); - const { loading, error, value } = useAsync( - async () => { - const accessToken = await githubAuth.getAccessToken(['repo', 'user']); - if (!githubUsername) { - const userInfo = await api.fetchUserInfo({ accessToken }); - setGithubUsername(userInfo.login); - } - return api.listClusters({ - gitHubToken: accessToken, - gitHubUser: githubUsername, - }); - }, - ); + const { loading, error, value } = useAsync(async () => { + const accessToken = await githubAuth.getAccessToken(['repo', 'user']); + if (!githubUsername) { + const userInfo = await api.fetchUserInfo({ accessToken }); + setGithubUsername(userInfo.login); + } + return api.listClusters({ + gitHubToken: accessToken, + gitHubUser: githubUsername, + }); + }); let content: JSX.Element; if (loading) { content = ( diff --git a/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.tsx b/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.tsx index 3193bbea06..a5125fb006 100644 --- a/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.tsx +++ b/plugins/gitops-profiles/src/components/ProfileCatalog/ProfileCatalog.tsx @@ -201,7 +201,7 @@ const ProfileCatalog: FC<{}> = () => { setRunStatus([]); const cloneResponse = await api.cloneClusterFromTemplate({ - templateRepository: templateRepo, + templateRepository: templateRepo!, gitHubToken: githubAccessToken, gitHubUser: githubUsername, targetOrg: gitHubOrg, @@ -224,7 +224,7 @@ const ProfileCatalog: FC<{}> = () => { gitHubUser: githubUsername, targetOrg: gitHubOrg, targetRepo: gitHubRepo, - profiles: gitopsProfiles, + profiles: gitopsProfiles!, }); if (applyProfileResp.error === undefined) { diff --git a/plugins/graphiql/package.json b/plugins/graphiql/package.json index 193fe3d133..d4b6bfc7c4 100644 --- a/plugins/graphiql/package.json +++ b/plugins/graphiql/package.json @@ -40,7 +40,7 @@ "graphql": "15.1.0", "react": "^16.13.1", "react-dom": "^16.13.1", - "react-use": "^14.2.0" + "react-use": "^15.3.3" }, "devDependencies": { "@backstage/cli": "^0.1.1-alpha.16", diff --git a/plugins/lighthouse/package.json b/plugins/lighthouse/package.json index eea841c174..5c8e06834c 100644 --- a/plugins/lighthouse/package.json +++ b/plugins/lighthouse/package.json @@ -30,7 +30,7 @@ "react-dom": "^16.13.1", "react-markdown": "^4.3.1", "react-router-dom": "6.0.0-beta.0", - "react-use": "^14.2.0" + "react-use": "^15.3.3" }, "devDependencies": { "@backstage/cli": "^0.1.1-alpha.16", diff --git a/plugins/lighthouse/src/components/AuditList/index.tsx b/plugins/lighthouse/src/components/AuditList/index.tsx index 09ea882134..c83ce9f641 100644 --- a/plugins/lighthouse/src/components/AuditList/index.tsx +++ b/plugins/lighthouse/src/components/AuditList/index.tsx @@ -32,7 +32,7 @@ import { useApi, } from '@backstage/core'; -import { lighthouseApiRef, WebsiteListResponse } from '../../api'; +import { lighthouseApiRef } from '../../api'; import { useQuery } from '../../utils'; import LighthouseSupportButton from '../SupportButton'; import LighthouseIntro, { LIGHTHOUSE_INTRO_LOCAL_STORAGE } from '../Intro'; @@ -50,7 +50,7 @@ const AuditList: FC<{}> = () => { : 1; const lighthouseApi = useApi(lighthouseApiRef); - const { value, loading, error } = useAsync( + const { value, loading, error } = useAsync( async () => await lighthouseApi.getWebsiteList({ limit: LIMIT, diff --git a/plugins/lighthouse/src/components/AuditView/index.tsx b/plugins/lighthouse/src/components/AuditView/index.tsx index d323b1a005..12606482bf 100644 --- a/plugins/lighthouse/src/components/AuditView/index.tsx +++ b/plugins/lighthouse/src/components/AuditView/index.tsx @@ -117,7 +117,7 @@ const ConnectedAuditView: FC<{}> = () => { const params = useParams() as { id: string }; const classes = useStyles(); - const { loading, error, value: nextValue } = useAsync( + const { loading, error, value: nextValue } = useAsync( async () => await lighthouseApi.getWebsiteForAuditId(params.id), [params.id], ); diff --git a/plugins/register-component/package.json b/plugins/register-component/package.json index e1a095f1e4..b1bf461764 100644 --- a/plugins/register-component/package.json +++ b/plugins/register-component/package.json @@ -33,7 +33,7 @@ "react-hook-form": "^5.7.2", "react-router": "6.0.0-beta.0", "react-router-dom": "6.0.0-beta.0", - "react-use": "^14.2.0" + "react-use": "^15.3.3" }, "devDependencies": { "@backstage/cli": "^0.1.1-alpha.16", diff --git a/plugins/rollbar/package.json b/plugins/rollbar/package.json index d2308b869e..3a1b0a94c5 100644 --- a/plugins/rollbar/package.json +++ b/plugins/rollbar/package.json @@ -32,7 +32,7 @@ "react-router": "6.0.0-beta.0", "react-router-dom": "6.0.0-beta.0", "react-sparklines": "^1.7.0", - "react-use": "^14.2.0" + "react-use": "^15.3.3" }, "devDependencies": { "@backstage/cli": "^0.1.1-alpha.16", diff --git a/plugins/scaffolder/package.json b/plugins/scaffolder/package.json index e28387c30e..3be38f6ea1 100644 --- a/plugins/scaffolder/package.json +++ b/plugins/scaffolder/package.json @@ -37,7 +37,7 @@ "react-lazylog": "^4.5.2", "react-router": "6.0.0-beta.0", "react-router-dom": "6.0.0-beta.0", - "react-use": "^14.2.0", + "react-use": "^15.3.3", "swr": "^0.2.2" }, "devDependencies": { diff --git a/plugins/sentry/package.json b/plugins/sentry/package.json index 3a5cbd5094..5c40d2ff24 100644 --- a/plugins/sentry/package.json +++ b/plugins/sentry/package.json @@ -30,7 +30,7 @@ "react": "^16.13.1", "react-dom": "^16.13.1", "react-sparklines": "^1.7.0", - "react-use": "^14.2.0", + "react-use": "^15.3.3", "timeago.js": "^4.0.2" }, "devDependencies": { diff --git a/plugins/tech-radar/package.json b/plugins/tech-radar/package.json index 0018a6faeb..3f4e63df69 100644 --- a/plugins/tech-radar/package.json +++ b/plugins/tech-radar/package.json @@ -32,7 +32,7 @@ "prop-types": "^15.7.2", "react": "^16.13.1", "react-dom": "^16.13.1", - "react-use": "^14.2.0" + "react-use": "^15.3.3" }, "devDependencies": { "@backstage/cli": "^0.1.1-alpha.16", diff --git a/plugins/techdocs/package.json b/plugins/techdocs/package.json index 210d297c7d..cdfbf394f9 100644 --- a/plugins/techdocs/package.json +++ b/plugins/techdocs/package.json @@ -32,7 +32,7 @@ "react-dom": "^16.13.1", "react-router": "6.0.0-beta.0", "react-router-dom": "6.0.0-beta.0", - "react-use": "^14.2.0", + "react-use": "^15.3.3", "sanitize-html": "^1.27.0" }, "devDependencies": { diff --git a/plugins/welcome/package.json b/plugins/welcome/package.json index 66fec93779..545954bc75 100644 --- a/plugins/welcome/package.json +++ b/plugins/welcome/package.json @@ -29,7 +29,7 @@ "react": "^16.13.1", "react-dom": "^16.13.1", "react-router-dom": "6.0.0-beta.0", - "react-use": "^14.2.0" + "react-use": "^15.3.3" }, "devDependencies": { "@backstage/cli": "^0.1.1-alpha.16", diff --git a/yarn.lock b/yarn.lock index dd3c0ce6d7..99db406126 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9666,10 +9666,10 @@ fast-deep-equal@2.0.1, fast-deep-equal@^2.0.1: resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= -fast-deep-equal@^3.0.0, fast-deep-equal@^3.1.1: - version "3.1.1" - resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4" - integrity sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA== +fast-deep-equal@^3.0.0, fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: + version "3.1.3" + resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== fast-glob@^2.0.2, fast-glob@^2.2.6: version "2.2.7" @@ -17167,24 +17167,30 @@ react-transition-group@^4.0.0, react-transition-group@^4.3.0: loose-envify "^1.4.0" prop-types "^15.6.2" -react-use@^14.2.0: - version "14.2.0" - resolved "https://registry.npmjs.org/react-use/-/react-use-14.2.0.tgz#abac033fae5e358599b7e38084ff11b02e5d4868" - integrity sha512-vwC7jsBsiDENLrXGPqIH3W4mMS2j24h5jp4ol3jiiUQzZhCaG+ihumrShJxBI59hXso1pLHAePRQAg/fJjDcaQ== +react-universal-interface@^0.6.2: + version "0.6.2" + resolved "https://registry.npmjs.org/react-universal-interface/-/react-universal-interface-0.6.2.tgz#5e8d438a01729a4dbbcbeeceb0b86be146fe2b3b" + integrity sha512-dg8yXdcQmvgR13RIlZbTRQOoUrDciFVoSBZILwjE2LFISxZZ8loVJKAkuzswl5js8BHda79bIb2b84ehU8IjXw== + +react-use@^15.3.3: + version "15.3.3" + resolved "https://registry.npmjs.org/react-use/-/react-use-15.3.3.tgz#f16de7a16286c446388e8bd99680952fc3dc9a95" + integrity sha512-nYb94JbmDCaLZg3sOXmFW8HN+lXWxnl0caspXoYfZG1CON8JfLN9jMOyxRDUpm7dUq7WZ5mIept/ByqBQKJ0wQ== dependencies: "@types/js-cookie" "2.2.6" "@xobotyi/scrollbar-width" "1.9.5" copy-to-clipboard "^3.2.0" - fast-deep-equal "^3.1.1" + fast-deep-equal "^3.1.3" fast-shallow-equal "^1.0.0" js-cookie "^2.2.1" nano-css "^5.2.1" + react-universal-interface "^0.6.2" resize-observer-polyfill "^1.5.1" screenfull "^5.0.0" set-harmonic-interval "^1.0.1" throttle-debounce "^2.1.0" ts-easing "^0.2.0" - tslib "^1.10.0" + tslib "^2.0.0" react-virtualized@^9.21.0: version "9.21.2" From 0d2ab85858f373ee0dce0dd2a9af0a9062483c39 Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 4 Aug 2020 09:49:42 +0200 Subject: [PATCH 68/73] chore(scaffolder): updating the wording for the sample templates --- .../sample-templates/create-react-app/template.yaml | 2 +- .../sample-templates/react-ssr-template/template.yaml | 2 +- .../sample-templates/springboot-grpc-template/template.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/scaffolder-backend/sample-templates/create-react-app/template.yaml b/plugins/scaffolder-backend/sample-templates/create-react-app/template.yaml index 4d730fb702..958882e9fd 100644 --- a/plugins/scaffolder-backend/sample-templates/create-react-app/template.yaml +++ b/plugins/scaffolder-backend/sample-templates/create-react-app/template.yaml @@ -3,7 +3,7 @@ kind: Template metadata: name: create-react-app-template title: Create React App Template - description: A template that scaffolds an applications using the Create React App (CRA) templater. + description: Create a new CRA website project tags: - Experimental - React diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/template.yaml b/plugins/scaffolder-backend/sample-templates/react-ssr-template/template.yaml index ba0e877662..5594a3a919 100644 --- a/plugins/scaffolder-backend/sample-templates/react-ssr-template/template.yaml +++ b/plugins/scaffolder-backend/sample-templates/react-ssr-template/template.yaml @@ -3,7 +3,7 @@ kind: Template metadata: name: react-ssr-template title: React SSR Template - description: Next.js application skeleton for creating isomorphic web applications. + description: Create a website powered with Next.js tags: - Recommended - React diff --git a/plugins/scaffolder-backend/sample-templates/springboot-grpc-template/template.yaml b/plugins/scaffolder-backend/sample-templates/springboot-grpc-template/template.yaml index b1bc273d88..520d0a62ac 100644 --- a/plugins/scaffolder-backend/sample-templates/springboot-grpc-template/template.yaml +++ b/plugins/scaffolder-backend/sample-templates/springboot-grpc-template/template.yaml @@ -3,7 +3,7 @@ kind: Template metadata: name: springboot-template title: Spring Boot GRPC Service - description: Standard Spring Boot (Java) microservice with recommended configuration for GRPC + description: Create a simple microservice using gRPC and Spring Boot Java tags: - Recommended - Java From 97f3f588441c43cf735f38882478b5c692cc27e5 Mon Sep 17 00:00:00 2001 From: Sebastian Qvarfordt Date: Tue, 4 Aug 2020 13:04:48 +0200 Subject: [PATCH 69/73] Mob/techdocs end to end (#1736) * Initial techdocs end to end heavily inspired by scaffolder * added some tests and fixed linting * fix(techdocs-backend): fix eslint * fix(techdocs-backend): cleanup commented test * Removed unused dependency * fix(techdocs-backend): updated standalone server * moved type dependency to devDependencies * fix: updated dependencies and devDependencies. * Update plugins/techdocs-backend/src/techdocs/stages/generate/types.ts Co-authored-by: Emma Indal Co-authored-by: Emma Indal Co-authored-by: ellinors Co-authored-by: Emma Indal --- app-config.yaml | 2 +- packages/backend/src/plugins/techdocs.ts | 34 +++++++- plugins/techdocs-backend/.gitignore | 2 + plugins/techdocs-backend/package.json | 7 ++ plugins/techdocs-backend/src/index.ts | 1 + .../src/service/router.test.ts | 8 ++ .../techdocs-backend/src/service/router.ts | 62 +++++++++++++- .../src/service/standaloneServer.ts | 29 ++++++- .../techdocs-backend/src/techdocs/index.ts | 16 ++++ .../techdocs/stages/generate/generators.ts | 46 +++++++++++ .../src/techdocs/stages/generate/helpers.ts | 80 +++++++++++++++++++ .../src/techdocs/stages/generate/index.ts | 18 +++++ .../src/techdocs/stages/generate/techdocs.ts | 48 +++++++++++ .../src/techdocs/stages/generate/types.ts | 55 +++++++++++++ .../src/techdocs/stages/index.ts | 19 +++++ .../src/techdocs/stages/prepare/dir.test.ts | 59 ++++++++++++++ .../src/techdocs/stages/prepare/dir.ts | 38 +++++++++ .../src/techdocs/stages/prepare/helpers.ts | 54 +++++++++++++ .../src/techdocs/stages/prepare/index.ts | 18 +++++ .../src/techdocs/stages/prepare/preparers.ts | 38 +++++++++ .../src/techdocs/stages/prepare/types.ts | 33 ++++++++ .../src/techdocs/stages/publish/index.ts | 17 ++++ .../src/techdocs/stages/publish/local.test.ts | 57 +++++++++++++ .../src/techdocs/stages/publish/local.ts | 54 +++++++++++++ .../src/techdocs/stages/publish/types.ts | 32 ++++++++ yarn.lock | 15 ++++ 26 files changed, 835 insertions(+), 7 deletions(-) create mode 100644 plugins/techdocs-backend/.gitignore create mode 100644 plugins/techdocs-backend/src/techdocs/index.ts create mode 100644 plugins/techdocs-backend/src/techdocs/stages/generate/generators.ts create mode 100644 plugins/techdocs-backend/src/techdocs/stages/generate/helpers.ts create mode 100644 plugins/techdocs-backend/src/techdocs/stages/generate/index.ts create mode 100644 plugins/techdocs-backend/src/techdocs/stages/generate/techdocs.ts create mode 100644 plugins/techdocs-backend/src/techdocs/stages/generate/types.ts create mode 100644 plugins/techdocs-backend/src/techdocs/stages/index.ts create mode 100644 plugins/techdocs-backend/src/techdocs/stages/prepare/dir.test.ts create mode 100644 plugins/techdocs-backend/src/techdocs/stages/prepare/dir.ts create mode 100644 plugins/techdocs-backend/src/techdocs/stages/prepare/helpers.ts create mode 100644 plugins/techdocs-backend/src/techdocs/stages/prepare/index.ts create mode 100644 plugins/techdocs-backend/src/techdocs/stages/prepare/preparers.ts create mode 100644 plugins/techdocs-backend/src/techdocs/stages/prepare/types.ts create mode 100644 plugins/techdocs-backend/src/techdocs/stages/publish/index.ts create mode 100644 plugins/techdocs-backend/src/techdocs/stages/publish/local.test.ts create mode 100644 plugins/techdocs-backend/src/techdocs/stages/publish/local.ts create mode 100644 plugins/techdocs-backend/src/techdocs/stages/publish/types.ts diff --git a/app-config.yaml b/app-config.yaml index 5f75ff522e..f578fb3fca 100644 --- a/app-config.yaml +++ b/app-config.yaml @@ -21,7 +21,7 @@ organization: name: Spotify techdocs: - storageUrl: https://techdocs-mock-sites.storage.googleapis.com + storageUrl: http://localhost:7000/techdocs/static/docs sentry: organization: spotify diff --git a/packages/backend/src/plugins/techdocs.ts b/packages/backend/src/plugins/techdocs.ts index 0d03bfabab..812a56cd9f 100644 --- a/packages/backend/src/plugins/techdocs.ts +++ b/packages/backend/src/plugins/techdocs.ts @@ -14,9 +14,37 @@ * limitations under the License. */ -import { createRouter } from '@backstage/plugin-techdocs-backend'; +import { + createRouter, + DirectoryPreparer, + Preparers, + Generators, + LocalPublish, + TechdocsGenerator +} from '@backstage/plugin-techdocs-backend'; import { PluginEnvironment } from '../types'; +import Docker from 'dockerode'; -export default async function createPlugin({ logger }: PluginEnvironment) { - return await createRouter({ logger }); +export default async function createPlugin({ logger, config }: PluginEnvironment) { + const generators = new Generators(); + const techdocsGenerator = new TechdocsGenerator(); + generators.register('techdocs', techdocsGenerator); + + const directoryPreparer = new DirectoryPreparer(); + const preparers = new Preparers(); + + preparers.register('dir', directoryPreparer); + + const publisher = new LocalPublish(); + + const dockerClient = new Docker(); + + return await createRouter({ + preparers, + generators, + publisher, + dockerClient, + logger, + config, + }); } diff --git a/plugins/techdocs-backend/.gitignore b/plugins/techdocs-backend/.gitignore new file mode 100644 index 0000000000..650853097a --- /dev/null +++ b/plugins/techdocs-backend/.gitignore @@ -0,0 +1,2 @@ +static +!src/techdocs/stages/build \ No newline at end of file diff --git a/plugins/techdocs-backend/package.json b/plugins/techdocs-backend/package.json index edc8908cfc..e5c97f9d0d 100644 --- a/plugins/techdocs-backend/package.json +++ b/plugins/techdocs-backend/package.json @@ -22,14 +22,21 @@ }, "dependencies": { "@backstage/backend-common": "^0.1.1-alpha.16", + "@backstage/catalog-model": "^0.1.1-alpha.16", + "@backstage/config": "^0.1.1-alpha.16", + "@types/dockerode": "^2.5.34", "@types/express": "^4.17.6", + "dockerode": "^3.2.1", "express": "^4.17.1", "express-promise-router": "^3.0.3", + "fs-extra": "^9.0.1", "knex": "^0.21.1", + "node-fetch": "^2.6.0", "winston": "^3.2.1" }, "devDependencies": { "@backstage/cli": "^0.1.1-alpha.16", + "@types/node-fetch": "^2.5.7", "supertest": "^4.0.2" }, "files": [ diff --git a/plugins/techdocs-backend/src/index.ts b/plugins/techdocs-backend/src/index.ts index 7612c392a2..8c65708017 100644 --- a/plugins/techdocs-backend/src/index.ts +++ b/plugins/techdocs-backend/src/index.ts @@ -15,3 +15,4 @@ */ export * from './service/router'; +export * from './techdocs'; diff --git a/plugins/techdocs-backend/src/service/router.test.ts b/plugins/techdocs-backend/src/service/router.test.ts index f4dbb706fd..b28010e059 100644 --- a/plugins/techdocs-backend/src/service/router.test.ts +++ b/plugins/techdocs-backend/src/service/router.test.ts @@ -15,6 +15,9 @@ */ import { getVoidLogger } from '@backstage/backend-common'; +import { Preparers, LocalPublish, Generators } from '../techdocs'; +import { ConfigReader } from '@backstage/config'; +import Docker from 'dockerode'; import express from 'express'; import request from 'supertest'; import { createRouter } from './router'; @@ -24,7 +27,12 @@ describe('createRouter', () => { beforeAll(async () => { const router = await createRouter({ + preparers: new Preparers(), + generators: new Generators(), + publisher: new LocalPublish(), logger: getVoidLogger(), + dockerClient: new Docker(), + config: ConfigReader.fromConfigs([]), }); app = express().use(router); }); diff --git a/plugins/techdocs-backend/src/service/router.ts b/plugins/techdocs-backend/src/service/router.ts index 7c91dd4ef7..874ab7c89c 100644 --- a/plugins/techdocs-backend/src/service/router.ts +++ b/plugins/techdocs-backend/src/service/router.ts @@ -17,18 +17,76 @@ import { Logger } from 'winston'; import Router from 'express-promise-router'; import express from 'express'; import Knex from 'knex'; +import fetch from 'node-fetch'; +import { Config } from '@backstage/config'; +import path from 'path'; +import Docker from 'dockerode'; +import { + GeneratorBuilder, + PreparerBuilder, + PublisherBase, + LocalPublish, +} from '../techdocs'; +import { Entity } from '@backstage/catalog-model'; type RouterOptions = { + preparers: PreparerBuilder; + generators: GeneratorBuilder; + publisher: PublisherBase; logger: Logger; database?: Knex; // TODO: Make database required when we're implementing database stuff. + config: Config; + dockerClient: Docker; }; -export async function createRouter({}: RouterOptions): Promise { +export async function createRouter({ + preparers, + generators, + publisher, + config, + dockerClient, +}: RouterOptions): Promise { const router = Router(); - router.get('/', (_, res) => { + router.get('/', async (_, res) => { res.status(200).send('Hello TechDocs Backend'); }); + // TODO: This route should not exist in the future + router.get('/buildall', async (_, res) => { + const baseUrl = config.getString('backend.baseUrl'); + const entitiesResponse = (await ( + await fetch(`${baseUrl}/catalog/entities`) + ).json()) as Entity[]; + + const entitiesWithDocs = entitiesResponse.filter( + entity => entity.metadata.annotations?.['backstage.io/techdocs-ref'], + ); + + entitiesWithDocs.forEach(async entity => { + const preparer = preparers.get(entity); + const generator = generators.get(entity); + + const { resultDir } = await generator.run({ + directory: await preparer.prepare(entity), + dockerClient, + }); + + publisher.publish({ + entity, + directory: resultDir, + }); + }); + + res.send('Successfully generated documentation'); + }); + + if (publisher instanceof LocalPublish) { + router.use( + '/static/docs/', + express.static(path.resolve(__dirname, `../../static/docs`)), + ); + } + return router; } diff --git a/plugins/techdocs-backend/src/service/standaloneServer.ts b/plugins/techdocs-backend/src/service/standaloneServer.ts index 09acfc9e27..76de973875 100644 --- a/plugins/techdocs-backend/src/service/standaloneServer.ts +++ b/plugins/techdocs-backend/src/service/standaloneServer.ts @@ -18,6 +18,15 @@ import { createServiceBuilder } from '@backstage/backend-common'; import { Server } from 'http'; import { Logger } from 'winston'; import { createRouter } from './router'; +import Docker from 'dockerode'; +import { + Preparers, + DirectoryPreparer, + Generators, + TechdocsGenerator, + LocalPublish, +} from '../techdocs'; +import { ConfigReader } from '@backstage/config'; export interface ServerOptions { port: number; @@ -31,9 +40,27 @@ export async function startStandaloneServer( const logger = options.logger.child({ service: 'techdocs-backend' }); logger.debug('Creating application...'); + const preparers = new Preparers(); + const directoryPreparer = new DirectoryPreparer(); + preparers.register('dir', directoryPreparer); + + const generators = new Generators(); + const techdocsGenerator = new TechdocsGenerator(); + generators.register('techdocs', techdocsGenerator); + + const publisher = new LocalPublish(); + + const dockerClient = new Docker(); logger.debug('Starting application server...'); - const router = await createRouter({ logger }); + const router = await createRouter({ + preparers, + generators, + logger, + publisher, + dockerClient, + config: ConfigReader.fromConfigs([]), + }); const service = createServiceBuilder(module) .enableCors({ origin: 'http://localhost:3000' }) .addRouter('/techdocs', router); diff --git a/plugins/techdocs-backend/src/techdocs/index.ts b/plugins/techdocs-backend/src/techdocs/index.ts new file mode 100644 index 0000000000..7113525bb8 --- /dev/null +++ b/plugins/techdocs-backend/src/techdocs/index.ts @@ -0,0 +1,16 @@ +/* + * 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. + */ +export * from './stages'; diff --git a/plugins/techdocs-backend/src/techdocs/stages/generate/generators.ts b/plugins/techdocs-backend/src/techdocs/stages/generate/generators.ts new file mode 100644 index 0000000000..da9d3c418b --- /dev/null +++ b/plugins/techdocs-backend/src/techdocs/stages/generate/generators.ts @@ -0,0 +1,46 @@ +/* + * 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 { + GeneratorBase, + SupportedGeneratorKey, + GeneratorBuilder, + } from './types'; + + import { Entity } from '@backstage/catalog-model'; + import { getGeneratorKey } from './helpers'; + + export class Generators implements GeneratorBuilder { + private generatorMap = new Map(); + + register(templaterKey: SupportedGeneratorKey, templater: GeneratorBase) { + this.generatorMap.set(templaterKey, templater); + } + + get(entity: Entity): GeneratorBase { + const generatorKey = getGeneratorKey(entity); + const generator = this.generatorMap.get(generatorKey); + + if (!generator) { + throw new Error( + `No generator registered for entity: "${generatorKey}"`, + ); + } + + return generator; + } + } + \ No newline at end of file diff --git a/plugins/techdocs-backend/src/techdocs/stages/generate/helpers.ts b/plugins/techdocs-backend/src/techdocs/stages/generate/helpers.ts new file mode 100644 index 0000000000..7dc4403977 --- /dev/null +++ b/plugins/techdocs-backend/src/techdocs/stages/generate/helpers.ts @@ -0,0 +1,80 @@ +/* + * 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 { Entity } from '@backstage/catalog-model'; +import { Writable, PassThrough } from 'stream'; +import Docker from 'dockerode'; +import { SupportedGeneratorKey } from './types'; + +// TODO: Implement proper support for more generators. +export function getGeneratorKey(entity: Entity): SupportedGeneratorKey { + if (!entity) { + throw new Error('No entity provided'); + } + + return 'techdocs'; +} + +type RunDockerContainerOptions = { + imageName: string; + args: string[]; + logStream?: Writable; + docsDir: string; + resultDir: string; + dockerClient: Docker; + createOptions?: Docker.ContainerCreateOptions; +}; + +export async function runDockerContainer({ + imageName, + args, + logStream = new PassThrough(), + docsDir, + resultDir, + dockerClient, + createOptions, +}: RunDockerContainerOptions) { + const [{ Error: error, StatusCode: statusCode }] = await dockerClient.run( + imageName, + args, + logStream, + { + Volumes: { + '/content': {}, + '/result': {}, + }, + WorkingDir: '/content', + HostConfig: { + Binds: [`${docsDir}:/content`, `${resultDir}:/result`], + }, + ...createOptions, + }, + ); + + if (error) { + throw new Error( + `Docker failed to run with the following error message: ${error}`, + ); + } + + if (statusCode !== 0) { + throw new Error( + `Docker container returned a non-zero exit code (${statusCode})`, + ); + } + + return { error, statusCode }; +} diff --git a/plugins/techdocs-backend/src/techdocs/stages/generate/index.ts b/plugins/techdocs-backend/src/techdocs/stages/generate/index.ts new file mode 100644 index 0000000000..5c086a976a --- /dev/null +++ b/plugins/techdocs-backend/src/techdocs/stages/generate/index.ts @@ -0,0 +1,18 @@ +/* + * 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. + */ +export { TechdocsGenerator } from './techdocs'; +export { Generators } from './generators'; +export type { GeneratorBuilder } from './types'; diff --git a/plugins/techdocs-backend/src/techdocs/stages/generate/techdocs.ts b/plugins/techdocs-backend/src/techdocs/stages/generate/techdocs.ts new file mode 100644 index 0000000000..d6650fb744 --- /dev/null +++ b/plugins/techdocs-backend/src/techdocs/stages/generate/techdocs.ts @@ -0,0 +1,48 @@ +/* + * 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 { + GeneratorBase, + GeneratorRunOptions, + GeneratorRunResult, +} from './types'; +import { runDockerContainer } from './helpers'; +import fs from 'fs'; +import path from 'path'; +import os from 'os'; + +export class TechdocsGenerator implements GeneratorBase { + public async run({ + directory, + logStream, + dockerClient, + }: GeneratorRunOptions): Promise { + const resultDir = fs.mkdtempSync(path.join(os.tmpdir(), `techdocs-tmp-`)); + + await runDockerContainer({ + imageName: 'spotify/techdocs', + args: ['build', '-d', '/result'], + logStream, + docsDir: directory, + resultDir, + dockerClient, + }); + + console.log( + `[TechDocs]: Successfully generated docs from ${directory} into ${resultDir}`, + ); + return { resultDir }; + } +} diff --git a/plugins/techdocs-backend/src/techdocs/stages/generate/types.ts b/plugins/techdocs-backend/src/techdocs/stages/generate/types.ts new file mode 100644 index 0000000000..4292aa68f6 --- /dev/null +++ b/plugins/techdocs-backend/src/techdocs/stages/generate/types.ts @@ -0,0 +1,55 @@ +/* + * 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 type { Writable } from 'stream'; +import Docker from 'dockerode'; +import { Entity } from '@backstage/catalog-model'; + +/** + * The returned directory from the generator which is ready + * to pass to the next stage of the TechDocs which is publishing + */ +export type GeneratorRunResult = { + resultDir: string; +}; + +/** + * The values that the generator will recieve. The directory of the + * uncompiled documentation, with the values from the frontend. A dedicated log stream and a docker + * client to run any generator on top of your directory. + */ +export type GeneratorRunOptions = { + directory: string; + logStream?: Writable; + dockerClient: Docker; +}; + +export type GeneratorBase = { + // runs the generator with the values and returns the directory to be published + run(opts: GeneratorRunOptions): Promise; +}; + +/** + * List of supported generator options + */ +export type SupportedGeneratorKey = 'techdocs' | string; + +/** + * The generator builder holds the generator ready for run time + */ +export type GeneratorBuilder = { + register(protocol: SupportedGeneratorKey, generator: GeneratorBase): void; + get(entity: Entity): GeneratorBase; +}; diff --git a/plugins/techdocs-backend/src/techdocs/stages/index.ts b/plugins/techdocs-backend/src/techdocs/stages/index.ts new file mode 100644 index 0000000000..40988483a3 --- /dev/null +++ b/plugins/techdocs-backend/src/techdocs/stages/index.ts @@ -0,0 +1,19 @@ +/* + * 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. + */ + +export * from './generate'; +export * from './prepare'; +export * from './publish'; diff --git a/plugins/techdocs-backend/src/techdocs/stages/prepare/dir.test.ts b/plugins/techdocs-backend/src/techdocs/stages/prepare/dir.test.ts new file mode 100644 index 0000000000..8a99a8b59a --- /dev/null +++ b/plugins/techdocs-backend/src/techdocs/stages/prepare/dir.test.ts @@ -0,0 +1,59 @@ +/* + * 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 { DirectoryPreparer } from './dir'; + +const createMockEntity = (annotations: {}) => { + return { + apiVersion: 'version', + kind: 'TestKind', + metadata: { + name: 'testName', + annotations: { + ...annotations, + }, + }, + }; +}; + +describe('directory preparer', () => { + it('should merge managed-by-location and techdocs-ref when techdocs-ref is relative', async () => { + const directoryPreparer = new DirectoryPreparer(); + + const mockEntity = createMockEntity({ + 'backstage.io/managed-by-location': + 'file:/directory/documented-component.yaml', + 'backstage.io/techdocs-ref': 'dir:./our-documentation', + }); + + expect(await directoryPreparer.prepare(mockEntity)).toEqual( + '/directory/our-documentation', + ); + }); + + it('should merge managed-by-location and techdocs-ref when techdocs-ref is absolute', async () => { + const directoryPreparer = new DirectoryPreparer(); + + const mockEntity = createMockEntity({ + 'backstage.io/managed-by-location': + 'file:/directory/documented-component.yaml', + 'backstage.io/techdocs-ref': 'dir:/our-documentation/techdocs', + }); + + expect(await directoryPreparer.prepare(mockEntity)).toEqual( + '/our-documentation/techdocs', + ); + }); +}); diff --git a/plugins/techdocs-backend/src/techdocs/stages/prepare/dir.ts b/plugins/techdocs-backend/src/techdocs/stages/prepare/dir.ts new file mode 100644 index 0000000000..e61a3e48ac --- /dev/null +++ b/plugins/techdocs-backend/src/techdocs/stages/prepare/dir.ts @@ -0,0 +1,38 @@ +/* + * 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 { PreparerBase } from './types'; +import { Entity } from '@backstage/catalog-model'; +import path from 'path'; +import { parseReferenceAnnotation } from './helpers'; + +export class DirectoryPreparer implements PreparerBase { + prepare(entity: Entity): Promise { + const { location: managedByLocation } = parseReferenceAnnotation( + 'backstage.io/managed-by-location', + entity, + ); + const { location: techdocsLocation } = parseReferenceAnnotation( + 'backstage.io/techdocs-ref', + entity, + ); + + const managedByLocationDirectory = path.dirname(managedByLocation); + + return new Promise(resolve => { + resolve(path.resolve(managedByLocationDirectory, techdocsLocation)); + }); + } +} diff --git a/plugins/techdocs-backend/src/techdocs/stages/prepare/helpers.ts b/plugins/techdocs-backend/src/techdocs/stages/prepare/helpers.ts new file mode 100644 index 0000000000..1fd86805ca --- /dev/null +++ b/plugins/techdocs-backend/src/techdocs/stages/prepare/helpers.ts @@ -0,0 +1,54 @@ +/* + * 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 { Entity } from '@backstage/catalog-model'; +import { InputError } from '@backstage/backend-common'; +import { RemoteProtocol } from './types'; + +export type ParsedLocationAnnotation = { + protocol: RemoteProtocol; + location: string; +}; + +export const parseReferenceAnnotation = ( + annotationName: string, + entity: Entity, +): ParsedLocationAnnotation => { + const annotation = entity.metadata.annotations?.[annotationName]; + + if (!annotation) { + throw new InputError( + `No location annotation provided in entity: ${entity.metadata.name}`, + ); + } + + // split on the first colon for the protocol and the rest after the first split + // is the location. + const [protocol, location] = annotation.split(/:(.+)/) as [ + RemoteProtocol?, + string?, + ]; + + if (!protocol || !location) { + throw new InputError( + `Failure to parse either protocol or location for entity: ${entity.metadata.name}`, + ); + } + + return { + protocol, + location, + }; +}; diff --git a/plugins/techdocs-backend/src/techdocs/stages/prepare/index.ts b/plugins/techdocs-backend/src/techdocs/stages/prepare/index.ts new file mode 100644 index 0000000000..9f928e7413 --- /dev/null +++ b/plugins/techdocs-backend/src/techdocs/stages/prepare/index.ts @@ -0,0 +1,18 @@ +/* + * 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. + */ +export { DirectoryPreparer } from './dir'; +export { Preparers } from './preparers'; +export type { PreparerBuilder } from './types'; diff --git a/plugins/techdocs-backend/src/techdocs/stages/prepare/preparers.ts b/plugins/techdocs-backend/src/techdocs/stages/prepare/preparers.ts new file mode 100644 index 0000000000..1d5b689d8b --- /dev/null +++ b/plugins/techdocs-backend/src/techdocs/stages/prepare/preparers.ts @@ -0,0 +1,38 @@ +/* + * 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 { PreparerBase, RemoteProtocol, PreparerBuilder } from './types'; +import { Entity } from '@backstage/catalog-model'; +import { parseReferenceAnnotation } from './helpers'; + +export class Preparers implements PreparerBuilder { + private preparerMap = new Map(); + + register(protocol: RemoteProtocol, preparer: PreparerBase) { + this.preparerMap.set(protocol, preparer); + } + + get(entity: Entity): PreparerBase { + const { protocol } = parseReferenceAnnotation('backstage.io/techdocs-ref', entity); + const preparer = this.preparerMap.get(protocol); + + if (!preparer) { + throw new Error(`No preparer registered for type: "${protocol}"`); + } + + return preparer; + } +} \ No newline at end of file diff --git a/plugins/techdocs-backend/src/techdocs/stages/prepare/types.ts b/plugins/techdocs-backend/src/techdocs/stages/prepare/types.ts new file mode 100644 index 0000000000..8baf6347bb --- /dev/null +++ b/plugins/techdocs-backend/src/techdocs/stages/prepare/types.ts @@ -0,0 +1,33 @@ +/* + * 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 type { Entity } from '@backstage/catalog-model'; +import { Logger } from 'winston'; + +export type PreparerBase = { + /** + * Given an Entity definition from the Service Catalog, go and prepare a directory + * with contents from the location in temporary storage and return the path + * @param entity The entity from the Service Catalog + */ + prepare(entity: Entity, opts?: { logger: Logger }): Promise; +}; + +export type PreparerBuilder = { + register(protocol: RemoteProtocol, preparer: PreparerBase): void; + get(entity: Entity): PreparerBase; +}; + +export type RemoteProtocol = 'dir' | string; diff --git a/plugins/techdocs-backend/src/techdocs/stages/publish/index.ts b/plugins/techdocs-backend/src/techdocs/stages/publish/index.ts new file mode 100644 index 0000000000..0029ea5c4e --- /dev/null +++ b/plugins/techdocs-backend/src/techdocs/stages/publish/index.ts @@ -0,0 +1,17 @@ +/* + * 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. + */ +export { LocalPublish } from './local'; +export type { PublisherBase } from './types'; diff --git a/plugins/techdocs-backend/src/techdocs/stages/publish/local.test.ts b/plugins/techdocs-backend/src/techdocs/stages/publish/local.test.ts new file mode 100644 index 0000000000..b5a96e4feb --- /dev/null +++ b/plugins/techdocs-backend/src/techdocs/stages/publish/local.test.ts @@ -0,0 +1,57 @@ +/* + * 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 { LocalPublish } from './local'; +import fs from 'fs-extra'; +import path from 'path'; + +const createMockEntity = (annotations = {}) => { + return { + apiVersion: 'version', + kind: 'TestKind', + metadata: { + name: 'test-component-name', + annotations: { + ...annotations, + }, + }, + }; +}; + +describe('local publisher', () => { + it('should publish generated documentation dir', async () => { + const publisher = new LocalPublish(); + + const mockEntity = createMockEntity(); + + const tempDir = fs.mkdtempSync(`${__dirname}/test-component-folder-`); + + expect(tempDir).toBeTruthy(); + + fs.closeSync(fs.openSync(path.join(tempDir, '/mock-file'), 'w')); + + await publisher.publish({ entity: mockEntity, directory: tempDir }); + const publishDir = path.resolve( + __dirname, + `../../../../static/docs/${mockEntity.metadata.name}`, + ); + + expect(fs.existsSync(publishDir)).toBeTruthy(); + expect(fs.existsSync(path.join(publishDir, '/mock-file'))).toBeTruthy(); + + fs.removeSync(publishDir); + fs.removeSync(tempDir); + }); +}); diff --git a/plugins/techdocs-backend/src/techdocs/stages/publish/local.ts b/plugins/techdocs-backend/src/techdocs/stages/publish/local.ts new file mode 100644 index 0000000000..227ba445ae --- /dev/null +++ b/plugins/techdocs-backend/src/techdocs/stages/publish/local.ts @@ -0,0 +1,54 @@ +/* + * 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 { PublisherBase } from './types'; +import { Entity } from '@backstage/catalog-model'; +import path from 'path'; +import fs from 'fs-extra'; + +export class LocalPublish implements PublisherBase { + publish({ + entity, + directory, + }: { + entity: Entity; + directory: string; + }): + | Promise<{ + remoteUrl: string; + }> + | { remoteUrl: string } { + const publishDir = path.resolve( + __dirname, + `../../../../static/docs/${entity.metadata.name}`, + ); + + if (!fs.existsSync(publishDir)) { + fs.mkdirSync(publishDir, { recursive: true }); + } + + return new Promise((resolve, reject) => { + fs.copy(directory, publishDir, err => { + if (err) { + reject(err); + } + + resolve({ + remoteUrl: `http://localhost:7000/techdocs/static/docs/${entity.metadata.name}`, + }); + }); + }); + } +} diff --git a/plugins/techdocs-backend/src/techdocs/stages/publish/types.ts b/plugins/techdocs-backend/src/techdocs/stages/publish/types.ts new file mode 100644 index 0000000000..ca85d9f56e --- /dev/null +++ b/plugins/techdocs-backend/src/techdocs/stages/publish/types.ts @@ -0,0 +1,32 @@ +/* + * 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 { Entity } from '@backstage/catalog-model'; + +/** + * Publisher is in charge of taking a folder created by + * the builder, and pushing it to storage + */ +export type PublisherBase = { + /** + * + * @param opts object containing the entity from the service + * catalog, and the directory that has been generated + */ + publish(opts: { + entity: Entity; + directory: string; + }): Promise<{ remoteUrl: string }> | { remoteUrl: string }; +}; diff --git a/yarn.lock b/yarn.lock index 99db406126..cd152470fe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4065,6 +4065,13 @@ dependencies: "@types/node" "*" +"@types/dockerode@^2.5.34": + version "2.5.34" + resolved "https://registry.npmjs.org/@types/dockerode/-/dockerode-2.5.34.tgz#9adb884f7cc6c012a6eb4b2ad794cc5d01439959" + integrity sha512-LcbLGcvcBwBAvjH9UrUI+4qotY+A5WCer5r43DR5XHv2ZIEByNXFdPLo1XxR+v/BjkGjlggW8qUiXuVEhqfkpA== + dependencies: + "@types/node" "*" + "@types/eslint-visitor-keys@^1.0.0": version "1.0.0" resolved "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" @@ -8590,6 +8597,14 @@ dockerode@^3.2.0: docker-modem "^2.1.0" tar-fs "~2.0.1" +dockerode@^3.2.1: + version "3.2.1" + resolved "https://registry.npmjs.org/dockerode/-/dockerode-3.2.1.tgz#4a2222e3e1df536bf595e78e76d3cfbf6d4d93b9" + integrity sha512-XsSVB5Wu5HWMg1aelV5hFSqFJaKS5x1aiV/+sT7YOzOq1IRl49I/UwV8Pe4x6t0iF9kiGkWu5jwfvbkcFVupBw== + dependencies: + docker-modem "^2.1.0" + tar-fs "~2.0.1" + doctrine@1.5.0: version "1.5.0" resolved "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" From 0001f109a462aa67e30b5cd3ebf440d768747fcd Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 4 Aug 2020 14:47:41 +0200 Subject: [PATCH 70/73] chore(deps-dev): bump @testing-library/react-hooks from 3.3.0 to 3.4.1 (#1820) Bumps [@testing-library/react-hooks](https://github.com/testing-library/react-hooks-testing-library) from 3.3.0 to 3.4.1. - [Release notes](https://github.com/testing-library/react-hooks-testing-library/releases) - [Commits](https://github.com/testing-library/react-hooks-testing-library/compare/v3.3.0...v3.4.1) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- yarn.lock | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/yarn.lock b/yarn.lock index cd152470fe..a1112a4917 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1161,14 +1161,7 @@ core-js-pure "^3.0.0" regenerator-runtime "^0.13.4" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.10.3", "@babel/runtime@^7.3.1", "@babel/runtime@^7.3.4", "@babel/runtime@^7.4.4", "@babel/runtime@^7.4.5", "@babel/runtime@^7.5.0", "@babel/runtime@^7.5.4", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.0", "@babel/runtime@^7.6.2", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.4", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2", "@babel/runtime@^7.9.6": - version "7.10.3" - resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.3.tgz#670d002655a7c366540c67f6fd3342cd09500364" - integrity sha512-RzGO0RLSdokm9Ipe/YD+7ww8X2Ro79qiXZF3HU9ljrM+qnJmH1Vqth+hbiQZy761LnMJTMitHDuKVYTk3k4dLw== - dependencies: - regenerator-runtime "^0.13.4" - -"@babel/runtime@^7.10.0": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.10.0", "@babel/runtime@^7.10.2", "@babel/runtime@^7.10.3", "@babel/runtime@^7.3.1", "@babel/runtime@^7.3.4", "@babel/runtime@^7.4.4", "@babel/runtime@^7.4.5", "@babel/runtime@^7.5.0", "@babel/runtime@^7.5.4", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.0", "@babel/runtime@^7.6.2", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.4", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2", "@babel/runtime@^7.9.6": version "7.10.5" resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.5.tgz#303d8bd440ecd5a491eae6117fd3367698674c5c" integrity sha512-otddXKhdNn7d0ptoFRHtMLa8LqDxLYwTjB4nYgM1yy5N6gU/MUf8zqyyLltCH3yAVitBzmwK4us+DD0l/MauAg== @@ -3812,12 +3805,12 @@ redent "^3.0.0" "@testing-library/react-hooks@^3.3.0": - version "3.3.0" - resolved "https://registry.npmjs.org/@testing-library/react-hooks/-/react-hooks-3.3.0.tgz#dc217bfce8e7c34a99c811d73d23feef957b7c1d" - integrity sha512-rE9geI1+HJ6jqXkzzJ6abREbeud6bLF8OmF+Vyc7gBoPwZAEVBYjbC1up5nNoVfYBhO5HUwdD4u9mTehAUeiyw== + version "3.4.1" + resolved "https://registry.npmjs.org/@testing-library/react-hooks/-/react-hooks-3.4.1.tgz#1f8ccd21208086ec228d9743fe40b69d0efcd7e5" + integrity sha512-LbzvE7oKsVzuW1cxA/aOeNgeVvmHWG2p/WSzalIGyWuqZT3jVcNDT5KPEwy36sUYWde0Qsh32xqIUFXukeywXg== dependencies: "@babel/runtime" "^7.5.4" - "@types/testing-library__react-hooks" "^3.0.0" + "@types/testing-library__react-hooks" "^3.3.0" "@testing-library/react@^10.4.1": version "10.4.3" @@ -4748,12 +4741,11 @@ dependencies: "@types/jest" "*" -"@types/testing-library__react-hooks@^3.0.0": - version "3.2.0" - resolved "https://registry.npmjs.org/@types/testing-library__react-hooks/-/testing-library__react-hooks-3.2.0.tgz#52f3a109bef06080e3b1e3ae7ea1c014ce859897" - integrity sha512-dE8iMTuR5lzB+MqnxlzORlXzXyCL0EKfzH0w/lau20OpkHD37EaWjZDz0iNG8b71iEtxT4XKGmSKAGVEqk46mw== +"@types/testing-library__react-hooks@^3.3.0": + version "3.4.0" + resolved "https://registry.npmjs.org/@types/testing-library__react-hooks/-/testing-library__react-hooks-3.4.0.tgz#be148b7fa7d19cd3349c4ef9d9534486bc582fcc" + integrity sha512-QYLZipqt1hpwYsBU63Ssa557v5wWbncqL36No59LI7W3nCMYKrLWTnYGn2griZ6v/3n5nKXNYkTeYpqPHY7Ukg== dependencies: - "@types/react" "*" "@types/react-test-renderer" "*" "@types/through@*": From f2c063454e60c6783570dd45fc665efcc3fc6b36 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 4 Aug 2020 14:48:07 +0200 Subject: [PATCH 71/73] chore(deps-dev): bump @types/nodegit from 0.26.5 to 0.26.7 (#1817) Bumps [@types/nodegit](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/nodegit) from 0.26.5 to 0.26.7. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/nodegit) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- plugins/scaffolder-backend/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/scaffolder-backend/package.json b/plugins/scaffolder-backend/package.json index 9dee285320..597d57a170 100644 --- a/plugins/scaffolder-backend/package.json +++ b/plugins/scaffolder-backend/package.json @@ -47,7 +47,7 @@ "@octokit/types": "^5.0.1", "@types/fs-extra": "^9.0.1", "@types/git-url-parse": "^9.0.0", - "@types/nodegit": "0.26.5", + "@types/nodegit": "0.26.7", "@types/supertest": "^2.0.8", "supertest": "^4.0.2", "yaml": "^1.10.0" diff --git a/yarn.lock b/yarn.lock index a1112a4917..71995e1ba1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4405,10 +4405,10 @@ resolved "https://registry.npmjs.org/@types/node/-/node-13.13.15.tgz#fe1cc3aa465a3ea6858b793fd380b66c39919766" integrity sha512-kwbcs0jySLxzLsa2nWUAGOd/s21WU1jebrEdtzhsj1D4Yps1EOuyI1Qcu+FD56dL7NRNIJtDDjcqIG22NwkgLw== -"@types/nodegit@0.26.5": - version "0.26.5" - resolved "https://registry.npmjs.org/@types/nodegit/-/nodegit-0.26.5.tgz#f13032617da3894620b6132828f0136a65043e14" - integrity sha512-Dszf6yKBPLSPDC18QtY5LFRaRoE682/BHEhPQqwPtSBh0pG9uTfrhh1fnt61OSXiF8s4lBJunXbBpfwxvhQElQ== +"@types/nodegit@0.26.7": + version "0.26.7" + resolved "https://registry.npmjs.org/@types/nodegit/-/nodegit-0.26.7.tgz#3fc8f5108dcabddd6238509748c0e812ba02b9b7" + integrity sha512-qVwQupq4To/wkRtUnaiwbNhuRiVJShOG9CYIWiGdKQRkvWijtHmEnrC1KJHOVrzK04sMdHRClyecrfmN17VMFQ== dependencies: "@types/node" "*" From 69c996408779b2db5fca043cfec08648c1617fb5 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 4 Aug 2020 14:48:30 +0200 Subject: [PATCH 72/73] chore(deps): bump chokidar from 3.4.0 to 3.4.1 (#1818) Bumps [chokidar](https://github.com/paulmillr/chokidar) from 3.4.0 to 3.4.1. - [Release notes](https://github.com/paulmillr/chokidar/releases) - [Commits](https://github.com/paulmillr/chokidar/compare/3.4.0...3.4.1) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 71995e1ba1..dd71017b47 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6921,9 +6921,9 @@ chokidar@^2.0.4, chokidar@^2.1.8: fsevents "^1.2.7" chokidar@^3.2.2, chokidar@^3.3.0, chokidar@^3.3.1: - version "3.4.0" - resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.4.0.tgz#b30611423ce376357c765b9b8f904b9fba3c0be8" - integrity sha512-aXAaho2VJtisB/1fg1+3nlLJqGOuewTzQpd/Tz0yTg2R0e4IGtshYvtjowyEumcBv2z+y4+kc75Mz7j5xJskcQ== + version "3.4.1" + resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.4.1.tgz#e905bdecf10eaa0a0b1db0c664481cc4cbc22ba1" + integrity sha512-TQTJyr2stihpC4Sya9hs2Xh+O2wf+igjL36Y75xx2WdHuiICcn/XJza46Jwt0eT5hVpQOzo3FpY3cj3RVYLX0g== dependencies: anymatch "~3.1.1" braces "~3.0.2" From 65b55fb0fa1ed4349aadb8d28d2d416a3ac2243f Mon Sep 17 00:00:00 2001 From: blam Date: Wed, 5 Aug 2020 00:56:12 +0200 Subject: [PATCH 73/73] chore(gql): graphql should be public --- plugins/graphql/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/graphql/package.json b/plugins/graphql/package.json index 5ed22253c3..2cb0d273c8 100644 --- a/plugins/graphql/package.json +++ b/plugins/graphql/package.json @@ -4,7 +4,6 @@ "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", - "private": true, "publishConfig": { "access": "public", "main": "dist/index.cjs.js",