Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix chrome detection; upgrade deps #3

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
node-version: 20
cache: 'yarn'

- uses: calcit-lang/[email protected].3
- uses: calcit-lang/[email protected].7
with:
version: '0.9.1'
bundler: false

- name: "compiles to js"
run: >
Expand Down
6 changes: 3 additions & 3 deletions calcit.cirru

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion compact.cirru
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
:defs $ {}
|chrome-extension? $ %{} :CodeEntry (:doc |)
:code $ quote
def chrome-extension? $ and (some? js/chrome) (some? js/chrome.runtime) (some? js/chrome.runtime.id)
def chrome-extension? $ and (some? js/window.chrome) (some? js/window.chrome.runtime) (some? js/window.chrome.runtime.id)
|dev? $ %{} :CodeEntry (:doc |)
:code $ quote
def dev? $ = "\"dev" (get-env "\"mode" "\"release")
Expand Down
1 change: 1 addition & 0 deletions deps.cirru
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

{}
:calcit-version |0.9.5
:dependencies $ {}
|calcit-lang/lilac |main
|calcit-lang/memof |main
Expand Down
6 changes: 3 additions & 3 deletions extension/get-selected.mjs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
export let get_selected = () => {
return new Promise((resolve, reject) => {
if (chrome?.runtime?.id == null) {
if (window.chrome?.runtime?.id == null) {
console.warn("not chrome extension runtime...");
resolve(null);
return;
}
console.log("calling content script...");
chrome.tabs
window.chrome.tabs
.query({ active: true, currentWindow: true })
.then((x) => {
let activeTab = x[0];
if (activeTab) {
let id = activeTab.id;
chrome.tabs.sendMessage(id, { get: "selected" }, function (response) {
window.chrome.tabs.sendMessage(id, { get: "selected" }, function (response) {
// 接收来自 content.js 的返回数据
// console.info('Content script returned: ' + response);
resolve(response);
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"dependencies": {
"@calcit/procs": "^0.9.1",
"@google/generative-ai": "^0.16.0",
"axios": "^1.7.3",
"@calcit/procs": "^0.9.5",
"@google/generative-ai": "^0.20.0",
"axios": "^1.7.7",
"cirru-color": "^0.2.4",
"copy-text-to-clipboard": "^3.2.0"
},
"devDependencies": {
"bottom-tip": "^0.1.5",
"vite": "^5.3.5"
"vite": "^5.4.8"
},
"scripts": {
"build": "yarn vite build --base ./ && rm -rfv extension/dist && cp -vr dist extension/"
Expand Down
Loading