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

fix: lack of comments removal, invalid regexp #745

Merged
merged 3 commits into from
Jan 9, 2024

Conversation

DeutscherDude
Copy link
Contributor

This addresses issues mentioned in #715
The issue mentioned in #704 will be investigated further

@DeutscherDude
Copy link
Contributor Author

DeutscherDude commented Nov 25, 2023

Hello @lorenwest,
I have amended the parsing of JSON to utilize JSON5 parser as per this thread.
Additionally, I removed the extraneous stripping of comments from CSON parser.
There are some changes introduced to stripComments, i.e. a new RegExp, which I amended, so that it does not use the [a-zA-z] honey pot.
Happy to introduce any further required changes 😄

*Edit: Though the removal of comment stripping from CSON might be a mistake. Let me know your thoughts

@timturnerwhcc
Copy link

@lorenwest @DeutscherDude There hasn't been much movement on this PR in a bit - it would be really helpful to have as my team is migrating to Node20.

I'm happy to give feedback on this PR or whatever else to help move it forward.

@jfberry
Copy link

jfberry commented Jan 9, 2024

We are also holding off a node-20+ migration because of this bug

@lorenwest
Copy link
Collaborator

This looks like a healthy change, and I wish it were as simple as approving and merging. Unfortunately for health reasons I've been less than active in this project, and it seems that 2 test failures have crept into the master branch.

One of the problems was resolved in this branch, but there's another that needs further research before merging. When did it start failing? Is it a failure of the test or a failure of the baseline code? Does it only fail on one NodeJS version or many? What was the original intent, and is it still relevant? All of this takes time and energy to resolve, and my philosophy is to never merge into master with a single test failure, otherwise the effort everyone has put into these tests are diluted.

@markstos and I are the two authorized to merge into master and push a new release, and we've been doing it for 8-12 years, and neither of us is getting any younger. Would anyone like to start taking the reigns for node-config going forward? It's pretty stable, but does need TLC every now and then.

@jfberry
Copy link

jfberry commented Jan 9, 2024

I generally agree with your philosophy but it sounds like this pr doesn’t increase the failures that exist, in fact reduces them?
If so it’s a positive step forward.
Besides what is a show stopper for people with particular config files upgrading to newer versions of node.

Copy link
Collaborator

@lorenwest lorenwest left a comment

Choose a reason for hiding this comment

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

Looks good

@lorenwest lorenwest merged commit c8a7759 into node-config:master Jan 9, 2024
@DeutscherDude
Copy link
Contributor Author

Happy to be of further aid in the future. I got pretty intimate with the code and feel comfortable with it :).
For now, I am rather entangled with finishing my engineering degree, but gimme a month 😊

@lorenwest
Copy link
Collaborator

lorenwest commented Jan 9, 2024

Thanks for the offer @DeutscherDude . For now I've disabled the failing test as I couldn't see how it could ever have worked. Your branch was merged, a new release was created, and npm latest is now at v3.3.10

...and all tests pass in the master branch again. At some point someone should set up a workflow where a new release runs all tests, requiring all to pass, then bumps up the version, checks it in, creates release notes and pushes to npm.

renovate bot added a commit to tomacheese/cmcutter that referenced this pull request Jan 9, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [config](http://github.com/node-config/node-config.git)
([source](https://togithub.com/node-config/node-config)) | [`3.3.9` ->
`3.3.10`](https://renovatebot.com/diffs/npm/config/3.3.9/3.3.10) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/config/3.3.10?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/config/3.3.10?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/config/3.3.9/3.3.10?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/config/3.3.9/3.3.10?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>node-config/node-config (config)</summary>

###
[`v3.3.10`](https://togithub.com/node-config/node-config/releases/tag/v3.3.10)

[Compare
Source](https://togithub.com/node-config/node-config/compare/v3.3.9...v3.3.10)

##### What's Changed

- replace var to let and const by
[@&#8203;jamashita](https://togithub.com/jamashita) in
[node-config/node-config#720
- refactor: 💡 xxx === undefined => typeof xxx === 'undefined' by
[@&#8203;jamashita](https://togithub.com/jamashita) in
[node-config/node-config#729
- Fix source maps when using ts config files, improve performance
loading ts config files by
[@&#8203;andrzej-woof](https://togithub.com/andrzej-woof) in
[node-config/node-config#721
- fix: lack of comments removal, invalid regexp by
[@&#8203;DeutscherDude](https://togithub.com/DeutscherDude) in
[node-config/node-config#745

##### New Contributors

- [@&#8203;jamashita](https://togithub.com/jamashita) made their first
contribution in
[node-config/node-config#720
- [@&#8203;andrzej-woof](https://togithub.com/andrzej-woof) made their
first contribution in
[node-config/node-config#721
- [@&#8203;DeutscherDude](https://togithub.com/DeutscherDude) made their
first contribution in
[node-config/node-config#745

**Full Changelog**:
node-config/node-config@v3.3.9...v3.3.10

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/tomacheese/cmcutter).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xMjcuMCIsInVwZGF0ZWRJblZlciI6IjM3LjEyNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIn0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@Shayan1191
Copy link

It's very good

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

5 participants