Feat/create vite plugin - #35
Draft
jp-knj wants to merge 7 commits into
Draft
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.