build: package.json 中files增加src,移除sideEffects

This commit is contained in:
roymondchen 2024-06-17 16:24:06 +08:00
parent 80e42cc997
commit e4a06bd12d
16 changed files with 55 additions and 63 deletions

View File

@ -14,7 +14,8 @@
},
"files": [
"bin",
"lib"
"lib",
"src"
],
"engines": {
"node": ">=18"

View File

@ -2,9 +2,6 @@
"version": "1.4.8",
"name": "@tmagic/core",
"type": "module",
"sideEffects": [
"dist/*"
],
"main": "dist/tmagic-core.umd.cjs",
"module": "dist/tmagic-core.js",
"types": "types/index.d.ts",
@ -22,7 +19,8 @@
},
"files": [
"dist",
"types"
"types",
"src"
],
"license": "Apache-2.0",
"scripts": {

View File

@ -2,9 +2,6 @@
"version": "1.4.8",
"name": "@tmagic/data-source",
"type": "module",
"sideEffects": [
"dist/*"
],
"main": "dist/tmagic-data-source.umd.cjs",
"module": "dist/tmagic-data-source.js",
"types": "types/index.d.ts",
@ -18,7 +15,8 @@
},
"files": [
"dist",
"types"
"types",
"src"
],
"license": "Apache-2.0",
"scripts": {

View File

@ -2,9 +2,6 @@
"version": "1.4.8",
"name": "@tmagic/dep",
"type": "module",
"sideEffects": [
"dist/*"
],
"main": "dist/tmagic-dep.umd.cjs",
"module": "dist/tmagic-dep.js",
"types": "types/index.d.ts",
@ -18,7 +15,8 @@
},
"files": [
"dist",
"types"
"types",
"src"
],
"license": "Apache-2.0",
"scripts": {

View File

@ -2,9 +2,6 @@
"version": "1.4.8",
"name": "@tmagic/design",
"type": "module",
"sideEffects": [
"dist/*"
],
"main": "dist/tmagic-design.umd.cjs",
"module": "dist/tmagic-design.js",
"types": "types/index.d.ts",
@ -18,7 +15,8 @@
},
"files": [
"dist",
"types"
"types",
"src"
],
"license": "Apache-2.0",
"scripts": {

View File

@ -3,7 +3,6 @@
"name": "@tmagic/editor",
"type": "module",
"sideEffects": [
"dist/*",
"src/theme/*"
],
"main": "dist/tmagic-editor.umd.cjs",
@ -24,7 +23,8 @@
},
"files": [
"dist",
"types"
"types",
"src"
],
"license": "Apache-2.0",
"scripts": {

View File

@ -2,9 +2,6 @@
"version": "1.4.8",
"name": "@tmagic/element-plus-adapter",
"type": "module",
"sideEffects": [
"dist/*"
],
"main": "dist/tmagic-element-plus-adapter.umd.cjs",
"module": "dist/tmagic-element-plus-adapter.js",
"types": "types/index.d.ts",
@ -18,7 +15,8 @@
},
"files": [
"dist",
"types"
"types",
"src"
],
"license": "Apache-2.0",
"scripts": {

View File

@ -3,7 +3,6 @@
"name": "@tmagic/form",
"type": "module",
"sideEffects": [
"dist/*",
"src/theme/*"
],
"main": "dist/tmagic-form.umd.cjs",
@ -24,7 +23,8 @@
},
"files": [
"dist",
"types"
"types",
"src"
],
"license": "Apache-2.0",
"scripts": {

View File

@ -2,7 +2,6 @@
"version": "1.4.8",
"name": "@tmagic/schema",
"type": "module",
"sideEffects": false,
"main": "dist/tmagic-schema.umd.cjs",
"module": "dist/tmagic-schema.js",
"types": "types/index.d.ts",
@ -16,7 +15,8 @@
},
"files": [
"dist",
"types"
"types",
"src"
],
"scripts": {
"build": "npm run build:type && vite build",

View File

@ -2,9 +2,6 @@
"version": "1.4.8",
"name": "@tmagic/stage",
"type": "module",
"sideEffects": [
"dist/*"
],
"main": "dist/tmagic-stage.umd.cjs",
"module": "dist/tmagic-stage.js",
"types": "types/index.d.ts",
@ -18,7 +15,8 @@
},
"files": [
"dist",
"types"
"types",
"src"
],
"license": "Apache-2.0",
"scripts": {

View File

@ -2,9 +2,6 @@
"version": "1.4.8",
"name": "@tmagic/table",
"type": "module",
"sideEffects": [
"dist/*"
],
"main": "dist/tmagic-table.umd.cjs",
"module": "dist/tmagic-table.js",
"types": "types/index.d.ts",
@ -22,7 +19,8 @@
},
"files": [
"dist",
"types"
"types",
"src"
],
"license": "Apache-2.0",
"scripts": {

View File

@ -2,9 +2,6 @@
"version": "1.4.8",
"name": "@tmagic/tdesign-vue-next-adapter",
"type": "module",
"sideEffects": [
"dist/*"
],
"main": "dist/tmagic-tdesign-vue-next-adapter.umd.cjs",
"module": "dist/tmagic-tdesign-vue-next-adapter.js",
"types": "types/index.d.ts",
@ -18,7 +15,8 @@
},
"files": [
"dist",
"types"
"types",
"src"
],
"license": "Apache-2.0",
"scripts": {

View File

@ -18,7 +18,8 @@
},
"files": [
"dist",
"types"
"types",
"src"
],
"license": "Apache-2.0",
"scripts": {

View File

@ -32,14 +32,14 @@
"url": "https://github.com/Tencent/tmagic-editor.git"
},
"peerDependencies": {
"@tmagic/core": "workspace:*",
"@tmagic/editor": "workspace:*",
"@tmagic/form": "workspace:*",
"@tmagic/utils": "workspace:*",
"@tmagic/schema": "workspace:*",
"@tmagic/stage": "workspace:*",
"element-plus": "^2.7.5",
"vue": "^3.4.27"
"@tmagic/core": ">=1.4.8",
"@tmagic/editor": ">=1.4.8",
"@tmagic/form": ">=1.4.8",
"@tmagic/utils": ">=1.4.8",
"@tmagic/schema": ">=1.4.8",
"@tmagic/stage": ">=1.4.8",
"element-plus": ">=2.7.5",
"vue": ">=3.4.27"
},
"devDependencies": {
"@types/node": "^18.19.0",

View File

@ -32,11 +32,11 @@
"vue-demi": "^0.14.7"
},
"peerDependencies": {
"@tmagic/core": "workspace:*",
"@tmagic/data-source": "workspace:*",
"@tmagic/schema": "workspace:*",
"@tmagic/stage": "workspace:*",
"@tmagic/utils": "workspace:*",
"@tmagic/core": ">=1.4.8",
"@tmagic/data-source": ">=1.4.8",
"@tmagic/schema": ">=1.4.8",
"@tmagic/stage": ">=1.4.8",
"@tmagic/utils": ">=1.4.8",
"@vue/composition-api": ">=1.7.2",
"typescript": "*",
"vue": ">=2.0.0 || >=3.0.0"

View File

@ -187,6 +187,17 @@ async function main() {
}
}
if (!skipGit) {
const { stdout } = await run('git', ['diff'], { stdio: 'pipe' });
if (stdout) {
step('\nCommitting changes...');
await runIfNotDry('git', ['add', '-A']);
await runIfNotDry('git', ['commit', '-m', `chore: release v${targetVersion}`, '--verify']);
} else {
console.log('No changes to commit.');
}
}
// publish packages
step('\nPublishing packages...');
@ -194,7 +205,9 @@ async function main() {
if (isDryRun) {
additionalPublishFlags.push('--dry-run');
}
if (isDryRun || skipGit) {
additionalPublishFlags.push('--no-git-checks');
}
// bypass the pnpm --publish-branch restriction which isn't too useful to us
// otherwise it leads to a prompt and blocks the release script
const branch = await getBranch();
@ -215,7 +228,7 @@ async function main() {
if (stdout) {
step('\nCommitting changes...');
await runIfNotDry('git', ['add', '-A']);
await runIfNotDry('git', ['commit', '-m', `chore: release v${targetVersion}`, '--verify']);
await runIfNotDry('git', ['commit', '-m', `chore: update lockfile v${targetVersion}`, '--verify']);
} else {
console.log('No changes to commit.');
}
@ -362,14 +375,7 @@ async function publishPackage(pkgName, version, additionalFlags) {
// workspace:* deps
await run(
'pnpm',
[
'publish',
...(releaseTag ? ['--tag', releaseTag] : []),
'--access',
'public',
'--no-git-checks',
...additionalFlags,
],
['publish', ...(releaseTag ? ['--tag', releaseTag] : []), '--access', 'public', ...additionalFlags],
{
cwd: getPkgRoot(pkgName),
stdio: 'pipe',