Switch back to npm
This commit is contained in:
parent
b4fff901cd
commit
ca52167809
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,4 +1,4 @@
|
||||||
.env
|
.venv
|
||||||
coverage
|
coverage
|
||||||
/node_modules
|
/node_modules
|
||||||
/out/vendor
|
/out/vendor
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
language: node_js
|
language: node_js
|
||||||
sudo: false
|
sudo: false
|
||||||
cache: yarn
|
|
||||||
node_js:
|
node_js:
|
||||||
- "6"
|
- "node"
|
||||||
after_success:
|
after_success:
|
||||||
- yarn run codecov
|
- npm run codecov
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- "node_modules"
|
||||||
|
|
18
README.md
18
README.md
|
@ -16,17 +16,21 @@
|
||||||
|
|
||||||
## How to develop
|
## How to develop
|
||||||
|
|
||||||
The only hard dependency of the toolchain is [yarn](https://yarnpkg.com).
|
The only hard dependency of the toolchain is Node.js (with npm).
|
||||||
|
|
||||||
If yarn is not installed on your system but Python3 is, yarn will be automatically installed in a local virtual environment.
|
If Node.js is not installed on your system but Python3 is, you can use the following commands to (de)activate a virtual
|
||||||
|
and local Node.js environment:
|
||||||
|
|
||||||
|
source activate_node # From now on, "npm" command will be the one from virtual environment
|
||||||
|
deactivate_node # This restores the environment as before the "source" command
|
||||||
|
|
||||||
If you want to build on your computer, clone the repository, then run:
|
If you want to build on your computer, clone the repository, then run:
|
||||||
|
|
||||||
./spacetac install # Install dependencies
|
npm install # Install dependencies
|
||||||
./spacetac run build # Build the final JS
|
npm run build # Build the final JS
|
||||||
./spacetac run atlas # Pack the images and sounds
|
npm run atlas # Pack the images and sounds
|
||||||
./spacetac test # Run unit tests
|
npm test # Run unit tests
|
||||||
./spacetac start # Start development server, and open game in web browser
|
npm start # Start development server, and open game in web browser
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
|
|
14
activate_node
Normal file
14
activate_node
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# Activation script for virtual nodejs environment
|
||||||
|
# Usage:
|
||||||
|
# source activate_node
|
||||||
|
|
||||||
|
if [ \! -f "./activate_node" ]
|
||||||
|
then
|
||||||
|
echo "Not in project directory"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
vdir="./.venv"
|
||||||
|
test -x "${vdir}/bin/nodeenv" || ( virtualenv -p python3 "${vdir}" && "${vdir}/bin/pip" install --upgrade nodeenv )
|
||||||
|
test -e "${vdir}/node/bin/activate" || "${vdir}/bin/nodeenv" --node=9.3.0 --force "${vdir}/node"
|
||||||
|
source "${vdir}/node/bin/activate"
|
5585
package-lock.json
generated
Normal file
5585
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -4,7 +4,6 @@
|
||||||
"description": "A tactical RPG set in space",
|
"description": "A tactical RPG set in space",
|
||||||
"main": "src/build.js",
|
"main": "src/build.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"shell": "${SHELL} || true",
|
|
||||||
"postinstall": "rm -rf out/vendor && mkdir -p out/vendor && cp -r node_modules/phaser/build out/vendor/phaser && cp -r node_modules/parse/dist out/vendor/parse && cp -r node_modules/jasmine-core/lib/jasmine-core out/vendor/jasmine",
|
"postinstall": "rm -rf out/vendor && mkdir -p out/vendor && cp -r node_modules/phaser/build out/vendor/phaser && cp -r node_modules/parse/dist out/vendor/parse && cp -r node_modules/jasmine-core/lib/jasmine-core out/vendor/jasmine",
|
||||||
"build": "tsc -p .",
|
"build": "tsc -p .",
|
||||||
"atlas": "rm -f out/assets/atlas* && find graphics/exported -name '*.png' -print0 | xargs -0 gf-pack --name out/assets/atlas --fullpath --width 1024 --height 1024 --square --powerOfTwo --trim --padding 2",
|
"atlas": "rm -f out/assets/atlas* && find graphics/exported -name '*.png' -print0 | xargs -0 gf-pack --name out/assets/atlas --fullpath --width 1024 --height 1024 --square --powerOfTwo --trim --padding 2",
|
||||||
|
|
19
spacetac
19
spacetac
|
@ -1,19 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
# Main build/run tool
|
|
||||||
# REQUIRES yarn
|
|
||||||
# If yarn is not found, python3 may be used to create a local node.js environment with yarn in it, and use it
|
|
||||||
|
|
||||||
yarn=$(which yarn 2>/dev/null)
|
|
||||||
set -e
|
|
||||||
|
|
||||||
if [ "x${yarn}" != "x" ]
|
|
||||||
then
|
|
||||||
"${yarn}" "$@"
|
|
||||||
else
|
|
||||||
dir=$(dirname $0)
|
|
||||||
|
|
||||||
test -x "${dir}/.env/bin/nodeenv" || ( virtualenv -p python3 "${dir}/.env" && "${dir}/.env/bin/pip" install --upgrade nodeenv )
|
|
||||||
test -e "${dir}/.env/node/bin/activate" || "${dir}/.env/bin/nodeenv" --node=9.3.0 --force "${dir}/.env/node"
|
|
||||||
test -e "${dir}/.env/node/bin/yarn" || "${dir}/.env/node/bin/shim" "${dir}/.env/node/bin/npm" install -g yarn@1.3.2
|
|
||||||
PATH="${dir}/.env/node/bin:${PATH}" yarn "$@"
|
|
||||||
fi
|
|
Loading…
Reference in a new issue