diff --git a/angular.json b/angular.json index a0dbac90e..da7a6f58e 100644 --- a/angular.json +++ b/angular.json @@ -14,7 +14,7 @@ "outputPath": "dist", "index": "packages/docs/src/index.html", "main": "packages/docs/src/main.ts", - "tsConfig": "packages/docs/src/tsconfig.json", + "tsConfig": "packages/docs/tsconfig.json", "assets": [ { "glob": "**/*", @@ -74,7 +74,7 @@ "builder": "@angular-devkit/build-angular:tslint", "options": { "tsConfig": [ - "packages/docs/src/tsconfig.json" + "packages/docs/tsconfig.json" ], "exclude": [ "**/node_modules/**" diff --git a/packages/docs/README.md b/packages/docs/README.md new file mode 100644 index 000000000..539ab99a5 --- /dev/null +++ b/packages/docs/README.md @@ -0,0 +1,6 @@ + +1. build:mosaic-examples +2. build:mosaic +3. build:docs + +and run serve - docs:start \ No newline at end of file diff --git a/packages/docs/src/app/docs.module.ts b/packages/docs/src/app/docs.module.ts index 16f912573..dd913b1f3 100644 --- a/packages/docs/src/app/docs.module.ts +++ b/packages/docs/src/app/docs.module.ts @@ -5,6 +5,7 @@ import { FormsModule } from '@angular/forms'; import { BrowserModule } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { RouterModule } from '@angular/router'; +import { ExampleModule } from '@ptsecurity/mosaic-examples'; import { MainLayoutComponent } from './components/main-layout/main-layout.component'; import { MainLayoutModule } from './components/main-layout/main-layout.module'; @@ -18,6 +19,7 @@ import { } from './containers/component-viwer/component-viewer.component'; import { ComponentViewerModule } from './containers/component-viwer/component-viewer.module'; import { DocsComponent } from './docs.component'; +import { DocumentationItems } from './shared/documentation-items/documentation-items'; @NgModule({ @@ -26,6 +28,7 @@ import { DocsComponent } from './docs.component'; BrowserAnimationsModule, FormsModule, HttpClientModule, + ExampleModule, RouterModule.forRoot([ { path: '', component: HomepageComponent, pathMatch: 'full' }, @@ -68,7 +71,7 @@ import { DocsComponent } from './docs.component'; ], declarations: [DocsComponent], providers: [ - + DocumentationItems, { provide: LocationStrategy, useClass: PathLocationStrategy diff --git a/packages/docs/src/tsconfig.json b/packages/docs/src/tsconfig.json deleted file mode 100644 index 71c409f9b..000000000 --- a/packages/docs/src/tsconfig.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "compilerOptions": { - "declaration": false, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "lib": [ - "es6", - "dom" - ], - "mapRoot": "./", - "module": "es6", - "moduleResolution": "node", - "outDir": "../dist/out-tsc", - "sourceMap": true, - "target": "es5", - "baseUrl": ".", - "paths": { - "@ptsecurity/cdk/*": [ - "../../../dist/packages/cdk/*" - ], - "@ptsecurity/mosaic/*": [ - "../../../dist/packages/mosaic/*" - ], - "@ptsecurity/mosaic-moment-adapter/*": [ - "../../../dit/packages/mosaic-moment-adapter/*" - ], - - "@ptsecurity/mosaic-examples/*": [ - "../../../dist/packages/mosaic-examples/*" - ], - "@ptsecurity/mosaic-examples": [ - "../../../dist/packages/mosaic-examples/public-api" - ] - } - }, - "exclude": [ - "assets" - ] -} diff --git a/packages/docs/tsconfig.json b/packages/docs/tsconfig.json new file mode 100644 index 000000000..4c53d4693 --- /dev/null +++ b/packages/docs/tsconfig.json @@ -0,0 +1,37 @@ +{ + "compilerOptions": { + "declaration": false, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "lib": [ + "es2017", + "dom" + ], + + "module": "es2015", + "moduleResolution": "node", + "outDir": "./dist/out-tsc", + "sourceMap": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "importHelpers": true, + "target": "es2015", + "baseUrl": ".", + "paths": { + "@ptsecurity/cdk/*": ["../../dist/packages/cdk/*"], + "@ptsecurity/cdk": ["../../dist/packages/cdk"], + + "@ptsecurity/mosaic/*": ["../../dist/packages/mosaic/*"], + + "@ptsecurity/mosaic-moment-adapter/*": ["../../dist/packages/mosaic-moment-adapter/*"], + "@ptsecurity/mosaic-moment-adapter": ["../../dist/packages/mosaic-moment-adapter"], + + "@ptsecurity/mosaic-examples/*": ["../../dist/releases/mosaic-examples/*"], + "@ptsecurity/mosaic-examples": ["../../dist/packages/mosaic-examples"] + } + }, + "exclude": [ + "assets" + ], + "include": ["./**/*.ts"] +} diff --git a/packages/mosaic-examples/button-basic/button-basic-example.css b/packages/mosaic-examples/button-overview/button-overview-example.css similarity index 100% rename from packages/mosaic-examples/button-basic/button-basic-example.css rename to packages/mosaic-examples/button-overview/button-overview-example.css diff --git a/packages/mosaic-examples/button-basic/button-basic-example.html b/packages/mosaic-examples/button-overview/button-overview-example.html similarity index 100% rename from packages/mosaic-examples/button-basic/button-basic-example.html rename to packages/mosaic-examples/button-overview/button-overview-example.html diff --git a/packages/mosaic-examples/button-basic/button-basic-example.ts b/packages/mosaic-examples/button-overview/button-overview-example.ts similarity index 50% rename from packages/mosaic-examples/button-basic/button-basic-example.ts rename to packages/mosaic-examples/button-overview/button-overview-example.ts index 0a94ec3fd..f94a7c3da 100644 --- a/packages/mosaic-examples/button-basic/button-basic-example.ts +++ b/packages/mosaic-examples/button-overview/button-overview-example.ts @@ -6,8 +6,8 @@ import { Component } from '@angular/core'; */ @Component({ selector: 'button-basic-example', - templateUrl: 'button-basic-example.html', - styleUrls: ['button-basic-example.css'] + templateUrl: 'button-overview-example.html', + styleUrls: ['button-overview-example.css'] }) -export class ButtonBasicExample { +export class ButtonOverviewExample { } diff --git a/packages/mosaic-examples/tsconfig.build.json b/packages/mosaic-examples/tsconfig.build.json index ad3c99ec9..031825520 100644 --- a/packages/mosaic-examples/tsconfig.build.json +++ b/packages/mosaic-examples/tsconfig.build.json @@ -17,7 +17,10 @@ "module": "es2015", "moduleResolution": "node", "outDir": "../../dist/packages/mosaic-examples", - "rootDir": ".", + "rootDirs": [ + ".", + "../../dist/packages/mosaic-examples" + ], "sourceMap": true, "inlineSources": true, "target": "es2015", @@ -29,15 +32,13 @@ "@ptsecurity/mosaic/*": [ "../../dist/packages/mosaic/*" ], - "@ptsecurity/mosaic": [ - "../../dist/packages/mosaic/public-api" - ], +// "@ptsecurity/mosaic": [ +// "../../dist/packages/mosaic/public-api" +// ], "@ptsecurity/cdk/*": [ "../../dist/packages/cdk/*" ], - "@ptsecurity/mosaic-moment-adapter": [ - "../../dist/packages/mosaic-moment-adapter" - ] + "@ptsecurity/mosaic-moment-adapter/*": ["../../dist/packages/mosaic-moment-adapter/*"] } }, "files": [ diff --git a/tools/gulp/gulpfile.ts b/tools/gulp/gulpfile.ts index 1c9882fe4..ccbde652f 100644 --- a/tools/gulp/gulpfile.ts +++ b/tools/gulp/gulpfile.ts @@ -1,6 +1,8 @@ +import { task, series } from 'gulp'; + import { createPackageBuildTasks } from '../packages'; -import { cdkPackage, examplesPackage, mosaicPackage, momentAdapterPackage } from './packages'; +import { cdkPackage, examplesPackage, mosaicPackage, momentAdapterPackage, allBuildPackages } from './packages'; /* tslint:disable:no-import-side-effect ordered-imports */ // THIS ORDER OF IMPORTS AND CALLS IS IMPORTANT @@ -23,4 +25,13 @@ import './tasks/docs'; import './tasks/payload'; import './tasks/changelog'; import './tasks/validate-licenses'; + + /* tslint:enable:no-import-side-effect */ + + +/** Task that builds all available release packages. */ +task('all-build-release-packages', series( + ...allBuildPackages.map((buildPackage) => `${buildPackage.name}:build-release`) +)); + diff --git a/tools/gulp/packages.ts b/tools/gulp/packages.ts index 40460fc15..dadbc7809 100644 --- a/tools/gulp/packages.ts +++ b/tools/gulp/packages.ts @@ -17,3 +17,10 @@ mosaicPackage.sourceDir = join(buildConfig.packagesDir, 'mosaic'); cdkPackage.copySecondaryEntryPointStylesToRoot = true; cdkPackage.hasSchematics = true; + +export const allBuildPackages = [ + cdkPackage, + momentAdapterPackage, + mosaicPackage, + examplesPackage +]; diff --git a/tools/gulp/tasks/docs.ts b/tools/gulp/tasks/docs.ts index c8c01656e..3bdeafdc3 100644 --- a/tools/gulp/tasks/docs.ts +++ b/tools/gulp/tasks/docs.ts @@ -145,7 +145,6 @@ task('copy-stackblitz-examples', () => { }); task('docs', series( - 'clean', 'markdown-docs-mosaic', 'build-highlighted-examples', 'build-examples-module',