Skip to content

Commit 759e63e

Browse files
authored
ci: adding pre-release ci for oxygen sdk (#992)
This PR will add initial CI for pre-releasing the LD Shopify Oxygen SDK. Additional changes: - fixed minor typo in docs - added to CI_CONTRIBUTING docs for the pre-release process <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Sets up CI, release/publish config, and docs for the new Shopify Oxygen SDK. > > - **CI/Workflows**: > - Add `sdk/shopify-oxygen` workflow (`.github/workflows/shopify-oxygen.yml`) for build/test. > - Include `packages/sdk/shopify-oxygen` in manual publish workflows (`manual-publish*.yml`). > - **Release Configuration**: > - Add `packages/sdk/shopify-oxygen` to `.release-please-manifest.json` as `0.0.0`. > - Configure `release-please-config.json` for Shopify Oxygen (pre-1.0 settings, `release-as: 0.1.0`, `bootstrap-sha`, `extra-files`). > - **Package Setup**: > - Add TypeScript project reference (`tsconfig.json`) and adjust package `tsconfig.ref.json` to extend local config. > - Add `typedoc.json` for docs generation in `packages/sdk/shopify-oxygen`. > - **Docs**: > - Add `contributing/publishing.md` and link from `CONTRIBUTING.md`; fix "Dependencies" heading typo. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 9a544cc. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 6ffacc3 commit 759e63e

File tree

11 files changed

+144
-27
lines changed

11 files changed

+144
-27
lines changed

.github/workflows/manual-publish-docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ on:
2424
- packages/sdk/server-ai
2525
- packages/telemetry/browser-telemetry
2626
- packages/sdk/combined-browser
27+
- packages/sdk/shopify-oxygen
2728
name: Publish Documentation
2829
jobs:
2930
build-publish:

.github/workflows/manual-publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ on:
4040
- packages/ai-providers/server-ai-langchain
4141
- packages/telemetry/browser-telemetry
4242
- packages/sdk/combined-browser
43+
- packages/sdk/shopify-oxygen
4344
prerelease:
4445
description: 'Is this a prerelease. If so, then the latest tag will not be updated in npm.'
4546
type: boolean
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: sdk/shopify-oxygen
2+
3+
on:
4+
push:
5+
branches: [main, 'feat/**']
6+
paths-ignore:
7+
- '**.md'
8+
pull_request:
9+
branches: [main, 'feat/**']
10+
paths-ignore:
11+
- '**.md'
12+
13+
jobs:
14+
build-test-shopify-oxygen:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-node@v4
19+
with:
20+
# https://shopify.dev/docs/storefronts/headless/hydrogen/getting-started#requirements
21+
node-version: lts/*
22+
registry-url: 'https://registry.npmjs.org'
23+
- id: shared
24+
name: Shared CI Steps
25+
uses: ./actions/ci
26+
with:
27+
workspace_name: '@launchdarkly/shopify-oxygen-sdk'
28+
workspace_path: packages/sdk/shopify-oxygen

.release-please-manifest.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@
2121
"packages/store/node-server-sdk-redis": "4.2.14",
2222
"packages/telemetry/browser-telemetry": "1.0.11",
2323
"packages/telemetry/node-server-sdk-otel": "1.3.2",
24-
"packages/tooling/jest": "0.1.12"
24+
"packages/tooling/jest": "0.1.12",
25+
"packages/sdk/shopify-oxygen": "0.0.0"
2526
}

CONTRIBUTING.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ describe('given a mock filesystem and memory feature store', { /* tests */})
6969
These then combined to create an understandable test name:
7070
`given a mock filesystem and memory feature store > it does not load flags prior to start`
7171
72+
---
73+
For docs on our module publishing process, see [our publishing doc](contributing/publishing.md)
74+
7275
## Development Guidelines
7376
7477
These are a series of recommendations for developing code in this repository. Not all existing code will comply
@@ -235,7 +238,7 @@ There are a number of categories of packages in the monorepo:
235238
5. **Tooling packages** (red): Development and testing tools
236239
- Jest testing utilities
237240

238-
### Depenencies
241+
### Dependencies
239242

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

contributing/initial-package-publish.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

