diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 0000000..f1771fe --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,61 @@ +name: Deploy Documentation + +on: + push: + branches: + - main + paths: + - 'docs/**' + - '.github/workflows/deploy-docs.yml' + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build documentation + run: pnpm docs:build + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: docs/.vitepress/dist + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + needs: build + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/README.md b/README.md index 7ee02b5..d34f18e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# Volt.js +# VoltX.js + +> ⚠️ **Pre-release Software**: VoltX.js is in active development. Breaking changes are expected until v1.0. Use in production at your own risk. ## Philosophy/Goals diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 012f846..237c89a 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -5,8 +5,9 @@ import { u } from "./utils"; * @see https://vitepress.dev/reference/site-config */ export default defineConfig({ - title: "Volt.js", + title: "VoltX.js", description: "A reactive, hypermedia framework.", + base: "/volt/", appearance: "dark", themeConfig: { nav: [{ text: "Home", link: "/" }, { text: "Overview", link: "/overview" }, { text: "CSS", link: "/css/volt-css" }], diff --git a/docs/api/binder.md b/docs/api/binder.md index 5efbc86..6306488 100644 --- a/docs/api/binder.md +++ b/docs/api/binder.md @@ -5,11 +5,11 @@ updated: 2025-10-18 # binder -Binder system for mounting and managing Volt.js bindings +Binder system for mounting and managing VoltX.js bindings ## mount -Mount Volt.js on a root element and its descendants and binds all data-volt-* attributes to the provided scope. +Mount VoltX.js on a root element and its descendants and binds all data-volt-* attributes to the provided scope. Returns a cleanup function to unmount and dispose all bindings. ```typescript diff --git a/docs/api/events.md b/docs/api/events.md index 8a28cc7..fce5cb9 100644 --- a/docs/api/events.md +++ b/docs/api/events.md @@ -5,7 +5,7 @@ updated: 2025-10-18 # Event Handling -Volt.js provides declarative event handling through `data-volt-on-*` attributes with automatic access to special scoped references. +VoltX provides declarative event handling through `data-volt-on-*` attributes with automatic access to special scoped references. ## Event Binding Syntax @@ -35,7 +35,7 @@ The `$event` reference provides access to the native browser event object. ## Event Types -Volt.js aims to support all standard DOM events through `data-volt-on-*`: +VoltX.js aims to support all standard DOM events through `data-volt-on-*`: **Mouse Events:** @@ -66,7 +66,7 @@ Volt.js aims to support all standard DOM events through `data-volt-on-*`: ## Implementation Details -When an event handler is bound, Volt.js: +When an event handler is bound, VoltX.js: 1. Creates a new scope that extends the component scope 2. Injects `$el` (the bound element) and `$event` (the event object) into this scope diff --git a/docs/api/lifecycle.md b/docs/api/lifecycle.md index 1007a98..00f7fc3 100644 --- a/docs/api/lifecycle.md +++ b/docs/api/lifecycle.md @@ -5,7 +5,7 @@ updated: 2025-10-18 # lifecycle -Global lifecycle hook system for Volt.js +Global lifecycle hook system for VoltX.js Provides beforeMount, afterMount, beforeUnmount, and afterUnmount hooks ## registerGlobalHook diff --git a/docs/api/plugin.md b/docs/api/plugin.md index 66f005c..24e1bf6 100644 --- a/docs/api/plugin.md +++ b/docs/api/plugin.md @@ -5,12 +5,12 @@ updated: 2025-10-18 # plugin -Plugin system for extending Volt.js with custom bindings +Plugin system for extending VoltX.js with custom bindings ## registerPlugin Register a custom plugin with a given name. -Plugins extend Volt.js with custom data-volt-* attribute bindings. +Plugins extend VoltX.js with custom data-volt-* attribute bindings. ```typescript export function registerPlugin(name: string, handler: PluginHandler): void diff --git a/docs/bindings.md b/docs/bindings.md index ee92283..83d93d2 100644 --- a/docs/bindings.md +++ b/docs/bindings.md @@ -1,4 +1,4 @@ -# Volt Bindings +# VoltX Bindings Bindings connect reactive state to the DOM using `data-volt-*` attributes. Each binding evaluates expressions and updates the DOM when dependencies change. @@ -56,7 +56,7 @@ The `data-volt-class` binding toggles CSS classes based on an object expression: Each key in the object is a class name. When the corresponding value is truthy, the class is added; when falsy, the class is removed. -Class names with hyphens or spaces must be quoted. The binding preserves existing classes not managed by Volt.js. +Class names with hyphens or spaces must be quoted. The binding preserves existing classes not managed by VoltX.js. ## Event Bindings @@ -372,7 +372,8 @@ Signal changes update the URL, and URL changes (back/forward navigation) update Register custom bindings for domain-specific behavior using the plugin API: ```js -import { registerPlugin } from '@voltjs/volt'; +import { registerPlugin } from 'voltx.js'; +// or: import { registerPlugin } from '@voltx/core'; registerPlugin('tooltip', (ctx) => { const message = ctx.evaluate(ctx.element.getAttribute('data-volt-tooltip')); diff --git a/docs/css/volt-css.md b/docs/css/volt-css.md index a8c41c6..d3ac89b 100644 --- a/docs/css/volt-css.md +++ b/docs/css/volt-css.md @@ -335,7 +335,7 @@ Respecting user preferences improves accessibility and reduces eye strain. Autom ## License -Part of the Volt.js project. MIT licensed. +Part of the VoltX project. MIT licensed. ## Further Reading diff --git a/docs/expressions.md b/docs/expressions.md index be8cae2..d704ce9 100644 --- a/docs/expressions.md +++ b/docs/expressions.md @@ -1,6 +1,6 @@ # Expression Evaluation -Volt.js evaluates JavaScript-like expressions in HTML templates using a sandboxed recursive descent parser. +VoltX.js evaluates JavaScript-like expressions in HTML templates using a sandboxed recursive descent parser. The evaluator is CSP-compliant and does not use `eval()` or `new Function()`. ## Supported Syntax diff --git a/docs/index.md b/docs/index.md index 0452c2f..ba16786 100644 --- a/docs/index.md +++ b/docs/index.md @@ -3,9 +3,12 @@ layout: home hero: - name: "Volt.js" - text: "A reactive, hypermedia framework." - tagline: A reactive, hypermedia framework. + name: "VoltX.js" + # text: "A reactive, hypermedia framework." + tagline: | + A reactive, hypermedia framework. + + ⚠️ Pre-release software: Breaking changes expected actions: - theme: brand text: Overview diff --git a/docs/installation.md b/docs/installation.md index 53fac3c..6f4a432 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -1,12 +1,10 @@ # Installation - - -Volt.js can be installed via CDN or package manager. Choose the method that best fits your project setup. +VoltX.js can be installed via CDN or package manager. Choose the method that best fits your project setup. ## CDN (unpkg) -The simplest way to get started is loading Volt.js directly from a CDN. This approach requires no build tools and works immediately in any HTML file. +The simplest way to get started is loading VoltX.js directly from a CDN. This approach requires no build tools and works immediately in any HTML file. ### ES Modules @@ -14,7 +12,7 @@ Use the module build for modern browsers with ES module support: ```html ``` @@ -23,21 +21,33 @@ You can optionally pin to a specific version: ```html ``` ## Package Manager -For applications using node based tools, install Volt.js via npm or similar: +For applications using node based tools, install VoltX.js via npm or JSR: + +### npm + +```bash +npm install voltx.js +``` + +```bash +pnpm add voltx.js +``` + +### JSR (Deno, Node.js, Bun) ```bash -npm install @voltjs/volt +npx jsr add @voltx/core ``` ```bash -pnpm add @voltjs/volt +deno add jsr:@voltx/core ``` ### Module Imports @@ -45,8 +55,11 @@ pnpm add @voltjs/volt Import only the functions you need to minimize bundle size: ```js -import { charge, registerPlugin } from '@voltjs/volt'; -import { persistPlugin } from '@voltjs/volt/plugins'; +// npm +import { charge, registerPlugin } from 'voltx.js'; + +// JSR +import { charge, registerPlugin } from '@voltx/core'; registerPlugin('persist', persistPlugin); charge(); @@ -56,7 +69,7 @@ The framework uses tree-shaking to eliminate unused code when bundled with moder ## TypeScript -Volt.js is written in TypeScript and includes complete type definitions. +VoltX.js is written in TypeScript and includes complete type definitions. TypeScript users get automatic type inference for: @@ -77,7 +90,7 @@ For applications that can be built entirely in HTML, use the declarative approac - Volt.js App + VoltX.js App
@@ -86,7 +99,7 @@ For applications that can be built entirely in HTML, use the declarative approac
@@ -101,7 +114,7 @@ For applications requiring initialization logic, use the programmatic API with ` ```html ``` @@ -129,12 +143,11 @@ See the [Server-Side Rendering & Lifecycle](./lifecycle) documentation for compl ## Plugin Setup -Volt.js includes several built-in plugins that must be registered before use: +VoltX.js includes several built-in plugins that must be registered before use: ```html @@ -159,8 +159,7 @@ Use the persist plugin to save the count across page reloads: