treedome: use yarn{Config,Build}Hook for ui

This commit is contained in:
Doron Behar 2024-06-23 00:01:35 +03:00
parent fdcf1d1b8a
commit d544d8d66c
2 changed files with 12 additions and 90 deletions

View File

@ -1,68 +0,0 @@
{
"name": "treedome",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"tauri": "tauri",
"clean": "rm -rf node_modules",
"prettier-format": "prettier --config .prettierrc 'src/**/*.ts*' --write"
},
"dependencies": {
"@column-resizer/react": "^1.3.0",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@fontsource/noto-sans": "^5.0.8",
"@fontsource/noto-sans-mono": "^5.0.8",
"@leeoniya/ufuzzy": "^1.0.8",
"@mantine/core": "^7.5.0",
"@mantine/form": "^7.5.0",
"@mantine/hooks": "^7.5.0",
"@mantine/modals": "^7.5.0",
"@mantine/notifications": "^7.5.0",
"@mantine/spotlight": "^7.5.0",
"@mantine/tiptap": "^7.5.0",
"@minoru/react-dnd-treeview": "^3.4.4",
"@mui/icons-material": "^5.14.0",
"@mui/material": "^5.14.0",
"@tabler/icons-react": "^2.28.0",
"@tauri-apps/api": "^1.4.0",
"@tiptap/extension-code-block-lowlight": "^2.0.4",
"@tiptap/extension-highlight": "^2.0.4",
"@tiptap/extension-image": "^2.0.4",
"@tiptap/extension-link": "^2.0.4",
"@tiptap/extension-placeholder": "^2.0.4",
"@tiptap/extension-subscript": "^2.0.4",
"@tiptap/extension-superscript": "^2.0.4",
"@tiptap/extension-text-align": "^2.0.4",
"@tiptap/extension-typography": "^2.2.3",
"@tiptap/extension-underline": "^2.0.4",
"@tiptap/pm": "^2.0.4",
"@tiptap/react": "^2.0.4",
"@tiptap/starter-kit": "^2.0.4",
"@types/lodash": "^4.14.195",
"fuse.js": "^7.0.0",
"jotai": "^2.2.2",
"lodash": "^4.17.21",
"lowlight": "^2.9.0",
"rc-tree": "^5.7.8",
"react": "^18.2.0",
"react-dnd": "^16.0.1",
"react-dom": "^18.2.0",
"react-idle-timer": "^5.7.2",
"wouter": "^2.11.0"
},
"devDependencies": {
"@tauri-apps/cli": "^1.4.0",
"@types/node": "^20.4.4",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.19",
"@vitejs/plugin-react": "^4.0.3",
"prettier": "^3.0.0",
"typescript": "^5.1.6",
"vite": "^4.4.6"
}
}

View File

@ -8,7 +8,10 @@
, gsettings-desktop-schemas
, gtk3
, libsoup
, mkYarnPackage
, stdenv
, yarnConfigHook
, yarnBuildHook
, nodejs
, openssl
, pkg-config
, rustPlatform
@ -28,31 +31,20 @@ let
fetchLFS = true;
};
frontend-build = mkYarnPackage {
inherit version src;
frontend-build = stdenv.mkDerivation (finalAttrs: {
pname = "treedome-ui";
inherit version src;
offlineCache = fetchYarnDeps {
yarnLock = "${src}/yarn.lock";
hash = "sha256-CrD/n8z5fJKkBKEcvpRHJaqXBt1gbON7VsuLb2JGu1A=";
};
packageJSON = ./package.json;
configurePhase = ''
runHook preConfigure
ln -s $node_modules node_modules
runHook postConfigure
'';
buildPhase = ''
runHook preBuild
export HOME=$(mktemp -d)
yarn --offline run build
runHook postBuild
'';
nativeBuildInputs = [
yarnConfigHook
yarnBuildHook
nodejs
];
installPhase = ''
runHook preInstall
@ -62,9 +54,7 @@ let
runHook postInstall
'';
doDist = false;
};
});
in
rustPlatform.buildRustPackage {
inherit version pname src;