| @ -1,9 +1,6 @@ | ||||
| node_modules/ | ||||
| public/assets/*.png | ||||
| public/assets/*.json | ||||
| public/css/*.css | ||||
| public/js/*.js | ||||
| public/favicon.ico | ||||
| build/*.png | ||||
| db.sqlite | ||||
| 
 | ||||
|  | ||||
| @ -1,5 +1,19 @@ | ||||
| const DB=require('better-sqlite3'); | ||||
| 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'); | ||||
| 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); | ||||
|  | ||||
| After Width: | Height: | Size: 7.8 KiB | 
| @ -0,0 +1 @@ | ||||
| ../../assets/config.json | ||||
| After Width: | Height: | Size: 21 KiB | 
| After Width: | Height: | Size: 150 KiB | 
| After Width: | Height: | Size: 3.9 KiB | 
| After Width: | Height: | Size: 94 KiB | 
| After Width: | Height: | Size: 15 KiB | 
| After Width: | Height: | Size: 7.9 KiB | 
| @ -0,0 +1 @@ | ||||
| ../../assets/levelList.json | ||||
| @ -0,0 +1 @@ | ||||
| ../../assets/metaConfig.json | ||||
| After Width: | Height: | Size: 6.0 KiB | 
| After Width: | Height: | Size: 63 KiB | 
| After Width: | Height: | Size: 54 KiB | 
| After Width: | Height: | Size: 38 KiB | 
| After Width: | Height: | Size: 38 KiB | 
| After Width: | Height: | Size: 38 KiB | 
| After Width: | Height: | Size: 38 KiB | 
| @ -0,0 +1 @@ | ||||
| ../../assets/snake.json | ||||
| After Width: | Height: | Size: 1.7 KiB | 
| After Width: | Height: | Size: 2.1 KiB | 
| After Width: | Height: | Size: 2.9 KiB | 
| After Width: | Height: | Size: 4.2 KiB |