qrcode-pack 0.1.0 → 0.1.1
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/.github/workflows/generate-release.yml +45 -0
- package/README.md +14 -1
- package/package.json +1 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
name: Generate Release and Publish to NPM
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- '*'
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build-and-release:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout code
|
|
14
|
+
uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
# Get Tag Name
|
|
17
|
+
- name: Get Tag name
|
|
18
|
+
id: vars
|
|
19
|
+
run: echo "TAG_NAME=${GITHUB_REF_NAME}" >> $GITHUB_ENV
|
|
20
|
+
|
|
21
|
+
# Generates a GitHub Release
|
|
22
|
+
- name: Create GitHub Release
|
|
23
|
+
uses: softprops/action-gh-release@v2
|
|
24
|
+
with:
|
|
25
|
+
files: ${{ env.ZIP_NAME }}
|
|
26
|
+
body: |
|
|
27
|
+
**QR Code Pack – Version ${{ github.ref_name }}**
|
|
28
|
+
|
|
29
|
+
For detailed changes in this version, see the automatically generated notes.
|
|
30
|
+
generate_release_notes: true
|
|
31
|
+
make_latest: "true"
|
|
32
|
+
env:
|
|
33
|
+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
|
34
|
+
|
|
35
|
+
# Publish to NPM
|
|
36
|
+
- name: Setup Node
|
|
37
|
+
uses: actions/setup-node@v4
|
|
38
|
+
with:
|
|
39
|
+
node-version: 20
|
|
40
|
+
registry-url: https://registry.npmjs.org/
|
|
41
|
+
|
|
42
|
+
- name: Publish to NPM
|
|
43
|
+
run: npm publish
|
|
44
|
+
env:
|
|
45
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/README.md
CHANGED
|
@@ -28,7 +28,20 @@ qr.renderToCanvas('myCanvas', 512);
|
|
|
28
28
|
|
|
29
29
|
## Props
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
## Props
|
|
32
|
+
|
|
33
|
+
| Prop / Method | Type | Default | Description |
|
|
34
|
+
|-------------------------|----------------------------|---------|-------------|
|
|
35
|
+
| `text` | `string` | `""` | The content to encode in the QR Code. |
|
|
36
|
+
| `ecLevel` | `"L" | "M" | "Q" | "H"` | `"H"` | Error correction level of the QR Code. `"L"` = low, `"H"` = high. |
|
|
37
|
+
| `version` | `number` | `null` | QR Code version (1–40). Higher versions store more data. If `null`, the version is calculated automatically. |
|
|
38
|
+
| `modules` | `array` | `null` | Internal matrix representing the QR Code modules (pixels). Populated after calling `buildMatrix()`. |
|
|
39
|
+
| `reserved` | `array` | `null` | Reserved areas in the matrix, such as alignment patterns and format markers. |
|
|
40
|
+
| `buildMatrix()` | `function` | — | Generates the internal QR Code matrix based on `text` and `ecLevel`. |
|
|
41
|
+
| `renderToCanvas(canvasId, size)` | `function` | — | Renders the QR Code to an HTML `<canvas>`. `canvasId` = ID of the canvas, `size` = width/height in pixels. |
|
|
42
|
+
|
|
43
|
+
> **Optional note:**
|
|
44
|
+
> Additional options may be added in future releases, such as custom colors, padding, or different rendering outputs.
|
|
32
45
|
|
|
33
46
|
## Contributing
|
|
34
47
|
|