chore: moving the routeRefs to the new scaffolder-react package
Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
@@ -0,0 +1 @@
|
||||
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
|
||||
@@ -0,0 +1,14 @@
|
||||
# Scaffolder React
|
||||
|
||||
WORK IN PROGRESS
|
||||
|
||||
This is shared code of the frontend part of the default Scaffolder plugin.
|
||||
|
||||
It will implement the core API for working with the Scaffolder, and
|
||||
supplies components that can be reused by third-party plugins.
|
||||
|
||||
## Links
|
||||
|
||||
- [Frontend part of the plugin](https://github.com/backstage/backstage/tree/master/plugins/scaffolder)
|
||||
- [Backend part of the plugin](https://github.com/backstage/backstage/tree/master/plugins/scaffolder-backend)
|
||||
- [The Backstage homepage](https://backstage.io)
|
||||
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"name": "@backstage/plugin-scaffolder-react",
|
||||
"description": "A frontend library that helps other Backstage plugins interact with the Scaffolder",
|
||||
"version": "1.0.0",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"license": "Apache-2.0",
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"main": "dist/index.esm.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"alphaTypes": "dist/index.alpha.d.ts"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "web-library"
|
||||
},
|
||||
"homepage": "https://backstage.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/backstage/backstage",
|
||||
"directory": "plugins/scaffolder-react"
|
||||
},
|
||||
"keywords": [
|
||||
"backstage"
|
||||
],
|
||||
"scripts": {
|
||||
"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/catalog-client": "workspace:^",
|
||||
"@backstage/catalog-model": "workspace:^",
|
||||
"@backstage/core-components": "workspace:^",
|
||||
"@backstage/core-plugin-api": "workspace:^",
|
||||
"@backstage/errors": "workspace:^",
|
||||
"@backstage/theme": "workspace:^",
|
||||
"@backstage/types": "workspace:^",
|
||||
"@backstage/version-bridge": "workspace:^",
|
||||
"@material-ui/core": "^4.12.2",
|
||||
"@material-ui/icons": "^4.9.1",
|
||||
"@material-ui/lab": "4.0.0-alpha.57"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "^16.13.1 || ^17.0.0",
|
||||
"react": "^16.13.1 || ^17.0.0",
|
||||
"react-router-dom": "6.0.0-beta.0 || ^6.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "workspace:^",
|
||||
"@backstage/core-app-api": "workspace:^",
|
||||
"@backstage/plugin-catalog-common": "workspace:^",
|
||||
"@backstage/plugin-scaffolder-common": "workspace:^",
|
||||
"@backstage/test-utils": "workspace:^",
|
||||
"@testing-library/jest-dom": "^5.10.1",
|
||||
"@testing-library/react": "^12.1.3",
|
||||
"@testing-library/react-hooks": "^8.0.0",
|
||||
"@testing-library/user-event": "^14.0.0"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"alpha"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright 2022 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './routes';
|
||||
@@ -45,6 +45,7 @@
|
||||
"@backstage/plugin-catalog-react": "workspace:^",
|
||||
"@backstage/plugin-permission-react": "workspace:^",
|
||||
"@backstage/plugin-scaffolder-common": "workspace:^",
|
||||
"@backstage/plugin-scaffolder-react": "workspace:^",
|
||||
"@backstage/theme": "workspace:^",
|
||||
"@backstage/types": "workspace:^",
|
||||
"@codemirror/language": "^6.0.0",
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
import React from 'react';
|
||||
import { scaffolderApiRef } from '../../api';
|
||||
import { ActionsPage } from './ActionsPage';
|
||||
import { rootRouteRef } from '../../routes';
|
||||
import { rootRouteRef } from '@backstage/plugin-scaffolder-react';
|
||||
import { renderInTestApp, TestApiRegistry } from '@backstage/test-utils';
|
||||
import { ApiProvider } from '@backstage/core-app-api';
|
||||
import { ScaffolderApi } from '../../types';
|
||||
|
||||
@@ -26,7 +26,7 @@ import { identityApiRef } from '@backstage/core-plugin-api';
|
||||
import { ListTasksPage } from './ListTasksPage';
|
||||
import { ScaffolderApi } from '../../types';
|
||||
import { scaffolderApiRef } from '../../api';
|
||||
import { rootRouteRef } from '../../routes';
|
||||
import { rootRouteRef } from '@backstage/plugin-scaffolder-react';
|
||||
import { act, fireEvent } from '@testing-library/react';
|
||||
|
||||
describe('<ListTasksPage />', () => {
|
||||
|
||||
@@ -29,7 +29,7 @@ import { CatalogFilterLayout } from '@backstage/plugin-catalog-react';
|
||||
import useAsync from 'react-use/lib/useAsync';
|
||||
import React, { useState } from 'react';
|
||||
import { scaffolderApiRef } from '../../api';
|
||||
import { rootRouteRef } from '../../routes';
|
||||
import { rootRouteRef } from '@backstage/plugin-scaffolder-react';
|
||||
import { ScaffolderTask } from '../../types';
|
||||
import { OwnerListPicker } from './OwnerListPicker';
|
||||
import {
|
||||
|
||||
@@ -39,7 +39,7 @@ import * as fieldOverrides from './FieldOverrides';
|
||||
import { LayoutOptions } from '../../layouts';
|
||||
import { ReviewStepProps } from '../types';
|
||||
import { ReviewStep } from './ReviewStep';
|
||||
import { selectedTemplateRouteRef } from '../../routes';
|
||||
import { selectedTemplateRouteRef } from '@backstage/plugin-scaffolder-react';
|
||||
import { extractSchemaFromStep } from '../../next/TemplateWizardPage/Stepper/schema';
|
||||
|
||||
const Form = withTheme(MuiTheme);
|
||||
|
||||
@@ -43,7 +43,7 @@ import {
|
||||
scaffolderListTaskRouteRef,
|
||||
scaffolderTaskRouteRef,
|
||||
selectedTemplateRouteRef,
|
||||
} from '../routes';
|
||||
} from '@backstage/plugin-scaffolder-react';
|
||||
import { ListTasksPage } from './ListTasksPage';
|
||||
import { LayoutOptions, LAYOUTS_KEY, LAYOUTS_WRAPPER_KEY } from '../layouts';
|
||||
import { ReviewStepProps } from './types';
|
||||
|
||||
@@ -34,7 +34,7 @@ import {
|
||||
UserListPicker,
|
||||
} from '@backstage/plugin-catalog-react';
|
||||
import React, { ComponentType } from 'react';
|
||||
import { registerComponentRouteRef } from '../../routes';
|
||||
import { registerComponentRouteRef } from '@backstage/plugin-scaffolder-react';
|
||||
import { TemplateList } from '../TemplateList';
|
||||
import { TemplateTypePicker } from '../TemplateTypePicker';
|
||||
import { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common';
|
||||
|
||||
@@ -18,7 +18,7 @@ import userEvent from '@testing-library/user-event';
|
||||
import { renderInTestApp } from '@backstage/test-utils';
|
||||
import { screen } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { rootRouteRef } from '../../routes';
|
||||
import { rootRouteRef } from '@backstage/plugin-scaffolder-react';
|
||||
import { ScaffolderPageContextMenu } from './ScaffolderPageContextMenu';
|
||||
|
||||
describe('ScaffolderPageContextMenu', () => {
|
||||
|
||||
@@ -32,7 +32,7 @@ import {
|
||||
actionsRouteRef,
|
||||
editRouteRef,
|
||||
scaffolderListTaskRouteRef,
|
||||
} from '../../routes';
|
||||
} from '@backstage/plugin-scaffolder-react';
|
||||
|
||||
const useStyles = makeStyles({
|
||||
button: {
|
||||
|
||||
@@ -51,7 +51,7 @@ import {
|
||||
rootRouteRef,
|
||||
scaffolderTaskRouteRef,
|
||||
selectedTemplateRouteRef,
|
||||
} from '../../routes';
|
||||
} from '@backstage/plugin-scaffolder-react';
|
||||
import { ScaffolderTaskStatus, ScaffolderTaskOutput } from '../../types';
|
||||
import { useTaskEventStream } from '../hooks/useEventStream';
|
||||
import { TaskErrors } from './TaskErrors';
|
||||
|
||||
@@ -61,7 +61,10 @@ import {
|
||||
import LanguageIcon from '@material-ui/icons/Language';
|
||||
import WarningIcon from '@material-ui/icons/Warning';
|
||||
import React from 'react';
|
||||
import { selectedTemplateRouteRef, viewTechDocRouteRef } from '../../routes';
|
||||
import {
|
||||
selectedTemplateRouteRef,
|
||||
viewTechDocRouteRef,
|
||||
} from '@backstage/plugin-scaffolder-react';
|
||||
|
||||
const useStyles = makeStyles(theme => ({
|
||||
cardHeader: {
|
||||
|
||||
@@ -24,7 +24,7 @@ import React from 'react';
|
||||
import { Route, Routes } from 'react-router-dom';
|
||||
import { scaffolderApiRef } from '../../api';
|
||||
import { ScaffolderApi } from '../../types';
|
||||
import { rootRouteRef } from '../../routes';
|
||||
import { rootRouteRef } from '@backstage/plugin-scaffolder-react';
|
||||
import { TemplatePage } from './TemplatePage';
|
||||
import {
|
||||
featureFlagsApiRef,
|
||||
|
||||
@@ -26,7 +26,7 @@ import {
|
||||
rootRouteRef,
|
||||
scaffolderTaskRouteRef,
|
||||
selectedTemplateRouteRef,
|
||||
} from '../../routes';
|
||||
} from '@backstage/plugin-scaffolder-react';
|
||||
import { MultistepJsonForm } from '../MultistepJsonForm';
|
||||
import { createValidator } from './createValidator';
|
||||
|
||||
|
||||
@@ -62,12 +62,14 @@ export {
|
||||
scaffolderPlugin,
|
||||
} from './plugin';
|
||||
export * from './components';
|
||||
|
||||
export {
|
||||
rootRouteRef,
|
||||
nextRouteRef,
|
||||
selectedTemplateRouteRef,
|
||||
nextSelectedTemplateRouteRef,
|
||||
} from './routes';
|
||||
} from '@backstage/plugin-scaffolder-react';
|
||||
|
||||
export type { TaskPageProps } from './components/TaskPage';
|
||||
|
||||
/** next exports */
|
||||
|
||||
@@ -28,7 +28,7 @@ import {
|
||||
import { useElementFilter } from '@backstage/core-plugin-api';
|
||||
import { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';
|
||||
import { TemplateGroupFilter } from '../TemplateListPage/TemplateGroups';
|
||||
import { nextSelectedTemplateRouteRef } from '../../routes';
|
||||
import { nextSelectedTemplateRouteRef } from '@backstage/plugin-scaffolder-react';
|
||||
import { SecretsContextProvider } from '../../components/secrets/SecretsContext';
|
||||
import type { FormProps } from '../types';
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
} from '@backstage/test-utils';
|
||||
import { TemplateCard } from './TemplateCard';
|
||||
import React from 'react';
|
||||
import { nextRouteRef } from '../../../routes';
|
||||
import { nextRouteRef } from '@backstage/plugin-scaffolder-react';
|
||||
import { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';
|
||||
import { RELATION_OWNED_BY } from '@backstage/catalog-model';
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ import React from 'react';
|
||||
import {
|
||||
nextSelectedTemplateRouteRef,
|
||||
viewTechDocRouteRef,
|
||||
} from '../../../routes';
|
||||
} from '@backstage/plugin-scaffolder-react';
|
||||
import { CardHeader } from './CardHeader';
|
||||
import { CardLink } from './CardLink';
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
TestApiProvider,
|
||||
} from '@backstage/test-utils';
|
||||
import React from 'react';
|
||||
import { nextRouteRef } from '../../routes';
|
||||
import { nextRouteRef } from '@backstage/plugin-scaffolder-react';
|
||||
import { TemplateListPage } from './TemplateListPage';
|
||||
|
||||
describe('TemplateListPage', () => {
|
||||
|
||||
@@ -35,7 +35,7 @@ import {
|
||||
import { CategoryPicker } from './CategoryPicker';
|
||||
import { RegisterExistingButton } from './RegisterExistingButton';
|
||||
import { useRouteRef } from '@backstage/core-plugin-api';
|
||||
import { registerComponentRouteRef } from '../../routes';
|
||||
import { registerComponentRouteRef } from '@backstage/plugin-scaffolder-react';
|
||||
import { TemplateGroupFilter, TemplateGroups } from './TemplateGroups';
|
||||
|
||||
export type TemplateListPageProps = {
|
||||
|
||||
@@ -35,7 +35,7 @@ import { createAsyncValidators } from './createAsyncValidators';
|
||||
import { useTemplateSchema } from './useTemplateSchema';
|
||||
import { ReviewState } from './ReviewState';
|
||||
import validator from '@rjsf/validator-ajv6';
|
||||
import { selectedTemplateRouteRef } from '../../../routes';
|
||||
import { selectedTemplateRouteRef } from '@backstage/plugin-scaffolder-react';
|
||||
import { useFormData } from './useFormData';
|
||||
import { FormProps } from '../../types';
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
import { act, fireEvent } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { scaffolderApiRef } from '../../api';
|
||||
import { nextRouteRef, rootRouteRef } from '../../routes';
|
||||
import { nextRouteRef, rootRouteRef } from '@backstage/plugin-scaffolder-react';
|
||||
import { ScaffolderApi } from '../../types';
|
||||
import { TemplateWizardPage } from './TemplateWizardPage';
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ import {
|
||||
nextRouteRef,
|
||||
scaffolderTaskRouteRef,
|
||||
selectedTemplateRouteRef,
|
||||
} from '../../routes';
|
||||
} from '@backstage/plugin-scaffolder-react';
|
||||
import { SecretsContext } from '../../components/secrets/SecretsContext';
|
||||
import { JsonValue } from '@backstage/types';
|
||||
import type { FormProps } from '../types';
|
||||
|
||||
@@ -40,7 +40,7 @@ import {
|
||||
registerComponentRouteRef,
|
||||
rootRouteRef,
|
||||
viewTechDocRouteRef,
|
||||
} from './routes';
|
||||
} from '@backstage/plugin-scaffolder-react';
|
||||
import {
|
||||
createApiFactory,
|
||||
createPlugin,
|
||||
|
||||
@@ -7450,6 +7450,37 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@backstage/plugin-scaffolder-react@workspace:^, @backstage/plugin-scaffolder-react@workspace:plugins/scaffolder-react":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@backstage/plugin-scaffolder-react@workspace:plugins/scaffolder-react"
|
||||
dependencies:
|
||||
"@backstage/catalog-client": "workspace:^"
|
||||
"@backstage/catalog-model": "workspace:^"
|
||||
"@backstage/cli": "workspace:^"
|
||||
"@backstage/core-app-api": "workspace:^"
|
||||
"@backstage/core-components": "workspace:^"
|
||||
"@backstage/core-plugin-api": "workspace:^"
|
||||
"@backstage/errors": "workspace:^"
|
||||
"@backstage/plugin-catalog-common": "workspace:^"
|
||||
"@backstage/plugin-scaffolder-common": "workspace:^"
|
||||
"@backstage/test-utils": "workspace:^"
|
||||
"@backstage/theme": "workspace:^"
|
||||
"@backstage/types": "workspace:^"
|
||||
"@backstage/version-bridge": "workspace:^"
|
||||
"@material-ui/core": ^4.12.2
|
||||
"@material-ui/icons": ^4.9.1
|
||||
"@material-ui/lab": 4.0.0-alpha.57
|
||||
"@testing-library/jest-dom": ^5.10.1
|
||||
"@testing-library/react": ^12.1.3
|
||||
"@testing-library/react-hooks": ^8.0.0
|
||||
"@testing-library/user-event": ^14.0.0
|
||||
peerDependencies:
|
||||
"@types/react": ^16.13.1 || ^17.0.0
|
||||
react: ^16.13.1 || ^17.0.0
|
||||
react-router-dom: 6.0.0-beta.0 || ^6.3.0
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@backstage/plugin-scaffolder@workspace:^, @backstage/plugin-scaffolder@workspace:plugins/scaffolder":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@backstage/plugin-scaffolder@workspace:plugins/scaffolder"
|
||||
@@ -7470,6 +7501,7 @@ __metadata:
|
||||
"@backstage/plugin-catalog-react": "workspace:^"
|
||||
"@backstage/plugin-permission-react": "workspace:^"
|
||||
"@backstage/plugin-scaffolder-common": "workspace:^"
|
||||
"@backstage/plugin-scaffolder-react": "workspace:^"
|
||||
"@backstage/test-utils": "workspace:^"
|
||||
"@backstage/theme": "workspace:^"
|
||||
"@backstage/types": "workspace:^"
|
||||
|
||||
Reference in New Issue
Block a user