question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

🚀 Feature: Support `yarn create` using Yarn classic for creating a new Backstage app

See original GitHub issue

🔖 Feature description

I’d like to propose supporting yarn create for Yarn classic to create Backstage apps, similar to how it’s done for other products, such as Create React App (yarn create react-app) and NextJS (yarn create next-app). Do you see value in this? If yes, I’m happy to open a PR.

🎤 Context

Currently, if I try running yarn create @backstage/app using Yarn classic, Yarn will recognize that the package is @backstage/create-app, but will complain that the binary file bin/create-app is missing:

$ yarn create @backstage/app
yarn create v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "@backstage/create-app@0.4.33" with binaries:
      - backstage-create-app
/bin/sh: /home/solimant/.yarn/bin/create-app: No such file or directory
error Command failed.
Exit code: 127
Command: /home/solimant/.yarn/bin/create-app
Arguments: 
Directory: /home/solimant/repos
Output:

info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.

This is because Yarn uses the package name to look for the generated target binary, which in this case would be create-app. However, the binary file is actually called backstage-create-app, and not create-app, and so Yarn fails to find it.

✌️ Possible Implementation

If we approach this backwards, a reasonable end goal would be to have a binary under ~/.yarn/bin/ called create-backstage-app. And because Yarn uses the package name to find the binary file, if we kept the package name the same, then we’d have to have a binary under ~/.yarn/bin/ called create-app, which is too generic, and may be prone to conflicts with other products. Therefore, this means that we’d have to change the package name to become @backstage/create-backstage-app instead of just @backstage/create-app in order for Yarn to look for the binary ~/.yarn/bin/create-backstage-app and not ~/.yarn/bin/create-app.

Once that decision is established, everything else becomes a pretty straightforward refactor. That said, the actual folder of the CLI can still remain under packages/create-app, unless there are reasons why it should match the package name, in which case it would need to move under packages/create-backstage-app.

The end result would be for the following to be successful:

yarn create @backstage/backstage-app

👀 Have you spent some time to check if this feature request has been raised before?

  • I checked and didn’t find similar issue

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

Yes I am willing to submit a PR!

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Rugvipcommented, Nov 14, 2022

Oh so to be clear, it’s now yarn create backstage-app. I felt that was just as good as if not better than yarn create @backstage/app

1reaction
Rugvipcommented, Nov 14, 2022

Thought about this some more and realized there’s a bit of a security issue with the potential for someone to publish a malicious package as yarn create backstage-app. I’ve published https://www.npmjs.com/package/create-backstage-app to make sure that doesn’t happen, which of course also happens to solve this! 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create an App - Backstage Demo
Backstage provides a utility for creating new apps. It guides you through the initial setup of selecting the name of the app and...
Read more >
yarn create
Creates new projects from any create-* starter kits. yarn create <starter-kit-package> [<args>]. This command is a shorthand that helps you do two things...
Read more >
Good First Issue: Issues for your first open-source contribution
Making your first open-source contribution is easier than you think. Good First Issue is a curated list of issues from popular open-source projects...
Read more >
Overwolf Supported Games
Overwolf is an open platform for building gaming apps for top PC games. Use simple HTML and JavaScript to build native desktop apps...
Read more >
Roser, Nancy L,, Ed. TITLE Adventuring with Books - ERIC
to build a collection of old and new poems, to demonstrate the variety ... ever family" With the help of black-and-white photographs of....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found