@kerfjs/ui 5.0.0-beta.116 → 5.0.0-beta.117

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.
@@ -1,6 +1,6 @@
1
1
  # Public API signatures for the UI authoring corpus
2
2
 
3
- Generated from emitted declarations for `@kerfjs/ui@5.0.0-beta.116` and `kerfjs@5.0.0-beta.116`. This bounded reference covers only APIs used by the seven-task corpus. It is interface evidence, not an implementation or runtime guarantee.
3
+ Generated from emitted declarations for `@kerfjs/ui@5.0.0-beta.117` and `kerfjs@5.0.0-beta.117`. This bounded reference covers only APIs used by the seven-task corpus. It is interface evidence, not an implementation or runtime guarantee.
4
4
 
5
5
  ## `@kerfjs/ui/css-values`
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Web Awesome JSX signatures for the UI authoring corpus
2
2
 
3
- Generated from the emitted `@kerfjs/ui@5.0.0-beta.116` declaration boundary. Import `@kerfjs/ui/webawesome` for type effects when authoring direct `wa-*` JSX. The module emits no runtime behavior and does not register custom elements.
3
+ Generated from the emitted `@kerfjs/ui@5.0.0-beta.117` declaration boundary. Import `@kerfjs/ui/webawesome` for type effects when authoring direct `wa-*` JSX. The module emits no runtime behavior and does not register custom elements.
4
4
 
5
5
  ```ts
6
6
  import { KerfCustomElement } from 'kerfjs/jsx-runtime';
@@ -39,6 +39,7 @@ export const UI_ANALYSIS_ACTIONS: Readonly<Record<`KUI-L${string}`, string>>;
39
39
 
40
40
  export function analyzeUiProject(options?: {
41
41
  root?: string;
42
+ workspaceRoot?: string;
42
43
  paths?: string[];
43
44
  profile?: string;
44
45
  knownRules?: Iterable<string>;
@@ -1846,6 +1846,7 @@ function inspectTsx(
1846
1846
 
1847
1847
  export async function analyzeUiProject({
1848
1848
  root: requestedRoot = process.cwd(),
1849
+ workspaceRoot: requestedWorkspaceRoot = requestedRoot,
1849
1850
  paths,
1850
1851
  knownRules = [],
1851
1852
  adoption = false,
@@ -1859,6 +1860,7 @@ export async function analyzeUiProject({
1859
1860
  ),
1860
1861
  } = {}) {
1861
1862
  const root = resolve(requestedRoot);
1863
+ const workspaceRoot = resolve(requestedWorkspaceRoot);
1862
1864
  const files = await collectFiles(root, paths);
1863
1865
  const diagnosticDecisions = new Map();
1864
1866
  const contents = new Map(
@@ -1912,7 +1914,7 @@ export async function analyzeUiProject({
1912
1914
  startDirectory,
1913
1915
  (async () => {
1914
1916
  const profileResult = await loadApplicationUiProfile({
1915
- workspaceRoot: root,
1917
+ workspaceRoot,
1916
1918
  startDirectory,
1917
1919
  packageProfile,
1918
1920
  knownRules: [...Object.keys(UI_ANALYSIS_RULES), ...knownRules],
@@ -2093,7 +2095,7 @@ export async function analyzeUiProject({
2093
2095
  };
2094
2096
  const consumer =
2095
2097
  relative(root, context.startDirectory).replaceAll('\\', '/') || '.';
2096
- if (isSuppressed(item, context.profileResult.profile, root)) {
2098
+ if (isSuppressed(item, context.profileResult.profile, workspaceRoot)) {
2097
2099
  decision.suppressed = true;
2098
2100
  decision.suppressedConsumers.add(consumer);
2099
2101
  } else {
package/docs/ui-doctor.md CHANGED
@@ -16,6 +16,8 @@ The default terminal output is short and repair-oriented. `--format json` emits
16
16
 
17
17
  The catalog stage discovers the package-default application UI profile and workspace/root-to-leaf directory layers. It validates referenced selection/composition catalogs and, when a workspace declares `package.json#kerfComponentCatalog`, invokes the installed `create-kerf-component` catalog checker to validate metadata, source exports, schema conformance, and generated-output drift. This checker reads source text; it does not import application modules.
18
18
 
