Skip to content

Commit a806292

Browse files
committed
Merge branch 'clientBuild' into dev
2 parents eebfbca + 75e9e19 commit a806292

File tree

7 files changed

+87
-45
lines changed

7 files changed

+87
-45
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Logs
2+
local.txt
23
logs
34
*.log
45
npm-debug.log*

.travis.yml

Lines changed: 42 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,64 @@
1-
#node -pe "require('./package.json').version"
2-
#before_script:
3-
# in master branch increment the version
4-
#- npm version patch
5-
# on:
6-
# branch : master
7-
#- npm install -g documentation
8-
#- npm run doc
9-
1+
before_script:
2+
- |
3+
if [[ $TRAVIS_BRANCH == 'clientBuild' && $TRAVIS_COMMIT_MESSAGE == *"[run deploy]"* ]]; then
4+
echo "__INCREMENT_VERSION_NUMBER__"
5+
export PACKAGE_VERSION=$(npm version patch)
6+
npm install -g documentation
7+
npm run doc
8+
fi
109
1110
language: node_js
1211
sudo: required
1312
node_js:
1413
- "stable"
14+
1515
# travis call prepare
1616
# Send coverage data to Coveralls
17+
# Deploy terminusdb/terminus-client
1718
after_script:
1819
- npm run coveralls-after
1920

2021
branches:
2122
only:
22-
- dev
23-
- master
23+
- clientBuild
2424

