From a10905a986dd9b4d1d5d38f72e93a6494d6c6b27 Mon Sep 17 00:00:00 2001 From: Chau Tran Date: Sun, 10 Jan 2021 00:21:53 -0600 Subject: [PATCH] chore: adjust nx and workspace json to include tags --- .eslintrc.json | 25 +++++++++++++++++-- nx.json | 14 +++++------ .../src/lib/with-classes/with-enum.spec.ts | 7 +++++- 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 1a12b9e06..9559cb45e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -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" + ] + } ] } ] @@ -21,7 +40,9 @@ { "files": ["*.ts", "*.tsx"], "extends": ["plugin:@nrwl/nx/typescript"], - "parserOptions": { "project": "./tsconfig.*?.json" }, + "parserOptions": { + "project": "./tsconfig.*?.json" + }, "rules": {} }, { diff --git a/nx.json b/nx.json index fa322e626..0fccf1cd8 100644 --- a/nx.json +++ b/nx.json @@ -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": { diff --git a/packages/integration-test/src/lib/with-classes/with-enum.spec.ts b/packages/integration-test/src/lib/with-classes/with-enum.spec.ts index 6db78ec8b..d894b6ec8 100644 --- a/packages/integration-test/src/lib/with-classes/with-enum.spec.ts +++ b/packages/integration-test/src/lib/with-classes/with-enum.spec.ts @@ -11,6 +11,11 @@ import { describe('With Enum', () => { const [mapper] = setupClasses('withEnum'); + enum StringEnum1 { + Foo = 'foo', + Bar = 'bar', + } + it('should map correctly', () => { mapper.createMap(FooWithEnum, FooWithEnumDto); @@ -18,7 +23,7 @@ describe('With Enum', () => { 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();