Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

troygould-stack
Copy link
Collaborator

@troygould-stack troygould-stack commented Jun 17, 2025

Describe your changes

A couple of options interfaces passed to the StacksEditor are not exported. Therefore, I had to recreate these interfaces when I wanted to use them. See:
https://github.com/StackEng/StackOverflow/blob/571e63834ee5920c9f5db16b97b84f94c85a872d/StackOverflow/_Scripts/islands/ask-question/src/shared/stackSnippets.ts#L18

Copy link

changeset-bot bot commented Jun 17, 2025

🦋 Changeset detected

Latest commit: 7b2dba6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@stackoverflow/stacks-editor Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

netlify bot commented Jun 17, 2025

Deploy Preview for stacks-editor ready!

Name Link
🔨 Latest commit 7b2dba6
🔍 Latest deploy log https://app.netlify.com/projects/stacks-editor/deploys/685ac8bd7c056c00087bd480
😎 Deploy Preview https://deploy-preview-457--stacks-editor.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.

@troygould-stack troygould-stack marked this pull request as ready for review June 23, 2025 21:58
Copy link
Contributor

@giamir giamir left a comment

Choose a reason for hiding this comment

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

@troygould-stack Thanks for the PR.

These changes need a patch release in order to be used in Core. To do that you can use npx @changeset/cli in this PR branch to generate a changeset. Once the PR is merged you can publish the package in autonomy by following the instructions in this part of the README.

Sidenote: Instead of hardcoding things in Core an alternative workaround would have been to write a reference to the internals of the editor I believe (I am not 100% sure though and have not tested it):

import type { SnippetMetadata } from "../../../../node_modules/@stackoverflow/stacks-editor/dist/plugins/official/stack-snippets/src/common";

This PR is the right call, you don't want to dig into internals of packages like that in general since internals should stay private. That said it might save you some copy/paste next time you need a temporary workaround.

@giamir giamir changed the title update exports fix(stack-snippet): expose stack-snippet options and metadata types Jun 24, 2025
@troygould-stack troygould-stack requested a review from giamir June 24, 2025 16:03
@troygould-stack troygould-stack merged commit 1c70c0e into main Jun 24, 2025
5 checks passed
@troygould-stack troygould-stack deleted the tgould/export-options-interfaces branch June 24, 2025 18:11
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.

2 participants