Revert "chore: remove nutjs" and replace nutjs version (#2900)
* Revert "chore: remove nutjs (#2860)" This reverts commit ce2d8e540582a73423efed02dbe484e213cdf0fe. * feat: change nut-js to download from GitHub * feat: change nut-js to use @nut-tree-fork/nut-js * Revert "Chore: temporary disable cache for server migration (#2742)" This reverts commit af9a35110ba2462279dfb988cc89748697a97899. * feat: disable quickask settings on linux * feat: enable quick ask linux again * Change to @kirillvakalov/nut-tree__nut-js (#2906) Co-authored-by: Hien To <tominhhien97@gmail.com> --------- Co-authored-by: Van-QA <van@jan.ai> Co-authored-by: hiento09 <136591877+hiento09@users.noreply.github.com> Co-authored-by: Hien To <tominhhien97@gmail.com>
This commit is contained in:
parent
eb7e96393b
commit
aa1f01f4fa
112
.github/workflows/jan-electron-linter-and-test.yml
vendored
112
.github/workflows/jan-electron-linter-and-test.yml
vendored
@ -57,19 +57,19 @@ jobs:
|
|||||||
rm -rf ~/jan
|
rm -rf ~/jan
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
# - name: Get Commit Message for PR
|
- name: Get Commit Message for PR
|
||||||
# if : github.event_name == 'pull_request'
|
if : github.event_name == 'pull_request'
|
||||||
# run: |
|
run: |
|
||||||
# echo "REPORT_PORTAL_DESCRIPTION=${{github.event.after}})" >> $GITHUB_ENV
|
echo "REPORT_PORTAL_DESCRIPTION=${{github.event.after}})" >> $GITHUB_ENV
|
||||||
|
|
||||||
# - name: Get Commit Message for push event
|
- name: Get Commit Message for push event
|
||||||
# if : github.event_name == 'push'
|
if : github.event_name == 'push'
|
||||||
# run: |
|
run: |
|
||||||
# echo "REPORT_PORTAL_DESCRIPTION=${{github.sha}})" >> $GITHUB_ENV
|
echo "REPORT_PORTAL_DESCRIPTION=${{github.sha}})" >> $GITHUB_ENV
|
||||||
|
|
||||||
# - name: "Config report portal"
|
- name: "Config report portal"
|
||||||
# run: |
|
run: |
|
||||||
# make update-playwright-config REPORT_PORTAL_URL=${{ secrets.REPORT_PORTAL_URL }} REPORT_PORTAL_API_KEY=${{ secrets.REPORT_PORTAL_API_KEY }} REPORT_PORTAL_PROJECT_NAME=${{ secrets.REPORT_PORTAL_PROJECT_NAME }} REPORT_PORTAL_LAUNCH_NAME="Jan App macos" REPORT_PORTAL_DESCRIPTION="${{env.REPORT_PORTAL_DESCRIPTION}}"
|
make update-playwright-config REPORT_PORTAL_URL=${{ secrets.REPORT_PORTAL_URL }} REPORT_PORTAL_API_KEY=${{ secrets.REPORT_PORTAL_API_KEY }} REPORT_PORTAL_PROJECT_NAME=${{ secrets.REPORT_PORTAL_PROJECT_NAME }} REPORT_PORTAL_LAUNCH_NAME="Jan App macos" REPORT_PORTAL_DESCRIPTION="${{env.REPORT_PORTAL_DESCRIPTION}}"
|
||||||
|
|
||||||
- name: Linter and test
|
- name: Linter and test
|
||||||
run: |
|
run: |
|
||||||
@ -78,9 +78,9 @@ jobs:
|
|||||||
make test
|
make test
|
||||||
env:
|
env:
|
||||||
CSC_IDENTITY_AUTO_DISCOVERY: "false"
|
CSC_IDENTITY_AUTO_DISCOVERY: "false"
|
||||||
# TURBO_API: "${{ secrets.TURBO_API }}"
|
TURBO_API: "${{ secrets.TURBO_API }}"
|
||||||
# TURBO_TEAM: "macos"
|
TURBO_TEAM: "macos"
|
||||||
# TURBO_TOKEN: "${{ secrets.TURBO_TOKEN }}"
|
TURBO_TOKEN: "${{ secrets.TURBO_TOKEN }}"
|
||||||
|
|
||||||
test-on-macos-pr-target:
|
test-on-macos-pr-target:
|
||||||
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
|
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
|
||||||
@ -141,16 +141,16 @@ jobs:
|
|||||||
}
|
}
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
# - name: Get Commit Message for push event
|
- name: Get Commit Message for push event
|
||||||
# if : github.event_name == 'push'
|
if : github.event_name == 'push'
|
||||||
# shell: bash
|
shell: bash
|
||||||
# run: |
|
run: |
|
||||||
# echo "REPORT_PORTAL_DESCRIPTION=${{github.sha}}" >> $GITHUB_ENV
|
echo "REPORT_PORTAL_DESCRIPTION=${{github.sha}}" >> $GITHUB_ENV
|
||||||
|
|
||||||
# - name: "Config report portal"
|
- name: "Config report portal"
|
||||||
# shell: bash
|
shell: bash
|
||||||
# run: |
|
run: |
|
||||||
# make update-playwright-config REPORT_PORTAL_URL=${{ secrets.REPORT_PORTAL_URL }} REPORT_PORTAL_API_KEY=${{ secrets.REPORT_PORTAL_API_KEY }} REPORT_PORTAL_PROJECT_NAME=${{ secrets.REPORT_PORTAL_PROJECT_NAME }} REPORT_PORTAL_LAUNCH_NAME="Jan App Windows ${{ matrix.antivirus-tools }}" REPORT_PORTAL_DESCRIPTION="${{env.REPORT_PORTAL_DESCRIPTION}}"
|
make update-playwright-config REPORT_PORTAL_URL=${{ secrets.REPORT_PORTAL_URL }} REPORT_PORTAL_API_KEY=${{ secrets.REPORT_PORTAL_API_KEY }} REPORT_PORTAL_PROJECT_NAME=${{ secrets.REPORT_PORTAL_PROJECT_NAME }} REPORT_PORTAL_LAUNCH_NAME="Jan App Windows ${{ matrix.antivirus-tools }}" REPORT_PORTAL_DESCRIPTION="${{env.REPORT_PORTAL_DESCRIPTION}}"
|
||||||
|
|
||||||
- name: Linter and test
|
- name: Linter and test
|
||||||
shell: powershell
|
shell: powershell
|
||||||
@ -158,10 +158,10 @@ jobs:
|
|||||||
npm config set registry ${{ secrets.NPM_PROXY }} --global
|
npm config set registry ${{ secrets.NPM_PROXY }} --global
|
||||||
yarn config set registry ${{ secrets.NPM_PROXY }} --global
|
yarn config set registry ${{ secrets.NPM_PROXY }} --global
|
||||||
make test
|
make test
|
||||||
# env:
|
env:
|
||||||
# TURBO_API: "${{ secrets.TURBO_API }}"
|
TURBO_API: "${{ secrets.TURBO_API }}"
|
||||||
# TURBO_TEAM: "windows"
|
TURBO_TEAM: "windows"
|
||||||
# TURBO_TOKEN: "${{ secrets.TURBO_TOKEN }}"
|
TURBO_TOKEN: "${{ secrets.TURBO_TOKEN }}"
|
||||||
test-on-windows-pr:
|
test-on-windows-pr:
|
||||||
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
|
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
|
||||||
runs-on: windows-desktop-default-windows-security
|
runs-on: windows-desktop-default-windows-security
|
||||||
@ -189,16 +189,16 @@ jobs:
|
|||||||
}
|
}
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
# - name: Get Commit Message for PR
|
- name: Get Commit Message for PR
|
||||||
# if : github.event_name == 'pull_request'
|
if : github.event_name == 'pull_request'
|
||||||
# shell: bash
|
shell: bash
|
||||||
# run: |
|
run: |
|
||||||
# echo "REPORT_PORTAL_DESCRIPTION=${{github.event.after}}" >> $GITHUB_ENV
|
echo "REPORT_PORTAL_DESCRIPTION=${{github.event.after}}" >> $GITHUB_ENV
|
||||||
|
|
||||||
# - name: "Config report portal"
|
- name: "Config report portal"
|
||||||
# shell: bash
|
shell: bash
|
||||||
# run: |
|
run: |
|
||||||
# make update-playwright-config REPORT_PORTAL_URL=${{ secrets.REPORT_PORTAL_URL }} REPORT_PORTAL_API_KEY=${{ secrets.REPORT_PORTAL_API_KEY }} REPORT_PORTAL_PROJECT_NAME=${{ secrets.REPORT_PORTAL_PROJECT_NAME }} REPORT_PORTAL_LAUNCH_NAME="Jan App Windows" REPORT_PORTAL_DESCRIPTION="${{env.REPORT_PORTAL_DESCRIPTION}}"
|
make update-playwright-config REPORT_PORTAL_URL=${{ secrets.REPORT_PORTAL_URL }} REPORT_PORTAL_API_KEY=${{ secrets.REPORT_PORTAL_API_KEY }} REPORT_PORTAL_PROJECT_NAME=${{ secrets.REPORT_PORTAL_PROJECT_NAME }} REPORT_PORTAL_LAUNCH_NAME="Jan App Windows" REPORT_PORTAL_DESCRIPTION="${{env.REPORT_PORTAL_DESCRIPTION}}"
|
||||||
|
|
||||||
- name: Linter and test
|
- name: Linter and test
|
||||||
shell: powershell
|
shell: powershell
|
||||||
@ -206,10 +206,10 @@ jobs:
|
|||||||
npm config set registry ${{ secrets.NPM_PROXY }} --global
|
npm config set registry ${{ secrets.NPM_PROXY }} --global
|
||||||
yarn config set registry ${{ secrets.NPM_PROXY }} --global
|
yarn config set registry ${{ secrets.NPM_PROXY }} --global
|
||||||
make test
|
make test
|
||||||
# env:
|
env:
|
||||||
# TURBO_API: "${{ secrets.TURBO_API }}"
|
TURBO_API: "${{ secrets.TURBO_API }}"
|
||||||
# TURBO_TEAM: "windows"
|
TURBO_TEAM: "windows"
|
||||||
# TURBO_TOKEN: "${{ secrets.TURBO_TOKEN }}"
|
TURBO_TOKEN: "${{ secrets.TURBO_TOKEN }}"
|
||||||
|
|
||||||
test-on-windows-pr-target:
|
test-on-windows-pr-target:
|
||||||
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
|
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
|
||||||
@ -266,20 +266,20 @@ jobs:
|
|||||||
rm -rf ~/jan
|
rm -rf ~/jan
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
# - name: Get Commit Message for PR
|
- name: Get Commit Message for PR
|
||||||
# if : github.event_name == 'pull_request'
|
if : github.event_name == 'pull_request'
|
||||||
# run: |
|
run: |
|
||||||
# echo "REPORT_PORTAL_DESCRIPTION=${{github.event.after}}" >> $GITHUB_ENV
|
echo "REPORT_PORTAL_DESCRIPTION=${{github.event.after}}" >> $GITHUB_ENV
|
||||||
|
|
||||||
# - name: Get Commit Message for push event
|
- name: Get Commit Message for push event
|
||||||
# if : github.event_name == 'push'
|
if : github.event_name == 'push'
|
||||||
# run: |
|
run: |
|
||||||
# echo "REPORT_PORTAL_DESCRIPTION=${{github.sha}}" >> $GITHUB_ENV
|
echo "REPORT_PORTAL_DESCRIPTION=${{github.sha}}" >> $GITHUB_ENV
|
||||||
|
|
||||||
# - name: "Config report portal"
|
- name: "Config report portal"
|
||||||
# shell: bash
|
shell: bash
|
||||||
# run: |
|
run: |
|
||||||
# make update-playwright-config REPORT_PORTAL_URL=${{ secrets.REPORT_PORTAL_URL }} REPORT_PORTAL_API_KEY=${{ secrets.REPORT_PORTAL_API_KEY }} REPORT_PORTAL_PROJECT_NAME=${{ secrets.REPORT_PORTAL_PROJECT_NAME }} REPORT_PORTAL_LAUNCH_NAME="Jan App Linux" REPORT_PORTAL_DESCRIPTION="${{env.REPORT_PORTAL_DESCRIPTION}}"
|
make update-playwright-config REPORT_PORTAL_URL=${{ secrets.REPORT_PORTAL_URL }} REPORT_PORTAL_API_KEY=${{ secrets.REPORT_PORTAL_API_KEY }} REPORT_PORTAL_PROJECT_NAME=${{ secrets.REPORT_PORTAL_PROJECT_NAME }} REPORT_PORTAL_LAUNCH_NAME="Jan App Linux" REPORT_PORTAL_DESCRIPTION="${{env.REPORT_PORTAL_DESCRIPTION}}"
|
||||||
|
|
||||||
- name: Linter and test
|
- name: Linter and test
|
||||||
run: |
|
run: |
|
||||||
@ -288,10 +288,10 @@ jobs:
|
|||||||
npm config set registry ${{ secrets.NPM_PROXY }} --global
|
npm config set registry ${{ secrets.NPM_PROXY }} --global
|
||||||
yarn config set registry ${{ secrets.NPM_PROXY }} --global
|
yarn config set registry ${{ secrets.NPM_PROXY }} --global
|
||||||
make test
|
make test
|
||||||
# env:
|
env:
|
||||||
# TURBO_API: "${{ secrets.TURBO_API }}"
|
TURBO_API: "${{ secrets.TURBO_API }}"
|
||||||
# TURBO_TEAM: "linux"
|
TURBO_TEAM: "linux"
|
||||||
# TURBO_TOKEN: "${{ secrets.TURBO_TOKEN }}"
|
TURBO_TOKEN: "${{ secrets.TURBO_TOKEN }}"
|
||||||
|
|
||||||
test-on-ubuntu-pr-target:
|
test-on-ubuntu-pr-target:
|
||||||
runs-on: [self-hosted, Linux, ubuntu-desktop]
|
runs-on: [self-hosted, Linux, ubuntu-desktop]
|
||||||
|
|||||||
@ -103,7 +103,8 @@
|
|||||||
"pacote": "^17.0.4",
|
"pacote": "^17.0.4",
|
||||||
"request": "^2.88.2",
|
"request": "^2.88.2",
|
||||||
"request-progress": "^3.0.0",
|
"request-progress": "^3.0.0",
|
||||||
"ulidx": "^2.3.0"
|
"ulidx": "^2.3.0",
|
||||||
|
"@kirillvakalov/nut-tree__nut-js": "4.2.1-2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@electron/notarize": "^2.1.0",
|
"@electron/notarize": "^2.1.0",
|
||||||
|
|||||||
@ -1,24 +1,23 @@
|
|||||||
import { clipboard, globalShortcut } from 'electron'
|
import { clipboard, globalShortcut } from 'electron'
|
||||||
|
import { keyboard, Key } from "@kirillvakalov/nut-tree__nut-js"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets selected text by synthesizing the keyboard shortcut
|
* Gets selected text by synthesizing the keyboard shortcut
|
||||||
* "CommandOrControl+c" then reading text from the clipboard
|
* "CommandOrControl+c" then reading text from the clipboard
|
||||||
*/
|
*/
|
||||||
export const getSelectedText = async () => {
|
export const getSelectedText = async () => {
|
||||||
// TODO: Implement this function
|
const currentClipboardContent = clipboard.readText() // preserve clipboard content
|
||||||
// const currentClipboardContent = clipboard.readText() // preserve clipboard content
|
clipboard.clear()
|
||||||
// clipboard.clear()
|
const hotkeys: Key[] = [
|
||||||
// const hotkeys: Key[] = [
|
process.platform === 'darwin' ? Key.LeftCmd : Key.LeftControl,
|
||||||
// process.platform === 'darwin' ? Key.LeftCmd : Key.LeftControl,
|
Key.C,
|
||||||
// Key.C,
|
]
|
||||||
// ]
|
await keyboard.pressKey(...hotkeys)
|
||||||
// await keyboard.pressKey(...hotkeys)
|
await keyboard.releaseKey(...hotkeys)
|
||||||
// await keyboard.releaseKey(...hotkeys)
|
await new Promise((resolve) => setTimeout(resolve, 200)) // add a delay before checking clipboard
|
||||||
// await new Promise((resolve) => setTimeout(resolve, 200)) // add a delay before checking clipboard
|
const selectedText = clipboard.readText()
|
||||||
// const selectedText = clipboard.readText()
|
clipboard.writeText(currentClipboardContent)
|
||||||
// clipboard.writeText(currentClipboardContent)
|
return selectedText
|
||||||
// return selectedText
|
|
||||||
return ''
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user