Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core1.0.0 #59

Open
wants to merge 44 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
a14c5e0
[fix] change reference path
moajo Oct 12, 2017
fa8f7ac
[fix] add lint
moajo Oct 12, 2017
6b22123
Adopt common-configuration environment
kyasbal Dec 16, 2017
17bd665
Merge remote-tracking branch 'origin/core1.0'
kyasbal Dec 16, 2017
d8ec349
Adopt core1.0 beta
kyasbal Dec 16, 2017
b638c79
fix node version
kyasbal Dec 16, 2017
164360b
Revert removing release.sh
kyasbal Dec 16, 2017
c1c9872
Adopt core1.0
kyasbal Dec 16, 2017
fb376d6
chore: remove metaInfo.ts
moajo Jan 4, 2018
ae5cc6e
fix: refactor and change converter declarations
moajo Jan 20, 2018
206421b
fix: convert tests to TypeScript
moajo Jan 21, 2018
ed480dd
fix: AABB constructor bug
kyasbal Jan 25, 2018
29b5ca5
chore(package): update ava to version 0.25.0
greenkeeper[bot] Jan 26, 2018
78e7e3d
chore(package): update semantic-release to version 12.4.1
greenkeeper[bot] Jan 28, 2018
ad74f44
chore(package): update typedoc to version 0.10.0
greenkeeper[bot] Feb 1, 2018
626542d
Merge remote-tracking branch 'origin/greenkeeper/typedoc-0.10.0' into…
moajo Feb 18, 2018
f7b7f7d
Merge remote-tracking branch 'origin/greenkeeper/semantic-release-12.…
moajo Feb 18, 2018
80472fb
Merge remote-tracking branch 'origin/greenkeeper/ava-0.25.0' into cor…
moajo Feb 18, 2018
f6c3ed7
update dependencies
moajo Feb 18, 2018
aada501
fix: webpack.config
moajo Feb 18, 2018
4a8d627
adopt typescript2.7
moajo Feb 18, 2018
31c111c
publish beta
moajo Feb 18, 2018
252570a
publish beta
kyasbal Feb 18, 2018
c26a743
Merge branch 'core1.0.0' of github.com:GrimoireGL/grimoirejs-math int…
kyasbal Feb 18, 2018
0ccf475
publish beta
moajo Feb 18, 2018
724dfe5
[CI] CircleCI 2.0 migration
m2wasabi Mar 1, 2018
0f82270
[CI] CircleCI 2.0 migration (install awscli on test)
m2wasabi Mar 1, 2018
1e4bbd9
[CI] CircleCI 2.0 migration (checkout submodules)
m2wasabi Mar 1, 2018
16a6cbc
[CI] CircleCI 2.0 migration (upload articacts in directory)
m2wasabi Mar 1, 2018
7416042
[CI] CircleCI 2.0 migration (npm and docs parallel release)
m2wasabi Mar 1, 2018
3decc5e
[CI] CircleCI 2.0 migration (parallel release and artifacts test : dr…
m2wasabi Mar 2, 2018
93a6c7c
[CI] CircleCI 2.0 migration (fix: create directory recursive)
m2wasabi Mar 2, 2018
03b6a0b
[CI] CircleCI 2.0 migration (fix: directory depth)
m2wasabi Mar 2, 2018
a27303c
[CI] CircleCI 2.0 migration (unlock upload docs)
m2wasabi Mar 2, 2018
7023bc5
[CI] CircleCI 2.0 Yarn skip npm-scripts
m2wasabi Mar 7, 2018
1c8f75b
Merge remote-tracking branch 'origin/feature/circleci2.0_migrate' int…
kyasbal Mar 13, 2018
f254d96
update common
kyasbal Mar 13, 2018
3ed90f2
Updated cauldron dependency
kyasbal Mar 13, 2018
8cb59e8
include metaInfo.ts inside of circleci cache
kyasbal Mar 13, 2018
d8fc66c
rewrite dependent grimore version
kyasbal Mar 13, 2018
eee96da
updated grimoirejs dependency
kyasbal Mar 13, 2018
b884754
WIP try to list packages
kyasbal Mar 13, 2018
b0bc8df
rewrite dependency
kyasbal Mar 13, 2018
7b011ab
replace grimoire version
kyasbal Mar 14, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 142 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
version: 2
jobs:
build:
docker:
- image: circleci/node:9.6
environment:
TZ: /usr/share/zoneinfo/UTC
steps:
- checkout
- run: git submodule sync
- run: git submodule update --init
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run: sudo apt update && sudo apt install python-pip python-dev
- run: pip install awscli --upgrade --user
- run: echo 'export PATH=/home/circleci/.local/bin:$PATH' >> $BASH_ENV
- run: yarn --version
- run: yarn install --ignore-scripts --no-progress
- run: npm run build
- save-cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- ~/.local
- ~/.npm/_cacache
- ~/.cache/yarn
- node_modules/
- run: yarn list
- save-cache:
key: artifact-cache-{{ .Environment.CIRCLE_SHA1 }}
paths:
- lib/
- lib-es5/
- ref/
- register/
- test-es5/
- yarn.lock
- src/index.ts
- src/metaInfo.ts
test:
docker:
- image: circleci/node:9.6
environment:
TZ: /usr/share/zoneinfo/UTC
steps:
- checkout
- run: git submodule sync
- run: git submodule update --init
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- restore_cache:
key: artifact-cache-{{ .Environment.CIRCLE_SHA1 }}
- run: sudo apt update && sudo apt install python-pip python-dev
- run: pip install awscli --upgrade --user
- run: echo 'export PATH=/home/circleci/.local/bin:$PATH' >> $BASH_ENV
- run: npm test
common_e2e:
docker:
- image: circleci/node:9.6
environment:
TZ: /usr/share/zoneinfo/UTC
steps:
- checkout
- run: git submodule sync
- run: git submodule update --init
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- restore_cache:
key: artifact-cache-{{ .Environment.CIRCLE_SHA1 }}
- run: sudo apt update && sudo apt install python-pip python-dev
- run: pip install awscli --upgrade --user
- run: echo 'export PATH=/home/circleci/.local/bin:$PATH' >> $BASH_ENV
- run: sh ./common/e2e.sh
- run: mkdir -p /tmp/artifacts && mv register /tmp/artifacts/
- store_artifacts:
path: /tmp/artifacts/register
npm_release:
docker:
- image: circleci/node:9.6
environment:
TZ: /usr/share/zoneinfo/UTC
steps:
- checkout
- run: git submodule sync
- run: git submodule update --init
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- restore_cache:
key: artifact-cache-{{ .Environment.CIRCLE_SHA1 }}
- run: sudo apt update && sudo apt install python-pip python-dev
- run: pip install awscli --upgrade --user
- run: echo 'export PATH=/home/circleci/.local/bin:$PATH' >> $BASH_ENV
- run: sh release.sh
deploy_docs:
docker:
- image: circleci/node:9.6
environment:
TZ: /usr/share/zoneinfo/UTC
steps:
- checkout
- run: git submodule sync
- run: git submodule update --init
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- restore_cache:
key: artifact-cache-{{ .Environment.CIRCLE_SHA1 }}
- run: sudo apt update && sudo apt install python-pip python-dev
- run: pip install awscli --upgrade --user
- run: echo 'export PATH=/home/circleci/.local/bin:$PATH' >> $BASH_ENV
- run: npm run doc
- run: mkdir -p /tmp/artifacts && mv docs /tmp/artifacts/
- store_artifacts:
path: /tmp/artifacts/docs
- run:
name: document deploy
command: aws s3 cp /tmp/artifacts/docs/ s3://api.grimoire.gl/$CIRCLE_PROJECT_REPONAME --recursive --acl public-read

workflows:
version: 2
workflow:
jobs:
- build
- test:
requires:
- build
- common_e2e:
requires:
- build
- test
- npm_release:
requires:
- build
- test
filters:
branches:
only: master
- deploy_docs:
requires:
- build
- test
filters:
branches:
only: master
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,7 @@ ref
register
yarn.lock
src/index.ts
src/metaInfo.ts
docs
package-lock.json
test-lib
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "common"]
path = common
url = https://github.com/GrimoireGL/common-configurations.git
29 changes: 0 additions & 29 deletions circle.yml

