Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 10, 2025

Plan: Rename TypeScript/JavaScript Classes in atsds

This PR renames several TypeScript/JavaScript classes to follow PascalCase naming conventions:

Classes Renamed:

  • _common_t_Common (internal base class)
  • string_tString_ (exported class)
  • variable_tVariable (exported class)
  • item_tItem (exported class)
  • list_tList (exported class)
  • term_tTerm (exported class)
  • rule_tRule (exported class)
  • search_tSearch (exported class)

Files Modified:

  • atsds/index.mts - Main TypeScript source with class definitions
  • tests/test_string.mjs - Import and usage
  • tests/test_variable.mjs - Import and usage
  • tests/test_item.mjs - Import and usage
  • tests/test_list.mjs - Import and usage
  • tests/test_term.mjs - Import and usage
  • tests/test_rule.mjs - Import and usage
  • tests/test_search.mjs - Import and usage
  • examples/main.mjs - Import and usage
  • README.md - Documentation examples (TypeScript/JavaScript only)
  • docs/index.md - Documentation examples
  • docs/api/typescript.md - API documentation
  • docs/getting-started/installation.md - Installation examples
  • docs/getting-started/quickstart.md - Quick start guide
  • docs/concepts/terms.md - Terms concept documentation
  • docs/concepts/rules.md - Rules concept documentation
  • docs/concepts/search.md - Search concept documentation
  • docs/examples/basic.md - Basic examples
  • docs/examples/Sudoku.vue - Sudoku Vue example

Summary of Changes:

  • All TypeScript/JavaScript class names updated to PascalCase
  • All test files updated with new class names
  • All documentation updated with new TypeScript/JavaScript examples (including Vue examples)
  • Python and C++ names unchanged (remain snake_case as intended)
  • All functionality and behavior preserved

Recent Fixes:

  • Fixed remaining search_t and rule_t references in docs/concepts/search.md TypeScript examples
  • Updated docs/examples/Sudoku.vue to use Search class name
Original prompt

This section details on the original issue you should resolve

<issue_title>修改atsds(typescript/javascript接口部分)中的一系列class名称</issue_title>
<issue_description>需要修改的名字有

  • _common_t -> _Common
  • string_t -> String_
  • variable_t -> Variable
  • item_t -> Item
  • list_t -> List
  • term_t -> Term
  • rule_t -> Rule
  • search_t -> Search

需要改动的文件包括但不限于

  • atsds/index.mts
  • tests/ 和 examples/ 下的测试
  • README.md 和 docs/ 下的文档

不要修改python和cpp那边的名称, 也不要修改除了上面列的名字之外的名字.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>
Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>
Copilot AI changed the title [WIP] Update class names in atsds TypeScript/JavaScript interfaces Rename TypeScript/JavaScript classes to PascalCase Dec 10, 2025
Copilot AI requested a review from hzhangxyz December 10, 2025 17:40
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
@hzhangxyz hzhangxyz marked this pull request as ready for review December 10, 2025 17:40
Copilot AI review requested due to automatic review settings December 10, 2025 17:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR successfully refactors the TypeScript/JavaScript API to follow language-standard PascalCase naming conventions for classes, improving code readability and adherence to TypeScript/JavaScript best practices. The change affects only the atsds TypeScript/JavaScript interface, leaving Python (apyds) and C++ (ds::) APIs unchanged with their snake_case naming.

Key changes:

  • Renamed 8 exported classes from snake_case (*_t suffix) to PascalCase
  • Updated all TypeScript source code, tests, examples, and documentation
  • Maintained backward compatibility scope: Python and C++ APIs unaffected

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
atsds/index.mts Renamed all exported classes and internal _Common base class; updated all type annotations, method signatures, and documentation comments
tests/test_variable.mjs Updated all imports and class instantiations to use Variable
tests/test_term.mjs Updated all imports and class instantiations to use Term, List, Item, Variable
tests/test_string.mjs Updated all imports and class instantiations to use String_
tests/test_search.mjs Updated all imports and class instantiations to use Search, Rule
tests/test_rule.mjs Updated all imports and class instantiations to use Rule
tests/test_list.mjs Updated all imports and class instantiations to use List
tests/test_item.mjs Updated all imports and class instantiations to use Item
examples/main.mjs Updated imports and usage of Rule and Search classes
docs/index.md Updated example code to use new Term class name
docs/getting-started/quickstart.md Updated all TypeScript examples to use new class names
docs/getting-started/installation.md Updated example code and import statements with new class names
docs/examples/basic.md Updated TypeScript example to use Rule and Search
docs/concepts/terms.md Updated all TypeScript code examples to use new class names (Variable, Item, List, Term)
docs/concepts/search.md Updated TypeScript examples to use Search class
docs/concepts/rules.md Updated all TypeScript examples to use Rule class
docs/api/typescript.md Comprehensively updated API documentation with new class names, method signatures, and examples
README.md Updated quick reference and examples to use new class names

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@hzhangxyz hzhangxyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs/concepts/search.md:132: import { search_t } from "atsds";
docs/concepts/search.md:134: const search = new search_t();
docs/concepts/search.md:205: import { rule_t, search_t } from "atsds";
docs/concepts/search.md:207: const search = new search_t(1000, 10000);
docs/concepts/search.md:205: import { rule_t, search_t } from "atsds";
docs/concepts/search.md:216: const target = new rule_t("X");

Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 10, 2025

docs/concepts/search.md:132: import { search_t } from "atsds";
docs/concepts/search.md:134: const search = new search_t();
docs/concepts/search.md:205: import { rule_t, search_t } from "atsds...

Fixed in commit be49517. Updated all remaining TypeScript examples in docs/concepts/search.md to use the new class names (Search and Rule).

Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>
@hzhangxyz hzhangxyz merged commit 3f8154f into main Dec 10, 2025
76 of 77 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

修改atsds(typescript/javascript接口部分)中的一系列class名称

2 participants