Merge branch 'master' of github.com:jonathan-ash/backstage into sidebar-submenu-external-links
This commit is contained in:
@@ -1,5 +1,17 @@
|
||||
# @backstage/app-defaults
|
||||
|
||||
## 0.1.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- c77c5c7eb6: Added `backstage.role` to `package.json`
|
||||
- Updated dependencies
|
||||
- @backstage/core-app-api@0.5.3
|
||||
- @backstage/core-components@0.8.9
|
||||
- @backstage/core-plugin-api@0.6.1
|
||||
- @backstage/plugin-permission-react@0.3.1
|
||||
- @backstage/theme@0.2.15
|
||||
|
||||
## 0.1.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
{
|
||||
"name": "@backstage/app-defaults",
|
||||
"description": "Provides the default wiring of a Backstage App",
|
||||
"version": "0.1.7",
|
||||
"version": "0.1.8",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"main": "dist/index.esm.js",
|
||||
"types": "dist/index.d.ts"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "web-library"
|
||||
},
|
||||
"homepage": "https://backstage.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -21,19 +24,20 @@
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"scripts": {
|
||||
"build": "backstage-cli build --outputs types,esm",
|
||||
"lint": "backstage-cli lint",
|
||||
"test": "backstage-cli test",
|
||||
"prepack": "backstage-cli prepack",
|
||||
"postpack": "backstage-cli postpack",
|
||||
"clean": "backstage-cli clean"
|
||||
"build": "backstage-cli package build",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"prepack": "backstage-cli package prepack",
|
||||
"postpack": "backstage-cli package postpack",
|
||||
"clean": "backstage-cli package clean",
|
||||
"start": "backstage-cli package start"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/core-components": "^0.8.8",
|
||||
"@backstage/core-app-api": "^0.5.2",
|
||||
"@backstage/core-plugin-api": "^0.6.0",
|
||||
"@backstage/plugin-permission-react": "^0.3.0",
|
||||
"@backstage/theme": "^0.2.14",
|
||||
"@backstage/core-components": "^0.8.9",
|
||||
"@backstage/core-app-api": "^0.5.3",
|
||||
"@backstage/core-plugin-api": "^0.6.1",
|
||||
"@backstage/plugin-permission-react": "^0.3.1",
|
||||
"@backstage/theme": "^0.2.15",
|
||||
"@material-ui/core": "^4.12.2",
|
||||
"@material-ui/icons": "^4.9.1",
|
||||
"react-router-dom": "6.0.0-beta.0"
|
||||
@@ -42,8 +46,8 @@
|
||||
"react": "^16.13.1 || ^17.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.13.2",
|
||||
"@backstage/test-utils": "^0.2.4",
|
||||
"@backstage/cli": "^0.14.0",
|
||||
"@backstage/test-utils": "^0.2.5",
|
||||
"@testing-library/jest-dom": "^5.10.1",
|
||||
"@testing-library/react": "^11.2.5",
|
||||
"@types/jest": "^26.0.7",
|
||||
|
||||
@@ -1,5 +1,59 @@
|
||||
# example-app
|
||||
|
||||
## 0.2.65
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- @backstage/cli@0.14.0
|
||||
- @backstage/core-app-api@0.5.3
|
||||
- @backstage/core-components@0.8.9
|
||||
- @backstage/core-plugin-api@0.6.1
|
||||
- @backstage/integration-react@0.1.22
|
||||
- @backstage/plugin-airbrake@0.2.0
|
||||
- @backstage/plugin-apache-airflow@0.1.7
|
||||
- @backstage/plugin-api-docs@0.7.3
|
||||
- @backstage/plugin-azure-devops@0.1.15
|
||||
- @backstage/plugin-badges@0.2.23
|
||||
- @backstage/plugin-catalog@0.8.0
|
||||
- @backstage/plugin-catalog-import@0.8.2
|
||||
- @backstage/plugin-catalog-react@0.6.15
|
||||
- @backstage/plugin-circleci@0.2.38
|
||||
- @backstage/plugin-cloudbuild@0.2.36
|
||||
- @backstage/plugin-code-coverage@0.1.26
|
||||
- @backstage/plugin-cost-insights@0.11.21
|
||||
- @backstage/plugin-explore@0.3.30
|
||||
- @backstage/plugin-gcp-projects@0.3.18
|
||||
- @backstage/plugin-github-actions@0.4.36
|
||||
- @backstage/plugin-gocd@0.1.5
|
||||
- @backstage/plugin-graphiql@0.2.31
|
||||
- @backstage/plugin-home@0.4.15
|
||||
- @backstage/plugin-jenkins@0.5.21
|
||||
- @backstage/plugin-kafka@0.2.29
|
||||
- @backstage/plugin-kubernetes@0.5.8
|
||||
- @backstage/plugin-lighthouse@0.2.38
|
||||
- @backstage/plugin-newrelic@0.3.17
|
||||
- @backstage/plugin-newrelic-dashboard@0.1.7
|
||||
- @backstage/plugin-org@0.4.3
|
||||
- @backstage/plugin-pagerduty@0.3.26
|
||||
- @backstage/plugin-permission-react@0.3.1
|
||||
- @backstage/plugin-rollbar@0.3.27
|
||||
- @backstage/plugin-scaffolder@0.12.3
|
||||
- @backstage/plugin-search@0.7.0
|
||||
- @backstage/plugin-sentry@0.3.37
|
||||
- @backstage/plugin-shortcuts@0.2.0
|
||||
- @backstage/plugin-tech-insights@0.1.9
|
||||
- @backstage/plugin-tech-radar@0.5.6
|
||||
- @backstage/plugin-techdocs@0.13.4
|
||||
- @backstage/plugin-todo@0.2.1
|
||||
- @backstage/plugin-user-settings@0.3.20
|
||||
- @backstage/app-defaults@0.1.8
|
||||
- @backstage/catalog-model@0.10.0
|
||||
- @backstage/search-common@0.2.3
|
||||
- @backstage/theme@0.2.15
|
||||
- @backstage/plugin-catalog-common@0.1.3
|
||||
- @backstage/plugin-catalog-graph@0.2.11
|
||||
|
||||
## 0.2.64
|
||||
|
||||
### Patch Changes
|
||||
|
||||
+60
-57
@@ -1,57 +1,60 @@
|
||||
{
|
||||
"name": "example-app",
|
||||
"version": "0.2.64",
|
||||
"version": "0.2.65",
|
||||
"private": true,
|
||||
"backstage": {
|
||||
"role": "frontend"
|
||||
},
|
||||
"bundled": true,
|
||||
"dependencies": {
|
||||
"@backstage/app-defaults": "^0.1.7",
|
||||
"@backstage/catalog-model": "^0.9.10",
|
||||
"@backstage/cli": "^0.13.2",
|
||||
"@backstage/core-app-api": "^0.5.2",
|
||||
"@backstage/core-components": "^0.8.8",
|
||||
"@backstage/core-plugin-api": "^0.6.0",
|
||||
"@backstage/integration-react": "^0.1.21",
|
||||
"@backstage/plugin-airbrake": "^0.1.3",
|
||||
"@backstage/plugin-api-docs": "^0.7.2",
|
||||
"@backstage/plugin-azure-devops": "^0.1.14",
|
||||
"@backstage/plugin-apache-airflow": "^0.1.6",
|
||||
"@backstage/plugin-badges": "^0.2.22",
|
||||
"@backstage/plugin-catalog": "^0.7.12",
|
||||
"@backstage/plugin-catalog-common": "^0.1.2",
|
||||
"@backstage/plugin-catalog-graph": "^0.2.10",
|
||||
"@backstage/plugin-catalog-import": "^0.8.1",
|
||||
"@backstage/plugin-catalog-react": "^0.6.14",
|
||||
"@backstage/plugin-circleci": "^0.2.37",
|
||||
"@backstage/plugin-cloudbuild": "^0.2.35",
|
||||
"@backstage/plugin-code-coverage": "^0.1.25",
|
||||
"@backstage/plugin-cost-insights": "^0.11.20",
|
||||
"@backstage/plugin-explore": "^0.3.29",
|
||||
"@backstage/plugin-gcp-projects": "^0.3.17",
|
||||
"@backstage/plugin-github-actions": "^0.4.35",
|
||||
"@backstage/plugin-gocd": "^0.1.4",
|
||||
"@backstage/plugin-graphiql": "^0.2.30",
|
||||
"@backstage/plugin-home": "^0.4.14",
|
||||
"@backstage/plugin-jenkins": "^0.5.20",
|
||||
"@backstage/plugin-kafka": "^0.2.28",
|
||||
"@backstage/plugin-kubernetes": "^0.5.7",
|
||||
"@backstage/plugin-lighthouse": "^0.2.37",
|
||||
"@backstage/plugin-newrelic": "^0.3.16",
|
||||
"@backstage/plugin-newrelic-dashboard": "^0.1.6",
|
||||
"@backstage/plugin-org": "^0.4.2-next.0",
|
||||
"@backstage/plugin-pagerduty": "0.3.25",
|
||||
"@backstage/plugin-permission-react": "^0.3.0",
|
||||
"@backstage/plugin-rollbar": "^0.3.26",
|
||||
"@backstage/plugin-scaffolder": "^0.12.2",
|
||||
"@backstage/plugin-search": "^0.6.2",
|
||||
"@backstage/plugin-sentry": "^0.3.36",
|
||||
"@backstage/plugin-shortcuts": "^0.1.22",
|
||||
"@backstage/plugin-tech-radar": "^0.5.5",
|
||||
"@backstage/plugin-techdocs": "^0.13.3",
|
||||
"@backstage/plugin-todo": "^0.2.0",
|
||||
"@backstage/plugin-user-settings": "^0.3.19",
|
||||
"@backstage/search-common": "^0.2.2",
|
||||
"@backstage/plugin-tech-insights": "^0.1.8",
|
||||
"@backstage/theme": "^0.2.14",
|
||||
"@backstage/app-defaults": "^0.1.8",
|
||||
"@backstage/catalog-model": "^0.10.0",
|
||||
"@backstage/cli": "^0.14.0",
|
||||
"@backstage/core-app-api": "^0.5.3",
|
||||
"@backstage/core-components": "^0.8.9",
|
||||
"@backstage/core-plugin-api": "^0.6.1",
|
||||
"@backstage/integration-react": "^0.1.22",
|
||||
"@backstage/plugin-airbrake": "^0.2.0",
|
||||
"@backstage/plugin-api-docs": "^0.7.3",
|
||||
"@backstage/plugin-azure-devops": "^0.1.15",
|
||||
"@backstage/plugin-apache-airflow": "^0.1.7",
|
||||
"@backstage/plugin-badges": "^0.2.23",
|
||||
"@backstage/plugin-catalog": "^0.8.0",
|
||||
"@backstage/plugin-catalog-common": "^0.1.3",
|
||||
"@backstage/plugin-catalog-graph": "^0.2.11",
|
||||
"@backstage/plugin-catalog-import": "^0.8.2",
|
||||
"@backstage/plugin-catalog-react": "^0.6.15",
|
||||
"@backstage/plugin-circleci": "^0.2.38",
|
||||
"@backstage/plugin-cloudbuild": "^0.2.36",
|
||||
"@backstage/plugin-code-coverage": "^0.1.26",
|
||||
"@backstage/plugin-cost-insights": "^0.11.21",
|
||||
"@backstage/plugin-explore": "^0.3.30",
|
||||
"@backstage/plugin-gcp-projects": "^0.3.18",
|
||||
"@backstage/plugin-github-actions": "^0.4.36",
|
||||
"@backstage/plugin-gocd": "^0.1.5",
|
||||
"@backstage/plugin-graphiql": "^0.2.31",
|
||||
"@backstage/plugin-home": "^0.4.15",
|
||||
"@backstage/plugin-jenkins": "^0.5.21",
|
||||
"@backstage/plugin-kafka": "^0.2.29",
|
||||
"@backstage/plugin-kubernetes": "^0.5.8",
|
||||
"@backstage/plugin-lighthouse": "^0.2.38",
|
||||
"@backstage/plugin-newrelic": "^0.3.17",
|
||||
"@backstage/plugin-newrelic-dashboard": "^0.1.7",
|
||||
"@backstage/plugin-org": "^0.4.3",
|
||||
"@backstage/plugin-pagerduty": "0.3.26",
|
||||
"@backstage/plugin-permission-react": "^0.3.1",
|
||||
"@backstage/plugin-rollbar": "^0.3.27",
|
||||
"@backstage/plugin-scaffolder": "^0.12.3",
|
||||
"@backstage/plugin-search": "^0.7.0",
|
||||
"@backstage/plugin-sentry": "^0.3.37",
|
||||
"@backstage/plugin-shortcuts": "^0.2.0",
|
||||
"@backstage/plugin-tech-radar": "^0.5.6",
|
||||
"@backstage/plugin-techdocs": "^0.13.4",
|
||||
"@backstage/plugin-todo": "^0.2.1",
|
||||
"@backstage/plugin-user-settings": "^0.3.20",
|
||||
"@backstage/search-common": "^0.2.3",
|
||||
"@backstage/plugin-tech-insights": "^0.1.9",
|
||||
"@backstage/theme": "^0.2.15",
|
||||
"@material-ui/core": "^4.12.2",
|
||||
"@material-ui/icons": "^4.9.1",
|
||||
"@material-ui/lab": "4.0.0-alpha.57",
|
||||
@@ -71,8 +74,8 @@
|
||||
"zen-observable": "^0.8.15"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/plugin-permission-react": "^0.3.0",
|
||||
"@backstage/test-utils": "^0.2.4",
|
||||
"@backstage/plugin-permission-react": "^0.3.1",
|
||||
"@backstage/test-utils": "^0.2.5",
|
||||
"@rjsf/core": "^3.2.1",
|
||||
"@testing-library/cypress": "^8.0.2",
|
||||
"@testing-library/jest-dom": "^5.10.1",
|
||||
@@ -84,18 +87,18 @@
|
||||
"@types/react-dom": "*",
|
||||
"@types/zen-observable": "^0.8.0",
|
||||
"cross-env": "^7.0.0",
|
||||
"cypress": "^7.3.0",
|
||||
"cypress": "^9.5.0",
|
||||
"eslint-plugin-cypress": "^2.10.3",
|
||||
"start-server-and-test": "^1.10.11"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "backstage-cli app:serve",
|
||||
"build": "backstage-cli app:build",
|
||||
"clean": "backstage-cli clean",
|
||||
"test": "backstage-cli test",
|
||||
"start": "backstage-cli package start",
|
||||
"build": "backstage-cli package build",
|
||||
"clean": "backstage-cli package clean",
|
||||
"test": "backstage-cli package test",
|
||||
"test:e2e": "start-server-and-test start http://localhost:3000 cy:dev",
|
||||
"test:e2e:ci": "start-server-and-test start http://localhost:3000 cy:run",
|
||||
"lint": "backstage-cli lint",
|
||||
"lint": "backstage-cli package lint",
|
||||
"cy:dev": "cypress open",
|
||||
"cy:run": "cypress run"
|
||||
},
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
SidebarPinStateContext,
|
||||
} from '@backstage/core-components';
|
||||
import { useApi } from '@backstage/core-plugin-api';
|
||||
import { CatalogResultListItem } from '@backstage/plugin-catalog';
|
||||
import { CatalogSearchResultListItem } from '@backstage/plugin-catalog';
|
||||
import {
|
||||
catalogApiRef,
|
||||
CATALOG_FILTER_EXISTS,
|
||||
@@ -136,7 +136,7 @@ const SearchPage = () => {
|
||||
switch (type) {
|
||||
case 'software-catalog':
|
||||
return (
|
||||
<CatalogResultListItem
|
||||
<CatalogSearchResultListItem
|
||||
key={document.location}
|
||||
result={document}
|
||||
/>
|
||||
|
||||
@@ -1,5 +1,34 @@
|
||||
# @backstage/backend-common
|
||||
|
||||
## 0.10.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Fix for the previous release with missing type declarations.
|
||||
- Updated dependencies
|
||||
- @backstage/cli-common@0.1.8
|
||||
- @backstage/config@0.1.15
|
||||
- @backstage/config-loader@0.9.5
|
||||
- @backstage/errors@0.2.2
|
||||
- @backstage/integration@0.7.4
|
||||
- @backstage/types@0.1.3
|
||||
|
||||
## 0.10.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 1ed305728b: Bump `node-fetch` to version 2.6.7 and `cross-fetch` to version 3.1.5
|
||||
- c77c5c7eb6: Added `backstage.role` to `package.json`
|
||||
- 0107c9aa08: chore(deps): bump `helmet` from 4.4.1 to 5.0.2
|
||||
- b590e9b58d: Updated `isDatabaseConflictError` to handle modern sqlite conflict errors
|
||||
- Updated dependencies
|
||||
- @backstage/config-loader@0.9.4
|
||||
- @backstage/errors@0.2.1
|
||||
- @backstage/integration@0.7.3
|
||||
- @backstage/cli-common@0.1.7
|
||||
- @backstage/config@0.1.14
|
||||
- @backstage/types@0.1.2
|
||||
|
||||
## 0.10.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
Vendored
+9
-1
@@ -23,7 +23,7 @@ export interface Config {
|
||||
/** Backend configuration for when request authentication is enabled */
|
||||
auth?: {
|
||||
/** Keys shared by all backends for signing and validating backend tokens. */
|
||||
keys: {
|
||||
keys?: {
|
||||
/**
|
||||
* Secret for generating tokens. Should be a base64 string, recommended
|
||||
* length is 24 bytes.
|
||||
@@ -134,6 +134,14 @@ export interface Config {
|
||||
| {
|
||||
store: 'memory';
|
||||
}
|
||||
| {
|
||||
store: 'redis';
|
||||
/**
|
||||
* A redis connection string in the form `user:pass@host:port`.
|
||||
* @secret
|
||||
*/
|
||||
connection: string;
|
||||
}
|
||||
| {
|
||||
store: 'memcache';
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/backend-common",
|
||||
"description": "Common functionality library for Backstage backends",
|
||||
"version": "0.10.7",
|
||||
"version": "0.10.8",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"private": false,
|
||||
@@ -11,6 +11,9 @@
|
||||
"types": "dist/index.d.ts",
|
||||
"alphaTypes": "dist/index.alpha.d.ts"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "node-library"
|
||||
},
|
||||
"homepage": "https://backstage.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -22,20 +25,21 @@
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
"build": "backstage-cli build --experimental-type-build --outputs cjs,types",
|
||||
"lint": "backstage-cli lint",
|
||||
"test": "backstage-cli test",
|
||||
"prepack": "backstage-cli prepack",
|
||||
"postpack": "backstage-cli postpack",
|
||||
"clean": "backstage-cli clean"
|
||||
"build": "backstage-cli package build --experimental-type-build",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"prepack": "backstage-cli package prepack",
|
||||
"postpack": "backstage-cli package postpack",
|
||||
"clean": "backstage-cli package clean",
|
||||
"start": "backstage-cli package start"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/cli-common": "^0.1.6",
|
||||
"@backstage/config": "^0.1.13",
|
||||
"@backstage/config-loader": "^0.9.3",
|
||||
"@backstage/errors": "^0.2.0",
|
||||
"@backstage/integration": "^0.7.2",
|
||||
"@backstage/types": "^0.1.1",
|
||||
"@backstage/cli-common": "^0.1.7",
|
||||
"@backstage/config": "^0.1.14",
|
||||
"@backstage/config-loader": "^0.9.4",
|
||||
"@backstage/errors": "^0.2.1",
|
||||
"@backstage/integration": "^0.7.3",
|
||||
"@backstage/types": "^0.1.2",
|
||||
"@google-cloud/storage": "^5.8.0",
|
||||
"@manypkg/get-packages": "^1.1.3",
|
||||
"@octokit/rest": "^18.5.3",
|
||||
@@ -53,16 +57,17 @@
|
||||
"express-promise-router": "^4.1.0",
|
||||
"fs-extra": "9.1.0",
|
||||
"git-url-parse": "^11.6.0",
|
||||
"helmet": "^4.0.0",
|
||||
"helmet": "^5.0.2",
|
||||
"isomorphic-git": "^1.8.0",
|
||||
"jose": "^1.27.1",
|
||||
"keyv": "^4.0.3",
|
||||
"keyv-memcache": "^1.2.5",
|
||||
"@keyv/redis": "^2.2.3",
|
||||
"knex": "^1.0.2",
|
||||
"lodash": "^4.17.21",
|
||||
"logform": "^2.3.2",
|
||||
"luxon": "^2.0.2",
|
||||
"minimatch": "^3.0.4",
|
||||
"minimatch": "^5.0.0",
|
||||
"minimist": "^1.2.5",
|
||||
"morgan": "^1.10.0",
|
||||
"node-abort-controller": "^3.0.1",
|
||||
@@ -84,8 +89,8 @@
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.13.2",
|
||||
"@backstage/test-utils": "^0.2.4",
|
||||
"@backstage/cli": "^0.14.0",
|
||||
"@backstage/test-utils": "^0.2.5",
|
||||
"@types/archiver": "^5.1.0",
|
||||
"@types/compression": "^1.7.0",
|
||||
"@types/concat-stream": "^2.0.0",
|
||||
|
||||
@@ -18,6 +18,8 @@ import { ConfigReader } from '@backstage/config';
|
||||
import Keyv from 'keyv';
|
||||
/* @ts-expect-error */
|
||||
import KeyvMemcache from 'keyv-memcache';
|
||||
/* @ts-expect-error */
|
||||
import KeyvRedis from '@keyv/redis';
|
||||
import { DefaultCacheClient } from './CacheClient';
|
||||
import { CacheManager } from './CacheManager';
|
||||
import { NoStore } from './NoStore';
|
||||
@@ -26,6 +28,8 @@ jest.createMockFromModule('keyv');
|
||||
jest.mock('keyv');
|
||||
jest.createMockFromModule('keyv-memcache');
|
||||
jest.mock('keyv-memcache');
|
||||
jest.createMockFromModule('@keyv/redis');
|
||||
jest.mock('@keyv/redis');
|
||||
jest.mock('./CacheClient', () => {
|
||||
return {
|
||||
DefaultCacheClient: jest.fn(),
|
||||
@@ -190,6 +194,33 @@ describe('CacheManager', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('returns a Redis client when configured', () => {
|
||||
const redisHostAndPort = '127.0.0.1:6379';
|
||||
const expectedHost = `redis://${redisHostAndPort}`;
|
||||
const manager = CacheManager.fromConfig(
|
||||
new ConfigReader({
|
||||
backend: {
|
||||
cache: {
|
||||
store: 'redis',
|
||||
connection: redisHostAndPort,
|
||||
},
|
||||
},
|
||||
}),
|
||||
);
|
||||
const expectedTtl = 3600;
|
||||
manager.forPlugin('test').getClient({ defaultTtl: expectedTtl });
|
||||
|
||||
const cache = Keyv as unknown as jest.Mock;
|
||||
const mockCacheCalls = cache.mock.calls.splice(-1);
|
||||
expect(mockCacheCalls[0][0]).toMatchObject({
|
||||
ttl: expectedTtl,
|
||||
});
|
||||
expect(mockCacheCalls[0][0].store).toBeInstanceOf(KeyvRedis);
|
||||
const redis = KeyvRedis as jest.Mock;
|
||||
const mockRedisCalls = redis.mock.calls.splice(-1);
|
||||
expect(mockRedisCalls[0][0]).toEqual(expectedHost);
|
||||
});
|
||||
|
||||
describe('connection errors', () => {
|
||||
it('uses provided logger', () => {
|
||||
// Set up and inject mock logger.
|
||||
|
||||
@@ -18,6 +18,8 @@ import { Config } from '@backstage/config';
|
||||
import Keyv from 'keyv';
|
||||
// @ts-expect-error
|
||||
import KeyvMemcache from 'keyv-memcache';
|
||||
// @ts-expect-error
|
||||
import KeyvRedis from '@keyv/redis';
|
||||
import { Logger } from 'winston';
|
||||
import { getRootLogger } from '../logging';
|
||||
import { DefaultCacheClient, CacheClient } from './CacheClient';
|
||||
@@ -37,6 +39,7 @@ export class CacheManager {
|
||||
* that return Keyv instances appropriate to the store.
|
||||
*/
|
||||
private readonly storeFactories = {
|
||||
redis: this.getRedisClient,
|
||||
memcache: this.getMemcacheClient,
|
||||
memory: this.getMemoryClient,
|
||||
none: this.getNoneClient,
|
||||
@@ -123,6 +126,17 @@ export class CacheManager {
|
||||
return this.storeFactories[this.store].call(this, pluginId, ttl);
|
||||
}
|
||||
|
||||
private getRedisClient(
|
||||
pluginId: string,
|
||||
defaultTtl: number | undefined,
|
||||
): Keyv {
|
||||
return new Keyv({
|
||||
namespace: pluginId,
|
||||
ttl: defaultTtl,
|
||||
store: new KeyvRedis(`redis://${this.connection}`),
|
||||
});
|
||||
}
|
||||
|
||||
private getMemcacheClient(
|
||||
pluginId: string,
|
||||
defaultTtl: number | undefined,
|
||||
|
||||
@@ -19,7 +19,7 @@ import compression from 'compression';
|
||||
import cors from 'cors';
|
||||
import express, { Router, ErrorRequestHandler } from 'express';
|
||||
import helmet from 'helmet';
|
||||
import { ContentSecurityPolicyOptions } from 'helmet/dist/middlewares/content-security-policy';
|
||||
import { ContentSecurityPolicyOptions } from 'helmet/dist/types/middlewares/content-security-policy';
|
||||
import * as http from 'http';
|
||||
import stoppable from 'stoppable';
|
||||
import { Logger } from 'winston';
|
||||
@@ -215,8 +215,17 @@ export class ServiceBuilderImpl implements ServiceBuilder {
|
||||
httpsSettings: this.httpsSettings,
|
||||
helmetOptions: {
|
||||
contentSecurityPolicy: {
|
||||
useDefaults: false,
|
||||
directives: applyCspDirectives(this.cspOptions),
|
||||
},
|
||||
// These are all disabled in order to maintain backwards compatibility
|
||||
// when bumping helmet v5. We can't enable these by default because
|
||||
// there is no way for users to configure them.
|
||||
// TODO(Rugvip): We should give control of this setup to consumers
|
||||
crossOriginEmbedderPolicy: false,
|
||||
crossOriginOpenerPolicy: false,
|
||||
crossOriginResourcePolicy: false,
|
||||
originAgentCluster: false,
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -232,6 +241,11 @@ export function applyCspDirectives(
|
||||
// It should be replaced by any other solution that doesn't require unsafe-eval.
|
||||
result['script-src'] = ["'self'", "'unsafe-eval'"];
|
||||
|
||||
// TODO(Rugvip): This is removed so that we maintained backwards compatibility
|
||||
// when bumping to helmet v5, we could remove this as well as
|
||||
// skip setting `useDefaults: false` in the future.
|
||||
delete result['form-action'];
|
||||
|
||||
if (directives) {
|
||||
for (const [key, value] of Object.entries(directives)) {
|
||||
if (value === false) {
|
||||
|
||||
@@ -1,5 +1,27 @@
|
||||
# @backstage/backend-tasks
|
||||
|
||||
## 0.1.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Fix for the previous release with missing type declarations.
|
||||
- Updated dependencies
|
||||
- @backstage/backend-common@0.10.9
|
||||
- @backstage/config@0.1.15
|
||||
- @backstage/errors@0.2.2
|
||||
- @backstage/types@0.1.3
|
||||
|
||||
## 0.1.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- c77c5c7eb6: Added `backstage.role` to `package.json`
|
||||
- Updated dependencies
|
||||
- @backstage/backend-common@0.10.8
|
||||
- @backstage/errors@0.2.1
|
||||
- @backstage/config@0.1.14
|
||||
- @backstage/types@0.1.2
|
||||
|
||||
## 0.1.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/backend-tasks",
|
||||
"description": "Common distributed task management library for Backstage backends",
|
||||
"version": "0.1.6",
|
||||
"version": "0.1.7",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"private": false,
|
||||
@@ -10,6 +10,9 @@
|
||||
"main": "dist/index.cjs.js",
|
||||
"types": "dist/index.d.ts"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "node-library"
|
||||
},
|
||||
"homepage": "https://backstage.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -21,18 +24,19 @@
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
"build": "backstage-cli build --outputs cjs,types",
|
||||
"lint": "backstage-cli lint",
|
||||
"test": "backstage-cli test",
|
||||
"prepack": "backstage-cli prepack",
|
||||
"postpack": "backstage-cli postpack",
|
||||
"clean": "backstage-cli clean"
|
||||
"build": "backstage-cli package build",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"prepack": "backstage-cli package prepack",
|
||||
"postpack": "backstage-cli package postpack",
|
||||
"clean": "backstage-cli package clean",
|
||||
"start": "backstage-cli package start"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/backend-common": "^0.10.7",
|
||||
"@backstage/config": "^0.1.13",
|
||||
"@backstage/errors": "^0.2.0",
|
||||
"@backstage/types": "^0.1.1",
|
||||
"@backstage/backend-common": "^0.10.8",
|
||||
"@backstage/config": "^0.1.14",
|
||||
"@backstage/errors": "^0.2.1",
|
||||
"@backstage/types": "^0.1.2",
|
||||
"@types/luxon": "^2.0.4",
|
||||
"knex": "^1.0.2",
|
||||
"lodash": "^4.17.21",
|
||||
@@ -43,8 +47,8 @@
|
||||
"zod": "^3.9.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/backend-test-utils": "^0.1.17",
|
||||
"@backstage/cli": "^0.13.2",
|
||||
"@backstage/backend-test-utils": "^0.1.18",
|
||||
"@backstage/cli": "^0.14.0",
|
||||
"jest": "^26.0.1",
|
||||
"wait-for-expect": "^3.0.2"
|
||||
},
|
||||
|
||||
@@ -62,19 +62,21 @@ export class PluginTaskSchedulerJanitor {
|
||||
|
||||
const dbNull = this.knex.raw('null');
|
||||
|
||||
const tasksQuery = this.knex<DbTasksRow>(DB_TASKS_TABLE)
|
||||
const tasks = await this.knex<DbTasksRow>(DB_TASKS_TABLE)
|
||||
.where('current_run_expires_at', '<', this.knex.fn.now())
|
||||
.update({
|
||||
current_run_ticket: dbNull,
|
||||
current_run_started_at: dbNull,
|
||||
current_run_expires_at: dbNull,
|
||||
});
|
||||
})
|
||||
.returning(['id']);
|
||||
|
||||
if (this.knex.client.config.client === 'sqlite3') {
|
||||
const tasks = await tasksQuery;
|
||||
this.logger.warn(`${tasks} tasks timed out and were lost`);
|
||||
// sqlite ignores "returning", returns number of rows changed instead
|
||||
if (typeof tasks === 'number') {
|
||||
if (tasks > 0) {
|
||||
this.logger.warn(`${tasks} tasks timed out and were lost`);
|
||||
}
|
||||
} else {
|
||||
const tasks = await tasksQuery.returning(['id']);
|
||||
for (const { id } of tasks) {
|
||||
this.logger.warn(`Task timed out and was lost: ${id}`);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
# @backstage/backend-test-utils
|
||||
|
||||
## 0.1.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- c77c5c7eb6: Added `backstage.role` to `package.json`
|
||||
- Updated dependencies
|
||||
- @backstage/cli@0.14.0
|
||||
- @backstage/backend-common@0.10.8
|
||||
- @backstage/config@0.1.14
|
||||
|
||||
## 0.1.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/backend-test-utils",
|
||||
"description": "Test helpers library for Backstage backends",
|
||||
"version": "0.1.17",
|
||||
"version": "0.1.18",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"private": false,
|
||||
@@ -10,6 +10,9 @@
|
||||
"main": "dist/index.cjs.js",
|
||||
"types": "dist/index.d.ts"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "node-library"
|
||||
},
|
||||
"homepage": "https://backstage.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -22,17 +25,18 @@
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
"build": "backstage-cli build --outputs cjs,types",
|
||||
"lint": "backstage-cli lint",
|
||||
"test": "backstage-cli test",
|
||||
"prepack": "backstage-cli prepack",
|
||||
"postpack": "backstage-cli postpack",
|
||||
"clean": "backstage-cli clean"
|
||||
"build": "backstage-cli package build",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"prepack": "backstage-cli package prepack",
|
||||
"postpack": "backstage-cli package postpack",
|
||||
"clean": "backstage-cli package clean",
|
||||
"start": "backstage-cli package start"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/backend-common": "^0.10.7",
|
||||
"@backstage/cli": "^0.13.2",
|
||||
"@backstage/config": "^0.1.13",
|
||||
"@backstage/backend-common": "^0.10.8",
|
||||
"@backstage/cli": "^0.14.0",
|
||||
"@backstage/config": "^0.1.14",
|
||||
"@vscode/sqlite3": "^5.0.7",
|
||||
"knex": "^1.0.2",
|
||||
"mysql2": "^2.2.5",
|
||||
@@ -41,7 +45,7 @@
|
||||
"uuid": "^8.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.13.2",
|
||||
"@backstage/cli": "^0.14.0",
|
||||
"jest": "^26.0.1"
|
||||
},
|
||||
"files": [
|
||||
|
||||
@@ -1,5 +1,84 @@
|
||||
# example-backend
|
||||
|
||||
## 0.2.66
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- @backstage/backend-common@0.10.9
|
||||
- @backstage/backend-tasks@0.1.8
|
||||
- @backstage/catalog-client@0.7.1
|
||||
- @backstage/catalog-model@0.10.1
|
||||
- @backstage/config@0.1.15
|
||||
- @backstage/integration@0.7.4
|
||||
- @backstage/plugin-app-backend@0.3.26
|
||||
- @backstage/plugin-auth-backend@0.10.2
|
||||
- @backstage/plugin-auth-node@0.1.2
|
||||
- @backstage/plugin-azure-devops-backend@0.3.5
|
||||
- @backstage/plugin-badges-backend@0.1.20
|
||||
- @backstage/plugin-catalog-backend@0.21.5
|
||||
- @backstage/plugin-code-coverage-backend@0.1.24
|
||||
- @backstage/plugin-graphql-backend@0.1.16
|
||||
- @backstage/plugin-jenkins-backend@0.1.15
|
||||
- @backstage/plugin-kafka-backend@0.2.19
|
||||
- @backstage/plugin-kubernetes-backend@0.4.9
|
||||
- @backstage/plugin-permission-backend@0.5.1
|
||||
- @backstage/plugin-permission-common@0.5.1
|
||||
- @backstage/plugin-permission-node@0.5.1
|
||||
- @backstage/plugin-proxy-backend@0.2.20
|
||||
- @backstage/plugin-rollbar-backend@0.1.23
|
||||
- @backstage/plugin-scaffolder-backend@0.16.1
|
||||
- @backstage/plugin-scaffolder-backend-module-rails@0.3.1
|
||||
- @backstage/plugin-search-backend@0.4.4
|
||||
- @backstage/plugin-search-backend-module-elasticsearch@0.0.10
|
||||
- @backstage/plugin-search-backend-module-pg@0.2.8
|
||||
- @backstage/plugin-search-backend-node@0.4.7
|
||||
- @backstage/plugin-tech-insights-backend@0.2.6
|
||||
- @backstage/plugin-tech-insights-backend-module-jsonfc@0.1.10
|
||||
- @backstage/plugin-tech-insights-node@0.2.4
|
||||
- @backstage/plugin-techdocs-backend@0.13.5
|
||||
- @backstage/plugin-todo-backend@0.1.23
|
||||
|
||||
## 0.2.65
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- @backstage/plugin-techdocs-backend@0.13.4
|
||||
- @backstage/plugin-catalog-backend@0.21.4
|
||||
- @backstage/backend-common@0.10.8
|
||||
- @backstage/catalog-client@0.7.0
|
||||
- @backstage/integration@0.7.3
|
||||
- @backstage/plugin-auth-backend@0.10.1
|
||||
- @backstage/plugin-auth-node@0.1.1
|
||||
- @backstage/plugin-permission-backend@0.5.0
|
||||
- @backstage/plugin-permission-common@0.5.0
|
||||
- @backstage/plugin-rollbar-backend@0.1.22
|
||||
- @backstage/plugin-scaffolder-backend@0.16.0
|
||||
- @backstage/backend-tasks@0.1.7
|
||||
- @backstage/catalog-model@0.10.0
|
||||
- @backstage/config@0.1.14
|
||||
- @backstage/plugin-app-backend@0.3.25
|
||||
- @backstage/plugin-azure-devops-backend@0.3.4
|
||||
- @backstage/plugin-badges-backend@0.1.19
|
||||
- @backstage/plugin-code-coverage-backend@0.1.23
|
||||
- @backstage/plugin-graphql-backend@0.1.15
|
||||
- @backstage/plugin-jenkins-backend@0.1.14
|
||||
- @backstage/plugin-kafka-backend@0.2.18
|
||||
- @backstage/plugin-kubernetes-backend@0.4.8
|
||||
- @backstage/plugin-permission-node@0.5.0
|
||||
- @backstage/plugin-proxy-backend@0.2.19
|
||||
- @backstage/plugin-scaffolder-backend-module-rails@0.3.0
|
||||
- @backstage/plugin-search-backend@0.4.3
|
||||
- @backstage/plugin-search-backend-module-elasticsearch@0.0.9
|
||||
- @backstage/plugin-search-backend-module-pg@0.2.7
|
||||
- @backstage/plugin-search-backend-node@0.4.6
|
||||
- @backstage/plugin-tech-insights-backend@0.2.5
|
||||
- @backstage/plugin-tech-insights-backend-module-jsonfc@0.1.9
|
||||
- @backstage/plugin-tech-insights-node@0.2.3
|
||||
- @backstage/plugin-todo-backend@0.1.22
|
||||
- example-app@0.2.65
|
||||
|
||||
## 0.2.64
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#
|
||||
# Once the commands have been run, you can build the image using `yarn build-image`
|
||||
|
||||
FROM node:14-buster-slim
|
||||
FROM node:16-bullseye-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
@@ -19,6 +19,12 @@ WORKDIR /app
|
||||
COPY yarn.lock package.json packages/backend/dist/skeleton.tar.gz ./
|
||||
RUN tar xzf skeleton.tar.gz && rm skeleton.tar.gz
|
||||
|
||||
# install sqlite3 dependencies
|
||||
RUN apt-get update && \
|
||||
apt-get install -y libsqlite3-dev python3 cmake g++ && \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
yarn config set python /usr/bin/python3
|
||||
|
||||
RUN yarn install --frozen-lockfile --production --network-timeout 300000 && rm -rf "$(yarn cache dir)"
|
||||
|
||||
# Then copy the rest of the backend bundle, along with any other files we might want.
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
{
|
||||
"name": "example-backend",
|
||||
"version": "0.2.64",
|
||||
"version": "0.2.65",
|
||||
"main": "dist/index.cjs.js",
|
||||
"types": "src/index.ts",
|
||||
"license": "Apache-2.0",
|
||||
"private": true,
|
||||
"backstage": {
|
||||
"role": "backend"
|
||||
},
|
||||
"homepage": "https://backstage.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -15,48 +18,48 @@
|
||||
"backstage"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "backstage-cli backend:bundle",
|
||||
"build": "backstage-cli package build",
|
||||
"build-image": "docker build ../.. -f Dockerfile --tag example-backend",
|
||||
"start": "backstage-cli backend:dev",
|
||||
"lint": "backstage-cli lint",
|
||||
"test": "backstage-cli test",
|
||||
"clean": "backstage-cli clean",
|
||||
"start": "backstage-cli package start",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"clean": "backstage-cli package clean",
|
||||
"migrate:create": "knex migrate:make -x ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/backend-common": "^0.10.7",
|
||||
"@backstage/backend-tasks": "^0.1.6",
|
||||
"@backstage/catalog-client": "^0.6.0",
|
||||
"@backstage/catalog-model": "^0.9.10",
|
||||
"@backstage/config": "^0.1.13",
|
||||
"@backstage/integration": "^0.7.2",
|
||||
"@backstage/plugin-app-backend": "^0.3.24",
|
||||
"@backstage/plugin-auth-backend": "^0.10.0",
|
||||
"@backstage/plugin-auth-node": "^0.1.0",
|
||||
"@backstage/plugin-azure-devops-backend": "^0.3.3",
|
||||
"@backstage/plugin-badges-backend": "^0.1.18",
|
||||
"@backstage/plugin-catalog-backend": "^0.21.3",
|
||||
"@backstage/plugin-code-coverage-backend": "^0.1.22",
|
||||
"@backstage/plugin-graphql-backend": "^0.1.14",
|
||||
"@backstage/plugin-jenkins-backend": "^0.1.13",
|
||||
"@backstage/plugin-kubernetes-backend": "^0.4.7",
|
||||
"@backstage/plugin-kafka-backend": "^0.2.17",
|
||||
"@backstage/plugin-permission-backend": "^0.4.3",
|
||||
"@backstage/plugin-permission-common": "^0.4.0",
|
||||
"@backstage/plugin-permission-node": "^0.4.3",
|
||||
"@backstage/plugin-proxy-backend": "^0.2.18",
|
||||
"@backstage/plugin-rollbar-backend": "^0.1.21",
|
||||
"@backstage/plugin-scaffolder-backend": "^0.15.24",
|
||||
"@backstage/plugin-scaffolder-backend-module-rails": "^0.2.6",
|
||||
"@backstage/plugin-search-backend": "^0.4.2",
|
||||
"@backstage/plugin-search-backend-node": "^0.4.5",
|
||||
"@backstage/plugin-search-backend-module-elasticsearch": "^0.0.8",
|
||||
"@backstage/plugin-search-backend-module-pg": "^0.2.6",
|
||||
"@backstage/plugin-techdocs-backend": "^0.13.3",
|
||||
"@backstage/plugin-tech-insights-backend": "^0.2.4",
|
||||
"@backstage/plugin-tech-insights-node": "^0.2.2",
|
||||
"@backstage/plugin-tech-insights-backend-module-jsonfc": "^0.1.8",
|
||||
"@backstage/plugin-todo-backend": "^0.1.21",
|
||||
"@backstage/backend-common": "^0.10.8",
|
||||
"@backstage/backend-tasks": "^0.1.7",
|
||||
"@backstage/catalog-client": "^0.7.0",
|
||||
"@backstage/catalog-model": "^0.10.0",
|
||||
"@backstage/config": "^0.1.14",
|
||||
"@backstage/integration": "^0.7.3",
|
||||
"@backstage/plugin-app-backend": "^0.3.25",
|
||||
"@backstage/plugin-auth-backend": "^0.10.1",
|
||||
"@backstage/plugin-auth-node": "^0.1.1",
|
||||
"@backstage/plugin-azure-devops-backend": "^0.3.4",
|
||||
"@backstage/plugin-badges-backend": "^0.1.19",
|
||||
"@backstage/plugin-catalog-backend": "^0.21.4",
|
||||
"@backstage/plugin-code-coverage-backend": "^0.1.23",
|
||||
"@backstage/plugin-graphql-backend": "^0.1.15",
|
||||
"@backstage/plugin-jenkins-backend": "^0.1.14",
|
||||
"@backstage/plugin-kubernetes-backend": "^0.4.8",
|
||||
"@backstage/plugin-kafka-backend": "^0.2.18",
|
||||
"@backstage/plugin-permission-backend": "^0.5.0",
|
||||
"@backstage/plugin-permission-common": "^0.5.0",
|
||||
"@backstage/plugin-permission-node": "^0.5.0",
|
||||
"@backstage/plugin-proxy-backend": "^0.2.19",
|
||||
"@backstage/plugin-rollbar-backend": "^0.1.22",
|
||||
"@backstage/plugin-scaffolder-backend": "^0.16.0",
|
||||
"@backstage/plugin-scaffolder-backend-module-rails": "^0.3.0",
|
||||
"@backstage/plugin-search-backend": "^0.4.3",
|
||||
"@backstage/plugin-search-backend-node": "^0.4.6",
|
||||
"@backstage/plugin-search-backend-module-elasticsearch": "^0.0.9",
|
||||
"@backstage/plugin-search-backend-module-pg": "^0.2.7",
|
||||
"@backstage/plugin-techdocs-backend": "^0.13.4",
|
||||
"@backstage/plugin-tech-insights-backend": "^0.2.5",
|
||||
"@backstage/plugin-tech-insights-node": "^0.2.3",
|
||||
"@backstage/plugin-tech-insights-backend-module-jsonfc": "^0.1.9",
|
||||
"@backstage/plugin-todo-backend": "^0.1.22",
|
||||
"@gitbeaker/node": "^35.1.0",
|
||||
"@octokit/rest": "^18.5.3",
|
||||
"@vscode/sqlite3": "^5.0.7",
|
||||
@@ -73,7 +76,7 @@
|
||||
"winston": "^3.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.13.2",
|
||||
"@backstage/cli": "^0.14.0",
|
||||
"@types/dockerode": "^3.3.0",
|
||||
"@types/express": "^4.17.6",
|
||||
"@types/express-serve-static-core": "^4.17.5"
|
||||
|
||||
@@ -1,5 +1,54 @@
|
||||
# @backstage/catalog-client
|
||||
|
||||
## 0.7.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Fix for the previous release with missing type declarations.
|
||||
- Updated dependencies
|
||||
- @backstage/catalog-model@0.10.1
|
||||
- @backstage/errors@0.2.2
|
||||
|
||||
## 0.7.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 8eda0e7a9c: **BREAKING**: Removed the explicit `DiscoveryApi` and `FetchApi` export symbols,
|
||||
which were unnecessary duplicates from the well known core ones.
|
||||
|
||||
The `CATALOG_FILTER_EXISTS` symbol's value has changed. However, this should not
|
||||
affect any code in practice.
|
||||
|
||||
- deaf6065db: Removed `CatalogApi.geLocationByEntity` and `CatalogApi.getOriginLocationByEntity`, and replaced them with `CatalogApi.getLocationByRef`.
|
||||
|
||||
If you were using one of the two old methods, you can update your code as follows:
|
||||
|
||||
```diff
|
||||
-const originLocation = catalogApi.getOriginLocationByEntity(entity);
|
||||
+const originLocation = catalogApi.getLocationByRef(entity.metadata.annotations[ANNOTATION_ORIGIN_LOCATION]!);
|
||||
-const location = catalogApi.getLocationByEntity(entity);
|
||||
+const location = catalogApi.getLocationByRef(entity.metadata.annotations[ANNOTATION_LOCATION]!);
|
||||
```
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 1ed305728b: Bump `node-fetch` to version 2.6.7 and `cross-fetch` to version 3.1.5
|
||||
- c77c5c7eb6: Added `backstage.role` to `package.json`
|
||||
- 216725b434: Updated to use new names for `parseLocationRef` and `stringifyLocationRef`
|
||||
- 244d24ebc4: Export the `Location` type that was previously exported by the `@backstage/catalog-model` package.
|
||||
- 538ca90790: Deprecated the following types used by the catalog client, and created new
|
||||
corresponding types to make them more consistent:
|
||||
|
||||
- `CatalogEntitiesRequest` -> `GetEntitiesRequest`
|
||||
- `CatalogListResponse` was removed and generally replaced with `GetEntitiesResponse` (which does not use a type parameter argument)
|
||||
- `CatalogEntityAncestorsRequest`-> `GetEntityAncestorsRequest`
|
||||
- `CatalogEntityAncestorsResponse` -> `GetEntityAncestorsResponse`
|
||||
|
||||
- 27eccab216: Replaces use of deprecated catalog-model constants.
|
||||
- Updated dependencies
|
||||
- @backstage/errors@0.2.1
|
||||
- @backstage/catalog-model@0.10.0
|
||||
|
||||
## 0.6.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
```ts
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import { EntityName } from '@backstage/catalog-model';
|
||||
import { LocationSpec } from '@backstage/catalog-model';
|
||||
|
||||
// @public
|
||||
export type AddLocationRequest = {
|
||||
@@ -43,16 +42,16 @@ export interface CatalogApi {
|
||||
name: EntityName,
|
||||
options?: CatalogRequestOptions,
|
||||
): Promise<Entity | undefined>;
|
||||
getLocationByEntity(
|
||||
entity: Entity,
|
||||
getEntityFacets(
|
||||
request: GetEntityFacetsRequest,
|
||||
options?: CatalogRequestOptions,
|
||||
): Promise<Location_2 | undefined>;
|
||||
): Promise<GetEntityFacetsResponse>;
|
||||
getLocationById(
|
||||
id: string,
|
||||
options?: CatalogRequestOptions,
|
||||
): Promise<Location_2 | undefined>;
|
||||
getOriginLocationByEntity(
|
||||
entity: Entity,
|
||||
getLocationByRef(
|
||||
locationRef: string,
|
||||
options?: CatalogRequestOptions,
|
||||
): Promise<Location_2 | undefined>;
|
||||
refreshEntity(
|
||||
@@ -95,6 +94,11 @@ export class CatalogClient implements CatalogApi {
|
||||
compoundName: EntityName,
|
||||
options?: CatalogRequestOptions,
|
||||
): Promise<Entity | undefined>;
|
||||
getEntityFacets(
|
||||
request: GetEntityFacetsRequest,
|
||||
options?: CatalogRequestOptions,
|
||||
): Promise<GetEntityFacetsResponse>;
|
||||
// @deprecated (undocumented)
|
||||
getLocationByEntity(
|
||||
entity: Entity,
|
||||
options?: CatalogRequestOptions,
|
||||
@@ -103,6 +107,11 @@ export class CatalogClient implements CatalogApi {
|
||||
id: string,
|
||||
options?: CatalogRequestOptions,
|
||||
): Promise<Location_2 | undefined>;
|
||||
getLocationByRef(
|
||||
locationRef: string,
|
||||
options?: CatalogRequestOptions,
|
||||
): Promise<Location_2 | undefined>;
|
||||
// @deprecated (undocumented)
|
||||
getOriginLocationByEntity(
|
||||
entity: Entity,
|
||||
options?: CatalogRequestOptions,
|
||||
@@ -178,9 +187,32 @@ export interface GetEntityAncestorsResponse {
|
||||
rootEntityRef: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface GetEntityFacetsRequest {
|
||||
facets: string[];
|
||||
filter?:
|
||||
| Record<string, string | symbol | (string | symbol)[]>[]
|
||||
| Record<string, string | symbol | (string | symbol)[]>
|
||||
| undefined;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface GetEntityFacetsResponse {
|
||||
facets: Record<
|
||||
string,
|
||||
Array<{
|
||||
value: string;
|
||||
count: number;
|
||||
}>
|
||||
>;
|
||||
}
|
||||
|
||||
// @public
|
||||
type Location_2 = {
|
||||
id: string;
|
||||
} & LocationSpec;
|
||||
type: string;
|
||||
target: string;
|
||||
presence?: 'optional' | 'required';
|
||||
};
|
||||
export { Location_2 as Location };
|
||||
```
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/catalog-client",
|
||||
"description": "An isomorphic client for the catalog backend",
|
||||
"version": "0.6.0",
|
||||
"version": "0.7.0",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"license": "Apache-2.0",
|
||||
@@ -12,6 +12,9 @@
|
||||
"module": "dist/index.esm.js",
|
||||
"types": "dist/index.d.ts"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "common-library"
|
||||
},
|
||||
"homepage": "https://backstage.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -22,20 +25,20 @@
|
||||
"backstage"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "backstage-cli build",
|
||||
"lint": "backstage-cli lint",
|
||||
"test": "backstage-cli test",
|
||||
"prepack": "backstage-cli prepack",
|
||||
"postpack": "backstage-cli postpack",
|
||||
"clean": "backstage-cli clean"
|
||||
"build": "backstage-cli package build",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"prepack": "backstage-cli package prepack",
|
||||
"postpack": "backstage-cli package postpack",
|
||||
"clean": "backstage-cli package clean"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/catalog-model": "^0.9.10",
|
||||
"@backstage/errors": "^0.2.0",
|
||||
"@backstage/catalog-model": "^0.10.0",
|
||||
"@backstage/errors": "^0.2.1",
|
||||
"cross-fetch": "^3.1.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.13.2",
|
||||
"@backstage/cli": "^0.14.0",
|
||||
"@types/jest": "^26.0.7",
|
||||
"msw": "^0.35.0"
|
||||
},
|
||||
|
||||
@@ -36,6 +36,8 @@ import {
|
||||
GetEntityAncestorsRequest,
|
||||
GetEntityAncestorsResponse,
|
||||
Location,
|
||||
GetEntityFacetsRequest,
|
||||
GetEntityFacetsResponse,
|
||||
} from './types/api';
|
||||
import { DiscoveryApi } from './types/discovery';
|
||||
import { FetchApi } from './types/fetch';
|
||||
@@ -97,14 +99,13 @@ export class CatalogClient implements CatalogApi {
|
||||
options?: CatalogRequestOptions,
|
||||
): Promise<GetEntitiesResponse> {
|
||||
const { filter = [], fields = [], offset, limit, after } = request ?? {};
|
||||
const filterItems = [filter].flat();
|
||||
const params: string[] = [];
|
||||
|
||||
// filter param can occur multiple times, for example
|
||||
// /api/catalog/entities?filter=metadata.name=wayback-search,kind=component&filter=metadata.name=www-artist,kind=component'
|
||||
// the "outer array" defined by `filter` occurrences corresponds to "anyOf" filters
|
||||
// the "inner array" defined within a `filter` param corresponds to "allOf" filters
|
||||
for (const filterItem of filterItems) {
|
||||
for (const filterItem of [filter].flat()) {
|
||||
const filterParts: string[] = [];
|
||||
for (const [key, value] of Object.entries(filterItem)) {
|
||||
for (const v of [value].flat()) {
|
||||
@@ -207,6 +208,47 @@ export class CatalogClient implements CatalogApi {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc CatalogApi.getEntityFacets}
|
||||
*/
|
||||
async getEntityFacets(
|
||||
request: GetEntityFacetsRequest,
|
||||
options?: CatalogRequestOptions,
|
||||
): Promise<GetEntityFacetsResponse> {
|
||||
const { filter = [], facets } = request;
|
||||
const params: string[] = [];
|
||||
|
||||
// filter param can occur multiple times, for example
|
||||
// /api/catalog/entities?filter=metadata.name=wayback-search,kind=component&filter=metadata.name=www-artist,kind=component'
|
||||
// the "outer array" defined by `filter` occurrences corresponds to "anyOf" filters
|
||||
// the "inner array" defined within a `filter` param corresponds to "allOf" filters
|
||||
for (const filterItem of [filter].flat()) {
|
||||
const filterParts: string[] = [];
|
||||
for (const [key, value] of Object.entries(filterItem)) {
|
||||
for (const v of [value].flat()) {
|
||||
if (v === CATALOG_FILTER_EXISTS) {
|
||||
filterParts.push(encodeURIComponent(key));
|
||||
} else if (typeof v === 'string') {
|
||||
filterParts.push(
|
||||
`${encodeURIComponent(key)}=${encodeURIComponent(v)}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (filterParts.length) {
|
||||
params.push(`filter=${filterParts.join(',')}`);
|
||||
}
|
||||
}
|
||||
|
||||
for (const facet of facets) {
|
||||
params.push(`facet=${encodeURIComponent(facet)}`);
|
||||
}
|
||||
|
||||
const query = params.length ? `?${params.join('&')}` : '';
|
||||
return await this.requestOptional('GET', `/entity-facets${query}`, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc CatalogApi.addLocation}
|
||||
*/
|
||||
@@ -246,7 +288,7 @@ export class CatalogClient implements CatalogApi {
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc CatalogApi.getOriginLocationByEntity}
|
||||
* @deprecated please use getLocationByRef instead
|
||||
*/
|
||||
async getOriginLocationByEntity(
|
||||
entity: Entity,
|
||||
@@ -268,7 +310,7 @@ export class CatalogClient implements CatalogApi {
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc CatalogApi.getLocationByEntity}
|
||||
* @deprecated please use getLocationByRef instead
|
||||
*/
|
||||
async getLocationByEntity(
|
||||
entity: Entity,
|
||||
@@ -288,6 +330,23 @@ export class CatalogClient implements CatalogApi {
|
||||
.find(l => locationCompound === stringifyLocationRef(l));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc CatalogApi.getLocationByRef}
|
||||
*/
|
||||
async getLocationByRef(
|
||||
locationRef: string,
|
||||
options?: CatalogRequestOptions,
|
||||
): Promise<Location | undefined> {
|
||||
const all: { data: Location }[] = await this.requestRequired(
|
||||
'GET',
|
||||
'/locations',
|
||||
options,
|
||||
);
|
||||
return all
|
||||
.map(r => r.data)
|
||||
.find(l => locationRef === stringifyLocationRef(l));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc CatalogApi.removeLocationById}
|
||||
*/
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Entity, EntityName, LocationSpec } from '@backstage/catalog-model';
|
||||
import { Entity, EntityName } from '@backstage/catalog-model';
|
||||
|
||||
/**
|
||||
* This symbol can be used in place of a value when passed to filters in e.g.
|
||||
@@ -142,6 +142,90 @@ export interface GetEntityAncestorsResponse {
|
||||
}>;
|
||||
}
|
||||
|
||||
/**
|
||||
* The request type for {@link CatalogClient.getEntityFacets}.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface GetEntityFacetsRequest {
|
||||
/**
|
||||
* If given, return only entities that match the given patterns.
|
||||
*
|
||||
* @remarks
|
||||
*
|
||||
* If multiple filter sets are given as an array, then there is effectively an
|
||||
* OR between each filter set.
|
||||
*
|
||||
* Within one filter set, there is effectively an AND between the various
|
||||
* keys.
|
||||
*
|
||||
* Within one key, if there are more than one value, then there is effectively
|
||||
* an OR between them.
|
||||
*
|
||||
* Example: For an input of
|
||||
*
|
||||
* ```
|
||||
* [
|
||||
* { kind: ['API', 'Component'] },
|
||||
* { 'metadata.name': 'a', 'metadata.namespace': 'b' }
|
||||
* ]
|
||||
* ```
|
||||
*
|
||||
* This effectively means
|
||||
*
|
||||
* ```
|
||||
* (kind = EITHER 'API' OR 'Component')
|
||||
* OR
|
||||
* (metadata.name = 'a' AND metadata.namespace = 'b' )
|
||||
* ```
|
||||
*
|
||||
* Each key is a dot separated path in each object.
|
||||
*
|
||||
* As a value you can also pass in the symbol `CATALOG_FILTER_EXISTS`
|
||||
* (exported from this package), which means that you assert on the existence
|
||||
* of that key, no matter what its value is.
|
||||
*/
|
||||
filter?:
|
||||
| Record<string, string | symbol | (string | symbol)[]>[]
|
||||
| Record<string, string | symbol | (string | symbol)[]>
|
||||
| undefined;
|
||||
/**
|
||||
* Dot separated paths for the facets to extract from each entity.
|
||||
*
|
||||
* @remarks
|
||||
*
|
||||
* Example: For an input of `['kind', 'metadata.annotations.backstage.io/orphan']`, then the
|
||||
* response will be shaped like
|
||||
*
|
||||
* ```
|
||||
* {
|
||||
* "facets": {
|
||||
* "kind": [
|
||||
* { "key": "Component", "count": 22 },
|
||||
* { "key": "API", "count": 13 }
|
||||
* ],
|
||||
* "metadata.annotations.backstage.io/orphan": [
|
||||
* { "key": "true", "count": 2 }
|
||||
* ]
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
facets: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* The response type for {@link CatalogClient.getEntityFacets}.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface GetEntityFacetsResponse {
|
||||
/**
|
||||
* The computed facets, one entry per facet in the request.
|
||||
*/
|
||||
facets: Record<string, Array<{ value: string; count: number }>>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options you can pass into a catalog request for additional information.
|
||||
*
|
||||
@@ -158,7 +242,11 @@ export interface CatalogRequestOptions {
|
||||
*/
|
||||
export type Location = {
|
||||
id: string;
|
||||
} & LocationSpec;
|
||||
type: string;
|
||||
target: string;
|
||||
/** @deprecated This field is is ignored */
|
||||
presence?: 'optional' | 'required';
|
||||
};
|
||||
|
||||
/**
|
||||
* The request type for {@link CatalogClient.addLocation}.
|
||||
@@ -169,6 +257,7 @@ export type AddLocationRequest = {
|
||||
type?: string;
|
||||
target: string;
|
||||
dryRun?: boolean;
|
||||
/** @deprecated This field is is ignored */
|
||||
presence?: 'optional' | 'required';
|
||||
};
|
||||
|
||||
@@ -248,6 +337,17 @@ export interface CatalogApi {
|
||||
options?: CatalogRequestOptions,
|
||||
): Promise<void>;
|
||||
|
||||
/**
|
||||
* Gets a summary of field facets of entities in the catalog.
|
||||
*
|
||||
* @param request - Request parameters
|
||||
* @param options - Additional options
|
||||
*/
|
||||
getEntityFacets(
|
||||
request: GetEntityFacetsRequest,
|
||||
options?: CatalogRequestOptions,
|
||||
): Promise<GetEntityFacetsResponse>;
|
||||
|
||||
// Locations
|
||||
|
||||
/**
|
||||
@@ -262,24 +362,13 @@ export interface CatalogApi {
|
||||
): Promise<Location | undefined>;
|
||||
|
||||
/**
|
||||
* Gets origin location by Entity.
|
||||
* Gets a registered location by its ref.
|
||||
*
|
||||
* @param entity - An {@link catalog-model#Entity}.
|
||||
* @param locationRef - A location ref, e.g. "url:https://github.com/..."
|
||||
* @param options - Additional options
|
||||
*/
|
||||
getOriginLocationByEntity(
|
||||
entity: Entity,
|
||||
options?: CatalogRequestOptions,
|
||||
): Promise<Location | undefined>;
|
||||
|
||||
/**
|
||||
* Gets Location by Entity.
|
||||
*
|
||||
* @param entity - An {@link catalog-model#Entity}.
|
||||
* @param options - Additional options
|
||||
*/
|
||||
getLocationByEntity(
|
||||
entity: Entity,
|
||||
getLocationByRef(
|
||||
locationRef: string,
|
||||
options?: CatalogRequestOptions,
|
||||
): Promise<Location | undefined>;
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@ export type {
|
||||
GetEntityAncestorsRequest,
|
||||
GetEntityAncestorsResponse,
|
||||
Location,
|
||||
GetEntityFacetsRequest,
|
||||
GetEntityFacetsResponse,
|
||||
} from './api';
|
||||
export { ENTITY_STATUS_CATALOG_PROCESSING_TYPE } from './status';
|
||||
export * from './deprecated';
|
||||
export { ENTITY_STATUS_CATALOG_PROCESSING_TYPE } from './status';
|
||||
|
||||
@@ -1,5 +1,45 @@
|
||||
# @backstage/catalog-model
|
||||
|
||||
## 0.10.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Fix for the previous release with missing type declarations.
|
||||
- Updated dependencies
|
||||
- @backstage/config@0.1.15
|
||||
- @backstage/errors@0.2.2
|
||||
- @backstage/types@0.1.3
|
||||
|
||||
## 0.10.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- e483dd6c72: **BREAKING**: Remove deprecated validation methods `analyzeLocationSchema`, `locationSchema` and `locationSpecSchema`.
|
||||
This functionality was primarily used internally by the `catalog-backend`.
|
||||
- edbc03814a: **BREAKING**: Remove deprecated `serializeEntityRef` which is replaced by `stringifyEntityRef`.
|
||||
- e72d371296: **BREAKING**: Removed `TemplateEntityV1beta2` from the model and moved it to
|
||||
`@backstage/plugin-scaffolder-common` where `TemplateEntityV1beta3` already
|
||||
lived. It has also been marked as deprecated in the process - please consider
|
||||
[migrating to `v1beta3` templates](https://backstage.io/docs/features/software-templates/migrating-from-v1beta2-to-v1beta3).
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- c77c5c7eb6: Added `backstage.role` to `package.json`
|
||||
- 216725b434: Deprecated `parseLocationReference` and `stringifyLocationReference`,
|
||||
introducing `parseLocationRef` and `stringifyLocationRef` in their place.
|
||||
- 244d24ebc4: Deprecates the `Location` type export from this package. Imports of the `Location` type should now be done from the `@backstage/catalog-client` package instead.
|
||||
- 7aeb491394: Deprecated `ENTITY_DEFAULT_NAMESPACE` constant in favour of `DEFAULT_NAMESPACE`.
|
||||
- 0d03e42a89: Deprecated `compareEntityToRef` due to low usage and provided value.
|
||||
- e8c6f9d282: Deprecated the `EntityRefContext` type which had limited use.
|
||||
- 7f21538c9e: Deprecated `JSONSchema` export type.
|
||||
- 20f3244102: Deprecates the following exports which all have very limited and internal use. `ENTITY_META_GENERATED_FIELDS`, `entityHasChanges`, `generateEntityEtag`, `generateEntityUid`, `generateUpdatedEntity`, `ENTITY_META_GENERATED_FIELDS`.
|
||||
- 27eccab216: Deprecates `EDIT_URL_ANNOTATION`, `LOCATION_ANNOTATION`, `ORIGIN_LOCATION_ANNOTATION`, `SOURCE_LOCATION_ANNOTATION`, `VIEW_URL_ANNOTATION`
|
||||
and replaces these constants all prefixed with ANNOTATION\_ `ANNOTATION_EDIT_URL`, `ANNOTATION_LOCATION`, `ANNOTATION_ORIGIN_LOCATION`, `ANNOTATION_SOURCE_LOCATION`, `ANNOTATION_VIEW_URL`
|
||||
- Updated dependencies
|
||||
- @backstage/errors@0.2.1
|
||||
- @backstage/config@0.1.14
|
||||
- @backstage/types@0.1.2
|
||||
|
||||
## 0.9.10
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -69,7 +69,14 @@ export class CommonValidatorFunctions {
|
||||
// @public @deprecated
|
||||
export function compareEntityToRef(
|
||||
entity: Entity,
|
||||
ref: EntityRef | EntityName,
|
||||
ref:
|
||||
| string
|
||||
| {
|
||||
kind?: string;
|
||||
namespace?: string;
|
||||
name: string;
|
||||
}
|
||||
| EntityName,
|
||||
context?: {
|
||||
defaultKind?: string;
|
||||
defaultNamespace?: string;
|
||||
@@ -212,7 +219,7 @@ export type EntityPolicy = {
|
||||
enforce(entity: Entity): Promise<Entity | undefined>;
|
||||
};
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export type EntityRef =
|
||||
| string
|
||||
| {
|
||||
@@ -231,13 +238,7 @@ export type EntityRefContext = {
|
||||
export type EntityRelation = {
|
||||
type: string;
|
||||
target: EntityName;
|
||||
};
|
||||
|
||||
// @public
|
||||
export type EntityRelationSpec = {
|
||||
source: EntityName;
|
||||
type: string;
|
||||
target: EntityName;
|
||||
targetRef: string;
|
||||
};
|
||||
|
||||
// @public
|
||||
@@ -311,7 +312,7 @@ export { GroupEntityV1alpha1 };
|
||||
// @public
|
||||
export const groupEntityV1alpha1Validator: KindValidator;
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export type JSONSchema = JSONSchema7 & {
|
||||
[key in string]?: JsonValue;
|
||||
};
|
||||
@@ -370,7 +371,7 @@ export { LocationEntityV1alpha1 };
|
||||
// @public
|
||||
export const locationEntityV1alpha1Validator: KindValidator;
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export type LocationSpec = {
|
||||
type: string;
|
||||
target: string;
|
||||
@@ -391,9 +392,15 @@ export class NoForeignRootFieldsEntityPolicy implements EntityPolicy {
|
||||
export const ORIGIN_LOCATION_ANNOTATION =
|
||||
'backstage.io/managed-by-origin-location';
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export function parseEntityName(
|
||||
ref: EntityRef,
|
||||
ref:
|
||||
| string
|
||||
| {
|
||||
kind?: string;
|
||||
namespace?: string;
|
||||
name: string;
|
||||
},
|
||||
context?: {
|
||||
defaultKind?: string;
|
||||
defaultNamespace?: string;
|
||||
@@ -402,7 +409,13 @@ export function parseEntityName(
|
||||
|
||||
// @public
|
||||
export function parseEntityRef(
|
||||
ref: EntityRef,
|
||||
ref:
|
||||
| string
|
||||
| {
|
||||
kind?: string;
|
||||
namespace?: string;
|
||||
name: string;
|
||||
},
|
||||
context?: {
|
||||
defaultKind: string;
|
||||
defaultNamespace: string;
|
||||
@@ -411,7 +424,13 @@ export function parseEntityRef(
|
||||
|
||||
// @public
|
||||
export function parseEntityRef(
|
||||
ref: EntityRef,
|
||||
ref:
|
||||
| string
|
||||
| {
|
||||
kind?: string;
|
||||
namespace?: string;
|
||||
name: string;
|
||||
},
|
||||
context?: {
|
||||
defaultKind: string;
|
||||
},
|
||||
@@ -423,7 +442,13 @@ export function parseEntityRef(
|
||||
|
||||
// @public
|
||||
export function parseEntityRef(
|
||||
ref: EntityRef,
|
||||
ref:
|
||||
| string
|
||||
| {
|
||||
kind?: string;
|
||||
namespace?: string;
|
||||
name: string;
|
||||
},
|
||||
context?: {
|
||||
defaultNamespace: string;
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/catalog-model",
|
||||
"description": "Types and validators that help describe the model of a Backstage Catalog",
|
||||
"version": "0.9.10",
|
||||
"version": "0.10.0",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"license": "Apache-2.0",
|
||||
@@ -13,6 +13,9 @@
|
||||
"types": "dist/index.d.ts",
|
||||
"alphaTypes": "dist/index.alpha.d.ts"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "common-library"
|
||||
},
|
||||
"homepage": "https://backstage.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -23,17 +26,17 @@
|
||||
"backstage"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "backstage-cli build --experimental-type-build",
|
||||
"lint": "backstage-cli lint",
|
||||
"test": "backstage-cli test",
|
||||
"prepack": "backstage-cli prepack",
|
||||
"postpack": "backstage-cli postpack",
|
||||
"clean": "backstage-cli clean"
|
||||
"build": "backstage-cli package build --experimental-type-build",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"prepack": "backstage-cli package prepack",
|
||||
"postpack": "backstage-cli package postpack",
|
||||
"clean": "backstage-cli package clean"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/config": "^0.1.13",
|
||||
"@backstage/errors": "^0.2.0",
|
||||
"@backstage/types": "^0.1.1",
|
||||
"@backstage/config": "^0.1.14",
|
||||
"@backstage/errors": "^0.2.1",
|
||||
"@backstage/types": "^0.1.2",
|
||||
"@types/json-schema": "^7.0.5",
|
||||
"ajv": "^7.0.3",
|
||||
"json-schema": "^0.4.0",
|
||||
@@ -41,7 +44,7 @@
|
||||
"uuid": "^8.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.13.2-next.0",
|
||||
"@backstage/cli": "^0.14.0",
|
||||
"@types/jest": "^26.0.7",
|
||||
"@types/lodash": "^4.14.151",
|
||||
"yaml": "^1.9.2"
|
||||
|
||||
@@ -116,6 +116,7 @@ export type EntityMeta = JsonObject & {
|
||||
* This field can not be set by the user at creation time, and the server
|
||||
* will reject an attempt to do so. The field will be populated in read
|
||||
* operations.
|
||||
* @deprecated field is not supported.
|
||||
*/
|
||||
generation?: number;
|
||||
|
||||
@@ -197,30 +198,15 @@ export type EntityRelation = {
|
||||
|
||||
/**
|
||||
* The target entity of this relation.
|
||||
*
|
||||
* @deprecated use targetRef instead
|
||||
*/
|
||||
target: EntityName;
|
||||
};
|
||||
|
||||
/**
|
||||
* Holds the relation data for entities.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type EntityRelationSpec = {
|
||||
/**
|
||||
* The source entity of this relation.
|
||||
*/
|
||||
source: EntityName;
|
||||
|
||||
/**
|
||||
* The type of the relation.
|
||||
* The entity ref of the target of this relation.
|
||||
*/
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* The target entity of this relation.
|
||||
*/
|
||||
target: EntityName;
|
||||
targetRef: string;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,7 +29,6 @@ export type {
|
||||
EntityLink,
|
||||
EntityMeta,
|
||||
EntityRelation,
|
||||
EntityRelationSpec,
|
||||
} from './Entity';
|
||||
export type { EntityEnvelope } from './EntityEnvelope';
|
||||
export type {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import yaml from 'yaml';
|
||||
import { ENTITY_DEFAULT_NAMESPACE } from '../constants';
|
||||
import { DEFAULT_NAMESPACE } from '../constants';
|
||||
import { DefaultNamespaceEntityPolicy } from './DefaultNamespaceEntityPolicy';
|
||||
|
||||
describe('DefaultNamespaceEntityPolicy', () => {
|
||||
@@ -57,7 +57,7 @@ describe('DefaultNamespaceEntityPolicy', () => {
|
||||
expect.objectContaining({
|
||||
metadata: {
|
||||
name: 'my-component-yay',
|
||||
namespace: ENTITY_DEFAULT_NAMESPACE,
|
||||
namespace: DEFAULT_NAMESPACE,
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import lodash from 'lodash';
|
||||
import { EntityPolicy } from './types';
|
||||
import { ENTITY_DEFAULT_NAMESPACE } from '../constants';
|
||||
import { DEFAULT_NAMESPACE } from '../constants';
|
||||
import { Entity } from '../Entity';
|
||||
|
||||
/**
|
||||
@@ -27,7 +27,7 @@ import { Entity } from '../Entity';
|
||||
export class DefaultNamespaceEntityPolicy implements EntityPolicy {
|
||||
private readonly namespace: string;
|
||||
|
||||
constructor(namespace: string = ENTITY_DEFAULT_NAMESPACE) {
|
||||
constructor(namespace: string = DEFAULT_NAMESPACE) {
|
||||
this.namespace = namespace;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ENTITY_DEFAULT_NAMESPACE } from './constants';
|
||||
import { DEFAULT_NAMESPACE } from './constants';
|
||||
import { Entity } from './Entity';
|
||||
import { compareEntityToRef, parseEntityName, parseEntityRef } from './ref';
|
||||
|
||||
@@ -29,7 +29,7 @@ describe('ref', () => {
|
||||
expect(() => parseEntityName('b/c')).toThrow(/kind/);
|
||||
expect(parseEntityName('a:c')).toEqual({
|
||||
kind: 'a',
|
||||
namespace: ENTITY_DEFAULT_NAMESPACE,
|
||||
namespace: DEFAULT_NAMESPACE,
|
||||
name: 'c',
|
||||
});
|
||||
expect(() => parseEntityName('c')).toThrow(/kind/);
|
||||
@@ -118,7 +118,7 @@ describe('ref', () => {
|
||||
).toEqual({ kind: 'a', namespace: 'y', name: 'c' });
|
||||
expect(parseEntityName('a:c', { defaultKind: 'x' })).toEqual({
|
||||
kind: 'a',
|
||||
namespace: ENTITY_DEFAULT_NAMESPACE,
|
||||
namespace: DEFAULT_NAMESPACE,
|
||||
name: 'c',
|
||||
});
|
||||
expect(
|
||||
@@ -126,7 +126,7 @@ describe('ref', () => {
|
||||
).toEqual({ kind: 'x', namespace: 'y', name: 'c' });
|
||||
expect(parseEntityName('c', { defaultKind: 'x' })).toEqual({
|
||||
kind: 'x',
|
||||
namespace: ENTITY_DEFAULT_NAMESPACE,
|
||||
namespace: DEFAULT_NAMESPACE,
|
||||
name: 'c',
|
||||
});
|
||||
});
|
||||
@@ -152,7 +152,7 @@ describe('ref', () => {
|
||||
).toEqual({ kind: 'a', namespace: 'y', name: 'c' });
|
||||
expect(
|
||||
parseEntityName({ kind: 'a', name: 'c' }, { defaultKind: 'x' }),
|
||||
).toEqual({ kind: 'a', namespace: ENTITY_DEFAULT_NAMESPACE, name: 'c' });
|
||||
).toEqual({ kind: 'a', namespace: DEFAULT_NAMESPACE, name: 'c' });
|
||||
expect(
|
||||
parseEntityName(
|
||||
{ name: 'c' },
|
||||
@@ -161,7 +161,7 @@ describe('ref', () => {
|
||||
).toEqual({ kind: 'x', namespace: 'y', name: 'c' });
|
||||
expect(parseEntityName({ name: 'c' }, { defaultKind: 'x' })).toEqual({
|
||||
kind: 'x',
|
||||
namespace: ENTITY_DEFAULT_NAMESPACE,
|
||||
namespace: DEFAULT_NAMESPACE,
|
||||
name: 'c',
|
||||
});
|
||||
// empty strings are errors, not defaults
|
||||
@@ -194,12 +194,12 @@ describe('ref', () => {
|
||||
});
|
||||
expect(parseEntityRef('a:c')).toEqual({
|
||||
kind: 'a',
|
||||
namespace: undefined,
|
||||
namespace: 'default',
|
||||
name: 'c',
|
||||
});
|
||||
expect(parseEntityRef('c')).toEqual({
|
||||
kind: undefined,
|
||||
namespace: undefined,
|
||||
namespace: 'default',
|
||||
name: 'c',
|
||||
});
|
||||
});
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { EntityName, EntityRef } from '../types';
|
||||
import { ENTITY_DEFAULT_NAMESPACE } from './constants';
|
||||
import { DEFAULT_NAMESPACE } from './constants';
|
||||
import { EntityName } from '../types';
|
||||
import { Entity } from './Entity';
|
||||
|
||||
function parseRefString(ref: string): {
|
||||
@@ -48,7 +48,7 @@ function parseRefString(ref: string): {
|
||||
export function getEntityName(entity: Entity): EntityName {
|
||||
return {
|
||||
kind: entity.kind,
|
||||
namespace: entity.metadata.namespace || ENTITY_DEFAULT_NAMESPACE,
|
||||
namespace: entity.metadata.namespace || DEFAULT_NAMESPACE,
|
||||
name: entity.metadata.name,
|
||||
};
|
||||
}
|
||||
@@ -76,13 +76,14 @@ export type EntityRefContext = {
|
||||
* otherwise specified as part of the options, and will throw an error if no
|
||||
* kind was specified in the input reference and no default kind was given.
|
||||
*
|
||||
* @deprecated Please use parseEntityRef instead
|
||||
* @public
|
||||
* @param ref - The reference to parse
|
||||
* @param context - The context of defaults that the parsing happens within
|
||||
* @returns A complete entity name
|
||||
*/
|
||||
export function parseEntityName(
|
||||
ref: EntityRef,
|
||||
ref: string | { kind?: string; namespace?: string; name: string },
|
||||
context: {
|
||||
/** The default kind, if none is given in the reference */
|
||||
defaultKind?: string;
|
||||
@@ -91,7 +92,7 @@ export function parseEntityName(
|
||||
} = {},
|
||||
): EntityName {
|
||||
const { kind, namespace, name } = parseEntityRef(ref, {
|
||||
defaultNamespace: ENTITY_DEFAULT_NAMESPACE,
|
||||
defaultNamespace: DEFAULT_NAMESPACE,
|
||||
...context,
|
||||
});
|
||||
|
||||
@@ -119,7 +120,7 @@ export function parseEntityName(
|
||||
* @returns The compound form of the reference
|
||||
*/
|
||||
export function parseEntityRef(
|
||||
ref: EntityRef,
|
||||
ref: string | { kind?: string; namespace?: string; name: string },
|
||||
context?: { defaultKind: string; defaultNamespace: string },
|
||||
): EntityName;
|
||||
/**
|
||||
@@ -128,7 +129,7 @@ export function parseEntityRef(
|
||||
* @public
|
||||
*/
|
||||
export function parseEntityRef(
|
||||
ref: EntityRef,
|
||||
ref: string | { kind?: string; namespace?: string; name: string },
|
||||
context?: { defaultKind: string },
|
||||
): {
|
||||
kind: string;
|
||||
@@ -141,7 +142,7 @@ export function parseEntityRef(
|
||||
* @public
|
||||
*/
|
||||
export function parseEntityRef(
|
||||
ref: EntityRef,
|
||||
ref: string | { kind?: string; namespace?: string; name: string },
|
||||
context?: { defaultNamespace: string },
|
||||
): {
|
||||
kind?: string;
|
||||
@@ -154,7 +155,7 @@ export function parseEntityRef(
|
||||
* @public
|
||||
*/
|
||||
export function parseEntityRef(
|
||||
ref: EntityRef,
|
||||
ref: string | { kind?: string; namespace?: string; name: string },
|
||||
context: {
|
||||
/** The default kind, if none is given in the reference */
|
||||
defaultKind?: string;
|
||||
@@ -170,11 +171,13 @@ export function parseEntityRef(
|
||||
throw new Error(`Entity reference must not be empty`);
|
||||
}
|
||||
|
||||
const defaultNamespace = context.defaultNamespace || DEFAULT_NAMESPACE;
|
||||
|
||||
if (typeof ref === 'string') {
|
||||
const parsed = parseRefString(ref);
|
||||
return {
|
||||
kind: parsed.kind ?? context.defaultKind,
|
||||
namespace: parsed.namespace ?? context.defaultNamespace,
|
||||
namespace: parsed.namespace ?? defaultNamespace,
|
||||
name: parsed.name,
|
||||
};
|
||||
}
|
||||
@@ -190,7 +193,7 @@ export function parseEntityRef(
|
||||
|
||||
return {
|
||||
kind: kind ?? context.defaultKind,
|
||||
namespace: namespace ?? context.defaultNamespace,
|
||||
namespace: namespace ?? defaultNamespace,
|
||||
name,
|
||||
};
|
||||
}
|
||||
@@ -218,11 +221,11 @@ export function stringifyEntityRef(
|
||||
|
||||
if ('metadata' in ref) {
|
||||
kind = ref.kind;
|
||||
namespace = ref.metadata.namespace ?? ENTITY_DEFAULT_NAMESPACE;
|
||||
namespace = ref.metadata.namespace ?? DEFAULT_NAMESPACE;
|
||||
name = ref.metadata.name;
|
||||
} else {
|
||||
kind = ref.kind;
|
||||
namespace = ref.namespace ?? ENTITY_DEFAULT_NAMESPACE;
|
||||
namespace = ref.namespace ?? DEFAULT_NAMESPACE;
|
||||
name = ref.name;
|
||||
}
|
||||
|
||||
@@ -249,7 +252,10 @@ export function stringifyEntityRef(
|
||||
*/
|
||||
export function compareEntityToRef(
|
||||
entity: Entity,
|
||||
ref: EntityRef | EntityName,
|
||||
ref:
|
||||
| string
|
||||
| { kind?: string; namespace?: string; name: string }
|
||||
| EntityName,
|
||||
context?: {
|
||||
/** The default kind, if none is given in the reference */
|
||||
defaultKind?: string;
|
||||
@@ -258,7 +264,7 @@ export function compareEntityToRef(
|
||||
},
|
||||
): boolean {
|
||||
const entityKind = entity.kind;
|
||||
const entityNamespace = entity.metadata.namespace || ENTITY_DEFAULT_NAMESPACE;
|
||||
const entityNamespace = entity.metadata.namespace || DEFAULT_NAMESPACE;
|
||||
const entityName = entity.metadata.name;
|
||||
|
||||
let refKind: string | undefined;
|
||||
@@ -268,12 +274,12 @@ export function compareEntityToRef(
|
||||
const parsed = parseRefString(ref);
|
||||
refKind = parsed.kind || context?.defaultKind;
|
||||
refNamespace =
|
||||
parsed.namespace || context?.defaultNamespace || ENTITY_DEFAULT_NAMESPACE;
|
||||
parsed.namespace || context?.defaultNamespace || DEFAULT_NAMESPACE;
|
||||
refName = parsed.name;
|
||||
} else {
|
||||
refKind = ref.kind || context?.defaultKind;
|
||||
refNamespace =
|
||||
ref.namespace || context?.defaultNamespace || ENTITY_DEFAULT_NAMESPACE;
|
||||
ref.namespace || context?.defaultNamespace || DEFAULT_NAMESPACE;
|
||||
refName = ref.name;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,9 +21,6 @@ import { ANNOTATION_LOCATION } from './annotation';
|
||||
/**
|
||||
* Parses a string form location reference.
|
||||
*
|
||||
* Note that the return type is not `LocationSpec`, because we do not want to
|
||||
* conflate the string form with the additional properties of that type.
|
||||
*
|
||||
* @public
|
||||
* @param ref - A string-form location reference, e.g. `'url:https://host'`
|
||||
* @returns A location reference, e.g. `{ type: 'url', target: 'https://host' }`
|
||||
@@ -36,11 +33,6 @@ export function parseLocationReference(ref: string) {
|
||||
/**
|
||||
* Parses a string form location reference.
|
||||
*
|
||||
* @remarks
|
||||
*
|
||||
* Note that the return type is not `LocationSpec`, because we do not want to
|
||||
* conflate the string form with the additional properties of that type.
|
||||
*
|
||||
* @public
|
||||
* @param ref - A string-form location ref, e.g. `'url:https://host'`
|
||||
* @returns A location ref, e.g. `{ type: 'url', target: 'https://host' }`
|
||||
@@ -83,11 +75,6 @@ export function parseLocationRef(ref: string): {
|
||||
/**
|
||||
* Turns a location reference into its string form.
|
||||
*
|
||||
* @remarks
|
||||
*
|
||||
* Note that the input type is not `LocationSpec`, because we do not want to
|
||||
* conflate the string form with the additional properties of that type.
|
||||
*
|
||||
* @public
|
||||
* @param ref - A location reference, e.g. `{ type: 'url', target: 'https://host' }`
|
||||
* @returns A string-form location reference, e.g. `'url:https://host'`
|
||||
@@ -103,11 +90,6 @@ export function stringifyLocationReference(ref: {
|
||||
/**
|
||||
* Turns a location ref into its string form.
|
||||
*
|
||||
* @remarks
|
||||
*
|
||||
* Note that the input type is not `LocationSpec`, because we do not want to
|
||||
* conflate the string form with the additional properties of that type.
|
||||
*
|
||||
* @public
|
||||
* @param ref - A location ref, e.g. `{ type: 'url', target: 'https://host' }`
|
||||
* @returns A string-form location ref, e.g. `'url:https://host'`
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
* default value: 'required'.
|
||||
*
|
||||
* @public
|
||||
* @deprecated Import from `@backstage/plugin-catalog-backend` instead.
|
||||
*/
|
||||
export type LocationSpec = {
|
||||
type: string;
|
||||
|
||||
@@ -38,7 +38,8 @@
|
||||
"type": "integer",
|
||||
"description": "A positive nonzero number that indicates the current generation of data for this entity; the value is incremented each time the spec changes. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations.",
|
||||
"examples": [1],
|
||||
"minimum": 1
|
||||
"minimum": 1,
|
||||
"deprecated": true
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
|
||||
@@ -21,6 +21,7 @@ import { JSONSchema7 } from 'json-schema';
|
||||
* JSONSchema extendable by arbitrary JSON attributes
|
||||
*
|
||||
* @public
|
||||
* @deprecated use JSONSchema7 from the json-schema package instead.
|
||||
*/
|
||||
export type JSONSchema = JSONSchema7 & { [key in string]?: JsonValue };
|
||||
|
||||
@@ -39,6 +40,7 @@ export type EntityName = {
|
||||
* A reference by name to an entity, either as a compact string representation,
|
||||
* or as a compound reference structure.
|
||||
*
|
||||
* @deprecated Please use string directly, or EntityName (depending on what you actually need)
|
||||
* @remarks
|
||||
*
|
||||
* The string representation is on the form `[<kind>:][<namespace>/]<name>`.
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
# @backstage/cli-common
|
||||
|
||||
## 0.1.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Fix for the previous release with missing type declarations.
|
||||
|
||||
## 0.1.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- c77c5c7eb6: Added `backstage.role` to `package.json`
|
||||
|
||||
## 0.1.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/cli-common",
|
||||
"description": "Common functionality used by cli, backend, and create-app",
|
||||
"version": "0.1.6",
|
||||
"version": "0.1.7",
|
||||
"private": false,
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
@@ -10,6 +10,9 @@
|
||||
"main": "dist/index.cjs.js",
|
||||
"types": "dist/index.d.ts"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "node-library"
|
||||
},
|
||||
"homepage": "https://backstage.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -21,12 +24,13 @@
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
"build": "backstage-cli build --outputs cjs,types",
|
||||
"lint": "backstage-cli lint",
|
||||
"test": "backstage-cli test",
|
||||
"prepack": "backstage-cli prepack",
|
||||
"postpack": "backstage-cli postpack",
|
||||
"clean": "backstage-cli clean"
|
||||
"build": "backstage-cli package build",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"prepack": "backstage-cli package prepack",
|
||||
"postpack": "backstage-cli package postpack",
|
||||
"clean": "backstage-cli package clean",
|
||||
"start": "backstage-cli package start"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^26.0.7",
|
||||
|
||||
@@ -1,5 +1,43 @@
|
||||
# @backstage/cli
|
||||
|
||||
## 0.14.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 1fc0cd3896: Bumped Webpack and Rollup `svgr` dependencies and updated the AST template for `.icon.svg` modules. This means that SVG icon imports are now using SVGO v2.
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 0b74c72987: Added a new experimental and hidden `backstage-cli repo lint` command that can be used to lint all packages in the project, similar to `lerna run lint`.
|
||||
- 532dae9c4c: The `versions:bump --release next` command is updated to compare the `main` and `next` release manifests and prefer the latest.
|
||||
- 1ed305728b: Bump `node-fetch` to version 2.6.7 and `cross-fetch` to version 3.1.5
|
||||
- c77c5c7eb6: Added `backstage.role` to `package.json`
|
||||
- 22862486de: The `versions:bump` command now filters out `npm_` environment configuration when running `yarn install`. This has the effect of allowing it to consider local configuration files within the repository, which is the behavior that one would expect.
|
||||
- 22862486de: The `versions:bump` command now also considers the root `package.json` when searching for updates. It has also received updates to its output, including a link the [Backstage upgrade helper](https://backstage.github.io/upgrade-helper) and silenced `yarn install` output.
|
||||
- 7410e12268: Several changes were made to the new experimental package roles system. Unless you have been experimenting with using this new system, these changes have no affect on your project.
|
||||
|
||||
Renamed the `backstage-cli migrate package-role` command to `backstage-cli migrate package-roles`.
|
||||
|
||||
Updated the package role definitions by renaming `app` to `frontend`, `plugin-frontend` to `frontend-plugin`, `plugin-frontend-module` to `frontend-plugin-module`, `plugin-backend` to `backend-plugin`, and `plugin-backend-module` to `backend-plugin-module`
|
||||
|
||||
The `backstage-cli migrate package-scripts` received several tweaks to make it more accurate. It now tries to maintain existing script arguments, like `--config` parameters for `build` and `start` scripts.
|
||||
|
||||
The `script` command category has been renamed to `package`.
|
||||
|
||||
The `backstage-cli package build` command set an incorrect target directory for `app` and `backend` packages, which has been fixed.
|
||||
|
||||
The `backend:bundle` and `repo build` command for the `backend` role was previously ignoring building of bundled packages that had migrated to use package roles and the standard build script, this has now been fixed.
|
||||
|
||||
- c6bbafb516: Updated the default [sucrase](https://github.com/alangpierce/sucrase)-based Jest transform to include source maps if the environment variable `ENABLE_SOURCE_MAPS` is non-empty. This can be used to better support editor test debugging integrations.
|
||||
- 7410e12268: The `test` command now automatically adds `--passWithNoTests` to the Jest invocation. To revert this behavior, pass `--passWithNoTests=false` or `--no-passWithNoTests`.
|
||||
- Updated dependencies
|
||||
- @backstage/config-loader@0.9.4
|
||||
- @backstage/errors@0.2.1
|
||||
- @backstage/release-manifests@0.0.2
|
||||
- @backstage/cli-common@0.1.7
|
||||
- @backstage/config@0.1.14
|
||||
- @backstage/types@0.1.2
|
||||
|
||||
## 0.13.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -55,8 +55,8 @@ module.exports = {
|
||||
devDependencies: [
|
||||
'**/*.test.*',
|
||||
'**/*.stories.*',
|
||||
'src/setupTests.*',
|
||||
'dev/**',
|
||||
'**/src/setupTests.*',
|
||||
'**/dev/**',
|
||||
],
|
||||
optionalDependencies: true,
|
||||
peerDependencies: true,
|
||||
|
||||
@@ -175,7 +175,10 @@ async function getRootConfig() {
|
||||
// script to determine whether a given package should be tested
|
||||
const packageData = await fs.readJson(packagePath);
|
||||
const testScript = packageData.scripts && packageData.scripts.test;
|
||||
if (testScript && testScript.includes('backstage-cli test')) {
|
||||
const isSupportedTestScript =
|
||||
testScript?.includes('backstage-cli test') ||
|
||||
testScript?.includes('backstage-cli package test');
|
||||
if (testScript && isSupportedTestScript) {
|
||||
return await getProjectConfig(projectPath, packageData.name);
|
||||
}
|
||||
|
||||
|
||||
+28
-24
@@ -1,11 +1,14 @@
|
||||
{
|
||||
"name": "@backstage/cli",
|
||||
"description": "CLI for developing Backstage plugins and apps",
|
||||
"version": "0.13.2",
|
||||
"version": "0.14.0",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "cli"
|
||||
},
|
||||
"homepage": "https://backstage.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -18,23 +21,23 @@
|
||||
"license": "Apache-2.0",
|
||||
"main": "dist/index.cjs.js",
|
||||
"scripts": {
|
||||
"build": "backstage-cli build --outputs cjs",
|
||||
"lint": "backstage-cli lint",
|
||||
"test": "backstage-cli test",
|
||||
"clean": "backstage-cli clean",
|
||||
"build": "backstage-cli package build",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"clean": "backstage-cli package clean",
|
||||
"start": "nodemon --"
|
||||
},
|
||||
"bin": {
|
||||
"backstage-cli": "bin/backstage-cli"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/cli-common": "^0.1.6",
|
||||
"@backstage/config": "^0.1.13",
|
||||
"@backstage/config-loader": "^0.9.3",
|
||||
"@backstage/errors": "^0.2.0",
|
||||
"@backstage/release-manifests": "^0.0.1",
|
||||
"@backstage/types": "^0.1.1",
|
||||
"@hot-loader/react-dom": "^16.13.0",
|
||||
"@backstage/cli-common": "^0.1.7",
|
||||
"@backstage/config": "^0.1.14",
|
||||
"@backstage/config-loader": "^0.9.4",
|
||||
"@backstage/errors": "^0.2.1",
|
||||
"@backstage/release-manifests": "^0.0.2",
|
||||
"@backstage/types": "^0.1.2",
|
||||
"@hot-loader/react-dom": "^17.0.2",
|
||||
"@manypkg/get-packages": "^1.1.3",
|
||||
"@octokit/request": "^5.4.12",
|
||||
"@rollup/plugin-commonjs": "^21.0.1",
|
||||
@@ -48,8 +51,8 @@
|
||||
"@sucrase/webpack-loader": "^2.0.0",
|
||||
"@svgr/plugin-jsx": "6.2.x",
|
||||
"@svgr/plugin-svgo": "6.2.x",
|
||||
"@svgr/rollup": "5.5.x",
|
||||
"@svgr/webpack": "5.5.x",
|
||||
"@svgr/rollup": "6.2.x",
|
||||
"@svgr/webpack": "6.2.x",
|
||||
"@types/webpack-env": "^1.15.2",
|
||||
"@typescript-eslint/eslint-plugin": "^5.9.0",
|
||||
"@typescript-eslint/parser": "^5.9.0",
|
||||
@@ -85,7 +88,7 @@
|
||||
"json-schema": "^0.4.0",
|
||||
"jest-transform-yaml": "^1.0.0",
|
||||
"lodash": "^4.17.21",
|
||||
"minimatch": "3.0.4",
|
||||
"minimatch": "5.0.0",
|
||||
"mini-css-extract-plugin": "^2.4.2",
|
||||
"npm-packlist": "^3.0.0",
|
||||
"node-libs-browser": "^2.2.1",
|
||||
@@ -118,14 +121,14 @@
|
||||
"zod": "^3.11.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/backend-common": "^0.10.7",
|
||||
"@backstage/config": "^0.1.13",
|
||||
"@backstage/core-components": "^0.8.8",
|
||||
"@backstage/core-plugin-api": "^0.6.0",
|
||||
"@backstage/core-app-api": "^0.5.2",
|
||||
"@backstage/dev-utils": "^0.2.21",
|
||||
"@backstage/test-utils": "^0.2.4",
|
||||
"@backstage/theme": "^0.2.14",
|
||||
"@backstage/backend-common": "^0.10.8",
|
||||
"@backstage/config": "^0.1.14",
|
||||
"@backstage/core-components": "^0.8.9",
|
||||
"@backstage/core-plugin-api": "^0.6.1",
|
||||
"@backstage/core-app-api": "^0.5.3",
|
||||
"@backstage/dev-utils": "^0.2.22",
|
||||
"@backstage/test-utils": "^0.2.5",
|
||||
"@backstage/theme": "^0.2.15",
|
||||
"@types/diff": "^5.0.0",
|
||||
"@types/express": "^4.17.6",
|
||||
"@types/fs-extra": "^9.0.1",
|
||||
@@ -137,7 +140,8 @@
|
||||
"@types/npm-packlist": "^1.1.2",
|
||||
"@types/recursive-readdir": "^2.2.0",
|
||||
"@types/rollup-plugin-peer-deps-external": "^2.2.0",
|
||||
"@types/rollup-plugin-postcss": "^2.0.0",
|
||||
"@types/rollup-plugin-postcss": "^3.1.4",
|
||||
"@types/svgo": "^2.6.2",
|
||||
"@types/tar": "^6.1.1",
|
||||
"@types/terser-webpack-plugin": "^5.0.4",
|
||||
"@types/yarnpkg__lockfile": "^1.1.4",
|
||||
|
||||
@@ -35,7 +35,10 @@ export async function buildBackend(options: BuildBackendOptions) {
|
||||
const pkg = await fs.readJson(resolvePath(targetDir, 'package.json'));
|
||||
|
||||
// We build the target package without generating type declarations.
|
||||
await buildPackage({ outputs: new Set([Output.cjs]) });
|
||||
await buildPackage({
|
||||
targetDir: options.targetDir,
|
||||
outputs: new Set([Output.cjs]),
|
||||
});
|
||||
|
||||
const tmpDir = await fs.mkdtemp(resolvePath(os.tmpdir(), 'backstage-bundle'));
|
||||
try {
|
||||
@@ -49,19 +52,20 @@ export async function buildBackend(options: BuildBackendOptions) {
|
||||
|
||||
// We built the target backend package using the regular build process, but the result of
|
||||
// that has now been packed into the dist workspace, so clean up the dist dir.
|
||||
await fs.remove(targetDir);
|
||||
await fs.mkdir(targetDir);
|
||||
const distDir = resolvePath(targetDir, 'dist');
|
||||
await fs.remove(distDir);
|
||||
await fs.mkdir(distDir);
|
||||
|
||||
// Move out skeleton.tar.gz before we create the main bundle, no point having that included up twice.
|
||||
await fs.move(
|
||||
resolvePath(tmpDir, SKELETON_FILE),
|
||||
resolvePath(targetDir, SKELETON_FILE),
|
||||
resolvePath(distDir, SKELETON_FILE),
|
||||
);
|
||||
|
||||
// Create main bundle.tar.gz, with some tweaks to make it more likely hit Docker build cache.
|
||||
await tar.create(
|
||||
{
|
||||
file: resolvePath(targetDir, BUNDLE_FILE),
|
||||
file: resolvePath(distDir, BUNDLE_FILE),
|
||||
cwd: tmpDir,
|
||||
portable: true,
|
||||
noMtime: true,
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ interface BuildAppOptions {
|
||||
configPaths: string[];
|
||||
}
|
||||
|
||||
export async function buildApp(options: BuildAppOptions) {
|
||||
export async function buildFrontend(options: BuildAppOptions) {
|
||||
const { targetDir, writeStats, configPaths } = options;
|
||||
const { name } = await fs.readJson(resolvePath(targetDir, 'package.json'));
|
||||
await buildBundle({
|
||||
@@ -18,22 +18,22 @@ import { Command } from 'commander';
|
||||
import { buildPackage, Output } from '../../lib/builder';
|
||||
import { findRoleFromCommand, getRoleInfo } from '../../lib/role';
|
||||
import { paths } from '../../lib/paths';
|
||||
import { buildApp } from './buildApp';
|
||||
import { buildFrontend } from './buildFrontend';
|
||||
import { buildBackend } from './buildBackend';
|
||||
|
||||
export async function command(cmd: Command): Promise<void> {
|
||||
const role = await findRoleFromCommand(cmd);
|
||||
|
||||
if (role === 'app') {
|
||||
return buildApp({
|
||||
targetDir: paths.resolveTarget('dist'),
|
||||
if (role === 'frontend') {
|
||||
return buildFrontend({
|
||||
targetDir: paths.targetDir,
|
||||
configPaths: cmd.config as string[],
|
||||
writeStats: Boolean(cmd.stats),
|
||||
});
|
||||
}
|
||||
if (role === 'backend') {
|
||||
return buildBackend({
|
||||
targetDir: paths.resolveTarget('dist'),
|
||||
targetDir: paths.targetDir,
|
||||
skipBuildDependencies: Boolean(cmd.skipBuildDependencies),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -61,14 +61,17 @@ export function registerRepoCommand(program: CommanderStatic) {
|
||||
|
||||
export function registerScriptCommand(program: CommanderStatic) {
|
||||
const command = program
|
||||
.command('script [command]', { hidden: true })
|
||||
.description('Lifecycle scripts for Backstage packages [EXPERIMENTAL]');
|
||||
.command('package [command]', { hidden: true })
|
||||
.description('Lifecycle scripts for individual packages [EXPERIMENTAL]');
|
||||
|
||||
command
|
||||
.command('start')
|
||||
.description('Start a package for local development')
|
||||
.option(...configOption)
|
||||
.option('--role <name>', 'Run the command with an explicit package role')
|
||||
.option(
|
||||
'--role <name>',
|
||||
'Run the command with an explicit package role [EXPERIMENTAL]',
|
||||
)
|
||||
.option('--check', 'Enable type checking and linting if available')
|
||||
.option('--inspect', 'Enable debugger in Node.js environments')
|
||||
.option(
|
||||
@@ -80,6 +83,10 @@ export function registerScriptCommand(program: CommanderStatic) {
|
||||
command
|
||||
.command('build')
|
||||
.description('Build a package for production deployment or publishing')
|
||||
.option(
|
||||
'--role <name>',
|
||||
'Run the command with an explicit package role [EXPERIMENTAL]',
|
||||
)
|
||||
.option(
|
||||
'--minify',
|
||||
'Minify the generated code. Does not apply to app or backend packages.',
|
||||
@@ -104,7 +111,7 @@ export function registerScriptCommand(program: CommanderStatic) {
|
||||
)
|
||||
.action(lazy(() => import('./build').then(m => m.command)));
|
||||
|
||||
program
|
||||
command
|
||||
.command('lint')
|
||||
.option(
|
||||
'--format <format>',
|
||||
@@ -115,7 +122,7 @@ export function registerScriptCommand(program: CommanderStatic) {
|
||||
.description('Lint a package')
|
||||
.action(lazy(() => import('./lint').then(m => m.default)));
|
||||
|
||||
program
|
||||
command
|
||||
.command('test')
|
||||
.allowUnknownOption(true) // Allows the command to run, but we still need to parse raw args
|
||||
.helpOption(', --backstage-cli-help') // Let Jest handle help
|
||||
@@ -144,7 +151,7 @@ export function registerMigrateCommand(program: CommanderStatic) {
|
||||
.description('Migration utilities [EXPERIMENTAL]');
|
||||
|
||||
command
|
||||
.command('package-role')
|
||||
.command('package-roles')
|
||||
.description(`Add package role field to packages that don't have it`)
|
||||
.action(lazy(() => import('./migrate/packageRole').then(m => m.default)));
|
||||
|
||||
@@ -157,7 +164,7 @@ export function registerMigrateCommand(program: CommanderStatic) {
|
||||
}
|
||||
|
||||
export function registerCommands(program: CommanderStatic) {
|
||||
// TODO(Rugvip): Deprecate in favor of script variant
|
||||
// TODO(Rugvip): Deprecate in favor of package variant
|
||||
program
|
||||
.command('app:build')
|
||||
.description('Build an app for a production release')
|
||||
@@ -165,7 +172,7 @@ export function registerCommands(program: CommanderStatic) {
|
||||
.option(...configOption)
|
||||
.action(lazy(() => import('./app/build').then(m => m.default)));
|
||||
|
||||
// TODO(Rugvip): Deprecate in favor of script variant
|
||||
// TODO(Rugvip): Deprecate in favor of package variant
|
||||
program
|
||||
.command('app:serve')
|
||||
.description('Serve an app for local development')
|
||||
@@ -173,7 +180,7 @@ export function registerCommands(program: CommanderStatic) {
|
||||
.option(...configOption)
|
||||
.action(lazy(() => import('./app/serve').then(m => m.default)));
|
||||
|
||||
// TODO(Rugvip): Deprecate in favor of script variant
|
||||
// TODO(Rugvip): Deprecate in favor of package variant
|
||||
program
|
||||
.command('backend:build')
|
||||
.description('Build a backend plugin')
|
||||
@@ -181,7 +188,7 @@ export function registerCommands(program: CommanderStatic) {
|
||||
.option('--experimental-type-build', 'Enable experimental type build')
|
||||
.action(lazy(() => import('./backend/build').then(m => m.default)));
|
||||
|
||||
// TODO(Rugvip): Deprecate in favor of script variant
|
||||
// TODO(Rugvip): Deprecate in favor of package variant
|
||||
program
|
||||
.command('backend:bundle')
|
||||
.description('Bundle the backend into a deployment archive')
|
||||
@@ -191,7 +198,7 @@ export function registerCommands(program: CommanderStatic) {
|
||||
)
|
||||
.action(lazy(() => import('./backend/bundle').then(m => m.default)));
|
||||
|
||||
// TODO(Rugvip): Deprecate in favor of script variant
|
||||
// TODO(Rugvip): Deprecate in favor of package variant
|
||||
program
|
||||
.command('backend:dev')
|
||||
.description('Start local development server with HMR for the backend')
|
||||
@@ -240,7 +247,7 @@ export function registerCommands(program: CommanderStatic) {
|
||||
lazy(() => import('./create-plugin/createPlugin').then(m => m.default)),
|
||||
);
|
||||
|
||||
// TODO(Rugvip): Deprecate in favor of script variant
|
||||
// TODO(Rugvip): Deprecate in favor of package variant
|
||||
program
|
||||
.command('plugin:build')
|
||||
.description('Build a plugin')
|
||||
@@ -248,7 +255,7 @@ export function registerCommands(program: CommanderStatic) {
|
||||
.option('--experimental-type-build', 'Enable experimental type build')
|
||||
.action(lazy(() => import('./plugin/build').then(m => m.default)));
|
||||
|
||||
// TODO(Rugvip): Deprecate in favor of script variant
|
||||
// TODO(Rugvip): Deprecate in favor of package variant
|
||||
program
|
||||
.command('plugin:serve')
|
||||
.description('Serves the dev/ folder of a plugin')
|
||||
@@ -263,7 +270,7 @@ export function registerCommands(program: CommanderStatic) {
|
||||
.description('Diff an existing plugin with the creation template')
|
||||
.action(lazy(() => import('./plugin/diff').then(m => m.default)));
|
||||
|
||||
// TODO(Rugvip): Deprecate in favor of script variant
|
||||
// TODO(Rugvip): Deprecate in favor of package variant
|
||||
program
|
||||
.command('build')
|
||||
.description('Build a package for publishing')
|
||||
@@ -272,7 +279,7 @@ export function registerCommands(program: CommanderStatic) {
|
||||
.option('--experimental-type-build', 'Enable experimental type build')
|
||||
.action(lazy(() => import('./oldBuild').then(m => m.default)));
|
||||
|
||||
// TODO(Rugvip): Deprecate in favor of script variant
|
||||
// TODO(Rugvip): Deprecate in favor of package variant
|
||||
program
|
||||
.command('lint')
|
||||
.option(
|
||||
@@ -284,7 +291,7 @@ export function registerCommands(program: CommanderStatic) {
|
||||
.description('Lint a package')
|
||||
.action(lazy(() => import('./lint').then(m => m.default)));
|
||||
|
||||
// TODO(Rugvip): Deprecate in favor of script variant
|
||||
// TODO(Rugvip): Deprecate in favor of package variant
|
||||
program
|
||||
.command('test')
|
||||
.allowUnknownOption(true) // Allows the command to run, but we still need to parse raw args
|
||||
@@ -370,19 +377,19 @@ export function registerCommands(program: CommanderStatic) {
|
||||
.description('Check Backstage package versioning')
|
||||
.action(lazy(() => import('./versions/lint').then(m => m.default)));
|
||||
|
||||
// TODO(Rugvip): Deprecate in favor of script variant
|
||||
// TODO(Rugvip): Deprecate in favor of package variant
|
||||
program
|
||||
.command('prepack')
|
||||
.description('Prepares a package for packaging before publishing')
|
||||
.action(lazy(() => import('./pack').then(m => m.pre)));
|
||||
|
||||
// TODO(Rugvip): Deprecate in favor of script variant
|
||||
// TODO(Rugvip): Deprecate in favor of package variant
|
||||
program
|
||||
.command('postpack')
|
||||
.description('Restores the changes made by the prepack command')
|
||||
.action(lazy(() => import('./pack').then(m => m.post)));
|
||||
|
||||
// TODO(Rugvip): Deprecate in favor of script variant
|
||||
// TODO(Rugvip): Deprecate in favor of package variant
|
||||
program
|
||||
.command('clean')
|
||||
.description('Delete cache directories')
|
||||
|
||||
@@ -19,6 +19,8 @@ import { resolve as resolvePath } from 'path';
|
||||
import { PackageGraph } from '../../lib/monorepo';
|
||||
import { getRoleFromPackage, getRoleInfo, PackageRole } from '../../lib/role';
|
||||
|
||||
const configArgPattern = /--config[=\s][^\s$]+/;
|
||||
|
||||
const noStartRoles: PackageRole[] = ['cli', 'common-library'];
|
||||
|
||||
export async function command() {
|
||||
@@ -33,17 +35,52 @@ export async function command() {
|
||||
|
||||
const roleInfo = getRoleInfo(role);
|
||||
const hasStart = !noStartRoles.includes(role);
|
||||
const isBundled = roleInfo.output.includes('bundle');
|
||||
const needsPack = !(roleInfo.output.includes('bundle') || role === 'cli');
|
||||
const scripts = packageJson.scripts ?? {};
|
||||
|
||||
const startCmd = ['start'];
|
||||
if (scripts.start?.includes('--check')) {
|
||||
startCmd.push('--check');
|
||||
}
|
||||
if (scripts.start?.includes('--config')) {
|
||||
startCmd.push(...(scripts.start.match(configArgPattern) ?? []));
|
||||
}
|
||||
|
||||
const buildCmd = ['build'];
|
||||
if (scripts.build?.includes('--minify')) {
|
||||
buildCmd.push('--minify');
|
||||
}
|
||||
if (scripts.build?.includes('--experimental-type-build')) {
|
||||
buildCmd.push('--experimental-type-build');
|
||||
}
|
||||
if (scripts.build?.includes('--config')) {
|
||||
buildCmd.push(...(scripts.build.match(configArgPattern) ?? []));
|
||||
}
|
||||
|
||||
// For test scripts we keep all existing flags except for --passWithNoTests, since that's now default
|
||||
const testCmd = ['test'];
|
||||
if (scripts.test?.startsWith('backstage-cli test')) {
|
||||
const args = scripts.test
|
||||
.slice('backstage-cli test'.length)
|
||||
.split(' ')
|
||||
.filter(Boolean);
|
||||
if (args.includes('--passWithNoTests')) {
|
||||
args.splice(args.indexOf('--passWithNoTests'), 1);
|
||||
}
|
||||
testCmd.push(...args);
|
||||
}
|
||||
|
||||
const expectedScripts = {
|
||||
...(hasStart && { start: 'backstage-cli script start' }),
|
||||
build: 'backstage-cli script build',
|
||||
lint: 'backstage-cli script lint',
|
||||
test: 'backstage-cli script test',
|
||||
clean: 'backstage-cli script clean',
|
||||
...(!isBundled && {
|
||||
postpack: 'backstage-cli script postpack',
|
||||
prepack: 'backstage-cli script prepack',
|
||||
...(hasStart && {
|
||||
start: `backstage-cli package ${startCmd.join(' ')}`,
|
||||
}),
|
||||
build: `backstage-cli package ${buildCmd.join(' ')}`,
|
||||
lint: 'backstage-cli package lint',
|
||||
test: `backstage-cli package ${testCmd.join(' ')}`,
|
||||
clean: 'backstage-cli package clean',
|
||||
...(needsPack && {
|
||||
postpack: 'backstage-cli package postpack',
|
||||
prepack: 'backstage-cli package prepack',
|
||||
}),
|
||||
};
|
||||
|
||||
@@ -52,7 +89,12 @@ export async function command() {
|
||||
(packageJson.scripts = packageJson.scripts || {});
|
||||
|
||||
for (const [name, value] of Object.entries(expectedScripts)) {
|
||||
if (currentScripts[name] !== value) {
|
||||
const currentScript = currentScripts[name];
|
||||
|
||||
const isMissing = !currentScript;
|
||||
const isDifferent = currentScript !== value;
|
||||
const isBackstageScript = currentScript?.includes('backstage-cli');
|
||||
if (isMissing || (isDifferent && isBackstageScript)) {
|
||||
changed = true;
|
||||
currentScripts[name] = value;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ import { ExtendedPackage } from '../../lib/monorepo/PackageGraph';
|
||||
import { runParallelWorkers } from '../../lib/parallel';
|
||||
import { paths } from '../../lib/paths';
|
||||
import { detectRoleFromPackage } from '../../lib/role';
|
||||
import { buildApp } from '../build/buildApp';
|
||||
import { buildFrontend } from '../build/buildFrontend';
|
||||
import { buildBackend } from '../build/buildBackend';
|
||||
|
||||
function createScriptOptionsParser(anyCmd: Command, commandPath: string[]) {
|
||||
@@ -43,7 +43,9 @@ function createScriptOptionsParser(anyCmd: Command, commandPath: string[]) {
|
||||
}
|
||||
|
||||
if (!targetCmd) {
|
||||
throw new Error(`Could not find script command '${commandPath.join(' ')}'`);
|
||||
throw new Error(
|
||||
`Could not find package command '${commandPath.join(' ')}'`,
|
||||
);
|
||||
}
|
||||
const cmd = targetCmd;
|
||||
|
||||
@@ -80,7 +82,7 @@ export async function command(cmd: Command): Promise<void> {
|
||||
const apps = new Array<ExtendedPackage>();
|
||||
const backends = new Array<ExtendedPackage>();
|
||||
|
||||
const parseBuildScript = createScriptOptionsParser(cmd, ['script', 'build']);
|
||||
const parseBuildScript = createScriptOptionsParser(cmd, ['package', 'build']);
|
||||
|
||||
const options = packages.flatMap(pkg => {
|
||||
const role =
|
||||
@@ -90,7 +92,7 @@ export async function command(cmd: Command): Promise<void> {
|
||||
return [];
|
||||
}
|
||||
|
||||
if (role === 'app') {
|
||||
if (role === 'frontend') {
|
||||
apps.push(pkg);
|
||||
return [];
|
||||
} else if (role === 'backend') {
|
||||
@@ -137,7 +139,7 @@ export async function command(cmd: Command): Promise<void> {
|
||||
);
|
||||
return;
|
||||
}
|
||||
await buildApp({
|
||||
await buildFrontend({
|
||||
targetDir: pkg.dir,
|
||||
configPaths: (buildOptions.config as string[]) ?? [],
|
||||
writeStats: Boolean(buildOptions.stats),
|
||||
|
||||
@@ -31,19 +31,19 @@ export async function command(cmd: Command): Promise<void> {
|
||||
|
||||
switch (role) {
|
||||
case 'backend':
|
||||
case 'plugin-backend':
|
||||
case 'plugin-backend-module':
|
||||
case 'backend-plugin':
|
||||
case 'backend-plugin-module':
|
||||
case 'node-library':
|
||||
return startBackend(options);
|
||||
case 'app':
|
||||
case 'frontend':
|
||||
return startFrontend({
|
||||
...options,
|
||||
entry: 'src/index',
|
||||
verifyVersions: true,
|
||||
});
|
||||
case 'web-library':
|
||||
case 'plugin-frontend':
|
||||
case 'plugin-frontend-module':
|
||||
case 'frontend-plugin':
|
||||
case 'frontend-plugin-module':
|
||||
return startFrontend({ entry: 'dev/index', ...options });
|
||||
default:
|
||||
throw new Error(
|
||||
|
||||
@@ -29,7 +29,11 @@ function includesAnyOf(hayStack: string[], ...needles: string[]) {
|
||||
|
||||
export default async (cmd: Command) => {
|
||||
// all args are forwarded to jest
|
||||
const rawArgs = cmd.parent.rawArgs as string[];
|
||||
let parent = cmd;
|
||||
while (parent.parent) {
|
||||
parent = parent.parent;
|
||||
}
|
||||
const rawArgs = parent.rawArgs as string[];
|
||||
const args = rawArgs.slice(rawArgs.indexOf('test') + 1);
|
||||
|
||||
// Only include our config if caller isn't passing their own config
|
||||
@@ -37,6 +41,10 @@ export default async (cmd: Command) => {
|
||||
args.push('--config', paths.resolveOwn('config/jest.js'));
|
||||
}
|
||||
|
||||
if (!includesAnyOf(args, '--no-passWithNoTests', '--passWithNoTests=false')) {
|
||||
args.push('--passWithNoTests');
|
||||
}
|
||||
|
||||
// Run in watch mode unless in CI, coverage mode, or running all tests
|
||||
if (
|
||||
!process.env.CI &&
|
||||
|
||||
@@ -173,6 +173,14 @@ class PackageJsonHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
// Skip diffing package scripts that have been migrated to the new commands
|
||||
const hasNewScript = Object.values(targetScripts).some(script =>
|
||||
String(script).includes('backstage-cli package '),
|
||||
);
|
||||
if (hasNewScript) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (const key of Object.keys(pkgScripts)) {
|
||||
await this.syncField(key, pkgScripts, targetScripts, 'scripts');
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { relative as relativePath, posix as posixPath } from 'path';
|
||||
import path from 'path';
|
||||
import { getPackages, Package } from '@manypkg/get-packages';
|
||||
import { paths } from '../paths';
|
||||
import { PackageRole } from '../role';
|
||||
@@ -166,8 +166,11 @@ export class PackageGraph extends Map<string, PackageGraphNode> {
|
||||
|
||||
const dirMap = new Map(
|
||||
Array.from(this.values()).map(pkg => [
|
||||
posixPath.normalize(relativePath(paths.targetRoot, pkg.dir)) +
|
||||
posixPath.sep,
|
||||
// relative from root, convert to posix, and add a / at the end
|
||||
path
|
||||
.relative(paths.targetRoot, pkg.dir)
|
||||
.split(path.sep)
|
||||
.join(path.posix.sep) + path.posix.sep,
|
||||
pkg,
|
||||
]),
|
||||
);
|
||||
|
||||
@@ -38,6 +38,7 @@ import {
|
||||
Output,
|
||||
} from '../builder';
|
||||
import { copyPackageDist } from './copyPackageDist';
|
||||
import { getRoleInfo } from '../role';
|
||||
|
||||
// These packages aren't safe to pack in parallel since the CLI depends on them
|
||||
const UNSAFE_PACKAGES = [
|
||||
@@ -131,7 +132,9 @@ export async function createDistWorkspace(
|
||||
}
|
||||
const role = pkg.packageJson.backstage?.role;
|
||||
if (!role) {
|
||||
console.warn(`Ignored ${pkg.packageJson.name} because it has no role`);
|
||||
console.warn(
|
||||
`Building ${pkg.packageJson.name} separately because it has no role`,
|
||||
);
|
||||
customBuild.push(pkg.packageJson.name);
|
||||
continue;
|
||||
}
|
||||
@@ -142,9 +145,17 @@ export async function createDistWorkspace(
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!buildScript.startsWith('backstage-cli script build')) {
|
||||
if (!buildScript.startsWith('backstage-cli package build')) {
|
||||
console.warn(
|
||||
`Ignored ${pkg.packageJson.name} because it has a custom build script, '${buildScript}'`,
|
||||
`Building ${pkg.packageJson.name} separately because it has a custom build script, '${buildScript}'`,
|
||||
);
|
||||
customBuild.push(pkg.packageJson.name);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (getRoleInfo(role).output.includes('bundle')) {
|
||||
console.warn(
|
||||
`Building ${pkg.packageJson.name} separately because it is a bundled package`,
|
||||
);
|
||||
customBuild.push(pkg.packageJson.name);
|
||||
continue;
|
||||
@@ -216,7 +227,7 @@ export async function createDistWorkspace(
|
||||
const FAST_PACK_SCRIPTS = [
|
||||
undefined,
|
||||
'backstage-cli prepack',
|
||||
'backstage-cli script prepack',
|
||||
'backstage-cli package prepack',
|
||||
];
|
||||
|
||||
async function moveToDistWorkspace(
|
||||
|
||||
@@ -31,8 +31,8 @@ describe('getRoleInfo', () => {
|
||||
output: ['types', 'esm'],
|
||||
});
|
||||
|
||||
expect(getRoleInfo('app')).toEqual({
|
||||
role: 'app',
|
||||
expect(getRoleInfo('frontend')).toEqual({
|
||||
role: 'frontend',
|
||||
platform: 'web',
|
||||
output: ['bundle'],
|
||||
});
|
||||
@@ -56,10 +56,10 @@ describe('getRoleFromPackage', () => {
|
||||
expect(
|
||||
getRoleFromPackage({
|
||||
backstage: {
|
||||
role: 'app',
|
||||
role: 'frontend',
|
||||
},
|
||||
}),
|
||||
).toEqual('app');
|
||||
).toEqual('frontend');
|
||||
|
||||
expect(() =>
|
||||
getRoleFromPackage({
|
||||
@@ -135,7 +135,7 @@ describe('detectRoleFromPackage', () => {
|
||||
'cy:run': 'cypress run',
|
||||
},
|
||||
}),
|
||||
).toEqual('app');
|
||||
).toEqual('frontend');
|
||||
});
|
||||
|
||||
it('detects the role of example-backend', () => {
|
||||
@@ -180,7 +180,7 @@ describe('detectRoleFromPackage', () => {
|
||||
clean: 'backstage-cli clean',
|
||||
},
|
||||
}),
|
||||
).toEqual('plugin-frontend');
|
||||
).toEqual('frontend-plugin');
|
||||
});
|
||||
|
||||
it('detects the role of @backstage/plugin-catalog-backend', () => {
|
||||
@@ -204,7 +204,7 @@ describe('detectRoleFromPackage', () => {
|
||||
clean: 'backstage-cli clean',
|
||||
},
|
||||
}),
|
||||
).toEqual('plugin-backend');
|
||||
).toEqual('backend-plugin');
|
||||
});
|
||||
|
||||
it('detects the role of @backstage/plugin-catalog-react', () => {
|
||||
@@ -274,7 +274,7 @@ describe('detectRoleFromPackage', () => {
|
||||
clean: 'backstage-cli clean',
|
||||
},
|
||||
}),
|
||||
).toEqual('plugin-backend-module');
|
||||
).toEqual('backend-plugin-module');
|
||||
});
|
||||
|
||||
it('detects the role of @backstage/plugin-permission-node', () => {
|
||||
@@ -323,6 +323,6 @@ describe('detectRoleFromPackage', () => {
|
||||
clean: 'backstage-cli clean',
|
||||
},
|
||||
}),
|
||||
).toEqual('plugin-frontend-module');
|
||||
).toEqual('frontend-plugin-module');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -22,7 +22,7 @@ import { PackageRole, PackageRoleInfo } from './types';
|
||||
|
||||
const packageRoleInfos: PackageRoleInfo[] = [
|
||||
{
|
||||
role: 'app',
|
||||
role: 'frontend',
|
||||
platform: 'web',
|
||||
output: ['bundle'],
|
||||
},
|
||||
@@ -52,22 +52,22 @@ const packageRoleInfos: PackageRoleInfo[] = [
|
||||
output: ['types', 'esm', 'cjs'],
|
||||
},
|
||||
{
|
||||
role: 'plugin-frontend',
|
||||
role: 'frontend-plugin',
|
||||
platform: 'web',
|
||||
output: ['types', 'esm'],
|
||||
},
|
||||
{
|
||||
role: 'plugin-frontend-module',
|
||||
role: 'frontend-plugin-module',
|
||||
platform: 'web',
|
||||
output: ['types', 'esm'],
|
||||
},
|
||||
{
|
||||
role: 'plugin-backend',
|
||||
role: 'backend-plugin',
|
||||
platform: 'node',
|
||||
output: ['types', 'cjs'],
|
||||
},
|
||||
{
|
||||
role: 'plugin-backend-module',
|
||||
role: 'backend-plugin-module',
|
||||
platform: 'node',
|
||||
output: ['types', 'cjs'],
|
||||
},
|
||||
@@ -147,22 +147,22 @@ export function detectRoleFromPackage(
|
||||
const pkg = detectionSchema.parse(pkgJson);
|
||||
|
||||
if (pkg.scripts?.start?.includes('app:serve')) {
|
||||
return 'app';
|
||||
return 'frontend';
|
||||
}
|
||||
if (pkg.scripts?.build?.includes('backend:bundle')) {
|
||||
return 'backend';
|
||||
}
|
||||
if (pkg.name?.includes('plugin-') && pkg.name?.includes('-backend-module-')) {
|
||||
return 'plugin-backend-module';
|
||||
return 'backend-plugin-module';
|
||||
}
|
||||
if (pkg.name?.includes('plugin-') && pkg.name?.includes('-module-')) {
|
||||
return 'plugin-frontend-module';
|
||||
return 'frontend-plugin-module';
|
||||
}
|
||||
if (pkg.scripts?.start?.includes('plugin:serve')) {
|
||||
return 'plugin-frontend';
|
||||
return 'frontend-plugin';
|
||||
}
|
||||
if (pkg.scripts?.start?.includes('backend:dev')) {
|
||||
return 'plugin-backend';
|
||||
return 'backend-plugin';
|
||||
}
|
||||
|
||||
const mainEntry = pkg.publishConfig?.main || pkg.main;
|
||||
|
||||
@@ -15,16 +15,16 @@
|
||||
*/
|
||||
|
||||
export type PackageRole =
|
||||
| 'app'
|
||||
| 'frontend'
|
||||
| 'backend'
|
||||
| 'cli'
|
||||
| 'web-library'
|
||||
| 'node-library'
|
||||
| 'common-library'
|
||||
| 'plugin-frontend'
|
||||
| 'plugin-frontend-module'
|
||||
| 'plugin-backend'
|
||||
| 'plugin-backend-module';
|
||||
| 'frontend-plugin'
|
||||
| 'frontend-plugin-module'
|
||||
| 'backend-plugin'
|
||||
| 'backend-plugin-module';
|
||||
|
||||
export type PackagePlatform = 'node' | 'web' | 'common';
|
||||
export type PackageOutputType = 'bundle' | 'types' | 'esm' | 'cjs';
|
||||
|
||||
@@ -20,28 +20,23 @@
|
||||
* them with .icon.svg
|
||||
*/
|
||||
export function svgrTemplate(
|
||||
{ template }: any,
|
||||
_opts: any,
|
||||
{ imports, interfaces, componentName, jsx }: any,
|
||||
{ imports, interfaces, componentName, props, jsx }: any,
|
||||
{ tpl }: any,
|
||||
) {
|
||||
const iconName = {
|
||||
...componentName,
|
||||
name: `${componentName.name.replace(/icon$/, '')}Icon`,
|
||||
};
|
||||
const name = `${componentName.replace(/icon$/, '')}Icon`;
|
||||
|
||||
const defaultExport = {
|
||||
type: 'ExportDefaultDeclaration',
|
||||
declaration: iconName,
|
||||
declaration: { type: 'Identifier', name },
|
||||
};
|
||||
|
||||
const typeScriptTemplate = template.smart({ plugins: ['typescript'] });
|
||||
return typeScriptTemplate.ast`
|
||||
return tpl`
|
||||
${imports}
|
||||
import SvgIcon from '@material-ui/core/SvgIcon';
|
||||
|
||||
${interfaces}
|
||||
|
||||
const ${iconName} = props => React.createElement(SvgIcon, props, ${jsx.children});
|
||||
const ${name} = (${props}) => React.createElement(SvgIcon, ${props}, ${jsx.children});
|
||||
|
||||
${defaultExport}`;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
# @backstage/codemods
|
||||
|
||||
## 0.1.35
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- @backstage/cli-common@0.1.8
|
||||
|
||||
## 0.1.34
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- c77c5c7eb6: Added `backstage.role` to `package.json`
|
||||
- Updated dependencies
|
||||
- @backstage/core-app-api@0.5.3
|
||||
- @backstage/core-components@0.8.9
|
||||
- @backstage/core-plugin-api@0.6.1
|
||||
- @backstage/cli-common@0.1.7
|
||||
|
||||
## 0.1.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
{
|
||||
"name": "@backstage/codemods",
|
||||
"description": "A collection of codemods for Backstage projects",
|
||||
"version": "0.1.33",
|
||||
"version": "0.1.34",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"main": "dist/index.cjs.js"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "cli"
|
||||
},
|
||||
"homepage": "https://backstage.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -20,18 +23,18 @@
|
||||
"main": "src/index.ts",
|
||||
"scripts": {
|
||||
"start": "nodemon --",
|
||||
"build": "backstage-cli build --outputs cjs",
|
||||
"lint": "backstage-cli lint",
|
||||
"test": "backstage-cli test",
|
||||
"build": "backstage-cli package build",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"prepack": "backstage-cli prepack",
|
||||
"postpack": "backstage-cli postpack",
|
||||
"clean": "backstage-cli clean"
|
||||
"clean": "backstage-cli package clean"
|
||||
},
|
||||
"bin": {
|
||||
"backstage-codemods": "bin/backstage-codemods"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/cli-common": "0.1.6",
|
||||
"@backstage/cli-common": "0.1.7",
|
||||
"@backstage/core-app-api": "*",
|
||||
"@backstage/core-components": "*",
|
||||
"@backstage/core-plugin-api": "*",
|
||||
|
||||
@@ -1,5 +1,28 @@
|
||||
# @backstage/config-loader
|
||||
|
||||
## 0.9.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Fix for the previous release with missing type declarations.
|
||||
- Updated dependencies
|
||||
- @backstage/cli-common@0.1.8
|
||||
- @backstage/config@0.1.15
|
||||
- @backstage/errors@0.2.2
|
||||
- @backstage/types@0.1.3
|
||||
|
||||
## 0.9.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 1ed305728b: Bump `node-fetch` to version 2.6.7 and `cross-fetch` to version 3.1.5
|
||||
- c77c5c7eb6: Added `backstage.role` to `package.json`
|
||||
- Updated dependencies
|
||||
- @backstage/errors@0.2.1
|
||||
- @backstage/cli-common@0.1.7
|
||||
- @backstage/config@0.1.14
|
||||
- @backstage/types@0.1.2
|
||||
|
||||
## 0.9.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/config-loader",
|
||||
"description": "Config loading functionality used by Backstage backend, and CLI",
|
||||
"version": "0.9.3",
|
||||
"version": "0.9.4",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
@@ -9,6 +9,9 @@
|
||||
"module": "dist/index.esm.js",
|
||||
"types": "dist/index.d.ts"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "node-library"
|
||||
},
|
||||
"homepage": "https://backstage.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -22,18 +25,19 @@
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"scripts": {
|
||||
"build": "backstage-cli build",
|
||||
"lint": "backstage-cli lint",
|
||||
"test": "backstage-cli test",
|
||||
"prepack": "backstage-cli prepack",
|
||||
"postpack": "backstage-cli postpack",
|
||||
"clean": "backstage-cli clean"
|
||||
"build": "backstage-cli package build",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"prepack": "backstage-cli package prepack",
|
||||
"postpack": "backstage-cli package postpack",
|
||||
"clean": "backstage-cli package clean",
|
||||
"start": "backstage-cli package start"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/cli-common": "^0.1.6",
|
||||
"@backstage/config": "^0.1.13",
|
||||
"@backstage/errors": "^0.2.0",
|
||||
"@backstage/types": "^0.1.1",
|
||||
"@backstage/cli-common": "^0.1.7",
|
||||
"@backstage/config": "^0.1.14",
|
||||
"@backstage/errors": "^0.2.1",
|
||||
"@backstage/types": "^0.1.2",
|
||||
"@types/json-schema": "^7.0.6",
|
||||
"ajv": "^7.0.3",
|
||||
"chokidar": "^3.5.2",
|
||||
|
||||
@@ -333,6 +333,66 @@ describe('loadConfig', () => {
|
||||
stopSignal.resolve();
|
||||
});
|
||||
|
||||
it('watches included files', async () => {
|
||||
const onChange = defer<AppConfig[]>();
|
||||
const stopSignal = defer<void>();
|
||||
|
||||
await expect(
|
||||
loadConfig({
|
||||
configRoot: '/root',
|
||||
configTargets: [{ path: '/root/app-config.development.yaml' }],
|
||||
watch: {
|
||||
onChange: onChange.resolve,
|
||||
stopSignal: stopSignal.promise,
|
||||
},
|
||||
}),
|
||||
).resolves.toEqual({
|
||||
appConfigs: [
|
||||
{
|
||||
context: 'app-config.development.yaml',
|
||||
data: {
|
||||
app: {
|
||||
sessionKey: 'development-key',
|
||||
},
|
||||
backend: {
|
||||
foo: {
|
||||
bar: 'token is-secret',
|
||||
},
|
||||
},
|
||||
other: {
|
||||
secret: 'abc123',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
// session-key is indirectly included in app-config.development.yaml
|
||||
// via included.yaml
|
||||
await fs.writeFile('/root/secrets/session-key.txt', 'abc234');
|
||||
|
||||
await expect(onChange.promise).resolves.toEqual([
|
||||
{
|
||||
context: 'app-config.development.yaml',
|
||||
data: {
|
||||
app: {
|
||||
sessionKey: 'development-key',
|
||||
},
|
||||
backend: {
|
||||
foo: {
|
||||
bar: 'token is-secret',
|
||||
},
|
||||
},
|
||||
other: {
|
||||
secret: 'abc234',
|
||||
},
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
stopSignal.resolve();
|
||||
});
|
||||
|
||||
it('watches remote config urls', async () => {
|
||||
server.use(initialLoaderHandler);
|
||||
|
||||
|
||||
@@ -140,7 +140,8 @@ export async function loadConfig(
|
||||
const env = envFunc ?? (async (name: string) => process.env[name]);
|
||||
|
||||
const loadConfigFiles = async () => {
|
||||
const configs = [];
|
||||
const fileConfigs = [];
|
||||
const loadedPaths = new Set<string>();
|
||||
|
||||
for (const configPath of configPaths) {
|
||||
if (!isAbsolute(configPath)) {
|
||||
@@ -148,8 +149,15 @@ export async function loadConfig(
|
||||
}
|
||||
|
||||
const dir = dirname(configPath);
|
||||
const readFile = (path: string) =>
|
||||
fs.readFile(resolvePath(dir, path), 'utf8');
|
||||
const readFile = (path: string) => {
|
||||
const fullPath = resolvePath(dir, path);
|
||||
// if we read a file when building configuration,
|
||||
// we should include that file when watching for
|
||||
// changes, too.
|
||||
loadedPaths.add(fullPath);
|
||||
|
||||
return fs.readFile(fullPath, 'utf8');
|
||||
};
|
||||
|
||||
const input = yaml.parse(await readFile(configPath));
|
||||
const substitutionTransform = createSubstitutionTransform(env);
|
||||
@@ -158,10 +166,10 @@ export async function loadConfig(
|
||||
substitutionTransform,
|
||||
]);
|
||||
|
||||
configs.push({ data, context: basename(configPath) });
|
||||
fileConfigs.push({ data, context: basename(configPath) });
|
||||
}
|
||||
|
||||
return configs;
|
||||
return { fileConfigs, loadedPaths };
|
||||
};
|
||||
|
||||
const loadRemoteConfigFiles = async () => {
|
||||
@@ -199,8 +207,9 @@ export async function loadConfig(
|
||||
};
|
||||
|
||||
let fileConfigs: AppConfig[];
|
||||
let loadedPaths: Set<string>;
|
||||
try {
|
||||
fileConfigs = await loadConfigFiles();
|
||||
({ fileConfigs, loadedPaths } = await loadConfigFiles());
|
||||
} catch (error) {
|
||||
throw new ForwardedError('Failed to read static configuration file', error);
|
||||
}
|
||||
@@ -220,14 +229,24 @@ export async function loadConfig(
|
||||
const envConfigs = await readEnvConfig(process.env);
|
||||
|
||||
const watchConfigFile = (watchProp: LoadConfigOptionsWatch) => {
|
||||
const watcher = chokidar.watch(configPaths, {
|
||||
let watchedFiles = Array.from(loadedPaths);
|
||||
|
||||
const watcher = chokidar.watch(watchedFiles, {
|
||||
usePolling: process.env.NODE_ENV === 'test',
|
||||
});
|
||||
|
||||
let currentSerializedConfig = JSON.stringify(fileConfigs);
|
||||
watcher.on('change', async () => {
|
||||
try {
|
||||
const newConfigs = await loadConfigFiles();
|
||||
const { fileConfigs: newConfigs, loadedPaths: newLoadedPaths } =
|
||||
await loadConfigFiles();
|
||||
|
||||
// Replace watches to handle any added or removed
|
||||
// $include or $file expressions.
|
||||
watcher.unwatch(watchedFiles);
|
||||
watchedFiles = Array.from(newLoadedPaths);
|
||||
watcher.add(watchedFiles);
|
||||
|
||||
const newSerializedConfig = JSON.stringify(newConfigs);
|
||||
|
||||
if (currentSerializedConfig === newSerializedConfig) {
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
# @backstage/config
|
||||
|
||||
## 0.1.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Fix for the previous release with missing type declarations.
|
||||
- Updated dependencies
|
||||
- @backstage/types@0.1.3
|
||||
|
||||
## 0.1.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- c77c5c7eb6: Added `backstage.role` to `package.json`
|
||||
- Updated dependencies
|
||||
- @backstage/types@0.1.2
|
||||
|
||||
## 0.1.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/config",
|
||||
"description": "Config API used by Backstage core, backend, and CLI",
|
||||
"version": "0.1.13",
|
||||
"version": "0.1.14",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
@@ -9,6 +9,9 @@
|
||||
"module": "dist/index.esm.js",
|
||||
"types": "dist/index.d.ts"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "common-library"
|
||||
},
|
||||
"homepage": "https://backstage.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -22,19 +25,19 @@
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"scripts": {
|
||||
"build": "backstage-cli build",
|
||||
"lint": "backstage-cli lint",
|
||||
"test": "backstage-cli test",
|
||||
"prepack": "backstage-cli prepack",
|
||||
"postpack": "backstage-cli postpack",
|
||||
"clean": "backstage-cli clean"
|
||||
"build": "backstage-cli package build",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"prepack": "backstage-cli package prepack",
|
||||
"postpack": "backstage-cli package postpack",
|
||||
"clean": "backstage-cli package clean"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/types": "^0.1.1",
|
||||
"@backstage/types": "^0.1.2",
|
||||
"lodash": "^4.17.21"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/test-utils": "^0.2.4-next.0",
|
||||
"@backstage/test-utils": "^0.2.5",
|
||||
"@types/jest": "^26.0.7",
|
||||
"@types/node": "^14.14.32"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
# @backstage/core-app-api
|
||||
|
||||
## 0.5.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 1ed305728b: Bump `node-fetch` to version 2.6.7 and `cross-fetch` to version 3.1.5
|
||||
- c77c5c7eb6: Added `backstage.role` to `package.json`
|
||||
- Updated dependencies
|
||||
- @backstage/core-plugin-api@0.6.1
|
||||
- @backstage/config@0.1.14
|
||||
- @backstage/types@0.1.2
|
||||
- @backstage/version-bridge@0.1.2
|
||||
|
||||
## 0.5.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
{
|
||||
"name": "@backstage/core-app-api",
|
||||
"description": "Core app API used by Backstage apps",
|
||||
"version": "0.5.2",
|
||||
"version": "0.5.3",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"main": "dist/index.esm.js",
|
||||
"types": "dist/index.d.ts"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "web-library"
|
||||
},
|
||||
"homepage": "https://backstage.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -21,18 +24,19 @@
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"scripts": {
|
||||
"build": "backstage-cli build --outputs types,esm",
|
||||
"lint": "backstage-cli lint",
|
||||
"test": "backstage-cli test",
|
||||
"prepack": "backstage-cli prepack",
|
||||
"postpack": "backstage-cli postpack",
|
||||
"clean": "backstage-cli clean"
|
||||
"build": "backstage-cli package build",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"prepack": "backstage-cli package prepack",
|
||||
"postpack": "backstage-cli package postpack",
|
||||
"clean": "backstage-cli package clean",
|
||||
"start": "backstage-cli package start"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/config": "^0.1.13",
|
||||
"@backstage/core-plugin-api": "^0.6.0",
|
||||
"@backstage/types": "^0.1.1",
|
||||
"@backstage/version-bridge": "^0.1.1",
|
||||
"@backstage/config": "^0.1.14",
|
||||
"@backstage/core-plugin-api": "^0.6.1",
|
||||
"@backstage/types": "^0.1.2",
|
||||
"@backstage/version-bridge": "^0.1.2",
|
||||
"@types/prop-types": "^15.7.3",
|
||||
"prop-types": "^15.7.2",
|
||||
"react-router-dom": "6.0.0-beta.0",
|
||||
@@ -45,8 +49,8 @@
|
||||
"react": "^16.13.1 || ^17.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.13.2-next.0",
|
||||
"@backstage/test-utils": "^0.2.4",
|
||||
"@backstage/cli": "^0.14.0",
|
||||
"@backstage/test-utils": "^0.2.5",
|
||||
"@testing-library/jest-dom": "^5.10.1",
|
||||
"@testing-library/react": "^11.2.5",
|
||||
"@testing-library/react-hooks": "^7.0.2",
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
# @backstage/core-components
|
||||
|
||||
## 0.8.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 1ed305728b: Bump `node-fetch` to version 2.6.7 and `cross-fetch` to version 3.1.5
|
||||
- c77c5c7eb6: Added `backstage.role` to `package.json`
|
||||
- 126074a04b: Port supported react-use functions to react-hookz.
|
||||
- Updated dependencies
|
||||
- @backstage/core-plugin-api@0.6.1
|
||||
- @backstage/errors@0.2.1
|
||||
- @backstage/config@0.1.14
|
||||
- @backstage/theme@0.2.15
|
||||
|
||||
## 0.8.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
{
|
||||
"name": "@backstage/core-components",
|
||||
"description": "Core components used by Backstage plugins and apps",
|
||||
"version": "0.8.8",
|
||||
"version": "0.8.9",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"main": "dist/index.esm.js",
|
||||
"types": "dist/index.d.ts"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "web-library"
|
||||
},
|
||||
"homepage": "https://backstage.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -21,18 +24,19 @@
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"scripts": {
|
||||
"build": "backstage-cli build --outputs types,esm",
|
||||
"lint": "backstage-cli lint",
|
||||
"test": "backstage-cli test",
|
||||
"prepack": "backstage-cli prepack",
|
||||
"postpack": "backstage-cli postpack",
|
||||
"clean": "backstage-cli clean"
|
||||
"build": "backstage-cli package build",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"prepack": "backstage-cli package prepack",
|
||||
"postpack": "backstage-cli package postpack",
|
||||
"clean": "backstage-cli package clean",
|
||||
"start": "backstage-cli package start"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/config": "^0.1.13",
|
||||
"@backstage/core-plugin-api": "^0.6.0",
|
||||
"@backstage/errors": "^0.2.0",
|
||||
"@backstage/theme": "^0.2.14",
|
||||
"@backstage/config": "^0.1.14",
|
||||
"@backstage/core-plugin-api": "^0.6.1",
|
||||
"@backstage/errors": "^0.2.1",
|
||||
"@backstage/theme": "^0.2.15",
|
||||
"@material-table/core": "^3.1.0",
|
||||
"@material-ui/core": "^4.12.2",
|
||||
"@material-ui/icons": "^4.9.1",
|
||||
@@ -60,7 +64,8 @@
|
||||
"react-sparklines": "^1.7.0",
|
||||
"react-syntax-highlighter": "^15.4.5",
|
||||
"react-text-truncate": "^0.17.0",
|
||||
"react-use": "^17.2.4",
|
||||
"react-use": "^17.3.2",
|
||||
"@react-hookz/web": "^12.3.0",
|
||||
"react-virtualized-auto-sizer": "^1.0.6",
|
||||
"react-window": "^1.8.6",
|
||||
"remark-gfm": "^3.0.1",
|
||||
@@ -73,9 +78,9 @@
|
||||
"react-dom": "^16.13.1 || ^17.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/core-app-api": "^0.5.2",
|
||||
"@backstage/cli": "^0.13.2",
|
||||
"@backstage/test-utils": "^0.2.4",
|
||||
"@backstage/core-app-api": "^0.5.3",
|
||||
"@backstage/cli": "^0.14.0",
|
||||
"@backstage/test-utils": "^0.2.5",
|
||||
"@testing-library/jest-dom": "^5.10.1",
|
||||
"@testing-library/react": "^11.2.5",
|
||||
"@testing-library/react-hooks": "^7.0.2",
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import React, { useEffect, useMemo, useRef } from 'react';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import IconButton from '@material-ui/core/IconButton';
|
||||
import CopyIcon from '@material-ui/icons/FileCopy';
|
||||
import AutoSizer from 'react-virtualized-auto-sizer';
|
||||
@@ -42,6 +43,7 @@ export function RealLogViewer(props: RealLogViewerProps) {
|
||||
|
||||
const search = useLogViewerSearch(lines);
|
||||
const selection = useLogViewerSelection(lines);
|
||||
const location = useLocation();
|
||||
|
||||
useEffect(() => {
|
||||
if (search.resultLine !== undefined && listRef.current) {
|
||||
@@ -49,11 +51,18 @@ export function RealLogViewer(props: RealLogViewerProps) {
|
||||
}
|
||||
}, [search.resultLine]);
|
||||
|
||||
useEffect(() => {
|
||||
if (location.hash) {
|
||||
// #line-6 -> 6
|
||||
const line = parseInt(location.hash.replace(/\D/g, ''), 10);
|
||||
selection.setSelection(line, false);
|
||||
}
|
||||
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
|
||||
const handleSelectLine = (
|
||||
line: number,
|
||||
event: { shiftKey: boolean; preventDefault: () => void },
|
||||
) => {
|
||||
event.preventDefault();
|
||||
selection.setSelection(line, event.shiftKey);
|
||||
};
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import { useMemo, useState } from 'react';
|
||||
import useToggle from 'react-use/lib/useToggle';
|
||||
import { useToggle } from '@react-hookz/web';
|
||||
import { AnsiLine } from './AnsiProcessor';
|
||||
|
||||
export function applySearchFilter(lines: AnsiLine[], searchText: string) {
|
||||
|
||||
@@ -18,7 +18,7 @@ import { makeStyles } from '@material-ui/core/styles';
|
||||
import Tooltip, { TooltipProps } from '@material-ui/core/Tooltip';
|
||||
import React, { useState } from 'react';
|
||||
import TextTruncate, { TextTruncateProps } from 'react-text-truncate';
|
||||
import useMountedState from 'react-use/lib/useMountedState';
|
||||
import { useIsMounted } from '@react-hookz/web';
|
||||
|
||||
type Props = {
|
||||
text: TextTruncateProps['text'];
|
||||
@@ -41,7 +41,7 @@ const useStyles = makeStyles(
|
||||
|
||||
export function OverflowTooltip(props: Props) {
|
||||
const [hover, setHover] = useState(false);
|
||||
const isMounted = useMountedState();
|
||||
const isMounted = useIsMounted();
|
||||
const classes = useStyles();
|
||||
|
||||
const handleToggled = (truncated: boolean) => {
|
||||
|
||||
@@ -18,7 +18,7 @@ import { isEqual } from 'lodash';
|
||||
import qs from 'qs';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
import useDebounce from 'react-use/lib/useDebounce';
|
||||
import { useDebouncedEffect } from '@react-hookz/web';
|
||||
|
||||
function stringify(queryParams: any): string {
|
||||
// Even though these setting don't look nice (e.g. escaped brackets), we should keep
|
||||
@@ -75,7 +75,7 @@ export function useQueryParamState<T>(
|
||||
);
|
||||
}, [searchParamsString, setQueryParamState, stateName]);
|
||||
|
||||
useDebounce(
|
||||
useDebouncedEffect(
|
||||
() => {
|
||||
const queryString = joinQueryString(
|
||||
searchParamsString,
|
||||
@@ -87,8 +87,8 @@ export function useQueryParamState<T>(
|
||||
setSearchParams(queryString, { replace: true });
|
||||
}
|
||||
},
|
||||
debounceTime,
|
||||
[setSearchParams, queryParamState, searchParamsString, stateName],
|
||||
debounceTime,
|
||||
);
|
||||
|
||||
return [queryParamState, setQueryParamState];
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
useApi,
|
||||
} from '@backstage/core-plugin-api';
|
||||
import React from 'react';
|
||||
import useAsync from 'react-use/lib/useAsync';
|
||||
import { useAsync, useMountEffect } from '@react-hookz/web';
|
||||
import { ErrorPanel } from '../../components/ErrorPanel';
|
||||
import { Progress } from '../../components/Progress';
|
||||
import { ProxiedSignInIdentity } from './ProxiedSignInIdentity';
|
||||
@@ -56,7 +56,7 @@ export type ProxiedSignInPageProps = SignInPageProps & {
|
||||
export const ProxiedSignInPage = (props: ProxiedSignInPageProps) => {
|
||||
const discoveryApi = useApi(discoveryApiRef);
|
||||
|
||||
const { loading, error } = useAsync(async () => {
|
||||
const [{ status, error }, { execute }] = useAsync(async () => {
|
||||
const identity = new ProxiedSignInIdentity({
|
||||
provider: props.provider,
|
||||
discoveryApi,
|
||||
@@ -65,9 +65,11 @@ export const ProxiedSignInPage = (props: ProxiedSignInPageProps) => {
|
||||
await identity.start();
|
||||
|
||||
props.onSignInSuccess(identity);
|
||||
}, []);
|
||||
});
|
||||
|
||||
if (loading) {
|
||||
useMountEffect(execute);
|
||||
|
||||
if (status === 'loading') {
|
||||
return <Progress />;
|
||||
} else if (error) {
|
||||
return (
|
||||
|
||||
@@ -21,7 +21,7 @@ import { makeStyles } from '@material-ui/core/styles';
|
||||
import Typography from '@material-ui/core/Typography';
|
||||
import CloseIcon from '@material-ui/icons/Close';
|
||||
import React, { useContext, useState } from 'react';
|
||||
import useLocalStorage from 'react-use/lib/useLocalStorage';
|
||||
import { useLocalStorageValue } from '@react-hookz/web';
|
||||
import {
|
||||
sidebarConfig,
|
||||
SidebarContext,
|
||||
@@ -155,7 +155,7 @@ export function SidebarIntro(_props: {}) {
|
||||
recentlyViewedItemsDismissed: false,
|
||||
};
|
||||
const [dismissedIntro, setDismissedIntro] =
|
||||
useLocalStorage<SidebarIntroLocalStorage>(SIDEBAR_INTRO_LOCAL_STORAGE);
|
||||
useLocalStorageValue<SidebarIntroLocalStorage>(SIDEBAR_INTRO_LOCAL_STORAGE);
|
||||
|
||||
const { starredItemsDismissed, recentlyViewedItemsDismissed } =
|
||||
dismissedIntro ?? {};
|
||||
|
||||
@@ -25,7 +25,7 @@ import Button from '@material-ui/core/Button';
|
||||
import Grid from '@material-ui/core/Grid';
|
||||
import Typography from '@material-ui/core/Typography';
|
||||
import React, { useState } from 'react';
|
||||
import useMount from 'react-use/lib/useMount';
|
||||
import { useMountEffect } from '@react-hookz/web';
|
||||
import { Progress } from '../../components/Progress';
|
||||
import { Content } from '../Content/Content';
|
||||
import { ContentHeader } from '../ContentHeader/ContentHeader';
|
||||
@@ -149,7 +149,7 @@ export const SingleSignInPage = ({
|
||||
}
|
||||
};
|
||||
|
||||
useMount(() => login({ checkExisting: true }));
|
||||
useMountEffect(() => login({ checkExisting: true }));
|
||||
|
||||
return showLoginPage ? (
|
||||
<Page themeId="home">
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
# @backstage/core-plugin-api
|
||||
|
||||
## 0.6.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 1ed305728b: Bump `node-fetch` to version 2.6.7 and `cross-fetch` to version 3.1.5
|
||||
- c77c5c7eb6: Added `backstage.role` to `package.json`
|
||||
- 2714145cf5: Removes unused react-use dependency.
|
||||
- Updated dependencies
|
||||
- @backstage/config@0.1.14
|
||||
- @backstage/types@0.1.2
|
||||
- @backstage/version-bridge@0.1.2
|
||||
|
||||
## 0.6.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
{
|
||||
"name": "@backstage/core-plugin-api",
|
||||
"description": "Core API used by Backstage plugins",
|
||||
"version": "0.6.0",
|
||||
"version": "0.6.1",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"main": "dist/index.esm.js",
|
||||
"types": "dist/index.d.ts"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "web-library"
|
||||
},
|
||||
"homepage": "https://backstage.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -21,21 +24,21 @@
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"scripts": {
|
||||
"build": "backstage-cli build --outputs types,esm",
|
||||
"lint": "backstage-cli lint",
|
||||
"test": "backstage-cli test",
|
||||
"prepack": "backstage-cli prepack",
|
||||
"postpack": "backstage-cli postpack",
|
||||
"clean": "backstage-cli clean"
|
||||
"build": "backstage-cli package build",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"prepack": "backstage-cli package prepack",
|
||||
"postpack": "backstage-cli package postpack",
|
||||
"clean": "backstage-cli package clean",
|
||||
"start": "backstage-cli package start"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/config": "^0.1.13",
|
||||
"@backstage/types": "^0.1.1",
|
||||
"@backstage/version-bridge": "^0.1.1",
|
||||
"@backstage/config": "^0.1.14",
|
||||
"@backstage/types": "^0.1.2",
|
||||
"@backstage/version-bridge": "^0.1.2",
|
||||
"history": "^5.0.0",
|
||||
"prop-types": "^15.7.2",
|
||||
"react-router-dom": "6.0.0-beta.0",
|
||||
"react-use": "^17.2.4",
|
||||
"zen-observable": "^0.8.15"
|
||||
},
|
||||
"peerDependencies": {
|
||||
@@ -43,9 +46,9 @@
|
||||
"react": "^16.13.1 || ^17.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.13.2-next.0",
|
||||
"@backstage/core-app-api": "^0.5.2-next.0",
|
||||
"@backstage/test-utils": "^0.2.4-next.0",
|
||||
"@backstage/cli": "^0.14.0",
|
||||
"@backstage/core-app-api": "^0.5.3",
|
||||
"@backstage/test-utils": "^0.2.5",
|
||||
"@testing-library/jest-dom": "^5.10.1",
|
||||
"@testing-library/react": "^11.2.5",
|
||||
"@testing-library/react-hooks": "^7.0.2",
|
||||
|
||||
@@ -1,5 +1,34 @@
|
||||
# @backstage/create-app
|
||||
|
||||
## 0.4.20
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- e725bb812f: Remove SearchContextProvider from `<Root />`
|
||||
|
||||
The `SidebarSearchModal` exported from `plugin-search` internally renders `SearchContextProvider`, so it can be removed from `Root.tsx`:
|
||||
|
||||
```diff
|
||||
-import {
|
||||
- SidebarSearchModal,
|
||||
- SearchContextProvider,
|
||||
-} from '@backstage/plugin-search';
|
||||
+import { SidebarSearchModal } from '@backstage/plugin-search';
|
||||
|
||||
... omitted ...
|
||||
|
||||
<SidebarGroup label="Search" icon={<SearchIcon />} to="/search">
|
||||
- <SearchContextProvider>
|
||||
- <SidebarSearchModal />
|
||||
- </SearchContextProvider>
|
||||
+ <SidebarSearchModal />
|
||||
</SidebarGroup>
|
||||
```
|
||||
|
||||
- c77c5c7eb6: Added `backstage.role` to `package.json`
|
||||
- Updated dependencies
|
||||
- @backstage/cli-common@0.1.7
|
||||
|
||||
## 0.4.19
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
{
|
||||
"name": "@backstage/create-app",
|
||||
"description": "A CLI that helps you create your own Backstage app",
|
||||
"version": "0.4.19",
|
||||
"version": "0.4.20",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "cli"
|
||||
},
|
||||
"homepage": "https://backstage.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -21,16 +24,16 @@
|
||||
"backstage-create-app": "bin/backstage-create-app"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "backstage-cli build --outputs cjs",
|
||||
"lint": "backstage-cli lint",
|
||||
"test": "backstage-cli test",
|
||||
"clean": "backstage-cli clean",
|
||||
"build": "backstage-cli package build",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"clean": "backstage-cli package clean",
|
||||
"prepack": "node scripts/prepack.js",
|
||||
"postpack": "node scripts/postpack.js",
|
||||
"start": "nodemon --"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/cli-common": "^0.1.6",
|
||||
"@backstage/cli-common": "^0.1.7",
|
||||
"chalk": "^4.0.0",
|
||||
"commander": "^6.1.0",
|
||||
"fs-extra": "9.1.0",
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { makeStyles, Theme, Grid, List, Paper } from '@material-ui/core';
|
||||
|
||||
import { CatalogResultListItem } from '@backstage/plugin-catalog';
|
||||
import { CatalogSearchResultListItem } from '@backstage/plugin-catalog';
|
||||
import {
|
||||
catalogApiRef,
|
||||
CATALOG_FILTER_EXISTS,
|
||||
@@ -116,7 +116,7 @@ const SearchPage = () => {
|
||||
switch (type) {
|
||||
case 'software-catalog':
|
||||
return (
|
||||
<CatalogResultListItem
|
||||
<CatalogSearchResultListItem
|
||||
key={document.location}
|
||||
result={document}
|
||||
/>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#
|
||||
# Once the commands have been run, you can build the image using `yarn build-image`
|
||||
|
||||
FROM node:14-buster-slim
|
||||
FROM node:16-bullseye-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
@@ -19,6 +19,12 @@ WORKDIR /app
|
||||
COPY yarn.lock package.json packages/backend/dist/skeleton.tar.gz ./
|
||||
RUN tar xzf skeleton.tar.gz && rm skeleton.tar.gz
|
||||
|
||||
# install sqlite3 dependencies
|
||||
RUN apt-get update && \
|
||||
apt-get install -y libsqlite3-dev python3 cmake g++ && \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
yarn config set python /usr/bin/python3
|
||||
|
||||
RUN yarn install --frozen-lockfile --production --network-timeout 300000 && rm -rf "$(yarn cache dir)"
|
||||
|
||||
# Then copy the rest of the backend bundle, along with any other files we might want.
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
# @backstage/dev-utils
|
||||
|
||||
## 0.2.22
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- c77c5c7eb6: Added `backstage.role` to `package.json`
|
||||
- Updated dependencies
|
||||
- @backstage/core-app-api@0.5.3
|
||||
- @backstage/core-components@0.8.9
|
||||
- @backstage/core-plugin-api@0.6.1
|
||||
- @backstage/integration-react@0.1.22
|
||||
- @backstage/test-utils@0.2.5
|
||||
- @backstage/plugin-catalog-react@0.6.15
|
||||
- @backstage/app-defaults@0.1.8
|
||||
- @backstage/catalog-model@0.10.0
|
||||
- @backstage/theme@0.2.15
|
||||
|
||||
## 0.2.21
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
{
|
||||
"name": "@backstage/dev-utils",
|
||||
"description": "Utilities for developing Backstage plugins.",
|
||||
"version": "0.2.21",
|
||||
"version": "0.2.22",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"main": "dist/index.esm.js",
|
||||
"types": "dist/index.d.ts"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "web-library"
|
||||
},
|
||||
"homepage": "https://backstage.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -21,23 +24,24 @@
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"scripts": {
|
||||
"build": "backstage-cli build --outputs types,esm",
|
||||
"lint": "backstage-cli lint",
|
||||
"test": "backstage-cli test",
|
||||
"prepack": "backstage-cli prepack",
|
||||
"postpack": "backstage-cli postpack",
|
||||
"clean": "backstage-cli clean"
|
||||
"build": "backstage-cli package build",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"prepack": "backstage-cli package prepack",
|
||||
"postpack": "backstage-cli package postpack",
|
||||
"clean": "backstage-cli package clean",
|
||||
"start": "backstage-cli package start"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/app-defaults": "^0.1.7",
|
||||
"@backstage/core-app-api": "^0.5.2",
|
||||
"@backstage/core-components": "^0.8.8",
|
||||
"@backstage/core-plugin-api": "^0.6.0",
|
||||
"@backstage/catalog-model": "^0.9.10",
|
||||
"@backstage/integration-react": "^0.1.21",
|
||||
"@backstage/plugin-catalog-react": "^0.6.14",
|
||||
"@backstage/test-utils": "^0.2.4",
|
||||
"@backstage/theme": "^0.2.14",
|
||||
"@backstage/app-defaults": "^0.1.8",
|
||||
"@backstage/core-app-api": "^0.5.3",
|
||||
"@backstage/core-components": "^0.8.9",
|
||||
"@backstage/core-plugin-api": "^0.6.1",
|
||||
"@backstage/catalog-model": "^0.10.0",
|
||||
"@backstage/integration-react": "^0.1.22",
|
||||
"@backstage/plugin-catalog-react": "^0.6.15",
|
||||
"@backstage/test-utils": "^0.2.5",
|
||||
"@backstage/theme": "^0.2.15",
|
||||
"@material-ui/core": "^4.12.2",
|
||||
"@material-ui/icons": "^4.9.1",
|
||||
"@testing-library/jest-dom": "^5.10.1",
|
||||
@@ -55,7 +59,7 @@
|
||||
"react-dom": "^16.13.1 || ^17.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.13.2",
|
||||
"@backstage/cli": "^0.14.0",
|
||||
"@types/jest": "^26.0.7",
|
||||
"@types/node": "^14.14.32"
|
||||
},
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
"description": "E2E test for verifying Backstage packages",
|
||||
"version": "0.2.0",
|
||||
"private": true,
|
||||
"backstage": {
|
||||
"role": "cli"
|
||||
},
|
||||
"homepage": "https://backstage.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -16,9 +19,11 @@
|
||||
"main": "src/index.ts",
|
||||
"scripts": {
|
||||
"start": "nodemon --",
|
||||
"lint": "backstage-cli lint",
|
||||
"test": "backstage-cli test",
|
||||
"test:e2e": "yarn start"
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"test:e2e": "yarn start",
|
||||
"build": "backstage-cli package build",
|
||||
"clean": "backstage-cli package clean"
|
||||
},
|
||||
"bin": {
|
||||
"e2e-test": "bin/e2e-test"
|
||||
|
||||
@@ -1,5 +1,22 @@
|
||||
# @backstage/errors
|
||||
|
||||
## 0.2.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Fix for the previous release with missing type declarations.
|
||||
- Updated dependencies
|
||||
- @backstage/types@0.1.3
|
||||
|
||||
## 0.2.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 1ed305728b: Bump `node-fetch` to version 2.6.7 and `cross-fetch` to version 3.1.5
|
||||
- c77c5c7eb6: Added `backstage.role` to `package.json`
|
||||
- Updated dependencies
|
||||
- @backstage/types@0.1.2
|
||||
|
||||
## 0.2.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/errors",
|
||||
"description": "Common utilities for error handling within Backstage",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"license": "Apache-2.0",
|
||||
@@ -12,6 +12,9 @@
|
||||
"module": "dist/index.esm.js",
|
||||
"types": "dist/index.d.ts"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "common-library"
|
||||
},
|
||||
"homepage": "https://backstage.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -22,20 +25,20 @@
|
||||
"backstage"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "backstage-cli build",
|
||||
"lint": "backstage-cli lint",
|
||||
"test": "backstage-cli test",
|
||||
"prepack": "backstage-cli prepack",
|
||||
"postpack": "backstage-cli postpack",
|
||||
"clean": "backstage-cli clean"
|
||||
"build": "backstage-cli package build",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"prepack": "backstage-cli package prepack",
|
||||
"postpack": "backstage-cli package postpack",
|
||||
"clean": "backstage-cli package clean"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/types": "^0.1.1",
|
||||
"@backstage/types": "^0.1.2",
|
||||
"cross-fetch": "^3.1.5",
|
||||
"serialize-error": "^8.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.13.2-next.0",
|
||||
"@backstage/cli": "^0.14.0",
|
||||
"@types/jest": "^26.0.7"
|
||||
},
|
||||
"files": [
|
||||
|
||||
@@ -1,5 +1,19 @@
|
||||
# @backstage/integration-react
|
||||
|
||||
## 0.1.22
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 1ed305728b: Bump `node-fetch` to version 2.6.7 and `cross-fetch` to version 3.1.5
|
||||
- c77c5c7eb6: Added `backstage.role` to `package.json`
|
||||
- f0e2f7a56a: Updated the `ScmAuth` error message for missing provider configurations to link to `ScmAuthApi` setup documentation.
|
||||
- Updated dependencies
|
||||
- @backstage/core-components@0.8.9
|
||||
- @backstage/core-plugin-api@0.6.1
|
||||
- @backstage/integration@0.7.3
|
||||
- @backstage/config@0.1.14
|
||||
- @backstage/theme@0.2.15
|
||||
|
||||
## 0.1.21
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/integration-react",
|
||||
"description": "Frontend package for managing integrations towards external systems",
|
||||
"version": "0.1.21",
|
||||
"version": "0.1.22",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"license": "Apache-2.0",
|
||||
@@ -11,21 +11,24 @@
|
||||
"main": "dist/index.esm.js",
|
||||
"types": "dist/index.d.ts"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "web-library"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "backstage-cli plugin:build",
|
||||
"start": "backstage-cli plugin:serve",
|
||||
"lint": "backstage-cli lint",
|
||||
"test": "backstage-cli test",
|
||||
"prepack": "backstage-cli prepack",
|
||||
"postpack": "backstage-cli postpack",
|
||||
"clean": "backstage-cli clean"
|
||||
"build": "backstage-cli package build",
|
||||
"start": "backstage-cli package start",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"prepack": "backstage-cli package prepack",
|
||||
"postpack": "backstage-cli package postpack",
|
||||
"clean": "backstage-cli package clean"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/config": "^0.1.13",
|
||||
"@backstage/core-components": "^0.8.8",
|
||||
"@backstage/core-plugin-api": "^0.6.0",
|
||||
"@backstage/integration": "^0.7.2",
|
||||
"@backstage/theme": "^0.2.14",
|
||||
"@backstage/config": "^0.1.14",
|
||||
"@backstage/core-components": "^0.8.9",
|
||||
"@backstage/core-plugin-api": "^0.6.1",
|
||||
"@backstage/integration": "^0.7.3",
|
||||
"@backstage/theme": "^0.2.15",
|
||||
"@material-ui/core": "^4.12.2",
|
||||
"@material-ui/icons": "^4.9.1",
|
||||
"@material-ui/lab": "4.0.0-alpha.57",
|
||||
@@ -35,9 +38,9 @@
|
||||
"react": "^16.13.1 || ^17.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.13.2",
|
||||
"@backstage/dev-utils": "^0.2.21",
|
||||
"@backstage/test-utils": "^0.2.4",
|
||||
"@backstage/cli": "^0.14.0",
|
||||
"@backstage/dev-utils": "^0.2.22",
|
||||
"@backstage/test-utils": "^0.2.5",
|
||||
"@testing-library/jest-dom": "^5.10.1",
|
||||
"@testing-library/react": "^11.2.5",
|
||||
"@testing-library/user-event": "^13.1.8",
|
||||
|
||||
@@ -1,5 +1,22 @@
|
||||
# @backstage/integration
|
||||
|
||||
## 0.7.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Fix for the previous release with missing type declarations.
|
||||
- Updated dependencies
|
||||
- @backstage/config@0.1.15
|
||||
|
||||
## 0.7.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 1ed305728b: Bump `node-fetch` to version 2.6.7 and `cross-fetch` to version 3.1.5
|
||||
- c77c5c7eb6: Added `backstage.role` to `package.json`
|
||||
- Updated dependencies
|
||||
- @backstage/config@0.1.14
|
||||
|
||||
## 0.7.2
|
||||
|
||||
### Patch Changes
|
||||
@@ -212,7 +229,7 @@
|
||||
|
||||
- 0fd4ea443: Updates the `GithubCredentialsProvider` to return the token type, it can either be `token` or `app` depending on the authentication method.
|
||||
|
||||
Update the `GithubOrgReaderProcessor` NOT to query for email addresses if GitHub Apps is used for authentication, this is due to inconsistencies in the GitHub API when using server to server communications and installation tokens. https://github.community/t/api-v4-unable-to-retrieve-email-resource-not-accessible-by-integration/13831/4 for more info.
|
||||
Update the `GithubOrgReaderProcessor` NOT to query for email addresses if GitHub Apps is used for authentication, this is due to inconsistencies in the GitHub API when using server to server communications and installation tokens. See [this community discussion](https://github.community/t/api-v4-unable-to-retrieve-email-resource-not-accessible-by-integration/13831/4) for more info.
|
||||
|
||||
**Removes** deprecated GithubOrgReaderProcessor provider configuration(`catalog.processors.githubOrg`). If you're using the deprecated config section make sure to migrate to [integrations](https://backstage.io/docs/integrations/github/locations) instead.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/integration",
|
||||
"description": "Helpers for managing integrations towards external systems",
|
||||
"version": "0.7.2",
|
||||
"version": "0.7.3",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"license": "Apache-2.0",
|
||||
@@ -12,6 +12,9 @@
|
||||
"module": "dist/index.esm.js",
|
||||
"types": "dist/index.d.ts"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "common-library"
|
||||
},
|
||||
"homepage": "https://backstage.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -22,15 +25,15 @@
|
||||
"backstage"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "backstage-cli build",
|
||||
"lint": "backstage-cli lint",
|
||||
"test": "backstage-cli test",
|
||||
"prepack": "backstage-cli prepack",
|
||||
"postpack": "backstage-cli postpack",
|
||||
"clean": "backstage-cli clean"
|
||||
"build": "backstage-cli package build",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"prepack": "backstage-cli package prepack",
|
||||
"postpack": "backstage-cli package postpack",
|
||||
"clean": "backstage-cli package clean"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/config": "^0.1.13",
|
||||
"@backstage/config": "^0.1.14",
|
||||
"cross-fetch": "^3.1.5",
|
||||
"git-url-parse": "^11.6.0",
|
||||
"@octokit/rest": "^18.5.3",
|
||||
@@ -39,9 +42,9 @@
|
||||
"lodash": "^4.17.21"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.13.2-next.0",
|
||||
"@backstage/config-loader": "^0.9.3",
|
||||
"@backstage/test-utils": "^0.2.4-next.0",
|
||||
"@backstage/cli": "^0.14.0",
|
||||
"@backstage/config-loader": "^0.9.4",
|
||||
"@backstage/test-utils": "^0.2.5",
|
||||
"@types/jest": "^26.0.7",
|
||||
"@types/luxon": "^2.0.4",
|
||||
"msw": "^0.35.0"
|
||||
|
||||
@@ -82,11 +82,7 @@ export function readGitLabIntegrationConfig(
|
||||
baseUrl = `https://${host}`;
|
||||
}
|
||||
|
||||
if (host.includes(':')) {
|
||||
throw new Error(
|
||||
`Invalid GitLab integration config, host '${host}' should just be the host name (e.g. "github.com"), not a URL`,
|
||||
);
|
||||
} else if (!isValidHost(host)) {
|
||||
if (!isValidHost(host)) {
|
||||
throw new Error(
|
||||
`Invalid GitLab integration config, '${host}' is not a valid host`,
|
||||
);
|
||||
|
||||
@@ -138,7 +138,7 @@ export async function getProjectId(
|
||||
// Convert
|
||||
// to: https://gitlab.com/api/v4/projects/groupA%2Fteams%2FsubgroupA%2FteamA%2Frepo
|
||||
const repoIDLookup = new URL(
|
||||
`${url.protocol + url.hostname}/api/v4/projects/${encodeURIComponent(
|
||||
`${url.origin}/api/v4/projects/${encodeURIComponent(
|
||||
repo.replace(/^\//, ''),
|
||||
)}`,
|
||||
);
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# @backstage/release-manifests
|
||||
|
||||
## 0.0.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 1ed305728b: Bump `node-fetch` to version 2.6.7 and `cross-fetch` to version 3.1.5
|
||||
- c77c5c7eb6: Added `backstage.role` to `package.json`
|
||||
|
||||
## 0.0.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/release-manifests",
|
||||
"description": "Helper library for receiving release manifests",
|
||||
"version": "0.0.1",
|
||||
"version": "0.0.2",
|
||||
"private": false,
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
@@ -11,6 +11,9 @@
|
||||
"module": "dist/index.esm.js",
|
||||
"types": "dist/index.d.ts"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "common-library"
|
||||
},
|
||||
"homepage": "https://backstage.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -22,18 +25,18 @@
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
"build": "backstage-cli build",
|
||||
"lint": "backstage-cli lint",
|
||||
"test": "backstage-cli test",
|
||||
"prepack": "backstage-cli prepack",
|
||||
"postpack": "backstage-cli postpack",
|
||||
"clean": "backstage-cli clean"
|
||||
"build": "backstage-cli package build",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"prepack": "backstage-cli package prepack",
|
||||
"postpack": "backstage-cli package postpack",
|
||||
"clean": "backstage-cli package clean"
|
||||
},
|
||||
"dependencies": {
|
||||
"cross-fetch": "^3.1.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/test-utils": "^0.2.3",
|
||||
"@backstage/test-utils": "^0.2.5",
|
||||
"msw": "^0.35.0",
|
||||
"@types/jest": "^26.0.7",
|
||||
"@types/node": "^14.14.32"
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
# @backstage/search-common
|
||||
|
||||
## 0.2.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Fix for the previous release with missing type declarations.
|
||||
- Updated dependencies
|
||||
- @backstage/types@0.1.3
|
||||
- @backstage/plugin-permission-common@0.5.1
|
||||
|
||||
## 0.2.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- c77c5c7eb6: Added `backstage.role` to `package.json`
|
||||
- Updated dependencies
|
||||
- @backstage/plugin-permission-common@0.5.0
|
||||
- @backstage/types@0.1.2
|
||||
|
||||
## 0.2.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/search-common",
|
||||
"description": "Common functionalities for Search, to be shared between various search-enabled plugins",
|
||||
"version": "0.2.2",
|
||||
"version": "0.2.3",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"private": false,
|
||||
@@ -10,6 +10,9 @@
|
||||
"main": "dist/index.cjs.js",
|
||||
"types": "dist/index.d.ts"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "common-library"
|
||||
},
|
||||
"homepage": "https://backstage.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -25,22 +28,22 @@
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "backstage-cli build --outputs cjs,types",
|
||||
"lint": "backstage-cli lint",
|
||||
"test": "backstage-cli test",
|
||||
"prepack": "backstage-cli prepack",
|
||||
"postpack": "backstage-cli postpack",
|
||||
"clean": "backstage-cli clean"
|
||||
"build": "backstage-cli package build",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"prepack": "backstage-cli package prepack",
|
||||
"postpack": "backstage-cli package postpack",
|
||||
"clean": "backstage-cli package clean"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/backstage/backstage/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/types": "^0.1.1",
|
||||
"@backstage/plugin-permission-common": "^0.4.0-next.0"
|
||||
"@backstage/types": "^0.1.2",
|
||||
"@backstage/plugin-permission-common": "^0.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.13.2-next.0"
|
||||
"@backstage/cli": "^0.14.0"
|
||||
},
|
||||
"jest": {
|
||||
"roots": [
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
# techdocs-cli-embedded-app
|
||||
|
||||
## 0.2.64
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- @backstage/cli@0.14.0
|
||||
- @backstage/core-app-api@0.5.3
|
||||
- @backstage/core-components@0.8.9
|
||||
- @backstage/core-plugin-api@0.6.1
|
||||
- @backstage/integration-react@0.1.22
|
||||
- @backstage/test-utils@0.2.5
|
||||
- @backstage/plugin-catalog@0.8.0
|
||||
- @backstage/plugin-techdocs@0.13.4
|
||||
- @backstage/app-defaults@0.1.8
|
||||
- @backstage/catalog-model@0.10.0
|
||||
- @backstage/config@0.1.14
|
||||
- @backstage/theme@0.2.15
|
||||
|
||||
## 0.2.63
|
||||
|
||||
### Patch Changes
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user