Skip to content

Commit

Permalink
Merge pull request #125 from srleecode/17.2.11
Browse files Browse the repository at this point in the history
fix: remove component index import
  • Loading branch information
srleecode authored Jan 6, 2024
2 parents 34b0379 + b634a5a commit 5dbc422
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@srleecode/domain",
"version": "17.2.10",
"version": "17.2.11",
"private": true,
"description": "Nrwl nx plugin to allow operations at the domain level",
"homepage": "https://github.com/srleecode/domain",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ describe('createPresentationLayerGenerator', () => {
addJestJunitReporter: true,
});
const filePath = `${groupingFolder}/presentation/src/index.ts`;
expect(tree.read(filePath).toString()).toMatch(
`export * from './lib/test-app-test-domain-shell.module`,
const index = tree.read(filePath).toString();
expect(index).toEqual(
`export * from './lib/test-app-test-domain-shell.module';`,
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import { classify } from '@angular-devkit/core/src/utils/strings';
export const createShellModule = (
tree: Tree,
groupingFolder: string,
libraryName: string
libraryName: string,
) => {
const dasherisedGroupingFolder = getDasherizedFolderPath(
tree,
groupingFolder
groupingFolder,
);
const classifiedDomain = classify(
getDomainPath(tree, groupingFolder).replace('/', '-')
getDomainPath(tree, groupingFolder).replace('/', '-'),
);
tree.write(
`${groupingFolder}/${libraryName}/src/lib/${dasherisedGroupingFolder}-shell.module.ts`,
Expand All @@ -26,26 +26,26 @@ import { CommonModule } from '@angular/common';
@NgModule({
imports: [CommonModule],
})
export class Ng${classifiedDomain}ShellModule {}`
export class Ng${classifiedDomain}ShellModule {}`,
);
updateModuleReference(
tree,
groupingFolder,
libraryName,
dasherisedGroupingFolder
dasherisedGroupingFolder,
);
};

const updateModuleReference = (
tree: Tree,
groupingFolder: string,
libraryName: string,
dasherisedGroupingFolder: string
dasherisedGroupingFolder: string,
) => {
const indexPath = `${groupingFolder}/${libraryName}/src/index.ts`;
tree.write(
indexPath,
tree.read(indexPath).toString() +
`export * from './lib/${dasherisedGroupingFolder}-shell.module.ts';`
`export * from './lib/${dasherisedGroupingFolder}-shell.module';`,
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ export const addDomainLibrary = async (
tree
.children(libraryFolder)
.forEach((folder) => tree.delete(`${libraryFolder}/${folder}`));
tree.write(
`${groupingFolderPath}/${libraryCommonOptions.name}/src/index.ts`,
'',
);
const dasherisedGroupingFolder = getDasherizedFolderPath(
tree,
groupingFolderPath,
Expand Down
2 changes: 1 addition & 1 deletion packages/domain/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@srleecode/domain",
"version": "17.2.10",
"version": "17.2.11",
"main": "index.js",
"executors": "./executors.json",
"generators": "./generators.json",
Expand Down

0 comments on commit 5dbc422

Please sign in to comment.