Skip to content

Commit

Permalink
Merge pull request #2 from galacean/build/low-end-compat
Browse files Browse the repository at this point in the history
build: remove Object.entries, add compat lint rules to ensure compatibility with low-end devices
  • Loading branch information
yiiqii authored Jan 17, 2024
2 parents 32167b5 + 12235b0 commit 4386e00
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 5 deletions.
11 changes: 11 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ module.exports = {
"plugin:@typescript-eslint/recommended",
"plugin:promise/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:compat/recommended",
],
plugins: [
"@typescript-eslint",
"compat",
],
rules: {
"arrow-parens": ["error", "as-needed"],
Expand Down Expand Up @@ -134,5 +136,14 @@ module.exports = {
"disallowTypeAnnotations": false,
},
],
"compat/compat": "error",
},
overrides: [
{
"files": ["**/test/**/*.ts", "**/demo/**/*.ts"],
"rules": {
"compat/compat": "off"
}
}
]
};
4 changes: 2 additions & 2 deletions fallback/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ export function ensureFixedVec3 (a: any): FixedVec3Expression | undefined {
}

export function objectValueToNumber (o: Record<string, any>): object {
for (const [key, value] of Object.entries(o)) {
o[key] = Number(value);
for (const key of Object.keys(o)) {
o[key] = Number(o[key]);
}

return o;
Expand Down
120 changes: 118 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@galacean/effects-specification",
"version": "1.0.0",
"version": "1.0.1",
"description": "Galacean Effects JSON Specification",
"module": "./dist/index.mjs",
"main": "./dist/index.js",
Expand Down Expand Up @@ -33,6 +33,9 @@
"prepare": "husky install",
"prepublishOnly": "npm run build"
},
"browserslist": [
"iOS 9"
],
"devDependencies": {
"@commitlint/cli": "^13.2.1",
"@commitlint/config-conventional": "^13.2.0",
Expand All @@ -48,6 +51,7 @@
"chai": "^4.3.6",
"chai-spies": "^1.0.0",
"eslint": "^8.13.0",
"eslint-plugin-compat": "^4.2.0",
"eslint-plugin-promise": "^6.1.1",
"husky": "^7.0.4",
"lint-staged": "^11.2.6",
Expand Down

0 comments on commit 4386e00

Please sign in to comment.