create-astram-app 0.5.0 → 0.7.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 +256 -38
- package/dist/add-frontend.js.map +1 -1
- package/dist/index.js +14 -9
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/template/README.md +51 -20
- package/template/frontend/README.md +21 -11
- package/template/frontend/index.html +16 -0
- package/template/frontend/package.json +1 -1
- package/template/frontend/src/App.jsx +82 -20
- package/template/frontend/src/auth/AuthContext.jsx +141 -21
- package/template/frontend/src/auth/routeGate.js +31 -0
- package/template/frontend/src/auth/routeGate.test.mjs +59 -0
- package/template/frontend/src/auth/sessionFlow.js +27 -0
- package/template/frontend/src/auth/sessionFlow.test.mjs +63 -0
- package/template/frontend/src/components/EntityList.jsx +1 -7
- package/template/frontend/src/components/PageHeader.jsx +5 -4
- package/template/frontend/src/components/ShareDialog.jsx +3 -5
- package/template/frontend/src/components/access/CollapsibleGroup.jsx +4 -1
- package/template/frontend/src/components/ui/alert-dialog.tsx +27 -50
- package/template/frontend/src/components/ui/alert.tsx +17 -23
- package/template/frontend/src/components/ui/avatar.tsx +8 -20
- package/template/frontend/src/components/ui/badge.tsx +17 -26
- package/template/frontend/src/components/ui/button.tsx +22 -24
- package/template/frontend/src/components/ui/card.tsx +19 -36
- package/template/frontend/src/components/ui/checkbox.tsx +7 -10
- package/template/frontend/src/components/ui/date-field.tsx +26 -27
- package/template/frontend/src/components/ui/dialog.tsx +24 -40
- package/template/frontend/src/components/ui/dropdown-menu.tsx +25 -54
- package/template/frontend/src/components/ui/input-otp.tsx +1 -4
- package/template/frontend/src/components/ui/label.tsx +10 -12
- package/template/frontend/src/components/ui/searchable-select.tsx +1 -3
- package/template/frontend/src/components/ui/select.tsx +31 -43
- package/template/frontend/src/components/ui/separator.tsx +6 -6
- package/template/frontend/src/components/ui/sheet.tsx +29 -38
- package/template/frontend/src/components/ui/skeleton.tsx +3 -3
- package/template/frontend/src/components/ui/sonner.tsx +7 -7
- package/template/frontend/src/components/ui/table.tsx +56 -70
- package/template/frontend/src/components/ui/tooltip.tsx +7 -11
- package/template/frontend/src/config/branding.js +1 -4
- package/template/frontend/src/hooks/useMobile.tsx +4 -6
- package/template/frontend/src/index.css +5 -2
- package/template/frontend/src/pages/Dashboard.jsx +13 -7
- package/template/frontend/src/pages/ForgotPassword.jsx +9 -2
- package/template/frontend/src/pages/Login.jsx +85 -70
- package/template/frontend/src/pages/ResetPassword.jsx +9 -2
- package/template/frontend/src/pages/access/AccessForm.jsx +49 -15
- package/template/frontend/src/pages/access/AccessPage.jsx +10 -6
- package/template/frontend/src/pages/access/RecordPoliciesPage.jsx +9 -2
- package/template/frontend/src/pages/account/AccountLayout.jsx +11 -6
- package/template/frontend/src/pages/account/ChangePasswordPage.jsx +2 -2
- package/template/frontend/src/pages/account/ReenrollPage.jsx +3 -5
- package/template/frontend/src/pages/account/TwoFactorPage.jsx +3 -8
- package/template/frontend/src/pages/companies/CompaniesPage.jsx +7 -9
- package/template/frontend/src/pages/cross-tenant/GrantForm.jsx +41 -8
- package/template/frontend/src/pages/cross-tenant/GrantsPage.jsx +30 -7
- package/template/frontend/src/pages/cross-tenant/InboxPage.jsx +12 -3
- package/template/frontend/src/pages/roles/RolesPage.jsx +5 -9
- package/template/frontend/src/pages/service-accounts/ServiceAccountsPage.jsx +77 -18
- package/template/frontend/src/pages/service-accounts/accessModel.js +22 -0
- package/template/frontend/src/pages/service-accounts/accessModel.test.mjs +28 -0
- package/template/frontend/src/pages/users/MembershipCard.jsx +3 -1
- package/template/frontend/src/pages/users/PostingRow.jsx +8 -14
- package/template/frontend/src/pages/users/UsersPage.jsx +7 -9
- package/template/frontend/src/platform/httpClient.js +18 -0
- package/template/frontend/src/platform/httpClient.test.mjs +60 -0
- package/template/frontend/src/platform/sessionStore.js +55 -13
- package/template/frontend/src/platform/sessionStore.test.mjs +89 -0
- package/template/frontend/src/platform/shieldTransport.js +6 -0
- package/template/frontend/src/platform/shieldTransport.test.mjs +84 -5
- package/template/frontend/src/shell/AppShell.jsx +10 -12
- package/template/frontend/src/shell/Sidebar.jsx +15 -3
- package/template/frontend/src/shell/nav.js +1 -3
- package/template/frontend/vite.config.js +19 -1
- package/template/server/_env.example +22 -1
- package/template/server/eslint.config.mjs +314 -0
- package/template/server/package.json +11 -11
- package/template/server/scripts/dev.mjs +17 -6
- package/template/server/scripts/sync-astram-guide.mjs +45 -19
- package/template/server/src/app.module.ts +16 -7
- package/template/server/src/health/demo.controller.ts +16 -12
- package/template/server/src/main.ts +23 -1
- package/template/server/eslint.config.js +0 -95
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
// ESLint flat config for an Astram consumer app.
|
|
2
|
-
//
|
|
3
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
4
|
-
// THE PHYSICAL WALL — backstop (do not remove).
|
|
5
|
-
//
|
|
6
|
-
// The Astram paved road is the ONE way features touch data: inject the framework's
|
|
7
|
-
// RecordEngine (from @astram/engine) and go through the pipe (permission gate +
|
|
8
|
-
// audit are mandatory, cross-tenant isolation is enforced). A feature must NEVER
|
|
9
|
-
// reach the database directly — a raw mariadb/typeorm pool, a DataSource, a
|
|
10
|
-
// QueryRunner, or a repository `.save()`/`.query()` skips the security layer
|
|
11
|
-
// entirely (this is exactly how astram-org's ORS got bypassed 165 times).
|
|
12
|
-
//
|
|
13
|
-
// The PRIMARY wall is structural: the framework never hands feature scope a pool
|
|
14
|
-
// (EngineModule seals it). THIS lint rule is the BACKSTOP: it fails the build if a
|
|
15
|
-
// file under `src/features/**` imports a raw DB symbol or calls a raw DB method, so
|
|
16
|
-
// an off-road attempt is a red build, not a silent success.
|
|
17
|
-
//
|
|
18
|
-
// If you hit this rule because the pipe can't do what you need: STOP. Do NOT work
|
|
19
|
-
// around it. Record the gap in `.astram/guide/gaps.md` and raise it with the
|
|
20
|
-
// framework — the capability must be added to @astram/engine (the gap-flag loop).
|
|
21
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
22
|
-
|
|
23
|
-
import js from '@eslint/js';
|
|
24
|
-
import tseslint from 'typescript-eslint';
|
|
25
|
-
|
|
26
|
-
/** Raw DB packages a feature must never import directly. */
|
|
27
|
-
const FORBIDDEN_DB_IMPORTS = [
|
|
28
|
-
{ name: 'mariadb', message: 'Wall: features never open a DB pool — use the RecordEngine (@astram/engine).' },
|
|
29
|
-
{ name: 'mysql', message: 'Wall: features never open a DB driver — use the RecordEngine (@astram/engine).' },
|
|
30
|
-
{ name: 'mysql2', message: 'Wall: features never open a DB driver — use the RecordEngine (@astram/engine).' },
|
|
31
|
-
{ name: 'typeorm', message: 'Wall: no ORM in features — use the RecordEngine (@astram/engine).' },
|
|
32
|
-
{ name: '@nestjs/typeorm', message: 'Wall: no ORM in features — use the RecordEngine (@astram/engine).' },
|
|
33
|
-
{ name: 'pg', message: 'Wall: features never open a DB driver — use the RecordEngine (@astram/engine).' },
|
|
34
|
-
{ name: 'knex', message: 'Wall: no query builder in features — use the RecordEngine (@astram/engine).' },
|
|
35
|
-
];
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Named imports that hand a feature raw DB access even from an ALLOWED package.
|
|
39
|
-
* `SHIELD_DB_POOL` is exported from `@astram/guard` (a package a feature legitimately
|
|
40
|
-
* imports for other reasons), so it must be blocked by NAME on that path — the engine
|
|
41
|
-
* owns the pool; feature scope must never import the pool token.
|
|
42
|
-
*/
|
|
43
|
-
const FORBIDDEN_DB_NAMED_FROM = [
|
|
44
|
-
{
|
|
45
|
-
name: '@astram/guard',
|
|
46
|
-
importNames: ['SHIELD_DB_POOL'],
|
|
47
|
-
message: 'Wall: the DB pool is sealed inside the engine — features use the RecordEngine (@astram/engine).',
|
|
48
|
-
},
|
|
49
|
-
];
|
|
50
|
-
|
|
51
|
-
export default tseslint.config(
|
|
52
|
-
js.configs.recommended,
|
|
53
|
-
...tseslint.configs.recommended,
|
|
54
|
-
{
|
|
55
|
-
ignores: ['dist/**', 'node_modules/**'],
|
|
56
|
-
},
|
|
57
|
-
// ── The wall: scoped to feature code ──────────────────────────────────────
|
|
58
|
-
{
|
|
59
|
-
files: ['src/features/**/*.ts'],
|
|
60
|
-
rules: {
|
|
61
|
-
'no-restricted-imports': [
|
|
62
|
-
'error',
|
|
63
|
-
{
|
|
64
|
-
paths: [...FORBIDDEN_DB_IMPORTS, ...FORBIDDEN_DB_NAMED_FROM],
|
|
65
|
-
patterns: [
|
|
66
|
-
{
|
|
67
|
-
group: ['**/adapters/mariadb-*', '@astram/engine/dist/adapters/*'],
|
|
68
|
-
message:
|
|
69
|
-
'Wall: the engine adapters (pool/uow/audit) are framework-internal — features use the RecordEngine facade only.',
|
|
70
|
-
},
|
|
71
|
-
],
|
|
72
|
-
},
|
|
73
|
-
],
|
|
74
|
-
// Block raw query-runner / repository calls even if a pool were obtained.
|
|
75
|
-
'no-restricted-syntax': [
|
|
76
|
-
'error',
|
|
77
|
-
{
|
|
78
|
-
selector:
|
|
79
|
-
"CallExpression[callee.property.name='createQueryRunner']",
|
|
80
|
-
message: 'Wall: no QueryRunner in features — use the RecordEngine (@astram/engine).',
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
selector:
|
|
84
|
-
"CallExpression[callee.property.name='getRepository']",
|
|
85
|
-
message: 'Wall: no repository access in features — use the RecordEngine (@astram/engine).',
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
selector:
|
|
89
|
-
"CallExpression[callee.property.name='createPool']",
|
|
90
|
-
message: 'Wall: features never create a DB pool — use the RecordEngine (@astram/engine).',
|
|
91
|
-
},
|
|
92
|
-
],
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
);
|