@wix/origami-site 1.0.53 → 1.0.55
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.
|
|
3
|
+
"version": "1.0.55",
|
|
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": [
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@wix/origami-types": "1.4.
|
|
49
|
+
"@wix/origami-types": "1.4.4",
|
|
50
50
|
"@wix/builder-error-pages": "^1.1.6",
|
|
51
|
-
"@wix/origami-transforms": "0.1.
|
|
51
|
+
"@wix/origami-transforms": "0.1.60",
|
|
52
52
|
"@babel/parser": "^7.25.0",
|
|
53
53
|
"@wix/origami-services": "1.2.8",
|
|
54
54
|
"@wix/services-manager-react": "^1.0.8",
|
|
55
|
-
"@wix/origami-bi": "0.
|
|
55
|
+
"@wix/origami-bi": "0.24.0"
|
|
56
56
|
},
|
|
57
57
|
"exports": {
|
|
58
58
|
"./server": {
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"optional": true
|
|
94
94
|
}
|
|
95
95
|
},
|
|
96
|
-
"falconPackageHash": "
|
|
96
|
+
"falconPackageHash": "0fbf043cce6362f64bf57e52df04b6dea2a8ada0b92e2496264b66f4"
|
|
97
97
|
}
|
|
@@ -12,7 +12,7 @@ export class SiteTreeError extends Error {
|
|
|
12
12
|
| 'ROLE_PAGE_HAS_CHILDREN' // a folder inside [x]/ that isn't _generated
|
|
13
13
|
| 'PREFIX_COLLIDES_WITH_PAGE' // pages/team is both a page and a prefix
|
|
14
14
|
| 'NOT_FOUND_HAS_CHILDREN'
|
|
15
|
-
| '
|
|
15
|
+
| 'POPUP_NOT_TOP_LEVEL' // a popup folder not directly in src/popups
|
|
16
16
|
| 'UNSUPPORTED_ACCESS_RULE' // see section 4
|
|
17
17
|
constructor(code: SiteTreeError['code'], paths: string[], message: string)
|
|
18
18
|
paths: string[]
|
|
@@ -172,5 +172,24 @@ export const readSiteTree = async root => {
|
|
|
172
172
|
if (page) throw new SiteTreeError('PREFIX_COLLIDES_WITH_PAGE', [`src/${router.key}`, `src/${page.itemPath}`],
|
|
173
173
|
`Every URL under /${router.prefix} goes to the Wix router, so "${page.url}" can't be a page.`)
|
|
174
174
|
}
|
|
175
|
-
|
|
175
|
+
// Popups aren't ready for export and import yet: until they are, the core ignores src/popups unless this flag is set.
|
|
176
|
+
const popups = process.env.ORIGAMI_EXPERIMENTAL_POPUPS === '1' ? readPopups(src) : []
|
|
177
|
+
return { version: 2, pages, routers, ...(brokenRouters.length ? { brokenRouters } : {}), notFound, popups }
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/** Popups sit directly in src/popups, so their folder names, which are their seoUris and their only name, can't repeat.
|
|
181
|
+
* @returns {import('@wix/origami-types').PopupRoute[]} */
|
|
182
|
+
function readPopups(src) {
|
|
183
|
+
if (!existsSync(resolve(src, 'popups'))) return []
|
|
184
|
+
const { items, routers } = findItems(path => readdirSync(resolve(src, path), { withFileTypes: true }), 'popups')
|
|
185
|
+
for (const path of routers) {
|
|
186
|
+
if (basename(path) === 'route.json') throw new SiteTreeError('ROUTE_JSON_INVALID', [`src/${path}`], 'A popup has no router, so it has no route.json.')
|
|
187
|
+
throw new SiteTreeError('BRACKET_OUTSIDE_PREFIX', [`src/${path}`], 'A [page] folder belongs in a router prefix folder under src/pages, not in src/popups.')
|
|
188
|
+
}
|
|
189
|
+
const nested = items.filter(itemPath => itemPath.split('/').length !== 2)
|
|
190
|
+
if (nested.length) throw new SiteTreeError('POPUP_NOT_TOP_LEVEL', nested.map(itemPath => `src/${itemPath}`), 'A popup must sit directly in src/popups.')
|
|
191
|
+
return items.map(itemPath => {
|
|
192
|
+
const seoUri = basename(itemPath)
|
|
193
|
+
return { key: itemPath, seoUri, itemPath, title: pageMetadata(resolve(src, itemPath)).title ?? seoUri }
|
|
194
|
+
})
|
|
176
195
|
}
|