adminforth 1.1.80 → 1.1.82
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/dist/index.js +1 -1
- package/dist/modules/codeInjector.js +7 -0
- package/dist/spa/spa/vite.config.ts +1 -1
- package/index.ts +2 -2
- package/modules/codeInjector.ts +11 -1
- package/package.json +1 -1
- package/spa/vite.config.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -612,7 +612,7 @@ class AdminForth {
|
|
|
612
612
|
username
|
|
613
613
|
};
|
|
614
614
|
const beforeLoginConfirmation = this.config.auth.beforeLoginConfirmation;
|
|
615
|
-
if (beforeLoginConfirmation.length) {
|
|
615
|
+
if (beforeLoginConfirmation === null || beforeLoginConfirmation === void 0 ? void 0 : beforeLoginConfirmation.length) {
|
|
616
616
|
for (const hook of beforeLoginConfirmation) {
|
|
617
617
|
const resp = yield hook({ userRecord: adminUser });
|
|
618
618
|
if ((_d = resp === null || resp === void 0 ? void 0 : resp.body) === null || _d === void 0 ? void 0 : _d.setCookie) {
|
|
@@ -28,6 +28,11 @@ const execAsync = promisify(exec);
|
|
|
28
28
|
function hashify(obj) {
|
|
29
29
|
return crypto.createHash('sha256').update(JSON.stringify(obj)).digest('hex');
|
|
30
30
|
}
|
|
31
|
+
function notifyWatcherIssue(limit) {
|
|
32
|
+
console.log('Ran out of file handles after watching %s files.', limit);
|
|
33
|
+
console.log('Falling back to polling which uses more CPU.');
|
|
34
|
+
console.log('Run ulimit -n 10000 to increase the limit for open files.');
|
|
35
|
+
}
|
|
31
36
|
class CodeInjector {
|
|
32
37
|
cleanup() {
|
|
33
38
|
console.log('Cleaning up...');
|
|
@@ -425,6 +430,7 @@ class CodeInjector {
|
|
|
425
430
|
console.log(`File ${file} changed ${x}, preparing sources...`);
|
|
426
431
|
yield this.prepareSources({ filesUpdated: [file.replace(spaPath + '/', '')] });
|
|
427
432
|
}));
|
|
433
|
+
watcher.on('fallback', notifyWatcherIssue);
|
|
428
434
|
this.allWatchers.push(watcher);
|
|
429
435
|
});
|
|
430
436
|
}
|
|
@@ -488,6 +494,7 @@ class CodeInjector {
|
|
|
488
494
|
// for now do nothing
|
|
489
495
|
}
|
|
490
496
|
}));
|
|
497
|
+
watcher.on('fallback', notifyWatcherIssue);
|
|
491
498
|
this.allWatchers.push(watcher);
|
|
492
499
|
});
|
|
493
500
|
}
|
|
@@ -31,7 +31,7 @@ const customLogger = {
|
|
|
31
31
|
|
|
32
32
|
// https://vitejs.dev/config/
|
|
33
33
|
export default defineConfig({
|
|
34
|
-
base: process.env.
|
|
34
|
+
base: process.env.VUE_APP_ADMINFORTH_PUBLIC_PATH || '/',
|
|
35
35
|
server: {
|
|
36
36
|
port: 5173,
|
|
37
37
|
strictPort: true, // better predictability
|
package/index.ts
CHANGED
|
@@ -706,8 +706,8 @@ class AdminForth implements AdminForthClass {
|
|
|
706
706
|
pk: userRecord[userResource.columns.find((col) => col.primaryKey).name],
|
|
707
707
|
username
|
|
708
708
|
};
|
|
709
|
-
const beforeLoginConfirmation = this.config.auth.beforeLoginConfirmation as BeforeLoginConfirmationFunction[];
|
|
710
|
-
if (beforeLoginConfirmation
|
|
709
|
+
const beforeLoginConfirmation = this.config.auth.beforeLoginConfirmation as (BeforeLoginConfirmationFunction[] | undefined);
|
|
710
|
+
if (beforeLoginConfirmation?.length){
|
|
711
711
|
for (const hook of beforeLoginConfirmation) {
|
|
712
712
|
const resp = await hook({ userRecord:adminUser});
|
|
713
713
|
if (resp?.body?.setCookie){
|
package/modules/codeInjector.ts
CHANGED
|
@@ -30,6 +30,12 @@ function hashify(obj) {
|
|
|
30
30
|
('sha256').update(JSON.stringify(obj)).digest('hex');
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
function notifyWatcherIssue(limit) {
|
|
34
|
+
console.log('Ran out of file handles after watching %s files.', limit);
|
|
35
|
+
console.log('Falling back to polling which uses more CPU.');
|
|
36
|
+
console.log('Run ulimit -n 10000 to increase the limit for open files.');
|
|
37
|
+
}
|
|
38
|
+
|
|
33
39
|
class CodeInjector implements CodeInjectorType {
|
|
34
40
|
|
|
35
41
|
allWatchers = [];
|
|
@@ -490,6 +496,7 @@ async watchForReprepare({ verbose }) {
|
|
|
490
496
|
await this.prepareSources({ filesUpdated: [file.replace(spaPath + '/', '')] });
|
|
491
497
|
}
|
|
492
498
|
)
|
|
499
|
+
watcher.on('fallback', notifyWatcherIssue);
|
|
493
500
|
this.allWatchers.push(watcher);
|
|
494
501
|
}
|
|
495
502
|
|
|
@@ -561,7 +568,10 @@ async watchForReprepare({ verbose }) {
|
|
|
561
568
|
// for now do nothing
|
|
562
569
|
}
|
|
563
570
|
}
|
|
564
|
-
)
|
|
571
|
+
);
|
|
572
|
+
|
|
573
|
+
watcher.on('fallback', notifyWatcherIssue);
|
|
574
|
+
|
|
565
575
|
this.allWatchers.push(watcher);
|
|
566
576
|
}
|
|
567
577
|
|
package/package.json
CHANGED
package/spa/vite.config.ts
CHANGED
|
@@ -31,7 +31,7 @@ const customLogger = {
|
|
|
31
31
|
|
|
32
32
|
// https://vitejs.dev/config/
|
|
33
33
|
export default defineConfig({
|
|
34
|
-
base: process.env.
|
|
34
|
+
base: process.env.VUE_APP_ADMINFORTH_PUBLIC_PATH || '/',
|
|
35
35
|
server: {
|
|
36
36
|
port: 5173,
|
|
37
37
|
strictPort: true, // better predictability
|