From e5f0915b1c8dd4141009e7dc146e4c0058ab365f Mon Sep 17 00:00:00 2001 From: zhumeisongsong Date: Thu, 7 Nov 2024 00:15:53 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20Initial=20applications-conf?= =?UTF-8?q?ig=20lib?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/application-config/README.md | 7 ++++++ libs/application-config/eslint.config.js | 3 +++ libs/application-config/jest.config.ts | 10 +++++++++ libs/application-config/project.json | 9 ++++++++ libs/application-config/src/index.ts | 1 + .../src/lib/applications-config.spec.ts | 7 ++++++ .../src/lib/applications-config.ts | 3 +++ libs/application-config/tsconfig.json | 22 +++++++++++++++++++ libs/application-config/tsconfig.lib.json | 11 ++++++++++ libs/application-config/tsconfig.spec.json | 14 ++++++++++++ tsconfig.base.json | 6 ++++- 11 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 libs/application-config/README.md create mode 100644 libs/application-config/eslint.config.js create mode 100644 libs/application-config/jest.config.ts create mode 100644 libs/application-config/project.json create mode 100644 libs/application-config/src/index.ts create mode 100644 libs/application-config/src/lib/applications-config.spec.ts create mode 100644 libs/application-config/src/lib/applications-config.ts create mode 100644 libs/application-config/tsconfig.json create mode 100644 libs/application-config/tsconfig.lib.json create mode 100644 libs/application-config/tsconfig.spec.json diff --git a/libs/application-config/README.md b/libs/application-config/README.md new file mode 100644 index 0000000..6494920 --- /dev/null +++ b/libs/application-config/README.md @@ -0,0 +1,7 @@ +# applications-config + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test applications-config` to execute the unit tests via [Jest](https://jestjs.io). diff --git a/libs/application-config/eslint.config.js b/libs/application-config/eslint.config.js new file mode 100644 index 0000000..df7cfc2 --- /dev/null +++ b/libs/application-config/eslint.config.js @@ -0,0 +1,3 @@ +const baseConfig = require('../../eslint.config.js'); + +module.exports = [...baseConfig]; diff --git a/libs/application-config/jest.config.ts b/libs/application-config/jest.config.ts new file mode 100644 index 0000000..a7ffe20 --- /dev/null +++ b/libs/application-config/jest.config.ts @@ -0,0 +1,10 @@ +export default { + displayName: 'applications-config', + preset: '../../jest.preset.js', + testEnvironment: 'node', + transform: { + '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], + }, + moduleFileExtensions: ['ts', 'js', 'html'], + coverageDirectory: '../../coverage/libs/application-config', +}; diff --git a/libs/application-config/project.json b/libs/application-config/project.json new file mode 100644 index 0000000..54220f1 --- /dev/null +++ b/libs/application-config/project.json @@ -0,0 +1,9 @@ +{ + "name": "applications-config", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/application-config/src", + "projectType": "library", + "tags": [], + "// targets": "to see all targets run: nx show project applications-config --web", + "targets": {} +} diff --git a/libs/application-config/src/index.ts b/libs/application-config/src/index.ts new file mode 100644 index 0000000..f4ec158 --- /dev/null +++ b/libs/application-config/src/index.ts @@ -0,0 +1 @@ +export * from './lib/applications-config'; diff --git a/libs/application-config/src/lib/applications-config.spec.ts b/libs/application-config/src/lib/applications-config.spec.ts new file mode 100644 index 0000000..4243a03 --- /dev/null +++ b/libs/application-config/src/lib/applications-config.spec.ts @@ -0,0 +1,7 @@ +import { applicationsConfig } from './applications-config'; + +describe('applicationsConfig', () => { + it('should work', () => { + expect(applicationsConfig()).toEqual('applications-config'); + }); +}); diff --git a/libs/application-config/src/lib/applications-config.ts b/libs/application-config/src/lib/applications-config.ts new file mode 100644 index 0000000..82e44e9 --- /dev/null +++ b/libs/application-config/src/lib/applications-config.ts @@ -0,0 +1,3 @@ +export function applicationsConfig(): string { + return 'applications-config'; +} diff --git a/libs/application-config/tsconfig.json b/libs/application-config/tsconfig.json new file mode 100644 index 0000000..6f7169a --- /dev/null +++ b/libs/application-config/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "noPropertyAccessFromIndexSignature": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/application-config/tsconfig.lib.json b/libs/application-config/tsconfig.lib.json new file mode 100644 index 0000000..3f06e80 --- /dev/null +++ b/libs/application-config/tsconfig.lib.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": ["node"] + }, + "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"], + "include": ["src/**/*.ts"] +} diff --git a/libs/application-config/tsconfig.spec.json b/libs/application-config/tsconfig.spec.json new file mode 100644 index 0000000..9b2a121 --- /dev/null +++ b/libs/application-config/tsconfig.spec.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["jest", "node"] + }, + "include": [ + "jest.config.ts", + "src/**/*.test.ts", + "src/**/*.spec.ts", + "src/**/*.d.ts" + ] +} diff --git a/tsconfig.base.json b/tsconfig.base.json index b73cce6..70deefe 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -14,7 +14,11 @@ "skipLibCheck": true, "skipDefaultLibCheck": true, "baseUrl": ".", - "paths": {} + "paths": { + "@graphql-federation-workspace/applications-config": [ + "libs/application-config/src/index.ts" + ] + } }, "exclude": ["node_modules", "tmp"] }