Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial frontend #3

Merged
merged 6 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions README.md

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
37 changes: 1 addition & 36 deletions flake.lock

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

51 changes: 20 additions & 31 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,29 @@
flake-parts.url = "github:hercules-ci/flake-parts";
systems.url = "github:nix-systems/default";
rust-overlay.url = "github:oxalica/rust-overlay";

# Dev tools
treefmt-nix.url = "github:numtide/treefmt-nix";
};

outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = import inputs.systems;
imports = [
inputs.treefmt-nix.flakeModule
];
perSystem = { config, self', pkgs, lib, system, rust-overlay, ... }:
let
rust-toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
rust = rec {
toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
nativeBuildInputs = with pkgs; [
toolchain
rust-analyzer
];
buildInputs = with pkgs; [
pkg-config
openssl
wasm-pack
];
};

web = {
nativeBuildInputs = [ pkgs.nodePackages.pnpm ];
buildInputs = [];
};
in {
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
Expand All @@ -25,34 +35,13 @@

# Rust dev environment
devShells.default = pkgs.mkShell {
inputsFrom = [
config.treefmt.build.devShell
];
shellHook = ''
# For rust-analyzer 'hover' tooltips to work.
export RUST_SRC_PATH=${rust-toolchain.availableComponents.rust-src}
export RUST_SRC_PATH=${rust.toolchain.availableComponents.rust-src}
export PATH=~/.cargo/bin:$PATH
'';
nativeBuildInputs = with pkgs; [
rust-toolchain
rust-analyzer
];

buildInputs = with pkgs; [
pkg-config
openssl
wasm-pack
];
};

# Add your auto-formatters here.
# cf. https://numtide.github.io/treefmt/
treefmt.config = {
projectRootFile = "flake.nix";
programs = {
nixpkgs-fmt.enable = true;
rustfmt.enable = true;
};
nativeBuildInputs = rust.nativeBuildInputs ++ web.nativeBuildInputs;
buildInputs = rust.buildInputs ++ web.buildInputs;
};
};
};
Expand Down
24 changes: 24 additions & 0 deletions linera-web/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
20 changes: 20 additions & 0 deletions linera-web/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "linera-web",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"lit": "^3.1.2",
"webext-bridge": "^6.0.1"
},
"devDependencies": {
"@types/chrome": "^0.0.267",
"typescript": "^5.2.2",
"vite": "^5.2.0"
}
}
Loading