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

fix(core): adjust gitignore to support generation with directory #599

Merged
merged 1 commit into from
Feb 3, 2023

Conversation

Tungsten78
Copy link
Contributor

  • include typo fix

@nx-cloud
Copy link

nx-cloud bot commented Jan 26, 2023

@AgentEnder
Copy link
Member

@Tungsten78 This may not be needed anymore, since #596 includes a fix that moves the generated obj directory into dist. Can you check if its needed in a new workspace using latest?

@Tungsten78
Copy link
Contributor Author

@AgentEnder Assuming I'm checking the right thing it appears to continue as a problem.

image

@AgentEnder
Copy link
Member

Ah, I forgot about the nuget files. That's my bad.

My concern with using a globstar for this stems from projects containing source directories that have subfolders named bin, as is common for nodejs cli tools. A lot of times a node project may have a bin folder at root even...

We could instead list out the files that are still generated in these folders automatically perhaps? We could theoretically even just generate a .gitignore within the new dotnet apps roots and list bin / obj, Nx doesn't obey nested gitignores as far as globbing / dependency tracing but it should be fine for this use case since git does obey them.

@Tungsten78
Copy link
Contributor Author

Tungsten78 commented Jan 29, 2023

I hear you about making too many assumptions when applying ignores at the workspace level.

Writing a .gitignore I’m the generated projects might be safest.

@AgentEnder
Copy link
Member

Generally I was trying to avoid the root gitignores since Nx doesn't currently obey them (we'd like to, but it's actually a non trivial performance cost). That said, the remainder of those directories is pretty slim, and Nx trying to read them shouldn't cause any runtime errors so we should be OK to do that now.

If you want to close this PR and open another with that approach you can, or you can reuse this one, or if you'd rather I can take a look sometime in the next week or so

@Tungsten78
Copy link
Contributor Author

To ensure we're on the same page...

We are going to address the aforementioned issue by moving the ignore clauses

  • from the workspace .gitignore into project based .gitignore.

Example: [app,lib]/{directory}/{project}/.gitignore

obj
bin

@AgentEnder
Copy link
Member

Yeah, I think that makes the most sense. It'll move that logic outside of the init generator and into the generate-project util

@Tungsten78 Tungsten78 force-pushed the gitignore branch 2 times, most recently from 1a6cf0d to 7ed43c8 Compare February 3, 2023 01:48
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 3, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@Tungsten78
Copy link
Contributor Author

Full disclaimer: having issues running the test suite on my windows-based machine. Might need to use a mac?

Error: spawnSync echo ENOENT

    at DotNetClient.logAndExecute (C:\Users\CML0906\Source\nx-dotnet\packages\dotnet\src\lib\core\dotnet.client.ts:239:13)
    at DotNetClient.new (C:\Users\CML0906\Source\nx-dotnet\packages\dotnet\src\lib\core\dotnet.client.ts:36:17)
    at initToolManifest (C:\Users\CML0906\Source\nx-dotnet\packages\core\src\generators\init\generator.ts:88:21)
    at C:\Users\CML0906\Source\nx-dotnet\packages\core\src\generators\init\generator.ts:48:3
    at Generator.next (<anonymous>)
    at C:\Users\CML0906\Source\nx-dotnet\node_modules\tslib\tslib.js:118:75
    at new Promise (<anonymous>)
    at Object.__awaiter (C:\Users\CML0906\Source\nx-dotnet\node_modules\tslib\tslib.js:114:16)
    at initGenerator (C:\Users\CML0906\Source\nx-dotnet\packages\core\src\generators\init\generator.ts:11:20)
    at C:\Users\CML0906\Source\nx-dotnet\packages\core\src\generators\utils\generate-project.ts:169:24

@AgentEnder
Copy link
Member

Ideally it would "just work" regardless, but for my local dev I use WSL2 on windows. If you get spare time to help track down inconsistent results on base windows, any fixes to that DX would be appreciated

@Tungsten78
Copy link
Contributor Author

Tungsten78 commented Feb 3, 2023

Most of the test suite works on my Mac. Still have some failures.

Also, not having luck with yarn publish-local.

  • It doesn't like run-p. I see it in node_modules, but it's a lonely package.json. index.js not present.
  • Hacking a bit around it, it doesn't like e2e-registry either. I'm not sure where this comes from?

@AgentEnder
Copy link
Member

This seems like the likely culprit: nodejs/node-v0.x-archive#6425

@Tungsten78
Copy link
Contributor Author

This seems like the likely culprit: nodejs/node-v0.x-archive#6425

"use a better operating system". 😂

@AgentEnder
Copy link
Member

Yeah, it's been a while since I looked at the windows dev experience for the repo. Probably several small things.

@AgentEnder
Copy link
Member

I would expect publish local to work on WSL, Mac, or Linux so if that's failing on those platforms it may be more interesting.

It works on Ubuntu and WSL for sure given CI and my local env

@AgentEnder AgentEnder merged commit b3856e0 into nx-dotnet:master Feb 3, 2023
github-actions bot pushed a commit that referenced this pull request Feb 4, 2023
## [1.19.1](v1.19.0...v1.19.1) (2023-02-04)

### Bug Fixes

* **core:** adjust gitignore to support generation with directory ([#599](#599)) ([b3856e0](b3856e0))
* **core:** remove orphaned publish-local ([#611](#611)) ([7985e14](7985e14))

Feb 4, 2023, 7:17 PM
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2023

🎉 This PR is included in version 1.19.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants