mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
[ADF-2514][ADF-2517][ADF-2143] Fix build isssues (#3097)
* fix remove angular folder problem * fix npm import cli * fix search module * fix comment * fix tsconfig output * es 20016 tsconfig * travis add demo shell dist * exclude datapicker process services * demo shell script fix * bundle check new build * add simulate publish * invert publish * test distribution * improve sh help * uncomment script * finally got the guilty piece of code * run e2e
This commit is contained in:
parent
c06cf28769
commit
c578529b15
@ -58,8 +58,11 @@ script:
|
||||
(./scripts/start.sh -dev -t -ss -vjsapi alpha || exit 1;);
|
||||
fi
|
||||
fi
|
||||
|
||||
jobs:
|
||||
include:
|
||||
- stage: Check build demo shell in production mode AND e2e
|
||||
script: ./scripts/test-dist.sh
|
||||
- stage: Check 2.0.0 Project Update
|
||||
script: ./scripts/test-e2e-bc.sh
|
||||
- stage: Check ADF exports
|
||||
|
@ -6,22 +6,20 @@
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"prestart": "npm run validate-config",
|
||||
"start": "npm run server-versions && rimraf dist && ng serve --host 0.0.0.0 --proxy-config proxy.conf.js --app dist --open --aot=false",
|
||||
"start:dev": " npm run lint && npm run server-versions && rimraf dist && npm run clean-lib-angular && concurrently \"ng serve --host 0.0.0.0 --disable-host-check --app dev pp-dev --proxy-config proxy.conf.js --open\" \"npm run style:dev --watch\" \"npm run copy:dev\" ",
|
||||
"start:dist": "npm run server-versions && rimraf dist && node --max_old_space_size=30000 node_modules/.bin/ng serve --prod --build-optimizer=false --aot=false --host 0.0.0.0 --disable-host-check --app dist",
|
||||
"start": "npm run server-versions && rimraf dist && ng serve --host 0.0.0.0 --proxy-config proxy.conf.js --app dist --open",
|
||||
"start:dev": " npm run lint && npm run server-versions && rimraf dist && concurrently \"ng serve --host 0.0.0.0 --disable-host-check --app dev pp-dev --proxy-config proxy.conf.js --open\" \"npm run style:dev --watch\" \"npm run copy:dev\" ",
|
||||
"start:dist": "npm run server-versions && rimraf dist && node --max_old_space_size=30000 node_modules/.bin/ng serve --prod --host 0.0.0.0 --disable-host-check --app dist",
|
||||
"build": "npm run validate-config && npm run server-versions && rimraf dist && ng build--app dist",
|
||||
"build:dev": "npm run validate-config && npm run lint && npm run style:dev && npm run server-versions && rimraf dist && ng build --app dev",
|
||||
"build:dist": "npm run validate-config && npm run style:dev && npm run server-versions && rimraf dist && node --max_old_space_size=30000 node_modules/.bin/ng build --prod --build-optimizer=false --aot=false --app dist",
|
||||
"build:dist": "npm run validate-config && npm run server-versions && rimraf dist && ng build --prod --app dist",
|
||||
"style:dev": "npm run webpack -- --config config/webpack.style.js --progress --profile --bail",
|
||||
"copy:dev": "node ./config/dev-copy-watch.js",
|
||||
"test": " npm run clean-lib-angular && ng test --single-run",
|
||||
"test": " ng test --single-run",
|
||||
"lint": "ng lint",
|
||||
"e2e": "ng e2e",
|
||||
"validate-config": "ajv validate -s ../lib/core/app-config/schema.json -d ./src/app.config.json --errors=text --verbose",
|
||||
"server-versions": "rimraf ./src/versions.json && npm list --depth=0 --json=true --prod=true > ./src/versions.json || exit 0",
|
||||
"clean": "npm run clean-build && rimraf dist node_modules typings dist",
|
||||
"clean-lib-angular": "rimraf ../lib/node_modules/@angular",
|
||||
"clean-build": "rimraf 'app/{,**/}**.js' 'app/{,**/}**.js.map' 'app/{,**/}**.d.ts'",
|
||||
"clean": "rimraf dist node_modules typings",
|
||||
"clean-lock": "rimraf package-lock.json",
|
||||
"webpack": "node node_modules/webpack/bin/webpack.js"
|
||||
},
|
||||
@ -63,10 +61,10 @@
|
||||
],
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@alfresco/adf-content-services": "2.2.0",
|
||||
"@alfresco/adf-core": "2.2.0",
|
||||
"@alfresco/adf-insights": "2.2.0",
|
||||
"@alfresco/adf-process-services": "2.2.0",
|
||||
"@alfresco/adf-content-services": "2.3.0-beta3",
|
||||
"@alfresco/adf-core": "2.3.0-beta3",
|
||||
"@alfresco/adf-insights": "2.3.0-beta3",
|
||||
"@alfresco/adf-process-services": "2.3.0-beta3",
|
||||
"@angular/animations": "5.1.1",
|
||||
"@angular/cdk": "5.0.1",
|
||||
"@angular/common": "5.1.1",
|
||||
@ -82,7 +80,7 @@
|
||||
"@mat-datetimepicker/core": "^1.0.1",
|
||||
"@mat-datetimepicker/moment": "^1.0.1",
|
||||
"@ngx-translate/core": "9.1.1",
|
||||
"alfresco-js-api": "2.2.0",
|
||||
"alfresco-js-api": "^2.3.0-beta3",
|
||||
"chart.js": "2.5.0",
|
||||
"classlist.js": "1.1.20150312",
|
||||
"core-js": "2.4.1",
|
||||
@ -102,7 +100,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/core": "0.0.28",
|
||||
"@angular/cli": "1.6.5",
|
||||
"@angular/cli": "1.7.3",
|
||||
"@angular/compiler-cli": "^5.2.0",
|
||||
"@angular/language-service": "^5.2.0",
|
||||
"@types/jasmine": "~2.8.3",
|
||||
|
@ -29,14 +29,14 @@ import { SearchControlComponent } from './components/search-control.component';
|
||||
import { SearchComponent } from './components/search.component';
|
||||
import { EmptySearchResultComponent } from './components/empty-search-result.component';
|
||||
|
||||
export const ALFRESCO_SEARCH_DIRECTIVES: [any] = [
|
||||
export const ALFRESCO_SEARCH_DIRECTIVES: any[] = [
|
||||
SearchComponent,
|
||||
SearchControlComponent,
|
||||
SearchTriggerDirective,
|
||||
EmptySearchResultComponent
|
||||
];
|
||||
|
||||
export const ALFRESCO_SEARCH_PROVIDERS: [any] = [
|
||||
export const ALFRESCO_SEARCH_PROVIDERS: any[] = [
|
||||
SearchService
|
||||
];
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"removeComments": true,
|
||||
"declaration": true,
|
||||
"outDir": "./",
|
||||
"outDir": "../dist/content-services/",
|
||||
"baseUrl" : "./",
|
||||
"paths": {
|
||||
"@alfresco/adf-process-services": ["../process-services"],
|
||||
@ -25,7 +25,7 @@
|
||||
"@angular/*": ["../node_modules/@angular/*"]
|
||||
},
|
||||
"lib": [
|
||||
"es2015",
|
||||
"es2016",
|
||||
"dom"
|
||||
],
|
||||
"suppressImplicitAnyIndexErrors": true,
|
||||
|
@ -16,7 +16,7 @@
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"removeComments": true,
|
||||
"declaration": true,
|
||||
"outDir": "./",
|
||||
"outDir": "../dist/core/",
|
||||
"baseUrl" : "./",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"paths": {
|
||||
@ -26,7 +26,7 @@
|
||||
"@angular/*": ["../node_modules/@angular/*"]
|
||||
},
|
||||
"lib": [
|
||||
"es2015",
|
||||
"es2016",
|
||||
"dom"
|
||||
],
|
||||
"suppressImplicitAnyIndexErrors": true,
|
||||
|
@ -16,7 +16,7 @@
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"removeComments": true,
|
||||
"declaration": true,
|
||||
"outDir": "./",
|
||||
"outDir": "../dist/insights/",
|
||||
"baseUrl" : "./",
|
||||
"paths": {
|
||||
"@alfresco/adf-process-services": ["../process-services"],
|
||||
@ -26,7 +26,7 @@
|
||||
"@angular/*": ["../node_modules/@angular/*"]
|
||||
},
|
||||
"lib": [
|
||||
"es2015",
|
||||
"es2016",
|
||||
"dom"
|
||||
],
|
||||
"suppressImplicitAnyIndexErrors": true,
|
||||
|
@ -7,7 +7,7 @@
|
||||
"clean": "rimraf node_modules",
|
||||
"clean-lock": "rimraf package-lock.json",
|
||||
"rimraf": "rimraf",
|
||||
"build": "npm run webpack -- --config config/webpack.build.js --progress --profile --bail && npm run build-style && npm run bundlesize-check",
|
||||
"build": "npm run webpack -- --config config/webpack.build.js --progress --profile --bail && npm run build-style",
|
||||
"test": "node node_modules/karma/bin/karma start --reporters mocha,coverage --single-run --component .",
|
||||
"build-style": "npm run bundle-scss && npm run webpack -- --config config/webpack.style.js --progress --profile --bail",
|
||||
"build-style-new": "npm run bundle-scss-new && npm run webpack -- --config config/webpack.style.js --progress --profile --bail",
|
||||
@ -24,7 +24,7 @@
|
||||
"copy-i18n": "mkdir -p dist/core/bundles/assets/adf-core/i18n && cp -R core/i18n/* dist/core/bundles/assets/adf-core/i18n && mkdir -p dist/content-services/bundles/assets/adf-content-services/i18n && cp -R content-services/i18n/* dist/content-services/bundles/assets/adf-content-services/i18n && mkdir -p dist/process-services/bundles/assets/adf-process-services/i18n && cp -R process-services/i18n/* dist/process-services/bundles/assets/adf-process-services/i18n && mkdir -p dist/insights/bundles/assets/adf-insights/i18n && cp -R insights/i18n/* dist/insights/bundles/assets/adf-insights/i18n",
|
||||
"copy-assets": "cp -R core/assets/* dist/core/bundles/assets && cp -R content-services/assets/* dist/content-services/bundles/assets && cp -R process-services/assets/* dist/process-services/bundles/assets",
|
||||
"copy-app-schema": "cp core/app-config/schema.json dist/core/app.config.schema.json",
|
||||
"new-build": "npm run build-bundles && npm run build-style-new && npm run copy-i18n && npm run copy-assets && npm run copy-app-schema",
|
||||
"new-build": "rm -rf node_modules/@alfresco && npm run build-bundles && npm run build-style-new && npm run copy-i18n && npm run copy-assets && npm run copy-app-schema && npm run bundlesize-check",
|
||||
"build-bundles": "npm run build-core && npm run link-core && npm run build-content && npm run link-content && npm run build-process && npm run build-insights",
|
||||
"link-core": "mkdir -p ./node_modules/@alfresco/adf-core/ && cp -R ./dist/core/* ./node_modules/@alfresco/adf-core/",
|
||||
"link-content": "mkdir -p ./node_modules/@alfresco/adf-content-services/ && cp -R ./dist/content-services/* ./node_modules/@alfresco/adf-content-services/",
|
||||
@ -161,19 +161,19 @@
|
||||
"license": "Apache-2.0",
|
||||
"bundlesize": [
|
||||
{
|
||||
"path": "./content-services/bundles/adf-content-services.js",
|
||||
"path": "./dist/content-services/bundles/adf-content-services.umd.js",
|
||||
"maxSize": "50 kb"
|
||||
},
|
||||
{
|
||||
"path": "./process-services/bundles/adf-process-services.js",
|
||||
"maxSize": "60 kb"
|
||||
"path": "./dist/process-services/bundles/adf-process-services.umd.js",
|
||||
"maxSize": "50 kb"
|
||||
},
|
||||
{
|
||||
"path": "./insights/bundles/adf-insights.js",
|
||||
"maxSize": "60 kb"
|
||||
"path": "./dist/insights/bundles/adf-insights.umd.js",
|
||||
"maxSize": "50 kb"
|
||||
},
|
||||
{
|
||||
"path": "./core/bundles/adf-core.js",
|
||||
"path": "./dist/core/bundles/adf-core.umd.js",
|
||||
"maxSize": "150 kb"
|
||||
}
|
||||
],
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
import { Component, ViewEncapsulation, OnInit } from '@angular/core';
|
||||
import {
|
||||
baseHost,
|
||||
UploadWidgetComponent,
|
||||
FormService,
|
||||
LogService,
|
||||
@ -32,12 +31,23 @@ import {
|
||||
import { ContentNodeDialogService } from '@alfresco/adf-content-services';
|
||||
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import 'rxjs/add/observable/from';
|
||||
|
||||
@Component({
|
||||
selector: 'attach-widget',
|
||||
templateUrl: './attach-file-widget.component.html',
|
||||
styleUrls: ['./attach-file-widget.component.scss'],
|
||||
host: baseHost,
|
||||
host: {
|
||||
'(click)': 'event($event)',
|
||||
'(blur)': 'event($event)',
|
||||
'(change)': 'event($event)',
|
||||
'(focus)': 'event($event)',
|
||||
'(focusin)': 'event($event)',
|
||||
'(focusout)': 'event($event)',
|
||||
'(input)': 'event($event)',
|
||||
'(invalid)': 'event($event)',
|
||||
'(select)': 'event($event)'
|
||||
},
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class AttachFileWidgetComponent extends UploadWidgetComponent implements OnInit {
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
import { Component, ViewEncapsulation, OnInit } from '@angular/core';
|
||||
import {
|
||||
baseHost,
|
||||
WidgetComponent,
|
||||
FormService,
|
||||
NodesApiService
|
||||
@ -31,7 +30,17 @@ import { MinimalNodeEntryEntity } from 'alfresco-js-api';
|
||||
selector: 'attach-folder-widget',
|
||||
templateUrl: './attach-folder-widget.component.html',
|
||||
styleUrls: ['./attach-folder-widget.component.scss'],
|
||||
host: baseHost,
|
||||
host: {
|
||||
'(click)': 'event($event)',
|
||||
'(blur)': 'event($event)',
|
||||
'(change)': 'event($event)',
|
||||
'(focus)': 'event($event)',
|
||||
'(focusin)': 'event($event)',
|
||||
'(focusout)': 'event($event)',
|
||||
'(input)': 'event($event)',
|
||||
'(invalid)': 'event($event)',
|
||||
'(select)': 'event($event)'
|
||||
},
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class AttachFolderWidgetComponent extends WidgetComponent implements OnInit {
|
||||
|
@ -13,6 +13,7 @@
|
||||
"minimatch": "minimatch",
|
||||
"@angular/platform-browser/animations": "@angular/platform-browser/animations",
|
||||
"@angular/material": "@angular/material",
|
||||
"@mat-datetimepicker": "@mat-datetimepicker",
|
||||
"@angular/flex-layout": "@angular/flex-layout",
|
||||
"@alfresco/adf-core": "@alfresco/adf-core",
|
||||
"@alfresco/adf-content-services": "@alfresco/adf-content-services",
|
||||
|
@ -90,7 +90,7 @@ export class ProcessInstanceDetailsComponent implements OnChanges {
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the task detail to undefined
|
||||
* Reset the task detail
|
||||
*/
|
||||
reset() {
|
||||
this.processInstanceDetails = null;
|
||||
|
@ -27,6 +27,7 @@ import 'rxjs/add/observable/throw';
|
||||
import 'rxjs/add/observable/forkJoin';
|
||||
import 'rxjs/add/observable/fromPromise';
|
||||
import 'rxjs/operator/switchMap';
|
||||
import 'rxjs/add/observable/from';
|
||||
|
||||
@Injectable()
|
||||
export class TaskListService {
|
||||
|
@ -16,7 +16,7 @@
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"removeComments": true,
|
||||
"declaration": true,
|
||||
"outDir": "./",
|
||||
"outDir": "../dist/process-services/",
|
||||
"baseUrl" : "./",
|
||||
"paths": {
|
||||
"@alfresco/adf-process-services": ["../process-services"],
|
||||
@ -26,7 +26,7 @@
|
||||
"@angular/*": ["../node_modules/@angular/*"]
|
||||
},
|
||||
"lib": [
|
||||
"es2015",
|
||||
"es2016",
|
||||
"dom"
|
||||
],
|
||||
"suppressImplicitAnyIndexErrors": true,
|
||||
|
@ -31,7 +31,7 @@
|
||||
"rxjs/*": ["./node_modules/rxjs/*"]
|
||||
},
|
||||
"lib": [
|
||||
"es2015",
|
||||
"es2016",
|
||||
"dom"
|
||||
],
|
||||
"suppressImplicitAnyIndexErrors": true,
|
||||
|
@ -370,3 +370,27 @@ This script test that the update from 2.0.0 to 2.x.x is still smooth
|
||||
```sh
|
||||
./test-e2e-bc
|
||||
```
|
||||
|
||||
# simulate-publish.sh
|
||||
|
||||
***simulate-publish.sh***
|
||||
|
||||
This script run a verdaccio server and simulate a publish on it
|
||||
|
||||
## Examples
|
||||
|
||||
```sh
|
||||
./simulate-publish
|
||||
```
|
||||
|
||||
# test-dist.sh
|
||||
|
||||
***test-dist.sh***
|
||||
|
||||
This script test the distribution of ADF against the demo shell
|
||||
|
||||
## Examples
|
||||
|
||||
```sh
|
||||
./test-dist
|
||||
```
|
26
scripts/config/config-verdaccio.yaml
Normal file
26
scripts/config/config-verdaccio.yaml
Normal file
@ -0,0 +1,26 @@
|
||||
storage: ./.verdaccio_test_env/test-storage
|
||||
|
||||
uplinks:
|
||||
npmjs:
|
||||
url: https://registry.npmjs.org/
|
||||
|
||||
auth:
|
||||
auth-memory:
|
||||
users:
|
||||
test:
|
||||
name: test
|
||||
password: test
|
||||
|
||||
logs:
|
||||
- {type: stdout, format: pretty, level: trace}
|
||||
|
||||
packages:
|
||||
'@*/*':
|
||||
# scoped packages
|
||||
access: $all
|
||||
publish: $anonymous
|
||||
proxy: npmjs
|
||||
'**':
|
||||
access: $all
|
||||
publish: $anonymous
|
||||
proxy: npmjs
|
23
scripts/simulate-publish.sh
Executable file
23
scripts/simulate-publish.sh
Executable file
@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
npm set registry https://registry.npmjs.org/
|
||||
|
||||
echo "====== Install verdaccio ===== "
|
||||
|
||||
npm install -g verdaccio
|
||||
npm install -g concurrently
|
||||
npm install -g verdaccio-auth-memory
|
||||
|
||||
echo "====== Update version ===== "
|
||||
|
||||
$DIR/update-version.sh -nextalpha
|
||||
|
||||
echo "====== Change registry ===== "
|
||||
|
||||
npm set registry http://localhost:4873/
|
||||
|
||||
echo "====== Run verdaccio ===== "
|
||||
|
||||
concurrently "verdaccio --listen 4873 --config $DIR/config/config-verdaccio.yaml" "$DIR/npm-publish.sh"
|
@ -24,16 +24,16 @@ eval projects=( "@alfresco/core"
|
||||
show_help() {
|
||||
echo "Usage: start.sh"
|
||||
echo ""
|
||||
echo "-ss or -skipstart build only the demo shell without start"
|
||||
echo "-si or -skipinstall start the demo shell and skip the install the dependencies"
|
||||
echo "-dev or -develop start the demo shell using the relative lib folder to link the components"
|
||||
echo "-dist create the disbuild the demo shell in dist mode"
|
||||
echo "-t or -test execute test"
|
||||
echo "-ss or --skipstart build only the demo shell without start"
|
||||
echo "-si or --skipinstall start the demo shell and skip the install the dependencies"
|
||||
echo "-dev or --develop start the demo shell using the relative lib folder to link the components"
|
||||
echo "-dist build or start the demo shell in dist mode"
|
||||
echo "-t or --test execute test"
|
||||
echo "--e2e execute e2e test"
|
||||
echo "-u or -update start the demo shell and update the dependencies"
|
||||
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 "-v or -version install different version of ng2_components from npm defined in the package.json this option is not compatible with -d"
|
||||
echo "-u or --update start the demo shell and update the dependencies"
|
||||
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 "-v or --version install different version of ng2_components from npm defined in the package.json this option is not compatible with -d"
|
||||
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"
|
||||
}
|
||||
|
44
scripts/test-dist.sh
Executable file
44
scripts/test-dist.sh
Executable file
@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
echo "====== Install demo-shell ===== "
|
||||
|
||||
cd $DIR/../demo-shell
|
||||
npm install
|
||||
|
||||
echo "====== Install lib ===== "
|
||||
|
||||
cd $DIR/../lib
|
||||
npm install
|
||||
|
||||
echo "====== Install JS-API alpha ===== "
|
||||
|
||||
npm install alfresco-js-api@alpha
|
||||
|
||||
echo "====== Build ADF ===== "
|
||||
|
||||
npm run new-build
|
||||
|
||||
echo "====== COPY new build in demo shell node_modules ===== "
|
||||
|
||||
rm -rf ../demo-shell/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
|
||||
|
||||
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
|
||||
|
||||
echo "====== Build dist demo shell ===== "
|
||||
|
||||
cd $DIR/../demo-shell
|
||||
npm run build:dist
|
||||
|
||||
echo "====== e2e test ===== "
|
||||
|
||||
npm run e2e
|
Loading…
x
Reference in New Issue
Block a user