packages feed

yesod-vite 0.1.0.0 → 0.2.0.0

raw patch · 3 files changed

+83/−35 lines, 3 filesdep ~aesondep ~basedep ~bytestringPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: aeson, base, bytestring, containers, text

API changes (from Hackage documentation)

- Yesod.Vite: instance GHC.Generics.Generic Yesod.Vite.ViteManifestChunk
- Yesod.Vite: instance GHC.Show.Show Yesod.Vite.ViteManifestChunk
+ Yesod.Vite: instance GHC.Internal.Generics.Generic Yesod.Vite.ViteManifestChunk
+ Yesod.Vite: instance GHC.Internal.Show.Show Yesod.Vite.ViteManifestChunk
- Yesod.Vite: class (Yesod site) => YesodVite site
+ Yesod.Vite: class Yesod site => YesodVite site

Files

+ readme.md view
@@ -0,0 +1,42 @@+# `yesod-vite`++Yesod 💜 Vite.+++This package provides an implement for the `yesod` web framework to connect with vite.+Vite is a modern build tool used across stacks.++## Quick Start+The assumption here is that your setup is similar to the default Yesod scaffold.+You will need to have installed both `yesod-static` and `yesod-vite` for this to work.+In addition, you will need the static subsite configured, as the route constructor is required.+- Run `npm init -y` or the equivalent for your build tool.+- Run `npm i -D vite` or the equivalent for your build tool.+- Create a `vite.config.js` to include the following:+```javascript+import { defineConfig } from "vite";+import * as path from "node:path";+export default defineConfig({+  plugins: [],+  base: "/static/",+  build: {+    outDir: path.resolve("./static"),+    manifest: "manifest.json",+    rollupOptions: {+      input: path.resolve("./assets/src/app.js"),+    },+  },+});+```+- Install and configure "Yesod.Static" for your application.+- Setup 'YesodVite' as the following:+```haskell+instance YesodVite App where+  viteBuildDir :: app -> IO FilePath+  vitebuildDir app = return $ appStaticDir app+  viteInDev :: app -> IO Bool+  viteinDev app = return . const True+  viteRoute :: Route Static -> Route site+  viteRoute = StaticR+```+- Add the `viteAsset \<asset-name\>` to your default layout.
src/Yesod/Vite.hs view
@@ -20,44 +20,45 @@ -- The assumption here is that your setup is similar to the default Yesod scaffold. -- You will need to have installed both @yesod-static@ and @yesod-vite@ for this to work. -- In addition, you will need the static subsite configured, as the route constructor is required.+-- -- - Run @npm init -y@ or the equivalent for your build tool. -- -- - Run @npm i -D vite@ or the equivalent for your build tool. -- -- - Create a @vite.config.js@ to include the following: ----- @--- import { defineConfig } from "vite";--- import * as path from "node:path"; ----- export default defineConfig({---   plugins: [],---   base: "/static/",---   build: {---     outDir: path.resolve("./static"),---     manifest: "manifest.json",---     rollupOptions: {---       input: path.resolve("./assets/src/app.js"),---     },---   },--- });--- @+-- > import { defineConfig } from "vite";+-- > import * as path from "node:path";+-- >+-- > export default defineConfig({+-- >   plugins: [],+-- >   base: "static",+-- >   build: {+-- >     outDir: path.resolve("./static"),+-- >     manifest: "manifest.json",+-- >     rollupOptions: {+-- >       input: path.resolve("./assets/src/app.js"),+-- >     },+-- >   },+-- > }); --+-- -- - Install and configure "Yesod.Static" for your application. -- -- - Setup 'YesodVite' as the following: ----- @--- instance YesodVite App where---   viteBuildDir :: app -> IO FilePath---   vitebuildDir app = return $ appStaticDir app -----   viteInDev :: app -> IO Bool---   viteinDev app = return . const True+-- > instance YesodVite App where+-- >   viteBuildDir :: app -> IO FilePath+-- >   vitebuildDir app = return $ appStaticDir app+-- >+-- >   viteInDev :: app -> IO Bool+-- >   viteinDev app = return . const True+-- >+-- >   viteRoute :: Route Static -> Route site+-- >   viteRoute = StaticR -----   viteRoute :: Route Static -> Route site---   viteRoute = StaticR--- @ -- -- - Add the @viteAsset \<asset-name\>@ to your default layout. module Yesod.Vite@@ -65,6 +66,8 @@     decodeManifest,     gatherAllCSS,     gatherAllModules,+    ViteManifestChunk,+    ViteManifest,   ) where 
yesod-vite.cabal view
@@ -20,7 +20,7 @@ -- PVP summary:     +-+------- breaking API changes --                  | | +----- non-breaking API additions --                  | | | +--- code changes with no API change-version:            0.1.0.0+version:            0.2.0.0  -- A short (one-line) description of the package. synopsis:           An integration of vitejs with Yesod@@ -43,13 +43,16 @@ -- An email address to which users can send suggestions, bug reports, and patches. maintainer:         ian.kollipara@gmail.com +bug-reports:        https://github.com/ikollipara/yesod-vite/issues -- A copyright notice. copyright:          Ian Kollipara, 2026 category:           Web, Yesod build-type:         Simple  -- Extra doc files to be distributed with the package, such as a CHANGELOG or a README.-extra-doc-files:    CHANGELOG.md+extra-doc-files:+    CHANGELOG.md,+    readme.md  -- Extra source files to be distributed with the package, such as examples, or a tutorial module. -- extra-source-files:@@ -78,13 +81,13 @@      -- Other library packages from which modules are imported.     build-depends:-        base >=4.18.3.0 && <4.19,-        yesod-core >=1.6.27.0 && <1.7,-        text >=2.0.2 && <2.1,+        base >=4.21 && <4.22,+        yesod-core >= 1.6.27.0 && <1.7,+        text >=2.1 && <2.2,         yesod-static >=1.6.1.0 && <1.7,-        aeson >=2.1.2.1 && <2.2,-        containers >=0.6.7 && <0.7,-        bytestring >=0.11.5.4 && <0.12+        aeson >=2.2 && <2.3,+        containers >=0.7 && <0.8,+        bytestring >=0.12 && <0.13        -- Directories containing source files.@@ -118,13 +121,13 @@      -- Test dependencies.     build-depends:-        base >=4.18.3.0 && <4.19,+        base >=4.21 && <4.22,         yesod-vite,         hspec >=2.11.12 && <2.12,         HUnit >=1.6.2.0 && <1.7,-        text >=2.0.2 && <2.1,+        text >=2.1 && <2.2,         yesod-test >=1.6.16 && <1.7,         yesod-static >=1.6.1.0 && <1.7,         yesod-core >=1.6.27.0 && <1.7,-        bytestring >=0.11.5.4 && <0.12,+        bytestring >=0.12 && <0.13,         blaze-html >=0.9.2.0 && <0.10