Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .tiltignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
dist/
.astro/
agent/node_modules/
*.log
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode"],
"recommendations": ["astro-build.astro-vscode", "tilt-dev.tiltfile"],
"unwantedRecommendations": []
}
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
"fileMatch": ["**/src/content/docs/**/_category.json"],
"url": "./src/schemas/category.schema.json"
}
]
],
"files.associations": {
"Tiltfile": "tiltfile"
}
}
124 changes: 124 additions & 0 deletions Tiltfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# Docs-v2 Development Environment

# --- Guard: vale required for writing check ---
_vale_installed = str(local("which vale 2>/dev/null || echo ''", quiet=True)).strip() != ""

local_resource(
"install",
cmd="bun install",
dir=".",
labels=["setup"],
)

local_resource(
"dev",
serve_cmd="bun dev",
serve_dir=".",
resource_deps=["install"],
links=["http://localhost:4321"],
labels=["services"],
)

local_resource(
"preview",
cmd="bun run build",
serve_cmd="bun preview",
serve_dir=".",
resource_deps=["install"],
Comment thread
adkah marked this conversation as resolved.
auto_init=False,
links=["http://localhost:4322"],
Comment thread
ptlc8 marked this conversation as resolved.
labels=["services"],
)

local_resource(
"build",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion(non-blocking): your "build" resource doesnt seem useful, it's never used as a dep and the "preview" resource is already building
You could:

  • remove the "build" resource
  • or don't build in the "preview" resource and set "build" as a dep of "preview"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or don't build in the "preview" resource and set "build" as a dep of "preview"

This is what I wanted originally, but build was never running when I ran preview because build has auto_init=False - I'd have to manually run both

If it would be better to auto-init build I can do that, or just remove it and keep the build in preview?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This behaviour is really weird, I don't know why it does this
You can maybe remove the build and just keep preview, but that's ok actually

cmd="bun run build",
dir=".",
resource_deps=["install"],
auto_init=False,
labels=["build"],
)

local_resource(
"check",
cmd="bun run check",
dir=".",
resource_deps=["install"],
auto_init=False,
labels=["checks"],
)

local_resource(
"check:format",
cmd="bun run check:format",
dir=".",
resource_deps=["install"],
auto_init=False,
labels=["checks"],
)

local_resource(
"check:lint",
cmd="bun run check:lint",
dir=".",
resource_deps=["install"],
auto_init=False,
labels=["checks"],
)

local_resource(
"check:type",
cmd="bun run check:type",
dir=".",
resource_deps=["install"],
auto_init=False,
labels=["checks"],
)

local_resource(
"check:links",
cmd="bun run check:link",
dir=".",
resource_deps=["install"],
auto_init=False,
labels=["checks"],
)

if _vale_installed:
local_resource(
"check:writing",
cmd="bun run check:writing",
dir=".",
resource_deps=["install"],
auto_init=False,
labels=["checks"],
)
else:
warn("vale not found in PATH. 'check:writing' resource disabled. See https://vale.sh/docs/vale-cli/installation/ for install instructions.")

local_resource(
"fix",
cmd="bun run fix",
dir=".",
resource_deps=["install"],
auto_init=False,
labels=["utils"],
)

local_resource(
"fix:format",
cmd="bun run fix:format",
dir=".",
resource_deps=["install"],
auto_init=False,
labels=["utils"],
)

local_resource(
"fix:lint",
cmd="bun run fix:lint",
dir=".",
resource_deps=["install"],
auto_init=False,
labels=["utils"],
)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"scripts": {
"dev": "bunx --bun astro dev",
"build": "bunx --bun astro build && npx pagefind --site dist",
"preview": "bunx --bun astro preview",
"preview": "bunx --bun astro preview --port 4322",
"astro": "bunx --bun astro",
"check": "bun run --parallel check:format check:lint check:type check:writing check:link",
"check:format": "bun run --parallel check:format:oxfmt check:format:biome",
Expand Down
Loading