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

Cannot have docs/ directory at the root of project #3326

Closed
imaNNeo opened this issue Mar 3, 2022 · 5 comments
Closed

Cannot have docs/ directory at the root of project #3326

imaNNeo opened this issue Mar 3, 2022 · 5 comments
Labels
closed-not-planned Closed as we don't intend to take action on the reported issue

Comments

@imaNNeo
Copy link

imaNNeo commented Mar 3, 2022

Environment

  • pub version or flutter pub version: Pub 2.16.1
  • OS version: macOS Big Sur version 11.4 (20F71)
  • Are you using the Chinese community mirror or a corporate firewall? No

Problem

I need to have a directory called docs at the root of my project (because I want to use docs.page service to generate documentation pages).
When I run flutter pub publish --dry-run it fails with the error below:

Package validation found the following potential issue:
* Rename the top-level "docs" directory to "doc".
  The Pub layout convention is to use singular directory names.
  Plural names won't be correctly identified by Pub and other tools.

Although I tried to put docs/ in my .pubignore file, it didn't work.

You can check this failing workflow for more details.

There is a similar closed issue here: #2976
I couldn't find any solution there.

imaNNeo added a commit to imaNNeo/fl_chart that referenced this issue Mar 3, 2022
imaNNeo added a commit to imaNNeo/fl_chart that referenced this issue Mar 3, 2022
@sigurdm
Copy link
Contributor

sigurdm commented Mar 4, 2022

First this is only a warning. You can publish to pub.dev anyways.

I think we might have to rethink this if docs.page becomes a thing.

Anyways the validator is listing files with listDir(entryPoint.root.dir) instead of entryPoint.root.listFiles() if we change that .pubignores would be respected. But that would still mean the docs folder would not get published - that might or might not be what we want.

@jonasfj WDYT?

@jonasfj
Copy link
Member

jonasfj commented Mar 4, 2022

I think it's fine to respect .pubignore in the validators. That makes sense, and would be a possible workaround.

But this is just a warning it can be ignored, see:

warnings.add('Rename the top-level "$dir" directory to '

You get this warning because you're package is violating: https://dart.dev/tools/pub/package-layout

Closing this as working as intended.

@imaNNeo
Copy link
Author

imaNNeo commented Mar 4, 2022

ocs folder would not get publish

I think we don't need to publish docs directory.
It only needs to exist in the repository.

@imaNNeo
Copy link
Author

imaNNeo commented Mar 4, 2022

I use this Github Action to publish my package in CI / CD
I don't understand how I can configure it to ignore that specific warning.

@sigurdm sigurdm added the closed-not-planned Closed as we don't intend to take action on the reported issue label Sep 7, 2023
tingyangdevs20 added a commit to tingyangdevs20/FlutterChart that referenced this issue Nov 11, 2023
Gentlemen726 added a commit to Gentlemen726/flutter-graph-project that referenced this issue Mar 11, 2024
LionelPerrault added a commit to LionelPerrault/Fl-Chart that referenced this issue Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-not-planned Closed as we don't intend to take action on the reported issue
Projects
None yet
Development

No branches or pull requests

3 participants