generated from alecodes/base-template
chore: update dev environment
This commit is contained in:
parent
f5e398c933
commit
9246964edb
5 changed files with 84 additions and 26 deletions
8
.idea/runConfigurations/Dev.xml
generated
Normal file
8
.idea/runConfigurations/Dev.xml
generated
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Dev" type="CompoundRunConfigurationType">
|
||||
<toRun name="Run compendium" targetId="RsBuildProfile:dev" type="CargoCommandRunConfiguration" />
|
||||
<toRun name="dev-database-pg" type="docker-deploy" />
|
||||
<toRun name="Vite Dev Server" type="js.build_tools.npm" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
16
.idea/runConfigurations/Vite_Dev_Server.xml
generated
Normal file
16
.idea/runConfigurations/Vite_Dev_Server.xml
generated
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Vite Dev Server" type="js.build_tools.npm">
|
||||
<package-json value="$PROJECT_DIR$/package.json" />
|
||||
<command value="run" />
|
||||
<scripts>
|
||||
<script value="dev" />
|
||||
</scripts>
|
||||
<node-interpreter value="$USER_HOME$/.bun/bin/bun" />
|
||||
<package-manager value="$USER_HOME$/.bun/bin/bun" />
|
||||
<envs />
|
||||
<EXTENSION ID="com.intellij.lang.javascript.buildTools.npm.rc.StartBrowserRunConfigurationExtension">
|
||||
<browser start="true" url="http://localhost:3000" />
|
||||
</EXTENSION>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
36
.idea/runConfigurations/dev_database_pg.xml
generated
Normal file
36
.idea/runConfigurations/dev_database_pg.xml
generated
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="dev-database-pg" type="docker-deploy" factoryName="docker-image" activateToolWindowBeforeRun="false" server-name="Podman">
|
||||
<deployment type="docker-image">
|
||||
<settings>
|
||||
<option name="imageTag" value="docker.io/library/postgres:latest" />
|
||||
<option name="containerName" value="dev-database-pg" />
|
||||
<option name="envVars">
|
||||
<list>
|
||||
<DockerEnvVarImpl>
|
||||
<option name="name" value="POSTGRES_PASSWORD" />
|
||||
<option name="value" value="password" />
|
||||
</DockerEnvVarImpl>
|
||||
</list>
|
||||
</option>
|
||||
<option name="portBindings">
|
||||
<list>
|
||||
<DockerPortBindingImpl>
|
||||
<option name="containerPort" value="5432" />
|
||||
<option name="hostPort" value="5432" />
|
||||
</DockerPortBindingImpl>
|
||||
</list>
|
||||
</option>
|
||||
<option name="showCommandPreview" value="true" />
|
||||
<option name="volumeBindings">
|
||||
<list>
|
||||
<DockerVolumeBindingImpl>
|
||||
<option name="containerPath" value="/var/lib/postgresql/data" />
|
||||
<option name="hostPath" value="dev-database-pg-data" />
|
||||
</DockerVolumeBindingImpl>
|
||||
</list>
|
||||
</option>
|
||||
</settings>
|
||||
</deployment>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
43
package.json
43
package.json
|
|
@ -1,22 +1,25 @@
|
|||
{
|
||||
"name": "compendium",
|
||||
"module": "index.ts",
|
||||
"version": "0.1.0",
|
||||
"devDependencies": {
|
||||
"@alecodes/tmpl-build-and-load": "^0.1.3",
|
||||
"@biomejs/biome": "1.9.4",
|
||||
"@types/bun": "^1.2.10",
|
||||
"sass-embedded": "^1.86.3",
|
||||
"vite": "^6.3.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "^5.7.3"
|
||||
},
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@mini-strap/core": "^0.1.2",
|
||||
"@picocss/pico": "^2.1.1",
|
||||
"feather-icons": "^4.29.2",
|
||||
"htmx.org": "2.0.4"
|
||||
}
|
||||
"name": "compendium",
|
||||
"module": "index.ts",
|
||||
"version": "0.1.0",
|
||||
"scripts": {
|
||||
"dev": "vite"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@alecodes/tmpl-build-and-load": "^0.1.3",
|
||||
"@biomejs/biome": "1.9.4",
|
||||
"@types/bun": "^1.2.10",
|
||||
"sass-embedded": "^1.86.3",
|
||||
"vite": "^6.3.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "^5.7.3"
|
||||
},
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@mini-strap/core": "^0.1.2",
|
||||
"@picocss/pico": "^2.1.1",
|
||||
"feather-icons": "^4.29.2",
|
||||
"htmx.org": "2.0.4"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use axum::response::Html;
|
|||
use minijinja::{path_loader, Environment};
|
||||
use minijinja_autoreload::AutoReloader;
|
||||
use serde::Serialize;
|
||||
use vite_rs::{ViteFile, ViteProcess};
|
||||
use vite_rs::ViteFile;
|
||||
|
||||
#[derive(vite_rs::Embed)]
|
||||
#[root = "."]
|
||||
|
|
@ -15,7 +15,6 @@ struct Static;
|
|||
|
||||
pub struct Assets {
|
||||
templates: Environment<'static>,
|
||||
_guard: Option<ViteProcess>,
|
||||
_reloader: Option<AutoReloader>,
|
||||
}
|
||||
|
||||
|
|
@ -23,7 +22,6 @@ impl Clone for Assets {
|
|||
fn clone(&self) -> Self {
|
||||
Self {
|
||||
templates: self.templates.clone(),
|
||||
_guard: None,
|
||||
_reloader: None,
|
||||
}
|
||||
}
|
||||
|
|
@ -34,13 +32,11 @@ impl Assets {
|
|||
let mut templates = Environment::new();
|
||||
load_functions(&mut templates);
|
||||
templates.set_loader(minijinja::path_loader("frontend/templates"));
|
||||
let mut _guard = None;
|
||||
let mut _reloader = None;
|
||||
|
||||
// Load in dev mode
|
||||
#[cfg(debug_assertions)]
|
||||
{
|
||||
_guard = Static::start_dev_server(true);
|
||||
_reloader = Some(AutoReloader::new(|notifier| {
|
||||
let template_path = "frontend/templates";
|
||||
let mut env = Environment::new();
|
||||
|
|
@ -60,7 +56,6 @@ impl Assets {
|
|||
|
||||
Self {
|
||||
templates,
|
||||
_guard,
|
||||
_reloader,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue