Skip to content
Open
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
7 changes: 7 additions & 0 deletions .craft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
minVersion: "2.19.0"
changelog:
policy: auto
preReleaseCommand: node --experimental-strip-types scripts/pre-release.ts
targets:
- name: npm
- name: github
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release

on:
push:
branches:
- main
paths:
- "openapi-derefed.json"
workflow_dispatch:
inputs:
version:
description: Version to release
required: true
force:
description: Force release
default: false
type: boolean
merge_target:
description: Merge target branch
required: false

permissions:
contents: write
pull-requests: write

jobs:
release:
runs-on: ubuntu-latest
name: Release a new version
steps:
- name: Get auth token
id: token
uses: actions/create-github-app-token@v2.2.1
with:
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}

- uses: actions/checkout@v6
with:
token: ${{ steps.token.outputs.token }}
fetch-depth: 0

- name: Prepare release
uses: getsentry/craft@v2
env:
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
with:
version: ${{ inputs.version }}
force: ${{ inputs.force }}
merge_target: ${{ inputs.merge_target }}
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# dependencies (bun install)
node_modules

# output
dist

# code coverage
coverage
*.lcov

# logs
logs
_.log
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# caches
.eslintcache
.cache

# IntelliJ based IDEs
.idea

# Finder (MacOS) folder config
.DS_Store
105 changes: 105 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Functional Source License, Version 1.1, Apache 2.0 Future License

## Abbreviation

FSL-1.1-Apache-2.0

## Notice

Copyright 2025 Functional Software, Inc. dba Sentry

## Terms and Conditions

### Licensor ("We")

The party offering the Software under these Terms and Conditions.

### The Software

The "Software" is each version of the software that we make available under
these Terms and Conditions, as indicated by our inclusion of these Terms and
Conditions with the Software.

### License Grant

Subject to your compliance with this License Grant and the Patents,
Redistribution and Trademark clauses below, we hereby grant you the right to
use, copy, modify, create derivative works, publicly perform, publicly display
and redistribute the Software for any Permitted Purpose identified below.

### Permitted Purpose

A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
means making the Software available to others in a commercial product or
service that:

1. substitutes for the Software;

2. substitutes for any other product or service we offer using the Software
that exists as of the date we make the Software available; or

3. offers the same or substantially similar functionality as the Software.

Permitted Purposes specifically include using the Software:

1. for your internal use and access;

2. for non-commercial education;

3. for non-commercial research; and

4. in connection with professional services that you provide to a licensee
using the Software in accordance with these Terms and Conditions.

### Patents

To the extent your use for a Permitted Purpose would necessarily infringe our
patents, the license grant above includes a license under our patents. If you
make a claim against any party that the Software infringes or contributes to
the infringement of any patent, then your patent license to the Software ends
immediately.

### Redistribution

The Terms and Conditions apply to all copies, modifications and derivatives of
the Software.

If you redistribute any copies, modifications or derivatives of the Software,
you must include a copy of or a link to these Terms and Conditions and not
remove any copyright notices provided in or with the Software.

### Disclaimer

THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.

IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.

### Trademarks

Except for displaying the License Details and identifying us as the origin of
the Software, you have no right under these Terms and Conditions to use our
trademarks, trade names, service marks or product names.

## Grant of Future License

We hereby irrevocably grant you an additional license to use the Software under
the Apache License, Version 2.0 that is effective on the second anniversary of
the date we make the Software available. On or after that date, you may use the
Software under the Apache License, Version 2.0, in which case the following
will apply:

Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License.

You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
127 changes: 127 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "@sentry/api",
"version": "0.1.0",
"description": "Sentry API Client",
"license": "FSL-1.1-Apache-2.0",
"type": "module",
"files": [
"dist"
],
"repository": {
"type": "git",
"url": "https://github.com/getsentry/sentry-api-schema.git"
},
"scripts": {
"build": "bun build src/index.ts --outdir dist && tsc --emitDeclarationOnly"
},
"exports": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"devDependencies": {
"@hey-api/openapi-ts": "0.91.1",
"@types/node": "^22",
"typescript": "^5.9.3"
},
"engines": {
"node": ">=22"
},
"packageManager": "bun@1.3.3"
}
33 changes: 33 additions & 0 deletions scripts/pre-release.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { execSync } from "node:child_process";
import { createClient } from "@hey-api/openapi-ts";

/**
* Execute a shell command with output inherited to stdout/stderr
*/
function exec(command: string): void {
execSync(command, { stdio: "inherit" });
}

async function main() {
const version = process.env.CRAFT_NEW_VERSION;
if (!version) {
console.error("Error: CRAFT_NEW_VERSION environment variable is required");
process.exit(1);
}

console.log(`Setting version to ${version}`);

// Update package.json via npm (handles formatting consistently)
exec(`npm --no-git-tag-version version ${version}`);

// Generate the API client
await createClient({
input: "./openapi-derefed.json",
output: "src",
});

// Building the package
exec("bun run build");
}

main();
Loading