@creatiosoft/localization-types
v0.0.2
Published
Types only package for Localization Service
Downloads
18
Readme
@creatiosoft/localization-types
Shared TypeScript types package for the Localization Service platform.
Purpose
This package defines the canonical domain interfaces used across all components of the localization service — the API, the translation editor, the build pipeline, the CDN delivery layer, and any other service that needs to operate on localization data.
By centralising types in a single published package, all services share a common contract. Any breaking change to the domain model is surfaced as a compile-time error across every consumer, preventing silent mismatches between services.
Domain Model Overview
IProject
├── IProjectMember[] — users with roles (owner, developer, translator, viewer)
├── INamespace[] — logical groupings of translation keys (e.g. "auth", "ui")
│ └── IDictionaryEntry[] — key → translated value, per language
└── IVersion[] — published build snapshots of the full translation set
ILanguage — global catalogue of supported languages (e.g. "en", "hi", "fr")
IAudit — base interface extended by all entities (id, timestamps, actors)Getting Started
Installation
Install the package from the npm registry (or your private registry):
npm install @creatiosoft/localization-typesIf you are working in the monorepo and consuming this package locally, link it
using your package manager's workspace or npm link:
# From the localization-types directory
npm link
# From the consuming service directory
npm link @creatiosoft/localization-typesUsage
Import types directly from the package root:
import {
IProject,
INamespace,
IProjectMember,
ProjectRole,
IDictionaryEntry,
TranslationSource,
ILanguage,
IVersion,
VersionStatus,
IAudit,
} from '@creatiosoft/localization-types';Build
The package must be built before it can be consumed. The build compiles the
TypeScript source in src/ and emits JavaScript along with .d.ts declaration
files into dist/.
Prerequisites
- Node.js >= 18
- npm >= 9
Install dependencies
npm installCompile
npm run buildThis runs tsc using tsconfig.json and outputs to dist/.
Publish
The prepublishOnly script runs the build automatically before publishing,
so you do not need to build manually before running npm publish:
npm publishPackage Structure
localization-types/
├── src/
│ ├── index.ts # Root barrel export
│ ├── common/
│ │ ├── audit.ts # IAudit — base entity interface
│ │ └── index.ts
│ ├── language/
│ │ ├── language.ts # ILanguage
│ │ └── index.ts
│ ├── project/
│ │ ├── project.ts # IProject
│ │ ├── project-member.ts # IProjectMember, ProjectRole
│ │ ├── namespace.ts # INamespace
│ │ └── index.ts
│ ├── dictionary/
│ │ ├── dictionary-entry.ts # IDictionaryEntry, TranslationSource
│ │ └── index.ts
│ └── version/
│ ├── version.ts # IVersion, VersionStatus
│ └── index.ts
├── dist/ # Compiled output (generated, not committed)
├── tsconfig.json
└── package.jsonAuthor
Vikas Sood — Nth Bit Labs
