Skip to content

Commit

Permalink
Update npm deps
Browse files Browse the repository at this point in the history
  • Loading branch information
austinEng committed Sep 8, 2021
1 parent 0783dbd commit 2a869ce
Show file tree
Hide file tree
Showing 8 changed files with 3,151 additions and 22 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@ typings/

# next.js build output
.next

dist/bundle.js
dist/bundle.js.map
2 changes: 1 addition & 1 deletion index.html → dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
</head>
<body>
<canvas id="canvas"></canvas>
<script type="text/javascript" src="dist/bundle.js"></script>
<script type="text/javascript" src="bundle.js"></script>
</body>
</html>
3,120 changes: 3,120 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

23 changes: 11 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
{
"scripts": {
"start": "webpack-dev-server --hot --inline",
"start": "webpack-dev-server --no-hot --live-reload",
"build": "webpack"
},
"devDependencies": {
"@types/node": "^9.3.0",
"@types/webgl2": "0.0.2",
"@types/dat-gui": "^0.6.3",
"@types/gl-matrix": "^2.4.0",
"ts-loader": "^3.2.0",
"typescript": "^2.6.2",
"webpack": "^3.10.0",
"webpack-dev-server": "^2.10.1",
"@types/dat.gui": "^0.7.7",
"@types/webgl2": "0.0.6",
"ts-loader": "^9.2.5",
"typescript": "^4.4.2",
"webpack": "^5.52.0",
"webpack-cli": "^4.8.0",
"webpack-dev-server": "^4.1.1",
"webpack-glsl-loader": "^1.0.1"
},
"dependencies": {
"3d-view-controls": "^2.2.2",
"dat-gui": "^0.5.0",
"gl-matrix": "^2.4.0",
"stats-js": "^1.0.0-alpha1"
"dat.gui": "^0.7.7",
"gl-matrix": "^3.3.0",
"stats-js": "^1.0.1"
}
}
6 changes: 3 additions & 3 deletions src/geometry/Icosphere.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ class Icosphere extends Drawable {
}

// Create 3-float buffer views into the backing buffer to represent positions
let vertices: Array<vec4> = new Array(12);
let vertices: Array<Float32Array> = new Array(12);
for (let i = 0; i < 12; ++i) {
vertices[i] = <vec4> new Float32Array(buffer0, vertexByteOffset + i * 4 * Float32Array.BYTES_PER_ELEMENT, 4);
vertices[i] =new Float32Array(buffer0, vertexByteOffset + i * 4 * Float32Array.BYTES_PER_ELEMENT, 4);
}

// Initialize normals for a 20-sided icosahedron
Expand Down Expand Up @@ -105,7 +105,7 @@ class Icosphere extends Drawable {
function mid(v0: number, v1: number): number {
let key = [v0, v1].sort().join('_');
if (!edgeMap.has(key)) {
let midpoint = <vec4> new Float32Array(buffer0, vertexByteOffset + vertices.length * 4 * Float32Array.BYTES_PER_ELEMENT, 4);
let midpoint = new Float32Array(buffer0, vertexByteOffset + vertices.length * 4 * Float32Array.BYTES_PER_ELEMENT, 4);
vec4.add(midpoint, vertices[v0], vertices[v1]);
vec4.normalize(midpoint, midpoint);
edgeMap.set(key, vertices.length);
Expand Down
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {vec3} from 'gl-matrix';
import * as Stats from 'stats-js';
import * as DAT from 'dat-gui';
const Stats = require('stats-js');
import * as DAT from 'dat.gui';
import Icosphere from './geometry/Icosphere';
import Square from './geometry/Square';
import OpenGLRenderer from './rendering/gl/OpenGLRenderer';
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"noImplicitAny": true,
"module": "es6",
"target": "es6",
"allowJs": true
"allowJs": true,
"moduleResolution": "node"
}
}
12 changes: 9 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
const path = require('path');

module.exports = {
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
entry: path.resolve(__dirname, "src/main"),
output: {
path: path.resolve(__dirname, "dist"),
filename: "bundle.js",
publicPath: 'dist/',
publicPath: '/',
},
module: {
loaders: [
rules: [
{
test: /\.ts$/,
use: 'ts-loader',
Expand All @@ -26,6 +27,11 @@ module.exports = {
devtool: 'source-map',
devServer: {
port: 5660,
overlay: true,
static: {
directory: path.join(__dirname, 'dist'),
},
client: {
overlay: true,
}
},
};

0 comments on commit 2a869ce

Please sign in to comment.