Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(data): the correct package name is ngrx-data #1805

Merged
merged 1 commit into from
Apr 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions modules/data/schematics/ng-add/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,29 +98,29 @@ describe('Data ng-add Schematic', () => {
expect(content).toMatch(/EntityDataModuleWithoutEffects\n/);
});

describe('Migration of angular-ngrx-data', () => {
it('should remove angular-ngrx-data from package.json', () => {
describe('Migration of ngrx-data', () => {
it('should remove ngrx-data from package.json', () => {
const options = { ...defaultOptions, migrateNgrxData: true };

const packageJsonBefore = JSON.parse(
appTree.readContent('/package.json')
);
packageJsonBefore['dependencies']['angular-ngrx-data'] = '1.0.0';
packageJsonBefore['dependencies']['ngrx-data'] = '1.0.0';
appTree.overwrite(
'/package.json',
JSON.stringify(packageJsonBefore, null, 2)
);

expect(
JSON.parse(appTree.readContent('/package.json'))['dependencies'][
'angular-ngrx-data'
'ngrx-data'
]
).toBeDefined();

const tree = schematicRunner.runSchematic('ng-add', options, appTree);
const packageJson = JSON.parse(tree.readContent('/package.json'));

expect(packageJson.dependencies['angular-ngrx-data']).not.toBeDefined();
expect(packageJson.dependencies['ngrx-data']).not.toBeDefined();
});

it('should rename NgrxDataModule', () => {
Expand Down
4 changes: 2 additions & 2 deletions modules/data/schematics/ng-add/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ function removeAngularNgRxDataFromPackageJson() {
const sourceText = host.read('package.json')!.toString('utf-8');
const json = JSON.parse(sourceText);

if (json['dependencies'] && json['dependencies']['angular-ngrx-data']) {
delete json['dependencies']['angular-ngrx-data'];
if (json['dependencies'] && json['dependencies']['ngrx-data']) {
delete json['dependencies']['ngrx-data'];
}

host.overwrite('package.json', JSON.stringify(json, null, 2));
Expand Down
2 changes: 1 addition & 1 deletion modules/data/schematics/ng-add/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"migrateNgrxData": {
"type": "boolean",
"default": false,
"description": "Migrate from angular-ngrx-data, will rename modules.",
"description": "Migrate from ngrx-data, will rename modules.",
"alias": "migrate"
}
},
Expand Down
6 changes: 3 additions & 3 deletions projects/ngrx.io/content/guide/data/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ng add @ngrx/data
* project - name of the project defined in your `angular.json` to help locating the module to add the `EntityDataModule` to.
* module - name of file containing the module that you wish to add the import for the `EntityDataModule` to. Can also include the relative path to the file. For example, `src/app/app.module.ts`.
* effects - if `false` it will use the `EntityDataModuleWithoutEffects` module instead of the default `EntityDataModule`.
* migrateNgRxData - if `true` it will replace the `angular-ngrx-data` module with the `@ngrx/data` module.
* migrateNgRxData - if `true` it will replace the `ngrx-data` module with the `@ngrx/data` module.

This command will automate the following steps:

Expand All @@ -39,5 +39,5 @@ This command will automate the following steps:

With the `migrateNgRxData` flag the following will also take place:

1. Remove `angular-ngrx-data` from `package.json` > `dependencies`.
2. Rename `angular-ngrx-data` types to the matching `@ngrx/data` types.
1. Remove `ngrx-data` from `package.json` > `dependencies`.
2. Rename `ngrx-data` types to the matching `@ngrx/data` types.
2 changes: 1 addition & 1 deletion projects/ngrx.io/content/guide/migration/v8.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,6 @@ To stay consistent with the other `@ngrx/*` packages, the following has been ren

<div class="alert is-helpful">

The installation of `@ngrx/data` package via `ng add @ngrx/data` will remove `angular-ngrx-data` from the `package.json` and will also perform these renames.
The installation of `@ngrx/data` package via `ng add @ngrx/data` will remove `ngrx-data` from the `package.json` and will also perform these renames.

</div>