From b236115c55c994d4b8c6d200d83f84614ccb2882 Mon Sep 17 00:00:00 2001 From: mozzie Date: Fri, 15 Sep 2023 16:59:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9F=A5=E8=AF=A2=E5=85=A8=E9=83=A8?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E7=B1=BB=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/service-constants/package.json | 19 +++++++++++++++ packages/service-constants/rollup.config.js | 17 ++++++++++++++ packages/service-constants/src/index.ts | 1 + packages/service-constants/src/pattern.ts | 4 ++++ packages/service-constants/tsconfig.json | 26 +++++++++++++++++++++ 5 files changed, 67 insertions(+) create mode 100644 packages/service-constants/package.json create mode 100644 packages/service-constants/rollup.config.js create mode 100644 packages/service-constants/src/index.ts create mode 100644 packages/service-constants/src/pattern.ts create mode 100644 packages/service-constants/tsconfig.json diff --git a/packages/service-constants/package.json b/packages/service-constants/package.json new file mode 100644 index 0000000..0dcbcb4 --- /dev/null +++ b/packages/service-constants/package.json @@ -0,0 +1,19 @@ +{ + "name": "@tavi/service-constants", + "version": "1.0.0", + "main": "dist/index.cjs", + "types": "dist/index.d.ts", + "type": "module", + "scripts": { + "build": "rollup -c" + }, + "devDependencies": { + "@rollup/plugin-commonjs": "^24.1.0", + "@rollup/plugin-node-resolve": "^15.0.2", + "rollup": "^3.21.5", + "rollup-plugin-typescript2": "^0.34.1", + "typescript": "^5.0.2", + "tslib": "2.6.0", + "@types/node": "20.3.3" + } +} \ No newline at end of file diff --git a/packages/service-constants/rollup.config.js b/packages/service-constants/rollup.config.js new file mode 100644 index 0000000..68bb726 --- /dev/null +++ b/packages/service-constants/rollup.config.js @@ -0,0 +1,17 @@ +import typescript from 'rollup-plugin-typescript2'; +import resolve from '@rollup/plugin-node-resolve'; +import commonjs from '@rollup/plugin-commonjs'; + +export default { + input: 'src/index.ts', // 你的入口文件 + output: { + file: 'dist/index.cjs', + format: 'cjs', + }, + plugins: [ + typescript(), + resolve(), + commonjs(), + ], + external: [/* 任何你不想包含在最终包中的外部依赖 */] +}; diff --git a/packages/service-constants/src/index.ts b/packages/service-constants/src/index.ts new file mode 100644 index 0000000..ff43c72 --- /dev/null +++ b/packages/service-constants/src/index.ts @@ -0,0 +1 @@ +export { CREATE_LABEL_CATEGORY } from "./pattern"; diff --git a/packages/service-constants/src/pattern.ts b/packages/service-constants/src/pattern.ts new file mode 100644 index 0000000..7bdc34c --- /dev/null +++ b/packages/service-constants/src/pattern.ts @@ -0,0 +1,4 @@ +/** + * 创建标签分类 + */ +export const CREATE_LABEL_CATEGORY = "dicom.label.category.create"; diff --git a/packages/service-constants/tsconfig.json b/packages/service-constants/tsconfig.json new file mode 100644 index 0000000..faadd41 --- /dev/null +++ b/packages/service-constants/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "ESNext", + "declaration": true, + "removeComments": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "allowSyntheticDefaultImports": true, + "target": "es2020", + "incremental": true, + "skipLibCheck": true, + "strictNullChecks": false, + "noImplicitAny": false, + // 指定TypeScript如何从给定的模块说明符中查找文件。 + "moduleResolution": "node", + // 指定TypeScript如何从给定的模块说明符中查找文件。 + "declarationDir": "./dist/types" + }, + "include": [ + "src/**/*" + ], + "exclude": [ + "node_modules", + "**/*.spec.ts" + ] +} \ No newline at end of file