diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a7c256851b..2e09483cc8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -217,7 +217,6 @@ The following is the list of supported scopes: * **@angular-devkit/architect-cli** * **@angular-devkit/benchmark** * **@angular-devkit/build-angular** -* **@angular-devkit/build-ng-packagr** * **@angular-devkit/build-optimizer** * **@angular-devkit/build-webpack** * **@angular-devkit/core** diff --git a/README.md b/README.md index 9dc61923c8..d8179b1d15 100644 --- a/README.md +++ b/README.md @@ -186,7 +186,6 @@ This is a monorepo which contains many tools and packages: |---|---|---|---| **Architect** | [`@angular-devkit/architect`](https://npmjs.com/package/@angular-devkit/architect) | [![latest](https://img.shields.io/npm/v/%40angular-devkit%2Farchitect/latest.svg)](https://npmjs.com/package/@angular-devkit/architect) | [![README](https://img.shields.io/badge/README--green.svg)](/packages/angular_devkit/architect/README.md) [![snapshot](https://img.shields.io/badge/snapshot--blue.svg)](https://github.com/angular/angular-devkit-architect-builds) **Build Angular** | [`@angular-devkit/build-angular`](https://npmjs.com/package/@angular-devkit/build-angular) | [![latest](https://img.shields.io/npm/v/%40angular-devkit%2Fbuild-angular/latest.svg)](https://npmjs.com/package/@angular-devkit/build-angular) | [![README](https://img.shields.io/badge/README--green.svg)](/packages/angular_devkit/build_angular/README.md) [![snapshot](https://img.shields.io/badge/snapshot--blue.svg)](https://github.com/angular/angular-devkit-build-angular-builds) -**Build NgPackagr** | [`@angular-devkit/build-ng-packagr`](https://npmjs.com/package/@angular-devkit/build-ng-packagr) | [![latest](https://img.shields.io/npm/v/%40angular-devkit%2Fbuild-ng-packagr/latest.svg)](https://npmjs.com/package/@angular-devkit/build-ng-packagr) | [![README](https://img.shields.io/badge/README--green.svg)](/packages/angular_devkit/build_ng_packagr/README.md) [![snapshot](https://img.shields.io/badge/snapshot--blue.svg)](https://github.com/angular/angular-devkit-build-ng-packagr-builds) **Build Optimizer** | [`@angular-devkit/build-optimizer`](https://npmjs.com/package/@angular-devkit/build-optimizer) | [![latest](https://img.shields.io/npm/v/%40angular-devkit%2Fbuild-optimizer/latest.svg)](https://npmjs.com/package/@angular-devkit/build-optimizer) | [![README](https://img.shields.io/badge/README--green.svg)](/packages/angular_devkit/build_optimizer/README.md) [![snapshot](https://img.shields.io/badge/snapshot--blue.svg)](https://github.com/angular/angular-devkit-build-optimizer-builds) **Build Webpack** | [`@angular-devkit/build-webpack`](https://npmjs.com/package/@angular-devkit/build-webpack) | [![latest](https://img.shields.io/npm/v/%40angular-devkit%2Fbuild-webpack/latest.svg)](https://npmjs.com/package/@angular-devkit/build-webpack) | [![README](https://img.shields.io/badge/README--green.svg)](/packages/angular_devkit/build_webpack/README.md) [![snapshot](https://img.shields.io/badge/snapshot--blue.svg)](https://github.com/angular/angular-devkit-build-webpack-builds) **Core** | [`@angular-devkit/core`](https://npmjs.com/package/@angular-devkit/core) | [![latest](https://img.shields.io/npm/v/%40angular-devkit%2Fcore/latest.svg)](https://npmjs.com/package/@angular-devkit/core) | [![README](https://img.shields.io/badge/README--green.svg)](/packages/angular_devkit/core/README.md) [![snapshot](https://img.shields.io/badge/snapshot--blue.svg)](https://github.com/angular/angular-devkit-core-builds) diff --git a/packages/angular_devkit/build_ng_packagr/BUILD.bazel b/packages/angular_devkit/build_ng_packagr/BUILD.bazel deleted file mode 100644 index e4caded5a3..0000000000 --- a/packages/angular_devkit/build_ng_packagr/BUILD.bazel +++ /dev/null @@ -1,110 +0,0 @@ -# Copyright Google Inc. All Rights Reserved. -# -# Use of this source code is governed by an MIT-style license that can be -# found in the LICENSE file at https://angular.io/license - -load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test") -load("//tools:defaults.bzl", "ts_library") -load("//tools:ts_json_schema.bzl", "ts_json_schema") - -# @external_begin -load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") -load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm") -# @external_end - -licenses(["notice"]) # MIT - -package(default_visibility = ["//visibility:public"]) - -ts_json_schema( - name = "schema", - src = "src/build/schema.json", -) - -ts_library( - name = "build_ng_packagr", - srcs = glob( - include = ["src/**/*.ts"], - exclude = ["src/**/*_spec.ts"], - ) + [ - "//packages/angular_devkit/build_ng_packagr:src/build/schema.ts", - ], - data = [ - "builders.json", - "package.json", - "src/build/schema.json", - ], - module_name = "@angular-devkit/build-ng-packagr", - module_root = "src/index.d.ts", - deps = [ - "//packages/angular_devkit/architect", - "@npm//@types/node", - "@npm//ng-packagr", - "@npm//rxjs", - ], -) - -# @external_begin -pkg_npm( - name = "npm_package", - deps = [ - ":build_ng_packagr", - ], -) - -pkg_tar( - name = "npm_package_archive", - srcs = [":npm_package"], - extension = "tar.gz", - strip_prefix = "./npm_package", - tags = ["manual"], -) -# @external_end - -ts_library( - name = "build_ng_packagr_test_lib", - testonly = True, - srcs = glob( - include = [ - "src/test-utils.ts", - "src/**/*_spec.ts", - ], - ), - data = glob(["test/**/*"]), - deps = [ - ":build_ng_packagr", - "//packages/angular_devkit/architect", - "//packages/angular_devkit/architect/node", - "//packages/angular_devkit/architect/testing", - "//packages/angular_devkit/core", - "@npm//@angular/common", - "@npm//@angular/compiler", - "@npm//@angular/compiler-cli", - "@npm//@angular/core", - "@npm//@angular/platform-browser", - "@npm//@angular/platform-browser-dynamic", - "@npm//@angular/router", - "@npm//ng-packagr", - "@npm//rxjs", - "@npm//tslib", - "@npm//typescript", - "@npm//zone.js", - ], -) - -jasmine_node_test( - name = "build_ng_packagr_test", - srcs = ["build_ng_packagr_test_lib"], - tags = ["cpu:2"], - templated_args = ["--nobazel_patch_module_resolver"], -) - -jasmine_node_test( - name = "build_ng_packagr_ve_test", - srcs = ["build_ng_packagr_test_lib"], - tags = ["cpu:2"], - templated_args = [ - "--nobazel_patch_module_resolver", - "view_engine", - ], -) diff --git a/packages/angular_devkit/build_ng_packagr/README.md b/packages/angular_devkit/build_ng_packagr/README.md deleted file mode 100644 index acfeaea954..0000000000 --- a/packages/angular_devkit/build_ng_packagr/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Angular Build Architect for ng-packagr - -WIP \ No newline at end of file diff --git a/packages/angular_devkit/build_ng_packagr/builders.json b/packages/angular_devkit/build_ng_packagr/builders.json deleted file mode 100644 index 3a699cdb21..0000000000 --- a/packages/angular_devkit/build_ng_packagr/builders.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "$schema": "../architect/src/builders-schema.json", - "builders": { - "build": { - "implementation": "./src/build", - "schema": "./src/build/schema.json", - "description": "Build a library with ng-packagr." - } - } -} diff --git a/packages/angular_devkit/build_ng_packagr/package.json b/packages/angular_devkit/build_ng_packagr/package.json deleted file mode 100644 index f74f197d7d..0000000000 --- a/packages/angular_devkit/build_ng_packagr/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "@angular-devkit/build-ng-packagr", - "version": "0.0.0", - "description": "Angular Build Architect for ng-packagr", - "experimental": true, - "main": "src/index.js", - "typings": "src/index.d.ts", - "builders": "builders.json", - "dependencies": { - "@angular-devkit/architect": "0.0.0", - "rxjs": "6.6.3" - }, - "peerDependencies": { - "ng-packagr": "^10.0.0", - "tsickle": "~0.39.0" - }, - "devDependencies": { - "@angular/compiler": "11.0.0-next.4", - "@angular/compiler-cli": "11.0.0-next.4", - "@angular-devkit/core": "0.0.0", - "ng-packagr": "~10.1.0", - "tslib": "^2.0.0" - }, - "peerDependenciesMeta": { - "tsickle": { - "optional": true - } - } -} \ No newline at end of file diff --git a/packages/angular_devkit/build_ng_packagr/src/build/index.ts b/packages/angular_devkit/build_ng_packagr/src/build/index.ts deleted file mode 100644 index 4365114ee8..0000000000 --- a/packages/angular_devkit/build_ng_packagr/src/build/index.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -import { BuilderContext, BuilderOutput, createBuilder } from '@angular-devkit/architect'; -import { resolve } from 'path'; -import { Observable, from } from 'rxjs'; -import { mapTo, switchMap } from 'rxjs/operators'; -import { Schema } from './schema'; - -/** @deprecated Since 10.1 use `NgPackagrBuilderOptions` from `@angular-devkit/build-angular` instead. */ -export type NgPackagrBuilderOptions = Schema; - -async function initialize( - options: NgPackagrBuilderOptions, - root: string, -): Promise { - const packager = (await import('ng-packagr')).ngPackagr(); - - packager.forProject(resolve(root, options.project)); - - if (options.tsConfig) { - packager.withTsConfig(resolve(root, options.tsConfig)); - } - - return packager; -} - -/** @deprecated Since 10.1 use `executeNgPackagrBuilder` from `@angular-devkit/build-angular` instead. */ -export function execute( - options: NgPackagrBuilderOptions, - context: BuilderContext, -): Observable { - return from(initialize(options, context.workspaceRoot)).pipe( - switchMap(packager => options.watch ? packager.watch() : packager.build()), - mapTo({ success: true }), - ); -} - -export default createBuilder & NgPackagrBuilderOptions>(execute); diff --git a/packages/angular_devkit/build_ng_packagr/src/build/index_spec.ts b/packages/angular_devkit/build_ng_packagr/src/build/index_spec.ts deleted file mode 100644 index c06fcab942..0000000000 --- a/packages/angular_devkit/build_ng_packagr/src/build/index_spec.ts +++ /dev/null @@ -1,129 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -import { Architect } from '@angular-devkit/architect'; -import { WorkspaceNodeModulesArchitectHost } from '@angular-devkit/architect/node'; -import { TestProjectHost, TestingArchitectHost } from '@angular-devkit/architect/testing'; -import { - getSystemPath, - join, - normalize, - schema, - virtualFs, - workspaces, -} from '@angular-devkit/core'; // tslint:disable-line:no-implicit-dependencies -import { map, take, tap } from 'rxjs/operators'; - -// Default timeout for large specs is 2.5 minutes. -jasmine.DEFAULT_TIMEOUT_INTERVAL = 150000; - -// This flag controls whether AOT compilation uses Ivy or View Engine (VE). -export let veEnabled = process.argv.some(arg => arg == 'view_engine'); -export const workspaceRoot = join(normalize(__dirname), `../../test/ng-packaged/`); - -describe('NgPackagr Builder', () => { - const host = new TestProjectHost(workspaceRoot); - let architect: Architect; - - beforeEach(async () => { - await host.initialize().toPromise(); - - const registry = new schema.CoreSchemaRegistry(); - registry.addPostTransform(schema.transforms.addUndefinedDefaults); - - const workspaceSysPath = getSystemPath(host.root()); - const { workspace } = await workspaces.readWorkspace( - workspaceSysPath, - workspaces.createWorkspaceHost(host), - ); - const architectHost = new TestingArchitectHost( - workspaceSysPath, - workspaceSysPath, - new WorkspaceNodeModulesArchitectHost(workspace, workspaceSysPath), - ); - - architect = new Architect(architectHost, registry); - - // Set AOT compilation to use VE if needed. - if (veEnabled) { - host.replaceInFile('tsconfig.json', `"enableIvy": true,`, `"enableIvy": false,`); - } - }); - - afterEach(() => host.restore().toPromise()); - - it('builds and packages a library', async () => { - const run = await architect.scheduleTarget({ project: 'lib', target: 'build' }); - - await expectAsync(run.result).toBeResolvedTo(jasmine.objectContaining({ success: true })); - - await run.stop(); - - expect(host.scopedSync().exists(normalize('./dist/lib/fesm2015/lib.js'))).toBe(true); - const content = virtualFs.fileBufferToString( - host.scopedSync().read(normalize('./dist/lib/fesm2015/lib.js')), - ); - expect(content).toContain('lib works'); - - if (veEnabled) { - expect(content).not.toContain('ɵcmp'); - } else { - expect(content).toContain('ɵcmp'); - } - }); - - it('rebuilds on TS file changes', async () => { - const goldenValueFiles: { [path: string]: string } = { - 'projects/lib/src/lib/lib.component.ts': ` - import { Component } from '@angular/core'; - - @Component({ - selector: 'lib', - template: 'lib update works!' - }) - export class LibComponent { } - `, - }; - - const run = await architect.scheduleTarget( - { project: 'lib', target: 'build' }, - { watch: true }, - ); - - let buildNumber = 0; - - await run.output.pipe( - tap((buildEvent) => expect(buildEvent.success).toBe(true)), - map(() => { - const fileName = './dist/lib/fesm2015/lib.js'; - const content = virtualFs.fileBufferToString( - host.scopedSync().read(normalize(fileName)), - ); - - return content; - }), - tap(content => { - buildNumber += 1; - switch (buildNumber) { - case 1: - expect(content).toMatch(/lib works/); - host.writeMultipleFiles(goldenValueFiles); - break; - - case 2: - expect(content).toMatch(/lib update works/); - break; - default: - break; - } - }), - take(2), - ).toPromise(); - - await run.stop(); - }); -}); diff --git a/packages/angular_devkit/build_ng_packagr/src/build/schema.json b/packages/angular_devkit/build_ng_packagr/src/build/schema.json deleted file mode 100644 index a72def3150..0000000000 --- a/packages/angular_devkit/build_ng_packagr/src/build/schema.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema", - "title": "ng-packagr Target", - "description": "ng-packagr target options for Build Architect. Use to build library projects.", - "type": "object", - "properties": { - "project": { - "type": "string", - "description": "The file path for the ng-packagr configuration file, relative to the current workspace." - }, - "tsConfig": { - "type": "string", - "description": "The full path for the TypeScript configuration file, relative to the current workspace." - }, - "watch": { - "type": "boolean", - "description": "Run build when files change.", - "default": false - } - }, - "additionalProperties": false, - "required": [ - "project" - ] -} diff --git a/packages/angular_devkit/build_ng_packagr/src/index.ts b/packages/angular_devkit/build_ng_packagr/src/index.ts deleted file mode 100644 index 51ed774b37..0000000000 --- a/packages/angular_devkit/build_ng_packagr/src/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -export * from './build'; diff --git a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/.gitignore b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/.gitignore deleted file mode 100644 index 54bfd2001e..0000000000 --- a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/.gitignore +++ /dev/null @@ -1,42 +0,0 @@ -# See http://help.github.com/ignore-files/ for more about ignoring files. - -# compiled output -/dist -/tmp -/out-tsc - -# dependencies -/node_modules - -# IDEs and editors -/.idea -.project -.classpath -.c9/ -*.launch -.settings/ -*.sublime-workspace - -# IDE - VSCode -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json - -# misc -/.sass-cache -/connect.lock -/coverage -/libpeerconnection.log -npm-debug.log -testem.log -/typings - -# e2e -/e2e/*.js -/e2e/*.map - -# System Files -.DS_Store -Thumbs.db diff --git a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/angular.json b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/angular.json deleted file mode 100644 index 7447b5cddf..0000000000 --- a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/angular.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "$schema": "../../../../packages/angular_devkit/core/src/workspace/workspace-schema.json", - "version": 1, - "projects": { - "lib": { - "root": "projects/lib", - "projectType": "library", - "targets": { - "build": { - "builder": "@angular-devkit/build-ng-packagr:build", - "options": { - "project": "projects/lib/ng-package.json", - "tsConfig": "projects/lib/tsconfig.lib.json" - }, - "configurations": { - "production": { - "tsConfig": "projects/lib/tsconfig.lib.prod.json" - } - } - } - } - } - } -} \ No newline at end of file diff --git a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/karma.conf.js b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/karma.conf.js deleted file mode 100644 index 0d2820cdc8..0000000000 --- a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/karma.conf.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -// 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'), - require('@angular-devkit/build-angular/plugins/karma') - ], - client: { - clearContext: false // leave Jasmine Spec Runner output visible in browser - }, - coverageReporter: { - dir: require('path').join(__dirname, 'coverage'), - subdir: '.', - reporters: [ - {type: 'html'}, - {type: 'lcov'}, - {type: 'text-summary'}, - ], - }, - reporters: ['progress', 'kjhtml'], - port: 9876, - colors: true, - logLevel: config.LOG_INFO, - autoWatch: true, - browsers: ['Chrome'], - customLaunchers: { - ChromeHeadlessCI: { - base: 'ChromeHeadless', - flags: ['--disable-gpu'] - } - }, - singleRun: false - }); -}; diff --git a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/ng-package.json b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/ng-package.json deleted file mode 100644 index cce46c5a8b..0000000000 --- a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/ng-package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "../../../../../../node_modules/ng-packagr/ng-package.schema.json", - "dest": "../../dist/lib", - "lib": { - "entryFile": "src/public-api.ts" - } -} \ No newline at end of file diff --git a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/package.json b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/package.json deleted file mode 100644 index c6c6efd446..0000000000 --- a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "lib", - "version": "0.0.1", - "peerDependencies": { - "@angular/common": "^10.0.0", - "@angular/core": "^10.0.0" - } -} \ No newline at end of file diff --git a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.component.spec.ts b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.component.spec.ts deleted file mode 100644 index 2694b8dea5..0000000000 --- a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.component.spec.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { LibComponent } from './lib.component'; - -describe('LibComponent', () => { - let component: LibComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ LibComponent ] - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(LibComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.component.ts b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.component.ts deleted file mode 100644 index 3fcbd0a37c..0000000000 --- a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.component.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'lib', - template: ` -

- lib works! -

- `, - styles: [] -}) -export class LibComponent implements OnInit { - - constructor() { } - - ngOnInit() { - } - -} diff --git a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.module.ts b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.module.ts deleted file mode 100644 index 4db2feed5a..0000000000 --- a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.module.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -import { NgModule } from '@angular/core'; -import { LibComponent } from './lib.component'; -import { LibService } from './lib.service'; - -@NgModule({ - imports: [ - ], - declarations: [LibComponent], - providers: [LibService] -}) -export class LibModule { } diff --git a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.service.spec.ts b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.service.spec.ts deleted file mode 100644 index a808deee36..0000000000 --- a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.service.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -import { TestBed, inject } from '@angular/core/testing'; - -import { LibService } from './lib.service'; - -describe('LibService', () => { - beforeEach(() => { - TestBed.configureTestingModule({ - providers: [LibService] - }); - }); - - it('should be created', inject([LibService], (service: LibService) => { - expect(service).toBeTruthy(); - })); -}); diff --git a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.service.ts b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.service.ts deleted file mode 100644 index e8be2fbdc2..0000000000 --- a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.service.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -import { Injectable } from '@angular/core'; - -@Injectable() -export class LibService { - - constructor() { } - - testEs2016() { - return ['foo', 'bar'].includes('foo'); - } - -} diff --git a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/public-api.ts b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/public-api.ts deleted file mode 100644 index d3a2dc0db0..0000000000 --- a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/public-api.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -/* - * Public API Surface of lib - */ - -export * from './lib/lib.service'; -export * from './lib/lib.component'; -export * from './lib/lib.module'; diff --git a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/test.ts b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/test.ts deleted file mode 100644 index 92e85eee48..0000000000 --- a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/test.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -// This file is required by karma.conf.js and loads recursively all the .spec and framework files - -import 'zone.js/dist/zone'; -import 'zone.js/dist/zone-testing'; -import { getTestBed } from '@angular/core/testing'; -import { - BrowserDynamicTestingModule, - platformBrowserDynamicTesting -} from '@angular/platform-browser-dynamic/testing'; - -declare const require: { - context(path: string, deep?: boolean, filter?: RegExp): { - keys(): string[]; - (id: string): T; - }; -}; - -// First, initialize the Angular testing environment. -getTestBed().initTestEnvironment( - BrowserDynamicTestingModule, - platformBrowserDynamicTesting() -); -// Then we find all the tests. -const context = require.context('./', true, /\.spec\.ts$/); -// And load the modules. -context.keys().map(context); diff --git a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/tsconfig.lib.json b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/tsconfig.lib.json deleted file mode 100644 index 0af783fbaf..0000000000 --- a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/tsconfig.lib.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "target": "es2015", - "declaration": true, - "declarationMap": true, - "inlineSources": true, - "types": [], - "lib": [ - "dom", - "es2018" - ] - }, - "angularCompilerOptions": { - "skipTemplateCodegen": true, - "strictMetadataEmit": true, - "enableResourceInlining": true - }, - "exclude": [ - "src/test.ts", - "**/*.spec.ts" - ] -} diff --git a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/tsconfig.lib.prod.json b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/tsconfig.lib.prod.json deleted file mode 100644 index 04c0e66277..0000000000 --- a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/tsconfig.lib.prod.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "./tsconfig.lib.json", - "compilerOptions": { - "declarationMap": false - }, - "angularCompilerOptions": { - "enableIvy": false - } -} diff --git a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/tsconfig.spec.json b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/tsconfig.spec.json deleted file mode 100644 index f1c08bf277..0000000000 --- a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/tsconfig.spec.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "../../out-tsc/spec", - "types": [ - "jasmine" - ] - }, - "files": [ - "src/test.ts" - ], - "include": [ - "**/*.spec.ts", - "**/*.d.ts" - ] -} diff --git a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/tsconfig.json b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/tsconfig.json deleted file mode 100644 index 2c5d470a72..0000000000 --- a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compileOnSave": false, - "compilerOptions": { - "baseUrl": "./", - "outDir": "./dist/out-tsc", - "sourceMap": true, - "declaration": false, - "moduleResolution": "node", - "experimentalDecorators": true, - "target": "es2015", - "module": "es2020", - "typeRoots": [ - "node_modules/@types" - ], - "lib": [ - "es2017", - "dom" - ] - }, - "angularCompilerOptions": { - "enableIvy": true, - "disableTypeScriptVersionCheck": true - } -} diff --git a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/tslint.json b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/tslint.json deleted file mode 100644 index 1dcd993d00..0000000000 --- a/packages/angular_devkit/build_ng_packagr/test/ng-packaged/tslint.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "extends": "tslint:recommended", - "rulesDirectory": [ - "codelyzer" - ], - "rules": { - "align": { - "options": [ - "parameters", - "statements" - ] - }, - "array-type": false, - "arrow-return-shorthand": true, - "curly": true, - "deprecation": { - "severity": "warning" - }, - "eofline": true, - "import-blacklist": [ - true, - "rxjs/Rx" - ], - "import-spacing": true, - "indent": { - "options": [ - "spaces" - ] - }, - "max-classes-per-file": false, - "max-line-length": [ - true, - 140 - ], - "member-ordering": [ - true, - { - "order": [ - "static-field", - "instance-field", - "static-method", - "instance-method" - ] - } - ], - "no-console": [ - true, - "debug", - "info", - "time", - "timeEnd", - "trace" - ], - "no-empty": false, - "no-inferrable-types": [ - true, - "ignore-params" - ], - "no-non-null-assertion": true, - "no-redundant-jsdoc": true, - "no-switch-case-fall-through": true, - "no-var-requires": false, - "object-literal-key-quotes": [ - true, - "as-needed" - ], - "quotemark": [ - true, - "single" - ], - "semicolon": { - "options": [ - "always" - ] - }, - "space-before-function-paren": { - "options": { - "anonymous": "never", - "asyncArrow": "always", - "constructor": "never", - "method": "never", - "named": "never" - } - }, - "typedef-whitespace": { - "options": [ - { - "call-signature": "nospace", - "index-signature": "nospace", - "parameter": "nospace", - "property-declaration": "nospace", - "variable-declaration": "nospace" - }, - { - "call-signature": "onespace", - "index-signature": "onespace", - "parameter": "onespace", - "property-declaration": "onespace", - "variable-declaration": "onespace" - } - ] - }, - "whitespace": { - "options": [ - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type", - "check-typecast" - ] - }, - "component-class-suffix": true, - "contextual-lifecycle": true, - "directive-class-suffix": true, - "no-conflicting-lifecycle": true, - "no-host-metadata-property": true, - "no-input-rename": true, - "no-inputs-metadata-property": true, - "no-output-native": true, - "no-output-on-prefix": true, - "no-output-rename": true, - "no-outputs-metadata-property": true, - "template-banana-in-box": true, - "template-no-negated-async": true, - "use-lifecycle-interface": true, - "use-pipe-transform-interface": true - } -}