@cmssy/types
v0.62.0
Published
Shared type definitions for Cmssy platform
Readme
@cmssy/types
Shared TypeScript type definitions for the Cmssy platform.
Installation
npm install @cmssy/typesUsage
import {
FieldType,
LayoutRegionId,
BlockConfig,
TemplateConfig
} from "@cmssy/types";
// Use in block.config.ts
const config: BlockConfig = {
name: "My Block",
category: "content",
schema: {
title: {
type: FieldType.SINGLE_LINE,
label: "Title",
},
},
};Exports
- Field Types:
FieldType,FieldConfig,FieldValidation,ShowWhenCondition - Media values:
MediaReference(assetId,transform?,altText?- empty marks the use decorative),MEDIA_ALT_TEXT_MAX,ResolvedMedia(altis the text to render,altTextthe reference's own) - Layout:
LayoutRegionId(string),LayoutRegion,DEFAULT_LAYOUT_REGIONS,LAYOUT_REGION_ID_PATTERN,LAYOUT_REGIONS_MAX,LAYOUT_REGION_LABEL_MAX - Modules:
WorkspaceModule,FeatureFlag,BlockRequires - Block Config:
BlockConfig,BlockSource,PackageType - Template Config:
TemplateConfig,TemplatePageBlueprint,TemplateLayoutRegion - Media transform:
MediaTransform,MediaTrim,MediaFit,MediaBox,FocalPoint,MEDIA_FIT_MODES,MEDIA_TRANSFORM_WIDTHS,MEDIA_TRANSFORM_MAX_SIDE,MEDIA_TRIM_MAX_SIDE,MEDIA_QUALITY_MIN,MEDIA_QUALITY_MAX,MEDIA_QUALITY_DEFAULT,parseMediaTransform,parseMediaTrim,snapWidth,snapWidthDown,renderedBox,effectiveMediaFit,transformForTrim,trimmedFocalPoint,mediaTransformUrl
Development
npm install
npm run build
npm run typecheckPublishing
Releases are tag-driven and authenticated by OIDC trusted publishing - there is
no token, and npm publish from a working copy is not the path. It would also
ship whatever a previous build left in dist/, which npm run build does not
clean.
npm version patch|minor|major # bumps package.json and creates the tag
git push origin main
git push origin v<version> # one tag, never --tags.github/workflows/release.yml checks the tag against package.json, builds
from a fresh checkout and publishes. It skips a version already on npm, so a
re-run is safe - and so a tag that repeats a published version goes green
having published nothing.
