Skip to content

Commit 9108950

Browse files
release: 0.6.1 (#70)
* chore(internal): version bump * fix: publish script — handle NPM errors correctly * chore(internal): add pure annotations, make base APIResource abstract * release: 0.6.1 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 0af11b6 commit 9108950

File tree

14 files changed

+72
-27
lines changed

14 files changed

+72
-27
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.6.0"
2+
".": "0.6.1"
33
}

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## 0.6.1 (2025-06-14)
4+
5+
Full Changelog: [v0.6.0...v0.6.1](https://github.com/gitpod-io/gitpod-sdk-typescript/compare/v0.6.0...v0.6.1)
6+
7+
### Bug Fixes
8+
9+
* publish script — handle NPM errors correctly ([be3283b](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/be3283b4cfb44646b33bf364fb5380d3a226f6a0))
10+
11+
12+
### Chores
13+
14+
* **internal:** add pure annotations, make base APIResource abstract ([e489880](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/e48988064ee76b254985960b3c8c7c649d47398e))
15+
* **internal:** version bump ([94014af](https://github.com/gitpod-io/gitpod-sdk-typescript/commit/94014af9bfcfcf6e676dcc7934687db8704b429f))
16+
317
## 0.6.0 (2025-06-06)
418

519
Full Changelog: [v0.5.0...v0.6.0](https://github.com/gitpod-io/gitpod-sdk-typescript/compare/v0.5.0...v0.6.0)

bin/publish-npm

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,35 @@ npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN"
77
yarn build
88
cd dist
99

10+
# Get package name and version from package.json
11+
PACKAGE_NAME="$(jq -r -e '.name' ./package.json)"
12+
VERSION="$(jq -r -e '.version' ./package.json)"
13+
1014
# Get latest version from npm
1115
#
12-
# If the package doesn't exist, yarn will return
13-
# {"type":"error","data":"Received invalid response from npm."}
14-
# where .data.version doesn't exist so LAST_VERSION will be an empty string.
15-
LAST_VERSION="$(yarn info --json 2> /dev/null | jq -r '.data.version')"
16-
17-
# Get current version from package.json
18-
VERSION="$(node -p "require('./package.json').version")"
16+
# If the package doesn't exist, npm will return:
17+
# {
18+
# "error": {
19+
# "code": "E404",
20+
# "summary": "Unpublished on 2025-06-05T09:54:53.528Z",
21+
# "detail": "'the_package' is not in this registry..."
22+
# }
23+
# }
24+
NPM_INFO="$(npm view "$PACKAGE_NAME" version --json 2>/dev/null || true)"
25+
26+
# Check if we got an E404 error
27+
if echo "$NPM_INFO" | jq -e '.error.code == "E404"' > /dev/null 2>&1; then
28+
# Package doesn't exist yet, no last version
29+
LAST_VERSION=""
30+
elif echo "$NPM_INFO" | jq -e '.error' > /dev/null 2>&1; then
31+
# Report other errors
32+
echo "ERROR: npm returned unexpected data:"
33+
echo "$NPM_INFO"
34+
exit 1
35+
else
36+
# Success - get the version
37+
LAST_VERSION=$(echo "$NPM_INFO" | jq -r '.') # strip quotes
38+
fi
1939

2040
# Check if current version is pre-release (e.g. alpha / beta / rc)
2141
CURRENT_IS_PRERELEASE=false

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gitpod/sdk",
3-
"version": "0.6.0",
3+
"version": "0.6.1",
44
"description": "The official TypeScript library for the Gitpod API",
55
"author": "Gitpod <dev-feedback@gitpod.com>",
66
"types": "dist/index.d.ts",
@@ -45,7 +45,7 @@
4545
"sshpk": "^1.18.0",
4646
"ts-jest": "^29.1.0",
4747
"ts-node": "^10.5.0",
48-
"tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.4/tsc-multi-1.1.4.tgz",
48+
"tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.7/tsc-multi.tgz",
4949
"tsconfig-paths": "^4.0.0",
5050
"typescript": "5.8.3",
5151
"typescript-eslint": "8.31.1"

scripts/build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fi
3131
node scripts/utils/make-dist-package-json.cjs > dist/package.json
3232

3333
# build to .js/.mjs/.d.ts files
34-
npm exec tsc-multi
34+
./node_modules/.bin/tsc-multi
3535
# we need to patch index.js so that `new module.exports()` works for cjs backwards
3636
# compat. No way to get that from index.ts because it would cause compile errors
3737
# when building .mjs

src/core/resource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import type { Gitpod } from '../client';
44

5-
export class APIResource {
5+
export abstract class APIResource {
66
protected _client: Gitpod;
77

88
constructor(client: Gitpod) {

src/internal/headers.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
import { isReadonlyArray } from './utils/values';
4+
35
type HeaderValue = string | undefined | null;
46
export type HeadersLike =
57
| Headers
@@ -9,7 +11,7 @@ export type HeadersLike =
911
| null
1012
| NullableHeaders;
1113

12-
const brand_privateNullableHeaders = Symbol('brand.privateNullableHeaders');
14+
const brand_privateNullableHeaders = /* @__PURE__ */ Symbol('brand.privateNullableHeaders');
1315

1416
/**
1517
* @internal
@@ -25,8 +27,6 @@ export type NullableHeaders = {
2527
nulls: Set<string>;
2628
};
2729

28-
const isArray = Array.isArray as (val: unknown) => val is readonly unknown[];
29-
3030
function* iterateHeaders(headers: HeadersLike): IterableIterator<readonly [string, string | null]> {
3131
if (!headers) return;
3232

@@ -43,7 +43,7 @@ function* iterateHeaders(headers: HeadersLike): IterableIterator<readonly [strin
4343
let iter: Iterable<readonly (HeaderValue | readonly HeaderValue[])[]>;
4444
if (headers instanceof Headers) {
4545
iter = headers.entries();
46-
} else if (isArray(headers)) {
46+
} else if (isReadonlyArray(headers)) {
4747
iter = headers;
4848
} else {
4949
shouldClear = true;
@@ -52,7 +52,7 @@ function* iterateHeaders(headers: HeadersLike): IterableIterator<readonly [strin
5252
for (let row of iter) {
5353
const name = row[0];
5454
if (typeof name !== 'string') throw new TypeError('expected header name to be a string');
55-
const values = isArray(row[1]) ? row[1] : [row[1]];
55+
const values = isReadonlyArray(row[1]) ? row[1] : [row[1]];
5656
let didClear = false;
5757
for (const value of values) {
5858
if (value === undefined) continue;

src/internal/uploads.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export const multipartFormRequestOptions = async (
9090
return { ...opts, body: await createForm(opts.body, fetch) };
9191
};
9292

93-
const supportsFormDataMap = new WeakMap<Fetch, Promise<boolean>>();
93+
const supportsFormDataMap = /** @__PURE__ */ new WeakMap<Fetch, Promise<boolean>>();
9494

9595
/**
9696
* node-fetch doesn't support the global FormData object in recent node versions. Instead of sending
@@ -138,7 +138,7 @@ export const createForm = async <T = Record<string, unknown>>(
138138

139139
// We check for Blob not File because Bun.File doesn't inherit from File,
140140
// but they both inherit from Blob and have a `name` property at runtime.
141-
const isNamedBlob = (value: object) => value instanceof Blob && 'name' in value;
141+
const isNamedBlob = (value: unknown) => value instanceof Blob && 'name' in value;
142142

143143
const isUploadable = (value: unknown) =>
144144
typeof value === 'object' &&

src/internal/utils/log.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const noopLogger = {
5858
debug: noop,
5959
};
6060

61-
let cachedLoggers = new WeakMap<Logger, [LogLevel, Logger]>();
61+
let cachedLoggers = /** @__PURE__ */ new WeakMap<Logger, [LogLevel, Logger]>();
6262

6363
export function loggerFor(client: Gitpod): Logger {
6464
const logger = client.logger;

src/internal/utils/path.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ export const createPathTagFunction = (pathEncoder = encodeURIPath) =>
6060
/**
6161
* URI-encodes path params and ensures no unsafe /./ or /../ path segments are introduced.
6262
*/
63-
export const path = createPathTagFunction(encodeURIPath);
63+
export const path = /* @__PURE__ */ createPathTagFunction(encodeURIPath);

0 commit comments

Comments
 (0)