Closed guybedford closed 2 years ago
What is the .npm
suffix on [default-template-opts.npm]
?
Edit to add: And how would I know to add it?
This means these are the default options for the npm template.
On Tue, Jan 11, 2022 at 06:44 Duane Johnson @.***> wrote:
What is the .npm suffix on [default-template-opts.npm]?
— Reply to this email directly, view it on GitHub https://github.com/guybedford/chomp/pull/31#issuecomment-1010032345, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAESFSTKMIDRCMNFPUNFM5DUVQ64RANCNFSM5LVTU3WQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you modified the open/close state.Message ID: @.***>
But I'm not using the npm template? Or am I? And if I am, how do I know?
To be clear: I think it's confusing that it says template = "jspm"
right below, but we are configuring npm
template.
Edit to add: and we've chosen the pnpm
package manager in the example, too.
Templates are functions that output a list of tasks, where those tasks in turn can use templates. The jspm template will output the call to the necessary npm template for JSPM to work, with the global option making auto install configurable.
Would calling it global-options.npm seem clearer? It can be useful to eg configure a global Babel config this way for all Babel templates to avoid repetition so that’s why I was making sure that connection was clear first and foremost.
On Tue, Jan 11, 2022 at 09:31 Duane Johnson @.***> wrote:
To be clear: I think it's confusing that it says template = "jspm" right below, but we are configuring npm template.
— Reply to this email directly, view it on GitHub https://github.com/guybedford/chomp/pull/31#issuecomment-1010196369, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAESFSWOALV6RGACPLWGHA3UVRSNNANCNFSM5LVTU3WQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you modified the open/close state.Message ID: @.***>
This PR implements a number of renamings and adjustments to the template system, fixing a number of issues in the process.
chompfile.toml
are nowkebab-case
per convention.[task.args]
for setting template options has been renamed to[task.template-opts]
to make it clearer what this is doing.[default-template-opts.template-name]
top-level setting is now provided for setting default options by template. Resolves https://github.com/guybedford/chomp/issues/27.autoInstall
is nowauto-install
, andPKG_MANAGER
is no longer an environment variable but rather a template optionpkg-manager
jspm:generate
template is renamed to justjspm
.This PR also adopts a manual chaining of template options within the template definitions themselves, although that is mostly an implementation detail.
This PR also includes various template fixes including fixing https://github.com/guybedford/chomp/issues/29 and some normalization in the JSPM generator and Babel plugins.
TLDR; here's a before after configuration example:
BEFORE:
AFTER:
While this is strictly a breaking change, since no release has yet been made there is no version bump.