Switched to yarn (instead of npm+bower)
This commit is contained in:
parent
f0228f9846
commit
2d0b9c7ab6
|
@ -1,6 +1,7 @@
|
||||||
language: node_js
|
language: node_js
|
||||||
sudo: false
|
sudo: false
|
||||||
|
cache: yarn
|
||||||
node_js:
|
node_js:
|
||||||
- "6"
|
- "6"
|
||||||
after_success:
|
after_success:
|
||||||
- npm run codecov
|
- yarn run codecov
|
||||||
|
|
2
.vscode/tasks.json
vendored
2
.vscode/tasks.json
vendored
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"command": "./npm",
|
"command": "./spacetac",
|
||||||
"isShellCommand": true,
|
"isShellCommand": true,
|
||||||
"args": [
|
"args": [
|
||||||
"run",
|
"run",
|
||||||
|
|
10
README.md
10
README.md
|
@ -11,15 +11,17 @@
|
||||||
|
|
||||||
## How to develop
|
## 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:
|
If you want to build on your computer, clone the repository, then run:
|
||||||
|
|
||||||
npm install # Install dependencies
|
./spacetac install # Install dependencies
|
||||||
npm test # Run unit tests
|
./spacetac test # Run unit tests
|
||||||
rpm start # Start development server, and open game in web browser
|
./spacetac start # Start development server, and open game in web browser
|
||||||
|
|
||||||
After making changes to sources, you need to recompile:
|
After making changes to sources, you need to recompile:
|
||||||
|
|
||||||
npm run build
|
./spacetac run build
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
|
|
17
bower.json
17
bower.json
|
@ -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"
|
|
||||||
}
|
|
||||||
}
|
|
20
out/ai.html
20
out/ai.html
|
@ -9,17 +9,17 @@
|
||||||
* {
|
* {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
background-color: #111;
|
background-color: #111;
|
||||||
color: #eee;
|
color: #eee;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
margin-bottom: 38px;
|
margin-bottom: 38px;
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#duel {
|
#duel {
|
||||||
width: 50vw;
|
width: 50vw;
|
||||||
margin-top: 30vh;
|
margin-top: 30vh;
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
button,
|
button,
|
||||||
select {
|
select {
|
||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
|
@ -36,22 +36,22 @@
|
||||||
background-color: #ddd;
|
background-color: #ddd;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
td {
|
td {
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
width: 16vw;
|
width: 16vw;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
}
|
}
|
||||||
|
|
||||||
td:nth-child(1) {
|
td:nth-child(1) {
|
||||||
background-color: #611;
|
background-color: #611;
|
||||||
}
|
}
|
||||||
|
|
||||||
td:nth-child(3) {
|
td:nth-child(3) {
|
||||||
background-color: #148;
|
background-color: #148;
|
||||||
}
|
}
|
||||||
|
|
||||||
td[colspan] {
|
td[colspan] {
|
||||||
background-color: inherit;
|
background-color: inherit;
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<script src="vendor/phaser/build/phaser.min.js"></script>
|
<script src="vendor/phaser/phaser.min.js"></script>
|
||||||
<script src="build.js"></script>
|
<script src="build.js"></script>
|
||||||
|
|
||||||
<div id="duel">
|
<div id="duel">
|
||||||
|
@ -94,4 +94,4 @@
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
|
@ -27,8 +27,8 @@
|
||||||
<div id="-space-tac" class="game"></div>
|
<div id="-space-tac" class="game"></div>
|
||||||
|
|
||||||
<script src="vendor/parse/parse.min.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="vendor/phaser-plugin-scene-graph/dist/SceneGraph.js"></script>
|
<script src="vendor/phaser-plugin-scene-graph/SceneGraph.js"></script>
|
||||||
<script src="build.js"></script>
|
<script src="build.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<script src="vendor/phaser/build/phaser.min.js"></script>
|
<script src="vendor/phaser/phaser.min.js"></script>
|
||||||
<script src="build.js"></script>
|
<script src="build.js"></script>
|
||||||
|
|
||||||
<div id="loot">
|
<div id="loot">
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>SpaceTac - Unit tests</title>
|
<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>
|
<style>
|
||||||
canvas {
|
canvas {
|
||||||
display: none;
|
display: none;
|
||||||
|
@ -18,11 +18,11 @@
|
||||||
<div id="-space-tac" class="game"></div>
|
<div id="-space-tac" class="game"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="vendor/jasmine-core/lib/jasmine-core/jasmine.js"></script>
|
<script src="vendor/jasmine/jasmine.js"></script>
|
||||||
<script src="vendor/jasmine-core/lib/jasmine-core/jasmine-html.js"></script>
|
<script src="vendor/jasmine/jasmine-html.js"></script>
|
||||||
<script src="vendor/jasmine-core/lib/jasmine-core/boot.js"></script>
|
<script src="vendor/jasmine/boot.js"></script>
|
||||||
<script src="vendor/parse/parse.min.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>
|
<script src="build.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
19
package.json
19
package.json
|
@ -5,7 +5,7 @@
|
||||||
"main": "src/build.js",
|
"main": "src/build.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"shell": "${SHELL} || true",
|
"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 .",
|
"build": "tsc -p .",
|
||||||
"pretest": "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",
|
"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",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-polyfill": "^6.23.0",
|
"babel-polyfill": "^6.23.0",
|
||||||
"bower": "~1.8",
|
"codecov": "^2.2.0",
|
||||||
"codecov": "~2.1",
|
"jasmine": "^2.6.0",
|
||||||
"jasmine": "~2.5",
|
"karma": "^1.7.0",
|
||||||
"karma": "~1.5",
|
|
||||||
"karma-coverage": "~1.1",
|
"karma-coverage": "~1.1",
|
||||||
"karma-jasmine": "~1.1",
|
"karma-jasmine": "~1.1",
|
||||||
"karma-spec-reporter": "~0.0",
|
|
||||||
"karma-phantomjs-launcher": "~1.0",
|
"karma-phantomjs-launcher": "~1.0",
|
||||||
|
"karma-spec-reporter": "~0.0",
|
||||||
"live-server": "~1.2",
|
"live-server": "~1.2",
|
||||||
"remap-istanbul": "~0.9",
|
"remap-istanbul": "~0.9",
|
||||||
"typescript": "~2.3",
|
"typescript": "~2.3",
|
||||||
"typings": "~2.1"
|
"typings": "~2.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"jasmine-core": "^2.6.3",
|
||||||
|
"parse": "^1.9.2",
|
||||||
|
"phaser": "^2.6.2",
|
||||||
|
"phaser-plugin-scene-graph": "^1.0.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#!/bin/bash
|
#!/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
|
# REQUIRES python3, else falls back to system-wide npm
|
||||||
|
|
||||||
set -e
|
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 -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"
|
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 "$@"
|
|
@ -25,7 +25,7 @@ module.exports = function (config) {
|
||||||
|
|
||||||
files: [
|
files: [
|
||||||
'node_modules/babel-polyfill/dist/polyfill.js',
|
'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/vendor/parse/parse.min.js',
|
||||||
'out/build.js'
|
'out/build.js'
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue