@gitlab/frontend-utils
v0.5.1
Published
Shared frontend utilities for GitLab
Maintainers
Keywords
Readme
@gitlab/frontend-utils
Shared frontend utilities extracted from the GitLab monolith. Pure JavaScript functions with no coupling to Rails, Vue, or domain-specific code.
Installation
pnpm add @gitlab/frontend-utilsUsage
import { joinPaths, queryToObject } from '@gitlab/frontend-utils';Functions that originally relied on browser globals (window.gon, window.location) accept optional parameters for injection, so they work both in the monolith (where globals exist) and standalone.
Development
pnpm install
pnpm test
pnpm build
pnpm lintAdding a utility
- Add your module under
src/. - Co-locate tests as
*.test.jsnext to the source. - Re-export the public API from
src/index.js. - Update the monolith import to consume from this package, leaving a re-export shim in
lib/utils/during migration.
Publishing
The package is published to the public npm registry (registry.npmjs.org), not the GitLab package registry. Publishing uses npm trusted publishing with OIDC, so no npm token is stored in CI, and every version carries a provenance attestation.
To release, push a tag vMAJOR.MINOR.PATCH on main, for example v0.6.0. The tag pipeline sets version in package.json from the tag and publishes. Prerelease tags such as v0.6.0-rc.1 publish to the next dist-tag, so they do not replace latest. The tag message becomes the GitLab release notes.
