@ossy/app 3.18.0 → 3.20.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.task.js +12 -12
- package/package.json +11 -11
- package/src/shell/WorkspaceAppSettingsSync.jsx +14 -0
package/cli/build.task.js
CHANGED
|
@@ -64,24 +64,24 @@ function ensureDir (dir) {
|
|
|
64
64
|
/**
|
|
65
65
|
* Copy heavy optional browser deps that feature packages load via non-literal
|
|
66
66
|
* `import()` so Rollup never opens them (CI OOM). `@ossy/resumes` Word export
|
|
67
|
-
* loads `/static/vendor/docx.mjs
|
|
67
|
+
* loads `/static/vendor/docx.mjs`. Skip quietly when not installed.
|
|
68
68
|
*
|
|
69
69
|
* @param {string} staticOutDir
|
|
70
70
|
* @param {string} projectRoot
|
|
71
71
|
*/
|
|
72
|
-
function copyExternalBrowserVendors (staticOutDir, projectRoot) {
|
|
73
|
-
|
|
72
|
+
async function copyExternalBrowserVendors (staticOutDir, projectRoot) {
|
|
73
|
+
const requireFromRoot = createRequire(path.join(projectRoot, 'package.json'))
|
|
74
|
+
const destDir = path.join(staticOutDir, 'vendor')
|
|
75
|
+
ensureDir(destDir)
|
|
76
|
+
|
|
74
77
|
try {
|
|
75
|
-
docxEntry =
|
|
78
|
+
const docxEntry = requireFromRoot.resolve('docx')
|
|
79
|
+
// `docx` resolves to dist/index.cjs; ship the self-contained ESM build for browsers.
|
|
80
|
+
const src = path.join(path.dirname(docxEntry), 'index.mjs')
|
|
81
|
+
if (fs.existsSync(src)) fs.copyFileSync(src, path.join(destDir, 'docx.mjs'))
|
|
76
82
|
} catch {
|
|
77
|
-
|
|
83
|
+
// optional
|
|
78
84
|
}
|
|
79
|
-
// `docx` resolves to dist/index.cjs; ship the self-contained ESM build for browsers.
|
|
80
|
-
const src = path.join(path.dirname(docxEntry), 'index.mjs')
|
|
81
|
-
if (!fs.existsSync(src)) return
|
|
82
|
-
const destDir = path.join(staticOutDir, 'vendor')
|
|
83
|
-
ensureDir(destDir)
|
|
84
|
-
fs.copyFileSync(src, path.join(destDir, 'docx.mjs'))
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
// One source of truth for the per-entry name. Used both as the Rollup
|
|
@@ -489,7 +489,7 @@ export async function build (cliArgs = []) {
|
|
|
489
489
|
|
|
490
490
|
await bundle.close()
|
|
491
491
|
|
|
492
|
-
copyExternalBrowserVendors(staticOutDir, cwd)
|
|
492
|
+
await copyExternalBrowserVendors(staticOutDir, cwd)
|
|
493
493
|
|
|
494
494
|
if (fs.existsSync(publicSrc)) {
|
|
495
495
|
fs.cpSync(publicSrc, publicOutDir, { recursive: true, force: true })
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ossy/app",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.20.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"source": "./src/index.js",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -50,21 +50,21 @@
|
|
|
50
50
|
"@babel/preset-react": "^7.26.3",
|
|
51
51
|
"@babel/register": "^7.25.9",
|
|
52
52
|
"@ossy/authentication": "^3.11.1",
|
|
53
|
-
"@ossy/design-system": "^3.
|
|
53
|
+
"@ossy/design-system": "^3.20.0",
|
|
54
54
|
"@ossy/locale": "^3.4.0",
|
|
55
|
-
"@ossy/manifest": "^3.
|
|
56
|
-
"@ossy/package-catalog": "^3.
|
|
55
|
+
"@ossy/manifest": "^3.20.0",
|
|
56
|
+
"@ossy/package-catalog": "^3.19.0",
|
|
57
57
|
"@ossy/pages": "^3.0.9",
|
|
58
|
-
"@ossy/platform": "^3.
|
|
59
|
-
"@ossy/resources": "^3.
|
|
58
|
+
"@ossy/platform": "^3.20.0",
|
|
59
|
+
"@ossy/resources": "^3.20.0",
|
|
60
60
|
"@ossy/router": "^3.0.9",
|
|
61
61
|
"@ossy/router-react": "^3.18.0",
|
|
62
|
-
"@ossy/schema": "^3.
|
|
63
|
-
"@ossy/sdk": "^3.
|
|
62
|
+
"@ossy/schema": "^3.20.0",
|
|
63
|
+
"@ossy/sdk": "^3.20.0",
|
|
64
64
|
"@ossy/sdk-react": "^3.12.0",
|
|
65
65
|
"@ossy/themes": "^3.18.0",
|
|
66
|
-
"@ossy/users": "^3.
|
|
67
|
-
"@ossy/workspaces": "^3.
|
|
66
|
+
"@ossy/users": "^3.20.0",
|
|
67
|
+
"@ossy/workspaces": "^3.20.0",
|
|
68
68
|
"@rollup/plugin-alias": "^6.0.0",
|
|
69
69
|
"@rollup/plugin-babel": "^7.1.0",
|
|
70
70
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
@@ -98,5 +98,5 @@
|
|
|
98
98
|
"README.md",
|
|
99
99
|
"tsconfig.json"
|
|
100
100
|
],
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "edab6a966f41c07a68bdd86f3864cc2ad02e3406"
|
|
102
102
|
}
|
|
@@ -17,6 +17,10 @@ function buildPatch (workspace, workspaces) {
|
|
|
17
17
|
* Persists workspace shell snapshot to the signed user-app-settings cookie
|
|
18
18
|
* (via ProxyInternal PATCH /@ossy/users/me/app-settings) so SSR bootstrap
|
|
19
19
|
* props stay stable across full-page navigations.
|
|
20
|
+
*
|
|
21
|
+
* Also keeps `sdk.workspaceId` in sync so workspace-scoped action invocations
|
|
22
|
+
* include the workspaceId header even when it was absent from the initial SSR
|
|
23
|
+
* bootstrap props.
|
|
20
24
|
*/
|
|
21
25
|
export function WorkspaceAppSettingsSync () {
|
|
22
26
|
const sdk = useSdk()
|
|
@@ -24,6 +28,16 @@ export function WorkspaceAppSettingsSync () {
|
|
|
24
28
|
const { data: workspaces } = sdk.read(ListWorkspaces)
|
|
25
29
|
const lastPatchRef = useRef('')
|
|
26
30
|
|
|
31
|
+
// Keep sdk.workspaceId in sync with the live workspace read so that
|
|
32
|
+
// sdk.invoke sends the workspaceId header for workspace-scoped actions.
|
|
33
|
+
// useSdk() returns a wrapper object; the underlying ReactSdk is at .sdk.
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
const reactSdk = sdk.sdk
|
|
36
|
+
if (workspace?.id && reactSdk?.workspaceId !== workspace.id) {
|
|
37
|
+
reactSdk?.updateConfig({ workspaceId: workspace.id })
|
|
38
|
+
}
|
|
39
|
+
}, [workspace?.id, sdk])
|
|
40
|
+
|
|
27
41
|
useEffect(() => {
|
|
28
42
|
const patch = buildPatch(workspace, workspaces)
|
|
29
43
|
if (!patch) return
|