Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
31b96cc
Create jsr.json
yusinto Mar 21, 2024
c39756b
fix: Added explicit return types.
yusinto Mar 22, 2024
ca2cf35
Merge branch 'main' into yus/sc-236785/investigate-publishing-to-jsr
yusinto Mar 22, 2024
05353a3
fix: Include jsr.json when publishing.
yusinto Mar 22, 2024
0303885
Merge branch 'main' into yus/sc-236785/investigate-publishing-to-jsr
yusinto Mar 26, 2024
cde1ba4
fix: Modify package.json import to resolve esbuild error. Update esbu…
yusinto Mar 28, 2024
2c305ca
chore: Added jsr registry to npmrc and yarnrc.
yusinto Mar 28, 2024
fba552a
Update .prettierrc
yusinto Mar 28, 2024
af96d82
Update .gitignore
yusinto Mar 28, 2024
8f06f60
Update jsr.json
yusinto Mar 28, 2024
5e014f8
Update package.json
yusinto Mar 28, 2024
4c20848
Merge branch 'main' into yus/sc-236785/investigate-publishing-to-jsr
yusinto Apr 1, 2024
e588616
fix: Prettier ignore import assert.
yusinto Apr 1, 2024
cc7f0dc
fix: ts-ignore for import assertion because ts-jest errors.
yusinto Apr 1, 2024
b416c41
chore: Corrected example sdk key. Updated example README.
yusinto Apr 1, 2024
117363c
chore: Added jsr instructions.
yusinto Apr 1, 2024
a7d7dae
chore: Reverted example cf sdk version.
yusinto Apr 1, 2024
4fdab2a
chore: Minor readme and version updates after testing.
yusinto Apr 1, 2024
55feca3
Delete .npmrc
yusinto Apr 1, 2024
9c9ca3c
chore: Remove trailingCommas setting because its redundant.
yusinto Apr 1, 2024
4b29910
Update package.json
yusinto Apr 1, 2024
f2cbc4f
chore: Replace all instances of sdkKey with clientSideID.
yusinto Apr 1, 2024
a03c457
chore: Added extra files for cloudflare.
yusinto Apr 1, 2024
467b807
Merge branch 'main' into yus/sc-238808/release-please-to-jsr
yusinto Apr 8, 2024
3e66793
Merge branch 'main' into yus/sc-238808/release-please-to-jsr
yusinto Apr 10, 2024
9338fb3
chore: Initial naive attempt to publish to jsr.
yusinto Apr 10, 2024
8b71917
Merge branch 'main' into yus/sc-238808/release-please-to-jsr
yusinto Apr 12, 2024
544a533
feat: Support publishing to jsr.
yusinto Apr 12, 2024
920b848
chore: Independent jsr publishing scripts.
yusinto Apr 15, 2024
e45bbfb
Update release-please.yml
yusinto Apr 15, 2024
cbb856a
Update publish-jsr.sh
yusinto Apr 15, 2024
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
25 changes: 21 additions & 4 deletions .github/workflows/manual-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ name: Publish Package
on:
workflow_dispatch:
inputs:
package_registry:
description: 'Publish to'
required: true
default: 'npm'
type: choice
options:
- npm
- jsr
workspace_path:
description: 'The workspace to publish'
required: true
Expand Down Expand Up @@ -39,8 +47,8 @@ jobs:
id-token: write
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16.x
registry-url: 'https://registry.npmjs.org'
Expand Down Expand Up @@ -81,8 +89,17 @@ jobs:
yarn config set npmScopes.launchdarkly.npmRegistryServer "https://registry.npmjs.org"
yarn config set npmScopes.launchdarkly.npmAlwaysAuth true
yarn config set npmScopes.launchdarkly.npmAuthToken $NODE_AUTH_TOKEN
- id: publish
name: Publish Package
- id: publish-jsr
name: Publish Package to jsr
if: ${{ inputs.package_registry == 'jsr' }}
uses: ./actions/publish-jsr
with:
workspace_name: ${{ env.WORKSPACE_NAME }}
workspace_path: ${{ inputs.workspace_path }}
dry_run: ${{ inputs.dry_run }}
- id: publish-npm
name: Publish Package to npm
if: ${{ inputs.package_registry == 'npm' }}
uses: ./actions/publish
with:
workspace_name: ${{ env.WORKSPACE_NAME }}
Expand Down
5 changes: 5 additions & 0 deletions actions/full-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ runs:
yarn config set npmScopes.launchdarkly.npmRegistryServer "https://registry.npmjs.org"
yarn config set npmScopes.launchdarkly.npmAlwaysAuth true
yarn config set npmScopes.launchdarkly.npmAuthToken $NODE_AUTH_TOKEN
- uses: ./actions/publish-jsr
with:
workspace_name: ${{ env.WORKSPACE_NAME }}
workspace_path: ${{ inputs.workspace_path }}
dry_run: false
- uses: ./actions/publish
with:
workspace_name: ${{ env.WORKSPACE_NAME }}
Expand Down
25 changes: 25 additions & 0 deletions actions/publish-jsr/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish to jsr
description: Publish a package to jsr from the workspace.
inputs:
workspace_name:
description: 'The workspace to publish'
required: true
workspace_path:
description: 'Path to the workspace (for jsr publish)'
required: true
dry_run:
description: 'Is this a dry run. If so no package will be published.'
required: true

runs:
using: composite
steps:
- name: Publish jsr
shell: bash
run: |
echo "Publishing jsr: $WORKSPACE"
./scripts/publish-jsr.sh
env:
WORKSPACE: ${{ inputs.workspace_name }}
WORKSPACE_PATH: ${{ inputs.workspace_path }}
LD_RELEASE_IS_DRYRUN: ${{ inputs.dry_run }}
10 changes: 9 additions & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@
"packages/shared/sdk-server": {},
"packages/shared/sdk-server-edge": {},
"packages/shared/akamai-edgeworker-sdk": {},
"packages/sdk/cloudflare": {},
"packages/sdk/cloudflare": {
"extra-files": [
{
"type": "json",
"path": "jsr.json",
"jsonpath": "$.version"
}
]
},
"packages/sdk/react-native": {},
"packages/sdk/server-node": {},
"packages/sdk/vercel": {
Expand Down
14 changes: 14 additions & 0 deletions scripts/publish-jsr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

if [ -f "./$WORKSPACE_PATH/jsr.json" ]; then
yarn workspace $WORKSPACE pack
cd $WORKSPACE_PATH

if $LD_RELEASE_IS_DRYRUN ; then
echo "Doing a dry run of jsr publishing."
npx jsr publish --dry-run || { echo "jsr publish failed" >&2; exit 1; }
elif [ -f "./$WORKSPACE_PATH/jsr.json" ]; then
echo "Publishing to jsr."
npx jsr publish || { echo "jsr publish failed" >&2; exit 1; }
fi
fi