@backstage/cli 0.22.4-next.0 → 0.22.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/README.md +1 -1
- package/dist/cjs/index/{PackageGraph-583328aa.cjs.js → PackageGraph-6ffddac0.cjs.js} +3 -3
- package/dist/cjs/index/{build-eb378232.cjs.js → build-690455c7.cjs.js} +11 -10
- package/dist/cjs/index/{buildBackend-3ff6a1aa.cjs.js → buildBackend-18a71bf8.cjs.js} +6 -6
- package/dist/cjs/index/{buildWorkspace-7f9d23b6.cjs.js → buildWorkspace-73cc4f62.cjs.js} +9 -8
- package/dist/cjs/index/{bump-ee1d7a65.cjs.js → bump-908de0a7.cjs.js} +6 -6
- package/dist/cjs/index/{clean-c050d998.cjs.js → clean-bcaa2bce.cjs.js} +4 -4
- package/dist/cjs/index/{clean-31a1f618.cjs.js → clean-dbaf1912.cjs.js} +2 -2
- package/dist/cjs/index/{config-37cf3eff.cjs.js → config-91c020e8.cjs.js} +3 -3
- package/dist/cjs/index/{createDistWorkspace-cd594c0f.cjs.js → createDistWorkspace-7a2e4e7c.cjs.js} +9 -8
- package/dist/cjs/index/{createPlugin-a2904ac4.cjs.js → createPlugin-1f3076dd.cjs.js} +4 -4
- package/dist/cjs/index/{diff-7484f58b.cjs.js → diff-1b811a3f.cjs.js} +2 -2
- package/dist/cjs/index/{docs-3dc75573.cjs.js → docs-b4ed46bc.cjs.js} +5 -5
- package/dist/cjs/index/entryPoints-e81a0dba.cjs.js +44 -0
- package/dist/cjs/index/{fix-049fbfc9.cjs.js → fix-32f89b30.cjs.js} +4 -4
- package/dist/cjs/index/{index-49993236.cjs.js → index-0e97de8a.cjs.js} +2 -2
- package/dist/cjs/index/{index-70b5e9f0.cjs.js → index-1490ba2b.cjs.js} +9 -8
- package/dist/cjs/index/{index-fc99613b.cjs.js → index-701ec917.cjs.js} +47 -47
- package/dist/cjs/index/{index-56f89375.cjs.js → index-bf0fa947.cjs.js} +12 -11
- package/dist/cjs/index/{info-5ceccf59.cjs.js → info-87cec93d.cjs.js} +3 -3
- package/dist/cjs/index/{install-69068763.cjs.js → install-470924e3.cjs.js} +4 -4
- package/dist/cjs/index/{lint-6ffcd019.cjs.js → lint-98d3c2e6.cjs.js} +4 -4
- package/dist/cjs/index/{lint-af391261.cjs.js → lint-b441473e.cjs.js} +4 -4
- package/dist/cjs/index/{lint-4c20bc10.cjs.js → lint-f1c44a12.cjs.js} +2 -2
- package/dist/cjs/index/{list-deprecations-d474804f.cjs.js → list-deprecations-3667c4a5.cjs.js} +4 -4
- package/dist/cjs/index/{new-0aa80b7a.cjs.js → new-8809aa5e.cjs.js} +78 -4
- package/dist/cjs/index/{pack-06a08024.cjs.js → pack-1a98c41d.cjs.js} +4 -3
- package/dist/cjs/index/{packageExports-ddd7a9dd.cjs.js → packageExports-6ec50196.cjs.js} +4 -4
- package/dist/cjs/index/{packageLintConfigs-3be64192.cjs.js → packageLintConfigs-2940d9d4.cjs.js} +4 -4
- package/dist/cjs/index/{packageRole-1c4efbb6.cjs.js → packageRole-0b957d76.cjs.js} +3 -3
- package/dist/cjs/index/{packageRoles-2d5ba047.cjs.js → packageRoles-9bc5d41a.cjs.js} +2 -2
- package/dist/cjs/index/{packageScripts-0c36bb2f.cjs.js → packageScripts-a21a7d39.cjs.js} +5 -5
- package/dist/cjs/index/{packages-ad97f7b8.cjs.js → packages-5184c06b.cjs.js} +3 -3
- package/dist/cjs/index/{paths-cbef9084.cjs.js → paths-e450a0ff.cjs.js} +11 -7
- package/dist/cjs/index/{print-453dcd69.cjs.js → print-14e7144f.cjs.js} +5 -5
- package/dist/cjs/index/{productionPack-2d16db59.cjs.js → productionPack-2038bfcf.cjs.js} +7 -44
- package/dist/cjs/index/{reactRouterDeps-a4c295bd.cjs.js → reactRouterDeps-7b459c9c.cjs.js} +5 -5
- package/dist/cjs/index/{run-d843bae0.cjs.js → run-8a335c20.cjs.js} +2 -2
- package/dist/cjs/index/{schema-4c760ac7.cjs.js → schema-2462c29a.cjs.js} +5 -5
- package/dist/cjs/index/{tasks-989067ef.cjs.js → tasks-7a221be0.cjs.js} +2 -2
- package/dist/cjs/index/{test-0ba8dd19.cjs.js → test-1fada493.cjs.js} +4 -4
- package/dist/cjs/index/{test-406b3cba.cjs.js → test-5f854226.cjs.js} +3 -3
- package/dist/cjs/index/{validate-ab69bd87.cjs.js → validate-8b9a3ee1.cjs.js} +5 -5
- package/dist/index.cjs.js +1 -1
- package/package.json +17 -17
- package/templates/default-backend-plugin/package.json.hbs +1 -1
- package/templates/default-node-plugin-package/.eslintrc.js +1 -0
- package/templates/default-node-plugin-package/README.md.hbs +5 -0
- package/templates/default-node-plugin-package/package.json.hbs +36 -0
- package/templates/default-node-plugin-package/src/index.ts.hbs +18 -0
- package/templates/default-node-plugin-package/src/setupTests.ts +1 -0
- package/templates/default-node-plugin-package/tsconfig.json +9 -0
- package/templates/default-plugin/package.json.hbs +1 -1
- package/templates/default-react-plugin-package/.eslintrc.js +1 -0
- package/templates/default-react-plugin-package/README.md.hbs +5 -0
- package/templates/default-react-plugin-package/package.json.hbs +47 -0
- package/templates/default-react-plugin-package/src/components/ExampleComponent/ExampleComponent.test.tsx +18 -0
- package/templates/default-react-plugin-package/src/components/ExampleComponent/ExampleComponent.tsx +29 -0
- package/templates/default-react-plugin-package/src/components/ExampleComponent/index.ts +2 -0
- package/templates/default-react-plugin-package/src/components/index.ts +5 -0
- package/templates/default-react-plugin-package/src/hooks/index.ts +5 -0
- package/templates/default-react-plugin-package/src/hooks/useExample/index.ts +1 -0
- package/templates/default-react-plugin-package/src/hooks/useExample/useExample.ts +15 -0
- package/templates/default-react-plugin-package/src/index.ts.hbs +12 -0
- package/templates/default-react-plugin-package/src/setupTests.ts +1 -0
- package/templates/default-react-plugin-package/tsconfig.json +11 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { screen } from '@testing-library/react';
|
|
3
|
+
import { renderInTestApp } from '@backstage/test-utils';
|
|
4
|
+
import { ExampleComponent } from './ExampleComponent';
|
|
5
|
+
|
|
6
|
+
describe('ExampleComponent', () => {
|
|
7
|
+
it('should render', async () => {
|
|
8
|
+
await renderInTestApp(<ExampleComponent />)
|
|
9
|
+
|
|
10
|
+
expect(screen.getByText('Hello World')).toBeInTheDocument();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should display a custom message', async () => {
|
|
14
|
+
await renderInTestApp(<ExampleComponent message={'Hello Example'} />)
|
|
15
|
+
|
|
16
|
+
expect(screen.getByText('Hello Example')).toBeInTheDocument();
|
|
17
|
+
})
|
|
18
|
+
})
|
package/templates/default-react-plugin-package/src/components/ExampleComponent/ExampleComponent.tsx
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Typography } from '@material-ui/core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Props for {@link ExampleComponent}.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export interface ExampleComponentProps {
|
|
10
|
+
message?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Displays an example.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
*
|
|
18
|
+
* Longer descriptions should be put after the `@remarks` tag. That way the initial summary
|
|
19
|
+
* will show up in the API docs overview section, while the longer description will only be
|
|
20
|
+
* displayed on the page for the specific API.
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export function ExampleComponent(props: ExampleComponentProps) {
|
|
25
|
+
// By destructuring props here rather than in the signature the API docs will look nicer
|
|
26
|
+
const { message = 'Hello World' } = props;
|
|
27
|
+
|
|
28
|
+
return <Typography variant="h1">{message}</Typography>;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useExample } from './useExample';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { useApi, alertApiRef } from '@backstage/core-plugin-api';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Shows an example alert.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export function useExample() {
|
|
10
|
+
const alertApi = useApi(alertApiRef);
|
|
11
|
+
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
alertApi.post({ message: 'Hello World!' });
|
|
14
|
+
}, [alertApi])
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/***/
|
|
2
|
+
/**
|
|
3
|
+
* Web library for the {{id}} plugin.
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// In this package you might for example export components or hooks
|
|
9
|
+
// that are useful to other plugins or modules.
|
|
10
|
+
|
|
11
|
+
export * from './components'
|
|
12
|
+
export * from './hooks'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|