mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
Merge pull request #276 from rschamp/Makefile--
Replace Makefile with npm scripts
This commit is contained in:
commit
4cb680c047
6 changed files with 51 additions and 43 deletions
6
.eslintignore
Normal file
6
.eslintignore
Normal file
|
@ -0,0 +1,6 @@
|
|||
build/*
|
||||
dist.js
|
||||
node_modules/*
|
||||
playground/*
|
||||
vm.js
|
||||
vm.min.js
|
32
.gitattributes
vendored
Normal file
32
.gitattributes
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
# Set the default behavior, in case people don't have core.autocrlf set.
|
||||
* text=auto
|
||||
|
||||
# Explicitly specify line endings for as many files as possible.
|
||||
# People who (for example) rsync between Windows and Linux need this.
|
||||
|
||||
# File types which we know are binary
|
||||
|
||||
# Prefer LF for most file types
|
||||
*.frag text eol=lf
|
||||
*.htm text eol=lf
|
||||
*.html text eol=lf
|
||||
*.iml text eol=lf
|
||||
*.js text eol=lf
|
||||
*.js.map text eol=lf
|
||||
*.json text eol=lf
|
||||
*.md text eol=lf
|
||||
*.vert text eol=lf
|
||||
*.xml text eol=lf
|
||||
|
||||
# Prefer LF for these files
|
||||
.editorconfig text eol=lf
|
||||
.eslintrc text eol=lf
|
||||
.gitattributes text eol=lf
|
||||
.gitignore text eol=lf
|
||||
.gitmodules text eol=lf
|
||||
LICENSE text eol=lf
|
||||
Makefile text eol=lf
|
||||
README text eol=lf
|
||||
TRADEMARK text eol=lf
|
||||
|
||||
# Use CRLF for Windows-specific file types
|
34
Makefile
34
Makefile
|
@ -1,34 +0,0 @@
|
|||
ESLINT=./node_modules/.bin/eslint
|
||||
NODE=node
|
||||
TAP=./node_modules/.bin/tap
|
||||
WEBPACK=./node_modules/.bin/webpack --progress --colors
|
||||
WEBPACK_DEV_SERVER=./node_modules/.bin/webpack-dev-server
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
build:
|
||||
$(WEBPACK)
|
||||
|
||||
watch:
|
||||
$(WEBPACK) --watch
|
||||
|
||||
serve:
|
||||
$(WEBPACK_DEV_SERVER)
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
lint:
|
||||
$(ESLINT) ./src/*.js
|
||||
$(ESLINT) ./src/**/*.js
|
||||
$(ESLINT) ./test/**/*.js
|
||||
|
||||
test:
|
||||
@make lint
|
||||
$(TAP) ./test/{unit,integration}/*.js
|
||||
|
||||
coverage:
|
||||
$(TAP) ./test/{unit,integration}/*.js --coverage --coverage-report=lcov
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
.PHONY: build lint test coverage benchmark serve
|
|
@ -43,7 +43,7 @@ To run the Playground, make sure the dev server's running and go to [http://loca
|
|||
|
||||
## Standalone Build
|
||||
```bash
|
||||
make build
|
||||
npm run build
|
||||
```
|
||||
|
||||
```html
|
||||
|
@ -104,11 +104,11 @@ The VM's block representation contains all the important information for executi
|
|||
|
||||
## Testing
|
||||
```bash
|
||||
make test
|
||||
npm test
|
||||
```
|
||||
|
||||
```bash
|
||||
make coverage
|
||||
npm run coverage
|
||||
```
|
||||
|
||||
## Donate
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
@echo off
|
||||
node_modules\.bin\webpack-dev-server --host 0.0.0.0 --content-base .\playground
|
14
package.json
14
package.json
|
@ -11,10 +11,16 @@
|
|||
},
|
||||
"main": "./dist.js",
|
||||
"scripts": {
|
||||
"prepublish": "./node_modules/.bin/webpack --bail",
|
||||
"start": "webpack-dev-server",
|
||||
"build": "webpack --colors --progress",
|
||||
"test": "make test",
|
||||
"build": "./node_modules/.bin/webpack --progress --colors --bail",
|
||||
"coverage": "./node_modules/.bin/tap ./test/{unit,integration}/*.js --coverage --coverage-report=lcov",
|
||||
"lint": "./node_modules/.bin/eslint .",
|
||||
"prepublish": "npm run build",
|
||||
"prepublish-watch": "npm run watch",
|
||||
"start": "./node_modules/.bin/webpack-dev-server",
|
||||
"tap-integration": "./node_modules/.bin/tap ./test/integration/*.js",
|
||||
"tap-unit": "./node_modules/.bin/tap ./test/unit/*.js",
|
||||
"test": "npm run lint && npm run tap-unit && npm run tap-integration",
|
||||
"watch": "./node_modules/.bin/webpack --progress --colors --watch",
|
||||
"version": "./node_modules/.bin/json -f package.json -I -e \"this.repository.sha = '$(git log -n1 --pretty=format:%H)'\""
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
Loading…
Reference in a new issue