diff --git a/foo/public_api.ts b/foo/public_api.ts deleted file mode 100644 index 1ab970197..000000000 --- a/foo/public_api.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './bar'; diff --git a/sample/README.md b/sample/README.md new file mode 100644 index 000000000..e6a4d9352 --- /dev/null +++ b/sample/README.md @@ -0,0 +1,4 @@ +Best library in town! +===================== + +> Yep, for sure. diff --git a/sample/package.json b/sample/package.json new file mode 100644 index 000000000..4b1552d49 --- /dev/null +++ b/sample/package.json @@ -0,0 +1,12 @@ +{ + "name": "@foo/bar", + "version": "1.0.0-alpha.0", + "repository": "https://github.com/dherges/ng-packagr.git", + "author": "david ", + "license": "MIT", + "private": true, + "peerDependencies": { + "@angular/core": "^4.1.2", + "@angular/common": "^4.1.2" + } +} diff --git a/foo/bar.html b/sample/src/bar.html similarity index 100% rename from foo/bar.html rename to sample/src/bar.html diff --git a/foo/bar.scss b/sample/src/bar.scss similarity index 100% rename from foo/bar.scss rename to sample/src/bar.scss diff --git a/foo/bar.ts b/sample/src/bar.ts similarity index 100% rename from foo/bar.ts rename to sample/src/bar.ts diff --git a/sample/src/foo/foo.component.ts b/sample/src/foo/foo.component.ts new file mode 100644 index 000000000..ae0877aca --- /dev/null +++ b/sample/src/foo/foo.component.ts @@ -0,0 +1,24 @@ +import { Component } from '@angular/core'; +import { Http, Response } from '@angular/http'; +import { Observable } from 'rxjs/Observable'; +import 'rxjs/add/operator/map'; + +@Component({ + selector: 'foo-component', + template: 'foo' +}) +export class FooComponent { + + constructor( + private http: Http + ) {} + + doSomething() { + + this.http.get('/foo/bar') + .map((res: Response) => res.ok) + .subscribe(); + + } + +} diff --git a/sample/src/public_api.ts b/sample/src/public_api.ts new file mode 100644 index 000000000..e4f72b087 --- /dev/null +++ b/sample/src/public_api.ts @@ -0,0 +1,2 @@ +export * from './bar'; +export * from './foo/foo.component'; diff --git a/sample/tsconfig.lib.json b/sample/tsconfig.lib.json new file mode 100644 index 000000000..e71167bb8 --- /dev/null +++ b/sample/tsconfig.lib.json @@ -0,0 +1,41 @@ +{ + "angularCompilerOptions": { + "annotateForClosureCompiler": true, + "flatModuleId": "@foo/bar", + "flatModuleOutFile": "index", + "skipTemplateCodegen": true, + "strictMetadataEmit": true + }, + "buildOnSave": false, + "compileOnSave": false, + "compilerOptions": { + "baseUrl": "", + "target": "es2015", + "module": "es2015", + "moduleResolution": "node", + "outDir": "", + "declaration": true, + "sourceMap": true, + "inlineSources": true, + "skipLibCheck": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "typeRoots": [ + "node_modules/@types" + ], + "lib": [ + "dom", + "es2015" + ] + }, + "exclude": [ + "node_modules", + "dist", + "**/*.ngfactory.ts", + "**/*.shim.ts", + "**/*.spec.ts" + ], + "files": [ + "src/public_api.ts" + ] +}