devenv tweaks
1
index.ts
@@ -62,6 +62,7 @@ const render = createRenderer(z.object({
|
||||
name: z.string(),
|
||||
goprefix: z.string(),
|
||||
frontend: z.string(),
|
||||
mobile: z.string()
|
||||
})
|
||||
}))
|
||||
const destDir = path.join("./", project.name);
|
||||
|
||||
|
Before Width: | Height: | Size: 608 B After Width: | Height: | Size: 608 B |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 780 KiB After Width: | Height: | Size: 780 KiB |
|
Before Width: | Height: | Size: 324 KiB After Width: | Height: | Size: 324 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 215 B After Width: | Height: | Size: 215 B |
|
Before Width: | Height: | Size: 347 B After Width: | Height: | Size: 347 B |
|
Before Width: | Height: | Size: 468 B After Width: | Height: | Size: 468 B |
|
Before Width: | Height: | Size: 253 B After Width: | Height: | Size: 253 B |
|
Before Width: | Height: | Size: 343 B After Width: | Height: | Size: 343 B |
|
Before Width: | Height: | Size: 479 B After Width: | Height: | Size: 479 B |
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
@@ -1,10 +1,4 @@
|
||||
<@if(neq(context.project.frontend,"none"))>
|
||||
bundev = {
|
||||
exec = "bun dev";
|
||||
cwd = "./apps/web";
|
||||
after= ["devenv:processes:air@started"];
|
||||
};
|
||||
<@endif>{ pkgs, lib, config, inputs, ... }:
|
||||
{ pkgs, lib, config, inputs, ... }:
|
||||
|
||||
{
|
||||
packages = [
|
||||
@@ -19,9 +13,6 @@
|
||||
pkgs.protoc-gen-connect-go
|
||||
pkgs.protoc-gen-es
|
||||
pkgs.cobra-cli
|
||||
<@if(eq(context.project.mobile,"expo"))>
|
||||
pkgs.glib
|
||||
<@endif>
|
||||
];
|
||||
<@if(eq(context.project.mobile,"expo"))>
|
||||
android = {
|
||||
@@ -53,47 +44,65 @@
|
||||
}
|
||||
];
|
||||
};
|
||||
<@if(eq(context.project.mobile,"expo"))>
|
||||
enterShell = ''
|
||||
export LD_LIBRARY_PATH=$ANDROID_HOME/emulator/lib64:$LD_LIBRARY_PATH
|
||||
scripts.create-avd.exec = ''
|
||||
if [ ! -f .avd-created ]; then
|
||||
avdmanager create avd
|
||||
-n "Pixel_5_API34"
|
||||
-k "system-images;android-34;google_apis_playstore;x86_64"
|
||||
-d "pixel_5"
|
||||
fi
|
||||
'';
|
||||
tasks.'<@var(context.project.name)>:create-avd'.exec = ''
|
||||
avdmanager create avd
|
||||
-n "Pixel_5_API34"
|
||||
-k "system-images;android-34;google_apis_playstore;x86_64"
|
||||
-d "pixel_5"
|
||||
'';
|
||||
tasks.'<@var(context.project.name)>:run-emulator' = {
|
||||
exec = "emulator -avd Pixel_5_API34";
|
||||
after = [ "<@var(context.project.name)>:create-avd" ]
|
||||
};
|
||||
<@endif>
|
||||
processes = {
|
||||
<@if(neq(context.project.frontend,"none"))>
|
||||
bundev = {
|
||||
exec = "bun dev";
|
||||
cwd = "./apps/web";
|
||||
after= ["devenv:processes:air@started"];
|
||||
};
|
||||
<@endif>
|
||||
air = {
|
||||
exec = "air";
|
||||
cwd = "./services/api";
|
||||
after = ["devenv:processes:postgres"];
|
||||
};
|
||||
protowatcher = {
|
||||
exec = "watchexec -r -e proto buf generate";
|
||||
exec = "buf generate";
|
||||
cwd = "./packages/proto";
|
||||
watch = {
|
||||
paths = [ ./ ];
|
||||
extensions = [ "proto" ];
|
||||
};
|
||||
after= ["devenv:processes:air@started"];
|
||||
};
|
||||
protojswatcher = {
|
||||
exec = "watchexec -e js,ts -w ./packages/rpc/src -r bun run ./scripts/gen-rpc-index.ts";
|
||||
cwd = "./";
|
||||
after= ["devenv:processes:protowatcher@started"];
|
||||
exec = "bun run ./scripts/gen-rpc-index.ts";
|
||||
cwd = "./packages/rpc/src";
|
||||
watch = {
|
||||
paths = [ ./ ];
|
||||
extensions = ["js","ts"];
|
||||
};
|
||||
after= ["devenv:processes:protowatcher@after"];
|
||||
};
|
||||
<@if(eq(context.project.mobile,"expo"))>
|
||||
createavd = {
|
||||
exec = "create-avd"
|
||||
};
|
||||
emulator = {
|
||||
exec = "emulator -avd Pixel_5_API34"
|
||||
after = ["devenv:processes:createavd@after"]
|
||||
};
|
||||
bundev = {
|
||||
exec = "bunx expo run:android";
|
||||
cwd = "./apps/mobile";
|
||||
after= ["devenv:processes:emulator@started"];
|
||||
};
|
||||
<@endif>
|
||||
sqlwatcher = {
|
||||
exec = "watchexec -w ./db/migrations -w ./db/query -r -e sql sqlc generate";
|
||||
cwd = "./services/api";
|
||||
after= ["devenv:processes:air@started"];
|
||||
};
|
||||
<@if(eq(context.project.mobile,"expo"))>
|
||||
emulator = {
|
||||
exec
|
||||
}
|
||||
<@endif>
|
||||
|
||||
};
|
||||
}
|
||||
|
||||