You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,23 @@
1
1
2
2
# AGENTS.md
3
3
4
+
## Package manager
5
+
6
+
All packages and projects in this repo use `pnpm` and not `npm`.
7
+
Howeverer internally (e.g. in `codeInjector`) adminforth still supports both `npm` and `pnpm` style install commands, so users of framework itself can use it with either package manager. But in all dev demo/live demo, plugins, adapters, and documentation, we use `pnpm` as the standard.
8
+
9
+
## Package names rules
10
+
11
+
12
+
All adapters and plugins always have `@adminforth/` prefix in their package name, followed by short lowercase kebab-case plugin/adpater slug.
13
+
14
+
Every plugin has at least one Docusaurus docs page, which should use the path `/docs/tutorial/Plugins/<plugin-slug>/`.
15
+
16
+
Same for adapters, but with `/docs/tutorial/Adapters/<adapter-slug>/` path.
17
+
18
+
Page names in docusarus should be human readabale. We should not use `AuditLog` but instead we should have `Audit Log` via whitespace.
19
+
20
+
4
21
## General engineering rules
5
22
6
23
Write code as if the system contracts are already defined and trusted.
resourceId: 'aparts', // resourceId is defaulted to table name but you can redefine it like this e.g.
209
+
//diff-add
209
210
// in case of same table names from different data sources
210
211
label: 'Apartments', // label is defaulted to table name but you can change it
211
212
//diff-add
212
213
recordLabel: (r) =>`🏡 ${r.title}`,
213
214
columns: [
214
215
{
215
216
name: 'id',
217
+
//diff-add
216
218
type: AdminForthDataTypes.STRING,
217
219
//diff-add
218
220
label: 'Identifier', // if you wish you can redefine label, defaulted to uppercased name
219
221
showIn: { // show column in filter and in show page
220
-
//diff-add
222
+
//diff-remove
223
+
all:true,
224
+
//diff-add
221
225
list: false,
222
226
//diff-add
223
227
edit: false,
224
228
//diff-add
225
229
create: false,
226
230
},
231
+
//diff-add
227
232
primaryKey: true,
228
233
//diff-add
229
234
fillOnCreate: ({ initialRecord, adminUser }) =>Math.random().toString(36).substring(7), // called during creation to generate content of field, initialRecord is values user entered, adminUser object of user who creates record
230
235
},
231
236
{
232
-
name: 'title',
237
+
name: "title",
238
+
//diff-add
233
239
required: true,
234
-
showIn: { all: true }, // all available options
240
+
showIn: {
241
+
all:true, // all available options
242
+
},
243
+
//diff-add
235
244
type: AdminForthDataTypes.STRING,
236
245
//diff-add
237
246
maxLength: 255, // you can set max length for string fields
Copy file name to clipboardExpand all lines: adminforth/documentation/docs/tutorial/03-Customization/04-hooks.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ When user opens edit page, AdminForth makes a request to the backend to get the
44
44
45
45
Practically you can use `show.afterDatasourceResponse` to modify or add some data before it is displayed on the edit page.
46
46
47
-
For example [upload plugin](/docs/tutorial/Plugins/05-0-upload/) uses this hook to generate signed preview URL so user can see existing uploaded file preview in form, and at the same time database stores only original file path which might be not accessible without presigned URL.
47
+
For example [upload plugin](/docs/tutorial/Plugins/upload/) uses this hook to generate signed preview URL so user can see existing uploaded file preview in form, and at the same time database stores only original file path which might be not accessible without presigned URL.
Copy file name to clipboardExpand all lines: adminforth/documentation/docs/tutorial/03-Customization/10-menuConfiguration.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -277,7 +277,7 @@ auth: {
277
277
278
278
```
279
279
280
-
This syntax can be use to get unique avatar for each user of hardcode avatar, but it makes more sense to use it with [upload plugin](https://adminforth.dev/docs/tutorial/Plugins/05-0-upload/#using-plugin-for-uploading-avatar)
280
+
This syntax can be use to get unique avatar for each user of hardcode avatar, but it makes more sense to use it with [upload plugin](https://adminforth.dev/docs/tutorial/Plugins/upload/#using-plugin-for-uploading-avatar)
If you need to unsubscribe from a whole family of topics, for example when route changes can leave old dynamic subscriptions behind, you can use `unsubscribeByPrefix`:
24
+
25
+
```javascript
26
+
importwebsocketfrom'@/websocket';
27
+
28
+
websocket.unsubscribeByPrefix('/topic-name/');
29
+
```
30
+
31
+
This will unsubscribe from all topics whose name starts with the prefix.
32
+
33
+
It is useful for dynamic topics like `/topic-name/<resourceId>/<recordId>` where a stale subscription can update the wrong page if component unmount does not happen exactly when you expect.
[Email adapter base class](https://github.com/devforth/adminforth/blob/917d897c866975a4aee29273377f2c07cb6ddf81/adminforth/types/adapters/EmailAdapter.ts#L17)
6
+
7
+
## AWS SES Email Adapter
8
+
9
+
```bash
10
+
pnpm i @adminforth/email-adapter-aws-ses
11
+
```
12
+
13
+
Enables email delivery via [Amazon Simple Email Service (SES)](https://aws.amazon.com/ses/), suitable for high-volume, programmatic email sending.
14
+
15
+
## Mailgun Email Adapter
16
+
17
+
```bash
18
+
pnpm i @adminforth/email-adapter-mailgun
19
+
```
20
+
21
+
Allows sending transactional or marketing emails using [Mailgun](https://www.mailgun.com/), a developer-friendly email service.
0 commit comments