@yahoo/uds-create-config 5.108.2 → 5.108.4
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/dist/__fixtures__/yos-native.d.ts +5 -0
- package/dist/configs/react-native-system.d.ts +5 -0
- package/dist/configs/react-native-system.js +2 -0
- package/dist/configs/system.js +2 -0
- package/dist/entities/native/NativeSettings.d.ts +5 -0
- package/dist/entities/system/Settings.d.ts +10 -0
- package/dist/entities/system/Settings.js +13 -0
- package/dist/entities/system/component-module.js +48 -1
- package/dist/framework/Config.d.ts +9 -2
- package/dist/framework/Config.js +8 -3
- package/dist/framework/inline-sources.d.ts +7 -0
- package/dist/framework/inline-sources.js +51 -4
- package/dist/framework/schema-version.d.ts +1 -1
- package/dist/framework/schema-version.js +5 -5
- package/dist/lint/catalog.d.ts +40 -0
- package/dist/lint/catalog.js +50 -0
- package/dist/lint/edits.d.ts +27 -3
- package/dist/lint/edits.js +40 -1
- package/dist/lint/index.d.ts +4 -3
- package/dist/lint/index.js +3 -2
- package/dist/lint/lint.d.ts +1 -1
- package/dist/lint/lint.js +11 -5
- package/dist/lint/rules.d.ts +7 -7
- package/dist/lint/rules.js +6 -6
- package/dist/migrations/20261118171253_lint_names_removed.d.ts +4 -0
- package/dist/migrations/20261118171253_lint_names_removed.js +10 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/lint/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ignoredBy } from "./context.js";
|
|
2
2
|
import { AUTHORING_LINT_GROUPS, AUTHORING_LINT_RULES, CONFIG_LINT_RULES, flatLintSeverities, lintReads, lintRuleSettingNotes, nestLintSeverities, ruleSeverity } from "./rules.js";
|
|
3
|
-
import {
|
|
3
|
+
import { isBuiltInRule, isLintGroup, lintCatalog, lintNames, removedLintRules } from "./catalog.js";
|
|
4
|
+
import { fixEdits, groupSeverity, hasFix, ignoreEdits, ignoreEntry, lintIgnores, lintNameEdits, lintSeverities, removeRuleEdits, restoreEdits, retargetEdits, rulesOf, severityEdits } from "./edits.js";
|
|
4
5
|
import { lint, lintConfig } from "./lint.js";
|
|
5
|
-
export { AUTHORING_LINT_GROUPS, AUTHORING_LINT_RULES, CONFIG_LINT_RULES, fixEdits, flatLintSeverities, groupSeverity, hasFix, ignoreEdits, ignoreEntry, ignoredBy, lint, lintConfig, lintIgnores, lintReads, lintRuleSettingNotes, lintSeverities, nestLintSeverities, restoreEdits, retargetEdits, ruleSeverity, rulesOf, severityEdits };
|
|
6
|
+
export { AUTHORING_LINT_GROUPS, AUTHORING_LINT_RULES, CONFIG_LINT_RULES, fixEdits, flatLintSeverities, groupSeverity, hasFix, ignoreEdits, ignoreEntry, ignoredBy, isBuiltInRule, isLintGroup, lint, lintCatalog, lintConfig, lintIgnores, lintNameEdits, lintNames, lintReads, lintRuleSettingNotes, lintSeverities, nestLintSeverities, removeRuleEdits, removedLintRules, restoreEdits, retargetEdits, ruleSeverity, rulesOf, severityEdits };
|
package/dist/lint/lint.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Config } from "../framework/Config.js";
|
|
2
|
-
import { AuthoringLintFix, AuthoringLintRule, AuthoringLintSeverity, LintRuleSettingNote } from "./rules.js";
|
|
3
2
|
import { ConfigLintFinding, ConfigLintOptions } from "./context.js";
|
|
3
|
+
import { AuthoringLintFix, AuthoringLintRule, AuthoringLintSeverity, LintRuleSettingNote } from "./rules.js";
|
|
4
4
|
|
|
5
5
|
//#region src/lint/lint.d.ts
|
|
6
6
|
/** One text replacement an `auto` fix makes: `text` in place of `[start, end)` in `file`. */
|
package/dist/lint/lint.js
CHANGED
|
@@ -2,6 +2,7 @@ import { Settings } from "../entities/system/Settings.js";
|
|
|
2
2
|
import "../index.js";
|
|
3
3
|
import { configLintContext, ignoredBy } from "./context.js";
|
|
4
4
|
import { AUTHORING_LINT_RULES, lintReads } from "./rules.js";
|
|
5
|
+
import { removedLintRules } from "./catalog.js";
|
|
5
6
|
//#region src/lint/lint.ts
|
|
6
7
|
/**
|
|
7
8
|
* Running the lint. `lintConfig` runs the rules that read the config, synchronously, wherever a config
|
|
@@ -79,14 +80,19 @@ function lintConfig(config, options = {}) {
|
|
|
79
80
|
*/
|
|
80
81
|
async function lint(config, { sources } = {}) {
|
|
81
82
|
const ignores = Settings.get(config)?.lint?.ignore ?? [];
|
|
82
|
-
const
|
|
83
|
+
const removed = removedLintRules(config);
|
|
84
|
+
const found = lintConfig(sources?.prepare ? await sources.prepare(config) : config, sources ? {} : { rules: Object.keys(AUTHORING_LINT_RULES).filter((rule) => lintReads(rule) !== "code") }).filter((finding) => !removed.has(finding.rule) && !ignoredBy(ignores, finding));
|
|
83
85
|
if (!sources) return { config: found };
|
|
86
|
+
const result = await sources.lint({
|
|
87
|
+
config,
|
|
88
|
+
configFindings: found
|
|
89
|
+
});
|
|
84
90
|
return {
|
|
85
91
|
config: found,
|
|
86
|
-
sources:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
92
|
+
sources: {
|
|
93
|
+
...result,
|
|
94
|
+
findings: result.findings.filter((finding) => !removed.has(finding.rule))
|
|
95
|
+
}
|
|
90
96
|
};
|
|
91
97
|
}
|
|
92
98
|
//#endregion
|
package/dist/lint/rules.d.ts
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { unmappedNativeStyleKeys } from "./native-style-keys.js";
|
|
2
1
|
import { ConfigLintContext, ConfigLintReport, LintLayer, LintValue, LintedComponent } from "./context.js";
|
|
2
|
+
import { unmappedNativeStyleKeys } from "./native-style-keys.js";
|
|
3
3
|
|
|
4
4
|
//#region src/lint/rules.d.ts
|
|
5
5
|
declare const AUTHORING_LINT_GROUPS: {
|
|
6
6
|
readonly portability: {
|
|
7
|
-
readonly title: "
|
|
7
|
+
readonly title: "Linking & Extending";
|
|
8
8
|
readonly about: "Values that reach a component only through code, so a team that links or extends your system can’t change them.";
|
|
9
9
|
};
|
|
10
10
|
readonly editability: {
|
|
11
|
-
readonly title: "
|
|
11
|
+
readonly title: "Hidden from Create";
|
|
12
12
|
readonly about: "Behavior and styling decided in code, where Create can't show or change it. Turn this group off if your system is only ever edited in code.";
|
|
13
13
|
};
|
|
14
14
|
readonly maintainability: {
|
|
15
|
-
readonly title: "
|
|
15
|
+
readonly title: "Redundancies";
|
|
16
16
|
readonly about: "Styles written longer than they need to be: values your tokens already hold, the same value repeated under every option, and settings that change nothing. Each makes the next change harder.";
|
|
17
17
|
};
|
|
18
18
|
readonly design: {
|
|
19
|
-
readonly title: "
|
|
19
|
+
readonly title: "Accessibility";
|
|
20
20
|
readonly about: "Contrast, spacing and sizing your users will notice: text that is hard to read, values just off your scale, colors that stay the same in dark mode, and targets too small to tap.";
|
|
21
21
|
};
|
|
22
22
|
readonly compatibility: {
|
|
23
|
-
readonly title: "
|
|
23
|
+
readonly title: "Future-proofing";
|
|
24
24
|
readonly about: "Reliance on parts of the platform that are changing or internal, which a future update can break.";
|
|
25
25
|
};
|
|
26
26
|
readonly nursery: {
|
|
27
|
-
readonly title: "
|
|
27
|
+
readonly title: "Beta";
|
|
28
28
|
readonly about: "New rules still being tuned. They are off unless you turn them on, and their advice may change."; /** Naming the group turns none of them on: a nursery rule is taken up one at a time. */
|
|
29
29
|
readonly defaultSeverity: "off";
|
|
30
30
|
};
|
package/dist/lint/rules.js
CHANGED
|
@@ -19,27 +19,27 @@ import { unmappedNativeStyleKeys } from "./native-style-keys.js";
|
|
|
19
19
|
*/
|
|
20
20
|
const AUTHORING_LINT_GROUPS = {
|
|
21
21
|
portability: {
|
|
22
|
-
title: "
|
|
22
|
+
title: "Linking & Extending",
|
|
23
23
|
about: "Values that reach a component only through code, so a team that links or extends your system can’t change them."
|
|
24
24
|
},
|
|
25
25
|
editability: {
|
|
26
|
-
title: "
|
|
26
|
+
title: "Hidden from Create",
|
|
27
27
|
about: "Behavior and styling decided in code, where Create can't show or change it. Turn this group off if your system is only ever edited in code."
|
|
28
28
|
},
|
|
29
29
|
maintainability: {
|
|
30
|
-
title: "
|
|
30
|
+
title: "Redundancies",
|
|
31
31
|
about: "Styles written longer than they need to be: values your tokens already hold, the same value repeated under every option, and settings that change nothing. Each makes the next change harder."
|
|
32
32
|
},
|
|
33
33
|
design: {
|
|
34
|
-
title: "
|
|
34
|
+
title: "Accessibility",
|
|
35
35
|
about: "Contrast, spacing and sizing your users will notice: text that is hard to read, values just off your scale, colors that stay the same in dark mode, and targets too small to tap."
|
|
36
36
|
},
|
|
37
37
|
compatibility: {
|
|
38
|
-
title: "
|
|
38
|
+
title: "Future-proofing",
|
|
39
39
|
about: "Reliance on parts of the platform that are changing or internal, which a future update can break."
|
|
40
40
|
},
|
|
41
41
|
nursery: {
|
|
42
|
-
title: "
|
|
42
|
+
title: "Beta",
|
|
43
43
|
about: "New rules still being tuned. They are off unless you turn them on, and their advice may change.",
|
|
44
44
|
/** Naming the group turns none of them on: a nursery rule is taken up one at a time. */
|
|
45
45
|
defaultSeverity: "off"
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Lint settings take `names` and `removed`; stored configs and draft patches keep their shape. */
|
|
2
|
+
import type { SchemaMigration } from '../framework/schema-version';
|
|
3
|
+
export declare const LINT_NAMES_REMOVED_VERSION = 20261118171253;
|
|
4
|
+
export declare const lintNamesRemovedMigration: SchemaMigration;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/migrations/20261118171253_lint_names_removed.ts
|
|
2
|
+
const LINT_NAMES_REMOVED_VERSION = 20261118171253;
|
|
3
|
+
const lintNamesRemovedMigration = {
|
|
4
|
+
version: LINT_NAMES_REMOVED_VERSION,
|
|
5
|
+
up(json) {
|
|
6
|
+
return json;
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { LINT_NAMES_REMOVED_VERSION, lintNamesRemovedMigration };
|