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
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @moriajs/renderer
|
|
3
|
+
*
|
|
4
|
+
* Hybrid SSR/CSR rendering engine for Mithril.js.
|
|
5
|
+
* Provides server-side rendering with mithril-node-render
|
|
6
|
+
* and client-side hydration.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Options for rendering a page.
|
|
11
|
+
*/
|
|
12
|
+
export interface RenderOptions {
|
|
13
|
+
/** Page title */
|
|
14
|
+
title?: string;
|
|
15
|
+
/** Meta tags for the page head */
|
|
16
|
+
meta?: Record<string, string>;
|
|
17
|
+
/** Initial data to hydrate on the client */
|
|
18
|
+
initialData?: Record<string, unknown>;
|
|
19
|
+
/** HTML lang attribute */
|
|
20
|
+
lang?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Render a Mithril component to an HTML string (server-side).
|
|
25
|
+
*
|
|
26
|
+
* Uses mithril-node-render to produce static HTML from Mithril vnodes.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* import { renderToString } from '@moriajs/renderer';
|
|
31
|
+
* import MyPage from './pages/Home.js';
|
|
32
|
+
*
|
|
33
|
+
* const html = await renderToString(MyPage, {
|
|
34
|
+
* title: 'Home — My App',
|
|
35
|
+
* initialData: { user: { name: 'Guntur' } },
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export async function renderToString(
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
|
+
component: any,
|
|
42
|
+
options: RenderOptions = {}
|
|
43
|
+
): Promise<string> {
|
|
44
|
+
// mithril-node-render has no type declarations — use string import
|
|
45
|
+
const renderModule = await (Function('return import("mithril-node-render")')() as Promise<{ default: (vnode: unknown) => Promise<string> }>);
|
|
46
|
+
const mModule = await (Function('return import("mithril")')() as Promise<{ default: (tag: unknown) => unknown }>);
|
|
47
|
+
|
|
48
|
+
const render = renderModule.default;
|
|
49
|
+
const m = mModule.default;
|
|
50
|
+
|
|
51
|
+
const componentHtml = await render(m(component));
|
|
52
|
+
|
|
53
|
+
const metaTags = options.meta
|
|
54
|
+
? Object.entries(options.meta)
|
|
55
|
+
.map(([name, content]) => `<meta name="${name}" content="${content}">`)
|
|
56
|
+
.join('\n ')
|
|
57
|
+
: '';
|
|
58
|
+
|
|
59
|
+
const hydrationScript = options.initialData
|
|
60
|
+
? `<script>window.__MORIA_DATA__ = ${JSON.stringify(options.initialData)};</script>`
|
|
61
|
+
: '';
|
|
62
|
+
|
|
63
|
+
return `<!DOCTYPE html>
|
|
64
|
+
<html lang="${options.lang ?? 'en'}">
|
|
65
|
+
<head>
|
|
66
|
+
<meta charset="UTF-8">
|
|
67
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
68
|
+
${metaTags}
|
|
69
|
+
<title>${options.title ?? 'MoriaJS App'}</title>
|
|
70
|
+
</head>
|
|
71
|
+
<body>
|
|
72
|
+
<div id="app">${componentHtml}</div>
|
|
73
|
+
${hydrationScript}
|
|
74
|
+
<script type="module" src="/src/entry-client.ts"></script>
|
|
75
|
+
</body>
|
|
76
|
+
</html>`;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Hydrate a server-rendered Mithril component on the client.
|
|
81
|
+
* Call this in your entry-client.ts.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* import { hydrate } from '@moriajs/renderer';
|
|
86
|
+
* import App from './App.js';
|
|
87
|
+
*
|
|
88
|
+
* hydrate(App, document.getElementById('app')!);
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
export async function hydrate(
|
|
92
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
93
|
+
component: any,
|
|
94
|
+
container: Element
|
|
95
|
+
): Promise<void> {
|
|
96
|
+
const mModule = await import('mithril');
|
|
97
|
+
const m = mModule.default;
|
|
98
|
+
m.mount(container, component);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Get hydration data injected by the server.
|
|
103
|
+
*/
|
|
104
|
+
export function getHydrationData<T = Record<string, unknown>>(): T | undefined {
|
|
105
|
+
if (typeof window !== 'undefined') {
|
|
106
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
107
|
+
return (window as any).__MORIA_DATA__ as T | undefined;
|
|
108
|
+
}
|
|
109
|
+
return undefined;
|
|
110
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @moriajs/ui
|
|
3
|
+
*
|
|
4
|
+
* UI component library for Mithril.js.
|
|
5
|
+
* Includes toaster notifications, modals, and layout primitives.
|
|
6
|
+
* CSS-framework agnostic — ships its own minimal styles.
|
|
7
|
+
*/
|
|
8
|
+
import m from 'mithril';
|
|
9
|
+
export type ToastType = 'success' | 'error' | 'warning' | 'info';
|
|
10
|
+
export interface Toast {
|
|
11
|
+
id: string;
|
|
12
|
+
message: string;
|
|
13
|
+
type: ToastType;
|
|
14
|
+
duration?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Show a toast notification.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { toast } from '@moriajs/ui';
|
|
22
|
+
*
|
|
23
|
+
* toast.success('Saved successfully!');
|
|
24
|
+
* toast.error('Something went wrong');
|
|
25
|
+
* toast.info('New update available');
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare const toast: {
|
|
29
|
+
show(message: string, type?: ToastType, duration?: number): string;
|
|
30
|
+
success(message: string, duration?: number): string;
|
|
31
|
+
error(message: string, duration?: number): string;
|
|
32
|
+
warning(message: string, duration?: number): string;
|
|
33
|
+
info(message: string, duration?: number): string;
|
|
34
|
+
dismiss(id: string): void;
|
|
35
|
+
clear(): void;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Toaster container component.
|
|
39
|
+
* Mount once in your app layout.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* import { Toaster } from '@moriajs/ui';
|
|
44
|
+
* m(Toaster); // Place in your root layout
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare const Toaster: m.Component;
|
|
48
|
+
export interface ModalAttrs {
|
|
49
|
+
/** Whether the modal is visible */
|
|
50
|
+
isOpen: boolean;
|
|
51
|
+
/** Callback when modal is closed */
|
|
52
|
+
onClose: () => void;
|
|
53
|
+
/** Modal title */
|
|
54
|
+
title?: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Modal dialog component.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* import { Modal } from '@moriajs/ui';
|
|
62
|
+
*
|
|
63
|
+
* let showModal = false;
|
|
64
|
+
*
|
|
65
|
+
* m(Modal, {
|
|
66
|
+
* isOpen: showModal,
|
|
67
|
+
* onClose: () => { showModal = false; },
|
|
68
|
+
* title: 'Confirm Action',
|
|
69
|
+
* }, [
|
|
70
|
+
* m('p', 'Are you sure?'),
|
|
71
|
+
* m('button', { onclick: () => { showModal = false; } }, 'Yes'),
|
|
72
|
+
* ]);
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
export declare const Modal: m.Component<ModalAttrs>;
|
|
76
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,CAAC,MAAM,SAAS,CAAC;AAIxB,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAEjE,MAAM,WAAW,KAAK;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAKD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,KAAK;kBACA,MAAM,SAAQ,SAAS;qBAiBpB,MAAM,aAAa,MAAM;mBAG3B,MAAM,aAAa,MAAM;qBAGvB,MAAM,aAAa,MAAM;kBAG5B,MAAM,aAAa,MAAM;gBAG3B,MAAM;;CAWrB,CAAC;AASF;;;;;;;;;GASG;AACH,eAAO,MAAM,OAAO,EAAE,CAAC,CAAC,SAqCvB,CAAC;AAIF,MAAM,WAAW,UAAU;IACvB,mCAAmC;IACnC,MAAM,EAAE,OAAO,CAAC;IAChB,oCAAoC;IACpC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,kBAAkB;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,KAAK,EAAE,CAAC,CAAC,SAAS,CAAC,UAAU,CAgEzC,CAAC"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @moriajs/ui
|
|
3
|
+
*
|
|
4
|
+
* UI component library for Mithril.js.
|
|
5
|
+
* Includes toaster notifications, modals, and layout primitives.
|
|
6
|
+
* CSS-framework agnostic — ships its own minimal styles.
|
|
7
|
+
*/
|
|
8
|
+
import m from 'mithril';
|
|
9
|
+
/** Internal toast state */
|
|
10
|
+
const toasts = [];
|
|
11
|
+
/**
|
|
12
|
+
* Show a toast notification.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { toast } from '@moriajs/ui';
|
|
17
|
+
*
|
|
18
|
+
* toast.success('Saved successfully!');
|
|
19
|
+
* toast.error('Something went wrong');
|
|
20
|
+
* toast.info('New update available');
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export const toast = {
|
|
24
|
+
show(message, type = 'info', duration = 3000) {
|
|
25
|
+
const id = `toast-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
26
|
+
toasts.push({ id, message, type, duration });
|
|
27
|
+
m.redraw();
|
|
28
|
+
if (duration > 0) {
|
|
29
|
+
setTimeout(() => {
|
|
30
|
+
const index = toasts.findIndex((t) => t.id === id);
|
|
31
|
+
if (index !== -1) {
|
|
32
|
+
toasts.splice(index, 1);
|
|
33
|
+
m.redraw();
|
|
34
|
+
}
|
|
35
|
+
}, duration);
|
|
36
|
+
}
|
|
37
|
+
return id;
|
|
38
|
+
},
|
|
39
|
+
success(message, duration) {
|
|
40
|
+
return this.show(message, 'success', duration);
|
|
41
|
+
},
|
|
42
|
+
error(message, duration) {
|
|
43
|
+
return this.show(message, 'error', duration);
|
|
44
|
+
},
|
|
45
|
+
warning(message, duration) {
|
|
46
|
+
return this.show(message, 'warning', duration);
|
|
47
|
+
},
|
|
48
|
+
info(message, duration) {
|
|
49
|
+
return this.show(message, 'info', duration);
|
|
50
|
+
},
|
|
51
|
+
dismiss(id) {
|
|
52
|
+
const index = toasts.findIndex((t) => t.id === id);
|
|
53
|
+
if (index !== -1) {
|
|
54
|
+
toasts.splice(index, 1);
|
|
55
|
+
m.redraw();
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
clear() {
|
|
59
|
+
toasts.length = 0;
|
|
60
|
+
m.redraw();
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
const TOAST_COLORS = {
|
|
64
|
+
success: '#16a34a',
|
|
65
|
+
error: '#dc2626',
|
|
66
|
+
warning: '#d97706',
|
|
67
|
+
info: '#2563eb',
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Toaster container component.
|
|
71
|
+
* Mount once in your app layout.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* import { Toaster } from '@moriajs/ui';
|
|
76
|
+
* m(Toaster); // Place in your root layout
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
export const Toaster = {
|
|
80
|
+
view() {
|
|
81
|
+
return m('.moria-toaster', {
|
|
82
|
+
style: {
|
|
83
|
+
position: 'fixed',
|
|
84
|
+
top: '1rem',
|
|
85
|
+
right: '1rem',
|
|
86
|
+
zIndex: '9999',
|
|
87
|
+
display: 'flex',
|
|
88
|
+
flexDirection: 'column',
|
|
89
|
+
gap: '0.5rem',
|
|
90
|
+
},
|
|
91
|
+
}, toasts.map((t) => m('.moria-toast', {
|
|
92
|
+
key: t.id,
|
|
93
|
+
'data-type': t.type,
|
|
94
|
+
style: {
|
|
95
|
+
padding: '0.75rem 1rem',
|
|
96
|
+
borderRadius: '0.5rem',
|
|
97
|
+
color: '#fff',
|
|
98
|
+
fontSize: '0.875rem',
|
|
99
|
+
minWidth: '250px',
|
|
100
|
+
cursor: 'pointer',
|
|
101
|
+
background: TOAST_COLORS[t.type],
|
|
102
|
+
},
|
|
103
|
+
onclick: () => toast.dismiss(t.id),
|
|
104
|
+
}, t.message)));
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Modal dialog component.
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```ts
|
|
112
|
+
* import { Modal } from '@moriajs/ui';
|
|
113
|
+
*
|
|
114
|
+
* let showModal = false;
|
|
115
|
+
*
|
|
116
|
+
* m(Modal, {
|
|
117
|
+
* isOpen: showModal,
|
|
118
|
+
* onClose: () => { showModal = false; },
|
|
119
|
+
* title: 'Confirm Action',
|
|
120
|
+
* }, [
|
|
121
|
+
* m('p', 'Are you sure?'),
|
|
122
|
+
* m('button', { onclick: () => { showModal = false; } }, 'Yes'),
|
|
123
|
+
* ]);
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
export const Modal = {
|
|
127
|
+
view(vnode) {
|
|
128
|
+
if (!vnode.attrs.isOpen)
|
|
129
|
+
return m('div', { style: { display: 'none' } });
|
|
130
|
+
return m('.moria-modal-overlay', {
|
|
131
|
+
style: {
|
|
132
|
+
position: 'fixed',
|
|
133
|
+
inset: '0',
|
|
134
|
+
background: 'rgba(0,0,0,0.5)',
|
|
135
|
+
display: 'flex',
|
|
136
|
+
alignItems: 'center',
|
|
137
|
+
justifyContent: 'center',
|
|
138
|
+
zIndex: '9998',
|
|
139
|
+
},
|
|
140
|
+
onclick: (e) => {
|
|
141
|
+
if (e.target === e.currentTarget)
|
|
142
|
+
vnode.attrs.onClose();
|
|
143
|
+
},
|
|
144
|
+
}, m('.moria-modal', {
|
|
145
|
+
style: {
|
|
146
|
+
background: '#fff',
|
|
147
|
+
borderRadius: '0.75rem',
|
|
148
|
+
padding: '1.5rem',
|
|
149
|
+
minWidth: '400px',
|
|
150
|
+
maxWidth: '90vw',
|
|
151
|
+
maxHeight: '90vh',
|
|
152
|
+
overflowY: 'auto',
|
|
153
|
+
boxShadow: '0 25px 50px -12px rgba(0,0,0,0.25)',
|
|
154
|
+
},
|
|
155
|
+
}, [
|
|
156
|
+
vnode.attrs.title
|
|
157
|
+
? m('.moria-modal-header', {
|
|
158
|
+
style: {
|
|
159
|
+
display: 'flex',
|
|
160
|
+
justifyContent: 'space-between',
|
|
161
|
+
alignItems: 'center',
|
|
162
|
+
marginBottom: '1rem',
|
|
163
|
+
},
|
|
164
|
+
}, [
|
|
165
|
+
m('h2', { style: { margin: '0', fontSize: '1.25rem', fontWeight: '600' } }, vnode.attrs.title),
|
|
166
|
+
m('button', {
|
|
167
|
+
style: { background: 'none', border: 'none', fontSize: '1.5rem', cursor: 'pointer', color: '#6b7280' },
|
|
168
|
+
onclick: vnode.attrs.onClose,
|
|
169
|
+
}, '×'),
|
|
170
|
+
])
|
|
171
|
+
: m('span'),
|
|
172
|
+
m('.moria-modal-body', vnode.children),
|
|
173
|
+
]));
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,CAAC,MAAM,SAAS,CAAC;AAaxB,2BAA2B;AAC3B,MAAM,MAAM,GAAY,EAAE,CAAC;AAE3B;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG;IACjB,IAAI,CAAC,OAAe,EAAE,OAAkB,MAAM,EAAE,QAAQ,GAAG,IAAI;QAC3D,MAAM,EAAE,GAAG,SAAS,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QACxE,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC7C,CAAC,CAAC,MAAM,EAAE,CAAC;QAEX,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;YACf,UAAU,CAAC,GAAG,EAAE;gBACZ,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;gBACnD,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;oBACf,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;oBACxB,CAAC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sB,CAAC;SACvD,CACJ,CACJ,CAAC;IACN,CAAC;CACJ,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
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@moriajs/ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "MoriaJS UI — Toaster, modals, and component primitives for Mithril.js",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"dev": "tsc --watch",
|
|
17
|
+
"typecheck": "tsc --noEmit",
|
|
18
|
+
"clean": "rimraf dist .turbo"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"typescript": "^5.7.0",
|
|
22
|
+
"rimraf": "^6.0.0",
|
|
23
|
+
"@types/mithril": "^2.2.0"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"mithril": "^2.2.0"
|
|
27
|
+
},
|
|
28
|
+
"license": "MIT"
|
|
29
|
+
}
|