This file was deleted.

1 change: 1 addition & 0 deletions common
Submodule common added at 4dce05
24 changes: 0 additions & 24 deletions doc-timestamp.js

This file was deleted.

67 changes: 47 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "grimoirejs-math",
"version": "1.14.0-beta1",
"version": "2.1.0-beta7",
"description": "The basement library for math of grimoire.js",
"main": "./ref/index.js",
"typings": "./ref/index.d.ts",
Expand All @@ -14,45 +14,72 @@
"grimoire"
],
"dependencies": {
"gl-matrix": "https://github.com/GrimoireGL/gl-matrix.git"
"@types/gl-matrix": "^2.4.0",
"gl-matrix": "git+https://github.com/GrimoireGL/gl-matrix.git",
"grimoirejs": "1.0.9-beta41"
},
"devDependencies": {
"ava": "^0.22.0",
"ava": "^0.25.0",
"babel-cli": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-env": "^1.6.1",
"babel-preset-stage-2": "^6.24.1",
"condition-circle": "^1.5.0",
"grimoirejs": "^0.19.5",
"grimoirejs-cauldron": "^3.1.6",
"semantic-release": "^7.0.2",
"ts-loader": "^2.3.3",
"typedoc": "^0.8.0",
"typescript": "^2.4.2",
"webpack": "^3.5.5",
"babel-register": "^6.26.0",
"condition-circle": "^2.0.1",
"grimoirejs-cauldron": "^4.2.0-beta3",
"semantic-release": "^12.4.1",
"ts-loader": "^3.5.0",
"tslint": "^5.9.1",
"typedoc": "^0.10.0",
"typescript": "^2.7.2",
"webpack": "^3.11.0",
"webpack-shell-plugin": "^0.5.0"
},
"peerDependencies": {
"grimoirejs": "^0.16.0"
},
"repository": {
"type": "git",
"url": "https://github.com/GrimoireGL/grimoirejs-math.git"
},
"scripts": {
"test": "tsc --outDir ./lib && babel ./lib --presets es2015 --plugins transform-runtime --out-dir ./lib-es5 && babel ./test --presets es2015 --plugins transform-runtime --out-dir ./test-es5 && ava ./test-es5/**/*Test.js --verbose ",
"prepublish": "npm run build -- --env.prod&& npm test",
"test": "tsc -p tsconfig.test.json && ava --verbose --serial",
"prepare": "npm run build -- --env.prod&& npm test",
"start": "webpack --progress --watch",
"lint": "tslint -c tslint.json ./src/**/*.ts --project ./ --type-check --exclude ./src/index.ts",
"lint:fix": "tslint -c tslint.json ./src/**/*.ts --project ./ --type-check --exclude ./src/index.ts --fix",
"build": "webpack --progress",
"generate-expose": "cauldron generate-exposure --src ./src --dest ./src/index.ts --ts --main ./src/main.ts --dts ./ref",
"generate-reference": "cauldron generate-reference --src ./src --dest ./src/index.ts --ts --main ./src/main.ts --dts ./ref",
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
"doc": "node ./doc-timestamp.js && typedoc --out ./docs/ --options typedoc.json ./tsconfig.json"
"doc": "node ./common/doc-timestamp.js && typedoc --out ./docs/ --options ./common/typedoc.json ./tsconfig.json"
},
"license": "MIT",
"release": {
"verifyConditions": "condition-circle"
},
"api-reference":"https://api.grimoire.gl/grimoirejs-math"
}
"api-reference": "https://api.grimoire.gl/grimoirejs-math",
"ava": {
"failWithoutAssertions": false,
"files": [
"./test-lib/**/*Test.js"
],
"require": [
"babel-register"
],
"babel": "inherit"
},
"babel": {
"presets": [
"env",
"stage-2"
]
},
"e2e": {
"dependencies": {
"grimoirejs": "beta",
"fundamental": "beta",
"forward-shading": "beta",
"animation": "beta",
"gltf": "beta"
}
}
}
2 changes: 1 addition & 1 deletion release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ if [ $? = "0" ]; then
echo PRESET_UPDATE
curl "https://preset-updater.herokuapp.com/?repo=preset-basic&repoURL=https://github.com/GrimoireGL/grimoirejs-preset-basic.git&buildNumber=$CIRCLE_BUILD_NUM&currentPkg=grimoirejs-math"
fi
exit 0
exit 0
21 changes: 10 additions & 11 deletions src/AABB.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
///<reference path="./gl-matrix.d.ts"/>


import Vector3 from "./Vector3";
import { Nullable } from "grimoirejs/ref/Tool/Types";
/**
* Axis-Aligned Bounding Box implementation
*/
class AABB {
export default class AABB {

constructor(initialPoints?: Vector3[]) {
if (initialPoints) {
initialPoints.forEach(f => this.expand(f));
initialPoints.forEach((p) => this.expand(p));
}
}
/**
* AABB's vertex in most left,most bottom,most far.
* @type {Vector3}
*/
public pointLBF: Vector3;
public pointLBF!: Vector3;

/**
* AABB's vertex in most right,most top,most near.
* @type {Vector3}
*/
public pointRTN: Vector3;
public pointRTN!: Vector3;

/**
* Center of this AABB
* @type {Vector3}
*/
private _center: Vector3;
private _center!: Nullable<Vector3>;

/**
* Width of this AABB
Expand Down Expand Up @@ -76,10 +77,8 @@ class AABB {
* Clean up this AABB with initial value.
*/
public clear(): void {
this.pointLBF = null;
this.pointRTN = null;
delete this.pointLBF;
delete this.pointRTN;
this._center = null;
}
}

export default AABB;
}
Loading