From 00c00e008988aedc8adfc52777b883a93fa62ebe Mon Sep 17 00:00:00 2001 From: Tim Deschryver <28659384+timdeschryver@users.noreply.github.com> Date: Fri, 26 Apr 2019 14:05:39 +0200 Subject: [PATCH] fix(data): update the package name for replacement to ngrx-data (#1805) Closes #1802 --- modules/data/schematics/ng-add/index.spec.ts | 10 +++++----- modules/data/schematics/ng-add/index.ts | 4 ++-- modules/data/schematics/ng-add/schema.json | 2 +- projects/ngrx.io/content/guide/data/install.md | 6 +++--- projects/ngrx.io/content/guide/migration/v8.md | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/data/schematics/ng-add/index.spec.ts b/modules/data/schematics/ng-add/index.spec.ts index b7f1cc9c33..0d0983bea1 100644 --- a/modules/data/schematics/ng-add/index.spec.ts +++ b/modules/data/schematics/ng-add/index.spec.ts @@ -98,14 +98,14 @@ 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) @@ -113,14 +113,14 @@ describe('Data ng-add Schematic', () => { 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', () => { diff --git a/modules/data/schematics/ng-add/index.ts b/modules/data/schematics/ng-add/index.ts index 0736b2fb83..46dc965814 100644 --- a/modules/data/schematics/ng-add/index.ts +++ b/modules/data/schematics/ng-add/index.ts @@ -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)); diff --git a/modules/data/schematics/ng-add/schema.json b/modules/data/schematics/ng-add/schema.json index 4e9c3ed2d9..71244aaefc 100644 --- a/modules/data/schematics/ng-add/schema.json +++ b/modules/data/schematics/ng-add/schema.json @@ -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" } }, diff --git a/projects/ngrx.io/content/guide/data/install.md b/projects/ngrx.io/content/guide/data/install.md index 63ea8035d3..4b2377c5fb 100644 --- a/projects/ngrx.io/content/guide/data/install.md +++ b/projects/ngrx.io/content/guide/data/install.md @@ -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: @@ -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. diff --git a/projects/ngrx.io/content/guide/migration/v8.md b/projects/ngrx.io/content/guide/migration/v8.md index 8d4763ad69..0a057f716c 100644 --- a/projects/ngrx.io/content/guide/migration/v8.md +++ b/projects/ngrx.io/content/guide/migration/v8.md @@ -237,6 +237,6 @@ To stay consistent with the other `@ngrx/*` packages, the following has been ren