@entryscape/es-utils
v2.2.0
Published
Shared JavaScript utilities for [Blocks](https://bitbucket.org/metasolutions/blocks) and [EntryScape](https://bitbucket.org/metasolutions/entryscape).
Downloads
275
Keywords
Readme
es-utils
Shared JavaScript utilities for Blocks and EntryScape.
Extracts and consolidates common functionality used across both projects to reduce duplication and ensure consistency.
Installation
pnpm add @entryscape/es-utilsUsage
import { merge, fetchJson, EntityType } from '@entryscape/es-utils';Formats
@entryscape/es-utils/formats maps EU file-type codes to IANA media types and gives display labels for distribution formats. It is the only entry point that also works in plain Node, as ESM or CommonJS:
import { getFormatLabel, ianaToNal } from '@entryscape/es-utils/formats';
const { readFormat } = require('@entryscape/es-utils/formats');Development
pnpm test # Run tests
pnpm lint # Run linter
pnpm lint-fix # Auto-fix lint issues
pnpm lint-n-test # Run linter and tests
pnpm refresh # Clean reinstall and test
pnpm build # Build the CommonJS bundle of the formats module (dist/)
pnpm check:package # Build, then check that the formats module loads via require and import
pnpm generate:formats # Regenerate the file-type mapping from the EU vocabularyReleasing
The release script bumps the version, updates the changelog with Jira issues, runs lint and tests, commits, tags, and pushes to origin.
Setup
Set up Jira API credentials:
export JIRA_EMAIL="[email protected]"
export JIRA_API_TOKEN="your-api-token"Get your API token from: https://id.atlassian.com/manage-profile/security/api-tokens
Usage
pnpm release # Patch release (1.0.0 -> 1.0.1)
pnpm release minor # Minor release (1.0.0 -> 1.1.0)
pnpm release major # Major release (1.0.0 -> 2.0.0)
pnpm release --dry-run # Preview without making changesWhat it does
- Bumps version in package.json
- Collects Jira issues from merge commits since the last tag
- Filters issues to only include those with the
es-utilscomponent - Updates CHANGELOG.md with the new release entry
- Runs
pnpm lint-n-test - Commits changes with message "release version X.Y.Z"
- Creates a git tag
- Pushes commit and tag to origin
The script does not publish. pnpm pack and pnpm publish build dist/ and run pnpm check:package first, through the prepack script.
