@almadar/orb 6.3.0 → 6.4.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/package.json +6 -6
- package/shells/almadar-shell/LICENSE +72 -0
- package/shells/almadar-shell/README.md +25 -0
- package/shells/almadar-shell/locales/en.json +120 -0
- package/shells/almadar-shell/package.json +35 -0
- package/shells/almadar-shell/packages/client/eslint.config.cjs +23 -0
- package/shells/almadar-shell/packages/client/index.html +13 -0
- package/shells/almadar-shell/packages/client/package.json +61 -0
- package/shells/almadar-shell/packages/client/postcss.config.js +6 -0
- package/shells/almadar-shell/packages/client/src/App.tsx +84 -0
- package/shells/almadar-shell/packages/client/src/config/firebase.ts +37 -0
- package/shells/almadar-shell/packages/client/src/features/auth/AuthContext.tsx +139 -0
- package/shells/almadar-shell/packages/client/src/features/auth/authService.ts +83 -0
- package/shells/almadar-shell/packages/client/src/features/auth/components/Login.tsx +218 -0
- package/shells/almadar-shell/packages/client/src/features/auth/components/ProtectedRoute.tsx +27 -0
- package/shells/almadar-shell/packages/client/src/features/auth/components/UserProfile.tsx +68 -0
- package/shells/almadar-shell/packages/client/src/features/auth/components/index.ts +3 -0
- package/shells/almadar-shell/packages/client/src/features/auth/index.ts +13 -0
- package/shells/almadar-shell/packages/client/src/features/auth/types.ts +24 -0
- package/shells/almadar-shell/packages/client/src/index.css +35 -0
- package/shells/almadar-shell/packages/client/src/main.tsx +8 -0
- package/shells/almadar-shell/packages/client/src/navigation/index.ts +55 -0
- package/shells/almadar-shell/packages/client/src/pages/index.ts +12 -0
- package/shells/almadar-shell/packages/client/tailwind-preset.cjs +259 -0
- package/shells/almadar-shell/packages/client/tailwind.config.js +21 -0
- package/shells/almadar-shell/packages/client/tsconfig.json +33 -0
- package/shells/almadar-shell/packages/client/vite.config.ts +50 -0
- package/shells/almadar-shell/packages/server/eslint.config.cjs +19 -0
- package/shells/almadar-shell/packages/server/package.json +38 -0
- package/shells/almadar-shell/packages/server/src/app.ts +36 -0
- package/shells/almadar-shell/packages/server/src/index.ts +30 -0
- package/shells/almadar-shell/packages/server/src/routes.ts +11 -0
- package/shells/almadar-shell/packages/server/src/types/express.d.ts +15 -0
- package/shells/almadar-shell/packages/server/tsconfig.json +23 -0
- package/shells/almadar-shell/packages/shared/package.json +10 -0
- package/shells/almadar-shell/packages/shared/pnpm-lock.yaml +22 -0
- package/shells/almadar-shell/packages/shared/src/index.ts +2 -0
- package/shells/almadar-shell/pnpm-lock.yaml +8792 -0
- package/shells/almadar-shell/pnpm-workspace.yaml +2 -0
- package/shells/almadar-shell/tsup.config.ts +13 -0
- package/shells/almadar-shell/turbo.json +17 -0
- package/shells/almadar-shell/vitest.config.ts +8 -0
- package/shells/almadar-shell-hono/LICENSE +72 -0
- package/shells/almadar-shell-hono/README.md +25 -0
- package/shells/almadar-shell-hono/locales/en.json +120 -0
- package/shells/almadar-shell-hono/package.json +31 -0
- package/shells/almadar-shell-hono/packages/client/eslint.config.cjs +23 -0
- package/shells/almadar-shell-hono/packages/client/index.html +13 -0
- package/shells/almadar-shell-hono/packages/client/package-lock.json +9750 -0
- package/shells/almadar-shell-hono/packages/client/package.json +61 -0
- package/shells/almadar-shell-hono/packages/client/postcss.config.js +6 -0
- package/shells/almadar-shell-hono/packages/client/src/App.tsx +84 -0
- package/shells/almadar-shell-hono/packages/client/src/config/firebase.ts +37 -0
- package/shells/almadar-shell-hono/packages/client/src/features/auth/AuthContext.tsx +139 -0
- package/shells/almadar-shell-hono/packages/client/src/features/auth/authService.ts +83 -0
- package/shells/almadar-shell-hono/packages/client/src/features/auth/components/Login.tsx +218 -0
- package/shells/almadar-shell-hono/packages/client/src/features/auth/components/ProtectedRoute.tsx +27 -0
- package/shells/almadar-shell-hono/packages/client/src/features/auth/components/UserProfile.tsx +68 -0
- package/shells/almadar-shell-hono/packages/client/src/features/auth/components/index.ts +3 -0
- package/shells/almadar-shell-hono/packages/client/src/features/auth/index.ts +13 -0
- package/shells/almadar-shell-hono/packages/client/src/features/auth/types.ts +24 -0
- package/shells/almadar-shell-hono/packages/client/src/index.css +35 -0
- package/shells/almadar-shell-hono/packages/client/src/main.tsx +8 -0
- package/shells/almadar-shell-hono/packages/client/src/navigation/index.ts +55 -0
- package/shells/almadar-shell-hono/packages/client/src/pages/index.ts +12 -0
- package/shells/almadar-shell-hono/packages/client/tailwind-preset.cjs +259 -0
- package/shells/almadar-shell-hono/packages/client/tailwind.config.js +21 -0
- package/shells/almadar-shell-hono/packages/client/tsconfig.json +33 -0
- package/shells/almadar-shell-hono/packages/client/vite.config.ts +50 -0
- package/shells/almadar-shell-hono/packages/server/eslint.config.cjs +19 -0
- package/shells/almadar-shell-hono/packages/server/package.json +37 -0
- package/shells/almadar-shell-hono/packages/server/pnpm-lock.yaml +4665 -0
- package/shells/almadar-shell-hono/packages/server/src/app.ts +31 -0
- package/shells/almadar-shell-hono/packages/server/src/index.ts +31 -0
- package/shells/almadar-shell-hono/packages/server/src/routes.ts +12 -0
- package/shells/almadar-shell-hono/packages/server/src/serve.ts +45 -0
- package/shells/almadar-shell-hono/packages/server/tsconfig.json +23 -0
- package/shells/almadar-shell-hono/packages/shared/package.json +25 -0
- package/shells/almadar-shell-hono/packages/shared/pnpm-lock.yaml +919 -0
- package/shells/almadar-shell-hono/packages/shared/src/index.ts +2 -0
- package/shells/almadar-shell-hono/packages/shared/tsconfig.json +17 -0
- package/shells/almadar-shell-hono/packages/shared/tsup.config.ts +10 -0
- package/shells/almadar-shell-hono/pnpm-lock.yaml +9423 -0
- package/shells/almadar-shell-hono/pnpm-workspace.yaml +2 -0
- package/shells/almadar-shell-hono/tsup.config.ts +13 -0
- package/shells/almadar-shell-hono/turbo.json +17 -0
- package/shells/almadar-shell-hono/vitest.config.ts +8 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@almadar/orb",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.0",
|
|
4
4
|
"description": "Orb CLI - deterministic when it can be, intelligent when it needs to be",
|
|
5
5
|
"license": "BSL-1.1",
|
|
6
6
|
"repository": {
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"node": ">=16.0.0"
|
|
50
50
|
},
|
|
51
51
|
"optionalDependencies": {
|
|
52
|
-
"@almadar/orb-darwin-x64": "6.
|
|
53
|
-
"@almadar/orb-darwin-arm64": "6.
|
|
54
|
-
"@almadar/orb-linux-x64": "6.
|
|
55
|
-
"@almadar/orb-linux-arm64": "6.
|
|
56
|
-
"@almadar/orb-windows-x64": "6.
|
|
52
|
+
"@almadar/orb-darwin-x64": "6.4.0",
|
|
53
|
+
"@almadar/orb-darwin-arm64": "6.4.0",
|
|
54
|
+
"@almadar/orb-linux-x64": "6.4.0",
|
|
55
|
+
"@almadar/orb-linux-arm64": "6.4.0",
|
|
56
|
+
"@almadar/orb-windows-x64": "6.4.0"
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
Business Source License 1.1
|
|
2
|
+
|
|
3
|
+
Parameters
|
|
4
|
+
|
|
5
|
+
Licensor: Almadar FZE
|
|
6
|
+
Licensed Work: KFlow Builder / Almadar
|
|
7
|
+
The Licensed Work is (c) 2025-2026 Almadar FZE.
|
|
8
|
+
Additional Use Grant: You may make production use of the Licensed Work for
|
|
9
|
+
non-commercial purposes and for internal evaluation.
|
|
10
|
+
Production use for commercial purposes requires a
|
|
11
|
+
commercial license from the Licensor.
|
|
12
|
+
Change Date: 2030-02-01
|
|
13
|
+
Change License: Apache License, Version 2.0
|
|
14
|
+
|
|
15
|
+
Terms
|
|
16
|
+
|
|
17
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
18
|
+
works, redistribute, and make non-production use of the Licensed Work. The
|
|
19
|
+
Licensor may make an Additional Use Grant, above, permitting limited
|
|
20
|
+
production use.
|
|
21
|
+
|
|
22
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
23
|
+
available distribution of a specific version of the Licensed Work under this
|
|
24
|
+
License, whichever comes first, the Licensor hereby grants you rights under
|
|
25
|
+
the terms of the Change License, and the rights granted in the paragraph
|
|
26
|
+
above terminate.
|
|
27
|
+
|
|
28
|
+
If your use of the Licensed Work does not comply with the requirements
|
|
29
|
+
currently in effect as described in this License, you must purchase a
|
|
30
|
+
commercial license from the Licensor, its affiliated entities, or authorized
|
|
31
|
+
resellers, or you must refrain from using the Licensed Work.
|
|
32
|
+
|
|
33
|
+
All copies of the original and modified Licensed Work, and derivative works
|
|
34
|
+
of the Licensed Work, are subject to this License. This License applies
|
|
35
|
+
separately for each version of the Licensed Work and the Change Date may vary
|
|
36
|
+
for each version of the Licensed Work released by Licensor.
|
|
37
|
+
|
|
38
|
+
You must conspicuously display this License on each original or modified copy
|
|
39
|
+
of the Licensed Work. If you receive the Licensed Work in original or
|
|
40
|
+
modified form from a third party, the terms and conditions set forth in this
|
|
41
|
+
License apply to your use of that work.
|
|
42
|
+
|
|
43
|
+
Any use of the Licensed Work in violation of this License will automatically
|
|
44
|
+
terminate your rights under this License for the current and all other
|
|
45
|
+
versions of the Licensed Work.
|
|
46
|
+
|
|
47
|
+
This License does not grant you any right in any trademark or logo of
|
|
48
|
+
Licensor or its affiliates (provided that you may use a trademark or logo of
|
|
49
|
+
Licensor as expressly required by this License).
|
|
50
|
+
|
|
51
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
|
52
|
+
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
|
53
|
+
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
|
54
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
|
55
|
+
TITLE.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
|
|
60
|
+
"Business Source License" is a trademark of MariaDB Corporation Ab.
|
|
61
|
+
|
|
62
|
+
ADDITIONAL TERMS:
|
|
63
|
+
|
|
64
|
+
Documentation (builder/packages/website/docs/) is licensed under CC BY 4.0.
|
|
65
|
+
|
|
66
|
+
TRADEMARKS:
|
|
67
|
+
|
|
68
|
+
"Orbital", "KFlow", "Almadar", and the Almadar logo are trademarks of
|
|
69
|
+
Almadar FZE. You may not use these trademarks without prior written
|
|
70
|
+
permission from Almadar FZE.
|
|
71
|
+
|
|
72
|
+
For licensing inquiries: licensing@almadar.io
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# @almadar/shell
|
|
2
|
+
|
|
3
|
+
> Minimal full-stack shell template for Almadar applications
|
|
4
|
+
|
|
5
|
+
Part of the [Almadar](https://github.com/almadar-io/almadar) platform.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @almadar/shell
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { /* ... */ } from '@almadar/shell';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## API
|
|
20
|
+
|
|
21
|
+
<!-- Document public exports here -->
|
|
22
|
+
|
|
23
|
+
## License
|
|
24
|
+
|
|
25
|
+
BSL 1.1 (Business Source License). Converts to Apache 2.0 on 2030-02-01. Non-production use is free.
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$meta": { "locale": "en", "direction": "ltr" },
|
|
3
|
+
|
|
4
|
+
"common.save": "Save",
|
|
5
|
+
"common.cancel": "Cancel",
|
|
6
|
+
"common.delete": "Delete",
|
|
7
|
+
"common.close": "Close",
|
|
8
|
+
"common.confirm": "Are you sure?",
|
|
9
|
+
"common.create": "Create",
|
|
10
|
+
"common.edit": "Edit",
|
|
11
|
+
"common.view": "View",
|
|
12
|
+
"common.add": "Add",
|
|
13
|
+
"common.remove": "Remove",
|
|
14
|
+
"common.search": "Search...",
|
|
15
|
+
"common.filter": "Filter",
|
|
16
|
+
"common.actions": "Actions",
|
|
17
|
+
"common.yes": "Yes",
|
|
18
|
+
"common.no": "No",
|
|
19
|
+
"common.ok": "OK",
|
|
20
|
+
"common.done": "Done",
|
|
21
|
+
"common.apply": "Apply",
|
|
22
|
+
"common.reset": "Reset",
|
|
23
|
+
"common.refresh": "Refresh",
|
|
24
|
+
"common.export": "Export",
|
|
25
|
+
"common.import": "Import",
|
|
26
|
+
"common.copy": "Copy",
|
|
27
|
+
"common.settings": "Settings",
|
|
28
|
+
|
|
29
|
+
"nav.previous": "Previous",
|
|
30
|
+
"nav.next": "Next",
|
|
31
|
+
"nav.back": "Back",
|
|
32
|
+
"nav.home": "Home",
|
|
33
|
+
|
|
34
|
+
"form.submit": "Submit",
|
|
35
|
+
"form.saving": "Saving...",
|
|
36
|
+
"form.required": "This field is required",
|
|
37
|
+
"form.invalidEmail": "Enter a valid email address",
|
|
38
|
+
"form.selectPlaceholder": "Select {{label}}...",
|
|
39
|
+
"form.searchPlaceholder": "Search {{entity}}...",
|
|
40
|
+
|
|
41
|
+
"table.empty.title": "No items found",
|
|
42
|
+
"table.empty.description": "No items to display.",
|
|
43
|
+
"table.search.placeholder": "Search...",
|
|
44
|
+
"table.pagination.showing": "Showing {{start}} to {{end}} of {{total}} results",
|
|
45
|
+
"table.pagination.page": "Page {{page}} of {{totalPages}}",
|
|
46
|
+
"table.bulk.selected": "{{count}} selected",
|
|
47
|
+
"table.loading": "Loading...",
|
|
48
|
+
|
|
49
|
+
"status.loading": "Loading...",
|
|
50
|
+
"status.scheduled": "Scheduled",
|
|
51
|
+
"status.inProgress": "In Progress",
|
|
52
|
+
"status.completed": "Completed",
|
|
53
|
+
"status.cancelled": "Cancelled",
|
|
54
|
+
"status.pending": "Pending",
|
|
55
|
+
"status.active": "Active",
|
|
56
|
+
"status.inactive": "Inactive",
|
|
57
|
+
"status.draft": "Draft",
|
|
58
|
+
"status.archived": "Archived",
|
|
59
|
+
|
|
60
|
+
"error.generic": "Something went wrong",
|
|
61
|
+
"error.retry": "Try again",
|
|
62
|
+
"error.notFound": "Not found",
|
|
63
|
+
"error.loadFailed": "Failed to load: {{message}}",
|
|
64
|
+
"error.configMissing": "Configuration not found for: {{id}}",
|
|
65
|
+
|
|
66
|
+
"common.loading": "Loading...",
|
|
67
|
+
"common.showMore": "Show More",
|
|
68
|
+
"common.showLess": "Show Less",
|
|
69
|
+
"common.noResults": "No results found",
|
|
70
|
+
"common.saveChanges": "Save Changes",
|
|
71
|
+
"common.retry": "Retry",
|
|
72
|
+
"common.open": "Open",
|
|
73
|
+
"common.back": "Back",
|
|
74
|
+
|
|
75
|
+
"empty.noItems": "No items",
|
|
76
|
+
"empty.noData": "No data available",
|
|
77
|
+
"empty.noItemsYet": "No items yet",
|
|
78
|
+
"empty.noItemsAdded": "No items added yet",
|
|
79
|
+
"empty.noOptionsFound": "No options found",
|
|
80
|
+
|
|
81
|
+
"list.addItemPlaceholder": "Add new item...",
|
|
82
|
+
|
|
83
|
+
"error.occurred": "An error occurred",
|
|
84
|
+
"error.failedToLoad": "Failed to load data",
|
|
85
|
+
|
|
86
|
+
"wizard.back": "Back",
|
|
87
|
+
"wizard.next": "Next",
|
|
88
|
+
"wizard.complete": "Complete",
|
|
89
|
+
"wizard.stepOf": "Step {{current}} of {{total}}",
|
|
90
|
+
|
|
91
|
+
"pagination.previous": "Previous",
|
|
92
|
+
"pagination.next": "Next",
|
|
93
|
+
"pagination.total": "Total:",
|
|
94
|
+
"pagination.show": "Show:",
|
|
95
|
+
"pagination.goTo": "Go to:",
|
|
96
|
+
"pagination.go": "Go",
|
|
97
|
+
|
|
98
|
+
"auth.signIn": "Sign in",
|
|
99
|
+
"auth.signOut": "Sign out",
|
|
100
|
+
|
|
101
|
+
"dialog.confirm": "Confirm",
|
|
102
|
+
"dialog.cancel": "Cancel",
|
|
103
|
+
"dialog.loading": "Loading...",
|
|
104
|
+
"dialog.delete.title": "Delete {{item}}?",
|
|
105
|
+
"dialog.delete.message": "This action cannot be undone.",
|
|
106
|
+
|
|
107
|
+
"trait.availableActions": "Available Actions",
|
|
108
|
+
"trait.transitions": "Transitions",
|
|
109
|
+
"trait.availableNow": "Available now",
|
|
110
|
+
|
|
111
|
+
"book.startReading": "Start Reading",
|
|
112
|
+
"book.tableOfContents": "Table of Contents",
|
|
113
|
+
"book.partNumber": "Part {{number}}",
|
|
114
|
+
"book.print": "Print",
|
|
115
|
+
"book.previousPage": "Previous page",
|
|
116
|
+
"book.nextPage": "Next page",
|
|
117
|
+
|
|
118
|
+
"quiz.showAnswer": "Show answer",
|
|
119
|
+
"quiz.hideAnswer": "Hide answer"
|
|
120
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@almadar/shell",
|
|
3
|
+
"version": "2.6.2",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Minimal full-stack shell template for Almadar applications",
|
|
6
|
+
"packageManager": "pnpm@10.30.3",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"dev": "npx concurrently -n client,server -c blue,green \"pnpm --filter @almadar/shell-client dev\" \"pnpm --filter @almadar/shell-server dev\"",
|
|
9
|
+
"build": "pnpm run -r build",
|
|
10
|
+
"typecheck": "turbo run typecheck",
|
|
11
|
+
"lint": "turbo run lint",
|
|
12
|
+
"prepare": "git rev-parse --git-dir > /dev/null 2>&1 && git config core.hooksPath .githooks || true"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"concurrently": "^9.2.1",
|
|
16
|
+
"turbo": "^2.8.17"
|
|
17
|
+
},
|
|
18
|
+
"pnpm": {
|
|
19
|
+
"overrides": {
|
|
20
|
+
"@tootallnate/once": "^3.0.1",
|
|
21
|
+
"esbuild": "^0.25.0",
|
|
22
|
+
"flatted": "^3.4.1"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist"
|
|
27
|
+
],
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "https://github.com/almadar-io/almadar-shell.git"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const tsParser = require("@typescript-eslint/parser");
|
|
3
|
+
const almadarPlugin = require("@almadar/eslint-plugin");
|
|
4
|
+
|
|
5
|
+
module.exports = [
|
|
6
|
+
{ ignores: ["dist/**", "node_modules/**", "**/*.test.ts", "**/*.test.tsx"] },
|
|
7
|
+
{
|
|
8
|
+
files: ["src/**/*.ts", "src/**/*.tsx"],
|
|
9
|
+
languageOptions: {
|
|
10
|
+
parser: tsParser,
|
|
11
|
+
parserOptions: {
|
|
12
|
+
ecmaFeatures: { jsx: true },
|
|
13
|
+
ecmaVersion: "latest",
|
|
14
|
+
sourceType: "module",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
plugins: { almadar: almadarPlugin },
|
|
18
|
+
rules: {
|
|
19
|
+
"almadar/no-as-any": "error",
|
|
20
|
+
"almadar/no-import-generated": "error",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Almadar App</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@almadar/shell-client",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "tsc && vite build",
|
|
9
|
+
"typecheck": "tsc --noEmit",
|
|
10
|
+
"lint": "eslint src/",
|
|
11
|
+
"preview": "vite preview",
|
|
12
|
+
"test": "vitest run --passWithNoTests",
|
|
13
|
+
"test:watch": "vitest"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@almadar/ui": ">=2.47.0",
|
|
17
|
+
"@almadar/syntax": ">=1.2.1",
|
|
18
|
+
"@almadar/evaluator": ">=2.6.0",
|
|
19
|
+
"@almadar/patterns": ">=2.10.0",
|
|
20
|
+
"@almadar/core": ">=2.9.1",
|
|
21
|
+
"firebase": "^11.4.0",
|
|
22
|
+
"@tanstack/react-query": "^5.67.3",
|
|
23
|
+
"react": "^19.0.0",
|
|
24
|
+
"react-dom": "^19.0.0",
|
|
25
|
+
"react-router-dom": "^7.3.0",
|
|
26
|
+
"zustand": "^5.0.3",
|
|
27
|
+
"react-markdown": "^9.0.1",
|
|
28
|
+
"remark-gfm": "^4.0.1",
|
|
29
|
+
"remark-math": "^6.0.0",
|
|
30
|
+
"rehype-katex": "^7.0.1",
|
|
31
|
+
"rehype-raw": "^7.0.0",
|
|
32
|
+
"react-force-graph-2d": "^1.25.5",
|
|
33
|
+
"@monaco-editor/react": "^4.7.0",
|
|
34
|
+
"monaco-editor": "^0.52.2",
|
|
35
|
+
"leaflet": "^1.9.4",
|
|
36
|
+
"react-leaflet": "^4.2.1",
|
|
37
|
+
"lucide-react": "^0.344.0",
|
|
38
|
+
"three": "^0.160.0",
|
|
39
|
+
"@react-three/fiber": "^9.0.0",
|
|
40
|
+
"@react-three/drei": "^9.92.0",
|
|
41
|
+
"@react-three/postprocessing": "^3.0.0",
|
|
42
|
+
"postprocessing": "^6.39.0"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@almadar/eslint-plugin": ">=2.3.0",
|
|
46
|
+
"@typescript-eslint/parser": "8.56.0",
|
|
47
|
+
"eslint": "10.0.0",
|
|
48
|
+
"@testing-library/react": "^16.1.0",
|
|
49
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
50
|
+
"@types/react": "^19.0.0",
|
|
51
|
+
"@types/react-dom": "^19.0.0",
|
|
52
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
53
|
+
"autoprefixer": "^10.4.20",
|
|
54
|
+
"jsdom": "^25.0.1",
|
|
55
|
+
"postcss": "^8.5.3",
|
|
56
|
+
"tailwindcss": "^3.4.17",
|
|
57
|
+
"typescript": "^5.7.3",
|
|
58
|
+
"vite": "^6.2.1",
|
|
59
|
+
"vitest": "^2.1.9"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App Entry Point
|
|
3
|
+
*
|
|
4
|
+
* Main application component with compiler-generated content placeholders.
|
|
5
|
+
* The Rust compiler replaces {{PLACEHOLDERS}} with generated code.
|
|
6
|
+
*
|
|
7
|
+
* Navigation works via schema-driven NavigationProvider:
|
|
8
|
+
* - NavigationProvider holds active page state
|
|
9
|
+
* - navigateTo() switches pages and fires INIT with payload
|
|
10
|
+
* - No dependency on react-router for internal navigation
|
|
11
|
+
* - react-router is optional for URL bookmarkability
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { BrowserRouter, Routes, Route } from 'react-router-dom';
|
|
15
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
16
|
+
import { ThemeProvider, UISlotProvider } from '@almadar/ui/context';
|
|
17
|
+
import { UISlotComponent, NotifyListener } from '@almadar/ui/components';
|
|
18
|
+
import {
|
|
19
|
+
EntityStoreProvider,
|
|
20
|
+
EventBusProvider,
|
|
21
|
+
VerificationProvider,
|
|
22
|
+
} from '@almadar/ui/providers';
|
|
23
|
+
import { NavigationProvider } from '@almadar/ui/renderer';
|
|
24
|
+
import { I18nProvider, createTranslate } from '@almadar/ui/hooks';
|
|
25
|
+
import defaultLocale from '@almadar/ui/locales/en.json';
|
|
26
|
+
|
|
27
|
+
// {{GENERATED_I18N_IMPORT}}
|
|
28
|
+
// {{GENERATED_IMPORTS}}
|
|
29
|
+
|
|
30
|
+
// Generated schema import (compiler fills this in)
|
|
31
|
+
// {{GENERATED_SCHEMA_IMPORT}}
|
|
32
|
+
const schema = { name: 'app', orbitals: [] }; // Placeholder - replaced by compiler
|
|
33
|
+
|
|
34
|
+
// {{GENERATED_I18N_VALUE}}
|
|
35
|
+
const { $meta: defaultMeta, ...defaultMessages } = defaultLocale;
|
|
36
|
+
const i18nValue = { locale: defaultMeta?.locale ?? 'en', direction: (defaultMeta?.direction ?? 'ltr') as 'ltr' | 'rtl', t: createTranslate(defaultMessages) };
|
|
37
|
+
|
|
38
|
+
const queryClient = new QueryClient({
|
|
39
|
+
defaultOptions: {
|
|
40
|
+
queries: {
|
|
41
|
+
staleTime: 1000 * 60,
|
|
42
|
+
refetchOnWindowFocus: false,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
function App() {
|
|
48
|
+
return (
|
|
49
|
+
<I18nProvider value={i18nValue}>
|
|
50
|
+
<QueryClientProvider client={queryClient}>
|
|
51
|
+
<ThemeProvider>
|
|
52
|
+
<EntityStoreProvider>
|
|
53
|
+
<EventBusProvider>
|
|
54
|
+
<VerificationProvider>
|
|
55
|
+
<UISlotProvider>
|
|
56
|
+
<NavigationProvider
|
|
57
|
+
schema={schema}
|
|
58
|
+
updateUrl={true}
|
|
59
|
+
onNavigate={(pageName, path, payload) => {
|
|
60
|
+
console.log('[App] Navigation:', { pageName, path, payload });
|
|
61
|
+
}}
|
|
62
|
+
>
|
|
63
|
+
<BrowserRouter>
|
|
64
|
+
<Routes>
|
|
65
|
+
{/* {{GENERATED_ROUTES}} */}
|
|
66
|
+
<Route path="/" element={<div>Welcome to Almadar</div>} />
|
|
67
|
+
</Routes>
|
|
68
|
+
{/* Portal slots rendered by compiled trait views via CompiledPortal */}
|
|
69
|
+
{/* Toast notifications (non-overlapping, always safe to render here) */}
|
|
70
|
+
<UISlotComponent slot="toast" portal />
|
|
71
|
+
<NotifyListener />
|
|
72
|
+
</BrowserRouter>
|
|
73
|
+
</NavigationProvider>
|
|
74
|
+
</UISlotProvider>
|
|
75
|
+
</VerificationProvider>
|
|
76
|
+
</EventBusProvider>
|
|
77
|
+
</EntityStoreProvider>
|
|
78
|
+
</ThemeProvider>
|
|
79
|
+
</QueryClientProvider>
|
|
80
|
+
</I18nProvider>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export default App;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { initializeApp, getApps, getApp, FirebaseApp } from 'firebase/app';
|
|
2
|
+
import { getAuth, Auth } from 'firebase/auth';
|
|
3
|
+
|
|
4
|
+
let app: FirebaseApp;
|
|
5
|
+
let auth: Auth;
|
|
6
|
+
|
|
7
|
+
export async function initializeFirebase(): Promise<void> {
|
|
8
|
+
if (getApps().length > 0) {
|
|
9
|
+
app = getApp();
|
|
10
|
+
auth = getAuth(app);
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let config;
|
|
15
|
+
try {
|
|
16
|
+
// On Firebase Hosting, fetch auto-config from reserved URL
|
|
17
|
+
const res = await fetch('/__/firebase/init.json');
|
|
18
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
19
|
+
config = await res.json();
|
|
20
|
+
} catch {
|
|
21
|
+
// Fall back to env vars for local development
|
|
22
|
+
config = {
|
|
23
|
+
apiKey: import.meta.env.VITE_APP_FIREBASE_API_KEY,
|
|
24
|
+
authDomain: import.meta.env.VITE_APP_FIREBASE_AUTH_DOMAIN,
|
|
25
|
+
projectId: import.meta.env.VITE_APP_FIREBASE_PROJECT_ID,
|
|
26
|
+
storageBucket: import.meta.env.VITE_APP_FIREBASE_STORAGE_BUCKET,
|
|
27
|
+
messagingSenderId: import.meta.env.VITE_APP_FIREBASE_MESSAGING_SENDER_ID,
|
|
28
|
+
appId: import.meta.env.VITE_APP_FIREBASE_APP_ID,
|
|
29
|
+
measurementId: import.meta.env.VITE_APP_FIREBASE_MEASUREMENT_ID,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
app = initializeApp(config);
|
|
34
|
+
auth = getAuth(app);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { auth, app };
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import React, { createContext, useContext, useEffect, useState } from 'react';
|
|
2
|
+
import { User } from 'firebase/auth';
|
|
3
|
+
import { auth, initializeFirebase } from '../../config/firebase';
|
|
4
|
+
import { authService } from './authService';
|
|
5
|
+
import { AuthContextType } from './types';
|
|
6
|
+
|
|
7
|
+
const AuthContext = createContext<AuthContextType | undefined>(undefined);
|
|
8
|
+
|
|
9
|
+
export const useAuthContext = () => {
|
|
10
|
+
const context = useContext(AuthContext);
|
|
11
|
+
if (context === undefined) {
|
|
12
|
+
throw new Error('useAuthContext must be used within an AuthProvider');
|
|
13
|
+
}
|
|
14
|
+
return context;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
interface AuthProviderProps {
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const AuthProvider: React.FC<AuthProviderProps> = ({ children }) => {
|
|
22
|
+
const [user, setUser] = useState<User | null>(null);
|
|
23
|
+
const [loading, setLoading] = useState(true);
|
|
24
|
+
const [error, setError] = useState<string | null>(null);
|
|
25
|
+
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
let unsubscribe: (() => void) | undefined;
|
|
28
|
+
|
|
29
|
+
initializeFirebase().then(() => {
|
|
30
|
+
unsubscribe = auth.onAuthStateChanged((firebaseUser) => {
|
|
31
|
+
setUser(firebaseUser);
|
|
32
|
+
setLoading(false);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
return () => unsubscribe?.();
|
|
37
|
+
}, []);
|
|
38
|
+
|
|
39
|
+
const clearError = () => setError(null);
|
|
40
|
+
|
|
41
|
+
const signInWithGoogle = async () => {
|
|
42
|
+
try {
|
|
43
|
+
setLoading(true);
|
|
44
|
+
clearError();
|
|
45
|
+
await authService.signInWithGoogle();
|
|
46
|
+
} catch (err: unknown) {
|
|
47
|
+
setLoading(false);
|
|
48
|
+
const firebaseErr = err as { code?: string; message?: string };
|
|
49
|
+
const isCancel =
|
|
50
|
+
firebaseErr.code === 'auth/popup-closed-by-user' ||
|
|
51
|
+
firebaseErr.code === 'auth/cancelled-popup-request' ||
|
|
52
|
+
firebaseErr.code === 'auth/popup-blocked';
|
|
53
|
+
if (!isCancel) {
|
|
54
|
+
setError(firebaseErr.message ?? 'Google sign-in failed');
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const signInWithEmail = async (email: string, password: string) => {
|
|
60
|
+
try {
|
|
61
|
+
setLoading(true);
|
|
62
|
+
clearError();
|
|
63
|
+
await authService.signInWithEmail(email, password);
|
|
64
|
+
} catch (err: unknown) {
|
|
65
|
+
setLoading(false);
|
|
66
|
+
setError((err as { message?: string }).message ?? 'Sign-in failed');
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const signUpWithEmail = async (email: string, password: string, displayName?: string) => {
|
|
71
|
+
try {
|
|
72
|
+
setLoading(true);
|
|
73
|
+
clearError();
|
|
74
|
+
await authService.signUpWithEmail(email, password, displayName);
|
|
75
|
+
} catch (err: unknown) {
|
|
76
|
+
setLoading(false);
|
|
77
|
+
setError((err as { message?: string }).message ?? 'Sign-up failed');
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const sendSignInLinkToEmail = async (email: string) => {
|
|
82
|
+
try {
|
|
83
|
+
setLoading(true);
|
|
84
|
+
clearError();
|
|
85
|
+
const actionCodeSettings = {
|
|
86
|
+
url: `${window.location.origin}/login`,
|
|
87
|
+
handleCodeInApp: true,
|
|
88
|
+
};
|
|
89
|
+
await authService.sendSignInLinkToEmail(email, actionCodeSettings);
|
|
90
|
+
setLoading(false);
|
|
91
|
+
} catch (err: unknown) {
|
|
92
|
+
setLoading(false);
|
|
93
|
+
setError((err as { message?: string }).message ?? 'Failed to send sign-in link');
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const signInWithEmailLink = async (email: string, emailLink: string) => {
|
|
98
|
+
try {
|
|
99
|
+
setLoading(true);
|
|
100
|
+
clearError();
|
|
101
|
+
await authService.signInWithEmailLink(email, emailLink);
|
|
102
|
+
} catch (err: unknown) {
|
|
103
|
+
setLoading(false);
|
|
104
|
+
setError((err as { message?: string }).message ?? 'Email link sign-in failed');
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const isSignInWithEmailLink = (emailLink: string): boolean => {
|
|
109
|
+
return authService.isSignInWithEmailLink(emailLink);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const signOut = async () => {
|
|
113
|
+
try {
|
|
114
|
+
setLoading(true);
|
|
115
|
+
await authService.signOut();
|
|
116
|
+
setUser(null);
|
|
117
|
+
setLoading(false);
|
|
118
|
+
} catch (err: unknown) {
|
|
119
|
+
setLoading(false);
|
|
120
|
+
setError((err as { message?: string }).message ?? 'Sign-out failed');
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const value: AuthContextType = {
|
|
125
|
+
user,
|
|
126
|
+
loading,
|
|
127
|
+
error,
|
|
128
|
+
signInWithGoogle,
|
|
129
|
+
signOut,
|
|
130
|
+
signInWithEmail,
|
|
131
|
+
signUpWithEmail,
|
|
132
|
+
sendSignInLinkToEmail,
|
|
133
|
+
signInWithEmailLink,
|
|
134
|
+
isSignInWithEmailLink,
|
|
135
|
+
clearError,
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
return <AuthContext.Provider value={value}>{children}</AuthContext.Provider>;
|
|
139
|
+
};
|