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

WIP: TS Typings #1

Merged
merged 65 commits into from
Mar 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
dc2e52c
Added rollup TS support
giulioz Feb 24, 2021
f8c5445
Ported WebGL.js to TS
giulioz Feb 24, 2021
b1a69ec
Added three types and common ts config
giulioz Feb 24, 2021
b44e9b1
Fixed new rollup typescript
giulioz Feb 26, 2021
6de9b32
adds eslint config + relevant packages from pmndrs/drei
DylanTackoor Feb 27, 2021
dcf9881
matches babel/preset-typescript version + removes storybook from esli…
DylanTackoor Feb 27, 2021
938045a
Typed OrbitControls
giulioz Feb 27, 2021
64c9c4d
FlyControls and fixed OrbitControls
giulioz Feb 27, 2021
2a539e9
OrbitControls again...
giulioz Feb 27, 2021
5831226
DeviceOrientationControls
giulioz Feb 27, 2021
2ff5eac
adds initial FirstPersonControls.ts
DylanTackoor Feb 27, 2021
f9eb04a
types FirstPersonControls + adds type checking against staged ts(x) f…
DylanTackoor Feb 27, 2021
e487f5e
enables eslint caching
DylanTackoor Feb 27, 2021
ed3996f
moves most FirstPersonControls methods out of constructor
DylanTackoor Feb 27, 2021
06e05ac
typo fix :)
DylanTackoor Feb 27, 2021
40968fc
removes any
DylanTackoor Feb 27, 2021
312dbb6
removes .js file?
DylanTackoor Feb 27, 2021
3ca27b5
initial DragControls typings
DylanTackoor Feb 28, 2021
598fb89
moves DragControls constructor functions to es6 methods
DylanTackoor Feb 28, 2021
27bcfbc
prevents lint-staged + types script from transpiling files
DylanTackoor Feb 28, 2021
2ced70d
moves remaining DragControls constructor functions to es6 methods
DylanTackoor Feb 28, 2021
8cde3a7
better matches typescript version specifier against @typescript-eslin…
DylanTackoor Feb 28, 2021
71b7f16
removes original .js file :)
DylanTackoor Feb 28, 2021
9b5fa0f
removes remaining any types
DylanTackoor Feb 28, 2021
5a0a5cd
groups event handler methods by event type + hides more _values
DylanTackoor Feb 28, 2021
3dc2472
removed libs
RenaudRohlinger Feb 27, 2021
409b6ad
0.0.11
RenaudRohlinger Feb 27, 2021
606e2dc
feat: add SimplexNoise TS
joshuaellis Feb 27, 2021
c451acb
feat: add SimplexNoise
joshuaellis Feb 27, 2021
81f67ab
feat: add HorizontalBlurShader
joshuaellis Feb 27, 2021
2fc77a5
feat: add VerticalBlurShader
joshuaellis Feb 27, 2021
8882d72
feat: add CurveModifier
joshuaellis Feb 28, 2021
77ef002
move types/helpers to types/shared
joshuaellis Feb 28, 2021
b70a1ca
fix: update shaders
joshuaellis Feb 28, 2021
3838cab
feat: add GammaCorrectionShader
joshuaellis Feb 28, 2021
3dc2f86
feat: add Line2, LineMaterial & LineGeometry
joshuaellis Feb 28, 2021
9c51c93
Merge branch 'main' into typings-1
joshuaellis Mar 1, 2021
b117f3b
make orbit side-effect free
drcmda Mar 1, 2021
273379e
make orbit side-effect free
drcmda Mar 1, 2021
dd66580
feat: add TrackballControls
joshuaellis Mar 1, 2021
f59f1e2
feat: add transform controls
joshuaellis Mar 1, 2021
b9ceb5a
fix: domElement can be null, add checkers
joshuaellis Mar 1, 2021
0a4dbd5
Removed some private variables in DeviceOrientationControls
giulioz Mar 2, 2021
db0d12d
Refactored FPC
giulioz Mar 2, 2021
6e81bba
Refactored DragControls
giulioz Mar 2, 2021
22562c0
initial typings CameraControls
DylanTackoor Feb 28, 2021
26ea3f0
changes CameraControl class comments to jsdoc
DylanTackoor Feb 28, 2021
e89c1d6
moar TS
DylanTackoor Feb 28, 2021
dfa6657
WIP private method updates
DylanTackoor Mar 1, 2021
929d1ab
converts remaning private methods
DylanTackoor Mar 1, 2021
9a20e64
converts event callbacks
DylanTackoor Mar 1, 2021
a94f0c3
type + comment cleanup
DylanTackoor Mar 1, 2021
34c20fa
properly types CameraControls.object
DylanTackoor Mar 1, 2021
586d930
removes unused interface + CameraControl.js
DylanTackoor Mar 1, 2021
f366596
Revert "removes unused interface + CameraControl.js"
DylanTackoor Mar 1, 2021
1fc61f9
removes only the js file :facepalm:
DylanTackoor Mar 1, 2021
6867302
adds fixme comments for when i can get back to this
DylanTackoor Mar 1, 2021
2588fc4
resolves FIXMEs
DylanTackoor Mar 2, 2021
f613479
CameraControls.update cleanup
DylanTackoor Mar 2, 2021
7e75cc5
simplifies pan/panUp/panLeft
DylanTackoor Mar 2, 2021
613dd32
last CameraControls.ts type fixes
DylanTackoor Mar 2, 2021
633b94a
moves most CameraControls prop initialization out of constructor
DylanTackoor Mar 2, 2021
fd6002a
converts some comments to tsdoc + fixes fixes mouseButtons types by m…
DylanTackoor Mar 2, 2021
cd40115
simplifies PointerLockControls.getDirection()
DylanTackoor Mar 2, 2021
e940311
refactor: simplifies PointerLockControls.getDirection()
joshuaellis Mar 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"env": {
"browser": true,
"shared-node-browser": true,
"es6": true,
"node": true
},
"extends": [
"prettier",
"prettier/react",
"prettier/@typescript-eslint",
"plugin:prettier/recommended",
"plugin:react-hooks/recommended",
"plugin:import/errors",
"plugin:import/warnings"
],
"plugins": ["@typescript-eslint", "react", "prettier", "react-hooks", "import", "jest"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"ecmaVersion": 2018,
"jsx": true
},
"sourceType": "module"
},
"rules": {
"curly": ["warn", "multi-line", "consistent"],
"no-console": "off",
"no-empty-pattern": "warn",
"no-duplicate-imports": "error",
"import/no-unresolved": ["error", { "commonjs": true, "amd": true }],
"import/export": "error",
"import/named": "off",
"import/no-named-as-default": "off",
"import/no-named-as-default-member": "off",
"import/namespace": "off",
"import/default": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"no-unused-vars": ["warn"],
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }],
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
"jest/consistent-test-it": ["error", { "fn": "it", "withinDescribe": "it" }]
},
"settings": {
"react": {
"version": "detect"
},
"import/extensions": [".js", ".jsx", ".ts", ".tsx"],
"import/parsers": {
"@typescript-eslint/parser": [".js", ".jsx", ".ts", ".tsx"]
},
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx", ".json"],
"paths": ["src"]
}
}
},
"overrides": [
{
"files": ["src"],
"parserOptions": {
"project": ["./tsconfig.json", "./storybook/tsconfig.json"]
}
}
]
}
25 changes: 23 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"prebuild": "rimraf dist",
"build": "rollup -c && npm run copy",
"prepare": "npm run build",
"types": "tsc --noEmit --emitDeclarationOnly false",
"eslint": "eslint --cache --fix src/**/*.{ts,tsx}",
"eslint:ci": "eslint src/**/*.{ts,tsx}",
"copy": "copyfiles package.json readme.md LICENSE dist && json -I -f dist/package.json -e \"this.private=false; this.devDependencies=undefined; this.optionalDependencies=undefined; this.scripts=undefined; this.husky=undefined; this.prettier=undefined; this.jest=undefined; this['lint-staged']=undefined;\"",
"test": "echo \"Error: no test specified\""
},
Expand All @@ -20,7 +23,11 @@
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"prettier --write"
"prettier --write",
"eslint --fix"
],
"*.{ts,tsx}": [
"tsc --noEmit --emitDeclarationOnly false"
]
},
"repository": {
Expand All @@ -43,8 +50,20 @@
"@babel/preset-env": "7.11.0",
"@babel/preset-react": "7.10.4",
"@babel/preset-typescript": "^7.10.4",
"@rollup/plugin-typescript": "^8.2.0",
"@types/three": "^0.125.3",
"@typescript-eslint/eslint-plugin": "^4.15.2",
"@typescript-eslint/parser": "^4.15.2",
"babel-eslint": "^10.1.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"copyfiles": "^2.3.0",
"eslint": "^7.7.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jest": "^23.20.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.20.6",
"eslint-plugin-react-hooks": "^4.1.0",
"husky": "^4.2.5",
"json": "^10.0.0",
"lint-staged": "^10.2.11",
Expand All @@ -58,7 +77,9 @@
"rollup-plugin-multi-input": "^1.1.1",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-size-snapshot": "^0.12.0",
"three": "^0.126.0"
"three": "^0.126.0",
"tslib": "^2.1.0",
"typescript": "<4.2.0"
},
"dependencies": {
"@webgpu/glslang": "^0.0.15",
Expand Down
10 changes: 7 additions & 3 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import json from 'rollup-plugin-json'
import glslify from 'rollup-plugin-glslify'
import multiInput from 'rollup-plugin-multi-input'
import { sizeSnapshot } from 'rollup-plugin-size-snapshot'
import typescript from '@rollup/plugin-typescript'

const root = process.platform === 'win32' ? path.resolve('/') : '/'
const external = (id) => !id.startsWith('.') && !id.startsWith(root)
Expand All @@ -31,22 +32,24 @@ export default [
json(),
babel(getBabelOptions({ useESModules: true }, '>1%, not dead, not ie 11, not op_mini all')),
resolve({ extensions }),
typescript(),
],
preserveModules: true,
},
{
input: ['src/**/*.js', '!src/index.js'],
input: ['src/**/*.js', 'src/**/*.ts', '!src/index.js'],
output: { dir: `dist`, format: 'esm' },
external,
plugins: [
multiInput(),
json(),
babel(getBabelOptions({ useESModules: true }, '>1%, not dead, not ie 11, not op_mini all')),
resolve({ extensions }),
typescript(),
],
},
{
input: ['src/**/*.js', '!src/index.js'],
input: ['src/**/*.js', 'src/**/*.ts', '!src/index.js'],
output: { dir: `dist`, format: 'cjs' },
external,
plugins: [
Expand All @@ -56,12 +59,13 @@ export default [
json(),
babel(getBabelOptions({ useESModules: false })),
resolve({ extensions }),
typescript(),
],
},
{
input: `./src/index.js`,
output: { file: `dist/index.cjs.js`, format: 'cjs' },
external,
plugins: [json(), babel(getBabelOptions({ useESModules: false })), resolve({ extensions })],
plugins: [json(), babel(getBabelOptions({ useESModules: false })), resolve({ extensions }, typescript())],
},
]
109 changes: 0 additions & 109 deletions src/controls/DeviceOrientationControls.js

This file was deleted.

Loading