Files
Samuel Attard 2c94aac330 build: add oxfmt for JS/TS formatting and import sorting (#50692)
* build: add oxfmt for code formatting and import sorting

Adds oxfmt as a devDependency alongside oxlint and wires it into the
lint pipeline. The .oxfmtrc.json config matches Electron's current JS
style (single quotes, semicolons, 2-space indent, trailing commas off,
printWidth 100) and configures sortImports with custom groups that
mirror the import/order pathGroups previously enforced by ESLint:
@electron/internal, @electron/*, and {electron,electron/**} each get
their own ordered group ahead of external modules.

- `yarn lint:fmt` runs `oxfmt --check` over JS/TS sources and is
  chained into `yarn lint` so CI enforces it automatically.
- `yarn format` runs `oxfmt --write` for local fix-up.
- lint-staged invokes `oxfmt --write` on staged .js/.ts/.mjs/.cjs
  files before oxlint, so formatting is applied at commit time.

The next commit applies the formatter to the existing codebase so the
check actually passes.

* chore: apply oxfmt formatting to JS and TS sources

Runs `yarn format` across lib/, spec/, script/, build/, default_app/,
and npm/ to bring the codebase in line with the .oxfmtrc.json settings
added in the previous commit. This is a pure formatting pass: import
statements are sorted into the groups defined by the config, method
chains longer than printWidth are broken, single-quoted strings
containing apostrophes are switched to double quotes, and a handful of
single-statement `if` bodies are re-wrapped and get braces added by
`oxlint --fix` to satisfy the `curly: multi-line` rule.

No behavior changes.
2026-04-12 02:03:04 -07:00
..

Release Scripts

These ancient artifacts date back to the early days of Electron, they have been modified over the years but in reality still very much look how they did at the beginning. You have been warned.

None of these scripts are called manually, they are each called by Sudowoodo at various points in the Electron release process. What each script does though is loosely documented below, however this documentation is a best effort so please be careful when modifying the scripts as there still may be unknown or undocumented effects / intentions.

What scripts do we have?

cleanup-release

This script completely reverts a failed or otherwise unreleasable version. It does this by:

  • Deleting the draft release if it exists
  • Deleting the git tag if it exists

Note

This is the only script / case where an existing tag will be deleted. Tags are only considered immutable after the release is published.

print-next-version

This script just outputs the theoretical "next" version that a release would use.

prepare-for-release

This script creates all the requisite tags and CI builds that will populate required release assets.

  • Creates the git tag
  • Kicks off all release builds on GitHub Actions

run-release-build

This script is used to re-kick specific release builds after they fail. Sudowoodo is responsible for prompting the release team as to whether or not to run this script.

validate-before-publish

This script ensures that a release is in a valid state before publishing it anywhere. Specifically it checks:

  • All assets exist
  • All checksums match uploaded assets
  • Headers have been uploaded to the header CDN
  • Symbols have been uploaded to the symbol CDN

publish-to-github

This script finalizes the GitHub release, in the process it:

  • Uploads the header SHASUMs to the CDN
  • Updates the index.json file on the assets CDN with the new version via metadumper
  • Publishes the actual GitHub release

publish-to-npm

This script finishes the release process by publishing a new npm package.