contributing/publishing.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Publishing SDKs
2+
3+
Publishing a new SDK package in this monorepo typically happens in 2
4+
phases: initial package publishing phase and stable release phase.
5+
6+
> [!NOTE]
7+
> If you are moving an existing package to this monorepo, you should
8+
> still read through the [initial publishing](#initial-package-publishing)
9+
> and follow the relevant steps to initialize the CI implementation.
10+
11+
## Initial Package Publishing
12+
13+
When publishing a package for the first time, developers must complete several steps not part of a typical package release. This phase is
14+
designed to:
15+
1. Establish the CI implementation for the new package
16+
2. Generate pre-release builds for testing
17+
18+
### Step 1. Extend `release-please-config.json`
19+
20+
When doing the initial release, you will need to add a new record to
21+
[`release-please-config.json`](../release-please-config.json):
22+
```
23+
"packages/type/my-package": {
24+
"bump-minor-pre-major": true,
25+
"release-as": "0.1.0",
26+
"bootstrap-sha": "MY_SHA"
27+
}
28+
```
29+
> [!TIP]
30+
> `bump-minor-pre-major` only needs to be set if you are publishing
31+
> unstable releases (major version `0`). This option ensures that
32+
> breaking changes will only increment minor version.
33+
34+
> [!TIP]
35+
> `bootstrap-sha` will ensure that the conventional commits are
36+
> calculated from a certain point and not the whole package history.
37+
> You can find the appropriate commit sha using `git log`.
38+
39+
## 2. Add initial release manifest
40+
41+
Add the following to `.release-please-manifest.json`
42+
```
43+
"packages/type/my-package": "0.0.0"
44+
```
45+
46+
## 3. Add option to manual workflows
47+
48+
Add `PATH_TO_YOUR_PACKAGE` to the `on.workflow_dispatch.inputs.workspace_path.options`
49+
array in the following files:
50+
- [`manual-publish-docs.yml`](../.github/workflows/manual-publish-docs.yml)
51+
- [`manual-publish.yml`](../.github/workflows/manual-publish.yml)
52+
53+
## 4. Create a CI non-release workflow for just the project
54+
55+
You will add a file in the `.github/workflows` directory that tells GHA (mostly) how to
56+
test your SDK. Below is a simple template to get started:
57+
```
58+
name: sdk/YOUR_SDK
59+
60+
on:
61+
push:
62+
branches: [main, 'feat/**']
63+
paths-ignore:
64+
- '**.md'
65+
pull_request:
66+
branches: [main, 'feat/**']
67+
paths-ignore:
68+
- '**.md'
69+
70+
jobs:
71+
build-test-YOUR_SDK:
72+
runs-on: ubuntu-latest
73+
steps:
74+
- uses: actions/checkout@v4
75+
- uses: actions/setup-node@v4
76+
with:
77+
node-version: lts/*
78+
registry-url: 'https://registry.npmjs.org'
79+
- id: shared
80+
name: Shared CI Steps
81+
uses: ./actions/ci
82+
with:
83+
workspace_name: YOUR_PACKAGE_NAME
84+
workspace_path: PATH_TO_YOUR_PACKAGE
85+
```
86+
> ![TIP]
87+
> you should test your configuration on [your local machine](../.github/CI_CONTRIBUTING.md) if
88+
> possible.
89+
90+
<!-- TODO document the stable release phase --->
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
{
2-
"extends": "../../../tsconfig.json",
2+
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"composite": true,
5-
"rootDir": ".",
6-
"outDir": "dist"
75
},
8-
"include": ["src/**/*.ts"],
9-
"exclude": ["**/*.test.ts", "dist", "node_modules", "__tests__", "example"]
6+
"include": ["src/**/*", "package.json"],
107
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": ["../../../typedoc.base.json"],
3+
"entryPoints": ["src/index.ts"],
4+
"out": "docs"
5+
}

release-please-config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
"bump-minor-pre-major": true,
1313
"prerelease": true
1414
},
15+
"packages/sdk/shopify-oxygen": {
16+
"bump-minor-pre-major": true,
17+
"release-as": "0.1.0",
18+
"bootstrap-sha": "e70e4846d03f7ca2b6ef267efa90a24810e9364a",
19+
"extra-files": [
20+
"src/platform/OxygenInfo.ts"
21+
]
22+
},
1523
"packages/shared/common": {},
1624
"packages/shared/sdk-client": {},
1725
"packages/shared/sdk-server": {},

0 commit comments

Comments
 (0)