adminforth 1.0.80 → 1.0.81

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 CHANGED
@@ -76,6 +76,13 @@ class AdminForth {
76
76
  if (!this.config.customization.customComponentsDir) {
77
77
  this.config.customization.customComponentsDir = './custom';
78
78
  }
79
+ try {
80
+ // check customComponentsDir exists
81
+ fs.accessSync(this.config.customization.customComponentsDir, fs.constants.R_OK);
82
+ }
83
+ catch (e) {
84
+ this.config.customization.customComponentsDir = undefined;
85
+ }
79
86
  if (this.config.auth) {
80
87
  if (!this.config.auth.resourceId) {
81
88
  throw new Error('No config.auth.resourceId defined');
@@ -394,12 +394,7 @@ class CodeInjector {
394
394
  watchCustomComponentsForCopy(_a) {
395
395
  return __awaiter(this, arguments, void 0, function* ({ verbose }) {
396
396
  const customComponentsDir = this.adminforth.config.customization.customComponentsDir;
397
- // check dir exists
398
- try {
399
- yield fs.promises.access(customComponentsDir, fs.constants.F_OK);
400
- }
401
- catch (e) {
402
- console.log(`Custom components dir "${customComponentsDir}" does not exist, feel free to create it place custom assets and Vue files there`);
397
+ if (!customComponentsDir) {
403
398
  return;
404
399
  }
405
400
  // check if folder exists
package/index.ts CHANGED
@@ -98,6 +98,13 @@ class AdminForth implements AdminForthClass {
98
98
  this.config.customization.customComponentsDir = './custom';
99
99
  }
100
100
 
101
+ try {
102
+ // check customComponentsDir exists
103
+ fs.accessSync(this.config.customization.customComponentsDir, fs.constants.R_OK);
104
+ } catch (e) {
105
+ this.config.customization.customComponentsDir = undefined;
106
+ }
107
+
101
108
  if (this.config.auth) {
102
109
  if (!this.config.auth.resourceId) {
103
110
  throw new Error('No config.auth.resourceId defined');
@@ -456,14 +456,9 @@ async watchForReprepare({ verbose }) {
456
456
 
457
457
  async watchCustomComponentsForCopy({ verbose }) {
458
458
  const customComponentsDir = this.adminforth.config.customization.customComponentsDir;
459
- // check dir exists
460
- try {
461
- await fs.promises.access(customComponentsDir, fs.constants.F_OK);
462
- } catch (e) {
463
- console.log(`Custom components dir "${customComponentsDir}" does not exist, feel free to create it place custom assets and Vue files there`);
459
+ if (!customComponentsDir) {
464
460
  return;
465
461
  }
466
-
467
462
  // check if folder exists
468
463
  try {
469
464
  await fs.promises.access(customComponentsDir, fs.constants.F_OK);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "1.0.80",
3
+ "version": "1.0.81",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",