From b7b79a220261c4aaf213fec6c38422cc557ca18b Mon Sep 17 00:00:00 2001 From: Charlie Greenman Date: Mon, 4 Dec 2023 17:59:21 -0500 Subject: [PATCH 01/13] ZETA-7230: Update index for nextjs --- src/rz/nextjs/index.ts | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/rz/nextjs/index.ts diff --git a/src/rz/nextjs/index.ts b/src/rz/nextjs/index.ts new file mode 100644 index 0000000..e69de29 From 908e82ad52946c85ad0d9f6a7f94d2ae822ceb05 Mon Sep 17 00:00:00 2001 From: Charlie Greenman Date: Mon, 4 Dec 2023 18:03:08 -0500 Subject: [PATCH 02/13] ZETA-7230: Update the nexjs effects --- src/rz/nextjs/effects/library/nextjs-library.spec.ts | 0 src/rz/nextjs/effects/library/nextjs-library.ts | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/rz/nextjs/effects/library/nextjs-library.spec.ts create mode 100644 src/rz/nextjs/effects/library/nextjs-library.ts diff --git a/src/rz/nextjs/effects/library/nextjs-library.spec.ts b/src/rz/nextjs/effects/library/nextjs-library.spec.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/rz/nextjs/effects/library/nextjs-library.ts b/src/rz/nextjs/effects/library/nextjs-library.ts new file mode 100644 index 0000000..e69de29 From bdbfc734da54010d2b3fc9a2aa03c3f9844d160f Mon Sep 17 00:00:00 2001 From: Charlie Greenman Date: Mon, 4 Dec 2023 18:08:24 -0500 Subject: [PATCH 03/13] ZETA-7230: Update the nextjs library ts file so it works with the application --- src/rz/angular/effects/library/library.ts | 2 -- .../nextjs/effects/library/nextjs-library.ts | 35 +++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/rz/angular/effects/library/library.ts b/src/rz/angular/effects/library/library.ts index b06bf4e..865744a 100644 --- a/src/rz/angular/effects/library/library.ts +++ b/src/rz/angular/effects/library/library.ts @@ -12,12 +12,10 @@ export function libraryEffects(fileEffects: EditFileEffect[], parameters: any): const newFileEffects = []; for(const fileEffect of fileEffects) { const filePath = fileEffect.filePath; - const originFilePath = fileEffect.originFilePath; if(filePath.includes('tsconfig.base.json')) { const projectName = parameters['projectName']; const fileName = filePath.split('/').pop(); const fileToBeAddedTo = fileEffect.content; - const libName = parameters['name']; const libPath = parameters['nameFilePath']; const libPathMinusLibFolder = libPath.replace('libs/', ''); diff --git a/src/rz/nextjs/effects/library/nextjs-library.ts b/src/rz/nextjs/effects/library/nextjs-library.ts index e69de29..79661b4 100644 --- a/src/rz/nextjs/effects/library/nextjs-library.ts +++ b/src/rz/nextjs/effects/library/nextjs-library.ts @@ -0,0 +1,35 @@ +// returns package json as well, so can get package json data +export function returnRootTsConfig(filePathWithName: string, fileTree: string[], optionalTypes: AngularOptionalType[]): string[] { + return ['tsconfig.base.json']; +} + +// will use the name parameter to get name of library +export function libraryEffects(fileEffects: EditFileEffect[], parameters: any): EditFileEffect[] { + const newFileEffects = []; + for(const fileEffect of fileEffects) { + const filePath = fileEffect.filePath; + if(filePath.includes('tsconfig.base.json')) { + const projectName = parameters['projectName']; + const fileName = filePath.split('/').pop(); + const fileToBeAddedTo = fileEffect.content; + const libPath = parameters['nameFilePath']; + const libPathMinusLibFolder = libPath.replace('libs/', ''); + + const editInput: any = { + fileType: 'ts', + fileName: fileName, + filePath: filePath, + fileToBeAddedTo: fileToBeAddedTo, + edits: [{ + nodeType: 'addJsonKeyValue', + valueToModify: `paths`, + codeBlock: {[`@${projectName}/${libPathMinusLibFolder}`]: [`${libPath}/src/index.ts`]} + }] + }; + const updatedFileToBeAddedTo = morphJson(editInput); + fileEffect.content = updatedFileToBeAddedTo; + newFileEffects.push(fileEffect); + } + } + return newFileEffects; +} \ No newline at end of file From db40e784bd2832438804f452c70f916c82e959ef Mon Sep 17 00:00:00 2001 From: Charlie Greenman Date: Mon, 4 Dec 2023 18:20:57 -0500 Subject: [PATCH 04/13] ZETA-7230: Add nextjs as a standalone effect --- src/rz/morph/community-paths/community-paths.ts | 5 +++++ src/rz/nextjs/effects/library/nextjs-library.ts | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/rz/morph/community-paths/community-paths.ts b/src/rz/morph/community-paths/community-paths.ts index 6fd68b4..c056046 100644 --- a/src/rz/morph/community-paths/community-paths.ts +++ b/src/rz/morph/community-paths/community-paths.ts @@ -1,6 +1,7 @@ export enum CommunityPaths { Angular = 'angular', React = 'react', + Nextjs = 'nextjs', Aws = 'aws', Azure = 'azure', Gcp = 'gcp', @@ -19,6 +20,10 @@ export const supportedCommunityPaths = [ id: 'angular', displayName: 'Angular', }, + { + id: 'nextjs', + displayName: 'Nextjs', + }, { id: 'react', displayName: 'React', diff --git a/src/rz/nextjs/effects/library/nextjs-library.ts b/src/rz/nextjs/effects/library/nextjs-library.ts index 79661b4..ad15f4f 100644 --- a/src/rz/nextjs/effects/library/nextjs-library.ts +++ b/src/rz/nextjs/effects/library/nextjs-library.ts @@ -1,3 +1,5 @@ +import { EditFileEffect } from "../../../morph/interfaces/morph.interface"; + // returns package json as well, so can get package json data export function returnRootTsConfig(filePathWithName: string, fileTree: string[], optionalTypes: AngularOptionalType[]): string[] { return ['tsconfig.base.json']; From d369474f7ee96875c99532ffe7692d3cf1d32164 Mon Sep 17 00:00:00 2001 From: Charlie Greenman Date: Mon, 4 Dec 2023 18:37:44 -0500 Subject: [PATCH 05/13] ZETA-7230: Update te nextjs types and nexjs effects file to have beginning infrastructure --- src/rz/morph/morph.ts | 2 ++ src/rz/nextjs/effects/nextjs-effects.spec.ts | 0 src/rz/nextjs/effects/nextjs-effects.ts | 0 src/rz/nextjs/types/nextjs-types.ts | 13 +++++++++++++ 4 files changed, 15 insertions(+) create mode 100644 src/rz/nextjs/effects/nextjs-effects.spec.ts create mode 100644 src/rz/nextjs/effects/nextjs-effects.ts create mode 100644 src/rz/nextjs/types/nextjs-types.ts diff --git a/src/rz/morph/morph.ts b/src/rz/morph/morph.ts index ee0cfe1..e7898e8 100644 --- a/src/rz/morph/morph.ts +++ b/src/rz/morph/morph.ts @@ -57,6 +57,8 @@ export function standaloneEffects(programmingLanguage: string, parameter: Templa switch(programmingLanguage) { case CommunityPaths.Angular: return angularStandaloneEffects((parameter.type) as AngularTypeNames, fileEffects, parameters) + case CommunityPaths.Nextjs: + return angularStandaloneEffects((parameter.type) as AngularTypeNames, fileEffects, parameters) default: return [] } diff --git a/src/rz/nextjs/effects/nextjs-effects.spec.ts b/src/rz/nextjs/effects/nextjs-effects.spec.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/rz/nextjs/effects/nextjs-effects.ts b/src/rz/nextjs/effects/nextjs-effects.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/rz/nextjs/types/nextjs-types.ts b/src/rz/nextjs/types/nextjs-types.ts new file mode 100644 index 0000000..e63cfdc --- /dev/null +++ b/src/rz/nextjs/types/nextjs-types.ts @@ -0,0 +1,13 @@ +export enum NextjsTypeNames { + Generic = 'generic', + Library = 'library' +} + +export enum GlobalNextjsOptionNames { + IsExported = 'isExported' +} + +export interface AngularOptionalType { + name: GlobalNextjsOptionNames, + selected: boolean +} \ No newline at end of file From 43458891079a7ab7aa9c0f3a15984da6a2e12cd5 Mon Sep 17 00:00:00 2001 From: Charlie Greenman Date: Mon, 4 Dec 2023 18:47:19 -0500 Subject: [PATCH 06/13] ZETA-7230: Update the nextjs effects l0gic --- src/rz/nextjs/effects/nextjs-effects.ts | 8 ++++++++ src/rz/nextjs/types/nextjs-types.ts | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/rz/nextjs/effects/nextjs-effects.ts b/src/rz/nextjs/effects/nextjs-effects.ts index e69de29..3e708ed 100644 --- a/src/rz/nextjs/effects/nextjs-effects.ts +++ b/src/rz/nextjs/effects/nextjs-effects.ts @@ -0,0 +1,8 @@ +import { AngularOptionalType } from "../../angular/types/types"; +import { NOT_SUPPORTED_TYPE } from "../../morph"; +import { NextjsTypeNames } from "../types/nextjs-types"; + +export function angularFilesToAffect(filePathWithName: string, fileTree: string[], type: NextjsTypeNames, optionalTypes: AngularOptionalType[]): string[] | NOT_SUPPORTED_TYPE { + switch(type) { + } +} \ No newline at end of file diff --git a/src/rz/nextjs/types/nextjs-types.ts b/src/rz/nextjs/types/nextjs-types.ts index e63cfdc..d058a12 100644 --- a/src/rz/nextjs/types/nextjs-types.ts +++ b/src/rz/nextjs/types/nextjs-types.ts @@ -7,7 +7,7 @@ export enum GlobalNextjsOptionNames { IsExported = 'isExported' } -export interface AngularOptionalType { +export interface NextjsOptionalType { name: GlobalNextjsOptionNames, selected: boolean } \ No newline at end of file From 2aaec34b94e25cefa9570222cf2e71a397f658f0 Mon Sep 17 00:00:00 2001 From: Charlie Greenman Date: Mon, 4 Dec 2023 18:47:40 -0500 Subject: [PATCH 07/13] ZETA-7230: Update nextjs effects for the appliation --- src/rz/nextjs/effects/nextjs-effects.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/rz/nextjs/effects/nextjs-effects.ts b/src/rz/nextjs/effects/nextjs-effects.ts index 3e708ed..6a69d33 100644 --- a/src/rz/nextjs/effects/nextjs-effects.ts +++ b/src/rz/nextjs/effects/nextjs-effects.ts @@ -1,8 +1,11 @@ import { AngularOptionalType } from "../../angular/types/types"; import { NOT_SUPPORTED_TYPE } from "../../morph"; -import { NextjsTypeNames } from "../types/nextjs-types"; +import { NextjsOptionalType, NextjsTypeNames } from "../types/nextjs-types"; +import { returnRootTsConfig } from "./library/nextjs-library"; -export function angularFilesToAffect(filePathWithName: string, fileTree: string[], type: NextjsTypeNames, optionalTypes: AngularOptionalType[]): string[] | NOT_SUPPORTED_TYPE { +export function nextjsFilesToAffect(filePathWithName: string, fileTree: string[], type: NextjsTypeNames, optionalTypes: NextjsOptionalType[]): string[] | NOT_SUPPORTED_TYPE { switch(type) { + case NextjsTypeNames.Library: + return returnRootTsConfig(filePathWithName, fileTree, optionalTypes); } } \ No newline at end of file From 35f37c1f8d9e24bf7507e4a92cca1683cf991c2a Mon Sep 17 00:00:00 2001 From: Charlie Greenman Date: Mon, 4 Dec 2023 18:55:29 -0500 Subject: [PATCH 08/13] ZETA-7230: Update nextjs effects for the application --- src/rz/nextjs/effects/library/nextjs-library.ts | 2 +- src/rz/nextjs/effects/nextjs-effects.ts | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/rz/nextjs/effects/library/nextjs-library.ts b/src/rz/nextjs/effects/library/nextjs-library.ts index ad15f4f..0061751 100644 --- a/src/rz/nextjs/effects/library/nextjs-library.ts +++ b/src/rz/nextjs/effects/library/nextjs-library.ts @@ -6,7 +6,7 @@ export function returnRootTsConfig(filePathWithName: string, fileTree: string[], } // will use the name parameter to get name of library -export function libraryEffects(fileEffects: EditFileEffect[], parameters: any): EditFileEffect[] { +export function nextJsLibraryEffects(fileEffects: EditFileEffect[], parameters: any): EditFileEffect[] { const newFileEffects = []; for(const fileEffect of fileEffects) { const filePath = fileEffect.filePath; diff --git a/src/rz/nextjs/effects/nextjs-effects.ts b/src/rz/nextjs/effects/nextjs-effects.ts index 6a69d33..11ec7bb 100644 --- a/src/rz/nextjs/effects/nextjs-effects.ts +++ b/src/rz/nextjs/effects/nextjs-effects.ts @@ -1,11 +1,21 @@ import { AngularOptionalType } from "../../angular/types/types"; import { NOT_SUPPORTED_TYPE } from "../../morph"; +import { EditFileEffect } from "../../morph/interfaces/morph.interface"; import { NextjsOptionalType, NextjsTypeNames } from "../types/nextjs-types"; -import { returnRootTsConfig } from "./library/nextjs-library"; +import { nextJsLibraryEffects, returnRootTsConfig } from "./library/nextjs-library"; export function nextjsFilesToAffect(filePathWithName: string, fileTree: string[], type: NextjsTypeNames, optionalTypes: NextjsOptionalType[]): string[] | NOT_SUPPORTED_TYPE { switch(type) { case NextjsTypeNames.Library: return returnRootTsConfig(filePathWithName, fileTree, optionalTypes); } +} + +export function angularStandaloneEffects(type: NextjsTypeNames, fileEffects: EditFileEffect[], parameters?: any): EditFileEffect[] { + switch(type) { + case NextjsTypeNames.Library: + return nextJsLibraryEffects(fileEffects, parameters); + default: + return []; + } } \ No newline at end of file From e658568d6ae4f48181a2cfef72b873b5920844e6 Mon Sep 17 00:00:00 2001 From: Charlie Greenman Date: Mon, 4 Dec 2023 19:04:16 -0500 Subject: [PATCH 09/13] ZETA-7230: Update nextjs effects so works with the application --- src/rz/nextjs/effects/nextjs-effects.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/rz/nextjs/effects/nextjs-effects.ts b/src/rz/nextjs/effects/nextjs-effects.ts index 11ec7bb..cb9d8c9 100644 --- a/src/rz/nextjs/effects/nextjs-effects.ts +++ b/src/rz/nextjs/effects/nextjs-effects.ts @@ -1,6 +1,5 @@ -import { AngularOptionalType } from "../../angular/types/types"; import { NOT_SUPPORTED_TYPE } from "../../morph"; -import { EditFileEffect } from "../../morph/interfaces/morph.interface"; +import { EditFileEffect, NOT_SUPPORTED } from "../../morph/interfaces/morph.interface"; import { NextjsOptionalType, NextjsTypeNames } from "../types/nextjs-types"; import { nextJsLibraryEffects, returnRootTsConfig } from "./library/nextjs-library"; @@ -8,10 +7,12 @@ export function nextjsFilesToAffect(filePathWithName: string, fileTree: string[] switch(type) { case NextjsTypeNames.Library: return returnRootTsConfig(filePathWithName, fileTree, optionalTypes); + default: + return NOT_SUPPORTED; } } -export function angularStandaloneEffects(type: NextjsTypeNames, fileEffects: EditFileEffect[], parameters?: any): EditFileEffect[] { +export function nextjsStandaloneEffects(type: NextjsTypeNames, fileEffects: EditFileEffect[], parameters?: any): EditFileEffect[] { switch(type) { case NextjsTypeNames.Library: return nextJsLibraryEffects(fileEffects, parameters); From ebf5bbaa5ee053d197293ff7146aad0f468920f0 Mon Sep 17 00:00:00 2001 From: Charlie Greenman Date: Mon, 4 Dec 2023 19:21:12 -0500 Subject: [PATCH 10/13] ZETA-7230: Pipe up nextjs to codemod --- src/rz/morph/morph.ts | 8 ++++++-- src/rz/nextjs/effects/nextjs-effects.spec.ts | 0 2 files changed, 6 insertions(+), 2 deletions(-) delete mode 100644 src/rz/nextjs/effects/nextjs-effects.spec.ts diff --git a/src/rz/morph/morph.ts b/src/rz/morph/morph.ts index e7898e8..94638a1 100644 --- a/src/rz/morph/morph.ts +++ b/src/rz/morph/morph.ts @@ -12,6 +12,8 @@ import { angularEffects, angularFilesToAffect, angularStandaloneEffects } from ' import { reactTypes } from '../react'; import { TemplateInputParameter } from '../utils/interfaces/template-parameters'; import { EditFileEffect, NOT_SUPPORTED, NOT_SUPPORTED_TYPE } from './interfaces/morph.interface'; +import { nextjsStandaloneEffects } from '../nextjs/effects/nextjs-effects'; +import { NextjsTypeNames } from '../nextjs/types/nextjs-types'; // takes in singular object and makes all edits to files // used when editing a file @@ -40,8 +42,10 @@ export interface Parameters { // This function happens first and then effects is called export function filesToAffect(filePathWithName: string, fileTree: string[], parameter: TemplateInputParameter, programmingLanguage: string): string[] | NOT_SUPPORTED_TYPE { switch(programmingLanguage) { - case 'angular': + case CommunityPaths.Angular: return angularFilesToAffect(filePathWithName, fileTree, (parameter.type) as AngularTypeNames, (parameter.optionalTypes) as any as AngularOptionalType[]); + case 'angular': + return angularFilesToAffect(filePathWithName, fileTree, (parameter.type) as AngularTypeNames, (parameter.optionalTypes) as any as AngularOptionalType[]); default: return NOT_SUPPORTED; } @@ -58,7 +62,7 @@ export function standaloneEffects(programmingLanguage: string, parameter: Templa case CommunityPaths.Angular: return angularStandaloneEffects((parameter.type) as AngularTypeNames, fileEffects, parameters) case CommunityPaths.Nextjs: - return angularStandaloneEffects((parameter.type) as AngularTypeNames, fileEffects, parameters) + return nextjsStandaloneEffects((parameter.type) as NextjsTypeNames, fileEffects, parameters) default: return [] } diff --git a/src/rz/nextjs/effects/nextjs-effects.spec.ts b/src/rz/nextjs/effects/nextjs-effects.spec.ts deleted file mode 100644 index e69de29..0000000 From 7842796561398324edfaf56985ec3e04423f1f8b Mon Sep 17 00:00:00 2001 From: Charlie Greenman Date: Mon, 4 Dec 2023 19:48:00 -0500 Subject: [PATCH 11/13] ZETA-7230: Complete unit tests for nextjs --- .../effects/library/nextjs-library.spec.ts | 63 +++++++++++++++++++ .../nextjs/effects/library/nextjs-library.ts | 1 + 2 files changed, 64 insertions(+) diff --git a/src/rz/nextjs/effects/library/nextjs-library.spec.ts b/src/rz/nextjs/effects/library/nextjs-library.spec.ts index e69de29..a9c7f34 100644 --- a/src/rz/nextjs/effects/library/nextjs-library.spec.ts +++ b/src/rz/nextjs/effects/library/nextjs-library.spec.ts @@ -0,0 +1,63 @@ +import { standaloneEffects } from "../../../morph"; +import { EditFileEffect } from "../../../morph/interfaces/morph.interface"; +import { NextjsTypeNames } from "../../types/nextjs-types"; +import { returnRootTsConfig } from "./nextjs-library"; + +describe('Nextjs Library', () => { + describe('returnRootTsConfig', () => { + it('should return the root tsconfig to modify as well as package json to get project name from', () => { + const result = returnRootTsConfig('', [], []); + expect(result).toEqual(['tsconfig.base.json']); + }); + }); + + describe('libraryEffects', () => { + it('should modify the base tsconfig with the appropriate params', () => { + const programmingLanguage = 'nextjs'; + const mockParameter = { + type: NextjsTypeNames.Library + } as any; + const mockParameters = { + name: 'home', + nameFilePath: 'libs/ui/home', + projectName: 'test-codegen-eleven' + } + + const mockTsConfigBase = { + "compileOnSave": false, + "compilerOptions": { + "paths": { + "@test-codegen-eleven/common/common-ui": ["libs/common/common-ui/src/index.ts"], + } + } + }; + const expectedMockTsConfigBase = { + "compileOnSave": false, + "compilerOptions": { + "paths": { + "@test-codegen-eleven/common/common-ui": ["libs/common/common-ui/src/index.ts"], + "@test-codegen-eleven/ui/home": ["libs/ui/home/src/index.ts"], + } + } + }; + const mockTsConfigBaseStringfied = JSON.stringify(mockTsConfigBase); + const mockExpectedMockTsConfigBaseStringified = JSON.stringify(expectedMockTsConfigBase, null, 2); + const mockFileEffects: EditFileEffect[] = [ + { + filePath: 'tsconfig.base.json', + originFilePath: 'path/to/another/src/hello.component.ts', + content: mockTsConfigBaseStringfied + } + ]; + const result = standaloneEffects(programmingLanguage, mockParameter, mockFileEffects, mockParameters); + const expected = [ + { + filePath: 'tsconfig.base.json', + originFilePath: 'path/to/another/src/hello.component.ts', + content: mockExpectedMockTsConfigBaseStringified + } + ]; + expect(result).toEqual(expected); + }); + }); +}); \ No newline at end of file diff --git a/src/rz/nextjs/effects/library/nextjs-library.ts b/src/rz/nextjs/effects/library/nextjs-library.ts index 0061751..ca6c782 100644 --- a/src/rz/nextjs/effects/library/nextjs-library.ts +++ b/src/rz/nextjs/effects/library/nextjs-library.ts @@ -1,3 +1,4 @@ +import { morphJson } from "../../../json/json-morph"; import { EditFileEffect } from "../../../morph/interfaces/morph.interface"; // returns package json as well, so can get package json data From e8029cd7c7ac59809b8d3da065c5df2dc7f6d255 Mon Sep 17 00:00:00 2001 From: Charlie Greenman Date: Mon, 4 Dec 2023 19:54:37 -0500 Subject: [PATCH 12/13] ZETA-7230: Complete unit tests --- .../effects/library/nextjs-library.spec.ts | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/rz/nextjs/effects/library/nextjs-library.spec.ts b/src/rz/nextjs/effects/library/nextjs-library.spec.ts index a9c7f34..ca0524a 100644 --- a/src/rz/nextjs/effects/library/nextjs-library.spec.ts +++ b/src/rz/nextjs/effects/library/nextjs-library.spec.ts @@ -1,14 +1,26 @@ -import { standaloneEffects } from "../../../morph"; +import { filesToAffect, standaloneEffects } from "../../../morph"; import { EditFileEffect } from "../../../morph/interfaces/morph.interface"; import { NextjsTypeNames } from "../../types/nextjs-types"; import { returnRootTsConfig } from "./nextjs-library"; describe('Nextjs Library', () => { describe('returnRootTsConfig', () => { - it('should return the root tsconfig to modify as well as package json to get project name from', () => { - const result = returnRootTsConfig('', [], []); - expect(result).toEqual(['tsconfig.base.json']); - }); + it('should choose closest index file', () => { + const mockFilePath = 'path/to/another/src/hello.service.ts'; + const mockParameter = { + optionalTypes: {}, + type: NextjsTypeNames.Library + } as any; + + const fileTree = [ + "path/to/another/src", + "path/to/another/src/hello.component.ts", + "path/to/another/index.ts", + "path/to/another" + ]; + const fileToModify = filesToAffect(mockFilePath, fileTree, mockParameter, 'angular'); + expect(fileToModify).toEqual(['tsconfig.base.json']); + }); }); describe('libraryEffects', () => { From da475bcdb97dc75ee7cb78636693baf95ba5f953 Mon Sep 17 00:00:00 2001 From: Charlie Greenman Date: Mon, 4 Dec 2023 19:57:39 -0500 Subject: [PATCH 13/13] ZETA-7230: Update typescript type --- src/rz/nextjs/effects/library/nextjs-library.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rz/nextjs/effects/library/nextjs-library.ts b/src/rz/nextjs/effects/library/nextjs-library.ts index ca6c782..a3eb031 100644 --- a/src/rz/nextjs/effects/library/nextjs-library.ts +++ b/src/rz/nextjs/effects/library/nextjs-library.ts @@ -1,8 +1,9 @@ import { morphJson } from "../../../json/json-morph"; import { EditFileEffect } from "../../../morph/interfaces/morph.interface"; +import { NextjsOptionalType } from "../../types/nextjs-types"; // returns package json as well, so can get package json data -export function returnRootTsConfig(filePathWithName: string, fileTree: string[], optionalTypes: AngularOptionalType[]): string[] { +export function returnRootTsConfig(filePathWithName: string, fileTree: string[], optionalTypes: NextjsOptionalType[]): string[] { return ['tsconfig.base.json']; }