Skip to content

Commit f7f7ee2

Browse files
authored
Merge branch 'cocos:v3.8.7' into master
2 parents 8518bae + 8419b45 commit f7f7ee2

File tree

7,689 files changed

+1187286
-254615
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

7,689 files changed

+1187286
-254615
lines changed

.circleci/config.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
2+
#
3+
version: 2
4+
jobs:
5+
test:
6+
docker:
7+
- image: circleci/node:12.13
8+
steps:
9+
- checkout
10+
- run: sudo npm install -g gulp
11+
- run: npm install
12+
- run: gulp build-debug-infos
13+
- run: npm test
14+
15+
workflows:
16+
version: 2
17+
test:
18+
jobs:
19+
- test

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ end_of_line = lf
99
indent_size = 4
1010
indent_style = space
1111
insert_final_newline = true
12-
trim_trailing_whitespace = true
12+
trim_trailing_whitespace = true

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.jsb.ts
2+
**/*.ems.ts
3+
cocos/webgpu/**/*

.eslintrc.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

.eslintrc.yaml

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
root: true
2+
3+
parser: '@typescript-eslint/parser'
4+
5+
parserOptions:
6+
project:
7+
- ./tsconfig.json
8+
9+
extends:
10+
- eslint:recommended
11+
- airbnb-base
12+
- plugin:@typescript-eslint/recommended
13+
- plugin:@typescript-eslint/recommended-requiring-type-checking
14+
15+
plugins: ["@typescript-eslint"]
16+
17+
settings:
18+
import/resolver:
19+
node:
20+
extensions:
21+
- .js
22+
- .jsx
23+
- .ts
24+
- .tsx
25+
- .d.ts
26+
27+
env:
28+
browser: true
29+
node: true
30+
es6: true
31+
jest: true
32+
33+
globals:
34+
cc: false
35+
wx: false
36+
Editor: false
37+
_Scene: false
38+
_ccsg: false
39+
40+
rules:
41+
42+
# https://eslint.org/docs/rules/
43+
# https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin
44+
45+
# !!!!!!!!!!!!!!!!!!!!!!!!!
46+
# BEFORE ADDING ANY RULES
47+
# PLEASE EXPLAIN THE REASON IN THE COMMENT.
48+
49+
##### RECOMMENDED RULE OVERRIDES #####
50+
51+
camelcase: off # underscores may come in handy in some cases
52+
eqeqeq: warn # important check missing from recommended
53+
keyword-spacing: warn # we require this explicitly
54+
no-multi-spaces: off # useful for manually align some expression across lines
55+
prefer-rest-params: off # we need ES5 to be fast too
56+
prefer-spread: off # we need ES5 to be fast too
57+
space-before-function-paren: [warn, always] # we require this explicitly
58+
radix: off # we sometimes do not need to pass a second parameter
59+
# allow underscores, we still widely use pre-dangle naming in our naming convention
60+
# e.g. private properties, private functions, module scope shared variables etc.
61+
no-underscore-dangle: off
62+
quotes: [warn, single, { allowTemplateLiterals: true }] # force single, but allow template literal
63+
no-else-return: off # else-return is a common pattern which clearly expresses the control flow
64+
no-unused-expressions: off # taken over by '@typescript-eslint/no-unused-expressions'
65+
no-empty-function: off # taken over by '@typescript-eslint/no-empty-function'
66+
67+
##### AIRBNB-SPECIFIC RULE OVERRIDES #####
68+
69+
class-methods-use-this: off # so empty functions could work
70+
guard-for-in: off # for-in is a efficient choice for plain objects
71+
import/export: off # so export declare namespace could work
72+
import/extensions: off # typescript doesn't support this
73+
import/no-unresolved: off # TODO: fix internal modules
74+
import/prefer-default-export: off # prefer named exports
75+
indent: [error, 4, {
76+
SwitchCase: 0,
77+
ignoredNodes: [ # https://stackoverflow.com/a/72897089
78+
"FunctionExpression > .params[decorators.length > 0]",
79+
"FunctionExpression > .params > :matches(Decorator, :not(:first-child))",
80+
"ClassBody.body > PropertyDefinition[decorators.length > 0] > .key",
81+
]
82+
}]
83+
84+
lines-between-class-members: off # be more lenient on member declarations
85+
max-classes-per-file: off # helper classes are common
86+
max-len: [warn, 150] # more lenient on max length per line
87+
no-console: error # prefer the uniform logging methods
88+
no-plusplus: off # allow increment/decrement operators
89+
no-continue: off # allow unlabeled continues
90+
no-mixed-operators: off # this is just cumbersome
91+
no-multi-assign: off # it is handy sometimes
92+
no-nested-ternary: off # it is handy sometimes
93+
no-param-reassign: off # the output object is passed as parameters all the time
94+
no-restricted-syntax: off # for-in is a efficient choice for plain objects
95+
no-return-assign: off # it is handy sometimes
96+
no-shadow: off # TODO: this throws false-positives?
97+
no-sequences: off # it is handy sometimes
98+
no-bitwise: off # we use this extensively
99+
no-use-before-define: off # just too much work
100+
no-useless-constructor: off # gives false-positives for empty constructor with parameter properties
101+
object-curly-newline: off # we want manual control over this
102+
one-var-declaration-per-line: off # auto-fix has order issues with `one-var`
103+
prefer-destructuring: off # auto-fix is not smart enough to merge different instances
104+
linebreak-style: off # we don't enforce this on everyone's dev environment for now
105+
spaced-comment: off # for license declarations
106+
default-case-last: off # Place default case clause to first make it more clear that this switch statement has handled all cases
107+
108+
##### TYPESCRIPT-SPECIFIC RULE OVERRIDES #####
109+
110+
'@typescript-eslint/ban-ts-comment': [error, {
111+
'ts-expect-error': true,
112+
'ts-ignore': true,
113+
'ts-nocheck': true,
114+
'ts-check': false,
115+
}]
116+
'@typescript-eslint/no-unused-expressions': warn
117+
118+
# TODO: this is just too much work
119+
'@typescript-eslint/explicit-module-boundary-types': off
120+
121+
# NOTE: We don't want to rely on TS automatic type inference
122+
'@typescript-eslint/no-inferrable-types': off
123+
124+
# TODO: sadly we still rely heavily on legacyCC
125+
'@typescript-eslint/no-unsafe-assignment': off
126+
'@typescript-eslint/no-unsafe-call': off
127+
'@typescript-eslint/no-unsafe-member-access': off
128+
129+
'@typescript-eslint/no-unsafe-enum-comparison': off
130+
131+
'@typescript-eslint/unbound-method': off # we exploit prototype methods sometimes to acheive better performace
132+
'@typescript-eslint/no-explicit-any': off # still relevant for some heavily templated usages
133+
134+
'@typescript-eslint/no-empty-function': off # may become useful in some parent classes
135+
136+
'@typescript-eslint/no-unused-vars': off # may become useful in some parent classes
137+
'@typescript-eslint/no-non-null-assertion': off # sometimes we just know better than the compiler
138+
'@typescript-eslint/no-namespace': [warn, { # we need to declare static properties
139+
allowDeclarations: true,
140+
allowDefinitionFiles: true
141+
}]
142+
'@typescript-eslint/restrict-template-expressions': [warn, { # concatenations of different types are common, e.g. hash calculations
143+
allowNumber: true,
144+
allowBoolean: true
145+
}]
146+
147+
'@typescript-eslint/type-annotation-spacing': warn
148+
149+
# We choose to use style `... as foo` since it's more common.
150+
# In the other hand, angle bracket style can be ambiguous with j/tsx syntax.
151+
# For example, https://babeljs.io/docs/en/babel-plugin-transform-typescript#istsx
152+
# forbids angle bracket style if `isTSX` is enabled.
153+
'@typescript-eslint/consistent-type-assertions': [error, {
154+
assertionStyle: 'as'
155+
}]
156+
157+
# Prefer the interface style.
158+
'@typescript-eslint/consistent-type-definitions': [error, interface]
159+
'@typescript-eslint/explicit-function-return-type': [error, {
160+
allowIIFEs: true, # IIFEs are widely used, writing their signature twice is painful
161+
}]
162+
163+
'@typescript-eslint/no-this-alias': off

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Bug report
2+
description: Create a report to help us improve
3+
labels: ["Needs Triage","Bug"]
4+
body:
5+
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Please write a descriptive issue title above.
10+
11+
**Before You Start:**
12+
- Search [open](https://github.com/cocos/cocos-engine/issues) and [closed](https://github.com/cocos/cocos-engine/issues?q=is%3Aissue+is%3Aclosed) issues to ensure it has not already been reported.
13+
- Verify that your issue is reproducible in the latest stable version of [Cocos Creator](https://www.cocos.com/creator).
14+
15+
**For usage questions, please use the following resources:**
16+
- Read our [Docs](https://docs.cocos.com/creator/manual/en/)
17+
- Check our [API](https://docs.cocos.com/creator/api/en/#/)
18+
- Watch our [Video Tutorials](https://www.youtube.com/cocosengine)
19+
- Ask on our [forum](https://discuss.cocos2d-x.org/)
20+
21+
**Thanks for taking the time to fill out this form!**
22+
23+
24+
- type: input
25+
attributes:
26+
label: Cocos Creator version
27+
description: >
28+
Specify the official build version of engine.
29+
If you use a custom build, please test if your issue is reproducible in the official builds too.
30+
placeholder: 3.4.2, 3.5.0
31+
validations:
32+
required: true
33+
34+
- type: input
35+
attributes:
36+
label: System information
37+
description: |
38+
Specify the OS version, and when relevant hardware information.
39+
For graphics-related issues, specify the GPU model, driver version, and the rendering backend (GLES2, GLES3, Vulkan).
40+
For issues regarding to smart phones, specify the OS and phone model
41+
placeholder: Windows 10 Editor, iOS 15.4 build on iPhone 13
42+
validations:
43+
required: true
44+
45+
- type: textarea
46+
attributes:
47+
label: Issue description
48+
description: |
49+
Describe your issue briefly. What doesn't work, and how do you expect it to work instead?
50+
You can include images or videos with drag and drop, and format code blocks or logs with <code>```</code> tags.
51+
validations:
52+
required: true
53+
54+
- type: textarea
55+
attributes:
56+
label: Relevant error log output
57+
description: |
58+
Error output and stack trace.
59+
validations:
60+
required: false
61+
62+
- type: textarea
63+
attributes:
64+
label: Steps to reproduce
65+
description: |
66+
List of steps or sample code that reproduces the issue. If you include a minimal reproduction project below, you can detail how to use it here. Clear and concise reproduction instructions are important for us to be able to triage your issue in a timely manner.
67+
68+
Note that you can use [Markdown](https://guides.github.com/features/mastering-markdown/) to format lists and code.
69+
validations:
70+
required: true
71+
72+
- type: textarea
73+
attributes:
74+
label: Minimal reproduction project
75+
description: |
76+
A small Cocos Creator project which reproduces the issue. Highly recommended to speed up troubleshooting.
77+
Drag and drop a ZIP archive to upload it.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
blank_issues_enabled: true
2+
3+
contact_links:
4+
5+
- name: Documentation issue
6+
url: https://github.com/cocos/cocos-docs
7+
about: Please report issues with documentation on the documentation repository, not here
8+
9+
- name: General discussions and questions
10+
url: https://discuss.cocos2d-x.org/
11+
about: Please post on the forum if you want to ask questions, make suggestions and feature requests. Or you can visit the Chinese forum at https://forum.cocos.org
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Feature request
2+
description: Suggest an idea for Cocos
3+
labels: ["Needs Triage","Feature Request"]
4+
body:
5+
6+
- type: markdown
7+
attributes:
8+
value: |
9+
- Please write a descriptive proposal title above.
10+
- Search [open](https://github.com/cocos/cocos-engine/issues) and [closed](https://github.com/cocos/cocos-engine/issues?q=is%3Aissue+is%3Aclosed) issues to ensure it has not already been suggested.
11+
12+
- type: textarea
13+
attributes:
14+
label: Use Case
15+
description: Explain your use case, context, and rationale behind this feature request. More importantly, what is the project you are trying to build that led to the need for this feature? This is important to know the **context** in which the feature is being proposed.
16+
placeholder: Example - "I am working on a MOBA game that ... With heavy use of navigation..."
17+
validations:
18+
required: true
19+
20+
- type: textarea
21+
attributes:
22+
label: Problem Description
23+
description: Please add a clear and concise description of the problem or limitation you are having in your project.
24+
validations:
25+
required: true
26+
27+
- type: textarea
28+
attributes:
29+
label: Proposed Solution
30+
description: Describe the desired workflow or API set to satisfy the need in a clear and concise manner.
31+
validations:
32+
required: false
33+
34+
- type: textarea
35+
attributes:
36+
label: How it works
37+
description: Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams. If the API needs to be changed, please describe what does the proposed API look like and provide code samples. Note that you can use Markdown to format your code blocks.
38+
placeholder: Example - "When the user presses ..., select all nodes that have the group..."
39+
validations:
40+
required: false
41+
42+
- type: textarea
43+
attributes:
44+
label: Alternatives Considered
45+
description: A clear and concise description of any alternative solutions or features you've considered.
46+
placeholder: Example - "It would be possible to do it with ... But ..."
47+
validations:
48+
required: true
49+
50+
- type: textarea
51+
attributes:
52+
label: Additional Information
53+
description: Add any other context about the problem here.
54+
validations:
55+
required: false
56+
57+
- type: markdown
58+
attributes:
59+
value: |
60+
Thanks for taking the time to fill out this form!

0 commit comments

Comments
 (0)