Repository navigation
fix(cli): the CLI orders names the same way on every machine - #11683
Conversation
…aces locale-dependent comparisons)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Changes are needed, and approval also waits on an engineering owner's decision.
Owner decision: no current spec says that build's start-template tie-break (spec:AST-048 FR1, FR7) or the CLI's discovery lists must order tied names the same way on every host, since spec:AST-083 FR5 covers only search, build-block and suggestion order; an engineering owner (the author included) records the decision by commenting /approve-spec <full head SHA> on this pull request, or by naming the record that states it.
Blocking:
- The title and
.changeset/compare-text.mdsay the whole CLI now orders names the same way on every machine, butastryx component --liststill sorts by host locale (packages/cli/clients/cli/commands/component.mjs:399, where undercs_CZtheChat*andCheckbox*entries print afterHStack), so narrow the wording to build, search and discovery, or move that sort tocompareText. - The description says 45
localeCompare()calls were replaced, but the diff replaces 44 calls in 24 files, so correct the count.
Non-blocking: the new locale tests also pass without this change, so an input that differs today (such as astryx search "contact form" under cs_CZ) would let them catch a regression, and the lint selector misses localeCompare(x, undefined) and new Intl.Collator().
Claims and files checked
- Claim: build, search and discovery broke ties with the host locale. Verified: 44 call sites on the base.
- Claim: the order followed the host language on full-ICU Node. Verified: search order differs under Czech, Lithuanian and Turkish on the base.
- Claim: some locales changed build's start template and block lists. Not reproduced on 98 build requests; the search order differences did reproduce.
- Claim:
compareTextgives one fixed order. Verified incompare-text.mjsand its tests. - Claim: all 45 calls now use it. All are replaced, but the count is 44 (false).
- Claim: a lint rule bans
localeComparewithout a locale in those folders. Verified for one-argument calls only. - Claim: English-host answers are unchanged. Verified: 98 build requests and 136 searches give identical answers.
- Claim: Turkish, Lithuanian and Czech output equals English. Verified on the same requests.
- Claim: earlier counts of changed starts and block lists on a replay set. Not reproducible here.
- Claim: tests cover order, catalog rotation, exact ties and locale runs. They pass; the tie and locale tests also pass without the change.
- Changeset: the whole CLI orders names the same way on every machine. False (
component --list). - Changeset: the lint rule keeps locale-dependent comparisons out of those folders. Partly true: it catches one-argument calls only.
- File
.changeset/compare-text.md: blocking finding (scope). - File
packages/cli/foundation/text/compare-text.mjs: its header overstates the scope (same finding); the code is clear. - File
eslint.config.js: clear; selector gap noted. - Files
packages/cli/api/build/build.test.mjsandpackages/cli/api/build/kit/rank.test.mjs: the new tests pass on the base (non-blocking). - File
packages/cli/api/build/kit/rank.mjs: clear; waits on the owner decision. - The other 28 files (comparator swaps and their tests under
api/search,foundation/discovery,foundation/doc-compiler,foundation/env,foundation/fs,foundation/integrations,foundation/render,foundation/textandfoundation/xle): clear.
… fail without it; stricter lint; spec lines
|
/approve-spec b2fda08 |
There was a problem hiding this comment.
Approved pending CI: the unit test, typecheck and build jobs have not finished on this head yet.
compareText now orders every CLI list and tie-break the same way on every host, and the new lines in spec:AST-048 FR7 and spec:AST-083 FR5 carry an engineering owner's approval for this head. The earlier points are addressed: astryx component --list uses the fixed order, the description's call count matches the diff, and the new locale tests fail without the change.
Non-blocking:
- AST-083's new FR5 line covers "a result or a list", but the record's Intent still names only search, build blocks and not-found suggestions, and neither the AST-083 FR5 nor the AST-048 FR6/FR7 verification row names the new host-locale tests; consider adding
api/build/build.test.mjsandclients/cli/commands/component.host-locale.test.mjsto those rows and naming the CLI's other lists in the record.
Claims and files checked
- Claim: the CLI sorted and broke ties with the host's locale. Verified: 70 one-argument
localeComparecalls on the base. - Claim: on Node with full locale data the order followed the host language. Verified: search, build and
component --listdiffer under Czech, Hawaiian, Lithuanian and Turkish on the base. - Claim: some locales changed build's start template and list order. Verified: under Hawaiian, 3 of 108 requests start from another template on the base, including "data table".
- Claim:
compareTextgives one fixed order, case-folded then lowercase first. Verified in the helper and its tests. - Claim: 70 calls in 41 files now use it. Verified against the diff.
- Claim: two calls keep a fixed
'en'locale for numeric version order. Verified. - Claim: a lint rule on the CLI's code, tests excepted, flags
localeCompareandIntl.Collatorwithout a fixed locale. Verified for every linted CLI source file; the page templates the CLI scaffolds keep their locale-aware sorts. - Claim: AST-048 FR7 and AST-083 FR5 each gain one line. Verified.
- Claim: on an English host, build's starts, alternatives and blocks are unchanged. Verified on 108 requests; search results and
component --listare unchanged too. - Claim: Turkish, Lithuanian, Czech and Hawaiian output now equals English. Verified on the same requests.
- Claim: earlier counts of 82 changed starts and about 2,500 block lists on a replay set. Not reproducible here: the replay set is not in the repository.
- Claim: tests cover the helper's order, catalog order, exact ties, and locale runs that fail without the change. Verified: both locale tests fail on the base and pass on the head.
- Changeset: the CLI orders names the same way on every machine, another language could pick a different template or list order, and a lint rule keeps locale-dependent comparisons out of the CLI. Verified.
- Files
docs/specs/AST-048-build-recommendation/spec.md,docs/specs/AST-083-result-order/spec.md: clear; non-blocking note on the FR5 line's scope and the verification rows. - File
.changeset/compare-text.md: clear. - Files
packages/cli/foundation/text/compare-text.mjsand its test: clear. - File
eslint.config.js: clear; the later rule overrides keep the new selectors. - Files
packages/cli/api/build/build.test.mjs,packages/cli/clients/cli/commands/component.host-locale.test.mjs: clear; both fail without the change. - Files
packages/cli/api/build/kit/rank.mjs,packages/cli/api/build/kit/rank.test.mjs: clear. - The other 45 files (comparator swaps and their test updates under
api,assets/codemods,clients/cliandfoundation): clear.
| Tied names order the same way on every host: the host's language setting | ||
| never changes the order of a result or a list. |
There was a problem hiding this comment.
Non-blocking: this line covers "a result or a list", but this record's Intent still names only astryx search, build's blocks and the not-found suggestions, so the rule behind astryx component --list, doctor, upgrade and manifest order is hard to find here. The FR5 verification row also still lists only the offline and repeat checks. Consider adding api/build/build.test.mjs ("gives the same answers under every host locale") and clients/cli/commands/component.host-locale.test.mjs to that row (and the AST-048 FR6, FR7 row), and naming the CLI's other lists in the Intent or in architecture:cli-surface.
|
/approve-spec 4417ac4 |
There was a problem hiding this comment.
Changes requested: one blocking finding.
- Miss:
compareTextsorts the em dash—after every letter, so the template catalog sort (packages/cli/foundation/discovery/template-adapter.mjs:1622) reorders 51 of the 79astryx template <name>not-found suggestion lists probed on an English host (astryx template cardmoveslibraryfrom 7th to 2nd) without the failed-lookup measurement AST-083 FR7 requires; keep the earlier order for names with—and_, or report that measurement, and correct the helper header that calls this the en-US order.
The same change moves 8 entries in astryx template --list and splits component groups ("List Item — Basic" now sits between "List" and "List — Basic"). Everything else checks out: both new locale tests fail on the base and pass on this head, and English-host build, search and component lists are unchanged. Non-blocking: consider naming the new locale tests in the AST-083 and AST-048 verification rows.
Claims and files checked
- The CLI broke ties with a locale-less
localeCompare, so on full-ICU Node the order followed the host's language, changing build's start under some locales: verified (the new build test fails on the base underhaw_US, wheredata tablestarts fromshell-top-nav). - A new
compareTextgives one fixed order, case-folded code units then lowercase first: verified (compare-text.mjs:27-29and its test). - 70 calls in 41 files now use it: verified (70 one-argument calls removed across 41 non-test files; none remain in CLI
.mjssource). - Two calls keep a fixed
'en'locale for numeric version order: verified (api/discover/_adapter.mjs:493,authoring/discover/parse.mjs:77). - A lint rule on the CLI, tests excepted, flags
localeCompareandIntl.Collatorwithout a fixed locale: verified for every CLI.mjsfile (eslint.config.js:848-852, plus the three later command blocks); the.tsxpage templates are example code outside the glob. - AST-048 FR7 and AST-083 FR5 each gain one line: verified.
- On an English host, build's starts, alternatives and blocks are unchanged: verified for 40 requests; the replay set itself is not in the repository.
- Under Turkish, Lithuanian, Czech and Hawaiian locales the output equals the English output: verified for search, build,
component --listandtemplate --list. - Before, one locale changed 82 starts and about 2,500 block lists: not checkable here (the replay set is not in the repository); under
haw_US3 of 40 starts move on the base. - Tests cover
compareText's order, catalog-order independence and exact ties: verified (pass on the head). - The
component --listlocale test fails without the change: verified (fails on the base undercs_CZ). - The build locale test fails without the change: verified (fails on the base under
haw_US). - Both locale tests skip on a Node without full locale data: verified (
skipIfguards). - Release note: the CLI orders names the same way on every machine and a lint rule keeps locale-dependent comparisons out of the CLI: verified for CLI
.mjssource. .changeset/compare-text.md: cleardocs/specs/AST-048-build-recommendation/spec.md: cleardocs/specs/AST-083-result-order/spec.md: non-blocking note (Intent and verification row)eslint.config.js: clearpackages/cli/api/build/build.test.mjs: clearpackages/cli/api/build/kit/rank.mjs: clearpackages/cli/api/build/kit/rank.test.mjs: clearpackages/cli/api/component/list/list.mjs: clearpackages/cli/api/discover/search/search.mjs: clearpackages/cli/api/docs/_adapter.mjs: clearpackages/cli/api/doctor/_adapter.mjs: clearpackages/cli/api/doctor/built-checks.mjs: clearpackages/cli/api/icon/_records.mjs: clearpackages/cli/api/integration/authoring-checks.mjs: clearpackages/cli/api/integration/validate-integration.mjs: clearpackages/cli/api/search/_lexical.mjs: clearpackages/cli/api/theme-edit/_preview-app.mjs: clearpackages/cli/api/theme-edit/_preview.mjs: clearpackages/cli/api/theme-edit/_settings.mjs: clearpackages/cli/api/theme/_adapter.mjs: clearpackages/cli/api/upgrade/run/run.mjs: clearpackages/cli/assets/codemods/integration-discovery.mjs: clearpackages/cli/clients/cli/commands/component.host-locale.test.mjs: clearpackages/cli/clients/cli/commands/component.mjs: clearpackages/cli/clients/cli/commands/doctor-integration.test.mjs: clearpackages/cli/clients/cli/lib/cli-error.mjs: clearpackages/cli/clients/cli/lib/manifest.mjs: clearpackages/cli/clients/cli/lib/manifest.test.mjs: clearpackages/cli/foundation/discovery/component-discovery.mjs: clearpackages/cli/foundation/discovery/component-discovery.test.mjs: clearpackages/cli/foundation/discovery/copied-passages.mjs: clearpackages/cli/foundation/discovery/doc-types.mjs: clearpackages/cli/foundation/discovery/hook-discovery.mjs: clearpackages/cli/foundation/discovery/hook-discovery.test.mjs: clearpackages/cli/foundation/discovery/icon-definition-discovery.mjs: clearpackages/cli/foundation/discovery/icon-set-checks.mjs: clearpackages/cli/foundation/discovery/icon-set-discovery.mjs: clearpackages/cli/foundation/discovery/integration-doc-files.mjs: clearpackages/cli/foundation/discovery/prop-drift.mjs: clearpackages/cli/foundation/discovery/template-adapter.mjs: blocking finding (template order, AST-083 FR7)packages/cli/foundation/discovery/template-icons.mjs: clearpackages/cli/foundation/discovery/theme-discovery.mjs: clearpackages/cli/foundation/discovery/theming-targets.mjs: clearpackages/cli/foundation/discovery/theming-targets.test.mjs: clearpackages/cli/foundation/doc-compiler/inputs.mjs: clearpackages/cli/foundation/env/semver.mjs: clearpackages/cli/foundation/fs/file-protection.mjs: clearpackages/cli/foundation/integrations/contribution-inventory.mjs: clearpackages/cli/foundation/integrations/public-imports.mjs: clearpackages/cli/foundation/render/rebuild.mjs: clearpackages/cli/foundation/text/compare-text.mjs: finding (header misstates the order)packages/cli/foundation/text/compare-text.test.mjs: clearpackages/cli/foundation/text/string-utils.mjs: clearpackages/cli/foundation/text/string-utils.test.mjs: clearpackages/cli/foundation/text/suggest-order.mjs: clearpackages/cli/foundation/xle/expand.mjs: clear
… classes, so English-host lists keep their order
|
/approve-spec a11a51e |
There was a problem hiding this comment.
Changes requested: one blocking finding, and it is in the pull request description only.
- The "Writing rubric results" line R3 says no evidence or verification cell changed, but this head changes the AST-083 FR5 verification row and the AST-048 FR6, FR7 row to name the new host-locale tests; update R3, and list those rows under "What changes".
The em-dash reordering from the last review is fixed: on an English host, template --list and every template, component and docs lookup checked print what they printed before, and Czech, Hawaiian, Turkish and Lithuanian hosts now print the same. Non-blocking: the compare-text.mjs header could say "the names the CLI ships", since user-supplied names with _ or accented letters sort by code point (the doctor test already shows .drafts/ before __fixtures__/).
Claims and files checked
- The CLI broke ties with a locale-less comparison, so on Node with full locale data its order followed the host's language: verified (Czech and Hawaiian hosts reorder lists and search on the merge base).
- Under some locales this changed build's start template and the order of block, component and other lists: verified (under Hawaiian,
data table,tableandtable pageget other starts on the merge base). - The new comparator case-folds, orders by character class, then by code point, with lowercase first on a case-only tie: verified (
compare-text.mjs:23,:53-67, and its tests). - For the names the CLI sorts, this is the English-host order: verified for shipped names (the catalog test passes on this head and on it merged into
main); user-supplied names differ where the description says they can. - 70 calls in 41 files now use it: verified (70 one-argument calls replaced in 41 non-test files).
- Two calls keep a fixed
'en'locale for numeric version order: verified (api/discover/_adapter.mjs:493,authoring/discover/parse.mjs:77). - A lint rule on the CLI, tests excepted, flags locale-less
localeCompareandIntl.Collator: verified for every CLI.mjsfile; the.tsxpage templates are example code outside it. - Each record gains one host-independence line: verified, but the verification rows also change (blocking finding).
- English-host output is unchanged: verified for 330 lookups and 8 list outputs; the replay counts themselves are not in the repository.
- Build's starts, alternatives and blocks are unchanged on an English host: verified for 40 requests.
- Code-point order inside a class affects no shipped name or path: verified for the shipped catalogs and the CLI's own paths.
- Turkish, Lithuanian, Czech and Hawaiian hosts now print the English output: verified for every probe; the earlier 82-start count is not checkable here.
- The tests cover the comparator, catalog-order independence and exact ties: verified (pass).
- The
component --listand build locale tests fail without the change and skip without full locale data: verified (both fail on the merge base;skipIfguards). - Rubric results: no narration, research, rejected alternatives, change references, open questions or project status in the records: verified.
- Rubric result R3, no evidence or verification cell changed: false (blocking finding).
- Release note: one fixed order for build, search, discovery and the lists, kept by a lint rule: verified for CLI
.mjssource. .changeset/compare-text.md: cleardocs/specs/AST-048-build-recommendation/spec.md: blocking finding (description R3)docs/specs/AST-083-result-order/spec.md: blocking finding (description R3)eslint.config.js: clearpackages/cli/api/build/build.test.mjs: clearpackages/cli/api/build/kit/rank.mjs: clearpackages/cli/api/build/kit/rank.test.mjs: clearpackages/cli/api/component/list/list.mjs: clearpackages/cli/api/discover/search/search.mjs: clearpackages/cli/api/docs/_adapter.mjs: clearpackages/cli/api/doctor/_adapter.mjs: clearpackages/cli/api/doctor/built-checks.mjs: clearpackages/cli/api/icon/_records.mjs: clearpackages/cli/api/integration/authoring-checks.mjs: clearpackages/cli/api/integration/validate-integration.mjs: clearpackages/cli/api/search/_lexical.mjs: clearpackages/cli/api/theme-edit/_preview-app.mjs: clearpackages/cli/api/theme-edit/_preview.mjs: clearpackages/cli/api/theme-edit/_settings.mjs: clearpackages/cli/api/theme/_adapter.mjs: clearpackages/cli/api/upgrade/run/run.mjs: clearpackages/cli/assets/codemods/integration-discovery.mjs: clearpackages/cli/clients/cli/commands/component.host-locale.test.mjs: clearpackages/cli/clients/cli/commands/component.mjs: clearpackages/cli/clients/cli/commands/doctor-integration.test.mjs: clearpackages/cli/clients/cli/lib/cli-error.mjs: clearpackages/cli/clients/cli/lib/manifest.mjs: clearpackages/cli/clients/cli/lib/manifest.test.mjs: clearpackages/cli/foundation/discovery/component-discovery.mjs: clearpackages/cli/foundation/discovery/component-discovery.test.mjs: clearpackages/cli/foundation/discovery/copied-passages.mjs: clearpackages/cli/foundation/discovery/doc-types.mjs: clearpackages/cli/foundation/discovery/hook-discovery.mjs: clearpackages/cli/foundation/discovery/hook-discovery.test.mjs: clearpackages/cli/foundation/discovery/icon-definition-discovery.mjs: clearpackages/cli/foundation/discovery/icon-set-checks.mjs: clearpackages/cli/foundation/discovery/icon-set-discovery.mjs: clearpackages/cli/foundation/discovery/integration-doc-files.mjs: clearpackages/cli/foundation/discovery/prop-drift.mjs: clearpackages/cli/foundation/discovery/template-adapter.mjs: clearpackages/cli/foundation/discovery/template-icons.mjs: clearpackages/cli/foundation/discovery/theme-discovery.mjs: clearpackages/cli/foundation/discovery/theming-targets.mjs: clearpackages/cli/foundation/discovery/theming-targets.test.mjs: clearpackages/cli/foundation/doc-compiler/inputs.mjs: clearpackages/cli/foundation/env/semver.mjs: clearpackages/cli/foundation/fs/file-protection.mjs: clearpackages/cli/foundation/integrations/contribution-inventory.mjs: clearpackages/cli/foundation/integrations/public-imports.mjs: clearpackages/cli/foundation/render/rebuild.mjs: clearpackages/cli/foundation/text/compare-text.mjs: non-blocking note (header wording)packages/cli/foundation/text/compare-text.test.mjs: clearpackages/cli/foundation/text/string-utils.mjs: clearpackages/cli/foundation/text/string-utils.test.mjs: clearpackages/cli/foundation/text/suggest-order.mjs: clearpackages/cli/foundation/xle/expand.mjs: clear
| * so it is the same on every machine. For the names the CLI sorts it | ||
| * matches the order an English host gives. Pure, so browser-bundled code |
There was a problem hiding this comment.
Non-blocking: "For the names the CLI sorts it matches the order an English host gives" holds for the shipped catalogs, but inside a class this sorts by code point, so user-supplied names differ: components/.drafts/… now sorts before components/__fixtures__/… (the doctor test at doctor-integration.test.mjs:512), and Éclair after Zebra. "For the names the CLI ships" would match the description.
|
/approve-spec b7f634a |
There was a problem hiding this comment.
Approved pending CI: lint and the CLI smoke test pass on this head, but the main CI run stopped at admission because CI was full, so its build, typecheck and test jobs have not run yet; re-running all jobs is the next step.
The blocking finding from the last review is fixed: the description's rubric result now names the two verification-row edits. On this head, build, search, the list commands and not-found suggestions print the same output under Czech, Hawaiian, Turkish and Lithuanian hosts as under English, and English-host output for shipped names is unchanged. Three non-blocking notes stay from the last review: the helper header's English-order wording, the result-order record's Intent, and the second compareText (code-unit order) in api/theme/build/family.mjs.
Claims and files checked
- The CLI's locale-less comparisons made its order follow the host's language on Node with full locale data: verified (Czech, Hawaiian and Lithuanian hosts reorder lists and search on the base).
- Under some locales this changed build's start template and the order of block, component and other lists: verified (under Hawaiian,
data table,tableandtable pageget other starts on the base). - The new comparator case-folds, orders by character class, then by code point, with lowercase first on a case-only tie: verified (
compare-text.mjs:23,:53-67, its tests, and a fuzzed total-order check). - For the names the CLI sorts, this is the English-host order: verified for shipped names (every pair of 1,895 listed names agrees with an English collator, and 7,367 package paths sort the same); user-supplied names differ where the description says they can.
- 70 calls in 41 files now use it: verified.
- Two calls keep a fixed
'en'locale for numeric version order: verified (api/discover/_adapter.mjs:493,authoring/discover/parse.mjs:77). - A lint rule on the CLI, tests excepted, flags locale-less
localeCompareandIntl.Collator: verified for every non-test CLI.mjsfile; the.tsxpage templates are example code outside it. - Each of the two records gains one host-independence line, and the two verification rows name the new locale tests: verified.
- English-host output is unchanged: verified for 23 list, search, build and not-found outputs and seven theme builds; the replay counts themselves are not in the repository.
- Build's starts, alternatives and blocks are unchanged on an English host: verified for the builds probed.
- Code-point order inside a class affects no shipped name or path: verified.
- Turkish, Lithuanian, Czech and Hawaiian hosts now print the English output: verified for every probe; the earlier start and block-list counts are not checkable here.
- The tests cover the comparator, catalog-order independence and exact ties: verified (pass).
- The
component --listand build locale tests fail without the change and skip without full locale data: verified (both fail on the base;skipIfguards). - Rubric results: no narration, research, rejected alternatives, change references, open questions or project status; only the two verification rows changed among evidence cells: verified.
- Release note: build, search, discovery and the lists use one fixed order, kept by a lint rule: verified for CLI
.mjssource. .changeset/compare-text.md: cleardocs/specs/AST-048-build-recommendation/spec.md: cleardocs/specs/AST-083-result-order/spec.md: non-blocking note (Intent)eslint.config.js: clearpackages/cli/api/build/build.test.mjs: clearpackages/cli/api/build/kit/rank.mjs: clearpackages/cli/api/build/kit/rank.test.mjs: clearpackages/cli/api/component/list/list.mjs: clearpackages/cli/api/discover/search/search.mjs: clearpackages/cli/api/docs/_adapter.mjs: clearpackages/cli/api/doctor/_adapter.mjs: clearpackages/cli/api/doctor/built-checks.mjs: clearpackages/cli/api/icon/_records.mjs: clearpackages/cli/api/integration/authoring-checks.mjs: clearpackages/cli/api/integration/validate-integration.mjs: clearpackages/cli/api/search/_lexical.mjs: clearpackages/cli/api/theme-edit/_preview-app.mjs: clearpackages/cli/api/theme-edit/_preview.mjs: clearpackages/cli/api/theme-edit/_settings.mjs: clearpackages/cli/api/theme/_adapter.mjs: clearpackages/cli/api/upgrade/run/run.mjs: clearpackages/cli/assets/codemods/integration-discovery.mjs: clearpackages/cli/clients/cli/commands/component.host-locale.test.mjs: clearpackages/cli/clients/cli/commands/component.mjs: clearpackages/cli/clients/cli/commands/doctor-integration.test.mjs: clearpackages/cli/clients/cli/lib/cli-error.mjs: clearpackages/cli/clients/cli/lib/manifest.mjs: clearpackages/cli/clients/cli/lib/manifest.test.mjs: clearpackages/cli/foundation/discovery/component-discovery.mjs: clearpackages/cli/foundation/discovery/component-discovery.test.mjs: clearpackages/cli/foundation/discovery/copied-passages.mjs: clearpackages/cli/foundation/discovery/doc-types.mjs: clearpackages/cli/foundation/discovery/hook-discovery.mjs: clearpackages/cli/foundation/discovery/hook-discovery.test.mjs: clearpackages/cli/foundation/discovery/icon-definition-discovery.mjs: clearpackages/cli/foundation/discovery/icon-set-checks.mjs: clearpackages/cli/foundation/discovery/icon-set-discovery.mjs: clearpackages/cli/foundation/discovery/integration-doc-files.mjs: clearpackages/cli/foundation/discovery/prop-drift.mjs: clearpackages/cli/foundation/discovery/template-adapter.mjs: clearpackages/cli/foundation/discovery/template-icons.mjs: clearpackages/cli/foundation/discovery/theme-discovery.mjs: clearpackages/cli/foundation/discovery/theming-targets.mjs: clearpackages/cli/foundation/discovery/theming-targets.test.mjs: clearpackages/cli/foundation/doc-compiler/inputs.mjs: clearpackages/cli/foundation/env/semver.mjs: clearpackages/cli/foundation/fs/file-protection.mjs: clearpackages/cli/foundation/integrations/contribution-inventory.mjs: clearpackages/cli/foundation/integrations/public-imports.mjs: clearpackages/cli/foundation/render/rebuild.mjs: clearpackages/cli/foundation/text/compare-text.mjs: non-blocking note (header wording)packages/cli/foundation/text/compare-text.test.mjs: clearpackages/cli/foundation/text/string-utils.mjs: clearpackages/cli/foundation/text/string-utils.test.mjs: clearpackages/cli/foundation/text/suggest-order.mjs: clearpackages/cli/foundation/xle/expand.mjs: clear
|
/approve-spec c946b35 |
There was a problem hiding this comment.
Approved pending CI: lint, typecheck, the CLI smoke test and codemod checks pass on this head, but the main CI run's node, UI, build, docsite and swizzle-proof jobs are still running.
The merge of main keeps the change whole: Core's component list, now also stored at publish, goes through the same fixed order as the live read, so the stored and live lists print alike on every host. On this head, build, search, the list commands and not-found suggestions print the same output under Czech, Hawaiian, Turkish and Lithuanian hosts as under English, and English-host output is unchanged from the base. Four non-blocking notes remain: the merged-in Czech case in packages/cli/test/packed-component-list.test.mjs is still titled "prints groups in the running locale's order", the helper header's English-order wording, the result-order record's Intent, and the second compareText (code-unit order) in api/theme/build/family.mjs.
Claims and files checked
- The CLI's locale-less comparisons made its order follow the host's language on Node with full locale data: verified (Czech, Hawaiian and Lithuanian hosts reorder lists and search on the base).
- Under some locales this changed build's start template and the order of block, component and other lists: verified (under Hawaiian,
build tablestarts from the app shell on the base). - The new comparator case-folds, orders by character class, then by code point, with lowercase first on a case-only tie: verified (
compare-text.mjs:23,:53-67, its tests, and a fuzzed total-order check). - For the names the CLI sorts, this is the English-host order: verified for every sorted shipped name and 6,620 package paths; user-supplied names differ where the description says they can.
- 70 calls in 41 files now use it: verified.
- Two calls keep a fixed
'en'locale for numeric version order: verified (api/discover/_adapter.mjs:493,authoring/discover/parse.mjs:77). - A lint rule on the CLI, tests excepted, flags locale-less
localeCompareandIntl.Collator: verified for all 730 linted non-test CLI.mjsfiles; the.tsxpage templates are example code outside it. - Each of the two records gains one host-independence line, and the two verification rows name the new locale tests: verified.
- English-host output is unchanged: verified for 24 list, search, build and not-found outputs; the replay counts themselves are not in the repository.
- Build's starts, alternatives and blocks are unchanged on an English host: verified for the builds probed.
- Code-point order inside a class affects no shipped name or path: verified.
- Turkish, Lithuanian, Czech and Hawaiian hosts now print the English output: verified for every probe; the earlier start and block-list counts are not checkable here.
- The tests cover the comparator, catalog-order independence and exact ties: verified (pass).
- The
component --listand build locale tests fail without the change and skip without full locale data: verified (both fail on the base;skipIfguards). - Rubric results: no narration, research, rejected alternatives, change references, open questions or project status; only the two verification rows changed among evidence cells: verified.
- Release note: build, search, discovery and the lists use one fixed order, kept by a lint rule: verified for CLI
.mjssource. .changeset/compare-text.md: cleardocs/specs/AST-048-build-recommendation/spec.md: cleardocs/specs/AST-083-result-order/spec.md: non-blocking note (Intent)eslint.config.js: clearpackages/cli/api/build/build.test.mjs: clearpackages/cli/api/build/kit/rank.mjs: clearpackages/cli/api/build/kit/rank.test.mjs: clearpackages/cli/api/component/list/list.mjs: clearpackages/cli/api/discover/search/search.mjs: clearpackages/cli/api/docs/_adapter.mjs: clearpackages/cli/api/doctor/_adapter.mjs: clearpackages/cli/api/doctor/built-checks.mjs: clearpackages/cli/api/icon/_records.mjs: clearpackages/cli/api/integration/authoring-checks.mjs: clearpackages/cli/api/integration/validate-integration.mjs: clearpackages/cli/api/search/_lexical.mjs: clearpackages/cli/api/theme-edit/_preview-app.mjs: clearpackages/cli/api/theme-edit/_preview.mjs: clearpackages/cli/api/theme-edit/_settings.mjs: clearpackages/cli/api/theme/_adapter.mjs: clearpackages/cli/api/upgrade/run/run.mjs: clearpackages/cli/assets/codemods/integration-discovery.mjs: clearpackages/cli/clients/cli/commands/component.host-locale.test.mjs: clearpackages/cli/clients/cli/commands/component.mjs: clearpackages/cli/clients/cli/commands/doctor-integration.test.mjs: clearpackages/cli/clients/cli/lib/cli-error.mjs: clearpackages/cli/clients/cli/lib/manifest.mjs: clearpackages/cli/clients/cli/lib/manifest.test.mjs: clearpackages/cli/foundation/discovery/component-discovery.mjs: clearpackages/cli/foundation/discovery/component-discovery.test.mjs: clearpackages/cli/foundation/discovery/copied-passages.mjs: clearpackages/cli/foundation/discovery/doc-types.mjs: clearpackages/cli/foundation/discovery/hook-discovery.mjs: clearpackages/cli/foundation/discovery/hook-discovery.test.mjs: clearpackages/cli/foundation/discovery/icon-definition-discovery.mjs: clearpackages/cli/foundation/discovery/icon-set-checks.mjs: clearpackages/cli/foundation/discovery/icon-set-discovery.mjs: clearpackages/cli/foundation/discovery/integration-doc-files.mjs: clearpackages/cli/foundation/discovery/prop-drift.mjs: clearpackages/cli/foundation/discovery/template-adapter.mjs: clearpackages/cli/foundation/discovery/template-icons.mjs: clearpackages/cli/foundation/discovery/theme-discovery.mjs: clearpackages/cli/foundation/discovery/theming-targets.mjs: clearpackages/cli/foundation/discovery/theming-targets.test.mjs: clearpackages/cli/foundation/doc-compiler/inputs.mjs: clearpackages/cli/foundation/env/semver.mjs: clearpackages/cli/foundation/fs/file-protection.mjs: clearpackages/cli/foundation/integrations/contribution-inventory.mjs: clearpackages/cli/foundation/integrations/public-imports.mjs: clearpackages/cli/foundation/render/rebuild.mjs: clearpackages/cli/foundation/text/compare-text.mjs: non-blocking note (header wording)packages/cli/foundation/text/compare-text.test.mjs: clearpackages/cli/foundation/text/string-utils.mjs: clearpackages/cli/foundation/text/string-utils.test.mjs: clearpackages/cli/foundation/text/suggest-order.mjs: clearpackages/cli/foundation/xle/expand.mjs: clear
What changes
The CLI sorted and broke ties with
String.prototype.localeCompare()and no locale, so its order followed the host's language setting on Node builds with full locale data (the official builds, macOS). Under some locales this changed which page template build starts from, and the order of block, component and other lists.compareText(foundation/text/compare-text.mjs): one fixed order that never reads a locale. It compares case-folded text character by character by Unicode class (spaces, then punctuation, then symbols, then digits, then letters), then by code point; a case-only tie puts lowercase first. For the names the CLI sorts, this is the order an English host gave.astryx component --list), the manifest, doctor, upgrade, integration, theme and docs adapters now use it. Two calls keep a fixed'en'locale for numeric version order.packages/cli(tests excepted) flagslocaleCompareandIntl.Collatorwithout a fixed locale.component.host-locale.test.mjsand the host-locale checks inbuild.test.mjs). Prettier realigned those tables, so their diffs are wider than the edit.Measured
On an English host (Node with full locale data), output is unchanged: 3,933 CLI commands (lists, not-found suggestions for 610 catalog words, search, build) give byte-identical output with the old and new comparison; every one of the 43,958 comparisons those commands make agrees in sign; all pairs of the 1,964 shipped names agree; 6,810 repository paths sort identically. Build's starts, alternatives and blocks are also unchanged on the whole replay set. Within one character class, characters sort by code point, so
-sorts before_where the root collation puts_first; no shipped name or path depends on that. Under Turkish, Lithuanian, Czech and Hawaiian locales the output now equals the English output (before, one locale changed 82 starts and about 2,500 block lists).Tests
compareTextorder; ranking is the same for a reversed or rotated catalog; exact ties break by name.component --listunder en_US vs cs_CZ and haw_US (fails without the change).Writing rubric results