1
0
Fork 0

Switched to yarn (instead of npm+bower)

This commit is contained in:
Michaël Lemaire 2017-06-13 19:53:40 +02:00
parent f0228f9846
commit 2d0b9c7ab6
13 changed files with 3370 additions and 55 deletions

View File

@ -1,3 +0,0 @@
{
"directory": "out/vendor/"
}

View File

@ -1,6 +1,7 @@
language: node_js
sudo: false
cache: yarn
node_js:
- "6"
after_success:
- npm run codecov
- yarn run codecov

2
.vscode/tasks.json vendored
View File

@ -1,6 +1,6 @@
{
"version": "0.1.0",
"command": "./npm",
"command": "./spacetac",
"isShellCommand": true,
"args": [
"run",

View File

@ -11,15 +11,17 @@
## How to develop
The only hard dependency of the toolchain is Python3.
If you want to build on your computer, clone the repository, then run:
npm install # Install dependencies
npm test # Run unit tests
rpm start # Start development server, and open game in web browser
./spacetac install # Install dependencies
./spacetac test # Run unit tests
./spacetac start # Start development server, and open game in web browser
After making changes to sources, you need to recompile:
npm run build
./spacetac run build
## Credits

View File

@ -1,17 +0,0 @@
{
"name": "spacetac",
"description": "A tactical RPG set in space",
"main": "out/build.js",
"authors": [
"Michael Lemaire"
],
"license": "MIT",
"homepage": "https://thunderk.net/spacetac/",
"private": true,
"dependencies": {
"phaser": "2.6.2",
"parse": "1.9.2",
"jasmine-core": "jasmine#^2.5.2",
"phaser-plugin-scene-graph": "samme/phaser-plugin-scene-graph#1.0.4"
}
}

View File

@ -9,17 +9,17 @@
* {
margin: 0;
}
body {
background-color: #111;
color: #eee;
}
h1 {
margin-bottom: 38px;
font-size: 30px;
}
#duel {
width: 50vw;
margin-top: 30vh;
@ -27,7 +27,7 @@
margin-right: auto;
text-align: center;
}
button,
select {
font-size: 26px;
@ -36,22 +36,22 @@
background-color: #ddd;
cursor: pointer;
}
td {
padding: 12px;
width: 16vw;
text-align: center;
font-size: 26px;
}
td:nth-child(1) {
background-color: #611;
}
td:nth-child(3) {
background-color: #148;
}
td[colspan] {
background-color: inherit;
}
@ -59,7 +59,7 @@
</head>
<body>
<script src="vendor/phaser/build/phaser.min.js"></script>
<script src="vendor/phaser/phaser.min.js"></script>
<script src="build.js"></script>
<div id="duel">
@ -94,4 +94,4 @@
</script>
</body>
</html>
</html>

View File

@ -27,8 +27,8 @@
<div id="-space-tac" class="game"></div>
<script src="vendor/parse/parse.min.js"></script>
<script src="vendor/phaser/build/phaser.min.js"></script>
<script src="vendor/phaser-plugin-scene-graph/dist/SceneGraph.js"></script>
<script src="vendor/phaser/phaser.min.js"></script>
<script src="vendor/phaser-plugin-scene-graph/SceneGraph.js"></script>
<script src="build.js"></script>
<script>

View File

@ -50,7 +50,7 @@
</head>
<body>
<script src="vendor/phaser/build/phaser.min.js"></script>
<script src="vendor/phaser/phaser.min.js"></script>
<script src="build.js"></script>
<div id="loot">

View File

@ -5,7 +5,7 @@
<meta charset="utf-8" />
<title>SpaceTac - Unit tests</title>
<link rel="stylesheet" href="vendor/jasmine-core/lib/jasmine-core/jasmine.css">
<link rel="stylesheet" href="vendor/jasmine/jasmine.css">
<style>
canvas {
display: none;
@ -18,11 +18,11 @@
<div id="-space-tac" class="game"></div>
</div>
<script src="vendor/jasmine-core/lib/jasmine-core/jasmine.js"></script>
<script src="vendor/jasmine-core/lib/jasmine-core/jasmine-html.js"></script>
<script src="vendor/jasmine-core/lib/jasmine-core/boot.js"></script>
<script src="vendor/jasmine/jasmine.js"></script>
<script src="vendor/jasmine/jasmine-html.js"></script>
<script src="vendor/jasmine/boot.js"></script>
<script src="vendor/parse/parse.min.js"></script>
<script src="vendor/phaser/build/phaser.min.js"></script>
<script src="vendor/phaser/phaser.min.js"></script>
<script src="build.js"></script>
</body>

View File

@ -5,7 +5,7 @@
"main": "src/build.js",
"scripts": {
"shell": "${SHELL} || true",
"postinstall": "bower install && typings install",
"postinstall": "typings install && rm -rf out/vendor && mkdir -p out/vendor && cp -r node_modules/phaser/build out/vendor/phaser && cp -r node_modules/phaser-plugin-scene-graph/dist out/vendor/phaser-plugin-scene-graph && cp -r node_modules/parse/dist out/vendor/parse && cp -r node_modules/jasmine-core/lib/jasmine-core out/vendor/jasmine",
"build": "tsc -p .",
"pretest": "tsc -p .",
"test": "karma start spec/support/karma.conf.js && remap-istanbul -i out/coverage/coverage.json -o out/coverage -t html",
@ -21,17 +21,22 @@
"license": "MIT",
"devDependencies": {
"babel-polyfill": "^6.23.0",
"bower": "~1.8",
"codecov": "~2.1",
"jasmine": "~2.5",
"karma": "~1.5",
"codecov": "^2.2.0",
"jasmine": "^2.6.0",
"karma": "^1.7.0",
"karma-coverage": "~1.1",
"karma-jasmine": "~1.1",
"karma-spec-reporter": "~0.0",
"karma-phantomjs-launcher": "~1.0",
"karma-spec-reporter": "~0.0",
"live-server": "~1.2",
"remap-istanbul": "~0.9",
"typescript": "~2.3",
"typings": "~2.1"
},
"dependencies": {
"jasmine-core": "^2.6.3",
"parse": "^1.9.2",
"phaser": "^2.6.2",
"phaser-plugin-scene-graph": "^1.0.4"
}
}
}

View File

@ -1,5 +1,6 @@
#!/bin/bash
# Use as alternative to npm to run in local node.js environment
# Main build/run tool for SpaceTac
# Uses yarn installed in local node.js environment
# REQUIRES python3, else falls back to system-wide npm
set -e
@ -10,5 +11,5 @@ dir=$(dirname $0)
test -x "${dir}/.env/bin/nodeenv" || ( virtualenv -p python3 "${dir}/.env" && "${dir}/.env/bin/pip" install --upgrade nodeenv )
test -f "${dir}/.env/node/bin/activate" || "${dir}/.env/bin/nodeenv" --node=6.9.5 --force "${dir}/.env/node"
PATH="${dir}/.env/node/bin:${PATH}" npm "$@"
test -f "${dir}/.env/node/bin/yarn" || "${dir}/.env/node/bin/npm" install -g yarn@0.24.6
PATH="${dir}/.env/node/bin:${PATH}" yarn "$@"

View File

@ -25,7 +25,7 @@ module.exports = function (config) {
files: [
'node_modules/babel-polyfill/dist/polyfill.js',
'out/vendor/phaser/build/phaser.js',
'out/vendor/phaser/phaser.js',
'out/vendor/parse/parse.min.js',
'out/build.js'
]

3326
yarn.lock Normal file

File diff suppressed because it is too large Load Diff