Update JS

master
Benoît 2020-06-10 19:48:00 +02:00
parent 3162ac8569
commit 521153953b
4 changed files with 927 additions and 300 deletions

View File

@ -1,24 +0,0 @@
#!/usr/bin/env node
const { spawn } = require("child_process");
const fs = require("fs");
let folderName = '.';
if (process.argv.length >= 3) {
folderName = process.argv[2];
if (!fs.existsSync(folderName)) {
fs.mkdirSync(folderName);
}
}
const clone = spawn("git", ["clone", "https://github.com/rustwasm/create-wasm-app.git", folderName]);
clone.on("close", code => {
if (code !== 0) {
console.error("cloning the template failed!")
process.exit(code);
} else {
console.log("🦀 Rust + 🕸 Wasm = ❤");
}
});

View File

@ -6,12 +6,12 @@ import { Universe, Cell } from "wasm-game-of-life";
let req_id; let req_id;
let stop = false; let stop = false;
const CELL_SIZE = 60; // px const CELL_SIZE = 40; // px
const GRID_COLOR = "#CCCCCC"; const GRID_COLOR = "#CCCCCC";
const DEAD_COLOR = "#FFFFFF"; const DEAD_COLOR = "#FFFFFF";
const ALIVE_COLOR = "#3399FF"; const ALIVE_COLOR = "#3399FF";
const universe = Universe.new(5,5); const universe = Universe.new(10,10);
const width = universe.width(); const width = universe.width();
const height = universe.height(); const height = universe.height();

1184
www/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -3,16 +3,13 @@
"version": "0.1.0", "version": "0.1.0",
"description": "Game of Life in Wasm", "description": "Game of Life in Wasm",
"main": "index.js", "main": "index.js",
"bin": {
"create-wasm-app": ".bin/create-wasm-app.js"
},
"scripts": { "scripts": {
"build": "webpack --config webpack.config.js", "build": "webpack --config webpack.config.js",
"start": "webpack-dev-server" "start": "webpack-dev-server"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/rustwasm/create-wasm-app.git" "url": "git+https://dev.beneth.fr/rustwasm/wasm_game_of_life"
}, },
"keywords": [ "keywords": [
"webassembly", "webassembly",
@ -20,12 +17,12 @@
"rust", "rust",
"webpack" "webpack"
], ],
"author": "Ashley Williams <ashley666ashley@gmail.com>", "author": "Benoît Mauduit <bmauduit@beneth.fr>",
"license": "(MIT OR Apache-2.0)", "license": "(MIT OR Apache-2.0)",
"bugs": { "bugs": {
"url": "https://github.com/rustwasm/create-wasm-app/issues" "url": "https://dev.beneth.fr/rustwasm/wasm_game_of_life/issues"
}, },
"homepage": "https://dev.beneth.fr/wasm_game_of_life", "homepage": "https://dev.beneth.fr/rustwasm/wasm_game_of_life",
"devDependencies": { "devDependencies": {
"webpack": "^4.29.3", "webpack": "^4.29.3",
"webpack-cli": "^3.1.0", "webpack-cli": "^3.1.0",