Commit c692f5c6 authored by sshijun's avatar sshijun
Browse files

Move lib into src for better UI building


Signed-off-by: default avatarsshijun <sshijun@vmware.com>
parent d41fb07b
......@@ -15,7 +15,6 @@ src/common/dao/dao.test
jobservice/test
src/portal/coverage/
src/portal/lib/coverage/
src/portal/dist/
src/portal/html-report/
src/portal/node_modules/
......@@ -33,7 +32,7 @@ src/portal/typings/
src/portal/src/**/*.js
src/portal/src/**/*.js.map
src/portal/lib/coverage
src/portal/src/lib/coverage
**/npm*.log
**/*ngsummary.json
......
......@@ -84,17 +84,11 @@ If you already have a harbor backend environment, you can build a frontend devel
npm install
```
3. Compile the frontend code by the following command.
```
npm run build_all
```
4. Execute the following command,serve Harbor locally.
3. Execute the following command,serve Harbor locally.
```
npm run start
```
5. Then you can visit the Harbor by address: https://localhost:4200.
4. Then you can visit the Harbor by address: https://localhost:4200.
......@@ -18,10 +18,7 @@ RUN apt-get update \
COPY ./LICENSE /build_dir
COPY src/portal /build_dir
RUN ls -la \
&& npm run build_lib \
&& npm run link_lib \
&& node --max_old_space_size=2048 'node_modules/@angular/cli/bin/ng' build --prod
RUN node --max_old_space_size=2048 'node_modules/@angular/cli/bin/ng' build --prod
FROM goharbor/harbor-portal-base:${harbor_base_image_version}
......
......@@ -107,20 +107,6 @@
"src/i18n"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json",
"lib/tsconfig.lib.json"
],
"exclude": [
"**/node_modules/**"
],
"fix": true
}
}
}
},
......@@ -144,67 +130,6 @@
}
}
}
},
"lib": {
"root": "lib",
"sourceRoot": "lib/src",
"projectType": "library",
"prefix": "enl",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "lib/tsconfig.lib.json",
"project": "lib/ng-package.json"
},
"configurations": {
"production": {
"project": "lib/ng-package.prod.json"
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "lib/src/test.ts",
"tsConfig": "lib/tsconfig.lib.json",
"karmaConfig": "lib/karma.conf.js"
},
"scripts": [
"node_modules/core-js/client/shim.min.js",
"node_modules/mutationobserver-shim/dist/mutationobserver.min.js",
"node_modules/@webcomponents/custom-elements/custom-elements.min.js",
"node_modules/@clr/icons/clr-icons.min.js",
"node_modules/web-animations-js/web-animations.min.js",
"node_modules/marked/lib/marked.js",
"node_modules/prismjs/prism.js",
"node_modules/prismjs/components/prism-yaml.min.js"
],
"styles": [
"node_modules/@clr/icons/clr-icons.min.css",
"node_modules/@clr/ui/clr-ui.min.css",
"node_modules/prismjs/themes/prism-solarizedlight.css",
"src/styles.css"
],
"assets": [
"src/images",
"src/favicon.ico",
"src/setting.json",
"src/i18n"
]
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"lib/tsconfig.lib.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "harbor-portal",
......
# This file lists all individuals having contributed content to the repository.
Mia Zhou <meinaz@vmware.com>
Qian Deng<dengq@vmware.com>
Steven zou <szou@vmware.com>
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
export * from './src/index';
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
const path = require('path');
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-mocha-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
// reports can be any that are listed here: https://github.com/istanbuljs/istanbuljs/tree/aae256fb8b9a3d19414dcf069c592e88712c32c6/packages/istanbul-reports/lib
reports: ['html', 'lcovonly', 'text-summary'],
// base output directory. If you include %browser% in the path it will be replaced with the karma browser name
dir: path.join(__dirname, 'coverage'),
// Combines coverage information from multiple browsers into one report rather than outputting a report
// for each browser.
combineBrowserReports: true,
// if using webpack and pre-loaders, work around webpack breaking the source path
fixWebpackSourcePaths: true,
// Omit files with no statements, no functions and no branches from the report
skipFilesWithNoCoverage: false,
// Most reporters accept additional config options. You can pass these through the `report-config` option
'report-config': {
// all options available at: https://github.com/istanbuljs/istanbuljs/blob/aae256fb8b9a3d19414dcf069c592e88712c32c6/packages/istanbul-reports/lib/html/index.js#L135-L137
html: {
// outputs the report in ./coverage/html
subdir: 'html'
}
},
// enforce percentage thresholds
// anything under these percentages will cause karma to fail with an exit code of 1 if not running in watch mode
thresholds: {
emitWarning: true, // set to `true` to not fail the test command when thresholds are not met
// thresholds for all files
global: {
statements: 37,
branches: 19,
functions: 28,
lines: 36
},
// thresholds per file
each: {
statements: 0,
lines: 0,
branches: 0,
functions: 0
}
}
},
reporters: ['progress', 'mocha','coverage-istanbul'],
mochaReporter: {
output: 'minimal'
},
reportSlowerThan: 100,
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
singleRun: true,
browsers: ['ChromeHeadlessNoSandbox'],
browserDisconnectTolerance: 2,
browserNoActivityTimeout: 50000,
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: ['--no-sandbox']
}
},
restartOnFileChange: true
});
};
\ No newline at end of file
{
"$schema": "../node_modules/ng-packagr/ng-package.schema.json",
"dest": "./dist",
"deleteDestPath": false,
"lib": {
"entryFile": "index.ts",
"umdModuleIds": {
"@clr/angular" : "angular",
"ngx-markdown" : "ngxMarkdown",
"@ngx-translate/http-loader" : "httpLoader",
"ngx-cookie" : "ngxCookie",
"@ngx-translate/core" : "core$1"
}
}
}
\ No newline at end of file
{
"$schema": "../node_modules/ng-packagr/ng-package.schema.json",
"dest": "./dist",
"lib": {
"entryFile": "index.ts",
"umdModuleIds": {
"@clr/angular" : "angular",
"ngx-markdown" : "ngxMarkdown",
"@ngx-translate/http-loader" : "httpLoader",
"ngx-cookie" : "ngxCookie",
"@ngx-translate/core" : "core$1"
}
}
}
\ No newline at end of file
{
"name": "@harbor/ui",
"version": "1.10.0",
"lockfileVersion": 1
}
{
"name": "@harbor/ui",
"version": "1.10.0",
"description": "Harbor shared UI components based on Clarity and Angular8",
"author": "CNCF",
"module": "index.js",
"main": "bundles/harborui.umd.min.js",
"jsnext:main": "index.js",
"typings": "index.d.ts",
"keywords": [
"Harbor",
"Clarity",
"Angular7"
],
"license": "Apache 2.0",
"repository": {
"type": "git",
"url": "https://github.com/vmware/harbor.git"
},
"homepage": "https://github.com/vmware/harbor#readme",
"peerDependencies": {
"@angular/animations": "^8.2.0",
"@angular/common": "^8.2.0",
"@angular/compiler": "^8.2.0",
"@angular/core": "^8.2.0",
"@angular/forms": "^8.2.0",
"@angular/http": "^8.2.0",
"@angular/platform-browser": "^8.2.0",
"@angular/platform-browser-dynamic": "^8.2.0",
"@angular/router": "^8.2.0",
"@ngx-translate/core": "^10.0.2",
"@ngx-translate/http-loader": "^3.0.1",
"@webcomponents/custom-elements": "^1.1.3",
"@clr/angular": "^2.1.0",
"@clr/icons": "^2.1.0",
"@clr/ui": "^2.1.0",
"core-js": "^2.5.4",
"intl": "^1.2.5",
"mutationobserver-shim": "^0.3.2",
"ngx-cookie": "^1.0.0",
"ngx-markdown": "^8.1.0",
"rxjs": "^6.3.3",
"ts-helpers": "^1.1.1",
"web-animations-js": "^2.2.1",
"zone.js": "^0.8.26",
"tslib": "^1.9.0"
}
}
export * from './fade-in.animation';
export * from './slide-in-out.animation';
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { ClarityModule } from '@clr/angular';
import { HarborLibraryModule } from './harbor-library.module';
@NgModule({
declarations: [],
imports: [
BrowserAnimationsModule,
BrowserModule,
FormsModule,
ClarityModule,
HarborLibraryModule.forRoot()
],
providers: [],
bootstrap: []
})
export class AppModule {
}
export * from './channel.service';
export * from "./gc.component";
export * from "./gc.const";
export * from "./gc.api.repository";
export * from "./gc.service";
export * from "./gc.viewmodel.factory";
export * from "./gcLog";
export * from "./gc-history/gc-history.component";
import { Type } from '@angular/core';
import { ReplicationConfigComponent } from './replication/replication-config.component';
import { SystemSettingsComponent } from './system/system-settings.component';
import { VulnerabilityConfigComponent } from './vulnerability/vulnerability-config.component';
import { RegistryConfigComponent } from './registry-config.component';
import { GcComponent } from './gc/gc.component';
import { GcHistoryComponent } from './gc/gc-history/gc-history.component';
import { ProjectQuotasComponent } from './project-quotas/project-quotas.component';
import { EditProjectQuotasComponent } from './project-quotas/edit-project-quotas/edit-project-quotas.component';
export * from './config';
export * from './replication/replication-config.component';
export * from './system/system-settings.component';
export * from './vulnerability/vulnerability-config.component';
export * from './registry-config.component';
export * from './gc/index';
export const CONFIGURATION_DIRECTIVES: Type<any>[] = [
ReplicationConfigComponent,
GcHistoryComponent,
GcComponent,
SystemSettingsComponent,
VulnerabilityConfigComponent,
RegistryConfigComponent,
ProjectQuotasComponent,
EditProjectQuotasComponent
];
import { Type } from '@angular/core';
import { CreateEditEndpointComponent } from './create-edit-endpoint.component';
export const CREATE_EDIT_ENDPOINT_DIRECTIVES: Type<any>[] = [
CreateEditEndpointComponent
];
import { Type } from "@angular/core";
import { CreateEditLabelComponent } from "./create-edit-label.component";
export const CREATE_EDIT_LABEL_DIRECTIVES: Type<any>[] = [
CreateEditLabelComponent
];
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment