Skip to content

Commit

Permalink
chore: adjust nx and workspace json to include tags
Browse files Browse the repository at this point in the history
  • Loading branch information
nartc committed Jan 10, 2021
1 parent 89266a2 commit a10905a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 10 deletions.
25 changes: 23 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,26 @@
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{ "sourceTag": "*", "onlyDependOnLibsWithTags": ["*"] }
{
"sourceTag": "type:plugin",
"onlyDependOnLibsWithTags": ["type:library", "type:type-defs"]
},
{
"sourceTag": "type:library",
"onlyDependOnLibsWithTags": ["type:type-defs"]
},
{
"sourceTag": "type:integration",
"onlyDependOnLibsWithTags": ["type:library", "type:type-defs"]
},
{
"sourceTag": "type:test",
"onlyDependOnLibsWithTags": [
"type:library",
"type:plugin",
"type:type-defs"
]
}
]
}
]
Expand All @@ -21,7 +40,9 @@
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript"],
"parserOptions": { "project": "./tsconfig.*?.json" },
"parserOptions": {
"project": "./tsconfig.*?.json"
},
"rules": {}
},
{
Expand Down
14 changes: 7 additions & 7 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,25 @@
},
"projects": {
"core": {
"tags": []
"tags": ["type:library"]
},
"classes": {
"tags": []
"tags": ["type:plugin"]
},
"types": {
"tags": []
"tags": ["type:type-defs"]
},
"integration-test": {
"tags": []
"tags": ["type:test"]
},
"pojos": {
"tags": []
"tags": ["type:plugin"]
},
"nestjs": {
"tags": []
"tags": ["type:integration"]
},
"nestjs-integration-test": {
"tags": []
"tags": ["type:test"]
}
},
"workspaceLayout": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,19 @@ import {
describe('With Enum', () => {
const [mapper] = setupClasses('withEnum');

enum StringEnum1 {
Foo = 'foo',
Bar = 'bar',
}

it('should map correctly', () => {
mapper.createMap(FooWithEnum, FooWithEnumDto);

const foo = new FooWithEnum();
foo.externalEnum1 = ExternalEnum1.Bar;
foo.externalStringEnum1 = ExternalStringEnum1.Foo;
foo.enum1 = 0;
foo.stringEnum1 = 'bar' as any;
foo.stringEnum1 = 'bar' as StringEnum1;

const vm = mapper.map(foo, FooWithEnumDto, FooWithEnum);
expect(vm).toBeTruthy();
Expand Down

0 comments on commit a10905a

Please sign in to comment.