added built assets

This commit is contained in:
Nathan DECHER 2020-04-15 12:08:21 +02:00
parent 3e8eb69329
commit 142024a315
26 changed files with 20 additions and 5 deletions

3
.gitignore vendored
View file

@ -1,9 +1,6 @@
node_modules/ node_modules/
public/assets/*.png
public/assets/*.json
public/css/*.css public/css/*.css
public/js/*.js public/js/*.js
public/favicon.ico
build/*.png build/*.png
db.sqlite db.sqlite

View file

@ -82,7 +82,7 @@ public/assets/portal-d-anim.png: public/assets/portal-a-anim.png
convert $^ -modulate 100,100,50 $@ convert $^ -modulate 100,100,50 $@
public/assets/%.json: assets/%.json public/assets/%.json: assets/%.json
cp $^ $@ ln -s ../../$^ $@
public/css/snek.css: src/less/snek.less $(wildcard src/less/*.less) public/css/snek.css: src/less/snek.less $(wildcard src/less/*.less)
node_modules/.bin/lessc $< $@ node_modules/.bin/lessc $< $@

View file

@ -1,5 +1,19 @@
const DB=require('better-sqlite3'); const DB=require('better-sqlite3');
const fs=require('fs'); const fs=require('fs');
const child_process=require('child_process');
// prepare database
console.log('Preparing database');
fs.unlinkSync('db.sqlite');
const db=new DB('db.sqlite'); const db=new DB('db.sqlite');
db.exec(fs.readFileSync('init.sql', 'utf8')); db.exec(fs.readFileSync('init.sql', 'utf8'));
// compile less
console.log('Compiling less');
child_process.execFileSync('node_modules/.bin/lessc', ['src/less/snek.less', 'public/css/snek.css']);
// merge js
console.log('Merging js');
const jsFiles=fs.readdirSync('src/js').map(f => 'src/js/'+f);
const merged=child_process.execFileSync('node', ['mergejs.js', ...jsFiles]);
fs.writeFileSync('public/js/snek.js', merged);

View file

@ -5,7 +5,7 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"start": "node index.js", "start": "node index.js",
"prepare": "rm -f db.sqlite && make clean all && node install.js" "prepare": "node install.js"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

BIN
public/assets/apple32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

1
public/assets/config.json Symbolic link
View file

@ -0,0 +1 @@
../../assets/config.json

BIN
public/assets/door32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
public/assets/fire-anim.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

BIN
public/assets/hole-ts.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
public/assets/icon256.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

BIN
public/assets/icon32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
public/assets/key32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

View file

@ -0,0 +1 @@
../../assets/levelList.json

View file

@ -0,0 +1 @@
../../assets/metaConfig.json

BIN
public/assets/oil32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

1
public/assets/snake.json Symbolic link
View file

@ -0,0 +1 @@
../../assets/snake.json

BIN
public/assets/spikes-ts.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
public/assets/switch-ts.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
public/assets/wall32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB