mango-cms 0.2.2 → 0.2.4

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
@@ -169,7 +169,7 @@ program
169
169
  fs.copySync(templateDir, projectDir);
170
170
 
171
171
  // Create config directory if it doesn't exist
172
- const configDir = path.join(projectDir, 'config');
172
+ const configDir = path.join(projectDir, 'mango');
173
173
 
174
174
  // Create or update settings.json
175
175
  const settingsPath = path.join(configDir, 'config/settings.json');
@@ -191,7 +191,7 @@ program
191
191
  license: answers.license,
192
192
  siteName: answers.projectName,
193
193
  siteDomain: `${projectSlug}.com`,
194
- domain: `api.${projectSlug}.com`,
194
+ mangoDomain: `api.${projectSlug}.com`,
195
195
  database: `${projectSlug}`,
196
196
  s3Bucket: `${projectSlug}`
197
197
  };
@@ -224,8 +224,8 @@ program
224
224
  .action(async () => {
225
225
  try {
226
226
  const currentDir = process.cwd();
227
- const templateConfigDir = path.join(__dirname, 'default/config');
228
- const targetConfigDir = path.join(currentDir, 'config');
227
+ const templateConfigDir = path.join(__dirname, 'default/mango');
228
+ const targetConfigDir = path.join(currentDir, 'mango');
229
229
 
230
230
  // Check if config directory already exists
231
231
  if (fs.existsSync(targetConfigDir)) {
@@ -256,7 +256,7 @@ program
256
256
  await checkSystemDependencies();
257
257
 
258
258
  // Check for license in settings.json
259
- const settingsPath = path.join(process.cwd(), 'config/config/settings.json');
259
+ const settingsPath = path.join(process.cwd(), 'mango/config/settings.json');
260
260
  await ensureLicenseExists(settingsPath);
261
261
 
262
262
  // Ensure src exists
@@ -297,7 +297,7 @@ program
297
297
  .action(async () => {
298
298
  try {
299
299
  // Check for license in settings.json
300
- const settingsPath = path.join(process.cwd(), 'config/config/settings.json');
300
+ const settingsPath = path.join(process.cwd(), 'mango/config/settings.json');
301
301
  await ensureLicenseExists(settingsPath);
302
302
 
303
303
  // Ensure src exists
@@ -2,8 +2,9 @@
2
2
  "port": 6646,
3
3
  "siteName": "Example",
4
4
  "siteDomain": "example.com",
5
+ "mangoDomain": "api.example.com",
5
6
 
6
- "domain": "api.example.com",
7
+ "useDevAPI": false,
7
8
 
8
9
  "mongoURI":"mongodb://127.0.0.1:27017",
9
10
  "database":"exampleMongoDB",
@@ -6,7 +6,7 @@
6
6
 
7
7
  <script setup>
8
8
  import Mango from './mango'
9
- import { siteName } from '@config/config/settings.json'
9
+ import { siteName } from '@mango/config/settings.json'
10
10
  import { ref, watch, computed, nextTick, onUnmounted } from 'vue'
11
11
  import { useRoute } from 'vue-router'
12
12
 
@@ -1,7 +1,7 @@
1
1
  // import collections from '../../../mango/config/.collections.json'
2
2
  // import { algoliaAppId, algoliaSearchKey, algoliaIndex, port, domain } from '../../../mango/config/settings'
3
3
  import collections from '@collections'
4
- import { algoliaAppId, algoliaSearchKey, algoliaIndex, port, domain } from '@settings'
4
+ import { algoliaAppId, algoliaSearchKey, algoliaIndex, port, mangoDomain, useDevAPI } from '@settings'
5
5
  import axios from "axios";
6
6
  import { ref } from 'vue'
7
7
  import algoliasearch from 'algoliasearch/dist/algoliasearch-lite.esm.browser'
@@ -16,10 +16,10 @@ let endpoints = {
16
16
  const client = algoliasearch(algoliaAppId, algoliaSearchKey);
17
17
  const algolia = client.initIndex(algoliaIndex);
18
18
 
19
- let api = `https://${domain}`
20
- let ws = `wss://${domain}/graphql`
19
+ let api = `https://${mangoDomain}`
20
+ let ws = `wss://${mangoDomain}/graphql`
21
21
 
22
- if (process.env.NODE_ENV != 'production') {
22
+ if (process.env.NODE_ENV != 'production' && useDevAPI) {
23
23
  api = `http://localhost:${port}`
24
24
  ws = `ws://localhost:${port}/graphql`
25
25
  }
@@ -2,7 +2,7 @@ import axios from 'axios'
2
2
  import { computed, createApp, defineAsyncComponent, reactive, ref } from 'vue'
3
3
  import { createRouter, createWebHistory } from 'vue-router'
4
4
  import { MotionPlugin } from '@vueuse/motion'
5
- import { port, domain } from '@settings'
5
+ import { port, mangoDomain, useDevAPI } from '@settings'
6
6
  import VueClipboard from 'vue3-clipboard'
7
7
  import Vue3TouchEvents from "vue3-touch-events";
8
8
  import App from './App.vue'
@@ -68,9 +68,8 @@ app.provide('darkMode', darkMode().darkMode)
68
68
 
69
69
  const user = initUser()
70
70
 
71
- let api = `http://localhost:${port}`
72
- // let api = `https://${domain}`
73
- if (!isDev) api = `https://${domain}`
71
+ let api = useDevAPI ? `http://localhost:${port}` : `https://${mangoDomain}`
72
+ if (!isDev) api = `https://${mangoDomain}`
74
73
 
75
74
  const store = reactive({
76
75
 
@@ -5,16 +5,16 @@ import fs from 'fs'
5
5
 
6
6
  // Determine project root based on config directory location
7
7
  let projectRoot = process.cwd()
8
- let configPath = path.resolve(projectRoot, 'config')
8
+ let configPath = path.resolve(projectRoot, 'mango')
9
9
 
10
10
  // If config doesn't exist in current directory, check parent
11
11
  if (!fs.existsSync(configPath)) {
12
12
  projectRoot = path.resolve(projectRoot, '..')
13
- configPath = path.resolve(projectRoot, 'config')
13
+ configPath = path.resolve(projectRoot, 'mango')
14
14
 
15
15
  // If config still doesn't exist, throw error
16
16
  if (!fs.existsSync(configPath)) {
17
- throw new Error('Config folder not found. Please ensure your config folder exists either in the current directory or parent directory.')
17
+ throw new Error('Mango folder not found. Please ensure your mango folder exists either in the current directory or parent directory.')
18
18
  }
19
19
  }
20
20
 
@@ -27,6 +27,7 @@ export default defineConfig({
27
27
  resolve: {
28
28
  alias: {
29
29
  '@config': configPath,
30
+ '@mango': configPath,
30
31
  '@settings': path.resolve(configPath, 'config/settings.json'),
31
32
  '@collections': path.resolve(configPath, 'config/.collections.json'),
32
33
  '@plugins': path.resolve(configPath, 'plugins'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mango-cms",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "main": "./index.js",
5
5
  "exports": {
6
6
  ".": "./index.js",
package/webpack.config.js CHANGED
@@ -26,9 +26,9 @@ module.exports = {
26
26
  mode: 'production',
27
27
  resolve: {
28
28
  alias: {
29
- '@mango': path.resolve(mangoRoot),
30
29
  '@cms': path.resolve(mangoRoot, 'src/cms'),
31
- '@config': path.resolve(userProjectRoot, 'config'),
30
+ '@config': path.resolve(userProjectRoot, legacyMode ? 'config' : 'mango'),
31
+ '@mango': path.resolve(userProjectRoot, legacyMode ? 'config' : 'mango'),
32
32
  '@fields': path.resolve(mangoRoot, 'src/cms/1. build/fields'),
33
33
  '@mongo': path.resolve(mangoRoot, 'src/cms/1. build/libraries/mongo'),
34
34
  '@helpers': path.resolve(mangoRoot, 'src/cms/1. build/helpers'),
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes