ReviewOS

also looking at this

stacks/ts-qr-codes

chore(deps): update dependency react to 19.2.7

#2137
Closed chris wants to merge buddy-bot/update-major-update-react into main
222 files +16350 -1825

Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.

docs/api/barcode/CODE128.mdmodified+100-13
Changes to docs/api/barcode/CODE128.md
@@ -1,33 +1,53 @@
11# CODE128
22
3CODE128 is one of the more versatile barcodes. It has support for all 128 ASCII characters but does also encode numbers efficiently. It has three modes (A/B/C) but can switch between them at any time. CODE128 is the default barcode that barcode will choose if nothing else is specified.
3CODE128 is one of the most versatile barcode formats available. It has full support for all 128 ASCII characters while maintaining efficient number encoding. The format features three modes (A/B/C) and can dynamically switch between them, making it highly adaptable for various use cases. CODE128 is the default format in qrx when no specific format is specified.
44
5## Supported Modes
5## Understanding CODE128 Modes
66
7***Auto (recommended)***
7CODE128 has three different modes, each optimized for different types of data:
8
9- **Mode A**: Uppercase letters, numbers, and special characters
10- **Mode B**: Upper and lowercase letters, numbers, and special characters
11- **Mode C**: Numbers only (encoded in pairs for maximum density)
12
13[!NOTE] Image needed: Visual comparison of the same data encoded in different modes (A, B, and C)
14
15## Basic Usage
16
17The simplest way to use CODE128 is to let qrx automatically choose the best mode:
818
919```ts
1020import { barcode } from '@stacksjs/qrx'
1121
12barcode('#barcode', 'Example1234') // CODE128 (auto) is the default mode
13barcode('#barcode', 'Example1234', { format: 'CODE128' }) // But you can still specify it
22// Automatic mode (recommended)
23barcode('#barcode', 'Example1234') // CODE128 auto is the default
24barcode('#barcode', 'Example1234', { format: 'CODE128' }) // Explicit format specification
1425```
1526
16***Forced modes***
27[!NOTE] Image needed: Result of the above basic examples showing the generated barcodes
28
29## Force Modes
1730
18If the barcode scanner only supports one type of CODE128 you can force that mode.
31Sometimes you may need to force a specific CODE128 mode, particularly when working with barcode scanners that only support certain modes:
1932
2033```ts
2134import { barcode } from '@stacksjs/qrx'
2235
36// Mode A - Uppercase & Control Characters
2337barcode('#barcode', 'EXAMPLE\n1234', { format: 'CODE128A' })
38
39// Mode B - All ASCII Characters
2440barcode('#barcode', 'Example1234', { format: 'CODE128B' })
41
42// Mode C - Numbers Only (most compact)
2543barcode('#barcode', '12345678', { format: 'CODE128C' })
2644```
2745
28## `ean128` option for CODE128
46[!NOTE] Image needed: Side-by-side comparison of the same data encoded in each mode
47
48## GS1-128/EAN-128 Support
2949
30Enable encoding CODE128 as GS1-128/EAN-128.
50CODE128 can be encoded as GS1-128 _(formerly known as EAN-128)_ using the `ean128` option:
3151
3252```ts
3353import { barcode } from '@stacksjs/qrx'
@@ -38,18 +58,85 @@ barcode('#barcode', '12345678', {
3858})
3959```
4060
41## Non printable characters
61[!NOTE] Image needed: Comparison of normal CODE128 vs GS1-128 encoding
4262
43CODE128 supports all 128 ASCII characters. You can input them in a few ways.
63## Working with Special Characters
4464
45Here are some examples of how to encode *newlines*, *tabs*, and *carriage returns*.
65CODE128 supports the full ASCII character set (0-127). Here are different ways to encode special characters:
4666
4767```ts
4868import { barcode } from '@stacksjs/qrx'
4969
70// Using escape sequences
5071barcode('#barcode', '\n\t\r')
72
73// Using hex codes
5174barcode('#barcode', '\x0A\x09\x0D')
75
76// Using ASCII values
5277barcode('#barcode', String.fromCharCode(10, 9, 13))
5378```
5479
55For information about all ASCII character, see [ASCII Table](https://www.asciitable.com/).
80[!NOTE] Image needed: Examples of barcodes with special characters encoded
81
82## Advanced Options
83
84You can customize the appearance of CODE128 barcodes with these options:
85
86```ts
87import { barcode } from '@stacksjs/qrx'
88
89barcode('#barcode', 'Example1234', {
90 format: 'CODE128',
91 width: 2, // Width of a single bar
92 height: 100, // Height of the barcode
93 displayValue: true, // Show the text below the barcode
94 fontSize: 20, // Size of the text
95 font: 'monospace', // Font family
96 textAlign: 'center', // Text alignment (left/center/right)
97 textPosition: 'bottom', // Text position (top/bottom)
98 background: '#ffffff', // Background color
99 lineColor: '#000000', // Barcode color
100})
101```
102
103[!NOTE] Image needed: Examples showing different customization options
104
105## Best Practices
106
1071. Mode Selection:
108 - Use automatic mode unless you have specific requirements
109 - Use Mode C for number-only data for maximum density
110 - Use Mode A when uppercase and control characters are needed
111 - Use Mode B for mixed-case text
1122. Data Validation:
113 - ```ts
114 barcode('#barcode', 'Your Data', {
115 format: 'CODE128',
116 valid: (valid) => {
117 if (!valid)
118 console.error('Invalid data for CODE128')
119 }
120 })
121 ```
1223. Error Handling:
123 - ```ts
124 try {
125 barcode('#barcode', 'Your Data', { format: 'CODE128' })
126 }
127 catch (error) {
128 console.error('Failed to generate barcode:', error)
129 }
130 ```
131
132## Format Specifications
133
134- **Character Set:** Full ASCII (0-127)
135- **Data Length:** Variable
136- **Check Digit:** Modulo 103
137- **Start/Stop Characters:** Automatically added
138- **Error Detection:** Built-in check character
139
140[!NOTE] Image needed: Diagram showing the structure of a CODE128 barcode
141
142For information about ASCII characters and their codes, see the ASCII Table.
docs/api/barcode/CODE39.mdmodified+120-6
Changes to docs/api/barcode/CODE39.md
@@ -1,8 +1,19 @@
11# CODE39
22
3CODE39 is an old barcode type that can encode numbers, uppercase letters and a number of special characters (`-`, `.`, `$`, `/`, `+`, `%`, and `space`). It has been a common barcode type in the past but CODE128 is recommended if not for legacy reasons.
3CODE39 (also known as Code 3 of 9) is one of the earliest barcode formats still in use today. While CODE128 is generally recommended for new implementations, CODE39 remains widely used in inventory management, military applications, and automotive industries due to its simplicity and legacy support.
44
5## Example
5## Character Set
6
7CODE39 supports:
8
9- Numbers (0-9)
10- Uppercase letters (A-Z)
11- Special characters: `-`, `.`, `$`, `/`, `+`, `%`, `space`
12- Start/Stop characters (`*`) are automatically added
13
14## Basic Usage
15
16Here's a simple example of generating a CODE39 barcode:
617
718```ts
819import { barcode } from '@stacksjs/qrx'
@@ -12,11 +23,17 @@ barcode('#barcode', 'CODE39 Barcode', {
1223})
1324```
1425
15![CODE39 Barcode](http://i.imgur.com/gqvVBrp.png)
26[!NOTE] Image needed: Result of the above basic example showing the generated barcode
27
28## Checksum Support (Mod43)
1629
17## Mod43 checksum
30CODE39 supports an optional modulo 43 checksum digit for enhanced error detection. When enabled:
1831
19Code 39 is sometimes used with an optional modulo 43 check digit. Using it requires this feature to be enabled in the barcode reader. It is enabled by setting the `mod43` option to `true`.
321. A check digit is calculated using modulo 43 algorithm
332. The check digit is appended to the data
343. Barcode scanners must be configured to validate mod43
35
36Enable the checksum using the `mod43` option:
2037
2138```ts
2239import { barcode } from '@stacksjs/qrx'
@@ -27,4 +44,101 @@ barcode('#barcode', 'ABCDEFG', {
2744})
2845```
2946
30![CODE39 Barcode](http://i.imgur.com/thX3q8B.png)
47[!NOTE] Image needed: Result of the above example showing the generated barcode with checksum digit
48
49## Customization Options
50
51CODE39 supports all standard customization options:
52
53```ts
54import { barcode } from '@stacksjs/qrx'
55
56barcode('#barcode', 'CUSTOM39', {
57 format: 'CODE39',
58 width: 2, // Bar width
59 height: 100, // Barcode height
60 displayValue: true, // Show text below barcode
61 fontSize: 20, // Text size
62 font: 'monospace', // Text font
63 textAlign: 'center', // Text alignment
64 textPosition: 'bottom', // Text position
65 background: '#ffffff', // Background color
66 lineColor: '#ffffff' // Bar color
67})
68```
69
70## Technical Specifications
71
72- Type: Discrete, variable-length
73- Character Set: 43 characters (0-9, A-Z, and 7 special characters)
74- Check Digit: Optional (Mod 43)
75- Self-Checking: Yes
76- Length: Variable
77- Error Detection: Basic (improved with Mod 43)
78
79[!NOTE] Image needed: Diagram showing CODE39 barcode structure
80
81## Common Use Cases
82
831. **Military/Government**
84 - CAGE (Commercial and Government Entity) codes
85 - Department of Defense applications
862. **Automotive Industry**
87 - Vehicle Identification Numbers (VIN)
88 - Part tracking
893. **Healthcare**
90 - Patient identification
91 - Medical equipment tracking
92
93[!NOTE] Image needed: Example of CODE39 in real-world application
94
95## Advantages and Limitations
96
97### Advantages
98
99- Simple structure
100- Self-checking
101- Widely supported
102- No special start/stop characters needed
103- Readable even if printed at low density
104
105### Limitations
106
107- Lower data density than CODE128
108- Limited character set
109- Larger space requirement
110- No native support for lowercase letters
111
112## Best Practices
113
1141. Input Validation
115 - Always verify input contains only valid characters
116 - Consider using uppercase transformation for input
1172. Error Handling
118 ```ts
119 try {
120 barcode('#barcode', 'TEST-123', { format: 'CODE39' })
121 }
122 catch (error) {
123 console.error('Barcode generation failed:', error)
124 }
125 ```
1263. Check Digit Usage
127 - Enable mod43 for applications requiring high reliability
128 - Ensure scanners are configured correctly for mod43
129
130## Migration to CODE128
131
132If you're considering migrating from CODE39 to CODE128:
133
134```ts
135// Old CODE39 implementation
136barcode('#barcode', 'LEGACY-123', { format: 'CODE39' })
137
138// New CODE128 equivalent
139barcode('#barcode', 'LEGACY-123', { format: 'CODE128' })
140```
141
142[!NOTE] Image needed: Side-by-side comparison of CODE39 vs CODE128
143
144For more information about ASCII characters and their codes, see the ASCII Table.