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 +6 -6
- package/default/{config → mango}/config/settings.json +2 -1
- package/default/src/helpers/Mango.vue +1 -1
- package/default/src/helpers/mango.js +4 -4
- package/default/src/main.js +3 -4
- package/default/vite.config.js +4 -3
- package/package.json +1 -1
- package/webpack.config.js +2 -2
- /package/default/{config → mango}/automation/index.js +0 -0
- /package/default/{config → mango}/collections/examples.js +0 -0
- /package/default/{config → mango}/config/.collections.json +0 -0
- /package/default/{config → mango}/config/globalFields.js +0 -0
- /package/default/{config → mango}/config/statuses.js +0 -0
- /package/default/{config → mango}/config/users.js +0 -0
- /package/default/{config → mango}/endpoints/index.js +0 -0
- /package/default/{config → mango}/fields/vimeo.js +0 -0
- /package/default/{config → mango}/hooks/test.js +0 -0
- /package/default/{config → mango}/plugins/.gitkeep +0 -0
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, '
|
|
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
|
-
|
|
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/
|
|
228
|
-
const targetConfigDir = path.join(currentDir, '
|
|
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(), '
|
|
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(), '
|
|
300
|
+
const settingsPath = path.join(process.cwd(), 'mango/config/settings.json');
|
|
301
301
|
await ensureLicenseExists(settingsPath);
|
|
302
302
|
|
|
303
303
|
// Ensure src exists
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<script setup>
|
|
8
8
|
import Mango from './mango'
|
|
9
|
-
import { siteName } from '@
|
|
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,
|
|
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://${
|
|
20
|
-
let ws = `wss://${
|
|
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
|
}
|
package/default/src/main.js
CHANGED
|
@@ -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,
|
|
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
|
-
|
|
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
|
|
package/default/vite.config.js
CHANGED
|
@@ -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, '
|
|
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, '
|
|
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('
|
|
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
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|