Skip to content
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

☕ Support JSR #64

Merged
merged 4 commits into from
Apr 6, 2024
Merged

☕ Support JSR #64

merged 4 commits into from
Apr 6, 2024

Conversation

lambdalisue
Copy link
Member

@lambdalisue lambdalisue commented Feb 27, 2024

Summary by CodeRabbit

  • Chores
    • Updated project dependencies to include @lambdalisue/unknownutil version 3.16.3.
    • Renamed the metadata key constant for improved functionality.
    • Added a new GitHub Actions workflow for automated publishing.

Copy link

coderabbitai bot commented Feb 27, 2024

Walkthrough

The project now involves renaming the metadataKey constant to __unknownutil_metadata throughout the codebase, impacting metadata storage and retrieval across types and functions. Additionally, a new package @core/unknownutil with version 0.0.0 has been added, exporting ./mod.ts.

Changes

File Change Summary
metadata.ts Renamed metadataKey to __unknownutil_metadata
deno.jsonc Added @core/[email protected] exporting ./mod.ts
is/_deprecated.ts Reorganized import statements for isObjectOf and GetMetadata
is/_deprecated_test.ts Updated import statement for Predicate and PredicateType
is/annotation_test.ts Updated import statement for Predicate
is/core_test.ts Updated import statement for Predicate in type.ts module
is/factory.ts Modified import statement for isOptionalOf
is/factory_test.ts Updated import statement for Predicate with type keyword
is/utility_test.ts Altered import statement for Predicate and PredicateType
README.md Updated badge URLs and references for npm, deno.land, and documentation links
.github/workflows/jsr.yml Added GitHub Actions workflow jsr.yml for publishing using a Deno module on tagged pushes

🐇🌱
In the code's realm, a key transforms its identity,
metadataKey becomes __unknownutil_metadata with serenity.
A subtle shift in the fabric of data's abode,
Where metadata now finds a new decoding code.
The rabbit dances in joy, a digital waltz,
Celebrating the change, a small but meaningful pulse.
🌱🐇

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Feb 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.40%. Comparing base (a4b91de) to head (024b8dd).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #64      +/-   ##
==========================================
- Coverage   99.40%   99.40%   -0.01%     
==========================================
  Files           9        9              
  Lines         670      669       -1     
  Branches       72       72              
==========================================
- Hits          666      665       -1     
  Misses          4        4              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 5f92c85 and a59b311.
Files selected for processing (1)
  • deno.jsonc (1 hunks)
Additional comments: 2
deno.jsonc (2)
  • 2-4: The addition of @lambdalisue/unknownutil version 3.16.3 with an export path of ./mod.ts is correctly formatted for a Deno project. However, ensure that this version of the package supports the JSR features you intend to use. It's also important to verify that this package version doesn't introduce breaking changes or conflicts with other dependencies.
  • 1-7: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [5-14]

The configuration for tasks and imports remains unchanged and appears to be correctly set up for a Deno project. It's good practice to periodically review these configurations to ensure they align with the latest Deno features and best practices, especially after adding new dependencies.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between a59b311 and 02564d5.
Files selected for processing (1)
  • metadata.ts (3 hunks)
Additional comments: 3
metadata.ts (3)
  • 8-8: Renaming the metadata key to __unknownutil_metadata improves namespacing and reduces the likelihood of name collisions. This change is consistent throughout the file.
  • 22-22: The usage of the renamed metadata key within the getMetadata function is correct and follows the new naming convention.
  • 45-45: The application of the new metadata key within the setPredicateFactoryMetadata function is consistent with its definition and usage elsewhere in the file. This ensures uniformity in accessing metadata across different parts of the code.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 5f92c85 and e657b8c.
Files selected for processing (2)
  • deno.jsonc (1 hunks)
  • metadata.ts (3 hunks)
Files skipped from review as they are similar to previous changes (2)
  • deno.jsonc
  • metadata.ts

@lambdalisue lambdalisue marked this pull request as draft March 6, 2024 05:33
JSR does not allow slow types. See https://jsr.io/docs/about-slow-types

