Skip to content

Conversation

mkurapov
Copy link
Contributor

@mkurapov mkurapov commented Sep 19, 2025

Description of changes

Moving all of the NodeJS snippets from https://github.com/interledger/open-payments-snippets to snippets/node, and updating the ChunkedSnippet component to use the local files, based off of #653.

Fixes #668 | OPE-239

Required

  • Used LinkOut component on external links
  • Reviewed Vale errors and made changes where appropriate
  • Ran Prettier
  • Previewed updates in Netlify
  • Received SME and/or peer approval if updates are significant
  • Included a "fixes #" comment

Conditional

  • Ensured sequence diagrams follow our style guide
  • Included code samples where appropriate
  • Updated related READMEs

Copy link

netlify bot commented Sep 19, 2025

Deploy Preview for openpayments-preview ready!

Name Link
🔨 Latest commit 9346093
🔍 Latest deploy log https://app.netlify.com/projects/openpayments-preview/deploys/68cd87821706240009d61111
😎 Deploy Preview https://deploy-preview-689--openpayments-preview.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.

Comment on lines +11 to +22
const gitRoot = execSync('git rev-parse --show-toplevel').toString().trim();
const snippetsPath = path.join(gitRoot, 'snippets');
const getChunk = async () => {
if (source.startsWith('http')) {
const data = await fetch(source).then((response) => response.text());
return data;
}
const data = await fs.readFile(path.join(snippetsPath, l, source), {encoding: "utf8"})
return data
}
Copy link
Contributor Author

@mkurapov mkurapov Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taken from @raducristianpopa's ChunkedSnippetExperimental #653.

Comment on lines +15 to +18
if (source.startsWith('http')) {
const data = await fetch(source).then((response) => response.text());
return data;
}
Copy link
Contributor Author

@mkurapov mkurapov Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, still allowing the http path to be fetched from the source. This is to support the PHP snippets in the meantime, which will be done in a separate PR

@mkurapov mkurapov marked this pull request as ready for review September 22, 2025 15:28
Copy link
Contributor

@melissahenderson melissahenderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it looks good 😂

@mkurapov mkurapov merged commit a5b636f into main Sep 23, 2025
5 checks passed
@mkurapov mkurapov deleted the max/ope-239 branch September 23, 2025 17:58
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.

Add local node snippets
2 participants