Skip to content

Commit 471391d

Browse files
committed
fix(TS): update package settings
1 parent d77866b commit 471391d

File tree

4 files changed

+42
-46
lines changed

4 files changed

+42
-46
lines changed

src/TypeScriptSDK/package.json

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
{
22
"name": "dragonfly-schema",
33
"license": "MIT",
4-
"main": "dist/index.cjs.js",
5-
"module": "dist/index.es.js",
6-
"types": "dist/index.d.ts",
7-
"files": [
8-
"dist"
9-
],
4+
"version": "1.12.1-v2",
105
"type": "module",
116
"scripts": {
12-
"build": "tsc && vite build"
7+
"build": "tsc && vite build",
8+
"lint": "gts lint",
9+
"clean": "gts clean",
10+
"compile": "tsc",
11+
"fix": "gts fix",
12+
"prepare": "npm.cmd run compile",
13+
"pretest": "npm.cmd run compile",
14+
"posttest": "npm.cmd run lint"
1315
},
1416
"devDependencies": {
15-
"@types/node": "^20.14.2",
16-
"typescript": "^4.9.5",
17-
"vite": "^4.1.0",
18-
"vite-plugin-dts": "^3.9.1"
17+
"@types/node": "20.12.7",
18+
"gts": "^5.3.1",
19+
"typescript": "^5.4.3",
20+
"vite": "^5.4.1",
21+
"vite-tsconfig-paths": "^5.0.1"
1922
},
2023
"dependencies": {
2124
"class-validator": "^0.14.1",
2225
"honeybee-schema": "^1.58.3-v13"
23-
},
24-
"version": "1.12.1-v2"
26+
}
2527
}

src/TypeScriptSDK/tsconfig.json

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
11
{
22
"compilerOptions": {
3-
"baseUrl": "./models",
4-
"rootDir": "./models",
53
"target": "ESNext",
4+
"useDefineForClassFields": true,
5+
"module": "ESNext",
66
"lib": ["ESNext", "DOM", "DOM.Iterable"],
7-
"allowJs": true,
87
"skipLibCheck": true,
98
"esModuleInterop": true,
109
"allowSyntheticDefaultImports": true,
11-
"strict": true,
1210
"forceConsistentCasingInFileNames": true,
13-
"noFallthroughCasesInSwitch": true,
14-
"module": "esnext",
15-
"moduleResolution": "node",
16-
"resolveJsonModule": true,
11+
"outDir": "./dist",
12+
"incremental": true, /* Enable incremental compilation */
13+
"composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
14+
"sourceMap": true,
15+
16+
/* Bundler mode */
17+
"moduleResolution": "bundler",
18+
"allowImportingTsExtensions": true,
1719
"isolatedModules": true,
20+
"moduleDetection": "force",
1821
"noEmit": true,
22+
23+
/* Linting */
24+
"strict": true,
1925
"experimentalDecorators": true,
20-
"emitDecoratorMetadata": true
26+
"emitDecoratorMetadata": true,
27+
28+
"noFallthroughCasesInSwitch": true
2129
},
22-
"include": [
23-
"models"
24-
],
25-
"references": [{ "path": "./tsconfig.node.json" }]
30+
"include": [ "models"],
31+
"exclude": ["node_modules"]
2632
}

src/TypeScriptSDK/tsconfig.node.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/TypeScriptSDK/vite.config.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
import dts from "vite-plugin-dts";
2-
import path from "path";
3-
import { defineConfig, UserConfig } from "vite";
1+
import { defineConfig, UserConfig } from 'vite';
2+
import tsconfigPaths from 'vite-tsconfig-paths';
43

54
export default defineConfig({
6-
base: "./",
7-
plugins: [dts({ rollupTypes: true })],
5+
plugins: [tsconfigPaths()],
86
build: {
9-
sourcemap: false,
107
lib: {
11-
entry: path.resolve(__dirname, "./index.ts"),
12-
name: "mylib",
13-
formats: ["es", "cjs", "umd", "iife"],
14-
fileName: (format) => `index.${format}.js`,
8+
entry: './index.ts',
9+
name: 'schema',
10+
fileName: (format) => `index.${format}.js`
1511
},
16-
},
12+
13+
}
1714
} satisfies UserConfig);

0 commit comments

Comments
 (0)