Skip to content

开源白板工具(SaaS),一体化白板,包含思维导图、流程图、自由画等。All in one open-source whiteboard tool with mind, flowchart, freehand and etc.

fix: fix pub issue

pubuzhixing8156abcbea229
diff --git a/package.json b/package.json
index 0fca6a2..e34bdf7 100644
--- a/package.json
+++ b/package.json
@@ -6,8 +6,8 @@
"start": "nx serve web --host=0.0.0.0",
"build": "nx run-many -t=build",
"test": "nx run-many -t=test",
- "release:version": "node scripts/release-version.js",
- "release:publish": "nx release publish"
+ "release": "node scripts/release-version.js",
+ "pub": "node scripts/publish.js"
},
"private": true,
"dependencies": {
diff --git a/packages/drawnix/package.json b/packages/drawnix/package.json
index ef318c8..c477acd 100644
--- a/packages/drawnix/package.json
+++ b/packages/drawnix/package.json
@@ -7,7 +7,8 @@
"exports": {
".": {
"import": "./index.mjs",
- "require": "./index.js"
+ "require": "./index.js",
+ "types": "./index.d.ts"
}
}
}
diff --git a/packages/react-board/package.json b/packages/react-board/package.json
index 0fb7a61..92845fc 100644
--- a/packages/react-board/package.json
+++ b/packages/react-board/package.json
@@ -7,7 +7,8 @@
"exports": {
".": {
"import": "./index.mjs",
- "require": "./index.js"
+ "require": "./index.js",
+ "types": "./index.d.ts"
}
}
}
diff --git a/packages/react-text/package.json b/packages/react-text/package.json
index acd71b0..8ad2678 100644
--- a/packages/react-text/package.json
+++ b/packages/react-text/package.json
@@ -7,7 +7,8 @@
"exports": {
".": {
"import": "./index.mjs",
- "require": "./index.js"
+ "require": "./index.js",
+ "types": "./index.d.ts"
}
}
}
diff --git a/scripts/publish.js b/scripts/publish.js
new file mode 100644
index 0000000..1bb1afe
--- /dev/null
+++ b/scripts/publish.js
@@ -0,0 +1,24 @@
+const { execSync } = require('child_process');
+const path = require('path');
+const fs = require('fs');
+
+const libraries = ['react-board', 'react-text', 'drawnix'];
+
+libraries.forEach(lib => {
+ const libPath = path.resolve(__dirname, '../dist', lib);
+
+ if (fs.existsSync(libPath)) {
+ console.log(`Publishing ${lib}...`);
+ try {
+ execSync('npm publish --access public', {
+ cwd: libPath,
+ stdio: 'inherit'
+ });
+ console.log(`Successfully published ${lib}`);
+ } catch (error) {
+ console.error(`Failed to publish ${lib}:`, error);
+ }
+ } else {
+ console.error(`Library path not found: ${libPath}`);
+ }
+});
\ No newline at end of file