diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml new file mode 100644 index 0000000..a0f266f --- /dev/null +++ b/.github/workflows/publish-npm.yml @@ -0,0 +1,32 @@ +# This workflow is triggered when a GitHub release is created. +# It can also be run manually to re-publish to NPM in case it failed for some reason. +# You can run this workflow by navigating to https://www.github.com/vlm-run/vlmrun-node-sdk/actions/workflows/publish-npm.yml +name: Publish NPM +on: + workflow_dispatch: + + release: + types: [published] + +jobs: + publish: + name: publish + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version: '18' + + - name: Install dependencies + run: | + yarn install + + - name: Publish to NPM + run: | + bash ./bin/publish-npm + env: + NPM_TOKEN: ${{ secrets.VLM_NPM_TOKEN || secrets.NPM_TOKEN }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 291c805..beb9bb2 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -18,4 +18,5 @@ jobs: run: | bash ./bin/check-release-environment env: + NPM_TOKEN: ${{ secrets.VLM_NPM_TOKEN || secrets.NPM_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index bc69e05..23d2695 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ Full Changelog: [v0.0.1-alpha.0...v0.0.1-alpha.1](https://github.com/vlm-run/vlm * **internal:** codegen related update ([bad9391](https://github.com/vlm-run/vlmrun-node-sdk/commit/bad93911df586d77a07c39975ea4cc8c234e5888)) * **internal:** fix some typos ([c85fff3](https://github.com/vlm-run/vlmrun-node-sdk/commit/c85fff3f218e51eeaf3b9b619806a11372f1495b)) * **internal:** fix some typos ([0645bb3](https://github.com/vlm-run/vlmrun-node-sdk/commit/0645bb3aa580503a158af8efd99f8113ab15b242)) +* update SDK settings ([#3](https://github.com/vlm-run/vlmrun-node-sdk/issues/3)) ([c372d79](https://github.com/vlm-run/vlmrun-node-sdk/commit/c372d79e19803ef3f414aaf384251e23fda841f9)) ### Documentation diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fbbf4b0..fa6c0ce 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -55,12 +55,12 @@ $ cd vlmrun-node-sdk # With yarn $ yarn link $ cd ../my-package -$ yarn link vlm +$ yarn link vlmrun # With pnpm $ pnpm link --global $ cd ../my-package -$ pnpm link -—global vlm +$ pnpm link -—global vlmrun ``` ## Running tests @@ -91,3 +91,17 @@ To format and fix all lint issues automatically: ```sh $ yarn fix ``` + +## Publishing and releases + +Changes made to this repository via the automated release PR pipeline should publish to npm automatically. If +the changes aren't made through the automated pipeline, you may want to make releases manually. + +### Publish with a GitHub workflow + +You can release to package managers by using [the `Publish NPM` GitHub action](https://www.github.com/vlm-run/vlmrun-node-sdk/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up. + +### Publish manually + +If you need to manually release a package, you can run the `bin/publish-npm` script with an `NPM_TOKEN` set on +the environment. diff --git a/README.md b/README.md index 6a42cd7..78b36a6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Vlm Node API Library -[![NPM version](https://img.shields.io/npm/v/vlm.svg)](https://npmjs.org/package/vlm) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/vlm) +[![NPM version](https://img.shields.io/npm/v/vlmrun.svg)](https://npmjs.org/package/vlmrun) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/vlmrun) This library provides convenient access to the Vlm REST API from server-side TypeScript or JavaScript. @@ -11,19 +11,16 @@ It is generated with [Stainless](https://www.stainlessapi.com/). ## Installation ```sh -npm install git+ssh://git@github.com:vlm-run/vlmrun-node-sdk.git +npm install vlmrun ``` -> [!NOTE] -> Once this package is [published to npm](https://app.stainlessapi.com/docs/guides/publish), this will become: `npm install vlm` - ## Usage The full API of this library can be found in [api.md](api.md). ```js -import Vlm from 'vlm'; +import Vlm from 'vlmrun'; const client = new Vlm(); @@ -42,7 +39,7 @@ This library includes TypeScript definitions for all request params and response ```ts -import Vlm from 'vlm'; +import Vlm from 'vlmrun'; const client = new Vlm(); @@ -212,11 +209,11 @@ add the following import before your first import `from "Vlm"`: ```ts // Tell TypeScript and the package to use the global web fetch instead of node-fetch. // Note, despite the name, this does not add any polyfills, but expects them to be provided if needed. -import 'vlm/shims/web'; -import Vlm from 'vlm'; +import 'vlmrun/shims/web'; +import Vlm from 'vlmrun'; ``` -To do the inverse, add `import "vlm/shims/node"` (which does import polyfills). +To do the inverse, add `import "vlmrun/shims/node"` (which does import polyfills). This can also be useful if you are getting the wrong TypeScript types for `Response` ([more details](https://github.com/vlm-run/vlmrun-node-sdk/tree/main/src/_shims#readme)). ### Logging and middleware @@ -226,7 +223,7 @@ which can be used to inspect or alter the `Request` or `Response` before/after e ```ts import { fetch } from 'undici'; // as one example -import Vlm from 'vlm'; +import Vlm from 'vlmrun'; const client = new Vlm({ fetch: async (url: RequestInfo, init?: RequestInit): Promise => { diff --git a/bin/check-release-environment b/bin/check-release-environment index 6b43775..27ed3c0 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -2,6 +2,10 @@ errors=() +if [ -z "${NPM_TOKEN}" ]; then + errors+=("The VLM_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") +fi + lenErrors=${#errors[@]} if [[ lenErrors -gt 0 ]]; then diff --git a/jest.config.ts b/jest.config.ts index 43a3fc7..b8358a1 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -7,9 +7,9 @@ const config: JestConfigWithTsJest = { '^.+\\.(t|j)sx?$': ['@swc/jest', { sourceMaps: 'inline' }], }, moduleNameMapper: { - '^vlm$': '/src/index.ts', - '^vlm/_shims/auto/(.*)$': '/src/_shims/auto/$1-node', - '^vlm/(.*)$': '/src/$1', + '^vlmrun$': '/src/index.ts', + '^vlmrun/_shims/auto/(.*)$': '/src/_shims/auto/$1-node', + '^vlmrun/(.*)$': '/src/$1', }, modulePathIgnorePatterns: [ '/ecosystem-tests/', diff --git a/package.json b/package.json index 96150bd..62a5618 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "vlm", + "name": "vlmrun", "version": "0.0.1-alpha.1", "description": "The official TypeScript library for the Vlm API", "author": "Vlm ", @@ -59,8 +59,8 @@ "./shims/web.mjs" ], "imports": { - "vlm": ".", - "vlm/*": "./src/*" + "vlmrun": ".", + "vlmrun/*": "./src/*" }, "exports": { "./_shims/auto/*": { diff --git a/scripts/build b/scripts/build index 98990a8..3415107 100755 --- a/scripts/build +++ b/scripts/build @@ -8,7 +8,7 @@ node scripts/utils/check-version.cjs # Build into dist and will publish the package from there, # so that src/resources/foo.ts becomes /resources/foo.js -# This way importing from `"vlm/resources/foo"` works +# This way importing from `"vlmrun/resources/foo"` works # even with `"moduleResolution": "node"` rm -rf dist; mkdir dist @@ -47,8 +47,8 @@ node scripts/utils/postprocess-files.cjs # make sure that nothing crashes when we require the output CJS or # import the output ESM -(cd dist && node -e 'require("vlm")') -(cd dist && node -e 'import("vlm")' --input-type=module) +(cd dist && node -e 'require("vlmrun")') +(cd dist && node -e 'import("vlmrun")' --input-type=module) if [ -e ./scripts/build-deno ] then diff --git a/scripts/utils/postprocess-files.cjs b/scripts/utils/postprocess-files.cjs index 7f8d246..ddc95da 100644 --- a/scripts/utils/postprocess-files.cjs +++ b/scripts/utils/postprocess-files.cjs @@ -2,7 +2,7 @@ const fs = require('fs'); const path = require('path'); const { parse } = require('@typescript-eslint/parser'); -const pkgImportPath = process.env['PKG_IMPORT_PATH'] ?? 'vlm/'; +const pkgImportPath = process.env['PKG_IMPORT_PATH'] ?? 'vlmrun/'; const distDir = process.env['DIST_PATH'] ? @@ -142,7 +142,7 @@ async function postprocess() { if (file.endsWith('.d.ts')) { // work around bad tsc behavior - // if we have `import { type Readable } from 'vlm/_shims/index'`, + // if we have `import { type Readable } from 'vlmrun/_shims/index'`, // tsc sometimes replaces `Readable` with `import("stream").Readable` inline // in the output .d.ts transformed = transformed.replace(/import\("stream"\).Readable/g, 'Readable'); diff --git a/src/_shims/README.md b/src/_shims/README.md index 7b7bddd..6e9bdc0 100644 --- a/src/_shims/README.md +++ b/src/_shims/README.md @@ -1,9 +1,9 @@ # 👋 Wondering what everything in here does? -`vlm` supports a wide variety of runtime environments like Node.js, Deno, Bun, browsers, and various +`vlmrun` supports a wide variety of runtime environments like Node.js, Deno, Bun, browsers, and various edge runtimes, as well as both CommonJS (CJS) and EcmaScript Modules (ESM). -To do this, `vlm` provides shims for either using `node-fetch` when in Node (because `fetch` is still experimental there) or the global `fetch` API built into the environment when not in Node. +To do this, `vlmrun` provides shims for either using `node-fetch` when in Node (because `fetch` is still experimental there) or the global `fetch` API built into the environment when not in Node. It uses [conditional exports](https://nodejs.org/api/packages.html#conditional-exports) to automatically select the correct shims for each environment. However, conditional exports are a fairly new @@ -15,32 +15,32 @@ getting the wrong raw `Response` type from `.asResponse()`, for example. The user can work around these issues by manually importing one of: -- `import 'vlm/shims/node'` -- `import 'vlm/shims/web'` +- `import 'vlmrun/shims/node'` +- `import 'vlmrun/shims/web'` All of the code here in `_shims` handles selecting the automatic default shims or manual overrides. ### How it works - Runtime -Runtime shims get installed by calling `setShims` exported by `vlm/_shims/registry`. +Runtime shims get installed by calling `setShims` exported by `vlmrun/_shims/registry`. -Manually importing `vlm/shims/node` or `vlm/shims/web`, calls `setShims` with the respective runtime shims. +Manually importing `vlmrun/shims/node` or `vlmrun/shims/web`, calls `setShims` with the respective runtime shims. -All client code imports shims from `vlm/_shims/index`, which: +All client code imports shims from `vlmrun/_shims/index`, which: - checks if shims have been set manually -- if not, calls `setShims` with the shims from `vlm/_shims/auto/runtime` -- re-exports the installed shims from `vlm/_shims/registry`. +- if not, calls `setShims` with the shims from `vlmrun/_shims/auto/runtime` +- re-exports the installed shims from `vlmrun/_shims/registry`. -`vlm/_shims/auto/runtime` exports web runtime shims. -If the `node` export condition is set, the export map replaces it with `vlm/_shims/auto/runtime-node`. +`vlmrun/_shims/auto/runtime` exports web runtime shims. +If the `node` export condition is set, the export map replaces it with `vlmrun/_shims/auto/runtime-node`. ### How it works - Type time -All client code imports shim types from `vlm/_shims/index`, which selects the manual types from `vlm/_shims/manual-types` if they have been declared, otherwise it exports the auto types from `vlm/_shims/auto/types`. +All client code imports shim types from `vlmrun/_shims/index`, which selects the manual types from `vlmrun/_shims/manual-types` if they have been declared, otherwise it exports the auto types from `vlmrun/_shims/auto/types`. -`vlm/_shims/manual-types` exports an empty namespace. -Manually importing `vlm/shims/node` or `vlm/shims/web` merges declarations into this empty namespace, so they get picked up by `vlm/_shims/index`. +`vlmrun/_shims/manual-types` exports an empty namespace. +Manually importing `vlmrun/shims/node` or `vlmrun/shims/web` merges declarations into this empty namespace, so they get picked up by `vlmrun/_shims/index`. -`vlm/_shims/auto/types` exports web type definitions. -If the `node` export condition is set, the export map replaces it with `vlm/_shims/auto/types-node`, though TS only picks this up if `"moduleResolution": "nodenext"` or `"moduleResolution": "bundler"`. +`vlmrun/_shims/auto/types` exports web type definitions. +If the `node` export condition is set, the export map replaces it with `vlmrun/_shims/auto/types-node`, though TS only picks this up if `"moduleResolution": "nodenext"` or `"moduleResolution": "bundler"`. diff --git a/src/_shims/index.d.ts b/src/_shims/index.d.ts index 5988cc9..a3c062f 100644 --- a/src/_shims/index.d.ts +++ b/src/_shims/index.d.ts @@ -2,7 +2,7 @@ * Disclaimer: modules in _shims aren't intended to be imported by SDK users. */ import { manual } from './manual-types'; -import * as auto from 'vlm/_shims/auto/types'; +import * as auto from 'vlmrun/_shims/auto/types'; import { type RequestOptions } from '../core'; type SelectType = unknown extends Manual ? Auto : Manual; diff --git a/src/_shims/index.js b/src/_shims/index.js index 633caf1..f40ac6d 100644 --- a/src/_shims/index.js +++ b/src/_shims/index.js @@ -2,7 +2,7 @@ * Disclaimer: modules in _shims aren't intended to be imported by SDK users. */ const shims = require('./registry'); -const auto = require('vlm/_shims/auto/runtime'); +const auto = require('vlmrun/_shims/auto/runtime'); if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); for (const property of Object.keys(shims)) { Object.defineProperty(exports, property, { diff --git a/src/_shims/index.mjs b/src/_shims/index.mjs index 9523878..9b13d22 100644 --- a/src/_shims/index.mjs +++ b/src/_shims/index.mjs @@ -2,6 +2,6 @@ * Disclaimer: modules in _shims aren't intended to be imported by SDK users. */ import * as shims from './registry.mjs'; -import * as auto from 'vlm/_shims/auto/runtime'; +import * as auto from 'vlmrun/_shims/auto/runtime'; if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); export * from './registry.mjs'; diff --git a/src/_shims/manual-types.d.ts b/src/_shims/manual-types.d.ts index 60225e3..6c67bfa 100644 --- a/src/_shims/manual-types.d.ts +++ b/src/_shims/manual-types.d.ts @@ -4,8 +4,8 @@ /** * Types will get added to this namespace when you import one of the following: * - * import 'vlm/shims/node' - * import 'vlm/shims/web' + * import 'vlmrun/shims/node' + * import 'vlmrun/shims/web' * * Importing more than one will cause type and runtime errors. */ diff --git a/src/_shims/registry.ts b/src/_shims/registry.ts index e9be430..04360ff 100644 --- a/src/_shims/registry.ts +++ b/src/_shims/registry.ts @@ -41,10 +41,12 @@ export let isFsReadStream: Shims['isFsReadStream'] | undefined = undefined; export function setShims(shims: Shims, options: { auto: boolean } = { auto: false }) { if (auto) { - throw new Error(`you must \`import 'vlm/shims/${shims.kind}'\` before importing anything else from vlm`); + throw new Error( + `you must \`import 'vlmrun/shims/${shims.kind}'\` before importing anything else from vlmrun`, + ); } if (kind) { - throw new Error(`can't \`import 'vlm/shims/${shims.kind}'\` after \`import 'vlm/shims/${kind}'\``); + throw new Error(`can't \`import 'vlmrun/shims/${shims.kind}'\` after \`import 'vlmrun/shims/${kind}'\``); } auto = options.auto; kind = shims.kind; diff --git a/src/_shims/web-runtime.ts b/src/_shims/web-runtime.ts index 01c1fa0..aefe772 100644 --- a/src/_shims/web-runtime.ts +++ b/src/_shims/web-runtime.ts @@ -9,9 +9,9 @@ export function getRuntime({ manuallyImported }: { manuallyImported?: boolean } const recommendation = manuallyImported ? `You may need to use polyfills` - : `Add one of these imports before your first \`import … from 'vlm'\`: -- \`import 'vlm/shims/node'\` (if you're running on Node) -- \`import 'vlm/shims/web'\` (otherwise) + : `Add one of these imports before your first \`import … from 'vlmrun'\`: +- \`import 'vlmrun/shims/node'\` (if you're running on Node) +- \`import 'vlmrun/shims/web'\` (otherwise) `; let _fetch, _Request, _Response, _Headers; diff --git a/src/core.ts b/src/core.ts index 92dd0ad..54e5210 100644 --- a/src/core.ts +++ b/src/core.ts @@ -99,9 +99,9 @@ export class APIPromise extends Promise { * * 👋 Getting the wrong TypeScript type for `Response`? * Try setting `"moduleResolution": "NodeNext"` if you can, - * or add one of these imports before your first `import … from 'vlm'`: - * - `import 'vlm/shims/node'` (if you're running on Node) - * - `import 'vlm/shims/web'` (otherwise) + * or add one of these imports before your first `import … from 'vlmrun'`: + * - `import 'vlmrun/shims/node'` (if you're running on Node) + * - `import 'vlmrun/shims/web'` (otherwise) */ asResponse(): Promise { return this.responsePromise.then((p) => p.response); @@ -115,9 +115,9 @@ export class APIPromise extends Promise { * * 👋 Getting the wrong TypeScript type for `Response`? * Try setting `"moduleResolution": "NodeNext"` if you can, - * or add one of these imports before your first `import … from 'vlm'`: - * - `import 'vlm/shims/node'` (if you're running on Node) - * - `import 'vlm/shims/web'` (otherwise) + * or add one of these imports before your first `import … from 'vlmrun'`: + * - `import 'vlmrun/shims/node'` (if you're running on Node) + * - `import 'vlmrun/shims/web'` (otherwise) */ async withResponse(): Promise<{ data: T; response: Response }> { const [data, response] = await Promise.all([this.parse(), this.asResponse()]); diff --git a/tests/api-resources/audio.test.ts b/tests/api-resources/audio.test.ts index 3cd36bd..ec299f3 100644 --- a/tests/api-resources/audio.test.ts +++ b/tests/api-resources/audio.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Vlm from 'vlm'; +import Vlm from 'vlmrun'; import { Response } from 'node-fetch'; const client = new Vlm({ diff --git a/tests/api-resources/document.test.ts b/tests/api-resources/document.test.ts index 90b2cc2..c8dc27b 100644 --- a/tests/api-resources/document.test.ts +++ b/tests/api-resources/document.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Vlm from 'vlm'; +import Vlm from 'vlmrun'; import { Response } from 'node-fetch'; const client = new Vlm({ diff --git a/tests/api-resources/experimental/document/embeddings.test.ts b/tests/api-resources/experimental/document/embeddings.test.ts index b2dd93b..af07219 100644 --- a/tests/api-resources/experimental/document/embeddings.test.ts +++ b/tests/api-resources/experimental/document/embeddings.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Vlm from 'vlm'; +import Vlm from 'vlmrun'; import { Response } from 'node-fetch'; const client = new Vlm({ diff --git a/tests/api-resources/experimental/experimental.test.ts b/tests/api-resources/experimental/experimental.test.ts index e2da048..081cdb6 100644 --- a/tests/api-resources/experimental/experimental.test.ts +++ b/tests/api-resources/experimental/experimental.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Vlm from 'vlm'; +import Vlm from 'vlmrun'; import { Response } from 'node-fetch'; const client = new Vlm({ diff --git a/tests/api-resources/experimental/image/embeddings.test.ts b/tests/api-resources/experimental/image/embeddings.test.ts index 0db86c4..16d7526 100644 --- a/tests/api-resources/experimental/image/embeddings.test.ts +++ b/tests/api-resources/experimental/image/embeddings.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Vlm from 'vlm'; +import Vlm from 'vlmrun'; import { Response } from 'node-fetch'; const client = new Vlm({ diff --git a/tests/api-resources/files.test.ts b/tests/api-resources/files.test.ts index b9e3b5e..4052cfd 100644 --- a/tests/api-resources/files.test.ts +++ b/tests/api-resources/files.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Vlm, { toFile } from 'vlm'; +import Vlm, { toFile } from 'vlmrun'; import { Response } from 'node-fetch'; const client = new Vlm({ diff --git a/tests/api-resources/image.test.ts b/tests/api-resources/image.test.ts index 5c9c764..be739a9 100644 --- a/tests/api-resources/image.test.ts +++ b/tests/api-resources/image.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Vlm from 'vlm'; +import Vlm from 'vlmrun'; import { Response } from 'node-fetch'; const client = new Vlm({ diff --git a/tests/api-resources/models.test.ts b/tests/api-resources/models.test.ts index 1cb732d..0906573 100644 --- a/tests/api-resources/models.test.ts +++ b/tests/api-resources/models.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Vlm from 'vlm'; +import Vlm from 'vlmrun'; import { Response } from 'node-fetch'; const client = new Vlm({ diff --git a/tests/api-resources/openai/chat-completions.test.ts b/tests/api-resources/openai/chat-completions.test.ts index 011e78d..1e101b8 100644 --- a/tests/api-resources/openai/chat-completions.test.ts +++ b/tests/api-resources/openai/chat-completions.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Vlm from 'vlm'; +import Vlm from 'vlmrun'; import { Response } from 'node-fetch'; const client = new Vlm({ diff --git a/tests/api-resources/openai/models.test.ts b/tests/api-resources/openai/models.test.ts index 079d34d..2e2195d 100644 --- a/tests/api-resources/openai/models.test.ts +++ b/tests/api-resources/openai/models.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Vlm from 'vlm'; +import Vlm from 'vlmrun'; import { Response } from 'node-fetch'; const client = new Vlm({ diff --git a/tests/api-resources/openai/openai.test.ts b/tests/api-resources/openai/openai.test.ts index bd7663c..59b831d 100644 --- a/tests/api-resources/openai/openai.test.ts +++ b/tests/api-resources/openai/openai.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Vlm from 'vlm'; +import Vlm from 'vlmrun'; import { Response } from 'node-fetch'; const client = new Vlm({ diff --git a/tests/api-resources/response.test.ts b/tests/api-resources/response.test.ts index 4a68822..ed7ae90 100644 --- a/tests/api-resources/response.test.ts +++ b/tests/api-resources/response.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Vlm from 'vlm'; +import Vlm from 'vlmrun'; import { Response } from 'node-fetch'; const client = new Vlm({ diff --git a/tests/api-resources/schema.test.ts b/tests/api-resources/schema.test.ts index a38992d..bc4383b 100644 --- a/tests/api-resources/schema.test.ts +++ b/tests/api-resources/schema.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Vlm from 'vlm'; +import Vlm from 'vlmrun'; import { Response } from 'node-fetch'; const client = new Vlm({ diff --git a/tests/api-resources/top-level.test.ts b/tests/api-resources/top-level.test.ts index 920d883..190a9b8 100644 --- a/tests/api-resources/top-level.test.ts +++ b/tests/api-resources/top-level.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Vlm from 'vlm'; +import Vlm from 'vlmrun'; import { Response } from 'node-fetch'; const client = new Vlm({ diff --git a/tests/api-resources/web.test.ts b/tests/api-resources/web.test.ts index de113c0..1b3f88a 100644 --- a/tests/api-resources/web.test.ts +++ b/tests/api-resources/web.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Vlm from 'vlm'; +import Vlm from 'vlmrun'; import { Response } from 'node-fetch'; const client = new Vlm({ diff --git a/tests/form.test.ts b/tests/form.test.ts index c02dabe..4ae9dbf 100644 --- a/tests/form.test.ts +++ b/tests/form.test.ts @@ -1,6 +1,6 @@ -import { multipartFormRequestOptions, createForm } from 'vlm/core'; -import { Blob } from 'vlm/_shims/index'; -import { toFile } from 'vlm'; +import { multipartFormRequestOptions, createForm } from 'vlmrun/core'; +import { Blob } from 'vlmrun/_shims/index'; +import { toFile } from 'vlmrun'; describe('form data validation', () => { test('valid values do not error', async () => { diff --git a/tests/index.test.ts b/tests/index.test.ts index 1631709..33134f8 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Vlm from 'vlm'; -import { APIUserAbortError } from 'vlm'; -import { Headers } from 'vlm/core'; +import Vlm from 'vlmrun'; +import { APIUserAbortError } from 'vlmrun'; +import { Headers } from 'vlmrun/core'; import defaultFetch, { Response, type RequestInit, type RequestInfo } from 'node-fetch'; describe('instantiate client', () => { diff --git a/tests/responses.test.ts b/tests/responses.test.ts index 7cfe3be..042263a 100644 --- a/tests/responses.test.ts +++ b/tests/responses.test.ts @@ -1,5 +1,5 @@ -import { createResponseHeaders } from 'vlm/core'; -import { Headers } from 'vlm/_shims/index'; +import { createResponseHeaders } from 'vlmrun/core'; +import { Headers } from 'vlmrun/_shims/index'; describe('response parsing', () => { // TODO: test unicode characters diff --git a/tests/stringifyQuery.test.ts b/tests/stringifyQuery.test.ts index 62c24e5..38b8f3c 100644 --- a/tests/stringifyQuery.test.ts +++ b/tests/stringifyQuery.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { Vlm } from 'vlm'; +import { Vlm } from 'vlmrun'; const { stringifyQuery } = Vlm.prototype as any; diff --git a/tests/uploads.test.ts b/tests/uploads.test.ts index c34870d..d834fba 100644 --- a/tests/uploads.test.ts +++ b/tests/uploads.test.ts @@ -1,6 +1,6 @@ import fs from 'fs'; -import { toFile, type ResponseLike } from 'vlm/uploads'; -import { File } from 'vlm/_shims/index'; +import { toFile, type ResponseLike } from 'vlmrun/uploads'; +import { File } from 'vlmrun/_shims/index'; class MyClass { name: string = 'foo'; diff --git a/tsconfig.build.json b/tsconfig.build.json index 14355a2..eba55ee 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -5,8 +5,8 @@ "compilerOptions": { "rootDir": "./dist/src", "paths": { - "vlm/*": ["dist/src/*"], - "vlm": ["dist/src/index.ts"], + "vlmrun/*": ["dist/src/*"], + "vlmrun": ["dist/src/index.ts"], }, "noEmit": false, "declaration": true, diff --git a/tsconfig.json b/tsconfig.json index 9341318..09dbefd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,9 +9,9 @@ "esModuleInterop": true, "baseUrl": "./", "paths": { - "vlm/_shims/auto/*": ["src/_shims/auto/*-node"], - "vlm/*": ["src/*"], - "vlm": ["src/index.ts"] + "vlmrun/_shims/auto/*": ["src/_shims/auto/*-node"], + "vlmrun/*": ["src/*"], + "vlmrun": ["src/index.ts"] }, "noEmit": true,