Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
bbca71c
feat: add rebase core package
intensed-dev Sep 26, 2026
984ed1c
feat: add extensible non-invasive JavaScript core
intensed-dev Sep 26, 2026
2ac5a82
refactor: expose core through public package
intensed-dev Sep 26, 2026
30691be
refactor: update public package metadata
intensed-dev Sep 26, 2026
899e36c
docs: redefine Rebase as a non-invasive JavaScript layer
intensed-dev Sep 26, 2026
0c57a63
refactor: update project metadata
intensed-dev Sep 26, 2026
f653f4d
feat: add non-invasive Svelte adapter
intensed-dev Sep 26, 2026
88c1343
feat: add non-invasive Vue adapter
intensed-dev Sep 26, 2026
4febd9a
feat: add non-invasive React adapter
intensed-dev Sep 26, 2026
7156075
test: cover plugin API and framework compatibility
intensed-dev Sep 26, 2026
686968e
feat: add host-aware source transformation
intensed-dev Sep 26, 2026
e1f10a6
feat: export framework adapters
intensed-dev Sep 26, 2026
1fe488f
feat: add adapter package metadata
intensed-dev Sep 26, 2026
667c2ba
refactor: remove obsolete framework runtime
intensed-dev Sep 26, 2026
e083d89
refactor: remove obsolete rebase config
intensed-dev Sep 26, 2026
4cf0f68
refactor: remove obsolete framework code
intensed-dev Sep 26, 2026
1f809de
refactor: remove obsolete framework code
intensed-dev Sep 26, 2026
a10f71f
refactor: remove obsolete framework code
intensed-dev Sep 26, 2026
074daa4
refactor: remove obsolete framework code
intensed-dev Sep 26, 2026
f08c64c
fix: replace parser with stable JavaScript core
intensed-dev Sep 26, 2026
47416ac
chore: update test script and version
intensed-dev Sep 26, 2026
1baaa9a
Delete packages/compiler directory
intensed-dev Sep 26, 2026
2920559
Delete packages/runtime directory
intensed-dev Sep 26, 2026
348d85b
Delete Roadmap.md
intensed-dev Sep 26, 2026
ddb4605
Delete AGENTS.md
intensed-dev Sep 26, 2026
18eaf31
docs: prepare beta README
intensed-dev Sep 26, 2026
e3a41ce
chore: prepare beta release structure
intensed-dev Sep 26, 2026
685f16d
chore: prepare beta release structure
intensed-dev Sep 26, 2026
f345817
chore: prepare beta release structure
intensed-dev Sep 26, 2026
20b4c6b
chore: prepare beta release structure
intensed-dev Sep 26, 2026
73fc7f9
chore: prepare beta release structure
intensed-dev Sep 26, 2026
cacdd92
chore: prepare beta release structure
intensed-dev Sep 26, 2026
9fb56f2
chore: prepare beta release structure
intensed-dev Sep 26, 2026
bee3578
docs: add beta roadmap
intensed-dev Sep 26, 2026
ef8b619
docs: add repository agent guidance
intensed-dev Sep 26, 2026
0541b53
Update test script to run all test files
intensed-dev Sep 26, 2026
aedb156
Update test script to target core package tests
intensed-dev Sep 26, 2026
41b3fca
ci: remove obsolete build step
intensed-dev Sep 26, 2026
942c582
Merge pull request #3 from intensed-dev/rebase-plugin-api
intensed-dev Sep 26, 2026
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
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ jobs:
with:
node-version: 22
- run: npm test
- run: npm run build
61 changes: 48 additions & 13 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,55 @@
# AGENTS.md

## Project model
## Project

Rebase is a compiler-first JavaScript framework. Keep the compiler and runtime dependency-free and browser-oriented.
Rebase is a JavaScript-first, framework-agnostic enhancement layer for the web.

## Structure
Core principles:
1. Rebase adds to existing stacks; it does not replace them.
2. Syntax is opt-in and explicitly registered.
3. Framework-native syntax must never be consumed accidentally.
4. Plugins are first-class extension points.
5. Keep the core small; optional features belong in plugins.
6. Prefer standards-based JavaScript and small dependencies.
7. Document public APIs before calling them stable.

- `packages/compiler` — .rebase parsing, code generation, and CLI
- `packages/runtime` — reactive state, rendering, events, components, and routing
- `packages/rebase` — public package entry point
- `packages/*/test` — Node test suite
## Repository layout

## Development rules
- `packages/core`: core runtime, parser and plugin API.
- `packages/rebase`: user-facing `rebase` package.
- `packages/adapters`: host-framework integration entry points.
- `packages/*/test`: package tests.
- Documentation: https://js-rebase.github.io

- Preserve ESM syntax.
- Do not add a runtime dependency for functionality that can be implemented with platform APIs.
- Keep generated JavaScript readable.
- Add a regression test for compiler/runtime bugs.
- Do not commit generated `dist` output.
## API changes

When changing public behavior:
- update tests;
- update README usage when necessary;
- update ROADMAP.md when scope changes;
- update the documentation site when applicable;
- provide a migration path for breaking plugin changes.

## Plugins

Plugins are independent JavaScript packages and must be explicitly enabled by applications.

Do not add automatic plugin discovery to the core.

Official packages use the `@rebase/*` scope. Community packages should use names such as `rebase-foo` or `@author/rebase-foo`.

Plugins should declare the Rebase version range they support.

## Testing

Run:

```bash
npm test
```

Tests should focus on public behavior rather than private implementation details.

## Releases

Beta releases use `1.0.0-beta.N`. Do not call the API stable until the plugin and adapter contracts are documented.
208 changes: 195 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,208 @@
# Rebase

