Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/manual-publish-docs.yml
Copy link
Member

Choose a reason for hiding this comment

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

You can manually trigger this action from this branch to determine if everything is working as expected. Pre-publishing the docs won't hurt.

You would not want to do the same for the manual-publish.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ on:
- packages/sdk/server-ai
- packages/telemetry/browser-telemetry
- packages/sdk/combined-browser
- packages/sdk/shopify-oxygen
name: Publish Documentation
jobs:
build-publish:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/manual-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ on:
- packages/ai-providers/server-ai-langchain
- packages/telemetry/browser-telemetry
- packages/sdk/combined-browser
- packages/sdk/shopify-oxygen
prerelease:
description: 'Is this a prerelease. If so, then the latest tag will not be updated in npm.'
type: boolean
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/shopify-oxygen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: sdk/shopify-oxygen

on:
push:
branches: [main, 'feat/**']
paths-ignore:
- '**.md'
pull_request:
branches: [main, 'feat/**']
paths-ignore:
- '**.md'

jobs:
build-test-shopify-oxygen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Copy link
Member

Choose a reason for hiding this comment

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

Generally speaking we should used a SHA for these instead of a version. But it may be better to do that in its own PR as I recently did for C++.

https://github.com/launchdarkly/cpp-sdks/pull/500/files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

looks like there is also a PR against this repo #955 that might address this? Is there an easy way to get the image digest for these action images? I am having a hard time referencing them with docker pull/inspect

Copy link
Member

Choose a reason for hiding this comment

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

There just the SHA of the associated git repo. Each action is either a repo, or in a mono-repo.
https://github.com/actions/checkout

So the SHA of the tag associated with the release.
image

In a mono-repo there will likely be a tag per action, such as in our case: https://github.com/launchdarkly/gh-actions/releases/tag/persistent-stores-v0.1.2

- uses: actions/setup-node@v4
with:
# https://shopify.dev/docs/storefronts/headless/hydrogen/getting-started#requirements
node-version: lts/*
registry-url: 'https://registry.npmjs.org'
- id: shared
name: Shared CI Steps
uses: ./actions/ci
with:
workspace_name: '@launchdarkly/shopify-oxygen-sdk'
workspace_path: packages/sdk/shopify-oxygen
3 changes: 2 additions & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
"packages/store/node-server-sdk-redis": "4.2.14",
"packages/telemetry/browser-telemetry": "1.0.11",
"packages/telemetry/node-server-sdk-otel": "1.3.2",
"packages/tooling/jest": "0.1.12"
"packages/tooling/jest": "0.1.12",
"packages/sdk/shopify-oxygen": "0.0.0"
}
5 changes: 4 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ describe('given a mock filesystem and memory feature store', { /* tests */})
These then combined to create an understandable test name:
`given a mock filesystem and memory feature store > it does not load flags prior to start`

---
For docs on our module publishing process, see [our publishing doc](contributing/publishing.md)

## Development Guidelines

These are a series of recommendations for developing code in this repository. Not all existing code will comply
Expand Down Expand Up @@ -235,7 +238,7 @@ There are a number of categories of packages in the monorepo:
5. **Tooling packages** (red): Development and testing tools
- Jest testing utilities

### Depenencies
### Dependencies

In general dependencies should be avoided unless they are absolutely necessary. For each dependency several considerations should be made:

Expand Down
20 changes: 0 additions & 20 deletions contributing/initial-package-publish.md

This file was deleted.

90 changes: 90 additions & 0 deletions contributing/publishing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Publishing SDKs

Publishing a new SDK package in this monorepo typically happens in 2
phases: initial package publishing phase and stable release phase.

> [!NOTE]
> If you are moving an existing package to this monorepo, you should
> still read through the [initial publishing](#initial-package-publishing)
> and follow the relevant steps to initialize the CI implementation.

## Initial Package Publishing

When publishing a package for the first time, developers must complete several steps not part of a typical package release. This phase is
designed to:
1. Establish the CI implementation for the new package
2. Generate pre-release builds for testing

### Step 1. Extend `release-please-config.json`

When doing the initial release, you will need to add a new record to
[`release-please-config.json`](../release-please-config.json):
```
"packages/type/my-package": {
"bump-minor-pre-major": true,
"release-as": "0.1.0",
"bootstrap-sha": "MY_SHA"
}
```
> [!TIP]
> `bump-minor-pre-major` only needs to be set if you are publishing
> unstable releases (major version `0`). This option ensures that
> breaking changes will only increment minor version.

> [!TIP]
> `bootstrap-sha` will ensure that the conventional commits are
> calculated from a certain point and not the whole package history.
> You can find the appropriate commit sha using `git log`.

## 2. Add initial release manifest

Add the following to `.release-please-manifest.json`
```
"packages/type/my-package": "0.0.0"
```

## 3. Add option to manual workflows

Add `PATH_TO_YOUR_PACKAGE` to the `on.workflow_dispatch.inputs.workspace_path.options`
array in the following files:
- [`manual-publish-docs.yml`](../.github/workflows/manual-publish-docs.yml)
- [`manual-publish.yml`](../.github/workflows/manual-publish.yml)

## 4. Create a CI non-release workflow for just the project

You will add a file in the `.github/workflows` directory that tells GHA (mostly) how to
test your SDK. Below is a simple template to get started:
```
name: sdk/YOUR_SDK

on:
push:
branches: [main, 'feat/**']
paths-ignore:
- '**.md'
pull_request:
branches: [main, 'feat/**']
paths-ignore:
- '**.md'

jobs:
build-test-YOUR_SDK:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
registry-url: 'https://registry.npmjs.org'
- id: shared
name: Shared CI Steps
uses: ./actions/ci
with:
workspace_name: YOUR_PACKAGE_NAME
workspace_path: PATH_TO_YOUR_PACKAGE
```
> ![TIP]
> you should test your configuration on [your local machine](../.github/CI_CONTRIBUTING.md) if
> possible.

<!-- TODO document the stable release phase --->
7 changes: 2 additions & 5 deletions packages/sdk/shopify-oxygen/tsconfig.ref.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{
"extends": "../../../tsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"composite": true,
"rootDir": ".",
"outDir": "dist"
},
"include": ["src/**/*.ts"],
"exclude": ["**/*.test.ts", "dist", "node_modules", "__tests__", "example"]
"include": ["src/**/*", "package.json"],
}
5 changes: 5 additions & 0 deletions packages/sdk/shopify-oxygen/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": ["../../../typedoc.base.json"],
"entryPoints": ["src/index.ts"],
"out": "docs"
}
8 changes: 8 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
"bump-minor-pre-major": true,
"prerelease": true
},
"packages/sdk/shopify-oxygen": {
"bump-minor-pre-major": true,
"release-as": "0.1.0",
"bootstrap-sha": "e70e4846d03f7ca2b6ef267efa90a24810e9364a",
"extra-files": [
"src/platform/OxygenInfo.ts"
]
},
"packages/shared/common": {},
"packages/shared/sdk-client": {},
"packages/shared/sdk-server": {},
Expand Down
3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@
},
{
"path": "./packages/ai-providers/server-ai-vercel/tsconfig.ref.json"
},
{
"path": "./packages/sdk/shopify-oxygen/tsconfig.ref.json"
}
]
}