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

Can we ignore some files for publishing but include in the repo? #2566

Closed
vincevargadev opened this issue Jul 17, 2020 · 8 comments · Fixed by #2787
Closed

Can we ignore some files for publishing but include in the repo? #2566

vincevargadev opened this issue Jul 17, 2020 · 8 comments · Fixed by #2787
Labels
type-enhancement A request for a change that isn't a bug

Comments

@vincevargadev
Copy link

I'd like to leave some files in a package's repository on GitHub, but at the same time, make those files excluded when I publish a package on pub.dev.

The issue is that I'd like to add images or gifs to the README so that other developers immediately understand what the package is for. However, I don't want users of my package to have to download these images when they decide to add my package as a dependency.

Can we ignore some files for publishing but include in the repo?

@sigurdm sigurdm transferred this issue from dart-lang/pub-dev Jul 20, 2020
@sigurdm
Copy link
Contributor

sigurdm commented Jul 20, 2020

I think we should have a .pubignore or similar file.
@jonasfj what do you think?

@jonasfj
Copy link
Member

jonasfj commented Jul 20, 2020

We already respect .gitignore I think, but I can see how that doesn't work here.

Other possible use-case in #2222.

I imagine that if you have a .pubignore file, then we would not honor the .gitignore file.

@sigurdm
Copy link
Contributor

sigurdm commented Jul 20, 2020

It seems we can use git ls-files -X .pubignore --cached --others to interpret a .pubignore file.

That would however put a requirement on git - which might be acceptable if we still allow having no .pubignore file.

@jonasfj
Copy link
Member

jonasfj commented Jul 20, 2020

That would however put a requirement on git - which might be acceptable if we still allow having no .pubignore file.

External dependencies provided by the system, such as tar haven't exactly worked out well for us before, hehe

I suppose it works better for .gitignore, but ideally we would write this logic in Dart.

@jonasfj
Copy link
Member

jonasfj commented Jul 20, 2020

On the other hand, we can test if git is present, and we already use it.. so this might not be so bad..

@sigurdm
Copy link
Contributor

sigurdm commented Jul 21, 2020

ideally we would write this logic in Dart.

It is quite well specified: https://git-scm.com/docs/gitignore , but not trivial to implement.

Funnily enough we hardly ever get issues around our external dependency on git. I guess there is only one implementation that everybody shares.

Most of our tar issues seem to stem from the system tar being different for different systems.

@kevmoo kevmoo added the type-enhancement A request for a change that isn't a bug label Jul 21, 2020
@softmarshmallow
Copy link

softmarshmallow commented Aug 5, 2020

Is there any plans on supporting .pubignore or ingore: ["", ""] in pubspec?
the suggested ways are just temporary workaround

like npm and package.json handles it.

@jonasfj
Copy link
Member

jonasfj commented Aug 5, 2020

Is there any plans on supporting .pubignore or ingore: ["", ""] in pubspec?

I don't think it's a high priority for us at the moment. But if someone wants to work on it, I'll be happy to help define the feature, review and land it.

Otherwise, please upvote, and mention any novel use-cases you might have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants