moriajs 0.1.0
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 +380 -0
- package/apps/playground/dist/index.d.ts +8 -0
- package/apps/playground/dist/index.d.ts.map +1 -0
- package/apps/playground/dist/index.js +36 -0
- package/apps/playground/dist/index.js.map +1 -0
- package/apps/playground/node_modules/.bin/rimraf +17 -0
- package/apps/playground/node_modules/.bin/rimraf.CMD +12 -0
- package/apps/playground/node_modules/.bin/rimraf.ps1 +41 -0
- package/apps/playground/node_modules/.bin/tsc +17 -0
- package/apps/playground/node_modules/.bin/tsc.CMD +12 -0
- package/apps/playground/node_modules/.bin/tsc.ps1 +41 -0
- package/apps/playground/node_modules/.bin/tsserver +17 -0
- package/apps/playground/node_modules/.bin/tsserver.CMD +12 -0
- package/apps/playground/node_modules/.bin/tsserver.ps1 +41 -0
- package/apps/playground/node_modules/.bin/tsx +17 -0
- package/apps/playground/node_modules/.bin/tsx.CMD +12 -0
- package/apps/playground/node_modules/.bin/tsx.ps1 +41 -0
- package/apps/playground/package.json +25 -0
- package/apps/playground/src/index.ts +41 -0
- package/apps/playground/tsconfig.json +10 -0
- package/package.json +23 -0
- package/packages/auth/dist/index.d.ts +84 -0
- package/packages/auth/dist/index.d.ts.map +1 -0
- package/packages/auth/dist/index.js +78 -0
- package/packages/auth/dist/index.js.map +1 -0
- package/packages/auth/node_modules/.bin/rimraf +17 -0
- package/packages/auth/node_modules/.bin/rimraf.CMD +12 -0
- package/packages/auth/node_modules/.bin/rimraf.ps1 +41 -0
- package/packages/auth/node_modules/.bin/tsc +17 -0
- package/packages/auth/node_modules/.bin/tsc.CMD +12 -0
- package/packages/auth/node_modules/.bin/tsc.ps1 +41 -0
- package/packages/auth/node_modules/.bin/tsserver +17 -0
- package/packages/auth/node_modules/.bin/tsserver.CMD +12 -0
- package/packages/auth/node_modules/.bin/tsserver.ps1 +41 -0
- package/packages/auth/package.json +34 -0
- package/packages/auth/src/index.ts +138 -0
- package/packages/auth/tsconfig.json +10 -0
- package/packages/cli/dist/bin.d.ts +7 -0
- package/packages/cli/dist/bin.d.ts.map +1 -0
- package/packages/cli/dist/bin.js +8 -0
- package/packages/cli/dist/bin.js.map +1 -0
- package/packages/cli/dist/index.d.ts +8 -0
- package/packages/cli/dist/index.d.ts.map +1 -0
- package/packages/cli/dist/index.js +60 -0
- package/packages/cli/dist/index.js.map +1 -0
- package/packages/cli/node_modules/.bin/rimraf +17 -0
- package/packages/cli/node_modules/.bin/rimraf.CMD +12 -0
- package/packages/cli/node_modules/.bin/rimraf.ps1 +41 -0
- package/packages/cli/node_modules/.bin/tsc +17 -0
- package/packages/cli/node_modules/.bin/tsc.CMD +12 -0
- package/packages/cli/node_modules/.bin/tsc.ps1 +41 -0
- package/packages/cli/node_modules/.bin/tsserver +17 -0
- package/packages/cli/node_modules/.bin/tsserver.CMD +12 -0
- package/packages/cli/node_modules/.bin/tsserver.ps1 +41 -0
- package/packages/cli/package.json +33 -0
- package/packages/cli/src/bin.ts +10 -0
- package/packages/cli/src/index.ts +71 -0
- package/packages/cli/tsconfig.json +10 -0
- package/packages/core/dist/app.d.ts +42 -0
- package/packages/core/dist/app.d.ts.map +1 -0
- package/packages/core/dist/app.js +65 -0
- package/packages/core/dist/app.js.map +1 -0
- package/packages/core/dist/config.d.ts +61 -0
- package/packages/core/dist/config.d.ts.map +1 -0
- package/packages/core/dist/config.js +18 -0
- package/packages/core/dist/config.js.map +1 -0
- package/packages/core/dist/index.d.ts +13 -0
- package/packages/core/dist/index.d.ts.map +1 -0
- package/packages/core/dist/index.js +10 -0
- package/packages/core/dist/index.js.map +1 -0
- package/packages/core/dist/plugins.d.ts +38 -0
- package/packages/core/dist/plugins.d.ts.map +1 -0
- package/packages/core/dist/plugins.js +19 -0
- package/packages/core/dist/plugins.js.map +1 -0
- package/packages/core/node_modules/.bin/pino-pretty +17 -0
- package/packages/core/node_modules/.bin/pino-pretty.CMD +12 -0
- package/packages/core/node_modules/.bin/pino-pretty.ps1 +41 -0
- package/packages/core/node_modules/.bin/rimraf +17 -0
- package/packages/core/node_modules/.bin/rimraf.CMD +12 -0
- package/packages/core/node_modules/.bin/rimraf.ps1 +41 -0
- package/packages/core/node_modules/.bin/tsc +17 -0
- package/packages/core/node_modules/.bin/tsc.CMD +12 -0
- package/packages/core/node_modules/.bin/tsc.ps1 +41 -0
- package/packages/core/node_modules/.bin/tsserver +17 -0
- package/packages/core/node_modules/.bin/tsserver.CMD +12 -0
- package/packages/core/node_modules/.bin/tsserver.ps1 +41 -0
- package/packages/core/package.json +35 -0
- package/packages/core/src/app.ts +103 -0
- package/packages/core/src/config.ts +66 -0
- package/packages/core/src/index.ts +14 -0
- package/packages/core/src/plugins.ts +42 -0
- package/packages/core/tsconfig.json +10 -0
- package/packages/create-moria/dist/bin.d.ts +7 -0
- package/packages/create-moria/dist/bin.d.ts.map +1 -0
- package/packages/create-moria/dist/bin.js +8 -0
- package/packages/create-moria/dist/bin.js.map +1 -0
- package/packages/create-moria/dist/index.d.ts +13 -0
- package/packages/create-moria/dist/index.d.ts.map +1 -0
- package/packages/create-moria/dist/index.js +142 -0
- package/packages/create-moria/dist/index.js.map +1 -0
- package/packages/create-moria/node_modules/.bin/rimraf +17 -0
- package/packages/create-moria/node_modules/.bin/rimraf.CMD +12 -0
- package/packages/create-moria/node_modules/.bin/rimraf.ps1 +41 -0
- package/packages/create-moria/node_modules/.bin/tsc +17 -0
- package/packages/create-moria/node_modules/.bin/tsc.CMD +12 -0
- package/packages/create-moria/node_modules/.bin/tsc.ps1 +41 -0
- package/packages/create-moria/node_modules/.bin/tsserver +17 -0
- package/packages/create-moria/node_modules/.bin/tsserver.CMD +12 -0
- package/packages/create-moria/node_modules/.bin/tsserver.ps1 +41 -0
- package/packages/create-moria/package.json +28 -0
- package/packages/create-moria/src/bin.ts +10 -0
- package/packages/create-moria/src/index.ts +168 -0
- package/packages/create-moria/tsconfig.json +10 -0
- package/packages/db/dist/index.d.ts +71 -0
- package/packages/db/dist/index.d.ts.map +1 -0
- package/packages/db/dist/index.js +89 -0
- package/packages/db/dist/index.js.map +1 -0
- package/packages/db/node_modules/.bin/rimraf +17 -0
- package/packages/db/node_modules/.bin/rimraf.CMD +12 -0
- package/packages/db/node_modules/.bin/rimraf.ps1 +41 -0
- package/packages/db/node_modules/.bin/tsc +17 -0
- package/packages/db/node_modules/.bin/tsc.CMD +12 -0
- package/packages/db/node_modules/.bin/tsc.ps1 +41 -0
- package/packages/db/node_modules/.bin/tsserver +17 -0
- package/packages/db/node_modules/.bin/tsserver.CMD +12 -0
- package/packages/db/node_modules/.bin/tsserver.ps1 +41 -0
- package/packages/db/package.json +37 -0
- package/packages/db/src/index.ts +119 -0
- package/packages/db/tsconfig.json +10 -0
- package/packages/renderer/dist/index.d.ts +55 -0
- package/packages/renderer/dist/index.d.ts.map +1 -0
- package/packages/renderer/dist/index.js +85 -0
- package/packages/renderer/dist/index.js.map +1 -0
- package/packages/renderer/node_modules/.bin/rimraf +17 -0
- package/packages/renderer/node_modules/.bin/rimraf.CMD +12 -0
- package/packages/renderer/node_modules/.bin/rimraf.ps1 +41 -0
- package/packages/renderer/node_modules/.bin/tsc +17 -0
- package/packages/renderer/node_modules/.bin/tsc.CMD +12 -0
- package/packages/renderer/node_modules/.bin/tsc.ps1 +41 -0
- package/packages/renderer/node_modules/.bin/tsserver +17 -0
- package/packages/renderer/node_modules/.bin/tsserver.CMD +12 -0
- package/packages/renderer/node_modules/.bin/tsserver.ps1 +41 -0
- package/packages/renderer/package.json +34 -0
- package/packages/renderer/src/index.ts +110 -0
- package/packages/renderer/tsconfig.json +14 -0
- package/packages/ui/dist/index.d.ts +76 -0
- package/packages/ui/dist/index.d.ts.map +1 -0
- package/packages/ui/dist/index.js +176 -0
- package/packages/ui/dist/index.js.map +1 -0
- package/packages/ui/node_modules/.bin/rimraf +17 -0
- package/packages/ui/node_modules/.bin/rimraf.CMD +12 -0
- package/packages/ui/node_modules/.bin/rimraf.ps1 +41 -0
- package/packages/ui/node_modules/.bin/tsc +17 -0
- package/packages/ui/node_modules/.bin/tsc.CMD +12 -0
- package/packages/ui/node_modules/.bin/tsc.ps1 +41 -0
- package/packages/ui/node_modules/.bin/tsserver +17 -0
- package/packages/ui/node_modules/.bin/tsserver.CMD +12 -0
- package/packages/ui/node_modules/.bin/tsserver.ps1 +41 -0
- package/packages/ui/package.json +29 -0
- package/packages/ui/src/index.ts +230 -0
- package/packages/ui/tsconfig.json +16 -0
- package/pnpm-workspace.yaml +3 -0
- package/tsconfig.base.json +25 -0
- package/turbo.json +35 -0
package/README.md
ADDED
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<h1 align="center">🏔️ MoriaJS</h1>
|
|
3
|
+
<p align="center">The full-stack meta-framework for <a href="https://mithril.js.org">Mithril.js</a></p>
|
|
4
|
+
<p align="center">
|
|
5
|
+
<a href="#quick-start">Quick Start</a> ·
|
|
6
|
+
<a href="#packages">Packages</a> ·
|
|
7
|
+
<a href="#documentation">Docs</a> ·
|
|
8
|
+
<a href="#contributing">Contributing</a>
|
|
9
|
+
</p>
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
MoriaJS is a batteries-included full-stack framework built on **[Fastify](https://fastify.dev)** (backend) and **[Mithril.js](https://mithril.js.org)** (frontend), with hybrid SSR/CSR rendering. It provides the structure, tooling, and conventions that Mithril.js has been missing — think Next.js, but for Mithril.
|
|
15
|
+
|
|
16
|
+
## Features
|
|
17
|
+
|
|
18
|
+
- ⚡ **Fastify-powered** — High performance Node.js server with plugin architecture
|
|
19
|
+
- 🎯 **Type-safe** — Written in TypeScript, supports both TS and JS projects
|
|
20
|
+
- 🔄 **Hybrid rendering** — Server-side rendering + client-side hydration via `mithril-node-render`
|
|
21
|
+
- 🗄️ **Database-agnostic** — Kysely ORM with PostgreSQL (production) and SQLite (development) adapters
|
|
22
|
+
- 🔐 **Auth built-in** — JWT + httpOnly cookies with pluggable auth providers
|
|
23
|
+
- 🧩 **Plugin system** — Extend the framework with `defineMoriaPlugin()`
|
|
24
|
+
- 🎨 **UI components** — Toaster notifications, modals, and layout primitives
|
|
25
|
+
- 📦 **Monorepo** — pnpm workspaces + Turborepo for fast, organized development
|
|
26
|
+
|
|
27
|
+
## Status
|
|
28
|
+
|
|
29
|
+
> ⚠️ **Development Status**
|
|
30
|
+
> This package is in early development and undergoing active testing. Expect breaking changes between minor versions. Not recommended for production use yet.
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## Quick Start
|
|
35
|
+
|
|
36
|
+
Create a new MoriaJS project using the interactive scaffolder:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Create a new project
|
|
40
|
+
npx create-moria@latest my-app
|
|
41
|
+
|
|
42
|
+
# Start developing
|
|
43
|
+
cd my-app
|
|
44
|
+
npm install
|
|
45
|
+
npm run dev
|
|
46
|
+
# → Server running at http://localhost:3000
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Development
|
|
50
|
+
|
|
51
|
+
To contribute to MoriaJS or work on the framework itself:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Clone the repo
|
|
55
|
+
git clone https://github.com/guntur-d/moriajs.git
|
|
56
|
+
cd moriajs
|
|
57
|
+
|
|
58
|
+
# Install dependencies
|
|
59
|
+
pnpm install
|
|
60
|
+
|
|
61
|
+
# Build all packages
|
|
62
|
+
pnpm build
|
|
63
|
+
|
|
64
|
+
# Run the playground app
|
|
65
|
+
cd apps/playground
|
|
66
|
+
pnpm dev
|
|
67
|
+
# → Server running at http://localhost:3000
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The monorepo is managed with pnpm workspaces + Turborepo:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
pnpm build # Build all packages
|
|
74
|
+
pnpm turbo typecheck # Type-check all packages
|
|
75
|
+
pnpm turbo dev # Run all dev servers
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The playground app at `apps/playground/` is a working example that imports `@moriajs/core` and starts a Fastify server. Use it as a reference or starting point.
|
|
79
|
+
|
|
80
|
+
## Usage
|
|
81
|
+
|
|
82
|
+
### 1. Create your app
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
// src/index.ts
|
|
86
|
+
import { createApp, defineConfig } from '@moriajs/core';
|
|
87
|
+
|
|
88
|
+
const config = defineConfig({
|
|
89
|
+
server: { port: 3000 },
|
|
90
|
+
database: {
|
|
91
|
+
adapter: 'sqlite',
|
|
92
|
+
filename: './dev.db',
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
const app = await createApp({ config });
|
|
97
|
+
|
|
98
|
+
app.server.get('/', async () => {
|
|
99
|
+
return { message: 'Hello from MoriaJS!' };
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
await app.listen();
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### 2. Configuration
|
|
106
|
+
|
|
107
|
+
Create a `moria.config.ts` in your project root:
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
// moria.config.ts
|
|
111
|
+
import { defineConfig } from '@moriajs/core';
|
|
112
|
+
|
|
113
|
+
export default defineConfig({
|
|
114
|
+
server: {
|
|
115
|
+
port: 3000,
|
|
116
|
+
host: '0.0.0.0',
|
|
117
|
+
logLevel: 'info',
|
|
118
|
+
cors: {
|
|
119
|
+
origin: true,
|
|
120
|
+
credentials: true,
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
database: {
|
|
124
|
+
adapter: 'pg', // 'pg' | 'sqlite'
|
|
125
|
+
url: process.env.DATABASE_URL,
|
|
126
|
+
},
|
|
127
|
+
auth: {
|
|
128
|
+
secret: process.env.JWT_SECRET,
|
|
129
|
+
expiresIn: '7d',
|
|
130
|
+
cookieName: 'moria_token',
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### 3. Database
|
|
136
|
+
|
|
137
|
+
MoriaJS uses [Kysely](https://kysely.dev) for type-safe database queries with [kysely-schema](https://github.com/guntur-d/kysely-schema) for schema-first development.
|
|
138
|
+
|
|
139
|
+
```ts
|
|
140
|
+
import { createDatabase } from '@moriajs/db';
|
|
141
|
+
|
|
142
|
+
// SQLite for development
|
|
143
|
+
const db = await createDatabase({
|
|
144
|
+
adapter: 'sqlite',
|
|
145
|
+
filename: './dev.db',
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
// PostgreSQL for production
|
|
149
|
+
const db = await createDatabase({
|
|
150
|
+
adapter: 'pg',
|
|
151
|
+
url: process.env.DATABASE_URL,
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
// Use as a plugin
|
|
155
|
+
import { createDatabasePlugin } from '@moriajs/db';
|
|
156
|
+
|
|
157
|
+
const app = await createApp();
|
|
158
|
+
await app.use(createDatabasePlugin({
|
|
159
|
+
adapter: 'sqlite',
|
|
160
|
+
filename: './dev.db',
|
|
161
|
+
}));
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### 4. Authentication
|
|
165
|
+
|
|
166
|
+
JWT-based auth with httpOnly cookies — secure by default.
|
|
167
|
+
|
|
168
|
+
```ts
|
|
169
|
+
import { createAuthPlugin, requireAuth } from '@moriajs/auth';
|
|
170
|
+
|
|
171
|
+
const app = await createApp();
|
|
172
|
+
|
|
173
|
+
// Register the auth plugin
|
|
174
|
+
await app.use(createAuthPlugin({
|
|
175
|
+
secret: process.env.JWT_SECRET!,
|
|
176
|
+
expiresIn: '24h',
|
|
177
|
+
}));
|
|
178
|
+
|
|
179
|
+
// Public route
|
|
180
|
+
app.server.post('/api/login', async (request, reply) => {
|
|
181
|
+
// Validate credentials...
|
|
182
|
+
const token = await app.server.signIn({ id: user.id, email: user.email }, reply);
|
|
183
|
+
return { token };
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
// Protected route
|
|
187
|
+
app.server.get('/api/profile',
|
|
188
|
+
{ preHandler: [requireAuth()] },
|
|
189
|
+
async (request) => {
|
|
190
|
+
return { user: request.user };
|
|
191
|
+
}
|
|
192
|
+
);
|
|
193
|
+
|
|
194
|
+
// Role-based protection
|
|
195
|
+
app.server.delete('/api/users/:id',
|
|
196
|
+
{ preHandler: [requireAuth({ role: 'admin' })] },
|
|
197
|
+
async (request) => {
|
|
198
|
+
// Only admins can access this
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### 5. Server-Side Rendering
|
|
204
|
+
|
|
205
|
+
Render Mithril.js components on the server with automatic hydration.
|
|
206
|
+
|
|
207
|
+
```ts
|
|
208
|
+
import { renderToString } from '@moriajs/renderer';
|
|
209
|
+
|
|
210
|
+
app.server.get('/', async (request, reply) => {
|
|
211
|
+
const html = await renderToString(HomePage, {
|
|
212
|
+
title: 'My App — Home',
|
|
213
|
+
meta: { description: 'Welcome to my MoriaJS app' },
|
|
214
|
+
initialData: { user: request.user },
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
reply.type('text/html').send(html);
|
|
218
|
+
});
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
On the client side, hydrate the server-rendered page:
|
|
222
|
+
|
|
223
|
+
```ts
|
|
224
|
+
// entry-client.ts
|
|
225
|
+
import { hydrate, getHydrationData } from '@moriajs/renderer';
|
|
226
|
+
import App from './App.js';
|
|
227
|
+
|
|
228
|
+
const data = getHydrationData();
|
|
229
|
+
await hydrate(App, document.getElementById('app')!);
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### 6. UI Components
|
|
233
|
+
|
|
234
|
+
Built-in Mithril.js components — CSS-framework agnostic.
|
|
235
|
+
|
|
236
|
+
```ts
|
|
237
|
+
import m from 'mithril';
|
|
238
|
+
import { toast, Toaster, Modal } from '@moriajs/ui';
|
|
239
|
+
|
|
240
|
+
// Toast notifications
|
|
241
|
+
toast.success('Saved successfully!');
|
|
242
|
+
toast.error('Something went wrong');
|
|
243
|
+
toast.warning('Check your input');
|
|
244
|
+
toast.info('New update available');
|
|
245
|
+
|
|
246
|
+
// In your root layout — mount the Toaster once
|
|
247
|
+
const Layout = {
|
|
248
|
+
view(vnode) {
|
|
249
|
+
return m('div', [
|
|
250
|
+
m(Toaster), // Toast container
|
|
251
|
+
vnode.children, // Page content
|
|
252
|
+
]);
|
|
253
|
+
},
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
// Modal dialog
|
|
257
|
+
let showModal = false;
|
|
258
|
+
|
|
259
|
+
const Page = {
|
|
260
|
+
view() {
|
|
261
|
+
return m('div', [
|
|
262
|
+
m('button', { onclick: () => { showModal = true; } }, 'Open Modal'),
|
|
263
|
+
m(Modal, {
|
|
264
|
+
isOpen: showModal,
|
|
265
|
+
onClose: () => { showModal = false; },
|
|
266
|
+
title: 'Confirm Action',
|
|
267
|
+
}, [
|
|
268
|
+
m('p', 'Are you sure you want to proceed?'),
|
|
269
|
+
m('button', { onclick: () => { showModal = false; } }, 'Yes'),
|
|
270
|
+
]),
|
|
271
|
+
]);
|
|
272
|
+
},
|
|
273
|
+
};
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### 7. Plugins
|
|
277
|
+
|
|
278
|
+
Extend MoriaJS with custom plugins.
|
|
279
|
+
|
|
280
|
+
```ts
|
|
281
|
+
import { defineMoriaPlugin } from '@moriajs/core';
|
|
282
|
+
|
|
283
|
+
const myPlugin = defineMoriaPlugin({
|
|
284
|
+
name: 'my-plugin',
|
|
285
|
+
async register({ server, config }) {
|
|
286
|
+
// Add routes
|
|
287
|
+
server.get('/api/custom', async () => ({ custom: true }));
|
|
288
|
+
|
|
289
|
+
// Add decorators
|
|
290
|
+
server.decorate('myUtil', () => 'hello');
|
|
291
|
+
|
|
292
|
+
// Add hooks
|
|
293
|
+
server.addHook('onRequest', async (request) => {
|
|
294
|
+
request.log.info('Custom plugin hook');
|
|
295
|
+
});
|
|
296
|
+
},
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
// Register in your app
|
|
300
|
+
const app = await createApp();
|
|
301
|
+
await app.use(myPlugin);
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
## CLI
|
|
305
|
+
|
|
306
|
+
```bash
|
|
307
|
+
moria dev # Start development server with HMR
|
|
308
|
+
moria build # Build for production
|
|
309
|
+
moria start # Start production server
|
|
310
|
+
moria generate # Generate routes, components, models
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
## Packages
|
|
314
|
+
|
|
315
|
+
| Package | Description |
|
|
316
|
+
|---------|-------------|
|
|
317
|
+
| `@moriajs/core` | Fastify server, config, plugin system |
|
|
318
|
+
| `@moriajs/renderer` | SSR/CSR hybrid rendering engine |
|
|
319
|
+
| `@moriajs/db` | Kysely database adapters (PG + SQLite) |
|
|
320
|
+
| `@moriajs/auth` | JWT + httpOnly cookie authentication |
|
|
321
|
+
| `@moriajs/cli` | Dev, build, and generate commands |
|
|
322
|
+
| `@moriajs/ui` | Toaster, Modal, and UI primitives |
|
|
323
|
+
| `create-moria` | Project scaffolder (coming soon) |
|
|
324
|
+
|
|
325
|
+
## Tech Stack
|
|
326
|
+
|
|
327
|
+
| Layer | Technology |
|
|
328
|
+
|-------|-----------|
|
|
329
|
+
| Runtime | Node.js ≥ 20 |
|
|
330
|
+
| Backend | [Fastify](https://fastify.dev) |
|
|
331
|
+
| Frontend | [Mithril.js](https://mithril.js.org) |
|
|
332
|
+
| ORM | [Kysely](https://kysely.dev) + [kysely-schema](https://github.com/guntur-d/kysely-schema) |
|
|
333
|
+
| Bundler | [Vite](https://vite.dev) |
|
|
334
|
+
| Monorepo | pnpm workspaces + [Turborepo](https://turbo.build) |
|
|
335
|
+
| Language | TypeScript |
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
## Documentation
|
|
340
|
+
|
|
341
|
+
> 📝 Full documentation is coming soon. For now, each package's source code is well-documented with JSDoc comments and TypeScript types.
|
|
342
|
+
|
|
343
|
+
- [Configuration](./packages/core/src/config.ts) — All config options
|
|
344
|
+
- [Plugin API](./packages/core/src/plugins.ts) — Creating plugins
|
|
345
|
+
- [Database](./packages/db/src/index.ts) — Database adapters
|
|
346
|
+
- [Auth](./packages/auth/src/index.ts) — Authentication system
|
|
347
|
+
- [Renderer](./packages/renderer/src/index.ts) — SSR/CSR rendering
|
|
348
|
+
- [UI Components](./packages/ui/src/index.ts) — Toaster, Modal
|
|
349
|
+
|
|
350
|
+
## Roadmap
|
|
351
|
+
|
|
352
|
+
- [x] Monorepo scaffold (pnpm + Turborepo)
|
|
353
|
+
- [x] Core server with Fastify
|
|
354
|
+
- [x] Database adapters (PostgreSQL + SQLite)
|
|
355
|
+
- [x] JWT authentication
|
|
356
|
+
- [x] SSR renderer
|
|
357
|
+
- [x] UI component library
|
|
358
|
+
- [x] CLI with commands
|
|
359
|
+
- [x] Project scaffolder
|
|
360
|
+
- [ ] Vite integration with HMR
|
|
361
|
+
- [ ] File-based routing
|
|
362
|
+
- [ ] Full SSR/CSR hydration
|
|
363
|
+
- [ ] kysely-schema integration
|
|
364
|
+
- [ ] OAuth providers
|
|
365
|
+
- [ ] Middleware system
|
|
366
|
+
- [ ] Starter templates
|
|
367
|
+
|
|
368
|
+
## Contributing
|
|
369
|
+
|
|
370
|
+
MoriaJS is currently in early development. Contributions, issues, and feature requests are welcome!
|
|
371
|
+
|
|
372
|
+
1. Fork the repository
|
|
373
|
+
2. Create your branch (`git checkout -b feature/amazing-feature`)
|
|
374
|
+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
375
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
376
|
+
5. Open a Pull Request
|
|
377
|
+
|
|
378
|
+
## License
|
|
379
|
+
|
|
380
|
+
MIT © [Guntur D](https://github.com/guntur-d)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MoriaJS Playground
|
|
3
|
+
*
|
|
4
|
+
* A minimal application to test the MoriaJS framework.
|
|
5
|
+
* Run with: pnpm dev (uses tsx for direct TS execution)
|
|
6
|
+
*/
|
|
7
|
+
import { createApp, defineConfig } from '@moriajs/core';
|
|
8
|
+
const config = defineConfig({
|
|
9
|
+
server: {
|
|
10
|
+
port: 3000,
|
|
11
|
+
logLevel: 'info',
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
async function main() {
|
|
15
|
+
const app = await createApp({ config });
|
|
16
|
+
// Example route
|
|
17
|
+
app.server.get('/', async () => {
|
|
18
|
+
return {
|
|
19
|
+
framework: 'MoriaJS',
|
|
20
|
+
version: '0.0.1',
|
|
21
|
+
message: '🏔️ Welcome to MoriaJS — The Mithril.js Meta-Framework',
|
|
22
|
+
routes: {
|
|
23
|
+
health: '/health',
|
|
24
|
+
api: '/api (coming soon)',
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
// Start the server
|
|
29
|
+
const address = await app.listen();
|
|
30
|
+
console.log(`\n🏔️ MoriaJS Playground running at ${address}\n`);
|
|
31
|
+
}
|
|
32
|
+
main().catch((err) => {
|
|
33
|
+
console.error('Failed to start:', err);
|
|
34
|
+
process.exit(1);
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAExD,MAAM,MAAM,GAAG,YAAY,CAAC;IACxB,MAAM,EAAE;QACJ,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,MAAM;KACnB;CACJ,CAAC,CAAC;AAEH,KAAK,UAAU,IAAI;IACf,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAExC,gBAAgB;IAChB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,IAAI,EAAE;QAC3B,OAAO;YACH,SAAS,EAAE,SAAS;YACpB,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE,wDAAwD;YACjE,MAAM,EAAE;gBACJ,MAAM,EAAE,SAAS;gBACjB,GAAG,EAAE,oBAAoB;aAC5B;SACJ,CAAC;IACN,CAAC,CAAC,CAAC;IAEH,mBAAmB;IACnB,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC;IACnC,OAAO,CAAC,GAAG,CAAC,wCAAwC,OAAO,IAAI,CAAC,CAAC;AACrE,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;IACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
+
esac
|
|
7
|
+
|
|
8
|
+
if [ -z "$NODE_PATH" ]; then
|
|
9
|
+
export NODE_PATH="/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/rimraf@6.1.2/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/node_modules"
|
|
10
|
+
else
|
|
11
|
+
export NODE_PATH="/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/rimraf@6.1.2/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
+
fi
|
|
13
|
+
if [ -x "$basedir/node" ]; then
|
|
14
|
+
exec "$basedir/node" "$basedir/../rimraf/dist/esm/bin.mjs" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../rimraf/dist/esm/bin.mjs" "$@"
|
|
17
|
+
fi
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@SETLOCAL
|
|
2
|
+
@IF NOT DEFINED NODE_PATH (
|
|
3
|
+
@SET "NODE_PATH=C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\rimraf@6.1.2\node_modules\rimraf\dist\esm\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\rimraf@6.1.2\node_modules\rimraf\dist\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\rimraf@6.1.2\node_modules\rimraf\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\rimraf@6.1.2\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\node_modules"
|
|
4
|
+
) ELSE (
|
|
5
|
+
@SET "NODE_PATH=C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\rimraf@6.1.2\node_modules\rimraf\dist\esm\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\rimraf@6.1.2\node_modules\rimraf\dist\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\rimraf@6.1.2\node_modules\rimraf\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\rimraf@6.1.2\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\node_modules;%NODE_PATH%"
|
|
6
|
+
)
|
|
7
|
+
@IF EXIST "%~dp0\node.exe" (
|
|
8
|
+
"%~dp0\node.exe" "%~dp0\..\rimraf\dist\esm\bin.mjs" %*
|
|
9
|
+
) ELSE (
|
|
10
|
+
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
11
|
+
node "%~dp0\..\rimraf\dist\esm\bin.mjs" %*
|
|
12
|
+
)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env pwsh
|
|
2
|
+
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
|
3
|
+
|
|
4
|
+
$exe=""
|
|
5
|
+
$pathsep=":"
|
|
6
|
+
$env_node_path=$env:NODE_PATH
|
|
7
|
+
$new_node_path="C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\rimraf@6.1.2\node_modules\rimraf\dist\esm\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\rimraf@6.1.2\node_modules\rimraf\dist\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\rimraf@6.1.2\node_modules\rimraf\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\rimraf@6.1.2\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\node_modules"
|
|
8
|
+
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
|
9
|
+
# Fix case when both the Windows and Linux builds of Node
|
|
10
|
+
# are installed in the same directory
|
|
11
|
+
$exe=".exe"
|
|
12
|
+
$pathsep=";"
|
|
13
|
+
} else {
|
|
14
|
+
$new_node_path="/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/esm/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/dist/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/rimraf@6.1.2/node_modules/rimraf/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/rimraf@6.1.2/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/node_modules"
|
|
15
|
+
}
|
|
16
|
+
if ([string]::IsNullOrEmpty($env_node_path)) {
|
|
17
|
+
$env:NODE_PATH=$new_node_path
|
|
18
|
+
} else {
|
|
19
|
+
$env:NODE_PATH="$new_node_path$pathsep$env_node_path"
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
$ret=0
|
|
23
|
+
if (Test-Path "$basedir/node$exe") {
|
|
24
|
+
# Support pipeline input
|
|
25
|
+
if ($MyInvocation.ExpectingInput) {
|
|
26
|
+
$input | & "$basedir/node$exe" "$basedir/../rimraf/dist/esm/bin.mjs" $args
|
|
27
|
+
} else {
|
|
28
|
+
& "$basedir/node$exe" "$basedir/../rimraf/dist/esm/bin.mjs" $args
|
|
29
|
+
}
|
|
30
|
+
$ret=$LASTEXITCODE
|
|
31
|
+
} else {
|
|
32
|
+
# Support pipeline input
|
|
33
|
+
if ($MyInvocation.ExpectingInput) {
|
|
34
|
+
$input | & "node$exe" "$basedir/../rimraf/dist/esm/bin.mjs" $args
|
|
35
|
+
} else {
|
|
36
|
+
& "node$exe" "$basedir/../rimraf/dist/esm/bin.mjs" $args
|
|
37
|
+
}
|
|
38
|
+
$ret=$LASTEXITCODE
|
|
39
|
+
}
|
|
40
|
+
$env:NODE_PATH=$env_node_path
|
|
41
|
+
exit $ret
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
+
esac
|
|
7
|
+
|
|
8
|
+
if [ -z "$NODE_PATH" ]; then
|
|
9
|
+
export NODE_PATH="/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/typescript@5.9.3/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/node_modules"
|
|
10
|
+
else
|
|
11
|
+
export NODE_PATH="/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/typescript@5.9.3/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
+
fi
|
|
13
|
+
if [ -x "$basedir/node" ]; then
|
|
14
|
+
exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../typescript/bin/tsc" "$@"
|
|
17
|
+
fi
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@SETLOCAL
|
|
2
|
+
@IF NOT DEFINED NODE_PATH (
|
|
3
|
+
@SET "NODE_PATH=C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\typescript@5.9.3\node_modules\typescript\bin\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\typescript@5.9.3\node_modules\typescript\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\typescript@5.9.3\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\node_modules"
|
|
4
|
+
) ELSE (
|
|
5
|
+
@SET "NODE_PATH=C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\typescript@5.9.3\node_modules\typescript\bin\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\typescript@5.9.3\node_modules\typescript\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\typescript@5.9.3\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\node_modules;%NODE_PATH%"
|
|
6
|
+
)
|
|
7
|
+
@IF EXIST "%~dp0\node.exe" (
|
|
8
|
+
"%~dp0\node.exe" "%~dp0\..\typescript\bin\tsc" %*
|
|
9
|
+
) ELSE (
|
|
10
|
+
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
11
|
+
node "%~dp0\..\typescript\bin\tsc" %*
|
|
12
|
+
)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env pwsh
|
|
2
|
+
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
|
3
|
+
|
|
4
|
+
$exe=""
|
|
5
|
+
$pathsep=":"
|
|
6
|
+
$env_node_path=$env:NODE_PATH
|
|
7
|
+
$new_node_path="C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\typescript@5.9.3\node_modules\typescript\bin\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\typescript@5.9.3\node_modules\typescript\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\typescript@5.9.3\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\node_modules"
|
|
8
|
+
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
|
9
|
+
# Fix case when both the Windows and Linux builds of Node
|
|
10
|
+
# are installed in the same directory
|
|
11
|
+
$exe=".exe"
|
|
12
|
+
$pathsep=";"
|
|
13
|
+
} else {
|
|
14
|
+
$new_node_path="/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/typescript@5.9.3/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/node_modules"
|
|
15
|
+
}
|
|
16
|
+
if ([string]::IsNullOrEmpty($env_node_path)) {
|
|
17
|
+
$env:NODE_PATH=$new_node_path
|
|
18
|
+
} else {
|
|
19
|
+
$env:NODE_PATH="$new_node_path$pathsep$env_node_path"
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
$ret=0
|
|
23
|
+
if (Test-Path "$basedir/node$exe") {
|
|
24
|
+
# Support pipeline input
|
|
25
|
+
if ($MyInvocation.ExpectingInput) {
|
|
26
|
+
$input | & "$basedir/node$exe" "$basedir/../typescript/bin/tsc" $args
|
|
27
|
+
} else {
|
|
28
|
+
& "$basedir/node$exe" "$basedir/../typescript/bin/tsc" $args
|
|
29
|
+
}
|
|
30
|
+
$ret=$LASTEXITCODE
|
|
31
|
+
} else {
|
|
32
|
+
# Support pipeline input
|
|
33
|
+
if ($MyInvocation.ExpectingInput) {
|
|
34
|
+
$input | & "node$exe" "$basedir/../typescript/bin/tsc" $args
|
|
35
|
+
} else {
|
|
36
|
+
& "node$exe" "$basedir/../typescript/bin/tsc" $args
|
|
37
|
+
}
|
|
38
|
+
$ret=$LASTEXITCODE
|
|
39
|
+
}
|
|
40
|
+
$env:NODE_PATH=$env_node_path
|
|
41
|
+
exit $ret
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
+
esac
|
|
7
|
+
|
|
8
|
+
if [ -z "$NODE_PATH" ]; then
|
|
9
|
+
export NODE_PATH="/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/typescript@5.9.3/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/node_modules"
|
|
10
|
+
else
|
|
11
|
+
export NODE_PATH="/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/typescript@5.9.3/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
+
fi
|
|
13
|
+
if [ -x "$basedir/node" ]; then
|
|
14
|
+
exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../typescript/bin/tsserver" "$@"
|
|
17
|
+
fi
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@SETLOCAL
|
|
2
|
+
@IF NOT DEFINED NODE_PATH (
|
|
3
|
+
@SET "NODE_PATH=C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\typescript@5.9.3\node_modules\typescript\bin\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\typescript@5.9.3\node_modules\typescript\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\typescript@5.9.3\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\node_modules"
|
|
4
|
+
) ELSE (
|
|
5
|
+
@SET "NODE_PATH=C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\typescript@5.9.3\node_modules\typescript\bin\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\typescript@5.9.3\node_modules\typescript\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\typescript@5.9.3\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\node_modules;%NODE_PATH%"
|
|
6
|
+
)
|
|
7
|
+
@IF EXIST "%~dp0\node.exe" (
|
|
8
|
+
"%~dp0\node.exe" "%~dp0\..\typescript\bin\tsserver" %*
|
|
9
|
+
) ELSE (
|
|
10
|
+
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
11
|
+
node "%~dp0\..\typescript\bin\tsserver" %*
|
|
12
|
+
)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env pwsh
|
|
2
|
+
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
|
3
|
+
|
|
4
|
+
$exe=""
|
|
5
|
+
$pathsep=":"
|
|
6
|
+
$env_node_path=$env:NODE_PATH
|
|
7
|
+
$new_node_path="C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\typescript@5.9.3\node_modules\typescript\bin\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\typescript@5.9.3\node_modules\typescript\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\typescript@5.9.3\node_modules;C:\Codes\node\2026\github\moriajs\node_modules\.pnpm\node_modules"
|
|
8
|
+
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
|
9
|
+
# Fix case when both the Windows and Linux builds of Node
|
|
10
|
+
# are installed in the same directory
|
|
11
|
+
$exe=".exe"
|
|
12
|
+
$pathsep=";"
|
|
13
|
+
} else {
|
|
14
|
+
$new_node_path="/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/typescript@5.9.3/node_modules:/mnt/c/Codes/node/2026/github/moriajs/node_modules/.pnpm/node_modules"
|
|
15
|
+
}
|
|
16
|
+
if ([string]::IsNullOrEmpty($env_node_path)) {
|
|
17
|
+
$env:NODE_PATH=$new_node_path
|
|
18
|
+
} else {
|
|
19
|
+
$env:NODE_PATH="$new_node_path$pathsep$env_node_path"
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
$ret=0
|
|
23
|
+
if (Test-Path "$basedir/node$exe") {
|
|
24
|
+
# Support pipeline input
|
|
25
|
+
if ($MyInvocation.ExpectingInput) {
|
|
26
|
+
$input | & "$basedir/node$exe" "$basedir/../typescript/bin/tsserver" $args
|
|
27
|
+
} else {
|
|
28
|
+
& "$basedir/node$exe" "$basedir/../typescript/bin/tsserver" $args
|
|
29
|
+
}
|
|
30
|
+
$ret=$LASTEXITCODE
|
|
31
|
+
} else {
|
|
32
|
+
# Support pipeline input
|
|
33
|
+
if ($MyInvocation.ExpectingInput) {
|
|
34
|
+
$input | & "node$exe" "$basedir/../typescript/bin/tsserver" $args
|
|
35
|
+
} else {
|
|
36
|
+
& "node$exe" "$basedir/../typescript/bin/tsserver" $args
|
|
37
|
+
}
|
|
38
|
+
$ret=$LASTEXITCODE
|
|
39
|
+
}
|
|
40
|
+
$env:NODE_PATH=$env_node_path
|
|
41
|
+
exit $ret
|