A bunch of changes relating to the codemirror editor component #54

Merged
probablycorey merged 8 commits from editor-fixes into main 2026-01-13 23:00:38 +00:00
2 changed files with 13 additions and 15 deletions
Showing only changes of commit 23c8d4822a - Show all commits

View File

@ -19,7 +19,7 @@ import { list } from './list'
import { math } from './math'
import { str } from './str'
import { types } from './types'
import { isServer } from '#utils/utils'
import { runningInBrowser } from '#utils/utils'
export const globals: Record<string, any> = {
date,
@ -32,8 +32,18 @@ export const globals: Record<string, any> = {
str,
// shrimp runtime info

Makes it so we can run shrimp in the bowser or on the server.

Makes it so we can run shrimp in the bowser or on the server.
$: isServer
$: runningInBrowser
? {
args: [],
argv: [],
env: {},
pid: 0,
cwd: '',
script: {
name: '',
path: '.',
},
} : {
args: Bun.argv.slice(3),
argv: Bun.argv.slice(1),
env: process.env,
@ -44,17 +54,6 @@ export const globals: Record<string, any> = {
path: resolve(join('.', Bun.argv[2] ?? '')),
},
}
: {
args: [],
argv: [],
env: {},
pid: 0,
cwd: '',
script: {
name: '',
path: '.',
},
},
// hello
echo: (...args: any[]) => {

View File

@ -144,5 +144,4 @@ export const isDebug = (): boolean => {
return false
}
export const isBrowser = typeof window !== 'undefined'
export const isServer = typeof process !== 'undefined'
export const runningInBrowser = typeof window !== 'undefined'