Skip to content

Misc updates#208

Draft
10hendersonm wants to merge 20 commits into
mainfrom
misc_updates
Draft

Misc updates#208
10hendersonm wants to merge 20 commits into
mainfrom
misc_updates

Conversation

@10hendersonm

Copy link
Copy Markdown
Member

closes #140 and a bunch of vuln issues?

Changes

Validation

MattP007 and others added 19 commits June 30, 2026 14:24
Co-authored-by: Dayton <SVDEA001@target.com>
Co-authored-by: Dayton <SVDEA001@target.com>
Co-authored-by: Dayton <SVDEA001@target.com>
Co-authored-by: Dayton <SVDEA001@target.com>
- Drop build step: switch to Node 24 native TypeScript type stripping;
  tsconfig is now noEmit with erasableSyntaxOnly, and main/bin point
  directly to src/index.ts
- Remove ts-loader shim (scripts/ts-loader.mjs) — no longer needed
- Replace ESLint v7 flat-file (.eslintrc.js) with v9 flat config
  (eslint.config.mjs), add eslint-plugin-import for import ordering
- Bump prettier 2→3, husky 6→9, typescript 5→6, @types/node 22→24
- Switch .prettierrc.js to ESM (export default) to match flat config
- Add @commander-js/extra-typings and zod as runtime dependencies
- Update engines to node >=24

Co-authored-by: Dayton <SVDEA001@target.com>
Co-authored-by: Dayton <SVDEA001@target.com>
… handling

- Replace commander with @commander-js/extra-typings for typed options
- Validate block configs with Zod schema instead of manual type checks,
  surfacing structured error messages via prettifyZodErrors
- Remove the --no-follow-symbolic-links option (followSymlinks removed
  from ReplaceOptions and glob call); fix Dirent typing in glob exclude
- Expand default glob pattern from **/*.md to **/*.{md,mdx}
- Use logger.error + process.exitCode = 1 (non-throwing) for per-block
  errors so remaining blocks still get processed
- Switch imports to .ts extensions and node: protocol prefixes

Co-authored-by: Dayton <SVDEA001@target.com>
Co-authored-by: Dayton <SVDEA001@target.com>
- cli.test.ts: scope stdoutWriteMock per-test to avoid breaking
  node:test runner IPC; update expected glob pattern (.md → .{md,mdx});
  remove followSymlinks from expected call args
- md-inject.test.ts: fix child_process mock path to use node: prefix;
  update error assertions to match new string-based logger.error output
  (drop objectContaining wrappers); remove followSymlinks from call sites
- meta.test.ts: update lock file check from package-lock.json to
  pnpm-lock.yaml
- helpers.ts: formatting-only changes (prettier)

Co-authored-by: Dayton <SVDEA001@target.com>
Co-authored-by: Dayton <SVDEA001@target.com>
Co-authored-by: Dayton <SVDEA001@target.com>
mock.fn() defaults F to (...args: any[]) => undefined, causing
mockImplementation to reject callbacks with non-undefined return types.
Adding explicit generics to envCiMock, globMock, and readFileMock
resolves all typecheck errors.

Co-authored-by: Dayton <SVDEA001@target.com>
When a codeblock's replacement text is shorter than the original match,
the regex engine's lastIndex pointed past the start of the next block in
the mutated string, causing subsequent blocks to be silently skipped.
Realign lastIndex to pre.length + newBlock.length after each replacement,
and replace the deprecated substr with slice.

Co-authored-by: Dayton <SVDEA001@target.com>
…e exclusion

readGitignorePatterns stripped whitespace but not trailing slashes, so
directory patterns like `dist/` were stored as `dist/` and never matched
path segments. Also filter negation lines (`!`) which should not be treated
as exclusions. isGitignored now converts glob patterns containing `*` or `?`
to regex (** crosses separators, * and ? stay within a segment) so patterns
like `*.generated.md` correctly exclude matching files.

Co-authored-by: Dayton <SVDEA001@target.com>
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.

-a option hardcodes only markdown, not MDX

2 participants