@aigne/doc-smith 0.4.3 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/agents/publish-docs.mjs +14 -6
- package/package.json +8 -8
- package/utils/utils.mjs +23 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.4.5](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.4.4...v0.4.5) (2025-08-25)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* release 0.4.5 ([12aa6c3](https://github.com/AIGNE-io/aigne-doc-smith/commit/12aa6c340fdd95cbd74833662f4c3a80f19dfa30))
|
|
9
|
+
|
|
10
|
+
## [0.4.4](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.4.3...v0.4.4) (2025-08-22)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* support assign board id ([#58](https://github.com/AIGNE-io/aigne-doc-smith/issues/58)) ([0bcc196](https://github.com/AIGNE-io/aigne-doc-smith/commit/0bcc1969131f70caf2b1bc9303a3811be1b000ab))
|
|
16
|
+
|
|
3
17
|
## [0.4.3](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.4.2...v0.4.3) (2025-08-21)
|
|
4
18
|
|
|
5
19
|
|
package/agents/publish-docs.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { publishDocs as publishDocsFn } from "@aigne/publish-docs";
|
|
|
3
3
|
import chalk from "chalk";
|
|
4
4
|
import { getAccessToken } from "../utils/auth-utils.mjs";
|
|
5
5
|
import { DISCUSS_KIT_STORE_URL } from "../utils/constants.mjs";
|
|
6
|
-
import { loadConfigFromFile, saveValueToConfig } from "../utils/utils.mjs";
|
|
6
|
+
import { loadConfigFromFile, saveValueToConfig, getGithubRepoUrl } from "../utils/utils.mjs";
|
|
7
7
|
|
|
8
8
|
const DEFAULT_APP_URL = "https://docsmith.aigne.io";
|
|
9
9
|
|
|
@@ -76,6 +76,17 @@ export default async function publishDocs(
|
|
|
76
76
|
icon: projectLogo || config?.projectLogo || "",
|
|
77
77
|
};
|
|
78
78
|
|
|
79
|
+
// Construct boardMeta object
|
|
80
|
+
const boardMeta = {
|
|
81
|
+
category: config?.documentPurpose || [],
|
|
82
|
+
githubRepoUrl: getGithubRepoUrl(),
|
|
83
|
+
commitSha: config?.lastGitHead || "",
|
|
84
|
+
languages: [
|
|
85
|
+
...(config?.locale ? [config.locale] : []),
|
|
86
|
+
...(config?.translateLanguages || []),
|
|
87
|
+
].filter((lang, index, arr) => arr.indexOf(lang) === index), // Remove duplicates
|
|
88
|
+
};
|
|
89
|
+
|
|
79
90
|
try {
|
|
80
91
|
const { success, boardId: newBoardId } = await publishDocsFn({
|
|
81
92
|
sidebarPath,
|
|
@@ -87,6 +98,7 @@ export default async function publishDocs(
|
|
|
87
98
|
boardName: projectInfo.name,
|
|
88
99
|
boardDesc: projectInfo.description,
|
|
89
100
|
boardCover: projectInfo.icon,
|
|
101
|
+
boardMeta,
|
|
90
102
|
});
|
|
91
103
|
|
|
92
104
|
// Save values to config.yaml if publish was successful
|
|
@@ -98,11 +110,7 @@ export default async function publishDocs(
|
|
|
98
110
|
|
|
99
111
|
// Save boardId to config if it was auto-created
|
|
100
112
|
if (boardId !== newBoardId) {
|
|
101
|
-
await saveValueToConfig(
|
|
102
|
-
"boardId",
|
|
103
|
-
newBoardId,
|
|
104
|
-
"⚠️ Warning: boardId is auto-generated by system, please do not edit manually",
|
|
105
|
-
);
|
|
113
|
+
await saveValueToConfig("boardId", newBoardId);
|
|
106
114
|
}
|
|
107
115
|
const message = `✅ Documentation Published Successfully!`;
|
|
108
116
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/doc-smith",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
"author": "Arcblock <blocklet@arcblock.io> https://github.com/blocklet",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@aigne/aigne-hub": "0.6.
|
|
16
|
-
"@aigne/anthropic": "0.11.
|
|
17
|
-
"@aigne/cli": "1.
|
|
18
|
-
"@aigne/core": "1.
|
|
19
|
-
"@aigne/gemini": "0.9.
|
|
20
|
-
"@aigne/openai": "0.12.
|
|
21
|
-
"@aigne/publish-docs": "0.5.
|
|
15
|
+
"@aigne/aigne-hub": "^0.6.9",
|
|
16
|
+
"@aigne/anthropic": "^0.11.9",
|
|
17
|
+
"@aigne/cli": "^1.41.0",
|
|
18
|
+
"@aigne/core": "^1.55.0",
|
|
19
|
+
"@aigne/gemini": "^0.9.9",
|
|
20
|
+
"@aigne/openai": "^0.12.3",
|
|
21
|
+
"@aigne/publish-docs": "^0.5.7",
|
|
22
22
|
"chalk": "^5.5.0",
|
|
23
23
|
"dompurify": "^3.2.6",
|
|
24
24
|
"glob": "^11.0.3",
|
package/utils/utils.mjs
CHANGED
|
@@ -744,6 +744,29 @@ function getDirectoryContents(dirPath, searchTerm = "") {
|
|
|
744
744
|
}
|
|
745
745
|
}
|
|
746
746
|
|
|
747
|
+
/**
|
|
748
|
+
* Get GitHub repository URL from git remote
|
|
749
|
+
* @returns {string} GitHub repository URL or empty string if not a GitHub repo (e.g. git@github.com:xxxx/xxxx.git)
|
|
750
|
+
*/
|
|
751
|
+
export function getGithubRepoUrl() {
|
|
752
|
+
try {
|
|
753
|
+
const gitRemote = execSync("git remote get-url origin", {
|
|
754
|
+
encoding: "utf8",
|
|
755
|
+
stdio: ["pipe", "pipe", "ignore"],
|
|
756
|
+
}).trim();
|
|
757
|
+
|
|
758
|
+
// Check if it's a GitHub repository
|
|
759
|
+
if (gitRemote.includes("github.com")) {
|
|
760
|
+
return gitRemote;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
return "";
|
|
764
|
+
} catch {
|
|
765
|
+
// Not in git repository or no origin remote
|
|
766
|
+
return "";
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
|
|
747
770
|
/**
|
|
748
771
|
* Get GitHub repository information
|
|
749
772
|
* @param {string} repoUrl - The repository URL
|