Skip to content

Commit 408dba9

Browse files
committed
feat: porting to nx generators
1 parent d57b4d9 commit 408dba9

104 files changed

Lines changed: 10669 additions & 1905 deletions

File tree

Some content is hidden

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

libs/ddd/README.md

Lines changed: 8 additions & 1 deletion

libs/ddd/collection.json

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,37 @@
11
{
2-
"$schema": "../../node_modules/@angular-devkit/schematics/collection-schema.json",
32
"name": "@angular-architects/ddd",
43
"version": "0.0.1",
54
"schematics": {
65
"ng-add": {
7-
"factory": "./libs/ddd/src/schematics/ng-add/index",
6+
"factory": "./src/schematics/ng-add/index",
87
"description": "adds initial access restrictions to linting rules",
9-
"aliases": ["init"],
10-
"schema": "./libs/ddd/src/schematics/ng-add/schema.json"
8+
"schema": "./src/schematics/ng-add/schema.json"
9+
}
10+
},
11+
"generators": {
12+
"init": {
13+
"factory": "./src/generators/init/index",
14+
"description": "adds initial access restrictions to linting rules",
15+
"schema": "./src/generators/init/schema.json"
1116
},
1217
"domain": {
13-
"factory": "./libs/ddd/src/schematics/domain/index",
14-
"schema": "./libs/ddd/src/schematics/domain/schema.json",
15-
"description": "adds a domain including a domain folder, domain lib, entries in nx.json, and linting rules in tslint.json"
18+
"factory": "./src/generators/domain/index",
19+
"schema": "./src/generators/domain/schema.json",
20+
"description": "domain generator"
1621
},
1722
"feature": {
18-
"factory": "./libs/ddd/src/schematics/feature/index",
19-
"schema": "./libs/ddd/src/schematics/feature/schema.json",
23+
"factory": "./src/generators/feature/index",
24+
"schema": "./src/generators/feature/schema.json",
2025
"description": "adds a feature lib to a domain"
2126
},
2227
"ui": {
23-
"factory": "./libs/ddd/src/schematics/ui/ui",
24-
"schema": "./libs/ddd/src/schematics/ui/schema.json",
28+
"factory": "./src/generators/ui/index",
29+
"schema": "./src/generators/ui/schema.json",
2530
"description": "adds a UI library to a domain or as a shared library"
2631
},
2732
"util": {
28-
"factory": "./libs/ddd/src/schematics/util/util",
29-
"schema": "./libs/ddd/src/schematics/util/schema.json",
33+
"factory": "./src/generators/util/index",
34+
"schema": "./src/generators/util/schema.json",
3035
"description": "adds a utility library to a domain or as a shared library"
3136
}
3237
}

libs/ddd/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@angular-architects/ddd",
3-
"version": "1.5.1",
3+
"version": "2.0.0-rc.1",
44
"license": "MIT",
55
"author": "Manfred Steyer",
66
"description": "Nx plugin for structuring a monorepo with domains and layers",
@@ -9,8 +9,10 @@
99
"url": "https://github.com/angular-architects/nx-ddd-plugin"
1010
},
1111
"dependencies": {
12-
"@ngrx/schematics":"^12.0.0"
12+
"@ngrx/schematics":"^13.0.0"
1313
},
1414
"main": "src/index.js",
15-
"schematics": "./collection.json"
15+
"schematics": "./collection.json",
16+
"generators": "./collection.json"
17+
1618
}
File renamed without changes.

libs/ddd/src/_generators/domain/files/entities/.gitkeep renamed to libs/ddd/src/generators/domain/files/application/.gitkeep

File renamed without changes.

libs/ddd/src/_generators/domain/files/infrastructure/.gitkeep renamed to libs/ddd/src/generators/domain/files/entities/.gitkeep

File renamed without changes.

libs/ddd/src/schematics/domain/files/application/.gitkeep renamed to libs/ddd/src/generators/domain/files/infrastructure/.gitkeep

File renamed without changes.
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,16 @@ export default async function (tree: Tree, options: DomainOptions) {
5757
});
5858
});
5959

60-
generateFiles(
61-
tree,
62-
joinPathFragments(__dirname, './files'), // path to the file templates
63-
libLibFolder,
64-
{}
65-
);
60+
// generateFiles(
61+
// tree,
62+
// joinPathFragments(__dirname, './files'), // path to the file templates
63+
// libLibFolder,
64+
// {}
65+
// );
66+
67+
tree.write(joinPathFragments(libLibFolder, './application/.gitkeep'), '');
68+
tree.write(joinPathFragments(libLibFolder, './entities/.gitkeep'), '');
69+
tree.write(joinPathFragments(libLibFolder, './infrastructure/.gitkeep'), '');
6670

6771
if (options.addApp) {
6872
await applicationGenerator(tree, {
@@ -106,7 +110,7 @@ function addNgrxDependencies(tree: Tree) {
106110
}
107111

108112
function addNgrxImportsToApp(tree: Tree, appModuleFilepath: string) {
109-
const moduleSource = tree.read(appModuleFilepath, 'utf-8');
113+
const moduleSource = tree.read(appModuleFilepath).toString('utf-8');
110114

111115
let sourceFile = ts.createSourceFile(
112116
appModuleFilepath,
File renamed without changes.

0 commit comments

Comments
 (0)