@ossy/app 3.4.0 → 3.5.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 CHANGED
@@ -1,5 +1,6 @@
1
1
  import fs from 'node:fs'
2
2
  import path from 'node:path'
3
+ import { createRequire } from 'node:module'
3
4
  import { pathToFileURL } from 'node:url'
4
5
  import arg from 'arg'
5
6
  import { rollup } from 'rollup'
@@ -59,6 +60,29 @@ function ensureDir (dir) {
59
60
  fs.mkdirSync(dir, { recursive: true })
60
61
  }
61
62
 
63
+ /**
64
+ * Copy heavy optional browser deps that feature packages load via non-literal
65
+ * `import()` so Rollup never opens them (CI OOM). `@ossy/resumes` Word export
66
+ * loads `/static/vendor/docx.mjs` in the browser; skip quietly when not installed.
67
+ *
68
+ * @param {string} staticOutDir
69
+ * @param {string} projectRoot
70
+ */
71
+ function copyExternalBrowserVendors (staticOutDir, projectRoot) {
72
+ let docxEntry
73
+ try {
74
+ docxEntry = createRequire(path.join(projectRoot, 'package.json')).resolve('docx')
75
+ } catch {
76
+ return
77
+ }
78
+ // `docx` resolves to dist/index.cjs; ship the self-contained ESM build for browsers.
79
+ const src = path.join(path.dirname(docxEntry), 'index.mjs')
80
+ if (!fs.existsSync(src)) return
81
+ const destDir = path.join(staticOutDir, 'vendor')
82
+ ensureDir(destDir)
83
+ fs.copyFileSync(src, path.join(destDir, 'docx.mjs'))
84
+ }
85
+
62
86
  // One source of truth for the per-entry name. Used both as the Rollup
63
87
  // `input` key (which becomes the `[name]` token in `entryFileNames`) and
64
88
  // as the basename of the generated stub. Flattening the full relative
@@ -398,6 +422,14 @@ export async function build (cliArgs = []) {
398
422
  ) return true
399
423
  // Shared in-memory outbox — email integration appends, dev-inbox API reads.
400
424
  if (id === '@ossy/email/local-outbox') return true
425
+ // Schema registry singleton — must match registerSchema() at server boot.
426
+ // Tasks that import `@ossy/schema/system-schemas` must not get an inlined
427
+ // empty array (see get-schemas.task.js). Other `@ossy/schema` entry points
428
+ // stay bundled for the browser.
429
+ if (id === '@ossy/schema/system-schemas') return true
430
+ if (/[/\\]@ossy[/\\]schema[/\\]src[/\\]schema\.registry\.js$/.test(id)) return true
431
+ // Lazy-loaded by @ossy/resumes via load-docx.js (+ /static/vendor/docx.mjs).
432
+ if (id === 'docx') return true
401
433
  return false
402
434
  },
403
435
  plugins: [
@@ -443,6 +475,8 @@ export async function build (cliArgs = []) {
443
475
 
444
476
  await bundle.close()
445
477
 
478
+ copyExternalBrowserVendors(staticOutDir, cwd)
479
+
446
480
  if (fs.existsSync(publicSrc)) {
447
481
  fs.cpSync(publicSrc, publicOutDir, { recursive: true, force: true })
448
482
  }
package/cli/start.task.js CHANGED
@@ -13,8 +13,12 @@ export async function start (cliArgs = []) {
13
13
 
14
14
  const cwd = options['--cwd'] ? path.resolve(options['--cwd']) : process.cwd()
15
15
  const buildDir = options['--build-dir'] || 'build'
16
+ // Omit `--port` so `@ossy/platform` resolvePort uses `PORT` (ECS / Docker).
16
17
  const port = options['--port']
17
-
18
- const { lifetime } = await startServer({ cwd, buildDir, port })
18
+ const startOptions = port === undefined
19
+ ? { cwd, buildDir }
20
+ : { cwd, buildDir, port }
21
+
22
+ const { lifetime } = await startServer(startOptions)
19
23
  await lifetime
20
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ossy/app",
3
- "version": "3.4.0",
3
+ "version": "3.5.0",
4
4
  "description": "",
5
5
  "source": "./src/index.js",
6
6
  "main": "./src/index.js",
@@ -49,21 +49,21 @@
49
49
  "@babel/eslint-parser": "^7.15.8",
50
50
  "@babel/preset-react": "^7.26.3",
51
51
  "@babel/register": "^7.25.9",
52
- "@ossy/authentication": "^3.4.0",
53
- "@ossy/design-system": "^3.4.0",
52
+ "@ossy/authentication": "^3.5.0",
53
+ "@ossy/design-system": "^3.5.0",
54
54
  "@ossy/locale": "^3.4.0",
55
- "@ossy/manifest": "^3.4.0",
55
+ "@ossy/manifest": "^3.5.0",
56
56
  "@ossy/package-catalog": "^3.0.9",
57
57
  "@ossy/pages": "^3.0.9",
58
- "@ossy/platform": "^3.4.0",
59
- "@ossy/resources": "^3.4.0",
58
+ "@ossy/platform": "^3.5.0",
59
+ "@ossy/resources": "^3.5.0",
60
60
  "@ossy/router": "^3.0.9",
61
61
  "@ossy/router-react": "^3.0.9",
62
- "@ossy/schema": "^3.4.0",
63
- "@ossy/sdk": "^3.4.0",
62
+ "@ossy/schema": "^3.5.0",
63
+ "@ossy/sdk": "^3.5.0",
64
64
  "@ossy/sdk-react": "^3.0.9",
65
- "@ossy/themes": "^3.3.0",
66
- "@ossy/workspaces": "^3.4.0",
65
+ "@ossy/themes": "^3.5.0",
66
+ "@ossy/workspaces": "^3.5.0",
67
67
  "@rollup/plugin-alias": "^6.0.0",
68
68
  "@rollup/plugin-babel": "^7.1.0",
69
69
  "@rollup/plugin-commonjs": "^29.0.0",
@@ -97,5 +97,5 @@
97
97
  "README.md",
98
98
  "tsconfig.json"
99
99
  ],
100
- "gitHead": "d36b69444268d172bc3e8e1dc77e67afc63f8650"
100
+ "gitHead": "23167600f991596f122765a53f2b9df08314e115"
101
101
  }