From 9b0439221105aef880435bb6107bd43846fe0028 Mon Sep 17 00:00:00 2001 From: Chris Willis-Ford Date: Fri, 13 Jan 2017 13:34:26 -0800 Subject: [PATCH] Move build outputs into a `dist/` subdirectory (#375) * Move Node output: /dist.js => /dist/node/scratch-vm.js * Move web output: /vm{.js,.min.js} => /dist/web/scratch-vm{.js,.min.js} * Update build output references in package.json and the playground's index.html * Move the VirtualMachine class out of index.js into its own file, referenced by index.js. The VirtualMachine class is otherwise unchanged. * Add .gitattributes rules for new file types which were added to this repository without specifying their text/binary attributes * Turn on source maps in webpack and add corresponding .gitignore rule --- .eslintignore | 7 +- .gitattributes | 5 + .gitignore | 13 +- package.json | 2 +- playground/index.html | 2 +- src/index.js | 338 +--------------------------------------- src/virtual-machine.js | 339 +++++++++++++++++++++++++++++++++++++++++ webpack.config.js | 23 +-- 8 files changed, 371 insertions(+), 358 deletions(-) create mode 100644 src/virtual-machine.js diff --git a/.eslintignore b/.eslintignore index 564a29d1e..8af9aff65 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,7 +1,4 @@ -build/* -dist.js +coverage/* +dist/* node_modules/* playground/* -vm.js -vm.min.js -coverage/* diff --git a/.gitattributes b/.gitattributes index 103710fec..b7671ba47 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,8 +5,10 @@ # People who (for example) rsync between Windows and Linux need this. # File types which we know are binary +*.sb2 binary # Prefer LF for most file types +*.css text eol=lf *.frag text eol=lf *.htm text eol=lf *.html text eol=lf @@ -17,13 +19,16 @@ *.md text eol=lf *.vert text eol=lf *.xml text eol=lf +*.yml text eol=lf # Prefer LF for these files .editorconfig text eol=lf +.eslintignore text eol=lf .eslintrc text eol=lf .gitattributes text eol=lf .gitignore text eol=lf .gitmodules text eol=lf +.npmignore text eol=lf LICENSE text eol=lf Makefile text eol=lf README text eol=lf diff --git a/.gitignore b/.gitignore index aad54ff5e..fdf767042 100644 --- a/.gitignore +++ b/.gitignore @@ -8,11 +8,16 @@ npm-* # Testing /.nyc_output /coverage -/dist.js -/vm.js -/vm.min.js + +# IDEA +/.idea + +# Build +/dist /playground/assets /playground/media +/playground/scratch-vm.js +/playground/scratch-vm.js.map /playground/vendor.js -/playground/vm.js +/playground/vendor.js.map /playground/zenburn.css diff --git a/package.json b/package.json index 503d6dcf3..663e19e31 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "type": "git", "url": "git+ssh://git@github.com/LLK/scratch-vm.git" }, - "main": "./dist.js", + "main": "./dist/node/scratch-vm.js", "scripts": { "build": "./node_modules/.bin/webpack --progress --colors --bail", "coverage": "./node_modules/.bin/tap ./test/{unit,integration}/*.js --coverage --coverage-report=lcov", diff --git a/playground/index.html b/playground/index.html index 4c0a454bc..370f054dd 100644 --- a/playground/index.html +++ b/playground/index.html @@ -66,7 +66,7 @@ - +