google/aside

Add flag for including/excluding license rollup

kaugesaar opened this issue · 5 comments

I'd be happy to work on this feature myself. However, before diving in, I wanted to check whether it's within the project's scope. Would you accept a pull request for this? If it's in scope, what would be the preferred method: including or excluding the rollup via a flag?

Hi!
Thanks for checking this out.
Just for my understanding: what exactly do you mean by "license rollup"? The behavior to only keep one license header in the final output?

Yeah, exactly. Though I did also noticed now that it does have a script to add a license header too "all" other files as well. So the final feature would involve more than just the rollup plugin.

But basically a flag to toggle this part in rollup.config.mjs and its dependencies:

https://github.com/google/aside/blob/main/rollup.config.mjs#L30-L36

  license({
    banner: {
      content: {
        file: fileURLToPath(new URL('license-header.txt', import.meta.url)),
      },
    },
  }),

Plus the license-check-and-add dependency and its associated script and files.

Right not I'm removing all of it manually, which to be fair is not much work, but would be nice to be able to do it on init.

So basically the aim would be to keep the license situation untouched (don't add and don't remove), correct?

Yes the aim would be to leave it untouched in that sense. But on init you could potentially then have a flag such as:

npx @google/aside init --no-license-header

Wouldn't --no-license-modification or something similar be more descriptive of what's supposed to happen (which is 'nothing'^^)?