From f767c9d873d9651118d61b550915e702a9971509 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 20:48:36 +0000 Subject: [PATCH 1/3] chore: go live (#1) --- .github/workflows/publish-npm.yml | 32 +++++++++++++ .github/workflows/release-doctor.yml | 22 +++++++++ .release-please-manifest.json | 3 ++ CONTRIBUTING.md | 8 ++-- README.md | 6 +-- bin/check-release-environment | 22 +++++++++ package.json | 2 +- release-please-config.json | 67 ++++++++++++++++++++++++++++ src/_shims/index-deno.ts | 2 +- src/_shims/web-runtime.ts | 2 +- src/version.ts | 2 +- 11 files changed, 157 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/publish-npm.yml create mode 100644 .github/workflows/release-doctor.yml create mode 100644 .release-please-manifest.json create mode 100644 bin/check-release-environment create mode 100644 release-please-config.json diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml new file mode 100644 index 0000000..f81295e --- /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/maestro-org/maestro-arch-rpc-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.MAESTRO_ARCH_RPC_NPM_TOKEN || secrets.NPM_TOKEN }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml new file mode 100644 index 0000000..357a5b5 --- /dev/null +++ b/.github/workflows/release-doctor.yml @@ -0,0 +1,22 @@ +name: Release Doctor +on: + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + release_doctor: + name: release doctor + runs-on: ubuntu-latest + if: github.repository == 'maestro-org/maestro-arch-rpc-node-sdk' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + + steps: + - uses: actions/checkout@v4 + + - name: Check release environment + run: | + bash ./bin/check-release-environment + env: + NPM_TOKEN: ${{ secrets.MAESTRO_ARCH_RPC_NPM_TOKEN || secrets.NPM_TOKEN }} + diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..67dcd73 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.0.1-alpha.0" +} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index db75253..7f4c104 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,15 +42,15 @@ If you’d like to use the repository from source, you can either install from g To install via git: ```sh -$ npm install git+ssh://git@github.com:stainless-sdks/maestro-arch-rpc-node.git +$ npm install git+ssh://git@github.com:maestro-org/maestro-arch-rpc-node-sdk.git ``` Alternatively, to link a local copy of the repo: ```sh # Clone -$ git clone https://www.github.com/stainless-sdks/maestro-arch-rpc-node -$ cd maestro-arch-rpc-node +$ git clone https://www.github.com/maestro-org/maestro-arch-rpc-node-sdk +$ cd maestro-arch-rpc-node-sdk # With yarn $ yarn link @@ -99,7 +99,7 @@ the changes aren't made through the automated pipeline, you may want to make rel ### Publish with a GitHub workflow -You can release to package managers by using [the `Publish NPM` GitHub action](https://www.github.com/stainless-sdks/maestro-arch-rpc-node/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up. +You can release to package managers by using [the `Publish NPM` GitHub action](https://www.github.com/maestro-org/maestro-arch-rpc-node-sdk/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up. ### Publish manually diff --git a/README.md b/README.md index 674def3..df7e624 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ It is generated with [Stainless](https://www.stainlessapi.com/). ## Installation ```sh -npm install git+ssh://git@github.com:stainless-sdks/maestro-arch-rpc-node.git +npm install git+ssh://git@github.com:maestro-org/maestro-arch-rpc-node-sdk.git ``` > [!NOTE] @@ -215,7 +215,7 @@ import MaestroArchRpc from 'maestro-arch-rpc'; ``` To do the inverse, add `import "maestro-arch-rpc/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/stainless-sdks/maestro-arch-rpc-node/tree/main/src/_shims#readme)). +This can also be useful if you are getting the wrong TypeScript types for `Response` ([more details](https://github.com/maestro-org/maestro-arch-rpc-node-sdk/tree/main/src/_shims#readme)). ### Logging and middleware @@ -271,7 +271,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. -We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/maestro-arch-rpc-node/issues) with questions, bugs, or suggestions. +We are keen for your feedback; please open an [issue](https://www.github.com/maestro-org/maestro-arch-rpc-node-sdk/issues) with questions, bugs, or suggestions. ## Requirements diff --git a/bin/check-release-environment b/bin/check-release-environment new file mode 100644 index 0000000..25265d2 --- /dev/null +++ b/bin/check-release-environment @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +errors=() + +if [ -z "${NPM_TOKEN}" ]; then + errors+=("The MAESTRO_ARCH_RPC_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 + echo -e "Found the following errors in the release environment:\n" + + for error in "${errors[@]}"; do + echo -e "- $error\n" + done + + exit 1 +fi + +echo "The environment is ready to push releases!" + diff --git a/package.json b/package.json index 0fcf121..1336c6c 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "types": "dist/index.d.ts", "main": "dist/index.js", "type": "commonjs", - "repository": "github:stainless-sdks/maestro-arch-rpc-node", + "repository": "github:maestro-org/maestro-arch-rpc-node-sdk", "license": "Apache-2.0", "packageManager": "yarn@1.22.22", "files": [ diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..624ed99 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,67 @@ +{ + "packages": { + ".": {} + }, + "$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json", + "include-v-in-tag": true, + "include-component-in-tag": false, + "versioning": "prerelease", + "prerelease": true, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": false, + "pull-request-header": "Automated Release PR", + "pull-request-title-pattern": "release: ${version}", + "changelog-sections": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "perf", + "section": "Performance Improvements" + }, + { + "type": "revert", + "section": "Reverts" + }, + { + "type": "chore", + "section": "Chores" + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "style", + "section": "Styles" + }, + { + "type": "refactor", + "section": "Refactors" + }, + { + "type": "test", + "section": "Tests", + "hidden": true + }, + { + "type": "build", + "section": "Build System" + }, + { + "type": "ci", + "section": "Continuous Integration", + "hidden": true + } + ], + "release-type": "node", + "extra-files": [ + "src/version.ts", + "README.md" + ] +} diff --git a/src/_shims/index-deno.ts b/src/_shims/index-deno.ts index 8bab0e2..33cc545 100644 --- a/src/_shims/index-deno.ts +++ b/src/_shims/index-deno.ts @@ -79,7 +79,7 @@ export function getDefaultAgent(url: string) { } export function fileFromPath() { throw new Error( - 'The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/stainless-sdks/maestro-arch-rpc-node#file-uploads', + 'The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/maestro-org/maestro-arch-rpc-node-sdk#file-uploads', ); } diff --git a/src/_shims/web-runtime.ts b/src/_shims/web-runtime.ts index cae2e07..7cd7824 100644 --- a/src/_shims/web-runtime.ts +++ b/src/_shims/web-runtime.ts @@ -95,7 +95,7 @@ export function getRuntime({ manuallyImported }: { manuallyImported?: boolean } getDefaultAgent: (url: string) => undefined, fileFromPath: () => { throw new Error( - 'The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/stainless-sdks/maestro-arch-rpc-node#file-uploads', + 'The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/maestro-org/maestro-arch-rpc-node-sdk#file-uploads', ); }, isFsReadStream: (value: any) => false, diff --git a/src/version.ts b/src/version.ts index 55a1a52..db692bc 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.0.1-alpha.0'; +export const VERSION = '0.0.1-alpha.0'; // x-release-please-version From b89e669a2141d1455c72216e4c99bbcbb4d865e8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 20:49:04 +0000 Subject: [PATCH 2/3] chore: update SDK settings (#3) --- CONTRIBUTING.md | 4 +-- README.md | 19 ++++++-------- jest.config.ts | 6 ++--- package.json | 6 ++--- scripts/build | 6 ++--- scripts/utils/postprocess-files.cjs | 4 +-- src/_shims/README.md | 32 ++++++++++++------------ src/_shims/index.d.ts | 2 +- src/_shims/index.js | 2 +- src/_shims/index.mjs | 2 +- src/_shims/manual-types.d.ts | 4 +-- src/_shims/registry.ts | 4 +-- src/_shims/web-runtime.ts | 6 ++--- src/core.ts | 12 ++++----- tests/api-resources/accounts.test.ts | 2 +- tests/api-resources/blocks.test.ts | 2 +- tests/api-resources/programs.test.ts | 2 +- tests/api-resources/transactions.test.ts | 2 +- tests/form.test.ts | 6 ++--- tests/index.test.ts | 6 ++--- tests/responses.test.ts | 4 +-- tests/stringifyQuery.test.ts | 2 +- tests/uploads.test.ts | 4 +-- tsconfig.build.json | 4 +-- tsconfig.deno.json | 6 ++--- tsconfig.json | 6 ++--- 26 files changed, 76 insertions(+), 79 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7f4c104..37932e8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -55,12 +55,12 @@ $ cd maestro-arch-rpc-node-sdk # With yarn $ yarn link $ cd ../my-package -$ yarn link maestro-arch-rpc +$ yarn link maestro-arch-rpc-sdk # With pnpm $ pnpm link --global $ cd ../my-package -$ pnpm link -—global maestro-arch-rpc +$ pnpm link -—global maestro-arch-rpc-sdk ``` ## Running tests diff --git a/README.md b/README.md index df7e624..00fd44b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Maestro Arch Rpc Node API Library -[![NPM version](https://img.shields.io/npm/v/maestro-arch-rpc.svg)](https://npmjs.org/package/maestro-arch-rpc) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/maestro-arch-rpc) +[![NPM version](https://img.shields.io/npm/v/maestro-arch-rpc-sdk.svg)](https://npmjs.org/package/maestro-arch-rpc-sdk) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/maestro-arch-rpc-sdk) This library provides convenient access to the Maestro Arch Rpc 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:maestro-org/maestro-arch-rpc-node-sdk.git +npm install maestro-arch-rpc-sdk ``` -> [!NOTE] -> Once this package is [published to npm](https://app.stainlessapi.com/docs/guides/publish), this will become: `npm install maestro-arch-rpc` - ## Usage The full API of this library can be found in [api.md](api.md). ```js -import MaestroArchRpc from 'maestro-arch-rpc'; +import MaestroArchRpc from 'maestro-arch-rpc-sdk'; const client = new MaestroArchRpc(); @@ -42,7 +39,7 @@ This library includes TypeScript definitions for all request params and response ```ts -import MaestroArchRpc from 'maestro-arch-rpc'; +import MaestroArchRpc from 'maestro-arch-rpc-sdk'; const client = new MaestroArchRpc(); @@ -210,11 +207,11 @@ add the following import before your first import `from "MaestroArchRpc"`: ```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 'maestro-arch-rpc/shims/web'; -import MaestroArchRpc from 'maestro-arch-rpc'; +import 'maestro-arch-rpc-sdk/shims/web'; +import MaestroArchRpc from 'maestro-arch-rpc-sdk'; ``` -To do the inverse, add `import "maestro-arch-rpc/shims/node"` (which does import polyfills). +To do the inverse, add `import "maestro-arch-rpc-sdk/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/maestro-org/maestro-arch-rpc-node-sdk/tree/main/src/_shims#readme)). ### Logging and middleware @@ -224,7 +221,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 MaestroArchRpc from 'maestro-arch-rpc'; +import MaestroArchRpc from 'maestro-arch-rpc-sdk'; const client = new MaestroArchRpc({ fetch: async (url: RequestInfo, init?: RequestInit): Promise => { diff --git a/jest.config.ts b/jest.config.ts index 0e23174..6d77750 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -7,9 +7,9 @@ const config: JestConfigWithTsJest = { '^.+\\.(t|j)sx?$': ['@swc/jest', { sourceMaps: 'inline' }], }, moduleNameMapper: { - '^maestro-arch-rpc$': '/src/index.ts', - '^maestro-arch-rpc/_shims/auto/(.*)$': '/src/_shims/auto/$1-node', - '^maestro-arch-rpc/(.*)$': '/src/$1', + '^maestro-arch-rpc-sdk$': '/src/index.ts', + '^maestro-arch-rpc-sdk/_shims/auto/(.*)$': '/src/_shims/auto/$1-node', + '^maestro-arch-rpc-sdk/(.*)$': '/src/$1', }, modulePathIgnorePatterns: [ '/ecosystem-tests/', diff --git a/package.json b/package.json index 1336c6c..1e8143a 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "maestro-arch-rpc", + "name": "maestro-arch-rpc-sdk", "version": "0.0.1-alpha.0", "description": "The official TypeScript library for the Maestro Arch Rpc API", "author": "Maestro Arch Rpc ", @@ -60,8 +60,8 @@ "./shims/web.mjs" ], "imports": { - "maestro-arch-rpc": ".", - "maestro-arch-rpc/*": "./src/*" + "maestro-arch-rpc-sdk": ".", + "maestro-arch-rpc-sdk/*": "./src/*" }, "exports": { "./_shims/auto/*": { diff --git a/scripts/build b/scripts/build index 79fef28..5421a08 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 `"maestro-arch-rpc/resources/foo"` works +# This way importing from `"maestro-arch-rpc-sdk/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("maestro-arch-rpc")') -(cd dist && node -e 'import("maestro-arch-rpc")' --input-type=module) +(cd dist && node -e 'require("maestro-arch-rpc-sdk")') +(cd dist && node -e 'import("maestro-arch-rpc-sdk")' --input-type=module) if command -v deno &> /dev/null && [ -e ./scripts/build-deno ] then diff --git a/scripts/utils/postprocess-files.cjs b/scripts/utils/postprocess-files.cjs index 24bd377..a824a78 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'] ?? 'maestro-arch-rpc/'; +const pkgImportPath = process.env['PKG_IMPORT_PATH'] ?? 'maestro-arch-rpc-sdk/'; 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 'maestro-arch-rpc/_shims/index'`, + // if we have `import { type Readable } from 'maestro-arch-rpc-sdk/_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 3666285..ef79994 100644 --- a/src/_shims/README.md +++ b/src/_shims/README.md @@ -1,9 +1,9 @@ # 👋 Wondering what everything in here does? -`maestro-arch-rpc` supports a wide variety of runtime environments like Node.js, Deno, Bun, browsers, and various +`maestro-arch-rpc-sdk` 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, `maestro-arch-rpc` 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, `maestro-arch-rpc-sdk` 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 'maestro-arch-rpc/shims/node'` -- `import 'maestro-arch-rpc/shims/web'` +- `import 'maestro-arch-rpc-sdk/shims/node'` +- `import 'maestro-arch-rpc-sdk/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 `maestro-arch-rpc/_shims/registry`. +Runtime shims get installed by calling `setShims` exported by `maestro-arch-rpc-sdk/_shims/registry`. -Manually importing `maestro-arch-rpc/shims/node` or `maestro-arch-rpc/shims/web`, calls `setShims` with the respective runtime shims. +Manually importing `maestro-arch-rpc-sdk/shims/node` or `maestro-arch-rpc-sdk/shims/web`, calls `setShims` with the respective runtime shims. -All client code imports shims from `maestro-arch-rpc/_shims/index`, which: +All client code imports shims from `maestro-arch-rpc-sdk/_shims/index`, which: - checks if shims have been set manually -- if not, calls `setShims` with the shims from `maestro-arch-rpc/_shims/auto/runtime` -- re-exports the installed shims from `maestro-arch-rpc/_shims/registry`. +- if not, calls `setShims` with the shims from `maestro-arch-rpc-sdk/_shims/auto/runtime` +- re-exports the installed shims from `maestro-arch-rpc-sdk/_shims/registry`. -`maestro-arch-rpc/_shims/auto/runtime` exports web runtime shims. -If the `node` export condition is set, the export map replaces it with `maestro-arch-rpc/_shims/auto/runtime-node`. +`maestro-arch-rpc-sdk/_shims/auto/runtime` exports web runtime shims. +If the `node` export condition is set, the export map replaces it with `maestro-arch-rpc-sdk/_shims/auto/runtime-node`. ### How it works - Type time -All client code imports shim types from `maestro-arch-rpc/_shims/index`, which selects the manual types from `maestro-arch-rpc/_shims/manual-types` if they have been declared, otherwise it exports the auto types from `maestro-arch-rpc/_shims/auto/types`. +All client code imports shim types from `maestro-arch-rpc-sdk/_shims/index`, which selects the manual types from `maestro-arch-rpc-sdk/_shims/manual-types` if they have been declared, otherwise it exports the auto types from `maestro-arch-rpc-sdk/_shims/auto/types`. -`maestro-arch-rpc/_shims/manual-types` exports an empty namespace. -Manually importing `maestro-arch-rpc/shims/node` or `maestro-arch-rpc/shims/web` merges declarations into this empty namespace, so they get picked up by `maestro-arch-rpc/_shims/index`. +`maestro-arch-rpc-sdk/_shims/manual-types` exports an empty namespace. +Manually importing `maestro-arch-rpc-sdk/shims/node` or `maestro-arch-rpc-sdk/shims/web` merges declarations into this empty namespace, so they get picked up by `maestro-arch-rpc-sdk/_shims/index`. -`maestro-arch-rpc/_shims/auto/types` exports web type definitions. -If the `node` export condition is set, the export map replaces it with `maestro-arch-rpc/_shims/auto/types-node`, though TS only picks this up if `"moduleResolution": "nodenext"` or `"moduleResolution": "bundler"`. +`maestro-arch-rpc-sdk/_shims/auto/types` exports web type definitions. +If the `node` export condition is set, the export map replaces it with `maestro-arch-rpc-sdk/_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 5f7138e..7362cdf 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 'maestro-arch-rpc/_shims/auto/types'; +import * as auto from 'maestro-arch-rpc-sdk/_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 d110a7b..c074303 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('maestro-arch-rpc/_shims/auto/runtime'); +const auto = require('maestro-arch-rpc-sdk/_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 9fffe37..c823a28 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 'maestro-arch-rpc/_shims/auto/runtime'; +import * as auto from 'maestro-arch-rpc-sdk/_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 077c832..2e4e13a 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 'maestro-arch-rpc/shims/node' - * import 'maestro-arch-rpc/shims/web' + * import 'maestro-arch-rpc-sdk/shims/node' + * import 'maestro-arch-rpc-sdk/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 d90560a..1fba5dd 100644 --- a/src/_shims/registry.ts +++ b/src/_shims/registry.ts @@ -42,12 +42,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 'maestro-arch-rpc/shims/${shims.kind}'\` before importing anything else from maestro-arch-rpc`, + `you must \`import 'maestro-arch-rpc-sdk/shims/${shims.kind}'\` before importing anything else from maestro-arch-rpc-sdk`, ); } if (kind) { throw new Error( - `can't \`import 'maestro-arch-rpc/shims/${shims.kind}'\` after \`import 'maestro-arch-rpc/shims/${kind}'\``, + `can't \`import 'maestro-arch-rpc-sdk/shims/${shims.kind}'\` after \`import 'maestro-arch-rpc-sdk/shims/${kind}'\``, ); } auto = options.auto; diff --git a/src/_shims/web-runtime.ts b/src/_shims/web-runtime.ts index 7cd7824..9a3fc86 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 'maestro-arch-rpc'\`: -- \`import 'maestro-arch-rpc/shims/node'\` (if you're running on Node) -- \`import 'maestro-arch-rpc/shims/web'\` (otherwise) + : `Add one of these imports before your first \`import … from 'maestro-arch-rpc-sdk'\`: +- \`import 'maestro-arch-rpc-sdk/shims/node'\` (if you're running on Node) +- \`import 'maestro-arch-rpc-sdk/shims/web'\` (otherwise) `; let _fetch, _Request, _Response, _Headers; diff --git a/src/core.ts b/src/core.ts index cea3f27..362ccf1 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 'maestro-arch-rpc'`: - * - `import 'maestro-arch-rpc/shims/node'` (if you're running on Node) - * - `import 'maestro-arch-rpc/shims/web'` (otherwise) + * or add one of these imports before your first `import … from 'maestro-arch-rpc-sdk'`: + * - `import 'maestro-arch-rpc-sdk/shims/node'` (if you're running on Node) + * - `import 'maestro-arch-rpc-sdk/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 'maestro-arch-rpc'`: - * - `import 'maestro-arch-rpc/shims/node'` (if you're running on Node) - * - `import 'maestro-arch-rpc/shims/web'` (otherwise) + * or add one of these imports before your first `import … from 'maestro-arch-rpc-sdk'`: + * - `import 'maestro-arch-rpc-sdk/shims/node'` (if you're running on Node) + * - `import 'maestro-arch-rpc-sdk/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/accounts.test.ts b/tests/api-resources/accounts.test.ts index 913f7be..22ed9cd 100644 --- a/tests/api-resources/accounts.test.ts +++ b/tests/api-resources/accounts.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import MaestroArchRpc from 'maestro-arch-rpc'; +import MaestroArchRpc from 'maestro-arch-rpc-sdk'; import { Response } from 'node-fetch'; const client = new MaestroArchRpc({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010' }); diff --git a/tests/api-resources/blocks.test.ts b/tests/api-resources/blocks.test.ts index 3fe5c2e..5e83d96 100644 --- a/tests/api-resources/blocks.test.ts +++ b/tests/api-resources/blocks.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import MaestroArchRpc from 'maestro-arch-rpc'; +import MaestroArchRpc from 'maestro-arch-rpc-sdk'; import { Response } from 'node-fetch'; const client = new MaestroArchRpc({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010' }); diff --git a/tests/api-resources/programs.test.ts b/tests/api-resources/programs.test.ts index 7824aca..92be98e 100644 --- a/tests/api-resources/programs.test.ts +++ b/tests/api-resources/programs.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import MaestroArchRpc from 'maestro-arch-rpc'; +import MaestroArchRpc from 'maestro-arch-rpc-sdk'; import { Response } from 'node-fetch'; const client = new MaestroArchRpc({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010' }); diff --git a/tests/api-resources/transactions.test.ts b/tests/api-resources/transactions.test.ts index 8ace44f..8e5e141 100644 --- a/tests/api-resources/transactions.test.ts +++ b/tests/api-resources/transactions.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import MaestroArchRpc from 'maestro-arch-rpc'; +import MaestroArchRpc from 'maestro-arch-rpc-sdk'; import { Response } from 'node-fetch'; const client = new MaestroArchRpc({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010' }); diff --git a/tests/form.test.ts b/tests/form.test.ts index 76e19ad..972ef1b 100644 --- a/tests/form.test.ts +++ b/tests/form.test.ts @@ -1,6 +1,6 @@ -import { multipartFormRequestOptions, createForm } from 'maestro-arch-rpc/core'; -import { Blob } from 'maestro-arch-rpc/_shims/index'; -import { toFile } from 'maestro-arch-rpc'; +import { multipartFormRequestOptions, createForm } from 'maestro-arch-rpc-sdk/core'; +import { Blob } from 'maestro-arch-rpc-sdk/_shims/index'; +import { toFile } from 'maestro-arch-rpc-sdk'; describe('form data validation', () => { test('valid values do not error', async () => { diff --git a/tests/index.test.ts b/tests/index.test.ts index cc273ac..6bc0d52 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 MaestroArchRpc from 'maestro-arch-rpc'; -import { APIUserAbortError } from 'maestro-arch-rpc'; -import { Headers } from 'maestro-arch-rpc/core'; +import MaestroArchRpc from 'maestro-arch-rpc-sdk'; +import { APIUserAbortError } from 'maestro-arch-rpc-sdk'; +import { Headers } from 'maestro-arch-rpc-sdk/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 0fc0289..d9fdc39 100644 --- a/tests/responses.test.ts +++ b/tests/responses.test.ts @@ -1,5 +1,5 @@ -import { createResponseHeaders } from 'maestro-arch-rpc/core'; -import { Headers } from 'maestro-arch-rpc/_shims/index'; +import { createResponseHeaders } from 'maestro-arch-rpc-sdk/core'; +import { Headers } from 'maestro-arch-rpc-sdk/_shims/index'; describe('response parsing', () => { // TODO: test unicode characters diff --git a/tests/stringifyQuery.test.ts b/tests/stringifyQuery.test.ts index b66c7bc..2b98838 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 { MaestroArchRpc } from 'maestro-arch-rpc'; +import { MaestroArchRpc } from 'maestro-arch-rpc-sdk'; const { stringifyQuery } = MaestroArchRpc.prototype as any; diff --git a/tests/uploads.test.ts b/tests/uploads.test.ts index 1c71336..0d523ef 100644 --- a/tests/uploads.test.ts +++ b/tests/uploads.test.ts @@ -1,6 +1,6 @@ import fs from 'fs'; -import { toFile, type ResponseLike } from 'maestro-arch-rpc/uploads'; -import { File } from 'maestro-arch-rpc/_shims/index'; +import { toFile, type ResponseLike } from 'maestro-arch-rpc-sdk/uploads'; +import { File } from 'maestro-arch-rpc-sdk/_shims/index'; class MyClass { name: string = 'foo'; diff --git a/tsconfig.build.json b/tsconfig.build.json index 3ab00d9..bbaea30 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -5,8 +5,8 @@ "compilerOptions": { "rootDir": "./dist/src", "paths": { - "maestro-arch-rpc/*": ["dist/src/*"], - "maestro-arch-rpc": ["dist/src/index.ts"], + "maestro-arch-rpc-sdk/*": ["dist/src/*"], + "maestro-arch-rpc-sdk": ["dist/src/index.ts"], }, "noEmit": false, "declaration": true, diff --git a/tsconfig.deno.json b/tsconfig.deno.json index ec33451..f3e67fe 100644 --- a/tsconfig.deno.json +++ b/tsconfig.deno.json @@ -6,9 +6,9 @@ "rootDir": "./deno", "lib": ["es2020", "DOM"], "paths": { - "maestro-arch-rpc/_shims/auto/*": ["deno/_shims/auto/*-deno"], - "maestro-arch-rpc/*": ["deno/*"], - "maestro-arch-rpc": ["deno/index.ts"], + "maestro-arch-rpc-sdk/_shims/auto/*": ["deno/_shims/auto/*-deno"], + "maestro-arch-rpc-sdk/*": ["deno/*"], + "maestro-arch-rpc-sdk": ["deno/index.ts"], }, "noEmit": true, "declaration": true, diff --git a/tsconfig.json b/tsconfig.json index 50fdf6b..c94f8d2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,9 +9,9 @@ "esModuleInterop": true, "baseUrl": "./", "paths": { - "maestro-arch-rpc/_shims/auto/*": ["src/_shims/auto/*-node"], - "maestro-arch-rpc/*": ["src/*"], - "maestro-arch-rpc": ["src/index.ts"], + "maestro-arch-rpc-sdk/_shims/auto/*": ["src/_shims/auto/*-node"], + "maestro-arch-rpc-sdk/*": ["src/*"], + "maestro-arch-rpc-sdk": ["src/index.ts"], }, "noEmit": true, From 1cefc3592cf8886f25ab361686d6426577f9cfee Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 20:49:14 +0000 Subject: [PATCH 3/3] release: 0.0.1-alpha.1 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 10 ++++++++++ package.json | 2 +- src/version.ts | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 67dcd73..063a4ae 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.0.1-alpha.0" + ".": "0.0.1-alpha.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..03dfad5 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,10 @@ +# Changelog + +## 0.0.1-alpha.1 (2024-10-29) + +Full Changelog: [v0.0.1-alpha.0...v0.0.1-alpha.1](https://github.com/maestro-org/maestro-arch-rpc-node-sdk/compare/v0.0.1-alpha.0...v0.0.1-alpha.1) + +### Chores + +* go live ([#1](https://github.com/maestro-org/maestro-arch-rpc-node-sdk/issues/1)) ([f767c9d](https://github.com/maestro-org/maestro-arch-rpc-node-sdk/commit/f767c9d873d9651118d61b550915e702a9971509)) +* update SDK settings ([#3](https://github.com/maestro-org/maestro-arch-rpc-node-sdk/issues/3)) ([b89e669](https://github.com/maestro-org/maestro-arch-rpc-node-sdk/commit/b89e669a2141d1455c72216e4c99bbcbb4d865e8)) diff --git a/package.json b/package.json index 1e8143a..6dcde03 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "maestro-arch-rpc-sdk", - "version": "0.0.1-alpha.0", + "version": "0.0.1-alpha.1", "description": "The official TypeScript library for the Maestro Arch Rpc API", "author": "Maestro Arch Rpc ", "types": "dist/index.d.ts", diff --git a/src/version.ts b/src/version.ts index db692bc..2c77b51 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.0.1-alpha.0'; // x-release-please-version +export const VERSION = '0.0.1-alpha.1'; // x-release-please-version