jjpwrgem 0.1.4 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitignore +2 -0
- package/CHANGELOG.md +14 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -2
- package/readme.md +98 -0
- package/run-jjp.js +0 -0
package/.gitignore
ADDED
package/CHANGELOG.md
CHANGED
|
@@ -7,8 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.2.0](https://github.com/20jasper/JJPWRGEM/releases/tag/jjpwrgem-v0.2.0) - 2025-12-06
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- subcommands - check and format with uglify flag
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [0.1.5](https://github.com/20jasper/JJPWRGEM/releases/tag/jjpwrgem-v0.1.5) - 2025-12-05
|
|
18
|
+
|
|
19
|
+
Test for publishing flow
|
|
20
|
+
|
|
21
|
+
|
|
10
22
|
## [0.1.4](https://github.com/20jasper/JJPWRGEM/releases/tag/jjpwrgem-v0.1.4) - 2025-12-05
|
|
11
23
|
|
|
12
|
-
|
|
24
|
+
### Feature
|
|
13
25
|
- pretty format JSON
|
|
14
26
|
- error messages on failure
|
|
27
|
+
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"hasInstallScript": true,
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"name": "jjpwrgem",
|
|
26
|
-
"version": "0.
|
|
26
|
+
"version": "0.2.0"
|
|
27
27
|
},
|
|
28
28
|
"node_modules/@isaacs/balanced-match": {
|
|
29
29
|
"engines": {
|
|
@@ -896,5 +896,5 @@
|
|
|
896
896
|
}
|
|
897
897
|
},
|
|
898
898
|
"requires": true,
|
|
899
|
-
"version": "0.
|
|
899
|
+
"version": "0.2.0"
|
|
900
900
|
}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"artifactDownloadUrl": "https://github.com/20jasper/jjpwrgem/releases/download/jjpwrgem-v0.
|
|
2
|
+
"artifactDownloadUrl": "https://github.com/20jasper/jjpwrgem/releases/download/jjpwrgem-v0.2.0",
|
|
3
3
|
"author": "Jacob Asper <jacobasper191@gmail.com>",
|
|
4
4
|
"bin": {
|
|
5
5
|
"jjp": "run-jjp.js"
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"zipExt": ".tar.xz"
|
|
94
94
|
}
|
|
95
95
|
},
|
|
96
|
-
"version": "0.
|
|
96
|
+
"version": "0.2.0",
|
|
97
97
|
"volta": {
|
|
98
98
|
"node": "18.14.1",
|
|
99
99
|
"npm": "9.5.0"
|
package/readme.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# JJPWRGEM
|
|
2
|
+
|
|
3
|
+
JJPWRGEM JSON Parser With Really Good Error Messages
|
|
4
|
+
|
|
5
|
+
An RFC 8259 compliant JSON Parser!
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
echo -en '{"coolKey"}' | jjp
|
|
11
|
+
error: expected colon after key, found `}`
|
|
12
|
+
╭▸ stdin:1:11
|
|
13
|
+
│
|
|
14
|
+
1 │ {"coolKey"}
|
|
15
|
+
│ ┬────────━
|
|
16
|
+
│ │
|
|
17
|
+
│ expected due to `"coolKey"`
|
|
18
|
+
╰╴
|
|
19
|
+
help: insert colon and placeholder value
|
|
20
|
+
╭╴
|
|
21
|
+
1 │ {"coolKey": "🐟🛹"}
|
|
22
|
+
╰╴ ++++++++
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Stability
|
|
26
|
+
|
|
27
|
+
JJPWRGEM is in its infancy and extremely likely to have breaking changes (properly marked with semver of course!)
|
|
28
|
+
|
|
29
|
+
## indeterminate handling
|
|
30
|
+
|
|
31
|
+
How cases undefined by the spec are handled
|
|
32
|
+
|
|
33
|
+
- numbers of any size or length are allowed
|
|
34
|
+
- the original precision will be maintained
|
|
35
|
+
- -0 is not equal to 0 and will persist
|
|
36
|
+
- the last duplicate key is stored
|
|
37
|
+
- escaped and unescaped characters are considered not equal
|
|
38
|
+
- parsing will fail if BOM is included
|
|
39
|
+
- only utf8 encoding is supported
|
|
40
|
+
- no limitations on nesting or length
|
|
41
|
+
- extensions such as trailing commas or comments are not allowed
|
|
42
|
+
- surrogates are not validated, eg a lone continuation byte is valid
|
|
43
|
+
|
|
44
|
+
## FAQ
|
|
45
|
+
|
|
46
|
+
### What does JJPWRGEM stand for?
|
|
47
|
+
|
|
48
|
+
JJPWRGEM JSON Parser With Really Good Error Messages. I was inspired by GNU to make a recursive acronym
|
|
49
|
+
|
|
50
|
+
### How do you pronounce JJPWRGEM?
|
|
51
|
+
|
|
52
|
+
/ˈdʒeɪ dʒeɪ ˈpaʊər dʒɛm/ JAY-jay-POW-er-jem
|
|
53
|
+
|
|
54
|
+
### But why is it called that?
|
|
55
|
+
|
|
56
|
+
It sounds cool and the name isn't taken on any package managers
|
|
57
|
+
|
|
58
|
+
### Why is the logo an axolotl riding a skateboard?
|
|
59
|
+
|
|
60
|
+
It's cool
|
|
61
|
+
|
|
62
|
+
### Is it blazingly fast™?
|
|
63
|
+
|
|
64
|
+
Axolotls can't walk so fast, so relatively, yes
|
|
65
|
+
|
|
66
|
+
### How long is an axolotl?
|
|
67
|
+
|
|
68
|
+
According to the San Diego zoo, "[a]n axolotl can reach 12 inches in length, but on average grows to about 9 inches[^axolotlFact]"
|
|
69
|
+
|
|
70
|
+
[^axolotlFact]: https://animals.sandiegozoo.org/animals/axolotl
|
|
71
|
+
|
|
72
|
+
## Motivations
|
|
73
|
+
|
|
74
|
+
I originally started this project to practice finite state machines, but got back into it when hearing about the internals of some formatters and compilers!
|
|
75
|
+
|
|
76
|
+
I am heavily inspired by the Rust compiler's error messages. I love that unhelpful errors are considered bugs
|
|
77
|
+
|
|
78
|
+
I checked out several JSON parsers and formatters, and none provided much context on _why_ a key was missing. Errors ranged from "expected closing on byte 10" to a snapshot of source code for that character, but none were up to my standards
|
|
79
|
+
|
|
80
|
+
## Notes
|
|
81
|
+
|
|
82
|
+
I went with annotate snippets over other libraries like codespan reporting since it better supports patches and workflows that don't require files, like reading from stdin
|
|
83
|
+
|
|
84
|
+
## references
|
|
85
|
+
|
|
86
|
+
### parsers/diagnostics
|
|
87
|
+
|
|
88
|
+
https://rustc-dev-guide.rust-lang.org/diagnostics/error-codes.html
|
|
89
|
+
|
|
90
|
+
https://github.com/rust-lang/rust/pull/27475
|
|
91
|
+
|
|
92
|
+
OXC
|
|
93
|
+
|
|
94
|
+
### Accessibility
|
|
95
|
+
|
|
96
|
+
https://afixt.com/accessible-by-design-improving-command-line-interfaces-for-all-users/
|
|
97
|
+
|
|
98
|
+
miette
|
package/run-jjp.js
CHANGED
|
File without changes
|