Skip to content

Commit

Permalink
Merge pull request #40 from 3d-dice/v0.7.0
Browse files Browse the repository at this point in the history
v1.0.0
  • Loading branch information
frankieali authored May 27, 2022
2 parents 4882e33 + 707e2eb commit d1563b7
Show file tree
Hide file tree
Showing 46 changed files with 1,973 additions and 2,041 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ dist-ssr
newModelFiles
oldModelFiles
oldFiles
stash
stash
public-stash
notes.txt
stats.html
51 changes: 38 additions & 13 deletions copyAssets.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,46 @@
const copydir = require('copy-dir');
const path = require('path');
const fs = require('fs');
const readline = require('readline');
const { stdin: input, stdout: output } = require('process');

const { AbortController } = require('node-abort-controller'); //polyfill for Node <v14
const ac = new AbortController();
const signal = ac.signal;

const filesToCopy = './dist/assets'
let staticPath = '/public/assets'

// creat prompt asking for static folder
const rl = readline.createInterface({ input, output });

const writeFiles = (path) => {
// Creates directory if it doesn't exist
fs.mkdir(path, { recursive: true }, (err) => {
if (err) throw err;

// Moving files to user's local directory
copydir(filesToCopy, path, {
utimes: true, // keep add time and modify time
mode: true, // keep file mode
cover: true // cover file when exists, default is true
})
});
}

// User's local directory
const userPath = path.join(process.env.INIT_CWD,'/public/assets')

// Creates directory if it doesn't exist
fs.mkdir(userPath, { recursive: true }, (err) => {
if (err) throw err;

// Moving files to user's local directory
copydir(filesToCopy, userPath, {
utimes: true, // keep add time and modify time
mode: true, // keep file mode
cover: true // cover file when exists, default is true
})
rl.question('Path to your static assets folder (press "Enter" for /public/assets): ', (answer) => {
answer = answer || staticPath
console.log(`Copying assets to: ${answer}`);

writeFiles(path.join(process.env.INIT_CWD,answer))

rl.close();
});

signal.addEventListener('abort', () => {
console.log(`Question timeout. Using default: ${staticPath}`);
writeFiles(path.join(process.env.INIT_CWD,staticPath))
rl.close();
}, { once: true });

setTimeout(() => ac.abort(), 10000);
255 changes: 135 additions & 120 deletions package-lock.json

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "Frank Ali"
},
"description": "A 3D environment for rolling game dice",
"version": "0.6.1",
"version": "1.0.0",
"keywords": [
"3D",
"dice",
Expand Down Expand Up @@ -41,15 +41,16 @@
"postinstall": "node copyAssets.js"
},
"dependencies": {
"@babylonjs/core": "^5.0.0-rc.3",
"@babylonjs/loaders": "^5.0.0-rc.3",
"@babylonjs/materials": "^5.0.0-rc.3",
"copy-dir": "^1.3.0"
"@babylonjs/core": "^5.8.0",
"@babylonjs/loaders": "^5.8.0",
"@babylonjs/materials": "^5.8.0"
},
"devDependencies": {
"copy-dir": "^1.3.0",
"node-abort-controller": "^3.0.1",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-visualizer": "^5.6.0",
"vite": "^2.8.6"
"vite": "^2.9.9"
},
"browserslist": {
"production": [
Expand Down
731 changes: 731 additions & 0 deletions public/assets/dice-box/models/default.json

Large diffs are not rendered by default.

452 changes: 0 additions & 452 deletions public/assets/dice-box/models/dice-revised.babylon

This file was deleted.

452 changes: 0 additions & 452 deletions public/assets/dice-box/models/dice-revised.json

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/dice-box/themes/default/normal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed public/assets/dice-box/themes/galvanized/albedo.jpg
Binary file not shown.
Binary file not shown.
Binary file removed public/assets/dice-box/themes/galvanized/normal.jpg
Binary file not shown.
Binary file removed public/assets/dice-box/themes/purpleRock/albedo.jpg
Binary file not shown.
Binary file not shown.
Binary file removed public/assets/dice-box/themes/purpleRock/normal.jpg
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed public/assets/dice-box/themes/transparent/normal.jpg
Binary file not shown.
Loading

0 comments on commit d1563b7

Please sign in to comment.