Skip to content

Commit

Permalink
Introduce more packages
Browse files Browse the repository at this point in the history
  • Loading branch information
deminearchiver committed Apr 6, 2024
1 parent d0540cc commit 593de20
Show file tree
Hide file tree
Showing 50 changed files with 881 additions and 134 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
name: blending-windows-bundle
path: target/release/bundle/
build-linux:
name: Build (Linux)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
14 changes: 14 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resolver = "2"
members = [
"apps/backend",
"packages/tauri-plugin-ftp",
"packages/tauri-plugin-dwm",
]

[workspace.package]
Expand All @@ -12,3 +13,4 @@ license = "ISC"

[workspace.dependencies]
tauri-plugin-ftp = { path = "packages/tauri-plugin-ftp" }
tauri-plugin-dwm = { path = "packages/tauri-plugin-dwm" }
1 change: 1 addition & 0 deletions apps/backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ url = "2"
notify = "6"

tauri-plugin-ftp.workspace = true
tauri-plugin-dwm.workspace = true

windows-core = "0.54"

Expand Down
2 changes: 2 additions & 0 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"private": true,
"name": "@blending/backend",
"version": "0.0.0",
"packageManager": "yarn@4.1.1",
"scripts": {
"dev": "tauri dev",
Expand Down
4 changes: 4 additions & 0 deletions apps/backend/src/blender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ impl<R: Runtime, T: Manager<R>> BlenderExt<R> for T {
self.state::<Blender<R>>().inner()
}
}

trait Worker {

}
4 changes: 3 additions & 1 deletion apps/backend/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ use url::Url;

mod commands;
mod blender;
mod scraper;
mod settings;

