From 72704cad572fe8f946ee920871048167c5d009c2 Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Fri, 12 May 2017 15:12:24 +0100 Subject: [PATCH] [ADF-570] Script for Pushing to Registry (#1875) * change prepublish to build only add .npmrc in the gitignore and npmignore clean .npmrc during the clean task change registry during publish with npmrc file add rimraf install in npm publish * add option to link an alfresco-js-api from github * npm build on develop branch will use the alfresco-js-api from develop * modify script after review add -gitjsapi to starts.sh to change jsapi pointing add -vjsapi to starts.sh to change jsapi pointing * start dist demo shell script option --- .gitignore | 1 + .travis.yml | 6 +- appveyor.yml | 9 +- .../ng2-activiti-analytics/.gitignore | 1 + .../ng2-activiti-analytics/.npmignore | 1 + .../ng2-activiti-analytics/karma-test-shim.js | 2 + .../ng2-activiti-analytics/package.json | 5 +- .../ng2-activiti-diagrams/.gitignore | 1 + .../ng2-activiti-diagrams/.npmignore | 1 + .../ng2-activiti-diagrams/karma-test-shim.js | 2 + .../ng2-activiti-diagrams/package.json | 5 +- ng2-components/ng2-activiti-form/.gitignore | 1 + ng2-components/ng2-activiti-form/.npmignore | 1 + ng2-components/ng2-activiti-form/package.json | 5 +- .../ng2-activiti-processlist/.gitignore | 1 + .../ng2-activiti-processlist/.npmignore | 1 + .../karma-test-shim.js | 2 + .../ng2-activiti-processlist/package.json | 5 +- .../ng2-activiti-tasklist/.gitignore | 1 + .../ng2-activiti-tasklist/.npmignore | 1 + .../ng2-activiti-tasklist/karma-test-shim.js | 2 + .../ng2-activiti-tasklist/package.json | 5 +- ng2-components/ng2-alfresco-core/.gitignore | 1 + ng2-components/ng2-alfresco-core/.npmignore | 1 + .../ng2-alfresco-core/karma-test-shim.js | 2 + ng2-components/ng2-alfresco-core/package.json | 5 +- .../ng2-alfresco-datatable/.gitignore | 1 + .../ng2-alfresco-datatable/.npmignore | 1 + .../ng2-alfresco-datatable/karma-test-shim.js | 2 + .../ng2-alfresco-datatable/package.json | 5 +- .../ng2-alfresco-documentlist/.gitignore | 1 + .../ng2-alfresco-documentlist/.npmignore | 1 + .../karma-test-shim.js | 2 + .../ng2-alfresco-documentlist/package.json | 5 +- ng2-components/ng2-alfresco-login/.gitignore | 1 + ng2-components/ng2-alfresco-login/.npmignore | 1 + .../ng2-alfresco-login/karma-test-shim.js | 2 + .../ng2-alfresco-login/package.json | 5 +- ng2-components/ng2-alfresco-search/.gitignore | 1 + ng2-components/ng2-alfresco-search/.npmignore | 1 + .../ng2-alfresco-search/karma-test-shim.js | 2 + .../ng2-alfresco-search/package.json | 5 +- ng2-components/ng2-alfresco-social/.gitignore | 1 + ng2-components/ng2-alfresco-social/.npmignore | 1 + .../ng2-alfresco-social/karma-test-shim.js | 2 + .../ng2-alfresco-social/package.json | 5 +- ng2-components/ng2-alfresco-tag/.gitignore | 1 + ng2-components/ng2-alfresco-tag/.npmignore | 1 + .../ng2-alfresco-tag/karma-test-shim.js | 2 + ng2-components/ng2-alfresco-tag/package.json | 5 +- ng2-components/ng2-alfresco-upload/.gitignore | 1 + ng2-components/ng2-alfresco-upload/.npmignore | 1 + .../ng2-alfresco-upload/karma-test-shim.js | 2 + .../ng2-alfresco-upload/package.json | 5 +- .../ng2-alfresco-userinfo/.gitignore | 1 + .../ng2-alfresco-userinfo/.npmignore | 1 + .../ng2-alfresco-userinfo/karma-test-shim.js | 2 + .../ng2-alfresco-userinfo/package.json | 5 +- ng2-components/ng2-alfresco-viewer/.gitignore | 1 + ng2-components/ng2-alfresco-viewer/.npmignore | 2 + .../ng2-alfresco-viewer/karma-test-shim.js | 2 + .../ng2-alfresco-viewer/package.json | 3 +- .../ng2-alfresco-webscript/.gitignore | 1 + .../ng2-alfresco-webscript/.npmignore | 1 + .../ng2-alfresco-webscript/karma-test-shim.js | 2 + .../ng2-alfresco-webscript/package.json | 5 +- scripts/README.md | 47 +++++- scripts/npm-build-all.sh | 21 ++- scripts/npm-publish.sh | 44 +++++- scripts/start.sh | 136 ++++++++++++++++-- 70 files changed, 351 insertions(+), 54 deletions(-) diff --git a/.gitignore b/.gitignore index f171571be6..d2eb351acc 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ ng2-components/ng2-alfresco-userinfo-old/src/services/ecm-user.service.spec.ts src/environments/ /ng2-components/ng2-example-webpack/ /ng2-components/config/coverage/ +*.npmrc diff --git a/.travis.yml b/.travis.yml index 63a1d00ba6..6dfa73d91f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,11 @@ env: script: - if ([ "$MODULE" == "ng2-components" ]); then - (./scripts/npm-build-all.sh -t || exit 1;); + if ([ "$TRAVIS_BRANCH" = "master" ]); then + (./scripts/npm-build-all.sh -t || exit 1;); + else + (./scripts/npm-build-all.sh -t -gitjsapi development|| exit 1;); + fi fi - if ([ "$MODULE" == "ng2-demo-shell" ]); then (cd demo-shell-ng2 && npm install && npm run test || exit 1;); diff --git a/appveyor.yml b/appveyor.yml index e65747355b..2ffd0d6662 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -17,8 +17,13 @@ install: # Get the latest stable version of Node.js or io.js - ps: Install-Product node $env:nodejs_version # install module - - IF %COMPONENT_NAME% EQU ng2-components (cd scripts && sh npm-build-all.sh -t) - - IF %COMPONENT_NAME% EQU ng2-demo-shell (cd demo-shell-ng2 && npm install && npm run test || exit 1) + - if %COMPONENT_NAME% EQU ng2-components ( + if %APPVEYOR_REPO_BRANCH EQU master + (cd scripts && sh npm-build-all.sh -t || exit 1) + else + (cd scripts && sh npm-build-all.sh -t -gitjsapi development|| exit 1) + ) + - if %COMPONENT_NAME% EQU ng2-demo-shell (cd demo-shell-ng2 && npm install && npm run test || exit 1) # Don't actually build. build: off diff --git a/ng2-components/ng2-activiti-analytics/.gitignore b/ng2-components/ng2-activiti-analytics/.gitignore index fb23a7fef5..8dd503835e 100644 --- a/ng2-components/ng2-activiti-analytics/.gitignore +++ b/ng2-components/ng2-activiti-analytics/.gitignore @@ -1,6 +1,7 @@ npm-debug.log node_modules .idea +.npmrc typings coverage dist diff --git a/ng2-components/ng2-activiti-analytics/.npmignore b/ng2-components/ng2-activiti-analytics/.npmignore index 8bb008aff4..cb0b8b2890 100644 --- a/ng2-components/ng2-activiti-analytics/.npmignore +++ b/ng2-components/ng2-activiti-analytics/.npmignore @@ -1,5 +1,6 @@ npm-debug.log .idea +.npmrc coverage/ demo/ diff --git a/ng2-components/ng2-activiti-analytics/karma-test-shim.js b/ng2-components/ng2-activiti-analytics/karma-test-shim.js index a09906cdc6..64b94c4ab5 100644 --- a/ng2-components/ng2-activiti-analytics/karma-test-shim.js +++ b/ng2-components/ng2-activiti-analytics/karma-test-shim.js @@ -11,6 +11,8 @@ require('zone.js/dist/jasmine-patch'); require('zone.js/dist/async-test'); require('zone.js/dist/fake-async-test'); +jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; + var appContext = require.context('./src', true, /\.spec\.ts/); appContext.keys().forEach(appContext); diff --git a/ng2-components/ng2-activiti-analytics/package.json b/ng2-components/ng2-activiti-analytics/package.json index fb4856090f..f562749f92 100644 --- a/ng2-components/ng2-activiti-analytics/package.json +++ b/ng2-components/ng2-activiti-analytics/package.json @@ -4,12 +4,13 @@ "version": "1.4.0", "author": "Alfresco Software, Ltd.", "scripts": { - "clean": "rimraf dist node_modules typings bundles coverage", + "clean": "rimraf dist node_modules typings bundles coverage .npmrc", + "rimraf": "rimraf", "build": "webpack --config webpack.build.js --progress --profile --bail", "test": "karma start karma.conf.js --reporters mocha,coverage --single-run --component", "test-browser": "karma start karma.conf.js --reporters kjhtml --component", "coverage": "npm run test && wsrv -o -p 9875 ./coverage/report", - "prepublish" : "npm run test" + "prepublish" : "npm run build" }, "main": "bundles/ng2-activiti-analytics.js", "contributors": [ diff --git a/ng2-components/ng2-activiti-diagrams/.gitignore b/ng2-components/ng2-activiti-diagrams/.gitignore index fb23a7fef5..8dd503835e 100644 --- a/ng2-components/ng2-activiti-diagrams/.gitignore +++ b/ng2-components/ng2-activiti-diagrams/.gitignore @@ -1,6 +1,7 @@ npm-debug.log node_modules .idea +.npmrc typings coverage dist diff --git a/ng2-components/ng2-activiti-diagrams/.npmignore b/ng2-components/ng2-activiti-diagrams/.npmignore index 8bb008aff4..cb0b8b2890 100644 --- a/ng2-components/ng2-activiti-diagrams/.npmignore +++ b/ng2-components/ng2-activiti-diagrams/.npmignore @@ -1,5 +1,6 @@ npm-debug.log .idea +.npmrc coverage/ demo/ diff --git a/ng2-components/ng2-activiti-diagrams/karma-test-shim.js b/ng2-components/ng2-activiti-diagrams/karma-test-shim.js index a09906cdc6..64b94c4ab5 100644 --- a/ng2-components/ng2-activiti-diagrams/karma-test-shim.js +++ b/ng2-components/ng2-activiti-diagrams/karma-test-shim.js @@ -11,6 +11,8 @@ require('zone.js/dist/jasmine-patch'); require('zone.js/dist/async-test'); require('zone.js/dist/fake-async-test'); +jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; + var appContext = require.context('./src', true, /\.spec\.ts/); appContext.keys().forEach(appContext); diff --git a/ng2-components/ng2-activiti-diagrams/package.json b/ng2-components/ng2-activiti-diagrams/package.json index b0afdc37b8..f950286ec6 100644 --- a/ng2-components/ng2-activiti-diagrams/package.json +++ b/ng2-components/ng2-activiti-diagrams/package.json @@ -4,12 +4,13 @@ "version": "1.4.0", "author": "Alfresco Software, Ltd.", "scripts": { - "clean": "rimraf dist node_modules typings bundles coverage", + "clean": "rimraf dist node_modules typings bundles coverage .npmrc", + "rimraf": "rimraf", "build": "webpack --config webpack.build.js --progress --profile --bail", "test": "karma start karma.conf.js --reporters mocha,coverage --single-run --component", "test-browser": "karma start karma.conf.js --reporters kjhtml --component", "coverage": "npm run test && wsrv -o -p 9875 ./coverage/report", - "prepublish" : "npm run test" + "prepublish" : "npm run build" }, "main": "bundles/ng2-activiti-diagrams.js", "contributors": [ diff --git a/ng2-components/ng2-activiti-form/.gitignore b/ng2-components/ng2-activiti-form/.gitignore index fb23a7fef5..8dd503835e 100644 --- a/ng2-components/ng2-activiti-form/.gitignore +++ b/ng2-components/ng2-activiti-form/.gitignore @@ -1,6 +1,7 @@ npm-debug.log node_modules .idea +.npmrc typings coverage dist diff --git a/ng2-components/ng2-activiti-form/.npmignore b/ng2-components/ng2-activiti-form/.npmignore index 8bb008aff4..cb0b8b2890 100644 --- a/ng2-components/ng2-activiti-form/.npmignore +++ b/ng2-components/ng2-activiti-form/.npmignore @@ -1,5 +1,6 @@ npm-debug.log .idea +.npmrc coverage/ demo/ diff --git a/ng2-components/ng2-activiti-form/package.json b/ng2-components/ng2-activiti-form/package.json index 0c55c2263e..01f4d3dfe2 100644 --- a/ng2-components/ng2-activiti-form/package.json +++ b/ng2-components/ng2-activiti-form/package.json @@ -4,12 +4,13 @@ "version": "1.4.0", "author": "Alfresco Software, Ltd.", "scripts": { - "clean": "rimraf dist node_modules typings bundles coverage", + "clean": "rimraf dist node_modules typings bundles coverage .npmrc", + "rimraf": "rimraf", "build": "webpack --config webpack.build.js --progress --profile --bail", "test": "karma start karma.conf.js --reporters mocha,coverage --single-run --component", "test-browser": "karma start karma.conf.js --reporters kjhtml --component", "coverage": "npm run test && wsrv -o -p 9875 ./coverage/report", - "prepublish" : "npm run test" + "prepublish" : "npm run build" }, "main": "bundles/ng2-activiti-form.js", "repository": { diff --git a/ng2-components/ng2-activiti-processlist/.gitignore b/ng2-components/ng2-activiti-processlist/.gitignore index fb23a7fef5..8dd503835e 100644 --- a/ng2-components/ng2-activiti-processlist/.gitignore +++ b/ng2-components/ng2-activiti-processlist/.gitignore @@ -1,6 +1,7 @@ npm-debug.log node_modules .idea +.npmrc typings coverage dist diff --git a/ng2-components/ng2-activiti-processlist/.npmignore b/ng2-components/ng2-activiti-processlist/.npmignore index 8bb008aff4..cb0b8b2890 100644 --- a/ng2-components/ng2-activiti-processlist/.npmignore +++ b/ng2-components/ng2-activiti-processlist/.npmignore @@ -1,5 +1,6 @@ npm-debug.log .idea +.npmrc coverage/ demo/ diff --git a/ng2-components/ng2-activiti-processlist/karma-test-shim.js b/ng2-components/ng2-activiti-processlist/karma-test-shim.js index a09906cdc6..64b94c4ab5 100644 --- a/ng2-components/ng2-activiti-processlist/karma-test-shim.js +++ b/ng2-components/ng2-activiti-processlist/karma-test-shim.js @@ -11,6 +11,8 @@ require('zone.js/dist/jasmine-patch'); require('zone.js/dist/async-test'); require('zone.js/dist/fake-async-test'); +jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; + var appContext = require.context('./src', true, /\.spec\.ts/); appContext.keys().forEach(appContext); diff --git a/ng2-components/ng2-activiti-processlist/package.json b/ng2-components/ng2-activiti-processlist/package.json index eab4799cf7..bc415c3316 100644 --- a/ng2-components/ng2-activiti-processlist/package.json +++ b/ng2-components/ng2-activiti-processlist/package.json @@ -4,12 +4,13 @@ "version": "1.4.0", "author": "Alfresco Software, Ltd.", "scripts": { - "clean": "rimraf dist node_modules typings bundles coverage", + "clean": "rimraf dist node_modules typings bundles coverage .npmrc", + "rimraf": "rimraf", "build": "webpack --config webpack.build.js --progress --profile --bail", "test": "karma start karma.conf.js --reporters mocha,coverage --single-run --component", "test-browser": "karma start karma.conf.js --reporters kjhtml --component", "coverage": "npm run test && wsrv -o -p 9875 ./coverage/report", - "prepublish" : "npm run test" + "prepublish" : "npm run build" }, "main": "bundles/ng2-activiti-processlist.js", "repository": { diff --git a/ng2-components/ng2-activiti-tasklist/.gitignore b/ng2-components/ng2-activiti-tasklist/.gitignore index fb23a7fef5..8dd503835e 100644 --- a/ng2-components/ng2-activiti-tasklist/.gitignore +++ b/ng2-components/ng2-activiti-tasklist/.gitignore @@ -1,6 +1,7 @@ npm-debug.log node_modules .idea +.npmrc typings coverage dist diff --git a/ng2-components/ng2-activiti-tasklist/.npmignore b/ng2-components/ng2-activiti-tasklist/.npmignore index 8bb008aff4..cb0b8b2890 100644 --- a/ng2-components/ng2-activiti-tasklist/.npmignore +++ b/ng2-components/ng2-activiti-tasklist/.npmignore @@ -1,5 +1,6 @@ npm-debug.log .idea +.npmrc coverage/ demo/ diff --git a/ng2-components/ng2-activiti-tasklist/karma-test-shim.js b/ng2-components/ng2-activiti-tasklist/karma-test-shim.js index a09906cdc6..64b94c4ab5 100644 --- a/ng2-components/ng2-activiti-tasklist/karma-test-shim.js +++ b/ng2-components/ng2-activiti-tasklist/karma-test-shim.js @@ -11,6 +11,8 @@ require('zone.js/dist/jasmine-patch'); require('zone.js/dist/async-test'); require('zone.js/dist/fake-async-test'); +jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; + var appContext = require.context('./src', true, /\.spec\.ts/); appContext.keys().forEach(appContext); diff --git a/ng2-components/ng2-activiti-tasklist/package.json b/ng2-components/ng2-activiti-tasklist/package.json index ec2cef9b51..6257b3e41b 100644 --- a/ng2-components/ng2-activiti-tasklist/package.json +++ b/ng2-components/ng2-activiti-tasklist/package.json @@ -4,12 +4,13 @@ "version": "1.4.0", "author": "Alfresco Software, Ltd.", "scripts": { - "clean": "rimraf dist node_modules typings bundles coverage", + "clean": "rimraf dist node_modules typings bundles coverage .npmrc", + "rimraf": "rimraf", "build": "webpack --config webpack.build.js --progress --profile --bail", "test": "karma start karma.conf.js --reporters mocha,coverage --single-run --component", "test-browser": "karma start karma.conf.js --reporters kjhtml --component", "coverage": "npm run test && wsrv -o -p 9875 ./coverage/report", - "prepublish" : "npm run test" + "prepublish" : "npm run build" }, "main": "bundles/ng2-activiti-tasklist.js", "repository": { diff --git a/ng2-components/ng2-alfresco-core/.gitignore b/ng2-components/ng2-alfresco-core/.gitignore index fb23a7fef5..8dd503835e 100644 --- a/ng2-components/ng2-alfresco-core/.gitignore +++ b/ng2-components/ng2-alfresco-core/.gitignore @@ -1,6 +1,7 @@ npm-debug.log node_modules .idea +.npmrc typings coverage dist diff --git a/ng2-components/ng2-alfresco-core/.npmignore b/ng2-components/ng2-alfresco-core/.npmignore index 8bb008aff4..cb0b8b2890 100644 --- a/ng2-components/ng2-alfresco-core/.npmignore +++ b/ng2-components/ng2-alfresco-core/.npmignore @@ -1,5 +1,6 @@ npm-debug.log .idea +.npmrc coverage/ demo/ diff --git a/ng2-components/ng2-alfresco-core/karma-test-shim.js b/ng2-components/ng2-alfresco-core/karma-test-shim.js index a09906cdc6..64b94c4ab5 100644 --- a/ng2-components/ng2-alfresco-core/karma-test-shim.js +++ b/ng2-components/ng2-alfresco-core/karma-test-shim.js @@ -11,6 +11,8 @@ require('zone.js/dist/jasmine-patch'); require('zone.js/dist/async-test'); require('zone.js/dist/fake-async-test'); +jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; + var appContext = require.context('./src', true, /\.spec\.ts/); appContext.keys().forEach(appContext); diff --git a/ng2-components/ng2-alfresco-core/package.json b/ng2-components/ng2-alfresco-core/package.json index 02694955f9..b5ea9e0f6e 100644 --- a/ng2-components/ng2-alfresco-core/package.json +++ b/ng2-components/ng2-alfresco-core/package.json @@ -4,12 +4,13 @@ "version": "1.4.0", "author": "Alfresco Software, Ltd.", "scripts": { - "clean": "rimraf dist node_modules typings bundles coverage", + "clean": "rimraf dist node_modules typings bundles coverage .npmrc", + "rimraf": "rimraf", "build": "webpack --config webpack.build.js --progress --profile --bail", "test": "karma start karma.conf.js --reporters mocha,coverage --single-run --component", "test-browser": "karma start karma.conf.js --reporters kjhtml --component", "coverage": "npm run test && wsrv -o -p 9875 ./coverage/report", - "prepublish" : "npm run test" + "prepublish" : "npm run build" }, "main": "bundles/ng2-alfresco-core.js", "repository": { diff --git a/ng2-components/ng2-alfresco-datatable/.gitignore b/ng2-components/ng2-alfresco-datatable/.gitignore index fb23a7fef5..8dd503835e 100644 --- a/ng2-components/ng2-alfresco-datatable/.gitignore +++ b/ng2-components/ng2-alfresco-datatable/.gitignore @@ -1,6 +1,7 @@ npm-debug.log node_modules .idea +.npmrc typings coverage dist diff --git a/ng2-components/ng2-alfresco-datatable/.npmignore b/ng2-components/ng2-alfresco-datatable/.npmignore index 8bb008aff4..cb0b8b2890 100644 --- a/ng2-components/ng2-alfresco-datatable/.npmignore +++ b/ng2-components/ng2-alfresco-datatable/.npmignore @@ -1,5 +1,6 @@ npm-debug.log .idea +.npmrc coverage/ demo/ diff --git a/ng2-components/ng2-alfresco-datatable/karma-test-shim.js b/ng2-components/ng2-alfresco-datatable/karma-test-shim.js index a09906cdc6..64b94c4ab5 100644 --- a/ng2-components/ng2-alfresco-datatable/karma-test-shim.js +++ b/ng2-components/ng2-alfresco-datatable/karma-test-shim.js @@ -11,6 +11,8 @@ require('zone.js/dist/jasmine-patch'); require('zone.js/dist/async-test'); require('zone.js/dist/fake-async-test'); +jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; + var appContext = require.context('./src', true, /\.spec\.ts/); appContext.keys().forEach(appContext); diff --git a/ng2-components/ng2-alfresco-datatable/package.json b/ng2-components/ng2-alfresco-datatable/package.json index 53d069c26e..41b8a54050 100644 --- a/ng2-components/ng2-alfresco-datatable/package.json +++ b/ng2-components/ng2-alfresco-datatable/package.json @@ -4,12 +4,13 @@ "version": "1.4.0", "author": "Alfresco Software, Ltd.", "scripts": { - "clean": "rimraf dist node_modules typings bundles coverage", + "clean": "rimraf dist node_modules typings bundles coverage .npmrc", + "rimraf": "rimraf", "build": "webpack --config webpack.build.js --progress --profile --bail", "test": "karma start karma.conf.js --reporters mocha,coverage --single-run --component", "test-browser": "karma start karma.conf.js --reporters kjhtml --component", "coverage": "npm run test && wsrv -o -p 9875 ./coverage/report", - "prepublish" : "npm run test" + "prepublish" : "npm run build" }, "main": "bundles/ng2-alfresco-datatable.js", "repository": { diff --git a/ng2-components/ng2-alfresco-documentlist/.gitignore b/ng2-components/ng2-alfresco-documentlist/.gitignore index fb23a7fef5..8dd503835e 100644 --- a/ng2-components/ng2-alfresco-documentlist/.gitignore +++ b/ng2-components/ng2-alfresco-documentlist/.gitignore @@ -1,6 +1,7 @@ npm-debug.log node_modules .idea +.npmrc typings coverage dist diff --git a/ng2-components/ng2-alfresco-documentlist/.npmignore b/ng2-components/ng2-alfresco-documentlist/.npmignore index 8bb008aff4..cb0b8b2890 100644 --- a/ng2-components/ng2-alfresco-documentlist/.npmignore +++ b/ng2-components/ng2-alfresco-documentlist/.npmignore @@ -1,5 +1,6 @@ npm-debug.log .idea +.npmrc coverage/ demo/ diff --git a/ng2-components/ng2-alfresco-documentlist/karma-test-shim.js b/ng2-components/ng2-alfresco-documentlist/karma-test-shim.js index a09906cdc6..64b94c4ab5 100644 --- a/ng2-components/ng2-alfresco-documentlist/karma-test-shim.js +++ b/ng2-components/ng2-alfresco-documentlist/karma-test-shim.js @@ -11,6 +11,8 @@ require('zone.js/dist/jasmine-patch'); require('zone.js/dist/async-test'); require('zone.js/dist/fake-async-test'); +jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; + var appContext = require.context('./src', true, /\.spec\.ts/); appContext.keys().forEach(appContext); diff --git a/ng2-components/ng2-alfresco-documentlist/package.json b/ng2-components/ng2-alfresco-documentlist/package.json index f942497c52..9980b8ade3 100644 --- a/ng2-components/ng2-alfresco-documentlist/package.json +++ b/ng2-components/ng2-alfresco-documentlist/package.json @@ -4,12 +4,13 @@ "version": "1.4.0", "author": "Alfresco Software, Ltd.", "scripts": { - "clean": "rimraf dist node_modules typings bundles coverage", + "clean": "rimraf dist node_modules typings bundles coverage .npmrc", + "rimraf": "rimraf", "build": "webpack --config webpack.build.js --progress --profile --bail", "test": "karma start karma.conf.js --reporters mocha,coverage --single-run --component", "test-browser": "karma start karma.conf.js --reporters kjhtml --component", "coverage": "npm run test && wsrv -o -p 9875 ./coverage/report", - "prepublish" : "npm run test" + "prepublish" : "npm run build" }, "main": "bundles/ng2-alfresco-documentlist.js", "repository": { diff --git a/ng2-components/ng2-alfresco-login/.gitignore b/ng2-components/ng2-alfresco-login/.gitignore index fb23a7fef5..8dd503835e 100644 --- a/ng2-components/ng2-alfresco-login/.gitignore +++ b/ng2-components/ng2-alfresco-login/.gitignore @@ -1,6 +1,7 @@ npm-debug.log node_modules .idea +.npmrc typings coverage dist diff --git a/ng2-components/ng2-alfresco-login/.npmignore b/ng2-components/ng2-alfresco-login/.npmignore index 8bb008aff4..cb0b8b2890 100644 --- a/ng2-components/ng2-alfresco-login/.npmignore +++ b/ng2-components/ng2-alfresco-login/.npmignore @@ -1,5 +1,6 @@ npm-debug.log .idea +.npmrc coverage/ demo/ diff --git a/ng2-components/ng2-alfresco-login/karma-test-shim.js b/ng2-components/ng2-alfresco-login/karma-test-shim.js index a09906cdc6..64b94c4ab5 100644 --- a/ng2-components/ng2-alfresco-login/karma-test-shim.js +++ b/ng2-components/ng2-alfresco-login/karma-test-shim.js @@ -11,6 +11,8 @@ require('zone.js/dist/jasmine-patch'); require('zone.js/dist/async-test'); require('zone.js/dist/fake-async-test'); +jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; + var appContext = require.context('./src', true, /\.spec\.ts/); appContext.keys().forEach(appContext); diff --git a/ng2-components/ng2-alfresco-login/package.json b/ng2-components/ng2-alfresco-login/package.json index 3645169ca9..a10f722ecb 100644 --- a/ng2-components/ng2-alfresco-login/package.json +++ b/ng2-components/ng2-alfresco-login/package.json @@ -4,12 +4,13 @@ "version": "1.4.0", "author": "Alfresco Software, Ltd.", "scripts": { - "clean": "rimraf dist node_modules typings bundles coverage", + "clean": "rimraf dist node_modules typings bundles coverage .npmrc", + "rimraf": "rimraf", "build": "webpack --config webpack.build.js --progress --profile --bail", "test": "karma start karma.conf.js --reporters mocha,coverage --single-run --component", "test-browser": "karma start karma.conf.js --reporters kjhtml --component", "coverage": "npm run test && wsrv -o -p 9875 ./coverage/report", - "prepublish" : "npm run test" + "prepublish" : "npm run build" }, "main": "bundles/ng2-alfresco-login.js", "repository": { diff --git a/ng2-components/ng2-alfresco-search/.gitignore b/ng2-components/ng2-alfresco-search/.gitignore index fb23a7fef5..8dd503835e 100644 --- a/ng2-components/ng2-alfresco-search/.gitignore +++ b/ng2-components/ng2-alfresco-search/.gitignore @@ -1,6 +1,7 @@ npm-debug.log node_modules .idea +.npmrc typings coverage dist diff --git a/ng2-components/ng2-alfresco-search/.npmignore b/ng2-components/ng2-alfresco-search/.npmignore index 8bb008aff4..cb0b8b2890 100644 --- a/ng2-components/ng2-alfresco-search/.npmignore +++ b/ng2-components/ng2-alfresco-search/.npmignore @@ -1,5 +1,6 @@ npm-debug.log .idea +.npmrc coverage/ demo/ diff --git a/ng2-components/ng2-alfresco-search/karma-test-shim.js b/ng2-components/ng2-alfresco-search/karma-test-shim.js index a09906cdc6..64b94c4ab5 100644 --- a/ng2-components/ng2-alfresco-search/karma-test-shim.js +++ b/ng2-components/ng2-alfresco-search/karma-test-shim.js @@ -11,6 +11,8 @@ require('zone.js/dist/jasmine-patch'); require('zone.js/dist/async-test'); require('zone.js/dist/fake-async-test'); +jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; + var appContext = require.context('./src', true, /\.spec\.ts/); appContext.keys().forEach(appContext); diff --git a/ng2-components/ng2-alfresco-search/package.json b/ng2-components/ng2-alfresco-search/package.json index 310a41da92..e606650b36 100644 --- a/ng2-components/ng2-alfresco-search/package.json +++ b/ng2-components/ng2-alfresco-search/package.json @@ -4,12 +4,13 @@ "version": "1.4.0", "author": "Alfresco Software, Ltd.", "scripts": { - "clean": "rimraf dist node_modules typings bundles coverage", + "clean": "rimraf dist node_modules typings bundles coverage .npmrc", + "rimraf": "rimraf", "build": "webpack --config webpack.build.js --progress --profile --bail", "test": "karma start karma.conf.js --reporters mocha,coverage --single-run --component", "test-browser": "karma start karma.conf.js --reporters kjhtml --component", "coverage": "npm run test && wsrv -o -p 9875 ./coverage/report", - "prepublish" : "npm run test" + "prepublish" : "npm run build" }, "main": "bundles/ng2-alfresco-search.js", "repository": { diff --git a/ng2-components/ng2-alfresco-social/.gitignore b/ng2-components/ng2-alfresco-social/.gitignore index fb23a7fef5..8dd503835e 100644 --- a/ng2-components/ng2-alfresco-social/.gitignore +++ b/ng2-components/ng2-alfresco-social/.gitignore @@ -1,6 +1,7 @@ npm-debug.log node_modules .idea +.npmrc typings coverage dist diff --git a/ng2-components/ng2-alfresco-social/.npmignore b/ng2-components/ng2-alfresco-social/.npmignore index 8bb008aff4..cb0b8b2890 100644 --- a/ng2-components/ng2-alfresco-social/.npmignore +++ b/ng2-components/ng2-alfresco-social/.npmignore @@ -1,5 +1,6 @@ npm-debug.log .idea +.npmrc coverage/ demo/ diff --git a/ng2-components/ng2-alfresco-social/karma-test-shim.js b/ng2-components/ng2-alfresco-social/karma-test-shim.js index a09906cdc6..64b94c4ab5 100644 --- a/ng2-components/ng2-alfresco-social/karma-test-shim.js +++ b/ng2-components/ng2-alfresco-social/karma-test-shim.js @@ -11,6 +11,8 @@ require('zone.js/dist/jasmine-patch'); require('zone.js/dist/async-test'); require('zone.js/dist/fake-async-test'); +jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; + var appContext = require.context('./src', true, /\.spec\.ts/); appContext.keys().forEach(appContext); diff --git a/ng2-components/ng2-alfresco-social/package.json b/ng2-components/ng2-alfresco-social/package.json index 4e5281439c..9f82940c9e 100644 --- a/ng2-components/ng2-alfresco-social/package.json +++ b/ng2-components/ng2-alfresco-social/package.json @@ -4,12 +4,13 @@ "version": "1.4.0", "author": "Alfresco Software, Ltd.", "scripts": { - "clean": "rimraf dist node_modules typings bundles coverage", + "clean": "rimraf dist node_modules typings bundles coverage .npmrc", + "rimraf": "rimraf", "build": "webpack --config webpack.build.js --progress --profile --bail", "test": "karma start karma.conf.js --reporters mocha,coverage --single-run --component", "test-browser": "karma start karma.conf.js --reporters kjhtml --component", "coverage": "npm run test && wsrv -o -p 9875 ./coverage/report", - "prepublish" : "npm run test" + "prepublish" : "npm run build" }, "main": "bundles/ng2-alfresco-social.js", "repository": { diff --git a/ng2-components/ng2-alfresco-tag/.gitignore b/ng2-components/ng2-alfresco-tag/.gitignore index fb23a7fef5..8dd503835e 100644 --- a/ng2-components/ng2-alfresco-tag/.gitignore +++ b/ng2-components/ng2-alfresco-tag/.gitignore @@ -1,6 +1,7 @@ npm-debug.log node_modules .idea +.npmrc typings coverage dist diff --git a/ng2-components/ng2-alfresco-tag/.npmignore b/ng2-components/ng2-alfresco-tag/.npmignore index 8bb008aff4..cb0b8b2890 100644 --- a/ng2-components/ng2-alfresco-tag/.npmignore +++ b/ng2-components/ng2-alfresco-tag/.npmignore @@ -1,5 +1,6 @@ npm-debug.log .idea +.npmrc coverage/ demo/ diff --git a/ng2-components/ng2-alfresco-tag/karma-test-shim.js b/ng2-components/ng2-alfresco-tag/karma-test-shim.js index a09906cdc6..64b94c4ab5 100644 --- a/ng2-components/ng2-alfresco-tag/karma-test-shim.js +++ b/ng2-components/ng2-alfresco-tag/karma-test-shim.js @@ -11,6 +11,8 @@ require('zone.js/dist/jasmine-patch'); require('zone.js/dist/async-test'); require('zone.js/dist/fake-async-test'); +jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; + var appContext = require.context('./src', true, /\.spec\.ts/); appContext.keys().forEach(appContext); diff --git a/ng2-components/ng2-alfresco-tag/package.json b/ng2-components/ng2-alfresco-tag/package.json index f141d4cd2c..6fc86fe6d0 100644 --- a/ng2-components/ng2-alfresco-tag/package.json +++ b/ng2-components/ng2-alfresco-tag/package.json @@ -4,12 +4,13 @@ "version": "1.4.0", "author": "Alfresco Software, Ltd.", "scripts": { - "clean": "rimraf dist node_modules typings bundles coverage", + "clean": "rimraf dist node_modules typings bundles coverage .npmrc", + "rimraf": "rimraf", "build": "webpack --config webpack.build.js --progress --profile --bail", "test": "karma start karma.conf.js --reporters mocha,coverage --single-run --component", "test-browser": "karma start karma.conf.js --reporters kjhtml --component", "coverage": "npm run test && wsrv -o -p 9875 ./coverage/report", - "prepublish" : "npm run test" + "prepublish" : "npm run build" }, "main": "bundles/ng2-alfresco-tag.js", "repository": { diff --git a/ng2-components/ng2-alfresco-upload/.gitignore b/ng2-components/ng2-alfresco-upload/.gitignore index fb23a7fef5..8dd503835e 100644 --- a/ng2-components/ng2-alfresco-upload/.gitignore +++ b/ng2-components/ng2-alfresco-upload/.gitignore @@ -1,6 +1,7 @@ npm-debug.log node_modules .idea +.npmrc typings coverage dist diff --git a/ng2-components/ng2-alfresco-upload/.npmignore b/ng2-components/ng2-alfresco-upload/.npmignore index 8bb008aff4..cb0b8b2890 100644 --- a/ng2-components/ng2-alfresco-upload/.npmignore +++ b/ng2-components/ng2-alfresco-upload/.npmignore @@ -1,5 +1,6 @@ npm-debug.log .idea +.npmrc coverage/ demo/ diff --git a/ng2-components/ng2-alfresco-upload/karma-test-shim.js b/ng2-components/ng2-alfresco-upload/karma-test-shim.js index a09906cdc6..64b94c4ab5 100644 --- a/ng2-components/ng2-alfresco-upload/karma-test-shim.js +++ b/ng2-components/ng2-alfresco-upload/karma-test-shim.js @@ -11,6 +11,8 @@ require('zone.js/dist/jasmine-patch'); require('zone.js/dist/async-test'); require('zone.js/dist/fake-async-test'); +jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; + var appContext = require.context('./src', true, /\.spec\.ts/); appContext.keys().forEach(appContext); diff --git a/ng2-components/ng2-alfresco-upload/package.json b/ng2-components/ng2-alfresco-upload/package.json index 9397c54744..6f0742b867 100644 --- a/ng2-components/ng2-alfresco-upload/package.json +++ b/ng2-components/ng2-alfresco-upload/package.json @@ -4,12 +4,13 @@ "version": "1.4.0", "author": "Alfresco Software, Ltd.", "scripts": { - "clean": "rimraf dist node_modules typings bundles coverage", + "clean": "rimraf dist node_modules typings bundles coverage .npmrc", + "rimraf": "rimraf", "build": "webpack --config webpack.build.js --progress --profile --bail", "test": "karma start karma.conf.js --reporters mocha,coverage --single-run --component", "test-browser": "karma start karma.conf.js --reporters kjhtml --component", "coverage": "npm run test && wsrv -o -p 9875 ./coverage/report", - "prepublish" : "npm run test" + "prepublish" : "npm run build" }, "main": "bundles/ng2-alfresco-upload.js", "repository": { diff --git a/ng2-components/ng2-alfresco-userinfo/.gitignore b/ng2-components/ng2-alfresco-userinfo/.gitignore index fb23a7fef5..8dd503835e 100644 --- a/ng2-components/ng2-alfresco-userinfo/.gitignore +++ b/ng2-components/ng2-alfresco-userinfo/.gitignore @@ -1,6 +1,7 @@ npm-debug.log node_modules .idea +.npmrc typings coverage dist diff --git a/ng2-components/ng2-alfresco-userinfo/.npmignore b/ng2-components/ng2-alfresco-userinfo/.npmignore index 8bb008aff4..cb0b8b2890 100644 --- a/ng2-components/ng2-alfresco-userinfo/.npmignore +++ b/ng2-components/ng2-alfresco-userinfo/.npmignore @@ -1,5 +1,6 @@ npm-debug.log .idea +.npmrc coverage/ demo/ diff --git a/ng2-components/ng2-alfresco-userinfo/karma-test-shim.js b/ng2-components/ng2-alfresco-userinfo/karma-test-shim.js index a09906cdc6..64b94c4ab5 100644 --- a/ng2-components/ng2-alfresco-userinfo/karma-test-shim.js +++ b/ng2-components/ng2-alfresco-userinfo/karma-test-shim.js @@ -11,6 +11,8 @@ require('zone.js/dist/jasmine-patch'); require('zone.js/dist/async-test'); require('zone.js/dist/fake-async-test'); +jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; + var appContext = require.context('./src', true, /\.spec\.ts/); appContext.keys().forEach(appContext); diff --git a/ng2-components/ng2-alfresco-userinfo/package.json b/ng2-components/ng2-alfresco-userinfo/package.json index 8dd91e1b9d..9842b41455 100644 --- a/ng2-components/ng2-alfresco-userinfo/package.json +++ b/ng2-components/ng2-alfresco-userinfo/package.json @@ -4,12 +4,13 @@ "version": "1.4.0", "author": "Alfresco Software, Ltd.", "scripts": { - "clean": "rimraf dist node_modules typings bundles coverage", + "clean": "rimraf dist node_modules typings bundles coverage .npmrc", + "rimraf": "rimraf", "build": "webpack --config webpack.build.js --progress --profile --bail", "test": "karma start karma.conf.js --reporters mocha,coverage --single-run --component", "test-browser": "karma start karma.conf.js --reporters kjhtml --component", "coverage": "npm run test && wsrv -o -p 9875 ./coverage/report", - "prepublish" : "npm run test" + "prepublish" : "npm run build" }, "main": "bundles/ng2-alfresco-userinfo.js", "repository": { diff --git a/ng2-components/ng2-alfresco-viewer/.gitignore b/ng2-components/ng2-alfresco-viewer/.gitignore index fb23a7fef5..8dd503835e 100644 --- a/ng2-components/ng2-alfresco-viewer/.gitignore +++ b/ng2-components/ng2-alfresco-viewer/.gitignore @@ -1,6 +1,7 @@ npm-debug.log node_modules .idea +.npmrc typings coverage dist diff --git a/ng2-components/ng2-alfresco-viewer/.npmignore b/ng2-components/ng2-alfresco-viewer/.npmignore index c1922c5b29..6e5ae18ee1 100644 --- a/ng2-components/ng2-alfresco-viewer/.npmignore +++ b/ng2-components/ng2-alfresco-viewer/.npmignore @@ -1,5 +1,7 @@ npm-debug.log .idea +.npmrc + demo/localTestFile.pdf coverage/ diff --git a/ng2-components/ng2-alfresco-viewer/karma-test-shim.js b/ng2-components/ng2-alfresco-viewer/karma-test-shim.js index a09906cdc6..64b94c4ab5 100644 --- a/ng2-components/ng2-alfresco-viewer/karma-test-shim.js +++ b/ng2-components/ng2-alfresco-viewer/karma-test-shim.js @@ -11,6 +11,8 @@ require('zone.js/dist/jasmine-patch'); require('zone.js/dist/async-test'); require('zone.js/dist/fake-async-test'); +jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; + var appContext = require.context('./src', true, /\.spec\.ts/); appContext.keys().forEach(appContext); diff --git a/ng2-components/ng2-alfresco-viewer/package.json b/ng2-components/ng2-alfresco-viewer/package.json index ee1524a624..56c620ef88 100644 --- a/ng2-components/ng2-alfresco-viewer/package.json +++ b/ng2-components/ng2-alfresco-viewer/package.json @@ -4,7 +4,8 @@ "version": "1.4.0", "author": "Alfresco Software, Ltd.", "scripts": { - "clean": "rimraf dist node_modules typings bundles coverage", + "clean": "rimraf dist node_modules typings bundles coverage .npmrc", + "rimraf": "rimraf", "build": "webpack --config webpack.build.js --progress --profile --bail", "test": "karma start karma.conf.js --reporters mocha,coverage --single-run --component", "test-browser": "karma start karma.conf.js --reporters kjhtml --component", diff --git a/ng2-components/ng2-alfresco-webscript/.gitignore b/ng2-components/ng2-alfresco-webscript/.gitignore index fb23a7fef5..8dd503835e 100644 --- a/ng2-components/ng2-alfresco-webscript/.gitignore +++ b/ng2-components/ng2-alfresco-webscript/.gitignore @@ -1,6 +1,7 @@ npm-debug.log node_modules .idea +.npmrc typings coverage dist diff --git a/ng2-components/ng2-alfresco-webscript/.npmignore b/ng2-components/ng2-alfresco-webscript/.npmignore index 8bb008aff4..cb0b8b2890 100644 --- a/ng2-components/ng2-alfresco-webscript/.npmignore +++ b/ng2-components/ng2-alfresco-webscript/.npmignore @@ -1,5 +1,6 @@ npm-debug.log .idea +.npmrc coverage/ demo/ diff --git a/ng2-components/ng2-alfresco-webscript/karma-test-shim.js b/ng2-components/ng2-alfresco-webscript/karma-test-shim.js index a09906cdc6..64b94c4ab5 100644 --- a/ng2-components/ng2-alfresco-webscript/karma-test-shim.js +++ b/ng2-components/ng2-alfresco-webscript/karma-test-shim.js @@ -11,6 +11,8 @@ require('zone.js/dist/jasmine-patch'); require('zone.js/dist/async-test'); require('zone.js/dist/fake-async-test'); +jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; + var appContext = require.context('./src', true, /\.spec\.ts/); appContext.keys().forEach(appContext); diff --git a/ng2-components/ng2-alfresco-webscript/package.json b/ng2-components/ng2-alfresco-webscript/package.json index 3ed4ee5a3b..99b51f5674 100644 --- a/ng2-components/ng2-alfresco-webscript/package.json +++ b/ng2-components/ng2-alfresco-webscript/package.json @@ -4,12 +4,13 @@ "version": "1.4.0", "author": "Alfresco Software, Ltd.", "scripts": { - "clean": "rimraf dist node_modules typings bundles coverage", + "clean": "rimraf dist node_modules typings bundles coverage .npmrc", + "rimraf": "rimraf", "build": "webpack --config webpack.build.js --progress --profile --bail", "test": "karma start karma.conf.js --reporters mocha,coverage --single-run --component", "test-browser": "karma start karma.conf.js --reporters kjhtml --component", "coverage": "npm run test && wsrv -o -p 9875 ./coverage/report", - "prepublish" : "npm run test" + "prepublish" : "npm run build" }, "main": "bundles/ng2-alfresco-webscript.js", "repository": { diff --git a/scripts/README.md b/scripts/README.md index ef45012557..e381dbc0cc 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -38,12 +38,43 @@ feel for what's available. ```sh ./start.sh -update or -u +`` + +* Install a different version of the ng2-components specified in the package.json his option is not compatible with -d + +```sh +./start.sh -version or -v COMPONENTS_VERSION + +./start.sh -v 1.4.0 ``` * Start the demo in development mode building the relative folder ng2-components with all the components and pointing to this component instead to the node_modules one ```sh -./start.sh -develop -d +./start.sh -develop or -d +``` + +* Start the demo start the demo shell in dist mode + +```sh +./start.sh -dist +``` + +* If you want start the demo shell using an alfresco-js-api referenced by commit-ish version of the JS-API + +```sh +./start.sh -gitjsapi commit-ish + +./start.sh -gitjsapi development + +./start.sh -gitjsapi de92be966e2ce7eca642ca9e9d7647ba4f849356 +``` + +* If you want start the alfresco-js-api against a commit-ish version of the JS-API + +```sh +./start.sh -vjsapi 1.4.0 + ``` * If you want to build all your local component: @@ -55,13 +86,23 @@ feel for what's available. * If you want to build all your local component and run the test: ```sh -./npm-buid-alll.sh -t or -test +./npm-buid-all.sh -t or -test ``` * If you want clean the ng2-components folder node_modules before to build ```sh -./npm-buid-alll.sh -c +./npm-buid-all.sh -c +```* + +If you want build to build all the components against a commit-ish version of the JS-API + +```sh + ./npm-buid-all.sh -gitjsapi commit-ish + + ./npm-build-all.sh -gitjsapi development + + ./npm-build-all.sh -gitjsapi de92be966e2ce7eca642ca9e9d7647ba4f849356 ``` * If you want clean all your local component and the demo shell: diff --git a/scripts/npm-build-all.sh b/scripts/npm-build-all.sh index 396202dfed..c4c5a7370c 100755 --- a/scripts/npm-build-all.sh +++ b/scripts/npm-build-all.sh @@ -3,6 +3,8 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" eval RUN_TEST=false eval EXEC_CLEAN=false +eval EXEC_GIT_NPM_INSTALL_JSAPI=false +eval GIT_ISH="" eval projects=( "ng2-alfresco-core" "ng2-alfresco-datatable" @@ -21,11 +23,13 @@ eval projects=( "ng2-alfresco-core" "ng2-alfresco-viewer" "ng2-alfresco-webscript" "ng2-alfresco-userinfo" ) + show_help() { echo "Usage: npm-build-all.sh" echo "" echo "-t or -test build all your local component and run also the test on them" - echo "-c or -clean the ndode_moduels folder before to start the build" + echo "-c or -clean the node_modules folder before to start the build" + echo "-gitjsapi to build all the components against a commit-ish version of the JS-API" } enable_test(){ @@ -37,6 +41,11 @@ test_project() { npm run test -- --component $1 || exit 1 } +enable_js_api_git_link() { + GIT_ISH='git://github.com/Alfresco/alfresco-js-api.git#'$1 + EXEC_GIT_NPM_INSTALL_JSAPI=true +} + clean() { EXEC_CLEAN=true } @@ -45,6 +54,8 @@ while [[ $1 == -* ]]; do case "$1" in -h|--help|-\?) show_help; exit 0;; -t|--test) enable_test; shift;; + -gitjsapi) enable_js_api_git_link $2; shift 2;; + -v|--version) install_version_pacakge $2; shift 2;; -c|--clean) clean; shift;; -*) echo "invalid option: $1" 1>&2; show_help; exit 1;; esac @@ -65,6 +76,14 @@ npm run pkg-build echo "====== Install ng2-components dependencies =====" npm install +if $EXEC_GIT_NPM_INSTALL_JSAPI == true; then + echo "====== Use the alfresco JS-API '$GIT_ISH'=====" + npm install $GIT_ISH + cd "$DIR/../ng2-components/node_modules/alfresco-js-api" + npm install + cd "$DIR/../ng2-components/" +fi + echo "====== Build ng2-components =====" npm run build || exit 1 diff --git a/scripts/npm-publish.sh b/scripts/npm-publish.sh index 5a9f523a2f..df2de00a66 100755 --- a/scripts/npm-publish.sh +++ b/scripts/npm-publish.sh @@ -3,7 +3,9 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" eval FORCE_PUBLISH=false -eval NPM_REGISTRY="" +eval EXEC_CHANGE_REGISTRY=false +eval NPM_REGISTRY=false +eval TOKEN_REGISTRY="" eval OPTIONS="" cd "$DIR/../demo-shell-ng2" @@ -13,6 +15,7 @@ show_help() { echo "" echo "-f or -force publish the package with force" echo "-r or -registry to publish in an alternative npm registry -registry 'http://npm.local.me:8080/' " + echo "-token auth token for publish in the npm registry" echo "-t or -tag to add a tag when publish a package" } @@ -20,6 +23,21 @@ enable_force(){ OPTIONS="$OPTIONS -force" } +enable_change_registry(){ + NPM_REGISTRY=$1 + EXEC_CHANGE_REGISTRY=true +} + +get_token_registry(){ + TOKEN_REGISTRY=$1 + + if [[ "${TOKEN_REGISTRY}" == "" ]] + then + echo "token missing -token" + exit 0 + fi +} + add_tag(){ eval TAG=$1 @@ -34,8 +52,6 @@ add_tag(){ } change_registry(){ - NPM_REGISTRY=$1 - if [[ "${NPM_REGISTRY}" == "" ]] then echo "NPM registry required WITH OPTION -r | -registry" @@ -43,7 +59,10 @@ change_registry(){ fi echo "====== CHANGE REGISTRY: ${NPM_REGISTRY} =====" - npm config set registry ${NPM_REGISTRY} + touch .npmrc + echo 'strict-ssl=false' >> .npmrc + echo 'registry=http://'${NPM_REGISTRY} >> .npmrc + echo '//'${NPM_REGISTRY}'/:_authToken="'${TOKEN_REGISTRY}'"' >> .npmrc } while [[ $1 == -* ]]; do @@ -51,7 +70,7 @@ while [[ $1 == -* ]]; do -h|--help|-\?) show_help; exit 0;; -t|--tag) add_tag $2; shift 2;; -f|--force) enable_force; shift;; - -r|--registry) change_registry $2; shift 2;; + -r|--registry) get_token_registry $2; shift 2;; -*) echo "invalid option: $1" 1>&2; show_help; exit 0;; esac done @@ -75,10 +94,23 @@ for PACKAGE in \ ng2-alfresco-userinfo do DESTDIR="$DIR/../ng2-components/${PACKAGE}" - echo "====== PUBLISHING: ${DESTDIR} ===== npm publish ${OPTIONS}" + echo "====== MOVE DIR: ${DESTDIR} ===== " cd ${DESTDIR} + echo "====== INSTALL AND CLEAN ===== " + npm install rimraf npm run clean npm install + + if $EXEC_CHANGE_REGISTRY == true; then + change_registry + fi + + echo "====== PUBLISHING: ${DESTDIR} ===== npm publish ${OPTIONS}" npm publish ${OPTIONS} + + if $EXEC_CHANGE_REGISTRY == true; then + npm run rimraf .npmrc + fi + cd ${DIR} done diff --git a/scripts/start.sh b/scripts/start.sh index 9b8625f256..ea6e0a84d1 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -6,15 +6,44 @@ eval EXEC_INSTALL=false eval EXEC_UPDATE=false eval EXEC_CLEAN=false eval EXEC_DEVELOP=false +eval EXEC_VERSION=false +eval ENABLE_DIST=false +eval EXEC_GIT_NPM_INSTALL_JSAPI=false +eval EXEC_VERSION_JSAPI=false +eval JSAPI_VERSION="" +eval NG2_COMPONENTS_VERSION="" +eval GIT_ISH="" + +eval projects=( "ng2-alfresco-core" + "ng2-alfresco-datatable" + "ng2-activiti-diagrams" + "ng2-activiti-analytics" + "ng2-activiti-form" + "ng2-activiti-tasklist" + "ng2-activiti-processlist" + "ng2-alfresco-documentlist" + "ng2-alfresco-login" + "ng2-alfresco-search" + "ng2-alfresco-social" + "ng2-alfresco-tag" + "ng2-alfresco-social" + "ng2-alfresco-upload" + "ng2-alfresco-viewer" + "ng2-alfresco-webscript" + "ng2-alfresco-userinfo" ) show_help() { echo "Usage: start.sh" echo "" echo "-d or -develop start the demo shell using the relative ng2-components folder to link the components" + echo "-dist start the demo shell in dist mode" echo "-i or -install start the demo shell and install the dependencies" echo "-u or -update start the demo shell and update the dependencies" + echo "-v or -version install different version of ng2_components from npm defined in the package.json this option is not compatible with -d" echo "-c or -clean clean the demo shell and reinstall the dependencies" echo "-r or -registry to download the packages from an alternative npm registry example -registry 'http://npm.local.me:8080/' " + echo "-gitjsapi to build all the components against a commit-ish version of the JS-API" + echo "-vjsapi install different version from npm of JS-API defined in the package.json" } install() { @@ -29,6 +58,39 @@ develop() { EXEC_DEVELOP=true } +enable_dist() { + ENABLE_DIST=true +} + +enable_js_api_git_link() { + GIT_ISH='git://github.com/Alfresco/alfresco-js-api.git#'$1 + EXEC_GIT_NPM_INSTALL_JSAPI=true +} + +version_component() { + NG2_COMPONENTS_VERSION=$1 + + if [[ "${NG2_COMPONENTS_VERSION}" == "" ]] + then + echo "NG2 components version required with -v | -version" + exit 0 + fi + + EXEC_VERSION=true +} + +version_js_api() { + JSAPI_VERSION=$1 + + if [[ "${JSAPI_VERSION}" == "" ]] + then + echo "JSAPI version required with -vJSApi" + exit 0 + fi + + EXEC_VERSION_JSAPI=true +} + change_registry(){ NPM_REGISTRY=$1 @@ -55,6 +117,10 @@ while [[ $1 == -* ]]; do -c|--clean) clean; shift;; -d|--develop) develop; shift;; -r|--registry) change_registry $2; shift 2;; + -r|--version) version_component $2; shift 2;; + -dist) enable_dist; shift;; + -gitjsapi) enable_js_api_git_link $2; shift 2;; + -vjsapi) version_js_api $2; shift 2;; -*) shift;; esac done @@ -78,21 +144,71 @@ if $EXEC_INSTALL == true; then npm install fi -if $EXEC_UPDATE == true; then - echo "====== Update Demo shell =====" +if $EXEC_INSTALL == true; then + echo "====== Install Demo shell =====" cd "$DIR/../demo-shell-ng2" - npm update + npm install +fi + +if $EXEC_VERSION == true; then + echo "====== Install version "${NG2_COMPONENTS_VERSION}" of ng2-components =====" + cd "$DIR/../demo-shell-ng2" + + if [[ "${EXEC_DEVELOP}" == "" ]] + then + echo "Option -v is not compatible with -d see the help" + exit 0 + fi + + for PACKAGE in ${projects[@]} + do + npm install ${PACKAGE}@${NG2_COMPONENTS_VERSION} + done +fi + +if $EXEC_GIT_NPM_INSTALL_JSAPI == true; then + echo "====== Use the alfresco JS-API '$GIT_ISH'=====" + npm install $GIT_ISH + cd "$DIR/../ng2-components/node_modules/alfresco-js-api" + npm install + cd "$DIR/../ng2-components/" +fi + +if $EXEC_GIT_NPM_INSTALL_JSAPI == true; then + echo "====== Use the alfresco JS-API '$GIT_ISH'=====" + npm install $GIT_ISH + cd "$DIR/../ng2-components/node_modules/alfresco-js-api" + npm install +fi + +if $EXEC_VERSION_JSAPI == true; then + echo "====== Use the alfresco JS-API '$JSAPI_VERSION'=====" + cd "$DIR/../demo-shell-ng2" + npm install alfresco-js-api@${JSAPI_VERSION} fi if $EXEC_DEVELOP == true; then - echo "====== Start Demo shell development mode=====" cd "$DIR/../demo-shell-ng2" - npm run start:dev + if $ENABLE_DIST == true; then + echo "====== Build and start dist Demo shell =====" + npm run build:dev + npm run start:dist + else + echo "====== Start Demo shell =====" + npm run start:dev + fi +else + cd "$DIR/../demo-shell-ng2" + + if $ENABLE_DIST == true; then + echo "====== Build and start dist Demo shell =====" + npm run build + npm run start:dist + else + echo "====== Start Demo shell dev mode=====" + npm run start + fi + fi -if $EXEC_DEVELOP == false; then - echo "====== Start Demo shell =====" - cd "$DIR/../demo-shell-ng2" - npm run start -fi