[ENG-1060] Fix the PlatformProvider bug (#1353)

* Life is a lie and nothing makes sense

* consistent version

* Web uses the relative alias resolver it would seem

---------

Co-authored-by: Utku <74243531+utkubakir@users.noreply.github.com>
This commit is contained in:
Oscar Beaumont 2023-09-15 22:02:50 +10:00 committed by GitHub
parent 42c6c358c6
commit 1cae4fab53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 21 additions and 64 deletions

1
.gitignore vendored
View file

@ -27,6 +27,7 @@ apps/*/data
apps/*/stats.html
apps/releases/.vscode
apps/desktop/src-tauri/tauri.conf.patch.json
apps/desktop/src-tauri/*.dll
docs/public/*.st
docs/public/*.toml
dev.db

View file

@ -9,16 +9,7 @@ repository = { workspace = true }
edition = { workspace = true }
[dependencies]
tauri = { version = "=1.3.0", features = [
"dialog-all",
"linux-protocol-headers",
"macos-private-api",
"os-all",
"path-all",
"protocol-all",
"shell-all",
"window-all",
] }
tauri = { version = "=1.3.0", features = ["dialog-all", "linux-protocol-headers", "macos-private-api", "os-all", "path-all", "protocol-all", "shell-all", "window-all"] }
rspc = { workspace = true, features = ["tauri"] }
sd-core = { path = "../../../core", features = [
"ffmpeg",

View file

@ -33,6 +33,6 @@
"vite": "^4.0.4",
"vite-plugin-html": "^3.2.0",
"vite-plugin-svgr": "^2.2.1",
"vite-tsconfig-paths": "^3.5.2"
"vite-tsconfig-paths": "^4.0.3"
}
}

View file

@ -2,11 +2,16 @@ import { visualizer } from 'rollup-plugin-visualizer';
import { mergeConfig } from 'vite';
import baseConfig from '../../packages/config/vite';
import relativeAliasResolver from '../../packages/config/vite/relativeAliasResolver';
export default mergeConfig(baseConfig, {
server: {
port: 8002
},
resolve: {
// BE REALLY DAMN CAREFUL MODIFYING THIS: https://github.com/spacedriveapp/spacedrive/pull/1353
alias: [relativeAliasResolver]
},
plugins: [
visualizer({
gzipSize: true,

View file

@ -156,7 +156,9 @@ pub fn path_is_hidden(path: &Path, metadata: &Metadata) -> bool {
#[cfg(target_family = "windows")]
{
const FILE_ATTRIBUTE_HIDDEN: u8 = 0x2;
use std::os::windows::fs::MetadataExt;
const FILE_ATTRIBUTE_HIDDEN: u32 = 0x2;
if (metadata.file_attributes() & FILE_ATTRIBUTE_HIDDEN) == FILE_ATTRIBUTE_HIDDEN {
return true;

View file

@ -4,7 +4,8 @@
"license": "GPL-3.0-only",
"exports": {
"./*": "./*",
"./vite": "./vite"
"./vite": "./vite",
"./vite/relativeAliasResolver": "./vite/relativeAliasResolver"
},
"scripts": {
"lint": "eslint . --cache"

View file

@ -5,8 +5,6 @@ import { createHtmlPlugin } from 'vite-plugin-html';
import svg from 'vite-plugin-svgr';
import tsconfigPaths from 'vite-tsconfig-paths';
import relativeAliasResolver from './relativeAliasResolver';
export default defineConfig({
plugins: [
tsconfigPaths(),
@ -22,9 +20,6 @@ export default defineConfig({
localsConvention: 'camelCaseOnly'
}
},
resolve: {
alias: [relativeAliasResolver]
},
root: 'src',
build: {
sourcemap: true,

View file

@ -1,3 +1,5 @@
// BE REALLY DAMN CAREFUL MODIFYING THIS FILE: https://github.com/spacedriveapp/spacedrive/pull/1353
import fs from 'fs/promises';
import path from 'path';
import { Alias } from 'vite';

View file

@ -580,8 +580,8 @@ importers:
specifier: ^2.2.1
version: 2.2.1(vite@4.3.9)
vite-tsconfig-paths:
specifier: ^3.5.2
version: 3.5.2(vite@4.3.9)
specifier: ^4.0.3
version: 4.0.3(typescript@5.0.4)(vite@4.3.9)
crates/sync/example/web:
dependencies:
@ -4577,10 +4577,6 @@ packages:
engines: {node: '>=14.6'}
dev: true
/@cush/relative@1.0.0:
resolution: {integrity: sha512-RpfLEtTlyIxeNPGKcokS+p3BZII/Q3bYxryFRglh5H3A3T8q9fsLYm72VYAMEOOIBLEa8o93kFLiBDUWKrwXZA==}
dev: true
/@daybrush/utils@1.13.0:
resolution: {integrity: sha512-ALK12C6SQNNHw1enXK+UO8bdyQ+jaWNQ1Af7Z3FNxeAwjYhQT7do+TRE4RASAJ3ObaS2+TJ7TXR3oz2Gzbw0PQ==}
dev: false
@ -5819,7 +5815,7 @@ packages:
magic-string: 0.27.0
react-docgen-typescript: 2.2.2(typescript@5.0.4)
typescript: 5.0.4
vite: 4.3.9(@types/node@18.15.1)
vite: 4.3.9(less@4.2.0)
/@jridgewell/gen-mapping@0.3.3:
resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==}
@ -8869,7 +8865,7 @@ packages:
remark-slug: 6.1.0
rollup: 3.28.1
typescript: 5.0.4
vite: 4.3.9(@types/node@18.15.1)
vite: 4.3.9(less@4.2.0)
transitivePeerDependencies:
- supports-color
@ -9469,7 +9465,7 @@ packages:
react: 18.2.0
react-docgen: 6.0.0-alpha.3
react-dom: 18.2.0(react@18.2.0)
vite: 4.3.9(@types/node@18.15.1)
vite: 4.3.9(less@4.2.0)
transitivePeerDependencies:
- '@preact/preset-vite'
- supports-color
@ -15156,10 +15152,6 @@ packages:
'@types/glob': 8.1.0
glob: 8.1.0
/glob-regex@0.3.2:
resolution: {integrity: sha512-m5blUd3/OqDTWwzBBtWBPrGlAzatRywHameHeekAZyZrskYouOGdNB8T/q6JucucvJXtOuyHIn0/Yia7iDasDw==}
dev: true
/glob-to-regexp@0.4.1:
resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==}
@ -20619,16 +20611,6 @@ packages:
resolve: 1.22.4
dev: true
/recrawl-sync@2.2.3:
resolution: {integrity: sha512-vSaTR9t+cpxlskkdUFrsEpnf67kSmPk66yAGT1fZPrDudxQjoMzPgQhSMImQ0pAw5k0NPirefQfhopSjhdUtpQ==}
dependencies:
'@cush/relative': 1.0.0
glob-regex: 0.3.2
slash: 3.0.0
sucrase: 3.34.0
tslib: 1.14.1
dev: true
/recyclerlistview@4.2.0(react-native@0.72.4)(react@18.2.0):
resolution: {integrity: sha512-uuBCi0c+ggqHKwrzPX4Z/mJOzsBbjZEAwGGmlwpD/sD7raXixdAbdJ6BTcAmuWG50Cg4ru9p12M94Njwhr/27A==}
peerDependencies:
@ -22351,15 +22333,6 @@ packages:
strip-bom: 3.0.0
dev: true
/tsconfig-paths@4.2.0:
resolution: {integrity: sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==}
engines: {node: '>=6'}
dependencies:
json5: 2.2.3
minimist: 1.2.8
strip-bom: 3.0.0
dev: true
/tsconfig@0.0.1:
resolution: {integrity: sha512-niUm+6k+CDY/e2vHxy2o6VAJLWvbLzOGFMEgaJ+8x2MjslMK83g9LhFLxxWmBSeZDsI4Amk3bdtmT7WCpP+nuA==}
dependencies:
@ -23497,20 +23470,6 @@ packages:
- supports-color
dev: true
/vite-tsconfig-paths@3.5.2(vite@4.3.9):
resolution: {integrity: sha512-xJMgHA2oJ28QCG2f+hXrcqzo7IttrSRK4A//Tp94CfuX5eetOx33qiwXHUdi3FwkHP2ocpxHuvE45Ix67gwEmQ==}
peerDependencies:
vite: '>2.0.0-0'
dependencies:
debug: 4.3.4
globrex: 0.1.2
recrawl-sync: 2.2.3
tsconfig-paths: 4.2.0
vite: 4.3.9(@types/node@18.15.1)
transitivePeerDependencies:
- supports-color
dev: true
/vite-tsconfig-paths@4.0.3(typescript@5.0.4)(vite@4.3.9):
resolution: {integrity: sha512-gRO2Q/tOkV+9kMht5tz90+IaEKvW2zCnvwJV3tp2ruPNZOTM5rF+yXorJT4ggmAMYEaJ3nyXjx5P5jY5FwiZ+A==}
peerDependencies:
@ -23589,6 +23548,7 @@ packages:
rollup: 3.28.1
optionalDependencies:
fsevents: 2.3.3
dev: true
/vite@4.3.9(less@4.2.0):
resolution: {integrity: sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==}