mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
move tslint ADF rules in principal repo (#3247)
* move tslint ADF rules in principal repo * fix style issues * change pacakge.json position * update to angular cli 6.0.0 * reorganization package.json * remove node modules2 folder * exclude integration * rollback alfresco-js-api * solve types problems * fix pdf test * fix errors and exclude two tests * fix e2e * fix test * copy all the new packages in node_modules * fix test * fix packaging script * scss issue fix * move test export in tools
This commit is contained in:
@@ -207,44 +207,6 @@ The default behaviour of the ***npm-build-all.sh*** install node_modules and bui
|
||||
|
||||
For development environment configuration please refer to [project docs](../demo-shell/README.md).
|
||||
|
||||
|
||||
# npm-relock-pkgs.sh
|
||||
|
||||
***npm-relock-pkgs.sh*** Deletes and regenerates package-lock.json files for each|passed components, depending on the component's actual package.json
|
||||
|
||||
## Options
|
||||
|
||||
| Option | Description |
|
||||
| --- | --- |
|
||||
| -h or --help | show the help |
|
||||
| -t or --test | run the test suites after "npm install" of each component
|
||||
|
||||
## Examples
|
||||
|
||||
* Regenerate package-lock.json files for every package
|
||||
|
||||
```sh
|
||||
./npm-relock-pkgs.sh
|
||||
```
|
||||
|
||||
* Regenerate package-lock.json files for ng2-alfresco-core and ng2-alfresco-search components
|
||||
|
||||
```sh
|
||||
./npm-relock-pkgs.sh ng2-alfresco-core ng2-alfresco-search
|
||||
```
|
||||
|
||||
* Regenerate package-lock.json files for every package and run test suites for them
|
||||
|
||||
```sh
|
||||
./npm-relock-pkgs.sh -t
|
||||
```
|
||||
|
||||
* Regenerate package-lock.json files for for ng2-alfresco-core and ng2-alfresco-search components and run test suites for them
|
||||
|
||||
```sh
|
||||
./npm-relock-pkgs.sh -t ng2-alfresco-core ng2-alfresco-search
|
||||
```
|
||||
|
||||
# npm-clean.sh
|
||||
|
||||
***npm-clean.sh*** clean all the projects folders : lib and demo-shell.
|
||||
@@ -341,24 +303,6 @@ This script test that the update from 2.0.0 to 2.x.x is still smooth
|
||||
./test-e2e-bc
|
||||
```
|
||||
|
||||
***update-project.sh***
|
||||
|
||||
Update an external project and create a PR with last beta of ADF
|
||||
|
||||
## Options
|
||||
|
||||
| Option | Description |
|
||||
| --- | --- |
|
||||
| -n or --name | name of the project |
|
||||
| -gnu | for linux machine |
|
||||
| -t or --token | GITHUB token |
|
||||
|
||||
## Examples
|
||||
|
||||
```sh
|
||||
./update-project.sh -t YOUR_GITHUB_TOKEN -n NAME_PROJECT
|
||||
```
|
||||
|
||||
# test-e2e-bc.sh
|
||||
|
||||
***test-e2e-bc.sh***
|
||||
@@ -413,4 +357,4 @@ Internal script for update the rancher env
|
||||
|
||||
```sh
|
||||
/rancher-update.sh --access_key ACCESS_KEY --secret_key SECRET_KEY --url RANCHER_URL--environment_name adf-master --image docker:alfresco/demo-shell:master
|
||||
```
|
||||
```
|
||||
|
62
scripts/ng-packagr.sh
Executable file
62
scripts/ng-packagr.sh
Executable file
@@ -0,0 +1,62 @@
|
||||
#!/usr/bin/env bash
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
cd $DIR/..
|
||||
|
||||
echo "====== lint ====="
|
||||
|
||||
npm run lint-lib
|
||||
|
||||
echo "====== clean ====="
|
||||
|
||||
rm -rf node_modules/@alfresco
|
||||
|
||||
echo "====== Build lib ====="
|
||||
|
||||
npm run ng-packagr -- -p ./lib/core/package.json
|
||||
mkdir -p ./node_modules/@alfresco/adf-core/
|
||||
cp -R ./lib/dist/core/* ./node_modules/@alfresco/adf-core/
|
||||
|
||||
npm run ng-packagr -- -p ./lib/content-services/package.json
|
||||
mkdir -p ./node_modules/@alfresco/adf-content-services/
|
||||
cp -R ./lib/dist/content-services/* ./node_modules/@alfresco/adf-content-services/
|
||||
|
||||
npm run ng-packagr -- -p ./lib/process-services/package.json
|
||||
mkdir -p ./node_modules/@alfresco/adf-process-services/
|
||||
cp -R ./lib/dist/process-services/* ./node_modules/@alfresco/adf-process-services/
|
||||
|
||||
npm run ng-packagr -- -p ./lib/insights/package.json
|
||||
mkdir -p ./node_modules/@alfresco/adf-insights/
|
||||
cp -R ./lib/dist/insights/* ./node_modules/@alfresco/adf-insights/
|
||||
|
||||
echo "====== Build style ====="
|
||||
|
||||
node ./lib/config/bundle-scss.js
|
||||
|
||||
npm run webpack -- --config ./lib/config/webpack.style.js --progress --profile --bail
|
||||
|
||||
echo "====== Copy i18n ====="
|
||||
|
||||
mkdir -p ./lib/dist/core/bundles/assets/adf-core/i18n
|
||||
cp -R ./lib/core/i18n/* ./lib/dist/core/bundles/assets/adf-core/i18n
|
||||
|
||||
mkdir -p ./lib/dist/content-services/bundles/assets/adf-content-services/i18n
|
||||
cp -R ./lib/content-services/i18n/* ./lib/dist/content-services/bundles/assets/adf-content-services/i18n
|
||||
|
||||
mkdir -p ./lib/dist/process-services/bundles/assets/adf-process-services/i18n
|
||||
cp -R ./lib/process-services/i18n/* ./lib/dist/process-services/bundles/assets/adf-process-services/i18n
|
||||
|
||||
mkdir -p ./lib/dist/insights/bundles/assets/adf-insights/i18n
|
||||
cp -R ./lib/insights/i18n/* ./lib/dist/insights/bundles/assets/adf-insights/i18n
|
||||
|
||||
echo "====== Copy assets ====="
|
||||
|
||||
cp -R ./lib/core/assets/* ./lib/dist/core/bundles/assets
|
||||
cp -R ./lib/content-services/assets/* ./lib/dist/content-services/bundles/assets
|
||||
cp -R ./lib/process-services/assets/* ./lib/dist/process-services/bundles/assets
|
||||
|
||||
echo "====== Copy schema ====="
|
||||
|
||||
cp ./lib/core/app-config/schema.json ./lib/dist/core/app.config.schema.json
|
||||
|
||||
npm run bundlesize-check
|
@@ -55,12 +55,12 @@ enable_testbrowser(){
|
||||
|
||||
test_project() {
|
||||
echo "====== test project: $1 ====="
|
||||
npm run test -- --component $1 --mode coverage || exit 1
|
||||
npm run test-lib -- --component $1 --mode coverage || exit 1
|
||||
}
|
||||
|
||||
debug_project() {
|
||||
echo "====== debug project: $1 ====="
|
||||
npm run test-browser -- --component $1 || exit 1
|
||||
npm run test-lib-browser -- --component $1 || exit 1
|
||||
}
|
||||
|
||||
enable_fast_test() {
|
||||
@@ -116,7 +116,7 @@ while [[ $1 == -* ]]; do
|
||||
esac
|
||||
done
|
||||
|
||||
cd "$DIR/../lib/"
|
||||
cd "$DIR/../"
|
||||
|
||||
if $EXEC_CLEAN == true; then
|
||||
echo "====== Clean components ====="
|
||||
@@ -132,9 +132,9 @@ fi
|
||||
if $EXEC_GIT_NPM_INSTALL_JSAPI == true; then
|
||||
echo "====== Use the alfresco JS-API '$GIT_ISH'====="
|
||||
npm install $GIT_ISH --no-save
|
||||
cd "$DIR/../lib/node_modules/alfresco-js-api"
|
||||
cd "$DIR/../node_modules/alfresco-js-api"
|
||||
npm install
|
||||
cd "$DIR/../lib/"
|
||||
cd "$DIR/../"
|
||||
fi
|
||||
|
||||
if $EXEC_VERSION_JSAPI == true; then
|
||||
@@ -144,19 +144,17 @@ fi
|
||||
|
||||
if $EXEC_BUILD == true; then
|
||||
echo "====== Build components ====="
|
||||
npm run build || exit 1
|
||||
npm run build-lib || exit 1
|
||||
fi
|
||||
|
||||
if $EXEC_FAST_TEST == true; then
|
||||
echo "====== Test all components (fast option) ====="
|
||||
npm run test || exit 1
|
||||
npm run test-lib || exit 1
|
||||
fi
|
||||
|
||||
if $RUN_TEST == true; then
|
||||
DESTDIR="$DIR/../lib/"
|
||||
cd $DESTDIR
|
||||
if $EXEC_SINGLE_TEST == true; then
|
||||
cp -n "$DESTDIR/config/karma-test-shim.js" "$DESTDIR/$SINGLE_TEST/"
|
||||
cp -n "$DIR/../lib/config/karma-test-shim.js" "$DIR/../lib/$SINGLE_TEST/"
|
||||
test_project $SINGLE_TEST
|
||||
else
|
||||
for PACKAGE in ${projects[@]}
|
||||
@@ -167,10 +165,8 @@ if $RUN_TEST == true; then
|
||||
fi
|
||||
|
||||
if $RUN_TESTBROWSER == true; then
|
||||
DESTDIR="$DIR/../lib/"
|
||||
cd $DESTDIR
|
||||
if $EXEC_SINGLE_TEST == true; then
|
||||
cp -n "$DESTDIR/config/karma-test-shim.js" "$DESTDIR/$SINGLE_TEST/"
|
||||
cp -n "$DIR/../lib/config/karma-test-shim.js" "$DIR/../lib/$SINGLE_TEST/"
|
||||
debug_project $SINGLE_TEST
|
||||
else
|
||||
for PACKAGE in ${projects[@]}
|
||||
|
@@ -18,11 +18,7 @@ done
|
||||
|
||||
npm install rimraf
|
||||
|
||||
cd "$DIR/../demo-shell"
|
||||
npm run clean-lock
|
||||
npm run clean
|
||||
|
||||
cd "$DIR/../lib"
|
||||
cd "$DIR/../"
|
||||
npm run clean-lock
|
||||
npm run clean
|
||||
|
||||
|
@@ -22,7 +22,7 @@ eval projects=(
|
||||
"content-services"
|
||||
"process-services" )
|
||||
|
||||
cd "$DIR/../lib"
|
||||
cd "$DIR/../"
|
||||
|
||||
show_help() {
|
||||
echo "Usage: npm-publish.sh"
|
||||
|
@@ -1,75 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -f
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
eval RUN_TEST=false
|
||||
eval SELECTED_UNITS=""
|
||||
eval SELECTED_UNITS_ONLY=false
|
||||
|
||||
eval projects=( "core"
|
||||
"content-services"
|
||||
"process-services" )
|
||||
|
||||
show_help() {
|
||||
echo "Usage: npm-relock-pkgs.sh [options] [packages...]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo "-t or -test run the test suites for every package after npm install"
|
||||
}
|
||||
|
||||
enable_test(){
|
||||
RUN_TEST=true
|
||||
}
|
||||
|
||||
test_project() {
|
||||
echo "====== test project: $1 ====="
|
||||
npm run test -- --component $1 || exit 1
|
||||
}
|
||||
|
||||
while [[ $1 == -* ]]; do
|
||||
case "$1" in
|
||||
-h|--help|-\?) show_help; exit 0;;
|
||||
-t|--test) enable_test $2; shift;;
|
||||
-*) echo "invalid option: $1" 1>&2; show_help; exit 1;;
|
||||
esac
|
||||
done
|
||||
|
||||
npm install rimraf -g
|
||||
|
||||
for PACKAGE in "$@"
|
||||
do
|
||||
SELECTED_UNITS="$SELECTED_UNITS \"$PACKAGE\""
|
||||
SELECTED_UNITS_ONLY=true
|
||||
done
|
||||
|
||||
if $SELECTED_UNITS_ONLY == true; then
|
||||
eval projects=($SELECTED_UNITS)
|
||||
fi
|
||||
|
||||
echo "====== Regenerate package-lock.json ====="
|
||||
for PACKAGE in ${projects[@]}
|
||||
do
|
||||
echo "====== $PACKAGE ====="
|
||||
DESTDIR="$DIR/../lib/$PACKAGE"
|
||||
cd $DESTDIR
|
||||
|
||||
npm run clean-lock
|
||||
npm run clean
|
||||
npm install
|
||||
|
||||
if $RUN_TEST == true; then
|
||||
test_project $PACKAGE
|
||||
fi
|
||||
done
|
||||
|
||||
cd "$DIR/../demo-shell"
|
||||
npm run clean-lock
|
||||
npm run clean
|
||||
npm install
|
||||
|
||||
cd "$DIR/../lib"
|
||||
npm run clean-lock
|
||||
npm run clean
|
||||
npm install
|
||||
|
||||
cd ${DIR}
|
@@ -132,7 +132,7 @@ while [[ $1 == -* ]]; do
|
||||
esac
|
||||
done
|
||||
|
||||
cd "$DIR/../demo-shell"
|
||||
cd "$DIR/.."
|
||||
|
||||
if $EXEC_CLEAN == true; then
|
||||
echo "====== Clean Demo shell ====="
|
||||
@@ -145,13 +145,6 @@ if $EXEC_INSTALL == true; then
|
||||
npm install
|
||||
fi
|
||||
|
||||
if $EXEC_DEVELOP == true; then
|
||||
echo "====== Install node_modules components ====="
|
||||
cd "$DIR/../lib"
|
||||
npm install
|
||||
cd "$DIR/../demo-shell"
|
||||
fi
|
||||
|
||||
if $EXEC_VERSION == true; then
|
||||
echo "====== Install version "${NG2_COMPONENTS_VERSION}" of components ====="
|
||||
|
||||
@@ -172,29 +165,16 @@ if $EXEC_GIT_NPM_INSTALL_JSAPI == true; then
|
||||
npm install $GIT_ISH --no-save
|
||||
cd "$DIR/../demo-shell/node_modules/alfresco-js-api"
|
||||
npm install
|
||||
if $EXEC_DEVELOP == true; then
|
||||
cd "$DIR/../lib/"
|
||||
npm install $GIT_ISH --no-save
|
||||
cd "$DIR/../lib/node_modules/alfresco-js-api"
|
||||
npm install
|
||||
fi
|
||||
cd "$DIR/../demo-shell"
|
||||
fi
|
||||
|
||||
if $EXEC_VERSION_JSAPI == true; then
|
||||
echo "====== Use the alfresco JS-API '$JSAPI_VERSION'====="
|
||||
npm install alfresco-js-api@${JSAPI_VERSION}
|
||||
if $EXEC_DEVELOP == true; then
|
||||
echo "====== Install node_modules components ====="
|
||||
cd "$DIR/../lib/"
|
||||
npm install alfresco-js-api@${JSAPI_VERSION} --no-save
|
||||
fi
|
||||
cd "$DIR/../demo-shell"
|
||||
fi
|
||||
|
||||
if $EXEC_TEST == true; then
|
||||
echo "====== Demo shell Test ====="
|
||||
npm install && npm run test
|
||||
npm run test
|
||||
fi
|
||||
|
||||
if $EXEC_E2E == true; then
|
||||
|
@@ -2,14 +2,9 @@
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
echo "====== Install demo-shell ===== "
|
||||
|
||||
cd $DIR/../demo-shell
|
||||
npm install
|
||||
|
||||
echo "====== Install lib ===== "
|
||||
|
||||
cd $DIR/../lib
|
||||
cd $DIR/../
|
||||
npm install
|
||||
|
||||
echo "====== Install JS-API alpha ===== "
|
||||
@@ -18,25 +13,24 @@ npm install alfresco-js-api@alpha
|
||||
|
||||
echo "====== Build ADF ===== "
|
||||
|
||||
npm run build
|
||||
npm run build-lib
|
||||
|
||||
echo "====== COPY new build in demo shell node_modules ===== "
|
||||
echo "====== COPY new build in node_modules ===== "
|
||||
|
||||
rm -rf ../demo-shell/node_modules/@alfresco
|
||||
rm -rf ../node_modules/@alfresco
|
||||
|
||||
mkdir -p $DIR/../demo-shell/node_modules/@alfresco/adf-core
|
||||
mkdir -p $DIR/../demo-shell/node_modules/@alfresco/adf-content-services
|
||||
mkdir -p $DIR/../demo-shell/node_modules/@alfresco/adf-process-services
|
||||
mkdir -p $DIR/../demo-shell/node_modules/@alfresco/adf-insights
|
||||
mkdir -p $DIR/../node_modules/@alfresco/adf-core
|
||||
mkdir -p $DIR/../node_modules/@alfresco/adf-content-services
|
||||
mkdir -p $DIR/../node_modules/@alfresco/adf-process-services
|
||||
mkdir -p $DIR/../node_modules/@alfresco/adf-insights
|
||||
|
||||
cp -R $DIR/../lib/dist/core/* $DIR/../demo-shell/node_modules/@alfresco/adf-core
|
||||
cp -R $DIR/../lib/dist/content-services/* $DIR/../demo-shell/node_modules/@alfresco/adf-content-services
|
||||
cp -R $DIR/../lib/dist/process-services/* $DIR/../demo-shell/node_modules/@alfresco/adf-process-services
|
||||
cp -R $DIR/../lib/dist/insights/* $DIR/../demo-shell/node_modules/@alfresco/adf-insights
|
||||
cp -R $DIR/../lib/dist/core/* $DIR/..//node_modules/@alfresco/adf-core
|
||||
cp -R $DIR/../lib/dist/content-services/* $DIR/../node_modules/@alfresco/adf-content-services
|
||||
cp -R $DIR/../lib/dist/process-services/* $DIR/../node_modules/@alfresco/adf-process-services
|
||||
cp -R $DIR/../lib/dist/insights/* $DIR/../node_modules/@alfresco/adf-insights
|
||||
|
||||
echo "====== Build dist demo shell ===== "
|
||||
|
||||
cd $DIR/../demo-shell
|
||||
npm run build:dist
|
||||
|
||||
echo "====== e2e test ===== "
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
rm -rf "$DIR/../lib/node_modules/@angular"
|
||||
rm -rf "$DIR/../node_modules/@angular"
|
||||
cd "$DIR/../integration/base_ver_2_app"
|
||||
|
||||
ADF_VERSION=$(npm view @alfresco/adf-core version)
|
||||
|
@@ -1,61 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
eval GNU=false
|
||||
|
||||
set -e
|
||||
TEMP_GENERATOR_DIR=".tmp-generator";
|
||||
VERSION=$(npm view @alfresco/adf-core@beta version)
|
||||
|
||||
show_help() {
|
||||
echo "Usage: update-generator.sh"
|
||||
echo ""
|
||||
echo "-t or --token Github ouath token"
|
||||
echo "-n or --name Github name of the project"
|
||||
echo "-gnu for gnu"
|
||||
}
|
||||
|
||||
gnu_mode() {
|
||||
echo "====== GNU MODE ====="
|
||||
GNU=true
|
||||
}
|
||||
|
||||
token() {
|
||||
TOKEN=$1
|
||||
}
|
||||
|
||||
name_repo() {
|
||||
NAME_REPO=$1
|
||||
}
|
||||
|
||||
while [[ $1 == -* ]]; do
|
||||
case "$1" in
|
||||
-h|--help|-\?) show_help; exit 0;;
|
||||
-n|--name|-\?) name_repo $2; shift 2;;
|
||||
-gnu) gnu_mode; shift;;
|
||||
-t|--token) token $2; shift 2;;
|
||||
-*) echo "invalid option: $1" 1>&2; show_help; exit 1;;
|
||||
esac
|
||||
done
|
||||
|
||||
rm -rf $TEMP_GENERATOR_DIR;
|
||||
|
||||
git clone https://$TOKEN@github.com/Alfresco/$NAME_REPO.git $TEMP_GENERATOR_DIR
|
||||
cd $TEMP_GENERATOR_DIR
|
||||
git checkout development
|
||||
|
||||
BRANCH="generator-update-beta-$VERSION"
|
||||
git checkout -b $BRANCH
|
||||
|
||||
if $GNU; then
|
||||
./scripts/update-version.sh -gnu -v $VERSION
|
||||
else
|
||||
./scripts/update-version.sh -v $VERSION
|
||||
fi
|
||||
|
||||
git add .
|
||||
git commit -m "Update ADF packages version $VERSION"
|
||||
git push -u origin $BRANCH
|
||||
|
||||
curl -H "Authorization: token $TOKEN" -X POST -d '{"body":"Update ADF packages version '$VERSION'","head":"'$BRANCH'","base":"development","title":"Update ADF packages version '$VERSION'"}' https://api.github.com/repos/alfresco/$NAME_REPO/pulls
|
||||
|
||||
rm -rf $TEMP_GENERATOR_DIR;
|
@@ -99,24 +99,12 @@ version_js_change() {
|
||||
DIFFERENT_JS_API=true
|
||||
}
|
||||
|
||||
only_demoshell() {
|
||||
echo "====== UPDATE Only the demo shell versions ====="
|
||||
EXEC_COMPONENT=false
|
||||
}
|
||||
|
||||
|
||||
update_component_version() {
|
||||
echo "====== UPDATE PACKAGE VERSION of ${PACKAGE} to ${VERSION} version in all the package.json ======"
|
||||
DESTDIR="$DIR/../lib/${1}"
|
||||
sed "${sedi[@]}" "s/\"version\": \".*\"/\"version\": \"${VERSION}\"/g" ${DESTDIR}/package.json
|
||||
}
|
||||
|
||||
clean_lock() {
|
||||
echo "====== clean lock file ${1} ======"
|
||||
DESTDIR="$DIR/../lib/${1}"
|
||||
rm ${DESTDIR}/package-lock.json
|
||||
}
|
||||
|
||||
update_component_dependency_version(){
|
||||
DESTDIR="$DIR/../lib/${1}"
|
||||
|
||||
@@ -131,18 +119,6 @@ update_component_dependency_version(){
|
||||
done
|
||||
}
|
||||
|
||||
update_total_build_dependency_version(){
|
||||
DESTDIR="$DIR/../lib/"
|
||||
|
||||
for (( j=0; j<${projectslength}; j++ ));
|
||||
do
|
||||
echo "====== UPDATE TOTAL BUILD DEPENDENCY VERSION of .* to ~${VERSION} in ${1}======"
|
||||
sed "${sedi[@]}" "s/\"${prefix}${projects[$j]}\": \".*\"/\"${prefix}${projects[$j]}\": \"${VERSION}\"/g" ${DESTDIR}/package.json
|
||||
sed "${sedi[@]}" "s/\"${prefix}${projects[$j]}\": \"~.*\"/\"${prefix}${projects[$j]}\": \"~${VERSION}\"/g" ${DESTDIR}/package.json
|
||||
sed "${sedi[@]}" "s/\"${prefix}${projects[$j]}\": \"^.*\"/\"${prefix}${projects[$j]}\": \"^${VERSION}\"/g" ${DESTDIR}/package.json
|
||||
done
|
||||
}
|
||||
|
||||
update_total_build_dependency_js_version(){
|
||||
echo "====== UPDATE DEPENDENCY VERSION alfresco-js-api total build to ~${1} in ${DESTDIR}======"
|
||||
DESTDIR="$DIR/../lib/"
|
||||
@@ -153,24 +129,12 @@ update_total_build_dependency_js_version(){
|
||||
sed "${sedi[@]}" "s/\"${PACKAGETOCHANGE}\": \"^.*\"/\"${PACKAGETOCHANGE}\": \"${1}\"/g" ${DESTDIR}/package.json
|
||||
}
|
||||
|
||||
update_component_js_version(){
|
||||
echo "====== UPDATE DEPENDENCY VERSION of alfresco-js-api in ${1} to ${2} ======"
|
||||
DESTDIR="$DIR/../lib/${1}"
|
||||
|
||||
PACKAGETOCHANGE="alfresco-js-api"
|
||||
|
||||
sed "${sedi[@]}" "s/\"${PACKAGETOCHANGE}\": \".*\"/\"${PACKAGETOCHANGE}\": \"${2}\"/g" ${DESTDIR}/package.json
|
||||
sed "${sedi[@]}" "s/\"${PACKAGETOCHANGE}\": \"~.*\"/\"${PACKAGETOCHANGE}\": \"${2}\"/g" ${DESTDIR}/package.json
|
||||
sed "${sedi[@]}" "s/\"${PACKAGETOCHANGE}\": \"^.*\"/\"${PACKAGETOCHANGE}\": \"${2}\"/g" ${DESTDIR}/package.json
|
||||
|
||||
}
|
||||
|
||||
update_demo_shell_dependency_version(){
|
||||
update_dependency_version(){
|
||||
|
||||
for (( k=0; k<${projectslength}; k++ ));
|
||||
do
|
||||
echo "====== UPDATE VERSION OF DEMO-SHELL to ${projects[$k]} version ${VERSION} ======"
|
||||
DESTDIR="$DIR/../demo-shell/"
|
||||
echo "====== UPDATE ${projects[$k]} version ${VERSION} ======"
|
||||
DESTDIR="$DIR/.."
|
||||
|
||||
sed "${sedi[@]}" "s/\"${prefix}${projects[$k]}\": \".*\"/\"${prefix}${projects[$k]}\": \"${VERSION}\"/g" ${DESTDIR}/package.json
|
||||
sed "${sedi[@]}" "s/\"${prefix}${projects[$k]}\": \"~.*\"/\"${prefix}${projects[$k]}\": \"~${VERSION}\"/g" ${DESTDIR}/package.json
|
||||
@@ -178,9 +142,9 @@ update_demo_shell_dependency_version(){
|
||||
done
|
||||
}
|
||||
|
||||
update_demo_shell_js_version(){
|
||||
echo "====== UPDATE VERSION OF DEMO-SHELL to alfresco-js-api version ${1} ======"
|
||||
DESTDIR="$DIR/../demo-shell/"
|
||||
update_js_version(){
|
||||
echo "====== UPDATE VERSION alfresco-js-api version ${1} ======"
|
||||
DESTDIR="$DIR/../"
|
||||
PACKAGETOCHANGE="alfresco-js-api"
|
||||
|
||||
sed "${sedi[@]}" "s/\"${PACKAGETOCHANGE}\": \".*\"/\"${PACKAGETOCHANGE}\": \"${1}\"/g" ${DESTDIR}/package.json
|
||||
@@ -188,9 +152,9 @@ update_demo_shell_js_version(){
|
||||
sed "${sedi[@]}" "s/\"${PACKAGETOCHANGE}\": \"^.*\"/\"${PACKAGETOCHANGE}\": \"${1}\"/g" ${DESTDIR}/package.json
|
||||
}
|
||||
|
||||
clean_lock_demo_shell(){
|
||||
echo "====== clean lock file demo-shell ======"
|
||||
DESTDIR="$DIR/../demo-shell/"
|
||||
clean_lock(){
|
||||
echo "====== clean lock file ======"
|
||||
DESTDIR="$DIR/.."
|
||||
rm ${DESTDIR}/package-lock.json
|
||||
}
|
||||
|
||||
@@ -232,46 +196,30 @@ if $EXEC_COMPONENT == true; then
|
||||
# use for loop to read all values and indexes
|
||||
for (( i=0; i<${projectslength}; i++ ));
|
||||
do
|
||||
clean_lock ${projects[$i]}
|
||||
echo "====== UPDATE COMPONENT ${projects[$i]} ======"
|
||||
update_component_version ${projects[$i]}
|
||||
update_component_dependency_version ${projects[$i]}
|
||||
|
||||
if $JS_API == true; then
|
||||
|
||||
if $DIFFERENT_JS_API == true; then
|
||||
update_component_js_version ${projects[$i]} ${VERSION_JS_API}
|
||||
else
|
||||
update_component_js_version ${projects[$i]} ${VERSION}
|
||||
fi
|
||||
|
||||
fi
|
||||
done
|
||||
|
||||
echo "====== UPDATE TOTAL BUILD======"
|
||||
|
||||
update_total_build_dependency_version
|
||||
|
||||
if $JS_API == true; then
|
||||
if $DIFFERENT_JS_API == true; then
|
||||
update_total_build_dependency_js_version ${VERSION_JS_API}
|
||||
else
|
||||
update_total_build_dependency_js_version ${VERSION}
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "====== UPDATE DEMO SHELL ======"
|
||||
|
||||
clean_lock_demo_shell
|
||||
DESTDIR="$DIR/../demo-shell/"
|
||||
sed "${sedi[@]}" "s/\"version\": \".*\"/\"version\": \"${VERSION}\"/g" ${DIR}/../demo-shell/package.json
|
||||
|
||||
update_demo_shell_dependency_version
|
||||
|
||||
echo "====== UPDATE GLOBAL======"
|
||||
|
||||
clean_lock
|
||||
|
||||
update_dependency_version
|
||||
|
||||
if $JS_API == true; then
|
||||
if $DIFFERENT_JS_API == true; then
|
||||
update_demo_shell_js_version ${VERSION_JS_API}
|
||||
update_js_version ${VERSION_JS_API}
|
||||
else
|
||||
update_demo_shell_js_version ${VERSION}
|
||||
update_js_version ${VERSION}
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -279,6 +227,5 @@ DESTDIR="$DIR/../demo-shell/"
|
||||
sed "${sedi[@]}" "s/\"version\": \".*\"/\"version\": \"${VERSION}\"/g" ${DIR}/../demo-shell/package.json
|
||||
|
||||
if $EXEC_COMPONENT == true; then
|
||||
rm ${DIR}/../lib/package-lock.json
|
||||
sed "${sedi[@]}" "s/\"version\": \".*\"/\"version\": \"${VERSION}\"/g" ${DIR}/../lib/package.json
|
||||
fi
|
||||
|
Reference in New Issue
Block a user