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

default .gitignore file content wrong. #17018

Open
smallmain opened this issue May 21, 2024 · 7 comments
Open

default .gitignore file content wrong. #17018

smallmain opened this issue May 21, 2024 · 7 comments
Assignees
Labels
Bug Needs Triage Needs to be assigned by the team

Comments

@smallmain
Copy link

Cocos Creator version

3.8.2

System information

MacOS

Issue description

#///////////////////////////
# Cocos Creator 3D Project
#///////////////////////////
library/
temp/
local/
build/
profiles/
native

Only folders under the project root should be ignored.
Names like native are very common and may cause extension files and project files to be accidentally ignored.

Relevant error log output

No response

Steps to reproduce

.

Minimal reproduction project

No response

@smallmain smallmain added Bug Needs Triage Needs to be assigned by the team labels May 21, 2024
@minggo minggo self-assigned this May 24, 2024
@minggo
Copy link
Contributor

minggo commented May 24, 2024

I think it is because engine source code also has the folder named native, and the generated folder also has a native folder.

@smallmain
Copy link
Author

I think it is because engine source code also has the folder named native, and the generated folder also has a native folder.

Okay.

In my case, my engine plugin will have the native directory because the installed npm package has a directory with that name, but the engine plugin will have to add node_modules to Git if it's going to work properly because of this unresolved issue: #16896

Then, the project directory also has a directory with this name:

  • assets
    • login-sdk
      • native
      • browser
      • minigame

@minggo
Copy link
Contributor

minggo commented May 24, 2024

May be you should ask the plugin user to remove it. As most developers will not modify engine codes, so i think it is reasonable to keep it.

@smallmain
Copy link
Author

May be you should ask the plugin user to remove it. As most developers will not modify engine codes, so i think it is reasonable to keep it.

What? no!

The engine code has not been modified!

  • extensions
    • plugin-a
      • node_modules
        • fs
          • dist
            • impls
              • native
                • index.js
              • web
              • other

Here I assume that the engine plug-in depends on a cross-platform file system implementation module.
Because of the gitignore file, users cannot simply put plugins into version management.

This situation is not uncommon!

@minggo
Copy link
Contributor

minggo commented May 24, 2024

In my project, the .gitignore is

#///////////////////////////
# Cocos Creator 3D Project
#///////////////////////////

/library/
/temp/
/local/
/build/
/profiles/
/native/engine/android/**/*/assets

It is different from you.

@smallmain
Copy link
Author

smallmain commented May 24, 2024

I tried creating a new project using 3.8.3 and the .gitignore is:

#///////////////////////////
# Cocos Creator 3D Project
#///////////////////////////
library/
temp/
local/
build/
profiles/
native
#//////////////////////////
# NPM
#//////////////////////////
node_modules/

#//////////////////////////
# VSCode
#//////////////////////////
.vscode/

#//////////////////////////
# WebStorm
#//////////////////////////
.idea/

The same problem just occurred in the my team. I added the l10n plug-in to the project and submitted it to git. An error occurred after the team member pulled it.

image

because gitignore ignores node_modules, but the current plug-in system cannot automatically install plugin's dependencies.

I think the default gitignore file needs to be completely improved, and try to only ignore directories that Creator must ignore, rather than hitting it on a large scale.

In addition, Some settings of Creator itself are also ignored. things like build settings should be synchronized by default.

@minggo
Copy link
Contributor

minggo commented Jun 12, 2024

@wuzhiming it seems this file is generated by editor, please take a look.

@minggo minggo removed their assignment Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Needs Triage Needs to be assigned by the team
Projects
None yet
Development

No branches or pull requests

3 participants