Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(builder): streamline generated template #5426

Merged

Conversation

mataha
Copy link
Contributor

@mataha mataha commented May 6, 2023

What's the problem this PR addresses?

The template generated by @yarnpkg/builder's builder new plugin could be better in providing out-of-the-box setup for scaffolding new plugins, specifically on Windows systems with respect to proper file generation. This PR combines slight improvements I imagine a package developer would find welcome.

How did you fix it?

In @yarnpkg/builder:

  • create plugin source script file from all segments properly (Windows)
  • make default template create a .gitignore containing a bundles directory entry
  • mark generated package as private to avoid accidental publish in public registries
  • sort dependencies and devDependencies properly (as typings have no business being specified as regular dependencies)
  • include package.json scripts for building a development (i.e. non-minified) bundle and cleaning up the generated workspace

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@arcanis
Copy link
Member

arcanis commented May 16, 2023

Those make sense, thanks!

@arcanis arcanis merged commit 3e68e6f into yarnpkg:master May 16, 2023
@merceyz
Copy link
Member

merceyz commented May 16, 2023

create plugin source script file from all segments properly (Windows)

It already was correct, ppath is POSIX paths and xfs.writeFilePromise coverts it back to a win32 path if required.

@mataha
Copy link
Contributor Author

mataha commented May 16, 2023

create plugin source script file from all segments properly (Windows)

It already was correct, ppath is POSIX paths and xfs.writeFilePromise coverts it back to a win32 path if required.

In this case I apologize - I come from a Windows environment, thus I panic whenever I see hardcoded paths.

@mataha mataha deleted the feat/builder-plugin-scaffold-streamline branch May 16, 2023 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants