@wix/origami-site 1.0.8 → 1.0.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/origami-site",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "Runs an exported Wix origami site: file-based routing, Wix dynamic pages, popups and build checks. Use with @wix/origami-site-astro or @wix/origami-site-express.",
5
5
  "type": "module",
6
6
  "files": [
@@ -45,10 +45,10 @@
45
45
  }
46
46
  },
47
47
  "dependencies": {
48
- "@wix/origami-types": "1.4.1",
48
+ "@wix/origami-types": "1.4.2",
49
49
  "@wix/builder-error-pages": "^1.1.6",
50
50
  "@wix/builder-piler-components": "^1.6.7",
51
- "@wix/origami-transforms": "0.1.22",
51
+ "@wix/origami-transforms": "0.1.23",
52
52
  "@babel/parser": "^7.25.0",
53
53
  "@wix/system-core-components": "^1.3.10",
54
54
  "@wix/origami-services": "1.2.3",
@@ -93,5 +93,5 @@
93
93
  "optional": true
94
94
  }
95
95
  },
96
- "falconPackageHash": "209a9df2c051d4ece9c8c73869382b76649c38ac10a4bce28efc6406"
96
+ "falconPackageHash": "adf1f670b7c5ffaf57ca65443b6b006f84ebaebb635a8afeaa45f2eb"
97
97
  }
@@ -5,6 +5,7 @@ import { sharedPackages } from './sharedPackages.js'
5
5
  import { wrapperAliases } from './wrapperAliases.js'
6
6
  import { browserEnv } from './browserEnv.js'
7
7
  import { dedupeFontFaces } from './dedupeFontFaces.js'
8
+ import { servicesConfigsReload } from './servicesConfigsReload.js'
8
9
 
9
10
  /** @param {import('./index.js').OrigamiVitePluginsOptions} options
10
11
  * @returns {import('vite').Plugin[]} */
@@ -13,6 +14,7 @@ export function origamiVitePlugins({ root, siteTree }) {
13
14
  globalImports(root),
14
15
  pageList(siteTree),
15
16
  ...transforms({ root }),
17
+ servicesConfigsReload(root),
16
18
  sharedPackages(),
17
19
  wrapperAliases(root),
18
20
  browserEnv(),
@@ -0,0 +1,18 @@
1
+ import { resolve, sep } from 'node:path'
2
+
3
+ /** Reloads the document when a file under a unit's `servicesConfigs/` folder changes. Services are created once
4
+ * per document with the merged configs, so a hot update would keep the old values and register the configs twice.
5
+ * @param {string} root
6
+ * @returns {import('vite').Plugin} */
7
+ export const servicesConfigsReload = root => {
8
+ const src = `${resolve(root, 'src')}${sep}`
9
+ return {
10
+ name: 'origami:services-configs-reload',
11
+ handleHotUpdate({ file, server }) {
12
+ const path = resolve(file)
13
+ if (!path.startsWith(src) || !path.slice(src.length).split(sep).includes('servicesConfigs')) return undefined
14
+ server.ws.send({ type: 'full-reload', path: '*' })
15
+ return []
16
+ },
17
+ }
18
+ }
@@ -1,4 +1,4 @@
1
- // Ported from origami-site-runtime/routing/pagesToRoutes.js for the layout 2 tree.
1
+ // The route table, read from the site's folders under src/.
2
2
  import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs'
3
3
  import { basename, dirname, resolve } from 'node:path'
4
4
  import { parse } from '@babel/parser'