ci: upgrade deps and improve build scripts

This commit is contained in:
chenshenhai 2026-03-29 15:57:09 +08:00
parent 04f2087377
commit 409846e5ab
5 changed files with 2394 additions and 1897 deletions

View file

@ -30,53 +30,53 @@
"upgrade:version": "npm run version:reset && pnpm i"
},
"devDependencies": {
"@babel/core": "^7.28.4",
"@babel/preset-env": "^7.28.3",
"@babel/preset-typescript": "^7.27.1",
"@eslint/js": "^9.35.0",
"@babel/core": "^7.29.0",
"@babel/preset-env": "^7.29.2",
"@babel/preset-typescript": "^7.28.5",
"@eslint/js": "^10.0.1",
"@rollup/plugin-json": "^6.1.0",
"@types/glob": "^9.0.0",
"@types/jest": "^30.0.0",
"@types/koa-compose": "^3.2.8",
"@types/node": "^24.3.3",
"@types/koa-compose": "^3.2.9",
"@types/node": "^25.5.0",
"@types/serve-handler": "^6.1.4",
"@typescript-eslint/eslint-plugin": "^8.43.0",
"@typescript-eslint/parser": "^8.43.0",
"@vitejs/plugin-react": "^5.0.2",
"babel-jest": "^30.1.2",
"@typescript-eslint/eslint-plugin": "^8.57.2",
"@typescript-eslint/parser": "^8.57.2",
"@vitejs/plugin-react": "^6.0.1",
"babel-jest": "^30.3.0",
"chalk": "^5.6.2",
"dotenv": "^17.2.2",
"dotenv": "^17.3.1",
"enquirer": "^2.4.1",
"esbuild": "^0.25.9",
"eslint": "^9.35.0",
"eslint-plugin-n": "^17.21.3",
"esbuild": "^0.27.4",
"eslint": "^10.1.0",
"eslint-plugin-n": "^17.24.0",
"eslint-plugin-react": "^7.37.5",
"execa": "^9.6.0",
"fs-extra": "^11.3.1",
"glob": "^11.0.3",
"globals": "^16.4.0",
"execa": "^9.6.1",
"fs-extra": "^11.3.4",
"glob": "^13.0.6",
"globals": "^17.4.0",
"http-server": "^14.1.1",
"husky": "^9.1.7",
"jest": "^30.1.3",
"jest": "^30.3.0",
"jest-canvas-mock": "^2.5.2",
"jest-environment-jsdom": "^30.1.2",
"jest-environment-jsdom": "^30.3.0",
"jimp": "^1.6.0",
"koa-compose": "^4.1.0",
"less": "^4.4.1",
"less": "^4.6.4",
"pixelmatch": "^7.1.0",
"pngjs": "^7.0.0",
"puppeteer": "^24.20.0",
"rollup": "^4.50.1",
"rollup-plugin-dts": "^6.2.3",
"puppeteer": "^24.40.0",
"rollup": "^4.60.0",
"rollup-plugin-dts": "^6.4.1",
"rollup-plugin-esbuild": "^6.2.1",
"serve-handler": "^6.1.6",
"terser": "^5.44.0",
"ts-morph": "^27.0.0",
"serve-handler": "^6.1.7",
"terser": "^5.46.1",
"ts-morph": "^27.0.2",
"ts-node": "^10.9.2",
"tslib": "^2.8.1",
"typescript": "^5.9.2",
"typescript-eslint": "^8.43.0",
"vite": "^7.1.5"
"typescript": "^6.0.2",
"typescript-eslint": "^8.57.2",
"vite": "^8.0.3"
},
"engines": {
"pnpm": ">=10",

File diff suppressed because it is too large Load diff

View file

@ -18,17 +18,17 @@ async function buildBundle(opts: { dirName: string; globalName: string }) {
formats: ['iife'],
fileName: () => {
return 'index.global.js';
}
},
},
outDir: distDir
outDir: distDir,
},
resolve: {
alias: {
'@idraw/util': joinPackagePath('util', 'src', 'index.ts'),
'@idraw/renderer': joinPackagePath('renderer', 'src', 'index.ts'),
'@idraw/core': joinPackagePath('core', 'src', 'index.ts')
}
}
'@idraw/core': joinPackagePath('core', 'src', 'index.ts'),
},
},
};
console.log(`Start build bundle [${dirName}] ...`);
await build(config);

View file

@ -1,6 +1,6 @@
import ts from 'typescript';
import type { CompilerOptions } from 'typescript';
import { Project } from 'ts-morph';
import { Project, ScriptTarget, ModuleResolutionKind } from 'ts-morph';
import type { CompilerOptions as TsMorphCompilerOptions } from 'ts-morph';
import path from 'path';
import fs from 'fs';
@ -59,8 +59,8 @@ function buildPackage(dirName: string) {
noUnusedLocals: true,
declaration: true,
sourceMap: false,
target: ts.ScriptTarget.ES2015,
moduleResolution: ts.ModuleResolutionKind.NodeJs,
target: ScriptTarget.ES2015,
moduleResolution: ModuleResolutionKind.NodeJs,
allowJs: false,
strict: true,
experimentalDecorators: true,
@ -70,16 +70,16 @@ function buildPackage(dirName: string) {
// lib: ['ES2016', 'dom'],
outDir: joinPackagePath(dirName, 'dist', 'esm'),
rootDir: joinPackagePath(dirName, 'src'),
skipLibCheck: true
skipLibCheck: true,
};
const project = new Project({
compilerOptions
compilerOptions,
// tsConfigFilePath: joinProjectPath('tsconfig.web.json')
});
const program = ts.createProgram({
rootNames: targetFiles,
options: compilerOptions as CompilerOptions
options: compilerOptions as CompilerOptions,
});
// const diagnostics = ts.getPreEmitDiagnostics(program);

View file

@ -3,7 +3,7 @@
"module": "commonjs",
"target": "ES6",
"lib": ["ES6", "DOM"],
"moduleResolution": "Node",
"moduleResolution": "bundler",
"strict": false,
"jsx": "preserve",
"sourceMap": true,
@ -11,7 +11,8 @@
"esModuleInterop": true,
"importHelpers": true,
"allowJs": true,
"composite": true
"composite": true,
"types": ["node"]
},
"include": [
"scripts/",