Last Updated: October 15, 2025
Project: OmniScript Format
Version: v1.0
OmniScriptOSF/
βββ omniscript-core/ # Core packages
β βββ parser/ # OSF parser
β βββ cli/ # Command-line tools
β βββ spec/ # OSF specifications
β βββ docs/ # Core documentation
βββ omniscript-converters/ # Format converters
βββ omniscript-site/ # Documentation website
βββ omniscript-vscode/ # VSCode extension
βββ omniscript-examples/ # Example documents
βββ docs/ # Project documentation
β βββ TESTING.md # Test documentation
β βββ CODE_QUALITY.md # Quality reports
β βββ DEVELOPMENT.md # This file
βββ README.md # Main README
βββ RELEASE_NOTES.md # Release notes
βββ AGENTS.md # AI context
βββ CLAUDE.md # AI prompt
- Node.js: 22.16.0 or higher
- pnpm: 10.12.1 or higher
- Git: Latest version
git clone https://github.com/OmniScriptOSF/omniscript-core.git
cd omniscript-core# Install all dependencies
pnpm install
# Install dependencies for specific package
cd omniscript-core/parser
pnpm install# Build all packages
pnpm build --recursive
# Build specific package
cd omniscript-core/parser
pnpm buildgit checkout -b feature/my-featureEdit code in appropriate package:
- Parser:
omniscript-core/parser/src/ - Converters:
omniscript-converters/src/ - CLI:
omniscript-core/cli/src/
# Run tests for changed package
cd omniscript-core/parser
pnpm test
# Run all tests
pnpm test --recursive# Build changed package
pnpm build
# Build all packages
pnpm build --recursivegit add .
git commit -m "feat: add new feature"Use Conventional Commits:
feat:- New featurefix:- Bug fixdocs:- Documentationtest:- Testsrefactor:- Refactoringchore:- Maintenance
git push origin feature/my-featureCreate pull request on GitHub.
Location: omniscript-core/parser/
Development:
cd omniscript-core/parser
# Build
pnpm build
# Test
pnpm test
# Watch mode
pnpm build --watchKey Files:
src/parser.ts- Main parser logicsrc/types.ts- TypeScript typessrc/index.ts- Public APItests/- Test files
Location: omniscript-converters/
Development:
cd omniscript-converters
# Build
pnpm build
# Test
pnpm test
# Test specific converter
pnpm test pdfKey Files:
src/pdf.ts- PDF convertersrc/docx.ts- DOCX convertersrc/pptx.ts- PPTX convertersrc/xlsx.ts- XLSX convertertests/- Test files
Location: omniscript-core/cli/
Development:
cd omniscript-core/cli
# Build
pnpm build
# Test
pnpm test
# Run locally
node dist/osf.js parse example.osfKey Files:
src/osf.ts- CLI implementationtests/- Test files
- Update Types (
parser/src/types.ts):
export interface MyNewBlock {
type: 'mynew';
property1: string;
property2: number;
}
export type OSFBlock = MetaBlock | DocBlock | ... | MyNewBlock;- Update Parser (
parser/src/parser.ts):
case 'mynew': {
const props = parseKV(b.content);
const myNew: MyNewBlock = {
type: 'mynew',
property1: props.property1 as string,
property2: props.property2 as number
};
return myNew;
}- Update Serializer (
parser/src/parser.ts):
case 'mynew': {
const block = b as MyNewBlock;
return `@mynew {
property1: "${block.property1}";
property2: ${block.property2};
}`;
}-
Update Converters: Add rendering logic in
pdf.ts,docx.ts,pptx.ts,xlsx.ts -
Add Tests:
it('parses @mynew block', () => {
const osf = '@mynew { property1: "test"; property2: 42; }';
const doc = parse(osf);
expect(doc.blocks[0].type).toBe('mynew');
});- Create Converter (
converters/src/myformat.ts):
export class MyFormatConverter {
async convert(doc: OSFDocument): Promise<ConversionResult> {
// Implementation
}
}- Export (
converters/src/index.ts):
export { MyFormatConverter } from './myformat';-
Add Tests (
converters/tests/myformat.test.ts) -
Update CLI to support new format
# Run all unit tests
pnpm test --recursive
# Run specific package tests
cd omniscript-core/parser && pnpm test
# Run specific test file
pnpm test parser.test.ts
# Run in watch mode
pnpm test --watch
# Run with coverage
pnpm test --coverage# Run integration tests
pnpm test:integration
# Run end-to-end tests
pnpm test:e2eUse Vitest:
import { describe, it, expect } from 'vitest';
import { parse } from '../src/parser';
describe('Parser', () => {
it('parses @doc block', () => {
const osf = '@doc { # Hello }';
const doc = parse(osf);
expect(doc.blocks[0].type).toBe('doc');
});
});// Add console.log in parser
console.log('Parsing block:', blockType);
console.log('Properties:', props);// Enable debug mode
const converter = new PDFConverter();
converter.setDebug(true);# Add --verbose flag
node dist/osf.js parse example.osf --verbose
# Use Node debugger
node --inspect dist/osf.js parse example.osf- Use strict mode
- No implicit
any - Use explicit return types
- Use interfaces over types
// Good
function parse(input: string): OSFDocument {
// ...
}
// Bad
function parse(input) {
// ...
}- Files:
kebab-case.ts - Classes:
PascalCase - Functions:
camelCase - Constants:
UPPER_SNAKE_CASE
/**
* Parses OSF string into document AST
* @param input - OSF string
* @returns Parsed document
*/
export function parse(input: string): OSFDocument {
// Implementation
}Use JSDoc comments:
/**
* Converts OSF document to PDF
* @param doc - OSF document
* @param options - Conversion options
* @returns PDF buffer and metadata
*/
async convert(doc: OSFDocument, options?: ConversionOptions): Promise<ConversionResult>When adding features:
- Update main README.md
- Update package README.md
- Add examples
- Update specification
cd omniscript-core/parser
npm version patch # or minor, majorAdd changes to CHANGELOG.md:
## [1.0.1] - 2025-10-20
### Fixed
- Fix parser edge case
### Added
- Add new featurepnpm build --recursivepnpm test --recursive# Login to npm (if not already)
npm login
# Publish packages in order
cd omniscript-core/parser && npm publish
cd ../../omniscript-converters && npm publish
cd ../omniscript-core/cli && npm publishgit tag v1.0.1
git push origin v1.0.1- Go to GitHub releases
- Create new release from tag
- Add release notes
- Publish
Problem: TypeScript compilation errors
Solution:
# Clean and rebuild
rm -rf dist
pnpm buildProblem: Tests failing after changes
Solution:
# Run tests with verbose output
pnpm test --verbose
# Run specific failing test
pnpm test failing-test.test.tsProblem: Dependency resolution errors
Solution:
# Clear cache and reinstall
rm -rf node_modules
rm pnpm-lock.yaml
pnpm installProblem: Chrome not found for PDF generation
Solution:
# Install Chrome
npx puppeteer browsers install chrome- VSCode - Recommended editor
- pnpm - Package manager
- Vitest - Testing framework
- TypeScript - Language
- ESLint
- Prettier
- TypeScript and JavaScript Language Features
- vitest
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"typescript.tsdk": "node_modules/typescript/lib"
}| Package | TypeScript | Tests | Total |
|---|---|---|---|
| Parser | 1,200 | 800 | 2,000 |
| Converters | 4,500 | 2,800 | 7,300 |
| CLI | 900 | 600 | 1,500 |
| Total | 6,600 | 4,200 | 10,800 |
| Package | Runtime | Dev | Total |
|---|---|---|---|
| Parser | 0 | 5 | 5 |
| Converters | 6 | 5 | 11 |
| CLI | 4 | 4 | 8 |
See CONTRIBUTING.md for:
- Code of conduct
- Pull request process
- Coding standards
- Review process
- Documentation: https://omniscript.dev/docs
- GitHub Issues: Bug reports and feature requests
- GitHub Discussions: Questions and ideas
- Email: support@omniscript.dev
- GitHub: @OmniScriptOSF
- Twitter: @OmniScriptOSF
Last Updated: October 15, 2025
Maintained By: OmniScript Development Team