Skip to content

Feat/create vite plugin - #35

Draft
jp-knj wants to merge 7 commits into
mainfrom
feat/create-vite-plugin
Draft

Feat/create vite plugin#35
jp-knj wants to merge 7 commits into
mainfrom
feat/create-vite-plugin

Conversation

@jp-knj

@jp-knj jp-knj commented Jul 29, 2025

Copy link
Copy Markdown
Member

No description provided.

jp-knj added 7 commits July 29, 2025 01:04
- Create @minimal-astro/vite-plugin package
- Implement vitePluginAstro() with file filtering
- Add transformAstro() for basic AST to HTML transformation
- Configure plugin with enforce: 'pre' and basic HMR support
- Add comprehensive tests for plugin functionality
- Integrate plugin into blog example via vite.config.ts
- Remove index.html, main.js, counter.js, style.css, javascript.svg, vite.svg
- Remove test.astro that was created for testing
- Remove dist directory
- Add minimal placeholder index.html to prevent build errors
- Keep minimal structure with package.json, vite.config.ts, and empty src/ directories
- Add SSR transformation using template literals instead of eval
- Implement middleware for dev server routing (/, /about, etc)
- Support frontmatter execution and expression evaluation
- Create sample pages (index.astro, about.astro)
- Add comprehensive unit and integration tests
- Configure Vite with appType: 'custom' to handle SSR
- Exclude .astro files from Biome linting (syntax not supported)

The implementation separates SSG (html-builder) from SSR concerns
as per the architecture document, avoiding eval/Function constructor
for security.
- Add transformation guard to prevent double transformation
- Handle JSX-like expressions in templates by converting to template literals
- Add @minimal-astro/compiler dependency to blog example
- Fix module resolution issues in test environment
- Configure Vite to use .astro files as entry points instead of index.html
- Add resolveId and load hooks to properly handle .astro file imports

All 19 tests now passing successfully
- Fixed parser to correctly handle HTML_ATTRIBUTE_VALUE tokens
- Removed unnecessary equals sign checking logic
- Attribute values like href='/about' now parse correctly
- All existing tests continue to pass
- Added *.js, *.js.map, *.d.ts, *.d.ts.map patterns to .gitignore for src directories
- Removed all existing tracked build artifacts from packages/*/src/
- These files are generated during build and should not be in version control
- Add proper TypeScript type annotation for importer parameter
- Use path.isAbsolute() for cross-platform absolute path detection
- Consolidate path imports to avoid redundant dynamic imports
- This should fix CI build failures on different platforms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant