mango-cms 0.2.13 → 0.2.14

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.
@@ -7,6 +7,9 @@
7
7
  "preview": "vite preview",
8
8
  "mango": "mango"
9
9
  },
10
+ "resolutions": {
11
+ "strip-ansi": "^6.0.1"
12
+ },
10
13
  "dependencies": {
11
14
  "@headlessui/vue": "^1.6.7",
12
15
  "@mapbox/mapbox-gl-geocoder": "^5.0.0",
@@ -9,32 +9,49 @@ 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
- projectRoot = path.resolve(projectRoot, '..')
13
- configPath = path.resolve(projectRoot, 'mango')
12
+ projectRoot = path.resolve(projectRoot, '..')
13
+ configPath = path.resolve(projectRoot, 'mango')
14
14
 
15
- // If config still doesn't exist, throw error
16
- if (!fs.existsSync(configPath)) {
17
- throw new Error('Mango folder not found. Please ensure your mango folder exists either in the current directory or parent directory.')
18
- }
15
+ // If config still doesn't exist, throw error
16
+ if (!fs.existsSync(configPath)) {
17
+ throw new Error('Mango folder not found. Please ensure your mango folder exists either in the current directory or parent directory.')
18
+ }
19
19
  }
20
20
 
21
+ const collectionsPath = path.resolve(configPath, 'config/.collections.json')
22
+
21
23
  // https://vitejs.dev/config/
22
24
  export default defineConfig({
23
- plugins: [vue()],
24
- server: {
25
- host: '0.0.0.0',
26
- },
27
- resolve: {
28
- alias: {
29
- '@config': configPath,
30
- '@mango': configPath,
31
- '@settings': path.resolve(configPath, 'config/settings.json'),
32
- '@collections': path.resolve(configPath, 'config/.collections.json'),
33
- '@plugins': path.resolve(configPath, 'plugins'),
34
- 'vue': path.resolve(__dirname, 'node_modules/vue'),
35
- }
36
- },
37
- optimizeDeps: {
38
- exclude: ['vue'], // Prevent Vite from optimizing Vue separately
39
- },
25
+ plugins: [
26
+ vue(),
27
+ {
28
+ name: 'watch-collections',
29
+ configureServer(server) {
30
+ server.watcher.add(collectionsPath)
31
+ server.watcher.on('change', (file) => {
32
+ if (file === collectionsPath) {
33
+ server.ws.send({
34
+ type: 'full-reload',
35
+ })
36
+ }
37
+ })
38
+ },
39
+ },
40
+ ],
41
+ server: {
42
+ host: '0.0.0.0',
43
+ },
44
+ resolve: {
45
+ alias: {
46
+ '@config': configPath,
47
+ '@mango': configPath,
48
+ '@settings': path.resolve(configPath, 'config/settings.json'),
49
+ '@collections': path.resolve(configPath, 'config/.collections.json'),
50
+ '@plugins': path.resolve(configPath, 'plugins'),
51
+ vue: path.resolve(__dirname, 'node_modules/vue'),
52
+ },
53
+ },
54
+ optimizeDeps: {
55
+ exclude: ['vue', '@collections'], // Prevent Vite from optimizing Vue separately
56
+ },
40
57
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mango-cms",
3
- "version": "0.2.13",
3
+ "version": "0.2.14",
4
4
  "main": "./index.js",
5
5
  "exports": {
6
6
  ".": "./index.js",