Spaces:
Running
Running
Julien Chaumond
commited on
Commit
·
18a9c33
0
Parent(s):
[PITA] Setup decent dev workflow
Browse files- .gitattributes +5 -0
- .gitignore +78 -0
- .vscode/tasks.json +14 -0
- index.html +18 -0
- package-lock.json +13 -0
- package.json +14 -0
- post-compile.sh +3 -0
- src/index.ts +3 -0
- src/lib/Log.ts +1 -0
- supervisor.sh +4 -0
- tsconfig.json +10 -0
.gitattributes
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.dae filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.fbx filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.gltf filter=lfs diff=lfs merge=lfs -text
|
.gitignore
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Logs
|
| 2 |
+
logs
|
| 3 |
+
*.log
|
| 4 |
+
npm-debug.log*
|
| 5 |
+
yarn-debug.log*
|
| 6 |
+
yarn-error.log*
|
| 7 |
+
|
| 8 |
+
# Runtime data
|
| 9 |
+
pids
|
| 10 |
+
*.pid
|
| 11 |
+
*.seed
|
| 12 |
+
*.pid.lock
|
| 13 |
+
|
| 14 |
+
# Directory for instrumented libs generated by jscoverage/JSCover
|
| 15 |
+
lib-cov
|
| 16 |
+
|
| 17 |
+
# Coverage directory used by tools like istanbul
|
| 18 |
+
coverage
|
| 19 |
+
|
| 20 |
+
# nyc test coverage
|
| 21 |
+
.nyc_output
|
| 22 |
+
|
| 23 |
+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
| 24 |
+
.grunt
|
| 25 |
+
|
| 26 |
+
# Bower dependency directory (https://bower.io/)
|
| 27 |
+
bower_components
|
| 28 |
+
|
| 29 |
+
# node-waf configuration
|
| 30 |
+
.lock-wscript
|
| 31 |
+
|
| 32 |
+
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
| 33 |
+
build/Release
|
| 34 |
+
|
| 35 |
+
# Dependency directories
|
| 36 |
+
node_modules/
|
| 37 |
+
jspm_packages/
|
| 38 |
+
|
| 39 |
+
# TypeScript v1 declaration files
|
| 40 |
+
typings/
|
| 41 |
+
|
| 42 |
+
# Optional npm cache directory
|
| 43 |
+
.npm
|
| 44 |
+
|
| 45 |
+
# Optional eslint cache
|
| 46 |
+
.eslintcache
|
| 47 |
+
|
| 48 |
+
# Optional REPL history
|
| 49 |
+
.node_repl_history
|
| 50 |
+
|
| 51 |
+
# Output of 'npm pack'
|
| 52 |
+
*.tgz
|
| 53 |
+
|
| 54 |
+
# Yarn Integrity file
|
| 55 |
+
.yarn-integrity
|
| 56 |
+
|
| 57 |
+
# dotenv environment variables file
|
| 58 |
+
.env
|
| 59 |
+
|
| 60 |
+
# parcel-bundler cache (https://parceljs.org/)
|
| 61 |
+
.cache
|
| 62 |
+
|
| 63 |
+
# next.js build output
|
| 64 |
+
.next
|
| 65 |
+
|
| 66 |
+
# nuxt.js build output
|
| 67 |
+
.nuxt
|
| 68 |
+
|
| 69 |
+
# vuepress build output
|
| 70 |
+
.vuepress/dist
|
| 71 |
+
|
| 72 |
+
# Serverless directories
|
| 73 |
+
.serverless
|
| 74 |
+
|
| 75 |
+
# FuseBox cache
|
| 76 |
+
.fusebox/
|
| 77 |
+
|
| 78 |
+
dist/
|
.vscode/tasks.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
| 3 |
+
// for the documentation about the tasks.json format
|
| 4 |
+
"version": "2.0.0",
|
| 5 |
+
"tasks": [
|
| 6 |
+
{
|
| 7 |
+
"label": "post-compile",
|
| 8 |
+
"type": "process",
|
| 9 |
+
"isBackground": true,
|
| 10 |
+
"command": "fswatch -o dist/*.js | xargs -n 1 './post-compile.sh'",
|
| 11 |
+
"problemMatcher": []
|
| 12 |
+
}
|
| 13 |
+
]
|
| 14 |
+
}
|
index.html
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html>
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset=utf-8>
|
| 5 |
+
<title>My first three.js app</title>
|
| 6 |
+
<style>
|
| 7 |
+
body { margin: 0; }
|
| 8 |
+
canvas { width: 100%; height: 100% }
|
| 9 |
+
</style>
|
| 10 |
+
</head>
|
| 11 |
+
<body>
|
| 12 |
+
<script src="node_modules/three/build/three.js"></script>
|
| 13 |
+
<script src="node_modules/three/examples/js/libs/stats.min.js"></script>
|
| 14 |
+
<script src="node_modules/three/examples/js/loaders/ColladaLoader.js"></script>
|
| 15 |
+
<script src="dist/lib/Log.js"></script>
|
| 16 |
+
<script src="dist/post/index.js"></script>
|
| 17 |
+
</body>
|
| 18 |
+
</html>
|
package-lock.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "web3d",
|
| 3 |
+
"version": "1.0.0",
|
| 4 |
+
"lockfileVersion": 1,
|
| 5 |
+
"requires": true,
|
| 6 |
+
"dependencies": {
|
| 7 |
+
"three": {
|
| 8 |
+
"version": "0.103.0",
|
| 9 |
+
"resolved": "https://registry.npmjs.org/three/-/three-0.103.0.tgz",
|
| 10 |
+
"integrity": "sha512-4WKRHTMt96sp+lX+Hx/eHtN9CWFyejDqr1ikgxZUJIkKEHVglSE7FY8n81NC6yWXqVSjUIQQppaxsoUe26Zi9g=="
|
| 11 |
+
}
|
| 12 |
+
}
|
| 13 |
+
}
|
package.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "web3d",
|
| 3 |
+
"version": "1.0.0",
|
| 4 |
+
"description": "",
|
| 5 |
+
"main": "index.js",
|
| 6 |
+
"scripts": {
|
| 7 |
+
"test": "echo \"Error: no test specified\" && exit 1"
|
| 8 |
+
},
|
| 9 |
+
"author": "",
|
| 10 |
+
"license": "ISC",
|
| 11 |
+
"dependencies": {
|
| 12 |
+
"three": "^0.103.0"
|
| 13 |
+
}
|
| 14 |
+
}
|
post-compile.sh
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
echo "post-compile-tweaks"
|
| 3 |
+
tail -n +4 dist/index.js > dist/post/index.js
|
src/index.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as THREE from 'three';
|
| 2 |
+
|
| 3 |
+
c.log(THREE.AmbientLight);
|
src/lib/Log.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
const c = console;
|
supervisor.sh
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
fswatch -o dist/*.js | xargs -n 1 './post-compile.sh' &
|
| 4 |
+
php -S localhost:8000
|
tsconfig.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"compilerOptions": {
|
| 3 |
+
"target": "es2018",
|
| 4 |
+
"module": "commonjs",
|
| 5 |
+
"outDir": "dist/",
|
| 6 |
+
"strictNullChecks": true,
|
| 7 |
+
"strictBindCallApply": true,
|
| 8 |
+
"lib": ["es6", "es2016", "es2017", "es2018", "esnext", "dom", "dom.iterable"]
|
| 9 |
+
}
|
| 10 |
+
}
|