Skip to content

Commit 5841e09

Browse files
committed
feat: init
1 parent 46a493f commit 5841e09

File tree

652 files changed

+131951
-17
lines changed

Some content is hidden

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

652 files changed

+131951
-17
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
max_line_length = 120

.eslintrc.js

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
module.exports = {
2+
root: true,
3+
parser: "@typescript-eslint/parser",
4+
parserOptions: {
5+
tsconfigRootDir: __dirname,
6+
project: ["**/tsconfig.json"],
7+
},
8+
env: {
9+
browser: true,
10+
node: true,
11+
jest: true,
12+
},
13+
globals: { 'THREE': true },
14+
ignorePatterns: [
15+
'**/{node_modules,libs}',
16+
'*.js',
17+
'*.d.ts',
18+
'temp',
19+
],
20+
extends: [
21+
"eslint:recommended",
22+
"plugin:@typescript-eslint/recommended",
23+
"plugin:promise/recommended",
24+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
25+
],
26+
plugins: [
27+
"@typescript-eslint",
28+
],
29+
rules: {
30+
"arrow-parens": ["error", "as-needed"],
31+
"array-bracket-spacing": ["error", "never"],
32+
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
33+
"comma-dangle": ["error", "always-multiline"],
34+
"curly": "error",
35+
"generator-star-spacing": ["error", {
36+
"before": false,
37+
"after": true,
38+
"anonymous": "neither",
39+
"method": "neither"
40+
}],
41+
"new-parens": "error",
42+
"no-multi-spaces": [
43+
"error",
44+
{
45+
"ignoreEOLComments": true
46+
}
47+
],
48+
"no-console": ["error", { "allow": ["info", "warn", "error", "debug", "trace"] }],
49+
"no-inner-declarations": "error",
50+
"no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 1 }],
51+
"no-trailing-spaces": "error",
52+
"no-void": ["error", { "allowAsStatement": true }],
53+
"padding-line-between-statements": [
54+
"error",
55+
{ "blankLine": "always", "prev": "*", "next": ["return", "break"] },
56+
{ "blankLine": "never", "prev": "*", "next": ["case", "default"] },
57+
{ "blankLine": "always", "prev": ["const", "let", "var"], "next": "*" },
58+
{ "blankLine": "any", "prev": ["const", "let", "var"], "next": ["const", "let", "var"] }
59+
],
60+
"promise/always-return": "off",
61+
// TODO:: will be opened
62+
"promise/catch-or-return": "off",
63+
"prefer-rest-params": "off",
64+
"semi": ["error", "always"],
65+
"space-in-parens": ["error", "never"],
66+
"@typescript-eslint/comma-spacing": "error",
67+
"@typescript-eslint/no-namespace": "off",
68+
// TODO:: will be ["error", "never"]
69+
"import/prefer-default-export": "off",
70+
"@typescript-eslint/explicit-module-boundary-types": "off",
71+
"@typescript-eslint/no-unused-vars": "off",
72+
"@typescript-eslint/ban-ts-comment": "off",
73+
// TODO:: will be opened
74+
"@typescript-eslint/ban-types": "off",
75+
"@typescript-eslint/indent": ["error", 2],
76+
"@typescript-eslint/keyword-spacing": "error",
77+
// TODO:: will be opened
78+
"@typescript-eslint/no-var-requires": "off",
79+
// TODO:: will be opened
80+
"@typescript-eslint/no-non-null-assertion": "off",
81+
// TODO:: will be opened
82+
"@typescript-eslint/no-explicit-any": "off",
83+
"@typescript-eslint/no-empty-interface": "off",
84+
"@typescript-eslint/no-empty-function": "off",
85+
"@typescript-eslint/no-unnecessary-type-arguments": "error",
86+
"@typescript-eslint/no-unnecessary-type-assertion": "error",
87+
"@typescript-eslint/no-unnecessary-type-constraint": "error",
88+
// TODO:: will be opened
89+
"@typescript-eslint/no-unsafe-return": "off",
90+
// TODO:: will be opened
91+
"@typescript-eslint/no-unsafe-member-access": "off",
92+
"@typescript-eslint/no-unsafe-call": "off",
93+
"@typescript-eslint/object-curly-spacing": ["error", "always"],
94+
"@typescript-eslint/prefer-includes": "error",
95+
"@typescript-eslint/prefer-reduce-type-parameter": "error",
96+
"@typescript-eslint/prefer-ts-expect-error": "error",
97+
"@typescript-eslint/return-await": "error",
98+
// TODO:: will be opened
99+
"@typescript-eslint/restrict-plus-operands": "off",
100+
// TODO:: will be opened
101+
"@typescript-eslint/restrict-template-expressions": "off",
102+
"@typescript-eslint/space-infix-ops": ["error", { "int32Hint": false }],
103+
// TODO:: will be "error"
104+
"@typescript-eslint/strict-boolean-expressions": "off",
105+
"@typescript-eslint/no-floating-promises": ["error", { "ignoreVoid": true, "ignoreIIFE": true }],
106+
"@typescript-eslint/quotes": ["error", "single"],
107+
// TODO:: will be opened
108+
"@typescript-eslint/require-await": "off",
109+
"@typescript-eslint/space-before-blocks": "error",
110+
"@typescript-eslint/space-before-function-paren": ["error", "always"],
111+
"@typescript-eslint/type-annotation-spacing": "error",
112+
"@typescript-eslint/unbound-method": "off",
113+
// TODO:: will be opened
114+
"@typescript-eslint/no-misused-promises": "off",
115+
"@typescript-eslint/prefer-regexp-exec": "off",
116+
"@typescript-eslint/semi": "error",
117+
// TODO:: will be opened
118+
"@typescript-eslint/member-delimiter-style": ["error", {
119+
"multiline": {
120+
"delimiter": "comma",
121+
"requireLast": true
122+
},
123+
"singleline": {
124+
"delimiter": "comma",
125+
"requireLast": false
126+
}
127+
}],
128+
"@typescript-eslint/no-unsafe-enum-comparison": "warn",
129+
"@typescript-eslint/no-base-to-string": "off",
130+
"@typescript-eslint/no-duplicate-enum-values": "off",
131+
"@typescript-eslint/no-unsafe-assignment": "off",
132+
// TODO:: will be opened
133+
"@typescript-eslint/no-unsafe-argument": "off",
134+
"@typescript-eslint/consistent-type-imports": [
135+
"error",
136+
{
137+
"prefer": "type-imports",
138+
"disallowTypeAnnotations": false,
139+
},
140+
],
141+
},
142+
};

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
node_modules
2+
.DS_Store
3+
dist
4+
lib
5+
*.local
6+
*.tgz
7+
.eslintcache
8+
*.tsbuildinfo
9+
.vscode
10+
.idea
11+
.history
12+
.accesskey.yml
13+
.pnpm-debug.log
14+
temp
15+
api
16+
www

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
PATH=$PATH:/usr/local/bin:/usr/local/sbin
4+
npx commitlint --edit "$1"

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
PATH=$PATH:/usr/local/bin:/usr/local/sbin
4+
npx lint-staged

.lintstagedrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"{packages,plugin-packages,web-packages}/**/*.ts": [
3+
"eslint --cache --fix",
4+
"sh -c 'tsc -b tsconfig.check.json'"
5+
]
6+
}

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
engine-strict=true
2+
enable-pre-post-scripts=true

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
`effects-runtime` 遵循 [Semantic Versioning 2.0.0](http://semver.org/lang/zh-CN/) 语义化版本规范。
2+
3+
#### 发布周期
4+
5+
- 修订版本号:每周末会进行日常 bugfix 更新(如果有紧急的 bugfix,则任何时候都可发布)。
6+
- 次版本号:每月发布一个带有新特性的向下兼容的版本。
7+
- 主版本号:含有破坏性更新和新特性,不在发布周期内。
8+
9+
---
10+
## 1.0.0
11+
12+
`2023-11-21`
13+
14+
init

LICENSE

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1-
MIT License
1+
MIT LICENSE
22

3-
Copyright (c) 2023 Galacean
3+
Copyright (c) 2019-present Ant Group Co., Ltd. https://www.antgroup.com/
44

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
5+
Permission is hereby granted, free of charge, to any person obtaining
6+
a copy of this software and associated documentation files (the
7+
"Software"), to deal in the Software without restriction, including
8+
without limitation the rights to use, copy, modify, merge, publish,
9+
distribute, sublicense, and/or sell copies of the Software, and to
10+
permit persons to whom the Software is furnished to do so, subject to
11+
the following conditions:
1112

12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
13+
The above copyright notice and this permission notice shall be
14+
included in all copies or substantial portions of the Software.
1415

15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Galacean Effects Runtime
2+
3+
Galacean Effects runtime, It can load and render cool animation effects, The APIs provided by effects-core allow your engine to quickly access animation data such as layer and particle animation.
4+
5+
## [Integration Guide](https://galacean.antgroup.com/effects/#/user/ti4f2yx1rot4hs1n)
6+
7+
## [API Documentation]((https://galacean.antgroup.com/effects/#/api))
8+
9+
## Development
10+
11+
### Environment Setup
12+
13+
- Node.js `>= 16.0.0`
14+
- [Pnpm](https://pnpm.io/) `latest`
15+
- Install:
16+
- `npm install -g pnpm`
17+
- Upgrade:
18+
- `pnpm install -g pnpm`
19+
20+
### Getting Started
21+
22+
``` bash
23+
# 1. Install dependencies (first time)
24+
pnpm install
25+
# 2. Start the demo
26+
pnpm dev
27+
```
28+
29+
> Open in browser: http://localhost:8080/
30+
31+
## Plugin Example
32+
33+
``` bash
34+
# demo
35+
pnpm --filter @galacean/xxx dev
36+
```
37+
38+
> Open in browser: http://localhost:8081/demo/
39+
40+
### Low-End Device Testing
41+
42+
``` bash
43+
# Run the legacy version of the demo
44+
pnpm preview
45+
```
46+
47+
## Testing
48+
49+
``` bash
50+
pnpm test
51+
```
52+
53+
> Open in browser: http://localhost:9090/
54+
55+
### Installing Single Packages
56+
57+
``` bash
58+
# Install to the root directory
59+
pnpm add ajv@^6.5.3 -w -D
60+
# Install to a specific package
61+
pnpm add ajv@^6.5.3 --filter @galacean/effects-core
62+
```
63+
64+
## Other Commands
65+
66+
``` bash
67+
# lint
68+
pnpm lint
69+
# Type checking
70+
pnpm check:ts
71+
# Clean all ignore files
72+
pnpm clean:all
73+
# Build packages
74+
pnpm build
75+
# Build plugins
76+
pnpm build:plugins
77+
# Generate API documentation
78+
pnpm build:docs
79+
# Build a specific package
80+
pnpm --filter @galacean/xxx build
81+
```

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = { extends: ['@commitlint/config-conventional'] };

0 commit comments

Comments
 (0)