Skip to content

Conversation

@lumirlumir
Copy link
Owner

This pull request includes several changes aimed at improving the codebase by renaming files for consistency, updating function names, and adding comprehensive tests. The most important changes include renaming utility files, updating test scripts, and enhancing the textlint-rule-allowed-uris rule.

File Renaming and Function Updates:

  • Renamed src/utils/getDefinitionNodeUriType.js to src/utils/get-definition-node-uri-type/get-definition-node-uri-type.js and updated the import paths accordingly. [1] [2]
  • Renamed src/utils/getUriList.js to src/utils/get-uri-types/get-uri-types.js and updated the function names from getUriList to getUriTypes. [1] [2] [3] [4]

Test Enhancements:

  • Added a new test file src/utils/get-definition-node-uri-type/get-definition-node-uri-type.test.js to test the get-definition-node-uri-type module.
  • Added a new test file src/utils/get-uri-types/get-uri-types.test.js to test the get-uri-types module.
  • Updated the textlint-rule-allowed-uris test file to include a detailed overview and use modern Node.js testing modules. [1] [2]

Package Script Update:

  • Updated the test script in package.json to include Node.js native testing with node --test src.

Code Consistency:

  • Updated import paths and function names in src/textlint-rule-allowed-uris.js to use the new get-uri-types module. [1] [2]

These changes collectively enhance the maintainability, readability, and test coverage of the codebase.

Copilot AI review requested due to automatic review settings March 15, 2025 17:09
@github-actions github-actions bot added 🏷️ scope: * Auto-generated label based on Conventional Commits specification for GitHub release notes 🏷️ type: refactor Auto-generated label based on Conventional Commits specification for GitHub release notes labels Mar 15, 2025
@github-actions
Copy link

Labels have been automatically applied based on the Conventional Commits specification.🏷️

@codecov
Copy link

codecov bot commented Mar 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.60%. Comparing base (d9763a8) to head (8d3a7e3).
Report is 1 commits behind head on main.

@@            Coverage Diff             @@
##             main     #191      +/-   ##
==========================================
+ Coverage   98.97%   99.60%   +0.62%     
==========================================
  Files           7       11       +4     
  Lines         392     1016     +624     
==========================================
+ Hits          388     1012     +624     
  Misses          4        4              
Files with missing lines Coverage Δ
src/textlint-rule-allowed-uris.js 100.00% <100.00%> (ø)
...node-uri-type/get-definition-node-uri-type.data.js 100.00% <ø> (ø)
...tion-node-uri-type/get-definition-node-uri-type.js 93.22% <100.00%> (ø)
src/utils/get-definition-node-uri-type/index.js 100.00% <100.00%> (ø)
src/utils/get-uri-types/get-uri-types.data.js 100.00% <ø> (ø)
src/utils/get-uri-types/get-uri-types.js 100.00% <100.00%> (ø)
src/utils/get-uri-types/index.js 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d9763a8...8d3a7e3. Read the comment docs.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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 pull request refactors the codebase by restructuring utility directories, renaming files and functions for consistency, and updating tests to use modern Node.js testing modules. The key changes include:

  • Renaming and relocating utility modules (e.g., get-definition-node-uri-type, get-uri-types)
  • Enhancing test coverage with new test files and modern testing APIs
  • Updating import paths and package scripts for consistency and maintainability

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/utils/get-definition-node-uri-type/get-definition-node-uri-type.test.js Added new tests for the get-definition-node-uri-type module
src/utils/get-uri-types/get-uri-types.test.js Added new tests for the get-uri-types module
src/utils/get-uri-types/index.js Created an index file for the get-uri-types module
src/utils/get-definition-node-uri-type/index.js Created an index file for the get-definition-node-uri-type module
tests/textlint-rule-allowed-uris.test.js Updated tests to use Node.js native testing and modernized require methods
src/utils/get-uri-types/get-uri-types.js Refactored utility functions to update naming from getUriList* to getUriTypes*
src/utils/get-definition-node-uri-type/get-definition-node-uri-type.js Updated theme import path and refined JSDoc comments for clarity
src/utils/uri-types/uri-types.test.js Modified require path in tests to reflect new file structure
src/textlint-rule-allowed-uris.js Updated import paths to use the new get-uri-types module
tests/utils/getUriList.test.js Removed tests for the deprecated getUriList module
tests/utils/getDefinitionNodeUriType.test.js Removed tests for the deprecated getDefinitionNodeUriType module

