Encore deploy (#143)

* new deploy

* remove jazz from api for now

* .

* secrets

* .

* .
This commit is contained in:
Nikita
2024-09-06 15:49:58 +03:00
committed by GitHub
parent 924a683ed5
commit aae2e28353
5 changed files with 56 additions and 47 deletions

View File

@@ -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<void> => {
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<any>

View File

@@ -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" },

View File

@@ -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"

BIN
bun.lockb

Binary file not shown.

View File

@@ -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"
}