
committed by
Igor Minar

parent
a673494412
commit
d7aa20d912
21
packages/compiler-cli/src/ngcc/BUILD.bazel
Normal file
21
packages/compiler-cli/src/ngcc/BUILD.bazel
Normal file
@ -0,0 +1,21 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("//tools:defaults.bzl", "ts_library")
|
||||
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
|
||||
|
||||
ts_library(
|
||||
name = "ngcc",
|
||||
srcs = glob([
|
||||
"*.ts",
|
||||
"**/*.ts",
|
||||
]),
|
||||
module_name = "@angular/compiler-cli/src/ngcc",
|
||||
deps = [
|
||||
"//packages:types",
|
||||
"//packages/compiler",
|
||||
"//packages/compiler-cli/src/ngtsc/annotations",
|
||||
"//packages/compiler-cli/src/ngtsc/host",
|
||||
"//packages/compiler-cli/src/ngtsc/metadata",
|
||||
"//packages/compiler-cli/src/ngtsc/transform",
|
||||
],
|
||||
)
|
30
packages/compiler-cli/src/ngcc/README.md
Normal file
30
packages/compiler-cli/src/ngcc/README.md
Normal file
@ -0,0 +1,30 @@
|
||||
# Angular Compatibility Compiler (ngcc)
|
||||
|
||||
This compiler will convert `node_modules` compiled with `ngc`, into `node_modules` which
|
||||
appear to have been compiled with `ngtsc`.
|
||||
|
||||
This conversion will allow such "legacy" packages to be used by the Ivy rendering engine.
|
||||
|
||||
## Building
|
||||
|
||||
The project is built using Bazel:
|
||||
|
||||
```bash
|
||||
bazel build //packages/compiler-cli/src/ngcc
|
||||
```
|
||||
|
||||
## Unit Testing
|
||||
|
||||
The unit tests are built and run using Bazel:
|
||||
|
||||
```bash
|
||||
bazel test //packages/compiler-cli/src/ngcc/test
|
||||
```
|
||||
|
||||
## Integration Testing
|
||||
|
||||
There are tests that check the behaviour of the overall executable:
|
||||
|
||||
```bash
|
||||
bazel test //packages/compiler-cli/test/ngcc
|
||||
```
|
9
packages/compiler-cli/src/ngcc/index.ts
Normal file
9
packages/compiler-cli/src/ngcc/index.ts
Normal file
@ -0,0 +1,9 @@
|
||||
/**
|
||||
* @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 {mainNgcc} from './src/main';
|
16
packages/compiler-cli/src/ngcc/main-ngcc.ts
Normal file
16
packages/compiler-cli/src/ngcc/main-ngcc.ts
Normal file
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* @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 {mainNgcc} from './src/main';
|
||||
|
||||
// CLI entry point
|
||||
if (require.main === module) {
|
||||
const args = process.argv.slice(2);
|
||||
process.exitCode = mainNgcc(args);
|
||||
}
|
14
packages/compiler-cli/src/ngcc/src/main.ts
Normal file
14
packages/compiler-cli/src/ngcc/src/main.ts
Normal file
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* @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 {resolve} from 'path';
|
||||
|
||||
export function mainNgcc(args: string[]): number {
|
||||
const packagePath = resolve(args[0]);
|
||||
|
||||
return 0;
|
||||
}
|
26
packages/compiler-cli/src/ngcc/test/BUILD.bazel
Normal file
26
packages/compiler-cli/src/ngcc/test/BUILD.bazel
Normal file
@ -0,0 +1,26 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("//tools:defaults.bzl", "ts_library")
|
||||
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
|
||||
|
||||
ts_library(
|
||||
name = "test_lib",
|
||||
testonly = 1,
|
||||
srcs = glob([
|
||||
"**/*.ts",
|
||||
]),
|
||||
deps = [
|
||||
"//packages/compiler-cli/src/ngcc",
|
||||
"//packages/compiler-cli/src/ngtsc/host",
|
||||
"//packages/compiler-cli/src/ngtsc/testing",
|
||||
],
|
||||
)
|
||||
|
||||
jasmine_node_test(
|
||||
name = "test",
|
||||
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
|
||||
deps = [
|
||||
":test_lib",
|
||||
"//tools/testing:node_no_angular",
|
||||
],
|
||||
)
|
Reference in New Issue
Block a user