@ossy/app 1.3.0 → 1.4.0
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/build.js +10 -3
- package/package.json +10 -10
package/cli/build.js
CHANGED
|
@@ -407,8 +407,9 @@ export function clientHydrateIdForPage (pageAbsPath, srcDir) {
|
|
|
407
407
|
* One client entry per page: imports only that page module and hydrates the document.
|
|
408
408
|
* Keeps the same `toPage` shape as `generatePagesModule` so SSR and client trees match.
|
|
409
409
|
*/
|
|
410
|
-
export function generatePageHydrateModule ({ pageAbsPath, stubAbsPath, srcDir }) {
|
|
410
|
+
export function generatePageHydrateModule ({ pageAbsPath, stubAbsPath, srcDir, pagesGeneratedPath }) {
|
|
411
411
|
const rel = relToGeneratedImport(stubAbsPath, pageAbsPath)
|
|
412
|
+
const pagesRel = relToGeneratedImport(stubAbsPath, pagesGeneratedPath)
|
|
412
413
|
const { id, path: routePath } = filePathToRoute(pageAbsPath, srcDir)
|
|
413
414
|
const pathLiteral = JSON.stringify(routePath)
|
|
414
415
|
const idLiteral = JSON.stringify(id)
|
|
@@ -420,7 +421,7 @@ export function generatePageHydrateModule ({ pageAbsPath, stubAbsPath, srcDir })
|
|
|
420
421
|
"import { hydrateRoot } from 'react-dom/client'",
|
|
421
422
|
"import { App } from '@ossy/connected-components'",
|
|
422
423
|
`import * as _page from './${rel}'`,
|
|
423
|
-
`import pageRoutes from './${
|
|
424
|
+
`import pageRoutes from './${pagesRel}'`,
|
|
424
425
|
'',
|
|
425
426
|
'function toPage(mod, derived) {',
|
|
426
427
|
' const meta = mod?.metadata || {}',
|
|
@@ -451,6 +452,7 @@ export function generatePageHydrateModule ({ pageAbsPath, stubAbsPath, srcDir })
|
|
|
451
452
|
|
|
452
453
|
/** Writes `hydrate-<id>.jsx` for each page; removes stale `hydrate-*` outputs in `ossyDir` first. */
|
|
453
454
|
export function writePageHydrateStubs (pageFiles, srcDir, ossyDir) {
|
|
455
|
+
const pagesGeneratedPath = path.join(ossyDir, OSSY_GEN_PAGES_BASENAME)
|
|
454
456
|
if (!fs.existsSync(ossyDir)) fs.mkdirSync(ossyDir, { recursive: true })
|
|
455
457
|
for (const ent of fs.readdirSync(ossyDir, { withFileTypes: true })) {
|
|
456
458
|
const full = path.join(ossyDir, ent.name)
|
|
@@ -477,7 +479,12 @@ export function writePageHydrateStubs (pageFiles, srcDir, ossyDir) {
|
|
|
477
479
|
fs.mkdirSync(path.dirname(stubPath), { recursive: true })
|
|
478
480
|
fs.writeFileSync(
|
|
479
481
|
stubPath,
|
|
480
|
-
generatePageHydrateModule({
|
|
482
|
+
generatePageHydrateModule({
|
|
483
|
+
pageAbsPath: f,
|
|
484
|
+
stubAbsPath: stubPath,
|
|
485
|
+
srcDir,
|
|
486
|
+
pagesGeneratedPath,
|
|
487
|
+
})
|
|
481
488
|
)
|
|
482
489
|
}
|
|
483
490
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ossy/app",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"source": "./src/index.js",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
"@babel/eslint-parser": "^7.15.8",
|
|
28
28
|
"@babel/preset-react": "^7.26.3",
|
|
29
29
|
"@babel/register": "^7.25.9",
|
|
30
|
-
"@ossy/connected-components": "^1.
|
|
31
|
-
"@ossy/design-system": "^1.
|
|
32
|
-
"@ossy/pages": "^1.
|
|
33
|
-
"@ossy/router": "^1.
|
|
34
|
-
"@ossy/router-react": "^1.
|
|
35
|
-
"@ossy/sdk": "^1.
|
|
36
|
-
"@ossy/sdk-react": "^1.
|
|
37
|
-
"@ossy/themes": "^1.
|
|
30
|
+
"@ossy/connected-components": "^1.4.0",
|
|
31
|
+
"@ossy/design-system": "^1.4.0",
|
|
32
|
+
"@ossy/pages": "^1.4.0",
|
|
33
|
+
"@ossy/router": "^1.4.0",
|
|
34
|
+
"@ossy/router-react": "^1.4.0",
|
|
35
|
+
"@ossy/sdk": "^1.4.0",
|
|
36
|
+
"@ossy/sdk-react": "^1.4.0",
|
|
37
|
+
"@ossy/themes": "^1.4.0",
|
|
38
38
|
"@rollup/plugin-alias": "^6.0.0",
|
|
39
39
|
"@rollup/plugin-babel": "6.1.0",
|
|
40
40
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"README.md",
|
|
68
68
|
"tsconfig.json"
|
|
69
69
|
],
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "69e80ed4e43a04263df106e0f504c6d2fb55e0fb"
|
|
71
71
|
}
|