@yahoo/uds-create-config 5.42.3 → 5.43.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yahoo/uds-create-config",
3
- "version": "5.42.3",
3
+ "version": "5.43.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -110,5 +110,5 @@
110
110
  "files": [
111
111
  "dist"
112
112
  ],
113
- "udsSchemaVersion": 20261020173914
113
+ "udsSchemaVersion": 20261020183330
114
114
  }
@@ -1,69 +0,0 @@
1
- import { BUILD_DEFAULTS } from "../configs/build-options.js";
2
- //#region src/framework/registry-dir.ts
3
- /**
4
- * Where a project's build directories live, relative to the project root — the registry it pulls
5
- * into, the directory it writes to, and the one it is allowed to read from.
6
- *
7
- * One resolution rule each, shared by every consumer, because a default spelled at the call site is
8
- * a default that drifts: `.uds` was written out at eight of them before this.
9
- *
10
- * The registry half is shared by `uds pull` (writes the registry), `uds build` (regenerates linked
11
- * CSS from it), the bundler loaders (skip its files), and the push seal (excludes its files from a
12
- * consumer's own sealed sources): `build.registryDir` when the consumer sets one, else `registry/`
13
- * beside the system's components — `src/uds/registry` in the conventional layout.
14
- */
15
- /** The prefix a system's sources are imported by (`@/uds`), for their types. */
16
- function resolveSourceAlias(buildOptions) {
17
- return normalize(buildOptions?.sourceAlias ?? BUILD_DEFAULTS.sourceAlias);
18
- }
19
- /** The prefix a system's build output is imported by (`#uds`), mapped onto its `outDir`. */
20
- function resolveOutputAlias(buildOptions) {
21
- return normalize(buildOptions?.outputAlias ?? BUILD_DEFAULTS.outputAlias);
22
- }
23
- /** Scanned rather than matched with `/\/+$/`: anchoring a repeated group at the end makes the engine
24
- * backtrack across the whole run, which is quadratic on a path that is all slashes. */
25
- const normalize = (p) => {
26
- const posix = p.replace(/\\/g, "/");
27
- let end = posix.length;
28
- while (end > 0 && posix[end - 1] === "/") end--;
29
- return posix.slice(0, end);
30
- };
31
- /**
32
- * Project-root-relative POSIX path of the linked-system registry.
33
- *
34
- * Unset, it sits beside the system's own components: `registry/` under the root its `inputDir` names
35
- * (`components` itself dropped, so `src/uds/components` and `src/uds` both give `src/uds/registry`),
36
- * or under `src/uds` when none is declared. Linked sources are then imported the way the system's own
37
- * are, `@/uds/registry/<slug>/…` beside `@/uds/components/…`.
38
- *
39
- * Read from the AUTHORED settings only, never the derived `inputDir`: a loader that has nothing but a
40
- * built `config.json` has to land on the same directory the build did.
41
- */
42
- function resolveRegistryDir(buildOptions) {
43
- if (buildOptions?.registryDir) return normalize(buildOptions.registryDir);
44
- const inputDir = buildOptions?.inputDir ? normalize(buildOptions.inputDir) : BUILD_DEFAULTS.inputRoot;
45
- const root = inputDir === "components" ? "" : inputDir.replace(/\/components$/, "");
46
- return root ? `${root}/registry` : "registry";
47
- }
48
- /**
49
- * Project-root-relative POSIX path of the build output directory.
50
- *
51
- * The schema's default unless the system says otherwise. A CLI `--output-dir` overrides both, which is
52
- * why this takes only the config: a scratch build is the caller's business, not the system's.
53
- */
54
- function resolveOutDir(buildOptions) {
55
- return normalize(buildOptions?.outDir ?? BUILD_DEFAULTS.outDir);
56
- }
57
- /**
58
- * Config-relative POSIX path of the directory every sealed file must live under, or `undefined` when
59
- * the system declares none.
60
- *
61
- * `undefined` is not a default in disguise — it is the answer that keeps the `uds/components/`
62
- * anchor convention in charge, so a config that never set this emits exactly what it emitted before.
63
- */
64
- function resolveInputDir(buildOptions) {
65
- if (!buildOptions?.inputDir) return void 0;
66
- return normalize(buildOptions.inputDir);
67
- }
68
- //#endregion
69
- export { resolveInputDir, resolveOutDir, resolveOutputAlias, resolveRegistryDir, resolveSourceAlias };