Skip to content

Commit

Permalink
Merge pull request #3 from linera-io/05-10-Frontend_framework
Browse files Browse the repository at this point in the history
Initial frontend
  • Loading branch information
Twey committed May 13, 2024
2 parents 2b9ec1d + b614fac commit afc477a
Show file tree
Hide file tree
Showing 36 changed files with 962 additions and 130 deletions.
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

0 comments on commit afc477a

Please sign in to comment.