Skip to content

Commit

Permalink
upgrade to tauri v2 RC
Browse files Browse the repository at this point in the history
  • Loading branch information
dmca-glasgow committed Sep 3, 2024
1 parent 1e420bc commit b902f79
Show file tree
Hide file tree
Showing 20 changed files with 3,156 additions and 2,624 deletions.
2 changes: 1 addition & 1 deletion .github/actions/version-check/lib/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/actions/version-check/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async function getVersion(): Promise<string> {
const filePath = `${workingDir}/src-tauri/tauri.conf.json`;
const contents = await readFile(filePath, 'utf-8');
const json = JSON.parse(contents);
return json.package.version;
return json.version;
}

async function getPreviousReleaseVersions() {
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ dist
dist-ssr
*.local

.vscode/*

src-tauri/binaries/*
!src-tauri/binaries/.gitkeep

Expand Down
2,625 changes: 1,179 additions & 1,446 deletions package-lock.json

Large diffs are not rendered by default.

32 changes: 17 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,45 +20,47 @@
"dependencies": {
"@isos/processor": "0.0.1",
"@isos/runtime": "0.0.1",
"@tauri-apps/api": "^1",
"@tauri-apps/api": ">=2.0.0-rc.0",
"@tauri-apps/plugin-dialog": "^2.0.0-rc",
"@tauri-apps/plugin-fs": "^2.0.0-rc",
"@tauri-apps/plugin-shell": ">=2.0.0-rc.0",
"@tauri-apps/plugin-window-state": "^2.0.0-rc",
"classnames": "^2.5.1",
"preact": "^10.20.2",
"preact": "^10.23.2",
"rehype-document": "^7.0.3",
"rehype-format": "^5.0.0",
"rehype-mathjax": "^6.0.0",
"rehype-stringify": "^10.0.0",
"remark-math": "^6.0.0",
"remark-parse": "^11.0.0",
"remark-rehype": "^11.1.0",
"tauri-plugin-fs-watch-api": "github:tauri-apps/tauri-plugin-fs-watch#v1",
"tauri-plugin-window-state-api": "github:tauri-apps/tauri-plugin-window-state#v1",
"unified": "^11.0.4",
"unist-util-visit": "^5.0.0"
},
"devDependencies": {
"@axe-core/playwright": "^4.9.1",
"@axe-core/playwright": "^4.10.0",
"@babel/preset-react": "^7.24.1",
"@linaria/core": "^6.1.0",
"@linaria/react": "^6.1.0",
"@playwright/test": "^1.44.0",
"@playwright/test": "^1.46.1",
"@preact/preset-vite": "^2.5.0",
"@tauri-apps/cli": "^1",
"@tauri-apps/cli": "^2.0.0-rc.8",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/hast": "^3.0.4",
"@types/lodash": "^4.17.7",
"@types/node": "^20.12.7",
"@types/node": "^22.5.1",
"@types/pretty": "^2.0.3",
"@typescript-eslint/parser": "^7.9.0",
"@vitest/browser": "^2.0.4",
"@typescript-eslint/parser": "^8.3.0",
"@vitest/browser": "^2.0.5",
"@wyw-in-js/babel-preset": "^0.5.1",
"@wyw-in-js/vite": "^0.5.1",
"playwright": "^1.44.0",
"preact-render-to-string": "^6.5.2",
"playwright": "^1.46.1",
"preact-render-to-string": "^6.5.10",
"pretty": "^2.0.0",
"sass": "^1.77.8",
"typescript": "^5.0.2",
"vite": "^5.0.0",
"typescript": "^5.2.2",
"vite": "^5.4.2",
"vite-plugin-svgr": "^4.2.0",
"vitest": "^2.0.4"
"vitest": "^2.0.5"
}
}
14 changes: 5 additions & 9 deletions packages/fs/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
export async function readBinaryFile(
filePath: string
filePath: string,
): Promise<Uint8Array> {
if (process.env.NODE_ENV === 'test') {
const { readFile } = await import('fs/promises');
return readFile(filePath);
return (await import('fs/promises')).readFile(filePath);
} else {
const { readBinaryFile: r } = await import('@tauri-apps/api/fs');
return r(filePath);
return (await import('@tauri-apps/plugin-fs')).readFile(filePath);
}
}

export async function readTextFile(filePath: string): Promise<string> {
if (process.env.NODE_ENV === 'test') {
const { readFile } = await import('fs/promises');
return readFile(filePath, 'utf-8');
return (await import('fs/promises')).readFile(filePath, 'utf-8');
} else {
const { readTextFile: r } = await import('@tauri-apps/api/fs');
return r(filePath);
return (await import('@tauri-apps/plugin-fs')).readTextFile(filePath);
}
}
Loading

0 comments on commit b902f79

Please sign in to comment.