mango-cms 0.2.21 → 0.2.23

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/cli.js CHANGED
@@ -397,11 +397,11 @@ function generateNginxConfig(settings, buildPath) {
397
397
 
398
398
  server {
399
399
  server_name ${settings.siteDomain};
400
- root ${buildPath};
400
+ root ${buildPath.replace('/build', '/dist')};
401
401
  index index.html;
402
402
 
403
- # Serve static files directly
404
- location ~* \.(?:js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|otf|json)$ {
403
+ # Serve static files directly if they exist
404
+ location ~* \.(?:js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|otf|json|html)$ {
405
405
  expires 1y;
406
406
  access_log off;
407
407
  add_header Cache-Control "public";
@@ -413,8 +413,9 @@ server {
413
413
  }
414
414
  ` : ''}
415
415
 
416
+ # All other routes go to the fallback unless the file exists
416
417
  location / {
417
- try_files $uri $uri/ @fallback;
418
+ try_files $uri @fallback;
418
419
  }
419
420
 
420
421
  location @fallback {
@@ -466,7 +467,7 @@ function generateApacheConfig(settings, buildPath) {
466
467
 
467
468
  <VirtualHost *:80>
468
469
  ServerName ${settings.siteDomain}
469
- DocumentRoot ${buildPath}
470
+ DocumentRoot ${buildPath.replace('/build', '/dist')}
470
471
  IndexIndex index.html
471
472
 
472
473
  # Serve static files directly
@@ -511,8 +512,8 @@ async function configureWebServer(settings, buildPath) {
511
512
  generateApacheConfig(settings, buildPath);
512
513
 
513
514
  const configPath = webServer === 'nginx' ?
514
- `/etc/nginx/sites-available/${settings.siteName.toLowerCase()}` :
515
- `/etc/apache2/sites-available/${settings.siteName.toLowerCase()}.conf`;
515
+ `/etc/nginx/sites-available/${settings.database.toLowerCase()}` :
516
+ `/etc/apache2/sites-available/${settings.database.toLowerCase()}.conf`;
516
517
 
517
518
  try {
518
519
  // Check if config already exists
@@ -525,7 +526,7 @@ async function configureWebServer(settings, buildPath) {
525
526
 
526
527
  if (webServer === 'nginx') {
527
528
  // Create symlink if it doesn't exist
528
- const enabledPath = `/etc/nginx/sites-enabled/${settings.siteName.toLowerCase()}`;
529
+ const enabledPath = `/etc/nginx/sites-enabled/${settings.database.toLowerCase()}`;
529
530
  if (!fs.existsSync(enabledPath)) {
530
531
  execSync(`sudo ln -s ${configPath} ${enabledPath}`);
531
532
  }
@@ -533,7 +534,7 @@ async function configureWebServer(settings, buildPath) {
533
534
  execSync('sudo systemctl reload nginx');
534
535
  } else {
535
536
  // Enable apache site
536
- execSync(`sudo a2ensite ${settings.siteName.toLowerCase()}`);
537
+ execSync(`sudo a2ensite ${settings.database.toLowerCase()}`);
537
538
  execSync('sudo systemctl reload apache2');
538
539
  }
539
540
  console.log(`${webServer} configuration has been updated and service reloaded`);
@@ -25,7 +25,7 @@
25
25
  "dayjs": "^1.10.7",
26
26
  "express": "^4.18.1",
27
27
  "google-maps": "^4.3.3",
28
- "mango-cms": "^0.2.21",
28
+ "mango-cms": "^0.2.23",
29
29
  "mapbox-gl": "^2.7.0",
30
30
  "sweetalert2": "^11.4.0",
31
31
  "vite": "^6.2.2",
@@ -32,7 +32,8 @@
32
32
  </template>
33
33
 
34
34
  <template v-else>
35
- <div class="text-2xl">Mango Login</div>
35
+ <div class="-mb-4 uppercase opacity-50 tracking-widest text-sm">Login</div>
36
+ <div class="text-2xl">{{ siteName }}</div>
36
37
  <input type="email" v-model.trim="user.email" placeholder="Email" />
37
38
  <input type="password" v-model.trim="user.password" placeholder="Password" autocomplete="current-password" />
38
39
  </template>
@@ -59,6 +60,7 @@
59
60
  import Swal from 'sweetalert2'
60
61
  import { validateEmail } from '../../helpers/email'
61
62
  import { getUser } from '../../helpers/user'
63
+ import { siteName } from '@settings'
62
64
 
63
65
  // Function for setting cookies
64
66
  let setCookie = function (cname, cvalue) {
@@ -72,6 +74,7 @@ export default {
72
74
  inject: ['store','axios'],
73
75
  data() {
74
76
  return {
77
+ siteName,
75
78
  user: {
76
79
  email: null,
77
80
  password: null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mango-cms",
3
- "version": "0.2.21",
3
+ "version": "0.2.23",
4
4
  "main": "./index.js",
5
5
  "exports": {
6
6
  ".": "./index.js",
package/webpack.config.js CHANGED
@@ -27,12 +27,18 @@ module.exports = {
27
27
  mode: 'production',
28
28
  resolve: {
29
29
  alias: {
30
+
31
+ '@mango$': path.resolve(mangoRoot, 'src/cms/exports'),
32
+ '@mango': path.resolve(userProjectRoot, legacyMode ? 'config' : 'mango'),
33
+
30
34
  '@cms': path.resolve(mangoRoot, 'src/cms'),
31
35
  '@config': path.resolve(userProjectRoot, legacyMode ? 'config' : 'mango'),
32
- '@mango': path.resolve(userProjectRoot, legacyMode ? 'config' : 'mango'),
36
+ '@settings': path.resolve(userProjectRoot, legacyMode ? 'config/config/settings.json' : 'mango/config/settings.json'),
33
37
  '@fields': path.resolve(mangoRoot, 'src/cms/1. build/fields'),
34
38
  '@mongo': path.resolve(mangoRoot, 'src/cms/1. build/libraries/mongo'),
39
+ '@query': path.resolve(mangoRoot, 'src/cms/1. build/libraries/mongo'),
35
40
  '@helpers': path.resolve(mangoRoot, 'src/cms/1. build/helpers'),
41
+ '@main': path.resolve(mangoRoot, 'src/cms/2. process/0. main'),
36
42
  },
37
43
  },
38
44
  devtool: 'inline-source-map',