Compare commits

..
Author SHA1 Message Date
renovate[bot] bea820c417 fix(deps): update dependency @huggingface/transformers to v4 2026-11-20 23:31:34 +00:00
ShareVB d07563cf5e fix: update nginx for CVE
Fix #600
2026-11-19 09:59:15 +01:00
ShareVB cf6df4e9f3 ci: fix e2e 2026-11-15 23:06:50 +01:00
JoAdo07 91ee2ab7a8 fix(percentage-calculator): clear the result when an input is cleared
n-input-number emits null when its text is cleared, while the computeds only
treated undefined as a missing value. The arithmetic then coerced null to 0,
so emptying To showed -100 and emptying X showed 0.

The three formulas moved into a service that treats null and undefined alike,
with unit tests for the cleared cases and an e2e case that clears a filled
field.

Fixes #1906
2026-11-15 23:03:42 +01:00
ShareVB 1d77ed3bbe i18n: extract and translate remaining 2026-11-15 22:48:16 +01:00
ShareVB 83d7d33d86 fix(extract desc script): handle formatting of long lines 2026-11-15 22:48:16 +01:00
0295223a3d feat(new tool): Paste Image
Paste an image from the clipboard with Ctrl+V or Cmd+V, or with a
"Paste from clipboard" button for touch devices, then download it.

- Converts to PNG (default), JPEG, or WebP, with a quality slider for
  JPEG and WebP. The format and quality persist across visits.
- Keeps every image pasted in the session, with remove and clear all.
- Shows dimensions, original and output type and size.
- Edits the file name, copies the image as PNG, or copies a base64
  data URL.
- Converts images one at a time in the browser only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PEUYi3h8enZM5rmJAZ1UAF

Taken from https://github.com/CorentinTh/it-tools/pull/1912/changes/d19824e7ea42a192808b585f02e2479d6fe87cb3

Co-Authored-By: @destan
2026-11-15 22:48:16 +01:00
8974b3048d feat(new tool): Whitespace cleaner tool
Add a tool that cleans terminal and Claude Code output. The cleaner strips line numbers, ANSI escape sequences, box drawing, bullet markers, diff markers, trailing whitespace, and the common indent. Smart unwrap and Markdown / Reddit mode are optional. Options persist in localStorage. The pasted input is not saved.

Co-Authored-By: @destan
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PEUYi2gRxcytxRFXjPjH3U
2026-11-15 22:48:16 +01:00
ShareVB 6e021e9848 feat(new tool): CLI Banner Generator
Fix part of #598
2026-11-15 22:48:16 +01:00
ShareVB 8d13f0a176 fix(Fortune Wheel): better color choosing and UI enhancement
Add a remove winner option
Better choose color
Better UI for small screen
Better NaiveUI UI

Fix #597
2026-11-15 19:16:25 +01:00
ShareVB 231930dd56 ci: disable deploy on renovate bot PR because it exceeds Vercel free plan limits 2026-11-15 11:54:53 +01:00
AlgoVeria b5eace85db feat(new tools): 4-20 mA, 0-10 V and analog scaling converters (#596)
Add an Automation category with three tools for PLC programmers and
instrumentation technicians, built on a shared AnalogSignalConverter
component and a tested src/utils/analog-signal.ts module:

- 4-20 mA converter: current <-> engineering value, 4-20 / 0-20 mA, with the
  NAMUR NE 43 loop diagnostic (failure, undefined zone, under/over-range)
- 0-10 V converter: 0-10, 2-10, 0-5, 1-5 and ±10 V, warns below the live
  zero (broken wire)
- Analog scaling calculator: raw PLC values (Siemens 0-27648 / ±27648,
  Schneider 0-10000, 12/15/16 bits) <-> engineering value, with the rounded
  raw value

Three-column layout: input, parameters and output, each side with a gauge and
a coloured status. A swap button inverts the conversion direction and keeps
the operating point. Also shows the y = gain × x + offset formula for the PLC
and a 0-25-50-75-100 % reference table. Ranges are validated (min < max).

English and French translations.
2026-11-08 18:45:54 +01:00
Zachary Thompson e7758934a8 fix(hash-text): refresh added hashes when digest encoding changes (#594) 2026-11-03 08:34:28 +01:00
ozil 324a6be4d0 fix: keep the language dropdown scrollable within the viewport (#592) 2026-11-02 13:35:16 +01:00
ShareVB 8f94ed3619 i18n: extract and translated remaining 2026-10-30 22:38:27 +01:00
ShareVB 41297c80f8 feat(new tool): Fraction Decimal Converter
Fix #586
2026-10-30 22:28:58 +01:00
ShareVB f122bafaa9 feat(new tool): Sound Tester
Fix #589
2026-10-30 22:12:06 +01:00
ShareVB ec33d7df26 fix(Regex Memo): fix Escaping table formatting
Fix #591
2026-10-30 21:00:07 +01:00
renovate[bot] 47943c76ac chore(deps): update nginxinc/nginx-unprivileged:stable-alpine docker digest to f5116ed (#590)
Fix #588
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-10-26 14:18:17 +01:00
ShareVB bb3ef34052 chore(version): release 2026.10.25 2026-10-25 18:58:01 +01:00
ShareVB d77917f24c docs(changelog): update changelog for 2026.10.25 2026-10-25 18:58:01 +01:00
顾吕灏 d6e478c277 i18n: add Traditional Chinese (zh-TW) locale (#587)
* i18n: add Traditional Chinese (zh-TW) locale

- locales/zh-TW.yml: converted 1:1 from the freshly reviewed zh.yml (#584),
  8459 keys, key parity and {placeholder} parity both verified (0 diffs)
- src/tools/fstab-generator/locales/zh-TW.yml: per-tool locale converted as well
- src/components/NavbarButtons.vue: register the display name

Method: OpenCC s2twp + a manual Taiwan terminology pass
(104 phrase fixes). Locales are auto-discovered via import.meta.glob,
so the new file needs no further wiring.

* fix(i18n): correct Traditional Chinese terminology and spacing

* i18n: zh-TW second-pass terminology audit

Full-file sweep for s2twp conversion artifacts beyond dc031df:
- 許可權→權限 ×26, 轉義→跳脫 ×33, 質量→品質 ×14, 攝像頭→攝影機 ×6
- 佔點陣圖→佔位圖 ×1 (s2twp hit 位图 inside 占位图), 原始原始碼→原始碼 ×1
- 超時→逾時 ×7, 倒計時→倒數計時 ×3, 檢測器→偵測器 ×2, 分隔符→分隔符號 ×13

Both files re-validated: key parity (8459 / 26), placeholder parity 0 diffs,
no replacement-chain duplication left.

* fix(i18n): refine zh-TW terminology with context checks
2026-10-25 18:54:43 +01:00
Sebastian DanielssonandClaude Opus 5.5 788d4fdded fix(dns-query, gitattributes-generator): hide dns-query offline, pin commands to the snapshot
dns-query calls Cloudflare DNS over HTTPS and rdap.org, so offline mode
now hides it like dns-queries.

The gitattributes download commands are now built from the URLs the
preview was generated from. When the snapshot was used, they point at the
snapshot commit instead of master, so they reproduce what is shown.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 18:51:17 +01:00
Sebastian DanielssonandClaude Opus 5.5 8ec559012d fix(explainshell, ocr-image): honour the configured mirrors
Offline, explainshell now always uses the configured explainchain.url.
Before, a URL the browser had stored earlier (the public
explainshell.com) overrode it.

ocr-image's lang-url template may now name the file
(.../{lang}.traineddata.gz). tesseract.js appends that file name itself,
so the template is reduced to its directory instead of requesting a
duplicated path.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 18:51:17 +01:00
Sebastian DanielssonandClaude Opus 5.5 b64d2a1742 docs(readme): document offline mode and the mirror settings
Refs sharevb/it-tools#571

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 18:51:17 +01:00
Sebastian DanielssonandClaude Opus 5.5 6241fa6352 i18n(en, zh): describe bundled assets, mirrors and snapshots
Refs sharevb/it-tools#571

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 18:51:17 +01:00
Sebastian DanielssonandClaude Opus 5.5 3af8e4a4cd feat(json-viewer, yaml-viewer, currency-converter, geo-coordinates-converter): support intranet mirrors
Add json-schemas.catalog-url, currency-converter.url and
geo-coordinates-converter.tile-url. Offline without a mirror, schema
validation offers custom schemas only, the map is not shown and the
currency converter is hidden. Show the external-access badge on the
YAML viewer and the coordinates converter.

Refs sharevb/it-tools#571

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 18:51:17 +01:00
Sebastian DanielssonandClaude Opus 5.5 81c12017ce feat(gitignore-generator, gitattributes-generator): fall back to a bundled template snapshot
Offline mode uses the snapshot only; online, it replaces the hardcoded
fallback list when GitHub can't be reached. Refresh it with
pnpm script:update:git-templates.

Refs sharevb/it-tools#571

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 18:51:17 +01:00
Sebastian DanielssonandClaude Opus 5.5 d53e745854 feat(translator, remove-background, math-ocr, ocr-image, gif-to-mp4): ship runtimes with the app
Ship the ONNX runtime, the ffmpeg core, the tesseract worker and core and
English/Simplified Chinese OCR data instead of loading them from
jsdelivr. They load only when their tool runs and are left out of the
PWA precache. Models and other OCR languages can come from an intranet
mirror (transformers.models-url, ocr-image.lang-url). Remove math-ocr's
leftover MathJax typings: MathJax is no longer used.

Refs sharevb/it-tools#571

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 18:51:17 +01:00
Sebastian DanielssonandClaude Opus 5.5 94c0bbfcbc fix(countdown, cron-alarm, time-alarm): resolve Beep.mp3 against the app base
The root-absolute /Beep.mp3 (also fixed in pomodoro-timer, in the previous commit) broke when IT-Tools is served from a subfolder.

Refs sharevb/it-tools#571

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 18:51:17 +01:00
Sebastian DanielssonandClaude Opus 5.5 b536f040be fix(markdown-editor, unicode-formatter, pomodoro-timer): bundle editor extensions and fonts
md-editor-v3 loaded highlight.js, katex, mermaid, prettier, cropper,
screenfull and echarts from unpkg.com; the two other tools loaded Google
Fonts. All of them now come from the app.

Refs sharevb/it-tools#571

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 18:51:17 +01:00
Sebastian DanielssonandClaude Opus 5.5 4a80283786 feat(settings): add an offline mode that hides internet-only tools
"offline": true in tools-settings.json hides tools that need internet
access (menus and routes). Tools declare it with requiresInternet, either
always or unless an intranet mirror is configured. The settings helper
lives in a module without top-level await so eagerly loaded tool
index.ts files can use it without delaying app boot.

Refs sharevb/it-tools#571

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 18:51:17 +01:00
Sebastian DanielssonandClaude Opus 5.5 ea30976669 build(deps): add the assets offline mode ships, drop unused currency and ffmpeg helpers
Add fonts, md-editor extensions, the ffmpeg core, the tesseract core and
English/Simplified Chinese OCR data so tools stop loading them from
third-party CDNs. Remove currency-exchanger-js and @ffmpeg/util, which
nothing imports anymore. Patch curlconverter to resolve its wasm files
against the page's <base href> so curl-converter works in a subfolder.

Refs sharevb/it-tools#571

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 18:51:17 +01:00
Sebastian DanielssonandClaude Opus 5.5 bb00dcb8de i18n(zh): review the Simplified Chinese translation (#584)
Fix machine-translation errors, make terminology consistent, add spacing
between CJK and Latin text, use full-width punctuation, and add the two
missing database-builder keys.

Restore the externalAccess "null" sentinel that had been translated as
无效的 and restore code samples that had been translated.

Refs sharevb/it-tools#571

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-18 09:21:49 +02:00
Sebastian DanielssonandClaude Opus 5.5 de40fc7a98 fix(visualsubnetcalc, zpool-calc): escape user data before inserting HTML
Visual Subnet Calculator loads its subnet map from `?c=` shareable links
and imported configs, then wrote subnet keys, notes and colours into the
table HTML unescaped. A crafted link could run script on the it-tools
origin. addRow() now escapes the network, note and ancestor keys in join
cells, and only accepts hex colours. Allocation results, validation
issues, warnings, the network-boundary notice and caught exception
messages are escaped as well.

zpool-calc wrote the vdev type <select> value with .html(); use .text().

Both are vendored files; reapply if they are updated from upstream.

Fixes CodeQL js/xss-through-dom and js/xss-through-exception alerts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 21:11:50 +02:00
Sebastian DanielssonandClaude Opus 5.5 a891be1a13 fix(scripts): make extract-tools-desc quote matching linear
`(?:[^']+|(?<=\\)')+` nests quantifiers and backtracks exponentially on long
unterminated values. Use one `'(?:[^'\\]|\\.)*'` pattern for both extracting
and replacing. Extraction used `(.*?)`, which stopped at the first escaped
quote (`'It\'s'` became `It\`); it now reads the whole value and decodes
JS string escapes (\n, \xHH, \uHHHH, \u{...}, \') before writing the
locale file.

Fixes CodeQL js/redos alerts in scripts/extract-tools-desc.mjs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 21:11:50 +02:00
Sebastian DanielssonandClaude Opus 5.5 1b8d4879ac fix(database-builder): quote names and passwords in generated SQL
The database name, account and server address are prefilled from URL query
parameters and were pasted into the script as is, so a crafted link could
add statements to the SQL a user copies and runs (e.g. a database name
containing `` `; DROP DATABASE prod; -- ``). A password containing `'` also
produced invalid SQL.

- Quote identifiers and string literals per dialect.
- PostgreSQL passwords containing a backslash are emitted as E'' strings,
  which parse the same whatever standard_conforming_strings is set to.
- Oracle has no escape for `"` in quoted names or passwords, so either one
  containing `"` shows a validation error instead of generating SQL. Plain
  Oracle names stay unquoted since quoting makes them case-sensitive.
- Newlines in values that land in SQL comments are flattened.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 21:11:50 +02:00
Sebastian DanielssonandClaude Opus 5.5 0203c2388a fix(random): use crypto.getRandomValues for generated secrets
`src/utils/random.ts` was built on Math.random(), and it backs the token
generator, htpasswd salts and the passphrase suffixes. The PIN code
generator and the database builder's default password called Math.random()
directly. All now go through crypto.getRandomValues() with rejection
sampling, so indices are unbiased, for ranges up to 2^53.

The passphrase generator no longer calls generateSillyPassword(), which also
picks words with Math.random(). It uses the package's word lists with the
secure helpers, and skips pulling lodash and zxcvbn into the bundle.

Behaviour changes that came with it:
- randIntFromInterval() now includes its upper bound. The lorem ipsum
  sliders could never reach their maximum and the passphrase generator never
  put a number on the last word. The coin flipper used `0..10 % 2`, which
  would be biased with an inclusive range, so it now draws 0 or 1.
- randIntFromInterval() orders reversed bounds, rounds fractional ones
  inward and returns NaN for non-finite input instead of throwing.
- The lorem ipsum generator falls back to its defaults for malformed
  `paragraphs`, `sentences` and `words` URL values and clamps them to the
  slider ranges, so a link like `?sentences=[1,4294967297]` cannot freeze
  the page.
- Passphrases whose length equals the min or max length are accepted.
- Multi-word list entries ("wide eyed") count as one word, so the word count
  and number placement match the settings.
- Token generator draws each character independently instead of shuffling
  the alphabet repeated `length` times.

Fixes the CodeQL js/insecure-randomness alert in the passphrase generator.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 21:11:50 +02:00
Sebastian DanielssonandClaude Opus 5.5 d785329e74 fix(layout): escape every bracket and paren in footer package links
String replace() only replaced the first `[`, `]`, `(` and `)`, and link
text backslashes were left as is. Use global regexes and escape
backslashes too.

Fixes CodeQL js/incomplete-sanitization alerts in the tool layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 21:11:50 +02:00
Sebastian DanielssonandClaude Opus 5.5 f1b20c7c18 refactor(turndown): remove text-node escape rules that never run
Turndown only applies rules to element nodes; text nodes always go through
its built-in escape(). The `escapeText` rules and their `escapeMarkdown`
helpers in HTML to Markdown, HTML to data and EPUB to Markdown were never
called. They also escaped `|` twice, which would have produced `\\|` had
anyone wired them up. Output is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 21:11:50 +02:00
Sebastian DanielssonandClaude Opus 5.5 3872432a07 fix(markdown): escape backslashes in generated table cells
Pipes were escaped but backslashes were not, so a cell ending in `\` turned
the added `\|` into `\\|` and the pipe split the cell. The object-array
Markdown export also left newlines in cells, which broke the row; they now
become `<br>` like in the Markdown table generator.

Fixes CodeQL js/incomplete-sanitization alerts in the Markdown table
generator and the object-array export.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 21:11:50 +02:00
Sebastian DanielssonandClaude Opus 5.5 9b655473bc fix(json-viewer): unescape JSON strings in a single pass
Unescaping backslashes before `\n`, `\t` and friends decoded escaped
backslashes twice: `\\n` in an escaped JSON string became a raw newline
instead of `\n`, so parsing failed with "invalid character". A single
replace with a lookup table decodes each escape exactly once.

Fixes the CodeQL js/double-escaping alert.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 21:11:50 +02:00
Sebastian DanielssonandClaude Opus 5.5 b688f528bd fix(objgen): comment detection and whitespace stripping
The comment check passed its pattern as a string, so every `\s` became a
literal `s`. Lines starting with `s` that contained `//` or ended in `/`
(e.g. `site = https://example.com`) were dropped as comments. Lines are
already trimmed, so only `//` and lone `/` lines need skipping.

`spacesRegx` and `newLineRegx` lacked the global flag: prop names kept all
but their first space, and whitespace-only lines were treated as content.

Fixes CodeQL js/useless-regexp-character-escape and js/incomplete-sanitization
alerts in src/utils/objgen.ts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 21:11:50 +02:00
redenfire 3e7f8459ff i18n: rewrite Italian locale with human-quality translations (#582) 2026-10-03 21:04:00 +02:00
Philipp 4e5c0fd401 fix(docker): serve precompressed static assets (#583)
Generate gzip sidecars for JavaScript, CSS, and WebAssembly assets during the image build. Serve them through nginx when clients accept gzip, including proxied requests, while preserving uncompressed fallback and runtime HTML base-path rewriting.
2026-10-03 21:03:22 +02:00
Luoxingchen935 e179bd5b9b docs(zpool-memo): reformat vdev type table 2026-10-03 12:45:21 +02:00
Luoxingchen935 44f1298471 docs(locales): improve zh UFW generator translations 2026-10-03 12:45:21 +02:00
Luoxingchen935 f196182261 feat(zpool-memo): add localized content and recategorize 2026-10-03 12:45:21 +02:00
Luoxingchen935 cba443dc39 i18n: update translations for iptables and fstab generator tools 2026-10-03 12:45:21 +02:00
ShareVB fad759efda chore(version): release 2026.09.27 2026-09-27 22:53:34 +02:00
ShareVB fd37ca3dda docs(changelog): update changelog for 2026.09.27 2026-09-27 22:53:34 +02:00
ShareVB 51cb09339c chore: fix release script 2026-09-27 22:53:30 +02:00
ShareVB 6aa2e1cebb i18n: extract and translate remaining 2026-09-27 22:47:42 +02:00
ShareVB 90b779356f chore: update deps 2026-09-27 22:37:42 +02:00
da38faa9be ci: pnpm 12, pnpm/setup v3, faster and pinned CI, single Vercel deploy workflow (#577)
* ci: move to pnpm 12, pnpm/setup v3 and faster, pinned CI

pnpm 12.6.0 is declared in devEngines.packageManager instead of
packageManager, so pnpm/setup, the Dockerfile and local installs all pick
the same version; the lockfile records the resolved binary. Every workflow
moves to pnpm/setup v3, and the Vercel workflows gain a setup step so
`vercel build` runs with that pnpm rather than whatever is on the runner.

CI time:
- ci runs format check, lint, unit tests, typecheck and build as parallel
  steps instead of one after another.
- E2E builds the app once and shares dist with the three browser jobs
  instead of rebuilding it in each.
- ci and E2E cancel superseded runs on the same ref.
- The Docker latest/baseurl workflows no longer repeat ci's checks. They
  run on workflow_run after ci succeeds for a push, and build the commit
  ci tested.

Runners are pinned to ubuntu-26.04-arm. CodeQL stays on x64
(ubuntu-26.04): only the x64 image ships the CodeQL bundle in its tool
cache. The Playwright cache key now includes the runner architecture.

Every action is pinned to its latest release by commit SHA with a version
comment, the Dockerfile base images by digest, and the pnpm and Vercel CLI
installs to exact versions, matching the Renovate presets already enabled
(helpers:pinGitHubActionDigests, docker:pinDigests).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017s2w39tKNdBdD8kyfThuLy

* ci: deploy to Vercel from one workflow with previews and a concurrency group

Replaces sharevb-vercel-preview.yml and sharevb-vercel-prod.yml with
deploy.yaml, which builds here and deploys the prebuilt output:

- One concurrency group per ref with cancel-in-progress, so a burst of
  pushes costs one deployment instead of one per push.
- A GitHub environment per run (Production or Preview), which restores the
  Environments sidebar and the PR's "View deployment" button.
- Pull requests build their own head commit, named after the PR branch so
  Vercel shows the branch rather than "HEAD"; runs from forks are skipped,
  since they get no secrets.
- Fails early on missing secrets, refuses to deploy a build without
  index.html, and pins the Vercel CLI.

The production hostname for sitemap.xml and robots.txt comes from the
VERCEL_PRODUCTION_URL repository variable instead of being hardcoded, so
the same file serves any deployment. Secrets can live on the repository
or on the Production/Preview environments.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017s2w39tKNdBdD8kyfThuLy

* build: stop compiling tree-sitter's native addon

curlconverter depends on tree-sitter and tree-sitter-bash for its Node
shell parser, but the app only uses curlconverter in the browser, where its
`browser` field swaps in web-tree-sitter (WASM). The native addon is never
loaded.

Building it anyway broke installs: tree-sitter 0.21 ships prebuilds only for
darwin-x64 and win32-x64, so Linux compiles it from source, and its C++17
flags fail against Node 24.21's headers, which require C++20. That is what
failed pnpm install on the arm64 runners.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017s2w39tKNdBdD8kyfThuLy

* ci(e2e): run the browser jobs on x64

On ubuntu-26.04-arm the Playwright suite ran over 7x slower: chromium was
still in the test step after 27 minutes, against under 4 on x64. The build
job stays on arm; its output is architecture-independent.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017s2w39tKNdBdD8kyfThuLy

* test(e2e): stop the preview server with SIGTERM so runs exit

pnpm 12 starts the script it runs in its own process group. Playwright
stops its webServer by SIGKILLing the `pnpm preview` process group, which
no longer contains vite: vite survives, keeps the output pipes open, and
Playwright waits on it forever. The E2E jobs finished every test and then
hung until the job timeout.

pnpm 12.6 forwards SIGTERM to the script it runs, so stop the server with
SIGTERM instead. Locally with pnpm 12.6.0: 112 tests in 1.8 min, clean
exit, nothing left listening on the port.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017s2w39tKNdBdD8kyfThuLy

* Revert "ci(e2e): run the browser jobs on x64"

The slowdown blamed on arm was the Playwright webServer hang fixed in the
previous commit: every test had finished and the job was waiting on an
orphaned vite process. The suite is not slower on arm, so the browser jobs
go back to ubuntu-26.04-arm like the rest.

This reverts commit 9f5af383.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017s2w39tKNdBdD8kyfThuLy

* ci(docker): publish one image at a time, newest wins

Two workflow_run publishes could overlap, and whichever finished last set
the tags, even if it built the older commit. A single concurrency group per
workflow with cancel-in-progress fixes that: ci already cancels superseded
runs on the branch, so publishes arrive in commit order and cancelling the
older one leaves the newest commit on the tags. Raised in review.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017s2w39tKNdBdD8kyfThuLy

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: sharevb <sharevb@gmail.com>
2026-09-27 18:37:50 +02:00
ShareVB 7fc4b79172 feat(Timezone Converter): add POSIX string filterable list
Fix #579
2026-09-27 12:45:47 +02:00
641fa857b4 perf(bundle): improve initial load + loading of tools (#575)
* perf(bundle): improve initial load + loading of tool

Render the sider once and only build the parts of it that are visible.

- App.vue renders BaseLayout around the layout switch instead of inside each
  layout, so moving between a plain route and a tool route no longer unmounts
  and rebuilds the whole sider (~460 menu items) on every navigation.
- CollapsibleToolMenu mounts a category's items the first time it opens. Every
  category starts collapsed, so the menu was built entirely out of view.
- Its menuOptions computed no longer folds in the collapsed/active flags, which
  rebuilt every category's tools array -- and re-rendered every item -- per route
  change. They are read from the template instead.
- MenuItemTooltip measures truncation with scrollWidth/clientWidth rather than a
  canvas measureText(), dropping a throwaway <canvas> and a getComputedStyle per
  menu item.

Production build, 3 runs each, fresh profile per run:

  first contentful paint   2476-2735ms -> 814-974ms
  main-thread blocking     1806-2024ms -> 250-294ms
  requests at boot         384         -> 208
  click a tool from home   991-1014ms  -> 178-197ms
  switch between tools     281-322ms   -> 74-125ms

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Fix small width in mermaid exporter

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: sharevb <sharevb@gmail.com>
2026-09-27 12:04:23 +02:00
ShareVB 0f4c7b1d68 feat(JSON Editor): store data and add an auto height option
Fix #572
2026-09-26 11:16:58 +02:00
Shaquille_Oatmeal c96fd39482 feat(new tool): Restic Command Generator (#573)
Generates restic CLI commands, with the focus on getting data back out of a
repository when the Backrest UI is not available: a full restore, a restore
limited to some files or a subfolder, a single-file dump, or a FUSE mount.

Covers the backends Backrest points at (S3 compatible such as Backblaze B2,
B2 native, local, SFTP, REST, rclone, Azure, GCS, raw URI), builds the
matching environment setup without ever putting a secret in the command
(the default reads them with `read -rs`), and turns the Backrest plan and
instance IDs into the `plan:` / `created-by:` tag filters restic expects.

Also generates the whole recovery sequence (snapshots, find, ls, restore,
mount) from the same repository settings, and ships a small Backrest cheat
sheet pointing at the config file, the data directory and the tag formats.

Generator only: nothing is executed and no input leaves the browser.
2026-09-26 10:47:09 +02:00
ShareVB bc1d9a3199 feat(Keys Generator): add fingerprint
Fix #574
2026-09-19 20:15:46 +02:00
ShareVB c80a08be64 feat(new tool): EPC QR Code Generator
Fix #570
2026-09-08 08:34:33 +02:00
ShareVB 0039bd7213 feat(new tool): URL Redirection Checker
Depending on https://github.com/sharevb/network-utils-ws
Fix #550
2026-09-06 20:29:27 +02:00
ShareVB 62ab0bf92f fix: c-link to vs href
Fix #569
2026-09-06 09:59:14 +02:00
ShareVB a049d1c519 chore: remove fm:check ypass 2026-09-06 09:18:07 +02:00
ShareVB bc44870665 chore: global code formatting 2026-09-06 09:02:45 +02:00
Shaquille_Oatmeal 5bf94bc567 Restructure and enhance cheat sheets for improved readability (#566)
* docs(cheatsheets): expand and align the chmod, git, docker and swarm memos

Unify the four cheat sheets on one layout: short intro, emoji section
headings, grouped command blocks with aligned inline comments, reference
tables and a resources section. Placeholders are consistently <angled>.

- chmod: ls -l breakdown, octal and symbolic tables, special bits, umask,
  recursive/selective changes, recipes, related commands and gotchas;
  fix the directory access matrix (r alone does not grant file access)
  and the --preserve-root default
- git: config and aliases, staging, commit, branching, merge/rebase with
  conflict flow, remotes, stashing, inspection, cherry-pick, tags, undo
  with a reset-mode table, cleaning, bisect, submodules and worktrees
- docker: contexts and events, build flags, registries, run/exec/inspect,
  volumes and mounts, networks, the full compose workflow, cleanup and
  one-liners
- swarm: required firewall ports, node and manager operations, live
  service updates, job modes, placement expressions, publish modes,
  health checks, secret and config rotation, task states and a
  troubleshooting table

* docs(cheatsheets): put descriptions above commands so each line copies clean

Trailing inline comments meant selecting a single command also picked up
the padding and its description. Move every description onto its own line
above the command it documents, keeping one code block per topic.

- each command now stands alone on its line: triple-click copies exactly
  the command, nothing else
- no comment column to re-pad when a longer command is added later, so
  adding a line no longer reindents the whole block
- code lines drop from a median of 78 columns to ~22 (p90 42), so blocks
  no longer scroll sideways on narrow screens
- wrap the three remaining long commands over several lines
- reword the descriptions that only made sense trailing a command

* docs(cheatsheets): rework the tmux, screen, zellij, nano, jq, zpool, CSS and JSONPath memos

Bring eight more cheat sheets onto the same layout as the Docker and Git
ones: short intro, emoji section headings, one code block per topic with
the description above each command, reference tables, resources at the end.

- tmux: session/window/pane/copy-mode tables, scripting with send-keys and
  capture-pane, a starting .tmux.conf
- screen: shared and detached attach modes, split regions, copy mode,
  logging and monitoring, nested-screen prefix
- zellij: correct the pane-mode bindings (d/r split, not v/h), add tab,
  resize, move, search and session modes, layouts, zellij run/edit/action
- nano: add the command-line options and .nanorc settings the sheet was
  missing, drop the stray H1 and broken headings
- jq: flags, core syntax, object/array/string tables, conditionals,
  variables, reduce, and runnable recipes; drop the stale AWS AMI note
  and the HTML pipe entities
- zpool: vdev and support-vdev types, import/export, properties, dataset
  and snapshot/replication commands, tuning notes
- CSS selectors: split one 60-row table into basic, combinator, attribute,
  structural, state, form, functional and pseudo-element groups; add
  :is()/:where()/:has() and a specificity table
- JSONPath: RFC 9535 functions, worked example document, filter operators

* docs(cheatsheets): rework the Dockerfile, Compose and kubectl memos

- Dockerfile: instruction reference table, BuildKit cache/secret/bind
  mounts and heredocs, COPY --chown/--chmod/--from, HEALTHCHECK,
  STOPSIGNAL, a CMD vs ENTRYPOINT table, build commands and a worked
  multi-stage example
- Compose: drop the obsolete version: framing, merge the two duplicated
  "Compose vs Swarm" sections into one table, correct the claim that
  file-based secrets are Swarm-only, and add depends_on conditions,
  profiles, watch mode, include/extends/anchors, env interpolation and
  the full CLI section
- kubectl: replace the removed rolling-update and the retired Heapster
  section, add contexts, custom-columns and JSONPath output, rollouts,
  debug containers, port-forward, secrets, labels, node maintenance and
  one-liners; tag the code blocks so they highlight

* docs(cheatsheets): rework the sed, regex and common-regex memos

- sed: how the pattern space works, an addressing table, the full command
  reference including hold-space and branching, multi-line recipes, and a
  warning about BSD/macOS -i; merge the duplicated deletion and addressing
  sections
- regex: add flags, lazy quantifiers, named groups and backreferences,
  Unicode property escapes, replacement tokens, the JavaScript methods
  that expose groups, and a gotchas section (stateful /g, catastrophic
  backtracking, escaping user input)
- common-regex: rewrite the patterns that markdown escaping had mangled
  into unusable text, group them by subject, and add UUID, semver, CIDR,
  MAC, ISO 8601, duration, log-line and CSV patterns

Every pattern in common-regex now compiles, and the ones people copy most
(IPv4, UUID, semver, E.164, ISO dates, password rules, slug, duration,
MAC) were checked against matching and non-matching input.

* docs(cheatsheets): rework the XPath, conventional-commits and RJ45 memos

- XPath: give every table a CSS-equivalent column, fix the broken
  "only children of type" expression, flag which functions are 2.0+ and
  give the 1.0 workarounds for ends-with and case folding, add the axes
  short forms, worked examples, and how to run XPath from devtools,
  xmllint, lxml, Selenium and Playwright
- conventional commits: types table with the release effect each one
  has, description do/don't table, footer reference, both ways to mark a
  breaking change, a version-bump table, and husky v9 hook syntax
- RJ45: keep the colour swatches and the pinout image, add what each pin
  carries on 10/100 vs Gigabit, the PoE standards table (correcting the
  claim that the blue pair is the PoE pair), gigabit crossover, Cat8,
  length and solid-vs-stranded rules, and a fault-finding table

* docs(cheatsheets): rework the nginx and PowerShell memos

- nginx: the whole sheet was a single 218-line code block; split it into
  sections with a service/CLI block, a file-layout table, location
  matching priority, root vs alias, reverse proxy and WebSocket headers,
  load-balancing methods, TLS, rate limiting, caching and gzip, a
  variable reference and a 502/504 troubleshooting table
- PowerShell: add discovery (Get-Help/Get-Command/Get-Member), functions
  and param blocks, try/catch and error preferences, Invoke-RestMethod
  and JSON/CSV conversion, services, jobs, remoting, modules and
  execution policy, PowerShell 7 operators, an alias table, and repair
  the mangled escape-character rows

* docs(cheatsheets): rework the vim and bash memos

Both sheets were a single unbroken code block with ASCII banners, so the
whole page rendered as one <pre> with nothing to scan. Rebuild them as
sections with key/action tables and runnable blocks.

- vim: explain the count + operator + motion grammar, add the text-object
  table (ciw, ci", da(), registers and why "0p exists, the :g and :v
  global commands, folds, completion, diff mode, undo by time, a :set
  reference and a starter vimrc
- bash: parameter expansion, arrays including associative ones, the test
  operator tables, redirection and process substitution, job control and
  traps, set -euo pipefail with its caveat, shellcheck, and an ANSI
  colour table in place of sixty lines of colour variables

The vim sheet dropped roughly a hundred lines of one person's leader-key
mappings and plugin bindings (NERDTree, Taglist, sparkup, PHP DOC), which
only worked with their dotfiles; a note now explains that leader mappings
come from your own vimrc.
2026-08-30 16:38:56 +02:00
lawson.local.dev a5607e04ad add proxmox helper script (#568) 2026-08-30 16:20:40 +02:00
ShareVB 39c616f609 feat(QRCode Generator): add embeddable link and cropy dataurl
Fix #555
2026-08-23 10:48:30 +02:00
Shaquille_Oatmeal 002a211ca5 Enhance Docker Swarm documentation (#564)
Updated Docker Swarm documentation with improved clarity and additional details on commands and features.
2026-08-19 22:34:02 +02:00
0a1f5dc450 feat(docker): serve the app from any subpath with a runtime BASE_URL (#565)
* feat(docker): serve the app from any subpath with a runtime BASE_URL

BASE_URL was a build argument, so hosting under a subfolder meant building
your own image (or pulling the separate baseurl-it-tools tag, which is only
ever right for /it-tools/). Make it a runtime setting instead, so the regular
image works anywhere:

    docker run -e BASE_URL=/it-tools/ ghcr.io/sharevb/it-tools:latest

The build is now path-agnostic. Vite's base is relative, so hashed assets and
lazy chunks resolve against the chunk that imports them, and the single
absolute anchor left in the output is a `<base href="/">` injected into
index.html. nginx rewrites that one tag per request (sub_filter) from the
normalised BASE_URL, and the app reads its base back from it at runtime
(src/utils/base-url.ts) for the router and for every URL it builds into
public/ -- import.meta.env.BASE_URL is meaningless in a relative build.

Also handled:

- both reverse-proxy styles: the prefix may reach the container (stripped by
  the rewrite) or be stripped by the proxy first (nothing to do). The assets
  location matches with or without it, so a missing chunk is still a 404
  rather than the SPA shell.
- `/it-tools` redirects to `/it-tools/`, with a relative Location so the
  scheme of the proxy hop does not leak into it.
- the PWA: manifest URLs are relative to the manifest, workbox precache
  entries relative to the service worker, and the worker is registered
  against the runtime base rather than the build-time one.
- BASE_URL is normalised (`it-tools`, `/it-tools`, `/it-tools/` all work) and
  rejected if it is not a plain path, since it lands in an HTML attribute and
  in an nginx regex.

Defaults are unchanged: with BASE_URL unset the rendered config and the
served page are what they were, except that index.html loses ETag/Last-Modified
to sub_filter. On a read-only filesystem the template cannot be re-rendered,
so BASE_URL is ignored there and the container now says so, like it already
had to for PORT.

Building with --build-arg BASE_URL still works but only moves the image
default; the baseurl-it-tools tag is now just latest with that default.

Closes sharevb/it-tools#403

* fix(docker): restore the PWA update reload, escape BASE_URL in the nginx regexes

Follow-up from review of the runtime BASE_URL change.

- registerSW() in autoUpdate mode reloaded the page when a newly deployed
  worker took over (workbox-window's `activated` handler); hand-rolling the
  registration dropped that, so a tab kept running the previous bundle until
  it navigated. Reimplemented on `controllerchange`, guarded so a first
  install -- which also claims the page -- does not reload. Verified by
  counting document loads across an install and a simulated deploy: 1 load on
  first visit, exactly 1 reload when a new worker takes over.
- The comment justifying the hand-rolled registration was wrong: register()
  does resolve a relative URL against `<base href>`. The real reason is
  workbox-window's own urlsMatch(), which resolves against location.href, so
  a relative sw URL misidentifies the worker on a route deeper than one
  segment. Comment now says that.
- BASE_URL allows `.`, which is a metacharacter in the two nginx regexes it
  is spliced into: `/it.tools/` also matched `/itXtools/`. The entrypoint now
  exports regex-escaped forms for those, keeping the literal value for the
  sub_filter replacement and the redirect target.
- Dropped `$uri/` from try_files. Nothing in the build is a directory with an
  index, so the only thing it ever produced was nginx's trailing-slash
  redirect -- computed after the prefix rewrite, so `/it-tools/figlet-fonts`
  answered `301 /figlet-fonts/` and bounced the browser out of the app.
- The sub_filter comment claimed index.html was the only response losing
  ETag/Last-Modified; public/visualsubnetcalc/calc.html is HTML too and is
  equally affected. Comment corrected.
- README: in the prefix-stripping proxy setup, `/it-tools` without the
  trailing slash never reaches the container, so the proxy has to redirect it
  (as the sample does). Said so.
- The new e2e test reloaded a page that had just started pulling in a tool's
  chunks; WebKit cancelled the load ~1 run in 3 (the app reloads itself on an
  aborted chunk fetch). It opens the URL in a second tab instead: 8/8 on
  WebKit, 3/3 browsers green.

* fix(build): validate BASE_URL before it reaches the <base href>

From Copilot's review of #10.

The container validates its runtime BASE_URL, but the build-time one went
straight into an HTML attribute unchecked: a value carrying a quote rewrote
the tag around it, and one carrying a space or `..` quietly produced a page
that loads from the wrong place. Apply the same rule the entrypoint does --
a plain path of unreserved characters -- and fail the build otherwise.

Also: "can not" -> "cannot" in the read-only filesystem warning.

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-08-19 22:16:54 +02:00
SebastianandClaude Opus 5 ec740dd063 ci: rework the test and lint toolchain — per-browser E2E, scoped jsdom, type-aware oxlint (#561)
* ci(e2e): one job per browser with three workers

Replace the 3-way shard matrix with a per-browser matrix. Each job now
runs one Playwright project with three workers instead of three jobs each
running a mixed slice of all browsers at one worker.

The old layout gave each of three runners a single worker, so each job
used one of its four cores; a browser failure also showed up as
"shard 2/3" with no indication of which engine broke.

- `workers: 1` -> `3` on CI. Measured on a 4-core box: 9.4 min at one
  worker vs 5.1 min at three, with the box ~95% busy. A fourth worker
  added nothing and left no core for the preview server.
- `fail-fast: false` so one engine failing still reports the other two.
- Install and cache only the browser a job actually needs, instead of all
  three in every job.
- Fix the cache key, which read `.dependencies.playwright` and always
  resolved to `null`; the package is `devDependencies["@playwright/test"]`,
  so the key never changed when Playwright was upgraded.
- `set_node_mem.sh` grows a `NODE_MAX_OLD_SPACE_MB` override, used to cap
  each worker at 4GB. Playwright workers inherit `NODE_OPTIONS`, so
  otherwise every worker claims a machine-sized heap ceiling.

The script is now POSIX. It is sourced from package.json scripts, which
run under dash, where `[[` does not exist -- every run was logging
"[[: not found" and silently falling through to the Linux branch, so the
macOS detection never worked when invoked that way.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAwAJ6L3Mai8eSxXf5e6SA

* refactor(set_node_mem): capture memory sizes before the arithmetic

Addresses review feedback on the sourced heap-sizing script. Reads
closer to the original, which also assigned the raw value first.

Behaviour is unchanged: dash still produces --max-old-space-size=15051
by default and honours NODE_MAX_OLD_SPACE_MB.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAwAJ6L3Mai8eSxXf5e6SA

* fix(e2e): give CI more timeout headroom now that workers share a runner

The webkit job failed on `markdown-diff`, which mounts a Monaco diff
editor -- the heaviest tool in the suite -- on the slowest engine:

  1 failed   [webkit] markdown-diff Has correct title
  1 flaky    [webkit] markdown-diff Diff editor is visible with two panes
  107 passed (9.3m)

Both are first-paint timing, not behaviour. The 15s expect timeout was
sized for one worker per runner; with three sharing four cores, first
paint of a lazy-loaded tool takes longer, and the failure survived two
retries.

Raise the CI budget to 30s for assertions. The test timeout has to move
with it -- it defaults to 30s, so a 30s expect timeout would trip the
test timeout first and report a timeout instead of the failing
assertion. Local runs keep the previous 15s/30s.

Timeouts are upper bounds, so passing tests are unaffected.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAwAJ6L3Mai8eSxXf5e6SA

* fix(e2e): drop the inline timeout that caps markdown-diff below the CI budget

Raising the CI expect timeout to 30s fixed one of the two webkit
failures in markdown-diff but not the other:

  before: 1 failed + 1 flaky, 107 passed
  after:  1 failed,           108 passed

The surviving failure asserts the title with an inline
`{ timeout: 15000 }`, which overrides the global expect timeout, so it
kept the old budget while its neighbour picked up the new one.

The inline value only restated what the global used to be, so removing
it is a no-op locally (still 15s) and lets CI use its 30s budget.

The four inline overrides in mermaid-exporter are left alone: those
raise the timeout to 30s rather than capping it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAwAJ6L3Mai8eSxXf5e6SA

* perf(test): scope jsdom to the suites that need it

`test:unit` ran `vitest --environment jsdom`, which builds a jsdom for
every test file. Only 7 of 128 need one -- the other 121 are pure
functions and pass unchanged under the node environment.

Measured on a 4-core box, `pnpm test`, warm cache:

  before  89s wall, environment 128.79s, tests 4.70s
  after   ~56s wall, environment   7.37s, tests 5.30s

Environment setup was the single largest cost in the run and is now
~7s. The tests themselves were always ~5s.

Default to the node environment and let the 7 DOM-dependent suites opt
in with a `// @vitest-environment jsdom` docblock:

  src/ui/c-input-text                      (@vue/test-utils mount)
  src/ui/n-input-number-i18n               (@vue/test-utils mount)
  src/tools/certificate-key-parser         (webcrypto-liner-shim)
  src/tools/extract-text-from-html
  src/tools/markdown-preview
  src/tools/file-splitter
  src/tools/django-secret-generator

Same 128 files and 1035 tests pass before and after.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAwAJ6L3Mai8eSxXf5e6SA

* test: drop jsdom from three more suites and fix two assertions

Down from 7 jsdom suites to 4. The three removed did not need a DOM;
they needed it by accident.

certificate-key-parser
  The service and its infos module each did a side-effect
  `import 'webcrypto-liner-shim'`. That shim polyfills WebCrypto for
  browsers without a secure context (see README: WebCrypto needs HTTPS),
  and it touches browser globals at import time, so pulling it into a
  node process fails before any test runs.

  Node has WebCrypto natively, so the polyfill only belongs on the
  browser path. Move the import to certificate-key-parser.vue, which is
  what pgp-keygen.vue and pgp-encryption.vue already do. It now also
  evaluates before sshpk rather than after it, and no longer loads
  eagerly through the tool's infos module.

  That let the test drop its jsdom workaround too: it was replacing
  global.TextEncoder/TextDecoder with the text-encoding-utf-8 polyfill,
  which node does not need. The `no-restricted-globals` disable existed
  only for those writes and is gone with them.

  Side effect: the run no longer emits the shim's asm.js linking
  warning, which was the only warning left in the unit suite.

extract-text-from-html
  `validateHtml` parsed the input with DOMParser, discarded the
  document, and validated with a regex instead. `parseFromString` with
  'text/html' recovers from bad markup rather than throwing, so the
  catch was unreachable and the whole block was dead -- and the only
  reason the file needed a DOM.

django-secret-generator
  Used `window.crypto`; `globalThis.crypto` is the same API in browsers
  and in node.

Two assertions did not test what they claimed:

  expect(getTextFromHtml('<p>..</p>')).toString();

`.toString()` on the assertion object asserts nothing -- this passed
even if the function returned null. Now checks the type.

  expect(getSecretKey()).toMatch(/[a-z0-9!@#$%^&*(-_=+)]{50,60}/);

`toMatch` searches rather than anchors, so any key of 50 chars or more
passed regardless of length. Split into an explicit length range and an
anchored charset check. The old class was also wrong: `(-_` reads as the
range `(` to `_`, which accepts digits and uppercase.

Also moved a valid-html case that sat in the invalid block, and fixed
the `invlid` / `django-secret-generato` typos.

128 files pass, 1035 tests -> 1036 (the django assertion is now two).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAwAJ6L3Mai8eSxXf5e6SA

* chore(deps): drop the now-unused text-encoding-utf-8

The certificate-key-parser test was the only consumer: it replaced
global.TextEncoder/TextDecoder with this polyfill so the suite could run
under jsdom. That workaround went away when the suite moved to the node
environment, which provides both natively.

pnpm also prunes an orphaned transitive crypto-js@4.2.0, whose own
metadata marks it as no longer maintained. The lockfile change is 22
deletions and no additions.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAwAJ6L3Mai8eSxXf5e6SA

* ci: enable oxlint type-aware linting, drop typecheck from build and CI

Adds oxlint-tsgolint and turns on `options.typeAware`, which brings 59
type-aware rules from typescript-eslint into `pnpm lint`. It found 59
issues; `--fix` resolved 3 (useless `= undefined` defaults).

The remaining 56 are semantic -- floating promises, base-to-string,
misused string spread -- spread over ~20 files, so they are staged as
`warn` rather than fixed blind in a CI change. Lint exits 0 and the
findings are visible in the output, ready to burn down by rule.

TypeScript stays on 6.0.3. The docs ask for TypeScript 7+, but that is
about tsgolint's own toolchain, not the project's: oxlint-tsgolint ships
a self-contained binary with no npm dependencies, and produces the same
56 findings against TypeScript 6.

Upgrading the project to TypeScript 7.0.2 was tried and reverted -- it
breaks the build:

  [@vue/compiler-sfc] No fs option provided to `compileScript` in
  non-Node environment. File system access is required for resolving
  imported types.

Isolated by rebuilding with the same scripts on 6.0.3, which passes. TS
7's native port also drops the `./lib/tsc` subpath export, so vue-tsc
cannot start at all -- neither 3.3.6 nor the current 3.3.10.

Script and workflow cleanup:

- `build` no longer runs `vue-tsc --noEmit` first; it just builds.
- The `ci` workflow drops its Type check step. It already runs `pnpm
  lint`, which now carries the type-aware rules. No other workflow had
  a typecheck step.
- `precommit` and the PR template drop `pnpm typecheck` for the same
  reason.

The `typecheck` script itself is kept, and so is vue-tsc. tsgolint
analyses no .vue files at all -- 0 of the 59 findings came from one --
so vue-tsc remains the only thing that type-checks single-file
components, and deleting it would drop that coverage with nothing
replacing it. It is simply no longer wired into the build or CI.

Renovate's TypeScript toolchain group gains oxlint-tsgolint, whose
version tracks TypeScript releases.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAwAJ6L3Mai8eSxXf5e6SA

* refactor(oxlint): move config to oxlint.config.ts

Replaces .oxlintrc.json with a typed config built from oxlint's own
`defineConfig`, so rule names and options are checked by the editor
instead of being free-form JSON strings, and the staged type-aware rules
can carry an explanation next to them.

Verified as a faithful translation by diffing `oxlint --print-config`
between the two: identical resolved rule set (167 rules), no rule added,
dropped or re-levelled, and `options.typeAware` equal. Same 56 warnings
and 0 errors either way.

TypeScript configs are auto-discovered but marked experimental upstream
and require running under Node, which `pnpm lint` already does.

Also records why vue-tsc stays, since oxlint's vue plugin invites the
opposite conclusion: those 46 vue rules are style and correctness lint
rules, not a type checker. Planting

  const deliberateTypeError: number = getSecretKey();

in a .vue script block is reported by neither `--type-aware` nor
`--type-check` -- oxlint exits 0 -- while vue-tsc catches it as TS2322.
tsgolint only analyses .ts files.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAwAJ6L3Mai8eSxXf5e6SA

* ci: restore typecheck and run lint + typecheck on every build path

oxc-project/oxc#15761 ("oxlint: better vue support") is the tracking
issue for Vue in oxlint. It is open, unimplemented, and scoped to
parsing template bindings so structural lint rules can work -- not to
type checking. Even once it ships it would not cover what vue-tsc does,
and the maintainer notes eslint-plugin-vue cannot be fully replicated
because Vue templates carry no JavaScript bindings for the linter.

So vue-tsc stays and goes back into CI. Confirmed the gap is real by
planting `const x: number = getSecretKey()` in a .vue script block:
oxlint exits 0 under both --type-aware and --type-check, vue-tsc reports
TS2322.

Every job that runs `pnpm build` directly now runs lint and typecheck
first:

  sharevb-ci                        + typecheck
  sharevb-docker-nightly-release    + typecheck
  sharevb-docker-realease-latest    + typecheck
  sharevb-docker-realease-baseurl   + typecheck
  sharevb-github-pages-publish      + lint, typecheck  (had none)
  sharevb-releases                  + lint, typecheck  (had none)

The two publish workflows were building and shipping without any check
at all. Left alone: the nightly github-release job, already gated by
`needs: ci` on the same commit, and the e2e workflow, whose three
browser jobs build on the same commit that the ci workflow is already
checking in parallel.

`precommit` and the PR template get typecheck back for the same reason.

oxfmt config moves to oxfmt.config.ts alongside oxlint's, using oxfmt's
own defineConfig. Same 832 files are flagged before and after, so the
translation is faithful.

Format checking is deliberately NOT wired into CI yet: `pnpm fmt:check`
currently fails on 832 of 1613 files (410 .vue, 359 .ts, 50 .md, 12
other). The scripts exist but have never been enforced, so the tree has
drifted. Enabling the gate needs a repo-wide reformat, which belongs in
its own commit rather than buried here.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAwAJ6L3Mai8eSxXf5e6SA

* ci: report formatting drift without enforcing it

Adds `pnpm fmt:check` to the ci workflow with continue-on-error, so the
832 files that predate oxfmt being run in CI are visible on every PR
without blocking anything. Drop continue-on-error once a repo-wide
reformat lands.

Only the ci workflow gets it. It is the one that runs on pull_request,
so it is where a non-blocking signal is actually read; adding it to the
docker and release workflows would just add noise to logs nobody opens.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAwAJ6L3Mai8eSxXf5e6SA

* refactor(test): pin the timezone in config instead of every script

`TZ=UTC` was repeated across four scripts, including once redundantly
(`test` set it and then called `test:unit`, which set it again).

It is genuinely load-bearing for the unit suite. Running vitest on
America/New_York fails 7 tests across 5 files -- date-time-converter,
days-calculator, crontab-generator and friends assert on formatted dates
and offsets. Moved to `test.env` in vite.config.ts, which is enough on
its own: the full suite passes with the host on America/New_York and on
Asia/Tokyo with no inline prefix.

That also fixes `pnpm coverage`, which never had the prefix and so would
fail those same 7 tests on any machine not set to UTC.

For e2e it was doing nothing. The browser timezone is already pinned by
`timezoneId: 'Europe/Paris'`, and the specs do no date maths on the node
side -- the one `Date.now` override runs inside `addInitScript`, so it
is browser-side. The timezone-sensitive specs pass on Asia/Tokyo without
it. Pinned in playwright.config.ts anyway so the runner stays
deterministic if a spec ever does compute a date in node.

Also switches `test` from `npm run` to `pnpm run`, since everything else
in the repo uses pnpm.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAwAJ6L3Mai8eSxXf5e6SA

* chore: drop the `test` alias in favour of `test:unit`

`test` was a pass-through to `test:unit` and nothing else, so it only
added a level of indirection and a second name for the same thing --
confusing next to `test:e2e`, which is a different suite.

Repointed all five callers: the ci, nightly-release and two docker
release workflows, plus the README's "Run Unit Tests" snippet.

Note `pnpm test` no longer resolves, since npm's implicit test
lifecycle has nothing to fall back on now.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAwAJ6L3Mai8eSxXf5e6SA

* refactor(e2e): fold test:e2e:dev into test:e2e

The two scripts were not two environments, they were two answers to
"who owns the web server":

  test:e2e      Playwright starts `pnpm preview` on :5050 and tests the
                production build
  test:e2e:dev  assumes `pnpm dev` is already up on :5173 and starts
                nothing

That is one variable, not a second workflow, so it does not need a
second script. The config now derives it: if E2E_BASE_URL points
somewhere other than the preview URL, you are supplying the server and
Playwright leaves the lifecycle alone. NO_WEB_SERVER is gone -- it only
ever restated what a custom base URL already implies.

Renamed BASE_URL to E2E_BASE_URL along the way. vite.config.ts reads
BASE_URL as the app's base path (`/it-tools/`, set by the Pages and
Docker builds), so one exported value meant two incompatible things and
would have pointed Playwright at a path instead of a URL.

Both paths verified:
  pnpm test:e2e                                  5/5, preview started
  E2E_BASE_URL=http://localhost:5173 pnpm ...    5/5, dev server reused

Documented both in the README, which had no e2e section at all -- the
script was the only place the dev flow was written down. Also notes that
a cold dev server compiles on demand and can blow the assertion timeouts
on a first run; that cost 2 failures until the routes were warmed.

Also fixes webServer.command, which shelled out to `npm run preview`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAwAJ6L3Mai8eSxXf5e6SA

* chore: delete set_node_mem.sh

The script raised the V8 heap to total RAM minus 1GB and was sourced by
build, test:unit and test:e2e. Nothing needs it any more.

The build does not come close to the heap. It completes on Node's
default (2096MB here) and still completes when capped at 512MB -- a
thirtieth of what the script was handing out:

  cap 15051MB (script)   92s, 93s
  default 2096MB         94s, 103s
  cap 1024MB             91s
  cap  512MB             95s

Unit tests are the same story: 35s and 37s with, 36s and 37s without.
No measurable difference anywhere, so the script was not buying speed
either.

The reason is that the build is not a JavaScript-heap workload. It peaks
around 6.5GB of system memory while running fine under a 512MB heap cap,
because rolldown does the work in Rust, outside V8. The README's "you
need around 16GB" dates from the old JS bundler; corrected to ~8GB with
the measured figure.

Removing it also retires two things it dragged along: the
NODE_MAX_OLD_SPACE_MB override added for Playwright, which existed only
because every worker inherited a machine-sized ceiling from this script,
and a POSIX bug where `[[` failed under dash on every single run.

Verified with NODE_OPTIONS unset, so at the 2096MB default CI will see:
build 87s, 129 files / 1072 unit tests, e2e 5/5.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAwAJ6L3Mai8eSxXf5e6SA

* fix(e2e): key the browser cache on the installed Playwright version

The key read the range from package.json, so it was `^1.62.0` rather
than `1.62.0`. Those agree today, but the range also matches 1.62.3 and
1.63.0: a lockfile bump inside the same range leaves the key unchanged,
so the run restores browsers for the old version and the cache is never
refreshed, because that key already exists.

Read node_modules/@playwright/test/package.json instead. pnpm/setup has
already installed dependencies by this step, so the resolved version is
available.

Raised by Copilot on the upstream PR.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAwAJ6L3Mai8eSxXf5e6SA

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-08-18 21:55:58 +02:00
gg 2912cf3eb9 Fix regex to clean base64 data URI (#563)
Fix #562
2026-08-17 13:04:34 +02:00
SebastianandClaude Opus 5 fbc7d47fbd ci: use pnpm/setup for pnpm and Node setup, pin Node in package.json (#560)
* ci: use pnpm/setup for pnpm setup and install

Replace the corepack bootstrap + actions/setup-node + separate
`pnpm install` steps with a single `pnpm/setup` step, which installs
pnpm (version read from package.json `packageManager`), installs Node,
caches the pnpm store and runs `pnpm install`.

Node 24 stays pinned via `runtime: node@24`, and the GitHub Pages
workflow drops `pnpm/action-setup` in favour of the same step (it now
caches the store too).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAwAJ6L3Mai8eSxXf5e6SA

* chore: pin Node in package.json, bump pnpm to 11.22.0

Move the Node version out of the workflows and into package.json, so the
`pnpm/setup` steps are just `cache: true`:

- `engines.node` pins Node 24 as package metadata.
- `devEngines.runtime` is the field `pnpm/setup` actually reads to pick
  the runtime, and pnpm itself uses it to run scripts, so it is needed
  for the pin to take effect.

Bump `packageManager` from pnpm 11.11.0 to 11.22.0 (latest 11.x).

pnpm records the runtime in the lockfile (`node@runtime:24.19.0`), and
the 11.22.0 resolver writes peer suffixes differently from 11.11.0, so
pnpm-lock.yaml is regenerated. Lint, typecheck, unit tests and build all
pass on the updated lockfile.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAwAJ6L3Mai8eSxXf5e6SA

* chore: bump .nvmrc to Node 24.19.0

The repo was already on Node 24 everywhere else (Dockerfile, workflows,
and now engines/devEngines in package.json) while .nvmrc still selected
22.19.0. Align it with the rest, matching the node@runtime:24.19.0
version pnpm resolved into the lockfile.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAwAJ6L3Mai8eSxXf5e6SA

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-08-16 17:29:51 +02:00
SebastianandClaude Opus 5 d39255ac20 fix(deps): move the two remaining deprecated direct dependencies onto supported versions (#559)
* fix(deps): move @xmldom/xmldom off the versions upstream flagged as critical

Upstream deprecated 0.8.13 and 0.9.10 with 'this version has critical issues,
please update to the latest version'. 0.8.14 and 0.9.11 are the patched
releases of those same lines.

The direct dependency moves to ^0.8.14, which also lifts xml-crypto and
xml-encryption since both accept the whole 0.8 line. @boxyhq/saml20 pins
0.9.10 exactly, so a version scoped override takes it to 0.9.11.

epubjs asks for ^0.7.5 and the 0.7 line has no release that is not deprecated,
so 0.7.13 stays until epubjs moves; overriding it across two minors of an xml
parser is not something to do blind.

Also refreshes the stale minimumReleaseAgeExclude entry, which still named
0.8.12 and 0.8.13. The policy is not currently switched on, but 0.8.14 was
published three days ago and the list is where this repo records that.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mf5V2jMpFFXxGVXZU5rHBq

* test(crontab-generator): pin the cron dialect detection and the execution times

getLastExecutionTimes was only asserted to return five items, and getCronType
only covered four expressions. Neither is enough to move a cron library under.

Adds a classification table spanning the standard and aws dialects, including
the six field expressions where they overlap, and freezes the clock so the
returned execution times can be pinned exactly, timezone offsets included.

No behaviour change: this is the reference the cron-parser v5 upgrade has to
reproduce.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mf5V2jMpFFXxGVXZU5rHBq

* fix(deps): upgrade cron-parser to v5, keeping the aws dialect detected

Upstream deprecated v4 with 'v4 is no longer maintained, upgrade to v5'. The
rename is mechanical (parseExpression -> CronExpressionParser.parse) but the
upgrade is not, because v5 accepts the six field aws dialect that v4 rejected.

getCronType relied on that rejection: it tried the standard parser first and
treated a throw as the signal to fall through to event-cron-parser. Under v5
'0 11-22 ? * MON-FRI *' parses as standard, so aws expressions would have been
classified as standard, given the wrong next execution times and reported as
invalid whenever the aws dialect was requested.

Detection now keys off the '?' marker, which AWS EventBridge requires in one of
the two day fields and which standard cron gives no meaning to. Checked against
v4 over a 32 expression corpus spanning both dialects: identical classification
everywhere, including '* * * * * *', which is valid in both and stays standard.

getLastExecutionTimes keeps returning string[]: v5 types toJSON() as nullable
and the caller joins the array, so a hole would have silently rendered as a
blank line.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mf5V2jMpFFXxGVXZU5rHBq

* fix(build): stub bare fs/promises, which cron-parser v5 reaches for

cron-parser v5 adds CronFileParser, exported from the package entry, and it
does require('fs/promises') to read crontab files. The browser build has no
business loading that, and the alias list only stubbed 'node:fs/promises'.

Vite matches aliases by prefix, so the bare 'fs' entry rewrote 'fs/promises'
into '_empty.ts/promises' and the build failed with UNLOADABLE_DEPENDENCY:
'Not a directory'. The new entry has to sit before 'fs' for that reason.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mf5V2jMpFFXxGVXZU5rHBq

* refactor(crontab-generator): run each cron parser at most once per classification

From review feedback. getCronType could evaluate the standard branch twice for
an expression that is neither dialect, and getLastExecutionTimes asked for the
type twice, which repeated the whole classification. The '?' marker now selects
which dialect to try first and each parser runs once; the caller keeps the type
in a local.

Behaviour is unchanged, the 30 assertions of the untouched test file still pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mf5V2jMpFFXxGVXZU5rHBq

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-08-16 17:26:26 +02:00
SebastianandClaude Opus 5 903ffb8b90 refactor(websocket-tester): use the native WebSocket instead of w-websocket-client (#558)
* refactor(websocket-tester): use the native WebSocket instead of w-websocket-client

w-websocket-client ships a single 1465 byte UMD that wraps the platform
WebSocket: it builds `${url}/?token=${token}`, wires four handlers and returns
the socket. It nevertheless declares wsemi and lodash-es as runtime
dependencies, which its published build never imports, and wsemi alone pulls in
20 packages. Installing all of that to avoid writing twenty lines is a bad
trade, so the wrapper now lives here, behind tests.

Removes 14 packages from the lockfile (w-websocket-client, wsemi, diff2html,
tippy.js, @popperjs/core, seamless-scroll-polyfill, tree-kill, eventemitter3,
xxhash-wasm and their own transitives), and drops the Node-only `ws` from the
browser app's dependency graph; `ws` now only comes in through ethers.

Two follow-on effects:

- wsemi was the only subdependency wanting xlsx, which is why the xlsx CDN
  override forced pnpm's blockExoticSubdeps protection off repo-wide. Only this
  package depends on xlsx now, so the protection goes back to its default. A
  forced re-resolution of all 2484 packages passes with it enabled and leaves
  the lockfile byte identical.
- Connecting with an invalid url used to return { error } from the wrapper
  instead of a socket, so the next send() threw 'wsc.send is not a function'
  and nothing was ever logged. The failure is now reported in the log.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mf5V2jMpFFXxGVXZU5rHBq

* fix(websocket-tester): make connection errors readable and normalize the url

Both from review feedback on the pull request:

- The log showed 'Error: [object Event]' for a failed connection, because the
  native onerror handler receives a bare Event whose reason the websocket spec
  deliberately withholds. formatWebSocketError() turns it into 'connection
  failed', keeps the message of a real Error, and stringifies anything else.
  The old client had the same flaw, but this pr claims to report connection
  failures in the log, so it should actually report something.
- buildWebSocketUrl() now trims a trailing slash, so 'ws://host/' produces
  'ws://host/?token=...' rather than 'ws://host//?token=...'. This is a
  deliberate deviation from the previous client, which concatenated blindly.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mf5V2jMpFFXxGVXZU5rHBq

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-08-16 17:04:46 +02:00
SebastianandClaude Opus 5 5e4972e285 chore(deps): replace the five deprecated packages from the dependency dashboard (#557)
* test: extract testable services and pin current crypto behaviour

Move the hashing, hmac, crc and ULA logic out of the single file components
into service modules next to them, and cover them with characterization tests
that pin the exact digests, encodings and ciphertexts the tools produce today.

The encryption tool had no tests at all; it now has round trip coverage for
every algorithm plus pinned ciphertexts for the deterministic ones, including
OpenSSL salted payloads produced by previous versions of it-tools.

No behaviour change: this is the reference point the dependency replacements
that follow have to reproduce exactly.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mf5V2jMpFFXxGVXZU5rHBq

* chore(deps): replace the five deprecated packages flagged by renovate

Renovate's dependency dashboard lists five deprecated or replaced packages;
this removes all of them, keeping the observable behaviour identical.

- crypto-js -> crypto-es. Upstream discontinued crypto-js; crypto-es is its
  maintained ESM/TypeScript successor and is byte for byte compatible, which
  the characterization tests added in the previous commit verify: the same
  1012 assertions pass before and after the swap, including the OpenSSL
  salted ciphertexts of the encryption tool. It ships its own types, so
  @types/crypto-js goes away too.
- plausible-tracker -> @plausible-analytics/tracker, the official replacement.
  The app keeps providing the same 'plausible' injection shape, so nothing
  downstream changes. apiHost maps onto the new endpoint option and keeps
  posting to the very same url, trackLocalhost onto captureOnLocalhost, and
  the pageviews that enableAutoPageviews() used to start are now captured by
  init() itself. init() throws without a domain, unlike the old tracker, so
  an enabled but domain-less config now falls back to the no-op instance
  instead of breaking the app bootstrap.
- svg2png-wasm -> @resvg/resvg-wasm, the replacement named in its deprecation
  notice. The renderer moves into a service covered by tests that rasterize
  real svg content, and the 2 MB binary no longer has to be committed under
  public/: vite emits it from the package as a hashed asset, so it can never
  drift from the js glue on upgrade.
- @types/bcryptjs and @types/uuid are deprecated stubs, bcryptjs and uuid
  having shipped their own types for a while.

Also drops the now dead renovate rules that only existed to keep uuid and
@types/uuid in lockstep, and fixes the tool metadata a new guard test caught:
the encryption tool advertised 'crypto-s' and the wysiwyg editor still
advertised monaco and prettier.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mf5V2jMpFFXxGVXZU5rHBq

* test: pin that svg text is actually drawn, document the load bearing empty iv

The resvg swap is pixel identical to svg2png-wasm for shapes and gradients,
and it also fixes text that names the embedded Roboto family: svg2png-wasm
returned an empty canvas there, so the assertion guards a real improvement
rather than only the image dimensions.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mf5V2jMpFFXxGVXZU5rHBq

* fix: address review feedback on the plugin and renderer initialization

Two of the review comments are real regressions against the behaviour the
replaced packages had, so both are fixed with a test that fails without the fix:

- The plausible plugin called init() on every install. init() throws on the
  second call, so installing the plugin on a second app instance (tests, hot
  reload) would have taken the app down, where the old tracker was happy to be
  constructed repeatedly. The tracker is now initialized once and reused. The
  api host also gets its trailing slash trimmed so the endpoint cannot end up
  with a double slash.
- initializeSvgRenderer() memoized the initialization promise including its
  rejections, so one failed wasm download left the tool broken until a page
  reload. The old code only latched its flag after a successful load. A failed
  attempt is no longer cached.

Also extends the tool metadata guard to the removed stub type packages, and
pins the negative counters that verifyHOTP walks through when the window is
wider than the counter: their hexadecimal form keeps the minus sign, which the
hex parser reads as ffffffff rather than rejecting, and crypto-es reproduces
that exactly.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mf5V2jMpFFXxGVXZU5rHBq

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-08-15 21:52:48 +02:00
Sebastian 8b7bc0a650 fix(docker): run on read-only filesystems, IPv6-less hosts and cpu-limited containers (#556)
Five fixes to the Docker image, found while running it-tools on
OpenShift, where containers run as an arbitrary UID. No application code
is changed.

Start on a read-only filesystem. `docker run --read-only` and Kubernetes
readOnlyRootFilesystem crash-loop the container, because
20-envsubst-on-templates.sh checks its output directory with
`[ ! -w $dir ]`. That only reads permission bits, so a read-only mount
passes the check, the write fails with EROFS and `set -e` stops the
entrypoint. 19-skip-envsubst-if-readonly.envsh now tests the directory
with a real write and, on failure, points NGINX_ENVSUBST_TEMPLATE_DIR at
a missing path so the envsubst script exits early. That is only safe if
the config in the image is already correct, and today it is nginx's
stock welcome config, so the Dockerfile renders the template at build
time as well. Writable setups are unchanged: the write test passes,
nothing is exported and the config is rendered at startup as before, so
a custom $PORT still works.

Skip IPv6 when the host has none. nginx.conf always listens on IPv6, so
where IPv6 is off nginx fails with `socket() [::]:8080 failed (97:
Address family not supported by protocol)`.
25-remove-ipv6-listen-if-unavailable.sh comments those lines out, using
the same /proc/net/if_inet6 check as nginx's own
10-listen-on-ipv6-by-default.sh, and exits at once when IPv6 works. It
probes the directory before editing, because `sed -i` rewrites through a
temporary file there, so a writable file in a read-only directory is not
enough, and it tolerates a failed edit so it can never stop the
entrypoint.

Match workers to the cpu limit. `worker_processes auto` counts the
host's cores, not the container's cpu limit, so the image starts 256
workers on a 256-core host in any container size. `docker run -m 192m`
is enough to be OOM-killed at startup. Setting
NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE enables the script nginx
already ships. Containers without a cpu limit keep one worker per core.
This is the only change that affects a deployment that works today.

Return 404 for missing assets. All paths fall back to index.html, so a
missing build file returns 200 and text/html, and the browser reports a
confusing MIME error instead of a 404. /assets/ now skips the SPA
fallback. Sub-folder requests such as /it-tools/assets/... still match
`location /`, so those deployments do not change.

Stop remapping js. nginx.conf includes mime.types, which already maps
js, then maps it again, so every startup logs a duplicate extension
warning. mime.types has no entry for mjs, so mjs stays and js goes.

Signed-off-by: Sebastian Danielsson <sebastian.danielsson@proton.me>
2026-08-14 19:22:10 +02:00
woshidadi2026 69f508442c Optimize the Chinese translationUpdate zh.yml (#549) 2026-08-11 13:04:00 +02:00
sharevb c82794af62 Update FUNDING.yml to include Buy Me a Coffee 2026-08-07 11:10:07 +02:00
Patrice De Saint Steban 07102a6128 Fix French translations in fr.yml (#551)
* Fix French translations in fr.yml

* Refine French translations in fr.yml

Updated various French translations for clarity and accuracy.
2026-08-07 10:39:23 +02:00
LuoXingchen 04cfee6f3e feat: add i18n internationalization for memo and cheatsheet (#552)
* feat(git-memo): add i18n support and Chinese translation

- Dynamically load locale-specific markdown content
- Add comprehensive Chinese translation for git memo
- Apply theme-aware styles for tables and links

* feat(git-semantic-commit-memo): add i18n support and table styling

Load memo markdown dynamically based on locale, add Chinese translation, and apply theme-aware styles for tables and links.

* feat(jq-memo): add i18n support and Chinese memo

Support multiple languages for the jq memo tool by dynamically loading locale-specific markdown files based on the current i18n locale, and add the Chinese translation (jq.zh.md).

* feat(jsonpath-memo): add i18n support for memo component

Dynamically load localized markdown files based on the current locale, falling back to the default English memo.

* feat(markdown-cheatsheet): add i18n support with Chinese content

Load locale-specific memo content dynamically using glob import and provide the Chinese translation for the Markdown cheatsheet.

* style(markdown-cheatsheet): add table and link styling

Add borders, padding, and collapse for tables, and set link color using theme variables.

* feat(nano-memo): add i18n support and table/link styling

- Dynamically load locale-specific content markdown based on the current language
- Add Chinese translation content file
- Apply theme-aware border and link colors for tables and links

* feat(nginx-memo): add i18n support and styling improvements

- dynamically load localized content based on current locale
- add Chinese (zh) translation for nginx memo
- add table and link styling using theme variables
- fallback to default content if localized version is missing

* feat(powershell-memo): add i18n support and Chinese translation

Load localized Markdown content based on the current locale, falling back to the default English version. Include the complete Chinese translation file.

* feat(sed-memo): add i18n support and zh docs

* feat(tmux-memo): add i18n support and Chinese translation

- Dynamically load locale-specific markdown content
- Add Chinese translation (tmux-memo.content.zh.md)
- Fall back to default content if locale file not found

* feat(vim-memo): add i18n support and zh content

- Implement dynamic locale-based content loading
- Add comprehensive Chinese translation file
- Update styles for tables and links using theme variables

* feat(xpath-memo): support locale-based markdown loading

Load the appropriate markdown file based on the current i18n locale, falling back to the default when a localized version is not available.

* feat(zellij-memo): add i18n support for memo content

Load locale-specific markdown files dynamically based on the current language setting, falling back to the default when a translation is unavailable.

* feat(chmod-memo): add i18n support and Chinese docs

- load locale-specific markdown via dynamic imports
- add chmod.zh.md with detailed Chinese documentation
- fall back to default chmod.md if no locale match

* feat(screen-memo): add i18n support with Chinese translation

Add dynamic locale-based markdown loading for the Screen Memo tool
and include the complete Chinese (zh) translation.

* feat(regex-memo): add i18n support with Chinese translation

Load locale-specific markdown content dynamically based on the selected language.
2026-08-07 10:29:59 +02:00
Julien Deveaux db3a344568 feat: mermaid live preview (#548) 2026-08-01 09:11:05 +02:00
Erich SchroeterandErich Schroeter 671e8a11c7 feat(new tool): Markdown Format Converter (#488)
Fix #485
---------

Co-authored-by: Erich Schroeter <erich.schroeter@gmail.com>
2026-07-31 17:32:00 +02:00
renovate[bot] 9bc3cb74b5 chore(deps): update dependency @playwright/test to ^1.62.0 (#511)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-31 17:24:56 +02:00
LuoXingchen db9ac4e729 feat(k8s-memo): add i18n support for memo content (#546) 2026-07-31 17:19:23 +02:00
LuoXingchen bc12798327 feat(common-regex-memo): add i18n support for memo content (#547) 2026-07-31 17:18:10 +02:00
ShareVB e725356eee i18n: translate remaining
and translate units
Fix #484
2026-07-28 16:30:07 +02:00
ShareVB 6e89d3dd03 feat: add warning about need of external self hosted for related tools
Fix #489
2026-07-28 16:30:06 +02:00
woshidadi2026 27ab891343 Optimize Chinese translation (#487)
Fix #484
2026-07-27 21:26:12 +02:00
ShareVB e5a2017f7d fix(i18n): tool search in current language and handle switching
Fix #486
2026-07-27 13:59:21 +02:00
ShareVB be4d22587f fix(Code Block Copyable): enable lineWrapping
Fix #482
2026-07-26 17:24:21 +02:00
ShareVB 66e2ac5df2 fix(Units Converter): make units translatable
Fix part of #484
2026-07-26 10:55:55 +02:00
ShareVB fb6cc731f5 fix(Units Converter): ensure label fits
Fix #490
2026-07-26 10:28:40 +02:00
ShareVB 38643233a3 fix(Regex Tester): navigation bug due to shaddowroot
Fix #491
2026-07-26 10:27:02 +02:00
SebastianandClaude Opus 4.8 f1358d55b4 fix(layout): prevent horizontal page overflow with wide code content (#483)
Large inputs (e.g. a 64KB JSON pasted into the JSON prettify tool) pushed
all tool content off-screen. The mobile UX overhaul (#474) switched the app
to document-level scrolling (overflow: visible, no nested scroll container),
which exposed that the .content flex column has the default min-width: auto
and refuses to shrink below its content's min-content width. A long,
non-wrapping code line therefore stretched the whole column past the
viewport instead of scrolling inside the viewer.

Set min-width: 0 on the .content flex child so the column shrinks to the
available width and the inner scrollers (n-scrollbar / CodeMirror) handle
horizontal overflow as intended.


Claude-Session: https://claude.ai/code/session_016ujGA3EmSyT39H7awrRuCS

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 14:00:17 +02:00
LuoXingchen c105c1ec17 Translate another docker cheatsheets to zh-cn (#479)
* feat(docker-compose-memo): add Chinese translation and refactor locale-based memo loading

- Add docker-compose.zh.md with full Chinese translation
- Refactor docker-compose-memo.vue to dynamically load memo by current locale
- Update bash-memo.vue fallback to generic bash-memo.content.md
- Remove obsolete bash-memo.content.en.md

* feat: 添加 CSS 选择器和 Docker Swarm 的中文翻译,优化动态加载功能

* 添加 Docker 和 Dockerfile 的中文翻译,优化动态加载功能
2026-07-19 21:23:41 +02:00
ShareVB 2abda9b71e doc: add a docker compose sample with all related services 2026-07-19 21:19:26 +02:00
ShareVB 65955d9b33 feat: useNetworkUtilsConfig and basic auth for all tools requiring external docker services 2026-07-19 20:58:32 +02:00
ShareVB b1d3849f87 feat(Math OCR): replace MathJAX by Katex 2026-07-14 18:44:09 +02:00
ShareVB c4f7ded565 feat: add Cross Origin Isolation (HTTP Headers) 2026-07-14 18:44:09 +02:00
ShareVB db32bb0835 fix: allows cross origin isolation for tools with img and iframe 2026-07-14 18:42:34 +02:00
renovate[bot] db050b2617 chore(deps): update type packages with their dependencies (#452)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-14 01:16:21 +00:00
ShareVB 96a2079283 feat(Sitemap): add HOSTNAME env var to generate a sitemap
Fix #476
2026-07-13 23:16:40 +02:00
Erich SchroeterandErich Schroeter a2d696168a feat: Integer Base Converter space separator support (#481)
Fix #480

Co-authored-by: Erich Schroeter <erich.schroeter@gmail.com>
2026-07-13 23:04:29 +02:00
ShareVB e1de52bdf3 fix(i18n): some text
FIx #477
2026-07-13 21:41:31 +02:00
ShareVB 23dc0d4046 chore: update deps 2026-07-12 23:11:48 +02:00
ShareVB bbc819f28c i18n: translate remaining 2026-07-12 23:09:43 +02:00
ShareVB aa515d96f3 feat(new tool): Ping
Fix #1760
2026-07-12 23:09:42 +02:00
ShareVBand@DeepSpace2 175c860ec8 fix(Dockerfile): Add source label to Dockerfile
Fix #475

Co-authored-by: @DeepSpace2
2026-07-12 21:12:53 +02:00
ShareVB fe2766e554 fix(Cron Expression Generator): handle input cron and standard only 2026-07-12 17:48:17 +02:00
ShareVB 0620f57691 feat(IBAN Validator and Parser): add bank infos
Fix #1421
2026-07-12 16:58:02 +02:00
ShareVB 03099a149b chore(version): release 2026.07.11 2026-07-12 00:24:09 +02:00
ShareVB 2a310b499f docs(changelog): update changelog for 2026.07.11 2026-07-12 00:24:09 +02:00
ShareVB 9ab81ab28d fix(Release): needs lodash for now 2026-07-12 00:23:57 +02:00
ShareVB d1c51da6e0 i18n: add Hindi 2026-07-12 00:19:53 +02:00
ShareVB aa2674af35 i18n: translate remaining 2026-07-12 00:19:37 +02:00
ShareVB b788aaf03f i18n: extract strings 2026-07-11 23:34:55 +02:00
SebastianandClaude Fable 5 239c69ee40 feat: mobile UX overhaul, theme flash prevention and build cleanup (#474)
* feat: mobile UX overhaul, theme flash prevention and build cleanup

UI/UX (mostly mobile):
- Prevent white flash on load: pre-paint inline style + script in
  index.html applies the persisted theme before first paint.
- Match browser chrome to the app background: theme-color meta kept in
  sync for Android/older iOS, and body background pinned to the Layout
  color for Safari 26+, which ignores theme-color and samples the page.
- Make the document the app's scroller instead of n-layout's nested
  container: single scrollbar, native iOS tap-status-bar-to-scroll-top,
  natural toolbar collapsing; desktop sider becomes sticky and router
  scrollBehavior restores/resets scroll on navigation.
- Full-width mobile menu that fades in under an always-visible sticky
  top bar, seamless app background without the hero gradient, closes on
  navigation (including About while already on /about), scroll-locked
  behind, symmetric spacing around the title block and icon row.
- Language selector and theme toggle become icon dropdowns; theme
  supports System/Light/Dark via useColorMode (same storage as before).
- Route-change loading spinner scoped to the page area so the nav bar
  stays visible; spinner remains cosmetic-only (350ms delay).
- Halve content padding on small screens; reduce home top padding.
- Full-width expand/collapse tools button so its width doesn't jump.
- No sticky hover styles on touch devices (hover gated behind
  @media (hover: hover)).

Build:
- Rename deprecated rolldown output.advancedChunks to codeSplitting.
- Fix unocss 'unmatched utility' warnings in the pretty-scrollbar
  shortcut; override js-sha256 to 0.11.x (drops eval); bump
  javascript-obfuscator to 5.4.6.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TNayL5ianBBucVapfkM8CC

* Remove unnecessary comment

* Refresh lockfile, remove releaseage ignore

Signed-off-by: Sebastian Danielsson <sebastian.danielsson@proton.me>

* chore: remove unused LocaleSelector component

Language selection moved into the NavbarButtons dropdown; nothing
references this component anymore. Its i18n keys are left in place.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TNayL5ianBBucVapfkM8CC

---------

Signed-off-by: Sebastian Danielsson <sebastian.danielsson@proton.me>
Co-authored-by: Claude <noreply@anthropic.com>
2026-07-11 23:21:34 +02:00
ShareVB 74604235ad feat(Base64 String Converter): handle text encoding other than utf8
Fix #1777
2026-07-11 23:16:12 +02:00
ShareVB dfa836b7d4 feat(new tool): Keyboard Tester 2026-07-11 23:14:36 +02:00
ShareVB b016d34c2d feat(new tool): Cron Expression Generator 2026-07-11 21:55:43 +02:00
ShareVBand@stevenlee87 37cc92faf9 feat(new tool): DNS/RDAP queries
Co-authored-by: @stevenlee87
2026-07-11 17:42:06 +02:00
ShareVBand@stevenlee87 45ed4a7aed feat(new tool): CSS/JS Prettify & Minify
Co-authored-by: @stevenlee87
2026-07-11 17:41:31 +02:00
ShareVB 02df0f3e98 feat(new tool): Markdown Diff
Fix #1804
Co-authored-by: nimza <maz.webfreelance@gmail.com>
2026-07-11 17:17:30 +02:00
ShareVB 8b19bf00c3 feat(Token Generator): add ambigous chars exclusion by default
Fix #1800
2026-07-11 16:52:53 +02:00
ShareVBandRahul Somasundaram b662c6b356 feat(new tool): Markdown Preview
Co-authored-by: Rahul Somasundaram <rahulstsgr@gmail.com>
2026-07-11 16:52:53 +02:00
ShareVB 81149949b7 feat(new tool): Markdown Table Generator
With paste as markdown capabilities
Fix #542
Co-authored-by:  ssdwgg <1982549567@qq.com>
2026-07-11 16:52:53 +02:00
ShareVB d041556f9f feat(new tool): nmap Command Builder 2026-07-10 22:37:25 +02:00
ShareVB 8ecdf990d2 feat(new tool): k6 Generator 2026-07-10 22:30:59 +02:00
ShareVB 6f93cd19c1 feat(new tool): JSON Patch Tools
Fix #1776
2026-07-10 21:55:11 +02:00
ShareVB 00584bd549 feat(Docker Compose to .env): add updated Docker compose
Fix #1828
2026-07-09 23:31:30 +02:00
LuoXingchen 14bfc21b0a feat(docker-compose-memo): add Chinese translation and refactor locale-based memo loading (#421)
- Add docker-compose.zh.md with full Chinese translation
- Refactor docker-compose-memo.vue to dynamically load memo by current locale
2026-07-09 23:06:03 +02:00
ShareVB 329bf35a9d fix(Bash Cheatsheet): fix default to en 2026-07-09 23:05:16 +02:00
ShareVB 9302b8e0da feat(Case Converter): add Language specific Title Case
Fix #1831
2026-07-09 22:57:39 +02:00
SebastianandClaude Fable 5 bad27cfe39 perf: overhaul startup performance, dependencies and UI responsiveness (#419)
* perf(i18n): bundle only English eagerly, lazy-load other locales on demand

The entry bundle previously inlined all 19 locales (11 MB minified, 2.4 MB
gzip) via the virtual @intlify messages module. Now only en (plus tool-level
en files) is compiled into the entry; every other locale becomes its own lazy
chunk fetched the first time it is selected, with vue-i18n falling back to
English until the messages arrive.

VITE_AVAILABLE_LOCALES now filters the locales offered at runtime instead of
trimming the build; unlisted locale chunks are emitted but never fetched.

Also adds shims for *.yml default imports and @tabler/icons-vue per-icon
deep imports (used by the follow-up icon-loading commit).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKAJuYi4dP1mwsjPi4v5Ea

* perf(tools): load tool icons lazily and parallelize boot config fetches

The eager tool-metadata glob pulled ~460 static icon component modules into
the entry graph. Tool definitions now reference their icon via
defineAsyncComponent + per-icon dynamic import, and an advancedChunks group
merges all of them into a single lazy 'tool-icons' chunk fetched off the
critical path when the menu/home first renders. Exact same glyphs as before.

Entry-graph components (navbar, layouts, ToolCard, copy buttons, command
palette, home) switch from runtime icon packages to build-time-inlined
~icons/tabler imports so no static reference drags the icon chunk into the
entry bundle.

src/tools/index.ts also fetched tools-filter.json and external-tools.json
sequentially under top-level await, blocking first render on two serial
round-trips; they are now fetched in parallel.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKAJuYi4dP1mwsjPi4v5Ea

* perf(pwa): precache only the app shell, cache chunks and wasm on demand

The service worker precached every JS chunk and WASM binary — 1,679 files,
~162 MB — on first visit, saturating bandwidth while the page was trying to
become interactive. Precache is now limited to the shell (css/html) with
CacheFirst runtime caching for same-origin hashed scripts, workers and wasm,
so offline support covers everything the user has actually opened.

VITE_PWA_FULL_PRECACHE=true restores the previous cache-everything behavior
for self-hosted full-offline deployments.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKAJuYi4dP1mwsjPi4v5Ea

* perf(menu): eliminate layout thrash in sider and category animations

The sider show/hide animates CSS width, which re-laid-out all ~460 menu
items plus the page content on every frame; category expand/collapse
animates grid-template-rows with the same cost. Two changes cut the
per-frame work:

- content-visibility: auto on each category container so offscreen
  categories skip layout and paint entirely during animations
- the sider scroll content is pinned to the expanded width, so the width
  transition clips the menu instead of re-wrapping every item per frame

Measured with the Long Animation Frames API (dev mode, full hide+show
cycle): 4 long frames totalling ~395 ms before, 2 totalling ~236 ms after;
animation frames after the initial commit now stay under 50 ms.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKAJuYi4dP1mwsjPi4v5Ea

* perf(deps): replace moment with date-fns in countdown and alarm tools

moment was only used by three tools, each pulling its ~70 KB gzip bundle
into their chunks while date-fns (already a dependency) covers the same
needs tree-shaken. Also fixes a latent bug: moment's mutating add()/set()
modified the shared 'now' ref on every computed evaluation, so the deadline
could drift by one duration per re-render; date-fns operations are
immutable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKAJuYi4dP1mwsjPi4v5Ea

* perf(deps): replace lodash with es-toolkit

Full CJS lodash (~70 KB gzip, no tree-shaking) was in the entry graph via
the tools store and shared composables, plus four lodash.* micro-packages.
es-toolkit provides the same functions as tree-shakeable ESM:

- import _ from 'lodash' -> import * as _ from 'es-toolkit/compat'
  (namespace member access tree-shakes under Rolldown)
- the 20 _.chain pipelines are rewritten as plain array/object operations
  or es-toolkit calls (es-toolkit has no chain, deliberately)
- lodash.defaultsdeep/flattendeep/last/mergewith micro-packages replaced
  with es-toolkit core/compat equivalents
- lodash's RecursiveArray type is declared locally in generate-tree.ts
- files whose only lodash use was inside a rewritten chain lose the
  dependency entirely

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKAJuYi4dP1mwsjPi4v5Ea

* fix: catch lodash usages the codemod missed (.js/.tsx files, bare _() wrapper)

outputFormatter.js and diff-viewer.models.tsx were outside the codemod's
*.ts/*.vue glob, and otp.service.ts used the implicit-chain _(...) wrapper
form that the _. usage regex didn't match (its import was wrongly removed).
Both builds still passed because pnpm's hoisted store made 'lodash'
resolvable even after removal from package.json.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKAJuYi4dP1mwsjPi4v5Ea

* perf(boot): drop the splash screen and parallelize the settings fetch

The splash screen existed to cover a multi-second blank period while the old
13 MB entry bundle parsed; with the startup payload at ~3 MB the app shell
paints fast enough to render directly (measurements in the PR description).
Removes vite-plugin-splash-screen entirely.

tools-settings.json was fetched under top-level await in main.ts, serially
after the config fetches in src/tools/index.ts. It now lives in a sibling
async module so all three optional config fetches share one round-trip.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKAJuYi4dP1mwsjPi4v5Ea

* fix: defer preload-error reload so it cannot abort an in-flight navigation

Firefox fires vite:preloadError for module preloads cancelled by a user
navigation (NS_BINDING_ABORTED), and the immediate location.reload() raced
and aborted that navigation. With the tool icons now loading via dynamic
imports there are ~460 preloads in flight at startup, which made the race
deterministic in the date-time-converter Playwright specs on firefox.

Deferring the reload by a tick resolves it: if the page is genuinely
navigating away its timers die with the document; on a real chunk-load
failure the reload still happens.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKAJuYi4dP1mwsjPi4v5Ea

* fix(types): satisfy the vitest tsconfig typecheck

pnpm typecheck runs vue-tsc against tsconfig.vitest.json, which lacks the
unplugin-vue-i18n type shim and infers stricter unions:

- tools/index.ts: type the fetch fallbacks so Promise.all doesn't widen
  filterConfig to 'ToolsFilter | {}'
- i18n.plugin.ts: collapse es-toolkit merge's recursive mapped type before
  it reaches vue-i18n's generics (TS2589), watch the locale through the
  getter, and cast the messages record
- generate-tree.ts: drop flattenDeep/RecursiveArray for a plain spread —
  child output is already joined strings, so there was only one level to
  flatten

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKAJuYi4dP1mwsjPi4v5Ea

* perf(bundle): cut startup payload from ~1 MB to ~560 KB gzip

Four eager-loading leaks accounted for almost half the startup JS:

- Font Awesome (298 KB gzip): main.ts registered the entire solid icon set
  via library.add(fas) although only the pomodoro timer uses it. The six
  icons it needs are now registered inside the tool's lazy chunk.
- tool-icons chunk (67 KB gzip): rolldown's advancedChunks defaults to
  includeDependenciesRecursively, which captured shared helpers into the
  icon chunk and made entry chunks statically depend on it, dragging the
  whole lazy icon set back into the startup payload. Disabled per-group.
- markdown-it + entities + dompurify (~50 KB gzip): eagerly reachable via
  three paths — the external-tools mapping in tools/index.ts (now a
  conditional dynamic import), vue-markdown-render in tool.layout.vue and
  Home.custom.vue (now defineAsyncComponent).
- demo gallery routes: registered behind a runtime env check the bundler
  cannot eliminate; now a conditional dynamic import gated on
  import.meta.env.DEV so production builds drop it entirely.

Startup JS: 3.2 MB -> 1.92 MB raw, ~1.05 MB -> 562 KB gzip.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKAJuYi4dP1mwsjPi4v5Ea

* fix(lint): drop redundant spread flagged by oxlint

Object.values already returns a fresh array, so it can be pushed into
directly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKAJuYi4dP1mwsjPi4v5Ea

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 22:46:19 +02:00
63f011b071 Upgrade toolchain: Vite 8, Vue 3.5, Vitest 4, TypeScript 6, pnpm 11, Node 24; replace ESLint/Prettier with oxlint/oxfmt (#418)
* chore: upgrade toolchain to Vite 8, Vue 3.5, Vitest 4, TypeScript 6 and pnpm 11; adopt oxlint/oxfmt

- vite 4 -> 8.1.3 (rolldown-based: build.rollupOptions -> rolldownOptions,
  drop optimizeDeps.esbuildOptions), @vitejs/plugin-vue 4 -> 6, plugin-vue-jsx 3 -> 5
- vue 3.3 -> 3.5.39, vue-tsc 1.8 -> 3.3.6, vitest 0.34 -> 4.1.9, jsdom 22 -> 29
- typescript 5.2 -> 6.0.3 with moduleResolution=bundler (baseUrl/node10 are
  hard errors in TS 6, removed in TS 7); TS 7 RC not adoptable: its native
  tsc lacks the JS compiler API vue-tsc needs (vuejs/language-tools#5381)
- unocss 0.57 -> 66 (presetUno -> presetWind3), unplugin-* to current majors
  (unplugin-vue-components dtsTsx disabled: emits invalid declarations for
  dotted component names)
- @vueuse/head 1.0.0 -> 1.3.1 (1.0.0 silently stopped applying page titles
  under Vue 3.5)
- replace ESLint (@antfu config) + Prettier with oxlint + oxfmt; configs
  mirror the previous style rules. Existing files are intentionally NOT
  mass-reformatted (oxfmt has no brace-style/operator-position options to
  match the old @antfu style) — only files with real changes are formatted
- pnpm 9 -> 11.10.0: settings move to pnpm-workspace.yaml, fresh lockfile
  passing supply-chain policies, explicit allowBuilds decisions,
  blockExoticSubdeps off (xlsx CDN override patches vulnerable npm 0.18.5)
- isolated-vm (17 MB) and onnxruntime-node (208 MB) stubbed via overrides:
  native-only transitives already aliased to an empty module for the bundle
- elliptic overridden to npm ^6.6.1 (github fork tarball of
  webcrypto-liner-shim unreachable from the build environment)
- CI: node 22 -> 24, all actions pinned to latest patch releases, automatic
  Vercel workflows disabled (fork deploys via Vercel Git integration),
  vercel.json: git.deploymentEnabled removed, buildCommand skips no-op vue-tsc
- Dockerfile: node:24-alpine, pnpm@11, ship pnpm-workspace.yaml and stubs

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1

* fix: resolve type, lint and runtime issues from the toolchain upgrade

vue-tsc 3 checks templates far more strictly than 1.8 and TS 5.7+ made
Uint8Array generic over its backing buffer. Widen shared component props
(InputCopyable, c-table, c-input-text, UnitsConverter), convert values at
call sites, fix invalid local .d.ts declarations, and repair issues the
new tooling exposed:

- WireGuard generator: pre-shared-keys checkbox used v-model:value which
  never binds on a standalone n-checkbox (now v-model:checked)
- mask-closable="false" string attrs became real boolean bindings in
  countdown/cron-alarm/time-alarm
- v-model casts (x as any) fail to compile under plugin-vue 6 + rolldown;
  replaced with :value/@update:value split bindings
- invalid '::ffff::' IPv6 literal in ipv6registry.json, exposed by stricter
  parsing in cidr-tools 11.3 (IPv4-mapped range never matched)
- fanger pinned to 0.3.1 (0.3.2 published without dist/)
- countries-and-timezones namespace imports, Vitest 4 snapshot format,
  invalid ul-inside-p HTML in dead-pixel, test assertion outside it() block

vue-tsc clean; oxlint clean; vitest 665/665; vite build + PWA OK;
Playwright e2e 100/100; all 457 tool routes render without errors

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1

* chore: drop whole-tree oxfmt from precommit instructions

The tree deliberately keeps its existing @antfu-era formatting; running
'pnpm fmt' (oxfmt over all of src) would reformat ~800 untouched files.
Format only the files you change, or run 'pnpm fmt' in a dedicated PR.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1

* fix: escape backslashes before dots in parquet column keys

CodeQL flagged incomplete string escaping (js/incomplete-sanitization):
escaping '.' to '\.' without first escaping existing backslashes makes
column names containing backslashes ambiguous in naive-ui's nested-key
syntax. Escape backslashes first.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1

* test: allow 30s for initial mermaid render in e2e

mermaid is a large lazy-loaded chunk; webkit on cold CI runners exceeds
Playwright's default 5s expect timeout even across retries.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1

* refactor: replace 'as any' input type casts with proper typings

Copilot review on the upstream PR flagged the casts. c-input-text
renders any non-password type as a text input, so widen its type union
to include 'url' instead of casting; for naive-ui's NInput use the
documented input-props to set the native input's type=number.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1
(cherry picked from commit 906820336b271aa6d96ecb11efa03219bf869475)

* fix: reconcile lockfile with upstream sync; repair date-picker typing in Docker Label Generator

- fold upstream's new CodeMirror/picomatch dependencies into the pnpm 11
  lockfile; add @lezer/highlight to optimizeDeps (kept from upstream)
- dockerfile-label-generator: n-date-picker emits a number timestamp,
  not a Date — calling toISOString() on it would throw at runtime the
  moment a date was picked. Type as number and convert via new Date()
- drop stray tsconfig.vite-config.tsbuildinfo build artifact; ignore
  *.tsbuildinfo

vue-tsc clean; oxlint clean; vitest 665/665; vite build OK

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1

* chore: keep upstream Vercel CLI deployment setup

The fork-specific Vercel changes (Git-integration deploys, disabled CLI
workflows, build:vercel command) are excluded from the upstream
contribution; upstream deploys via its own Vercel CLI workflows.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1
(cherry picked from commit ed182ec55648358556343e60e1667129acdbb966)

* fix: escape backslashes in Docker label values; raise global e2e expect timeout

- dockerfile-label-generator escaped quotes without escaping existing
  backslashes first (CodeQL js/incomplete-sanitization, same class as
  the parquets-reader fix): a value ending in a backslash would break
  the generated LABEL quoting
- playwright: 15s global expect timeout — first paint of heavy lazy
  chunks exceeds the 5s default on slow CI browsers (webkit), which
  intermittently failed title assertions across retries

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6deEDJXFzgDzPiYPAcsv1
(cherry picked from commit 5b3822e10113a49bc519661a5b01ad62660d56a9)

* Update .gitignore to include specific file types

* Add stats.html to .gitignore

* Delete tsconfig.vite-config.tsbuildinfo

* Delete stats.html

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: sharevb <sharevb@gmail.com>
2026-07-06 18:29:27 +02:00
ShareVB 3c76776e2c feat: add a viewer for JSON/XML and other languages with folding to many tools
Fix #394
2026-07-05 18:07:17 +02:00
ShareVB d544bf2b3a feat(new tool): Picomatch tester 2026-07-05 16:16:26 +02:00
ShareVB 218ae7a862 feat(new tool): Docker Label Generator 2026-07-05 15:48:08 +02:00
ShareVB fe2a1be194 feat(Color Converter): add oklab/oklch and lab as CSS
Fix #1798
2026-07-05 13:51:22 +02:00
ShareVB 2a4fcc6e4d feat(new tools): HTML/Markdown to data
Fix #416
2026-07-05 12:45:09 +02:00
ShareVB be6a951e43 feat(Case Converter): allow multiline
Fix #1826
2026-07-05 10:10:46 +02:00
ShareVB 652ac8234d feat(new tool): SAML Parser
Fix #1801
2026-07-05 00:35:17 +02:00
ShareVB 040d659055 feat(new tool): URL Builder
Fix #401
2026-07-05 00:35:17 +02:00
ShareVB 816dc55db7 doc(readme): add build memory requirements
Fix #417
2026-07-05 00:35:17 +02:00
fred-head 93d50560de Add resolver dropdown to dns tester (#410)
* Add resolver dropdown to dns tester
* Added custom DNS resolver option
2026-07-04 18:56:04 +02:00
LuoXingchen be4cf74210 Add Chinese translation for bash memo and enhance dynamic loading in … (#408)
- Created a new markdown file for bash memo in Chinese (bash-memo.content.zh.md) containing various bash commands and shortcuts.
- Updated the Vue component to dynamically load the appropriate markdown content based on the selected locale using Vue I18n.
- Implemented a watcher to reload the memo content when the locale changes, ensuring the correct language is displayed.
2026-07-04 18:54:17 +02:00
fred-head b6f8cb0546 feat: hide network utils config when tools settings url is set (#411) 2026-07-04 14:39:19 +02:00
Chris Tran 5efbb87ea5 feat(new tool): Crop Image (#404)
* Add crop-image tool

Introduce a new Crop Image tool: adds an interactive Vue cropper component (src/tools/crop-image/crop-image.vue) with drag/drop upload, viewport cropping, zoom, rotation, horizontal/vertical flip, aspect-ratio presets/custom ratio, rule-of-thirds grid, background color, and export options (PNG/JPEG/WebP, quality and width modes). Also adds tool registration (src/tools/crop-image/index.ts), a placeholder service (crop-image.service.ts), a Vitest unit test (crop-image.service.test.ts) and a Playwright e2e spec stub (crop-image.e2e.spec.ts).
2026-06-25 08:40:36 +02:00
oleole39 a510e5005c fix unit in placeholder (#414) 2026-06-25 08:39:17 +02:00
Parth Agarwal 0889c1324f fix(script): Update set_node_mem.sh to work in MacOS (#405) 2026-06-25 08:31:40 +02:00
Lucas Vilela 9ff69dc69f jwt-parser - show full date with timezone for date claims (#412) 2026-06-25 08:26:40 +02:00
ShareVB 93d4318884 feat(new tool): Running Pace Calculator
Fix #400 (and #413)
2026-06-23 23:18:38 +02:00
ShareVB 464e005afd fix(Certificate Key Parser): option to add missing BEGIN/END
Fix #1799
2026-06-23 23:13:30 +02:00
ShareVB 521a957640 fix(Open graph meta generator): display subtypes (for Music...) 2026-06-23 23:13:30 +02:00
ShareVB 9bbff46317 fix(Open Graph Metadata Generator): fix missing translation keys
Fix #409
2026-06-20 18:46:33 +02:00
ShareVB 7e979b37e7 chore: add rollup-plugin-visualizer 2026-06-20 18:42:10 +02:00
ShareVB bce809a5cc feat(Image to SVG): intégration de esm-potrace-wasm et VTracer pour le mode couleur
Fix #391
2026-06-20 17:54:57 +02:00
Ишутин Олег eaea6e9fd5 fix(Fitness Computer): Change arguments order to fix wrong BMI calculation (#407) 2026-06-13 20:57:06 +02:00
ShareVB 102bb9926e fix(Data Storage Units Converter): fix b/iB/B conversion
Fix #398
2026-05-28 09:33:36 +02:00
ShareVB dfb92f2441 fix(Speed Converter): wrong m/h is in fact mi/h (miles)
Fix #399
2026-05-28 09:10:11 +02:00
ShareVB fb8a1eb5b1 fix(Amortization Calculator): exclude historical currencies
Fix #396
2026-05-24 23:02:41 +02:00
Shaquille_Oatmeal c5a93af9cc docs: enhance Docker cheat sheet (#397)
- Fix --no-cache flag and dockerd command
- Remove escaped underscores from placeholders
- Add Volumes, Networks, Compose, and Cleanup sections
- Add common flags reference table
2026-05-22 17:08:39 +02:00
ShareVB 3b7ddb4b8f fix: optimize Home loading
Fix part of #330
2026-05-17 16:17:04 +02:00
ShareVB d5f4dcb91c fixup! fix: node-forge patch for EcDSA 2026-05-16 16:14:22 +02:00
ShareVB 1a664fe096 feat(new tool): HTTPS Tester
Add HTTPS test tools (certificate, HSTS, 302 rewrite)

Fix #345
2026-05-16 15:53:44 +02:00
ShareVB 5fd2bb66f3 feat(new tool): Powershell Memo
Fix #1793
2026-05-16 15:47:55 +02:00
ShareVB 4100059b3a feat(new tool): DNS Propagation Tester
Fix #346
2026-05-16 15:47:55 +02:00
ShareVB d8787317a4 feat(new tool): DNS Tester
DNS Queries, Reverse DNS Queries, DNSSec test, AXFR test and Whois queries
2026-05-16 15:47:55 +02:00
ShareVB 23ede48549 feat(x509 Certificate Generator): add options for RSA bits 2026-05-11 13:59:16 +02:00
ShareVB 6cc1ad7e98 fix: node-forge patch for EcDSA
Fix #1792
2026-05-11 13:47:00 +02:00
ShareVB 7e9cf35c28 fix(Geo Coordinates Converter): fix marker display
Fix #392
2026-05-11 12:42:28 +02:00
Brian Baidalandsharevb 89975dc505 feat(new tool): Random Line Picker (#393)
Adds a new Random Line Picker tool to pick one or more random lines from user-provided text. It's a handy utility for quickly selecting random items (winners, samples, shuffled lists) inside the app.

Co-authored-by: sharevb <sharevb@gmail.com>
2026-05-11 00:28:20 +02:00
ShareVB f0e35b09ee feat(Geo Coordinates Converter): add DMS/Decimal/UTM and a interactive map
Fix #392
2026-05-11 00:11:03 +02:00
ShareVB 905de13a84 fix: remove HTTP Headers security as this broke many tools 2026-05-10 23:38:06 +02:00
ShareVB efd0b2513a i18n: translate remaining 2026-05-03 22:19:13 +02:00
ShareVB 4103bd7e6e i18n: extract more strings 2026-05-03 21:59:05 +02:00
ShareVB 92bf2b5bd7 fix(Pdf Signature Checker): not supported certificate 2026-05-03 21:48:30 +02:00
ShareVB 04c2575ab6 feat(UUID Generator): Case and hyphen options
Fix #373
2026-05-03 20:54:00 +02:00
hakimilgandShareVB b05e70d6d8 feat(new tool): JSON to .env converter (#349)
Converts a flat JSON object into a .env file. Keys are upper-cased,
values are safely quoted when they contain whitespace, quotes, or env
special characters (#, $, `, \). Nested objects and arrays are
JSON-stringified and always quoted; null/undefined become "".

Follows the existing FormatTransformer pattern used by the other
json-to-* converters, including i18n via useI18n and the built-in
.env download button.

Co-authored-by: ShareVB <sharevb@gmail.com>
2026-05-03 19:21:46 +02:00
ShareVB f7f82a57d6 chore: update dependencies 2026-05-03 19:20:25 +02:00
1620 changed files with 239455 additions and 40769 deletions

No files matched your search

-294
View File
@@ -1,294 +0,0 @@
{
"globals": {
"Component": true,
"ComponentPublicInstance": true,
"ComputedRef": true,
"EffectScope": true,
"InjectionKey": true,
"PropType": true,
"Ref": true,
"VNode": true,
"asyncComputed": true,
"autoResetRef": true,
"computed": true,
"computedAsync": true,
"computedEager": true,
"computedInject": true,
"computedWithControl": true,
"controlledComputed": true,
"controlledRef": true,
"createApp": true,
"createEventHook": true,
"createGlobalState": true,
"createInjectionState": true,
"createReactiveFn": true,
"createReusableTemplate": true,
"createSharedComposable": true,
"createTemplatePromise": true,
"createUnrefFn": true,
"customRef": true,
"debouncedRef": true,
"debouncedWatch": true,
"defineAsyncComponent": true,
"defineComponent": true,
"eagerComputed": true,
"effectScope": true,
"extendRef": true,
"getCurrentInstance": true,
"getCurrentScope": true,
"h": true,
"ignorableWatch": true,
"inject": true,
"injectLocal": true,
"isDefined": true,
"isProxy": true,
"isReactive": true,
"isReadonly": true,
"isRef": true,
"makeDestructurable": true,
"markRaw": true,
"nextTick": true,
"onActivated": true,
"onBeforeMount": true,
"onBeforeRouteLeave": true,
"onBeforeRouteUpdate": true,
"onBeforeUnmount": true,
"onBeforeUpdate": true,
"onClickOutside": true,
"onDeactivated": true,
"onErrorCaptured": true,
"onKeyStroke": true,
"onLongPress": true,
"onMounted": true,
"onRenderTracked": true,
"onRenderTriggered": true,
"onScopeDispose": true,
"onServerPrefetch": true,
"onStartTyping": true,
"onUnmounted": true,
"onUpdated": true,
"pausableWatch": true,
"provide": true,
"provideLocal": true,
"reactify": true,
"reactifyObject": true,
"reactive": true,
"reactiveComputed": true,
"reactiveOmit": true,
"reactivePick": true,
"readonly": true,
"ref": true,
"refAutoReset": true,
"refDebounced": true,
"refDefault": true,
"refThrottled": true,
"refWithControl": true,
"resolveComponent": true,
"resolveRef": true,
"resolveUnref": true,
"shallowReactive": true,
"shallowReadonly": true,
"shallowRef": true,
"syncRef": true,
"syncRefs": true,
"templateRef": true,
"throttledRef": true,
"throttledWatch": true,
"toRaw": true,
"toReactive": true,
"toRef": true,
"toRefs": true,
"toValue": true,
"triggerRef": true,
"tryOnBeforeMount": true,
"tryOnBeforeUnmount": true,
"tryOnMounted": true,
"tryOnScopeDispose": true,
"tryOnUnmounted": true,
"unref": true,
"unrefElement": true,
"until": true,
"useActiveElement": true,
"useAnimate": true,
"useArrayDifference": true,
"useArrayEvery": true,
"useArrayFilter": true,
"useArrayFind": true,
"useArrayFindIndex": true,
"useArrayFindLast": true,
"useArrayIncludes": true,
"useArrayJoin": true,
"useArrayMap": true,
"useArrayReduce": true,
"useArraySome": true,
"useArrayUnique": true,
"useAsyncQueue": true,
"useAsyncState": true,
"useAttrs": true,
"useBase64": true,
"useBattery": true,
"useBluetooth": true,
"useBreakpoints": true,
"useBroadcastChannel": true,
"useBrowserLocation": true,
"useCached": true,
"useClipboard": true,
"useClipboardItems": true,
"useCloned": true,
"useColorMode": true,
"useConfirmDialog": true,
"useCounter": true,
"useCssModule": true,
"useCssVar": true,
"useCssVars": true,
"useCurrentElement": true,
"useCycleList": true,
"useDark": true,
"useDateFormat": true,
"useDebounce": true,
"useDebounceFn": true,
"useDebouncedRefHistory": true,
"useDeviceMotion": true,
"useDeviceOrientation": true,
"useDevicePixelRatio": true,
"useDevicesList": true,
"useDialog": true,
"useDisplayMedia": true,
"useDocumentVisibility": true,
"useDraggable": true,
"useDropZone": true,
"useElementBounding": true,
"useElementByPoint": true,
"useElementHover": true,
"useElementSize": true,
"useElementVisibility": true,
"useEventBus": true,
"useEventListener": true,
"useEventSource": true,
"useEyeDropper": true,
"useFavicon": true,
"useFetch": true,
"useFileDialog": true,
"useFileSystemAccess": true,
"useFocus": true,
"useFocusWithin": true,
"useFps": true,
"useFullscreen": true,
"useGamepad": true,
"useGeolocation": true,
"useI18n": true,
"useIdle": true,
"useImage": true,
"useInfiniteScroll": true,
"useIntersectionObserver": true,
"useInterval": true,
"useIntervalFn": true,
"useKeyModifier": true,
"useLastChanged": true,
"useLink": true,
"useLoadingBar": true,
"useLocalStorage": true,
"useMagicKeys": true,
"useManualRefHistory": true,
"useMediaControls": true,
"useMediaQuery": true,
"useMemoize": true,
"useMemory": true,
"useMessage": true,
"useMounted": true,
"useMouse": true,
"useMouseInElement": true,
"useMousePressed": true,
"useMutationObserver": true,
"useNavigatorLanguage": true,
"useNetwork": true,
"useNotification": true,
"useNow": true,
"useObjectUrl": true,
"useOffsetPagination": true,
"useOnline": true,
"usePageLeave": true,
"useParallax": true,
"useParentElement": true,
"usePerformanceObserver": true,
"usePermission": true,
"usePointer": true,
"usePointerLock": true,
"usePointerSwipe": true,
"usePreferredColorScheme": true,
"usePreferredContrast": true,
"usePreferredDark": true,
"usePreferredLanguages": true,
"usePreferredReducedMotion": true,
"usePrevious": true,
"useRafFn": true,
"useRefHistory": true,
"useResizeObserver": true,
"useRoute": true,
"useRouter": true,
"useScreenOrientation": true,
"useScreenSafeArea": true,
"useScriptTag": true,
"useScroll": true,
"useScrollLock": true,
"useSessionStorage": true,
"useShare": true,
"useSlots": true,
"useSorted": true,
"useSpeechRecognition": true,
"useSpeechSynthesis": true,
"useStepper": true,
"useStorage": true,
"useStorageAsync": true,
"useStyleTag": true,
"useSupported": true,
"useSwipe": true,
"useTemplateRefsList": true,
"useTextDirection": true,
"useTextSelection": true,
"useTextareaAutosize": true,
"useThrottle": true,
"useThrottleFn": true,
"useThrottledRefHistory": true,
"useTimeAgo": true,
"useTimeout": true,
"useTimeoutFn": true,
"useTimeoutPoll": true,
"useTimestamp": true,
"useTitle": true,
"useToNumber": true,
"useToString": true,
"useToggle": true,
"useTransition": true,
"useUrlSearchParams": true,
"useUserMedia": true,
"useVModel": true,
"useVModels": true,
"useVibrate": true,
"useVirtualList": true,
"useWakeLock": true,
"useWebNotification": true,
"useWebSocket": true,
"useWebWorker": true,
"useWebWorkerFn": true,
"useWindowFocus": true,
"useWindowScroll": true,
"useWindowSize": true,
"watch": true,
"watchArray": true,
"watchAtMost": true,
"watchDebounced": true,
"watchDeep": true,
"watchEffect": true,
"watchIgnorable": true,
"watchImmediate": true,
"watchOnce": true,
"watchPausable": true,
"watchPostEffect": true,
"watchSyncEffect": true,
"watchThrottled": true,
"watchTriggerable": true,
"watchWithFilter": true,
"whenever": true
}
}
-24
View File
@@ -1,24 +0,0 @@
/**
* @type {import('eslint').Linter.Config}
*/
module.exports = {
root: true,
extends: ['@antfu', './.eslintrc-auto-import.json', '@unocss'],
ignorePatterns: ['src/libs/*'],
rules: {
'curly': ['error', 'all'],
'@typescript-eslint/semi': ['error', 'always'],
'@typescript-eslint/no-use-before-define': ['error', { allowNamedExports: true, functions: false }],
'vue/no-empty-component-block': ['error'],
'import/order': 'off',
'no-restricted-imports': ['error', {
paths: [{
name: '@vueuse/core',
importNames: ['useClipboard'],
message: 'Please use local useCopy from src/composable/copy.ts instead of useClipboard.',
}],
}],
},
};
+2 -2
View File
@@ -1,2 +1,2 @@
github:
- sharevb
github: sharevb
buy_me_a_coffee: sharevb
@@ -22,5 +22,5 @@
- [ ] Submit the PR against the `chore/all-my-stuffs` branch.
- [ ] Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
- [ ] Provide a description, in PLAIN ENGLISH ONLY, in this PR that addresses **what** the PR is solving, or reference the issue that it solves (e.g. `fixes #123`).
- [ ] Run `pnpm install --ignore-scripts && pnpm lint --fix && pnpm typecheck` to ensure pnpm lock, eslint and typecheck are ok
- [ ] Run `pnpm install --ignore-scripts && pnpm lint:fix && pnpm typecheck` to ensure pnpm lock, oxlint (including type-aware rules) and vue-tsc are ok
- [ ] Ideally, include relevant tests that fail without this PR but pass with it.
+244
View File
@@ -0,0 +1,244 @@
---
name: Deploy
# Builds here and deploys the result to Vercel. The Git integration is off for this project
# (`git.deploymentEnabled: false` in vercel.json), so this workflow is what deploys it.
#
# chore/all-my-stuffs goes to production. Every pull request gets a preview, linked from the
# PR's "View deployment" button through the GitHub environment set on the job.
#
# Setup: VERCEL_TOKEN, VERCEL_ORG_ID and VERCEL_PROJECT_ID as secrets, on the repository or on
# the Production and Preview environments. Optionally the VERCEL_PRODUCTION_URL repository
# variable (e.g. https://it-tools.example.com/): production builds generate sitemap.xml and
# robots.txt for it, and without it they are left out.
#
# Replaces sharevb-vercel-preview.yml and sharevb-vercel-prod.yml, which deployed the same two
# targets without a concurrency group or a GitHub environment. One deployment per burst of
# pushes keeps Vercel's daily deployment and upload caps, and Deployment Storage, in check.
permissions:
contents: read
on:
push:
branches:
- chore/all-my-stuffs
pull_request:
workflow_dispatch:
concurrency:
# Per ref, cancelling in progress: pushing three times in a minute should cost one
# deployment, not three. Production is grouped per ref too, so a rapid merge sequence
# collapses the same way.
group: deploy-${{ github.ref }}
cancel-in-progress: true
jobs:
deploy:
# Same-repository events only. GitHub withholds secrets from `pull_request` runs on forks,
# so a fork would fail the credentials check on every push — and more to the point, this
# job runs the checked-out branch's build scripts with VERCEL_TOKEN in the environment.
# That is fine for branches in this repository, whose authors already have the secrets, and
# is not something to offer an arbitrary fork.
# Skip renovate[bot] too as it exceeds Vercel Free Plan limits.
if: >-
(
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository
) &&
github.actor != 'renovate[bot]'
runs-on: ubuntu-26.04-arm
timeout-minutes: 15
# Records a GitHub Deployment per run, which is what puts the Environments sidebar, the
# "deployed to Preview" PR timeline entry and its "View deployment" button back — the parts
# of the Vercel Git integration lost when building moved here. The names match the
# environments that integration created, so their history carries on. The condition has to
# be restated rather than read from the `target` step: the environment is fixed before any
# step runs. `url` is evaluated at the end, so it can use the deploy step's output.
environment:
name: >-
${{ github.ref == 'refs/heads/chore/all-my-stuffs' && github.event_name != 'pull_request'
&& 'Production' || 'Preview' }}
url: ${{ steps.deploy.outputs.url }}
permissions:
contents: read
steps:
- name: Fail early if the Vercel credentials are missing
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
run: |
set -euo pipefail
missing=""
for name in VERCEL_TOKEN VERCEL_ORG_ID VERCEL_PROJECT_ID; do
[ -z "${!name}" ] && missing="$missing $name"
done
if [ -n "$missing" ]; then
# Either place works, so name both rather than send anyone to the wrong settings
# page.
echo "::error::Missing secrets:$missing — set them on the repository (Settings > Secrets and variables > Actions) or on the Production and Preview environments (Settings > Environments). See .github/workflows/deploy.yaml"
exit 1
fi
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# On pull requests, the exact commit that triggered the run, not GitHub's detached
# merge commit: this builds the PR's own head, as Vercel's Git integration did.
# Pinned to the event's SHA rather than the branch name, so a push that lands while
# this run is queued, or a re-run of an old run, can't deploy a different commit
# under this run's deployment. Empty on push and workflow_dispatch, which keeps the
# default ref.
ref: ${{ github.event.pull_request.head.sha }}
# The Vercel CLI reads the deployment's branch and commit message from git. A detached
# checkout shows up in Vercel as branch "HEAD", so name the commit after the PR branch.
- name: Name the checked-out commit after the PR branch
if: github.event_name == 'pull_request'
env:
# From the environment, not interpolated: branch names can contain shell
# metacharacters.
HEAD_REF: ${{ github.head_ref }}
run: git checkout -B "$HEAD_REF"
- uses: pnpm/setup@fbda4c85fc2e1e08721cd8763afea8f48d60f024 # v3.0.0
with:
cache: true
- name: Install Vercel CLI
# Into a scratch directory outside the repository, not globally: `pnpm add --global`
# needs a global bin directory that `pnpm/setup` does not configure, and it failed
# immediately on the first run with the secrets in place. Installing here also keeps
# package.json and the lockfile untouched, so the tree the build sees is the tree that
# was committed.
#
# Pinned: an unpinned CLI changes how this workflow builds and deploys with no commit
# here to explain it.
run: |
set -euo pipefail
mkdir -p "$RUNNER_TEMP/vercel-cli"
cd "$RUNNER_TEMP/vercel-cli"
pnpm init >/dev/null
# Build approvals as config rather than --allow-build flags, matching how the
# repository declares its own. This directory is outside the repository so it
# inherits nothing; both packages that run install scripts are named here. esbuild
# is the one that actually needs it — a transitive dependency of the CLI whose
# postinstall links its native binary.
#
# minimumReleaseAge is deliberately not set: pnpm's built-in default is already
# 1440 minutes, so restating it would only create a second place to keep in sync.
printf 'allowBuilds:\n vercel: true\n esbuild: true\n' > pnpm-workspace.yaml
pnpm add vercel@60.1.3
echo "$RUNNER_TEMP/vercel-cli/node_modules/.bin" >> "$GITHUB_PATH"
# Environment is decided once and reused, so the pull, the build and the deploy cannot
# disagree about which one they are targeting.
- name: Resolve target environment
id: target
env:
# Read from the environment, not interpolated into the script. workflow_dispatch can
# run on any branch, and a branch name containing shell metacharacters would
# otherwise be pasted straight into this `if` as source.
REF: ${{ github.ref }}
EVENT: ${{ github.event_name }}
PRODUCTION_URL: ${{ vars.VERCEL_PRODUCTION_URL }}
run: |
set -euo pipefail
if [ "$REF" = "refs/heads/chore/all-my-stuffs" ] && [ "$EVENT" != "pull_request" ]; then
{
echo "environment=production"
echo "prod_flag=--prod"
echo "hostname=$PRODUCTION_URL"
} >> "$GITHUB_OUTPUT"
else
{
echo "environment=preview"
echo "prod_flag="
# No sitemap or robots.txt for previews: they would advertise the preview URL.
echo "hostname="
} >> "$GITHUB_OUTPUT"
fi
- name: Pull Vercel project settings
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
run: |
set -euo pipefail
# The link is written out rather than left to the CLI to infer from environment
# variables. Relying on VERCEL_ORG_ID/VERCEL_PROJECT_ID alone failed here with
# "Could not retrieve Project Settings", and which variables a given CLI version
# honours is not something to guess at from a workflow. This file is exactly what
# `vercel link` produces, so the CLI has nothing left to work out.
mkdir -p .vercel
# printf rather than a heredoc: a heredoc's terminator has to sit at column zero,
# which it cannot inside an indented YAML block, and %s keeps the ids out of the
# shell's word splitting.
printf '{"projectId":"%s","orgId":"%s"}\n' "$VERCEL_PROJECT_ID" "$VERCEL_ORG_ID" \
> .vercel/project.json
# Shape only — the ids are secrets and are not printed.
python3 -c "import json;d=json.load(open('.vercel/project.json'));print('link written, keys:', sorted(d))"
vercel pull --yes \
--environment="${{ steps.target.outputs.environment }}" \
--token="$VERCEL_TOKEN"
- name: Build
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
# What sharevb-vercel-*.yml set, kept so the build is the same:
# VITE_VERCEL_ENV is the env label the app reports (src/config.ts), and
# VITE_VERCEL_DEPLOY turns off full PWA precaching (vite.config.ts).
VITE_VERCEL_ENV: ${{ steps.target.outputs.environment }}
VITE_VERCEL_DEPLOY: true
# HOSTNAME is what vite.config.ts generates sitemap.xml and robots.txt from, so it is
# set for production only, from the VERCEL_PRODUCTION_URL repository variable.
HOSTNAME: ${{ steps.target.outputs.hostname }}
run: |
set -euo pipefail
vercel build ${{ steps.target.outputs.prod_flag }} --token="$VERCEL_TOKEN"
# A build that produces nothing would otherwise deploy an empty site over a working
# one. Checked before anything is uploaded.
test -s .vercel/output/static/index.html || {
echo "::error::Build produced no .vercel/output/static/index.html — refusing to deploy"
exit 1
}
- name: Deploy
id: deploy
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
run: |
set -euo pipefail
# --archive=tgz uploads the output as one archive instead of file by file. The Hobby
# plan caps CLI uploads at 5000 files a day across the whole account
# ("api-upload-free"), and per-file uploads hit that after a busy
# day of deploys.
url=$(vercel deploy --prebuilt --archive=tgz ${{ steps.target.outputs.prod_flag }} --token="$VERCEL_TOKEN")
# `vercel deploy` prints the URL on stdout and progress on stderr, so this is the URL
# and nothing else. Empty means the deploy did not produce one, which is a failure
# even if the CLI exited 0.
[ -n "$url" ] || { echo "::error::Deploy returned no URL"; exit 1; }
echo "url=$url" >> "$GITHUB_OUTPUT"
echo "Deployed to $url"
- name: Summary
if: always()
env:
ENVIRONMENT: ${{ steps.target.outputs.environment }}
URL: ${{ steps.deploy.outputs.url }}
STATUS: ${{ job.status }}
run: |
{
echo "### Deploy"
echo ""
if [ "$STATUS" = "success" ]; then
echo "Deployed to **$ENVIRONMENT**: $URL"
else
echo "**Deploy failed.** See the failing step above."
fi
} >> "$GITHUB_STEP_SUMMARY"
+24 -21
View File
@@ -6,34 +6,37 @@ on:
branches:
- chore/all-my-stuffs
concurrency:
# A new push supersedes the previous run on the same ref, so a burst of pushes
# costs one run instead of one per push.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
runs-on: ubuntu-latest
runs-on: ubuntu-26.04-arm
steps:
- uses: actions/checkout@v6
- run: |
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
npm install -g corepack@latest
echo "After : corepack version => $(corepack --version)"
corepack enable
pnpm --version
- uses: actions/setup-node@v6
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup pnpm and install dependencies
uses: pnpm/setup@fbda4c85fc2e1e08721cd8763afea8f48d60f024 # v3.0.0
with:
node-version: 22
cache: 'pnpm'
cache: true
- name: Install dependencies
run: pnpm i --ignore-scripts
# The checks are independent of each other, so they share the runner
# instead of queueing behind one another. The build is the long pole.
- parallel:
- name: Check formatting
run: pnpm fmt:check
- name: Run linters
run: pnpm lint
- name: Run linters
run: pnpm lint
- name: Run unit test
run: pnpm test
- name: Run unit test
run: pnpm test:unit
- name: Type check
run: pnpm typecheck
- name: Type check
run: pnpm typecheck
- name: Build the app
run: pnpm build
- name: Build the app
run: pnpm build
@@ -21,7 +21,9 @@ on:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
# x64 on purpose: the x64 runner image ships the CodeQL bundle in its tool
# cache, the arm64 image does not, so arm would download it on every run.
runs-on: ubuntu-26.04
permissions:
actions: read
contents: read
@@ -37,11 +39,9 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v6
# Initializes the CodeQL tools for scanning.
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
uses: github/codeql-action/init@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -55,9 +55,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v4
# ℹ️ Command-line programs to run using the OS shell.
uses: github/codeql-action/autobuild@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
@@ -69,4 +67,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
uses: github/codeql-action/analyze@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2
@@ -10,12 +10,12 @@ on:
jobs:
check_date:
runs-on: ubuntu-latest
runs-on: ubuntu-26.04-arm
name: Check latest commit
outputs:
should_run: ${{ steps.should_run.outputs.should_run }}
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: print latest_commit
run: echo ${{ github.sha }}
@@ -26,44 +26,38 @@ jobs:
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false"
ci:
runs-on: ubuntu-latest
runs-on: ubuntu-26.04-arm
needs: check_date
if: ${{ needs.check_date.outputs.should_run != 'false' }}
steps:
- uses: actions/checkout@v6
- run: |
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
npm install -g corepack@latest
echo "After : corepack version => $(corepack --version)"
corepack enable
pnpm --version
- uses: actions/setup-node@v6
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup pnpm and install dependencies
uses: pnpm/setup@fbda4c85fc2e1e08721cd8763afea8f48d60f024 # v3.0.0
with:
node-version: 22
cache: 'pnpm'
- name: Install dependencies
run: pnpm i --ignore-scripts
cache: true
- name: Run linters
run: pnpm lint
- name: Run unit test
run: pnpm test
run: pnpm test:unit
- name: Type check
run: pnpm typecheck
- name: Build the app
run: pnpm build
build:
runs-on: ubuntu-latest
runs-on: ubuntu-26.04-arm
needs:
- ci
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v6
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
with:
images: sharevb/it-tools
labels: |
@@ -71,29 +65,29 @@ jobs:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Login to Docker Hub
uses: docker/login-action@v4
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
- name: Build and push
uses: docker/build-push-action@v7
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: .
file: ./Dockerfile
@@ -109,29 +103,19 @@ jobs:
run: docker logout ghcr.io
github-release:
runs-on: ubuntu-latest
runs-on: ubuntu-26.04-arm
needs: ci
steps:
- name: Set release version to nightly
run: echo "RELEASE_VERSION=nightly" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: |
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
npm install -g corepack@latest
echo "After : corepack version => $(corepack --version)"
corepack enable
pnpm --version
- uses: actions/setup-node@v6
- name: Setup pnpm and install dependencies
uses: pnpm/setup@fbda4c85fc2e1e08721cd8763afea8f48d60f024 # v3.0.0
with:
node-version: 22
cache: 'pnpm'
- name: Install dependencies
run: pnpm i --ignore-scripts
cache: true
- name: Build the app
run: pnpm build
@@ -148,7 +132,7 @@ jobs:
echo "$EOF" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v3
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: it-tools-${{ env.RELEASE_VERSION }}.zip
@@ -1,50 +1,42 @@
name: Build and Push Docker Image (baseurl-it-tools)
# Kept for the deployments already pulling the `baseurl-it-tools` tag. It is no longer a
# different build: BASE_URL is a runtime setting now, so this image is the same one as
# `latest` with the default moved to /it-tools/, and `latest` with `-e BASE_URL=/it-tools/`
# gets you exactly the same thing.
env:
VITE_VERCEL_ENV: production
# Runs after the ci workflow passes on a push to the default branch, rather than
# repeating its lint, tests, typecheck and build here: the image build compiles
# the app anyway, and ci is what decides whether this commit is fit to publish.
on:
push:
workflow_run:
workflows: [ci]
types: [completed]
branches:
- chore/all-my-stuffs
concurrency:
# One publish at a time, newest wins: without this, an older run that finishes
# last would overwrite the tags with an older commit. ci cancels its own
# superseded runs, so these runs arrive in commit order and cancelling the
# older one always leaves the newest commit published.
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: |
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
npm install -g corepack@latest
echo "After : corepack version => $(corepack --version)"
corepack enable
pnpm --version
- uses: actions/setup-node@v6
with:
node-version: 22
cache: 'pnpm'
- name: Install dependencies
run: pnpm i --ignore-scripts
- name: Run linters
run: pnpm lint
- name: Run unit tests
run: pnpm test
- name: Build the app
run: pnpm build
build:
runs-on: ubuntu-latest
needs:
- ci
# Only a successful ci run for a push; a pull request's run must never publish.
if: >-
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'push'
runs-on: ubuntu-26.04-arm
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v6
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
with:
images: sharevb/it-tools
labels: |
@@ -52,29 +44,32 @@ jobs:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# The commit ci tested, not whatever the branch points at by now.
ref: ${{ github.event.workflow_run.head_sha }}
- name: Login to Docker Hub
uses: docker/login-action@v4
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
- name: Build and push (BASE_URL)
uses: docker/build-push-action@v7
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: .
file: ./Dockerfile
@@ -3,51 +3,38 @@ name: Build and Push Docker Image (latest)
env:
VITE_VERCEL_ENV: production
# Runs after the ci workflow passes on a push to the default branch, rather than
# repeating its lint, tests, typecheck and build here: the image build compiles
# the app anyway, and ci is what decides whether this commit is fit to publish.
on:
push:
workflow_run:
workflows: [ci]
types: [completed]
branches:
- chore/all-my-stuffs
concurrency:
# One publish at a time, newest wins: without this, an older run that finishes
# last would overwrite the tags with an older commit. ci cancels its own
# superseded runs, so these runs arrive in commit order and cancelling the
# older one always leaves the newest commit published.
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: |
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
npm install -g corepack@latest
echo "After : corepack version => $(corepack --version)"
corepack enable
pnpm --version
- uses: actions/setup-node@v6
with:
node-version: 22
cache: 'pnpm'
- name: Install dependencies
run: pnpm i --ignore-scripts
- name: Run linters
run: pnpm lint
- name: Run unit tests
run: pnpm test
- name: Build the app
run: pnpm build
build:
runs-on: ubuntu-latest
needs:
- ci
# Only a successful ci run for a push; a pull request's run must never publish.
if: >-
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'push'
runs-on: ubuntu-26.04-arm
strategy:
matrix:
language: ['', 'en']
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v6
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
with:
images: sharevb/it-tools
labels: |
@@ -55,29 +42,32 @@ jobs:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# The commit ci tested, not whatever the branch points at by now.
ref: ${{ github.event.workflow_run.head_sha }}
- name: Login to Docker Hub
uses: docker/login-action@v4
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
- name: Build and push
uses: docker/build-push-action@v7
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: .
file: ./Dockerfile
+61 -30
View File
@@ -4,49 +4,80 @@ on:
push:
branches:
- chore/all-my-stuffs
concurrency:
# A new push supersedes the previous run on the same ref, so a burst of pushes
# costs one run instead of one per push.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
timeout-minutes: 120
runs-on: ubuntu-latest
strategy:
matrix:
shard: [1/3, 2/3, 3/3]
# Built once and shared: the build output is the same for every browser, so
# each test job downloads it instead of spending a minute rebuilding it.
build:
runs-on: ubuntu-26.04-arm
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: |
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
npm install -g corepack@latest
echo "After : corepack version => $(corepack --version)"
corepack enable
pnpm --version
- uses: actions/setup-node@v6
- name: Setup pnpm and install dependencies
uses: pnpm/setup@fbda4c85fc2e1e08721cd8763afea8f48d60f024 # v3.0.0
with:
node-version: 22
cache: 'pnpm'
- name: Get Playwright version
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=$(jq -r .dependencies.playwright package.json)" >> "$GITHUB_OUTPUT"
- name: Install dependencies
run: pnpm install --ignore-scripts
cache: true
- name: Build app
run: pnpm build
- name: Upload build output
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: dist
path: dist
if-no-files-found: error
retention-days: 1
test:
needs: build
name: test (${{ matrix.browser }})
timeout-minutes: 120
runs-on: ubuntu-26.04-arm
strategy:
# Always report every browser, rather than cancelling the rest on the
# first failure.
fail-fast: false
matrix:
browser: [chromium, firefox, webkit]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup pnpm and install dependencies
uses: pnpm/setup@fbda4c85fc2e1e08721cd8763afea8f48d60f024 # v3.0.0
with:
cache: true
- name: Get Playwright version
id: playwright-version
# The installed version, not the range in package.json: a lockfile bump
# inside the same range would otherwise leave the key unchanged and the
# cached browsers out of sync with Playwright.
run: echo "PLAYWRIGHT_VERSION=$(jq -r .version node_modules/@playwright/test/package.json)" >> "$GITHUB_OUTPUT"
- name: Download build output
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: dist
path: dist
- name: Restore Playwright browsers from cache
uses: actions/cache@v5
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }}-${{ hashFiles('**/playwright.config.ts') }}
key: ${{ runner.os }}-${{ runner.arch }}-playwright-${{ matrix.browser }}-${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }}-${{ hashFiles('**/playwright.config.ts') }}
restore-keys: |
${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }}-
${{ runner.os }}-playwright-
${{ runner.os }}-${{ runner.arch }}-playwright-${{ matrix.browser }}-${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }}-
${{ runner.os }}-${{ runner.arch }}-playwright-${{ matrix.browser }}-
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
run: pnpm exec playwright install --with-deps ${{ matrix.browser }}
- name: Run Playwright tests
run: pnpm run test:e2e --shard=${{ matrix.shard }}
run: pnpm run test:e2e --project=${{ matrix.browser }}
@@ -29,35 +29,34 @@ jobs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
runs-on: ubuntu-26.04-arm
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Node.js
uses: actions/setup-node@v6
- name: Setup pnpm and install dependencies
uses: pnpm/setup@fbda4c85fc2e1e08721cd8763afea8f48d60f024 # v3.0.0
with:
node-version: 22
cache: true
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 9
run_install: true
- name: Run linters
run: pnpm lint
- name: Type check
run: pnpm typecheck
- name: Build
run: |
BASE_URL="/it-tools/" pnpm build
cp dist/index.html dist/404.html
- name: Setup Pages
uses: actions/configure-pages@v6
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
- name: Upload artifact
uses: actions/upload-pages-artifact@v5
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: './dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
+20 -24
View File
@@ -10,11 +10,11 @@ on:
jobs:
docker-release:
runs-on: ubuntu-latest
runs-on: ubuntu-26.04-arm
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v6
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
with:
images: sharevb/it-tools
@@ -22,29 +22,29 @@ jobs:
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Login to Docker Hub
uses: docker/login-action@v4
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
- name: Build and push (BASE_URL)
uses: docker/build-push-action@v7
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: .
file: ./Dockerfile
@@ -62,7 +62,7 @@ jobs:
ghcr.io/sharevb/it-tools:${{ env.RELEASE_VERSION}}-baseurl-it-tools
- name: Build and push
uses: docker/build-push-action@v7
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: .
file: ./Dockerfile
@@ -78,29 +78,25 @@ jobs:
ghcr.io/sharevb/it-tools:${{ env.RELEASE_VERSION}}
github-release:
runs-on: ubuntu-latest
runs-on: ubuntu-26.04-arm
needs: docker-release
steps:
- name: Get release version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: |
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
npm install -g corepack@latest
echo "After : corepack version => $(corepack --version)"
corepack enable
pnpm --version
- uses: actions/setup-node@v6
- name: Setup pnpm and install dependencies
uses: pnpm/setup@fbda4c85fc2e1e08721cd8763afea8f48d60f024 # v3.0.0
with:
node-version: 22
cache: 'pnpm'
cache: true
- name: Install dependencies
run: pnpm i --ignore-scripts
- name: Run linters
run: pnpm lint
- name: Type check
run: pnpm typecheck
- name: Build the app
run: pnpm build
@@ -117,7 +113,7 @@ jobs:
echo "$EOF" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v3
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: it-tools-${{ env.RELEASE_VERSION }}.zip
@@ -1,24 +0,0 @@
name: Vercel Preview Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VITE_VERCEL_ENV: preview
VITE_VERCEL_DEPLOY: true
on:
push:
branches-ignore:
- chore/all-my-stuffs
pull_request:
jobs:
Deploy-Preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --archive=tgz --token=${{ secrets.VERCEL_TOKEN }}
-23
View File
@@ -1,23 +0,0 @@
name: Vercel Production Deployment
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VITE_VERCEL_ENV: production
VITE_VERCEL_DEPLOY: true
on:
push:
branches:
- chore/all-my-stuffs
jobs:
Deploy-Production:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --archive=tgz --prod --token=${{ secrets.VERCEL_TOKEN }}
+3 -1
View File
@@ -47,4 +47,6 @@ components.d.ts
!*.code-workspace
# Ignore build or packaged VS Code extensions
*.vsix
*.vsix
*.tsbuildinfo
stats.html
+1 -1
View File
@@ -1 +1 @@
22.19.0
24.19.0
-7
View File
@@ -1,7 +0,0 @@
{
"singleQuote": true,
"semi": true,
"tabWidth": 2,
"trailingComma": "all",
"printWidth": 120
}
+1 -1
View File
@@ -1,7 +1,7 @@
{
"recommendations": [
"Vue.volar",
"dbaeumer.vscode-eslint",
"oxc.oxc-vscode",
"lokalise.i18n-ally",
"ms-vscode-remote.remote-wsl"
]
+4 -3
View File
@@ -1,9 +1,10 @@
{
"editor.formatOnSave": false,
"editor.formatOnSave": true,
"editor.defaultFormatter": "oxc.oxc-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always",
"source.formatDocument": "always"
"source.fixAll.oxc": "always"
},
"oxc.fmt.experimental": true,
"i18n-ally.localesPaths": [
"locales",
"src/modules/i18n"
+212
View File
@@ -2,6 +2,218 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## Version 2026.10.25
### Features
- **json-viewer, yaml-viewer, currency-converter, geo-coordinates-converter**: support intranet mirrors (3af8e4a)
- **gitignore-generator, gitattributes-generator**: fall back to a bundled template snapshot (81c1201)
- **translator, remove-background, math-ocr, ocr-image, gif-to-mp4**: ship runtimes with the app (d53e745)
- **settings**: add an offline mode that hides internet-only tools (4a80283)
- **zpool-memo**: add localized content and recategorize (f196182)
### Bug fixes
- **dns-query, gitattributes-generator**: hide dns-query offline, pin commands to the snapshot (788d4fd)
- **explainshell, ocr-image**: honour the configured mirrors (8ec5590)
- **countdown, cron-alarm, time-alarm**: resolve Beep.mp3 against the app base (94c0bbf)
- **markdown-editor, unicode-formatter, pomodoro-timer**: bundle editor extensions and fonts (b536f04)
- **visualsubnetcalc, zpool-calc**: escape user data before inserting HTML (de40fc7)
- **scripts**: make extract-tools-desc quote matching linear (a891be1)
- **database-builder**: quote names and passwords in generated SQL (1b8d487)
- **random**: use crypto.getRandomValues for generated secrets (0203c23)
- **layout**: escape every bracket and paren in footer package links (d785329)
- **markdown**: escape backslashes in generated table cells (3872432)
- **json-viewer**: unescape JSON strings in a single pass (9b65547)
- **objgen**: comment detection and whitespace stripping (b688f52)
- **docker**: serve precompressed static assets (#583) (4e5c0fd)
### Refactoring
- **turndown**: remove text-node escape rules that never run (f1b20c7)
### Build system
- **deps**: add the assets offline mode ships, drop unused currency and ffmpeg helpers (ea30976)
### I18n
- add Traditional Chinese (zh-TW) locale (#587) (d6e478c)
- **en, zh**: describe bundled assets, mirrors and snapshots (6241fa6)
- **zh**: review the Simplified Chinese translation (#584) (bb00dcb)
- rewrite Italian locale with human-quality translations (#582) (3e7f845)
- update translations for iptables and fstab generator tools (cba443d)
### Documentation
- **readme**: document offline mode and the mirror settings (b64d2a1)
- **zpool-memo**: reformat vdev type table (e179bd5)
- **locales**: improve zh UFW generator translations (44f1298)
## Version 2026.09.27
### Features
- **Timezone Converter**: add POSIX string filterable list (7fc4b79)
- **JSON Editor**: store data and add an auto height option (0f4c7b1)
- **new tool**: Restic Command Generator (#573) (c96fd39)
- **Keys Generator**: add fingerprint (bc1d9a3)
- **new tool**: EPC QR Code Generator (c80a08b)
- **new tool**: URL Redirection Checker (0039bd7)
- **QRCode Generator**: add embeddable link and cropy dataurl (39c616f)
- **docker**: serve the app from any subpath with a runtime BASE_URL (#565) (0a1f5dc)
- add i18n internationalization for memo and cheatsheet (#552) (04cfee6)
- mermaid live preview (#548) (db3a344)
- **new tool**: Markdown Format Converter (#488) (671e8a1)
- **k8s-memo**: add i18n support for memo content (#546) (db9ac4e)
- **common-regex-memo**: add i18n support for memo content (#547) (bc12798)
- add warning about need of external self hosted for related tools (6e89d3d)
- useNetworkUtilsConfig and basic auth for all tools requiring external docker services (65955d9)
- **Math OCR**: replace MathJAX by Katex (b1d3849)
- add Cross Origin Isolation (HTTP Headers) (c4f7ded)
- **Sitemap**: add HOSTNAME env var to generate a sitemap (96a2079)
- Integer Base Converter space separator support (#481) (a2d6961)
- **new tool**: Ping (aa515d9)
- **IBAN Validator and Parser**: add bank infos (0620f57)
### Bug fixes
- c-link to vs href (62ab0bf)
- **deps**: move the two remaining deprecated direct dependencies onto supported versions (#559) (d39255a)
- **docker**: run on read-only filesystems, IPv6-less hosts and cpu-limited containers (#556) (8b7bc0a)
- **i18n**: tool search in current language and handle switching (e5a2017)
- **Code Block Copyable**: enable lineWrapping (be4d225)
- **Units Converter**: make units translatable (66e2ac5)
- **Units Converter**: ensure label fits (fb6cc73)
- **Regex Tester**: navigation bug due to shaddowroot (3864323)
- **layout**: prevent horizontal page overflow with wide code content (#483) (f1358d5)
- allows cross origin isolation for tools with img and iframe (db32bb0)
- **i18n**: some text (e1de52b)
- **Dockerfile**: Add source label to Dockerfile (175c860)
- **Cron Expression Generator**: handle input cron and standard only (fe2766e)
### Performance
- **bundle**: improve initial load + loading of tools (#575) (641fa85)
### Refactoring
- **websocket-tester**: use the native WebSocket instead of w-websocket-client (#558) (903ffb8)
### Continuous integration
- pnpm 12, pnpm/setup v3, faster and pinned CI, single Vercel deploy workflow (#577) (da38faa)
- rework the test and lint toolchain — per-browser E2E, scoped jsdom, type-aware oxlint (#561) (ec740dd)
- use pnpm/setup for pnpm and Node setup, pin Node in package.json (#560) (fbc7d47)
### Chores
- fix release script (51cb093)
- update deps (90b7793)
- remove fm:check ypass (a049d1c)
- global code formatting (bc44870)
- **deps**: replace the five deprecated packages from the dependency dashboard (#557) (5e4972e)
- **deps**: update dependency @playwright/test to ^1.62.0 (#511) (9bc3cb7)
- **deps**: update type packages with their dependencies (#452) (db050b2)
- update deps (23dc0d4)
### Other
- Restructure and enhance cheat sheets for improved readability (#566) (5bf94bc)
- add proxmox helper script (#568) (a5607e0)
- Enhance Docker Swarm documentation (#564) (002a211)
- Fix regex to clean base64 data URI (#563) (2912cf3)
- Optimize the Chinese translationUpdate zh.yml (#549) (69f5084)
- Update FUNDING.yml to include Buy Me a Coffee (c82794a)
- Fix French translations in fr.yml (#551) (07102a6)
- Optimize Chinese translation (#487) (27ab891)
- Translate another docker cheatsheets to zh-cn (#479) (c105c1e)
### I18n
- extract and translate remaining (6aa2e1c)
- translate remaining (e725356)
- translate remaining (bbc819f)
### Doc
- add a docker compose sample with all related services (2abda9b)
## Version 2026.07.11
### Features
- mobile UX overhaul, theme flash prevention and build cleanup (#474) (239c69e)
- **Base64 String Converter**: handle text encoding other than utf8 (7460423)
- **new tool**: Keyboard Tester (dfa836b)
- **new tool**: Cron Expression Generator (b016d34)
- **new tool**: DNS/RDAP queries (37cc92f)
- **new tool**: CSS/JS Prettify & Minify (45ed4a7)
- **new tool**: Markdown Diff (02df0f3)
- **Token Generator**: add ambigous chars exclusion by default (8b19bf0)
- **new tool**: Markdown Preview (b662c6b)
- **new tool**: Markdown Table Generator (8114994)
- **new tool**: nmap Command Builder (d041556)
- **new tool**: k6 Generator (8ecdf99)
- **new tool**: JSON Patch Tools (6f93cd1)
- **Docker Compose to .env**: add updated Docker compose (00584bd)
- **docker-compose-memo**: add Chinese translation and refactor locale-based memo loading (#421) (14bfc21)
- **Case Converter**: add Language specific Title Case (9302b8e)
- add a viewer for JSON/XML and other languages with folding to many tools (3c76776)
- **new tool**: Picomatch tester (d544bf2)
- **new tool**: Docker Label Generator (218ae7a)
- **Color Converter**: add oklab/oklch and lab as CSS (fe2a1be)
- **new tools**: HTML/Markdown to data (2a4fcc6)
- **Case Converter**: allow multiline (be6a951)
- **new tool**: SAML Parser (652ac82)
- **new tool**: URL Builder (040d659)
- hide network utils config when tools settings url is set (#411) (b6f8cb0)
- **new tool**: Crop Image (#404) (5efbb87)
- **new tool**: Running Pace Calculator (93d4318)
- **Image to SVG**: intégration de esm-potrace-wasm et VTracer pour le mode couleur (bce809a)
- **new tool**: HTTPS Tester (1a664fe)
- **new tool**: Powershell Memo (5fd2bb6)
- **new tool**: DNS Propagation Tester (4100059)
- **new tool**: DNS Tester (d878731)
- **x509 Certificate Generator**: add options for RSA bits (23ede48)
- **new tool**: Random Line Picker (#393) (89975dc)
- **Geo Coordinates Converter**: add DMS/Decimal/UTM and a interactive map (f0e35b0)
- **UUID Generator**: Case and hyphen options (04c2575)
- **new tool**: JSON to .env converter (#349) (b05e70d)
### Bug fixes
- **Release**: needs lodash for now (9ab81ab)
- **Bash Cheatsheet**: fix default to en (329bf35)
- **script**: Update set_node_mem.sh to work in MacOS (#405) (0889c13)
- **Certificate Key Parser**: option to add missing BEGIN/END (464e005)
- **Open graph meta generator**: display subtypes (for Music...) (521a957)
- **Open Graph Metadata Generator**: fix missing translation keys (9bbff46)
- **Fitness Computer**: Change arguments order to fix wrong BMI calculation (#407) (eaea6e9)
- **Data Storage Units Converter**: fix b/iB/B conversion (102bb99)
- **Speed Converter**: wrong m/h is in fact mi/h (miles) (dfb92f2)
- **Amortization Calculator**: exclude historical currencies (fb8a1eb)
- optimize Home loading (3b7ddb4)
- node-forge patch for EcDSA (6cc1ad7)
- **Geo Coordinates Converter**: fix marker display (7e9cf35)
- remove HTTP Headers security as this broke many tools (905de13)
- **Pdf Signature Checker**: not supported certificate (92bf2b5)
### Performance
- overhaul startup performance, dependencies and UI responsiveness (#419) (bad27cf)
### Chores
- add rollup-plugin-visualizer (7e979b3)
- update dependencies (f7f82a5)
### Other
- Add resolver dropdown to dns tester (#410) (93d5056)
- Add Chinese translation for bash memo and enhance dynamic loading in … (#408) (be4cf74)
- fix unit in placeholder (#414) (a510e50)
- jwt-parser - show full date with timezone for date claims (#412) (9ff69dc)
### I18n
- add Hindi (d1c51da)
- translate remaining (aa2674a)
- extract strings (b788aaf)
- translate remaining (efd0b25)
- extract more strings (4103bd7)
### Upgrade toolchain
- Vite 8, Vue 3.5, Vitest 4, TypeScript 6, pnpm 11, Node 24; replace ESLint/Prettier with oxlint/oxfmt (#418) (63f011b)
### Doc
- **readme**: add build memory requirements (816dc55)
### Documentation
- enhance Docker cheat sheet (#397) (c5a93af)
### Fixup! fix
- node-forge patch for EcDSA (d5f4dcb)
## Version 2026.01.04
### Features
+45 -8
View File
@@ -1,5 +1,5 @@
# build stage
FROM --platform=$BUILDPLATFORM node:lts-alpine AS build-stage
FROM --platform=$BUILDPLATFORM node:24-alpine@sha256:ebfe2f90462722a7a4de65e91990e97fe0d401c70e0e762c5b53302f905ec1c1 AS build-stage
# Set environment variables for non-interactive npm installs
ENV NPM_CONFIG_LOGLEVEL=warn
ENV CI=true
@@ -8,29 +8,66 @@ RUN apk add --update python3 make g++\
&& rm -rf /var/cache/apk/*
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN npm install -g pnpm && pnpm i --ignore-scripts --frozen-lockfile
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY patches patches
COPY stubs stubs
RUN npm install -g pnpm@12.6.0 && pnpm i --ignore-scripts --frozen-lockfile
COPY . .
ARG BASE_URL
ENV BASE_URL=${BASE_URL}
# Deliberately no BASE_URL here: the bundle is built path-agnostic (relative asset URLs
# plus a `<base href="/">` in index.html) so that one image can be served from any
# subpath. The path is a runtime setting instead -- see the BASE_URL environment variable
# on the production stage below.
ARG VITE_AVAILABLE_LOCALES
ENV VITE_AVAILABLE_LOCALES=${VITE_AVAILABLE_LOCALES}
ENV VITE_VERCEL_ENV=production
RUN pnpm build
# Precompress hashed assets once instead of compressing each response at runtime.
RUN pnpm build \
&& find dist/assets -type f \( -name '*.js' -o -name '*.mjs' -o -name '*.css' -o -name '*.wasm' \) \
-exec gzip -9 -n -k {} +
# production stage
FROM nginxinc/nginx-unprivileged:stable-alpine AS production-stage
FROM nginx/nginx-unprivileged:alpine AS production-stage
LABEL maintainer="ShareVB <sharevb@gmail.com>" \
org.opencontainers.image.authors="ShareVB <sharevb@gmail.com>"
LABEL org.opencontainers.image.source=github.com/sharevb/it-tools
ENV VITE_VERCEL_ENV=production
ARG BASE_URL
# The path the app is served under. Override it at run time -- `docker run -e
# BASE_URL=/it-tools/`, `environment: BASE_URL: /it-tools/` in a compose file -- and nginx
# rewrites the `<base href>` in index.html on the way out; nothing is baked in. The build
# arg only moves the default, for anyone who prefers to ship an image that is preconfigured
# for a subpath. See docker-entrypoint.d/18-resolve-base-url.envsh and nginx.conf.
ARG BASE_URL=/
ENV BASE_URL=${BASE_URL}
COPY --from=build-stage /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/templates/default.conf.template
COPY docker-entrypoint.d/ /docker-entrypoint.d/
ENV PORT=8080
# nginx defaults to `worker_processes auto`, which counts the host's cores and
# ignores the container's cpu limit. On a large host that is hundreds of
# workers in a small container: `docker run -m 192m` is enough to get the
# image OOM-killed on startup. Let the entrypoint size the pool from the cgroup
# cpu quota instead. Uncapped containers still get one worker per core.
ENV NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE=1
# Render the template once here as well. The entrypoint normally re-renders it
# at startup, so a custom $PORT keeps working, but it cannot do so on a
# read-only filesystem (see docker-entrypoint.d/19-skip-envsubst-if-readonly.envsh).
# Without this the image would fall back to the stock welcome config from the
# base image: no SPA fallback, so deep links 404 on refresh, and no COOP/COEP,
# so the WebAssembly-backed tools stop working.
# Sourcing the entrypoint's own resolver keeps the baked-in BASE_URL normalised and
# validated exactly the way a runtime one would be.
RUN . /docker-entrypoint.d/18-resolve-base-url.envsh \
&& envsubst '${PORT} ${BASE_URL} ${BASE_URL_REGEX} ${BASE_URL_NO_SLASH_REGEX}' \
< /etc/nginx/templates/default.conf.template \
> /etc/nginx/conf.d/default.conf
EXPOSE $PORT
CMD ["nginx", "-g", "daemon off;"]
+159 -33
View File
@@ -1,11 +1,28 @@
## BREAKING CHANGE for Container Image
Since the *base image* is now `nginx-unpriviledged` the container will now listen to port **8080** and not 80. So you need to update your port mapping, i.e. from `8080:80` to `8080:8080`.
Since the _base image_ is now `nginx-unpriviledged` the container will now listen to port **8080** and not 80. So you need to update your port mapping, i.e. from `8080:80` to `8080:8080`.
You can override listening port using environment variable `PORT` (docker option `-e PORT=8888`).
You can serve the app from a subfolder using environment variable `BASE_URL` (docker option
`-e BASE_URL=/it-tools/`), without rebuilding the image -- see
[Host in a subfolder](#host-in-a-subfolder-it-tools).
If the container needs to listen to IPv6, it needs to be enabled: https://serverfault.com/questions/1147296/how-to-enable-ipv6-on-ubuntu-20-04. Alternatively, you can mount your own `nginx.conf` own using docker option `-v "./nginx.conf:/etc/nginx/templates/default.conf.template"` (with `listen [::]:8080;` removed)
## Proxmox Install
Run the command below in the Proxmox VE Shell
```bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/alpine-it-tools.sh)"```
## Build requirements
**To build this project**, around **8GB** of RAM is enough. Measured on a 4-core
machine, `pnpm build` peaks at roughly 6.5GB of system memory and completes on
Node's default heap — most of the work happens inside rolldown, in Rust, rather
than on the JavaScript heap.
## PR Welcome
Especially for UI improvements and translation. And for anything else.
@@ -19,6 +36,7 @@ Some tools like PGP encryption rely on WebCrypto API that is only available in H
So even on internal installations, you should enable HTTPS using Let's Encrypt using DNS Challenge
Some docs about DNS Challenge:
- https://medium.com/@life-is-short-so-enjoy-it/homelab-nginx-proxy-manager-setup-ssl-certificate-with-domain-name-in-cloudflare-dns-732af64ddc0b
- https://doc.traefik.io/traefik/user-guides/docker-compose/acme-dns/
- https://medium.com/@svenvanginkel/traefik-letsencrypt-dns01-challenge-with-ovhcloud-52f2a2c6d08a
@@ -64,6 +82,12 @@ docker run --pull always --restart unless-stopped -p 8080:8080 sharevb/it-tools:
Other existing docker tags: `latest-en` (english only)
Container builds precompress JavaScript, CSS, and WebAssembly files in `dist/assets`.
Nginx serves the `.gz` sidecars when clients accept gzip, including requests forwarded
by reverse proxies, and otherwise serves the original files. Compression happens once
at build time rather than on every request. HTML remains uncompressed so runtime
`BASE_URL` rewriting continues to work.
## Use in Docker Compose file
```yml
@@ -97,12 +121,18 @@ WantedBy=multi-user.target default.target
Restart=always
```
## Use with companion Self Hosted docker services
Some tools requires additional docker services: HTTPS/DNS tools/Ping, HTML to PDF, Docker Image Download, Multi Links Download, Short Url Expander and TCP/UDP Port tester.
See complete example here: [docker-with-services](https://github.com/sharevb/it-tools/tree/chore/all-my-stuffs/docker-with-services)
## Filter tools and add home custom content
You can add custom content in Home page by mounting a `home.custom.md` in `/usr/share/nginx/html`.
You can filter available tools by mounting `tools-filter.json` in `/usr/share/nginx/html`. It can contains the following filtering regex:
```json
{
"excludeCategoryFilterRegex": "",
@@ -111,9 +141,10 @@ You can filter available tools by mounting `tools-filter.json` in `/usr/share/ng
"includeToolsFilterRegex": ""
}
```
Category matches on category (English) names ; Tools matches on tools path/url.
See [docker-tools-filter-and-home-content](https://github.com/sharevb/it-tools)
See [docker-tools-filter-and-home-content](https://github.com/sharevb/it-tools/tree/chore/all-my-stuffs/docker-tools-filter-and-home-content)
## Add custom external tools
@@ -140,13 +171,16 @@ You can add custom external tools (href or markdownContent) by mounting a `exter
]
```
See [docker-tools-filter-and-home-content](https://github.com/sharevb/it-tools)
See [docker-tools-filter-and-home-content](https://github.com/sharevb/it-tools/tree/chore/all-my-stuffs/docker-tools-filter-and-home-content)
## Setting default tools parameters / default UI language at runtime
For a complete sample, see [docker-with-services](https://github.com/sharevb/it-tools/tree/chore/all-my-stuffs/docker-with-services).
You can set default tool parameters by mounting a `tools-settings.json` in `/usr/share/nginx/html`.
It is a two level json, with the first level being for `tool name` and the second level for `parameter name`:
```json
{
"regex-tester": {
@@ -158,7 +192,9 @@ It is a two level json, with the first level being for `tool name` and the secon
```
You can find `tool name` and `parameter name` in the tools source code `src/tools` subfolder :
- example pattern for `const global = useQueryParamOrStorage({ storageName: 'regex-tester:g', name: 'global', defaultValue: true });`:
```json
{
"regex-tester": {
@@ -166,7 +202,9 @@ You can find `tool name` and `parameter name` in the tools source code `src/tool
}
}
```
- example pattern for `const value = useQueryParam({ tool: 'barcode-gen', name: 'text', defaultValue: '123456789' });`:
```json
{
"barcode-gen": {
@@ -174,7 +212,9 @@ You can find `tool name` and `parameter name` in the tools source code `src/tool
}
}
```
- example pattern for `const width = useITStorage('ascii-text-drawer:width', 80);`:
```json
{
"ascii-text-drawer": {
@@ -184,12 +224,52 @@ You can find `tool name` and `parameter name` in the tools source code `src/tool
```
To define the default UI language, add a `default_locale` key to json:
```json
{
"default_locale": "fr"
}
```
## Offline / air-gapped deployments
Fonts, editor extensions, the ffmpeg core, the ONNX runtime, the Tesseract OCR engine and its English and Simplified Chinese language data ship with the app, so these never come from a third-party CDN. The large ones are only downloaded when their tool is opened, and are left out of the PWA precache.
On a network without internet access, add `"offline": true` to `tools-settings.json`. Tools that only work with internet are then hidden (my-ip, ip-geo-location, dns-query, dns-queries, dnsbl-checker, dns-propagation-tester, online-wiktionary, iana-whois-checker), and tools with a bundled fallback switch to it:
- gitignore-generator and gitattributes-generator use a template snapshot bundled at build time (also used online when GitHub can't be reached). Refresh it with `pnpm script:update:git-templates`.
- ocr-image offers only the bundled languages.
- JSON/YAML schema validation offers only a custom schema (pasted, or a URL you enter).
- geo-coordinates-converter converts coordinates without showing a map.
Some tools work offline once you point them at an intranet mirror; without one, they are hidden in offline mode. The mirrors can also be used online:
```json
{
"offline": true,
"transformers": { "models-url": "https://intranet.example/hf-mirror/" },
"ocr-image": { "lang-url": "https://intranet.example/tessdata/" },
"json-schemas": { "catalog-url": "https://intranet.example/schemastore/api/json/catalog.json" },
"currency-converter": { "url": "https://intranet.example/currency-api/" },
"geo-coordinates-converter": {
"tile-url": "https://tiles.intranet.example/{z}/{x}/{y}.png",
"tile-attribution": "&copy; OpenStreetMap contributors"
},
"explainchain": { "url": "https://explainshell.intranet.example" }
}
```
| Setting | Used by | Expected content |
| --- | --- | --- |
| `transformers.models-url` | translator, remove-background, math-ocr | A mirror of the Hugging Face model repos with the same layout: `<url>/<org>/<model>/resolve/main/<file>`, e.g. `Xenova/opus-mt-en-fr/resolve/main/onnx/encoder_model_quantized.onnx`. Relative URLs resolve against the app. |
| `ocr-image.lang-url` | ocr-image | A directory of `<lang>.traineddata.gz` files (the `4.0.0_best_int` variant from the `@tesseract.js-data/<lang>` npm packages). The path may contain a `{lang}` placeholder, e.g. `https://intranet.example/npm/@tesseract.js-data/{lang}/4.0.0_best_int` for a mirror of jsDelivr. |
| `json-schemas.catalog-url` | json-viewer, yaml-viewer, json-editor, json-linter | A copy of the [SchemaStore](https://www.schemastore.org) catalog. The schema URLs listed in it must be reachable too. |
| `currency-converter.url` | currency-converter | A mirror of the `@fawazahmed0/currency-api` npm package, serving `v1/currencies/<code>.json`. |
| `geo-coordinates-converter.tile-url` | geo-coordinates-converter | A Leaflet tile URL template; `tile-attribution` is optional. |
| `explainchain.url` | explainshell | A self-hosted [explainshell](https://github.com/idank/explainshell). |
The tools that use the [companion self-hosted services](#use-with-companion-self-hosted-docker-services) stay available in offline mode and work against intranet targets.
## To build using a custom default language:
```
@@ -197,28 +277,39 @@ docker build -t it-tools-fr --build-arg VITE_LANGUAGE=fr .
docker run -d --name it-tools-fr --restart unless-stopped -p 8080:8080 it-tools-fr
```
## Build container image for a custom subfolder
## Host in a subfolder (`/it-tools/`)
According to https://github.com/sharevb/it-tools/pull/461#issuecomment-1602506049 and https://github.com/CorentinTh/it-tools/pull/461:
```
docker build -t it-tools --build-arg BASE_URL="/my-folder/" .
docker run -d --name it-tools --restart unless-stopped -p 8080:8080 it-tools
The container serves the app from whatever path you point `BASE_URL` at. Nothing is baked
into the image, so the regular `latest` image works for any subfolder -- no rebuild, no
subfolder-specific tag:
```yaml
services:
it-tools:
image: ghcr.io/sharevb/it-tools:latest
restart: unless-stopped
environment:
BASE_URL: /it-tools/
ports:
- 8080:8080
```
Then if you go to `http://localhost:8080` you'll get a blank page, but opening the DevTools (& refreshing) you'll notice in the Network tab that the app is trying to fetch assets from `/my-folder/...`
or `docker run -d --name it-tools -e BASE_URL=/it-tools/ -p 8080:8080 ghcr.io/sharevb/it-tools:latest`.
So you would need to put another server in front of it, like [Nginx Proxy Manager](https://nginxproxymanager.com/), [Traefik](https://traefik.io/traefik/), [caddy](https://caddyserver.com/) etc. Then setup a reverse proxy pass using `/my-folder`
`BASE_URL` accepts `it-tools`, `/it-tools` and `/it-tools/` alike; the default is `/`.
## Docker compose for hosting in a `/it-tools/` subfolder
You still want a reverse proxy in front -- [Nginx Proxy Manager](https://nginxproxymanager.com/),
[Traefik](https://traefik.io/traefik/), [caddy](https://caddyserver.com/) etc. -- passing
`/it-tools/` through to the container. It does not matter whether the proxy strips the
prefix before forwarding (`proxy_pass http://it-tools:8080/;`) or passes it on as-is
(`proxy_pass http://it-tools:8080;`): the container handles both.
For `/it-tools/` subfolder, you can use `baseurl-it-tools` tag.
See [sample of docker-compose.yml and nginx.conf](https://github.com/sharevb/it-tools/tree/chore/all-my-stuffs/docker-subfolder-sample), this docker image needs to have another reverse proxy in front of it, like [Nginx Proxy Manager](https://nginxproxymanager.com/), [Traefik](https://traefik.io/traefik/), [caddy](https://caddyserver.com/) etc.
Setup a reverse proxy pass using `/it-tools/`. And you should be able to access it-tools in `/it-tools/` of your server.
An example of nginx reverse proxy configuration is available at: https://github.com/sharevb/it-tools/tree/chore/all-my-stuffs/docker-subfolder-sample
One thing only the proxy can do, in the stripping setup: `/it-tools` without the trailing
slash never reaches the container, so redirect it there -- the sample's
`location /it-tools { return 301 /it-tools/; }`. When the prefix is forwarded instead, the
container does that redirect itself.
See the [sample docker-compose.yml and nginx.conf](https://github.com/sharevb/it-tools/tree/chore/all-my-stuffs/docker-subfolder-sample).
To run the sample:
```bash
@@ -227,7 +318,15 @@ cd it-tools/docker-subfolder-sample/
docker compose up
```
Then navigate to http://localhost:8080/it-tools/
Then navigate to http://localhost/it-tools/
Two things worth knowing:
- Building with `--build-arg BASE_URL=/it-tools/` still works, but it now only changes the
image's *default* -- the environment variable still wins at run time.
- On a read-only root filesystem the config template cannot be re-rendered at startup, so
`BASE_URL` (like `PORT`) has no effect unless `/etc/nginx/conf.d` is writable -- mount a
tmpfs or an emptyDir there. The container says so in its log.
## To build using a custom folder:
@@ -243,14 +342,15 @@ Then navigate to http://localhost:8080/it-tools/
Assuming you're already hosting it-tools behind a reverse proxy, you can configure forward-auth and enforce authentication from the reverse proxy
* [Official guides](https://docs.goauthentik.io/docs/add-secure-apps/providers/proxy/server_nginx) with nginx. Guides with other reverse proxy setups are available
* [Step-by-step setup guide with nginx-proxy-manager](https://geekscircuit.com/set-up-authentik-sso-with-nginx-proxy-manager/)
- [Official guides](https://docs.goauthentik.io/docs/add-secure-apps/providers/proxy/server_nginx) with nginx. Guides with other reverse proxy setups are available
- [Step-by-step setup guide with nginx-proxy-manager](https://geekscircuit.com/set-up-authentik-sso-with-nginx-proxy-manager/)
(thanks @jogerj)
## Deploy as LXC container
In Proxmox VE, you can use docker image directly:
```bash
sudo lxc-create -n sharevb-it-tools -t oci -- --url docker://ghcr.io/sharevb/it-tools:latest
```
@@ -265,16 +365,17 @@ To install VSCode in WSL2 (Windows), see: https://learn.microsoft.com/en-us/wind
- [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur)
- [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Oxc](https://marketplace.visualstudio.com/items?itemName=oxc.oxc-vscode) (oxlint + oxfmt)
- [i18n Ally](https://marketplace.visualstudio.com/items?itemName=lokalise.i18n-ally)
with the following settings:
```json
{
"editor.formatOnSave": false,
"editor.formatOnSave": true,
"editor.defaultFormatter": "oxc.oxc-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.oxc": "always"
},
"i18n-ally.localesPaths": ["locales", "src/tools/*/locales"],
"i18n-ally.keystyle": "nested"
@@ -313,21 +414,46 @@ pnpm build
### Run Unit Tests with [Vitest](https://vitest.dev/)
```sh
pnpm test
pnpm test:unit
```
### Lint with [ESLint](https://eslint.org/)
### Run End-to-End Tests with [Playwright](https://playwright.dev/)
Playwright starts `pnpm preview` itself, so build first:
```sh
pnpm build
pnpm test:e2e
```
To iterate against the dev server instead, leave `pnpm dev` running and point
the tests at it. Playwright then leaves the server alone:
```sh
E2E_BASE_URL=http://localhost:5173 pnpm test:e2e
```
The dev server compiles routes on demand, so a first run against a cold one can
blow past the assertion timeouts. Open the pages once, or just run it again.
### Lint with [Oxlint](https://oxc.rs/docs/guide/usage/linter)
```sh
pnpm lint
```
### Ensure CI (lock, eslint, typecheck) will succeed
### Format with [Oxfmt](https://oxc.rs/docs/guide/usage/formatter)
```sh
pnpm fmt
```
### Ensure CI (lock, oxlint, typecheck) will succeed
Before submitting a PR, run:
```sh
pnpm install --ignore-scripts && pnpm lint --fix && pnpm typecheck
pnpm install --ignore-scripts && pnpm lint:fix && pnpm typecheck
```
### Create a new tool
@@ -344,11 +470,11 @@ It will create a directory in `src/tools` with the correct files. You will need
Local installation required installing first: `python3 make g++`
| Container Image | Local Installation |
|-----------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|
| Container Image | Local Installation |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| GitHub Container Registry: <span title="triple click me!">`ghcr.io/sharevb/it-tools:latest`</span><br/>Docker Hub: <span title="triple click me!">`sharevb/it-tools:latest`</span> | <span title="triple click me!">`sudo apt-get install python3 make g++ && git clone -b chore/all-my-stuffs https://github.com/sharevb/it-tools.git && cd it-tools/ && pnpm i --ignore-scripts && pnpm dev`</span> |
| replace your current image with this image | copy & paste oneliner (from github repo) |
| You may need to clear cache and hard reload to get new features loading | Installing packages for the first time may take some time; please wait until it finishes |
| replace your current image with this image | copy & paste oneliner (from github repo) |
| You may need to clear cache and hard reload to get new features loading | Installing packages for the first time may take some time; please wait until it finishes |
<picture>
<source srcset="./.github/logo-dark.png" media="(prefers-color-scheme: light)">
@@ -358,4 +484,4 @@ Local installation required installing first: `python3 make g++`
## License
This project is under the [GNU GPLv3](LICENSE).
This project is under the [GNU GPLv3](LICENSE).
+302 -572
View File
@@ -1,301 +1,312 @@
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import
// biome-ignore lint: disable
export {}
declare global {
const EffectScope: typeof import('vue')['EffectScope']
const asyncComputed: typeof import('@vueuse/core')['asyncComputed']
const autoResetRef: typeof import('@vueuse/core')['autoResetRef']
const computed: typeof import('vue')['computed']
const computedAsync: typeof import('@vueuse/core')['computedAsync']
const computedEager: typeof import('@vueuse/core')['computedEager']
const computedInject: typeof import('@vueuse/core')['computedInject']
const computedWithControl: typeof import('@vueuse/core')['computedWithControl']
const controlledComputed: typeof import('@vueuse/core')['controlledComputed']
const controlledRef: typeof import('@vueuse/core')['controlledRef']
const createApp: typeof import('vue')['createApp']
const createEventHook: typeof import('@vueuse/core')['createEventHook']
const createGlobalState: typeof import('@vueuse/core')['createGlobalState']
const createInjectionState: typeof import('@vueuse/core')['createInjectionState']
const createReactiveFn: typeof import('@vueuse/core')['createReactiveFn']
const createReusableTemplate: typeof import('@vueuse/core')['createReusableTemplate']
const createSharedComposable: typeof import('@vueuse/core')['createSharedComposable']
const createTemplatePromise: typeof import('@vueuse/core')['createTemplatePromise']
const createUnrefFn: typeof import('@vueuse/core')['createUnrefFn']
const customRef: typeof import('vue')['customRef']
const debouncedRef: typeof import('@vueuse/core')['debouncedRef']
const debouncedWatch: typeof import('@vueuse/core')['debouncedWatch']
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
const defineComponent: typeof import('vue')['defineComponent']
const eagerComputed: typeof import('@vueuse/core')['eagerComputed']
const effectScope: typeof import('vue')['effectScope']
const extendRef: typeof import('@vueuse/core')['extendRef']
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
const getCurrentScope: typeof import('vue')['getCurrentScope']
const h: typeof import('vue')['h']
const ignorableWatch: typeof import('@vueuse/core')['ignorableWatch']
const inject: typeof import('vue')['inject']
const injectLocal: typeof import('@vueuse/core')['injectLocal']
const isDefined: typeof import('@vueuse/core')['isDefined']
const isProxy: typeof import('vue')['isProxy']
const isReactive: typeof import('vue')['isReactive']
const isReadonly: typeof import('vue')['isReadonly']
const isRef: typeof import('vue')['isRef']
const makeDestructurable: typeof import('@vueuse/core')['makeDestructurable']
const markRaw: typeof import('vue')['markRaw']
const nextTick: typeof import('vue')['nextTick']
const onActivated: typeof import('vue')['onActivated']
const onBeforeMount: typeof import('vue')['onBeforeMount']
const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave']
const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate']
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
const onClickOutside: typeof import('@vueuse/core')['onClickOutside']
const onDeactivated: typeof import('vue')['onDeactivated']
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
const onKeyStroke: typeof import('@vueuse/core')['onKeyStroke']
const onLongPress: typeof import('@vueuse/core')['onLongPress']
const onMounted: typeof import('vue')['onMounted']
const onRenderTracked: typeof import('vue')['onRenderTracked']
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
const onScopeDispose: typeof import('vue')['onScopeDispose']
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
const onStartTyping: typeof import('@vueuse/core')['onStartTyping']
const onUnmounted: typeof import('vue')['onUnmounted']
const onUpdated: typeof import('vue')['onUpdated']
const pausableWatch: typeof import('@vueuse/core')['pausableWatch']
const provide: typeof import('vue')['provide']
const provideLocal: typeof import('@vueuse/core')['provideLocal']
const reactify: typeof import('@vueuse/core')['reactify']
const reactifyObject: typeof import('@vueuse/core')['reactifyObject']
const reactive: typeof import('vue')['reactive']
const reactiveComputed: typeof import('@vueuse/core')['reactiveComputed']
const reactiveOmit: typeof import('@vueuse/core')['reactiveOmit']
const reactivePick: typeof import('@vueuse/core')['reactivePick']
const readonly: typeof import('vue')['readonly']
const ref: typeof import('vue')['ref']
const refAutoReset: typeof import('@vueuse/core')['refAutoReset']
const refDebounced: typeof import('@vueuse/core')['refDebounced']
const refDefault: typeof import('@vueuse/core')['refDefault']
const refThrottled: typeof import('@vueuse/core')['refThrottled']
const refWithControl: typeof import('@vueuse/core')['refWithControl']
const resolveComponent: typeof import('vue')['resolveComponent']
const resolveRef: typeof import('@vueuse/core')['resolveRef']
const resolveUnref: typeof import('@vueuse/core')['resolveUnref']
const shallowReactive: typeof import('vue')['shallowReactive']
const shallowReadonly: typeof import('vue')['shallowReadonly']
const shallowRef: typeof import('vue')['shallowRef']
const syncRef: typeof import('@vueuse/core')['syncRef']
const syncRefs: typeof import('@vueuse/core')['syncRefs']
const templateRef: typeof import('@vueuse/core')['templateRef']
const throttledRef: typeof import('@vueuse/core')['throttledRef']
const throttledWatch: typeof import('@vueuse/core')['throttledWatch']
const toRaw: typeof import('vue')['toRaw']
const toReactive: typeof import('@vueuse/core')['toReactive']
const toRef: typeof import('vue')['toRef']
const toRefs: typeof import('vue')['toRefs']
const toValue: typeof import('vue')['toValue']
const triggerRef: typeof import('vue')['triggerRef']
const tryOnBeforeMount: typeof import('@vueuse/core')['tryOnBeforeMount']
const tryOnBeforeUnmount: typeof import('@vueuse/core')['tryOnBeforeUnmount']
const tryOnMounted: typeof import('@vueuse/core')['tryOnMounted']
const tryOnScopeDispose: typeof import('@vueuse/core')['tryOnScopeDispose']
const tryOnUnmounted: typeof import('@vueuse/core')['tryOnUnmounted']
const unref: typeof import('vue')['unref']
const unrefElement: typeof import('@vueuse/core')['unrefElement']
const until: typeof import('@vueuse/core')['until']
const useActiveElement: typeof import('@vueuse/core')['useActiveElement']
const useAnimate: typeof import('@vueuse/core')['useAnimate']
const useArrayDifference: typeof import('@vueuse/core')['useArrayDifference']
const useArrayEvery: typeof import('@vueuse/core')['useArrayEvery']
const useArrayFilter: typeof import('@vueuse/core')['useArrayFilter']
const useArrayFind: typeof import('@vueuse/core')['useArrayFind']
const useArrayFindIndex: typeof import('@vueuse/core')['useArrayFindIndex']
const useArrayFindLast: typeof import('@vueuse/core')['useArrayFindLast']
const useArrayIncludes: typeof import('@vueuse/core')['useArrayIncludes']
const useArrayJoin: typeof import('@vueuse/core')['useArrayJoin']
const useArrayMap: typeof import('@vueuse/core')['useArrayMap']
const useArrayReduce: typeof import('@vueuse/core')['useArrayReduce']
const useArraySome: typeof import('@vueuse/core')['useArraySome']
const useArrayUnique: typeof import('@vueuse/core')['useArrayUnique']
const useAsyncQueue: typeof import('@vueuse/core')['useAsyncQueue']
const useAsyncState: typeof import('@vueuse/core')['useAsyncState']
const useAttrs: typeof import('vue')['useAttrs']
const useBase64: typeof import('@vueuse/core')['useBase64']
const useBattery: typeof import('@vueuse/core')['useBattery']
const useBluetooth: typeof import('@vueuse/core')['useBluetooth']
const useBreakpoints: typeof import('@vueuse/core')['useBreakpoints']
const useBroadcastChannel: typeof import('@vueuse/core')['useBroadcastChannel']
const useBrowserLocation: typeof import('@vueuse/core')['useBrowserLocation']
const useCached: typeof import('@vueuse/core')['useCached']
const useClipboard: typeof import('@vueuse/core')['useClipboard']
const useClipboardItems: typeof import('@vueuse/core')['useClipboardItems']
const useCloned: typeof import('@vueuse/core')['useCloned']
const useColorMode: typeof import('@vueuse/core')['useColorMode']
const useConfirmDialog: typeof import('@vueuse/core')['useConfirmDialog']
const useCounter: typeof import('@vueuse/core')['useCounter']
const useCssModule: typeof import('vue')['useCssModule']
const useCssVar: typeof import('@vueuse/core')['useCssVar']
const useCssVars: typeof import('vue')['useCssVars']
const useCurrentElement: typeof import('@vueuse/core')['useCurrentElement']
const useCycleList: typeof import('@vueuse/core')['useCycleList']
const useDark: typeof import('@vueuse/core')['useDark']
const useDateFormat: typeof import('@vueuse/core')['useDateFormat']
const useDebounce: typeof import('@vueuse/core')['useDebounce']
const useDebounceFn: typeof import('@vueuse/core')['useDebounceFn']
const useDebouncedRefHistory: typeof import('@vueuse/core')['useDebouncedRefHistory']
const useDeviceMotion: typeof import('@vueuse/core')['useDeviceMotion']
const useDeviceOrientation: typeof import('@vueuse/core')['useDeviceOrientation']
const useDevicePixelRatio: typeof import('@vueuse/core')['useDevicePixelRatio']
const useDevicesList: typeof import('@vueuse/core')['useDevicesList']
const useDialog: typeof import('naive-ui')['useDialog']
const useDisplayMedia: typeof import('@vueuse/core')['useDisplayMedia']
const useDocumentVisibility: typeof import('@vueuse/core')['useDocumentVisibility']
const useDraggable: typeof import('@vueuse/core')['useDraggable']
const useDropZone: typeof import('@vueuse/core')['useDropZone']
const useElementBounding: typeof import('@vueuse/core')['useElementBounding']
const useElementByPoint: typeof import('@vueuse/core')['useElementByPoint']
const useElementHover: typeof import('@vueuse/core')['useElementHover']
const useElementSize: typeof import('@vueuse/core')['useElementSize']
const useElementVisibility: typeof import('@vueuse/core')['useElementVisibility']
const useEventBus: typeof import('@vueuse/core')['useEventBus']
const useEventListener: typeof import('@vueuse/core')['useEventListener']
const useEventSource: typeof import('@vueuse/core')['useEventSource']
const useEyeDropper: typeof import('@vueuse/core')['useEyeDropper']
const useFavicon: typeof import('@vueuse/core')['useFavicon']
const useFetch: typeof import('@vueuse/core')['useFetch']
const useFileDialog: typeof import('@vueuse/core')['useFileDialog']
const useFileSystemAccess: typeof import('@vueuse/core')['useFileSystemAccess']
const useFocus: typeof import('@vueuse/core')['useFocus']
const useFocusWithin: typeof import('@vueuse/core')['useFocusWithin']
const useFps: typeof import('@vueuse/core')['useFps']
const useFullscreen: typeof import('@vueuse/core')['useFullscreen']
const useGamepad: typeof import('@vueuse/core')['useGamepad']
const useGeolocation: typeof import('@vueuse/core')['useGeolocation']
const useI18n: typeof import('vue-i18n')['useI18n']
const useIdle: typeof import('@vueuse/core')['useIdle']
const useImage: typeof import('@vueuse/core')['useImage']
const useInfiniteScroll: typeof import('@vueuse/core')['useInfiniteScroll']
const useIntersectionObserver: typeof import('@vueuse/core')['useIntersectionObserver']
const useInterval: typeof import('@vueuse/core')['useInterval']
const useIntervalFn: typeof import('@vueuse/core')['useIntervalFn']
const useKeyModifier: typeof import('@vueuse/core')['useKeyModifier']
const useLastChanged: typeof import('@vueuse/core')['useLastChanged']
const useLink: typeof import('vue-router')['useLink']
const useLoadingBar: typeof import('naive-ui')['useLoadingBar']
const useLocalStorage: typeof import('@vueuse/core')['useLocalStorage']
const useMagicKeys: typeof import('@vueuse/core')['useMagicKeys']
const useManualRefHistory: typeof import('@vueuse/core')['useManualRefHistory']
const useMediaControls: typeof import('@vueuse/core')['useMediaControls']
const useMediaQuery: typeof import('@vueuse/core')['useMediaQuery']
const useMemoize: typeof import('@vueuse/core')['useMemoize']
const useMemory: typeof import('@vueuse/core')['useMemory']
const useMessage: typeof import('naive-ui')['useMessage']
const useMounted: typeof import('@vueuse/core')['useMounted']
const useMouse: typeof import('@vueuse/core')['useMouse']
const useMouseInElement: typeof import('@vueuse/core')['useMouseInElement']
const useMousePressed: typeof import('@vueuse/core')['useMousePressed']
const useMutationObserver: typeof import('@vueuse/core')['useMutationObserver']
const useNavigatorLanguage: typeof import('@vueuse/core')['useNavigatorLanguage']
const useNetwork: typeof import('@vueuse/core')['useNetwork']
const useNotification: typeof import('naive-ui')['useNotification']
const useNow: typeof import('@vueuse/core')['useNow']
const useObjectUrl: typeof import('@vueuse/core')['useObjectUrl']
const useOffsetPagination: typeof import('@vueuse/core')['useOffsetPagination']
const useOnline: typeof import('@vueuse/core')['useOnline']
const usePageLeave: typeof import('@vueuse/core')['usePageLeave']
const useParallax: typeof import('@vueuse/core')['useParallax']
const useParentElement: typeof import('@vueuse/core')['useParentElement']
const usePerformanceObserver: typeof import('@vueuse/core')['usePerformanceObserver']
const usePermission: typeof import('@vueuse/core')['usePermission']
const usePointer: typeof import('@vueuse/core')['usePointer']
const usePointerLock: typeof import('@vueuse/core')['usePointerLock']
const usePointerSwipe: typeof import('@vueuse/core')['usePointerSwipe']
const usePreferredColorScheme: typeof import('@vueuse/core')['usePreferredColorScheme']
const usePreferredContrast: typeof import('@vueuse/core')['usePreferredContrast']
const usePreferredDark: typeof import('@vueuse/core')['usePreferredDark']
const usePreferredLanguages: typeof import('@vueuse/core')['usePreferredLanguages']
const usePreferredReducedMotion: typeof import('@vueuse/core')['usePreferredReducedMotion']
const usePrevious: typeof import('@vueuse/core')['usePrevious']
const useRafFn: typeof import('@vueuse/core')['useRafFn']
const useRefHistory: typeof import('@vueuse/core')['useRefHistory']
const useResizeObserver: typeof import('@vueuse/core')['useResizeObserver']
const useRoute: typeof import('vue-router')['useRoute']
const useRouter: typeof import('vue-router')['useRouter']
const useScreenOrientation: typeof import('@vueuse/core')['useScreenOrientation']
const useScreenSafeArea: typeof import('@vueuse/core')['useScreenSafeArea']
const useScriptTag: typeof import('@vueuse/core')['useScriptTag']
const useScroll: typeof import('@vueuse/core')['useScroll']
const useScrollLock: typeof import('@vueuse/core')['useScrollLock']
const useSessionStorage: typeof import('@vueuse/core')['useSessionStorage']
const useShare: typeof import('@vueuse/core')['useShare']
const useSlots: typeof import('vue')['useSlots']
const useSorted: typeof import('@vueuse/core')['useSorted']
const useSpeechRecognition: typeof import('@vueuse/core')['useSpeechRecognition']
const useSpeechSynthesis: typeof import('@vueuse/core')['useSpeechSynthesis']
const useStepper: typeof import('@vueuse/core')['useStepper']
const useStorage: typeof import('@vueuse/core')['useStorage']
const useStorageAsync: typeof import('@vueuse/core')['useStorageAsync']
const useStyleTag: typeof import('@vueuse/core')['useStyleTag']
const useSupported: typeof import('@vueuse/core')['useSupported']
const useSwipe: typeof import('@vueuse/core')['useSwipe']
const useTemplateRefsList: typeof import('@vueuse/core')['useTemplateRefsList']
const useTextDirection: typeof import('@vueuse/core')['useTextDirection']
const useTextSelection: typeof import('@vueuse/core')['useTextSelection']
const useTextareaAutosize: typeof import('@vueuse/core')['useTextareaAutosize']
const useThrottle: typeof import('@vueuse/core')['useThrottle']
const useThrottleFn: typeof import('@vueuse/core')['useThrottleFn']
const useThrottledRefHistory: typeof import('@vueuse/core')['useThrottledRefHistory']
const useTimeAgo: typeof import('@vueuse/core')['useTimeAgo']
const useTimeout: typeof import('@vueuse/core')['useTimeout']
const useTimeoutFn: typeof import('@vueuse/core')['useTimeoutFn']
const useTimeoutPoll: typeof import('@vueuse/core')['useTimeoutPoll']
const useTimestamp: typeof import('@vueuse/core')['useTimestamp']
const useTitle: typeof import('@vueuse/core')['useTitle']
const useToNumber: typeof import('@vueuse/core')['useToNumber']
const useToString: typeof import('@vueuse/core')['useToString']
const useToggle: typeof import('@vueuse/core')['useToggle']
const useTransition: typeof import('@vueuse/core')['useTransition']
const useUrlSearchParams: typeof import('@vueuse/core')['useUrlSearchParams']
const useUserMedia: typeof import('@vueuse/core')['useUserMedia']
const useVModel: typeof import('@vueuse/core')['useVModel']
const useVModels: typeof import('@vueuse/core')['useVModels']
const useVibrate: typeof import('@vueuse/core')['useVibrate']
const useVirtualList: typeof import('@vueuse/core')['useVirtualList']
const useWakeLock: typeof import('@vueuse/core')['useWakeLock']
const useWebNotification: typeof import('@vueuse/core')['useWebNotification']
const useWebSocket: typeof import('@vueuse/core')['useWebSocket']
const useWebWorker: typeof import('@vueuse/core')['useWebWorker']
const useWebWorkerFn: typeof import('@vueuse/core')['useWebWorkerFn']
const useWindowFocus: typeof import('@vueuse/core')['useWindowFocus']
const useWindowScroll: typeof import('@vueuse/core')['useWindowScroll']
const useWindowSize: typeof import('@vueuse/core')['useWindowSize']
const watch: typeof import('vue')['watch']
const watchArray: typeof import('@vueuse/core')['watchArray']
const watchAtMost: typeof import('@vueuse/core')['watchAtMost']
const watchDebounced: typeof import('@vueuse/core')['watchDebounced']
const watchDeep: typeof import('@vueuse/core')['watchDeep']
const watchEffect: typeof import('vue')['watchEffect']
const watchIgnorable: typeof import('@vueuse/core')['watchIgnorable']
const watchImmediate: typeof import('@vueuse/core')['watchImmediate']
const watchOnce: typeof import('@vueuse/core')['watchOnce']
const watchPausable: typeof import('@vueuse/core')['watchPausable']
const watchPostEffect: typeof import('vue')['watchPostEffect']
const watchSyncEffect: typeof import('vue')['watchSyncEffect']
const watchThrottled: typeof import('@vueuse/core')['watchThrottled']
const watchTriggerable: typeof import('@vueuse/core')['watchTriggerable']
const watchWithFilter: typeof import('@vueuse/core')['watchWithFilter']
const whenever: typeof import('@vueuse/core')['whenever']
const EffectScope: typeof import('vue').EffectScope
const asyncComputed: typeof import('@vueuse/core').asyncComputed
const autoResetRef: typeof import('@vueuse/core').autoResetRef
const computed: typeof import('vue').computed
const computedAsync: typeof import('@vueuse/core').computedAsync
const computedEager: typeof import('@vueuse/core').computedEager
const computedInject: typeof import('@vueuse/core').computedInject
const computedWithControl: typeof import('@vueuse/core').computedWithControl
const controlledComputed: typeof import('@vueuse/core').controlledComputed
const controlledRef: typeof import('@vueuse/core').controlledRef
const createApp: typeof import('vue').createApp
const createEventHook: typeof import('@vueuse/core').createEventHook
const createGlobalState: typeof import('@vueuse/core').createGlobalState
const createInjectionState: typeof import('@vueuse/core').createInjectionState
const createReactiveFn: typeof import('@vueuse/core').createReactiveFn
const createReusableTemplate: typeof import('@vueuse/core').createReusableTemplate
const createSharedComposable: typeof import('@vueuse/core').createSharedComposable
const createTemplatePromise: typeof import('@vueuse/core').createTemplatePromise
const createUnrefFn: typeof import('@vueuse/core').createUnrefFn
const customRef: typeof import('vue').customRef
const debouncedRef: typeof import('@vueuse/core').debouncedRef
const debouncedWatch: typeof import('@vueuse/core').debouncedWatch
const defineAsyncComponent: typeof import('vue').defineAsyncComponent
const defineComponent: typeof import('vue').defineComponent
const eagerComputed: typeof import('@vueuse/core').eagerComputed
const effectScope: typeof import('vue').effectScope
const extendRef: typeof import('@vueuse/core').extendRef
const getCurrentInstance: typeof import('vue').getCurrentInstance
const getCurrentScope: typeof import('vue').getCurrentScope
const getCurrentWatcher: typeof import('vue').getCurrentWatcher
const h: typeof import('vue').h
const ignorableWatch: typeof import('@vueuse/core').ignorableWatch
const inject: typeof import('vue').inject
const injectLocal: typeof import('@vueuse/core').injectLocal
const isDefined: typeof import('@vueuse/core').isDefined
const isProxy: typeof import('vue').isProxy
const isReactive: typeof import('vue').isReactive
const isReadonly: typeof import('vue').isReadonly
const isRef: typeof import('vue').isRef
const isShallow: typeof import('vue').isShallow
const makeDestructurable: typeof import('@vueuse/core').makeDestructurable
const markRaw: typeof import('vue').markRaw
const nextTick: typeof import('vue').nextTick
const onActivated: typeof import('vue').onActivated
const onBeforeMount: typeof import('vue').onBeforeMount
const onBeforeRouteLeave: typeof import('vue-router').onBeforeRouteLeave
const onBeforeRouteUpdate: typeof import('vue-router').onBeforeRouteUpdate
const onBeforeUnmount: typeof import('vue').onBeforeUnmount
const onBeforeUpdate: typeof import('vue').onBeforeUpdate
const onClickOutside: typeof import('@vueuse/core').onClickOutside
const onDeactivated: typeof import('vue').onDeactivated
const onErrorCaptured: typeof import('vue').onErrorCaptured
const onKeyStroke: typeof import('@vueuse/core').onKeyStroke
const onLongPress: typeof import('@vueuse/core').onLongPress
const onMounted: typeof import('vue').onMounted
const onRenderTracked: typeof import('vue').onRenderTracked
const onRenderTriggered: typeof import('vue').onRenderTriggered
const onScopeDispose: typeof import('vue').onScopeDispose
const onServerPrefetch: typeof import('vue').onServerPrefetch
const onStartTyping: typeof import('@vueuse/core').onStartTyping
const onUnmounted: typeof import('vue').onUnmounted
const onUpdated: typeof import('vue').onUpdated
const onWatcherCleanup: typeof import('vue').onWatcherCleanup
const pausableWatch: typeof import('@vueuse/core').pausableWatch
const provide: typeof import('vue').provide
const provideLocal: typeof import('@vueuse/core').provideLocal
const reactify: typeof import('@vueuse/core').reactify
const reactifyObject: typeof import('@vueuse/core').reactifyObject
const reactive: typeof import('vue').reactive
const reactiveComputed: typeof import('@vueuse/core').reactiveComputed
const reactiveOmit: typeof import('@vueuse/core').reactiveOmit
const reactivePick: typeof import('@vueuse/core').reactivePick
const readonly: typeof import('vue').readonly
const ref: typeof import('vue').ref
const refAutoReset: typeof import('@vueuse/core').refAutoReset
const refDebounced: typeof import('@vueuse/core').refDebounced
const refDefault: typeof import('@vueuse/core').refDefault
const refThrottled: typeof import('@vueuse/core').refThrottled
const refWithControl: typeof import('@vueuse/core').refWithControl
const resolveComponent: typeof import('vue').resolveComponent
const resolveRef: typeof import('@vueuse/core').resolveRef
const resolveUnref: typeof import('@vueuse/core').resolveUnref
const shallowReactive: typeof import('vue').shallowReactive
const shallowReadonly: typeof import('vue').shallowReadonly
const shallowRef: typeof import('vue').shallowRef
const syncRef: typeof import('@vueuse/core').syncRef
const syncRefs: typeof import('@vueuse/core').syncRefs
const templateRef: typeof import('@vueuse/core').templateRef
const throttledRef: typeof import('@vueuse/core').throttledRef
const throttledWatch: typeof import('@vueuse/core').throttledWatch
const toRaw: typeof import('vue').toRaw
const toReactive: typeof import('@vueuse/core').toReactive
const toRef: typeof import('vue').toRef
const toRefs: typeof import('vue').toRefs
const toValue: typeof import('vue').toValue
const triggerRef: typeof import('vue').triggerRef
const tryOnBeforeMount: typeof import('@vueuse/core').tryOnBeforeMount
const tryOnBeforeUnmount: typeof import('@vueuse/core').tryOnBeforeUnmount
const tryOnMounted: typeof import('@vueuse/core').tryOnMounted
const tryOnScopeDispose: typeof import('@vueuse/core').tryOnScopeDispose
const tryOnUnmounted: typeof import('@vueuse/core').tryOnUnmounted
const unref: typeof import('vue').unref
const unrefElement: typeof import('@vueuse/core').unrefElement
const until: typeof import('@vueuse/core').until
const useActiveElement: typeof import('@vueuse/core').useActiveElement
const useAnimate: typeof import('@vueuse/core').useAnimate
const useArrayDifference: typeof import('@vueuse/core').useArrayDifference
const useArrayEvery: typeof import('@vueuse/core').useArrayEvery
const useArrayFilter: typeof import('@vueuse/core').useArrayFilter
const useArrayFind: typeof import('@vueuse/core').useArrayFind
const useArrayFindIndex: typeof import('@vueuse/core').useArrayFindIndex
const useArrayFindLast: typeof import('@vueuse/core').useArrayFindLast
const useArrayIncludes: typeof import('@vueuse/core').useArrayIncludes
const useArrayJoin: typeof import('@vueuse/core').useArrayJoin
const useArrayMap: typeof import('@vueuse/core').useArrayMap
const useArrayReduce: typeof import('@vueuse/core').useArrayReduce
const useArraySome: typeof import('@vueuse/core').useArraySome
const useArrayUnique: typeof import('@vueuse/core').useArrayUnique
const useAsyncQueue: typeof import('@vueuse/core').useAsyncQueue
const useAsyncState: typeof import('@vueuse/core').useAsyncState
const useAttrs: typeof import('vue').useAttrs
const useBase64: typeof import('@vueuse/core').useBase64
const useBattery: typeof import('@vueuse/core').useBattery
const useBluetooth: typeof import('@vueuse/core').useBluetooth
const useBreakpoints: typeof import('@vueuse/core').useBreakpoints
const useBroadcastChannel: typeof import('@vueuse/core').useBroadcastChannel
const useBrowserLocation: typeof import('@vueuse/core').useBrowserLocation
const useCached: typeof import('@vueuse/core').useCached
const useClipboard: typeof import('@vueuse/core').useClipboard
const useClipboardItems: typeof import('@vueuse/core').useClipboardItems
const useCloned: typeof import('@vueuse/core').useCloned
const useColorMode: typeof import('@vueuse/core').useColorMode
const useConfirmDialog: typeof import('@vueuse/core').useConfirmDialog
const useCounter: typeof import('@vueuse/core').useCounter
const useCssModule: typeof import('vue').useCssModule
const useCssVar: typeof import('@vueuse/core').useCssVar
const useCssVars: typeof import('vue').useCssVars
const useCurrentElement: typeof import('@vueuse/core').useCurrentElement
const useCycleList: typeof import('@vueuse/core').useCycleList
const useDark: typeof import('@vueuse/core').useDark
const useDateFormat: typeof import('@vueuse/core').useDateFormat
const useDebounce: typeof import('@vueuse/core').useDebounce
const useDebounceFn: typeof import('@vueuse/core').useDebounceFn
const useDebouncedRefHistory: typeof import('@vueuse/core').useDebouncedRefHistory
const useDeviceMotion: typeof import('@vueuse/core').useDeviceMotion
const useDeviceOrientation: typeof import('@vueuse/core').useDeviceOrientation
const useDevicePixelRatio: typeof import('@vueuse/core').useDevicePixelRatio
const useDevicesList: typeof import('@vueuse/core').useDevicesList
const useDialog: typeof import('naive-ui').useDialog
const useDisplayMedia: typeof import('@vueuse/core').useDisplayMedia
const useDocumentVisibility: typeof import('@vueuse/core').useDocumentVisibility
const useDraggable: typeof import('@vueuse/core').useDraggable
const useDropZone: typeof import('@vueuse/core').useDropZone
const useElementBounding: typeof import('@vueuse/core').useElementBounding
const useElementByPoint: typeof import('@vueuse/core').useElementByPoint
const useElementHover: typeof import('@vueuse/core').useElementHover
const useElementSize: typeof import('@vueuse/core').useElementSize
const useElementVisibility: typeof import('@vueuse/core').useElementVisibility
const useEventBus: typeof import('@vueuse/core').useEventBus
const useEventListener: typeof import('@vueuse/core').useEventListener
const useEventSource: typeof import('@vueuse/core').useEventSource
const useEyeDropper: typeof import('@vueuse/core').useEyeDropper
const useFavicon: typeof import('@vueuse/core').useFavicon
const useFetch: typeof import('@vueuse/core').useFetch
const useFileDialog: typeof import('@vueuse/core').useFileDialog
const useFileSystemAccess: typeof import('@vueuse/core').useFileSystemAccess
const useFocus: typeof import('@vueuse/core').useFocus
const useFocusWithin: typeof import('@vueuse/core').useFocusWithin
const useFps: typeof import('@vueuse/core').useFps
const useFullscreen: typeof import('@vueuse/core').useFullscreen
const useGamepad: typeof import('@vueuse/core').useGamepad
const useGeolocation: typeof import('@vueuse/core').useGeolocation
const useI18n: typeof import('vue-i18n').useI18n
const useId: typeof import('vue').useId
const useIdle: typeof import('@vueuse/core').useIdle
const useImage: typeof import('@vueuse/core').useImage
const useInfiniteScroll: typeof import('@vueuse/core').useInfiniteScroll
const useIntersectionObserver: typeof import('@vueuse/core').useIntersectionObserver
const useInterval: typeof import('@vueuse/core').useInterval
const useIntervalFn: typeof import('@vueuse/core').useIntervalFn
const useKeyModifier: typeof import('@vueuse/core').useKeyModifier
const useLastChanged: typeof import('@vueuse/core').useLastChanged
const useLink: typeof import('vue-router').useLink
const useLoadingBar: typeof import('naive-ui').useLoadingBar
const useLocalStorage: typeof import('@vueuse/core').useLocalStorage
const useMagicKeys: typeof import('@vueuse/core').useMagicKeys
const useManualRefHistory: typeof import('@vueuse/core').useManualRefHistory
const useMediaControls: typeof import('@vueuse/core').useMediaControls
const useMediaQuery: typeof import('@vueuse/core').useMediaQuery
const useMemoize: typeof import('@vueuse/core').useMemoize
const useMemory: typeof import('@vueuse/core').useMemory
const useMessage: typeof import('naive-ui').useMessage
const useModel: typeof import('vue').useModel
const useMounted: typeof import('@vueuse/core').useMounted
const useMouse: typeof import('@vueuse/core').useMouse
const useMouseInElement: typeof import('@vueuse/core').useMouseInElement
const useMousePressed: typeof import('@vueuse/core').useMousePressed
const useMutationObserver: typeof import('@vueuse/core').useMutationObserver
const useNavigatorLanguage: typeof import('@vueuse/core').useNavigatorLanguage
const useNetwork: typeof import('@vueuse/core').useNetwork
const useNotification: typeof import('naive-ui').useNotification
const useNow: typeof import('@vueuse/core').useNow
const useObjectUrl: typeof import('@vueuse/core').useObjectUrl
const useOffsetPagination: typeof import('@vueuse/core').useOffsetPagination
const useOnline: typeof import('@vueuse/core').useOnline
const usePageLeave: typeof import('@vueuse/core').usePageLeave
const useParallax: typeof import('@vueuse/core').useParallax
const useParentElement: typeof import('@vueuse/core').useParentElement
const usePerformanceObserver: typeof import('@vueuse/core').usePerformanceObserver
const usePermission: typeof import('@vueuse/core').usePermission
const usePointer: typeof import('@vueuse/core').usePointer
const usePointerLock: typeof import('@vueuse/core').usePointerLock
const usePointerSwipe: typeof import('@vueuse/core').usePointerSwipe
const usePreferredColorScheme: typeof import('@vueuse/core').usePreferredColorScheme
const usePreferredContrast: typeof import('@vueuse/core').usePreferredContrast
const usePreferredDark: typeof import('@vueuse/core').usePreferredDark
const usePreferredLanguages: typeof import('@vueuse/core').usePreferredLanguages
const usePreferredReducedMotion: typeof import('@vueuse/core').usePreferredReducedMotion
const usePrevious: typeof import('@vueuse/core').usePrevious
const useRafFn: typeof import('@vueuse/core').useRafFn
const useRefHistory: typeof import('@vueuse/core').useRefHistory
const useResizeObserver: typeof import('@vueuse/core').useResizeObserver
const useRoute: typeof import('vue-router').useRoute
const useRouter: typeof import('vue-router').useRouter
const useScreenOrientation: typeof import('@vueuse/core').useScreenOrientation
const useScreenSafeArea: typeof import('@vueuse/core').useScreenSafeArea
const useScriptTag: typeof import('@vueuse/core').useScriptTag
const useScroll: typeof import('@vueuse/core').useScroll
const useScrollLock: typeof import('@vueuse/core').useScrollLock
const useSessionStorage: typeof import('@vueuse/core').useSessionStorage
const useShare: typeof import('@vueuse/core').useShare
const useSlots: typeof import('vue').useSlots
const useSorted: typeof import('@vueuse/core').useSorted
const useSpeechRecognition: typeof import('@vueuse/core').useSpeechRecognition
const useSpeechSynthesis: typeof import('@vueuse/core').useSpeechSynthesis
const useStepper: typeof import('@vueuse/core').useStepper
const useStorage: typeof import('@vueuse/core').useStorage
const useStorageAsync: typeof import('@vueuse/core').useStorageAsync
const useStyleTag: typeof import('@vueuse/core').useStyleTag
const useSupported: typeof import('@vueuse/core').useSupported
const useSwipe: typeof import('@vueuse/core').useSwipe
const useTemplateRef: typeof import('vue').useTemplateRef
const useTemplateRefsList: typeof import('@vueuse/core').useTemplateRefsList
const useTextDirection: typeof import('@vueuse/core').useTextDirection
const useTextSelection: typeof import('@vueuse/core').useTextSelection
const useTextareaAutosize: typeof import('@vueuse/core').useTextareaAutosize
const useThrottle: typeof import('@vueuse/core').useThrottle
const useThrottleFn: typeof import('@vueuse/core').useThrottleFn
const useThrottledRefHistory: typeof import('@vueuse/core').useThrottledRefHistory
const useTimeAgo: typeof import('@vueuse/core').useTimeAgo
const useTimeout: typeof import('@vueuse/core').useTimeout
const useTimeoutFn: typeof import('@vueuse/core').useTimeoutFn
const useTimeoutPoll: typeof import('@vueuse/core').useTimeoutPoll
const useTimestamp: typeof import('@vueuse/core').useTimestamp
const useTitle: typeof import('@vueuse/core').useTitle
const useToNumber: typeof import('@vueuse/core').useToNumber
const useToString: typeof import('@vueuse/core').useToString
const useToggle: typeof import('@vueuse/core').useToggle
const useTransition: typeof import('@vueuse/core').useTransition
const useUrlSearchParams: typeof import('@vueuse/core').useUrlSearchParams
const useUserMedia: typeof import('@vueuse/core').useUserMedia
const useVModel: typeof import('@vueuse/core').useVModel
const useVModels: typeof import('@vueuse/core').useVModels
const useVibrate: typeof import('@vueuse/core').useVibrate
const useVirtualList: typeof import('@vueuse/core').useVirtualList
const useWakeLock: typeof import('@vueuse/core').useWakeLock
const useWebNotification: typeof import('@vueuse/core').useWebNotification
const useWebSocket: typeof import('@vueuse/core').useWebSocket
const useWebWorker: typeof import('@vueuse/core').useWebWorker
const useWebWorkerFn: typeof import('@vueuse/core').useWebWorkerFn
const useWindowFocus: typeof import('@vueuse/core').useWindowFocus
const useWindowScroll: typeof import('@vueuse/core').useWindowScroll
const useWindowSize: typeof import('@vueuse/core').useWindowSize
const watch: typeof import('vue').watch
const watchArray: typeof import('@vueuse/core').watchArray
const watchAtMost: typeof import('@vueuse/core').watchAtMost
const watchDebounced: typeof import('@vueuse/core').watchDebounced
const watchDeep: typeof import('@vueuse/core').watchDeep
const watchEffect: typeof import('vue').watchEffect
const watchIgnorable: typeof import('@vueuse/core').watchIgnorable
const watchImmediate: typeof import('@vueuse/core').watchImmediate
const watchOnce: typeof import('@vueuse/core').watchOnce
const watchPausable: typeof import('@vueuse/core').watchPausable
const watchPostEffect: typeof import('vue').watchPostEffect
const watchSyncEffect: typeof import('vue').watchSyncEffect
const watchThrottled: typeof import('@vueuse/core').watchThrottled
const watchTriggerable: typeof import('@vueuse/core').watchTriggerable
const watchWithFilter: typeof import('@vueuse/core').watchWithFilter
const whenever: typeof import('@vueuse/core').whenever
}
// for type re-export
declare global {
// @ts-ignore
export type { Component, ComponentPublicInstance, ComputedRef, InjectionKey, PropType, Ref, VNode } from 'vue'
export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, ShallowRef, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
import('vue')
}
// for vue template auto import
import { UnwrapRef } from 'vue'
declare module 'vue' {
interface GlobalComponents {}
interface ComponentCustomProperties {
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
@@ -326,6 +337,7 @@ declare module 'vue' {
readonly extendRef: UnwrapRef<typeof import('@vueuse/core')['extendRef']>
readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
readonly getCurrentWatcher: UnwrapRef<typeof import('vue')['getCurrentWatcher']>
readonly h: UnwrapRef<typeof import('vue')['h']>
readonly ignorableWatch: UnwrapRef<typeof import('@vueuse/core')['ignorableWatch']>
readonly inject: UnwrapRef<typeof import('vue')['inject']>
@@ -335,6 +347,7 @@ declare module 'vue' {
readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
readonly isShallow: UnwrapRef<typeof import('vue')['isShallow']>
readonly makeDestructurable: UnwrapRef<typeof import('@vueuse/core')['makeDestructurable']>
readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']>
readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']>
@@ -357,6 +370,7 @@ declare module 'vue' {
readonly onStartTyping: UnwrapRef<typeof import('@vueuse/core')['onStartTyping']>
readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
readonly onWatcherCleanup: UnwrapRef<typeof import('vue')['onWatcherCleanup']>
readonly pausableWatch: UnwrapRef<typeof import('@vueuse/core')['pausableWatch']>
readonly provide: UnwrapRef<typeof import('vue')['provide']>
readonly provideLocal: UnwrapRef<typeof import('@vueuse/core')['provideLocal']>
@@ -467,6 +481,7 @@ declare module 'vue' {
readonly useGamepad: UnwrapRef<typeof import('@vueuse/core')['useGamepad']>
readonly useGeolocation: UnwrapRef<typeof import('@vueuse/core')['useGeolocation']>
readonly useI18n: UnwrapRef<typeof import('vue-i18n')['useI18n']>
readonly useId: UnwrapRef<typeof import('vue')['useId']>
readonly useIdle: UnwrapRef<typeof import('@vueuse/core')['useIdle']>
readonly useImage: UnwrapRef<typeof import('@vueuse/core')['useImage']>
readonly useInfiniteScroll: UnwrapRef<typeof import('@vueuse/core')['useInfiniteScroll']>
@@ -485,6 +500,7 @@ declare module 'vue' {
readonly useMemoize: UnwrapRef<typeof import('@vueuse/core')['useMemoize']>
readonly useMemory: UnwrapRef<typeof import('@vueuse/core')['useMemory']>
readonly useMessage: UnwrapRef<typeof import('naive-ui')['useMessage']>
readonly useModel: UnwrapRef<typeof import('vue')['useModel']>
readonly useMounted: UnwrapRef<typeof import('@vueuse/core')['useMounted']>
readonly useMouse: UnwrapRef<typeof import('@vueuse/core')['useMouse']>
readonly useMouseInElement: UnwrapRef<typeof import('@vueuse/core')['useMouseInElement']>
@@ -533,6 +549,7 @@ declare module 'vue' {
readonly useStyleTag: UnwrapRef<typeof import('@vueuse/core')['useStyleTag']>
readonly useSupported: UnwrapRef<typeof import('@vueuse/core')['useSupported']>
readonly useSwipe: UnwrapRef<typeof import('@vueuse/core')['useSwipe']>
readonly useTemplateRef: UnwrapRef<typeof import('vue')['useTemplateRef']>
readonly useTemplateRefsList: UnwrapRef<typeof import('@vueuse/core')['useTemplateRefsList']>
readonly useTextDirection: UnwrapRef<typeof import('@vueuse/core')['useTextDirection']>
readonly useTextSelection: UnwrapRef<typeof import('@vueuse/core')['useTextSelection']>
@@ -581,291 +598,4 @@ declare module 'vue' {
readonly watchWithFilter: UnwrapRef<typeof import('@vueuse/core')['watchWithFilter']>
readonly whenever: UnwrapRef<typeof import('@vueuse/core')['whenever']>
}
}
declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
readonly autoResetRef: UnwrapRef<typeof import('@vueuse/core')['autoResetRef']>
readonly computed: UnwrapRef<typeof import('vue')['computed']>
readonly computedAsync: UnwrapRef<typeof import('@vueuse/core')['computedAsync']>
readonly computedEager: UnwrapRef<typeof import('@vueuse/core')['computedEager']>
readonly computedInject: UnwrapRef<typeof import('@vueuse/core')['computedInject']>
readonly computedWithControl: UnwrapRef<typeof import('@vueuse/core')['computedWithControl']>
readonly controlledComputed: UnwrapRef<typeof import('@vueuse/core')['controlledComputed']>
readonly controlledRef: UnwrapRef<typeof import('@vueuse/core')['controlledRef']>
readonly createApp: UnwrapRef<typeof import('vue')['createApp']>
readonly createEventHook: UnwrapRef<typeof import('@vueuse/core')['createEventHook']>
readonly createGlobalState: UnwrapRef<typeof import('@vueuse/core')['createGlobalState']>
readonly createInjectionState: UnwrapRef<typeof import('@vueuse/core')['createInjectionState']>
readonly createReactiveFn: UnwrapRef<typeof import('@vueuse/core')['createReactiveFn']>
readonly createReusableTemplate: UnwrapRef<typeof import('@vueuse/core')['createReusableTemplate']>
readonly createSharedComposable: UnwrapRef<typeof import('@vueuse/core')['createSharedComposable']>
readonly createTemplatePromise: UnwrapRef<typeof import('@vueuse/core')['createTemplatePromise']>
readonly createUnrefFn: UnwrapRef<typeof import('@vueuse/core')['createUnrefFn']>
readonly customRef: UnwrapRef<typeof import('vue')['customRef']>
readonly debouncedRef: UnwrapRef<typeof import('@vueuse/core')['debouncedRef']>
readonly debouncedWatch: UnwrapRef<typeof import('@vueuse/core')['debouncedWatch']>
readonly defineAsyncComponent: UnwrapRef<typeof import('vue')['defineAsyncComponent']>
readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']>
readonly eagerComputed: UnwrapRef<typeof import('@vueuse/core')['eagerComputed']>
readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']>
readonly extendRef: UnwrapRef<typeof import('@vueuse/core')['extendRef']>
readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
readonly h: UnwrapRef<typeof import('vue')['h']>
readonly ignorableWatch: UnwrapRef<typeof import('@vueuse/core')['ignorableWatch']>
readonly inject: UnwrapRef<typeof import('vue')['inject']>
readonly injectLocal: UnwrapRef<typeof import('@vueuse/core')['injectLocal']>
readonly isDefined: UnwrapRef<typeof import('@vueuse/core')['isDefined']>
readonly isProxy: UnwrapRef<typeof import('vue')['isProxy']>
readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
readonly makeDestructurable: UnwrapRef<typeof import('@vueuse/core')['makeDestructurable']>
readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']>
readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']>
readonly onActivated: UnwrapRef<typeof import('vue')['onActivated']>
readonly onBeforeMount: UnwrapRef<typeof import('vue')['onBeforeMount']>
readonly onBeforeRouteLeave: UnwrapRef<typeof import('vue-router')['onBeforeRouteLeave']>
readonly onBeforeRouteUpdate: UnwrapRef<typeof import('vue-router')['onBeforeRouteUpdate']>
readonly onBeforeUnmount: UnwrapRef<typeof import('vue')['onBeforeUnmount']>
readonly onBeforeUpdate: UnwrapRef<typeof import('vue')['onBeforeUpdate']>
readonly onClickOutside: UnwrapRef<typeof import('@vueuse/core')['onClickOutside']>
readonly onDeactivated: UnwrapRef<typeof import('vue')['onDeactivated']>
readonly onErrorCaptured: UnwrapRef<typeof import('vue')['onErrorCaptured']>
readonly onKeyStroke: UnwrapRef<typeof import('@vueuse/core')['onKeyStroke']>
readonly onLongPress: UnwrapRef<typeof import('@vueuse/core')['onLongPress']>
readonly onMounted: UnwrapRef<typeof import('vue')['onMounted']>
readonly onRenderTracked: UnwrapRef<typeof import('vue')['onRenderTracked']>
readonly onRenderTriggered: UnwrapRef<typeof import('vue')['onRenderTriggered']>
readonly onScopeDispose: UnwrapRef<typeof import('vue')['onScopeDispose']>
readonly onServerPrefetch: UnwrapRef<typeof import('vue')['onServerPrefetch']>
readonly onStartTyping: UnwrapRef<typeof import('@vueuse/core')['onStartTyping']>
readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
readonly pausableWatch: UnwrapRef<typeof import('@vueuse/core')['pausableWatch']>
readonly provide: UnwrapRef<typeof import('vue')['provide']>
readonly provideLocal: UnwrapRef<typeof import('@vueuse/core')['provideLocal']>
readonly reactify: UnwrapRef<typeof import('@vueuse/core')['reactify']>
readonly reactifyObject: UnwrapRef<typeof import('@vueuse/core')['reactifyObject']>
readonly reactive: UnwrapRef<typeof import('vue')['reactive']>
readonly reactiveComputed: UnwrapRef<typeof import('@vueuse/core')['reactiveComputed']>
readonly reactiveOmit: UnwrapRef<typeof import('@vueuse/core')['reactiveOmit']>
readonly reactivePick: UnwrapRef<typeof import('@vueuse/core')['reactivePick']>
readonly readonly: UnwrapRef<typeof import('vue')['readonly']>
readonly ref: UnwrapRef<typeof import('vue')['ref']>
readonly refAutoReset: UnwrapRef<typeof import('@vueuse/core')['refAutoReset']>
readonly refDebounced: UnwrapRef<typeof import('@vueuse/core')['refDebounced']>
readonly refDefault: UnwrapRef<typeof import('@vueuse/core')['refDefault']>
readonly refThrottled: UnwrapRef<typeof import('@vueuse/core')['refThrottled']>
readonly refWithControl: UnwrapRef<typeof import('@vueuse/core')['refWithControl']>
readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']>
readonly resolveRef: UnwrapRef<typeof import('@vueuse/core')['resolveRef']>
readonly resolveUnref: UnwrapRef<typeof import('@vueuse/core')['resolveUnref']>
readonly shallowReactive: UnwrapRef<typeof import('vue')['shallowReactive']>
readonly shallowReadonly: UnwrapRef<typeof import('vue')['shallowReadonly']>
readonly shallowRef: UnwrapRef<typeof import('vue')['shallowRef']>
readonly syncRef: UnwrapRef<typeof import('@vueuse/core')['syncRef']>
readonly syncRefs: UnwrapRef<typeof import('@vueuse/core')['syncRefs']>
readonly templateRef: UnwrapRef<typeof import('@vueuse/core')['templateRef']>
readonly throttledRef: UnwrapRef<typeof import('@vueuse/core')['throttledRef']>
readonly throttledWatch: UnwrapRef<typeof import('@vueuse/core')['throttledWatch']>
readonly toRaw: UnwrapRef<typeof import('vue')['toRaw']>
readonly toReactive: UnwrapRef<typeof import('@vueuse/core')['toReactive']>
readonly toRef: UnwrapRef<typeof import('vue')['toRef']>
readonly toRefs: UnwrapRef<typeof import('vue')['toRefs']>
readonly toValue: UnwrapRef<typeof import('vue')['toValue']>
readonly triggerRef: UnwrapRef<typeof import('vue')['triggerRef']>
readonly tryOnBeforeMount: UnwrapRef<typeof import('@vueuse/core')['tryOnBeforeMount']>
readonly tryOnBeforeUnmount: UnwrapRef<typeof import('@vueuse/core')['tryOnBeforeUnmount']>
readonly tryOnMounted: UnwrapRef<typeof import('@vueuse/core')['tryOnMounted']>
readonly tryOnScopeDispose: UnwrapRef<typeof import('@vueuse/core')['tryOnScopeDispose']>
readonly tryOnUnmounted: UnwrapRef<typeof import('@vueuse/core')['tryOnUnmounted']>
readonly unref: UnwrapRef<typeof import('vue')['unref']>
readonly unrefElement: UnwrapRef<typeof import('@vueuse/core')['unrefElement']>
readonly until: UnwrapRef<typeof import('@vueuse/core')['until']>
readonly useActiveElement: UnwrapRef<typeof import('@vueuse/core')['useActiveElement']>
readonly useAnimate: UnwrapRef<typeof import('@vueuse/core')['useAnimate']>
readonly useArrayDifference: UnwrapRef<typeof import('@vueuse/core')['useArrayDifference']>
readonly useArrayEvery: UnwrapRef<typeof import('@vueuse/core')['useArrayEvery']>
readonly useArrayFilter: UnwrapRef<typeof import('@vueuse/core')['useArrayFilter']>
readonly useArrayFind: UnwrapRef<typeof import('@vueuse/core')['useArrayFind']>
readonly useArrayFindIndex: UnwrapRef<typeof import('@vueuse/core')['useArrayFindIndex']>
readonly useArrayFindLast: UnwrapRef<typeof import('@vueuse/core')['useArrayFindLast']>
readonly useArrayIncludes: UnwrapRef<typeof import('@vueuse/core')['useArrayIncludes']>
readonly useArrayJoin: UnwrapRef<typeof import('@vueuse/core')['useArrayJoin']>
readonly useArrayMap: UnwrapRef<typeof import('@vueuse/core')['useArrayMap']>
readonly useArrayReduce: UnwrapRef<typeof import('@vueuse/core')['useArrayReduce']>
readonly useArraySome: UnwrapRef<typeof import('@vueuse/core')['useArraySome']>
readonly useArrayUnique: UnwrapRef<typeof import('@vueuse/core')['useArrayUnique']>
readonly useAsyncQueue: UnwrapRef<typeof import('@vueuse/core')['useAsyncQueue']>
readonly useAsyncState: UnwrapRef<typeof import('@vueuse/core')['useAsyncState']>
readonly useAttrs: UnwrapRef<typeof import('vue')['useAttrs']>
readonly useBase64: UnwrapRef<typeof import('@vueuse/core')['useBase64']>
readonly useBattery: UnwrapRef<typeof import('@vueuse/core')['useBattery']>
readonly useBluetooth: UnwrapRef<typeof import('@vueuse/core')['useBluetooth']>
readonly useBreakpoints: UnwrapRef<typeof import('@vueuse/core')['useBreakpoints']>
readonly useBroadcastChannel: UnwrapRef<typeof import('@vueuse/core')['useBroadcastChannel']>
readonly useBrowserLocation: UnwrapRef<typeof import('@vueuse/core')['useBrowserLocation']>
readonly useCached: UnwrapRef<typeof import('@vueuse/core')['useCached']>
readonly useClipboard: UnwrapRef<typeof import('@vueuse/core')['useClipboard']>
readonly useClipboardItems: UnwrapRef<typeof import('@vueuse/core')['useClipboardItems']>
readonly useCloned: UnwrapRef<typeof import('@vueuse/core')['useCloned']>
readonly useColorMode: UnwrapRef<typeof import('@vueuse/core')['useColorMode']>
readonly useConfirmDialog: UnwrapRef<typeof import('@vueuse/core')['useConfirmDialog']>
readonly useCounter: UnwrapRef<typeof import('@vueuse/core')['useCounter']>
readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
readonly useCssVar: UnwrapRef<typeof import('@vueuse/core')['useCssVar']>
readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']>
readonly useCurrentElement: UnwrapRef<typeof import('@vueuse/core')['useCurrentElement']>
readonly useCycleList: UnwrapRef<typeof import('@vueuse/core')['useCycleList']>
readonly useDark: UnwrapRef<typeof import('@vueuse/core')['useDark']>
readonly useDateFormat: UnwrapRef<typeof import('@vueuse/core')['useDateFormat']>
readonly useDebounce: UnwrapRef<typeof import('@vueuse/core')['useDebounce']>
readonly useDebounceFn: UnwrapRef<typeof import('@vueuse/core')['useDebounceFn']>
readonly useDebouncedRefHistory: UnwrapRef<typeof import('@vueuse/core')['useDebouncedRefHistory']>
readonly useDeviceMotion: UnwrapRef<typeof import('@vueuse/core')['useDeviceMotion']>
readonly useDeviceOrientation: UnwrapRef<typeof import('@vueuse/core')['useDeviceOrientation']>
readonly useDevicePixelRatio: UnwrapRef<typeof import('@vueuse/core')['useDevicePixelRatio']>
readonly useDevicesList: UnwrapRef<typeof import('@vueuse/core')['useDevicesList']>
readonly useDialog: UnwrapRef<typeof import('naive-ui')['useDialog']>
readonly useDisplayMedia: UnwrapRef<typeof import('@vueuse/core')['useDisplayMedia']>
readonly useDocumentVisibility: UnwrapRef<typeof import('@vueuse/core')['useDocumentVisibility']>
readonly useDraggable: UnwrapRef<typeof import('@vueuse/core')['useDraggable']>
readonly useDropZone: UnwrapRef<typeof import('@vueuse/core')['useDropZone']>
readonly useElementBounding: UnwrapRef<typeof import('@vueuse/core')['useElementBounding']>
readonly useElementByPoint: UnwrapRef<typeof import('@vueuse/core')['useElementByPoint']>
readonly useElementHover: UnwrapRef<typeof import('@vueuse/core')['useElementHover']>
readonly useElementSize: UnwrapRef<typeof import('@vueuse/core')['useElementSize']>
readonly useElementVisibility: UnwrapRef<typeof import('@vueuse/core')['useElementVisibility']>
readonly useEventBus: UnwrapRef<typeof import('@vueuse/core')['useEventBus']>
readonly useEventListener: UnwrapRef<typeof import('@vueuse/core')['useEventListener']>
readonly useEventSource: UnwrapRef<typeof import('@vueuse/core')['useEventSource']>
readonly useEyeDropper: UnwrapRef<typeof import('@vueuse/core')['useEyeDropper']>
readonly useFavicon: UnwrapRef<typeof import('@vueuse/core')['useFavicon']>
readonly useFetch: UnwrapRef<typeof import('@vueuse/core')['useFetch']>
readonly useFileDialog: UnwrapRef<typeof import('@vueuse/core')['useFileDialog']>
readonly useFileSystemAccess: UnwrapRef<typeof import('@vueuse/core')['useFileSystemAccess']>
readonly useFocus: UnwrapRef<typeof import('@vueuse/core')['useFocus']>
readonly useFocusWithin: UnwrapRef<typeof import('@vueuse/core')['useFocusWithin']>
readonly useFps: UnwrapRef<typeof import('@vueuse/core')['useFps']>
readonly useFullscreen: UnwrapRef<typeof import('@vueuse/core')['useFullscreen']>
readonly useGamepad: UnwrapRef<typeof import('@vueuse/core')['useGamepad']>
readonly useGeolocation: UnwrapRef<typeof import('@vueuse/core')['useGeolocation']>
readonly useI18n: UnwrapRef<typeof import('vue-i18n')['useI18n']>
readonly useIdle: UnwrapRef<typeof import('@vueuse/core')['useIdle']>
readonly useImage: UnwrapRef<typeof import('@vueuse/core')['useImage']>
readonly useInfiniteScroll: UnwrapRef<typeof import('@vueuse/core')['useInfiniteScroll']>
readonly useIntersectionObserver: UnwrapRef<typeof import('@vueuse/core')['useIntersectionObserver']>
readonly useInterval: UnwrapRef<typeof import('@vueuse/core')['useInterval']>
readonly useIntervalFn: UnwrapRef<typeof import('@vueuse/core')['useIntervalFn']>
readonly useKeyModifier: UnwrapRef<typeof import('@vueuse/core')['useKeyModifier']>
readonly useLastChanged: UnwrapRef<typeof import('@vueuse/core')['useLastChanged']>
readonly useLink: UnwrapRef<typeof import('vue-router')['useLink']>
readonly useLoadingBar: UnwrapRef<typeof import('naive-ui')['useLoadingBar']>
readonly useLocalStorage: UnwrapRef<typeof import('@vueuse/core')['useLocalStorage']>
readonly useMagicKeys: UnwrapRef<typeof import('@vueuse/core')['useMagicKeys']>
readonly useManualRefHistory: UnwrapRef<typeof import('@vueuse/core')['useManualRefHistory']>
readonly useMediaControls: UnwrapRef<typeof import('@vueuse/core')['useMediaControls']>
readonly useMediaQuery: UnwrapRef<typeof import('@vueuse/core')['useMediaQuery']>
readonly useMemoize: UnwrapRef<typeof import('@vueuse/core')['useMemoize']>
readonly useMemory: UnwrapRef<typeof import('@vueuse/core')['useMemory']>
readonly useMessage: UnwrapRef<typeof import('naive-ui')['useMessage']>
readonly useMounted: UnwrapRef<typeof import('@vueuse/core')['useMounted']>
readonly useMouse: UnwrapRef<typeof import('@vueuse/core')['useMouse']>
readonly useMouseInElement: UnwrapRef<typeof import('@vueuse/core')['useMouseInElement']>
readonly useMousePressed: UnwrapRef<typeof import('@vueuse/core')['useMousePressed']>
readonly useMutationObserver: UnwrapRef<typeof import('@vueuse/core')['useMutationObserver']>
readonly useNavigatorLanguage: UnwrapRef<typeof import('@vueuse/core')['useNavigatorLanguage']>
readonly useNetwork: UnwrapRef<typeof import('@vueuse/core')['useNetwork']>
readonly useNotification: UnwrapRef<typeof import('naive-ui')['useNotification']>
readonly useNow: UnwrapRef<typeof import('@vueuse/core')['useNow']>
readonly useObjectUrl: UnwrapRef<typeof import('@vueuse/core')['useObjectUrl']>
readonly useOffsetPagination: UnwrapRef<typeof import('@vueuse/core')['useOffsetPagination']>
readonly useOnline: UnwrapRef<typeof import('@vueuse/core')['useOnline']>
readonly usePageLeave: UnwrapRef<typeof import('@vueuse/core')['usePageLeave']>
readonly useParallax: UnwrapRef<typeof import('@vueuse/core')['useParallax']>
readonly useParentElement: UnwrapRef<typeof import('@vueuse/core')['useParentElement']>
readonly usePerformanceObserver: UnwrapRef<typeof import('@vueuse/core')['usePerformanceObserver']>
readonly usePermission: UnwrapRef<typeof import('@vueuse/core')['usePermission']>
readonly usePointer: UnwrapRef<typeof import('@vueuse/core')['usePointer']>
readonly usePointerLock: UnwrapRef<typeof import('@vueuse/core')['usePointerLock']>
readonly usePointerSwipe: UnwrapRef<typeof import('@vueuse/core')['usePointerSwipe']>
readonly usePreferredColorScheme: UnwrapRef<typeof import('@vueuse/core')['usePreferredColorScheme']>
readonly usePreferredContrast: UnwrapRef<typeof import('@vueuse/core')['usePreferredContrast']>
readonly usePreferredDark: UnwrapRef<typeof import('@vueuse/core')['usePreferredDark']>
readonly usePreferredLanguages: UnwrapRef<typeof import('@vueuse/core')['usePreferredLanguages']>
readonly usePreferredReducedMotion: UnwrapRef<typeof import('@vueuse/core')['usePreferredReducedMotion']>
readonly usePrevious: UnwrapRef<typeof import('@vueuse/core')['usePrevious']>
readonly useRafFn: UnwrapRef<typeof import('@vueuse/core')['useRafFn']>
readonly useRefHistory: UnwrapRef<typeof import('@vueuse/core')['useRefHistory']>
readonly useResizeObserver: UnwrapRef<typeof import('@vueuse/core')['useResizeObserver']>
readonly useRoute: UnwrapRef<typeof import('vue-router')['useRoute']>
readonly useRouter: UnwrapRef<typeof import('vue-router')['useRouter']>
readonly useScreenOrientation: UnwrapRef<typeof import('@vueuse/core')['useScreenOrientation']>
readonly useScreenSafeArea: UnwrapRef<typeof import('@vueuse/core')['useScreenSafeArea']>
readonly useScriptTag: UnwrapRef<typeof import('@vueuse/core')['useScriptTag']>
readonly useScroll: UnwrapRef<typeof import('@vueuse/core')['useScroll']>
readonly useScrollLock: UnwrapRef<typeof import('@vueuse/core')['useScrollLock']>
readonly useSessionStorage: UnwrapRef<typeof import('@vueuse/core')['useSessionStorage']>
readonly useShare: UnwrapRef<typeof import('@vueuse/core')['useShare']>
readonly useSlots: UnwrapRef<typeof import('vue')['useSlots']>
readonly useSorted: UnwrapRef<typeof import('@vueuse/core')['useSorted']>
readonly useSpeechRecognition: UnwrapRef<typeof import('@vueuse/core')['useSpeechRecognition']>
readonly useSpeechSynthesis: UnwrapRef<typeof import('@vueuse/core')['useSpeechSynthesis']>
readonly useStepper: UnwrapRef<typeof import('@vueuse/core')['useStepper']>
readonly useStorage: UnwrapRef<typeof import('@vueuse/core')['useStorage']>
readonly useStorageAsync: UnwrapRef<typeof import('@vueuse/core')['useStorageAsync']>
readonly useStyleTag: UnwrapRef<typeof import('@vueuse/core')['useStyleTag']>
readonly useSupported: UnwrapRef<typeof import('@vueuse/core')['useSupported']>
readonly useSwipe: UnwrapRef<typeof import('@vueuse/core')['useSwipe']>
readonly useTemplateRefsList: UnwrapRef<typeof import('@vueuse/core')['useTemplateRefsList']>
readonly useTextDirection: UnwrapRef<typeof import('@vueuse/core')['useTextDirection']>
readonly useTextSelection: UnwrapRef<typeof import('@vueuse/core')['useTextSelection']>
readonly useTextareaAutosize: UnwrapRef<typeof import('@vueuse/core')['useTextareaAutosize']>
readonly useThrottle: UnwrapRef<typeof import('@vueuse/core')['useThrottle']>
readonly useThrottleFn: UnwrapRef<typeof import('@vueuse/core')['useThrottleFn']>
readonly useThrottledRefHistory: UnwrapRef<typeof import('@vueuse/core')['useThrottledRefHistory']>
readonly useTimeAgo: UnwrapRef<typeof import('@vueuse/core')['useTimeAgo']>
readonly useTimeout: UnwrapRef<typeof import('@vueuse/core')['useTimeout']>
readonly useTimeoutFn: UnwrapRef<typeof import('@vueuse/core')['useTimeoutFn']>
readonly useTimeoutPoll: UnwrapRef<typeof import('@vueuse/core')['useTimeoutPoll']>
readonly useTimestamp: UnwrapRef<typeof import('@vueuse/core')['useTimestamp']>
readonly useTitle: UnwrapRef<typeof import('@vueuse/core')['useTitle']>
readonly useToNumber: UnwrapRef<typeof import('@vueuse/core')['useToNumber']>
readonly useToString: UnwrapRef<typeof import('@vueuse/core')['useToString']>
readonly useToggle: UnwrapRef<typeof import('@vueuse/core')['useToggle']>
readonly useTransition: UnwrapRef<typeof import('@vueuse/core')['useTransition']>
readonly useUrlSearchParams: UnwrapRef<typeof import('@vueuse/core')['useUrlSearchParams']>
readonly useUserMedia: UnwrapRef<typeof import('@vueuse/core')['useUserMedia']>
readonly useVModel: UnwrapRef<typeof import('@vueuse/core')['useVModel']>
readonly useVModels: UnwrapRef<typeof import('@vueuse/core')['useVModels']>
readonly useVibrate: UnwrapRef<typeof import('@vueuse/core')['useVibrate']>
readonly useVirtualList: UnwrapRef<typeof import('@vueuse/core')['useVirtualList']>
readonly useWakeLock: UnwrapRef<typeof import('@vueuse/core')['useWakeLock']>
readonly useWebNotification: UnwrapRef<typeof import('@vueuse/core')['useWebNotification']>
readonly useWebSocket: UnwrapRef<typeof import('@vueuse/core')['useWebSocket']>
readonly useWebWorker: UnwrapRef<typeof import('@vueuse/core')['useWebWorker']>
readonly useWebWorkerFn: UnwrapRef<typeof import('@vueuse/core')['useWebWorkerFn']>
readonly useWindowFocus: UnwrapRef<typeof import('@vueuse/core')['useWindowFocus']>
readonly useWindowScroll: UnwrapRef<typeof import('@vueuse/core')['useWindowScroll']>
readonly useWindowSize: UnwrapRef<typeof import('@vueuse/core')['useWindowSize']>
readonly watch: UnwrapRef<typeof import('vue')['watch']>
readonly watchArray: UnwrapRef<typeof import('@vueuse/core')['watchArray']>
readonly watchAtMost: UnwrapRef<typeof import('@vueuse/core')['watchAtMost']>
readonly watchDebounced: UnwrapRef<typeof import('@vueuse/core')['watchDebounced']>
readonly watchDeep: UnwrapRef<typeof import('@vueuse/core')['watchDeep']>
readonly watchEffect: UnwrapRef<typeof import('vue')['watchEffect']>
readonly watchIgnorable: UnwrapRef<typeof import('@vueuse/core')['watchIgnorable']>
readonly watchImmediate: UnwrapRef<typeof import('@vueuse/core')['watchImmediate']>
readonly watchOnce: UnwrapRef<typeof import('@vueuse/core')['watchOnce']>
readonly watchPausable: UnwrapRef<typeof import('@vueuse/core')['watchPausable']>
readonly watchPostEffect: UnwrapRef<typeof import('vue')['watchPostEffect']>
readonly watchSyncEffect: UnwrapRef<typeof import('vue')['watchSyncEffect']>
readonly watchThrottled: UnwrapRef<typeof import('@vueuse/core')['watchThrottled']>
readonly watchTriggerable: UnwrapRef<typeof import('@vueuse/core')['watchTriggerable']>
readonly watchWithFilter: UnwrapRef<typeof import('@vueuse/core')['watchWithFilter']>
readonly whenever: UnwrapRef<typeof import('@vueuse/core')['whenever']>
}
}
}
+54
View File
@@ -0,0 +1,54 @@
# vim:sw=4:ts=4:et
#
# BASE_URL is the path the app is served under: `/` (the default) for a deployment at the
# root of a domain, `/it-tools/` for one behind a reverse proxy that mounts it on a
# subpath. It is a runtime setting, not a build one -- the image ships assets that work at
# any path, and nginx.conf rewrites the `<base href>` in index.html per request.
#
# Normalise it here, once, before 20-envsubst-on-templates.sh renders the config:
#
# - accept `it-tools`, `/it-tools` and `/it-tools/` alike, always emit `/it-tools/`.
# A missing trailing slash would otherwise silently move the app one directory up,
# because that is how the browser resolves relative URLs against `<base href>`.
# - reject anything that is not a plain path. The value is interpolated into an HTML
# attribute and into an nginx regex, so a stray quote or `..` is worth catching here
# rather than letting it land in the served page.
#
# Sourced, not executed, so the export reaches the envsubst step.
_base_url=$(printf '%s' "${BASE_URL:-/}" | sed -e 's#^/*#/#' -e 's#/*$#/#')
case "$_base_url" in
# `/` itself, or `/segment/segment/` made of unreserved URL characters.
/) ;;
*/../* | *//*)
_base_url_invalid=1
;;
*[!A-Za-z0-9._~/-]*)
_base_url_invalid=1
;;
esac
if [ -n "${_base_url_invalid:-}" ]; then
echo "18-resolve-base-url.envsh: error: BASE_URL='$BASE_URL' is not a plain path, falling back to /" >&2
_base_url=/
fi
if [ "$_base_url" != "/" ] && [ -z "${NGINX_ENTRYPOINT_QUIET_LOGS:-}" ]; then
echo "18-resolve-base-url.envsh: info: serving the app under $_base_url"
fi
BASE_URL="$_base_url"
# Regex-safe forms of the same value, for the rewrites in nginx.conf. `.` is a legal
# character in a path and the validation above lets it through, but it is also the one
# regex metacharacter that survives that filter: unescaped, a BASE_URL of `/it.tools/`
# would strip the prefix from `/itXtools/...` too.
BASE_URL_REGEX=$(printf '%s' "$_base_url" | sed 's/\./\\./g')
# `/it-tools/` -> `/it-tools`, so nginx.conf can redirect the slash-less spelling to the
# real one. Empty for a deployment at the root, where there is nothing to redirect.
BASE_URL_NO_SLASH_REGEX="${BASE_URL_REGEX%/}"
export BASE_URL BASE_URL_REGEX BASE_URL_NO_SLASH_REGEX
unset _base_url _base_url_invalid
+36
View File
@@ -0,0 +1,36 @@
# vim:sw=4:ts=4:et
#
# 20-envsubst-on-templates.sh guards its output directory with `[ ! -w $dir ]`,
# which only inspects permission bits. It therefore does not notice a read-only
# *mount*: with `docker run --read-only` or a Kubernetes readOnlyRootFilesystem,
# /etc/nginx/conf.d still looks writable, envsubst runs anyway, the redirect
# fails with EROFS and `set -e` takes the container down. The image
# crash-loops on every start.
#
# Probe the directory with a real write. If it fails, point the template
# directory at a path that does not exist so 20-envsubst-on-templates.sh
# returns early, and let nginx use the config rendered into the image at build
# time instead. Sourced, not executed, so the export reaches later scripts.
#
# On a writable filesystem -- every deployment that works today -- the probe
# succeeds and nothing is changed.
_envsubst_output_dir="${NGINX_ENVSUBST_OUTPUT_DIR:-/etc/nginx/conf.d}"
_envsubst_probe="$_envsubst_output_dir/.readonly-probe.$$"
if [ -d "${NGINX_ENVSUBST_TEMPLATE_DIR:-/etc/nginx/templates}" ] \
&& ! (touch "$_envsubst_probe" 2>/dev/null && rm -f "$_envsubst_probe" 2>/dev/null); then
if [ -z "${NGINX_ENTRYPOINT_QUIET_LOGS:-}" ]; then
echo "19-skip-envsubst-if-readonly.envsh: info: $_envsubst_output_dir is not writable, keeping the config baked into the image"
fi
# The baked config carries the image defaults, so anything that is only applied by
# rendering the template is quietly lost. $PORT has always had this caveat; say so for
# BASE_URL too, where the symptom (an app that loads from the wrong path) is a lot less
# obvious than a port that did not move.
if [ "${BASE_URL:-/}" != "/" ]; then
echo "19-skip-envsubst-if-readonly.envsh: warning: BASE_URL=$BASE_URL cannot be applied on a read-only filesystem; mount a writable $_envsubst_output_dir (a tmpfs or an emptyDir will do)" >&2
fi
export NGINX_ENVSUBST_TEMPLATE_DIR=/nonexistent-read-only-filesystem
fi
unset _envsubst_output_dir _envsubst_probe
@@ -0,0 +1,55 @@
#!/bin/sh
# vim:sw=4:ts=4:et
#
# nginx.conf listens on both IPv4 and IPv6. On a host or container runtime with
# IPv6 disabled, nginx refuses to start:
#
# socket() [::]:8080 failed (97: Address family not supported by protocol)
#
# Drop the IPv6 listen directives in that case. This runs after
# 20-envsubst-on-templates.sh so it edits the rendered config, and it is a
# no-op wherever IPv6 is available, which is the case the image already
# handles today.
set -e
ME=$(basename "$0")
entrypoint_log() {
if [ -z "${NGINX_ENTRYPOINT_QUIET_LOGS:-}" ]; then
echo "$@"
fi
}
# Same check the stock 10-listen-on-ipv6-by-default.sh uses.
if [ -f "/proc/net/if_inet6" ]; then
exit 0
fi
output_dir="${NGINX_ENVSUBST_OUTPUT_DIR:-/etc/nginx/conf.d}"
[ -d "$output_dir" ] || exit 0
# `sed -i` rewrites through a temporary file in the directory, so the directory
# has to be writable, not only the file. Probe it with a real write, the same
# way 19-skip-envsubst-if-readonly.envsh does.
probe="$output_dir/.ipv6-probe.$$"
if ! (touch "$probe" 2>/dev/null && rm -f "$probe" 2>/dev/null); then
entrypoint_log "$ME: info: ipv6 not available, but $output_dir is not writable (read-only file system?), leaving the config alone"
exit 0
fi
for conf in "$output_dir"/*.conf; do
[ -f "$conf" ] || continue
grep -q -E '^[[:space:]]*listen[[:space:]]+\[::\]' "$conf" || continue
# An individual file can still be mounted read-only inside a writable
# directory, so a failed edit must not take the entrypoint down with it.
if sed -i -E 's/^([[:space:]]*)(listen[[:space:]]+\[::\].*)$/\1# \2 # disabled by '"$ME"': no IPv6 on this host/' "$conf" 2>/dev/null; then
entrypoint_log "$ME: info: ipv6 not available, disabled IPv6 listen in $conf"
else
entrypoint_log "$ME: info: ipv6 not available, but can not modify $conf, leaving it alone"
fi
done
exit 0
+7 -2
View File
@@ -1,9 +1,14 @@
services:
it-tools:
container_name: it-tools-subfolder
image: ghcr.io/sharevb/it-tools:baseurl-it-tools
image: ghcr.io/sharevb/it-tools:latest
pull_policy: always
restart: unless-stopped
environment:
# The path the app is served under. This is all a subfolder deployment needs -- the
# regular image works at any path, there is no subfolder-specific tag to pull and
# nothing to rebuild.
BASE_URL: /it-tools/
nginx-reverse-proxy:
image: nginx:alpine
depends_on:
@@ -11,4 +16,4 @@ services:
volumes:
- "./nginx.conf:/etc/nginx/conf.d/default.conf"
ports:
- 80:80
- 80:80
+3
View File
@@ -2,6 +2,9 @@ server {
listen 80;
server_name _;
# The trailing slash on proxy_pass strips /it-tools/ before the request reaches the
# container. It works the other way round too -- `proxy_pass http://it-tools-subfolder:8080;`
# forwards the prefix as-is -- because the app's own nginx.conf handles both.
location /it-tools/ {
proxy_pass http://it-tools-subfolder:8080/;
}
+52
View File
@@ -0,0 +1,52 @@
services:
it-tools:
image: sharevb/it-tools:latest
pull_policy: always
restart: unless-stopped
environment:
- BASIC_AUTH=${BASIC_AUTH}
volumes:
- ./tools-settings.json:/usr/share/nginx/html/tools-settings.json
ports:
- 8080:8080
docker-image-download-server:
image: sharevb/docker-image-download-server:latest
pull_policy: always
restart: unless-stopped
environment:
- BASIC_AUTH=${BASIC_AUTH}
ports:
- 8001:3000
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ws-tcp-udp-bridge:
image: sharevb/ws-tcp-udp-bridge:latest
pull_policy: always
restart: unless-stopped
ports:
- 8002:8080
network-utils-ws:
image: sharevb/network-utils-ws:latest
pull_policy: always
restart: unless-stopped
environment:
- BASIC_AUTH=${BASIC_AUTH}
ports:
- 8003:8000
puppeteer-htmltopdf:
image: sharevb/puppeteer-htmltopdf:latest
pull_policy: always
restart: unless-stopped
environment:
- BASIC_AUTH=${BASIC_AUTH}
ports:
- 8004:3000
cors-anywhere:
image: sharevb/cors-anywhere:latest
pull_policy: always
restart: unless-stopped
environment:
- CORSANYWHERE_BASIC_AUTH=${BASIC_AUTH}
- CORSANYWHERE_ALLOWED_HTTP_METHODS=HEAD,GET,POST
ports:
- 8005:8080
+37
View File
@@ -0,0 +1,37 @@
{
"dns-prop": {
"url": "http://localhost:8003",
"auth": "alice:b@b"
},
"dns-tester": {
"url": "http://localhost:8003",
"auth": "alice:b@b"
},
"docker-dl": {
"url": "http://localhost:8001",
"auth": "alice:b@b"
},
"html-to-pdf": {
"url": "http://localhost:8004",
"auth": "alice:b@b"
},
"https-tester": {
"url": "http://localhost:8003",
"auth": "alice:b@b"
},
"multi-links-dl": {
"url": "http://localhost:8005",
"auth": "alice:b@b"
},
"ping": {
"url": "http://localhost:8003",
"auth": "alice:b@b"
},
"short-urls-expander": {
"cors-anywhere-url": "http://localhost:8005",
"auth": "alice:b@b"
},
"tcp-udp-port-tester": {
"ws": "ws://localhost:8002"
}
}
+19 -1
View File
@@ -2,6 +2,25 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="theme-color" content="#f1f5f9" />
<style>
html { color-scheme: light; }
html.dark { color-scheme: dark; }
html, body { background-color: #f1f5f9; }
html.dark, html.dark body { background-color: #1c1c1c; }
</style>
<script>
(function () {
try {
var mode = localStorage.getItem('vueuse-color-scheme') || 'auto';
if (mode === 'dark' || (mode === 'auto' && matchMedia('(prefers-color-scheme: dark)').matches)) {
document.documentElement.classList.add('dark');
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#1c1c1c');
}
}
catch (e) {}
})();
</script>
<link rel="icon" href="favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>IT Tools - Handy online tools for developers</title>
@@ -14,7 +33,6 @@
<link rel="mask-icon" href="safari-pinned-tab.svg" color="#18a058" />
<meta name="msapplication-TileColor" content="#da532c" />
<meta name="theme-color" content="#ffffff" />
<meta property="og:url" content="https://sharevb-it-tools.vercel.app/" />
<meta property="og:type" content="website" />
+2413 -5
View File
File diff suppressed because it is too large. Load diff
+2422 -5
View File
File diff suppressed because it is too large. Load diff
+2472 -6
View File
File diff suppressed because it is too large. Load diff
+2475 -7
View File
File diff suppressed because it is too large. Load diff
+1845 -40
View File
File diff suppressed because it is too large. Load diff
+2449 -5
View File
File diff suppressed because it is too large. Load diff
+4270 -1925
View File
File diff suppressed because it is too large. Load diff
+2450 -5
View File
File diff suppressed because it is too large. Load diff
+10459
View File
File diff suppressed because it is too large. Load diff
+6455 -4147
View File
File diff suppressed because it is too large. Load diff
+2348 -5
View File
File diff suppressed because it is too large. Load diff
+2446 -5
View File
File diff suppressed because it is too large. Load diff
+2427 -3
View File
File diff suppressed because it is too large. Load diff
+2442 -6
View File
File diff suppressed because it is too large. Load diff
+2446 -5
View File
File diff suppressed because it is too large. Load diff
+2466 -5
View File
File diff suppressed because it is too large. Load diff
+2448 -6
View File
File diff suppressed because it is too large. Load diff
+2437 -5
View File
File diff suppressed because it is too large. Load diff
+2443 -5
View File
File diff suppressed because it is too large. Load diff
+9926
View File
File diff suppressed because it is too large. Load diff
+5185 -2836
View File
File diff suppressed because it is too large. Load diff
+58 -8
View File
@@ -5,22 +5,72 @@ server {
root /usr/share/nginx/html;
index index.html;
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header Referrer-Policy strict-origin-when-cross-origin;
add_header X-Permitted-Cross-Domain-Policies none;
add_header Cross-Origin-Resource-Policy same-site;
#add_header X-Frame-Options SAMEORIGIN;
#add_header X-Content-Type-Options nosniff;
#add_header Referrer-Policy strict-origin-when-cross-origin;
#add_header X-Permitted-Cross-Domain-Policies none;
#add_header Cross-Origin-Resource-Policy same-site;
add_header Cross-Origin-Opener-Policy same-origin;
add_header Cross-Origin-Embedder-Policy require-corp;
#add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' http: https: blob:; style-src 'self' 'unsafe-inline' https: http:; img-src 'self' data: blob: https: http:; connect-src data: blob: https: http:; font-src 'self' https: http:; object-src 'none'; base-uri 'self'; form-action 'self';";
include /etc/nginx/mime.types;
types {
application/javascript js mjs;
# mime.types already maps js, remapping it here only emits a
# "duplicate extension" warning on every startup.
application/javascript mjs;
}
# `/it-tools` is the same place as `/it-tools/`, but only the second one gives the
# browser the right directory to resolve the app's relative URLs against, so send the
# first one there. Renders to `^$` -- which no request URI can match -- when the app is
# served from the root. Relative Location headers, because $scheme is whatever the
# reverse proxy used to reach the container, not what the browser used.
absolute_redirect off;
rewrite ^${BASE_URL_NO_SLASH_REGEX}$ ${BASE_URL} permanent;
# Serving the app from a subpath (BASE_URL, normalised by
# docker-entrypoint.d/18-resolve-base-url.envsh, `/` by default).
#
# The build is path-agnostic: every asset is referenced relatively, and the one
# absolute anchor is a `<base href="/">` in index.html that the app itself reads its
# base from (src/utils/base-url.ts). Rewriting that single tag on the way out is
# therefore enough to move the whole app to another path -- no rebuild, no
# subpath-specific image.
#
# sub_filter drops Last-Modified/ETag from every response it touches, and text/html is
# always in scope (sub_filter_types can add types, not exclude HTML). So: index.html,
# which an SPA must not cache anyway and which the service worker precaches regardless,
# and the one other HTML document in the build -- the visual-subnet-calculator's iframe,
# public/visualsubnetcalc/calc.html -- which loses conditional revalidation and is
# refetched in full when that tool is opened.
sub_filter '<base href="/">' '<base href="${BASE_URL}">';
sub_filter_once on;
# Hashed build output, with or without the deployment prefix in front of it: a reverse
# proxy may pass `/it-tools/assets/...` through as-is or strip the prefix first, and
# both have to land on the same file. Without this, a missing chunk falls through to
# index.html below and is served as text/html with a 200, which the browser rejects
# with an opaque MIME error instead of a plain 404.
location ~ ^/(?:.*/)?assets/(?<asset>.+)$ {
# Serve gzip sidecars when supported, including requests from reverse proxies.
gzip_static on;
gzip_proxied any;
gzip_vary on;
try_files /assets/$asset =404;
}
location / {
rewrite ^/it-tools/(.*) /$1 break;
try_files $uri $uri/ /index.html;
# Same story for everything else the app fetches by path (the JSON config files,
# the WASM helpers in public/): drop the deployment prefix when the proxy forwarded
# it instead of stripping it. Renders to `^/(.*)$` -- a no-op -- for the default
# BASE_URL of `/`.
rewrite ^${BASE_URL_REGEX}(.*)$ /$1 break;
# No `$uri/`: nothing in the build is a directory with an index in it, so the only
# thing matching one ever produced was nginx's own "add the trailing slash"
# redirect -- computed from the URI *after* the rewrite above, so under a subpath
# `/it-tools/figlet-fonts` bounced the browser out of the app to `/figlet-fonts/`
# (and then to a 403). Unknown paths belong to the SPA, which has a 404 page.
try_files $uri /index.html;
}
}
+20
View File
@@ -0,0 +1,20 @@
import { defineConfig } from 'oxfmt';
export default defineConfig({
printWidth: 120,
tabWidth: 2,
useTabs: false,
semi: true,
singleQuote: true,
trailingComma: 'all',
arrowParens: 'always',
endOfLine: 'lf',
ignorePatterns: [
'src/libs/**',
'dist/**',
'coverage/**',
'auto-imports.d.ts',
'components.d.ts',
'pnpm-lock.yaml',
],
});
+87
View File
@@ -0,0 +1,87 @@
import { defineConfig } from 'oxlint';
export default defineConfig({
plugins: ['eslint', 'typescript', 'oxc', 'unicorn', 'import', 'promise', 'vue', 'vitest'],
categories: {
correctness: 'error',
},
// Type-aware rules run through oxlint-tsgolint, which ships its own checker
// binary, so this does not depend on the project's TypeScript version.
// Note it only analyses .ts files -- .vue script blocks are covered by
// `pnpm typecheck` (vue-tsc) instead.
options: {
typeAware: true,
},
env: {
browser: true,
es2026: true,
},
globals: {
process: 'readonly',
},
ignorePatterns: [
'src/libs/**',
'dist/**',
'coverage/**',
'auto-imports.d.ts',
'components.d.ts',
],
rules: {
'eslint/curly': ['error', 'all'],
'typescript/no-use-before-define': [
'error',
{ allowNamedExports: true, functions: false },
],
'eslint/no-restricted-imports': [
'error',
{
paths: [
{
name: '@vueuse/core',
importNames: ['useClipboard'],
message: 'Please use local useCopy from src/composable/copy.ts instead of useClipboard.',
},
],
},
],
'no-undef': 'off',
'eslint/no-unused-vars': [
'error',
{ caughtErrors: 'none', varsIgnorePattern: '^_', argsIgnorePattern: '^_' },
],
'eslint/no-useless-escape': 'off',
// Staged as warnings while the existing findings are worked through, so
// they surface without failing the build. Promote to "error" per rule as
// each one reaches zero.
'typescript/await-thenable': 'warn',
'typescript/no-base-to-string': 'warn',
'typescript/no-duplicate-type-constituents': 'warn',
'typescript/no-floating-promises': 'warn',
'typescript/no-for-in-array': 'warn',
'typescript/no-misused-spread': 'warn',
'typescript/no-redundant-type-constituents': 'warn',
'typescript/no-useless-default-assignment': 'warn',
'typescript/restrict-template-expressions': 'warn',
'typescript/unbound-method': 'warn',
'import/default': 'off',
'vue/no-dupe-keys': 'off',
'vitest/valid-expect': 'off',
'vitest/expect-expect': 'off',
'vitest/require-to-throw-message': 'off',
},
overrides: [
{
files: ['**/*.test.ts', '**/*.spec.ts', '**/*.e2e.spec.ts'],
env: { vitest: true },
},
{
files: ['**/calendar-converter/calendar-converter.service.ts'],
rules: {
'eslint/no-unused-vars': 'off',
'oxc/erasing-op': 'off',
},
},
],
});
+254 -215
View File
@@ -1,103 +1,129 @@
{
"name": "it-tools",
"type": "module",
"version": "2026.1.4",
"packageManager": "pnpm@9.15.9",
"version": "2026.10.25",
"description": "Collection of handy online tools for developers, with great UX. ",
"author": "Corentin Th <corentin.thomasset74+it-tools@gmail.com> (https://corentin.tech)",
"keywords": [
"converter",
"developer-productivity",
"developer-tools",
"frontend",
"productivity",
"tool",
"tools",
"vuejs",
"website"
],
"license": "GNU GPLv3",
"author": "Corentin Th <corentin.thomasset74+it-tools@gmail.com> (https://corentin.tech)",
"repository": {
"type": "git",
"url": "https://github.com/sharevb/it-tools"
},
"keywords": [
"productivity",
"converter",
"website",
"vuejs",
"tools",
"frontend",
"tool",
"developer-tools",
"developer-productivity"
],
"type": "module",
"scripts": {
"dev": "vite",
"build": "vue-tsc --noEmit && . ./set_node_mem.sh && vite build",
"build": "vite build",
"preview": "vite preview --port 5050",
"test": "TZ=UTC npm run test:unit",
"test:unit": "TZ=UTC . ./set_node_mem.sh && vitest --environment jsdom",
"test:e2e": "TZ=UTC . ./set_node_mem.sh && playwright test",
"test:e2e:dev": "TZ=UTC BASE_URL=http://localhost:5173 NO_WEB_SERVER=true playwright test",
"test:unit": "vitest",
"test:e2e": "playwright test",
"coverage": "vitest run --coverage",
"typecheck": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
"lint": "eslint src --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore",
"lint": "oxlint src",
"lint:fix": "oxlint src --fix",
"fmt": "oxfmt src",
"fmt:check": "oxfmt --check src",
"script:create:tool": "node scripts/create-tool.mjs",
"script:create:ui": "hygen generator ui-component",
"release": "node ./scripts/release.mjs",
"script:extract:desc": "node ./scripts/extract-tools-desc.mjs",
"script:extract:strings": "node ./scripts/extract-tools-strings.mjs",
"script:update:git-templates": "node ./scripts/update-git-templates.mjs",
"script:translate-missing": "node ./scripts/translate-missings.mjs -e ./locales/en.yml -t ./locales/*.yml",
"vue-i18n-extract": "vue-i18n-extract report --vueFiles 'src/**/*.?(ts|vue)' --languageFiles 'locales/*.yml'",
"precommit": "pnpm install --ignore-scripts && pnpm lint --fix && pnpm typecheck"
"precommit": "pnpm install --ignore-scripts && pnpm lint:fix && pnpm typecheck"
},
"dependencies": {
"@boxyhq/saml20": "^1.16.0",
"@chenfengyuan/vue-barcode": "^2.0.2",
"@codemirror/lang-cpp": "^6.0.3",
"@codemirror/lang-css": "^6.3.1",
"@codemirror/lang-go": "^6.0.1",
"@codemirror/lang-html": "^6.4.11",
"@codemirror/lang-javascript": "^6.2.5",
"@codemirror/lang-json": "^6.0.2",
"@codemirror/lang-markdown": "^6.5.0",
"@codemirror/lang-php": "^6.0.2",
"@codemirror/lang-python": "^6.2.1",
"@codemirror/lang-sql": "^6.10.0",
"@codemirror/lang-xml": "^6.1.0",
"@codemirror/lang-yaml": "^6.1.3",
"@codemirror/language": "^6.12.4",
"@codemirror/state": "^6.7.0",
"@codemirror/theme-one-dark": "^6.1.3",
"@codemirror/view": "^6.43.5",
"@colordx/core": "^5.5.0",
"@date-fns/utc": "^2.1.1",
"@dice-roller/rpg-dice-roller": "^5.5.1",
"@faker-js/faker": "^10.2.0",
"@faker-js/faker": "^10.5.0",
"@ffmpeg/core": "0.12.10",
"@ffmpeg/ffmpeg": "^0.12.15",
"@ffmpeg/util": "^0.12.2",
"@finegym/fitness-calc": "^1.0.1",
"@fortawesome/fontawesome-svg-core": "^6.7.2",
"@fortawesome/free-solid-svg-icons": "^6.7.2",
"@fortawesome/vue-fontawesome": "^3.0.8",
"@fontsource/open-sans": "^5.3.0",
"@fontsource/varela-round": "^5.3.0",
"@fortawesome/fontawesome-svg-core": "^7.3.0",
"@fortawesome/free-solid-svg-icons": "^7.3.0",
"@fortawesome/vue-fontawesome": "^3.3.1",
"@github/paste-markdown": "^1.5.3",
"@guolao/vue-monaco-editor": "^1.5.5",
"@guolao/vue-monaco-editor": "^1.6.0",
"@guyplusplus/turndown-plugin-gfm": "^1.0.7",
"@huggingface/transformers": "3.7.2",
"@iplookup/country-extra": "^1.0.20251209",
"@huggingface/transformers": "4.3.2",
"@iplookup/country-extra": "^1.0.20260711",
"@it-tools/bip39": "^0.0.4",
"@it-tools/oggen": "^1.3.0",
"@jsonquerylang/jsonquery": "^5.1.1",
"@kenjiuno/decompressrtf": "^0.1.4",
"@kenjiuno/msgreader": "^1.27.0",
"@kenjiuno/msgreader": "^1.28.0",
"@langfreak/convert-layout": "^0.11.2",
"@lezer/highlight": "^1.2.3",
"@mdit/plugin-align": "^0.16.0",
"@noble/ciphers": "^1.2.1",
"@noble/ciphers": "^1.3.0",
"@plausible-analytics/tracker": "^0.4.6",
"@regexper/render": "^1.0.0",
"@resvg/resvg-wasm": "^2.6.2",
"@sindresorhus/slugify": "^3.0.0",
"@skeepit/unicode-to-gsm7": "^1.0.0",
"@tabler/icons-vue": "^3.20.0",
"@tiptap/core": "^3.22.5",
"@tiptap/extension-color": "^3.22.5",
"@tiptap/extension-gapcursor": "^3.22.5",
"@tiptap/extension-highlight": "^3.22.5",
"@tiptap/extension-table": "^3.22.5",
"@tiptap/extension-text-align": "^3.22.5",
"@tiptap/extension-text-style": "^3.22.5",
"@tiptap/extensions": "^3.22.5",
"@tiptap/pm": "^3.22.5",
"@tiptap/starter-kit": "^3.22.5",
"@tiptap/vue-3": "^3.22.5",
"@toon-format/toon": "^2.1.0",
"@tabler/icons-vue": "^3.44.0",
"@tesseract.js-data/chi_sim": "^1.0.0",
"@tesseract.js-data/eng": "^1.0.0",
"@tiptap/core": "^3.31.3",
"@tiptap/extension-color": "^3.31.3",
"@tiptap/extension-gapcursor": "^3.31.3",
"@tiptap/extension-highlight": "^3.31.3",
"@tiptap/extension-table": "^3.31.3",
"@tiptap/extension-text-align": "^3.31.3",
"@tiptap/extension-text-style": "^3.31.3",
"@tiptap/extensions": "^3.31.3",
"@tiptap/pm": "^3.31.3",
"@tiptap/starter-kit": "^3.31.3",
"@tiptap/vue-3": "^3.31.3",
"@toon-format/toon": "^4.1.1",
"@types/haversine": "^1.1.8",
"@types/html-to-text": "^9.0.4",
"@types/swagger-ui-dist": "^3.30.6",
"@unicode/unicode-15.1.0": "^1.6.16",
"@unicode/unicode-15.1.0": "^1.6.17",
"@vicons/material": "^0.12.0",
"@vicons/tabler": "^0.12.0",
"@vueuse/core": "^10.11.1",
"@vueuse/head": "^1.0.0",
"@vueuse/integrations": "^14.2.0",
"@vueuse/router": "^10.0.0",
"@xmldom/xmldom": "^0.8.13",
"@vueuse/head": "^1.3.1",
"@vueuse/integrations": "^14.3.0",
"@vueuse/router": "^10.11.1",
"@xmldom/xmldom": "^0.8.15",
"@xterm/xterm": "^5.5.0",
"@younestouati/playing-cards-standard-deck": "^6.0.1",
"@zxcvbn-ts/core": "^3.0.4",
"@zxcvbn-ts/language-common": "^3.0.4",
"@zxcvbn-ts/language-en": "^3.0.2",
"@zxing/library": "^0.21.3",
"@zxing/library": "^0.23.0",
"a11y-color-contrast": "^0.2.0",
"abort-signal-polyfill": "^1.0.0",
"aircodes": "^1.3.16",
@@ -111,40 +137,41 @@
"bech32": "^2.0.0",
"big.js": "^7.0.1",
"braces": "^3.0.3",
"bwip-js": "^4.8.0",
"bwip-js": "^4.11.2",
"byte-data": "^19.0.1",
"change-case": "^5.4.4",
"chardet": "^2.1.1",
"chardet": "^2.2.0",
"chart.js": "^4.5.1",
"chartjs-plugin-zoom": "^2.2.0",
"chatgpt-prompt-splitter": "^1.0.5",
"chinesegen": "^0.3.3",
"cidr-tools": "^11.0.3",
"cidr-tools": "^13.0.4",
"citation-formatter": "^1.0.1",
"colord": "^2.9.3",
"composerize": "^1.7.5",
"codemirror": "^6.0.2",
"colord": "^2.10.0",
"composerize": "^1.7.6",
"composeverter": "^1.7.5",
"convert": "^6.0.0",
"countries-and-timezones": "^3.8.0",
"convert": "^7.0.2",
"countries-and-timezones": "^3.9.0",
"countries-db": "^1.2.0",
"country-code-lookup": "^0.1.3",
"country-code-lookup": "^0.1.5",
"crc": "^4.3.2",
"creditcard": "^0.1.3",
"creditcard-generator": "^0.0.7",
"cron-parser": "4.9.0",
"cron-parser": "5.10.0",
"cron-validator": "^1.4.0",
"cronstrue": "^3.0.0",
"cronstrue": "^3.24.0",
"cropperjs": "^1.6.3",
"cross-spawn": "^7.0.6",
"crypto-js": "^4.2.0",
"crypto-es": "^3.1.3",
"csstoxpath": "^2.0.0",
"curlconverter": "^4.12.0",
"currency-codes-ts": "^3.0.0",
"currency-exchanger-js": "^1.0.4",
"damerau-levenshtein": "^1.0.8",
"data-guardian": "^1.1.3",
"date-fns": "^4.1.0",
"data-guardian": "^1.1.4",
"date-fns": "^4.4.0",
"date-fns-tz": "^3.2.0",
"date-holidays": "^3.27.0",
"date-holidays": "^3.34.1",
"decimal.js": "^10.6.0",
"decomposerize": "^1.4.4",
"detect-csv": "^1.1.0",
@@ -158,27 +185,31 @@
"dmarc-report-parser": "^0.1.5",
"dns-query": "^0.11.2",
"docker2kube": "^0.0.14",
"dom-to-image-more": "^3.7.2",
"dompurify": "^3.4.2",
"dom-to-image-more": "^3.10.0",
"dompurify": "^3.4.16",
"duration-fns": "^3.0.2",
"echarts": "^6.1.0",
"email-bounce-parser-browser": "^1.1.0",
"email-normalizer": "^1.0.0",
"emojilib": "^4.0.2",
"emojilib": "^4.0.3",
"epubjs": "^0.3.93",
"ethers": "^6.16.0",
"es-toolkit": "^1.49.0",
"esm-potrace-wasm": "^0.4.4",
"ethers": "^6.17.0",
"event-cron-parser": "^1.0.37",
"exif-be-gone": "^1.5.1",
"exifreader": "^4.33.1",
"fanger": "^0.3.1",
"fast-xml-parser": "^5.7.2",
"exifreader": "^4.46.0",
"fanger": "0.3.1",
"fast-json-patch": "^3.1.1",
"fast-xml-parser": "^5.11.1",
"fast_array_intersect": "^1.1.0",
"fflate": "^0.8.2",
"figlet": "^1.9.4",
"fflate": "^0.8.3",
"figlet": "^1.11.0",
"figue": "^1.2.0",
"file-type": "^21.2.0",
"file-type": "^22.0.1",
"flatten-anything": "^4.0.2",
"flexsearch": "^0.8.212",
"fuse.js": "^7.1.0",
"fuse.js": "^7.4.2",
"gcoord": "^1.0.7",
"generate-schema": "^2.6.0",
"get-timezone-offset": "^1.0.5",
@@ -189,114 +220,114 @@
"heic-convert": "^2.1.0",
"hex-array": "^1.0.0",
"highlight.js": "^11.11.1",
"html-to-text": "^9.0.5",
"htmlfy": "^1.0.1",
"htmlparser2": "^10.0.0",
"hyparquet": "^1.23.3",
"html-to-text": "^10.0.0",
"htmlfy": "^1.0.2",
"htmlparser2": "^10.1.0",
"hyparquet": "^1.26.2",
"hyparquet-compressors": "^1.1.1",
"ibantools": "^4.5.1",
"ical-generator": "^10.0.0",
"ibantools": "^4.5.4",
"ical-generator": "^11.0.0",
"ical.js": "^2.2.1",
"iconv-lite": "^0.7.1",
"idb-keyval": "^6.2.2",
"iconv-lite": "^0.7.3",
"idb-keyval": "^6.3.0",
"image-compare-viewer": "^1.6.2",
"image-in-browser": "^3.3.0",
"image-in-browser": "^3.5.3",
"image-to-ascii-art": "^0.0.4",
"ip-address": "^10.1.0",
"ip-bigint": "^8.2.2",
"ip-address": "^10.7.2",
"ip-bigint": "^9.0.6",
"ip-cidr": "^4.0.2",
"ip-matching": "^2.1.2",
"ip-regex": "^5.0.0",
"is-cidr": "^6.0.1",
"is-cidr": "^7.0.0",
"is-ip": "^5.0.1",
"isbn3": "^2.0.2",
"iso-639-1": "^3.1.5",
"isbn3": "^2.0.9",
"iso-639-1": "^3.1.6",
"jasypt": "^1.0.7",
"javascript-obfuscator": "^5.1.0",
"javascript-obfuscator": "^5.4.7",
"javastack.js": "^1.0.3",
"jks-js": "^1.1.4",
"jks-js": "^1.1.7",
"jose": "5.10.0",
"jpeg-quality-estimator": "^1.0.1",
"jq-wasm": "^1.0.1",
"js-base64": "^3.7.8",
"js-beautify": "^1.15.4",
"js-base64": "^3.9.4",
"js-beautify": "^2.0.3",
"js-tiktoken": "^1.0.21",
"jsbarcode": "^3.12.1",
"jsbarcode": "^3.12.3",
"json-analyzer": "^1.2.2",
"json-editor-vue": "^0.18.1",
"json-editor-vue": "^0.19.2",
"json-to-ts": "^2.1.0",
"json5": "^2.2.3",
"jsonar-mod": "^1.9.0",
"jsonlint-mod": "^1.7.6",
"jsonpath": "^1.3.0",
"jsonrepair": "^3.13.1",
"jsonrepair": "^3.15.0",
"jsonschema": "^1.5.0",
"jsonschema-protobuf": "^1.0.2",
"jsstack.js": "^2.0.0",
"jsvat-next": "^3.0.4",
"jszip": "^3.10.1",
"jwt-decode": "^4.0.0",
"katex": "^0.17.0",
"korean-unpacker": "^1.0.3",
"langs": "^2.0.0",
"libmime": "^5.3.8",
"libphonenumber-js": "^1.12.33",
"leaflet": "^1.9.4",
"libmime": "^5.4.1",
"libphonenumber-js": "^1.13.8",
"lodash": "^4.18.1",
"lodash.defaultsdeep": "^4.6.1",
"lodash.flattendeep": "^4.4.0",
"lodash.last": "^3.0.0",
"lodash.mergewith": "^4.6.2",
"long": "^5.3.2",
"lorem-ipsum-japanese": "^1.0.1",
"luhn-js": "^1.1.2",
"luxon": "^3.5.0",
"markdown-docx": "^1.6.0",
"markdown-it": "^14.1.1",
"luxon": "^3.7.2",
"markdown-docx": "^1.7.0",
"markdown-it": "^14.3.0",
"markdown-it-mark": "^4.0.0",
"markdown-it-sanitizer": "^0.4.3",
"markdown-it-sub": "^2.0.0",
"markdown-it-sup": "^2.0.0",
"markdown-table-prettify": "^4.0.0",
"markdown-table-prettify": "^4.1.0",
"marked": "^10.0.0",
"mathjs": "^15.2.0",
"md-editor-v3": "^4.21.3",
"md-editor-v3": "^7.0.0",
"mdt2json": "^1.1.0",
"memorystream": "^0.3.1",
"merge-anything": "^6.0.6",
"mermaid": "^11.12.2",
"mermaid": "^12.0.0",
"mime-types": "^3.0.2",
"mitex-wasm": "^0.2.5",
"moment": "^2.30.1",
"monaco-editor": "^0.55.1",
"morsee": "^1.0.10",
"msgpackr": "^1.11.8",
"naive-ui": "^2.43.2",
"nanoid": "^5.1.6",
"msgpackr": "^2.0.4",
"naive-ui": "^2.44.1",
"nanoid": "^6.0.0",
"nanoid-dictionary": "^5.0.0",
"nestify-anything": "^4.0.1",
"netmask": "^2.0.2",
"netmask": "^2.1.1",
"netstack.js": "^2.1.4",
"nginx-config-formatter": "^1.4.5",
"niceware": "^4.0.0",
"node-emv": "^1.0.23",
"node-forge": "^1.4.0",
"openai-chat-tokens": "^0.2.8",
"openpgp": "^6.3.0",
"openpgp": "^6.3.1",
"otpauth-migration": "^1.0.0",
"oui-data": "^1.1.571",
"parse-duration": "^2.1.6",
"parse-torrent": "^11.0.19",
"paseto-ts": "^2.0.5",
"path2d-polyfill": "^3.1.3",
"pako": "^3.0.1",
"parse-duration": "^2.1.8",
"parse-torrent": "^11.0.21",
"paseto-ts": "^2.0.6",
"path2d-polyfill": "^3.2.2",
"pdf-signature-reader": "^1.4.3",
"pdfjs-dist": "^4.8.69",
"pinia": "^2.0.34",
"plausible-tracker": "^0.3.9",
"pdfjs-dist": "^4.10.38",
"picomatch": "^4.0.5",
"pinia": "^3.0.4",
"podletjs": "^1.0.2",
"port-numbers": "^8.0.28",
"postal-mime": "^2.7.1",
"port-numbers": "^8.0.32",
"postal-mime": "^2.7.5",
"potrace": "^2.1.8",
"pp-qr-code": "^0.6.4",
"prettier": "^3.9.9",
"pretty-ms": "^9.3.0",
"proj4": "^2.20.2",
"proj4": "^2.20.9",
"proj4-list": "^1.0.4",
"properties": "^1.2.1",
"punycode": "^2.3.1",
@@ -306,162 +337,170 @@
"qrcode-parser": "^2.1.3",
"qrcode-terminal-nooctal": "^0.12.1",
"qrcode-vue3": "^1.7.1",
"quicktype-core": "^23.2.6",
"quicktype-core": "^26.0.0",
"randexp": "^0.5.3",
"regex": "^6.1.0",
"rekcod": "^3.0.0",
"remove-markdown": "^0.6.3",
"resistor-data": "^1.1.1",
"remove-markdown": "^0.6.4",
"resistor-data": "^2.0.0",
"riimut": "^0.9.1",
"roboto-base64": "^0.1.2",
"rtf-stream-parser": "^3.8.1",
"run-pace": "^2.2.1",
"safe-license-list": "^0.1.2",
"sandybox": "^1.1.2",
"sanitize-html": "^2.17.0",
"sanitize-html": "^2.17.7",
"screenfull": "^5.2.0",
"shamirs-secret-sharing": "^2.0.1",
"shiki": "1.29.2",
"silly-password-generator": "^1.0.29",
"slashes": "^3.0.12",
"smol-toml": "^1.6.1",
"smol-toml": "^1.9.0",
"sms-segments-calculator": "^1.2.0",
"spdx-satisfies": "^6.0.0",
"sponge-case": "^2.0.3",
"sql-formatter": "^15.6.12",
"sql-formatter": "^15.8.2",
"sshpk": "^1.18.0",
"staveless-futhark": "^0.6.1",
"stringify-object": "^6.0.0",
"svg2png-wasm": "^1.4.1",
"svgo": "^3.3.3",
"swagger-ui-dist": "^5.27.0",
"stopword": "^3.1.5",
"stringify-object": "^7.0.0",
"svgo": "^3.3.5",
"swagger-ui-dist": "^5.32.8",
"swap-case": "^3.0.3",
"tesseract.js": "^5.1.1",
"text-encoding-utf-8": "^1.0.2",
"tesseract.js": "^7.0.0",
"tesseract.js-core": "7.0.0",
"tick-time": "^1.0.1",
"tidy-url": "^1.18.3",
"title-case": "^4.3.2",
"to-double-quotes": "^4.0.0",
"to-single-quotes": "^4.0.0",
"turndown": "^7.2.4",
"ua-parser-js": "^2.0.4",
"ua-parser-js": "^2.0.10",
"ulid": "^3.0.2",
"unicode-emoji-json": "^0.8.0",
"unicode-emoji-json": "^0.9.0",
"unique-random": "^4.0.0",
"units-converter": "^1.0.3",
"unixcrypt-browser": "^2.0.4",
"unpdf": "^1.4.0",
"unplugin-auto-import": "^0.16.4",
"unpdf": "^1.8.0",
"unplugin-auto-import": "^21.0.0",
"utf8": "^3.0.0",
"uuid": "^14.0.0",
"vanilla-jsoneditor": "^3.11.0",
"vue": "^3.3.4",
"uuid": "^14.0.1",
"vanilla-jsoneditor": "^3.13.0",
"vite-plugin-sitemap": "^0.8.2",
"vue": "^3.5.39",
"vue-color-wheel": "^0.1.1",
"vue-i18n": "^11.4.0",
"vue-loading-overlay": "^6.0",
"vue-markdown-render": "^2.3.0",
"vue-mathjax-next": "^0.0.6",
"vue-router": "^4.1.6",
"vue-i18n": "^11.4.6",
"vue-loading-overlay": "^6.0.6",
"vue-markdown-render": "^2.3.1",
"vue-router": "^5.1.0",
"vue-shadow-dom": "^4.2.0",
"vue-tsc": "^1.8.1",
"vue-tsc": "^3.3.10",
"vue3-flip-countdown": "^0.1.6",
"vue3-katex": "^0.8.1",
"vuedraggable": "^4.1.0",
"vuex": "^4.1.0",
"w-websocket-client": "^1.0.29",
"webcrack": "^2.15.0",
"webcrack": "^2.16.0",
"webcrypto-liner-shim": "^1.4.8",
"webp-converter-browser": "^1.0.4",
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz",
"xml-formatter": "^3.6.7",
"xml-formatter": "^3.7.0",
"xml-js": "^1.6.11",
"xpath": "^0.0.34",
"xpath-to-css": "^1.2.0",
"xslt-processor": "^3.4.0",
"yaml": "^2.8.4"
"yaml": "^2.9.0"
},
"devDependencies": {
"@antfu/eslint-config": "^0.41.0",
"@iconify-json/mdi": "^1.1.50",
"@intlify/unplugin-vue-i18n": "^11.0.0",
"@playwright/test": "^1.59.1",
"@rushstack/eslint-patch": "^1.2.0",
"@tsconfig/node18": "^18.2.0",
"@iconify-json/mdi": "^1.2.3",
"@iconify-json/tabler": "^1.2.35",
"@intlify/unplugin-vue-i18n": "^11.2.4",
"@playwright/test": "^1.62.0",
"@tsconfig/node24": "^24.0.4",
"@types/arr-diff": "^4.0.3",
"@types/bcryptjs": "^2.4.6",
"@types/big.js": "^6.2.2",
"@types/crypto-js": "^4.2.2",
"@types/big.js": "^7.0.0",
"@types/codemirror": "^5.60.17",
"@types/damerau-levenshtein": "^1.0.2",
"@types/emscripten": "^1.40.1",
"@types/emscripten": "^1.41.5",
"@types/har-format": "^1.2.16",
"@types/hex-array": "^1.0.2",
"@types/js-beautify": "^1.14.3",
"@types/jsdom": "^21.1.7",
"@types/jsdom": "^28.0.0",
"@types/jsonpath": "^0.2.4",
"@types/libmime": "^5.0.3",
"@types/lodash": "^4.17.20",
"@types/lodash.defaultsdeep": "^4.6.9",
"@types/lodash.flattendeep": "^4.4.9",
"@types/lodash.last": "^3.0.9",
"@types/lodash.mergewith": "^4.6.9",
"@types/luxon": "^3.4.2",
"@types/markdown-it": "^13.0.9",
"@types/leaflet": "^1.9.21",
"@types/libmime": "^5.3.0",
"@types/luxon": "^3.7.2",
"@types/markdown-it": "^14.0.0",
"@types/memorystream": "^0.3.4",
"@types/mime-types": "^3.0.1",
"@types/morsee": "^1.0.2",
"@types/nanoid-dictionary": "^4.2.3",
"@types/netmask": "^2.0.5",
"@types/node": "^24.10.1",
"@types/netmask": "^2.0.6",
"@types/node": "^24.13.3",
"@types/node-forge": "^1.3.14",
"@types/picomatch": "^4.0.3",
"@types/potrace": "^2.1.5",
"@types/punycode": "^2.1.4",
"@types/qrcode": "^1.5.5",
"@types/sanitize-html": "^2.13.0",
"@types/qrcode": "^1.5.6",
"@types/sanitize-html": "^2.16.1",
"@types/spdx-satisfies": "^6.0.0",
"@types/sshpk": "^1.17.4",
"@types/sshpk": "^1.17.5",
"@types/stopword": "^2.0.3",
"@types/stringify-object": "^4.0.5",
"@types/text-encoding-utf-8": "^1.0.5",
"@types/turndown": "^5.0.6",
"@types/ua-parser-js": "^0.7.39",
"@types/unist": "^3.0.3",
"@types/utf8": "^3.0.3",
"@types/uuid": "^10.0.0",
"@unocss/eslint-config": "^0.57.1",
"@vitejs/plugin-vue": "^4.3.4",
"@vitejs/plugin-vue-jsx": "^3.0.2",
"@vue/compiler-sfc": "^3.2.47",
"@vue/runtime-dom": "^3.3.4",
"@vue/test-utils": "^2.3.2",
"@vue/tsconfig": "^0.4.0",
"axios": "^1.16.0",
"commander": "^14.0.1",
"consola": "^3.0.2",
"dotenv": "^17.2.3",
"eslint": "^8.47.0",
"@vitejs/plugin-vue": "^6.0.7",
"@vitejs/plugin-vue-jsx": "^5.1.6",
"@vue/compiler-sfc": "^3.5.39",
"@vue/runtime-dom": "^3.5.39",
"@vue/test-utils": "^2.4.11",
"@vue/tsconfig": "^0.9.1",
"axios": "^1.18.1",
"commander": "^15.0.0",
"consola": "^3.4.2",
"dotenv": "^17.4.2",
"fast-glob": "^3.3.3",
"hygen": "^6.2.11",
"jsdom": "^22.0.0",
"less": "^4.2.2",
"prettier": "^3.0.0",
"semver": "^7.5.2",
"typescript": "~5.2.2",
"unocss": "^0.57.1",
"unocss-preset-scrollbar": "^0.2.1",
"unplugin-icons": "^0.17.0",
"unplugin-vue-components": "^0.25.0",
"unplugin-vue-markdown": "^29.1.0",
"vite": "^4.4.9",
"vite-plugin-node-polyfills": "^0.23.0",
"vite-plugin-pwa": "^1.1.0",
"vite-plugin-splash-screen": "^0.2.0",
"vite-plugin-wasm": "^3.4.1",
"vite-svg-loader": "^4.0.0",
"vitest": "^0.34.6",
"jsdom": "^29.1.1",
"less": "^4.6.7",
"oxfmt": "^0.57.0",
"oxlint": "^1.72.0",
"oxlint-tsgolint": "^7.0.2001",
"rollup-plugin-visualizer": "^7.0.1",
"semver": "^7.8.5",
"typescript": "~6.0.3",
"unocss": "^66.7.4",
"unocss-preset-scrollbar": "^4.0.0",
"unplugin-icons": "^23.0.1",
"unplugin-vue-components": "^32.1.0",
"unplugin-vue-markdown": "^32.0.0",
"vite": "^8.1.3",
"vite-plugin-node-polyfills": "^0.28.0",
"vite-plugin-pwa": "^1.3.0",
"vite-plugin-wasm": "^3.6.0",
"vite-svg-loader": "^5.1.1",
"vitest": "^4.1.11",
"vue-i18n-extract": "^2.0.7",
"workbox-window": "^7.3.0",
"workbox-build": "^7.4.1",
"workbox-window": "^7.4.1",
"zx": "^8.8.5"
},
"pnpm": {
"overrides": {
"@vueuse/shared": "13.9.0",
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
"devEngines": {
"packageManager": {
"name": "pnpm",
"version": "12.6.0",
"onFail": "download"
},
"runtime": {
"name": "node",
"version": "24.x",
"onFail": "download"
}
},
"engines": {
"node": "24.x"
},
"scarfSettings": {
"enabled": false
}
+24
View File
@@ -0,0 +1,24 @@
diff --git a/dist/src/shell/webParser.js b/dist/src/shell/webParser.js
index 1b3bab1a4789e926fbe07786188d1dcddf655489..39ac6d3a8f4f5ac007d4dc1e2da272e2cc5b9088 100644
--- a/dist/src/shell/webParser.js
+++ b/dist/src/shell/webParser.js
@@ -2,13 +2,17 @@
import Parser from "web-tree-sitter";
// NOTE: top-level await requires Safari 15+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await#browser_compatibility
+// The wasm files are served next to the app (it-tools ships them in public/). Resolve them
+// against the document's <base href> rather than the domain root, so the app also works
+// when it is served from a subfolder.
+const appBase = document.querySelector("base")?.href ?? new URL("/", location.href).href;
await Parser.init({
// eslint-disable-next-line @typescript-eslint/no-unused-vars
locateFile(scriptName, scriptDirectory) {
- return "/" + scriptName;
+ return new URL(scriptName, appBase).href;
},
});
-const Bash = await Parser.Language.load("/tree-sitter-bash.wasm");
+const Bash = await Parser.Language.load(new URL("tree-sitter-bash.wasm", appBase).href);
const parser = new Parser();
parser.setLanguage(Bash);
export default parser;
+8
View File
@@ -0,0 +1,8 @@
diff --git a/dist/index.js b/dist/index.js
index ba40e7a8d4d4d56621fa467ff0f6fdc3a30e0fa6..9136f03df05cb2ff615e43fa2df4e32b784465ba 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -1 +1 @@
-var A=void 0!==A?A:{},r=!!globalThis.window,v=!!globalThis.WorkerGlobalScope,t=(globalThis.process?.versions?.node&&globalThis.process?.type,globalThis.document?.currentScript?.src);v&&(t=self.location.href);if(r||v){try{new URL(".",t).href}catch{}v&&(A=>{var r=new XMLHttpRequest;return r.open("GET",A,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),async A=>{var r=await fetch(A,{credentials:"same-origin"});if(r.ok)return r.arrayBuffer();throw new Error(r.status+" : "+r.url)}}var j,f,b,n=console.log.bind(console),e=console.error.bind(console),o=!1;var a,k=!1;function s(){var A=y.buffer;j=new Int8Array(A),new Int16Array(A),f=new Uint8Array(A),new Uint16Array(A),new Int32Array(A),b=new Uint32Array(A),new Float32Array(A),new Float64Array(A),new BigInt64Array(A),new BigUint64Array(A)}function x(r){throw A.onAbort?.(r),e(r="Aborted("+r+")"),o=!0,r+=". Build with -sASSERTIONS for more info.",new WebAssembly.RuntimeError(r)}function i(){return function(A){for(var r,v=0,t=A.length,j=new Uint8Array(t);v<t;++v)r=A.charCodeAt(v),j[v]=~r>>8&r;return j}('\0asm\0\0\0“``\0`\0```\0`\0`\0`\0`\0\0`~~`|``~`~```||`\0`\r||+aa\0ab\0\fac\0ad\0\tae\0\0af\0\rag\0\0ZY\0\0\0\0\0\0\0\0\0\0\t\0\0\0\0\0\b\b\0\v\n\0\0\n\0\0\0\0\tp11‚€€\bA°Ô\vh\0i\0_j\0^k\0Al\0@m\0?\t6\0A\v0(]\\>[ZYXW>VUTS8RQPONMLKJDFIEGHC\'B\'\f\nËÿY€\f\b@ \0E\r\0 \0A\bk" \0Ak(\0"Axq"\0j!@ Aq\r\0 AqE\r  (\0"k"AÄÐ\0(\0I\r \0 j!\0@@@AÈÐ\0(\0 G@ (\f! AÿM@  (\b"G\rA´Ð\0A´Ð\0(\0A~ Avwq6\0\f\v (!  G@ (\b" 6\f  6\b\f\v (" Aj ("E\r Aj\v!@ ! "Aj! ("\r\0 Aj! ("\r\0\v A\x006\0\f\v ("AqAG\rA¼Ð\0 \x006\0  A~q6  \0Ar6  \x006\0\v  6\f  6\b\f\vA\0!\v E\r\0@ ("At"(äR F@ AäÒ\0j 6\0 \rA¸Ð\0A¸Ð\0(\0A~ wq6\0\f\v@  (F@  6\f\v  6\v E\r\v  6 ("@  6  6\v ("E\r\0  6  6\v  O\r\0 ("AqE\r\0@@@@ AqE@AÌÐ\0(\0 F@AÌÐ\0 6\0AÀÐ\0AÀÐ\0(\0 \0j"\x006\0  \0Ar6 AÈÐ\0(\0G\rA¼Ð\0A\x006\0AÈÐ\0A\x006\0\vAÈÐ\0(\0" F@AÈÐ\0 6\0A¼Ð\0A¼Ð\0(\0 \0j"\x006\0  \0Ar6 \0 j \x006\0\v Axq \0j!\0 (\f! AÿM@ (\b" F@A´Ð\0A´Ð\0(\0A~ Avwq6\0\f\v  6\f  6\b\f\v (!\b  G@ (\b" 6\f  6\b\f\v (" Aj ("E\r Aj\v!@ ! "Aj! ("\r\0 Aj! ("\r\0\v A\x006\0\f\v  A~q6  \0Ar6 \0 j \x006\0\f\vA\0!\v \bE\r\0@ ("At"(äR F@ AäÒ\0j 6\0 \rA¸Ð\0A¸Ð\0(\0A~ wq6\0\f\v@  \b(F@ \b 6\f\v \b 6\v E\r\v  \b6 ("@  6  6\v ("E\r\0  6  6\v  \0Ar6 \0 j \x006\0  G\r\0A¼Ð\0 \x006\0\v \0AÿM@ \0AøqAÜÐ\0j!A´Ð\0(\0"A \0Avt"\0qE@A´Ð\0 \0 r6\0 \f\v (\b\v!\0  6\b \0 6\f  6\f  \x006\b\vA! \0AÿÿÿM@ \0A& \0A\bvg"kvAq AtrA>s!\v  6 B\x007 AtAäÒ\0j!@A¸Ð\0(\0"A t"qE@A¸Ð\0  r6\0  6\0A!A\b\f\v \0A AvkA\0 AGt! (\0!@ "(Axq \0F\r Av! At!  Aqj"("\r\0\v  6A! !A\b\v!\0 "\f\v (\b" 6\f  6\bA!\0A\b!A\0\v!  j 6\0  6\f \0 j 6\0AÔÐ\0AÔÐ\0(\0Ak"\0A \06\0\v\vY~@A\0 \0E\r\0 \0­ ­~"§" \0 rA€€I\r\0A  B ˆ§\v"\f"\0E\r\0 \0Ak-\0\0AqE\r\0 \0A\0 \v \0\v\0 \0-\0\0A qE@   \0"\v\vj#\0A€k"$\0@  L\r\0 A€Àq\r\0    k"A€ A€I" E@@ \0 A€\t A€k"AÿK\r\0\v\v \0  \t\v A€j$\0\v8\0  l!  (LA\0H@ \0  "\f\v \0  "\v"\0F@\v \0 n\v»(\v#\0Ak"\n$\0@@@@@@@@@@ \0AôM@A´Ð\0(\0"A \0A\vjAøq \0A\vI"Av"\0v"Aq@@ AsAq \0j"At"AÜÐ\0j"\0 (äP"(\b"F@A´Ð\0 A~ wq6\0\f\v  \x006\f \0 6\b\v A\bj!\0  Ar6  j" (Ar6\f\v\v A¼Ð\0(\0"\bM\r @@A \0t"A\0 kr  \0tqh"At"AÜÐ\0j" (äP"\0(\b"F@A´Ð\0 A~ wq"6\0\f\v  6\f  6\b\v \0 Ar6 \0 j"  k"Ar6 \0 j 6\0 \b@ \bAxqAÜÐ\0j!AÈÐ\0(\0! A \bAvt"qE@A´Ð\0  r6\0 \f\v (\b\v!  6\b  6\f  6\f  6\b\v \0A\bj!\0AÈÐ\0 6\0A¼Ð\0 6\0\f\v\vA¸Ð\0(\0"\vE\r \vhAt(äR"(Axq k! !@@ ("\0E@ ("\0E\r\v \0(Axq k"   I"! \0  ! \0!\f\v\v (!\t  (\f"\0G@ (\b" \x006\f \0 6\b\f\n\v (" Aj ("E\r Aj\v!@ ! "\0Aj! \0("\r\0 \0Aj! \0("\r\0\v A\x006\0\f\t\vA! \0A¿K\r\0 \0A\vj"Axq!A¸Ð\0(\0"E\r\0A!\bA\0 k! \0AôÿÿM@ A& A\bvg"\0kvAq \0AtkA>j!\b\v@@@ \bAt(äR"E@A\0!\0\f\vA\0!\0 A \bAvkA\0 \bAGt!@@ (Axq k" O\r\0 ! "\r\0A\0! !\0\f\v \0 ("   AvAqj("F \0 !\0 At! \r\0\v\v \0 rE@A\0!A \bt"\0A\0 \0kr  Line truncated
\ No newline at end of file
+var A,I,g=void 0!==g?g:{},C=Object.assign({},g),Q=(A,I)=>{throw I},B="object"==typeof window,E="function"==typeof importScripts,i="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,D="";if(i){var o=require("fs"),w=require("path");D=E?w.dirname(D)+"/":__dirname+"/",A=(A,I)=>(A=b(A)?new URL(A):w.normalize(A),o.readFileSync(A,I?void 0:"utf8")),I=I=>{var g=A(I,!0);return g.buffer||(g=new Uint8Array(g)),g},(A,I,g,C=!0)=>{A=b(A)?new URL(A):w.normalize(A),o.readFile(A,C?void 0:"utf8",((A,Q)=>{A?g(A):I(C?Q.buffer:Q)}))},!g.thisProgram&&process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),"undefined"!=typeof module&&(module.exports=g),process.on("uncaughtException",(A=>{if(!("unwind"===A||A instanceof l||A.context instanceof l))throw A})),Q=(A,I)=>{throw process.exitCode=A,I},g.inspect=()=>"[Emscripten Module object]"}else(B||E)&&(E?D=self.location.href:"undefined"!=typeof document&&document.currentScript&&(D=document.currentScript.src),D=0!==D.indexOf("blob:")?D.substr(0,D.replace(/[?#].*/,"").lastIndexOf("/")+1):"",A=A=>{var I=new XMLHttpRequest;return I.open("GET",A,!1),I.send(null),I.responseText},E&&(I=A=>{var I=new XMLHttpRequest;return I.open("GET",A,!1),I.responseType="arraybuffer",I.send(null),new Uint8Array(I.response)}),(A,I,g)=>{var C=new XMLHttpRequest;C.open("GET",A,!0),C.responseType="arraybuffer",C.onload=()=>{200==C.status||0==C.status&&C.response?I(C.response):g()},C.onerror=g,C.send(null)},A=>document.title=A);var N,s=g.print||console.log.bind(console),h=g.printErr||console.error.bind(console);Object.assign(g,C),C=null,g.arguments&&g.arguments,g.thisProgram&&g.thisProgram,g.quit&&(Q=g.quit),g.wasmBinary&&(N=g.wasmBinary);var y,R=g.noExitRuntime||!0;"object"!=typeof WebAssembly&&L("no native wasm support detected");var F,G,M,a=!1;function K(){var A=y.buffer;g.HEAP8=F=new Int8Array(A),g.HEAP16=new Int16Array(A),g.HEAPU8=G=new Uint8Array(A),g.HEAPU16=new Uint16Array(A),g.HEAP32=new Int32Array(A),g.HEAPU32=M=new Uint32Array(A),g.HEAPF32=new Float32Array(A),g.HEAPF64=new Float64Array(A)}var S=[],t=[],r=[],c=!1;var Y=0,U=null,J=null;function L(A){throw g.onAbort&&g.onAbort(A),h(A="Aborted("+A+")"),a=!0,1,A+=". Build with -sASSERTIONS for more info.",new WebAssembly.RuntimeError(A)}var k,H,e="data:application/octet-stream;base64,";function n(A){return A.startsWith("data:application/octet-stream;base64,")}function b(A){return A.startsWith("file://")}function d(A){if(A==k&&N)return new Uint8Array(N);var g=function(A){if(!n(A))return;return function(A){if(void 0!==i&&i){var I=Buffer.from(A,"base64");return new Uint8Array(I.buffer,I.byteOffset,I.length)}try{for(var g=atob(A),C=new Uint8Array(g.length),Q=0;Q<g.length;++Q)C[Q]=g.charCodeAt(Q);return C}catch(A){throw new Error("Converting base64 string to bytes failed.")}}(A.slice(e.length))}(A);if(g)return g;if(I)return I(A);throw"both async and sync fetching of the wasm failed"}function q(A,I,g){return function(A){return Promise.resolve().then((()=>d(A)))}(A).then((A=>WebAssembly.instantiate(A,I))).then((A=>A)).then(g,(A=>{h(`failed to asynchronously prepare wasm: ${A}`),L(A)}))}function l(A){this.name="ExitStatus",this.message=`Program terminated with exit(${A})`,this.status=A}n(k="data:application/octet-stream;base64,AGFzbQEAAAABigETYAF/AX9gAX8AYAJ/fwBgAn9/AX9gA39/fwF/YAR/f39/AGADf39/AGAAAGAFf39/f38AYAZ/f39/f38AYAN/fn8BfmAFf39/f38Bf2AGf3x/f39/AX9gBH9/f38Bf2ACfn8Bf2AHf39/f39/fwF/YAJ8fwF8YAABf2AMf39/f39/f39/fH98AX8CMQgBYQFhAAYBYQFiAA0BYQFjAAEBYQFkAAsBYQFlAAcBYQFmAAABYQFnAAABYQFoAAYDX14BAwYECAUABgAEBAEADgAGAAIEAAUBBQALAAQCAQAHAgcBAgAFBgMCAgMDBAUADxADBAMCAQEDAgABEQAAAAAACQkICAEFBQQABAIMCgQAAAoAAwMCAAADAwIABwMSBAUBcAE2NgUHAQGAAoCAAgYIAX8BQaDVBAsHKQoBaQIAAWoAKAFrAGUBbABkAW0AYwFuAQABbwBCAXAAQQFxAEABcgBHCTsBAEEBCzUbGytMGxNiYR0TYF9eE11cHRNbWllYOVdWVVRTUlETUBsTHR1PSEpOE0lLTRNFE0QTRilDKQq09QJe9QsBB38CQCAARQ0AIABBCGsiAiAAQQRrKAIAIgFBeHEiAGohBQJAIAFBAXENACABQQNxRQ0BIAIgAigCACIBayICQbTRACgCAEkNASAAIAFqIQACQAJAQbjRACgCACACRwRAIAFB/wFNBEAgAUEDdiEEIAIoAgwiASACKAIIIgNGBEBBpNEAQaTRACgCAEF+IAR3cTYCAAwFCyADIAE2AgwgASADNgIIDAQLIAIoAhghBiACIAIoAgwiAUcEQCACKAIIIgMgATYCDCABIAM2AggMAwsgAkEUaiIEKAIAIgNFBEAgAigCECIDRQ0CIAJBEGohBAsDQCAEIQcgAyIBQRRqIgQoAgAiAw0AIAFBEGohBCABKAIQIgMNAAsgB0EANgIADAILIAUoAgQiAUEDcUEDRw0CQazRACAANgIAIAUgAUF+cTYCBCACIABBAXI2AgQgBSAANgIADwtBACEBCyAGRQ0AAkAgAigCHCIDQQJ0QdTTAGoiBCgCACACRgRAIAQgATYCACABDQFBqNEAQajRACgCAEF+IAN3cTYCAAwCCyAGQRBBFCAGKAIQIAJGG2ogATYCACABRQ0BCyABIAY2AhggAigCECIDBEAgASADNgIQIAMgATYCGAsgAigCFCIDRQ0AIAEgAzYCFCADIAE2AhgLIAIgBU8NACAFKAIEIgFBAXFFDQACQAJAAkACQCABQQJxRQRAQbzRACgCACAFRgRAQbzRACACNgIAQbDRAEGw0QAoAgAgAGoiADYCACACIABBAXI2AgQgAkG40QAoAgBHDQZBrNEAQQA2AgBBuNEAQQA2AgAPC0G40QAoAgAgBUYEQEG40QAgAjYCAEGs0QBBrNEAKAIAIABqIgA2AgAgAiAAQQFyNgIEIAAgAmogADYCAA8LIAFBeHEgAGohACABQf8BTQRAIAFBA3YhBCAFKAIMIgEgBSgCCCIDRgRAQaTRAEGk0QAoAgBBfiAEd3E2AgAMBQsgAyABNgIMIAEgAzYCCAwECyAFKAIYIQYgBSAFKAIMIgFHBEBBtNEAKAIAGiAFKAIIIgMgATYCDCABIAM2AggMAwsgBUEUaiIEKAIAIgNFBEAgBSgCECIDRQ0CIAVB Line truncated
+765
View File
@@ -0,0 +1,765 @@
diff --git a/lib/asn1-validator.js b/lib/asn1-validator.js
index 2be328501e93e5f0e38245b6ee797bfc426dfcaa..4deb9f17e77b9c1a602fc6e034012b4c1ccf7e52 100644
--- a/lib/asn1-validator.js
+++ b/lib/asn1-validator.js
@@ -17,7 +17,6 @@ exports.privateKeyValidator = {
name: 'PrivateKeyInfo.version',
tagClass: asn1.Class.UNIVERSAL,
type: asn1.Type.INTEGER,
- constructed: false,
capture: 'privateKeyVersion'
}, {
// privateKeyAlgorithm
@@ -29,7 +28,6 @@ exports.privateKeyValidator = {
name: 'AlgorithmIdentifier.algorithm',
tagClass: asn1.Class.UNIVERSAL,
type: asn1.Type.OID,
- constructed: false,
capture: 'privateKeyOid'
}]
}, {
@@ -37,12 +35,11 @@ exports.privateKeyValidator = {
name: 'PrivateKeyInfo',
tagClass: asn1.Class.UNIVERSAL,
type: asn1.Type.OCTETSTRING,
- constructed: false,
capture: 'privateKey'
}]
};
-exports.publicKeyValidator = {
+exports.publicKeyInfoValidator = {
name: 'SubjectPublicKeyInfo',
tagClass: asn1.Class.UNIVERSAL,
type: asn1.Type.SEQUENCE,
@@ -54,38 +51,24 @@ exports.publicKeyValidator = {
type: asn1.Type.SEQUENCE,
constructed: true,
value: [{
- name: 'AlgorithmIdentifier.algorithm',
- tagClass: asn1.Class.UNIVERSAL,
- type: asn1.Type.OID,
- constructed: false,
- capture: 'publicKeyOid'
- }]
- },
- // capture group for ed25519PublicKey
- {
- tagClass: asn1.Class.UNIVERSAL,
- type: asn1.Type.BITSTRING,
- constructed: false,
- composed: true,
- captureBitStringValue: 'ed25519PublicKey'
- }
- // FIXME: this is capture group for rsaPublicKey, use it in this API or
- // discard?
- /* {
+ name: 'AlgorithmIdentifier.algorithm',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.OID,
+ capture: 'publicKeyOid'
+ },
+ {
+ name: 'AlgorithmIdentifier.parameters',
+ tagClass: asn1.Class.UNIVERSAL,
+ optional: true,
+ captureAsn1: 'parameters',
+ }]
+ }, {
// subjectPublicKey
name: 'SubjectPublicKeyInfo.subjectPublicKey',
tagClass: asn1.Class.UNIVERSAL,
type: asn1.Type.BITSTRING,
constructed: false,
- value: [{
- // RSAPublicKey
- name: 'SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey',
- tagClass: asn1.Class.UNIVERSAL,
- type: asn1.Type.SEQUENCE,
- constructed: true,
- optional: true,
- captureAsn1: 'rsaPublicKey'
- }]
- } */
- ]
+ captureAsn1: 'subjectPublicKey', // used by RSA
+ captureBitStringValue: 'subjectPublicKeyRaw', // used by ECDSA and ED25519
+ }]
};
diff --git a/lib/ecdsa.js b/lib/ecdsa.js
new file mode 100644
index 0000000000000000000000000000000000000000..6373401341a319edcd5360d3002cab2de4b81942
--- /dev/null
+++ b/lib/ecdsa.js
@@ -0,0 +1,390 @@
+/**
+ * JavaScript implementation of ECDSA.
+ *
+ * Copyright (c) 2021 HAMANO Tsukasa <hamano@osstech.co.jp>
+ *
+ * This implementation is based on the elliptic
+ *
+ * https://github.com/indutny/elliptic/
+ */
+var forge = require('./forge');
+require('./asn1');
+require('./jsbn');
+require('./random');
+require('./sha512');
+var util = require('./util');
+var elliptic = require('elliptic');
+var asn1Validator = require('./asn1-validator');
+var publicKeyInfoValidator = asn1Validator.publicKeyInfoValidator;
+var privateKeyValidator = asn1Validator.privateKeyValidator;
+var asn1 = forge.asn1;
+
+if(typeof BigInteger === 'undefined') {
+ var BigInteger = forge.jsbn.BigInteger;
+}
+
+var ByteBuffer = util.ByteBuffer;
+var NativeBuffer = typeof Buffer === 'undefined' ? Uint8Array : Buffer;
+
+forge.pki = forge.pki || {};
+module.exports = forge.pki.ecdsa = forge.ecdsa = forge.ecdsa || {};
+var ecdsa = forge.ecdsa;
+
+ecdsa.constants = {};
+
+/*
+ * Supported namedCurve listed here:
+ * https://github.com/indutny/elliptic/blob/master/lib/elliptic/curves.js
+ */
+ecdsa.supportedCueves = [
+ 'p192', // secp192r1, prime192v1
+ 'p256', // secp256r1, prime256v1
+ 'p224', // secp224r1,
+ 'p384', // secp384r1
+ 'p521', // secp521r1
+ 'secp256k1',// secp256k1
+];
+
+/*
+ * RCF5915: Elliptic Curve Private Key Format
+ * https://datatracker.ietf.org/doc/html/rfc5915
+ *
+ * ECPrivateKey ::= SEQUENCE {
+ * version INTEGER { ecPrivkeyVer1(1) } (ecPrivkeyVer1),
+ * privateKey OCTET STRING,
+ * parameters [0] ECParameters {{ NamedCurve }} OPTIONAL,
+ * publicKey [1] BIT STRING OPTIONAL
+ * }
+ */
+var ecPrivateKeyValidator = {
+ name: 'ECPrivateKey',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.SEQUENCE,
+ constructed: true,
+ value: [{
+ name: 'ECPrivateKey.version',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.INTEGER,
+ capture: 'version',
+ }, {
+ name: 'ECPrivateKey.privateKey',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.OCTETSTRING,
+ capture: 'privateKey',
+ }, {
+ tagClass: asn1.Class.CONTEXT_SPECIFIC,
+ type: 0x0,
+ optional: true,
+ value: [{
+ name: 'ECPrivateKey.parameters',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.OID,
+ captureAsn1: 'parameters',
+ }],
+ }, {
+ tagClass: asn1.Class.CONTEXT_SPECIFIC,
+ type: 0x1,
+ optional: true,
+ value: [{
+ name: 'ECPrivateKey.publicKey',
+ type: asn1.Type.BITSTRING,
+ captureAsn1: 'publicKey',
+ }],
+ }]
+};
+
+var ecSpecifiedCurveValidator = {
+ name: 'SpecifiedCurve',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.SEQUENCE,
+ constructed: true,
+ value: [{
+ name: 'SpecifiedCurveVersion',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.INTEGER,
+ capture: 'version',
+ }, {
+ name: 'SpecifiedCurve.FieldID',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.SEQUENCE,
+ constructed: true,
+ value: [{
+ name: 'SpecifiedCurve.FieldID.fieldType',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.OID,
+ capture: 'fieldType',
+ }, {
+ name: 'SpecifiedCurve.FieldID.prime',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.INTEGER,
+ capture: 'p',
+ }]
+ }, {
+ name: 'SpecifiedCurve.Curve',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.SEQUENCE,
+ constructed: true,
+ value: [{
+ name: 'SpecifiedCurve.Curve.a',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.OCTETSTRING,
+ capture: 'a',
+ }, {
+ name: 'SpecifiedCurve.Curve.b',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.OCTETSTRING,
+ capture: 'b',
+ }]
+ }, {
+ name: 'SpecifiedCurve.Generator',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.OCTETSTRING,
+ capture: 'g',
+ }, {
+ name: 'SpecifiedCurve.Order',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.INTEGER,
+ capture: 'n',
+ }, {
+ name: 'SpecifiedCurve.Confactor',
+ tagClass: asn1.Class.UNIVERSAL,
+ type: asn1.Type.INTEGER,
+ capture: 'c',
+ optional: true
+ }]
+};
+
+ecdsa.generateKeyPair = function(options) {
+ options = options || {};
+ var curveName = options.name || 'p256';
+ var seed = options.seed;
+ var errors = [];
+
+ if (!(ecdsa.supportedCueves.includes(curveName))) {
+ var error = new Error('unsupported curveName: ' + curveName);
+ error.errors = errors;
+ throw error;
+ }
+ var curve = elliptic.curves[curveName];
+ var ec = new elliptic.ec(curve);
+ ec.curveName = curveName;
+ var kp = ec.genKeyPair({
+ entropy: seed,
+ });
+ var privateKey = kp.getPrivate();
+ var publicKey = kp.getPublic();
+ return {
+ publicKey: new ecdsa.ECPublicKey(kp.ec, publicKey),
+ privateKey: new ecdsa.ECPrivateKey(kp.ec, privateKey)
+ };
+};
+
+/**
+ * Converts a ECPrivateKey to an ASN.1 representation.
+ *
+ * @param key the ECPrivateKey.
+ *
+ * @return the ASN.1 representation of an ECPrivateKey.
+ */
+ecdsa.privateKeyToAsn1 = function(key, options) {
+ return key.toAsn1(options);
+};
+
+var ECPublicKey = function(ec, publicKey) {
+ this._ec = ec;
+ this._publicKey = publicKey;
+};
+
+ecdsa.ECPublicKey = ECPublicKey;
+
+/**
+ * Converts a public key from a RFC8410 ASN.1 encoding.
+ *
+ * @param obj - The asn1 representation of a public key.
+ *
+ * @return {ECPublicKey} - ECPublicKey object.
+ */
+ECPublicKey.fromAsn1 = function(obj) {
+ var capture = {};
+ var errors = [];
+ if(!forge.asn1.validate(obj, publicKeyInfoValidator, capture, errors)) {
+ var error = new Error('Cannot read PublicKeyInfo ASN.1 object.');
+ error.errors = errors;
+ throw error;
+ }
+ var publicKey = capture.subjectPublicKeyRaw;
+ var params = capture.parameters;
+ var curve;
+ var curveName;
+ if(params && params.type === forge.asn1.Type.OID) {
+ var oid = forge.asn1.derToOid(params.value);
+ curveName = forge.oids[oid];
+ if(!ecdsa.supportedCueves.includes(curveName)) {
+ var error = new Error('Unsupported curveName: ' + curveName);
+ error.errors = errors;
+ throw error;
+ }
+ curve = elliptic.curves[curveName];
+ } else if(params && params.type === forge.asn1.Type.SEQUENCE) {
+ var capture = {};
+ if(!forge.asn1.validate(params, ecSpecifiedCurveValidator, capture, errors)) {
+ var error = new Error('Cannot read specified curve ASN.1 object.');
+ error.errors = errors;
+ throw error;
+ }
+ var options = {
+ p: util.bytesToHex(capture.p),
+ a: util.bytesToHex(capture.a),
+ b: util.bytesToHex(capture.b),
+ n: util.bytesToHex(capture.n),
+ };
+ var _curve = new elliptic.curve.short(options);
+ var g = _curve.decodePoint(util.bytesToHex(capture.g), 'hex');
+ curve = {
+ curve: _curve,
+ n: _curve.n,
+ g: g
+ };
+ } else {
+ var error = new Error('no ECParameters');
+ error.errors = errors;
+ throw error;
+ }
+ var ec = new elliptic.ec({curve: curve});
+ ec.curveName = curveName;
+ var kp = ec.keyFromPublic(publicKey);
+ return new ECPublicKey(ec, kp.getPublic());
+};
+
+ECPublicKey.prototype.verify = function(msg, signature) {
+ var hexMsg = util.bytesToHex(msg);
+ var hexSignature = util.bytesToHex(signature);
+ return this._ec.verify(hexMsg, hexSignature, this._publicKey, 'hex');
+};
+
+ECPublicKey.prototype.toString = function() {
+ return this._publicKey.encode('hex');
+};
+
+ECPublicKey.prototype.getBytes = function() {
+ return String.fromCharCode.apply(null, this._publicKey.encode());
+};
+
+ECPublicKey.prototype.toAsn1 = function(options) {
+ var curveOID = forge.oids[this._ec.curveName];
+ if (!curveOID) {
+ var error = new Error('unsupported namedCurve or specifiedCurve.');
+ error.errors = errors;
+ throw error;
+ }
+
+ var obj = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);
+ var aid = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
+ asn1.oidToDer(forge.oids['ecPublicKey']).getBytes()),
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
+ asn1.oidToDer(curveOID).getBytes())]);
+ obj.value.push(aid);
+ obj.value.push(
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false,
+ "\0" + this.getBytes()));
+ return obj;
+};
+
+ECPublicKey.prototype.toDer = function() {
+ return asn1.toDer(this.toAsn1()).getBytes();
+};
+
+ECPublicKey.prototype.toPem = function() {
+ return '-----BEGIN PUBLIC KEY-----\n' +
+ util.encode64(this.toDer(), 64) +
+ '\n-----END PUBLIC KEY-----\n';
+};
+
+
+var ECPrivateKey = function(ec, privateKey) {
+ this._ec = ec;
+ this._privateKey = privateKey;
+};
+ecdsa.ECPrivateKey = ECPrivateKey;
+
+/**
+ * Converts a private key from a RFC5915 ASN.1 Object.
+ *
+ * @param obj - The asn1 representation of a private key.
+ *
+ * @returns {Object} obj - The ASN.1 key object.
+ * @returns {ECPrivateKey} ECPrivateKey object.
+ */
+ECPrivateKey.fromAsn1 = function(obj) {
+ var capture = {};
+ var errors = [];
+ var valid = forge.asn1.validate(obj, ecPrivateKeyValidator, capture, errors);
+ if(!valid) {
+ var error = new Error('Invalid ECPrivateKey object.');
+ error.errors = errors;
+ throw error;
+ }
+ var params;
+ if (!capture.parameters) {
+ var error = new Error('no ECPrivateKey.parameters.');
+ error.errors = errors;
+ throw error;
+ }
+ var oid = asn1.derToOid(capture.parameters.value)
+ var curveName = forge.oids[oid];
+ if (!ecdsa.supportedCueves.includes(curveName)) {
+ var error = new Error('unsupported curveName: ' + curveName);
+ error.errors = errors;
+ throw error;
+ }
+ curve = elliptic.curves[curveName];
+ var ec = new elliptic.ec({curve: curve});
+ ec.curveName = curveName;
+ var kp = ec.keyFromPrivate(util.bytesToHex(capture.privateKey));
+ return new ECPrivateKey(ec, kp.getPrivate());
+};
+
+ECPrivateKey.prototype.sign = function(msg) {
+ var hexMsg = util.bytesToHex(msg);
+ var signature = this._ec.sign(hexMsg, this._privateKey);
+ return String.fromCharCode.apply(null, signature.toDER());
+};
+
+ECPrivateKey.prototype.toString = function() {
+ return this._privateKey.toString('hex');
+};
+
+ECPrivateKey.prototype.getBytes = function() {
+ return String.fromCharCode.apply(null, this._privateKey.toArray());
+};
+
+ECPrivateKey.prototype.toAsn1 = function(options) {
+ var curveOID = forge.oids[this._ec.curveName];
+ if (!curveOID) {
+ var error = new Error('unsupported namedCurve');
+ error.errors = errors;
+ throw error;
+ }
+ return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [
+ asn1.create(asn1.Class.UNIVERSAL,
+ asn1.Type.INTEGER, false,
+ asn1.integerToDer(1).getBytes()),
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,
+ this.getBytes()),
+ asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0x0, true, [
+ asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,
+ asn1.oidToDer(curveOID).getBytes())
+ ]),
+ ]);
+};
+
+ECPrivateKey.prototype.toDer = function(options) {
+ return asn1.toDer(this.toAsn1(options)).getBytes();
+};
+
+ECPrivateKey.prototype.toPem = function(options) {
+ return '-----BEGIN EC PRIVATE KEY-----\n' +
+ util.encode64(this.toDer(options), 64) +
+ '\n-----END EC PRIVATE KEY-----\n';
+};
diff --git a/lib/ed25519.js b/lib/ed25519.js
index 87eb7097aff14b2a26103c10ce6777a672e0a0e8..31c48254c6112625a581945029f541269e74b46e 100644
--- a/lib/ed25519.js
+++ b/lib/ed25519.js
@@ -114,7 +114,7 @@ ed25519.publicKeyFromAsn1 = function(obj) {
// get SubjectPublicKeyInfo
var capture = {};
var errors = [];
- var valid = forge.asn1.validate(obj, publicKeyValidator, capture, errors);
+ var valid = forge.asn1.validate(obj, publicKeyInfoValidator, capture, errors);
if(!valid) {
var error = new Error('Invalid Key.');
error.errors = errors;
@@ -126,7 +126,7 @@ ed25519.publicKeyFromAsn1 = function(obj) {
throw new Error('Invalid OID "' + oid + '"; OID must be "' +
ed25519Oid + '".');
}
- var publicKeyBytes = capture.ed25519PublicKey;
+ var publicKeyBytes = capture.ed25519PublicKeyRaw;
if(publicKeyBytes.length !== ed25519.constants.PUBLIC_KEY_BYTE_LENGTH) {
throw new Error('Key length is invalid.');
}
diff --git a/lib/oids.js b/lib/oids.js
index 817ed1be2001cf1640df2b59cc4822cb01877cce..6ead3acf140269037eba6e1e0bd047fccc95167b 100644
--- a/lib/oids.js
+++ b/lib/oids.js
@@ -39,6 +39,18 @@ _IN('1.3.101.112', 'EdDSA25519');
_IN('1.2.840.10040.4.3', 'dsa-with-sha1');
+_IN('1.2.840.10045.2.1', 'ecPublicKey');
+_IN('1.2.840.10045.4.3.2', 'ecdsa-with-SHA256');
+_IN('1.2.840.10045.4.3.3', 'ecdsa-with-SHA384');
+_IN('1.2.840.10045.4.3.4', 'ecdsa-with-SHA512');
+
+_IN('1.2.840.10045.3.1.1', 'p192');
+_IN('1.2.840.10045.3.1.7', 'p256');
+_IN('1.3.132.0.33', 'p224');
+_IN('1.3.132.0.34', 'p384');
+_IN('1.3.132.0.35', 'p521');
+_IN('1.3.132.0.10', 'secp256k1');
+
_IN('1.3.14.3.2.7', 'desCBC');
_IN('1.3.14.3.2.26', 'sha1');
@@ -60,6 +72,7 @@ _IN('1.2.840.113549.1.7.3', 'envelopedData');
_IN('1.2.840.113549.1.7.4', 'signedAndEnvelopedData');
_IN('1.2.840.113549.1.7.5', 'digestedData');
_IN('1.2.840.113549.1.7.6', 'encryptedData');
+_IN('2.23.136.1.1.1', 'mrtdSignatureData');
// pkcs#9 oids
_IN('1.2.840.113549.1.9.1', 'emailAddress');
diff --git a/lib/pkcs7.js b/lib/pkcs7.js
index 3a5d845c5d6d62ac9fc6195ee6ef4155ecc0619c..5a773bcce033d69ebdc73d8586c0c2258eb9419b 100644
--- a/lib/pkcs7.js
+++ b/lib/pkcs7.js
@@ -1167,7 +1167,7 @@ function _fromAsn1(msg, obj, validator) {
// Check contentType, so far we only support (raw) Data.
var contentType = asn1.derToOid(capture.contentType);
- if(contentType !== forge.pki.oids.data) {
+ if(![forge.pki.oids.data, forge.pki.oids.mrtdSignatureData].includes(contentType)) {
throw new Error('Unsupported PKCS#7 message. ' +
'Only wrapped ContentType Data supported.');
}
diff --git a/lib/rsa.js b/lib/rsa.js
index a4264822b4dcd6dca44ca3e59e410c982eed7183..8cab56a1b776e808f550ded9ef14395fa6304da1 100644
--- a/lib/rsa.js
+++ b/lib/rsa.js
@@ -70,6 +70,10 @@ require('./prime');
require('./random');
require('./util');
+var asn1Validator = require('./asn1-validator');
+var publicKeyInfoValidator = asn1Validator.publicKeyInfoValidator;
+var ecdsa = require('./ecdsa');
+
if(typeof BigInteger === 'undefined') {
var BigInteger = forge.jsbn.BigInteger;
}
@@ -226,44 +230,6 @@ var rsaPublicKeyValidator = {
}]
};
-// validator for an SubjectPublicKeyInfo structure
-// Note: Currently only works with an RSA public key
-var publicKeyValidator = forge.pki.rsa.publicKeyValidator = {
- name: 'SubjectPublicKeyInfo',
- tagClass: asn1.Class.UNIVERSAL,
- type: asn1.Type.SEQUENCE,
- constructed: true,
- captureAsn1: 'subjectPublicKeyInfo',
- value: [{
- name: 'SubjectPublicKeyInfo.AlgorithmIdentifier',
- tagClass: asn1.Class.UNIVERSAL,
- type: asn1.Type.SEQUENCE,
- constructed: true,
- value: [{
- name: 'AlgorithmIdentifier.algorithm',
- tagClass: asn1.Class.UNIVERSAL,
- type: asn1.Type.OID,
- constructed: false,
- capture: 'publicKeyOid'
- }]
- }, {
- // subjectPublicKey
- name: 'SubjectPublicKeyInfo.subjectPublicKey',
- tagClass: asn1.Class.UNIVERSAL,
- type: asn1.Type.BITSTRING,
- constructed: false,
- value: [{
- // RSAPublicKey
- name: 'SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey',
- tagClass: asn1.Class.UNIVERSAL,
- type: asn1.Type.SEQUENCE,
- constructed: true,
- optional: true,
- captureAsn1: 'rsaPublicKey'
- }]
- }]
-};
-
// validator for a DigestInfo structure
var digestInfoValidator = {
name: 'DigestInfo',
@@ -1465,36 +1431,29 @@ pki.privateKeyToAsn1 = pki.privateKeyToRSAPrivateKey = function(key) {
};
/**
- * Converts a public key from an ASN.1 SubjectPublicKeyInfo or RSAPublicKey.
+ * Converts a RSA public key from an ASN.1 SubjectPublicKeyInfo.
*
- * @param obj the asn1 representation of a SubjectPublicKeyInfo or RSAPublicKey.
+ * @param obj the asn1 representation of a SubjectPublicKeyInfo.
*
* @return the public key.
*/
-pki.publicKeyFromAsn1 = function(obj) {
- // get SubjectPublicKeyInfo
+pki.rsa.publicKeyFromAsn1 = function(obj) {
+ //var subjectPublicKey = obj.value[1].value[0];
var capture = {};
var errors = [];
- if(asn1.validate(obj, publicKeyValidator, capture, errors)) {
- // get oid
- var oid = asn1.derToOid(capture.publicKeyOid);
- if(oid !== pki.oids.rsaEncryption) {
- var error = new Error('Cannot read public key. Unknown OID.');
- error.oid = oid;
- throw error;
- }
- obj = capture.rsaPublicKey;
+ if(!asn1.validate(obj, publicKeyInfoValidator, capture, errors)) {
+ var error = new Error('Cannot read public key. ' +
+ 'ASN.1 object does not contain an PublicKeyInfo.');
+ error.errors = errors;
+ throw error;
}
-
- // get RSA params
- errors = [];
+ obj = capture.subjectPublicKey.value[0];
if(!asn1.validate(obj, rsaPublicKeyValidator, capture, errors)) {
var error = new Error('Cannot read public key. ' +
- 'ASN.1 object does not contain an RSAPublicKey.');
+ 'ASN.1 object does not contain an RSAPublicKey.');
error.errors = errors;
throw error;
}
-
// FIXME: inefficient, get a BigInteger that uses byte strings
var n = forge.util.createBuffer(capture.publicKeyModulus).toHex();
var e = forge.util.createBuffer(capture.publicKeyExponent).toHex();
@@ -1503,6 +1462,31 @@ pki.publicKeyFromAsn1 = function(obj) {
return pki.setRsaPublicKey(
new BigInteger(n, 16),
new BigInteger(e, 16));
+}
+
+/**
+ * Converts a public key from an ASN.1 SubjectPublicKeyInfo or RSAPublicKey.
+ *
+ * @param obj the asn1 representation of a SubjectPublicKeyInfo or RSAPublicKey.
+ *
+ * @return the public key.
+ */
+pki.publicKeyFromAsn1 = function(obj) {
+ // get SubjectPublicKeyInfo
+ var capture = {};
+ var errors = [];
+ // get oid
+ var oid = asn1.derToOid(obj.value[0].value[0].value);
+ switch (oid) {
+ case pki.oids.rsaEncryption:
+ return pki.rsa.publicKeyFromAsn1(obj);
+ case pki.oids.ecPublicKey:
+ return ecdsa.ECPublicKey.fromAsn1(obj);
+ default:
+ var error = new Error('Cannot read public key. Unknown OID.');
+ error.oid = oid;
+ throw error;
+ }
};
/**
diff --git a/lib/x509.js b/lib/x509.js
index b4a4f6d7a4c57bea6d986a733f360a299bd15f5f..ce83d6dec9140d7df79c0e61bfc754df44f907a8 100644
--- a/lib/x509.js
+++ b/lib/x509.js
@@ -144,8 +144,8 @@ _shortNames['E'] = oids['emailAddress'];
_shortNames['emailAddress'] = 'E';
// validator for an SubjectPublicKeyInfo structure
-// Note: Currently only works with an RSA public key
-var publicKeyValidator = forge.pki.rsa.publicKeyValidator;
+var asn1Validator = require('./asn1-validator');
+var publicKeyInfoValidator = asn1Validator.publicKeyInfoValidator;
// validator for an X.509v3 certificate
var x509CertificateValidator = {
@@ -252,7 +252,7 @@ var x509CertificateValidator = {
captureAsn1: 'certSubject'
},
// SubjectPublicKeyInfo
- publicKeyValidator,
+ publicKeyInfoValidator,
{
// issuerUniqueID (optional)
name: 'Certificate.TBSCertificate.issuerUniqueID',
@@ -427,7 +427,7 @@ var certificationRequestInfoValidator = {
captureAsn1: 'certificationRequestInfoSubject'
},
// SubjectPublicKeyInfo
- publicKeyValidator,
+ publicKeyInfoValidator,
{
name: 'CertificationRequestInfo.attributes',
tagClass: asn1.Class.CONTEXT_SPECIFIC,
@@ -706,13 +706,15 @@ var _createSignatureDigest = function(options) {
case 'md5WithRSAEncryption':
return forge.md.md5.create();
case 'sha256WithRSAEncryption':
+ case 'RSASSA-PSS':
+ case 'ecdsa-with-SHA256':
return forge.md.sha256.create();
case 'sha384WithRSAEncryption':
+ case 'ecdsa-with-SHA384':
return forge.md.sha384.create();
case 'sha512WithRSAEncryption':
+ case 'ecdsa-with-SHA512':
return forge.md.sha512.create();
- case 'RSASSA-PSS':
- return forge.md.sha256.create();
default:
var error = new Error(
'Could not compute ' + options.type + ' digest. ' +
@@ -1312,8 +1314,8 @@ pki.certificateFromAsn1 = function(obj, computeHash) {
// get oid
var oid = asn1.derToOid(capture.publicKeyOid);
- if(oid !== pki.oids.rsaEncryption) {
- throw new Error('Cannot read public key. OID is not RSA.');
+ if(![pki.oids.rsaEncryption, pki.oids.ecPublicKey].includes(oid)) {
+ throw new Error('Cannot read public key. publicKeyOid: ' + oid);
}
// create certificate
diff --git a/package.json b/package.json
index a78076c0f5020f48af7d9bf0b88ef39883374d08..b4d0074930f08c206c6071167cf43e2db0fc477e 100644
--- a/package.json
+++ b/package.json
@@ -119,5 +119,8 @@
"buffer": false,
"crypto": false,
"process": false
+ },
+ "dependencies": {
+ "elliptic": "^6.5.4"
}
}
+12
View File
@@ -0,0 +1,12 @@
diff --git a/lib/run-pace.js b/lib/run-pace.js
index 2b20a32ff4b5712016dd869a734ff25f730cdb12..9b9b72187e6675db6b295a827f2293950d12a111 100644
--- a/lib/run-pace.js
+++ b/lib/run-pace.js
@@ -119,7 +119,3 @@ function removeTrailingZeroes(number) {
function removeLeadingZero(number) {
return number.replace(/^0/, "");
}
-
-function zeroPad(number) {
- return `0${number}`.slice(-2);
-}
+40 -13
View File
@@ -1,8 +1,23 @@
import { defineConfig, devices } from '@playwright/test';
const isCI = !!process.env.CI;
const baseUrl = process.env.BASE_URL || 'http://localhost:5050';
const useWebServer = process.env.NO_WEB_SERVER !== 'true';
// `pnpm preview` serves the production build here, and Playwright starts it
// itself. Point E2E_BASE_URL somewhere else -- a running `pnpm dev`, a deployed
// preview -- and that is taken as "I am supplying the server", so Playwright
// leaves the lifecycle alone.
//
// Deliberately not BASE_URL: vite.config.ts already reads that as the app's
// base path (`/it-tools/`), so sharing the name would make one value mean two
// incompatible things.
const previewUrl = 'http://localhost:5050';
const baseUrl = process.env.E2E_BASE_URL || previewUrl;
const useWebServer = baseUrl === previewUrl;
// What the browser sees is pinned by `timezoneId` below, and the specs do no
// date maths of their own, so today this changes nothing. It keeps the runner
// deterministic if a spec ever does compute a date on the node side.
process.env.TZ = 'UTC';
/**
* See https://playwright.dev/docs/test-configuration.
@@ -10,14 +25,23 @@ const useWebServer = process.env.NO_WEB_SERVER !== 'true';
export default defineConfig({
testDir: './src',
testMatch: /\.e2e\.(spec\.)?ts$/,
/* First paint of heavy lazy-loaded tools can exceed the 5s default on
slow CI browsers (webkit especially). Three workers share a runner, so
first paint is slower still and CI needs more headroom than a local run.
The test timeout has to stay above the expect timeout, otherwise it fires
first and reports a timeout instead of the assertion that actually failed. */
timeout: isCI ? 60_000 : 30_000,
expect: { timeout: isCI ? 30_000 : 15_000 },
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: isCI,
/* Retry on CI only */
retries: isCI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: isCI ? 1 : undefined,
/* CI runs one browser per job on a 4-core runner. Three workers saturates it
(measured ~95% busy); a fourth adds nothing and leaves no core for the
preview server. */
workers: isCI ? 3 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
@@ -53,13 +77,16 @@ export default defineConfig({
/* Run your local dev server before starting the tests */
...(useWebServer
&& {
webServer: {
command: 'npm run preview',
url: 'http://localhost:5050',
reuseExistingServer: !isCI,
},
}
),
...(useWebServer && {
webServer: {
command: 'pnpm preview',
url: previewUrl,
reuseExistingServer: !isCI,
// pnpm 12 runs the script in its own process group, so Playwright's
// default SIGKILL to the `pnpm preview` group misses vite: it survives,
// holds the output pipes open, and the run never exits. pnpm forwards
// SIGTERM to the script, so stop it that way.
gracefulShutdown: { signal: 'SIGTERM', timeout: 5_000 },
},
}),
});
+8962 -9655
View File
File diff suppressed because it is too large. Load diff
+64
View File
@@ -0,0 +1,64 @@
# The xlsx override below points the graph at the SheetJS CDN tarball, because
# the npm registry version is stale (0.18.5) and carries known vulnerabilities.
# Only this package depends on xlsx now, so pnpm's default protection against
# URL tarballs in subdependencies can stay enabled.
overrides:
'@vueuse/shared': 13.9.0
# Native-only transitives of webcrack / @huggingface/transformers.
# The browser app aliases both to an empty module in vite.config.ts,
# so stub them out entirely (saves ~225 MB of node_modules).
isolated-vm: file:./stubs/empty-stub
onnxruntime-node: file:./stubs/empty-stub
elliptic: ^6.6.1
# @boxyhq/saml20 pins 0.9.10 exactly, which upstream deprecated for "critical
# issues"; 0.9.11 is the patched release of that same line.
'@xmldom/xmldom@0.9.10': 0.9.11
# @it-tools/bip39 pins ^0.9.0, whose Node fallback uses eval("require('crypto')")
# and triggers rolldown EVAL build warnings; 0.11.x dropped the eval.
js-sha256: ^0.11.1
xlsx: https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz
patchedDependencies:
node-forge@1.4.0: patches/node-forge@1.4.0.patch
esm-potrace-wasm: patches/esm-potrace-wasm.patch
run-pace: patches/run-pace.patch
curlconverter@4.12.0: patches/curlconverter@4.12.0.patch
# pnpm 11 requires an explicit decision for every dependency build script.
# true = script is needed (native binaries / functional postinstall)
# false = script is cosmetic (funding banners) or the build is unneeded
allowBuilds:
'@scarf/scarf': false
core-js: false
es5-ext: false
esbuild: true
exifreader: false
json-editor-vue: false
msgpackr-extract: true
protobufjs: false
sharp: false
tesseract.js: false
# Native Node bindings for curlconverter's shell parser. The app only uses
# curlconverter in the browser, where its `browser` field swaps in
# web-tree-sitter (WASM), so the addon is never loaded. There is no
# linux-arm64 prebuild, and compiling it fails against Node 24's C++20 headers.
tree-sitter: false
tree-sitter-bash: false
vue-demi: true
minimumReleaseAgeExclude:
- phin@3.7.1
- elliptic@6.6.2
- file-type@21.3.1
- unhead@2.1.11 || 2.1.13
- dompurify@3.3.2 || 3.3.4 || 3.4.0 || 3.4.6 || 3.4.7 || 3.4.8 || 3.4.9 || 3.4.11
- protocol-buffers-schema@3.6.1
- '@xmldom/xmldom@0.8.14 || 0.9.11'
- mathjs@15.2.0
- protobufjs@7.5.5 || 7.5.6 || 7.5.8 || 7.6.1 || 7.6.3
- underscore@1.13.8
- ip-address@10.1.1
- uuid@11.1.1
- '@iplookup/country-extra@1.0.20260711'
- nanoid@6.0.0
@@ -0,0 +1,41 @@
class PinkNoiseProcessor extends AudioWorkletProcessor {
b0 = 0;
b1 = 0;
b2 = 0;
b3 = 0;
b4 = 0;
b5 = 0;
b6 = 0;
process(inputs, outputs) {
const output = outputs[0];
for (const channel of output) {
for (let i = 0; i < channel.length; i++) {
const white = Math.random() * 2 - 1;
this.b0 = 0.99886 * this.b0 + white * 0.0555179;
this.b1 = 0.99332 * this.b1 + white * 0.0750759;
this.b2 = 0.969 * this.b2 + white * 0.153852;
this.b3 = 0.8665 * this.b3 + white * 0.3104856;
this.b4 = 0.55 * this.b4 + white * 0.5329522;
this.b5 = -0.7616 * this.b5 - white * 0.016898;
let pink = this.b0 + this.b1 + this.b2 + this.b3 + this.b4 + this.b5 + this.b6 + white * 0.5362;
this.b6 = white * 0.115926;
channel[i] = pink * 0.11;
}
}
return true;
}
}
registerProcessor('pink-noise-processor', PinkNoiseProcessor);
+36
View File
@@ -0,0 +1,36 @@
class SweepProcessor extends AudioWorkletProcessor {
phase = 0;
position = 0;
startFreq = 20;
endFreq = 20000;
duration = 10;
process(inputs, outputs) {
const output = outputs[0];
const totalSamples = sampleRate * this.duration;
for (const channel of output) {
for (let i = 0; i < channel.length; i++) {
const progress = this.position / totalSamples;
const freq = this.startFreq * Math.pow(this.endFreq / this.startFreq, progress);
channel[i] = Math.sin(this.phase) * 0.2;
this.phase += (2 * Math.PI * freq) / sampleRate;
this.position++;
}
}
if (this.position >= totalSamples) {
return false;
}
return true;
}
}
registerProcessor('sweep-processor', SweepProcessor);
+49
View File
@@ -0,0 +1,49 @@
class ToneProcessor extends AudioWorkletProcessor {
static get parameterDescriptors() {
return [
{
name: 'frequency',
defaultValue: 440,
minValue: 20,
maxValue: 20000,
},
{
name: 'gain',
defaultValue: 0.2,
minValue: 0,
maxValue: 1,
},
];
}
phase = 0;
process(inputs, outputs, parameters) {
const output = outputs[0];
const frequencies = parameters.frequency;
const gains = parameters.gain;
for (let channel = 0; channel < output.length; channel++) {
const data = output[channel];
for (let i = 0; i < data.length; i++) {
const frequency = frequencies.length > 1 ? frequencies[i] : frequencies[0];
const gain = gains.length > 1 ? gains[i] : gains[0];
data[i] = Math.sin(this.phase) * gain;
this.phase += (2 * Math.PI * frequency) / sampleRate;
if (this.phase > Math.PI * 2) {
this.phase -= Math.PI * 2;
}
}
}
return true;
}
}
registerProcessor('tone-processor', ToneProcessor);
@@ -0,0 +1,15 @@
class WhiteNoiseProcessor extends AudioWorkletProcessor {
process(inputs, outputs) {
const output = outputs[0];
for (const channel of output) {
for (let i = 0; i < channel.length; i++) {
channel[i] = Math.random() * 2 - 1;
}
}
return true;
}
}
registerProcessor('white-noise-processor', WhiteNoiseProcessor);
Binary file not shown.
+18 -11
View File
@@ -33,7 +33,7 @@ function escapeHtml(text) {
'"': '&quot;',
"'": '&#039;'
};
return text.replace(/[&<>"']/g, char => map[char]);
return String(text).replace(/[&<>"']/g, char => map[char]);
}
// Helper function to generate HTML table from table data array
@@ -1139,7 +1139,7 @@ function reset() {
let rootNetwork = get_network($('#network').val(), $('#netsize').val())
let rootCidr = rootNetwork + '/' + $('#netsize').val()
if (cidrInput !== rootCidr) {
show_warning_modal('<div>Your network input is not on a network boundary for this network size. It has been automatically changed:</div><div class="font-monospace pt-2">' + $('#network').val() + ' -> ' + rootNetwork + '</div>')
show_warning_modal('<div>Your network input is not on a network boundary for this network size. It has been automatically changed:</div><div class="font-monospace pt-2">' + escapeHtml($('#network').val()) + ' -> ' + escapeHtml(rootNetwork) + '</div>')
$('#network').val(rootNetwork)
cidrInput = $('#network').val() + '/' + $('#netsize').val()
}
@@ -1264,6 +1264,13 @@ function addRowTree(subnetTree, depth, maxDepth, operatingMode) {
}
function addRow(network, netSize, colspan, note, notesWidth, color, operatingMode) {
// The subnet map can come from a shareable URL or an imported config, so escape everything that lands in HTML
const rawNetwork = network
network = escapeHtml(network)
note = escapeHtml(note)
if (!/^#[0-9a-f]{3,8}$/i.test(color)) {
color = ''
}
let addressFirst = ip2int(network)
let addressLast = subnet_last_address(addressFirst, netSize)
let usableFirst = subnet_usable_first(addressFirst, netSize, operatingMode)
@@ -1317,10 +1324,10 @@ function addRow(network, netSize, colspan, note, notesWidth, color, operatingMod
// DONE: If the subnet address (without the mask) matches a larger subnet address
// in the heirarchy that is a signal to add more join buttons to that row, since they start at the top row and
// via rowspan extend downward.
let matchingNetworkList = get_matching_network_list(network, subnetMap).slice(1)
let matchingNetworkList = get_matching_network_list(rawNetwork, subnetMap).slice(1)
for (const i in matchingNetworkList) {
let matchingNetwork = matchingNetworkList[i]
let networkChildrenCount = count_network_children(matchingNetwork, subnetMap, [])
let networkChildrenCount = count_network_children(matchingNetworkList[i], subnetMap, [])
let matchingNetwork = escapeHtml(matchingNetworkList[i])
newRow += ' <td aria-label="' + matchingNetwork + ' Join" rowspan="' + networkChildrenCount + '" colspan="1" class="join rotate" data-subnet="' + matchingNetwork + '" data-mutate-verb="join"><span>/' + matchingNetwork.split('/')[1] + '</span></td>\n'
}
}
@@ -2281,7 +2288,7 @@ $('#btn_auto_allocate').on('click', function() {
if (subnetRequests.errors) {
let errorHtml = '<div class="alert alert-danger"><strong>Subnet Requirements Errors:</strong><ul class="mb-0">';
for (const error of subnetRequests.errors) {
errorHtml += `<li>${error}</li>`;
errorHtml += `<li>${escapeHtml(error)}</li>`;
}
errorHtml += '</ul></div>';
$('#allocation_results').html(errorHtml);
@@ -2464,7 +2471,7 @@ $('#btn_auto_allocate').on('click', function() {
if (allocations.length > 0) {
resultsHtml += '<div class="alert alert-success"><h6>Allocated Subnets:</h6><ul class="mb-0">';
for (const alloc of allocations) {
resultsHtml += `<li><strong>${alloc.name}:</strong> ${alloc.cidr}</li>`;
resultsHtml += `<li><strong>${escapeHtml(alloc.name)}:</strong> ${escapeHtml(alloc.cidr)}</li>`;
}
resultsHtml += '</ul></div>';
@@ -2557,7 +2564,7 @@ $('#btn_auto_allocate').on('click', function() {
if (allocationErrors.length > 0) {
resultsHtml += '<div class="alert alert-danger"><h6>Errors:</h6><ul class="mb-0">';
for (const error of allocationErrors) {
resultsHtml += `<li>${error}</li>`;
resultsHtml += `<li>${escapeHtml(error)}</li>`;
}
resultsHtml += '</ul></div>';
}
@@ -2565,7 +2572,7 @@ $('#btn_auto_allocate').on('click', function() {
$('#allocation_results').html(resultsHtml);
} catch (error) {
console.error('Auto-allocation error:', error);
$('#allocation_results').html('<div class="alert alert-danger">An error occurred during allocation: ' + error.message + '</div>');
$('#allocation_results').html('<div class="alert alert-danger">An error occurred during allocation: ' + escapeHtml(error.message) + '</div>');
}
}, 100);
});
@@ -2665,14 +2672,14 @@ $('#btn_validate_alignment').on('click', function() {
if (issues.length > 0) {
resultsHtml += '<div class="alert alert-danger"><h6>Issues Found:</h6><ul class="mb-0">';
for (const issue of issues) {
resultsHtml += `<li>${issue}</li>`;
resultsHtml += `<li>${escapeHtml(issue)}</li>`;
}
resultsHtml += '</ul></div>';
}
if (warnings.length > 0) {
resultsHtml += '<div class="alert alert-warning"><h6>Gaps Detected:</h6><ul class="mb-0">';
for (const warning of warnings) {
resultsHtml += `<li>${warning}</li>`;
resultsHtml += `<li>${escapeHtml(warning)}</li>`;
}
resultsHtml += '</ul></div>';
}
+561
View File
@@ -0,0 +1,561 @@
let wasm;
function addToExternrefTable0(obj) {
const idx = wasm.__externref_table_alloc();
wasm.__wbindgen_export_2.set(idx, obj);
return idx;
}
function handleError(f, args) {
try {
return f.apply(this, args);
} catch (e) {
const idx = addToExternrefTable0(e);
wasm.__wbindgen_exn_store(idx);
}
}
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
let cachedUint8ArrayMemory0 = null;
function getUint8ArrayMemory0() {
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
}
return cachedUint8ArrayMemory0;
}
function getStringFromWasm0(ptr, len) {
ptr = ptr >>> 0;
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
}
let WASM_VECTOR_LEN = 0;
function passArray8ToWasm0(arg, malloc) {
const ptr = malloc(arg.length * 1, 1) >>> 0;
getUint8ArrayMemory0().set(arg, ptr / 1);
WASM_VECTOR_LEN = arg.length;
return ptr;
}
let cachedDataViewMemory0 = null;
function getDataViewMemory0() {
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
}
return cachedDataViewMemory0;
}
function isLikeNone(x) {
return x === undefined || x === null;
}
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
? function (arg, view) {
return cachedTextEncoder.encodeInto(arg, view);
}
: function (arg, view) {
const buf = cachedTextEncoder.encode(arg);
view.set(buf);
return {
read: arg.length,
written: buf.length
};
});
function passStringToWasm0(arg, malloc, realloc) {
if (realloc === undefined) {
const buf = cachedTextEncoder.encode(arg);
const ptr = malloc(buf.length, 1) >>> 0;
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
WASM_VECTOR_LEN = buf.length;
return ptr;
}
let len = arg.length;
let ptr = malloc(len, 1) >>> 0;
const mem = getUint8ArrayMemory0();
let offset = 0;
for (; offset < len; offset++) {
const code = arg.charCodeAt(offset);
if (code > 0x7F) break;
mem[ptr + offset] = code;
}
if (offset !== len) {
if (offset !== 0) {
arg = arg.slice(offset);
}
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
const ret = encodeString(arg, view);
offset += ret.written;
ptr = realloc(ptr, len, offset, 1) >>> 0;
}
WASM_VECTOR_LEN = offset;
return ptr;
}
function debugString(val) {
// primitive types
const type = typeof val;
if (type == 'number' || type == 'boolean' || val == null) {
return `${val}`;
}
if (type == 'string') {
return `"${val}"`;
}
if (type == 'symbol') {
const description = val.description;
if (description == null) {
return 'Symbol';
} else {
return `Symbol(${description})`;
}
}
if (type == 'function') {
const name = val.name;
if (typeof name == 'string' && name.length > 0) {
return `Function(${name})`;
} else {
return 'Function';
}
}
// objects
if (Array.isArray(val)) {
const length = val.length;
let debug = '[';
if (length > 0) {
debug += debugString(val[0]);
}
for(let i = 1; i < length; i++) {
debug += ', ' + debugString(val[i]);
}
debug += ']';
return debug;
}
// Test for built-in
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
let className;
if (builtInMatches && builtInMatches.length > 1) {
className = builtInMatches[1];
} else {
// Failed to match the standard '[object ClassName]'
return toString.call(val);
}
if (className == 'Object') {
// we're a user defined class or Object
// JSON.stringify avoids problems with cycles, and is generally much
// easier than looping through ownProperties of `val`.
try {
return 'Object(' + JSON.stringify(val) + ')';
} catch (_) {
return 'Object';
}
}
// errors
if (val instanceof Error) {
return `${val.name}: ${val.message}\n${val.stack}`;
}
// TODO we could test for more things here, like `Set`s and `Map`s.
return className;
}
export function main() {
wasm.main();
}
const BinaryImageConverterFinalization = (typeof FinalizationRegistry === 'undefined')
? { register: () => {}, unregister: () => {} }
: new FinalizationRegistry(ptr => wasm.__wbg_binaryimageconverter_free(ptr >>> 0, 1));
export class BinaryImageConverter {
static __wrap(ptr) {
ptr = ptr >>> 0;
const obj = Object.create(BinaryImageConverter.prototype);
obj.__wbg_ptr = ptr;
BinaryImageConverterFinalization.register(obj, obj.__wbg_ptr, obj);
return obj;
}
__destroy_into_raw() {
const ptr = this.__wbg_ptr;
this.__wbg_ptr = 0;
BinaryImageConverterFinalization.unregister(this);
return ptr;
}
free() {
const ptr = this.__destroy_into_raw();
wasm.__wbg_binaryimageconverter_free(ptr, 0);
}
/**
* @param {string} params
* @returns {BinaryImageConverter}
*/
static new_with_string(params) {
const ptr0 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len0 = WASM_VECTOR_LEN;
const ret = wasm.binaryimageconverter_new_with_string(ptr0, len0);
return BinaryImageConverter.__wrap(ret);
}
init() {
wasm.binaryimageconverter_init(this.__wbg_ptr);
}
/**
* @returns {boolean}
*/
tick() {
const ret = wasm.binaryimageconverter_tick(this.__wbg_ptr);
return ret !== 0;
}
/**
* @returns {number}
*/
progress() {
const ret = wasm.binaryimageconverter_progress(this.__wbg_ptr);
return ret >>> 0;
}
}
const ColorImageConverterFinalization = (typeof FinalizationRegistry === 'undefined')
? { register: () => {}, unregister: () => {} }
: new FinalizationRegistry(ptr => wasm.__wbg_colorimageconverter_free(ptr >>> 0, 1));
export class ColorImageConverter {
static __wrap(ptr) {
ptr = ptr >>> 0;
const obj = Object.create(ColorImageConverter.prototype);
obj.__wbg_ptr = ptr;
ColorImageConverterFinalization.register(obj, obj.__wbg_ptr, obj);
return obj;
}
__destroy_into_raw() {
const ptr = this.__wbg_ptr;
this.__wbg_ptr = 0;
ColorImageConverterFinalization.unregister(this);
return ptr;
}
free() {
const ptr = this.__destroy_into_raw();
wasm.__wbg_colorimageconverter_free(ptr, 0);
}
/**
* @param {string} params
* @returns {ColorImageConverter}
*/
static new_with_string(params) {
const ptr0 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len0 = WASM_VECTOR_LEN;
const ret = wasm.colorimageconverter_new_with_string(ptr0, len0);
return ColorImageConverter.__wrap(ret);
}
init() {
wasm.colorimageconverter_init(this.__wbg_ptr);
}
/**
* @returns {boolean}
*/
tick() {
const ret = wasm.colorimageconverter_tick(this.__wbg_ptr);
return ret !== 0;
}
/**
* @returns {number}
*/
progress() {
const ret = wasm.colorimageconverter_progress(this.__wbg_ptr);
return ret;
}
}
async function __wbg_load(module, imports) {
if (typeof Response === 'function' && module instanceof Response) {
if (typeof WebAssembly.instantiateStreaming === 'function') {
try {
return await WebAssembly.instantiateStreaming(module, imports);
} catch (e) {
if (module.headers.get('Content-Type') != 'application/wasm') {
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
} else {
throw e;
}
}
}
const bytes = await module.arrayBuffer();
return await WebAssembly.instantiate(bytes, imports);
} else {
const instance = await WebAssembly.instantiate(module, imports);
if (instance instanceof WebAssembly.Instance) {
return { instance, module };
} else {
return instance;
}
}
}
function __wbg_get_imports() {
const imports = {};
imports.wbg = {};
imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
const ret = arg0.call(arg1);
return ret;
}, arguments) };
imports.wbg.__wbg_createElementNS_914d752e521987da = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
const ret = arg0.createElementNS(arg1 === 0 ? undefined : getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
return ret;
}, arguments) };
imports.wbg.__wbg_data_d1ed736c1e42b10e = function(arg0, arg1) {
const ret = arg1.data;
const ptr1 = passArray8ToWasm0(ret, wasm.__wbindgen_malloc);
const len1 = WASM_VECTOR_LEN;
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
};
imports.wbg.__wbg_debug_e17b51583ca6a632 = function(arg0, arg1, arg2, arg3) {
console.debug(arg0, arg1, arg2, arg3);
};
imports.wbg.__wbg_document_d249400bd7bd996d = function(arg0) {
const ret = arg0.document;
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
};
imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
let deferred0_0;
let deferred0_1;
try {
deferred0_0 = arg0;
deferred0_1 = arg1;
console.error(getStringFromWasm0(arg0, arg1));
} finally {
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
}
};
imports.wbg.__wbg_error_80de38b3f7cc3c3c = function(arg0, arg1, arg2, arg3) {
console.error(arg0, arg1, arg2, arg3);
};
imports.wbg.__wbg_getContext_e9cf379449413580 = function() { return handleError(function (arg0, arg1, arg2) {
const ret = arg0.getContext(getStringFromWasm0(arg1, arg2));
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
}, arguments) };
imports.wbg.__wbg_getElementById_f827f0d6648718a8 = function(arg0, arg1, arg2) {
const ret = arg0.getElementById(getStringFromWasm0(arg1, arg2));
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
};
imports.wbg.__wbg_getImageData_c02374a30b126dab = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
const ret = arg0.getImageData(arg1, arg2, arg3, arg4);
return ret;
}, arguments) };
imports.wbg.__wbg_height_838cee19ba8597db = function(arg0) {
const ret = arg0.height;
return ret;
};
imports.wbg.__wbg_info_033d8b8a0838f1d3 = function(arg0, arg1, arg2, arg3) {
console.info(arg0, arg1, arg2, arg3);
};
imports.wbg.__wbg_instanceof_CanvasRenderingContext2d_df82a4d3437bf1cc = function(arg0) {
let result;
try {
result = arg0 instanceof CanvasRenderingContext2D;
} catch (_) {
result = false;
}
const ret = result;
return ret;
};
imports.wbg.__wbg_instanceof_HtmlCanvasElement_2ea67072a7624ac5 = function(arg0) {
let result;
try {
result = arg0 instanceof HTMLCanvasElement;
} catch (_) {
result = false;
}
const ret = result;
return ret;
};
imports.wbg.__wbg_instanceof_Window_def73ea0955fc569 = function(arg0) {
let result;
try {
result = arg0 instanceof Window;
} catch (_) {
result = false;
}
const ret = result;
return ret;
};
imports.wbg.__wbg_log_c222819a41e063d3 = function(arg0) {
console.log(arg0);
};
imports.wbg.__wbg_log_cad59bb680daec67 = function(arg0, arg1, arg2, arg3) {
console.log(arg0, arg1, arg2, arg3);
};
imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
const ret = new Error();
return ret;
};
imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
const ret = new Function(getStringFromWasm0(arg0, arg1));
return ret;
};
imports.wbg.__wbg_prepend_536a5a2dc0b99b47 = function() { return handleError(function (arg0, arg1) {
arg0.prepend(arg1);
}, arguments) };
imports.wbg.__wbg_setAttribute_2704501201f15687 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
arg0.setAttribute(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
}, arguments) };
imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
const ret = arg1.stack;
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len1 = WASM_VECTOR_LEN;
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
};
imports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
const ret = typeof global === 'undefined' ? null : global;
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
};
imports.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
const ret = typeof globalThis === 'undefined' ? null : globalThis;
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
};
imports.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
const ret = typeof self === 'undefined' ? null : self;
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
};
imports.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
const ret = typeof window === 'undefined' ? null : window;
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
};
imports.wbg.__wbg_warn_aaf1f4664a035bd6 = function(arg0, arg1, arg2, arg3) {
console.warn(arg0, arg1, arg2, arg3);
};
imports.wbg.__wbg_width_5dde457d606ba683 = function(arg0) {
const ret = arg0.width;
return ret;
};
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
const ret = debugString(arg1);
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len1 = WASM_VECTOR_LEN;
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
};
imports.wbg.__wbindgen_init_externref_table = function() {
const table = wasm.__wbindgen_export_2;
const offset = table.grow(4);
table.set(0, undefined);
table.set(offset + 0, undefined);
table.set(offset + 1, null);
table.set(offset + 2, true);
table.set(offset + 3, false);
;
};
imports.wbg.__wbindgen_is_undefined = function(arg0) {
const ret = arg0 === undefined;
return ret;
};
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
const ret = getStringFromWasm0(arg0, arg1);
return ret;
};
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
throw new Error(getStringFromWasm0(arg0, arg1));
};
return imports;
}
function __wbg_init_memory(imports, memory) {
}
function __wbg_finalize_init(instance, module) {
wasm = instance.exports;
__wbg_init.__wbindgen_wasm_module = module;
cachedDataViewMemory0 = null;
cachedUint8ArrayMemory0 = null;
wasm.__wbindgen_start();
return wasm;
}
function initSync(module) {
if (wasm !== undefined) return wasm;
if (typeof module !== 'undefined') {
if (Object.getPrototypeOf(module) === Object.prototype) {
({module} = module)
} else {
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
}
}
const imports = __wbg_get_imports();
__wbg_init_memory(imports);
if (!(module instanceof WebAssembly.Module)) {
module = new WebAssembly.Module(module);
}
const instance = new WebAssembly.Instance(module, imports);
return __wbg_finalize_init(instance, module);
}
async function __wbg_init(module_or_path) {
if (wasm !== undefined) return wasm;
if (typeof module_or_path !== 'undefined') {
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
({module_or_path} = module_or_path)
} else {
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
}
}
if (typeof module_or_path === 'undefined') {
module_or_path = new URL('vtracer_webapp_bg.wasm', import.meta.url);
}
const imports = __wbg_get_imports();
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
module_or_path = fetch(module_or_path);
}
__wbg_init_memory(imports);
const { instance, module } = await __wbg_load(await module_or_path, imports);
return __wbg_finalize_init(instance, module);
}
export { initSync };
export default __wbg_init;
window.vtracerInit = __wbg_init;
window.ColorImageConverter = ColorImageConverter;
Binary file not shown.
+2 -2
View File
@@ -1255,9 +1255,9 @@ $(document).ready(function() {
$("input#add_vdev").val("");
if (new_vdev_type == "mirror") {
$("td#status").html(new_vdev_width + "-way mirror added");
$("td#status").text(new_vdev_width + "-way mirror added");
} else {
$("td#status").html(new_vdev_width + "-wide " + new_vdev_type.toUpperCase() + " added");
$("td#status").text(new_vdev_width + "-wide " + new_vdev_type.toUpperCase() + " added");
}
}
+2 -8
View File
@@ -20,7 +20,7 @@
"packageRules": [
{
"groupName": "TypeScript toolchain",
"matchPackageNames": ["typescript", "vue-tsc"],
"matchPackageNames": ["typescript", "vue-tsc", "oxlint-tsgolint"],
"matchUpdateTypes": ["major", "minor", "patch"]
},
{
@@ -50,7 +50,6 @@
"groupName": "UnoCSS ecosystem",
"matchPackageNames": [
"unocss",
"@unocss/eslint-config",
"unocss-preset-scrollbar"
],
"matchUpdateTypes": ["major", "minor", "patch"]
@@ -74,17 +73,12 @@
"matchPackageNames": ["@vueuse/core", "@vueuse/head", "@vueuse/router"],
"matchUpdateTypes": ["major", "minor", "patch"]
},
{
"groupName": "uuid with types",
"matchPackageNames": ["uuid", "@types/uuid"],
"matchUpdateTypes": ["major", "minor", "patch"]
},
{
"groupName": "Type packages with their dependencies",
"matchDepTypes": ["devDependencies"],
"groupSlug": "types",
"automerge": true,
"matchPackageNames": ["/^@types//", "!@types/uuid"]
"matchPackageNames": ["/^@types//"]
}
]
}
+24 -12
View File
@@ -11,29 +11,42 @@ if (fs.existsSync(localesFile)) {
localesData = yaml.parse(fs.readFileSync(localesFile, 'utf-8')) || {};
}
// Single-quoted JS string that may contain escaped quotes. `[^'\\]|\\.` cannot overlap, so it cannot backtrack exponentially.
const quotedValue = (key) => new RegExp(`\\b${key}:[ \n]+'((?:[^'\\\\]|\\\\.)*)'`);
// Decode JS string escapes (\n, \x27, \u00e9, \u{1F600}, \') the way the JS parser would
const JS_ESCAPES = { n: '\n', r: '\r', t: '\t', b: '\b', f: '\f', v: '\v', 0: '\0' };
const unescapeValue = (value) =>
value.replace(/\\(?:u\{([\da-fA-F]+)\}|u([\da-fA-F]{4})|x([\da-fA-F]{2})|(.))/g, (_, codePoint, u4, x2, char) =>
char === undefined ? String.fromCodePoint(Number.parseInt(codePoint ?? u4 ?? x2, 16)) : (JS_ESCAPES[char] ?? char),
);
function processFile(filePath) {
const parentDir = path.basename(path.dirname(filePath)); // Get parent directory name
const originalContent = fs.readFileSync(filePath, 'utf-8');
// Extract existing name and description values
const nameMatch = originalContent.match(/name: '(.*?)'/);
const descriptionMatch = originalContent.match(/description: '(.*?)'/);
const externAccessDescriptionMatch = originalContent.match(/externAccessDescription: '(.*?)'/);
const nameMatch = originalContent.match(quotedValue('name'));
const descriptionMatch = originalContent.match(quotedValue('description'));
const externAccessDescriptionMatch = originalContent.match(quotedValue('externAccessDescription'));
if (!nameMatch || !descriptionMatch) {
console.warn(`Skipping ${filePath}: Unable to extract name or description.`);
console.warn(
`Skipping ${filePath}: Unable to extract name (${nameMatch ? 'found' : 'not found'}) or description (${descriptionMatch ? 'found' : 'not found'}).`,
);
return;
}
const nameValue = nameMatch[1];
const descriptionValue = descriptionMatch[1];
const externAccessDescriptionValue = externAccessDescriptionMatch ? externAccessDescriptionMatch[1] : null;
const nameValue = unescapeValue(nameMatch[1]);
const descriptionValue = unescapeValue(descriptionMatch[1]);
const externAccessDescriptionValue = externAccessDescriptionMatch
? unescapeValue(externAccessDescriptionMatch[1])
: null;
// Modify name and description to use the translate function
const transformedContent = originalContent
.replace(/name: '((?:[^']+|(?<=\\)')+)'/, `name: t('tools.${parentDir}.title')`)
.replace(/description: '((?:[^']+|(?<=\\)')+)'/, `description: t('tools.${parentDir}.description')`)
.replace(/externAccessDescription: '((?:[^']+|(?<=\\)')+)'/, `externAccessDescription: t('tools.${parentDir}.externalAccess')`);
.replace(quotedValue('name'), `name: t('tools.${parentDir}.title')`)
.replace(quotedValue('description'), `description: t('tools.${parentDir}.description')`)
.replace(quotedValue('externAccessDescription'), `externAccessDescription: t('tools.${parentDir}.externalAccess')`);
fs.writeFileSync(filePath, `import { translate as t } from '@/plugins/i18n.plugin';\n${transformedContent}`, 'utf-8');
console.log(`Transformed: ${filePath}`);
@@ -59,8 +72,7 @@ function iterateFolder(folderPath) {
if (stat.isDirectory()) {
iterateFolder(itemPath);
}
else if (item === 'index.ts') {
} else if (item === 'index.ts') {
processFile(itemPath);
}
});
+1 -1
View File
@@ -49,7 +49,7 @@ try {
consola.success('Changelog changes committed');
consola.info('Creating version and tag');
await $`npm version ${version} -m "chore(version): release ${version}"`;
await $`pnpm version ${version} -m "chore(version): release ${version}"`;
consola.info('Npm version released with tag');
} catch (error) {
consola.error(error);
+75
View File
@@ -0,0 +1,75 @@
// Downloads every template of github/gitignore and alexkaratarakis/gitattributes into JSON snapshots that the
// gitignore and gitattributes generators fall back to when offline or when GitHub can't be reached.
// Usage: pnpm script:update:git-templates (set GITHUB_TOKEN to avoid the unauthenticated API rate limit)
import fs from 'node:fs/promises';
const sources = [
{
repository: 'github/gitignore',
ref: 'main',
extension: '.gitignore',
output: 'src/tools/gitignore-generator/gitignore-templates.json',
},
{
repository: 'alexkaratarakis/gitattributes',
ref: 'master',
extension: '.gitattributes',
output: 'src/tools/gitattributes-generator/gitattributes-templates.json',
},
];
const CONCURRENCY = 8;
const apiHeaders = {
Accept: 'application/vnd.github+json',
...(process.env.GITHUB_TOKEN ? { Authorization: `Bearer ${process.env.GITHUB_TOKEN}` } : {}),
};
async function fetchOk(url, init) {
const response = await fetch(url, init);
if (!response.ok) {
throw new Error(`${url}: ${response.status} ${response.statusText}`);
}
return response;
}
async function snapshot({ repository, ref, extension, output }) {
const commit = await (
await fetchOk(`https://api.github.com/repos/${repository}/commits/${ref}`, { headers: apiHeaders })
).json();
const tree = await (
await fetchOk(`https://api.github.com/repos/${repository}/git/trees/${commit.sha}?recursive=true`, {
headers: apiHeaders,
})
).json();
if (tree.truncated) {
throw new Error(`${repository}: tree listing is truncated`);
}
// Same name derivation as the tools: the path without its extension, skipping a bare root dotfile
const names = tree.tree
.filter(({ type, path }) => type === 'blob' && path.endsWith(extension))
.map(({ path }) => path.slice(0, -extension.length))
.filter(Boolean)
.sort((a, b) => a.localeCompare(b));
const templates = {};
for (let i = 0; i < names.length; i += CONCURRENCY) {
const batch = names.slice(i, i + CONCURRENCY);
const contents = await Promise.all(
batch.map(async (name) =>
(await fetchOk(`https://raw.githubusercontent.com/${repository}/${commit.sha}/${name}${extension}`)).text(),
),
);
batch.forEach((name, index) => (templates[name] = contents[index]));
}
const data = { repository, ref, commit: commit.sha, date: commit.commit.committer.date, templates };
await fs.writeFile(output, `${JSON.stringify(data, null, 2)}\n`);
const size = (await fs.stat(output)).size;
console.log(`${output}: ${names.length} templates from ${repository}@${commit.sha.slice(0, 7)} (${size} bytes)`);
}
for (const source of sources) {
await snapshot(source);
}
-5
View File
@@ -1,5 +0,0 @@
memory=$(awk '/MemTotal/{print $2}' /proc/meminfo);
memory=$((memory / 1024));
node_options="--max-old-space-size=$((memory - 1024))";
echo "NODE_OPTIONS=$node_options";
export NODE_OPTIONS="$node_options";
+27 -12
View File
@@ -3,6 +3,7 @@ import { RouterView, useRoute } from 'vue-router';
import { NGlobalStyle, NMessageProvider, NNotificationProvider, darkTheme } from 'naive-ui';
import { get } from '@vueuse/core';
import { darkThemeOverrides, lightThemeOverrides } from './themes';
import BaseLayout from './layouts/base.layout.vue';
import { layouts } from './layouts';
import { useStyleStore } from './stores/style.store';
import { useAppTheme } from './ui/theme/themes';
@@ -43,10 +44,7 @@ watchEffect(() => {
locale.value = get(getITToolsSetting('default_locale', locale.value));
syncRef(
locale,
useStorage('locale', locale),
);
syncRef(locale, useStorage('locale', locale));
</script>
<template>
@@ -55,9 +53,13 @@ syncRef(
<NMessageProvider placement="bottom">
<NNotificationProvider placement="bottom-right">
<div class="app-root">
<component :is="layout">
<RouterView />
</component>
<!-- Wraps the switch: inside it, this is to prevent moving between a plain and a tool route
tearing down down the sider and remounted its ~460 menu items. -->
<BaseLayout>
<component :is="layout">
<RouterView />
</component>
</BaseLayout>
</div>
</NNotificationProvider>
</NMessageProvider>
@@ -78,6 +80,8 @@ body {
min-height: 100%;
margin: 0;
padding: 0;
/* The document scrolls vertically (see MenuLayout.vue); never horizontally */
overflow-x: hidden;
-webkit-overflow-scrolling: touch;
}
@@ -85,10 +89,10 @@ body {
box-sizing: border-box;
}
/* No transform/contain here: they would make .app-root the containing block
for position:fixed descendants (the mobile menu), and the old inner-scroll
perf rationale no longer applies now that the document is the scroller. */
.app-root {
contain: layout style paint;
-webkit-transform: translateZ(0);
transform: translateZ(0);
-webkit-overflow-scrolling: touch;
}
@@ -97,13 +101,24 @@ body .vld-container {
left: 0;
top: 0;
width: 100%;
height: 100vh;
background-color: var(--loading-background-color);
z-index: 9999;
text-align: center;
pointer-events: none;
}
/* Fullscreen fallback: overlay mounted on <body> (first navigation) */
body > .vld-container {
height: 100vh;
z-index: 9999;
}
/* Route-change overlay scoped to the page area (see router.ts) */
.page-content > .vld-container {
height: 100%;
min-height: 350px;
z-index: 100;
}
body .vld-container.vl-active {
pointer-events: auto;
}
-1
View File
@@ -1,3 +1,2 @@
export function readFile() {}
export function writeFile() {}
export {};
+168
View File
@@ -0,0 +1,168 @@
import { createReadStream, existsSync, readFileSync, statSync } from 'node:fs';
import { createServer } from 'node:http';
import type { Server } from 'node:http';
import { extname, join, normalize, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { expect, test } from '@playwright/test';
// The app is built once, for no particular path, and told where it lives at request time.
// This exercises that: a server that mounts `dist` under a subfolder the way the container
// does -- rewrite the one `<base href>` in index.html, serve everything else from the same
// files -- and then checks the app actually works from there.
//
// See nginx.conf (the real thing), vite.config.ts (`base` and the baseHref plugin) and
// src/utils/base-url.ts (how the app reads it back).
const BASE_URL = '/it-tools/';
const DIST = resolve(fileURLToPath(new URL('.', import.meta.url)), '../dist');
const CONTENT_TYPES: Record<string, string> = {
'.css': 'text/css',
'.html': 'text/html',
'.ico': 'image/x-icon',
'.js': 'text/javascript',
'.json': 'application/json',
'.md': 'text/markdown',
'.mjs': 'text/javascript',
'.png': 'image/png',
'.svg': 'image/svg+xml',
'.wasm': 'application/wasm',
'.webmanifest': 'application/manifest+json',
};
function resolveInDist(pathname: string): string | undefined {
const candidate = join(DIST, normalize(pathname));
if (!candidate.startsWith(DIST) || !existsSync(candidate) || !statSync(candidate).isFile()) {
return undefined;
}
return candidate;
}
function serveDistUnder(base: string): Promise<{ server: Server; origin: string }> {
// What nginx.conf does with sub_filter, on every HTML response rather than only on the
// SPA fallback: the service worker precaches index.html by fetching it, and it has to
// get the same document a navigation would.
const withBaseHref = (html: string) => html.replace('<base href="/">', `<base href="${base}">`);
const indexHtml = withBaseHref(readFileSync(join(DIST, 'index.html'), 'utf-8'));
const server = createServer((request, response) => {
const { pathname } = new URL(request.url ?? '/', 'http://localhost');
// Everything below the mount point, with the prefix dropped -- the reverse proxy in
// front of a container may or may not have stripped it already, so nginx.conf copes
// with both and so does this.
const path = decodeURIComponent(pathname.startsWith(base) ? pathname.slice(base.length - 1) : pathname);
const asset = path.match(/^\/(?:.*\/)?assets\/(.+)$/);
const file = asset ? resolveInDist(`/assets/${asset[1]}`) : resolveInDist(path);
if (!file) {
// A missing hashed chunk is a 404, not the SPA shell: serving index.html in its
// place turns a plain 404 into an opaque MIME error in the browser.
if (asset) {
response.writeHead(404).end();
return;
}
response.writeHead(200, { 'content-type': 'text/html' }).end(indexHtml);
return;
}
response.writeHead(200, {
'content-type': CONTENT_TYPES[extname(file)] ?? 'application/octet-stream',
// Same headers the container sets; the WebAssembly-backed tools need them.
'cross-origin-opener-policy': 'same-origin',
'cross-origin-embedder-policy': 'require-corp',
});
if (extname(file) === '.html') {
response.end(withBaseHref(readFileSync(file, 'utf-8')));
return;
}
createReadStream(file).pipe(response);
});
return new Promise((done) => {
server.listen(0, '127.0.0.1', () => {
const address = server.address();
const port = typeof address === 'object' && address !== null ? address.port : 0;
done({ server, origin: `http://127.0.0.1:${port}` });
});
});
}
test.describe('Deployment under a subfolder', () => {
let server: Server;
let origin: string;
test.beforeAll(async () => {
({ server, origin } = await serveDistUnder(BASE_URL));
});
test.afterAll(async () => {
await new Promise((done) => server.close(done));
});
test('loads the app, and everything it asks for, from the subfolder', async ({ page }) => {
const notFound: string[] = [];
page.on('response', (response) => {
if (response.status() === 404 && response.url().startsWith(origin)) {
notFound.push(response.url());
}
});
await page.goto(`${origin}${BASE_URL}`);
await expect(page).toHaveTitle(/IT Tools/);
// Router links carry the subfolder, so navigating inside the app stays inside it.
await expect(page.locator(`a[href^="${BASE_URL}"]`).first()).toBeVisible();
expect(notFound).toEqual([]);
});
test('serves a deep link, whose assets are one directory further down', async ({ page }) => {
// The interesting case for a relative build: index.html is served for a path that is
// not the app root, so `./assets/...` would resolve one level too deep without the
// `<base href>` the server injected.
await page.goto(`${origin}${BASE_URL}json-to-yaml-converter`);
await expect(page).toHaveTitle('JSON to YAML converter - IT Tools');
// Reaching the tool at all means its lazily imported chunk was resolved correctly.
await page.getByTestId('input').fill('{"foo":"bar"}');
expect((await page.getByTestId('area-content').innerText()).trim()).toEqual('foo: bar');
});
test('keeps the subfolder when navigating and reloading', async ({ page }) => {
await page.goto(`${origin}${BASE_URL}`);
const homeTitle = await page.title();
await page.locator('a.it-tool-link').first().click();
// The router was handed the runtime base, so an in-app navigation writes a URL that
// still points inside the subfolder -- and reloading it lands back on the same tool
// instead of on the app root or a 404.
await expect(page).not.toHaveURL(`${origin}${BASE_URL}`);
expect(page.url().startsWith(`${origin}${BASE_URL}`)).toBe(true);
await expect(page).not.toHaveTitle(homeTitle);
const url = page.url();
const title = await page.title();
// Then load that URL from scratch, the way someone pasting the link would: it has to
// come back as the same tool rather than as the app root or a 404. In a second tab
// rather than by reloading this one -- navigating a page that has just pulled in a
// tool's chunks races with those requests, and the app answers an aborted chunk load
// by reloading itself (the vite:preloadError handler in src/main.ts), which cancels
// the navigation the test is waiting on.
const fresh = await page.context().newPage();
await fresh.goto(url);
await expect(fresh).toHaveURL(url);
await expect(fresh).toHaveTitle(title);
await fresh.close();
});
});
+135
View File
@@ -0,0 +1,135 @@
<script setup lang="ts">
import { useThemeVars } from 'naive-ui';
import { formatSignalNumber } from '@/utils/analog-signal';
const props = withDefaults(
defineProps<{
min: number;
max: number;
value: number;
unit?: string;
status?: 'ok' | 'warning' | 'error';
}>(),
{
unit: '',
status: 'ok',
},
);
const themeVars = useThemeVars();
const isValid = computed(() => Number.isFinite(props.min) && Number.isFinite(props.max) && props.min !== props.max);
// Position in the range, in percent; may go outside of 0-100 when the value is out of range.
const percent = computed(() =>
isValid.value && Number.isFinite(props.value)
? ((props.value - props.min) / (props.max - props.min)) * 100
: Number.NaN,
);
const clampedPercent = computed(() => (Number.isFinite(percent.value) ? Math.min(100, Math.max(0, percent.value)) : 0));
const isOutOfRange = computed(() => percent.value < 0 || percent.value > 100);
const fillColor = computed(
() =>
({
ok: themeVars.value.primaryColor,
warning: themeVars.value.warningColor,
error: themeVars.value.errorColor,
})[props.status],
);
const withUnit = (value: number) => `${formatSignalNumber(value)}${props.unit ? ` ${props.unit}` : ''}`;
const middle = computed(() => (props.min + props.max) / 2);
</script>
<template>
<div class="analog-gauge" :class="{ 'out-of-range': isOutOfRange }" data-test-id="gauge">
<div class="scale">
<span>{{ withUnit(max) }}</span>
<span>{{ withUnit(middle) }}</span>
<span>{{ withUnit(min) }}</span>
</div>
<div class="tube" role="meter" :aria-valuemin="min" :aria-valuemax="max" :aria-valuenow="value">
<div class="fill" :style="{ height: `${clampedPercent}%`, backgroundColor: fillColor }" />
<div class="tick" style="bottom: 25%" />
<div class="tick" style="bottom: 50%" />
<div class="tick" style="bottom: 75%" />
</div>
<div class="marker-track">
<div v-if="Number.isFinite(percent)" class="marker" :style="{ bottom: `${clampedPercent}%`, color: fillColor }">
◄ {{ formatSignalNumber(percent, 1) }} %
</div>
</div>
</div>
</template>
<style scoped lang="less">
.analog-gauge {
display: flex;
align-items: stretch;
justify-content: center;
gap: 8px;
height: 200px;
margin: 16px 0;
.scale {
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: flex-end;
font-size: 12px;
opacity: 0.7;
white-space: nowrap;
// Labels sit on the top, middle and bottom lines of the tube
margin: -8px 0;
}
.tube {
position: relative;
width: 28px;
border-radius: 6px;
overflow: hidden;
background-color: v-bind('themeVars.buttonColor2');
border: 1px solid v-bind('themeVars.borderColor');
.fill {
position: absolute;
bottom: 0;
left: 0;
right: 0;
transition:
height 0.25s ease-out,
background-color 0.25s;
}
.tick {
position: absolute;
left: 0;
width: 8px;
height: 1px;
background-color: v-bind('themeVars.textColor3');
}
}
.marker-track {
position: relative;
width: 72px;
.marker {
position: absolute;
left: 0;
transform: translateY(50%);
font-size: 12px;
font-weight: 600;
white-space: nowrap;
transition: bottom 0.25s ease-out;
}
}
&.out-of-range .tube {
border-color: v-bind('fillColor');
}
}
</style>
+468
View File
@@ -0,0 +1,468 @@
<script setup lang="ts">
import { useStorage } from '@vueuse/core';
import { useThemeVars } from 'naive-ui';
import { useI18n } from 'vue-i18n';
import AnalogGauge from './AnalogGauge.vue';
import { useCopy } from '@/composable/copy';
import {
type SignalRange,
formatSignalNumber,
getCurrentLoopStatus,
getLinearTransform,
getSignalRangeStatus,
scaleValue,
} from '@/utils/analog-signal';
export interface SignalPreset {
label: string;
min: number;
max: number;
}
type Direction = 'signal-to-value' | 'value-to-signal';
type Side = 'signal' | 'engineering';
interface SideStatus {
type: 'ok' | 'warning' | 'error';
message: string;
}
const props = withDefaults(
defineProps<{
storageKey: string;
signalLabel: string;
signalUnit?: string;
presets: SignalPreset[];
defaultEngineering?: SignalRange & { unit: string };
// The signal is an integer register (raw PLC value): also show the rounded value.
integerSignal?: boolean;
// Apply the NAMUR NE 43 diagnostic when the signal range is 4-20 mA.
currentLoopDiagnostic?: boolean;
}>(),
{
signalUnit: '',
defaultEngineering: () => ({ min: 0, max: 100, unit: '%' }),
integerSignal: false,
currentLoopDiagnostic: false,
},
);
const { t, locale } = useI18n();
const themeVars = useThemeVars();
const defaultPreset = props.presets[0] ?? { label: '', min: 0, max: 10 };
const signalMin = useStorage<number | null>(`${props.storageKey}:signal-min`, defaultPreset.min);
const signalMax = useStorage<number | null>(`${props.storageKey}:signal-max`, defaultPreset.max);
const engineeringMin = useStorage<number | null>(`${props.storageKey}:engineering-min`, props.defaultEngineering.min);
const engineeringMax = useStorage<number | null>(`${props.storageKey}:engineering-max`, props.defaultEngineering.max);
const engineeringUnit = useStorage(`${props.storageKey}:engineering-unit`, props.defaultEngineering.unit);
const direction = useStorage<Direction>(`${props.storageKey}:direction`, 'signal-to-value');
const toNumber = (value: number | null | undefined) => (typeof value === 'number' ? value : Number.NaN);
const signalRange = computed<SignalRange>(() => ({ min: toNumber(signalMin.value), max: toNumber(signalMax.value) }));
const engineeringRange = computed<SignalRange>(() => ({
min: toNumber(engineeringMin.value),
max: toNumber(engineeringMax.value),
}));
const rangeOf = (side: Side) => (side === 'signal' ? signalRange.value : engineeringRange.value);
const unitOf = (side: Side) => (side === 'signal' ? props.signalUnit : engineeringUnit.value);
const labelOf = (side: Side) =>
side === 'signal' ? props.signalLabel : t('analogSignalConverter.texts.label-engineering-value');
const inputSide = computed<Side>(() => (direction.value === 'signal-to-value' ? 'signal' : 'engineering'));
const outputSide = computed<Side>(() => (direction.value === 'signal-to-value' ? 'engineering' : 'signal'));
const midpoint = ({ min, max }: SignalRange) => (min + max) / 2;
const inputValue = ref<number | null>(midpoint(rangeOf(inputSide.value)));
// Min must be strictly lower than max: an inverted range is almost always a typo.
const isRangeValid = (range: SignalRange) =>
Number.isFinite(range.min) && Number.isFinite(range.max) && range.min < range.max;
const isSignalRangeInvalid = computed(() => !isRangeValid(signalRange.value));
const isEngineeringRangeInvalid = computed(() => !isRangeValid(engineeringRange.value));
const rangesError = computed(() => {
if (!isRangeValid(signalRange.value)) {
return t('analogSignalConverter.texts.error-signal-range');
}
if (!isRangeValid(engineeringRange.value)) {
return t('analogSignalConverter.texts.error-engineering-range');
}
return '';
});
const outputValue = computed(() => {
const value = toNumber(inputValue.value);
if (rangesError.value || !Number.isFinite(value)) {
return Number.NaN;
}
return scaleValue({ value, from: rangeOf(inputSide.value), to: rangeOf(outputSide.value) });
});
const valueOf = (side: Side) => (side === inputSide.value ? toNumber(inputValue.value) : outputValue.value);
// Swapping keeps the current operating point: the output becomes the new input.
function swapDirection() {
const previousOutput = outputValue.value;
direction.value = direction.value === 'signal-to-value' ? 'value-to-signal' : 'signal-to-value';
inputValue.value = Number.isFinite(previousOutput)
? Number(formatSignalNumber(previousOutput))
: midpoint(rangeOf(inputSide.value));
}
const CUSTOM_PRESET = 'custom';
const presetOptions = computed(() => [
...props.presets.map(({ label }, index) => ({ label, value: String(index) })),
{ label: t('analogSignalConverter.texts.preset-custom'), value: CUSTOM_PRESET },
]);
const selectedPreset = computed({
get() {
const index = props.presets.findIndex(({ min, max }) => min === signalMin.value && max === signalMax.value);
return index === -1 ? CUSTOM_PRESET : String(index);
},
set(value: string) {
const preset = props.presets[Number(value)];
if (preset) {
signalMin.value = preset.min;
signalMax.value = preset.max;
}
},
});
const isCurrentLoop = computed(
() => props.currentLoopDiagnostic && signalRange.value.min === 4 && signalRange.value.max === 20,
);
function getSignalStatus(value: number): SideStatus {
if (isCurrentLoop.value) {
const status = getCurrentLoopStatus(value);
if (status === 'ok') {
return { type: 'ok', message: t('analogSignalConverter.texts.status-ok') };
}
return {
type: status.startsWith('failure') ? 'error' : 'warning',
message: t(`analogSignalConverter.texts.loop-status-${status}`),
};
}
const status = getSignalRangeStatus({ value, range: signalRange.value });
if (status === 'ok') {
return { type: 'ok', message: t('analogSignalConverter.texts.status-ok') };
}
// A live zero (e.g. 2-10 V) lets a value under the minimum reveal a broken wire.
const hasLiveZero = Math.min(signalRange.value.min, signalRange.value.max) > 0;
return {
type: 'warning',
message:
status === 'below-range' && hasLiveZero
? t('analogSignalConverter.texts.status-below-live-zero')
: t(`analogSignalConverter.texts.status-${status}`),
};
}
function getEngineeringStatus(value: number): SideStatus {
const status = getSignalRangeStatus({ value, range: engineeringRange.value });
return status === 'ok'
? { type: 'ok', message: t('analogSignalConverter.texts.status-ok') }
: { type: 'warning', message: t(`analogSignalConverter.texts.engineering-${status}`) };
}
function statusOf(side: Side): SideStatus | null {
const value = valueOf(side);
if (rangesError.value || !Number.isFinite(value)) {
return null;
}
return side === 'signal' ? getSignalStatus(value) : getEngineeringStatus(value);
}
const inputStatus = computed(() => statusOf(inputSide.value));
const outputStatus = computed(() => statusOf(outputSide.value));
const formatWithUnit = (value: number, unit: string) =>
Number.isFinite(value) ? `${formatSignalNumber(value)}${unit ? ` ${unit}` : ''}` : '';
const withUnit = (label: string, unit: string) => (unit ? `${label} (${unit})` : label);
const outputText = computed(() => formatWithUnit(outputValue.value, unitOf(outputSide.value)));
const roundedOutputText = computed(() =>
props.integerSignal && outputSide.value === 'signal' && Number.isFinite(outputValue.value)
? formatWithUnit(Math.round(outputValue.value), props.signalUnit)
: '',
);
const { copy: copyOutput } = useCopy({ source: () => formatSignalNumber(outputValue.value) });
// Significant digits rather than decimals: Siemens gains such as 100 / 27648 are tiny.
const formatCoefficient = (value: number) => String(Number(value.toPrecision(10)));
const formula = computed(() => {
if (rangesError.value) {
return '';
}
const { gain, offset } = getLinearTransform({ from: rangeOf(inputSide.value), to: rangeOf(outputSide.value) });
const names = {
signal: t('analogSignalConverter.texts.formula-signal'),
engineering: t('analogSignalConverter.texts.formula-value'),
};
const product = `${names[outputSide.value]} = ${formatCoefficient(gain)} × ${names[inputSide.value]}`;
return formatCoefficient(offset) === '0'
? product
: `${product} ${offset < 0 ? '-' : '+'} ${formatCoefficient(Math.abs(offset))}`;
});
const referencePoints = computed(() => {
if (rangesError.value) {
return [];
}
return [0, 25, 50, 75, 100].map((percent) => {
const signal = scaleValue({ value: percent, from: { min: 0, max: 100 }, to: signalRange.value });
const value = scaleValue({ value: percent, from: { min: 0, max: 100 }, to: engineeringRange.value });
return {
percent: `${percent} %`,
signal: formatWithUnit(props.integerSignal ? Math.round(signal) : signal, props.signalUnit),
value: formatWithUnit(value, engineeringUnit.value),
};
});
});
</script>
<template>
<div flex flex-col gap-3>
<div class="converter-columns">
<!-- Input -->
<c-card class="column" :title="t('analogSignalConverter.texts.title-input')">
<div class="side-label">
{{ withUnit(labelOf(inputSide), unitOf(inputSide)) }}
</div>
<n-input-number-i18n v-model:value="inputValue" size="large" data-test-id="converter-input" />
<AnalogGauge
v-if="!rangesError"
:min="rangeOf(inputSide).min"
:max="rangeOf(inputSide).max"
:value="valueOf(inputSide)"
:unit="unitOf(inputSide)"
:status="inputStatus?.type"
data-test-id="input-gauge"
/>
<div v-if="inputStatus" class="status" :class="inputStatus.type" data-test-id="input-status">
<icon-mdi-check-circle v-if="inputStatus.type === 'ok'" />
<icon-mdi-alert v-else />
<span>{{ inputStatus.message }}</span>
</div>
</c-card>
<!-- Parameters -->
<c-card class="column" :title="t('analogSignalConverter.texts.title-parameters')">
<!-- c-select keeps the label it was mounted with: remount it when the language changes -->
<c-select
:key="locale"
v-model:value="selectedPreset"
:options="presetOptions"
:label="t('analogSignalConverter.texts.label-signal-type')"
data-test-id="signal-preset"
/>
<div class="side-label" mt-3>
{{ withUnit(`${signalLabel} min / max`, signalUnit) }}
</div>
<div flex gap-2>
<n-input-number-i18n
v-model:value="signalMin"
:status="isSignalRangeInvalid ? 'error' : undefined"
flex-1
:show-button="false"
data-test-id="signal-min"
/>
<n-input-number-i18n
v-model:value="signalMax"
:status="isSignalRangeInvalid ? 'error' : undefined"
flex-1
:show-button="false"
data-test-id="signal-max"
/>
</div>
<div class="swap" my-4>
<c-button
round
:title="t('analogSignalConverter.texts.swap-direction')"
data-test-id="swap-direction"
@click="swapDirection"
>
<icon-mdi-swap-horizontal text-20px />
<span ml-2>{{ t('analogSignalConverter.texts.swap-direction') }}</span>
</c-button>
</div>
<div class="side-label">
{{ t('analogSignalConverter.texts.label-engineering-range') }}
</div>
<div flex gap-2>
<n-input-number-i18n
v-model:value="engineeringMin"
:status="isEngineeringRangeInvalid ? 'error' : undefined"
flex-1
:show-button="false"
data-test-id="engineering-min"
/>
<n-input-number-i18n
v-model:value="engineeringMax"
:status="isEngineeringRangeInvalid ? 'error' : undefined"
flex-1
:show-button="false"
data-test-id="engineering-max"
/>
</div>
<c-input-text
v-model:value="engineeringUnit"
:label="t('analogSignalConverter.texts.label-engineering-unit')"
:placeholder="t('analogSignalConverter.texts.placeholder-unit')"
mt-3
data-test-id="engineering-unit"
/>
<c-alert v-if="rangesError" type="error" mt-3>
{{ rangesError }}
</c-alert>
<input-copyable
v-else
:label="t('analogSignalConverter.texts.label-formula')"
:value="formula"
mt-3
data-test-id="formula"
/>
</c-card>
<!-- Output -->
<c-card class="column" :title="t('analogSignalConverter.texts.title-output')">
<div class="side-label">
{{ withUnit(labelOf(outputSide), unitOf(outputSide)) }}
</div>
<div class="output-value">
<span data-test-id="converter-output">{{ outputText || '—' }}</span>
<c-button
v-if="outputText"
variant="text"
circle
:title="t('analogSignalConverter.texts.copy-output')"
@click="copyOutput()"
>
<icon-mdi-content-copy />
</c-button>
</div>
<div v-if="roundedOutputText" class="rounded-output" data-test-id="converter-output-rounded">
{{ t('analogSignalConverter.texts.label-rounded-signal') }} : {{ roundedOutputText }}
</div>
<AnalogGauge
v-if="!rangesError"
:min="rangeOf(outputSide).min"
:max="rangeOf(outputSide).max"
:value="outputValue"
:unit="unitOf(outputSide)"
:status="outputStatus?.type"
data-test-id="output-gauge"
/>
<div v-if="outputStatus" class="status" :class="outputStatus.type" data-test-id="output-status">
<icon-mdi-check-circle v-if="outputStatus.type === 'ok'" />
<icon-mdi-alert v-else />
<span>{{ outputStatus.message }}</span>
</div>
</c-card>
</div>
<c-card v-if="!rangesError" :title="t('analogSignalConverter.texts.title-reference-points')">
<n-table size="small" data-test-id="reference-points">
<thead>
<tr>
<th>{{ t('analogSignalConverter.texts.column-percent') }}</th>
<th>{{ signalLabel }}</th>
<th>{{ t('analogSignalConverter.texts.label-engineering-value') }}</th>
</tr>
</thead>
<tbody>
<tr v-for="point of referencePoints" :key="point.percent">
<td>{{ point.percent }}</td>
<td>{{ point.signal }}</td>
<td>{{ point.value }}</td>
</tr>
</tbody>
</n-table>
</c-card>
</div>
</template>
<style scoped lang="less">
.converter-columns {
display: grid;
grid-template-columns: 1fr 1.2fr 1fr;
gap: 12px;
align-items: stretch;
// Narrow screens: input, parameters and output stacked
@media (max-width: 900px) {
grid-template-columns: 1fr;
}
.column {
min-width: 0;
}
}
.side-label {
font-size: 13px;
opacity: 0.75;
margin-bottom: 6px;
}
.swap {
display: flex;
justify-content: center;
}
.output-value {
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
min-height: 40px;
font-size: 28px;
font-weight: 600;
word-break: break-all;
}
.rounded-output {
text-align: center;
font-size: 13px;
opacity: 0.75;
}
.status {
display: flex;
align-items: flex-start;
gap: 6px;
font-size: 13px;
line-height: 1.4;
svg {
flex-shrink: 0;
margin-top: 2px;
}
&.ok {
color: v-bind('themeVars.successColor');
}
&.warning {
color: v-bind('themeVars.warningColor');
}
&.error {
color: v-bind('themeVars.errorColor');
}
}
</style>
+305
View File
@@ -0,0 +1,305 @@
<script setup lang="ts">
import Copy from '~icons/tabler/copy';
import { Base64 } from 'js-base64';
import { useCopy } from '@/composable/copy';
import { useDownloadFileFromBase64 } from '@/composable/downloadBase64';
import { translate as t } from '@/plugins/i18n.plugin';
import { EditorView, basicSetup } from 'codemirror';
import { Compartment, EditorState } from '@codemirror/state';
import { javascript } from '@codemirror/lang-javascript';
import { html } from '@codemirror/lang-html';
import { xml } from '@codemirror/lang-xml';
import { json } from '@codemirror/lang-json';
import { css } from '@codemirror/lang-css';
import { markdown } from '@codemirror/lang-markdown';
import { sql } from '@codemirror/lang-sql';
import { yaml } from '@codemirror/lang-yaml';
import { go } from '@codemirror/lang-go';
import { python } from '@codemirror/lang-python';
import { php } from '@codemirror/lang-php';
import { cpp } from '@codemirror/lang-cpp';
import { oneDark } from '@codemirror/theme-one-dark';
import { keymap, lineNumbers } from '@codemirror/view';
import { foldGutter, foldKeymap } from '@codemirror/language';
import { useStyleStore } from '@/stores/style.store';
const props = withDefaults(
defineProps<{
value: string;
language?: string;
copyPlacement?: 'top-right' | 'bottom-right' | 'outside' | 'none';
copyMessage?: string;
downloadFileName?: string;
downloadButtonText?: string;
maxHeight?: string;
showLineNumbers?: boolean;
showFoldGutter?: boolean;
}>(),
{
language: 'txt',
copyPlacement: 'top-right',
copyMessage: t('textareaCopyable.copy'),
downloadFileName: '',
downloadButtonText: t('textareaCopyable.download'),
maxHeight: '400px',
},
);
const {
value,
maxHeight,
language,
showLineNumbers,
showFoldGutter,
copyPlacement,
copyMessage,
downloadFileName,
downloadButtonText,
} = toRefs(props);
const styleStore = useStyleStore();
const isDarkTheme = computed(() => styleStore.isDarkTheme);
const editorRoot = ref<HTMLElement | null>(null);
let view: EditorView | null = null;
// Compartments for dynamic reconfiguration
const themeCompartment = new Compartment();
const languageCompartment = new Compartment();
const maxHeightStyle = computed(() =>
maxHeight.value ? (typeof maxHeight.value === 'number' ? `${maxHeight.value}px` : maxHeight.value) : '400px',
);
// ---------------------------
// LANGUAGE REGISTRY
// ---------------------------
function resolveLanguage(lang: string) {
const l = lang.toLowerCase();
switch (l) {
case 'sql':
return sql();
case 'json':
return json();
case 'html':
return html();
case 'xml':
return xml();
case 'yaml':
return yaml();
case 'ts':
case 'typescript':
return javascript({ typescript: true });
case 'markdown':
case 'md':
return markdown();
case 'css':
return css();
case 'javascript':
case 'js':
return javascript();
case 'go':
return go();
case 'csharp':
case 'cs':
return cpp(); // closest CM6 grammar
case 'python':
case 'py':
return python();
case 'php':
return php();
default:
return []; // plain text fallback
}
}
function themeExtension() {
return isDarkTheme.value ? oneDark : [];
}
// ---------------------------
// EDITOR INITIALIZATION
// ---------------------------
function createExtensions() {
return [
basicSetup,
EditorView.editable.of(false),
EditorState.readOnly.of(true),
EditorView.lineWrapping,
keymap.of(foldKeymap),
themeCompartment.of(themeExtension()),
languageCompartment.of(resolveLanguage(language.value ?? 'plain')),
(showLineNumbers.value ?? true) ? lineNumbers() : [],
(showFoldGutter.value ?? true) ? foldGutter({ openText: '▾', closedText: '▸' }) : [],
];
}
function initEditor() {
if (!editorRoot.value) {
return;
}
view = new EditorView({
doc: value.value,
extensions: createExtensions(),
parent: editorRoot.value,
});
}
function destroyEditor() {
if (view) {
view.destroy();
view = null;
}
}
onMounted(() => {
initEditor();
});
onBeforeUnmount(destroyEditor);
watch(isDarkTheme, () => {
if (view) {
view.dispatch({
effects: themeCompartment.reconfigure(themeExtension()),
});
}
});
watch(
() => props.language,
() => {
if (view) {
view.dispatch({
effects: languageCompartment.reconfigure(resolveLanguage(props.language ?? 'plain')),
});
}
},
);
watch(
() => props.value,
(newVal) => {
if (!view) {
return;
}
const current = view.state.doc.toString();
if (newVal !== current) {
view.dispatch({
changes: {
from: 0,
to: view.state.doc.length,
insert: newVal,
},
});
}
},
);
const { copy, isJustCopied } = useCopy({ source: value, createToast: false });
const tooltipText = computed(() => (isJustCopied.value ? t('textareaCopyable.copied') : copyMessage.value));
const valueBase64 = computed(() => Base64.encode(value.value));
const { download } = useDownloadFileFromBase64({
source: valueBase64,
filename: downloadFileName,
});
</script>
<template>
<div style="overflow-x: hidden; width: 100%">
<c-card
relative
:style="
copyPlacement === 'top-right'
? 'padding-top: 50px'
: copyPlacement === 'bottom-right'
? 'padding-bottom: 50px'
: ''
"
>
<div
v-if="value && copyPlacement !== 'none'"
absolute
right-10px
:class="copyPlacement === 'top-right' ? 'top-10px' : copyPlacement === 'bottom-right' ? 'bottom-10px' : ''"
style="z-index: 10; background: var(--bg-color); border-radius: 50%; padding: 2px"
>
<c-tooltip v-if="value && copyPlacement !== 'outside'" :tooltip="tooltipText" position="left">
<c-button circle important:h-10 important:w-10 @click="copy()">
<n-icon size="22" :component="Copy" />
</c-button>
</c-tooltip>
</div>
<div class="code-block">
<div class="code-block__editor-wrapper" :style="{ maxHeight: maxHeightStyle }">
<div ref="editorRoot" class="code-block__editor" />
</div>
</div>
</c-card>
<div v-if="copyPlacement === 'outside'" mt-4 flex justify-center>
<c-button @click="copy()">
{{ tooltipText }}
</c-button>
</div>
<div v-if="downloadFileName !== '' && value !== ''" mt-5 flex justify-center>
<c-button secondary @click="download">
{{ downloadButtonText }}
</c-button>
</div>
</div>
</template>
<style scoped>
.code-block {
border-radius: 6px;
overflow: hidden;
border: 1px solid #2d2d2d;
font-size: 13px;
}
.code-block__toolbar {
display: flex;
justify-content: flex-end;
padding: 4px 8px;
background: #111;
border-bottom: 1px solid #2d2d2d;
}
.code-block__copy {
cursor: pointer;
border: none;
background: #2d2d2d;
color: #f5f5f5;
padding: 2px 8px;
border-radius: 4px;
font-size: 12px;
}
.code-block__editor-wrapper {
overflow: auto;
}
.code-block__editor .cm-editor {
height: auto;
min-height: 100%;
}
</style>
+83 -39
View File
@@ -21,8 +21,8 @@ const collapsedCategories = useStorage<Record<string, boolean>>(
{
deep: true,
serializer: {
read: v => (v ? JSON.parse(v) : null),
write: v => JSON.stringify(v),
read: (v) => (v ? JSON.parse(v) : null),
write: (v) => JSON.stringify(v),
},
},
);
@@ -47,14 +47,23 @@ watchEffect(() => {
const isToggling = ref(false);
const menuContainerRefs = ref<Record<string, HTMLElement>>({});
// Every category starts coMount a category's items when it first opens, then keep themllapsed, so mounting all ~460 items up front built a
// menu nobody can see. Mount a category's items when it first opens, then keep them.
const openedCategories = ref<Record<string, boolean>>({});
watchEffect(() => {
toolsByCategory.value.forEach(({ name }) => {
if (collapsedCategories.value[name] === false) {
openedCategories.value[name] = true;
}
});
});
function toggleCategoryCollapse({ name }: { name: string }) {
collapsedCategories.value[name] = !collapsedCategories.value[name];
}
const areAllCollapsed = computed(() => {
return toolsByCategory.value.every(({ name }) =>
collapsedCategories.value[name] !== false,
);
return toolsByCategory.value.every(({ name }) => collapsedCategories.value[name] !== false);
});
async function toggleAllCategories() {
@@ -82,21 +91,22 @@ function getAnimationDuration(itemCount: number): number {
const baseDuration = 250;
const durationIncrement = 5;
return baseDuration + (Math.min(itemCount, 30) * durationIncrement);
return baseDuration + Math.min(itemCount, 30) * durationIncrement;
}
// Function to check if any tool in the category is active
function isCategoryActive(components: Tool[]): boolean {
return components.some(tool => tool.path === route.path);
return components.some((tool) => tool.path === route.path);
}
// Depends on the tool list only: holding the collapsed/active flags in here rebuilt
// every category's `tools` array, re-rendering all ~460 items on each navigation.
const menuOptions = computed(() =>
toolsByCategory.value.map(({ name, components }) => ({
name,
isCollapsed: collapsedCategories.value[name],
isActive: isCategoryActive(components),
components,
animationDuration: getAnimationDuration(components.length),
tools: components.map(tool => ({
tools: components.map((tool) => ({
label: makeLabel(tool),
icon: makeIcon(tool),
key: tool.path,
@@ -105,16 +115,14 @@ const menuOptions = computed(() =>
);
async function scrollToActiveItem() {
const activeCategory = toolsByCategory.value.find(({ components }) =>
isCategoryActive(components),
);
const activeCategory = toolsByCategory.value.find(({ components }) => isCategoryActive(components));
if (activeCategory) {
// Expand the active category
collapsedCategories.value[activeCategory.name] = false;
// Wait for the entire animation to complete
await new Promise(resolve => setTimeout(resolve, getAnimationDuration(activeCategory.components.length) + 50));
await new Promise((resolve) => setTimeout(resolve, getAnimationDuration(activeCategory.components.length) + 50));
// Scroll to the active menu item
const menuContainer = menuContainerRefs.value[activeCategory.name];
@@ -131,33 +139,52 @@ onMounted(() => {
scrollToActiveItem();
});
watch(() => route.path, () => {
scrollToActiveItem();
});
watch(
() => route.path,
() => {
scrollToActiveItem();
},
);
const themeVars = useThemeVars();
</script>
<template>
<div class="top-controls" mb-12px ml-12px>
<c-button :disabled="isToggling" @click="toggleAllCategories">
<!-- Full width: the label changes between expand/collapse, and a
hug-content button would jump in width on every toggle -->
<div class="top-controls" mb-12px mx-12px>
<c-button w-full :disabled="isToggling" @click="toggleAllCategories">
<span v-if="isToggling">
{{ areAllCollapsed ? $t('collapsibleToolMenu.text.expanding') : $t('collapsibleToolMenu.text.collapsing') }}
</span>
<span v-else>
{{ areAllCollapsed ? $t('collapsibleToolMenu.text.expand-all-tools') : $t('collapsibleToolMenu.text.collapse-all-tools') }}
{{
areAllCollapsed
? $t('collapsibleToolMenu.text.expand-all-tools')
: $t('collapsibleToolMenu.text.collapse-all-tools')
}}
</span>
</c-button>
</div>
<div v-for="{ name, tools, isCollapsed, isActive, animationDuration } of menuOptions" :key="name" class="category-container">
<div v-for="{ name, components, tools, animationDuration } of menuOptions" :key="name" class="category-container">
<button
class="category-button"
:class="{ 'category-active': isActive }"
flex cursor-pointer items-center op-60
:class="{ 'category-active': isCategoryActive(components) }"
flex
cursor-pointer
items-center
op-60
@click="toggleCategoryCollapse({ name })"
>
<span :class="{ 'rotate-0': isCollapsed, 'rotate-90': !isCollapsed }" text-16px lh-1 op-50 transition-transform duration-200>
<span
:class="{ 'rotate-0': collapsedCategories[name], 'rotate-90': !collapsedCategories[name] }"
text-16px
lh-1
op-50
transition-transform
duration-200
>
<icon-mdi-chevron-right />
</span>
@@ -167,22 +194,26 @@ const themeVars = useThemeVars();
</button>
<div
:ref="el => { if (el) menuContainerRefs[name] = el as HTMLElement }"
:ref="
(el) => {
if (el) menuContainerRefs[name] = el as HTMLElement;
}
"
class="menu-container"
:class="{ collapsed: isCollapsed }"
:class="{ collapsed: collapsedCategories[name] }"
:style="{ '--animation-duration': `${animationDuration}ms` }"
>
<div class="menu-wrapper">
<div class="toggle-bar" @click="toggleCategoryCollapse({ name })" />
<n-menu
v-if="openedCategories[name]"
class="menu"
:value="route.path"
:collapsed-width="64"
:collapsed-icon-size="22"
:options="tools"
:indent="8"
:default-expand-all="true"
/>
</div>
</div>
@@ -199,9 +230,12 @@ const themeVars = useThemeVars();
text-align: left;
user-select: none;
&:hover {
background-color: v-bind('themeVars.buttonColor2Hover');
opacity: 0.8;
// Hover only on hover-capable devices; on touch it sticks after tapping
@media (hover: hover) {
&:hover {
background-color: v-bind('themeVars.buttonColor2Hover');
opacity: 0.8;
}
}
&.category-active {
@@ -209,17 +243,25 @@ const themeVars = useThemeVars();
opacity: 1;
color: white;
&:hover {
background-color: color-mix(in srgb, v-bind('themeVars.primaryColorHover') 50%, transparent);
@media (hover: hover) {
&:hover {
background-color: color-mix(in srgb, v-bind('themeVars.primaryColorHover') 50%, transparent);
}
}
}
}
.category-container {
.menu-container {
display: grid;
grid-template-rows: 1fr;
transition: grid-template-rows var(--animation-duration, 250ms) ease-out;
will-change: grid-template-rows;
// Offscreen categories skip layout and paint entirely, which keeps the sider
// width transition and expand/collapse animations from re-laying-out all ~460
// menu items on every frame.
content-visibility: auto;
contain-intrinsic-size: auto 36px;
.menu-container {
display: grid;
grid-template-rows: 1fr;
transition: grid-template-rows var(--animation-duration, 250ms) ease-out;
will-change: grid-template-rows;
&.collapsed {
grid-template-rows: 0fr;
@@ -259,8 +301,10 @@ const themeVars = useThemeVars();
left: 14px;
}
&:hover {
opacity: 0.5;
@media (hover: hover) {
&:hover {
opacity: 0.5;
}
}
}
}
+4 -2
View File
@@ -48,8 +48,10 @@ const { icon, title } = toRefs(props);
font-weight: bold;
transition: color ease 0.2s;
&:hover {
color: rgb(20, 20, 20);
@media (hover: hover) {
&:hover {
color: rgb(20, 20, 20);
}
}
}
}
+1 -1
View File
@@ -24,7 +24,7 @@ function toggleFavorite(event: MouseEvent) {
</script>
<template>
<c-tooltip :tooltip="isFavorite ? $t('favoriteButton.remove') : $t('favoriteButton.add') ">
<c-tooltip :tooltip="isFavorite ? $t('favoriteButton.remove') : $t('favoriteButton.add')">
<c-button
variant="text"
circle
+53 -32
View File
@@ -1,5 +1,5 @@
<script setup lang="ts">
import _ from 'lodash';
import * as _ from 'es-toolkit/compat';
import { Base64 } from 'js-base64';
import type { UseValidationRule } from '@/composable/validation';
import CInputText from '@/ui/c-input-text/c-input-text.vue';
@@ -9,19 +9,19 @@ import { useAppTheme } from '@/ui/theme/themes';
const props = withDefaults(
defineProps<{
transformer?: (v: string) => string
inputValidationRules?: UseValidationRule<string>[]
inputLabel?: string
inputPlaceholder?: string
inputDefault?: string
outputLabel?: string
outputLanguage?: string
downloadFileName?: string
downloadButtonText?: string
rows?: number
inputLineNumbers?: boolean
inputMaxRows?: number
inputAutosize?: boolean
transformer?: (v: string) => string;
inputValidationRules?: UseValidationRule<string>[];
inputLabel?: string;
inputPlaceholder?: string;
inputDefault?: string;
outputLabel?: string;
outputLanguage?: string;
downloadFileName?: string;
downloadButtonText?: string;
rows?: number;
inputLineNumbers?: boolean;
inputMaxRows?: number;
inputAutosize?: boolean;
}>(),
{
transformer: _.identity,
@@ -41,8 +41,19 @@ const props = withDefaults(
);
const {
transformer, inputValidationRules, inputLabel, outputLabel, outputLanguage,
inputPlaceholder, inputDefault, downloadFileName, downloadButtonText, rows, inputLineNumbers, inputMaxRows, inputAutosize,
transformer,
inputValidationRules,
inputLabel,
outputLabel,
outputLanguage,
inputPlaceholder,
inputDefault,
downloadFileName,
downloadButtonText,
rows,
inputLineNumbers,
inputMaxRows,
inputAutosize,
} = toRefs(props);
const appTheme = useAppTheme();
@@ -140,12 +151,13 @@ watch(
watch(
input,
() => nextTick(() => {
const textarea = textareaElement.value;
if (textarea) {
lineNumbersOffset.value = textarea.scrollTop;
}
}),
() =>
nextTick(() => {
const textarea = textareaElement.value;
if (textarea) {
lineNumbersOffset.value = textarea.scrollTop;
}
}),
{ flush: 'post' },
);
@@ -154,11 +166,10 @@ function focusInput() {
}
const outputBase64 = computed(() => Base64.encode(output.value));
const { download } = useDownloadFileFromBase64(
{
source: outputBase64,
filename: downloadFileName,
});
const { download } = useDownloadFileFromBase64({
source: outputBase64,
filename: downloadFileName,
});
</script>
<template>
@@ -191,16 +202,26 @@ const { download } = useDownloadFileFromBase64(
aria-hidden="true"
@click="focusInput"
>
<pre class="line-numbers__content" :style="{ transform: `translateY(-${lineNumbersOffset}px)` }">{{ lineNumbersText }}</pre>
<pre class="line-numbers__content" :style="{ transform: `translateY(-${lineNumbersOffset}px)` }">{{
lineNumbersText
}}</pre>
</div>
</template>
</CInputText>
<div overflow-auto>
<div mb-5px>
{{ outputLabel }}
</div>
<textarea-copyable :value="output" :language="outputLanguage" :follow-height-of="inputElement?.inputWrapperRef" />
<n-tabs type="line">
<n-tab-pane name="output" :tab="outputLabel">
<textarea-copyable
:value="output"
:language="outputLanguage"
:follow-height-of="inputElement?.inputWrapperRef"
/>
</n-tab-pane>
<n-tab-pane name="editable" :tab="t('formatTransformer.viewer')">
<CodeBlockCopyable :value="output" :language="outputLanguage" />
</n-tab-pane>
</n-tabs>
<div v-if="downloadFileName !== '' && output !== ''" mt-5 flex justify-center>
<c-button secondary @click="download">
+14 -14
View File
@@ -4,27 +4,27 @@ import { useCopy } from '@/composable/copy';
import { translate as t } from '@/plugins/i18n.plugin';
const props = defineProps<{
value: string
multiline?: boolean
rows?: number | string
autosize?: boolean
readonly?: boolean
value?: string | number | boolean | null;
multiline?: boolean;
rows?: number | string;
autosize?: boolean;
readonly?: boolean;
}>();
const emit = defineEmits(['update:value']);
const value = useVModel(props, 'value', emit);
const rawValue = useVModel(props, 'value', emit);
const value = computed({
get: () => String(rawValue.value ?? ''),
set: (newValue: string) => {
rawValue.value = newValue;
},
});
const { copy, isJustCopied } = useCopy({ source: value, createToast: false });
const tooltipText = computed(() => isJustCopied.value ? t('inputCopyable.copied') : t('inputCopyable.copy'));
const tooltipText = computed(() => (isJustCopied.value ? t('inputCopyable.copied') : t('inputCopyable.copy')));
</script>
<template>
<c-input-text
v-model:value="value"
:multiline="multiline"
:rows="rows"
:autosize="autosize"
:readonly="readonly"
>
<c-input-text v-model:value="value" :multiline="multiline" :rows="rows" :autosize="autosize" :readonly="readonly">
<template #suffix>
<c-tooltip :tooltip="tooltipText">
<c-button circle variant="text" size="small" @click="copy()">
+10 -27
View File
@@ -4,32 +4,24 @@ import { nextTick, onMounted, onUnmounted, ref } from 'vue';
import type { Tool } from '@/tools/tools.types';
defineProps<{
tool: Tool
tool: Tool;
}>();
const textRef = ref<HTMLElement>();
const showTooltip = ref(false);
let resizeTimeout: ReturnType<typeof setTimeout> | null = null;
// Must settle before the pointer arrives: n-tooltip reads `disabled` on enter,
// so deciding on hover would leave the first hover with a stale value.
async function checkTruncation() {
await nextTick();
if (textRef.value) {
const text = textRef.value.textContent || '';
const computedStyle = window.getComputedStyle(textRef.value);
// Create canvas context for precise text measurement
const canvas = document.createElement('canvas');
const context = canvas.getContext('2d')!;
context.font = `${computedStyle.fontWeight} ${computedStyle.fontSize} ${computedStyle.fontFamily}`;
const el = textRef.value;
const textWidth = context.measureText(text).width;
// Calculate precise container width by accounting for padding
const containerWidth = textRef.value.clientWidth
- Number.parseFloat(computedStyle.paddingLeft)
- Number.parseFloat(computedStyle.paddingRight);
showTooltip.value = textWidth > containerWidth;
if (el) {
// .menu-text is one nowrap ellipsised line, so overflow is exactly the condition.
// Replaces a canvas measureText() that cost a <canvas> + getComputedStyle per item.
showTooltip.value = el.scrollWidth > el.clientWidth;
}
}
@@ -55,19 +47,10 @@ onUnmounted(() => {
</script>
<template>
<n-tooltip
placement="right"
:delay="500"
:show-arrow="true"
:disabled="!showTooltip"
>
<n-tooltip placement="right" :delay="500" :show-arrow="true" :disabled="!showTooltip">
<template #trigger>
<RouterLink :to="tool.path" class="menu-link">
<span
ref="textRef"
class="menu-text"
@mouseenter="checkTruncation"
>
<span ref="textRef" class="menu-text" @mouseenter="checkTruncation">
{{ tool.name }}
</span>
</RouterLink>
+119 -18
View File
@@ -1,6 +1,8 @@
<script setup lang="ts">
import { useThemeVars } from 'naive-ui';
import { useStyleStore } from '@/stores/style.store';
const themeVars = useThemeVars();
const styleStore = useStyleStore();
const { isMenuCollapsed, isSmallScreen } = toRefs(styleStore);
const siderPosition = computed(() => (isSmallScreen.value ? 'absolute' : 'static'));
@@ -23,16 +25,44 @@ onUnmounted(() => {
window.removeEventListener('resize', updateWindowWidth);
});
// Calculate the actual width to ensure minimum width is respected
const siderWidth = computed(() => {
if (isMenuCollapsed.value) {
return 0;
}
// Use 12.5% of window width, but ensure it's at least 240px
const siderContentWidth = computed(() => Math.max(240, windowWidth.value * 0.125));
// Use 12.5% of window width, but ensure it's at least 240px
const tenPercent = windowWidth.value * 0.125;
return Math.max(240, tenPercent);
// Small screens: the menu is a full-width panel below the top bar that fades
// in/out (see styles below) instead of naive-ui's width-collapse, which
// re-lays-out the page on every animation frame.
const siderWidth = computed(() => {
if (isSmallScreen.value) {
return windowWidth.value;
}
return isMenuCollapsed.value ? 0 : siderContentWidth.value;
});
const siderCollapsed = computed(() => (isSmallScreen.value ? false : isMenuCollapsed.value));
const isDrawerOpen = computed(() => isSmallScreen.value && !isMenuCollapsed.value);
// Native-drawer touch: lock the page scroll while the drawer is open
watchEffect(() => {
document.body.style.overflow = isDrawerOpen.value ? 'hidden' : '';
});
// Close the menu when navigating (tool links, the about button, ...) so the
// destination page is visible.
const route = useRoute();
watch(
() => route.path,
() => {
if (isSmallScreen.value) {
isMenuCollapsed.value = true;
}
},
);
onUnmounted(() => {
document.body.style.overflow = '';
});
// The scroll container is pinned to the expanded width so the sider width
// transition clips the menu instead of re-wrapping every item on each frame.
const siderContentWidthPx = computed(() => `${siderContentWidth.value}px`);
</script>
<template>
@@ -42,39 +72,110 @@ const siderWidth = computed(() => {
collapse-mode="width"
:collapsed-width="0"
:width="siderWidth"
:collapsed="isMenuCollapsed"
:collapsed="siderCollapsed"
:show-trigger="false"
:native-scrollbar="false"
:position="siderPosition"
:class="{ 'drawer-open': isDrawerOpen }"
>
<slot name="sider" />
</n-layout-sider>
<n-layout class="content">
<slot name="content" />
<div v-show="isSmallScreen && !isMenuCollapsed" class="overlay" @click="isMenuCollapsed = true" />
</n-layout>
</n-layout>
</template>
<style lang="less" scoped>
.overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #00000080;
cursor: pointer;
.n-layout-sider {
// With :native-scrollbar="false" the sider content lives in an n-scrollbar.
::v-deep(.n-scrollbar-content) {
width: v-bind(siderContentWidthPx);
}
}
.content {
// background-color: #f1f5f9;
// Flex items default to min-width: auto, so a child wider than the viewport
// (e.g. a long, non-wrapping line in a code viewer) stretches this whole
// column past the screen instead of letting the child's own scroll container
// (n-scrollbar / CodeMirror) scroll horizontally. min-width: 0 lets the
// column shrink to the available width so that inner scrolling kicks in.
min-width: 0;
::v-deep(.n-layout-scroll-container) {
padding: 26px;
// Same breakpoint as styleStore.isSmallScreen
@media (max-width: 700px) {
padding: 13px;
}
}
}
// The document is the app's scroller: layouts grow with their content instead
// of scrolling in a nested container. A single scrollbar, and native behaviors
// (iOS tap-status-bar-to-scroll-to-top, toolbar collapsing) just work.
.n-layout {
height: auto;
min-height: 100vh;
min-height: 100dvh;
overflow: visible;
::v-deep(> .n-layout-scroll-container) {
height: auto;
min-height: 100vh;
min-height: 100dvh;
overflow: visible;
}
}
// The sider keeps its own internal menu scrollbar, pinned to the viewport
// while the document scrolls.
.n-layout-sider {
position: sticky;
top: 0;
align-self: flex-start;
height: 100vh;
height: 100dvh;
// Small screens: full-width panel fixed below the always-visible top bar
// (height exposed by base.layout.vue), fading in/out quickly. Seamless with
// the page: same background as the app, no side border.
&.n-layout-sider--absolute-positioned {
position: fixed;
top: var(--app-topbar-height, 56px);
bottom: auto;
height: calc(100dvh - var(--app-topbar-height, 56px));
z-index: 15;
background-color: v-bind('themeVars.bodyColor');
opacity: 0;
visibility: hidden;
transition:
opacity 0.2s ease,
visibility 0s 0.2s;
&.drawer-open {
opacity: 1;
visibility: visible;
transition: opacity 0.2s ease;
}
// Full-width menu content instead of the pinned desktop width
::v-deep(.n-scrollbar-content) {
width: 100%;
}
// The menu's own scroll shouldn't chain to the page behind it
::v-deep(.n-scrollbar-container) {
overscroll-behavior: contain;
}
// No side border on a full-width panel
::v-deep(.n-layout-sider__border) {
display: none;
}
}
}
</style>
+53
View File
@@ -0,0 +1,53 @@
import { expect, test } from '@playwright/test';
for (const viewport of [
{ width: 320, height: 568 },
{ width: 667, height: 375 },
{ width: 1280, height: 720 },
]) {
test.describe(`Language menu at ${viewport.width}x${viewport.height}`, () => {
test.use({ viewport });
test('scrolls to the last language without scrolling the page or dismissing the menu', async ({ page }) => {
await page.goto('/');
if (viewport.width <= 700) {
await page.getByRole('button', { name: 'Toggle menu', exact: true }).click();
}
await page.getByRole('button', { name: 'Language', exact: true }).click();
const menu = page.locator('.n-dropdown-menu');
await expect(menu).toBeVisible();
await menu.evaluate(async (element) => {
await Promise.all(element.getAnimations().map((animation) => animation.finished));
});
const bounds = await menu.boundingBox();
expect(bounds).not.toBeNull();
expect(bounds!.y).toBeGreaterThanOrEqual(0);
expect(bounds!.y + bounds!.height).toBeLessThanOrEqual(viewport.height);
const pageScroll = await page.evaluate(() => window.scrollY);
// Move directly: locator.hover() may scroll the page to align a teleported menu.
await page.mouse.move(bounds!.x + bounds!.width / 2, bounds!.y + bounds!.height / 2);
const lastLanguage = menu.getByText('繁體中文', { exact: true });
await expect(async () => {
await page.mouse.wheel(0, 300);
await expect(lastLanguage).toBeInViewport({ ratio: 1, timeout: 500 });
}).toPass({ timeout: 10_000 });
await expect(menu).toBeVisible();
expect(await page.evaluate(() => window.scrollY)).toBe(pageScroll);
// A second gesture at the boundary must not chain to the page either.
await page.mouse.wheel(0, 500);
await page.evaluate(
() => new Promise<void>((resolve) => requestAnimationFrame(() => requestAnimationFrame(() => resolve()))),
);
await expect(menu).toBeVisible();
expect(await page.evaluate(() => window.scrollY)).toBe(pageScroll);
await lastLanguage.click();
await expect(menu).not.toBeVisible();
await expect(page.getByRole('button', { name: '語言', exact: true })).toBeVisible();
});
});
}
+139 -8
View File
@@ -1,9 +1,114 @@
<script setup lang="ts">
import { IconBrandGithub, IconInfoCircle, IconMoon, IconSun } from '@tabler/icons-vue';
import type { Component } from 'vue';
import { NIcon, useThemeVars } from 'naive-ui';
import IconBrandGithub from '~icons/tabler/brand-github';
import IconCheck from '~icons/tabler/check';
import IconDeviceDesktop from '~icons/tabler/device-desktop';
import IconInfoCircle from '~icons/tabler/info-circle';
import IconLanguage from '~icons/tabler/language';
import IconMoon from '~icons/tabler/moon';
import IconSun from '~icons/tabler/sun';
import { appLocales } from '@/plugins/i18n.plugin';
import { useStyleStore } from '@/stores/style.store';
const styleStore = useStyleStore();
const { isDarkTheme } = toRefs(styleStore);
const { isDarkTheme, themeMode } = toRefs(styleStore);
const themeVars = useThemeVars();
const { locale, t } = useI18n();
const localesLong: Record<string, string> = {
en: 'English',
de: 'Deutsch',
da: 'Dansk',
es: 'Español',
fr: 'Français',
ga: 'Gaeilge',
it: 'Italiano',
nl: 'Nederlands',
no: 'Norwegian',
pl: 'Polski',
pt: 'Português',
ru: 'Русский',
tr: 'Türkçe',
el: 'ελληνικά',
uk: 'Українська',
ko: '한국인',
zh: '中文',
'zh-TW': '繁體中文',
vi: 'Tiếng Việt',
ar: 'عربي',
hi: 'हिन्दी',
};
function renderIcon(icon: Component) {
return () => h(NIcon, null, { default: () => h(icon) });
}
function optionLabel(text: string, isActive: boolean) {
return () => h('span', { style: isActive ? { color: themeVars.value.primaryColor } : {} }, text);
}
const languageOptions = computed(() =>
appLocales.map((availableLocale) => ({
key: availableLocale,
label: optionLabel(localesLong[availableLocale] ?? availableLocale, availableLocale === locale.value),
icon: availableLocale === locale.value ? renderIcon(IconCheck) : undefined,
})),
);
function onLanguageSelect(key: string) {
locale.value = key;
}
// Keep wheel gestures inside the menu even in engines without overscroll-behavior.
function containLanguageMenuScroll(event: WheelEvent) {
if (event.ctrlKey) {
return;
}
const scroller = (event.currentTarget as HTMLElement).querySelector('.n-scrollbar-container');
if (!scroller) {
return;
}
if (
(event.deltaY < 0 && scroller.scrollTop <= 0) ||
(event.deltaY > 0 && scroller.scrollTop + scroller.clientHeight >= scroller.scrollHeight - 1)
) {
event.preventDefault();
}
}
const themeOptions = computed(() => [
{
key: 'auto',
label: optionLabel(t('home.nav.themeSystem', 'System'), themeMode.value === 'auto'),
icon: renderIcon(IconDeviceDesktop),
},
{
key: 'light',
label: optionLabel(t('home.nav.themeLight', 'Light'), themeMode.value === 'light'),
icon: renderIcon(IconSun),
},
{
key: 'dark',
label: optionLabel(t('home.nav.themeDark', 'Dark'), themeMode.value === 'dark'),
icon: renderIcon(IconMoon),
},
]);
const themeTriggerIcon = computed(() => (isDarkTheme.value ? IconMoon : IconSun));
function onThemeSelect(key: 'auto' | 'light' | 'dark') {
styleStore.themeMode = key;
}
// The mobile menu closes on navigation (MenuLayout watches the route), but
// clicking About while already on /about doesn't navigate — close explicitly.
function closeMenuOnSmallScreen() {
if (styleStore.isSmallScreen) {
styleStore.isMenuCollapsed = true;
}
}
</script>
<template>
@@ -21,18 +126,44 @@ const { isDarkTheme } = toRefs(styleStore);
</c-tooltip>
<c-tooltip :tooltip="$t('home.nav.about')" position="bottom">
<c-button circle variant="text" to="/about" :aria-label="$t('home.nav.aboutLabel')">
<c-button circle variant="text" to="/about" :aria-label="$t('home.nav.aboutLabel')" @click="closeMenuOnSmallScreen">
<n-icon size="25" :component="IconInfoCircle" />
</c-button>
</c-tooltip>
<c-tooltip :tooltip="isDarkTheme ? $t('home.nav.lightMode') : $t('home.nav.darkMode')" position="bottom">
<c-button circle variant="text" :aria-label="$t('home.nav.mode')" @click="() => styleStore.toggleDark()">
<n-icon v-if="isDarkTheme" size="25" :component="IconSun" />
<n-icon v-else size="25" :component="IconMoon" />
<n-dropdown :options="themeOptions" trigger="click" @select="onThemeSelect">
<c-button circle variant="text" :aria-label="t('home.nav.mode')">
<n-icon size="25" :component="themeTriggerIcon" />
</c-button>
</c-tooltip>
</n-dropdown>
<n-dropdown
class="language-dropdown"
:options="languageOptions"
trigger="click"
scrollable
@select="onLanguageSelect"
@wheel="containLanguageMenuScroll"
>
<c-button circle variant="text" :aria-label="t('home.nav.language', 'Language')">
<n-icon size="25" :component="IconLanguage" />
</c-button>
</n-dropdown>
</template>
<style lang="less">
// The menu is teleported outside this component. Keep it within the viewport,
// with room for its trigger whether the popover opens above or below it.
.language-dropdown {
max-height: min(400px, calc(50vh - 24px));
max-height: min(400px, calc(50dvh - 24px));
.n-scrollbar-container {
overscroll-behavior-y: contain;
}
}
</style>
<style lang="less" scoped>
.n-button {
&:not(:last-child) {
+1 -1
View File
@@ -8,7 +8,7 @@ const { value } = toRefs(props);
const initialText = t('spanCopyable.copy');
const { copy, isJustCopied } = useCopy({ source: value, createToast: false });
const tooltipText = computed(() => isJustCopied.value ? t('spanCopyable.copied') : initialText);
const tooltipText = computed(() => (isJustCopied.value ? t('spanCopyable.copied') : initialText));
</script>
<template>
+39 -28
View File
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { Copy } from '@vicons/tabler';
import Copy from '~icons/tabler/copy';
import { useElementSize } from '@vueuse/core';
import hljs from 'highlight.js/lib/core';
import jsonHljs from 'highlight.js/lib/languages/json';
@@ -24,16 +24,16 @@ import { translate as t } from '@/plugins/i18n.plugin';
const props = withDefaults(
defineProps<{
value: string
followHeightOf?: HTMLElement | null
language?: string
copyPlacement?: 'top-right' | 'bottom-right' | 'outside' | 'none'
copyMessage?: string
wordWrap?: boolean
downloadFileName?: string
downloadButtonText?: string
scrollable?: boolean
maxHeight?: string
value: string;
followHeightOf?: HTMLElement | null;
language?: string;
copyPlacement?: 'top-right' | 'bottom-right' | 'outside' | 'none';
copyMessage?: string;
wordWrap?: boolean;
downloadFileName?: string;
downloadButtonText?: string;
scrollable?: boolean;
maxHeight?: string;
}>(),
{
followHeightOf: null,
@@ -65,36 +65,46 @@ hljs.registerLanguage('python', pythonHljs);
hljs.registerLanguage('php', phpHljs);
hljs.registerLanguage('protobuf', protobufHljs);
const { value, language, followHeightOf, copyPlacement, copyMessage, downloadFileName, downloadButtonText } = toRefs(props);
const { value, language, followHeightOf, copyPlacement, copyMessage, downloadFileName, downloadButtonText } =
toRefs(props);
const { height } = followHeightOf.value ? useElementSize(followHeightOf) : { height: ref(null) };
const scrollbarRef = ref();
// Watch for content changes and scroll to bottom
watch(value, () => {
nextTick(() => {
if (scrollbarRef.value) {
scrollbarRef.value.scrollTo({ top: scrollbarRef.value.scrollbarInstRef.containerRef.scrollHeight });
}
});
}, { flush: 'post' });
watch(
value,
() => {
nextTick(() => {
if (scrollbarRef.value) {
scrollbarRef.value.scrollTo({ top: scrollbarRef.value.scrollbarInstRef.containerRef.scrollHeight });
}
});
},
{ flush: 'post' },
);
const { copy, isJustCopied } = useCopy({ source: value, createToast: false });
const tooltipText = computed(() => isJustCopied.value ? t('textareaCopyable.copied') : copyMessage.value);
const tooltipText = computed(() => (isJustCopied.value ? t('textareaCopyable.copied') : copyMessage.value));
const valueBase64 = computed(() => Base64.encode(value.value));
const { download } = useDownloadFileFromBase64(
{
source: valueBase64,
filename: downloadFileName,
});
const { download } = useDownloadFileFromBase64({
source: valueBase64,
filename: downloadFileName,
});
</script>
<template>
<div style="overflow-x: hidden; width: 100%">
<c-card
relative
:style="copyPlacement === 'top-right' ? 'padding-top: 50px' : (copyPlacement === 'bottom-right' ? 'padding-bottom: 50px' : '')"
:style="
copyPlacement === 'top-right'
? 'padding-top: 50px'
: copyPlacement === 'bottom-right'
? 'padding-bottom: 50px'
: ''
"
>
<n-scrollbar
ref="scrollbarRef"
@@ -112,8 +122,9 @@ const { download } = useDownloadFileFromBase64(
</n-scrollbar>
<div
v-if="value && copyPlacement !== 'none'"
absolute right-10px
:class="copyPlacement === 'top-right' ? 'top-10px' : (copyPlacement === 'bottom-right' ? 'bottom-10px' : '')"
absolute
right-10px
:class="copyPlacement === 'top-right' ? 'top-10px' : copyPlacement === 'bottom-right' ? 'bottom-10px' : ''"
:style="scrollable ? 'z-index: 10; background: var(--bg-color); border-radius: 50%; padding: 2px;' : ''"
>
<c-tooltip v-if="value && copyPlacement !== 'outside'" :tooltip="tooltipText" position="left">
+3 -6
View File
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { World } from '@vicons/tabler';
import World from '~icons/tabler/world';
import { useThemeVars } from 'naive-ui';
import FavoriteButton from './FavoriteButton.vue';
import type { Tool } from '@/tools/tools.types';
@@ -32,10 +32,7 @@ const theme = useThemeVars();
<div class="truncat my-5px text-lg text-black dark:text-white">
{{ tool.name }}
<World
v-if="tool.externAccessDescription"
class="tool-privacy-icon"
/>
<World v-if="tool.externAccessDescription" class="tool-privacy-icon" />
</div>
<div class="line-clamp-2 text-neutral-500 dark:text-neutral-400">
@@ -48,6 +45,6 @@ const theme = useThemeVars();
<style lang="css" scoped>
.tool-privacy-icon {
display: inline-block;
height: .9em;
height: 0.9em;
}
</style>
+53 -52
View File
@@ -1,19 +1,21 @@
<script setup lang="ts">
import _ from 'lodash';
import convert, { type Unit } from 'convert';
import * as unitsconverter from 'units-converter';
const props = withDefaults(defineProps<{
supportedUnits: { [key: string]: string }
defaultUnit: string
labelWidth?: string
unitMinWidth?: string
converterType: 'convert' | 'frequency' | 'volumeFlowRate' | 'speed' | 'acceleration'
}>(), {
labelWidth: '150px',
unitMinWidth: '50px',
converterType: 'convert',
});
const props = withDefaults(
defineProps<{
supportedUnits: { [key: string]: { value: string; label: string } };
defaultUnit: string;
labelWidth?: string;
unitMinWidth?: string;
converterType?: 'convert' | 'frequency' | 'volumeFlowRate' | 'speed' | 'acceleration';
}>(),
{
labelWidth: '150px',
unitMinWidth: '50px',
converterType: 'convert',
},
);
const { supportedUnits, defaultUnit, labelWidth, unitMinWidth, converterType } = toRefs(props);
const SI_PREFIX_NAMES = [
@@ -45,19 +47,22 @@ const SI_PREFIX_NAMES = [
const SI_PREFIX_NAMES_REGEX = new RegExp(`^(${SI_PREFIX_NAMES.join('|')})`);
const units = reactive<
Record<
string,
{ title: string; unit: string; ref: number }
>
>(Object.entries(supportedUnits.value).map(([key, label]) => ({
title: label,
unit: key,
ref: 1,
})).reduce((prev, current) => ({
const units = reactive<Record<string, { local_title: string; eng_title: string; unit: string; ref: number }>>(
Object.entries(supportedUnits.value)
.map(([key, { label, value }]) => ({
eng_title: value,
local_title: label,
unit: key,
ref: 1,
}))
.reduce(
(prev, current) => ({
...prev,
[current.unit]: current,
}), {}));
}),
{},
),
);
const excludeSIPrefixes = ref(true);
const filteredUnits = computed(() => {
@@ -65,9 +70,7 @@ const filteredUnits = computed(() => {
return Object.entries(units);
}
return Object.entries(units).filter(
([_, { title }]) => !SI_PREFIX_NAMES_REGEX.test(title),
);
return Object.entries(units).filter(([_, { eng_title }]) => !SI_PREFIX_NAMES_REGEX.test(eng_title));
});
function update(key: string) {
@@ -79,32 +82,34 @@ function update(key: string) {
if (converterType.value === 'convert') {
const converter = convert(value, key as Unit);
_.chain(units)
.omit(key)
.forEach(({ unit }) => {
Object.entries(units)
.filter(([unitKey]) => unitKey !== key)
.forEach(([, { unit }]) => {
try {
units[unit].ref = converter.to(unit as Unit);
}
catch (e: any) {
} catch (e: any) {
units[unit].ref = 0;
}
})
.value();
}
else {
const converter = unitsconverter[converterType.value](value).from(key);
});
} else {
const mapUnit = (unit: string) => {
// npm units-converter uses wrong symbol for miles per hour, so we need to fix it
if (converterType.value === 'speed' && unit === 'mi/h') {
return 'm/h';
}
return unit;
};
const converter = unitsconverter[converterType.value](value).from(mapUnit(key));
_.chain(units)
.omit(key)
.forEach(({ unit }) => {
Object.entries(units)
.filter(([unitKey]) => unitKey !== mapUnit(key))
.forEach(([, { unit }]) => {
try {
units[unit].ref = converter.to(unit).value;
}
catch (e: any) {
units[unit].ref = converter.to(mapUnit(unit)).value;
} catch (e: any) {
units[unit].ref = 0;
}
})
.value();
});
}
}
@@ -121,16 +126,12 @@ update(defaultUnit.value);
{{ $t('tools.UnitsConverter.text.si-converter') }}
</c-link>
</n-space>
<n-input-group v-for="[key, { title, unit }] in filteredUnits" :key="key" mb-3 w-full>
<n-input-group-label :style="{ width: labelWidth }">
{{ title }}
<n-input-group v-for="[key, { local_title, unit }] in filteredUnits" :key="key" mb-3 w-full>
<n-input-group-label :style="{ minWidth: labelWidth }">
{{ local_title }}
</n-input-group-label>
<n-input-number
v-model:value="units[key].ref"
style="flex: 1"
@update:value="() => update(key)"
/>
<n-input-number v-model:value="units[key].ref" style="flex: 1" @update:value="() => update(key)" />
<n-input-group-label :style="{ minWidth: unitMinWidth }">
{{ unit }}
+20 -10
View File
@@ -2,8 +2,14 @@ import { type Ref, ref, watchEffect } from 'vue';
export { computedCatch, computedCatchAsync };
function computedCatch<T, D>(getter: () => T, { defaultValue }: { defaultValue: D; defaultErrorMessage?: string }): [Ref<T | D>, Ref<string | undefined>];
function computedCatch<T, D>(getter: () => T, { defaultValue, defaultErrorMessage = 'Unknown error' }: { defaultValue?: D; defaultErrorMessage?: string } = {}) {
function computedCatch<T, D>(
getter: () => T,
{ defaultValue }: { defaultValue: D; defaultErrorMessage?: string },
): [Ref<T | D>, Ref<string | undefined>];
function computedCatch<T, D>(
getter: () => T,
{ defaultValue, defaultErrorMessage = 'Unknown error' }: { defaultValue?: D; defaultErrorMessage?: string } = {},
) {
const error = ref<string | undefined>();
const value = ref<T | D | undefined>();
@@ -11,9 +17,8 @@ function computedCatch<T, D>(getter: () => T, { defaultValue, defaultErrorMessag
try {
error.value = undefined;
value.value = getter();
}
catch (err) {
error.value = err instanceof Error ? err.message : err?.toString() ?? defaultErrorMessage;
} catch (err) {
error.value = err instanceof Error ? err.message : (err?.toString() ?? defaultErrorMessage);
value.value = defaultValue;
}
});
@@ -21,8 +26,14 @@ function computedCatch<T, D>(getter: () => T, { defaultValue, defaultErrorMessag
return [value, error] as const;
}
function computedCatchAsync<T, D>(getterAsync: () => Promise<T>, { defaultValue }: { defaultValue: D; defaultErrorMessage?: string }): [Ref<T | D>, Ref<string | undefined>];
function computedCatchAsync<T, D>(getterAsync: () => Promise<T>, { defaultValue, defaultErrorMessage = 'Unknown error' }: { defaultValue?: D; defaultErrorMessage?: string } = {}) {
function computedCatchAsync<T, D>(
getterAsync: () => Promise<T>,
{ defaultValue }: { defaultValue: D; defaultErrorMessage?: string },
): [Ref<T | D>, Ref<string | undefined>];
function computedCatchAsync<T, D>(
getterAsync: () => Promise<T>,
{ defaultValue, defaultErrorMessage = 'Unknown error' }: { defaultValue?: D; defaultErrorMessage?: string } = {},
) {
const error = ref<string | undefined>();
const value = ref<T | D | undefined>();
@@ -30,9 +41,8 @@ function computedCatchAsync<T, D>(getterAsync: () => Promise<T>, { defaultValue,
try {
error.value = undefined;
value.value = await getterAsync();
}
catch (err) {
error.value = err instanceof Error ? err.message : err?.toString() ?? defaultErrorMessage;
} catch (err) {
error.value = err instanceof Error ? err.message : (err?.toString() ?? defaultErrorMessage);
value.value = defaultValue;
}
});
+1 -2
View File
@@ -11,8 +11,7 @@ function computedRefreshable<T>(getter: () => T, { throttle }: { throttle?: numb
if (throttle) {
watchThrottled(getter, update, { throttle });
}
else {
} else {
watch(getter, update);
}
+33 -20
View File
@@ -4,7 +4,11 @@ import { useMessage } from 'naive-ui';
import type { MaybeRefOrGetter } from 'vue';
import { translate as t } from '@/plugins/i18n.plugin';
export function useCopy({ source, text = t('tools.copy.text.copied-to-the-clipboard'), createToast = true }: { source?: MaybeRefOrGetter<string>; text?: string; createToast?: boolean } = {}) {
export function useCopy({
source,
text = t('tools.copy.text.copied-to-the-clipboard'),
createToast = true,
}: { source?: MaybeRefOrGetter<string>; text?: string; createToast?: boolean } = {}) {
const { copy, copied, ...rest } = useClipboard({
source,
legacy: true,
@@ -18,8 +22,7 @@ export function useCopy({ source, text = t('tools.copy.text.copied-to-the-clipbo
async copy(content?: string, { notificationMessage }: { notificationMessage?: string } = {}) {
if (source) {
await copy();
}
else {
} else {
await copy(content);
}
@@ -30,7 +33,11 @@ export function useCopy({ source, text = t('tools.copy.text.copied-to-the-clipbo
};
}
export function useCopyClipboardItems({ source, text = t('tools.copy.text.copied-to-the-clipboard'), createToast = true }: { source?: MaybeRefOrGetter<Array<{ mime: string; content: string }>>; text?: string; createToast?: boolean } = {}) {
export function useCopyClipboardItems({
source,
text = t('tools.copy.text.copied-to-the-clipboard'),
createToast = true,
}: { source?: MaybeRefOrGetter<Array<{ mime: string; content: string }>>; text?: string; createToast?: boolean } = {}) {
function toClipboardItem(item: { mime: string; content: string }) {
return new ClipboardItem({
[item.mime]: new Blob([item.content], { type: item.mime }),
@@ -46,11 +53,13 @@ export function useCopyClipboardItems({ source, text = t('tools.copy.text.copied
return {
...rest,
isJustCopied: copied,
async copy(content?: { mime: string; content: string }[], { notificationMessage }: { notificationMessage?: string } = {}) {
async copy(
content?: { mime: string; content: string }[],
{ notificationMessage }: { notificationMessage?: string } = {},
) {
if (source) {
await copy();
}
else {
} else {
await copy((content || []).map(toClipboardItem));
}
@@ -61,7 +70,17 @@ export function useCopyClipboardItems({ source, text = t('tools.copy.text.copied
};
}
export function useCopyHtml({ sourceHtml, fallbackText, toastText = t('tools.copy.text.copied-to-the-clipboard'), createToast = true }: { sourceHtml?: MaybeRefOrGetter<string>; fallbackText?: MaybeRefOrGetter<string>; toastText?: string; createToast?: boolean } = {}) {
export function useCopyHtml({
sourceHtml,
fallbackText,
toastText = t('tools.copy.text.copied-to-the-clipboard'),
createToast = true,
}: {
sourceHtml?: MaybeRefOrGetter<string>;
fallbackText?: MaybeRefOrGetter<string>;
toastText?: string;
createToast?: boolean;
} = {}) {
const message = useMessage();
const copied = ref(false);
@@ -81,8 +100,7 @@ export function useCopyHtml({ sourceHtml, fallbackText, toastText = t('tools.cop
try {
document.execCommand('copy');
}
finally {
} finally {
document.body.removeChild(textarea);
}
}
@@ -100,19 +118,16 @@ export function useCopyHtml({ sourceHtml, fallbackText, toastText = t('tools.cop
const blobText = new Blob([fallbackText || html], { type: 'text/plain' });
const item = new ClipboardItemCtor({ 'text/plain': blobText, 'text/html': blobHtml });
await navigator.clipboard.write([item]);
}
else if (navigator.clipboard?.writeText) {
} else if (navigator.clipboard?.writeText) {
// Async text fallback
await navigator.clipboard.writeText(fallbackText || html);
}
else {
} else {
// Legacy execCommand fallback
legacyCopy(fallbackText || html);
}
copied.value = true;
}
catch (e: any) {
} catch (e: any) {
error.value = e.toString();
}
}
@@ -122,16 +137,14 @@ export function useCopyHtml({ sourceHtml, fallbackText, toastText = t('tools.cop
async copy(html?: string, text?: string, { notificationMessage }: { notificationMessage?: string } = {}) {
if (sourceHtml) {
await copyHtml(toValue(sourceHtml), toValue(fallbackText));
}
else if (html) {
} else if (html) {
await copyHtml(html, text);
}
if (createToast) {
if (error.value) {
message.error(error.value);
}
else {
} else {
message.success(notificationMessage ?? toastText);
}
}
Loaded 100 of 1620 files, more files were not shown because too many files have changed in this diff. Show more