👽 Angular 14 rebase 👽 (#7769)

* fix after rebase

* new release strategy for ng next

Signed-off-by: eromano <eugenioromano16@gmail.com>

* peer dep

Signed-off-by: eromano <eugenioromano16@gmail.com>

* Angular 14

fix unit test and storybook

Signed-off-by: eromano <eugenioromano16@gmail.com>

fix after rebase

Signed-off-by: eromano <eugenioromano16@gmail.com>

update pkg.json

Signed-off-by: eromano <eugenioromano16@gmail.com>

missing dep

Signed-off-by: eromano <eugenioromano16@gmail.com>

Fix mistake and missing code

Dream....build only affected libs

Add utility run commands

* Use nx command to run affected tests

* Fix nx test core

fix content tests

Run unit with watch false

core test fixes

reduce test warnings

Fix process cloud unit

Fix adf unit test

Fix lint process cloud

Disable lint next line

Use right core path

Fix insights unit

fix linting insights

Fix process-services unit

fix the extensions test report

fix test warnings

Fix content unit

Fix bunch of content unit

* Produce an adf alpha of 14

* hopefully fixing the content

* Push back the npm publish

* Remove flaky unit

* Fix linting

* Make the branch as root

* Get rid of angualar13

* Remove the travis depth

* Fixing version for npm

* Enabling cache for unit and build

* Fix scss for core and paths

Copy i18 and asset by using ng-packager

Export the theming alias and fix path

Use ng-package to copy assets process-services-cloud

Use ng-package to copy assets process-services

Use ng-package to copy assets content-services

Use ng-package to copy assets insights

* feat: fix api secondary entry point

* fix storybook rebase

* Move dist under dist/libs from lib/dist

* Fix the webstyle

* Use only necessary nrwl deps and improve lint

* Fix unit for libs

* Convert lint.sh to targets - improve performance

* Use latest of angular

* Align alfresco-js-api

Signed-off-by: eromano <eugenioromano16@gmail.com>
Co-authored-by: eromano <eugenioromano16@gmail.com>
Co-authored-by: Mikolaj Serwicki <mikolaj.serwicki@hyland.com>
Co-authored-by: Tomasz <tomasz.gnyp@hyland.com>
This commit is contained in:
Maurizio Vitale
2022-08-25 10:50:30 +01:00
committed by GitHub
parent 53bc5aab2c
commit 1fa81962a0
1351 changed files with 26853 additions and 11958 deletions

View File

@@ -3,32 +3,20 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR
cd ../../
rm -rf lib/dist
rm -rf dist/libs
echo "====== Run lib ====="
if [ "$CI" = "true" ]; then
echo "Building libs for production"
NODE_OPTIONS="--max-old-space-size=8192" $(npm bin)/nx affected:build --all --prod || exit 1
echo "Building libs for production with NX_FLAG $NX_CALCULATION_FLAGS"
NODE_OPTIONS="--max-old-space-size=8192" $(npm bin)/nx affected:build $NX_CALCULATION_FLAGS --prod --exclude=demoshell || exit 1
else
echo "Building libs for development"
NODE_OPTIONS="--max-old-space-size=8192" $(npm bin)/nx affected:build --all || exit 1
echo "Building libs for development with NX_FLAG $NX_CALCULATION_FLAGS"
NODE_OPTIONS="--max-old-space-size=8192" $(npm bin)/nx affected:build $NX_CALCULATION_FLAGS --exclude=demoshell || exit 1
fi
echo "====== run core ====="
./scripts/build/build-core.sh || exit 1
echo "====== Run content-services ====="
./scripts/build/build-content-services.sh || exit 1
echo "====== Run process-services ====="
./scripts/build/build-process-services.sh || exit 1
echo "====== Run insights ====="
./scripts/build/build-insights.sh || exit 1
echo "====== Run process-services-cloud ====="
./scripts/build/build-process-services-cloud.sh || exit 1
echo "====== Run testing ====="
./scripts/build/build-testing.sh || exit 1
@@ -36,5 +24,6 @@ echo "====== Run Cli ====="
./scripts/build/build-cli.sh || exit 1
echo "====== Copy schema ====="
cp lib/core/app-config/schema.json lib/dist/core/app.config.schema.json
cp lib/core/src/lib/app-config/schema.json dist/libs/core/app.config.schema.json

View File

@@ -7,10 +7,10 @@ cd $DIR/../../lib/cli/
echo "====== Cli ======"
cd $DIR/../../
cp -R ./lib/cli/dist lib/dist/cli/
cp ./lib/cli/README.md lib/dist/cli/README.md
cp -R ./lib/cli/dist dist/libs/cli/
cp ./lib/cli/README.md dist/libs/cli/README.md
echo "====== Cli Move to node_modules ======"
rm -rf ./node_modules/@alfresco/adf-cli/ && \
mkdir -p ./node_modules/@alfresco/adf-cli/ && \
cp -R ./lib/dist/cli/* ./node_modules/@alfresco/adf-cli/
cp -R ./dist/libs/cli/* ./node_modules/@alfresco/adf-cli/

View File

@@ -1,14 +0,0 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/../..
echo "====== Content Services ======"
echo "====== Copy i18n ======"
mkdir -p ./lib/dist/content-services/bundles/assets/adf-content-services/i18n
cp -R ./lib/content-services/src/lib/i18n/* ./lib/dist/content-services/bundles/assets/adf-content-services/i18n
echo "====== Copy assets ======"
cp -R ./lib/content-services/src/lib/assets/* ./lib/dist/content-services/bundles/assets

View File

@@ -6,16 +6,6 @@ cd $DIR/../..
echo "====== Core ======"
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
echo "====== Copy schema ======"
cp -R ./lib/core/app-config/schema.json lib/dist/core/app.config.schema.json
echo "====== Copy assets ======"
cp -R ./lib/core/assets/* ./lib/dist/core/bundles/assets
echo "====== Prebuilt Themes ====="
npm run webpack -- --config ./lib/config/webpack.style.js --progress --profile --bail
rm ./lib/dist/core/prebuilt-themes/*.js
rm ./dist/libs/core/lib/prebuilt-themes/*.js

View File

@@ -1,11 +0,0 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/../..
echo "====== Insights ======"
echo "====== Copy i18n ======"
mkdir -p ./lib/dist/insights/bundles/assets/adf-insights/i18n
cp -R ./lib/insights/src/lib/i18n/* ./lib/dist/insights/bundles/assets/adf-insights/i18n

View File

@@ -1,14 +0,0 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/../..
echo "====== Process Services Cloud ======"
echo "====== Copy i18n ======"
mkdir -p ./lib/dist/process-services-cloud/bundles/assets/adf-process-services-cloud/i18n
cp -R ./lib/process-services-cloud/src/lib/i18n/* ./lib/dist/process-services-cloud/bundles/assets/adf-process-services-cloud/i18n
echo "====== Copy assets ======"
cp -R ./lib/process-services-cloud/src/lib/assets/* ./lib/dist/process-services-cloud/bundles/assets

View File

@@ -1,14 +0,0 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/../..
echo "====== Process Services ======"
echo "====== Copy i18n ======"
mkdir -p ./lib/dist/process-services/bundles/assets/adf-process-services/i18n
cp -R ./lib/process-services/src/lib/i18n/* ./lib/dist/process-services/bundles/assets/adf-process-services/i18n
echo "====== Copy assets ======"
cp -R ./lib/process-services/src/lib/assets/* ./lib/dist/process-services/bundles/assets

View File

@@ -9,4 +9,4 @@ echo "====== Testing ======"
echo "====== Move to node_modules ======"
rm -rf ./node_modules/@alfresco/adf-testing/ && \
mkdir -p ./node_modules/@alfresco/adf-testing/ && \
cp -R ./lib/dist/testing/* ./node_modules/@alfresco/adf-testing/
cp -R ./dist/libs/testing/* ./node_modules/@alfresco/adf-testing/

View File

@@ -7,11 +7,11 @@
# =======================================
rm -rf ./node_modules/@alfresco/adf-cli/ && \
mkdir -p ./node_modules/@alfresco/adf-cli/ && \
cp -R ./lib/dist/cli/* ./node_modules/@alfresco/adf-cli/
cp -R ./dist/libs/cli/* ./node_modules/@alfresco/adf-cli/
rm -rf ./node_modules/@alfresco/adf-testing/ && \
mkdir -p ./node_modules/@alfresco/adf-testing/ && \
cp -R ./lib/dist/testing/* ./node_modules/@alfresco/adf-testing/
cp -R ./dist/libs/testing/* ./node_modules/@alfresco/adf-testing/
# =======================================
exit 0

View File

@@ -20,6 +20,41 @@ export HEAD_HASH="HEAD"
export HEAD_COMMIT_HASH=${TRAVIS_PULL_REQUEST_SHA:-${TRAVIS_COMMIT}}
export COMMIT_MESSAGE=`git log --format=%B -n 1 $HEAD_COMMIT_HASH`
#########################################################################################
# Settings based of Travis event type
#########################################################################################
if [ "${TRAVIS_EVENT_TYPE}" == "push" ]; then
# Settings for merges ---------------------------------------------------------------
if [[ "$TRAVIS_BRANCH" =~ ^master(-patch.*)?$ ]]; then
# into master(-patch*)
export NX_CALCULATION_FLAGS="--all"
export BUILD_OPTS="--configuration production"
elif [[ "$TRAVIS_BRANCH" =~ ^develop-patch.*$ ]]; then
# into develop-patch*
echo -e "\e[32mSetting up CI jobs for patch version creation.\e[0m"
export NX_CALCULATION_FLAGS="--all"
export BUILD_OPTS="--configuration production"
else
# into develop
export NX_CALCULATION_FLAGS="--base=$(git describe --tags `git rev-list --tags --max-count=1`) --head=$HEAD_HASH"
export BUILD_OPTS="--configuration production"
fi
elif [ "${TRAVIS_EVENT_TYPE}" == "pull_request" ]; then
# Settings for PRs ------------------------------------------------------------------
export NX_CALCULATION_FLAGS="--base=origin/$TRAVIS_BRANCH --head=$HEAD_HASH"
export BUILD_OPTS="--configuration production"
elif [ "${TRAVIS_EVENT_TYPE}" == "cron" ]; then
# Settings for Cron -----------------------------------------------------------------
export NX_CALCULATION_FLAGS="--all"
export BUILD_OPTS="--configuration production"
else
# Settings for API ------------------------------------------------------------------
export NX_CALCULATION_FLAGS="--all"
export BUILD_OPTS="--configuration production"
# In case of manual Travis run use the commit message from travis and not the one from git
COMMIT_MESSAGE=$TRAVIS_COMMIT_MESSAGE
fi
# Settings for S3 caching -------------------------------------------------------------
pip install --user awscli

View File

@@ -1,24 +0,0 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$DIR/../"
echo "Check envs"
if grep "envalfresco" . -R --exclude-dir={.angular,.lib,.coverage,node_modules,.history,.idea,scripts,dist,e2e-output,.git} --exclude={.env,.env.*}; then
echo not permitted word
exit 1
fi
echo "Lint"
nx affected:lint --parallel=5 --all || exit 1
echo "Style Lint"
npm run stylelint || exit 1
echo "Spell check"
npm run spellcheck || exit 1
echo "License check"
npm run license-checker || exit 1
npm run validate-config || exit 1

View File

@@ -23,14 +23,9 @@ then
fi
fi
if [[ $TRAVIS_BRANCH =~ angular-upgrade-v13 ]]
if [[ $TRAVIS_BRANCH =~ angular-14-rebase ]]
then
./scripts/update-version.sh -gnu -nextalpha -major || exit 1;
fi
if [[ $TRAVIS_BRANCH =~ angular-upgrade-v14 ]]
then
./scripts/update-version.sh -gnu -nextalpha -major || exit 1;
./scripts/update-version.sh -gnu -nextalpha || exit 1;
fi
node ./scripts/pre-publish.js

View File

@@ -72,7 +72,7 @@ if [ $PACKAGE == 'adf-testing' ]; then
fi
if [ $PACKAGE == 'adf-core' ]; then
if [ ! -f package/prebuilt-themes/'adf-blue-orange.css' ]; then
if [ ! -f package/lib/prebuilt-themes/'adf-blue-orange.css' ]; then
error_out '31;1' "$PACKAGE prebuilt-theme not found!" >&2
exit 1
else

View File

@@ -17,12 +17,7 @@ then
TAG_NPM=alpha
fi
if [[ $TRAVIS_BRANCH =~ angular-upgrade-v13 ]]
then
TAG_NPM=a13
fi
if [[ $TRAVIS_BRANCH =~ angular-upgrade-v14 ]]
if [[ $TRAVIS_BRANCH =~ angular-14-rebase ]]
then
TAG_NPM=a14
fi

View File

@@ -1,16 +0,0 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/../../../
AFFECTED_LIBS="$(nx affected:libs --base=$BASE_HASH --head=$HEAD_HASH --plain || exit 1)"
echo "================== AFFECTED_LIBS ${AFFECTED_LIBS} ==================="
echo "================== content-services unit ==================="
if [[ $AFFECTED_LIBS =~ "content-services" || "${TRAVIS_EVENT_TYPE}" == "cron" ]];
then
ng test content-services --watch=false || exit 1;
fi;

View File

@@ -1,24 +0,0 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/../../../
AFFECTED_LIBS="$(nx affected:libs --base=$BASE_HASH --head=$HEAD_HASH --plain || exit 1)"
echo "================== AFFECTED_LIBS ${AFFECTED_LIBS} ==================="
echo "================== core unit ==================="
if [[ $AFFECTED_LIBS =~ "core" || "${TRAVIS_EVENT_TYPE}" == "cron" ]];
then
ng test core --watch=false || exit 1;
fi;
echo "================== extensions unit ==================="
if [[ $AFFECTED_LIBS =~ "extensions" || "${TRAVIS_EVENT_TYPE}" == "cron" ]];
then
ng test extensions --watch=false || exit 1;
fi;

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
command="concurrently "
cd $DIR/../../../
AFFECTED_LIBS="$(nx affected:libs --base=$BASE_HASH --head=$HEAD_HASH --plain || exit 1)"
echo "================== AFFECTED_LIBS ${AFFECTED_LIBS} ==================="
echo "================== process-services-cloud unit ==================="
if [[ $AFFECTED_LIBS =~ "process-services-cloud" || "${TRAVIS_EVENT_TYPE}" == "cron" ]];
then
ng test process-services-cloud --watch=false || exit 1;
fi;

View File

@@ -1,24 +0,0 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
command="concurrently "
cd $DIR/../../../
AFFECTED_LIBS="$(nx affected:libs --base=$BASE_HASH --head=$HEAD_HASH --plain || exit 1)"
echo "================== AFFECTED_LIBS ${AFFECTED_LIBS} ==================="
echo "================== process-services unit ==================="
if [[ $AFFECTED_LIBS =~ "process-services" || "${TRAVIS_EVENT_TYPE}" == "cron" ]];
then
ng test process-services --watch=false || exit 1;
fi;
echo "================== insights unit ==================="
if [[ $AFFECTED_LIBS =~ "insights" || "${TRAVIS_EVENT_TYPE}" == "cron" ]];
then
ng test insights --watch=false || exit 1;
fi;