Skip to content

Refactor export helpers into reusable node-export module#76

Closed
mniinio wants to merge 1 commit into
mainfrom
codex/create-reusable-module-for-non-cli-logic
Closed

Refactor export helpers into reusable node-export module#76
mniinio wants to merge 1 commit into
mainfrom
codex/create-reusable-module-for-non-cli-logic

Conversation

@mniinio

@mniinio mniinio commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

Motivation

  • Separate CLI orchestration from reusable export logic so programmatic consumers can import helpers without pulling in the entire CLI.
  • Make the rendering/output helpers reusable for other scripts and consumers and enable a package subpath for direct imports.
  • Preserve existing behavior and test surface while simplifying scripts/export.js to a thin CLI wrapper.

Description

  • Added src/node-export.cjs and moved non-CLI export logic there, including buildContent, buildFileName, renderSVG, writePDF, writePNG, and re-exported exportJSON from scripts/noteManager.
  • Simplified scripts/export.js to only parse CLI arguments and call the shared helpers from ../src/node-export.cjs.
  • Exposed the new module via package.json exports as "./node-export": "./src/node-export.cjs" while keeping the existing root entry points intact.
  • Updated tests/export.test.js to import the helpers from src/node-export.cjs and validated the same exported API surface is available.

Testing

  • Ran npm test -- tests/export.test.js and the test suite passed (all tests in tests/export.test.js succeeded).
  • Ran npm run build and the build completed successfully.

Codex Task

@netlify

netlify Bot commented Mar 23, 2026

Copy link
Copy Markdown

Deploy Preview for apiops-cycles-canvascreator ready!

Name Link
🔨 Latest commit 418fa44
🔍 Latest deploy log https://app.netlify.com/projects/apiops-cycles-canvascreator/deploys/69c15f32107a680008206b98
😎 Deploy Preview https://deploy-preview-76--apiops-cycles-canvascreator.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mniinio mniinio closed this Mar 24, 2026
@mniinio mniinio deleted the codex/create-reusable-module-for-non-cli-logic branch March 24, 2026 04:51
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