-
Notifications
You must be signed in to change notification settings - Fork 0
NPM publishing and Monorepo #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Publish Widget | ||
on: | ||
push: | ||
branches: [main] | ||
paths: ["widget/**"] | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: "pnpm" | ||
registry-url: "https://registry.npmjs.org" | ||
- name: Install PNPM | ||
run: npm install -g pnpm | ||
- name: Install dependencies | ||
run: pnpm install | ||
- name: Publish | ||
run: ./scripts/publish.sh | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,6 +78,25 @@ To configure the demo, create a `.env` file in the `/demo` directory: | |
VITE_API_TOKEN=your_api_token_here | ||
``` | ||
|
||
## Publishing | ||
|
||
This repository is configured to publish to npmjs.org whenever: | ||
|
||
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: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. when should one use these instructions instead of the publish script? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both are needed, sort of:
What's nice about |
||
|
||
```bash | ||
pnpm version <major|minor|patch> | ||
``` | ||
|
||
and then push those changes to the main branch. Don't forget the tags! | ||
|
||
```bash | ||
git push origin main --tags && git push | ||
``` | ||
|
||
## License | ||
|
||
This software is proprietary and confidential. Commercial terms apply. Please see [LICENSE.txt](LICENSE.txt) for details or contact Airbyte, Inc. for licensing information. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ <h1>Airbyte Widget Demo</h1> | |
<div id="error" class="error"></div> | ||
</div> | ||
<script type="module"> | ||
import { EmbeddedWidget } from "../src/index"; | ||
import { EmbeddedWidget } from "@airbyte-embedded/airbyte-embedded-modal"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
||
const loadingEl = document.getElementById("loading"); | ||
const errorEl = document.getElementById("error"); | ||
|
@@ -42,6 +42,7 @@ <h1>Airbyte Widget Demo</h1> | |
client_secret: import.meta.env.VITE_AB_API_CLIENT_SECRET || "", | ||
}); | ||
|
||
// Note: This should be an API call to the customer's backend server, not Airbyte directly | ||
const response = await fetch(`${import.meta.env.VITE_AB_BASE_URL}/api/v1/applications/token`, { | ||
method: "POST", | ||
headers: { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,9 @@ | |
"test:ui": "playwright test --ui" | ||
}, | ||
"license": "UNLICENSED", | ||
"dependencies": { | ||
"@airbyte-embedded/airbyte-embedded-modal": "workspace:*" | ||
}, | ||
Comment on lines
+10
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now the demo imports our package in a regular-ish way |
||
"devDependencies": { | ||
"@playwright/test": "^1.42.1", | ||
"@types/node": "^22.13.14", | ||
|
There was a problem hiding this comment.
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.