Skip to content

Commit

Permalink
chore: test commit - 3 #UIM-4 (+14 squashed commit)
Browse files Browse the repository at this point in the history
Squashed commit:

[a355848] chore: test commit - 3 #UIM-4

[d5b74eb] chore: test commit - 2 (#UIM-4)

[a9f165c] chore: test commit (#4)

[8ec0506] fix: base-href parametr

[5c47f43] fix: ci PR NUmbers

[539390d] fix: ci PR NUmbers

[0c59de1] fix: correct deps for ci

[1e867ee] fix: build

[5d0c17d] chore: added preview docs script

* testing stage

[665b0a7] feat: added unit test config and 1 simple spec

[39b6f25] fix: angular cli build

[c641ade] chore: fixes McTreeSelection, await fix in master

[240ac61] chore: tree-selection test

[96b5b92] chore: added prod build for docs (+7 squashed commit)

Squashed commit:

[0dd9d64] chore: version for stackblitz

[66610cf] chore: added stackblitz

[2c20840] chore: updated code snippets

[e11b757] chore: updated css

[fc86734] chore: updated ts paths

[ef81da5] chore: added button overview

[b8f4450] chore: added pages
  • Loading branch information
pimenovoleg committed Jul 12, 2019
1 parent 203cb20 commit f0d4946
Show file tree
Hide file tree
Showing 82 changed files with 2,545 additions and 402 deletions.
46 changes: 38 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,25 @@ jobs:
- attach_workspace: *attach_options
- run: yarn run valid:lic

build_mosaic_docs:
<<: *job_defaults
steps:
- attach_workspace: *attach_options
- run:
name: Setup Environment Variables
command: |
echo 'export CI_PREVIEW=true' >> $BASH_ENV
echo 'export SHORT_GIT_HASH=$(git rev-parse --short $CIRCLE_SHA1)' >> $BASH_ENV
echo 'export CIRCLE_PULL_REQUEST_NUMBER=$(echo "$CIRCLE_PULL_REQUEST" | cut -d"/" -f7)' >> $BASH_ENV
source $BASH_ENV
- run: yarn run build:docs
- run: yarn run build:mosaic-examples
- run: yarn run docs:prod-build --progress false --base-href /mosaic-previews/pr$CIRCLE_PULL_REQUEST_NUMBER-$SHORT_GIT_HASH/ --output-path dist/releases/mosaic-docs/pr$CIRCLE_PULL_REQUEST_NUMBER-$SHORT_GIT_HASH/
- persist_to_workspace:
root: dist
paths:
- *release_path

build_mosaic:
<<: *job_defaults
steps:
Expand Down Expand Up @@ -125,15 +144,24 @@ jobs:
- "c3:de:eb:9c:82:70:a8:23:f3:4e:92:b8:07:d2:22:df"
- run: ./scripts/deploy/publish-artifacts.sh

docs_publish:
preview_mosaic_docs:
<<: *job_defaults
steps:
- add_ssh_keys:
fingerprints:
- "c3:de:eb:9c:82:70:a8:23:f3:4e:92:b8:07:d2:22:df"
- *checkout_code
- *restore_cache
- run: ./scripts/deploy/publish-docs.sh
- *attach_release_output
- run:
name: Setup Environment Variables
command: |
echo 'export CI_PREVIEW=true' >> $BASH_ENV
echo 'export SHORT_GIT_HASH=$(git rev-parse --short $CIRCLE_SHA1)' >> $BASH_ENV
echo 'export CIRCLE_PULL_REQUEST_NUMBER=$(echo "$CIRCLE_PULL_REQUEST" | cut -d"/" -f7)' >> $BASH_ENV
source $BASH_ENV
- run: yarn run build:docs
- run: yarn run docs:publish-preview


workflows:
Expand All @@ -155,6 +183,12 @@ workflows:
- build_mosaic:
requires:
- install

- build_mosaic_docs:
requires:
- build_cdk
- build_mosaic
- build_mosaic-moment-adapter
# 3 Group
- test_unit:
requires:
Expand All @@ -177,11 +211,7 @@ workflows:
branches:
only:
- master
- docs_publish:
- preview_mosaic_docs:
requires:
- build_mosaic_docs
- test_unit
- build_mosaic
filters:
branches:
only:
- master
79 changes: 59 additions & 20 deletions angular.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"mosaic-io": {
"root": "",
"mosaic-docs": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
},
"root": "packages/docs",
"sourceRoot": "packages/docs/src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"aot": true,
"sourceMap": false,
"outputPath": "dist",
"outputPath": "./dist/releases/mosaic-docs",
"index": "packages/docs/src/index.html",
"main": "packages/docs/src/main.ts",
"tsConfig": "packages/docs/src/tsconfig.json",
"polyfills": "packages/docs/src/polyfills.ts",
"tsConfig": "packages/docs/tsconfig.app.json",
"aot": false,
"assets": [
{
"glob": "**/*",
Expand All @@ -23,7 +31,7 @@
},
{
"glob": "**/*",
"input": "./node_modules/@ptsecurity/mosaic-examples/docs-content",
"input": "../../dist/docs-content",
"output": "/docs-content"
},
{
Expand All @@ -35,12 +43,22 @@
"styles": [
{
"input": "packages/docs/src/main.scss"
},
{
"input": "packages/docs/src/highlightjs/material-light.scss"
}

],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "packages/docs/src/environments/environment.ts",
"with": "packages/docs/src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
Expand All @@ -50,10 +68,11 @@
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
"budgets": [
{
"src": "packages/docs/src/environments/environment.ts",
"replaceWith": "packages/docs/src/environments/environment.prod.ts"
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
]
}
Expand All @@ -62,26 +81,46 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "mosaic-io:build"
"browserTarget": "mosaic-docs:build"
},
"configurations": {
"production": {
"browserTarget": "mosaic-io:build:production"
"browserTarget": "mosaic-docs:build:production"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"tsConfig": [
"packages/docs/src/tsconfig.json"
"main": "packages/docs/src/test.ts",
"polyfills": "packages/docs/src/polyfills.ts",
"tsConfig": "packages/docs/tsconfig.spec.json",
"karmaConfig": "packages/docs/karma.conf.js",
"assets": [
{
"glob": "**/*",
"input": "packages/docs/src/assets",
"output": "/assets"
},
{
"glob": "favicon.ico",
"input": "packages/docs/src",
"output": "/"
}
],
"exclude": [
"**/node_modules/**"
]
"styles": [
{
"input": "packages/docs/src/main.scss"
},
{
"input": "packages/docs/src/highlightjs/material-light.scss"
}
],
"scripts": []
}
}
}
}
}
},
"defaultProject": "mosaic-docs"
}
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@
"karma": "^4.1.0",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage": "^1.1.2",
"karma-coverage-istanbul-reporter": "^2.0.5",
"karma-jasmine": "^2.0.1",
"karma-jasmine-html-reporter": "^1.4.2",
"karma-junit-reporter": "^1.2.0",
"karma-remap-coverage": "^0.1.5",
"karma-sauce-launcher": "1.2.0",
Expand Down Expand Up @@ -146,6 +148,9 @@
"changelog": "gulp changelog",
"ng": "ng",
"docs:start": "ng serve",
"docs:prod-build": "ng build",
"docs:prod-build:aot": "ng build --aot --prod",
"docs:publish-preview": "ts-node --project ./scripts/tsconfig.deploy.json ./scripts/deploy/publish-docs-preview.ts",
"postinstall": "ngc -p angular.tsconfig.json",
"preinstall": "node ./tools/npm/check-npm.js",
"publish": "ts-node --project ./scripts/tsconfig.deploy.json ./scripts/deploy/publish-artifacts.ts",
Expand Down
25 changes: 25 additions & 0 deletions packages/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

