Skip to content

Conversation

evantahler
Copy link
Contributor

This PR sets up automatic publishing for the widget to @airbyte-embedded/airbyte-embedded-modal (https://www.npmjs.com/package/@airbyte-embedded/airbyte-embedded-modal). Just change the package.json version and get that on main and Github Actions should handle the rest.

Of note, I changed the package name to be within our namespace, and reuse the pacakge/repo were were using when Embedded was a stand-alone project. I bumped the minor version to mark that change.

I also made some other minor quality-of-life improvements that I'll annotate in the comments.

Comment on lines +27 to +28
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

NPM token has been added to this repo as an Action secret, and is also in 1Password.

</div>
<script type="module">
import { EmbeddedWidget } from "../src/index";
import { EmbeddedWidget } from "@airbyte-embedded/airbyte-embedded-modal";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I enabled pnpm workspaces for this repo so that we could have real-looking imports, and test that the 'bundled-up' package acts like we want it to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note for the future: the import should probably a little more specific, like AirbyteEmbeddedWidget

Comment on lines +10 to +12
"dependencies": {
"@airbyte-embedded/airbyte-embedded-modal": "workspace:*"
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now the demo imports our package in a regular-ish way

@evantahler evantahler requested review from teallarson and girarda April 2, 2025 03:22
1. There is an update to the main branch.
2. A new version is created in the `package.json`.

To create a new version, you can use the following command:
Copy link
Contributor

Choose a reason for hiding this comment

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

when should one use these instructions instead of the publish script?

Copy link
Contributor Author

@evantahler evantahler Apr 2, 2025

Choose a reason for hiding this comment

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

Both are needed, sort of:

  • The publish script and github action /always/ run on main, but are no-ops unless there's a new version in the package.json. Not every commit on main should produce a new artifact on NPM.
  • The pnpm version command is the best way to bump the version of the package within package.json, but you don't have to do it that way.
  • No one should ever need to run the publish shell script manually

What's nice about pnpm version is that it will also make a git tag for you too.

@evantahler evantahler merged commit b330b68 into main Apr 2, 2025
2 checks passed
@evantahler evantahler deleted the evan-publishing branch April 2, 2025 16:10
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.

3 participants