@gitlab/frontend-utils
v0.3.4
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
yarn 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
yarn install
yarn test
yarn build
yarn 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
Tagging a commit with v* (e.g. v0.1.0) triggers the publish pipeline to the GitLab npm registry.
