Package Refactoring Complete! ✅
What Changed
Package Names
packages/core→ Now named@glotblocks/glost-corein package.jsonpackages/glost→ Now the main facade package namedglost
New Structure
packages/
├── glost/ # NEW: Main facade package (v0.5.0)
│ ├── package.json # name: "glost"
│ ├── src/
│ │ ├── index.ts # Re-exports everything
│ │ ├── processor.ts
│ │ ├── registry.ts
│ │ └── presets.ts
│ └── README.md
│
├── core/ # Renamed to glost-core (v0.5.0)
│ └── package.json # name: "glost-core"
│
├── processor/
│ └── package.json # Updated: depends on "glost-core"
│
├── registry/
│ └── package.json # Updated: depends on "glost-core"
│
├── cli/
│ └── package.json # Updated: depends on "glost-core"
│
└── presets/
└── package.json # Updated: depends on "glost-core"Updated Dependencies
All packages that previously depended on "glost": "workspace:*" now depend on "glost-core": "workspace:*":
- ✅ glost-processor
- ✅ glost-registry
- ✅ glost-cli
- ✅ glost-presets
Usage
Users Install One Package
npm install @glotblocks/glostEverything Available from One Import
// All from one place!
import {
glost, // Processor
createSimpleDocument, // From glost-core
getAllWords, // From glost-core
pluginRegistry, // From glost-registry
languageLearningPreset // From glost-presets
} from "@glotblocks/glost";Or Granular Imports
// Just the core
import { createSimpleDocument } from "@glotblocks/glost-core";
// With processor
import { glost } from "@glotblocks/glost-processor";Subpath Exports
// Explicit subpaths
import { glost } from "@glotblocks/glost/processor";
import { pluginRegistry } from "@glotblocks/glost/registry";
import { languageLearningPreset } from "@glotblocks/glost/presets";Next Steps
- Run
pnpm installto update workspace dependencies - Build the packages:
pnpm build -r - Test the changes: Import from
glostinstead of@glotblocks/glost-core
Benefits
✅ Clear Naming - @glotblocks/glost-core clearly indicates it’s the core implementation
✅ Convenience - Users can npm install glost and get everything
✅ Flexibility - Advanced users can install specific packages
✅ Standard Pattern - Follows monorepo best practices (like babel, unified)
✅ Clean API - Main package is the public interface
Breaking Changes for Users
Before
import { createSimpleDocument } from "@glotblocks/glost";After (both work!)
// Option 1: From main package (recommended)
import { createSimpleDocument } from "@glotblocks/glost";
// Option 2: From core directly
import { createSimpleDocument } from "@glotblocks/glost-core";The main glost package re-exports everything from @glotblocks/glost-core, so existing code using import from "@glotblocks/glost" will continue to work!
Last updated on