diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 401f472..7b5d691 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -6,7 +6,7 @@ on: - '**' pull_request: branches: - - main + - master jobs: check: diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 215878f..a6c6315 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -3,7 +3,7 @@ name: release-please on: push: branches: - - main + - master jobs: release-please: diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..84f9e28 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1 @@ +{"packages/userscript":"1.0.0"} diff --git a/README.md b/README.md index 7cdb5c5..512a436 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Install **Tampermonkey** **([Chrome](https://www.tampermonkey.net/)** / **[Fir | Greasyfork | GitHub | | ---------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| [Insatall](https://greasyfork.org/scripts/456055-chatgpt-exporter) | [Insatall](https://raw.githubusercontent.com/pionxzh/chatgpt-exporter/main/dist/chatgpt.user.js) | +| [Insatall](https://greasyfork.org/scripts/456055-chatgpt-exporter) | [Insatall](https://raw.githubusercontent.com/pionxzh/chatgpt-exporter/master/dist/chatgpt.user.js) | # Example diff --git a/packages/userscript/src/main.ts b/packages/userscript/src/main.ts index e6cbd97..e42aa7b 100644 --- a/packages/userscript/src/main.ts +++ b/packages/userscript/src/main.ts @@ -3,9 +3,24 @@ import './style.scss' import { copyToClipboard, downloadFile, getBase64FromImg, onloadSafe } from './utils' import templateHtml from './template.html?raw' -appendLeftSidebarItem() +type ConversationLine = | +{ type: 'text'; text: string } | +{ type: 'image'; src: string } | +{ type: 'code'; code: string } | +{ type: 'code-block'; lang: string; code: string } | +{ type: 'link'; text: string; href: string } + +interface ConversationItem { + author: { + name: string + avatar: string + } + lines: ConversationLine[][] +} + +main() -function appendLeftSidebarItem() { +function main() { onloadSafe(() => { const firstItem = document.querySelector('[class^="Navigation__NavMenuItem"]') if (!firstItem) return @@ -31,21 +46,6 @@ function appendLeftSidebarItem() { }) } -type ConversationLine = | -{ type: 'text'; text: string } | -{ type: 'image'; src: string } | -{ type: 'code'; code: string } | -{ type: 'code-block'; lang: string; code: string } | -{ type: 'link'; text: string; href: string } - -interface ConversationItem { - author: { - name: string - avatar: string - } - lines: ConversationLine[][] -} - function copyToText() { const items = getConversation() if (items.length === 0) { diff --git a/release-please-config.json b/release-please-config.json index bdfb343..46c0f65 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -2,8 +2,8 @@ "pull-request-header": ":robot: I have created a release", "pull-request-title-pattern": "chore: release${component} ${version}", "packages": { - "packages/exporter": { - "component": "exporter" + "packages/userscript": { + "component": "userscript" } } }