Remove all internal usage of the Json types

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2021-10-22 15:52:51 +02:00
parent 73aff6c039
commit 56f182dde2
91 changed files with 110 additions and 82 deletions
+2
View File
@@ -33,6 +33,7 @@
"@backstage/backend-common": "^0.9.7",
"@backstage/config-loader": "^0.7.0",
"@backstage/config": "^0.1.8",
"@backstage/types": "^0.1.1",
"@types/express": "^4.17.6",
"express": "^4.17.1",
"express-promise-router": "^4.1.0",
@@ -42,6 +43,7 @@
},
"devDependencies": {
"@backstage/cli": "^0.8.0",
"@backstage/types": "^0.1.1",
"@types/supertest": "^2.0.8",
"msw": "^0.29.0",
"supertest": "^6.1.3"
+2 -1
View File
@@ -17,7 +17,8 @@
import fs from 'fs-extra';
import { resolve as resolvePath } from 'path';
import { Logger } from 'winston';
import { AppConfig, Config, JsonObject } from '@backstage/config';
import { AppConfig, Config } from '@backstage/config';
import { JsonObject } from '@backstage/types';
import { loadConfigSchema, readEnvConfig } from '@backstage/config-loader';
type InjectOptions = {
@@ -10,7 +10,7 @@ import { Config } from '@backstage/config';
import { EntityProvider } from '@backstage/plugin-catalog-backend';
import { EntityProviderConnection } from '@backstage/plugin-catalog-backend';
import { GroupEntity } from '@backstage/catalog-model';
import { JsonValue } from '@backstage/config';
import { JsonValue } from '@backstage/types';
import { LocationSpec } from '@backstage/catalog-model';
import { Logger as Logger_2 } from 'winston';
import { SearchEntry } from 'ldapjs';
@@ -33,6 +33,7 @@
"@backstage/config": "^0.1.10",
"@backstage/errors": "^0.1.3",
"@backstage/plugin-catalog-backend": "^0.17.1",
"@backstage/types": "^0.1.1",
"@types/ldapjs": "^2.2.0",
"ldapjs": "^2.2.0",
"lodash": "^4.17.21",
@@ -14,7 +14,8 @@
* limitations under the License.
*/
import { Config, JsonValue } from '@backstage/config';
import { Config } from '@backstage/config';
import { JsonValue } from '@backstage/types';
import { SearchOptions } from 'ldapjs';
import mergeWith from 'lodash/mergeWith';
import { RecursivePartial } from '@backstage/plugin-catalog-backend';
+2 -2
View File
@@ -18,8 +18,8 @@ import { EntityRelationSpec } from '@backstage/catalog-model';
import express from 'express';
import { GitHubIntegrationConfig } from '@backstage/integration';
import { IndexableDocument } from '@backstage/search-common';
import { JsonObject } from '@backstage/config';
import { JsonValue } from '@backstage/config';
import { JsonObject } from '@backstage/types';
import { JsonValue } from '@backstage/types';
import { Knex } from 'knex';
import { Location as Location_2 } from '@backstage/catalog-model';
import { LocationSpec } from '@backstage/catalog-model';
+1
View File
@@ -37,6 +37,7 @@
"@backstage/errors": "^0.1.3",
"@backstage/integration": "^0.6.8",
"@backstage/search-common": "^0.2.0",
"@backstage/types": "^0.1.1",
"@octokit/graphql": "^4.5.8",
"@types/express": "^4.17.6",
"aws-sdk": "^2.840.0",
@@ -15,7 +15,7 @@
*/
import { Entity, EntityRelationSpec } from '@backstage/catalog-model';
import { JsonObject } from '@backstage/config';
import { JsonObject } from '@backstage/types';
import { DateTime } from 'luxon';
import { DeferredEntity } from '../processing/types';
@@ -16,7 +16,7 @@
import { UrlReader } from '@backstage/backend-common';
import { Entity, LocationSpec } from '@backstage/catalog-model';
import { JsonValue } from '@backstage/config';
import { JsonValue } from '@backstage/types';
import { ScmIntegrationRegistry } from '@backstage/integration';
import yaml from 'yaml';
import { CatalogProcessor } from './types';
@@ -19,7 +19,7 @@ import {
EntityRelationSpec,
LocationSpec,
} from '@backstage/catalog-model';
import { JsonValue } from '@backstage/config';
import { JsonValue } from '@backstage/types';
export type CatalogProcessor = {
/**
@@ -29,7 +29,7 @@ import {
InputError,
NotAllowedError,
} from '@backstage/errors';
import { JsonValue } from '@backstage/config';
import { JsonValue } from '@backstage/types';
import { ScmIntegrationRegistry } from '@backstage/integration';
import path from 'path';
import { Logger } from 'winston';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { JsonObject, JsonValue } from '@backstage/config';
import { JsonObject, JsonValue } from '@backstage/types';
import { CatalogProcessor } from '../ingestion/processors';
import { CatalogProcessorCache } from '../ingestion/processors/types';
import { isObject } from './util';
@@ -15,7 +15,7 @@
*/
import { Entity, EntityRelationSpec } from '@backstage/catalog-model';
import { JsonObject } from '@backstage/config';
import { JsonObject } from '@backstage/types';
export type EntityProcessingRequest = {
entity: Entity;
@@ -24,7 +24,7 @@ import {
ORIGIN_LOCATION_ANNOTATION,
stringifyEntityRef,
} from '@backstage/catalog-model';
import { JsonObject, JsonValue } from '@backstage/config';
import { JsonObject, JsonValue } from '@backstage/types';
import { InputError } from '@backstage/errors';
import { ScmIntegrationRegistry } from '@backstage/integration';
import path from 'path';
+1
View File
@@ -33,6 +33,7 @@
"dependencies": {
"@backstage/catalog-model": "^0.9.5",
"@backstage/config": "^0.1.8",
"@backstage/types": "^0.1.1",
"@graphql-modules/core": "^0.7.17",
"apollo-server": "^2.16.1",
"cross-fetch": "^3.0.6",
@@ -16,7 +16,7 @@
import { Entity, EntityMeta } from '@backstage/catalog-model';
import fetch from 'cross-fetch';
import { JsonObject } from '@backstage/config';
import { JsonObject } from '@backstage/types';
export interface ReaderEntityMeta extends EntityMeta {
uid: string;
+1
View File
@@ -26,6 +26,7 @@
"@backstage/core-plugin-api": "^0.1.11",
"@backstage/errors": "^0.1.3",
"@backstage/theme": "^0.2.11",
"@backstage/types": "^0.1.1",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.57",
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { JsonValue } from '@backstage/config';
import { JsonValue } from '@backstage/types';
import { Box, Chip, Divider, makeStyles, Typography } from '@material-ui/core';
import { Schema } from 'jsonschema';
import React, { useEffect, useRef } from 'react';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { JsonValue } from '@backstage/config';
import { JsonValue } from '@backstage/types';
import {
Paper,
Table,
@@ -25,6 +25,7 @@
"@backstage/integration": "^0.6.2",
"@backstage/plugin-scaffolder-backend": "^0.15.10",
"@backstage/config": "^0.1.8",
"@backstage/types": "^0.1.1",
"command-exists": "^1.2.9",
"fs-extra": "10.0.0",
"winston": "^3.2.1",
@@ -29,7 +29,8 @@ import {
UrlReader,
ContainerRunner,
} from '@backstage/backend-common';
import { ConfigReader, JsonObject } from '@backstage/config';
import { ConfigReader } from '@backstage/config';
import { JsonObject } from '@backstage/types';
import { ScmIntegrations } from '@backstage/integration';
import mockFs from 'mock-fs';
import os from 'os';
@@ -19,7 +19,7 @@ import {
UrlReader,
resolveSafeChildPath,
} from '@backstage/backend-common';
import { JsonObject, JsonValue } from '@backstage/config';
import { JsonObject, JsonValue } from '@backstage/types';
import { InputError } from '@backstage/errors';
import { ScmIntegrations } from '@backstage/integration';
import commandExists from 'command-exists';
@@ -26,6 +26,7 @@
"@backstage/config": "^0.1.8",
"@backstage/errors": "^0.1.3",
"@backstage/integration": "^0.6.2",
"@backstage/types": "^0.1.1",
"command-exists": "^1.2.9",
"fs-extra": "^9.0.0"
},
@@ -15,7 +15,7 @@
*/
import { ContainerRunner, UrlReader } from '@backstage/backend-common';
import { JsonObject } from '@backstage/config';
import { JsonObject } from '@backstage/types';
import { InputError } from '@backstage/errors';
import { ScmIntegrations } from '@backstage/integration';
import fs from 'fs-extra';
@@ -23,7 +23,7 @@ import {
railsArgumentResolver,
RailsRunOptions,
} from './railsArgumentResolver';
import { JsonObject } from '@backstage/config';
import { JsonObject } from '@backstage/types';
import { Writable } from 'stream';
export class RailsNewRunner {
@@ -22,6 +22,7 @@
"dependencies": {
"@backstage/config": "^0.1.8",
"@backstage/plugin-scaffolder-backend": "^0.15.2",
"@backstage/types": "^0.1.1",
"winston": "^3.2.1",
"yeoman-environment": "^3.6.0"
},
@@ -23,7 +23,7 @@ import os from 'os';
import { PassThrough } from 'stream';
import { createRunYeomanAction } from './yeoman';
import type { ActionContext } from '@backstage/plugin-scaffolder-backend';
import { JsonObject } from '@backstage/config';
import { JsonObject } from '@backstage/types';
describe('run:yeoman', () => {
const mockTmpDir = os.tmpdir();
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { JsonObject } from '@backstage/config';
import { JsonObject } from '@backstage/types';
import { createTemplateAction } from '@backstage/plugin-scaffolder-backend';
import { yeomanRun } from './yeomanRun';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { JsonObject } from '@backstage/config';
import { JsonObject } from '@backstage/types';
/*
* This module should use '@types/yeoman-environment' eventually as soon as '@types/yeoman-environment' supports
+3 -5
View File
@@ -14,10 +14,8 @@ import { createFetchCookiecutterAction } from '@backstage/plugin-scaffolder-back
import { createPullRequest } from 'octokit-plugin-create-pull-request';
import { Entity } from '@backstage/catalog-model';
import express from 'express';
import { JsonObject } from '@backstage/config';
import { JsonObject as JsonObject_2 } from '@backstage/types';
import { JsonValue } from '@backstage/config';
import { JsonValue as JsonValue_2 } from '@backstage/types';
import { JsonObject } from '@backstage/types';
import { JsonValue } from '@backstage/types';
import { LocationSpec } from '@backstage/catalog-model';
import { Logger as Logger_2 } from 'winston';
import { Octokit } from '@octokit/rest';
@@ -185,7 +183,7 @@ export function createRouter(options: RouterOptions): Promise<express.Router>;
// @public (undocumented)
export const createTemplateAction: <
Input extends Partial<{
[name: string]: JsonValue_2 | Partial<JsonObject_2> | undefined;
[name: string]: JsonValue | Partial<JsonObject> | undefined;
}>,
>(
templateAction: TemplateAction<Input>,
+1
View File
@@ -39,6 +39,7 @@
"@backstage/plugin-catalog-backend": "^0.17.1",
"@backstage/plugin-scaffolder-common": "^0.1.0",
"@backstage/plugin-scaffolder-backend-module-cookiecutter": "^0.1.2",
"@backstage/types": "^0.1.1",
"@gitbeaker/core": "^30.2.0",
"@gitbeaker/node": "^30.2.0",
"@octokit/rest": "^18.5.3",
@@ -15,7 +15,7 @@
*/
import { resolveSafeChildPath, UrlReader } from '@backstage/backend-common';
import { JsonValue } from '@backstage/config';
import { JsonValue } from '@backstage/types';
import { InputError } from '@backstage/errors';
import { ScmIntegrations } from '@backstage/integration';
import fs from 'fs-extra';
@@ -17,7 +17,7 @@ import { createTemplateAction } from '../../createTemplateAction';
import { resolveSafeChildPath } from '@backstage/backend-common';
import { InputError } from '@backstage/errors';
import { JsonObject } from '@backstage/config';
import { JsonObject } from '@backstage/types';
import fs from 'fs-extra';
interface FilesToRename extends JsonObject {
@@ -16,7 +16,7 @@
import { Logger } from 'winston';
import { Writable } from 'stream';
import { JsonValue, JsonObject } from '@backstage/config';
import { JsonValue, JsonObject } from '@backstage/types';
import { Schema } from 'jsonschema';
type PartialJsonObject = Partial<JsonObject>;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { JsonObject } from '@backstage/config';
import { JsonObject } from '@backstage/types';
import { resolvePackagePath } from '@backstage/backend-common';
import { ConflictError, NotFoundError } from '@backstage/errors';
import { Knex } from 'knex';
@@ -26,7 +26,7 @@ import * as winston from 'winston';
import nunjucks from 'nunjucks';
import fs from 'fs-extra';
import path from 'path';
import { JsonObject, JsonValue } from '@backstage/config';
import { JsonObject, JsonValue } from '@backstage/types';
import { InputError } from '@backstage/errors';
import { PassThrough } from 'stream';
import { isTruthy } from './helper';
@@ -31,7 +31,7 @@ import { Logger } from 'winston';
import path from 'path';
import fs from 'fs-extra';
import { validate as validateJsonSchema } from 'jsonschema';
import { JsonObject, JsonValue } from '@backstage/config';
import { JsonObject, JsonValue } from '@backstage/types';
import { InputError } from '@backstage/errors';
type Options = {
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { JsonObject } from '@backstage/config';
import { JsonObject } from '@backstage/types';
import { assertError } from '@backstage/errors';
import { Logger } from 'winston';
import {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { JsonValue, JsonObject } from '@backstage/config';
import { JsonValue, JsonObject } from '@backstage/types';
export type Status =
| 'open'
+1 -1
View File
@@ -4,7 +4,7 @@
```ts
import { Entity } from '@backstage/catalog-model';
import { JsonObject } from '@backstage/config';
import { JsonObject } from '@backstage/types';
import { JSONSchema } from '@backstage/catalog-model';
// @public (undocumented)
+1 -1
View File
@@ -37,7 +37,7 @@
},
"dependencies": {
"@backstage/catalog-model": "^0.9.5",
"@backstage/config": "^0.1.10"
"@backstage/types": "^0.1.1"
},
"devDependencies": {
"@backstage/cli": "^0.8.0"
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { JsonObject } from '@backstage/config';
import { JsonObject } from '@backstage/types';
import { Entity } from '@backstage/catalog-model';
/** @public */
+2 -2
View File
@@ -19,9 +19,9 @@ import { FieldProps } from '@rjsf/core';
import { FieldValidation } from '@rjsf/core';
import { IconButton } from '@material-ui/core';
import { IdentityApi } from '@backstage/core-plugin-api';
import { JsonObject } from '@backstage/config';
import { JsonObject } from '@backstage/types';
import { JSONSchema } from '@backstage/catalog-model';
import { JsonValue } from '@backstage/config';
import { JsonValue } from '@backstage/types';
import { Observable } from '@backstage/core-plugin-api';
import { default as React_2 } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';
+1
View File
@@ -41,6 +41,7 @@
"@backstage/integration-react": "^0.1.12",
"@backstage/plugin-catalog-react": "^0.6.1",
"@backstage/theme": "^0.2.11",
"@backstage/types": "^0.1.1",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.57",
+1 -1
View File
@@ -15,7 +15,7 @@
*/
import { EntityName } from '@backstage/catalog-model';
import { JsonObject, JsonValue } from '@backstage/config';
import { JsonObject, JsonValue } from '@backstage/types';
import { ResponseError } from '@backstage/errors';
import { ScmIntegrationRegistry } from '@backstage/integration';
import { Field, FieldValidation } from '@rjsf/core';
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { JsonObject } from '@backstage/config';
import { JsonObject } from '@backstage/types';
import {
Box,
Button,
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { JsonObject } from '@backstage/config';
import { JsonObject } from '@backstage/types';
import { FormProps } from '@rjsf/core';
function isObject(value: unknown): value is JsonObject {
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { JsonObject, JsonValue } from '@backstage/config';
import { JsonObject, JsonValue } from '@backstage/types';
import { LinearProgress } from '@material-ui/core';
import { FormValidation, IChangeEvent } from '@rjsf/core';
import React, { useCallback, useState } from 'react';
+1 -1
View File
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { JSONSchema } from '@backstage/catalog-model';
import { JsonValue } from '@backstage/config';
import { JsonValue } from '@backstage/types';
export type Status = 'open' | 'processing' | 'failed' | 'completed' | 'skipped';
export type JobStatus = 'PENDING' | 'STARTED' | 'COMPLETED' | 'FAILED';
+1 -1
View File
@@ -9,7 +9,7 @@ import { ApiRef } from '@backstage/core-plugin-api';
import { AsyncState } from 'react-use/lib/useAsync';
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { IndexableDocument } from '@backstage/search-common';
import { JsonObject } from '@backstage/config';
import { JsonObject } from '@backstage/types';
import { default as React_2 } from 'react';
import { ReactElement } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';
+1
View File
@@ -38,6 +38,7 @@
"@backstage/plugin-catalog-react": "^0.6.1",
"@backstage/search-common": "^0.2.0",
"@backstage/theme": "^0.2.11",
"@backstage/types": "^0.1.1",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.57",
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { JsonObject } from '@backstage/config';
import { JsonObject } from '@backstage/types';
import { useApi } from '@backstage/core-plugin-api';
import { SearchResultSet } from '@backstage/search-common';
import React, {
@@ -19,7 +19,7 @@ import { usePrevious } from 'react-use';
import qs from 'qs';
import { useLocation, useOutlet } from 'react-router';
import { SearchContextProvider, useSearch } from '../SearchContext';
import { JsonObject } from '@backstage/config';
import { JsonObject } from '@backstage/types';
import { LegacySearchPage } from '../LegacySearchPage';
export const UrlUpdater = () => {