Skip to content

Commit

Permalink
feat: publish v0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
1943time committed Aug 22, 2023
1 parent fe9324e commit 58ff031
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bluestone",
"version": "0.6.1",
"version": "0.7.0",
"description": "",
"main": "./out/main/index.js",
"license": "AGPL-3.0",
Expand Down
1 change: 1 addition & 0 deletions src/preload/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ declare global {
electron: ElectronAPI
api: {
sdk: typeof Sdk,
toUnix: (path: string) => string
md5: (str: string | Buffer) => string
createHttp: (options: ExtendOptions) => Got
// checkedLatest: () => Promise<any>
Expand Down
4 changes: 4 additions & 0 deletions src/preload/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import got, {Got} from 'got'
import {ExtendOptions} from 'got/dist/source/types'
const langSet = new Set(BUNDLED_LANGUAGES.map(l => [l.id, ...(l.aliases || [])]).flat(2))
let highlighter:Highlighter | null = null
import {toUnix} from 'upath'

let watchers = new Map<string, chokidar.FSWatcher>()
let ready:any = null
Expand All @@ -28,6 +29,9 @@ const api = {
highlightCode(code: string, lang: string) {
return highlighter?.codeToThemedTokens(code, lang, undefined, {includeExplanation: false}) || []
},
toUnix(path: string) {
return toUnix(path)
},
fs,
watch: async (path: string, cb: (event: 'add'| 'addDir' | 'change'| 'unlink'| 'unlinkDir', path: string) => void) => {
if (watchers.get(path)) await watchers.get(path)!.close()
Expand Down

0 comments on commit 58ff031

Please sign in to comment.