@uniweb/build 1.20.6 → 1.20.7
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 +6 -6
- package/src/index.js +1 -1
- package/src/resolve-data-schema.js +21 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniweb/build",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.7",
|
|
4
4
|
"description": "Build tooling for the Uniweb Component Web Platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -58,11 +58,11 @@
|
|
|
58
58
|
"sharp": "^0.35.5",
|
|
59
59
|
"yaml": "^2.5.0",
|
|
60
60
|
"@uniweb/content-reader": "~1.5.9",
|
|
61
|
-
"@uniweb/
|
|
62
|
-
"@uniweb/theming": "~1.3.2",
|
|
61
|
+
"@uniweb/content-writer": "~1.3.1",
|
|
63
62
|
"@uniweb/semantic-parser": "~1.13.2",
|
|
64
63
|
"@uniweb/projections": "~1.2.16",
|
|
65
|
-
"@uniweb/
|
|
64
|
+
"@uniweb/schemas": "~1.7.1",
|
|
65
|
+
"@uniweb/theming": "~1.3.2"
|
|
66
66
|
},
|
|
67
67
|
"optionalDependencies": {
|
|
68
68
|
"@uniweb/runtime": "~1.5.6"
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"@tailwindcss/vite": "^4.0.0",
|
|
75
75
|
"@vitejs/plugin-react": "^4.0.0 || ^5.0.0",
|
|
76
76
|
"vite-plugin-svgr": "^4.0.0",
|
|
77
|
-
"@uniweb/
|
|
78
|
-
"@uniweb/
|
|
77
|
+
"@uniweb/core": "~1.6.11",
|
|
78
|
+
"@uniweb/runtime": "~1.5.6"
|
|
79
79
|
},
|
|
80
80
|
"peerDependenciesMeta": {
|
|
81
81
|
"vite": {
|
package/src/index.js
CHANGED
|
@@ -98,7 +98,7 @@ export { classifyPackage, isExtensionPackage, isSchemasPackage } from './utils/c
|
|
|
98
98
|
export { collectStandaloneSchemas } from './resolve-data-schema.js'
|
|
99
99
|
|
|
100
100
|
// One name in a scope is one type: the names a workspace's packages define twice
|
|
101
|
-
export { typesDefinedTwice, packageTypeScope } from './foundation/shared-types.js'
|
|
101
|
+
export { typesDefinedTwice, packageTypeScope, workspaceTypeFiles } from './foundation/shared-types.js'
|
|
102
102
|
|
|
103
103
|
// Default export is the combined Vite plugin
|
|
104
104
|
export { default } from './vite-foundation-plugin.js'
|
|
@@ -362,16 +362,23 @@ export async function buildDataSchemaMap(refs, { srcDir }) {
|
|
|
362
362
|
/**
|
|
363
363
|
* Collect every data schema a STANDALONE schemas package defines, normalized and
|
|
364
364
|
* keyed by self-ref (`@/<name>`) — the input to a foundation-less registry
|
|
365
|
-
* publish (buildSchemaOnlyPackage). A
|
|
366
|
-
*
|
|
365
|
+
* publish (buildSchemaOnlyPackage). A package registers the schemas a foundation's
|
|
366
|
+
* build reads from it, so they are found where the build finds them:
|
|
367
367
|
*
|
|
368
|
-
* 1.
|
|
369
|
-
*
|
|
370
|
-
* package
|
|
371
|
-
*
|
|
372
|
-
*
|
|
373
|
-
*
|
|
374
|
-
*
|
|
368
|
+
* 1. A `schemas/` directory of `*.{js,json,yml,yaml}` files — one schema per
|
|
369
|
+
* file, named by basename. A foundation's build reads a local package's types
|
|
370
|
+
* from it: a package of its workspace, or a library it bundles
|
|
371
|
+
* (`foundation/shared-types.js`).
|
|
372
|
+
* 2. Otherwise, module exports — the package entry exports `getSchemaNames()` +
|
|
373
|
+
* `getSchema()` (or a `schemas` map / a default map): the `@org/schemas`
|
|
374
|
+
* package contract a foundation consumes from an installed package
|
|
375
|
+
* (`resolveScopedSchema` below), e.g. `@uniweb/schemas` → the standards.
|
|
376
|
+
*
|
|
377
|
+
* ⭐ THE DIRECTORY FIRST. A library holds code and types, and its entry is its code:
|
|
378
|
+
* React components, which Node does not load. ⛔ Until 2026-11-10 the entry was
|
|
379
|
+
* imported first, so `uniweb register` in a library whose `index.js` exports a
|
|
380
|
+
* component stopped with "Unknown file extension .jsx" — and a package holding both
|
|
381
|
+
* registered its exports, which no local build had read.
|
|
375
382
|
*
|
|
376
383
|
* Names only, no uuids; normalization only (no lowering to any storage model).
|
|
377
384
|
* Each schema is validated, so a malformed one throws a clear error before publish.
|
|
@@ -380,12 +387,12 @@ export async function buildDataSchemaMap(refs, { srcDir }) {
|
|
|
380
387
|
* @returns {Promise<Record<string, object>>} `{ '@/<name>': normalizedSchema }`
|
|
381
388
|
*/
|
|
382
389
|
export async function collectStandaloneSchemas(packageDir) {
|
|
383
|
-
const
|
|
384
|
-
if (
|
|
385
|
-
return
|
|
390
|
+
const dir = join(packageDir, 'schemas')
|
|
391
|
+
if (schemaFilesIn(dir).length > 0) return collectSchemasFromDir(dir)
|
|
392
|
+
return collectSchemasFromExports(packageDir)
|
|
386
393
|
}
|
|
387
394
|
|
|
388
|
-
// Source
|
|
395
|
+
// Source 2: a package whose entry exports schemas. Mirrors how a foundation
|
|
389
396
|
// consumes an `@org/schemas` package (getSchema / schemas / default), plus
|
|
390
397
|
// `getSchemaNames()` for enumeration. Returns `{}` when the package exports none.
|
|
391
398
|
async function collectSchemasFromExports(packageDir) {
|
|
@@ -422,7 +429,7 @@ async function collectSchemasFromExports(packageDir) {
|
|
|
422
429
|
return out
|
|
423
430
|
}
|
|
424
431
|
|
|
425
|
-
// Source
|
|
432
|
+
// Source 1: a `schemas/` directory of schema files, one schema per file
|
|
426
433
|
// (named by basename). Returns `{}` when the directory is absent.
|
|
427
434
|
async function collectSchemasFromDir(dir) {
|
|
428
435
|
const out = {}
|