Following the guide:
npx @backstage/cli create-app
Followed by:
yarn create-plugin
Would ideally work without extra steps or maybe have extra steps being documented.
$ npx @backstage/cli create-app
? Enter a name for the app [required] test
Creating the app...
Checking if the directory is available:
checking test โ
Creating a temporary app directory:
creating temporary directory โ
Preparing files:
copying README.md โ
copying lerna.json โ
copying tsconfig.json โ
copying .eslintrc.js โ
templating package.json.hbs โ
copying prettier.config.js โ
templating package.json.hbs โ
copying tsconfig.json โ
copying android-chrome-192x192.png โ
copying favicon-16x16.png โ
copying favicon.ico โ
copying apple-touch-icon.png โ
copying robots.txt โ
copying index.html โ
copying favicon-32x32.png โ
copying manifest.json โ
copying safari-pinned-tab.svg โ
copying index.tsx โ
copying App.tsx โ
copying plugins.ts โ
copying setupTests.ts โ
copying App.test.tsx โ
copying README.md โ
templating package.json.hbs โ
copying tsconfig.json โ
copying index.ts โ
copying setupTests.ts โ
copying plugin.test.ts โ
copying plugin.ts โ
copying WelcomePage.test.tsx โ
copying index.ts โ
copying WelcomePage.tsx โ
copying index.ts โ
copying Timer.tsx โ
Moving to final location:
moving test โ
Building the app:
executing yarn install โ
executing yarn build โ
๐ฅ Successfully created test
$ cd test
$ yarn create-plugin
yarn run v1.22.0
$ backstage-cli create-plugin
? Enter an ID for the plugin [required] sample-plugin
Creating the plugin...
Checking if the plugin ID is available:
checking sample-plugin โ
Creating a temporary plugin directory:
creating temporary directory โ
Preparing files:
copying .eslintrc.js โ
templating README.md.hbs โ
templating package.json.hbs โ
copying tsconfig.json โ
templating plugin.test.ts.hbs โ
templating plugin.ts.hbs โ
copying index.ts โ
copying setupTests.ts โ
templating ExampleFetchComponent.test.tsx.hbs โ
templating ExampleFetchComponent.tsx.hbs โ
copying index.ts โ
templating ExampleComponent.test.tsx.hbs โ
templating ExampleComponent.tsx.hbs โ
copying index.ts โ
Moving to final location:
moving sample-plugin โ
Building the plugin:
executing yarn install โ
executing yarn build โ
Error: src/components/ExampleFetchComponent/ExampleFetchComponent.tsx:25:19 - error TS2307: Cannot find module '@material-ui/lab/Alert'.
25 import Alert from '@material-ui/lab/Alert';
~~~~~~~~~~~~~~~~~~~~~~~~
src/components/ExampleFetchComponent/ExampleFetchComponent.tsx:26:26 - error TS2307: Cannot find module 'react-use'.
26 import { useAsync } from 'react-use';
~~~~~~~~~~~
error Command failed with exit code 1.
$ backstage-cli plugin:build
[build-cache] input directory is dirty, skipping cache
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
executing yarn build โ
Could not execute command yarn build
It seems that something went wrong when creating the plugin ๐ค
We are going to clean up, and then you can try again.
Cleanup:
remove temporary directory โ
๐ฅ Failed to create plugin!
โจ Done in 21.59s.
Perhaps make the peer dependencies dev dependencies for the sake of a smooth experience for the Getting Started Guide or perhaps provide a step to install the dependencies in the app before running the create plugin command.
npx @backstage/cli create-appcd to the new app directoryyarn create-pluginI was trying to add a new plugin in a backstage app that I created.
System Software Overview:
System Version: macOS 10.15.2 (19C57)
Kernel Version: Darwin 19.2.0
node --version
v12.15.0
yarn --version
1.22.0
I'm happy to contribute a fix here if it's determined one is needed.
@ruairitobrien, thanks for reporting the issue!
The fix we'd aim for right now is actually to get rid of all peer dependencies, as they don't work particularly well together yarn workspaces. That is, move all peerDependencies to just dependencies, and remove any duplicate devDependencies. Wanna take a shot at that? :grin:
Will do. Thanks!
Just to let you know, will likely be later today/tonight before I can get to it but will do it today! :)
Fixed by #581