aside icon indicating copy to clipboard operation
aside copied to clipboard

Add flag for including/excluding license rollup

Open kaugesaar opened this issue 2 years ago • 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?

kaugesaar avatar Aug 09 '23 20:08 kaugesaar

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?

paranerd avatar Aug 10 '23 07:08 paranerd

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.

kaugesaar avatar Aug 10 '23 07:08 kaugesaar

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

paranerd avatar Aug 10 '23 07:08 paranerd

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

kaugesaar avatar Aug 10 '23 17:08 kaugesaar

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

paranerd avatar Aug 11 '23 13:08 paranerd