-
-
Notifications
You must be signed in to change notification settings - Fork 6
feat: adding a npm package #53
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
Open
MathurAditya724
wants to merge
9
commits into
main
Choose a base branch
from
feat/package
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d49212e
feat: added package and build info
MathurAditya724 9ce0fba
fix: minor changes
MathurAditya724 2f4ca2a
chore: minor changes
MathurAditya724 14221ea
fix: updated the gitignore file
MathurAditya724 30dbb1a
Update .craft.yml
MathurAditya724 6bdc40d
Update .craft.yml
MathurAditya724 f45e38b
fix: using node inplace of bun in pre release script
MathurAditya724 aa1f419
chore: minor fix
MathurAditya724 98c5b79
fix: removed bun install step
MathurAditya724 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
MathurAditya724 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## 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. | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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", | ||
| }); | ||
MathurAditya724 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| // Building the package | ||
| exec("bun run build"); | ||
| } | ||
|
|
||
| main(); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.