mirror of
https://github.com/zaphar/kitchen.git
synced 2025-07-22 19:40:14 -04:00
Stop using Trunk because it's not hermetic
This commit is contained in:
parent
fec74bf5e9
commit
d0f57894f9
20
Cargo.lock
generated
20
Cargo.lock
generated
@ -1785,9 +1785,9 @@ checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen"
|
name = "wasm-bindgen"
|
||||||
version = "0.2.80"
|
version = "0.2.78"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad"
|
checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"serde",
|
"serde",
|
||||||
@ -1797,9 +1797,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-backend"
|
name = "wasm-bindgen-backend"
|
||||||
version = "0.2.80"
|
version = "0.2.78"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4"
|
checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bumpalo",
|
"bumpalo",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
@ -1824,9 +1824,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-macro"
|
name = "wasm-bindgen-macro"
|
||||||
version = "0.2.80"
|
version = "0.2.78"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5"
|
checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quote",
|
"quote",
|
||||||
"wasm-bindgen-macro-support",
|
"wasm-bindgen-macro-support",
|
||||||
@ -1834,9 +1834,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-macro-support"
|
name = "wasm-bindgen-macro-support"
|
||||||
version = "0.2.80"
|
version = "0.2.78"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b"
|
checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@ -1847,9 +1847,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-shared"
|
name = "wasm-bindgen-shared"
|
||||||
version = "0.2.80"
|
version = "0.2.78"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744"
|
checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "web-sys"
|
name = "web-sys"
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
outputs = {self, nixpkgs, flake-utils, rust-overlay, naersk, gitignore, flake-compat}:
|
outputs = {self, nixpkgs, flake-utils, rust-overlay, naersk, gitignore, flake-compat}:
|
||||||
let
|
let
|
||||||
kitchenGen = (import ./nix/kitchen/default.nix);
|
kitchenGen = (import ./nix/kitchen/default.nix);
|
||||||
trunkGen = (import ./nix/trunk/default.nix);
|
|
||||||
kitchenWasmGen = (import ./nix/kitchenWasm/default.nix);
|
kitchenWasmGen = (import ./nix/kitchenWasm/default.nix);
|
||||||
cargoVendorGen = (import ./nix/cargoVendorDeps/default.nix);
|
cargoVendorGen = (import ./nix/cargoVendorDeps/default.nix);
|
||||||
moduleGen = (import ./nix/kitchen/module.nix);
|
moduleGen = (import ./nix/kitchen/module.nix);
|
||||||
@ -31,13 +30,12 @@
|
|||||||
targets = [ "wasm32-unknown-unknown" ];
|
targets = [ "wasm32-unknown-unknown" ];
|
||||||
};
|
};
|
||||||
naersk-lib = naersk.lib."${system}";
|
naersk-lib = naersk.lib."${system}";
|
||||||
trunk = trunkGen { inherit pkgs naersk-lib; };
|
|
||||||
cargoVendorDeps = cargoVendorGen {
|
cargoVendorDeps = cargoVendorGen {
|
||||||
inherit pkgs version;
|
inherit pkgs version;
|
||||||
lockFile = ./Cargo.lock;
|
lockFile = ./Cargo.lock;
|
||||||
};
|
};
|
||||||
kitchenWasm = kitchenWasmGen {
|
kitchenWasm = kitchenWasmGen {
|
||||||
inherit pkgs cargoVendorDeps rust-wasm trunk version;
|
inherit pkgs cargoVendorDeps rust-wasm version;
|
||||||
};
|
};
|
||||||
kitchen = (kitchenGen {
|
kitchen = (kitchenGen {
|
||||||
inherit pkgs version naersk-lib kitchenWasm;# cargoVendorDeps;
|
inherit pkgs version naersk-lib kitchenWasm;# cargoVendorDeps;
|
||||||
@ -48,8 +46,7 @@
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
packages = {
|
packages = {
|
||||||
inherit trunk
|
inherit cargoVendorDeps
|
||||||
cargoVendorDeps
|
|
||||||
kitchenWasm
|
kitchenWasm
|
||||||
kitchen
|
kitchen
|
||||||
;
|
;
|
||||||
@ -61,7 +58,7 @@
|
|||||||
program = "${kitchen}/bin/kitchen";
|
program = "${kitchen}/bin/kitchen";
|
||||||
};
|
};
|
||||||
devShell = pkgs.mkShell {
|
devShell = pkgs.mkShell {
|
||||||
buildInputs = [ trunk rust-wasm ];
|
buildInputs = [ rust-wasm ] ++ (with pkgs; [wasm-bindgen-cli wasm-pack]);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -12,8 +12,8 @@ in
|
|||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
inherit src pname;
|
inherit src pname;
|
||||||
version = version;
|
version = version;
|
||||||
# we need wasmb-bindgen v0.2.78 ideally
|
# we need wasmb-bindgen v0.2.78 exactly
|
||||||
buildInputs = [ trunk rust-wasm wasm-bindgen-cli ];
|
buildInputs = [ rust-wasm wasm-bindgen-cli wasm-pack binaryen];
|
||||||
phases = [ "postUnpackPhase" "buildPhase"];
|
phases = [ "postUnpackPhase" "buildPhase"];
|
||||||
postUnpackPhase = ''
|
postUnpackPhase = ''
|
||||||
ln -s ${cargoVendorDeps} ./cargo-vendor-dir
|
ln -s ${cargoVendorDeps} ./cargo-vendor-dir
|
||||||
@ -22,9 +22,11 @@ stdenv.mkDerivation {
|
|||||||
'';
|
'';
|
||||||
# TODO(jwall): Build this from the root rather than the src.
|
# TODO(jwall): Build this from the root rather than the src.
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
echo building with trunk
|
echo building with wasm-pack
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
cd web
|
cd web
|
||||||
trunk build --release --public-url /ui/ --dist $out;
|
cp -r static $out
|
||||||
|
wasm-pack build --target web --out-dir $out;
|
||||||
|
cp -r index.html $out
|
||||||
'';
|
'';
|
||||||
}
|
}
|
@ -1,21 +0,0 @@
|
|||||||
{pkgs ? (import <nixpkgs>) {},
|
|
||||||
naersk-lib,
|
|
||||||
}:
|
|
||||||
with pkgs;
|
|
||||||
naersk-lib.buildPackage rec {
|
|
||||||
pname = "trunk";
|
|
||||||
version = "v0.14.0";
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "thedodd";
|
|
||||||
repo = pname;
|
|
||||||
rev = version;
|
|
||||||
sha256 = "sha256-69MQDIF79pSuaOgZEIqb/ESPQzL7MUiQaJaxPccGxo8=";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Trunk uses the network in it's test which is lame. We'll work around
|
|
||||||
# by disabling here for now.
|
|
||||||
doCheck = false;
|
|
||||||
meta = {
|
|
||||||
description = "Trunk rust web assembly bundler";
|
|
||||||
};
|
|
||||||
}
|
|
@ -9,6 +9,8 @@ web = []
|
|||||||
default = ["web"]
|
default = ["web"]
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
[lib]
|
||||||
|
crate-type = ["cdylib", "rlib"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
recipes = {path = "../recipes" }
|
recipes = {path = "../recipes" }
|
||||||
@ -19,7 +21,8 @@ sycamore-router = "0.7.1"
|
|||||||
serde_json = "1.0.79"
|
serde_json = "1.0.79"
|
||||||
|
|
||||||
[dependencies.wasm-bindgen]
|
[dependencies.wasm-bindgen]
|
||||||
version = "0.2.80"
|
# we need wasm-bindgen v0.2.78 exactly
|
||||||
|
version = "0.2.78"
|
||||||
|
|
||||||
[dependencies.web-sys]
|
[dependencies.web-sys]
|
||||||
version = "0.3"
|
version = "0.3"
|
||||||
|
@ -19,12 +19,20 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" name="viewport"
|
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" name="viewport"
|
||||||
content="width=device-width, initial-scale=1.0" charset="UTF-8">
|
content="width=device-width, initial-scale=1.0" charset="UTF-8">
|
||||||
<link data-trunk rel="inline" type="css" href="static/pico.min.css">
|
<link rel="stylesheet" href="static/pico.min.css">
|
||||||
<link data-trunk rel="inline" type="css" , href="static/app.css">
|
<link rel="stylesheet" href="static/app.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="main"></div>
|
<div id="main"></div>
|
||||||
|
<script type="module">
|
||||||
|
import init, { } from './kitchen_wasm.js';
|
||||||
|
|
||||||
|
async function run() {
|
||||||
|
await init();
|
||||||
|
}
|
||||||
|
run();
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
@ -11,18 +11,20 @@
|
|||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
mod app_state;
|
||||||
mod components;
|
mod components;
|
||||||
mod pages;
|
mod pages;
|
||||||
mod service;
|
mod service;
|
||||||
mod typings;
|
mod typings;
|
||||||
mod web;
|
mod web;
|
||||||
mod app_state;
|
|
||||||
|
|
||||||
use sycamore::prelude::*;
|
use sycamore::prelude::*;
|
||||||
|
use wasm_bindgen::prelude::wasm_bindgen;
|
||||||
|
|
||||||
use web::UI;
|
use web::UI;
|
||||||
|
|
||||||
fn main() {
|
#[wasm_bindgen(start)]
|
||||||
|
pub fn main() {
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
{
|
{
|
||||||
console_error_panic_hook::set_once();
|
console_error_panic_hook::set_once();
|
Loading…
x
Reference in New Issue
Block a user