mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-11 16:09:39 +00:00
add back bun versioning to client
This commit is contained in:
@@ -263,8 +263,10 @@
|
||||
editor.insertAtCursor(`(await wmill.getVariable('${path}'))`)
|
||||
} else if (lang === 'bun') {
|
||||
const code = editor.getCode()
|
||||
if (!code.includes('import { getVariable } from "windmill-client')) {
|
||||
editor.insertAtBeginning(`import { getVariable } from "windmill-client"\n`)
|
||||
if (!code.includes(`import { getVariable } from "windmill-client@${__pkg__.version}`)) {
|
||||
editor.insertAtBeginning(
|
||||
`import { getVariable } from "windmill-client@${__pkg__.version}"\n`
|
||||
)
|
||||
}
|
||||
editor.insertAtCursor(`(await getVariable('${path}'))`)
|
||||
} else if (lang == 'python3') {
|
||||
@@ -319,8 +321,10 @@
|
||||
editor.insertAtCursor(`(await wmill.getResource('${path}'))`)
|
||||
} else if (lang === 'bun') {
|
||||
const code = editor.getCode()
|
||||
if (!code.includes('import { getResource } from "windmill-client')) {
|
||||
editor.insertAtBeginning(`import { getResource } from "windmill-client"\n`)
|
||||
if (!code.includes(`import { getResource } from "windmill-client@${__pkg__.version}`)) {
|
||||
editor.insertAtBeginning(
|
||||
`import { getResource } from "windmill-client@${__pkg__.version}"\n`
|
||||
)
|
||||
}
|
||||
editor.insertAtCursor(`(await getResource('${path}'))`)
|
||||
} else if (lang == 'python3') {
|
||||
|
||||
@@ -45,7 +45,7 @@ export async function main(
|
||||
`
|
||||
|
||||
export const BUN_INIT_CODE = `// import { toWords } from "number-to-words@1"
|
||||
import { getVariable } from "windmill-client"
|
||||
import { getVariable } from "windmill-client@${__pkg__.version}"
|
||||
|
||||
// fill the type, or use the +Resource type to get a type-safe reference to a resource
|
||||
// type Postgresql = object
|
||||
@@ -107,7 +107,7 @@ export async function main(x: string) {
|
||||
}
|
||||
`
|
||||
|
||||
export const BUN_INIT_CODE_CLEAR = `// import { setClient, getVariable } from "windmill-client"
|
||||
export const BUN_INIT_CODE_CLEAR = `// import { setClient, getVariable } from "windmill-client@${__pkg__.version}"
|
||||
|
||||
export async function main(x: string) {
|
||||
// setClient()
|
||||
|
||||
Reference in New Issue
Block a user