```
error: TS1170 [ERROR]: A computed property name in a type literal must refer to an expression whose type
is a literal type or a 'unique symbol' type.
  [metadataKey]: T;
  ~~~~~~~~~~~~~
    at file:///Users/alisue/ghq/github.com/lambdalisue/deno-unknownutil/metadata.ts:9:26

TS2304 [ERROR]: Cannot find name 'metadataKey'.
  [metadataKey]: T;
   ~~~~~~~~~~~
    at file:///Users/alisue/ghq/github.com/lambdalisue/deno-unknownutil/metadata.ts:10:4

Found 2 errors.
```
@lambdalisue lambdalisue marked this pull request as ready for review April 6, 2024 03:03
@lambdalisue lambdalisue merged commit 92c763d into main Apr 6, 2024
6 checks passed
@lambdalisue lambdalisue deleted the jsr branch April 6, 2024 03:04
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Actionable comments outside the diff hunks (2)
is/factory_test.ts (2)

Line range hint 33-33: The tests are thorough and well-structured, covering a wide range of cases for each utility function. Good use of Deno's testing features and assertions.


Line range hint 33-33: The usage of utility functions within the tests demonstrates a good understanding of TypeScript's type system and the capabilities of the utility functions. Effective use of type assertions.

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between a4b91de and 024b8dd.
Files selected for processing (11)
  • .github/workflows/jsr.yml (1 hunks)
  • README.md (1 hunks)
  • deno.jsonc (1 hunks)
  • is/_deprecated.ts (1 hunks)
  • is/_deprecated_test.ts (1 hunks)
  • is/annotation_test.ts (1 hunks)
  • is/core_test.ts (1 hunks)
  • is/factory.ts (1 hunks)
  • is/factory_test.ts (1 hunks)
  • is/utility_test.ts (1 hunks)
  • metadata.ts (3 hunks)
Additional comments not posted (9)
is/_deprecated.ts (1)

3-4: Ensure that the updated import paths for isObjectOf and GetMetadata are correct and align with the new structure of the project.

metadata.ts (1)

8-8: Renaming metadataKey to __unknownutil_metadata improves clarity. Ensure all references to this key throughout the project are updated accordingly.

is/_deprecated_test.ts (1)

10-10: The change to named imports for Predicate and PredicateType aligns with TypeScript best practices for type imports. Ensure that all usages of these types in the file are updated if necessary.

is/core_test.ts (1)

6-6: Switching to named imports for Predicate is a good practice for importing types in TypeScript. Verify that this change does not affect the usage of Predicate in the tests.

README.md (1)

3-5: The updates to badge URLs and references in the README ensure that they accurately reflect the current state of the project. Double-check the URLs to ensure they are correct and functional.

is/utility_test.ts (1)

10-10: The transition to named imports for Predicate and PredicateType is consistent with TypeScript's best practices for importing types. Confirm that the tests still function as expected after this change.

is/annotation_test.ts (1)

10-10: LGTM! Using type for importing types aligns with TypeScript best practices.

is/factory.ts (1)

3-3: LGTM! Using type for importing types aligns with TypeScript best practices.

is/factory_test.ts (1)

10-10: Using the type keyword for importing types is a good practice for clarity and potential bundling optimizations.

deno-version: ${{ env.DENO_VERSION }}
- name: Publish
run: |
deno run -A jsr:@david/[email protected]
Copy link

Choose a reason for hiding this comment

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

Consider pinning the version of the jsr:@david/publish-on-tag action to ensure consistent behavior across runs.

-          deno run -A jsr:@david/[email protected]
+          deno run -A jsr:@david/[email protected]  # Pinning the version for consistency

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
deno run -A jsr:@david/[email protected]
deno run -A jsr:@david/[email protected] # Pinning the version for consistency

Comment on lines +2 to +4
"name": "@core/unknownutil",
"version": "0.0.0",
"exports": "./mod.ts",
Copy link

Choose a reason for hiding this comment

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

The package version specified as "0.0.0" seems incorrect based on the PR objectives, which mention integrating @lambdalisue/unknownutil version 3.16.3. Ensure the version number is updated accordingly.

-  "version": "0.0.0",
+  "version": "3.16.3",

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
"name": "@core/unknownutil",
"version": "0.0.0",
"exports": "./mod.ts",
"name": "@core/unknownutil",
"version": "3.16.3",
"exports": "./mod.ts",

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.

1 participant