Repository navigation
feat: v1.1.0 - harden library, add CLI, types, and 8 new styles - #8
Conversation
Library: - Smart tokenizer for code styles (camelCase, _, -, ., / boundaries) - Real slug (diacritics folded, ASCII only); kebab keeps Unicode - Unicode-aware title, sentence, alternate; grapheme-safe reverse/flip - Conventional ASCII leet map, case preserved - Empty string returns '' instead of false - strict option throws TypeError/RangeError - capstringAll() and CATEGORIES exports - New styles: smallcaps, bubble, wide, strike, clap, morse, binary, piglatin Tooling: - CLI (cli.js + bin/capstring.js) with --all, --list, --json, stdin - Hand-written index.d.ts with Style union; drift test - files whitelist (drop .npmignore), sideEffects: false, prepublishOnly - 100% coverage thresholds, Node 24 in CI, CLI smoke test Docs: README regrouped with behavior notes, CHANGELOG 1.1.0, CLAUDE.md, AGENTS.md
- web/: static site with live results for every style, click to copy, shareable ?t= URLs, dark mode, no build step (imports index.js directly) - netlify/functions/api.js: single Functions 2.0 handler for /api/* (styles, :style/:text, all, chain, batch) with CORS, caching, limits - netlify.toml: publish web/, copy index.js at build, security headers - Tests for the API handler via Request objects and a browser-safety guard - Docs: README Try it online + HTTP API sections, CLAUDE.md, AGENTS.md
- Trigger CI for pull requests against any branch so stacked PRs get checks - npm audit fix: clears 22 Dependabot alerts in dev-only transitive deps
… in range npm audit fix had bumped vitest to 4.1 / vite 8, which requires Node 20.19+ and broke the Node 18 CI job. Revert that and update only the transitive packages that have fixes within vitest 4.0.18's ranges (18 of 22 alerts). The remaining 4 are in vite 7 / @vitest/mocker and are dev-only; they clear when Node 18 support is dropped.
… polish - Require Node 22.12+; CI matrix 22/24; vitest 5, eslint 10; zero audit findings - API: GET /api/badge/:style/:text (SVG), /api/lorem/:count?style=, /api/spell/:text?style= (nspell + dictionary-en as devDependencies, bundled into the function; the npm package stays zero-dependency) - Site: chain builder (+ on each row, ?chain= in the URL), Open Graph and Twitter meta tags, 404 page, version in footer from /api - 141 tests, 100% coverage on index.js, cli.js, api.js
- web: keep '+' in text intact in shareable URLs (only chain uses literal +)
- cli: flags may follow text ('capstring hello --all' no longer drops the text)
- api/spell: 500-char limit, at most 50 suggestions per request (reported as
'limited'), dedupe case variants, uncache a failed dictionary load, log
unexpected errors before the 500
- api/lorem: count must be plain digits (no hex, exponent, whitespace)
- api/badge: ?label= capped at 100 chars
- api: export RESERVED segments and test they never collide with STYLES
- index: tokenize lazily so non-code styles skip toWords
- vitest: testTimeout was nested under coverage and ignored
- CLAUDE.md: branch settings live in the Netlify UI, not netlify.toml
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: da7e603570
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Tokenizer NFC-normalizes and keeps combining marks (NFD 'Crème' no longer splits into cre-me) - slug goes through the shared tokenizer so camelCase splits (helloWorld -> hello-world, XMLHttpRequest -> xml-http-request) - strike applies the combining mark per grapheme so ZWJ emoji and flags survive - piglatin keeps 'qu' with a preceding consonant cluster (squeal -> ealsquay) - sentence capitalizes after an opening quote or bracket that follows a boundary
- netlify.toml: force the build when CACHED_COMMIT_REF equals COMMIT_REF (first or cache-cleared deploys) instead of skipping it - npm run dev uses npx netlify-cli so it works without a global install - web: percent-encode shell metacharacters in the generated curl line - api/spell: the 50-suggestion budget counts attempts, so unsuggestable words can no longer bypass the CPU bound
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 894f410ccc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b0f54f6acc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… CRLF as whitespace
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d52be1ee04
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9921cd7366
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Drop CHANGELOG.md from the tarball (it lives on GitHub) and add a test that fails if the published file list changes or unpacked size exceeds 50 kB.
…er docs, shared site chrome API (/api): every former route is here: transform, all, chain, batch (texts or inputs), count, lorem, spell, badge, styles. Output format by extension, ?format=, or Accept header; json default; txt, html, xml, yaml, csv, jsonp. Errors render in the requested format. Site: shared header (menu, GitHub/npm icons, light/dark toggle) and footer (icons, copyright) on every page; /docs/ Swagger UI over a hand-written OpenAPI 3.1 spec; /dev/ Docsify developer docs (getting started, library, styles, CLI, TypeScript, HTTP API from code, recipes, behavior, changelog); new caps-arrow icon; format picker and spell check on the playground. Docs: no hardcoded style counts in copy; no personal name on the site.
✅ Deploy Preview for capstring ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…lish - 13 new styles: capitalize, lowerfirst, ada, cobol, initials, spaced, squish, nato, hex, base64, bold, italic, script - Remove chain (API route, UI, tests, spec); spell and count are ordinary playground rows under API extras - Developer Docs rebuilt without Docsify: one page, jump sidebar with filter, per-style entries with live example tables, sticky code panel with Node / TypeScript / CLI / curl / Python tabs - Shared header with light/dark toggle (data-theme set before paint), footer with GitHub/npm/MIT icons and a nameless copyright - Violet/teal palette, caps-arrow icon, equal-width result cards - No style counts in copy; hello world is the example everywhere; README tables generated from the library
…ode samples - GET /api returns the Swagger reference to browsers (Accept: text/html) and JSON service info to everything else - Developer Docs move to /docs with Node / CLI samples inline in each section and each style entry; the floating code panel is gone - Dark theme for Swagger's JSON Schema renderer in the Schemas section
…loper Docs Page text, Swagger's servers list, and the API's docs link all derive from the origin serving the request, so localhost, deploy previews, Netlify, and a future custom domain all show live URLs.
count(str) returns words, characters, charactersNoSpaces, and spaces. The CLI gains --count / -c. The API's /count uses it and adds spaces. The playground groups count under Tools and spell plus badge under API only.
- svg renders the result as an image; png rasterizes it with @resvg/resvg-js and vendored OFL/DejaVu fonts (netlify/fonts) covering the Unicode art styles; fullwidth text is drawn as spaced ASCII - Limits: text 10,000 chars, batch 1,000 texts (spell 500, badge label 100, lorem 1,000 unchanged) - Developer Docs sidebar lists each style once; CLI section opens with npx and global-install quick start; count added to CLI samples
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 807f71cd89
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Image formats cut output at 200 characters so a wide canvas cannot exhaust the function (binary/hex over /all would reach megapixels) - JSONP callback must be a dotted JavaScript identifier, not just safe characters - package.json exports ./cli.js, which the docs show importing - sentence case capitalizes after leading whitespace
- spell: only whole ASCII-letter words are checked; naïve, München, utf8 stay intact - Accept header lookup ignores prototype keys (no Content-Type 'undefined') - svg/png keep backslashes in text; only real line breaks collapse - badge honours .svg (default) and .png, rejects text formats - XML arrays use <style>/<result>/<correction>/<item>, never <cas> - capstring/capstringAll accept null options - playground: badge curl URL has the style segment; text that ends in a format extension or contains a slash goes through ?text= - docs samples escape U+2028/2029; CHANGELOG reflects shipped paths, count(), and the image formats
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 86229f4006
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- badge values are bounded before rendering, like the image formats - batch has a total budget of 100,000 characters across all texts - JSONP callbacks cannot start with a JavaScript reserved word - count() measures grapheme clusters, so an emoji or flag counts once - playground: badge URL honours the png format; the curl line quotes the URL
Summary
Makes capstring serious and robust while staying fun. Stays on 1.x (1.1.0). No style names removed.
Library
XMLHttpRequest hello_world→xml-http-request-hello-worldslug(diacritics folded, ASCII only):Crème Brûlée & Co.→creme-brulee-co.kebabkeeps Unicode letters.title,sentence(capitalizes after. ! ?),alternatereverse/flip: emoji, flags, combining accents surviveleetmap, case preserved''(wasfalse);{ strict: true }throws instead of silently returningcapstringAll()andCATEGORIESsmallcaps,bubble,wide,strike,clap,morse,binary,piglatin(37 total)Tooling
npx capstring kebab "Hello World",--all,--list,--json, reads stdinindex.d.tswith aStyleunion; a test fails if it drifts fromSTYLESfileswhitelist replaces.npmignore;sideEffects: false;prepublishOnlyruns lint + coveragenpm pack --dry-runin CIAll behavior changes are listed in CHANGELOG under "Behavior changes".
Test plan
npm run lintcleannpm run test:coverage94 tests, 100% statements / branches / functions / linesnpm pack --dry-runlists exactly index.js, index.d.ts, cli.js, bin/, CHANGELOG.md, README.md, LICENSE, package.jsonnode bin/capstring.js --all "XMLHttpRequest 😀"andecho "hello. world" | node bin/capstring.js sentence