19
+ For `--root <workspace> --package <name>`, the analyzer and ESLint stages use that same workspace root to resolve the root profile, nested directory profiles, catalogs, and workspace-relative exception targets. They inspect only the selected package's source files. Keep a workspace profile at the root with `"scope": "workspace"`; a package-local profile under it uses `"scope": "directory"`. An authored doctor config may live in the package and be passed with `--config` relative to the workspace root.
20
+
19
21
  TypeScript uses the compiler API with `noEmit`. ESLint loads the installed `eslint-plugin-kerfjs` `recommended-ui` preset (`--eslint strict-ui` opts into advisory rules as errors). This is deliberately an isolated Kerf lint pass rather than the consumer's complete ESLint configuration. For each file, the doctor projects the applicable core ESLint rules and `linterOptions` from the consumer configuration so core-rule suppression directives retain the same used/unused semantics as the application's normal lint command. Consumer plugin rules are not executed, and inline directives for plugins such as `@typescript-eslint` therefore do not produce false "rule definition not found" diagnostics; the consumer's normal ESLint command remains authoritative for those rules. Unknown `kerfjs/*` directives still fail the doctor pass. Stable KUI identifiers come from the packaged `application-ui-diagnostic-ids-v1.json` registry; the doctor also reads installed ESLint message metadata for semantic conflict detection instead of duplicating rule definitions. The analyzer calls the public `@kerfjs/ui/analyzer` contract. None of these stages executes generated application code.
20
22
 
21
23
  Composition findings come from the same catalogs. `KUI-L201`–`KUI-L203`
package/doctor/index.mjs CHANGED
@@ -497,7 +497,14 @@ async function installedPackageVersion(root, name) {
497
497
 
498
498
  async function cacheKey(root, packageRoot, mode, paths, config) {
499
499
  const files = await collectInputs(packageRoot);
500
- for (const directory of new Set([root, packageRoot])) {
500
+ const profileDirectories = [];
501
+ let directory = packageRoot;
502
+ while (directory === root || !relative(root, directory).startsWith('..')) {
503
+ profileDirectories.push(directory);
504
+ if (directory === root) break;
505
+ directory = dirname(directory);
506
+ }
507
+ for (const directory of profileDirectories) {
501
508
  for (const name of [
502
509
  'package.json',
503
510
  'package-lock.json',
@@ -511,6 +518,20 @@ async function cacheKey(root, packageRoot, mode, paths, config) {
511
518
  const path = resolve(directory, name);
512
519
  if (!files.includes(path) && (await exists(path))) files.push(path);
513
520
  }
521
+ const profilePath = resolve(directory, '.kerf-ui-profile.json');
522
+ if (await exists(profilePath)) {
523
+ try {
524
+ const profile = JSON.parse(await readFile(profilePath, 'utf8'));
525
+ for (const catalog of profile.catalogs ?? [])
526
+ for (const reference of [catalog.selection, catalog.composition]) {
527
+ if (typeof reference?.path !== 'string') continue;
528
+ const path = resolve(directory, reference.path);
529
+ if (!files.includes(path) && (await exists(path))) files.push(path);
530
+ }
531
+ } catch {
532
+ // The profile file itself remains in the key; validation reports bad JSON.
533
+ }
534
+ }
514
535
  }
515
536
  files.sort();
516
537
  const toolVersions = Object.fromEntries(
@@ -935,6 +956,7 @@ function eslintSeverity(severity, code) {
935
956
  }
936
957
 
937
958
  async function runEslint({
959
+ root,
938
960
  packageRoot,
939
961
  paths,
940
962
  eslintConfig = 'recommended-ui',
@@ -988,6 +1010,7 @@ async function runEslint({
988
1010
  });
989
1011
  }
990
1012
  configs.push(preset);
1013
+ configs.push({ settings: { kerfjs: { ui: { workspaceRoot: root } } } });
991
1014
  const consumerEslint = new ESLint({ cwd: packageRoot });
992
1015
  if (await consumerEslint.findConfigFile()) {
993
1016
  const consumerCoreConfigs = await Promise.all(
@@ -1256,6 +1279,7 @@ export async function runUiDoctor({
1256
1279
  ...normalizeAnalyzer(
1257
1280
  await analyzeUiProject({
1258
1281
  root: packageRoot,
1282
+ workspaceRoot: root,
1259
1283
  paths: selectedPaths,
1260
1284
  ownership: config.ownership ?? 'package',
1261
1285
  ownershipContext: config.ownershipContext ?? 'subject',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kerfjs/ui",
3
- "version": "5.0.0-beta.116",
3
+ "version": "5.0.0-beta.117",
4
4
  "description": "Accessible, composable UI primitives for kerf applications.",
5
5
  "type": "module",
6
6
  "license": "MIT",