Skip to content

Commit b8a769a

Browse files
timdeschryverbrandonroberts
authored andcommitted
feat(component): initial setup (#2257)
1 parent 2801018 commit b8a769a

File tree

19 files changed

+195
-2
lines changed

19 files changed

+195
-2
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ The scope should be the name of the npm package affected (as perceived by the pe
9898

9999
The following is the list of supported scopes:
100100

101+
- **component**
101102
- **data**
102103
- **effects**
103104
- **entity**

build/tasks.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ export async function copySchematicsCore(config: Config) {
1818
.toString('utf-8');
1919
const pkgConfig = JSON.parse(packageJson);
2020

21-
if (pkgConfig.schematics || pkgConfig['ng-update'].migrations) {
21+
if (
22+
pkgConfig.schematics ||
23+
(pkgConfig['ng-update'] && pkgConfig['ng-update'].migrations)
24+
) {
2225
ncp(
2326
`${modulesDir}/schematics-core`,
2427
`${modulesDir}/${pkg}/schematics-core`,

modules/component/BUILD

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package(default_visibility = ["//visibility:public"])
2+
3+
load("//tools:defaults.bzl", "ng_module", "ng_package")
4+
5+
ng_module(
6+
name = "component",
7+
srcs = glob([
8+
"*.ts",
9+
"src/**/*.ts",
10+
]),
11+
module_name = "@ngrx/component",
12+
deps = [
13+
# TODO: @ngrx/component - add ngrx deps, also add it to package.json as peerDependency
14+
# "//modules/store",
15+
"@npm//@angular/common",
16+
"@npm//@angular/core",
17+
"@npm//rxjs",
18+
],
19+
)
20+
21+
ng_package(
22+
name = "npm_package",
23+
srcs = glob(["**/*.externs.js"]) + [
24+
"package.json",
25+
],
26+
entry_point = "modules/component/index.js",
27+
packages = [
28+
# TODO: @ngrx/component - add schematic
29+
# "//modules/component/schematics-core:npm_package",
30+
],
31+
deps = [
32+
":component",
33+
],
34+
)

modules/component/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Change Log
2+
3+
See [CHANGELOG.md](https://github.com/ngrx/platform/blob/master/CHANGELOG.md)

modules/component/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# @ngrx/component
2+
3+
The sources for this package are in the main [NgRx](https://github.com/ngrx/platform) repo. Please file issues and pull requests against that repo.
4+
5+
License: MIT

modules/component/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* DO NOT EDIT
3+
*
4+
* This file is automatically generated at build
5+
*/
6+
7+
export * from './public_api';

modules/component/package.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "@ngrx/component",
3+
"version": "0.0.0-PLACEHOLDER",
4+
"description": "Reactive utilities for components",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/ngrx/platform.git"
8+
},
9+
"keywords": [
10+
"Angular",
11+
"Redux",
12+
"NgRx",
13+
"Schematics",
14+
"Angular CLI"
15+
],
16+
"author": "NgRx",
17+
"license": "MIT",
18+
"bugs": {
19+
"url": "https://github.com/ngrx/platform/issues"
20+
},
21+
"homepage": "https://github.com/ngrx/platform#readme",
22+
"peerDependencies": {
23+
"@angular/common": "NG_VERSION",
24+
"@angular/core": "NG_VERSION",
25+
"rxjs": "RXJS_VERSION"
26+
},
27+
"sideEffects": false
28+
}

modules/component/public_api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './src/index';

modules/component/rollup.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default {
2+
entry: './dist/component/@ngrx/component.es5.js',
3+
dest: './dist/component/bundles/component.umd.js',
4+
format: 'umd',
5+
exports: 'named',
6+
moduleName: 'ngrx.component',
7+
globals: {
8+
// TODO: @ngrx/component - add ngrx deps, also add it to tsconfig-build.json as path
9+
// '@ngrx/store': 'ngrx.store',
10+
},
11+
};

modules/component/spec/BUILD

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
load("//tools:defaults.bzl", "jasmine_node_test", "ts_test_library")
2+
3+
ts_test_library(
4+
name = "test_lib",
5+
srcs = glob(
6+
[
7+
"**/*.ts",
8+
],
9+
),
10+
deps = [
11+
"//modules/component",
12+
# TODO: @ngrx/component - add ngrx deps
13+
# "//modules/store",
14+
"@npm//@angular/common",
15+
"@npm//rxjs",
16+
],
17+
)
18+
19+
jasmine_node_test(
20+
name = "test",
21+
deps = [
22+
":test_lib",
23+
"//modules/component",
24+
# TODO: @ngrx/component - add ngrx deps
25+
# "//modules/store",
26+
],
27+
)

0 commit comments

Comments
 (0)