25-
before_deploy:
26-
if ! [[ $TRAVIS_TAG ]]; then
27-
export TRAVIS_TAG="1.$TRAVIS_BUILD_NUMBER" &&
28-
npm install -g documentation &&
29-
npm version patch &&
30-
npm run doc
31-
# Set up git user name and tag this commit
32-
git config --local user.name "Francesca-Bit" &&
33-
git config --local user.email "[email protected]" &&
34-
git add package.json &&
35-
git commit -m "version changed travis_build_number $TRAVIS_TAG" &&
36-
git push origin master &&
37-
npm run git-tag;
38-
fi
25+
before_deploy:
26+
- |
27+
if [[ ! $TRAVIS_VAR ]]; then
28+
printf "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc
29+
npm run build
30+
echo "___TRAVIS_VAR____"
31+
export TRAVIS_VAR="1.$TRAVIS_BUILD_NUMBER"
32+
33+
git commit --amend -m "[skip travis] version changed $PACKAGE_VERSION"
34+
git push https://${GITHUB_TOKEN}@github.com/$TRAVIS_REPO_SLUG HEAD:$TRAVIS_BRANCH
35+
git tag -f -a "$PACKAGE_VERSION" -m "new version $PACKAGE_VERSION"
36+
export LAST_HASH=$(git ls-remote https://github.com/$TRAVIS_REPO_SLUG $TRAVIS_BRANCH | awk '{ print $1}')
37+
echo $LAST_HASH
38+
fi
39+
#https://blog.travis-ci.com/2018-04-11-how_to_publish_node_js_packages_with_travis_ci_and_packagecloud/
3940
deploy:
40-
- provider: releases
41-
api_key: $GITHUB_TOKEN
42-
file: public_pages/dist/*
43-
skip_cleanup: true
44-
on:
45-
branch: master
46-
-provider: pages
41+
- provider: script
4742
skip_cleanup: true
48-
github_token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable
4943
keep_history: true
50-
local_dir: public_pages
44+
script: bash public_pages.sh
45+
on:
46+
branch: clientBuild
47+
condition: $TRAVIS_COMMIT_MESSAGE == *"[run deploy]"*
48+
- provider: releases
49+
target_commitish : $LAST_HASH
50+
keep_history: true
51+
api_key: $GITHUB_TOKEN
52+
skip_cleanup: true
53+
overwrite: true
5154
on:
52-
branch: master
55+
branch: clientBuild
56+
condition: $TRAVIS_COMMIT_MESSAGE == *"[run deploy]"*
5357
- provider: npm
5458
skip_cleanup: true
5559
56-
api_key: "NPM_TOKEN"
60+
api_key: $NPM_TOKEN
5761
keep_history: true
5862
on:
59-
branch : master
63+
branch : clientBuild
64+
condition: $TRAVIS_COMMIT_MESSAGE == *"[run deploy]"*

lib/viewer/chartConfig.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ WOQLChartConfig.prototype.layout=function(layout){
104104
}
105105

106106

107-
//default is { top: 10, right: 30, left: 0, bottom: 0 }
107+
//default is { top: 10, right: 30, left: 0, bottom: 80 }
108108
WOQLChartConfig.prototype.margin=function(marginObj){
109109
if(marginObj){
110110
this._margin=marginObj;
@@ -250,13 +250,23 @@ WOQLChartRule.prototype.dot=function(isVisible){
250250
}
251251

252252
WOQLChartRule.prototype.labelRotate=function(angle){
253-
if(angle){
253+
if(angle!==undefined){
254254
this.rule.labelRotate = angle;
255255
return this
256256
}
257257
return this.rule.labelRotate;
258258
}
259259

260+
//Specify the padding of x-axis. DEFAULT: { left: 0, right: 0 }
261+
WOQLChartRule.prototype.padding=function(paddingObj){
262+
if(paddingObj){
263+
this.rule.padding=paddingObj;
264+
return this
265+
}
266+
267+
return this.rule.padding;
268+
}
269+
260270
/*
261271
* The type of xAxis or yAxis 'number' | 'category' default is 'category'.
262272
* The type of line chart 'basis'|'basisClosed'|'basisOpen'|'linear'|'linearClosed'|'natural'|'monotoneX'|'monotoneY'|'monotone' | 'step' | 'stepBefore' | 'stepAfter' |

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "@terminusdb/terminus-client",
3-
"version": "1.0.2",
3+
"version": "1.1.2",
44
"description": "TerminusDB client library",
55
"main": "index.js",
66
"directories": {
77
"lib": "lib",
88
"test": "test"
99
},
1010
"publishConfig": {
11-
"access": "public"
11+
"access": "public"
1212
},
1313
"author": "[email protected]",
1414
"license": "Apache-2.0",
@@ -46,17 +46,17 @@
4646
"webpack-dev-server": "^3.10.1"
4747
},
4848
"scripts": {
49-
"versionWIN":"echo %npm_package_version%",
49+
"versionWIN": "echo %npm_package_version%",
5050
"doc": "documentation build lib/** -f html -o public_pages/$npm_package_version/docs",
5151
"clean": "rimraf -r public_pages/$npm_package_version/dist",
5252
"test": "npm run cover",
53-
"test:only": "mocha --require @babel/register --require @babel/preset-env --recursive",
53+
"test:only": "mocha --require @babel/register --require @babel/preset-env --recursive ",
5454
"test:watch": "mocha --watch --require @babel/register --require @babel/preset-env --recursive",
5555
"test:examples": "node examples/",
5656
"cover": "nyc --check-coverage --lines 30 npm run test:only ",
5757
"lint": "echo todo",
5858
"build": "webpack --mode production",
59-
"prepare": "npm run clean && npm run test && npm run build",
59+
"prepare": "npm run clean && npm run test",
6060
"coveralls-after": "nyc report --reporter=text-lcov | coveralls",
6161
"npm:publish": "npm publish --access public",
6262
"test-single": "mocha $1",

public_pages.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
echo "___SONO IN SCRIPT____"
3+
4+
5+
PUBLICATION_BRANCH=gh-pages
6+
# Checkout the branch
7+
REPO_PATH=$PWD
8+
9+
echo "$REPO_PATH"
10+
11+
pushd "$HOME" || exit
12+
git clone --branch=$PUBLICATION_BRANCH "https://${GITHUB_TOKEN}@github.com/$TRAVIS_REPO_SLUG" tmp_pages 2>&1 > /dev/null
13+
cd tmp_pages || exit
14+
15+
#rm -rf 1.1.4
16+
17+
# Update pages
18+
cp -r $REPO_PATH/public_pages/. .
19+
# Commit and push latest version
20+
git add .
21+
git config user.name "Travis"
22+
git config user.email "[email protected]"
23+
git commit -m "Updated version."
24+
git push -fq origin $PUBLICATION_BRANCH 2>&1 > /dev/null
25+
popd || exit

test/objectFrame.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ describe('Object Frame Rules', function () {
2222
})
2323
})
2424

25+

0 commit comments

Comments
 (0)