Skip to content

Commit

Permalink
Share font loading logic between overlay ui and main ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphiiko committed Jul 15, 2023
1 parent 68f6dda commit b3b193b
Show file tree
Hide file tree
Showing 26 changed files with 6,671 additions and 6,532 deletions.
8 changes: 5 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
src-tauri/
src-shared/
elevated-sidecar/
src-core/
src-shared-rust/
src-elevated-sidecar/
src-overlay-sidecar/
proto/
node_modules/
dist/
2 changes: 1 addition & 1 deletion .github/workflows/build-development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
uses: Swatinem/rust-cache@v2
with:
workspaces: |
src-shared
src-shared-rust
src-elevated-sidecar
src-core
- name: Install development Tauri CLI
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
uses: Swatinem/rust-cache@v2
with:
workspaces: |
src-shared
src-shared-rust
src-elevated-sidecar
src-core
- name: Install development Tauri CLI
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-and-feature-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
uses: Swatinem/rust-cache@v2
with:
workspaces: |
src-shared
src-shared-rust
src-elevated-sidecar
src-core
- name: Install development Tauri CLI
Expand Down
18 changes: 18 additions & 0 deletions package-lock.json

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

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"ng": "ng",
"lint": "ng lint",
"tl": "node scripts/translation-utils.js",
"clean": "rimraf dist && rimraf src-overlay-sidecar/bin && rimraf src-overlay-sidecar/obj && rimraf src-overlay-ui/build && rimraf src-elevated-sidecar/target && rimraf src-core/target && rimraf src-shared/target && rimraf src-core/resources/elevated-sidecar && rimraf src-core/resources/overlay-sidecar && rimraf src-core/resources/fonts",
"clean": "rimraf dist && rimraf src-overlay-sidecar/bin && rimraf src-overlay-sidecar/obj && rimraf src-overlay-ui/build && rimraf src-elevated-sidecar/target && rimraf src-core/target && rimraf src-shared-rust/target && rimraf src-core/resources/elevated-sidecar && rimraf src-core/resources/overlay-sidecar && rimraf src-core/resources/fonts",
"generate:grpc-web-client": "@powershell -NoProfile -ExecutionPolicy Unrestricted -Command ./scripts/ts-proto-gen.ps1 && prettier --loglevel silent --write src-grpc-web-client/**/*",
"postinstall": "cd src-overlay-ui && npm install && cd .. && node scripts/postinstall.js",
"init": "cd src-overlay-ui && npm install && cd .. && run-s generate:grpc-web-client build:pre"
Expand Down Expand Up @@ -68,6 +68,7 @@
"rxjs": "^7.5.7",
"sass-material-colors": "^0.0.5",
"set-cookie-parser": "^2.5.1",
"src-shared-ts": "file:src-shared-ts",
"tauri-plugin-fs-extra-api": "github:tauri-apps/tauri-plugin-fs-extra",
"tauri-plugin-log-api": "github:tauri-apps/tauri-plugin-log",
"tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store#dev",
Expand Down Expand Up @@ -127,4 +128,4 @@
"git add"
]
}
}
}
31 changes: 24 additions & 7 deletions scripts/set-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,26 @@ if (version !== 'DEV' && !semver(version)) {

if (version === 'DEV') version = '0.0.0';

const packageJson = JSON.parse(readFileSync('package.json').toString());
packageJson.version = version;
writeFileSync('package.json', JSON.stringify(packageJson, null, 2));
// UI package json
{
const packageJson = JSON.parse(readFileSync('package.json').toString());
packageJson.version = version;
writeFileSync('package.json', JSON.stringify(packageJson, null, 2));
}

// Shared TS package json
{
const packageJson = JSON.parse(readFileSync('src-shared-ts/package.json').toString());
packageJson.version = version;
writeFileSync('src-shared-ts/package.json', JSON.stringify(packageJson, null, 2));
}

// Overlay UI package json
{
const packageJson = JSON.parse(readFileSync('src-overlay-ui/package.json').toString());
packageJson.version = version;
writeFileSync('src-overlay-ui/package.json', JSON.stringify(packageJson, null, 2));
}

// Tauri config json
const tauriConfJson = JSON.parse(readFileSync('src-core/tauri.conf.json').toString());
Expand All @@ -28,7 +45,7 @@ tauriConfJson.tauri.windows = tauriConfJson.tauri.windows.map((window) => {
});
writeFileSync('src-core/tauri.conf.json', JSON.stringify(tauriConfJson, null, 2));

// Tauri cargo toml
// Core Cargo toml
let tauriCargoToml = readFileSync('src-core/Cargo.toml').toString();
tauriCargoToml = tauriCargoToml.replaceAll(
/\[package\]\r?\nname = "oyasumivr"\r?\nversion = "[0-9]+\.[0-9]+\.[0-9]+"/g,
Expand All @@ -44,12 +61,12 @@ adminCargoToml = adminCargoToml.replaceAll(
);
writeFileSync('src-elevated-sidecar/Cargo.toml', adminCargoToml);

// Shared cargo toml
let sharedCargoToml = readFileSync('src-shared/Cargo.toml').toString();
// Shared Cargo toml
let sharedCargoToml = readFileSync('src-shared-rust/Cargo.toml').toString();
sharedCargoToml = sharedCargoToml.replaceAll(
/\[package\]\r?\nname = "oyasumivr-shared"\r?\nversion = "[0-9]+\.[0-9]+\.[0-9]+"/g,
`[package]\r\nname = "oyasumivr-shared"\r\nversion = "${version}"`
);
writeFileSync('src-shared/Cargo.toml', sharedCargoToml);
writeFileSync('src-shared-rust/Cargo.toml', sharedCargoToml);

console.log(`Set all versions to v${version}.`);
2 changes: 1 addition & 1 deletion src-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ tauri-build = { version = "1.4.0", features = [] }
tonic-build = { version = "0.9", features = [] }

[dependencies]
oyasumivr-shared = { path = "../src-shared", version = '*' }
oyasumivr-shared = { path = "../src-shared-rust", version = '*' }
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
lazy_static = "1.4.0"
Expand Down
2 changes: 1 addition & 1 deletion src-core/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,4 @@
}
]
}
}
}
2 changes: 1 addition & 1 deletion src-elevated-sidecar/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rust-version = "1.70.0"
tonic-build = "0.9"

[dependencies]
oyasumivr-shared = { path = "../src-shared", version = '*' }
oyasumivr-shared = { path = "../src-shared-rust", version = '*' }
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
nvml-wrapper = "0.8.0"
Expand Down
Loading

0 comments on commit b3b193b

Please sign in to comment.