-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(devkit): add builder as a library
Recreate NgPackgrSchematics as a library. Publish a rc version and point is as a LinkingTool builder.
- Loading branch information
1 parent
780598c
commit c199b5b
Showing
36 changed files
with
6,200 additions
and
2,660 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'], | ||
transform: { | ||
'^.+\\.(ts|js|html)$': 'ts-jest' | ||
}, | ||
resolver: '@nrwl/jest/plugins/resolver', | ||
moduleFileExtensions: ['ts', 'js', 'html'], | ||
coverageReporters: ['html'], | ||
passWithNoTests: true | ||
}; |
7 changes: 0 additions & 7 deletions
7
libs/devkit/builders/build-ng-packagr-and-schematics/README.md
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
libs/devkit/builders/build-ng-packagr-and-schematics/src/build/index.js
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
libs/devkit/builders/build-ng-packagr-and-schematics/src/build/index.js.map
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
libs/devkit/builders/build-ng-packagr-and-schematics/src/build/index.ts
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
libs/devkit/builders/build-ng-packagr-and-schematics/src/build/ng-packagr-build.js
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
libs/devkit/builders/build-ng-packagr-and-schematics/src/build/ng-packagr-build.js.map
This file was deleted.
Oops, something went wrong.
43 changes: 0 additions & 43 deletions
43
libs/devkit/builders/build-ng-packagr-and-schematics/src/build/schematics.build.js
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
libs/devkit/builders/build-ng-packagr-and-schematics/src/build/schematics.build.js.map
This file was deleted.
Oops, something went wrong.
40 changes: 0 additions & 40 deletions
40
libs/devkit/builders/build-ng-packagr-and-schematics/src/build/schematics.build.ts
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
libs/devkit/builders/build-ng-packagr-and-schematics/src/index.js
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
libs/devkit/builders/build-ng-packagr-and-schematics/src/index.js.map
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
libs/devkit/builders/build-ng-packagr-and-schematics/src/index.ts
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
libs/devkit/builders/build-ng-packagr-and-schematics/tsconfig.lib.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# devkit-builders-ng-packagr-schematics | ||
|
||
This library was generated with [Nx](https://nx.dev). | ||
|
||
## Running unit tests | ||
|
||
Run `ng test devkit-builders-ng-packagr-schematics` to execute the unit tests via [Jest](https://jestjs.io). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...-ng-packagr-and-schematics/jest.config.js → ...ders/ng-packagr-schematics/jest.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
module.exports = { | ||
name: 'devkit-builders-build-ng-packagr-and-schematics', | ||
name: 'devkit-builders-ng-packagr-schematics', | ||
preset: '../../../../jest.config.js', | ||
transform: { | ||
'^.+\\.[tj]sx?$': 'ts-jest' | ||
}, | ||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'], | ||
coverageDirectory: '../../../../coverage/libs/devkit/builders/build-ng-packagr-and-schematics' | ||
coverageDirectory: '../../../../coverage/libs/devkit/builders/ng-packagr-schematics' | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './lib/build'; |
5 changes: 5 additions & 0 deletions
5
libs/devkit/builders/ng-packagr-schematics/src/lib/build/builder.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface Builder { | ||
build(): Promise<void>; | ||
|
||
watch(): Promise<void>; | ||
} |
29 changes: 29 additions & 0 deletions
29
libs/devkit/builders/ng-packagr-schematics/src/lib/build/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { BuilderContext, BuilderOutput, createBuilder } from '@angular-devkit/architect'; | ||
import { combineLatest, from, Observable } from 'rxjs'; | ||
import { last, mapTo, switchMap } from 'rxjs/operators'; | ||
import { initialize as initializeNgPackagrBuilder } from './ng-packagr-build'; | ||
import { initialize as initializeSchematicsBuilder } from './schematics.build'; | ||
import { JsonObject } from '@angular-devkit/core'; | ||
|
||
interface Options extends JsonObject { | ||
project: string; | ||
tsConfigRuntime: string; | ||
tsConfigSchematics: string; | ||
watch?: boolean; | ||
} | ||
|
||
export function execute(options: Options, context: BuilderContext): Observable<BuilderOutput> { | ||
return combineLatest([ | ||
from( | ||
initializeNgPackagrBuilder( | ||
{ ...options, tsConfig: options.tsConfigRuntime }, | ||
context.workspaceRoot | ||
) | ||
).pipe(switchMap(packager => (options.watch ? packager.watch() : packager.build()))), | ||
from(initializeSchematicsBuilder(options, context.workspaceRoot)).pipe( | ||
switchMap(builder => (options.watch ? builder.watch() : builder.build())) | ||
) | ||
]).pipe(last(), mapTo({ success: true })); | ||
} | ||
|
||
export default createBuilder(execute); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.