Skip to content

Commit 8fbcde9

Browse files
committed
update docs for npm i command, expose dataConnector
1 parent 38dfb8f commit 8fbcde9

File tree

19 files changed

+27
-30
lines changed

19 files changed

+27
-30
lines changed

Changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2020
# Improved
2121

2222
- Added separate BeforeCreateSave function in types without oldRecord and make oldRecord Mandatory in existing BeforeSaveFunction
23+
24+
- Added dataConnector: IAdminForthDataSourceConnectorBase; into IOperationalResource - for reusing connectors from users code
2325

2426
## [v1.5.7] - 2024-12-09
2527

adminforth/documentation/blog/2024-10-01-ai-blog/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ nvm use 20
4141
mkdir ai-blog
4242
cd ai-blog
4343
npm init -y
44-
npm install adminforth @adminforth/upload @adminforth/rich-editor @adminforth/chat-gpt \
45-
express slugify http-proxy @types/express typescript tsx @types/node --save-dev
44+
npm i adminforth @adminforth/upload @adminforth/rich-editor @adminforth/chat-gpt \
45+
express slugify http-proxy @types/express typescript tsx @types/node -D
4646
npx --yes tsc --init --module NodeNext --target ESNext
4747
```
4848

adminforth/documentation/docs/tutorial/001-gettingStarted.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ npm install adminforth
2626
AdminForth does not provide own HTTP server, but can add own listeners over exisitng [Express](https://expressjs.com/) server (Fastify support is planned in future). This allows to create custom APIs for backoffice in a way you know.
2727

2828
```bash
29-
npm install express
29+
npm i express
3030
```
3131

3232
You can use AdminForth in pure Node, but we recommend using TypeScript for better development experience:
3333

3434
```bash
35-
npm install typescript@5.4.5 tsx@4.11.2 @types/express @types/node --save-dev
35+
npm i typescript@5.4.5 tsx@4.11.2 @types/express @types/node -D
3636
echo '{
3737
"compilerOptions": {
3838
"target": "esnext",

adminforth/documentation/docs/tutorial/01-helloWorld.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ nvm use 20
2525
mkdir af-hello
2626
cd af-hello
2727
npm init -y
28-
npm install adminforth express @types/express typescript tsx @types/node --save-dev
28+
npm i adminforth express @types/express typescript tsx @types/node -D
2929
npx --yes tsc --init --module NodeNext --target ESNext
3030
```
3131

adminforth/documentation/docs/tutorial/03-Customization/02-customFieldRendering.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ npm init -y
175175
And simply do `npm install` for the package you need:
176176

177177
```bash
178-
npm install <some package> --save-dev
178+
npm i <some package> -D
179179
```
180180

181181

adminforth/documentation/docs/tutorial/03-Customization/06-customPages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ To add custom package to SPA bundle you have to initialize npm in `custom` direc
99
```bash
1010
cd ./custom
1111
npm init -y
12-
npm install apexcharts --save-dev
12+
npm i apexcharts -D
1313
```
1414

1515
> 👆 Note: for better development experience we recommend to create file `custom/tsconfig.json` with the following content:

adminforth/documentation/docs/tutorial/03-Customization/08-pageInjections.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ onMounted(async () => {
138138
Then initialize npm in `custom` directory if you didn't do this and install required packages:
139139
```bash
140140
npm init -y
141-
npm install apexcharts --save-dev
141+
npm i apexcharts -D
142142
```
143143

144144
Also we have to add an Api to get percentages:

adminforth/documentation/docs/tutorial/06-Advanced/01-plugin-development.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ mkdir -p af-plugin-chatgpt
2323
cd af-plugin-chatgpt
2424
npm init -y
2525
touch index.ts
26-
npm i --save-dev typescript @types/node
26+
npm i typescript @types/node -D
2727
```
2828

2929
Edit `package.json`:
@@ -221,7 +221,7 @@ npm init -y
221221
Now install our dependency:
222222

223223
```bash
224-
npm i --save-dev vue-suggestion-input
224+
npm i vue-suggestion-input -D
225225
```
226226

227227
Create file `completionInput.vue`:

adminforth/modules/utils.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,6 @@ export function md5hash(str:string) {
370370
export class RateLimiter {
371371
static counterData = {};
372372

373-
374-
375-
376373
/**
377374
* Very dirty version of ratelimiter for demo purposes (should not be considered as production ready)
378375
* Will be used as RateLimiter.checkRateLimit('key', '5/24h', clientIp)
@@ -432,7 +429,6 @@ export class RateLimiter {
432429
RateLimiter.decrementCounter(key, clientIp);
433430
}, whenClear.getTime() - Date.now());
434431

435-
436432
return { error: false };
437433

438434
}
@@ -445,7 +441,6 @@ export class RateLimiter {
445441
RateLimiter.counterData[key][ip] = 0;
446442
}
447443
RateLimiter.counterData[key][ip]++;
448-
console.log('🔄️🔄️🔄️🔄️🔄️🔄️ incremented', key, ip, this.counterData[key][ip]);
449444
}
450445

451446
static decrementCounter(key: string, ip: string) {
@@ -458,9 +453,6 @@ export class RateLimiter {
458453
if (RateLimiter.counterData[key][ip] > 0) {
459454
RateLimiter.counterData[key][ip]--;
460455
}
461-
console.log('🔄️🔄️🔄️🔄️🔄️🔄️ decremented', key, ip, this.counterData[key][ip]);
462-
463456
}
464457

465-
466458
}

adminforth/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)