## Development Setup
1. generate dynamic examples (for Stackblitz)
```bash
yarn run build:mosaic-examples
```

2. generate components for Docs App
```bash
yarn run build:mosaic
```
3. generate `docs-content` folder
```bash
yarn run build:docs
```


## Development Server
Start dev server documentation (aka ng serve)

```bash
yarn run docs:start
```

open http://localhost:4200/
12 changes: 12 additions & 0 deletions packages/docs/browserslist
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# You can see what browsers were selected by your queries by running:
# npx browserslist

> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.
32 changes: 32 additions & 0 deletions packages/docs/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/mosaic-docs'),
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
});
};
Empty file added packages/docs/scripts/.gitkeep
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
</mc-vertical-navbar-item>
</mc-vertical-navbar>


<div class="content">
<router-outlet></router-outlet>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mc-vertical-navbar {
}

.content {
margin-left: 64px;
margin-left: 218px;
}


Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ import { Component } from '@angular/core';
})
export class MainLayoutComponent {


}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ import { RouterModule } from '@angular/router';
import { McButtonModule } from '@ptsecurity/mosaic/button';
import { McDropdownModule } from '@ptsecurity/mosaic/dropdown';
import { McIconModule } from '@ptsecurity/mosaic/icon';
import { McTreeModule } from '@ptsecurity/mosaic/tree';
import { McVerticalNavbarModule } from '@ptsecurity/mosaic/vertical-navbar';

import { TreeComponent } from '../tree/tree.component';

import { MainLayoutComponent } from './main-layout.component';


Expand All @@ -14,13 +17,13 @@ import { MainLayoutComponent } from './main-layout.component';
CommonModule,
RouterModule,

McTreeModule,
McVerticalNavbarModule,
McButtonModule,
McIconModule,
McDropdownModule

],
exports: [MainLayoutComponent],
declarations: [MainLayoutComponent]
declarations: [MainLayoutComponent, TreeComponent]
})
export class MainLayoutModule {}
15 changes: 15 additions & 0 deletions packages/docs/src/app/components/tree/tree.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<mc-tree-selection
[dataSource]="dataSource"
[treeControl]="treeControl"
>

<mc-tree-option *mcTreeNodeDef="let node" mcTreeNodePadding>
{{ node.name }}
</mc-tree-option>

<mc-tree-option *mcTreeNodeDef="let node; when: hasChild" mcTreeNodePadding>
<i mc-icon="mc-angle-down-S_16" [style.transform]="treeControl.isExpanded(node) ? '' : 'rotate(-90deg)'" cdkTreeNodeToggle></i>
{{ node.name }} : {{ node.type }}
</mc-tree-option>
</mc-tree-selection>

Loading

0 comments on commit f0d4946

Please sign in to comment.