rename npm namespace from @spotify-backstage to @backstage

This commit is contained in:
Patrik Oldsberg
2020-03-25 19:12:11 +01:00
parent 5c26725361
commit 3a0d8edcb5
35 changed files with 51 additions and 58 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
const path = require('path')
const base = require('@spotify-backstage/cli/config/eslint');
const path = require('path');
const base = require('@backstage/cli/config/eslint');
module.exports = {
...base,
@@ -8,7 +8,7 @@ module.exports = {
'notice/notice': [
'error',
{
templateFile: path.resolve(__dirname, "scripts/copyright.js"),
templateFile: path.resolve(__dirname, 'scripts/copyright.js'),
},
],
},
+1 -1
View File
@@ -40,7 +40,7 @@ The app will call the `createPlugin` method on each plugin, passing in a `router
of methods on it.
```typescript
import { createPlugin } from '@spotify-backstage/core';
import { createPlugin } from '@backstage/core';
import ExampleComponent from './components/ExampleComponent';
export default createPlugin({
@@ -43,7 +43,7 @@ In the root folder you have some configuration for typescript and jest, the test
In the `src` folder we get to the interesting bits. Check out the `plugin.ts`:
```jsx
import { createPlugin } from '@spotify-backstage/core';
import { createPlugin } from '@backstage/core';
import ExampleComponent from './components/ExampleComponent';
export default createPlugin({
+1 -1
View File
@@ -26,7 +26,7 @@ type PluginHooks = {
Showcasing adding multiple routes and a redirect.
```jsx
import { createPlugin } from '@spotify-backstage/core';
import { createPlugin } from '@backstage/core';
import ExampleComponent from './components/ExampleComponent';
export default createPlugin({
+1 -1
View File
@@ -5,7 +5,7 @@
"node": ">=12.0.0"
},
"scripts": {
"start": "yarn build && yarn workspace @spotify-backstage/app start",
"start": "yarn build && yarn workspace @backstage/app start",
"build": "lerna run build",
"test": "cross-env CI=true lerna run test --since origin/master -- --coverage",
"create-plugin": "backstage-cli create-plugin",
+1 -1
View File
@@ -1,3 +1,3 @@
# @spotify-backstage/app
# @backstage/app
This package is an example of a Backstage application.
+5 -5
View File
@@ -1,15 +1,15 @@
{
"name": "@spotify-backstage/app",
"name": "@backstage/app",
"version": "0.0.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.9.1",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"@spotify-backstage/cli": "^0.1.0",
"@spotify-backstage/core": "^0.1.0",
"@spotify-backstage/plugin-home-page": "^0.1.0",
"@spotify-backstage/plugin-welcome": "^0.1.0",
"@backstage/cli": "^0.1.0",
"@backstage/core": "^0.1.0",
"@backstage/plugin-home-page": "^0.1.0",
"@backstage/plugin-welcome": "^0.1.0",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
+1 -1
View File
@@ -15,7 +15,7 @@
*/
import { CssBaseline, makeStyles, ThemeProvider } from '@material-ui/core';
import { BackstageTheme, createApp } from '@spotify-backstage/core';
import { BackstageTheme, createApp } from '@backstage/core';
import React, { FC } from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import Root from './components/Root';
+1 -1
View File
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { ApiHolder, ApiRegistry, errorApiRef } from '@spotify-backstage/core';
import { ApiHolder, ApiRegistry, errorApiRef } from '@backstage/core';
import { ErrorDisplayForwarder } from './components/ErrorDisplay/ErrorDisplay';
const builder = ApiRegistry.builder();
@@ -18,7 +18,7 @@ import React, { FC, useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import { Snackbar } from '@material-ui/core';
import { Alert } from '@material-ui/lab';
import { ErrorApi, ErrorContext } from '@spotify-backstage/core';
import { ErrorApi, ErrorContext } from '@backstage/core';
type SubscriberFunc = (error: Error) => void;
type Unsubscribe = () => void;
+1 -1
View File
@@ -28,7 +28,7 @@ import {
SidebarSpacer,
SidebarDivider,
SidebarSpace,
} from '@spotify-backstage/core';
} from '@backstage/core';
const useSidebarLogoStyles = makeStyles({
root: {
+2 -2
View File
@@ -1,3 +1,3 @@
/* eslint-disable notice/notice */
export { default as HomePagePlugin } from '@spotify-backstage/plugin-home-page';
export { default as WelcomePlugin } from '@spotify-backstage/plugin-welcome';
export { default as HomePagePlugin } from '@backstage/plugin-home-page';
export { default as WelcomePlugin } from '@backstage/plugin-welcome';
+1 -1
View File
@@ -1,5 +1,5 @@
{
"name": "@spotify-backstage/cli",
"name": "@backstage/cli",
"description": "CLI for developing Backstage plugins and apps",
"version": "0.1.0",
"private": false,
@@ -59,9 +59,8 @@ describe('createPlugin', () => {
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'test-'));
try {
const sourceData =
'{"name": "@spotify-backstage/{{id}}", "version": "{{version}}"}';
const targetData =
'{"name": "@spotify-backstage/foo", "version": "0.0.0"}';
'{"name": "@backstage/{{id}}", "version": "{{version}}"}';
const targetData = '{"name": "@backstage/foo", "version": "0.0.0"}';
const sourcePath = path.join(tempDir, 'in.hbs');
const targetPath = path.join(tempDir, 'out.json');
fs.writeFileSync(sourcePath, sourceData);
@@ -130,7 +130,7 @@ export const addPluginDependencyToApp = (
console.log();
console.log(chalk.green(' Adding plugin as dependency in app:'));
const pluginPackage = `@spotify-backstage/plugin-${pluginName}`;
const pluginPackage = `@backstage/plugin-${pluginName}`;
const packageFile = path.join(rootDir, 'packages', 'app', 'package.json');
process.stdout.write(
@@ -171,7 +171,7 @@ export const addPluginToApp = (rootDir: string, pluginName: string) => {
console.log();
console.log(chalk.green(' Import plugin in app:'));
const pluginPackage = `@spotify-backstage/plugin-${pluginName}`;
const pluginPackage = `@backstage/plugin-${pluginName}`;
const pluginNameCapitalized = pluginName
.split('-')
.map(name => capitalize(name))
@@ -414,7 +414,7 @@ const createPlugin = async () => {
console.log(
chalk.green(
`🥇 Successfully created ${chalk.cyan(
`@spotify-backstage/plugin-${answers.id}`,
`@backstage/plugin-${answers.id}`,
)}`,
),
);
@@ -26,7 +26,7 @@ import { waitForExit } from '../../helpers/run';
const PACKAGE_BLACKLIST = [
// We never want to watch for changes in the cli, but all packages will depend on it.
'@spotify-backstage/cli',
'@backstage/cli',
];
const WATCH_LOCATIONS = ['package.json', 'src', 'assets'];
@@ -1,5 +1,5 @@
{
"name": "@spotify-backstage/plugin-{{id}}",
"name": "@backstage/plugin-{{id}}",
"version": "{{version}}",
"main": "dist/cjs/index.js",
"types": "dist/cjs/index.d.ts",
@@ -11,7 +11,7 @@
"test": "backstage-cli test"
},
"devDependencies": {
"@spotify-backstage/cli": "^{{version}}",
"@backstage/cli": "^{{version}}",
"@types/testing-library__jest-dom": "5.0.2",
"jest-fetch-mock": "^3.0.3"
},
@@ -19,7 +19,7 @@ import { render } from '@testing-library/react';
import mockFetch from 'jest-fetch-mock';
import ExampleComponent from './ExampleComponent';
import { ThemeProvider } from '@material-ui/core';
import { BackstageTheme } from '@spotify-backstage/core';
import { BackstageTheme } from '@backstage/core';
describe('ExampleComponent', () => {
it('should render', () => {
@@ -25,7 +25,7 @@ import {
ContentHeader,
HeaderLabel,
SupportButton,
} from '@spotify-backstage/core';
} from '@backstage/core';
import ExampleFetchComponent from '../ExampleFetchComponent';
const ExampleComponent: FC<{}> = () => (
@@ -25,7 +25,7 @@ import TableHead from '@material-ui/core/TableHead';
import TableRow from '@material-ui/core/TableRow';
import Alert from '@material-ui/lab/Alert';
import { useAsync } from 'react-use';
import { Progress } from '@spotify-backstage/core';
import { Progress } from '@backstage/core';
const useStyles = makeStyles({
table: {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { createPlugin } from '@spotify-backstage/core';
import { createPlugin } from '@backstage/core';
import ExampleComponent from './components/ExampleComponent';
export default createPlugin({
+2 -2
View File
@@ -1,5 +1,5 @@
{
"name": "@spotify-backstage/core",
"name": "@backstage/core",
"description": "Core API used by Backstage plugins and apps",
"version": "0.1.0",
"private": false,
@@ -42,7 +42,7 @@
"recompose": "0.30.0"
},
"devDependencies": {
"@spotify-backstage/cli": "^0.1.0",
"@backstage/cli": "^0.1.0",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
+3 -3
View File
@@ -1,12 +1,12 @@
{
"name": "@spotify-backstage/plugin-home-page",
"name": "@backstage/plugin-home-page",
"version": "0.1.0",
"main": "dist/cjs/index.js",
"types": "dist/cjs/index.d.ts",
"private": true,
"devDependencies": {
"@spotify-backstage/cli": "^0.1.0",
"@spotify-backstage/core": "^0.1.0",
"@backstage/cli": "^0.1.0",
"@backstage/core": "^0.1.0",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
@@ -18,7 +18,7 @@ import React from 'react';
import { render } from '@testing-library/react';
import HomePage from './HomePage';
import { ThemeProvider } from '@material-ui/core';
import { BackstageTheme } from '@spotify-backstage/core';
import { BackstageTheme } from '@backstage/core';
describe('HomePage', () => {
it('should render', () => {
@@ -17,13 +17,7 @@
import React, { FC } from 'react';
import { Typography, Link, Grid } from '@material-ui/core';
import HomePageTimer from '../HomepageTimer';
import {
Content,
InfoCard,
Header,
Page,
pageTheme,
} from '@spotify-backstage/core';
import { Content, InfoCard, Header, Page, pageTheme } from '@backstage/core';
import SquadTechHealth from './SquadTechHealth';
import Table from '@material-ui/core/Table';
import TableBody from '@material-ui/core/TableBody';
@@ -17,7 +17,7 @@
import React, { FC } from 'react';
import { Grid, Typography } from '@material-ui/core';
import { HorizontalScrollGrid, ProgressCard } from '@spotify-backstage/core';
import { HorizontalScrollGrid, ProgressCard } from '@backstage/core';
const SquadTechHealth: FC<{}> = () => {
return (
@@ -15,7 +15,7 @@
*/
import React, { FC } from 'react';
import { HeaderLabel } from '@spotify-backstage/core';
import { HeaderLabel } from '@backstage/core';
const timeFormat = { hour: '2-digit', minute: '2-digit' };
const utcOptions = { timeZone: 'UTC', ...timeFormat };
+1 -1
View File
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { createPlugin } from '@spotify-backstage/core';
import { createPlugin } from '@backstage/core';
import HomePage from './components/HomePage';
export default createPlugin({
+3 -3
View File
@@ -1,5 +1,5 @@
{
"name": "@spotify-backstage/plugin-welcome",
"name": "@backstage/plugin-welcome",
"version": "0.1.0",
"main": "dist/cjs/index.js",
"types": "dist/cjs/index.d.ts",
@@ -11,8 +11,8 @@
"test": "backstage-cli test"
},
"devDependencies": {
"@spotify-backstage/core": "^0.1.0",
"@spotify-backstage/cli": "^0.1.0",
"@backstage/core": "^0.1.0",
"@backstage/cli": "^0.1.0",
"@types/testing-library__jest-dom": "5.0.2"
},
"dependencies": {
@@ -15,7 +15,7 @@
*/
import React, { FC } from 'react';
import { HeaderLabel } from '@spotify-backstage/core';
import { HeaderLabel } from '@backstage/core';
const timeFormat = { hour: '2-digit', minute: '2-digit' };
const utcOptions = { timeZone: 'UTC', ...timeFormat };
@@ -17,7 +17,7 @@
import React from 'react';
import { render, fireEvent } from '@testing-library/react';
import ErrorButton from './ErrorButton';
import { ApiRegistry, errorApiRef, ApiProvider } from '@spotify-backstage/core';
import { ApiRegistry, errorApiRef, ApiProvider } from '@backstage/core';
describe('ErrorButton', () => {
it('should trigger an error', () => {
@@ -16,7 +16,7 @@
import React, { FC } from 'react';
import { Button } from '@material-ui/core';
import { errorApiRef, useApi } from '@spotify-backstage/core';
import { errorApiRef, useApi } from '@backstage/core';
const ErrorButton: FC<{}> = () => {
const errorApi = useApi(errorApiRef);
@@ -23,7 +23,7 @@ import {
ApiProvider,
ApiRegistry,
errorApiRef,
} from '@spotify-backstage/core';
} from '@backstage/core';
describe('WelcomePage', () => {
it('should render', () => {
@@ -33,7 +33,7 @@ import {
pageTheme,
ContentHeader,
SupportButton,
} from '@spotify-backstage/core';
} from '@backstage/core';
import ErrorButton from './ErrorButton';
const WelcomePage: FC<{}> = () => {
+1 -1
View File
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { createPlugin } from '@spotify-backstage/core';
import { createPlugin } from '@backstage/core';
import WelcomePage from './components/WelcomePage';
export default createPlugin({