diff --git a/.eslintrc.js b/.eslintrc.js index c227c17938..969b6d7d5e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -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'), }, ], }, diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index b8465d96e5..e7d8c53b90 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -17,10 +17,11 @@ jobs: name: Node ${{ matrix.node-version }} on ${{ matrix.os }} steps: - uses: actions/checkout@v2 - - name: find location of yarn cache + - name: find location of global yarn cache id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" - - uses: actions/cache@v1 + - name: cache global yarn cache + uses: actions/cache@v1 with: path: ${{ steps.yarn-cache.outputs.dir }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index 852d2e28e2..d972ae7c90 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -17,14 +17,18 @@ jobs: matrix: node-version: [12.x] + env: + CI: true + steps: - uses: actions/checkout@v2 - name: fetch branch master run: git fetch origin master - - name: find location of yarn cache + - name: find location of global yarn cache id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" - - uses: actions/cache@v1 + - name: cache global yarn cache + uses: actions/cache@v1 with: path: ${{ steps.yarn-cache.outputs.dir }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} @@ -39,14 +43,10 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - - name: yarn install, build, and test - run: | - yarn install - yarn lint - yarn build - yarn test - env: - CI: true + - run: yarn install + - run: yarn lint + - run: yarn build + - run: yarn test deploy-storybook: if: github.event_name == 'push' && github.ref == 'refs/heads/master' @@ -57,7 +57,7 @@ jobs: node-version: [12.x] steps: - uses: actions/checkout@v2 - - name: build storybook' + - name: build storybook run: | yarn install yarn workspace storybook build-storybook diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml new file mode 100644 index 0000000000..1985215a0e --- /dev/null +++ b/.github/workflows/master.yml @@ -0,0 +1,54 @@ +name: Master Build + +on: + push: + branches: [master] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x] + + env: + CI: true + + steps: + - uses: actions/checkout@v2 + - name: find location of global yarn cache + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + - name: cache global yarn cache + uses: actions/cache@v1 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: cache node_modules + uses: actions/cache@v1 + with: + path: node_modules + key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }} + - name: use node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + registry-url: https://registry.npmjs.org/ # Needed for auth + - run: yarn install + - run: yarn lint + - run: yarn build + - run: yarn test + # Publishes current version of packages that are not already present in the registry + - name: publish + run: npx --no-install lerna publish from-package --yes + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + # Tags the commit with the version in the core package if the tag doesn't exist + - uses: Klemensas/action-autotag@1.2.3 + with: + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + package_root: "packages/core" + tag_prefix: "v" diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md new file mode 100644 index 0000000000..47cd67e8ef --- /dev/null +++ b/DEPLOYMENT.md @@ -0,0 +1,38 @@ +# Deploying Backstage + +## Heroku + +Deploying to heroku is relatively easy following these steps. + +First, make sure you have the [heroku CLI installed](https://devcenter.heroku.com/articles/heroku-cli) and log into it as well as loging into Heroku's [container registry](https://devcenter.heroku.com/articles/container-registry-and-runtime). + +```bash +$ heroku login +$ heroku container:login +``` + +You _might_ also need to set your Heroku app's stack to `container` + +```bash +$ heroku stack:set container -a +``` + +There are two small tweaks made to Backstage's default Dockerfile to run on Heroku: + +1. Do not run nginx as the `nginx` user. +2. Replace the standard port (80) in `/etc/nginx/conf.d/default.conf` with the wildcard `$PORT`, which Heroku will set for us. + +These changes are in the `deployment/Dockerfile.heroku` file, which you will need to copy into your root directory before deploying: + +```bash +$ cp deployment/Dockerfile.heroku Dockerfile +``` + +With these changes, we can build/push the Docker image to Heroku's container registry and release it to the `web` worker. + +```bash +$ heroku container:push web -a +$ heroku container:release web -a +``` + +With that, you should have Backstage up and running! diff --git a/Dockerfile b/Dockerfile index 39d51a35f2..5337207235 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,3 +15,4 @@ RUN yarn build FROM nginx:mainline COPY --from=builder /app/packages/app/build /usr/share/nginx/html +COPY ./docker/default.conf /etc/nginx/conf.d/default.conf diff --git a/README.md b/README.md index 629bfdc376..2145e62fa8 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ We created Backstage about 4 years ago. While our internal version of Backstage - 🐇 **Phase 3:** Ecosystem (later) - Everyone's infrastructure stack is different. By fostering a vibrant community of contributors we hope to provide an ecosystem of Open Source plugins/integrations that allows you to pick the tools that match your stack. -Check out our [Milestones](https://github.com/spotify/backstage/milestones) and how they relate to the 3 Phases outlined above. +Check out our [Milestones](https://github.com/spotify/backstage/milestones) and open [RFCs](https://github.com/spotify/backstage/labels/rfc) how they relate to the three Phases outlined above. Our vision for Backstage is for it to become the trusted standard toolbox (read: UX layer) for the open source infrastructure landscape. Think of it like Kubernetes for developer experience. We realize this is an ambitious goal. We can’t do it alone. If this sounds interesting or you'd like to help us shape our product vision, we'd love to talk. You can email me directly: [alund@spotify.com](mailto:alund@spotify.com). @@ -69,16 +69,8 @@ $ yarn start The final `yarn start` command should open a local instance of Backstage in your browser, otherwise open one of the URLs printed in the terminal. -### (Optional)Try on Docker - -Run the following commands if you have Docker environment - -```bash -$ docker build . -t spotify/backstage -$ docker run --rm -it -p 80:80 spotify/backstage -``` - -Then open http://localhost/ on your browser. +For more complex development environment configuration, see the +[Development Environment](docs/getting-started/development-environment.md) section of the Getting Started docs. ## Documentation @@ -93,8 +85,10 @@ Then open http://localhost/ on your browser. - [Discord chat](https://discord.gg/MUpMjP2) - Get support or discuss the project - [Good First Issues](https://github.com/spotify/backstage/labels/good%20first%20issue) - Start here if you want to contribute +- [RFCs](https://github.com/spotify/backstage/labels/rfc) - Help shape the technical direction - [FAQ](docs/FAQ.md) - Frequently Asked Questions - [Code of Conduct](CODE_OF_CONDUCT.md) - This is how we roll +- [Blog](https://backstage.io/blog/) - Announcements and updates - Give us a star ⭐️ - If you are using Backstage or think it is an interesting project, we would love a star ❤️ Or, if you are an open source developer and are interested in joining our team, please reach out to [foss-opportunities@spotify.com ](mailto:foss-opportunities@spotify.com) diff --git a/deployment/Dockerfile.heroku b/deployment/Dockerfile.heroku new file mode 100644 index 0000000000..15878c67da --- /dev/null +++ b/deployment/Dockerfile.heroku @@ -0,0 +1,24 @@ +FROM node:12 as builder +WORKDIR /app + +COPY package.json yarn.lock .yarnrc .npmrc /app/ +COPY .yarn /app/.yarn +COPY packages /app/packages +COPY plugins /app/plugins + +RUN yarn + +COPY . . + +RUN yarn build + +FROM nginx:mainline + +COPY --from=builder /app/packages/app/build /usr/share/nginx/html + +# Run nginx as root +RUN sed -i 's/user nginx.*$//' /etc/nginx/nginx.conf + +# Copy in the nginx conf template and replace "$PORT" with the environment variable set by heroku +COPY deployment/default.conf.template /etc/nginx/conf.d/default.conf.template +CMD /bin/bash -c "envsubst '\$PORT' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf" && nginx -g 'daemon off;' diff --git a/deployment/default.conf.template b/deployment/default.conf.template new file mode 100644 index 0000000000..61c32aa95e --- /dev/null +++ b/deployment/default.conf.template @@ -0,0 +1,8 @@ +server { + listen $PORT default_server; + + location / { + root /usr/share/nginx/html; + index index.html; + } +} diff --git a/docker/default.conf b/docker/default.conf new file mode 100644 index 0000000000..d01be24dc7 --- /dev/null +++ b/docker/default.conf @@ -0,0 +1,23 @@ +server { + listen 80; + server_name localhost; + + #charset koi8-r; + #access_log /var/log/nginx/host.access.log main; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri /index.html; + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +} + diff --git a/docs/FAQ.md b/docs/FAQ.md index 9b9fff564e..01c3a4f473 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -31,3 +31,12 @@ Bitbucket. We believe that in time there will be plugins that will provide funct as well. Hopefully contributed by the community. And note that implementations of Backstage can be hosted wherever you feel suits your needs best. + +## Can Backstage by used for other things than developer portals? + +Yes. + +The core frontend framework could be used for building any large-scale web application where multiple teams are building separate parts of the app, but you want the overall experience to be consistent. + +That being said, in [Phase 2](https://github.com/spotify/backstage#project-roadmap) of the project we will add features that are needed for developer portals and systems for managing software ecosystems. Our ambition will be to keep Backstage modular. + diff --git a/docs/README.md b/docs/README.md index 74e71370e1..c645b33024 100644 --- a/docs/README.md +++ b/docs/README.md @@ -5,3 +5,4 @@ Check out [https://backstage.io]() or see the table of content below. - [Architecture and terminology](architecture-terminology.md) - [Getting started](getting-started/README.md) - [References](reference/README.md) +- [Publishing](publishing.md) diff --git a/docs/getting-started/Plugin development.md b/docs/getting-started/Plugin development.md index 45cb171ef9..774a02434e 100644 --- a/docs/getting-started/Plugin development.md +++ b/docs/getting-started/Plugin development.md @@ -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({ diff --git a/docs/getting-started/README.md b/docs/getting-started/README.md index c37e61e82f..719e946a7e 100644 --- a/docs/getting-started/README.md +++ b/docs/getting-started/README.md @@ -2,6 +2,7 @@ Here is a collection of tutorials that will guide you through setting up and extending an instance of Backstage with your own plugins. +- [Development Environment](development-environment.md) - [Create a Backstage plugin](create-a-plugin.md) - [Structure of a plugin](structure-of-a-plugin.md) - Using Backstage components (TODO) diff --git a/docs/getting-started/development-environment.md b/docs/getting-started/development-environment.md new file mode 100644 index 0000000000..e836a0c5d2 --- /dev/null +++ b/docs/getting-started/development-environment.md @@ -0,0 +1,35 @@ +# Development Environment + +Open a terminal window and start the web app using the following commands from the project root: + +```bash +$ yarn install # may take a while + +$ yarn start +``` + +The final `yarn start` command should open a local instance of Backstage in your browser, otherwise open one of the URLs printed in the terminal. + +By default, backstage will start on port 3000, however you can override this by setting an environment variable `PORT` on your local machine. e.g. `export PORT=8080` then running `yarn start`. Or `PORT=8080 yarn start`. + +Once successfully started, you should see the following message in your terminal window: + +``` +You can now view @backstage/app in the browser. + + Local: http://localhost:8080 + On Your Network: http://192.168.1.224:8080 +``` + +### (Optional)Try on Docker + +Run the following commands if you have Docker environment + +```bash +$ docker build . -t spotify/backstage +$ docker run --rm -it -p 80:80 spotify/backstage +``` + +Then open http://localhost/ on your browser. + +[Back to Docs](README.md) diff --git a/docs/getting-started/structure-of-a-plugin.md b/docs/getting-started/structure-of-a-plugin.md index c6034261f1..2b31221373 100644 --- a/docs/getting-started/structure-of-a-plugin.md +++ b/docs/getting-started/structure-of-a-plugin.md @@ -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({ diff --git a/docs/publishing.md b/docs/publishing.md new file mode 100644 index 0000000000..15eaadd95d --- /dev/null +++ b/docs/publishing.md @@ -0,0 +1,37 @@ +# Publishing + +## NPM + +NPM packages are published through CI/CD in the +[.github/workflows/master.yml](../.github/workflows/master.yml) workflow. Every +commit that is merged to master will be checked for new versions of all public +packages, and any new versions will automatically be published to NPM. + +### Creating a new release + +Version bumps are made through release PRs. To create a new release, checkout out +a new branch that you will use for the release, e.g. + +```sh +$ git checkout -b new-release +``` + +Then, from the root of the repo, run + +```sh +$ yarn release +``` + +This will bring up the lerna release CLI where you choose what type of version bump +you want to make, (major/minor/patch/prerelease). The CLI will take you through choosing +a version, previewing all changes, and then approving the release. Once the release +is approved, a new commit is created that you can submit as a PR. Push the branch to GitHub: + +```sh +$ git push origin -u new-release +``` + +And then create a PR. Once the PR is approved and merged into master, the master build +will publish new versions of all bumped packages. + +[Back to Docs](README.md) diff --git a/docs/reference/createPlugin.md b/docs/reference/createPlugin.md index 779e1ef820..77048199ef 100644 --- a/docs/reference/createPlugin.md +++ b/docs/reference/createPlugin.md @@ -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({ diff --git a/lerna.json b/lerna.json index 322929db1d..1002c5f9be 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,9 @@ { - "packages": ["packages/*", "plugins/*"], + "packages": [ + "packages/*", + "plugins/*" + ], "npmClient": "yarn", "useWorkspaces": true, - "version": "0.1.0" + "version": "0.1.1-alpha.0" } diff --git a/package.json b/package.json index 7c6f997efb..736da36ac9 100644 --- a/package.json +++ b/package.json @@ -5,13 +5,13 @@ "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", + "release": "if [ \"$(git symbolic-ref --short HEAD)\" = master ]; then echo \"don't try to release master\"; exit 1; else lerna version --no-push; fi", "lint": "lerna run lint", - "storybook": "yarn workspace @spotify-backstage/core storybook", - "build-storybook": "yarn workspace @spotify-backstage/core build-storybook" + "storybook": "yarn workspace storybook start" }, "workspaces": { "packages": [ diff --git a/packages/app/README.md b/packages/app/README.md new file mode 100644 index 0000000000..0e4aa9912e --- /dev/null +++ b/packages/app/README.md @@ -0,0 +1,3 @@ +# @backstage/app + +This package is an example of a Backstage application. diff --git a/packages/app/package.json b/packages/app/package.json index 4f581599a5..2aa2c1312e 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,15 +1,15 @@ { - "name": "@spotify-backstage/app", - "version": "0.0.0", + "name": "@backstage/app", + "version": "0.1.1-alpha.0", "private": true, "dependencies": { + "@backstage/cli": "^0.1.1-alpha.0", + "@backstage/core": "^0.1.1-alpha.0", + "@backstage/plugin-home-page": "^0.1.1-alpha.0", + "@backstage/plugin-welcome": "^0.1.1-alpha.0", "@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", "@testing-library/jest-dom": "^4.2.4", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^7.1.2", diff --git a/packages/app/src/App.tsx b/packages/app/src/App.tsx index 91b588041c..09d7f55094 100644 --- a/packages/app/src/App.tsx +++ b/packages/app/src/App.tsx @@ -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'; diff --git a/packages/app/src/apis.ts b/packages/app/src/apis.ts index 6e2de63795..c3315257d8 100644 --- a/packages/app/src/apis.ts +++ b/packages/app/src/apis.ts @@ -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(); diff --git a/packages/app/src/components/ErrorDisplay/ErrorDisplay.tsx b/packages/app/src/components/ErrorDisplay/ErrorDisplay.tsx index 307158d88c..25e87c7bff 100644 --- a/packages/app/src/components/ErrorDisplay/ErrorDisplay.tsx +++ b/packages/app/src/components/ErrorDisplay/ErrorDisplay.tsx @@ -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; diff --git a/packages/app/src/components/Root/Root.tsx b/packages/app/src/components/Root/Root.tsx index 8795b50e1d..920f5c9871 100644 --- a/packages/app/src/components/Root/Root.tsx +++ b/packages/app/src/components/Root/Root.tsx @@ -28,7 +28,7 @@ import { SidebarSpacer, SidebarDivider, SidebarSpace, -} from '@spotify-backstage/core'; +} from '@backstage/core'; const useSidebarLogoStyles = makeStyles({ root: { diff --git a/packages/app/src/plugins.ts b/packages/app/src/plugins.ts index 12bba3ac06..3c757a59c9 100644 --- a/packages/app/src/plugins.ts +++ b/packages/app/src/plugins.ts @@ -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'; diff --git a/packages/cli/README.md b/packages/cli/README.md new file mode 100644 index 0000000000..99afb635ce --- /dev/null +++ b/packages/cli/README.md @@ -0,0 +1,22 @@ +# @backstage/cli + +This package provides a CLI for developing Backstage plugins and apps. + +## Installation + +Install the package via npm or yarn: + +```sh +$ npm install --save @backstage/cli +``` + +or + +```sh +$ yarn add @backstage/cli +``` + +## Documentation + +- [Backstage Readme](https://github.com/spotify/backstage/blob/master/README.md) +- [Backstage Documentation](https://github.com/spotify/backstage/blob/master/docs/README.md) diff --git a/packages/cli/package.json b/packages/cli/package.json index 9cc9ee6aa7..f26b13a421 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,9 +1,22 @@ { - "name": "@spotify-backstage/cli", - "version": "0.1.0", - "main": "dist", - "license": "Apache-2.0", + "name": "@backstage/cli", + "description": "CLI for developing Backstage plugins and apps", + "version": "0.1.1-alpha.0", "private": false, + "publishConfig": { + "access": "public" + }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/spotify/backstage", + "directory": "packages/cli" + }, + "keywords": [ + "backstage" + ], + "license": "Apache-2.0", + "main": "dist", "scripts": { "exec": "npx ts-node ./src", "build": "tsc --outDir dist --noEmit false --module CommonJS", diff --git a/packages/cli/src/commands/create-plugin/createPlugin.test.ts b/packages/cli/src/commands/create-plugin/createPlugin.test.ts index 1d78cb9191..9bf50027e3 100644 --- a/packages/cli/src/commands/create-plugin/createPlugin.test.ts +++ b/packages/cli/src/commands/create-plugin/createPlugin.test.ts @@ -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); diff --git a/packages/cli/src/commands/create-plugin/createPlugin.ts b/packages/cli/src/commands/create-plugin/createPlugin.ts index 112377cbda..4d264b01f9 100644 --- a/packages/cli/src/commands/create-plugin/createPlugin.ts +++ b/packages/cli/src/commands/create-plugin/createPlugin.ts @@ -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}`, )}`, ), ); diff --git a/packages/cli/src/commands/watch-deps/index.ts b/packages/cli/src/commands/watch-deps/index.ts index e5993ae9d6..059c2a7b5e 100644 --- a/packages/cli/src/commands/watch-deps/index.ts +++ b/packages/cli/src/commands/watch-deps/index.ts @@ -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']; diff --git a/packages/cli/templates/default-plugin/package.json.hbs b/packages/cli/templates/default-plugin/package.json.hbs index 20b78a268b..b2bd6f2c82 100644 --- a/packages/cli/templates/default-plugin/package.json.hbs +++ b/packages/cli/templates/default-plugin/package.json.hbs @@ -1,21 +1,22 @@ { - "name": "@spotify-backstage/plugin-{{id}}", + "name": "@backstage/plugin-{{id}}", "version": "{{version}}", "main": "dist/cjs/index.js", "types": "dist/cjs/index.d.ts", "license": "Apache-2.0", - "private": false, + "private": true, "scripts": { "build": "backstage-cli plugin:build", "lint": "backstage-cli lint", "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" }, "dependencies": { + "@backstage/core": "^{{version}}", "@material-ui/lab": "4.0.0-alpha.45" } } diff --git a/packages/cli/templates/default-plugin/src/components/ExampleComponent/ExampleComponent.test.tsx.hbs b/packages/cli/templates/default-plugin/src/components/ExampleComponent/ExampleComponent.test.tsx.hbs index 360055dc3d..15db0863d2 100644 --- a/packages/cli/templates/default-plugin/src/components/ExampleComponent/ExampleComponent.test.tsx.hbs +++ b/packages/cli/templates/default-plugin/src/components/ExampleComponent/ExampleComponent.test.tsx.hbs @@ -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', () => { diff --git a/packages/cli/templates/default-plugin/src/components/ExampleComponent/ExampleComponent.tsx.hbs b/packages/cli/templates/default-plugin/src/components/ExampleComponent/ExampleComponent.tsx.hbs index b5c56422da..b96c970022 100644 --- a/packages/cli/templates/default-plugin/src/components/ExampleComponent/ExampleComponent.tsx.hbs +++ b/packages/cli/templates/default-plugin/src/components/ExampleComponent/ExampleComponent.tsx.hbs @@ -25,7 +25,7 @@ import { ContentHeader, HeaderLabel, SupportButton, -} from '@spotify-backstage/core'; +} from '@backstage/core'; import ExampleFetchComponent from '../ExampleFetchComponent'; const ExampleComponent: FC<{}> = () => ( diff --git a/packages/cli/templates/default-plugin/src/components/ExampleFetchComponent/ExampleFetchComponent.tsx.hbs b/packages/cli/templates/default-plugin/src/components/ExampleFetchComponent/ExampleFetchComponent.tsx.hbs index 4801dea6dd..3420cc9d5a 100644 --- a/packages/cli/templates/default-plugin/src/components/ExampleFetchComponent/ExampleFetchComponent.tsx.hbs +++ b/packages/cli/templates/default-plugin/src/components/ExampleFetchComponent/ExampleFetchComponent.tsx.hbs @@ -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: { diff --git a/packages/cli/templates/default-plugin/src/plugin.ts.hbs b/packages/cli/templates/default-plugin/src/plugin.ts.hbs index ccac096007..bb0b93ca25 100644 --- a/packages/cli/templates/default-plugin/src/plugin.ts.hbs +++ b/packages/cli/templates/default-plugin/src/plugin.ts.hbs @@ -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({ diff --git a/packages/core/README.md b/packages/core/README.md new file mode 100644 index 0000000000..a22f66ecd9 --- /dev/null +++ b/packages/core/README.md @@ -0,0 +1,22 @@ +# @backstage/core + +This package provides the core API used by Backstage plugins and apps. + +## Installation + +Install the package via npm or yarn: + +```sh +$ npm install --save @backstage/core +``` + +or + +```sh +$ yarn add @backstage/core +``` + +## Documentation + +- [Backstage Readme](https://github.com/spotify/backstage/blob/master/README.md) +- [Backstage Documentation](https://github.com/spotify/backstage/blob/master/docs/README.md) diff --git a/packages/core/package.json b/packages/core/package.json index b6ceeb42f2..8adb1307fe 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,8 +1,21 @@ { - "name": "@spotify-backstage/core", - "version": "0.1.0", - "license": "Apache-2.0", + "name": "@backstage/core", + "description": "Core API used by Backstage plugins and apps", + "version": "0.1.1-alpha.0", "private": false, + "publishConfig": { + "access": "public" + }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/spotify/backstage", + "directory": "packages/core" + }, + "keywords": [ + "backstage" + ], + "license": "Apache-2.0", "main": "dist/cjs/index.js", "types": "dist/cjs/index.d.ts", "scripts": { @@ -26,7 +39,7 @@ "recompose": "0.30.0" }, "devDependencies": { - "@spotify-backstage/cli": "^0.1.0", + "@backstage/cli": "^0.1.1-alpha.0", "@testing-library/jest-dom": "^4.2.4", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^7.1.2", diff --git a/packages/storybook/README.md b/packages/storybook/README.md new file mode 100644 index 0000000000..2e716a5466 --- /dev/null +++ b/packages/storybook/README.md @@ -0,0 +1,3 @@ +# storybook + +This package provides a storybook build for Backstage. See [storybook.backstage.io](http://storybook.backstage.io) diff --git a/plugins/home-page/package.json b/plugins/home-page/package.json index 5380d8d25b..33be457cba 100644 --- a/plugins/home-page/package.json +++ b/plugins/home-page/package.json @@ -1,11 +1,14 @@ { - "name": "@spotify-backstage/plugin-home-page", - "version": "0.1.0", + "name": "@backstage/plugin-home-page", + "version": "0.1.1-alpha.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.1-alpha.0", + "@backstage/core": "^0.1.1-alpha.0", + "@material-ui/core": "^4.9.1", + "@material-ui/icons": "^4.9.1", "@testing-library/jest-dom": "^4.2.4", "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^7.1.2", @@ -13,9 +16,7 @@ "@types/node": "^12.0.0", "@types/testing-library__jest-dom": "5.0.2", "react": "^16.12.0", - "react-dom": "^16.12.0", - "@material-ui/core": "^4.9.1", - "@material-ui/icons": "^4.9.1" + "react-dom": "^16.12.0" }, "scripts": { "build": "backstage-cli plugin:build", diff --git a/plugins/home-page/src/components/HomePage/HomePage.test.tsx b/plugins/home-page/src/components/HomePage/HomePage.test.tsx index 500d53397a..6b2c1bfd11 100644 --- a/plugins/home-page/src/components/HomePage/HomePage.test.tsx +++ b/plugins/home-page/src/components/HomePage/HomePage.test.tsx @@ -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', () => { diff --git a/plugins/home-page/src/components/HomePage/HomePage.tsx b/plugins/home-page/src/components/HomePage/HomePage.tsx index f340b682fa..3ca572b367 100644 --- a/plugins/home-page/src/components/HomePage/HomePage.tsx +++ b/plugins/home-page/src/components/HomePage/HomePage.tsx @@ -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'; diff --git a/plugins/home-page/src/components/HomePage/SquadTechHealth.tsx b/plugins/home-page/src/components/HomePage/SquadTechHealth.tsx index 320205367c..c4e55c4dd5 100644 --- a/plugins/home-page/src/components/HomePage/SquadTechHealth.tsx +++ b/plugins/home-page/src/components/HomePage/SquadTechHealth.tsx @@ -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 ( diff --git a/plugins/home-page/src/components/HomepageTimer/HomepageTimer.tsx b/plugins/home-page/src/components/HomepageTimer/HomepageTimer.tsx index 3407da4012..770f98e762 100644 --- a/plugins/home-page/src/components/HomepageTimer/HomepageTimer.tsx +++ b/plugins/home-page/src/components/HomepageTimer/HomepageTimer.tsx @@ -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 }; diff --git a/plugins/home-page/src/plugin.ts b/plugins/home-page/src/plugin.ts index 0ace719780..17eb89eb35 100644 --- a/plugins/home-page/src/plugin.ts +++ b/plugins/home-page/src/plugin.ts @@ -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({ diff --git a/plugins/welcome/package.json b/plugins/welcome/package.json index 1d5f6a7373..b38977afab 100644 --- a/plugins/welcome/package.json +++ b/plugins/welcome/package.json @@ -1,18 +1,18 @@ { - "name": "@spotify-backstage/plugin-welcome", - "version": "0.1.0", + "name": "@backstage/plugin-welcome", + "version": "0.1.1-alpha.0", "main": "dist/cjs/index.js", "types": "dist/cjs/index.d.ts", "license": "Apache-2.0", - "private": false, + "private": true, "scripts": { "build": "backstage-cli plugin:build", "lint": "backstage-cli lint", "test": "backstage-cli test" }, "devDependencies": { - "@spotify-backstage/core": "^0.1.0", - "@spotify-backstage/cli": "^0.1.0", + "@backstage/cli": "^0.1.1-alpha.0", + "@backstage/core": "^0.1.1-alpha.0", "@types/testing-library__jest-dom": "5.0.2" }, "dependencies": { diff --git a/plugins/welcome/src/components/Timer/Timer.tsx b/plugins/welcome/src/components/Timer/Timer.tsx index 3407da4012..770f98e762 100644 --- a/plugins/welcome/src/components/Timer/Timer.tsx +++ b/plugins/welcome/src/components/Timer/Timer.tsx @@ -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 }; diff --git a/plugins/welcome/src/components/WelcomePage/ErrorButton.test.tsx b/plugins/welcome/src/components/WelcomePage/ErrorButton.test.tsx index 791937a3b5..6a91a6c202 100644 --- a/plugins/welcome/src/components/WelcomePage/ErrorButton.test.tsx +++ b/plugins/welcome/src/components/WelcomePage/ErrorButton.test.tsx @@ -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', () => { diff --git a/plugins/welcome/src/components/WelcomePage/ErrorButton.tsx b/plugins/welcome/src/components/WelcomePage/ErrorButton.tsx index fa73115d18..390c434633 100644 --- a/plugins/welcome/src/components/WelcomePage/ErrorButton.tsx +++ b/plugins/welcome/src/components/WelcomePage/ErrorButton.tsx @@ -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); diff --git a/plugins/welcome/src/components/WelcomePage/WelcomePage.test.tsx b/plugins/welcome/src/components/WelcomePage/WelcomePage.test.tsx index 9787fa2a9a..b4139e4ed3 100644 --- a/plugins/welcome/src/components/WelcomePage/WelcomePage.test.tsx +++ b/plugins/welcome/src/components/WelcomePage/WelcomePage.test.tsx @@ -23,7 +23,7 @@ import { ApiProvider, ApiRegistry, errorApiRef, -} from '@spotify-backstage/core'; +} from '@backstage/core'; describe('WelcomePage', () => { it('should render', () => { diff --git a/plugins/welcome/src/components/WelcomePage/WelcomePage.tsx b/plugins/welcome/src/components/WelcomePage/WelcomePage.tsx index 755e19e0ff..69a892a95e 100644 --- a/plugins/welcome/src/components/WelcomePage/WelcomePage.tsx +++ b/plugins/welcome/src/components/WelcomePage/WelcomePage.tsx @@ -33,7 +33,7 @@ import { pageTheme, ContentHeader, SupportButton, -} from '@spotify-backstage/core'; +} from '@backstage/core'; import ErrorButton from './ErrorButton'; const WelcomePage: FC<{}> = () => { diff --git a/plugins/welcome/src/plugin.ts b/plugins/welcome/src/plugin.ts index bdc74209a7..20ec41d4c2 100644 --- a/plugins/welcome/src/plugin.ts +++ b/plugins/welcome/src/plugin.ts @@ -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({