@lumirlumir lumirlumir merged commit 955a0b3 into main Mar 15, 2025
8 checks passed
@lumirlumir lumirlumir deleted the refactor-utils branch March 15, 2025 17:12
lumirlumir added a commit that referenced this pull request Mar 18, 2025
…ch`) (#200)

## Release Information: `v1.0.9`

New release of `lumirlumir/npm-textlint-rule-allowed-uris` has arrived!
:tada:

This PR bumps the package versions from `v1.0.8` to `v1.0.9` (`patch`).

See
[Actions](https://github.com/lumirlumir/npm-textlint-rule-allowed-uris/actions/runs/13927306027)
for more details.

| Info        | Value                      |
| ----------- | -------------------------- |
| Repository  | `lumirlumir/npm-textlint-rule-allowed-uris` |
| SEMVER      | `patch`     |
| Pre ID      | `canary`      |
| Short SHA   | f11ce22       |
| Old Version | `v1.0.8`  |
| New Version | `v1.0.9`  |

<!-- Release notes generated using configuration in .github/release.yml
at main -->

## What's Changed
### 🧰 Chores
* chore(sync-server): update `dependabot.yml` by @lumirlumir in
#167
* chore(*): add `provenance` to `publishConfig` in `package.json` by
@lumirlumir in
#169
* chore(sync-server): update `publish.yml` and `.prettierignore` by
@lumirlumir in
#171
* chore(sync-server): update `.editorconfig` `max_line_length` to
`100000` by @lumirlumir in
#181
* chore(sync-server): update `.markdownlint.json` by @lumirlumir in
#186
* chore(*): install `textlint` as deps-dev and delete unnecessary files
by @lumirlumir in
#190
* chore(*): drop `mocha` and replace it with node built-in test runner
by @lumirlumir in
#192
* chore(*): create `CONTRIBUTING.md` and update ESLint config file by
@lumirlumir in
#194
* chore(*): add textlint configuration and integrate with lint-staged by
@lumirlumir in
#197
### 🔄 Continuous Integrations
* ci(sync-server): add permissions to read contents in `lint.yml` and
`test.yml` workflows by @lumirlumir in
#179
* ci(sync-server): add permissions to `pull-request.yml` and
`sync-client.yml` by @lumirlumir in
#180
* ci(*): drop `bump.yml` and create `version-multirepo.yml` by
@lumirlumir in
#198
* ci(*): create `release.yml` by @lumirlumir in
#199
### 📝 Documentation
* docs(*): create `SECURITY.md` by @lumirlumir in
#193
* docs(*): update `README.md` and `config.yml` by @lumirlumir in
#195
### ♻️ Code Refactoring
* refactor(*): update module imports to use `node:` prefix for
consistency by @lumirlumir in
#173
* refactor(*): create `src/types.js` by @lumirlumir in
#174
* refactor(*): rename `src/types.js` to `src/types/index.js` by
@lumirlumir in
#175
* refactor(*): restructure `theme` utilities and update usage in files
by @lumirlumir in
#176
* refactor(*): rename and refactor `UriTypes` class by @lumirlumir in
#177
* refactor(*): restructure directories and update comments by
@lumirlumir in
#191
### ⬆️ Dependency Updates
* chore(deps-dev): bump eslint from 9.20.1 to 9.21.0 by @dependabot in
#165
* chore(deps-dev): bump prettier from 3.5.1 to 3.5.2 by @dependabot in
#166
* chore(deps): bump axios from 1.7.9 to 1.8.1 by @dependabot in
#168
* chore(deps): bump undici from 6.19.7 to 6.21.1 in the npm_and_yarn
group across 1 directory by @dependabot in
#170
* chore(deps-dev): bump prettier from 3.5.2 to 3.5.3 by @dependabot in
#172
* chore(deps-dev): bump eslint from 9.21.0 to 9.22.0 by @dependabot in
#182
* chore(deps): bump axios from 1.8.1 to 1.8.2 by @dependabot in
#183
* chore(deps-dev): bump @babel/core from 7.26.9 to 7.26.10 in the babel
group across 1 directory by @dependabot in
#184
* chore(deps-dev): bump textlint-tester from 14.4.2 to 14.5.0 by
@dependabot in
#185
* chore(deps-dev): bump eslint-config-bananass from 0.0.5 to 0.0.6 in
the bananass group across 1 directory by @dependabot in
#187
* chore(deps): bump axios from 1.8.2 to 1.8.3 by @dependabot in
#188
* chore(deps-dev): bump lint-staged from 15.4.3 to 15.5.0 by @dependabot
in #189


**Full Changelog**:
v1.0.8...v1.0.9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏷️ scope: * Auto-generated label based on Conventional Commits specification for GitHub release notes 🏷️ type: refactor Auto-generated label based on Conventional Commits specification for GitHub release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants