From 89bd003480c85882c9bf50d76ddef8d899497cb8 Mon Sep 17 00:00:00 2001 From: Nettika Date: Wed, 28 Jan 2026 21:45:39 -0800 Subject: [PATCH] Create a Nix flake and setup Direnv --- .envrc | 1 + .gitignore | 125 +------------------------------------------- CLAUDE.md | 7 --- TODO.md | 6 ++- flake.lock | 61 +++++++++++++++++++++ flake.nix | 39 ++++++++++++++ original/.gitignore | 124 +++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 231 insertions(+), 132 deletions(-) create mode 100644 .envrc delete mode 100644 CLAUDE.md create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 original/.gitignore diff --git a/.envrc b/.envrc new file mode 100644 index 000000000..8392d159f --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake \ No newline at end of file diff --git a/.gitignore b/.gitignore index 6e12d892c..29963da9e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,124 +1 @@ -# Build Folders (you can keep bin if you'd like, to store dlls and pdbs) -[Bb]in/ -[Oo]bj/ - -# mstest test results -TestResults -Tests/temp/ -Tests/TestData/ExportedGcode/ - -StaticData/Translations/L10N/ - -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.sln.docstates - -node_modules/ - -# Build results -[Dd]ebug/ -[Rr]elease/ -x64/ -*_i.c -*_p.c -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.log -*.vspscc -*.vssscc -.builds - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opensdf -*.sdf - -# Visual Studio profiler -*.psess -*.vsp -*.vspx - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper* - -# NCrunch -*.ncrunch* -.*crunch*.local.xml - -# Installshield output folder -[Ee]xpress - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Ignore Android plugin binaries -StaticData/Plugins/ - -# Click-Once directory -publish - -# Publish Web Output -*.Publish.xml - -# NuGet Packages Directory -packages - -# Windows Azure Build Output -csx -*.build.csdef - -# Windows Store app package directory -AppPackages/ - -# Others -[Bb]in -[Oo]bj -sql -TestResults -[Tt]est[Rr]esult* -*.Cache -ClientBin -[Ss]tyle[Cc]op.* -~$* -*.dbmdl -Generated_Code #added for RIA/Silverlight projects - -# Backup & report files from converting an old project file to a newer -# Visual Studio version. Backup files are not needed, because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -MatterControl.userprefs - -.vs/ - -# JetBrains Rider user configuration directory -/.idea/ -/MainOutputDirectory.cs +/.direnv/ diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index 7af194044..000000000 --- a/CLAUDE.md +++ /dev/null @@ -1,7 +0,0 @@ -You are developing a web app that is a clone of MatterControl's design tools. MatterControl is a C# 3D modeller and slicer. You are only cloning the 3D design tools, not the slicer/printing capabilities. - -Your task list is in @TODO.md. - -The source code for the original program, MatterControl, is in the `original` directory. Technical research on the MatterControl codebase can be found in the `research` directory. See @research/index.md for an overview. - -Remember to use `nix-shell` to grab temporary tools as needed. diff --git a/TODO.md b/TODO.md index e8592002f..b3b23a3e6 100644 --- a/TODO.md +++ b/TODO.md @@ -2,12 +2,16 @@ A step-by-step checklist for porting MatterControl's design features to a Vue + TypeScript + three.js web application. +If a given step is more complex than anticipated, consider breaking it down into additional steps and adding those checklist items below. If a given step is no longer appropriate or you discern it needs adjusted or re-scoping, raise it in discussion. + +When a given step is completed, check it off. + --- ## Phase 1: Project Foundation ### Development Environment -- [ ] Create `flake.nix` with Node.js and pnpm +- [x] Create `flake.nix` with Node.js and pnpm - [ ] Add Rust toolchain to `flake.nix` (for later WASM work) - [ ] Add `flake.lock` and verify `nix develop` works - [ ] Create `justfile` with `dev`, `build`, `test`, `lint` recipes diff --git a/flake.lock b/flake.lock new file mode 100644 index 000000000..6bae7c7ca --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1769461804, + "narHash": "sha256-msG8SU5WsBUfVVa/9RPLaymvi5bI8edTavbIq3vRlhI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "bfc1b8a4574108ceef22f02bafcf6611380c100d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 000000000..2427a3acf --- /dev/null +++ b/flake.nix @@ -0,0 +1,39 @@ +{ + description = "MatterControl Web Port - Vue + TypeScript + three.js"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = + { + self, + nixpkgs, + flake-utils, + }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + devShells.default = pkgs.mkShell { + buildInputs = with pkgs; [ + # Node.js LTS and pnpm + nodejs_22 + pnpm + + # Useful development tools + just + ]; + + shellHook = '' + echo "Developer Environment" + echo "Node.js: $(node --version)" + echo "pnpm: $(pnpm --version)" + ''; + }; + } + ); +} diff --git a/original/.gitignore b/original/.gitignore new file mode 100644 index 000000000..6e12d892c --- /dev/null +++ b/original/.gitignore @@ -0,0 +1,124 @@ +# Build Folders (you can keep bin if you'd like, to store dlls and pdbs) +[Bb]in/ +[Oo]bj/ + +# mstest test results +TestResults +Tests/temp/ +Tests/TestData/ExportedGcode/ + +StaticData/Translations/L10N/ + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +node_modules/ + +# Build results +[Dd]ebug/ +[Rr]elease/ +x64/ +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.log +*.vspscc +*.vssscc +.builds + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper* + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Ignore Android plugin binaries +StaticData/Plugins/ + +# Click-Once directory +publish + +# Publish Web Output +*.Publish.xml + +# NuGet Packages Directory +packages + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +[Bb]in +[Oo]bj +sql +TestResults +[Tt]est[Rr]esult* +*.Cache +ClientBin +[Ss]tyle[Cc]op.* +~$* +*.dbmdl +Generated_Code #added for RIA/Silverlight projects + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +MatterControl.userprefs + +.vs/ + +# JetBrains Rider user configuration directory +/.idea/ +/MainOutputDirectory.cs