const BLENDER_ICON: &[u8] = include_bytes!("../resources/blender/blender_icon_32x32.png");
const VISIBILITY_ICON: &[u8] = include_bytes!("../resources/icon_visibility.png");
Expand Down Expand Up @@ -89,12 +91,12 @@ fn main() {
.plugin(tauri_plugin_autostart::init(MacosLauncher::LaunchAgent, None))
.plugin(tauri_plugin_shell::init())
.plugin(tauri_plugin_window_state::Builder::default().build())
.plugin(tauri_plugin_cli::init())
.plugin(
tauri_plugin_single_instance::init(|app, args, cwd| {

})
)
.plugin(tauri_plugin_dwm::init())
.plugin(tauri_plugin_dialog::init())
.setup(|app| {
let _ = app.autolaunch().disable();
Expand Down
19 changes: 19 additions & 0 deletions apps/backend/src/scraper.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
use semver::Version;
use suppaftp::FtpStream;

pub trait Scraper {

}

pub struct StableScraper {

}

impl StableScraper {
pub fn scrape() {
let mut stream = FtpStream::connect("mirrors.dotsrc.org:21").unwrap();
stream.login("anonymous", "").unwrap();
stream.cwd("/blender/blender-release/Blender4.1").unwrap();
}
}

Empty file.
Empty file.
5 changes: 0 additions & 5 deletions apps/backend/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@
"csp": null
}
},
"plugins": {
"cli": {

}
},
"bundle": {
"copyright": "Copyright (c) deminearchiver 2024",
"active": true,
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"solid-js": "^1.8.16",
"starlight-blog": "^0.5.1",
"starlight-image-zoom": "^0.2.0",
"typescript": "^5.4.3",
"typescript": "^5.4.4",
"unist-util-visit": "^5.0.0"
},
"devDependencies": {
Expand Down
4 changes: 3 additions & 1 deletion apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
},
"dependencies": {
"@blending/common": "workspace:^",
"@blending/css": "workspace:^",
"@blending/material": "workspace:^",
"@blending/tauri-plugin-dwm": "workspace:^",
"@blending/tauri-plugin-ftp": "workspace:^",
"@material/material-color-utilities": "^0.2.7",
"@solid-primitives/context": "^0.2.3",
Expand All @@ -31,7 +33,7 @@
"@solid-primitives/refs": "^1.0.8",
"@types/node": "^20.12.3",
"@vanilla-extract/vite-plugin": "^4.0.7",
"typescript": "^5.4.3",
"typescript": "^5.4.4",
"vite": "^5.2.7",
"vite-plugin-solid": "^2.10.2"
}
Expand Down
8 changes: 4 additions & 4 deletions apps/frontend/src/global.css.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { colorMix, css } from "@blending/common/css";
import css from "@blending/css";
import { darkTheme } from "@blending/material/theme/global/dark";
import { fontFace, globalStyle } from "@vanilla-extract/css";
import { globalStyle } from "@vanilla-extract/css";

/*
// <uniquifier>: Use a unique and descriptive class name
Expand Down Expand Up @@ -107,7 +107,7 @@ globalStyle(
globalStyle(
"body::-webkit-scrollbar-thumb",
{
backgroundColor: colorMix(
backgroundColor: css.colorMix(
"srgb",
[darkTheme.color.onSurface, "12%"],
"transparent",
Expand All @@ -121,7 +121,7 @@ globalStyle(
globalStyle(
"body::-webkit-scrollbar-thumb:hover",
{
backgroundColor: colorMix(
backgroundColor: css.colorMix(
"srgb",
[darkTheme.color.onSurface, "38%"],
"transparent",
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { App } from "./App";
import { Router, Route } from "@solidjs/router";

import "./global.css";
import "@blending/material/theme/global/dark";

import "material-symbols/rounded.css";
import { Test } from "./components/onboarding";

render(
() => <Test />,
document.getElementById("root")!,
Expand Down
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
],
"scripts": {
":": "yarn workspace",
":docs": "yarn workspace @blending/docs",
":backend": "yarn workspace @blending/backend",
":frontend": "yarn workspace @blending/frontend"
":docs": "yarn : @blending/docs",
":backend": "yarn : @blending/backend",
":frontend": "yarn : @blending/frontend",
"app:dev": "yarn :backend dev",
"app:build": "yarn :backend build",
"docs:dev": "yarn :docs dev",
"docs:build": "yarn :docs build"
},
"devDependencies": {
"typescript": "^5.4.3",
"wrangler": "^3.44.0"
}
}
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"packageManager": "yarn@4.1.1",
"devDependencies": {
"@blending/config": "workspace:^",
"typescript": "^5.4.3"
"typescript": "^5.4.4"
},
"dependencies": {
"@vanilla-extract/css": "^1.14.2",
Expand Down
76 changes: 0 additions & 76 deletions packages/common/src/css/css.ts

This file was deleted.

12 changes: 0 additions & 12 deletions packages/common/src/css/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
import { svgPathProperties as SVGPathProperties } from "svg-path-properties";

export function fontVariationSettings(values: Record<string, number>) {
return Object.entries(values)
.map(
([key, value]) => `"${key}" ${value}`
)
.join(",");
}

export * from "./functions/color-mix";


export type LinearPoint = [pos: number, val: number];

Expand Down Expand Up @@ -40,5 +30,3 @@ export function processSVGData(data: string, pointsLength: number): LinearPoint[
}
return points;
}

export * from "./css";
1 change: 0 additions & 1 deletion packages/common/src/css/literal.ts

This file was deleted.

19 changes: 19 additions & 0 deletions packages/css/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"private": true,
"name": "@blending/css",
"version": "0.0.0",
"type": "module",
"exports": {
".": "./src/index.ts",
"./syntax": "./src/syntax/index.ts"
},
"packageManager": "yarn@4.1.1",
"dependencies": {
"@vanilla-extract/css": "^1.14.2"
},
"devDependencies": {
"@blending/config": "workspace:^",
"@blending/utils": "workspace:^",
"typescript": "^5.4.4"
}
}
51 changes: 51 additions & 0 deletions packages/css/src/color-mix.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { syntax } from "./syntax";

const COLOR_MIX = syntax.function`color-mix`;

type RectangularColorSpace =
| "srgb"
| "srgb-linear"
| "display-p3"
| "a98-rgb"
| "prophoto-rgb"
| "rec2020"
| "lab"
| "oklab"
| "xyz"
| "xyz-d50"
| "xyz-d65";
type PolarColorSpace =
| "hsl"
| "hwb"
| "lch"
| "oklch";

type ColorSpace = RectangularColorSpace | PolarColorSpace;

type HueInterpolationMethod =
| "shorter"
| "longer"
| "decreasing"
| "increasing";

type ColorInterpolationMethod = ColorSpace | [ColorSpace, HueInterpolationMethod];

type ColorMixColor = string | [string, `${number}%`];

export const colorMix = (
method: ColorInterpolationMethod,
color1: ColorMixColor,
color2: ColorMixColor,
) => {
let parts: string[] = typeof method === "string" ? [method] : method;

const processColor = (color: ColorMixColor) => {
return typeof color === "string" ? color : color.join(" ");
}

return COLOR_MIX(
`in ${parts.join(" ")}`,
processColor(color1),
processColor(color2),
);
}
Loading

0 comments on commit 593de20

Please sign in to comment.