Skip to content

Commit

Permalink
Merge pull request #216 from mobi/chore_migrate_style_guide
Browse files Browse the repository at this point in the history
[Chore] Migrate Style Guide
  • Loading branch information
grahamhency authored Oct 2, 2019
2 parents 20f6645 + 9945f0b commit 22dcc67
Show file tree
Hide file tree
Showing 152 changed files with 9,451 additions and 2 deletions.
112 changes: 111 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,117 @@
}
}
}
},
"go-style-guide": {
"root": "projects/go-style-guide/",
"sourceRoot": "projects/go-style-guide/src",
"projectType": "application",
"prefix": "app",
"schematics": {
"@schematics/angular:component": {
"styleext": "scss"
}
},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/go-style-guide",
"index": "projects/go-style-guide/src/index.html",
"main": "projects/go-style-guide/src/main.ts",
"polyfills": "projects/go-style-guide/src/polyfills.ts",
"tsConfig": "projects/go-style-guide/tsconfig.app.json",
"assets": [
"projects/go-style-guide/src/favicon.ico",
"projects/go-style-guide/src/assets",
"projects/go-style-guide/src/_redirects"
],
"styles": [
"projects/go-style-guide/src/styles/styles.scss"
],
"scripts": [],
"stylePreprocessorOptions": {
"includePaths": [
"projects/go-style-guide/src/styles"
]
},
"es5BrowserSupport": true
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "projects/go-style-guide/src/environments/environment.ts",
"with": "projects/go-style-guide/src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "go-style-guide:build"
},
"configurations": {
"production": {
"browserTarget": "go-style-guide:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "go-style-guide:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/go-style-guide/src/test.ts",
"polyfills": "projects/go-style-guide/src/polyfills.ts",
"tsConfig": "projects/go-style-guide/tsconfig.spec.json",
"karmaConfig": "projects/go-style-guide/karma.conf.js",
"styles": [
"projects/go-style-guide/src/styles.css"
],
"scripts": [],
"assets": [
"projects/go-style-guide/src/favicon.ico",
"projects/go-style-guide/src/assets"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"projects/go-style-guide/tsconfig.app.json",
"projects/go-style-guide/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "go-lib"
}
}
18 changes: 18 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
"package": "npm run build_lib && npm run npm_pack",
"publish": "npm run package && cd dist/go-lib && npm publish",
"publish_local": "npm run package && node ./local_install.js",
"sass-lint": "node_modules/.bin/sass-lint -c .sass-lint.yml"
"sass-lint": "node_modules/.bin/sass-lint -c .sass-lint.yml",
"style_guide": "ng serve --project=go-style-guide",
"style_guide_publish": "ng build --prod --project=go-style-guide"
},
"private": true,
"engines": {
Expand All @@ -43,6 +45,9 @@
"@ng-select/ng-select": "^2.20.5",
"classlist.js": "^1.1.20150312",
"core-js": "^2.5.4",
"faker": "4.1.0",
"highlight.js": "^9.13.1",
"ngx-highlightjs": "^3.0.1",
"npm": "^6.10.1",
"rxjs": "~6.5.2",
"web-animations-js": "^2.3.2",
Expand Down
32 changes: 32 additions & 0 deletions projects/go-style-guide/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-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: {
dir: require('path').join(__dirname, '../../coverage/go-style-guide'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};
1 change: 1 addition & 0 deletions projects/go-style-guide/src/_redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* /index.html 200
35 changes: 35 additions & 0 deletions projects/go-style-guide/src/app/app.animations.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import {
animate,
AnimationTriggerMetadata,
query,
style,
transition,
trigger
} from '@angular/animations';

export const routerAnimation: AnimationTriggerMetadata =
trigger('routerAnimation', [
transition('* <=> *', [
// Initial state of new route
query(':enter',
[
style({ opacity: 0 })
],
{ optional: true }
),
query(':leave',
[
style({ opacity: 1 }),
animate('0.2s', style({ opacity: 0 }))
],
{ optional: true }
),
query(':enter',
[
style({ opacity: 0 }),
animate('0.2s', style({ opacity: 1 }))
],
{ optional: true }
)
])
]);
6 changes: 6 additions & 0 deletions projects/go-style-guide/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<go-layout>
<go-header go-layout-header logo="assets/images/goDesign.svg">
</go-header>
<go-side-nav go-layout-nav [menuItems]="menuItems">
</go-side-nav>
</go-layout>
106 changes: 106 additions & 0 deletions projects/go-style-guide/src/app/app.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
@import '../../../go-lib/src/styles/variables';
@import '../../../go-lib/src/styles/mixins';

// GLOBAL
a {
text-decoration: none;
}

// MAIN
body {
background: $theme-light-app-bg;
color: $theme-light-color;
font-family: $base-font-stack;
font-weight: 300;
}

code {
margin: .5rem 0 1.5rem;

&.code-block--no-bottom-margin {
margin-bottom: 0;
}
}

.main {
display: flex;
flex-direction: column;
max-height: 100vh;
min-height: 100vh;
overflow: hidden;
}

.main__content {
display: flex;
flex-grow: 1;
}

.main__route-container {
display: flex;
flex-grow: 1;
position: relative;
}

.main__route-container-outlet ~ * {
height: 100%;
overflow-x: hidden;
overflow-y: auto;
padding: 3rem;
position: absolute;
width: 100%;
}

// NAV
.main__nav {
background: $theme-dark-bg;
border-right: 1px solid $theme-dark-border;
color: $theme-dark-color;
}

// HEADER
.main__header {
align-items: center;
background: $theme-light-bg;
border-bottom: 1px solid $theme-light-border;
display: flex;
height: 60px;
justify-content: space-around;
width: 100%;
}

.header__logo {
height: 100%;
padding: 1rem;

img {
height: 100%;
}
}

.header__search {
background: $theme-light-app-bg;
border-radius: $global-radius;
color: $theme-light-color;
padding: 0.75rem;
width: 450px;
}

.header__theme-switcher {
align-items: center;
color: $theme-light-color;
cursor: pointer;
display: flex;
height: 100%;
padding: 1rem;
@include transition(all);

&:hover {
background: $theme-light-bg-hover;
}
}

.dark-example-area {
background: $theme-dark-bg;
border-radius: $global-radius;
padding: $column-gutter;
}
Loading

0 comments on commit 22dcc67

Please sign in to comment.