Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ORC tools

Standalone PowerShell tools for existing ORC projects. Every mutating tool is read-only by default and requires -Apply.

Enumerate Base64 assets

Preview a site-local migration:

pwsh -NoProfile -File .\enumerate-base64.ps1 -Site C:\src\orc\app

Apply it:

pwsh -NoProfile -File .\enumerate-base64.ps1 `
    -Site C:\src\orc\app `
    -Apply

Only F# wrappers that render HTML or Markdown are scanned: index.fs, indexmd.fs, and sharphtml-*, sharphtm-*, sharpmd-*, or sharpmarkdown-*. JavaScript/package source is deliberately excluded.

The tool validates each data:*;base64, payload, deduplicates decoded bytes, writes strings/sharedstrings.fs, and replaces every inline URI with the correct ordinary-string or triple-quoted raw-string expression. Its report maps stable asset IDs to every source file and line. Rename the generated Category.Asset### binding and all of its reported references together. Reruns preserve manually renamed catalog entries and append only new payloads.

Inspect a large catalog without printing its payloads, or register one asset by hash without scanning the site:

pwsh -NoProfile -File .\enumerate-base64.ps1 -Site C:\src\orc\app -List
pwsh -NoProfile -File .\enumerate-base64.ps1 `
    -Site C:\src\orc\app `
    -AddAsset C:\assets\hero.png `
    -AssetName HeroLogo `
    -Apply

If the bytes already exist, the stable reference is reported and the catalog is left untouched. A new payload is appended only with -Apply.

In the matching .github/config/deploy-*.fs, set UseSharedStrings = true. ORC then opens that site-local module for both deployment and multi-site preview rendering. The helper remains F# source and is never copied to the published site.

Convert comments

Preview every HTML-comment migration below a folder:

pwsh -NoProfile -File .\convert-comments.ps1 -Path C:\site

Apply the exact preview:

pwsh -NoProfile -File .\convert-comments.ps1 -Path C:\site -Apply

Files can be passed individually or as an array. The script converts <!-- ... --> to /* ... */, including multiline comments, only inside CSS/script raw-text regions. It recognizes <style>/<script> bodies, Giraffe style/script nodes whose content is a triple-quoted rawText, and standalone CSS/JavaScript/TypeScript wrappers. Normal HTML comments remain normal HTML comments. -AllComments is available for an explicitly selected file that is known to be raw text.

The migration preserves the file's Unicode encoding, BOM, line endings, and all text inside the delimiters. A file is blocked and left wholly untouched when an eligible comment body already contains */.

Folder scans include F#, HTML, CSS, JavaScript, and TypeScript files by default. Override -Extensions when a project uses another text extension. Generated and dependency directories are skipped.

Audit modules

Inspect current F# module/namespace declarations and deterministic, path-derived alternatives:

pwsh -NoProfile -File .\modulefix.ps1 `
    -RepoRoot C:\project `
    -CheckDirectory C:\project\docs

The module tool reports collisions and placeholder names but never edits source. Use -Format Json to create a refactoring plan or -FailOnCollision in automation.

About

miscellaneous tools for F# site QoL

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages