Skip to content
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

chore(publish): Publish NPM packages in order of dependency tree #8579

Merged
merged 3 commits into from
Jul 19, 2023
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
109 changes: 108 additions & 1 deletion .craft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,107 @@ minVersion: '0.23.1'
changelogPolicy: simple
preReleaseCommand: bash scripts/craft-pre-release.sh
targets:
# NPM Targets
## 1. Base Packages, node or browser SDKs depend on
## 1.1 Types
- name: npm
id: "@sentry/types"
includeNames: /^sentry-types-\d.*\.tgz$/
## 1.2 Utils
- name: npm
id: "@sentry/utils"
includeNames: /^sentry-utils-\d.*\.tgz$/
## 1.3 Core SDK
- name: npm
id: "@sentry/core"
includeNames: /^sentry-core-\d.*\.tgz$/
## 1.4 Tracing package
- name: npm
id: "@sentry-internal/tracing"
includeNames: /^sentry-internal-tracing-\d.*\.tgz$/
## 1.5 Replay package (browser only)
- name: npm
id: "@sentry/replay"
includeNames: /^sentry-replay-\d.*\.tgz$/

## 2. Browser & Node SDKs
- name: npm
id: "@sentry/browser"
includeNames: /^sentry-browser-\d.*\.tgz$/
- name: npm
id: "@sentry/node"
includeNames: /^sentry-node-\d.*\.tgz$/

## 3 Browser-based Packages
- name: npm
id: "@sentry/angular-ivy"
includeNames: /^sentry-angular-ivy-\d.*\.tgz$/
- name: npm
id: "@sentry/angular"
includeNames: /^sentry-angular-\d.*\.tgz$/
- name: npm
id: "@sentry/ember"
includeNames: /^sentry-ember-\d.*\.tgz$/
- name: npm
id: "@sentry/react"
includeNames: /^sentry-react-\d.*\.tgz$/
- name: npm
id: "@sentry/svelte"
includeNames: /^sentry-svelte-\d.*\.tgz$/
- name: npm
id: "@sentry/vue"
includeNames: /^sentry-vue-\d.*\.tgz$/
- name: npm
id: "@sentry/wasm"
includeNames: /^sentry-wasm-\d.*\.tgz$/
- name: npm
id: "@sentry/integrations"
includeNames: /^sentry-integrations-\d.*\.tgz$/

## 4. Node-based Packages
- name: npm
id: "@sentry/serverless"
includeNames: /^sentry-serverless-\d.*\.tgz$/
- name: npm
id: "@sentry/opentelemetry-node"
includeNames: /^sentry-opentelemetry-node-\d.*\.tgz$/

## 5. Fullstack/Meta Frameworks (depending on Node and Browser or Framework SDKs)
- name: npm
id: "@sentry/nextjs"
includeNames: /^sentry-nextjs-\d.*\.tgz$/
- name: npm
id: "@sentry/remix"
includeNames: /^sentry-remix-\d.*\.tgz$/
- name: npm
id: "@sentry/sveltekit"
includeNames: /^sentry-sveltekit-\d.*\.tgz$/
- name: npm
id: "@sentry/gatsby"
includeNames: /^sentry-gatsby-\d.*\.tgz$/

## 6. Other Packages
## 6.1
- name: npm
id: "@sentry-internal/typescript"
includeNames: /^sentry-internal-typescript-\d.*\.tgz$/
- name: npm
id: "@sentry-internal/eslint-plugin-sdk"
includeNames: /^sentry-internal-eslint-plugin-sdk-\d.*\.tgz$/
## 6.2
- name: npm
id: "@sentry-internal/eslint-config-sdk"
includeNames: /^sentry-internal-eslint-config-sdk-\d.*\.tgz$/

## 7. Deprecated packages we still release (but no packages depend on them anymore)
- name: npm
id: "@sentry/hub"
includeNames: /^sentry-hub-\d.*\.tgz$/
- name: npm
id: "@sentry/tracing"
includeNames: /^sentry-tracing-\d.*\.tgz$/

# AWS Lambda Layer target
- name: aws-lambda-layer
includeNames: /^sentry-node-serverless-\d+.\d+.\d+(-(beta|alpha)\.\d+)?\.zip$/
layerName: SentryNodeServerlessSDK
Expand All @@ -14,16 +115,22 @@ targets:
- nodejs16.x
- nodejs18.x
license: MIT

# CDN Bundle Target
- name: gcs
id: "browser-cdn-bundles"
Copy link
Member Author

Choose a reason for hiding this comment

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

Decided to also give this an id, as it's not apparent that this target uploads the CDN bundles

includeNames: /.*\.js.*$/
bucket: sentry-js-sdk
paths:
- path: /{{version}}/
metadata:
cacheControl: 'public, max-age=31536000'

# Github Release Target
- name: github
includeNames: /^sentry-.*$/
- name: npm

# Sentry Release Registry Target
- name: registry
sdks:
'npm:@sentry/browser':
Expand Down
9 changes: 7 additions & 2 deletions docs/new-sdk-release-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,13 @@ When you’re ready to make the first release, there are a couple of steps that
- [ ] 1) If not yet done, be sure to remove the `private: true` property from your SDK’s `package.json`. Additionally, ensure that `"publishConfig": {"access": "public"}` is set.
- [ ] 2) Make sure that the new SDK is **not added** in`[craft.yml](https://github.com/getsentry/sentry-javascript/blob/master/.craft.yml)` as a target for the **Sentry release registry**\
*Once this is added, craft will try to publish an entry in the next release which does not work and caused failed release runs in the past*
- [ ] 3) Make sure the new SDK is not excluded from the github & npm targets in `.craft.yml`
- [ ] 4) Cut a new release (as usual, via GH release action and Craft)
- [ ] 3) Add an `npm` target in `craft.yml` for the new package. Make sure to insert it in the right place, after all the Sentry dependencies of your package but before packages that depend on your new package (if applicable).
```yml
- name: npm
id: npm:@sentry/[yourPackage]
includeNames: /^sentry-[yourPackage]-\d.*\.tgz$/
```
- [ ] 4) Cut a new release (as usual, see [Publishing Release](https://github.com/getsentry/sentry-javascript/blob/develop/docs/publishing-a-release.md))

### After the Release

Expand Down