Skip to content

Commit 710edef

Browse files
committed
feat: refactor packages to match new ng-packager
1 parent 1b8bb72 commit 710edef

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+552
-2765
lines changed

CHANGELOG.md

-835
Large diffs are not rendered by default.

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ We follow the [Conventional Commits](https://conventionalcommits.org/) guideline
1212

1313
## Canary Releases
1414

15-
This repo is setup to automatically release canary builds for every commit that is pushed to master. In order to access those builds, run `npm install @angular-redux/store@canary` (or whichever package you are looking to use)
15+
This repo is setup to automatically release canary builds for every commit that is pushed to master. In order to access those builds, run `npm install ngredux-store@canary` (or whichever package you are looking to use)
1616

1717
## Stable Releases
1818

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Project forked from unmantained [@angular-redux/platform](https://github.com/angular-redux/platform) to add Ivy compilation support.
1+
Project forked from unmantained [ngredux-platform](https://github.com/angular-redux/platform) to add Ivy compilation support.
22

33
# Angular Redux
44

@@ -8,9 +8,9 @@ Project forked from unmantained [@angular-redux/platform](https://github.com/ang
88

99
## Packages
1010

11-
- [@angular-redux/store](packages/store) - Bindings between Redux and Angular
12-
- [@angular-redux/form](packages/form) - Bindings between Angular Forms and your Redux state
13-
- [@angular-redux/router](packages/router) - Bindings between Angular Router and your Redux state
11+
- [ngredux-store](packages/store) - Bindings between Redux and Angular
12+
- [ngredux-form](packages/form) - Bindings between Angular Forms and your Redux state
13+
- [ngredux-router](packages/router) - Bindings between Angular Router and your Redux state
1414

1515
## Examples
1616

angular.json

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"ngredux-store": {
7+
"projectType": "library",
8+
"root": "packages/store",
9+
"sourceRoot": "packages/store/src",
10+
"prefix": "lib",
11+
"architect": {
12+
"build": {
13+
"builder": "@angular-devkit/build-angular:ng-packagr",
14+
"options": {
15+
"tsConfig": "./tsconfig.lib.json",
16+
"project": "packages/store/ng-package.json"
17+
},
18+
"configurations": {
19+
"production": {
20+
"tsConfig": "./tsconfig.lib.prod.json"
21+
}
22+
}
23+
},
24+
"lint": {
25+
"builder": "@angular-devkit/build-angular:tslint",
26+
"options": {
27+
"tsConfig": [
28+
"./tsconfig.lib.json",
29+
"./tsconfig.spec.json"
30+
],
31+
"exclude": [
32+
"**/node_modules/**"
33+
]
34+
}
35+
}
36+
}
37+
},
38+
"ngredux-router": {
39+
"projectType": "library",
40+
"root": "packages/router",
41+
"sourceRoot": "packages/router/src",
42+
"prefix": "lib",
43+
"architect": {
44+
"build": {
45+
"builder": "@angular-devkit/build-angular:ng-packagr",
46+
"options": {
47+
"tsConfig": "./tsconfig.lib.json",
48+
"project": "packages/router/ng-package.json"
49+
},
50+
"configurations": {
51+
"production": {
52+
"tsConfig": "./tsconfig.lib.prod.json"
53+
}
54+
}
55+
},
56+
"lint": {
57+
"builder": "@angular-devkit/build-angular:tslint",
58+
"options": {
59+
"tsConfig": [
60+
"./tsconfig.lib.json",
61+
"./tsconfig.spec.json"
62+
],
63+
"exclude": [
64+
"**/node_modules/**"
65+
]
66+
}
67+
}
68+
}
69+
},
70+
"ngredux-form": {
71+
"projectType": "library",
72+
"root": "packages/form",
73+
"sourceRoot": "packages/form/src",
74+
"prefix": "lib",
75+
"architect": {
76+
"build": {
77+
"builder": "@angular-devkit/build-angular:ng-packagr",
78+
"options": {
79+
"tsConfig": "./tsconfig.lib.json",
80+
"project": "packages/form/ng-package.json"
81+
},
82+
"configurations": {
83+
"production": {
84+
"tsConfig": "./tsconfig.lib.prod.json"
85+
}
86+
}
87+
},
88+
"lint": {
89+
"builder": "@angular-devkit/build-angular:tslint",
90+
"options": {
91+
"tsConfig": [
92+
"./tsconfig.lib.json",
93+
"./tsconfig.spec.json"
94+
],
95+
"exclude": [
96+
"**/node_modules/**"
97+
]
98+
}
99+
}
100+
}
101+
}
102+
},
103+
"defaultProject": "store"
104+
}

docs/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
# Packages
66

7-
- [@angular-redux/store](store/) - Bindings between Redux and Angular
8-
- [@angular-redux/form](form/) - Bindings between Angular Forms and your Redux state
9-
- [@angular-redux/router](router/) - Bindings between Angular Router and your Redux state
7+
- [ngredux-store](store/) - Bindings between Redux and Angular
8+
- [ngredux-form](form/) - Bindings between Angular Forms and your Redux state
9+
- [ngredux-router](router/) - Bindings between Angular Router and your Redux state
1010

1111
# Examples
1212

docs/form/README.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
[![npm version](https://img.shields.io/npm/v/@angular-redux/form.svg)](https://www.npmjs.com/package/@angular-redux/form)
2-
[![downloads per month](https://img.shields.io/npm/dm/@angular-redux/form.svg)](https://www.npmjs.com/package/@angular-redux/form)
1+
[![npm version](https://img.shields.io/npm/v/ngredux-form.svg)](https://www.npmjs.com/package/ngredux-form)
2+
[![downloads per month](https://img.shields.io/npm/dm/ngredux-form.svg)](https://www.npmjs.com/package/ngredux-form)
33

44
This library is a thin layer of connective tissue between Angular 2+ forms and
55
Redux. It provides unidirectional data binding between your Redux state and
@@ -51,12 +51,12 @@ the class that is responsible for connecting your forms to your Redux state.
5151
There are two ways of doing this: either using an `Redux.Store<T>` object or
5252
an `NgRedux<T>` object. There are no substantial differences between these
5353
approaches, but if you are already using
54-
[@angular-redux/store](https://github.com/angular-redux/platform/blob/master/packages/store) or you wish to integrate
54+
[ngredux-store](https://github.com/angular-redux/platform/blob/master/packages/store) or you wish to integrate
5555
it into your project, then you would do something like this:
5656

5757
```typescript
58-
import { NgReduxModule } from '@angular-redux/store';
59-
import { NgReduxFormModule } from '@angular-redux/form';
58+
import { NgReduxModule } from 'ngredux-store';
59+
import { NgReduxFormModule } from 'ngredux-form';
6060

6161
@NgModule({
6262
imports: [
@@ -71,11 +71,11 @@ import { NgReduxFormModule } from '@angular-redux/form';
7171
export class ExampleModule {}
7272
```
7373

74-
Or if you are using Redux without `@angular-redux/store`, then your bootstrap call would look
74+
Or if you are using Redux without `ngredux-store`, then your bootstrap call would look
7575
more like this (substitute your own store creation code):
7676

7777
```typescript
78-
import { provideReduxForms } from '@angular-redux/form';
78+
import { provideReduxForms } from 'ngredux-form';
7979

8080
const storeCreator = compose(applyMiddleware(logger))(createStore);
8181
const store = create(reducers, <MyApplicationState>{});
@@ -89,7 +89,7 @@ export class ExampleModule {}
8989
```
9090

9191
The essential bit of code in the above samples is the call to `provideReduxForms(...)`.
92-
This configures `@angular-redux/form` and provides access to your Redux store or NgRedux
92+
This configures `ngredux-form` and provides access to your Redux store or NgRedux
9393
instance. The shape of the object that `provideReduxForms` expects is very
9494
basic:
9595

@@ -194,7 +194,7 @@ the `path` property on our first `<select>` element, it would look like this:
194194
['form1', 'dependents', 0, 'type']
195195
```
196196

197-
From there, `@angular-redux/form` is able to take that path and extract the value for
197+
From there, `ngredux-form` is able to take that path and extract the value for
198198
that element from the Redux state.
199199

200200
# Reactive Forms
@@ -222,14 +222,14 @@ the easy part and is unlikely to cause any problems for you. Slightly more diffi
222222
is _updating your Redux state_ when the form values change. There are two approaches
223223
that you can take in order to do this.
224224

225-
The first, and by far the simplest, is to use the reducer that comes with `@angular-redux/form`
225+
The first, and by far the simplest, is to use the reducer that comes with `ngredux-form`
226226
and uses the value supplied in `connect` and the form input names in order to update
227227
your Redux state automatically. If you do not need to do any special processing on
228228
your data when the user updates form inputs, then you should use this default reducer.
229229
To use it, you need to combine it with your existing reducers like so:
230230

231231
```typescript
232-
import { composeReducers, defaultFormReducer } from '@angular-redux/form';
232+
import { composeReducers, defaultFormReducer } from 'ngredux-form';
233233

234234
const reducer = composeReducers(
235235
defaultFormReducer(),
@@ -296,4 +296,4 @@ you have to use `composeReducers` distasteful, then this is another route availa
296296
to you.
297297

298298
The unit tests in `*.test.ts` files also contain useful examples of how to build
299-
forms using `@angular-redux/form`.
299+
forms using `ngredux-form`.

docs/router/README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
[![npm version](https://img.shields.io/npm/v/@angular-redux/router.svg)](https://www.npmjs.com/package/@angular-redux/router)
2-
[![downloads per month](https://img.shields.io/npm/dm/@angular-redux/router.svg)](https://www.npmjs.com/package/@angular-redux/router)
1+
[![npm version](https://img.shields.io/npm/v/ngredux-router.svg)](https://www.npmjs.com/package/ngredux-router)
2+
[![downloads per month](https://img.shields.io/npm/dm/ngredux-router.svg)](https://www.npmjs.com/package/ngredux-router)
33

4-
Bindings to connect @angular/router to @angular-redux/core
4+
Bindings to connect @angular/router to ngredux-core
55

66
# Setup
77

88
1. Use npm to install the bindings:
99

1010
```
11-
npm install @angular-redux/router --save
11+
npm install ngredux-router --save
1212
```
1313

1414
2. Use the `routerReducer` when providing `Store`:
1515

1616
```ts
1717
import { combineReducers } from 'redux';
18-
import { routerReducer } from '@angular-redux/router';
18+
import { routerReducer } from 'ngredux-router';
1919

2020
export default combineReducers<IAppState>({
2121
// your reducers..
@@ -27,8 +27,8 @@ export default combineReducers<IAppState>({
2727

2828
```ts
2929
import { NgModule } from '@angular/core';
30-
import { NgReduxModule, NgRedux } from '@angular-redux/core';
31-
import { NgReduxRouterModule, NgReduxRouter } from '@angular-redux/router';
30+
import { NgReduxModule, NgRedux } from 'ngredux-core';
31+
import { NgReduxRouterModule, NgReduxRouter } from 'ngredux-router';
3232
import { RouterModule } from '@angular/router';
3333
import { routes } from './routes';
3434

@@ -68,4 +68,4 @@ getting the URL from there.
6868

6969
# Examples
7070

71-
- [Example-app: An example of using @angular-redux/router along with the other companion packages.](https://github.com/angular-redux/platform/tree/master/packages/example-app)
71+
- [Example-app: An example of using ngredux-router along with the other companion packages.](https://github.com/angular-redux/platform/tree/master/packages/example-app)

docs/store/README.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
[![npm version](https://img.shields.io/npm/v/@angular-redux/store.svg)](https://www.npmjs.com/package/@angular-redux/store)
2-
[![downloads per month](https://img.shields.io/npm/dm/@angular-redux/store.svg)](https://www.npmjs.com/package/@angular-redux/store)
1+
[![npm version](https://img.shields.io/npm/v/ngredux-store.svg)](https://www.npmjs.com/package/ngredux-store)
2+
[![downloads per month](https://img.shields.io/npm/dm/ngredux-store.svg)](https://www.npmjs.com/package/ngredux-store)
33

44
# Getting Started
55

@@ -9,10 +9,10 @@
99

1010
## Quickstart
1111

12-
`@angular-redux/store` has a peer dependency on redux, so we need to install it.
12+
`ngredux-store` has a peer dependency on redux, so we need to install it.
1313

1414
```sh
15-
npm install --save redux @angular-redux/store
15+
npm install --save redux ngredux-store
1616
```
1717

1818
```typescript
@@ -29,7 +29,7 @@ can configure your Redux store with reducers, initial state,
2929
and optionally middlewares and enhancers as you would in Redux directly.
3030

3131
```typescript
32-
import { NgReduxModule, NgRedux } from '@angular-redux/store';
32+
import { NgReduxModule, NgRedux } from 'ngredux-store';
3333
import { createLogger } from 'redux-logger';
3434
import { rootReducer } from './reducers';
3535

@@ -59,7 +59,7 @@ import {
5959
compose,
6060
createStore,
6161
} from 'redux';
62-
import { NgReduxModule, NgRedux } from '@angular-redux/store';
62+
import { NgReduxModule, NgRedux } from 'ngredux-store';
6363
import { createLogger } from 'redux-logger';
6464
import { rootReducer } from './reducers';
6565

@@ -85,7 +85,7 @@ class AppModule {
8585

8686
> Note that we're also using a Redux middleware from the community here:
8787
> [redux-logger](https://www.npmjs.com/package/redux-logger). This is just to show
88-
> off that `@angular-redux/store` is indeed compatible with Redux middlewares as you
88+
> off that `ngredux-store` is indeed compatible with Redux middlewares as you
8989
> might expect.
9090
>
9191
> Note that to use it, you'll need to install it with `npm install --save redux-logger`
@@ -95,7 +95,7 @@ Now your Angular app has been reduxified! Use the `@select` decorator to
9595
access your store state, and `.dispatch()` to dispatch actions:
9696

9797
```typescript
98-
import { select } from '@angular-redux/store';
98+
import { select } from 'ngredux-store';
9999

100100
@Component({
101101
template:
@@ -116,8 +116,8 @@ class App {
116116

117117
# Companion Packages
118118

119-
- [Reduxify your Routing with @angular-redux/router](https://github.com/angular-redux/platform/blob/master/packages/router)
120-
- [Reduxify your Forms with @angular-redux/form](https://github.com/angular-redux/platform/blob/master/packages/form)
119+
- [Reduxify your Routing with ngredux-router](https://github.com/angular-redux/platform/blob/master/packages/router)
120+
- [Reduxify your Forms with ngredux-form](https://github.com/angular-redux/platform/blob/master/packages/form)
121121

122122
# Resources
123123

@@ -127,7 +127,7 @@ class App {
127127

128128
# In-Depth Usage
129129

130-
`@angular-redux/store` uses an approach to redux based on RxJS Observables to `select` and transform
130+
`ngredux-store` uses an approach to redux based on RxJS Observables to `select` and transform
131131
data on its way out of the store and into your UI or side-effect handlers. Observables
132132
are an efficient analogue to `reselect` for the RxJS-heavy Angular world.
133133

@@ -160,7 +160,7 @@ parameter at all.
160160
```typescript
161161
import { Component } from '@angular/core';
162162
import { Observable } from 'rxjs/Observable';
163-
import { select } from '@angular-redux/store';
163+
import { select } from 'ngredux-store';
164164

165165
@Component({
166166
selector: 'counter-value-printed-many-times',
@@ -208,7 +208,7 @@ import { Component } from '@angular/core';
208208
import { Observable } from 'rxjs/Observable';
209209
import { Counter } from '../components/Counter';
210210
import * as CounterActions from '../actions/CounterActions';
211-
import { NgRedux } from '@angular-redux/store';
211+
import { NgRedux } from 'ngredux-store';
212212

213213
interface IAppState {
214214
counter: number;
@@ -268,5 +268,5 @@ class Foo {
268268
- [Using Angular's Dependency Injector with Middlewares](store/articles/cookbooks#using-angular-2-services-in-your-middleware)
269269
- [Managing Side-Effects with redux-observable Epics](store/articles/cookbooks#side-effect-management-using-epics)
270270
- [Using the Redux DevTools Chrome Extension](store/articles/cookbooks#using-devtools)
271-
- [@angular-redux/store and ImmutableJS](store/articles/cookbooks#using-immutablejs)
271+
- [ngredux-store and ImmutableJS](store/articles/cookbooks#using-immutablejs)
272272
- [Strongly Typed Reducers](store/articles/cookbooks#strongly-typed-reducers)

0 commit comments

Comments
 (0)