-
Notifications
You must be signed in to change notification settings - Fork 0
Rename TypeScript/JavaScript classes to PascalCase #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>
Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
There was a problem hiding this 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 (
*_tsuffix) 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.
hzhangxyz
left a comment
There was a problem hiding this 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>
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>
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_t→String_(exported class)variable_t→Variable(exported class)item_t→Item(exported class)list_t→List(exported class)term_t→Term(exported class)rule_t→Rule(exported class)search_t→Search(exported class)Files Modified:
atsds/index.mts- Main TypeScript source with class definitionstests/test_string.mjs- Import and usagetests/test_variable.mjs- Import and usagetests/test_item.mjs- Import and usagetests/test_list.mjs- Import and usagetests/test_term.mjs- Import and usagetests/test_rule.mjs- Import and usagetests/test_search.mjs- Import and usageexamples/main.mjs- Import and usageREADME.md- Documentation examples (TypeScript/JavaScript only)docs/index.md- Documentation examplesdocs/api/typescript.md- API documentationdocs/getting-started/installation.md- Installation examplesdocs/getting-started/quickstart.md- Quick start guidedocs/concepts/terms.md- Terms concept documentationdocs/concepts/rules.md- Rules concept documentationdocs/concepts/search.md- Search concept documentationdocs/examples/basic.md- Basic examplesdocs/examples/Sudoku.vue- Sudoku Vue exampleSummary of Changes:
Recent Fixes:
search_tandrule_treferences indocs/concepts/search.mdTypeScript examplesdocs/examples/Sudoku.vueto useSearchclass nameOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.