bump to stylua@2.5.2#1
Merged
ddashdev merged 15 commits intoMay 17, 2026
Merged
Conversation
…sponse (#1114) * fix(vscode): prevent bogus update prompt when GitHub API returns non-OK response When the GitHub API rate-limits or otherwise returns a non-2xx response, fetchJson was silently parsing the error body JSON. releaseFromJson would then produce a release with an empty tagName, causing ensureStyluaExists to always show the "update available" status bar item (since any installed version != ""). When the user clicked Update, downloadStyLuaVisual("") was called, which produced the confusing error "No release version matches v." Fix by throwing in fetchJson on non-OK HTTP responses so the existing try/catch in ensureStyluaExists handles it gracefully. Also add a tagName guard in getRelease for defense in depth against other malformed payloads.
The badges were retired
…issing (#1116) * Fix ENOENT causing file to be emptied when StyLua binary is missing The child process error event was registered as "err" instead of the correct "error", so spawn failures (e.g. ENOENT when the binary does not exist) were never caught. The stdout close handler would then resolve the Promise with an empty string, causing the extension to replace the entire document with empty content. * Add regression test for ENOENT causing file to be emptied Verifies that formatCode rejects (rather than resolves with an empty string) when the StyLua binary path does not exist. * Update VS Code extension changelog for ENOENT file-deletion fix * Move ENOENT changelog entry below existing unreleased entry
…column width (#1118) * Add snapshot test reproducing issue #1104 Both export type lines exceed the 120-column limit by 1-2 chars, but StyLua leaves them on a single line instead of hanging. The snapshot captures the current (buggy) output to be updated once the fix lands. * Fix type hanging not respecting column limit near the equal token (#1104) attempt_assigned_type_tactics was calling test_over_budget with `shape` (the column position before " = ") instead of `shape + EQUAL_TOKEN_LENGTH` (after " = "). This made the budget check 3 chars too generous, so a union/intersection type that fit without the equal sign but overflowed with it was left on one line. Fixed all three test_over_budget call sites in the function to use shape + EQUAL_TOKEN_LENGTH so the equal sign is included in the check. * Update changelog for issue #1104 fix
…calFunction/ConstFunction (#1115) * fix: target first attribute at_sign in stmt_remove_leading_newlines for LocalFunction/ConstFunction When a LocalFunction or ConstFunction has a leading Luau attribute (e.g. @Native), the actual first token of the statement is the attribute's at_sign, not the local/const keyword. stmt_remove_leading_newlines was targeting the wrong token, leaving stray newlines before the attribute at the start of a block. Fixes #1109 * simplify: extract strip_attribute_leading_newlines helper, avoid allocation on no-attribute path - Deduplicate the identical 6-line attribute-stripping logic from LocalFunction and ConstFunction arms into a single helper function - Use peekable iterator so no Vec is allocated when the function has no attributes (the common case) - Make both arms use a consistent if-let pattern instead of early-return vs if/else - Remove redundant comment from test input file * refactor: use next() to own first attribute, eliminating index and clone Replace peek()+collect()+[0]+clone() with cloned().next()? which takes the first element as an owned value so with_at_sign can consume it directly. * style: rustfmt * docs: add changelog entry for #1109
…kages (#1119) * refactor(npm): replace postinstall download with platform-specific optional packages Eliminates all 5 npm dependencies (92 transitive packages) and the recurring dependabot noise they generate. npm now installs only the pre-built binary for the current platform via optionalDependencies, matching the pattern used by esbuild, Biome, and Prettier. - Add five platform packages under stylua-npm-bin/platforms/ - Simplify run.js to resolve the binary from the installed platform package - Remove binary.js / install.js / uninstall.js and their postinstall hooks - Update release workflow to wait for all binaries, then publish each platform package before publishing the main package - Update CI smoke test to download the released binary, pack the platform package locally, and install it via file: reference for testing * chore(npm): add minimal package-lock.json Replaces the 1,691-line lockfile for 92 packages with a 26-line lockfile reflecting the zero-dependency main package. * fix(npm-bin): drop redundant cwd, guard against null exit status spawnSync defaults cwd to process.cwd() so the explicit arg was noise. result.status is null when the child is signal-killed; process.exit(null) coerces to 0, hiding the failure — use ?? 1 as fallback. * fix(npm-bin): align with upstream esbuild/biome patterns - Add publishConfig (access:public, provenance:true) to all packages, replacing --access public CLI flags and enabling SLSA provenance - Add files:["run.js"] to main package to prevent platforms/ directories (with extracted binaries) from landing in the published tarball - Add preferUnplugged:true to platform packages for Yarn PnP compatibility - Use process.exitCode instead of process.exit() for the final exit, allowing cleanup handlers to run (matches Biome pattern) - Remove package-lock.json from git (no deps to lock; esbuild/biome don't commit one either); add stylua-npm-bin/.gitignore - Update release.py: drop npm install step and lock file from git add, add platform package.json files to version bump and git add - Update CHANGELOG.md - Rewrite smoketest to install both packages into a fresh test-install/ directory, mirroring how a real user install looks (sibling packages in node_modules/), and test via the npm bin symlink * chore: polish based on review feedback - Consolidate five per-platform .gitignore files into one stylua-npm-bin/.gitignore - Simplify smoketest download to a single bash step (Windows runners support bash) - Use npx to invoke stylua in smoketest instead of reaching into node_modules/.bin - Tighten CHANGELOG wording * fix(ci): install platform and main packages in single npm install Running two separate npm install commands caused npm 7+ to prune the platform package during the second install: when building the ideal tree for the main package with --no-optional, the already-installed platform package appeared extraneous and was removed. Installing both packages together in one command keeps both in the ideal tree so npm doesn't prune the platform binary. * fix(ci): drop --no-optional from smoketest npm install The os/cpu fields on the platform packages already prevent npm from installing mismatched platform packages; on a macOS arm64 runner, only @johnnymorganz/stylua-bin-darwin-arm64 matches. The explicitly provided $PLATFORM_TGZ satisfies that optional dependency locally, so no registry lookup is needed. optionalDependencies failures are non-fatal anyway. Removing --no-optional also clears the deprecation warning (replaced by --omit=optional in npm 7+).
Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) from 2.0.2 to 2.1.0. - [Release notes](https://github.com/juliangruber/brace-expansion/releases) - [Commits](juliangruber/brace-expansion@v2.0.2...v2.1.0) --- updated-dependencies: - dependency-name: brace-expansion dependency-version: 2.1.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Node 22 ships with npm 10.x, but npm trusted publishing requires npm 11.5.1+. This caused npm publish to fail with 404 errors for v2.5.0 (and previously v2.4.0 / v2.4.1 before the earlier Node 16->22 bump). Node 24 ships with npm 11.x, satisfying the requirement.
OIDC trusted publishing failed with E422 because npm's provenance verifier compares the package.json repository.url against the actual GitHub repo URL from the workflow context. The lowercase "johnnymorganz/stylua" did not match "JohnnyMorganz/StyLua". Use the canonical "git+...git" URL form so npm does not emit a normalization warning during publish. Also normalize the bin.stylua path in stylua-npm-bin (./run.js -> run.js) as suggested by `npm pkg fix`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.