Skip to content

Commit

Permalink
A few minor tidy-ups to help with review
Browse files Browse the repository at this point in the history
  • Loading branch information
nwmac committed Jun 17, 2020
1 parent 6f2dbe5 commit 93ef2e2
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 72 deletions.
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,21 @@ src/jetstream/console-database.db
src/jetstream/config.properties
src/jetstream/db/dbconf.yml

# Customisations - these can be removed in the future
# Left in for now to prevent these files being checked-in, if they are still present
# from a previous checkout
src/frontend/packages/core/favicon.ico
src/frontend/packages/core/sass/custom.scss
src/frontend/packages/core/assets/eula.html
src/frontend/packages/core/assets/logo.png
src/frontend/packages/core/assets/nav-logo.png
src/frontend/packages/core/assets/login-bg.jpg
src/frontend/packages/core/src/custom-import.module.ts
src/frontend/packages/core/src/custom
src/frontend/packages/core/assets/custom
src/frontend/packages/core/sass/custom
src/frontend/packages/core/src/index.html

# Customisation - generated import module
src/frontend/packages/core/src/_custom-import.module.ts

Expand Down
79 changes: 22 additions & 57 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,10 @@
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/frontend/packages/core/src/environments/environment.ts",
"with": "src/frontend/packages/core/src/environments/environment.prod.ts"
}
]
"fileReplacements": [{
"replace": "src/frontend/packages/core/src/environments/environment.ts",
"with": "src/frontend/packages/core/src/environments/environment.prod.ts"
}]
}
}
},
Expand Down Expand Up @@ -94,7 +92,7 @@
}
}
}
},
},
"core": {
"root": "src/frontend/packages/core/",
"sourceRoot": "src/frontend/packages/core",
Expand All @@ -103,44 +101,28 @@
"schematics": {},
"architect": {
"build": {
"builder": "@angular-builders/custom-webpack:browser",
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"preserveSymlinks": true,
"outputPath": "dist/core",
"index": "src/frontend/packages/core/src/index.html",
"main": "src/frontend/packages/core/src/main.ts",
"polyfills": "src/frontend/packages/core/src/polyfills.ts",
"tsConfig": "src/frontend/packages/core/tsconfig.app.json",
"assets": [
"src/frontend/packages/core/assets",
{
"glob": "**/*",
"input": "custom-src/frontend/assets/custom",
"output": "/core/assets/custom"
},
"src/frontend/packages/core/favicon.ico"
],
"styles": [
"src/frontend/packages/core/src/styles.scss",
"src/frontend/packages/cf-autoscaler/src/styles.scss",
"node_modules/xterm/css/xterm.css"
],
"assets": [],
"styles": [],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"fileReplacements": [
{
"replace": "src/frontend/packages/core/src/environments/environment.ts",
"with": "src/frontend/packages/core/src/environments/environment.prod.ts"
}
],
"budgets": [{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}],
"fileReplacements": [{
"replace": "src/frontend/packages/core/src/environments/environment.ts",
"with": "src/frontend/packages/core/src/environments/environment.prod.ts"
}],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
Expand All @@ -153,23 +135,6 @@
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "core:build"
},
"configurations": {
"production": {
"browserTarget": "core:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "core:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
Expand Down Expand Up @@ -227,7 +192,7 @@
"tsConfig": "src/frontend/packages/store/tsconfig.lib.json",
"project": "src/frontend/packages/store/ng-package.json"
},
"configurations": {
"configurations": {
"production": {
"tsConfig": "src/frontend/packages/store/tsconfig.lib.prod.json"
}
Expand Down Expand Up @@ -300,8 +265,8 @@
"options": {
"tsConfig": "src/frontend/packages/cloud-foundry/tsconfig.lib.json",
"project": "src/frontend/packages/cloud-foundry/ng-package.json"
}
, "configurations": {
},
"configurations": {
"production": {
"tsConfig": "src/frontend/packages/cloud-foundry/tsconfig.lib.prod.json"
}
Expand Down Expand Up @@ -343,8 +308,8 @@
"options": {
"tsConfig": "src/frontend/packages/cf-autoscaler/tsconfig.lib.json",
"project": "src/frontend/packages/cf-autoscaler/ng-package.json"
}
, "configurations": {
},
"configurations": {
"production": {
"tsConfig": "src/frontend/packages/cf-autoscaler/tsconfig.lib.prod.json"
}
Expand Down Expand Up @@ -386,4 +351,4 @@
"prefix": "app"
}
}
}
}
3 changes: 0 additions & 3 deletions build/fe-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
var config = require('./gulp.config');
var paths = config.paths;

// Import customization tasks
//require('./customize-build');

// Clean dist dir
gulp.task('clean', function (next) {
del(paths.dist + '**/*', {
Expand Down
2 changes: 1 addition & 1 deletion build/tools/v4-migration/migrate.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# Migrate in custom theme and extensions into the new package structure
# Migrate custom theme and extensions into the new package structure

set -e
set -o pipefail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { createBasicStoreModule } from '@stratosui/store/testing';

import { CoreModule } from '../../core/core.module';
import { SharedModule } from '../../shared/shared.module';
import { createBasicStoreModule } from '@stratosui/store/testing';
import { AppActionExtensionComponent } from './app-action-extension.component';

describe('AppActionExtensionComponent', () => {
let component: AppActionExtensionComponent;
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/packages/cloud-foundry/sass/_all-theme.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Theming for the copmponents in the Cloud Foudnry package
// Theming for the copmponents in the Cloud Foundry package

@import '../src/features/applications/application-wall/application-wall.component.theme';
@import '../src/shared/components/list/list-types/cf-security-groups/cf-security-groups-card/cf-security-groups-card.component.theme';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { safeUnsubscribe } from '../../../../../../core/src/core/utils.service';
import { APIResource } from '../../../../../../store/src/types/api.types';
import { IServiceBroker } from '../../../../cf-api-svc.types';
import { cfEntityCatalog } from '../../../../cf-entity-catalog';
import { CF_ENDPOINT_TYPE } from '../../../../cf-types';

@Component({
selector: 'app-service-broker-card',
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
} from '../../../../../cloud-foundry/src/features/service-catalog/services-helper';
import { ServicesService } from '../../../../../cloud-foundry/src/features/service-catalog/services.service';
import { StratosStatus } from '../../../../../core/src/shared/shared.types';
import { EntityServiceFactory } from '../../../../../store/src/entity-service-factory.service';
import { APIResource } from '../../../../../store/src/types/api.types';
import { IServiceBroker, IServicePlan } from '../../../cf-api-svc.types';
import { cfEntityCatalog } from '../../../cf-entity-catalog';
Expand Down
1 change: 0 additions & 1 deletion src/frontend/packages/core/favicon.ico

This file was deleted.

4 changes: 0 additions & 4 deletions src/frontend/packages/core/sass/_all-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@
@import '../../cloud-foundry/src/features/applications/deploy-application/deploy-application-step2/deploy-application-fs/deploy-application-fs.component.theme';
@import '../../cloud-foundry/src/features/cloud-foundry/tabs/cloud-foundry-firehose/cloud-foundry-firehose.component.theme';
@import '../../cloud-foundry/src/features/service-catalog/service-catalog-page/service-catalog-page.component.theme';

//TODO: Example of themable package
//@import '../../cloud-foundry/src/features/applications/application-wall/application-wall.component.theme';

@import '../../core/src/features/error-page/error-page/error-page.component.theme';
@import '../../core/src/features/endpoints/backup-restore/restore-endpoints/restore-endpoints.component.theme';
@import '../../core/src/features/metrics/metrics/metrics.component.theme';
Expand Down
1 change: 0 additions & 1 deletion src/frontend/packages/core/sass/custom.scss

This file was deleted.

2 changes: 1 addition & 1 deletion src/frontend/packages/tools/src/build/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class StratosBuilder {
constructor(public webpackConfig, public options) { }

public run() {
// Read in the Stratos config file if present (and do so config initialization)
// Read in the Stratos config file if present (and do so config initialization)
const sConfig = new StratosConfig(__dirname, this.options);

// Sass handler for themes and themable packages
Expand Down
5 changes: 5 additions & 0 deletions src/frontend/packages/tools/src/build/sass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { StratosConfig } from './../lib/stratos.config';
*
* Provides some custom resolution of sass files so that the theming
* is applied to components and that the chosen theme is used.
*
* Essentially intercepts package imports of the form ~@startosui/theme
* and ensures the correct packaeg is used.
*/
export class SassHandler {

Expand Down Expand Up @@ -64,6 +67,8 @@ export class SassHandler {
};
}

// Generate an import and include for each themable package so that we theme
// its components when the application is built.
private getThemingForPackages(c: StratosConfig): string {
let contents = '';
const themedPackages = c.getThemedPackages();
Expand Down

0 comments on commit 93ef2e2

Please sign in to comment.