raktajs 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,90 +1,124 @@
1
- # rakta
2
-
3
- The core framework package of **Rakta.js** a lightweight, composable
4
- frontend framework on Bun, React, and TypeScript.
5
-
6
- > Small in size. Fierce in speed. Alive in every route.
7
- > Bun in the engine. React at the core. Cirebon in the soul. Garuda in the heart.
8
-
9
- This package is rarely installed directly — most people get it through
10
- [`create-rakta-app`](https://www.npmjs.com/package/create-rakta-app). It is
11
- documented here for contributors and for people building custom tooling on
12
- top of Rakta.js.
13
-
14
- ## What's inside
15
-
16
- | Module | Import | Feature name | Purpose |
17
- | --- | --- | --- | --- |
18
- | Router | `rakta/router` | MendungWeave | File-based route scanning, matching, and manifest generation |
19
- | Components | `rakta/components` | ShrimpStep / TrusmiFrame | `<click to="">` navigation and `<picture path="">` images |
20
- | RPC | `rakta/rpc` | CarubanWire | Type-safe procedure router and client, inspired by tRPC |
21
- | Store | `rakta/store` | — | Lightweight, Zustand-inspired state store using `useSyncExternalStore` |
22
- | Schema | `rakta/schema` | — | Runtime validation with static type inference |
23
- | HTTP | `rakta/http` | PanturaFetch | A small, typed `fetch`-based HTTP client with interceptors |
24
- | SEO | `rakta/seo` | WaliSignal / SunyaragiCrown | Metadata, `<head>` rendering, sitemap, and robots.txt helpers |
25
- | Auto import | `rakta/auto-import` | TrusmiThread | Scans `app/`, `components/`, `lib/` and writes `.rakta/auto-imports.ts` |
26
- | Render | `rakta/render` | NorthCoastFlow | Render mode resolution (CSR / SSR / SSG / CSG / SPA / Hybrid) |
27
- | Forge | `rakta/forge` | CherbonsEngine | Dev server, build, and project inspection |
28
- | Tide | `rakta/tide` | — | Request/response runtime context helpers |
29
- | Config | `rakta/config` | — | `defineConfig` / `loadConfig` for `rakta.config.ts` |
30
-
31
- ## Installation
1
+ # Rakta.js
2
+
3
+ Rakta.js is a lightweight React framework for Bun and TypeScript.
4
+
5
+ **Small in size. Fierce in speed. Alive in every route.**
6
+
7
+ ## Features
8
+
9
+ - File-based routing from the `app/` directory
10
+ - Bun-powered dev server, production build, and start command
11
+ - React 19 client rendering with generated client entrypoints
12
+ - Route manifest generation and route inspection
13
+ - Rendering mode configuration: `csr`, `spa`, `ssr`, `ssg`, `csg`, and `hybrid`
14
+ - SEO config for default title and description
15
+ - Public `favicon.ico` support through `public/favicon.ico`
16
+ - Rakta navigation with `<click to="/path">`
17
+ - Schema validation utilities
18
+ - Type-safe RPC primitives
19
+ - Lightweight store utilities
20
+ - Typed HTTP client helpers
21
+ - PWA helpers for manifest, cache, and service worker building blocks
22
+ - Auto-import scanner and generator
23
+
24
+ ## Create A Project
32
25
 
33
26
  ```bash
34
- bun add rakta
27
+ bun create rakta-app@latest my-app
28
+ cd my-app
29
+ bun install
30
+ bun run dev
35
31
  ```
36
32
 
37
- `rakta` declares `react` and `react-dom` (`>=19.0.0`) as peer dependencies.
33
+ The default starter includes a Rakta welcome screen and ShrimpRun, an offline-browser-game-style starter built with React state and SVG animation.
38
34
 
39
- ## Quick example
35
+ ## CLI
40
36
 
41
- ```ts
42
- import { defineConfig } from "rakta/config";
37
+ ```bash
38
+ rakta dev
39
+ rakta build
40
+ rakta start
41
+ rakta routes
42
+ rakta make page about
43
+ rakta make layout dashboard
44
+ rakta make api users
45
+ rakta imports:generate
46
+ rakta rpc:types
47
+ rakta seo:generate
48
+ rakta doctor
49
+ ```
50
+
51
+ ## Config
43
52
 
44
- export default defineConfig({
45
- appName: "My App",
46
- render: { defaultMode: "csr" },
53
+ ```ts
54
+ import { defineRaktaConfig } from "raktajs";
55
+
56
+ export default defineRaktaConfig({
57
+ appName: "My Rakta App",
58
+ seo: {
59
+ defaultTitle:
60
+ "Rakta.js | Small in size. Fierce in speed. Alive in every route",
61
+ defaultDescription:
62
+ "Built with Rakta.js - Small in size. Fierce in speed. Alive in every route.",
63
+ },
64
+ render: {
65
+ defaultMode: "csr",
66
+ routes: {
67
+ "/": "csr",
68
+ "/docs": "ssg",
69
+ "/dashboard": "csr",
70
+ },
71
+ },
47
72
  });
48
73
  ```
49
74
 
50
- ```tsx
51
- // app/page.tsx
52
- import { Click } from "rakta/components";
53
-
54
- export default function HomePage() {
55
- return (
56
- <main>
57
- <h1>Welcome</h1>
58
- <click to="/about">About</click>
59
- </main>
60
- );
61
- }
75
+ ## App Routes
76
+
77
+ ```txt
78
+ app/
79
+ layout.tsx
80
+ page.tsx
81
+ about/
82
+ page.tsx
83
+ api/
84
+ hello/
85
+ route.ts
62
86
  ```
63
87
 
64
- ## CLI
88
+ ## Public Assets
65
89
 
66
- The `rakta` package also exposes a CLI binary:
90
+ Put static files in `public/`.
67
91
 
68
- ```bash
69
- bun rakta dev
70
- bun rakta build
71
- bun rakta start
72
- bun rakta routes
73
- bun rakta make page about
74
- bun rakta make layout dashboard
75
- bun rakta make api users
76
- bun rakta seo:generate
77
- bun rakta imports:generate
78
- bun rakta rpc:types
79
- bun rakta doctor
92
+ ```txt
93
+ public/
94
+ favicon.ico
80
95
  ```
81
96
 
82
- ## Documentation
97
+ Rakta.js automatically emits:
98
+
99
+ ```html
100
+ <link rel="icon" href="/favicon.ico" sizes="any" />
101
+ ```
83
102
 
84
- Full documentation lives in the repository root under
85
- [`docs/en`](../../docs/en) (English) and [`docs/id`](../../docs/id)
86
- (Bahasa Indonesia).
103
+ ## Package Exports
104
+
105
+ ```txt
106
+ raktajs
107
+ raktajs/components
108
+ raktajs/router
109
+ raktajs/render
110
+ raktajs/config
111
+ raktajs/seo
112
+ raktajs/pwa
113
+ raktajs/rpc
114
+ raktajs/schema
115
+ raktajs/http
116
+ raktajs/store
117
+ raktajs/auto-import
118
+ raktajs/forge
119
+ raktajs/tide
120
+ ```
87
121
 
88
122
  ## License
89
123
 
90
- MIT Rhein Sullivan | Vyagra Nexus
124
+ MIT - Rhein Sullivan | Vyagra Nexus
@@ -1 +1 @@
1
- {"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/cli/dev.ts"],"names":[],"mappings":"AAIA,wBAAsB,UAAU,CAAC,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB3E"}
1
+ {"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/cli/dev.ts"],"names":[],"mappings":"AAIA,wBAAsB,UAAU,CAAC,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiB3E"}
package/dist/cli/rakta.js CHANGED
@@ -800,15 +800,18 @@ import { join as join7 } from "path";
800
800
 
801
801
  // src/render/renderer.ts
802
802
  function buildHtmlShell(options) {
803
+ const title = options.title ?? options.appName;
804
+ const faviconPath = options.faviconPath ?? "/favicon.ico";
805
+ const descriptionMeta = options.description !== undefined ? `<meta name="description" content="${options.description}" />` : "";
803
806
  return `
804
807
  <!DOCTYPE html>
805
808
  <html lang="${options.lang}">
806
809
  <head>
807
810
  <meta charset="UTF-8" />
808
811
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
809
- <title>
810
- ${options.appName}
811
- </title>
812
+ <title>${title}</title>
813
+ ${descriptionMeta}
814
+ <link rel="icon" href="${faviconPath}" sizes="any" />
812
815
  <link rel="stylesheet" href="${options.cssPath}" />
813
816
  </head>
814
817
  <body>
@@ -997,6 +1000,8 @@ async function startDevServer(options) {
997
1000
  timestampMs: Date.now()
998
1001
  }, {
999
1002
  appName: options.appName,
1003
+ title: options.seo.defaultTitle,
1004
+ description: options.seo.defaultDescription,
1000
1005
  scriptPath: "/app.js",
1001
1006
  cssPath: "/app.css",
1002
1007
  lang: "en"
@@ -1032,6 +1037,7 @@ async function devCommand(cwd = process.cwd()) {
1032
1037
  appDir: join8(cwd, config.appDir),
1033
1038
  publicDir: join8(cwd, config.publicDir),
1034
1039
  appName: config.appName,
1040
+ seo: config.seo,
1035
1041
  renderConfig: config.render
1036
1042
  });
1037
1043
  console.log(` Ready at ${server.url}
@@ -1591,6 +1597,8 @@ function createBunAdapter(adapterConfig, renderConfig) {
1591
1597
  timestampMs: runtimeContext.timestampMs
1592
1598
  }, {
1593
1599
  appName: adapterConfig.appName,
1600
+ title: adapterConfig.seo.defaultTitle,
1601
+ description: adapterConfig.seo.defaultDescription,
1594
1602
  scriptPath: "/app.js",
1595
1603
  cssPath: "/app.css",
1596
1604
  lang: "en"
@@ -1632,6 +1640,7 @@ async function startCommand(cwd = process.cwd()) {
1632
1640
  port: projectConfig.port,
1633
1641
  host: projectConfig.server.hostname ?? "0.0.0.0",
1634
1642
  appName: projectConfig.appName,
1643
+ seo: projectConfig.seo,
1635
1644
  appDir: join17(cwd, projectConfig.appDir),
1636
1645
  publicDir: join17(cwd, projectConfig.publicDir),
1637
1646
  outDir: join17(cwd, outputDirectory)
@@ -1768,4 +1777,4 @@ ${BOLD}${RED}Rakta.js error:${RESET} ${errorMessage}
1768
1777
  process.exit(1);
1769
1778
  });
1770
1779
 
1771
- //# debugId=A7E4DE422B721CBF64756E2164756E21
1780
+ //# debugId=E8EBE1B7DAC0DE3364756E2164756E21