Skip to content

Commit

Permalink
chore: externalize semver
Browse files Browse the repository at this point in the history
Signed-off-by: Martichou <[email protected]>
  • Loading branch information
Martichou committed Aug 3, 2024
1 parent b9e1cfb commit 01fb516
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 13 deletions.
2 changes: 2 additions & 0 deletions app/common/vue_lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
"@tauri-apps/api": "^1.5.6",
"@tauri-apps/plugin-store": "2.0.0-beta.5",
"pinia": "^2.2.0",
"semver": "^7.6.3",
"vue": "^3.4.35"
},
"devDependencies": {
"@stylistic/eslint-plugin": "^2.1.0",
"@vue/eslint-config-typescript": "13.0.0",
"eslint": "8.57.0",
"@types/semver": "^7.5.8",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-security": "3.0.0",
Expand Down
23 changes: 17 additions & 6 deletions app/common/vue_lib/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion app/common/vue_lib/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { autostartKey, DisplayedItem, downloadPathKey, numberToVisibility, realc
import { SendInfo } from '@martichou/core_lib/bindings/SendInfo';
import { ChannelMessage } from '@martichou/core_lib/bindings/ChannelMessage';
import { ChannelAction } from '@martichou/core_lib';
import { gt } from 'semver';

export * from './types';
export * from './stores/useToastStore';
Expand Down Expand Up @@ -174,7 +175,7 @@ export async function getDownloadPath(vm: TauriVM) {
vm.downloadPath = await vm.store.get(downloadPathKey) ?? undefined;
}

export async function getLatestVersion(vm: TauriVM, gt: (a: string, b: string) => boolean) {
export async function getLatestVersion(vm: TauriVM) {
try {
const response = await fetch('https://api.github.com/repos/martichou/rquickshare/releases/latest');
if (!response.ok) {
Expand Down
3 changes: 1 addition & 2 deletions app/legacy/src/components/HomePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@
</template>

<script lang="ts">
import { gt } from 'semver'
import { ref, nextTick } from 'vue'
import { UnlistenFn, listen } from '@tauri-apps/api/event'
import { Store } from 'tauri-plugin-store-api';
Expand Down Expand Up @@ -532,7 +531,7 @@ export default {
})
);
await this.getLatestVersion(this, gt);
await this.getLatestVersion(this);
});
},
Expand Down
2 changes: 1 addition & 1 deletion app/legacy/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default defineConfig({
sourcemap: !!process.env.TAURI_DEBUG,
emptyOutDir: true,
rollupOptions: {
external: ['pinia']
external: ['pinia', 'semver']
}
},
// See https://vitest.dev/config/
Expand Down
3 changes: 1 addition & 2 deletions app/main/src/components/HomePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@
</template>

<script lang="ts">
import { gt } from 'semver'
import { ref, nextTick } from 'vue'
import { UnlistenFn, listen } from '@tauri-apps/api/event'
import { invoke } from '@tauri-apps/api/core'
Expand Down Expand Up @@ -534,7 +533,7 @@ export default {
})
);
await this.getLatestVersion(this, gt);
await this.getLatestVersion(this);
});
},
Expand Down
2 changes: 1 addition & 1 deletion app/main/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default defineConfig({
sourcemap: !!process.env.TAURI_DEBUG,
emptyOutDir: true,
rollupOptions: {
external: ['pinia']
external: ['pinia', 'semver']
}
},
// See https://vitest.dev/config/
Expand Down

0 comments on commit 01fb516

Please sign in to comment.