diff --git a/package.json b/package.json index 7364c1d452..277533346b 100644 --- a/package.json +++ b/package.json @@ -169,6 +169,7 @@ "mini-css-extract-plugin": "0.9.0", "minimatch": "3.0.4", "minimist": "^1.2.0", + "ng-packagr": "~9.0.0", "node-fetch": "^2.2.0", "npm-registry-client": "8.6.0", "open": "7.0.3", diff --git a/packages/angular_devkit/build_ng_packagr/BUILD.bazel b/packages/angular_devkit/build_ng_packagr/BUILD.bazel new file mode 100644 index 0000000000..1bc522e668 --- /dev/null +++ b/packages/angular_devkit/build_ng_packagr/BUILD.bazel @@ -0,0 +1,114 @@ +# 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 + +licenses(["notice"]) # MIT + +load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") +load("@npm_bazel_typescript//:index.bzl", "ts_library") +load("@npm_bazel_jasmine//:index.bzl", "jasmine_node_test") +load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm") +load("//tools:ts_json_schema.bzl", "ts_json_schema") + +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 = glob( + include = [ + "package.json", + "builders.json", + "src/build/schema.json", + ], + ), + devmode_module = "commonjs", + devmode_target = "es2018", + 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", + ], +) + +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"], +) + +ts_library( + name = "build_ng_packagr_test_lib", + testonly = True, + srcs = glob( + include = [ + "src/test-utils.ts", + "src/**/*_spec.ts", + ], + ), + data = glob(["test/**/*"]), + devmode_module = "commonjs", + devmode_target = "es2018", + tsconfig = "//:tsconfig-test.json", + 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//@types/jasmine", + "@npm//@types/node", + "@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/src/build/index_spec_large.ts b/packages/angular_devkit/build_ng_packagr/src/build/index_spec.ts similarity index 87% rename from packages/angular_devkit/build_ng_packagr/src/build/index_spec_large.ts rename to packages/angular_devkit/build_ng_packagr/src/build/index_spec.ts index 7c8f6b6a21..a9c3412cc4 100644 --- a/packages/angular_devkit/build_ng_packagr/src/build/index_spec_large.ts +++ b/packages/angular_devkit/build_ng_packagr/src/build/index_spec.ts @@ -18,13 +18,12 @@ import { } from '@angular-devkit/core'; // tslint:disable-line:no-implicit-dependencies import { map, take, tap } from 'rxjs/operators'; -const veEnabled = process.argv.includes('--ve'); +// Default timeout for large specs is 2.5 minutes. +jasmine.DEFAULT_TIMEOUT_INTERVAL = 150000; -const devkitRoot = (global as unknown as { _DevKitRoot: string})._DevKitRoot; -const workspaceRoot = join( - normalize(devkitRoot), - `tests/angular_devkit/build_ng_packagr/ng-packaged${veEnabled ? '-ve' : ''}/`, -); +// 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); @@ -48,6 +47,11 @@ describe('NgPackagr Builder', () => { ); 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()); diff --git a/tests/angular_devkit/build_ng_packagr/ng-packaged-ve/.gitignore b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/.gitignore similarity index 100% rename from tests/angular_devkit/build_ng_packagr/ng-packaged-ve/.gitignore rename to packages/angular_devkit/build_ng_packagr/test/ng-packaged/.gitignore 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 new file mode 100644 index 0000000000..7447b5cddf --- /dev/null +++ b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/angular.json @@ -0,0 +1,24 @@ +{ + "$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/tests/angular_devkit/build_ng_packagr/ng-packaged-ve/projects/lib/karma.conf.js b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/karma.conf.js similarity index 100% rename from tests/angular_devkit/build_ng_packagr/ng-packaged-ve/projects/lib/karma.conf.js rename to packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/karma.conf.js diff --git a/tests/angular_devkit/build_ng_packagr/ng-packaged-ve/projects/lib/ng-package.json b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/ng-package.json similarity index 100% rename from tests/angular_devkit/build_ng_packagr/ng-packaged-ve/projects/lib/ng-package.json rename to packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/ng-package.json diff --git a/tests/angular_devkit/build_ng_packagr/ng-packaged-ve/projects/lib/package.json b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/package.json similarity index 100% rename from tests/angular_devkit/build_ng_packagr/ng-packaged-ve/projects/lib/package.json rename to packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/package.json diff --git a/tests/angular_devkit/build_ng_packagr/ng-packaged-ve/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 similarity index 100% rename from tests/angular_devkit/build_ng_packagr/ng-packaged-ve/projects/lib/src/lib/lib.component.spec.ts rename to packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.component.spec.ts diff --git a/tests/angular_devkit/build_ng_packagr/ng-packaged-ve/projects/lib/src/lib/lib.component.ts b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.component.ts similarity index 100% rename from tests/angular_devkit/build_ng_packagr/ng-packaged-ve/projects/lib/src/lib/lib.component.ts rename to packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.component.ts diff --git a/tests/angular_devkit/build_ng_packagr/ng-packaged-ve/projects/lib/src/lib/lib.module.ts b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.module.ts similarity index 100% rename from tests/angular_devkit/build_ng_packagr/ng-packaged-ve/projects/lib/src/lib/lib.module.ts rename to packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.module.ts diff --git a/tests/angular_devkit/build_ng_packagr/ng-packaged-ve/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 similarity index 100% rename from tests/angular_devkit/build_ng_packagr/ng-packaged-ve/projects/lib/src/lib/lib.service.spec.ts rename to packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.service.spec.ts diff --git a/tests/angular_devkit/build_ng_packagr/ng-packaged-ve/projects/lib/src/lib/lib.service.ts b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.service.ts similarity index 100% rename from tests/angular_devkit/build_ng_packagr/ng-packaged-ve/projects/lib/src/lib/lib.service.ts rename to packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.service.ts diff --git a/tests/angular_devkit/build_ng_packagr/ng-packaged-ve/projects/lib/src/public-api.ts b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/public-api.ts similarity index 100% rename from tests/angular_devkit/build_ng_packagr/ng-packaged-ve/projects/lib/src/public-api.ts rename to packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/public-api.ts diff --git a/tests/angular_devkit/build_ng_packagr/ng-packaged-ve/projects/lib/src/test.ts b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/test.ts similarity index 100% rename from tests/angular_devkit/build_ng_packagr/ng-packaged-ve/projects/lib/src/test.ts rename to packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/test.ts diff --git a/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/tsconfig.lib.json b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/tsconfig.lib.json similarity index 100% rename from tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/tsconfig.lib.json rename to packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/tsconfig.lib.json diff --git a/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/tsconfig.lib.prod.json b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/tsconfig.lib.prod.json similarity index 100% rename from tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/tsconfig.lib.prod.json rename to packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/tsconfig.lib.prod.json diff --git a/tests/angular_devkit/build_ng_packagr/ng-packaged-ve/projects/lib/tsconfig.spec.json b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/tsconfig.spec.json similarity index 100% rename from tests/angular_devkit/build_ng_packagr/ng-packaged-ve/projects/lib/tsconfig.spec.json rename to packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/tsconfig.spec.json diff --git a/tests/angular_devkit/build_ng_packagr/ng-packaged/tsconfig.json b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/tsconfig.json similarity index 95% rename from tests/angular_devkit/build_ng_packagr/ng-packaged/tsconfig.json rename to packages/angular_devkit/build_ng_packagr/test/ng-packaged/tsconfig.json index 707f685dd4..d9a4c4b50a 100644 --- a/tests/angular_devkit/build_ng_packagr/ng-packaged/tsconfig.json +++ b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/tsconfig.json @@ -18,6 +18,7 @@ ] }, "angularCompilerOptions": { + "enableIvy": true, "disableTypeScriptVersionCheck": true } } diff --git a/tests/angular_devkit/build_ng_packagr/ng-packaged-ve/tslint.json b/packages/angular_devkit/build_ng_packagr/test/ng-packaged/tslint.json similarity index 100% rename from tests/angular_devkit/build_ng_packagr/ng-packaged-ve/tslint.json rename to packages/angular_devkit/build_ng_packagr/test/ng-packaged/tslint.json diff --git a/tests/angular_devkit/build_ng_packagr/ng-packaged-ve/angular.json b/tests/angular_devkit/build_ng_packagr/ng-packaged-ve/angular.json deleted file mode 100644 index 4f23a860ae..0000000000 --- a/tests/angular_devkit/build_ng_packagr/ng-packaged-ve/angular.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "$schema": "../../../../packages/angular_devkit/core/src/workspace/workspace-schema.json", - "version": 1, - "projects": { - "lib": { - "root": "projects/lib", - "projectType": "library", - "targets": { - "build": { - "builder": "../../../../packages/angular_devkit/build_ng_packagr:build", - "options": { - "project": "projects/lib/ng-package.json", - "tsConfig": "projects/lib/tsconfig.lib.json" - } - }, - "test": { - "builder": "../../../../packages/angular_devkit/build_angular:karma", - "options": { - "main": "projects/lib/src/test.ts", - "tsConfig": "projects/lib/tsconfig.spec.json", - "karmaConfig": "projects/lib/karma.conf.js", - "browsers": "ChromeHeadlessCI", - "progress": false, - "watch": false - } - }, - "lint": { - "builder": "../../../../packages/angular_devkit/build_angular:tslint", - "options": { - "tsConfig": [ - "projects/lib/tsconfig.lib.json", - "projects/lib/tsconfig.spec.json" - ], - "exclude": [ - "**/node_modules/**" - ] - } - } - } - } - } -} \ No newline at end of file diff --git a/tests/angular_devkit/build_ng_packagr/ng-packaged-ve/projects/lib/tsconfig.lib.json b/tests/angular_devkit/build_ng_packagr/ng-packaged-ve/projects/lib/tsconfig.lib.json deleted file mode 100644 index a23fa5f5a0..0000000000 --- a/tests/angular_devkit/build_ng_packagr/ng-packaged-ve/projects/lib/tsconfig.lib.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "target": "es2015", - "declaration": true, - "inlineSources": true, - "types": [], - "lib": [ - "dom", - "es2018" - ] - }, - "angularCompilerOptions": { - "skipTemplateCodegen": true, - "strictMetadataEmit": true, - "fullTemplateTypeCheck": true, - "strictInjectionParameters": true, - "enableResourceInlining": true - }, - "exclude": [ - "src/test.ts", - "**/*.spec.ts" - ] -} diff --git a/tests/angular_devkit/build_ng_packagr/ng-packaged-ve/tsconfig.json b/tests/angular_devkit/build_ng_packagr/ng-packaged-ve/tsconfig.json deleted file mode 100644 index c761d398dc..0000000000 --- a/tests/angular_devkit/build_ng_packagr/ng-packaged-ve/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": "esnext", - "typeRoots": [ - "node_modules/@types" - ], - "lib": [ - "es2017", - "dom" - ] - }, - "angularCompilerOptions": { - "enableIvy": false, - "disableTypeScriptVersionCheck": true - } -} diff --git a/tests/angular_devkit/build_ng_packagr/ng-packaged/.gitignore b/tests/angular_devkit/build_ng_packagr/ng-packaged/.gitignore deleted file mode 100644 index 54bfd2001e..0000000000 --- a/tests/angular_devkit/build_ng_packagr/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/tests/angular_devkit/build_ng_packagr/ng-packaged/angular.json b/tests/angular_devkit/build_ng_packagr/ng-packaged/angular.json deleted file mode 100644 index 26bd6d05ef..0000000000 --- a/tests/angular_devkit/build_ng_packagr/ng-packaged/angular.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "$schema": "../../../../packages/angular_devkit/core/src/workspace/workspace-schema.json", - "version": 1, - "projects": { - "lib": { - "root": "projects/lib", - "projectType": "library", - "targets": { - "build": { - "builder": "../../../../packages/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" - } - } - }, - "test": { - "builder": "../../../../packages/angular_devkit/build_angular:karma", - "options": { - "main": "projects/lib/src/test.ts", - "tsConfig": "projects/lib/tsconfig.spec.json", - "karmaConfig": "projects/lib/karma.conf.js", - "browsers": "ChromeHeadlessCI", - "progress": false, - "watch": false - } - }, - "lint": { - "builder": "../../../../packages/angular_devkit/build_angular:tslint", - "options": { - "tsConfig": [ - "projects/lib/tsconfig.lib.json", - "projects/lib/tsconfig.spec.json" - ], - "exclude": [ - "**/node_modules/**" - ] - } - } - } - } - } -} \ No newline at end of file diff --git a/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/karma.conf.js b/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/karma.conf.js deleted file mode 100644 index 2f49ecb6df..0000000000 --- a/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/karma.conf.js +++ /dev/null @@ -1,44 +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-istanbul-reporter'), - require('@angular-devkit/build-angular/plugins/karma') - ], - client: { - clearContext: false // leave Jasmine Spec Runner output visible in browser - }, - coverageIstanbulReporter: { - dir: require('path').join(__dirname, 'coverage'), - reports: ['html', 'lcovonly'], - fixWebpackSourcePaths: true - }, - 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/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/ng-package.json b/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/ng-package.json deleted file mode 100644 index cce46c5a8b..0000000000 --- a/tests/angular_devkit/build_ng_packagr/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/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/package.json b/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/package.json deleted file mode 100644 index 6c4cf3cf93..0000000000 --- a/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "lib", - "version": "0.0.1", - "peerDependencies": { - "@angular/common": "^6.0.0-rc.0 || ^6.0.0", - "@angular/core": "^6.0.0-rc.0 || ^6.0.0" - } -} \ No newline at end of file diff --git a/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/src/lib/lib.component.spec.ts b/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/src/lib/lib.component.spec.ts deleted file mode 100644 index 6ef4e5debc..0000000000 --- a/tests/angular_devkit/build_ng_packagr/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 { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { LibComponent } from './lib.component'; - -describe('LibComponent', () => { - let component: LibComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ LibComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(LibComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/src/lib/lib.component.ts b/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/src/lib/lib.component.ts deleted file mode 100644 index 3fcbd0a37c..0000000000 --- a/tests/angular_devkit/build_ng_packagr/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/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/src/lib/lib.module.ts b/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/src/lib/lib.module.ts deleted file mode 100644 index 4db2feed5a..0000000000 --- a/tests/angular_devkit/build_ng_packagr/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/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/src/lib/lib.service.spec.ts b/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/src/lib/lib.service.spec.ts deleted file mode 100644 index a808deee36..0000000000 --- a/tests/angular_devkit/build_ng_packagr/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/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/src/lib/lib.service.ts b/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/src/lib/lib.service.ts deleted file mode 100644 index e8be2fbdc2..0000000000 --- a/tests/angular_devkit/build_ng_packagr/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/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/src/public-api.ts b/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/src/public-api.ts deleted file mode 100644 index d3a2dc0db0..0000000000 --- a/tests/angular_devkit/build_ng_packagr/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/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/src/test.ts b/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/src/test.ts deleted file mode 100644 index 92e85eee48..0000000000 --- a/tests/angular_devkit/build_ng_packagr/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/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/tsconfig.spec.json b/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/tsconfig.spec.json deleted file mode 100644 index 16da33db07..0000000000 --- a/tests/angular_devkit/build_ng_packagr/ng-packaged/projects/lib/tsconfig.spec.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "../../out-tsc/spec", - "types": [ - "jasmine", - "node" - ] - }, - "files": [ - "src/test.ts" - ], - "include": [ - "**/*.spec.ts", - "**/*.d.ts" - ] -} diff --git a/tests/angular_devkit/build_ng_packagr/ng-packaged/tslint.json b/tests/angular_devkit/build_ng_packagr/ng-packaged/tslint.json deleted file mode 100644 index 1dcd993d00..0000000000 --- a/tests/angular_devkit/build_ng_packagr/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 - } -}