Rebase is an experimental compiler-first JavaScript framework for building web interfaces.
[![Beta](https://img.shields.io/badge/status-beta-7c3aed.svg)](https://github.com/intensed-dev/code)
[![License](https://img.shields.io/github/license/intensed-dev/code.svg)](LICENSE)
[![Tests](https://img.shields.io/github/actions/workflow/status/intensed-dev/code/ci.yml?label=tests)](https://github.com/intensed-dev/code/actions)

> Build the web. On your terms.
**A JavaScript-first enhancement layer for the web.**

## Status
Rebase adds small, opt-in features to HTML and existing web stacks without trying to become another framework.

Rebase is in early development. The component syntax, compiler, runtime, and public API are experimental.
> **Rebase doesn't replace your stack. It adds to it.**

## Documentation
## What Rebase is

https://rebase.js.org
Rebase is a small runtime and plugin API for extending web markup with explicitly registered syntax.

## Packages
It is designed to work alongside:

- `packages/compiler` — .rebase compiler prototype
- `packages/runtime` — browser runtime
- `packages/rebase` — public package entry
- HTML
- JavaScript
- Svelte
- Vue
- React
- other build systems and frameworks

## License
Rebase only owns syntax that the active Rebase instance explicitly registers. Host-framework syntax is left alone.

MIT
## Installation

### Package

```bash
npm install rebase
```

Then:

```js
import { createRebase } from "rebase";

const rebase = createRebase();

rebase.directive("hello", ({ expression }) =>
`<strong>Hello ${expression}</strong>`
);
```

### Core package

For library authors and integrations:

```bash
npm install @rebase/core
```

### Documentation

Full documentation and API reference:

**https://js-rebase.github.io**

## Syntax

Rebase has three extension points:

| Syntax | Purpose |
| --- | --- |
| `{@name ...}` | Directive |
| `{#name ...}{/name}` | Block |
| `{{ expression }}` | Runtime interpolation |

A plugin registers its own names. Rebase does not reserve arbitrary syntax globally.

Example:

```html
{@icon lucide:arrow-up}

{#feature}
<p>Plugin-provided content.</p>
{/feature}
```

## Plugins

A plugin is just a normal JavaScript package.

```js
export default {
name: "rebase-lucide",

install(rebase) {
rebase.directive("lucide", ({ expression }) => {
// return the generated HTML/SVG
});
}
};
```

Users install plugins separately:

```bash
npm install rebase rebase-lucide
```

and enable them explicitly:

Rebase 0.3 includes reactive blocks, reusable components, and built-in routing.
```js
import { createRebase } from "rebase";
import lucide from "rebase-lucide";

const rebase = createRebase();
rebase.use(lucide);
```

This means a plugin cannot silently change a user's Rebase instance merely by existing in `node_modules`.

## Framework compatibility

Rebase is intentionally non-invasive.

For Svelte, the adapter protects native blocks such as:

- `{#if}`
- `{#each}`
- `{#await}`
- `{#key}`
- `{#snippet}`

The Vue and React adapters provide the same host-aware entry point. Framework-specific source transformations remain the responsibility of the corresponding integration.

## API

The public API is intentionally small:

```js
rebase.expression(name, handler)
rebase.directive(name, handler)
rebase.block(name, handler)
rebase.hook(name, handler)
rebase.use(plugin)
rebase.transform(source, options)
rebase.mount(target, options)
```

Plugin handlers receive a context containing:

```js
{
name,
expression,
body,
scope,
rebase
}
```

## Repository structure

```text
.
├── .github/
│ ├── ISSUE_TEMPLATE/
│ └── workflows/
├── packages/
│ ├── core/
│ │ ├── index.js
│ │ └── test/
│ ├── adapters/
│ │ ├── svelte.js
│ │ ├── vue.js
│ │ └── react.js
│ └── rebase/
│ └── index.js
├── AGENTS.md
├── CONTRIBUTING.md
├── CODE_OF_CONDUCT.md
├── LICENSE
├── README.md
├── ROADMAP.md
├── SECURITY.md
└── package.json
```

## Development

Requirements:

- Node.js 20+
- npm

Run the test suite:

```bash
npm test
```

## Status

**Beta.**

The API is usable for experimentation and plugin development, but minor API changes may still happen before 1.0.

See the [roadmap](ROADMAP.md) and the [documentation](https://js-rebase.github.io).

## License

MIT
87 changes: 87 additions & 0 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Rebase Roadmap

Rebase is a small, framework-agnostic JavaScript enhancement layer.

The roadmap describes direction, not guaranteed release dates.

## Beta

### Core
- [x] Public Rebase API
- [x] Plugin registration
- [x] Expressions, directives and blocks
- [x] Hooks
- [x] Browser mounting
- [x] Async source transformation
- [x] Host-aware syntax protection
- [ ] Nested block parser
- [ ] Diagnostics and useful parser errors
- [ ] Stable public API documentation
- [ ] TypeScript declarations

### Distribution
- [x] `@rebase/core`
- [x] `rebase`
- [x] `@rebase/adapters`
- [x] Consistent beta versions
- [ ] npm release workflow
- [ ] Browser/CDN build
- [ ] ESM/browser compatibility matrix

### Plugins
- [ ] Official plugin specification
- [ ] Plugin naming and compatibility rules
- [ ] Official example plugins
- [ ] Plugin author guide
- [ ] Plugin test utilities
- [ ] Plugin discovery page

### Frameworks
- [x] Svelte host protection
- [x] Svelte adapter entry point
- [x] Vue adapter entry point
- [x] React adapter entry point
- [ ] Build-time Svelte integration
- [ ] Build-time Vue integration
- [ ] Build-time React integration

### Documentation
- [ ] API reference
- [ ] Plugin guide
- [ ] Framework guides
- [ ] Examples
- [ ] Migration guide
- [ ] Versioned documentation

## 1.0

- [ ] Stable parser
- [ ] Stable plugin contract
- [ ] Stable adapter contract
- [ ] CDN/browser distribution
- [ ] TypeScript declarations
- [ ] Security model documentation
- [ ] Performance baseline
- [ ] Automated releases
- [ ] Versioned docs

## Possible future plugins

- icons
- dates and formatting
- i18n
- Markdown
- math
- accessibility helpers
- development diagnostics

These should normally remain plugins rather than becoming core features.

## Non-goals

Rebase is not intended to become:

- a replacement for Svelte, Vue or React
- a full templating language
- a dependency-heavy meta-framework
- a mandatory global syntax standard
13 changes: 0 additions & 13 deletions Roadmap.md

This file was deleted.

Loading
Loading