react-lib-tools 0.0.21 → 0.0.22

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.
Files changed (25) hide show
  1. package/README.md +22 -3
  2. package/dist/{GettingStartedRoute-LGDNviy5.cjs → GettingStartedRoute-7Aa6it9K.cjs} +2 -2
  3. package/dist/{GettingStartedRoute-LGDNviy5.cjs.map → GettingStartedRoute-7Aa6it9K.cjs.map} +1 -1
  4. package/dist/{GettingStartedRoute-DmHalwMP.js → GettingStartedRoute-foIc86s9.js} +2 -2
  5. package/dist/{GettingStartedRoute-DmHalwMP.js.map → GettingStartedRoute-foIc86s9.js.map} +1 -1
  6. package/dist/{PageNotFound-DIt5wQ4x.cjs → PageNotFound-BvASwBiY.cjs} +2 -2
  7. package/dist/{PageNotFound-DIt5wQ4x.cjs.map → PageNotFound-BvASwBiY.cjs.map} +1 -1
  8. package/dist/{PageNotFound-DuD7brn5.js → PageNotFound-DUjrRqET.js} +2 -2
  9. package/dist/{PageNotFound-DuD7brn5.js.map → PageNotFound-DUjrRqET.js.map} +1 -1
  10. package/dist/{SupportRoute-DWEe-0A7.cjs → SupportRoute-9JIclEem.cjs} +2 -2
  11. package/dist/{SupportRoute-DWEe-0A7.cjs.map → SupportRoute-9JIclEem.cjs.map} +1 -1
  12. package/dist/{SupportRoute-B9n9OCoW.js → SupportRoute-Dq4qVZXN.js} +2 -2
  13. package/dist/{SupportRoute-B9n9OCoW.js.map → SupportRoute-Dq4qVZXN.js.map} +1 -1
  14. package/dist/{VersionsRoute-DOa8Yrmb.js → VersionsRoute-C5U0zY4k.js} +2 -2
  15. package/dist/{VersionsRoute-DOa8Yrmb.js.map → VersionsRoute-C5U0zY4k.js.map} +1 -1
  16. package/dist/{VersionsRoute-Br6RZivR.cjs → VersionsRoute-CgKKplVF.cjs} +2 -2
  17. package/dist/{VersionsRoute-Br6RZivR.cjs.map → VersionsRoute-CgKKplVF.cjs.map} +1 -1
  18. package/dist/{index-D1Hn63kY.js → index-DcYrvRB4.js} +23 -32
  19. package/dist/{index-D1Hn63kY.js.map → index-DcYrvRB4.js.map} +1 -1
  20. package/dist/{index-DleNtYr0.cjs → index-qm845CuF.cjs} +2 -2
  21. package/dist/{index-DleNtYr0.cjs.map → index-qm845CuF.cjs.map} +1 -1
  22. package/dist/react-lib-tools.cjs +1 -1
  23. package/dist/react-lib-tools.js +1 -1
  24. package/package.json +7 -2
  25. package/scripts/compress-og-image.ts +38 -0
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DleNtYr0.cjs");exports.AppRoot=e.AppRoot;exports.Block=e.Block;exports.Box=e.Box;exports.Button=e.Button;exports.Callout=e.Callout;exports.Checkbox=e.Checkbox;exports.Code=e.Code;exports.ComponentProps=e.ComponentProps;exports.ComponentPropsSection=e.ComponentPropsSection;exports.DocsSection=e.DocsSection;exports.ErrorBoundary=e.ErrorBoundary;exports.ExternalLink=e.ExternalLink;exports.Header=e.Header;exports.ImperativeHandle=e.ImperativeHandle;exports.Input=e.Input;exports.Link=e.Link;exports.LoadingSpinner=e.LoadingSpinner;exports.NavLink=e.NavLink;exports.NavSection=e.NavSection;exports.Radio=e.Radio;exports.Select=e.Select;exports.assert=e.assert;exports.cn=e.cn;exports.getIntentClassNames=e.getIntentClassNames;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-qm845CuF.cjs");exports.AppRoot=e.AppRoot;exports.Block=e.Block;exports.Box=e.Box;exports.Button=e.Button;exports.Callout=e.Callout;exports.Checkbox=e.Checkbox;exports.Code=e.Code;exports.ComponentProps=e.ComponentProps;exports.ComponentPropsSection=e.ComponentPropsSection;exports.DocsSection=e.DocsSection;exports.ErrorBoundary=e.ErrorBoundary;exports.ExternalLink=e.ExternalLink;exports.Header=e.Header;exports.ImperativeHandle=e.ImperativeHandle;exports.Input=e.Input;exports.Link=e.Link;exports.LoadingSpinner=e.LoadingSpinner;exports.NavLink=e.NavLink;exports.NavSection=e.NavSection;exports.Radio=e.Radio;exports.Select=e.Select;exports.assert=e.assert;exports.cn=e.cn;exports.getIntentClassNames=e.getIntentClassNames;
2
2
  //# sourceMappingURL=react-lib-tools.cjs.map
@@ -1,4 +1,4 @@
1
- import { A as o, a as e, B as n, b as t, C as r, c as i, d as p, i as c, j as l, D as d, e as C, E as k, H as m, I as B, f as L, L as S, g as u, N as x, h as I, R as N, k as g, l as v, m as E, n as H } from "./index-D1Hn63kY.js";
1
+ import { A as o, a as e, B as n, b as t, C as r, c as i, d as p, i as c, j as l, D as d, e as C, E as k, H as m, I as B, f as L, L as S, g as u, N as x, h as I, R as N, k as g, l as v, m as E, n as H } from "./index-DcYrvRB4.js";
2
2
  export {
3
3
  o as AppRoot,
4
4
  e as Block,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-lib-tools",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "type": "module",
5
5
  "author": "Brian Vaughn <brian.david.vaughn@gmail.com> (https://github.com/bvaughn/)",
6
6
  "contributors": [
@@ -55,6 +55,7 @@
55
55
  "devDependencies": {
56
56
  "@csstools/postcss-oklab-function": "^4.0.11",
57
57
  "@eslint/js": "^9.30.1",
58
+ "@floating-ui/react": "^0.27.16",
58
59
  "@headlessui/react": "^2.2.4",
59
60
  "@headlessui/tailwindcss": "^0.2.2",
60
61
  "@heroicons/react": "^2.2.0",
@@ -63,13 +64,16 @@
63
64
  "@testing-library/jest-dom": "^6.6.4",
64
65
  "@testing-library/react": "^16.3.0",
65
66
  "@testing-library/user-event": "^14.6.1",
67
+ "@types/bytes": "^3.1.5",
66
68
  "@types/compression": "^1.8.1",
67
69
  "@types/express": "^5.0.5",
68
70
  "@types/markdown-it": "^14.1.2",
69
71
  "@types/node": "^24.2.0",
70
72
  "@types/react": "^19.1.8",
71
73
  "@types/react-dom": "^19.2.3",
74
+ "@types/sharp": "^0.32.0",
72
75
  "@vitejs/plugin-react-swc": "^3.10.2",
76
+ "bytes": "^3.1.2",
73
77
  "clsx": "^2.1.1",
74
78
  "compression": "^1.8.1",
75
79
  "csstype": "^3.1.3",
@@ -94,6 +98,7 @@
94
98
  "rollup-plugin-terser": "^7.0.2",
95
99
  "rollup-plugin-visualizer": "^6.0.3",
96
100
  "rollup-preserve-directives": "^1.1.3",
101
+ "sharp": "^0.34.5",
97
102
  "sirv": "^3.0.2",
98
103
  "tailwind-merge": "^3.3.1",
99
104
  "tailwindcss": "^4.1.11",
@@ -104,10 +109,10 @@
104
109
  "typescript-eslint": "^8.35.1",
105
110
  "typescript-json-schema": "^0.65.1",
106
111
  "vite": "^7.0.4",
107
- "vitest-fail-on-console": "^0.10.1",
108
112
  "vite-plugin-dts": "^4.5.4",
109
113
  "vite-plugin-svgr": "^4.3.0",
110
114
  "vitest": "^3.2.4",
115
+ "vitest-fail-on-console": "^0.10.1",
111
116
  "zustand": "^5.0.7"
112
117
  }
113
118
  }
@@ -0,0 +1,38 @@
1
+ import bytes from "bytes";
2
+ import { stat, writeFile } from "node:fs/promises";
3
+ import { join } from "node:path";
4
+ import { cwd } from "node:process";
5
+ import sharp from "sharp";
6
+
7
+ /**
8
+ * Compress og:image.
9
+ */
10
+ export async function compressOgImage({
11
+ inputPath = ["public", "og.png"],
12
+ outputPath = ["public", "og.png"]
13
+ }: {
14
+ inputPath?: string[] | undefined;
15
+ outputPath?: string[] | undefined;
16
+ } = {}) {
17
+ const input = join(cwd(), ...inputPath);
18
+ const statsBefore = await stat(input);
19
+
20
+ const png = sharp(input).png({
21
+ quality: 100,
22
+ compressionLevel: 9
23
+ });
24
+
25
+ const output = join(cwd(), ...outputPath);
26
+ const buffer = await png.toBuffer();
27
+ await writeFile(output, buffer, {
28
+ encoding: "base64"
29
+ });
30
+
31
+ const statsAfter = await stat(output);
32
+
33
+ console.log(
34
+ "Compressed image:\n before: %s\n after: %s",
35
+ bytes(statsBefore.size),
36
+ bytes(statsAfter.size)
37
+ );
38
+ }