Skip to content

Commit 155613f

Browse files
authored
Merge pull request #2 from onkernel/release-please--branches--main--changes--next--components--sdk
release: 0.1.0-alpha.1
2 parents bc19eee + d2073dd commit 155613f

25 files changed

+223
-54
lines changed

.github/workflows/publish-npm.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This workflow is triggered when a GitHub release is created.
2+
# It can also be run manually to re-publish to NPM in case it failed for some reason.
3+
# You can run this workflow by navigating to https://www.github.com/onkernel/kernel-node-sdk/actions/workflows/publish-npm.yml
4+
name: Publish NPM
5+
on:
6+
workflow_dispatch:
7+
8+
release:
9+
types: [published]
10+
11+
jobs:
12+
publish:
13+
name: publish
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Node
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: '20'
23+
24+
- name: Install dependencies
25+
run: |
26+
yarn install
27+
28+
- name: Publish to NPM
29+
run: |
30+
bash ./bin/publish-npm
31+
env:
32+
NPM_TOKEN: ${{ secrets.KERNEL_NPM_TOKEN || secrets.NPM_TOKEN }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Release Doctor
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
8+
jobs:
9+
release_doctor:
10+
name: release doctor
11+
runs-on: ubuntu-latest
12+
if: github.repository == 'onkernel/kernel-node-sdk' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Check release environment
18+
run: |
19+
bash ./bin/check-release-environment
20+
env:
21+
NPM_TOKEN: ${{ secrets.KERNEL_NPM_TOKEN || secrets.NPM_TOKEN }}

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.1.0-alpha.1"
3+
}

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 4
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-2a9a9232d72f52fc9b2404958857a1b744762356421cf1bffb99db2c24045378.yml
3-
openapi_spec_hash: ba3c6823319d99762e7e1c6a624bc2ed
4-
config_hash: e48b09ec26046e2b2ba98ad41ecbaf1c
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-e642528081bcfbb78b52900cb9b8b1407a9c7a8653c57ab021a79d4d52585695.yml
3+
openapi_spec_hash: 8d91d1ac100906977531a93b9f4ae380
4+
config_hash: 49c38455e0bcb05feb11399f9da1fb4f

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Changelog
2+
3+
## 0.1.0-alpha.1 (2025-05-08)
4+
5+
Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/onkernel/kernel-node-sdk/compare/v0.0.1-alpha.0...v0.1.0-alpha.1)
6+
7+
### Features
8+
9+
* **api:** update via SDK Studio ([68f457e](https://github.com/onkernel/kernel-node-sdk/commit/68f457eb0f66b5b243e682677b0fa34eee685853))
10+
11+
12+
### Chores
13+
14+
* configure new SDK language ([bc19eee](https://github.com/onkernel/kernel-node-sdk/commit/bc19eeeb0eea066f8ad69fd1f03038f839108a31))
15+
* update SDK settings ([c9c482c](https://github.com/onkernel/kernel-node-sdk/commit/c9c482c8ae564005abe75f46300cebea44c26f8f))
16+
* update SDK settings ([25c177f](https://github.com/onkernel/kernel-node-sdk/commit/25c177ff56b479a6389c79a72d696b4b0bef8f69))

CONTRIBUTING.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,25 @@ If you’d like to use the repository from source, you can either install from g
4242
To install via git:
4343

4444
```sh
45-
$ npm install git+ssh://[email protected]:stainless-sdks/kernel-typescript.git
45+
$ npm install git+ssh://[email protected]:onkernel/kernel-node-sdk.git
4646
```
4747

4848
Alternatively, to link a local copy of the repo:
4949

5050
```sh
5151
# Clone
52-
$ git clone https://www.github.com/stainless-sdks/kernel-typescript
53-
$ cd kernel-typescript
52+
$ git clone https://www.github.com/onkernel/kernel-node-sdk
53+
$ cd kernel-node-sdk
5454

5555
# With yarn
5656
$ yarn link
5757
$ cd ../my-package
58-
$ yarn link kernel
58+
$ yarn link @onkernel/sdk
5959

6060
# With pnpm
6161
$ pnpm link --global
6262
$ cd ../my-package
63-
$ pnpm link -—global kernel
63+
$ pnpm link -—global @onkernel/sdk
6464
```
6565

6666
## Running tests
@@ -91,3 +91,17 @@ To format and fix all lint issues automatically:
9191
```sh
9292
$ yarn fix
9393
```
94+
95+
## Publishing and releases
96+
97+
Changes made to this repository via the automated release PR pipeline should publish to npm automatically. If
98+
the changes aren't made through the automated pipeline, you may want to make releases manually.
99+
100+
### Publish with a GitHub workflow
101+
102+
You can release to package managers by using [the `Publish NPM` GitHub action](https://www.github.com/onkernel/kernel-node-sdk/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up.
103+
104+
### Publish manually
105+
106+
If you need to manually release a package, you can run the `bin/publish-npm` script with an `NPM_TOKEN` set on
107+
the environment.

README.md

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Kernel TypeScript API Library
22

3-
[![NPM version](https://img.shields.io/npm/v/kernel.svg)](https://npmjs.org/package/kernel) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/kernel)
3+
[![NPM version](https://img.shields.io/npm/v/@onkernel/sdk.svg)](https://npmjs.org/package/@onkernel/sdk) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@onkernel/sdk)
44

55
This library provides convenient access to the Kernel REST API from server-side TypeScript or JavaScript.
66

@@ -11,19 +11,16 @@ It is generated with [Stainless](https://www.stainless.com/).
1111
## Installation
1212

1313
```sh
14-
npm install git+ssh://[email protected]:stainless-sdks/kernel-typescript.git
14+
npm install @onkernel/sdk
1515
```
1616

17-
> [!NOTE]
18-
> Once this package is [published to npm](https://app.stainless.com/docs/guides/publish), this will become: `npm install kernel`
19-
2017
## Usage
2118

2219
The full API of this library can be found in [api.md](api.md).
2320

2421
<!-- prettier-ignore -->
2522
```js
26-
import Kernel from 'kernel';
23+
import Kernel from '@onkernel/sdk';
2724

2825
const client = new Kernel({
2926
apiKey: process.env['KERNEL_API_KEY'], // This is the default and can be omitted
@@ -48,7 +45,7 @@ This library includes TypeScript definitions for all request params and response
4845

4946
<!-- prettier-ignore -->
5047
```ts
51-
import Kernel from 'kernel';
48+
import Kernel from '@onkernel/sdk';
5249

5350
const client = new Kernel({
5451
apiKey: process.env['KERNEL_API_KEY'], // This is the default and can be omitted
@@ -79,7 +76,7 @@ Request parameters that correspond to file uploads can be passed in many differe
7976

8077
```ts
8178
import fs from 'fs';
82-
import Kernel, { toFile } from 'kernel';
79+
import Kernel, { toFile } from '@onkernel/sdk';
8380

8481
const client = new Kernel();
8582

@@ -238,7 +235,7 @@ The log level can be configured in two ways:
238235
2. Using the `logLevel` client option (overrides the environment variable if set)
239236

240237
```ts
241-
import Kernel from 'kernel';
238+
import Kernel from '@onkernel/sdk';
242239

243240
const client = new Kernel({
244241
logLevel: 'debug', // Show all log messages
@@ -266,7 +263,7 @@ When providing a custom logger, the `logLevel` option still controls which messa
266263
below the configured level will not be sent to your logger.
267264

268265
```ts
269-
import Kernel from 'kernel';
266+
import Kernel from '@onkernel/sdk';
270267
import pino from 'pino';
271268

272269
const logger = pino();
@@ -336,7 +333,7 @@ globalThis.fetch = fetch;
336333
Or pass it to the client:
337334

338335
```ts
339-
import Kernel from 'kernel';
336+
import Kernel from '@onkernel/sdk';
340337
import fetch from 'my-fetch';
341338

342339
const client = new Kernel({ fetch });
@@ -347,7 +344,7 @@ const client = new Kernel({ fetch });
347344
If you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)
348345

349346
```ts
350-
import Kernel from 'kernel';
347+
import Kernel from '@onkernel/sdk';
351348

352349
const client = new Kernel({
353350
fetchOptions: {
@@ -364,7 +361,7 @@ options to requests:
364361
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg" align="top" width="18" height="21"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>
365362

366363
```ts
367-
import Kernel from 'kernel';
364+
import Kernel from '@onkernel/sdk';
368365
import * as undici from 'undici';
369366

370367
const proxyAgent = new undici.ProxyAgent('http://localhost:8888');
@@ -378,7 +375,7 @@ const client = new Kernel({
378375
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg" align="top" width="18" height="21"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>
379376

380377
```ts
381-
import Kernel from 'kernel';
378+
import Kernel from '@onkernel/sdk';
382379

383380
const client = new Kernel({
384381
fetchOptions: {
@@ -390,7 +387,7 @@ const client = new Kernel({
390387
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg" align="top" width="18" height="21"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>
391388

392389
```ts
393-
import Kernel from 'npm:kernel';
390+
import Kernel from 'npm:@onkernel/sdk';
394391

395392
const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });
396393
const client = new Kernel({
@@ -412,7 +409,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con
412409

413410
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
414411

415-
We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/kernel-typescript/issues) with questions, bugs, or suggestions.
412+
We are keen for your feedback; please open an [issue](https://www.github.com/onkernel/kernel-node-sdk/issues) with questions, bugs, or suggestions.
416413

417414
## Requirements
418415

bin/check-release-environment

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
errors=()
4+
5+
if [ -z "${NPM_TOKEN}" ]; then
6+
errors+=("The KERNEL_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
7+
fi
8+
9+
lenErrors=${#errors[@]}
10+
11+
if [[ lenErrors -gt 0 ]]; then
12+
echo -e "Found the following errors in the release environment:\n"
13+
14+
for error in "${errors[@]}"; do
15+
echo -e "- $error\n"
16+
done
17+
18+
exit 1
19+
fi
20+
21+
echo "The environment is ready to push releases!"
22+

eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default tseslint.config(
2525
{
2626
patterns: [
2727
{
28-
regex: '^kernel(/.*)?',
28+
regex: '^@onkernel/sdk(/.*)?',
2929
message: 'Use a relative import, not a package import.',
3030
},
3131
],

jest.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ const config: JestConfigWithTsJest = {
77
'^.+\\.(t|j)sx?$': ['@swc/jest', { sourceMaps: 'inline' }],
88
},
99
moduleNameMapper: {
10-
'^kernel$': '<rootDir>/src/index.ts',
11-
'^kernel/(.*)$': '<rootDir>/src/$1',
10+
'^@onkernel/sdk$': '<rootDir>/src/index.ts',
11+
'^@onkernel/sdk/(.*)$': '<rootDir>/src/$1',
1212
},
1313
modulePathIgnorePatterns: [
1414
'<rootDir>/ecosystem-tests/',

0 commit comments

Comments
 (0)