mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-24 08:06:17 +08:00
build: delete @angular-devkit/build-ng-packagr
BREAKING CHANGE: Deprecated `@angular-devkit/build-ng-packagr` has been removed. Please use `ng-packagr` builder from `@angular-devkit/build-angular` instead. Note: this change doesn't effect application and library developers, as they will be migrated to use the new builder during ng update.
This commit is contained in:
parent
bad0ced885
commit
b1f08585f7
CONTRIBUTING.mdREADME.md
packages/angular_devkit/build_ng_packagr
@ -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**
|
||||
|
@ -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) | [](https://npmjs.com/package/@angular-devkit/architect) | [](/packages/angular_devkit/architect/README.md) [](https://github.com/angular/angular-devkit-architect-builds)
|
||||
**Build Angular** | [`@angular-devkit/build-angular`](https://npmjs.com/package/@angular-devkit/build-angular) | [](https://npmjs.com/package/@angular-devkit/build-angular) | [](/packages/angular_devkit/build_angular/README.md) [](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) | [](https://npmjs.com/package/@angular-devkit/build-ng-packagr) | [](/packages/angular_devkit/build_ng_packagr/README.md) [](https://github.com/angular/angular-devkit-build-ng-packagr-builds)
|
||||
**Build Optimizer** | [`@angular-devkit/build-optimizer`](https://npmjs.com/package/@angular-devkit/build-optimizer) | [](https://npmjs.com/package/@angular-devkit/build-optimizer) | [](/packages/angular_devkit/build_optimizer/README.md) [](https://github.com/angular/angular-devkit-build-optimizer-builds)
|
||||
**Build Webpack** | [`@angular-devkit/build-webpack`](https://npmjs.com/package/@angular-devkit/build-webpack) | [](https://npmjs.com/package/@angular-devkit/build-webpack) | [](/packages/angular_devkit/build_webpack/README.md) [](https://github.com/angular/angular-devkit-build-webpack-builds)
|
||||
**Core** | [`@angular-devkit/core`](https://npmjs.com/package/@angular-devkit/core) | [](https://npmjs.com/package/@angular-devkit/core) | [](/packages/angular_devkit/core/README.md) [](https://github.com/angular/angular-devkit-core-builds)
|
||||
|
@ -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",
|
||||
],
|
||||
)
|
@ -1,3 +0,0 @@
|
||||
# Angular Build Architect for ng-packagr
|
||||
|
||||
WIP
|
@ -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."
|
||||
}
|
||||
}
|
||||
}
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
@ -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<import ('ng-packagr').NgPackagr> {
|
||||
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<BuilderOutput> {
|
||||
return from(initialize(options, context.workspaceRoot)).pipe(
|
||||
switchMap(packager => options.watch ? packager.watch() : packager.build()),
|
||||
mapTo({ success: true }),
|
||||
);
|
||||
}
|
||||
|
||||
export default createBuilder<Record<string, string> & NgPackagrBuilderOptions>(execute);
|
@ -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();
|
||||
});
|
||||
});
|
@ -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"
|
||||
]
|
||||
}
|
@ -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';
|
@ -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
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -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
|
||||
});
|
||||
};
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"$schema": "../../../../../../node_modules/ng-packagr/ng-package.schema.json",
|
||||
"dest": "../../dist/lib",
|
||||
"lib": {
|
||||
"entryFile": "src/public-api.ts"
|
||||
}
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
{
|
||||
"name": "lib",
|
||||
"version": "0.0.1",
|
||||
"peerDependencies": {
|
||||
"@angular/common": "^10.0.0",
|
||||
"@angular/core": "^10.0.0"
|
||||
}
|
||||
}
|
32
packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.component.spec.ts
32
packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.component.spec.ts
@ -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<LibComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ LibComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(LibComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@ -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: `
|
||||
<p>
|
||||
lib works!
|
||||
</p>
|
||||
`,
|
||||
styles: []
|
||||
})
|
||||
export class LibComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
@ -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 { }
|
22
packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.service.spec.ts
22
packages/angular_devkit/build_ng_packagr/test/ng-packaged/projects/lib/src/lib/lib.service.spec.ts
@ -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();
|
||||
}));
|
||||
});
|
@ -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');
|
||||
}
|
||||
|
||||
}
|
@ -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';
|
@ -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[];
|
||||
<T>(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);
|
@ -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"
|
||||
]
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
{
|
||||
"extends": "./tsconfig.lib.json",
|
||||
"compilerOptions": {
|
||||
"declarationMap": false
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"enableIvy": false
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../out-tsc/spec",
|
||||
"types": [
|
||||
"jasmine"
|
||||
]
|
||||
},
|
||||
"files": [
|
||||
"src/test.ts"
|
||||
],
|
||||
"include": [
|
||||
"**/*.spec.ts",
|
||||
"**/*.d.ts"
|
||||
]
|
||||
}
|
@ -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
|
||||
}
|
||||
}
|
@ -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
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user