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

[WIP] support $comment #103

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

fengkx
Copy link

@fengkx fengkx commented Feb 23, 2024

πŸ”— Linked issue

#21

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

I've tried to implement part of the functionality and turning on the WIP Pull Request first. Would like to have comments and suggestions for this API design.

Here are some choices I have made.

  1. mod.exports.default.a.$comment = 'asdsad' // throw Error because mod.exports.default.a is proxied to a string , So I make $comment on every object for now. Take a look at the test cases for exampes.
  2. Always use leadding comment block instead of comment line
  3. If it has multipe comment on one node, getter will join them with newline('\n')

Question

How to deal with array field for example:

export defaut {
	urls: [
		/* comment about first url */
		"http://example.com",
		/* comment about second url */
		"http://example2.com"
	]
}

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@fengkx fengkx changed the title [WIP] [WIP] support $comment Feb 23, 2024
@fengkx
Copy link
Author

fengkx commented Feb 23, 2024

@antfu Would you take a look on the API?

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.

None yet

1 participant