diff --git a/api/api/api.ts b/api/api/api.ts index e4b52d6c..f3aacecb 100644 --- a/api/api/api.ts +++ b/api/api/api.ts @@ -1,10 +1,20 @@ import { api, APIError } from "encore.dev/api" -import { startWorker } from "jazz-nodejs" -import { ID } from "jazz-tools" +// import { startWorker } from "jazz-nodejs" +// import { ID } from "jazz-tools" +import { secret } from "encore.dev/config" +import log from "encore.dev/log" -const JAZZ_WORKER_ACCOUNT_ID = process.env.JAZZ_WORKER_ACCOUNT_ID -const JAZZ_WORKER_SECRET = process.env.JAZZ_WORKER_SECRET -const JAZZ_PUBLIC_GLOBAL_GROUP = process.env.JAZZ_PUBLIC_GLOBAL_GROUP +const jazzWorkerAccountId = secret("jazzWorkerAccountId") +const jazzWorkerSecret = secret("jazzWorkerSecret") +const jazzPublicGlobalGroup = secret("jazzPublicGlobalGroup") + +export const testRoute = api( + { expose: true, method: "GET", path: "/test" }, + async ({}: {}): Promise => { + console.log(jazzPublicGlobalGroup(), "group") + log.info("better logs from encore") + } +) // return all content for GlobalTopic export const getTopic = api( @@ -20,10 +30,10 @@ export const getTopic = api( url: string }[] }> => { - const { worker } = await startWorker({ - accountID: "co_zhvp7ryXJzDvQagX61F6RCZFJB9", - accountSecret: JAZZ_WORKER_SECRET - }) + // const { worker } = await startWorker({ + // accountID: "co_zhvp7ryXJzDvQagX61F6RCZFJB9", + // accountSecret: JAZZ_WORKER_SECRET + // }) // TODO: how to get the import from outside this package? // const globalGroupId = process.env.JAZZ_PUBLIC_GLOBAL_GROUP as ID diff --git a/api/api/links.ts b/api/api/links.ts index ccb4f5c3..9c17de3d 100644 --- a/api/api/links.ts +++ b/api/api/links.ts @@ -2,9 +2,10 @@ // it is responsible for adding and getting links into LA from API import { api, APIError } from "encore.dev/api" -import { startWorker } from "jazz-nodejs" +// import { startWorker } from "jazz-nodejs" +import { secret } from "encore.dev/config" -const JAZZ_WORKER_SECRET = process.env.JAZZ_WORKER_SECRET +const jazzWorkerSecret = secret("jazzWorkerSecret") export const addPersonalLink = api( { expose: true, method: "POST", path: "/save-link" }, diff --git a/api/package.json b/api/package.json index b0d34260..3a130cad 100644 --- a/api/package.json +++ b/api/package.json @@ -4,7 +4,6 @@ "version": "0.0.1", "type": "module", "scripts": { - "test": "vitest", "dev": "encore run" }, "devDependencies": { @@ -13,8 +12,7 @@ "vitest": "^1.5.0" }, "dependencies": { - "encore.dev": "^1.35.3", - "jazz-nodejs": "^0.7.34" + "encore.dev": "^1.35.3" }, "optionalDependencies": { "@rollup/rollup-linux-x64-gnu": "^4.13.0" diff --git a/bun.lockb b/bun.lockb index 84e6f77a..b6cbd8eb 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 372187e9..f3eee142 100644 --- a/package.json +++ b/package.json @@ -1,35 +1,35 @@ { - "name": "learn-anything", - "scripts": { - "dev": "bun web", - "web": "cd web && bun dev", - "web:build": "bun run --filter '*' build", - "cli": "bun run --watch cli/run.ts", - "seed": "bun --watch cli/seed.ts", - "tauri": "tauri", - "app:build": "bun tauri build -b dmg -v" - }, - "workspaces": [ - "web" - ], - "dependencies": { - "@tauri-apps/cli": "^2.0.0-rc.11", - "@tauri-apps/plugin-fs": "^2.0.0-rc.2", - "jazz-nodejs": "0.7.35-unique.2", - "react-icons": "^5.3.0" - }, - "devDependencies": { - "bun-types": "^1.1.26" - }, - "prettier": { - "plugins": [ - "prettier-plugin-tailwindcss" - ], - "useTabs": true, - "semi": false, - "trailingComma": "none", - "printWidth": 120, - "arrowParens": "avoid" - }, - "license": "MIT" + "name": "learn-anything", + "scripts": { + "dev": "bun web", + "web": "cd web && bun dev", + "web:build": "bun run --filter '*' build", + "cli": "bun run --watch cli/run.ts", + "seed": "bun --watch cli/seed.ts", + "tauri": "tauri", + "app:build": "bun tauri build -b dmg -v" + }, + "workspaces": [ + "web" + ], + "dependencies": { + "@tauri-apps/cli": "^2.0.0-rc.11", + "@tauri-apps/plugin-fs": "^2.0.0-rc.2", + "jazz-nodejs": "0.7.35-unique.2", + "react-icons": "^5.3.0" + }, + "devDependencies": { + "bun-types": "^1.1.26" + }, + "prettier": { + "plugins": [ + "prettier-plugin-tailwindcss" + ], + "useTabs": true, + "semi": false, + "trailingComma": "none", + "printWidth": 120, + "arrowParens": "avoid" + }, + "license": "MIT" }