Skip to content

Commit b4e9b49

Browse files
Merge pull request #14 from pascalbe-dev/feature/9_allow-opt-out-of-publishable-lib
feat(domain,feature): add property to specify build type
2 parents 8a3a474 + 02637ef commit b4e9b49

File tree

6 files changed

+32
-0
lines changed

6 files changed

+32
-0
lines changed

libs/ddd/src/schematics/domain/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ export default function(options: DomainOptions): Rule {
2929
tags: `domain:${options.name},type:domain-logic`,
3030
style: 'scss',
3131
prefix: options.name,
32+
publishable: options.type === 'publishable',
33+
buildable: options.type === 'buildable',
3234
}),
3335
addDomainToLintingRules(options.name),
3436
mergeWith(templateSource),

libs/ddd/src/schematics/domain/schema.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@
1515
"type": "boolean",
1616
"description": "Add an app for the domain?",
1717
"default": false
18+
},
19+
"type": {
20+
"type": "string",
21+
"enum": [
22+
"internal",
23+
"buildable",
24+
"publishable"
25+
],
26+
"description": "A type to determine if and how to build the library.",
27+
"default": "publishable"
1828
}
1929
},
2030
"required": ["name"]

libs/ddd/src/schematics/domain/schema.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,9 @@ export interface DomainOptions {
1414
* Add an app for the domain?
1515
*/
1616
addApp?: boolean;
17+
/**
18+
* A type to determine if and how to build the library.
19+
*/
20+
type?: "internal" | "buildable" | "publishable";
1721
[k: string]: any;
1822
}

libs/ddd/src/schematics/feature/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ export default function(options: FeatureOptions): Rule {
181181
tags: `domain:${options.domain},type:feature`,
182182
style: 'scss',
183183
prefix: options.domain,
184+
publishable: options.type === 'publishable',
185+
buildable: options.type === 'buildable',
184186
}),
185187
addImport(featureModulePath, domainImportPath, domainModuleClassName),
186188
(!options.lazy && host.exists(appModulePath)) ?

libs/ddd/src/schematics/feature/schema.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@
2727
"entity": {
2828
"type": "string",
2929
"description": "Optional entity to create for this feature"
30+
},
31+
"type": {
32+
"type": "string",
33+
"enum": [
34+
"internal",
35+
"buildable",
36+
"publishable"
37+
],
38+
"description": "A type to determine if and how to build the library.",
39+
"default": "publishable"
3040
}
3141
},
3242
"required": ["name", "domain"]

libs/ddd/src/schematics/feature/schema.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,9 @@ export interface FeatureOptions {
2626
* Optional entity to create for this feature
2727
*/
2828
entity?: string;
29+
/**
30+
* A type to determine if and how to build the library.
31+
*/
32+
type?: "internal" | "buildable" | "publishable";
2933
[k: string]: any;
3034
}

0 commit comments

Comments
 (0)