Skip to content

feat: migrate compile action to TypeScript/Node.js#1

Merged
ronaldtse merged 1 commit intomainfrom
feat/typescript-migration
Feb 17, 2026
Merged

feat: migrate compile action to TypeScript/Node.js#1
ronaldtse merged 1 commit intomainfrom
feat/typescript-migration

Conversation

@ronaldtse
Copy link
Contributor

@ronaldtse ronaldtse commented Feb 17, 2026

Summary

Migrate the compile action from a composite action (shell script wrapper) to a TypeScript/Node.js action with architectural parity to sibling actions (cache, site-gen).

Changes

New Features

  • Type-safe input handling with validation
  • Unit tests with Vitest (38 tests, 80% coverage threshold)
  • Output capture (metanorma-version, output-dir)
  • Input validation (path traversal protection)
  • Version-aware command building

Files Created

  • src/main.ts - Entry point
  • src/input-helper.ts - Input parsing and validation
  • src/compile-settings.ts - TypeScript interface for 14 inputs
  • src/compile-command-manager.ts - Command building for metanorma compile
  • src/compile-provider.ts - Main orchestration logic
  • src/version-helper.ts - Version class with semver comparison
  • src/fs-helper.ts - Directory existence helper
  • src/state-helper.ts - IsPost state management
  • __test__/*.test.ts - 4 test files with 38 tests
  • package.json, tsconfig.json, eslint.config.js, vitest.config.ts
  • dist/index.js - Bundled action

Files Modified

  • action.yml - Changed from using: composite to using: node24, added outputs
  • .github/workflows/test.yml - Use shared workflows, added input validation tests

Verification

  • Unit tests: 38 tests passing
  • Build: dist/index.js created (423KB minified)
  • Lint: No errors
  • Format: Prettier passes

Test Plan

  • Verify lint-test job passes
  • Verify test-compile-packed-mn passes on all platforms
  • Verify test-compile-bundler passes
  • Verify test-compile-docker passes
  • Verify test-input-validation catches path traversal
  • Verify test-outputs sets metanorma-version correctly

@ronaldtse ronaldtse force-pushed the feat/typescript-migration branch from 39b5217 to 55a7336 Compare February 17, 2026 10:16
@ronaldtse ronaldtse merged commit a86dd84 into main Feb 17, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant