fix: Upgrade unbuild to resolve console warning issues and also deal with post-upgrade compatibility issues (#4009)

This commit is contained in:
Vben
2024-08-02 22:18:46 +08:00
committed by GitHub
parent e544119aa3
commit 530159140c
48 changed files with 382 additions and 743 deletions

View File

@@ -1,7 +0,0 @@
import { defineBuildConfig } from 'unbuild';
export default defineBuildConfig({
clean: true,
declaration: true,
entries: ['src/index'],
});

View File

@@ -1,5 +1,3 @@
import type { UserConfig } from 'cz-git';
import { execSync } from 'node:child_process';
import { getPackagesSync } from '@vben/node-utils';
@@ -27,7 +25,10 @@ const scopeComplete = execSync('git status --porcelain || true')
?.match(/src%%((\w|-)*)/)?.[1]
?.replace(/s$/, '');
const userConfig: UserConfig = {
/**
* @type {import('cz-git').UserConfig}
*/
const userConfig = {
extends: ['@commitlint/config-conventional'],
plugins: ['commitlint-plugin-function-rules'],
prompt: {
@@ -106,7 +107,7 @@ const userConfig: UserConfig = {
'function-rules/scope-enum': [
2, // level: error
'always',
(parsed: { scope: string }) => {
(parsed) => {
if (!parsed.scope || allowedScopes.includes(parsed.scope)) {
return [true];
}

View File

@@ -11,20 +11,15 @@
},
"license": "MIT",
"type": "module",
"scripts": {
"stub": "pnpm unbuild --stub"
},
"files": [
"dist"
],
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"main": "./index.mjs",
"module": "./index.mjs",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"default": "./dist/index.mjs"
"import": "./index.mjs",
"default": "./index.mjs"
}
},
"dependencies": {

View File

@@ -1,6 +0,0 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@vben/tsconfig/node.json",
"include": ["src"],
"exclude": ["node_modules"]
}