Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Bug report
about: Report a reproducible problem in Rebase
title: "bug: "
labels: bug
---

## What happened?

## Reproduction

```rebase
<!-- minimal example -->
```

## Expected behavior

## Environment

- Rebase version:
- Node version:
- Browser:
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Feature request
about: Suggest an improvement to Rebase
title: "feat: "
labels: enhancement
---

## Problem

## Proposed API or syntax

```rebase
<!-- example -->
```

## Alternatives considered
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CI

on:
push:
pull_request:

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 22
- run: npm test
- run: npm run build
20 changes: 20 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# AGENTS.md

## Project model

Rebase is a compiler-first JavaScript framework. Keep the compiler and runtime dependency-free and browser-oriented.

## Structure

- `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

## Development rules

- 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.
7 changes: 7 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Code of Conduct

We expect contributors to be respectful, constructive, and inclusive. Harassment, discrimination, personal attacks, and deliberately disruptive behavior are not acceptable.

Maintainers may remove comments, reject contributions, or restrict participation when behavior violates this code of conduct.

For serious incidents, use the private contact method described in `SECURITY.md`.
21 changes: 21 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Contributing to Rebase

## Development

Rebase requires a current Node.js release with ESM support.

```bash
npm test
npm run build
```

## Pull requests

- Keep changes focused.
- Add tests for behavior changes and bug fixes.
- Do not commit generated `dist` output.
- Explain syntax or public API changes in the pull request.

## Rebase syntax

A `.rebase` file may use `<script>`, `<template>`, and `<style>` sections in any order. Templates support `{name}`, `{#if}`, `{:elif}`, `{:else}`, `{#each}`, `on:*` event attributes, and reusable component tags.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Intense

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
11 changes: 11 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Security Policy

## Reporting a vulnerability

Do not publish exploit details in a public issue. Contact the repository owner privately through the contact method available on the GitHub profile.

Include the affected version, a minimal reproduction, impact, and relevant logs.

## Scope

The compiler intentionally generates JavaScript from project source. Do not compile untrusted `.rebase` files in a privileged environment.
9 changes: 9 additions & 0 deletions packages/compiler/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "@rebasejs/compiler",
"version": "0.3.0",
"type": "module",
"bin": {
"rebase": "./src/cli.js"
},
"exports": "./src/compiler.js"
}
23 changes: 23 additions & 0 deletions packages/compiler/test/compiler.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import test from "node:test";
import assert from "node:assert/strict";
import { compile } from "../src/compiler.js";

test("compiles Vue-style sections in any order", () => {
const result = compile(`
<style>.app { color: red; }</style>
<template><p>{message}</p></template>
<script>const message = "hello";</script>
`);
assert.equal(result.template, "<p>{message}</p>");
assert.equal(result.style, ".app { color: red; }");
assert.match(result.code, /return \\{ message \\};/);
});

test("rewrites .rebase imports and custom components", () => {
const result = compile(`
<script>import Card from "./Card.rebase";</script>
<template><Card title="Hello" /></template>
`);
assert.match(result.code, /from "\\.\\/Card\\.js"/);
assert.match(result.code, /data-component=\\\"Card\\\"/);
});
6 changes: 6 additions & 0 deletions packages/runtime/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "@rebasejs/runtime",
"version": "0.3.0",
"type": "module",
"exports": "./src/index.js"
}
Loading
Loading