@gitlab/frontend-config
v0.1.1
Published
Shared ESLint, TSConfig, Rslib and CI setup for packages in gitlab-org/frontend/toolkit
Maintainers
Keywords
Readme
@gitlab/frontend-config
Shared setup for packages in gitlab-org/frontend/toolkit:
ESLint, TSConfig and Rslib bases, the base CI pipeline, and the files a new package starts with.
Packages reference it and never copy it, so an update is a version bump.
Decided in MFE Platform ADR 004.
Using it in a package
Add the dependency, then three small files:
# .gitlab-ci.yml
include:
- project: gitlab-org/frontend/toolkit/config
ref: v0.1.0
file: ci/base.yml// eslint.config.js
import base from '@gitlab/frontend-config/eslint';
export default [...base];// tsconfig.json
{
"extends": "@gitlab/frontend-config/tsconfig",
"include": ["src"]
}Keep the npm version and the CI ref on the same release. Renovate bumps both in one MR.
Exports
| Export | What it is |
| --- | --- |
| @gitlab/frontend-config/eslint | Flat config array: @eslint/js recommended, typescript-eslint recommended, node and browser globals, the toolkit rules. Spread it and add your own entries after it. |
| @gitlab/frontend-config/tsconfig | Type checking base, noEmit. Add include in your tsconfig.json. |
| @gitlab/frontend-config/tsconfig/build | Emitting variant, src to dist with declarations. |
| @gitlab/frontend-config/rslib | Rslib base, ESM and CJS from src/index.ts with types. Untested until the first package adopts Rslib. |
CI
ci/base.yml calls package.json scripts by name, so every package needs lint, typecheck, test and build.
It runs them on every branch, and on a v* tag it publishes to npmjs with provenance through trusted publishing
and creates the GitLab release from the tag message. Add package-specific jobs below the include.
pnpm refuses to install in CI when a dependency has a build script nobody approved, ERR_PNPM_IGNORED_BUILDS.
Approve them in pnpm-workspace.yaml:
allowBuilds:
esbuild: trueReleasing a package
The tag is the version. A Maintainer creates vX.Y.Z on main from the Releases page or with git tag -a,
with the release notes in the message. The pipeline does the rest. package.json keeps a placeholder
version and is never bumped in the repository.
What else is here
templates/: the filesnew-gitlab-modulecopies into a new package..gitignore,.tool-versions, the CI stub, theextendsconfigs and the defaultCODEOWNERS..gitlab/issue_templates/: the group'sNew package requestandDeprecate packagetemplates. Thetoolkitgroup uses this project as its template source.new-gitlab-module, the bootstrap script from the ADR, is not here yet. Its scope is being defined.
Developing this package
pnpm install
pnpm run lint
pnpm run typecheckThe repository lints itself with its own ESLint export. Changes to eslint/, tsconfig/, rslib/ or ci/
reach consumers on their next bump, so note breaking ones in the release message.
