Skip to content

Commit b2f98de

Browse files
committed
feat(composer): add library skeleton
re orchestratora/rfcs#2
1 parent 9aad188 commit b2f98de

16 files changed

Lines changed: 2223 additions & 1703 deletions

angular.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,38 @@
239239
}
240240
},
241241
"schematics": {}
242+
},
243+
"composer": {
244+
"root": "libs/composer",
245+
"sourceRoot": "libs/composer/src",
246+
"projectType": "library",
247+
"prefix": "orc",
248+
"architect": {
249+
"build": {
250+
"builder": "@angular-devkit/build-ng-packagr:build",
251+
"options": {
252+
"tsConfig": "libs/composer/tsconfig.lib.json",
253+
"project": "libs/composer/ng-package.json"
254+
}
255+
},
256+
"lint": {
257+
"builder": "@angular-devkit/build-angular:tslint",
258+
"options": {
259+
"tsConfig": [
260+
"libs/composer/tsconfig.lib.json",
261+
"libs/composer/tsconfig.spec.json"
262+
],
263+
"exclude": ["**/node_modules/**"]
264+
}
265+
},
266+
"test": {
267+
"builder": "@angular-builders/jest:run",
268+
"options": {
269+
"configPath": "jest.config.js"
270+
}
271+
}
272+
},
273+
"schematics": {}
242274
}
243275
},
244276
"cli": {

libs/composer/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Composer
2+
3+
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.2.0.
4+
5+
## Code scaffolding
6+
7+
Run `ng generate component component-name --project composer` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project composer`.
8+
9+
> Note: Don't forget to add `--project composer` or else it will be added to the default project in your `angular.json` file.
10+
11+
## Build
12+
13+
Run `ng build composer` to build the project. The build artifacts will be stored in the `dist/` directory.
14+
15+
## Publishing
16+
17+
After building your library with `ng build composer`, go to the dist folder `cd dist/composer` and run `npm publish`.
18+
19+
## Running unit tests
20+
21+
Run `ng test composer` to execute the unit tests via [Karma](https://karma-runner.github.io).
22+
23+
## Further help
24+
25+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

libs/composer/ng-package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3+
"dest": "../../dist/libs/composer",
4+
"lib": {
5+
"entryFile": "src/public_api.ts",
6+
"umdId": "orchestrator.composer",
7+
"umdModuleIds": {
8+
"@orchestrator/core": "orchestrator.core"
9+
}
10+
}
11+
}

libs/composer/package.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "@orchestrator/composer",
3+
"version": "0.0.0",
4+
"publishConfig": {
5+
"access": "public"
6+
},
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/orchestratora/orchestrator.git"
10+
},
11+
"keywords": [
12+
"utility",
13+
"ui",
14+
"orchestrator",
15+
"components",
16+
"angular"
17+
],
18+
"author": "Orchestrator <orchestratora@gmail.com>",
19+
"license": "MIT",
20+
"peerDependencies": {
21+
"@angular/common": "^7.0.0",
22+
"@angular/core": "^7.0.0",
23+
"@orchestrator/core": "^0.0.0"
24+
}
25+
}

libs/composer/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './public_api';
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { async, TestBed } from '@angular/core/testing';
2+
import { ComposerModule } from './composer.module';
3+
4+
describe('ComposerModule', () => {
5+
beforeEach(async(() => {
6+
TestBed.configureTestingModule({
7+
imports: [ComposerModule],
8+
}).compileComponents();
9+
}));
10+
11+
it('should create', () => {
12+
expect(ComposerModule).toBeDefined();
13+
});
14+
});
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { NgModule } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
4+
@NgModule({
5+
imports: [CommonModule],
6+
})
7+
export class ComposerModule {}

libs/composer/src/public_api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './lib/composer.module';

libs/composer/src/test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
2+
3+
import 'core-js/es7/reflect';
4+
import 'zone.js/dist/zone';
5+
import 'zone.js/dist/zone-testing';
6+
import { getTestBed } from '@angular/core/testing';
7+
import {
8+
BrowserDynamicTestingModule,
9+
platformBrowserDynamicTesting,
10+
} from '@angular/platform-browser-dynamic/testing';
11+
12+
declare const require: any;
13+
14+
// First, initialize the Angular testing environment.
15+
getTestBed().initTestEnvironment(
16+
BrowserDynamicTestingModule,
17+
platformBrowserDynamicTesting(),
18+
);
19+
// Then we find all the tests.
20+
const context = require.context('./', true, /\.spec\.ts$/);
21+
// And load the modules.
22+
context.keys().map(context);

libs/composer/tsconfig.lib.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../../dist/out-tsc/libs/composer",
5+
"target": "es2015",
6+
"module": "es2015",
7+
"moduleResolution": "node",
8+
"declaration": true,
9+
"sourceMap": true,
10+
"inlineSources": true,
11+
"emitDecoratorMetadata": true,
12+
"experimentalDecorators": true,
13+
"types": [],
14+
"lib": ["dom", "es2018"],
15+
"paths": {
16+
"@orchestrator/*": ["dist/libs/*"]
17+
}
18+
},
19+
"angularCompilerOptions": {
20+
"annotateForClosureCompiler": true,
21+
"skipTemplateCodegen": true,
22+
"strictMetadataEmit": true,
23+
"fullTemplateTypeCheck": true,
24+
"strictInjectionParameters": true,
25+
"enableResourceInlining": true
26+
},
27+
"exclude": ["src/test.ts", "**/*.spec.ts"]
28+
}

0 commit comments

Comments
 (0)