-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* The main change in this release is our first attempt at publishing on JSR. --------- Co-authored-by: stainless-bot <[email protected]> Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
- Loading branch information
1 parent
3a9460e
commit 12f5712
Showing
49 changed files
with
689 additions
and
361 deletions.
There are no files selected for viewing
This file contains 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 @@ | ||
# This workflow is triggered when a GitHub release is created. | ||
# It can also be run manually to re-publish to JSR in case it failed for some reason. | ||
# You can run this workflow by navigating to https://www.github.com/val-town/sdk/actions/workflows/publish-jsr.yml | ||
name: Publish JSR | ||
on: | ||
workflow_dispatch: | ||
|
||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish: | ||
name: publish | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
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 JSR | ||
run: | | ||
bash ./bin/publish-jsr |
This file contains 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 |
---|---|---|
|
@@ -4,7 +4,7 @@ yarn-error.log | |
codegen.log | ||
Brewfile.lock.json | ||
dist | ||
/deno | ||
dist-deno | ||
/*.tgz | ||
.idea/ | ||
|
This file contains 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
".": "0.23.0" | ||
".": "0.24.0" | ||
} |
This file contains 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
configured_endpoints: 26 | ||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/val-town%2Fval-town-e71c730055783b96c5f9858d3c80eb88a8355c1d1fb770e9f2745fe63a16a4be.yml | ||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/val-town%2Fval-town-56a412f0f88fc96d4ccb7d3ae75cb619581c413531caae445a85fa2279fba829.yml |
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -5,9 +5,9 @@ Other package managers may work but are not officially supported for development | |
|
||
To set up the repository, run: | ||
|
||
```bash | ||
yarn | ||
yarn build | ||
```sh | ||
$ yarn | ||
$ yarn build | ||
``` | ||
|
||
This will install all the required dependencies and build output files to `dist/`. | ||
|
@@ -22,7 +22,7 @@ modify the contents of the `src/lib/` and `examples/` directories. | |
|
||
All files in the `examples/` directory are not modified by the generator and can be freely edited or added to. | ||
|
||
```bash | ||
```ts | ||
// add an example to examples/<your-example>.ts | ||
|
||
#!/usr/bin/env -S npm run tsn -T | ||
|
@@ -41,38 +41,38 @@ If you’d like to use the repository from source, you can either install from g | |
|
||
To install via git: | ||
|
||
```bash | ||
npm install git+ssh://[email protected]:val-town/sdk.git | ||
```sh | ||
$ npm install git+ssh://[email protected]:val-town/sdk.git | ||
``` | ||
|
||
Alternatively, to link a local copy of the repo: | ||
|
||
```bash | ||
```sh | ||
# Clone | ||
git clone https://www.github.com/val-town/sdk | ||
cd sdk | ||
$ git clone https://www.github.com/val-town/sdk | ||
$ cd sdk | ||
|
||
# With yarn | ||
yarn link | ||
cd ../my-package | ||
yarn link @valtown/sdk | ||
$ yarn link | ||
$ cd ../my-package | ||
$ yarn link @valtown/sdk | ||
|
||
# With pnpm | ||
pnpm link --global | ||
cd ../my-package | ||
pnpm link -—global @valtown/sdk | ||
$ pnpm link --global | ||
$ cd ../my-package | ||
$ pnpm link -—global @valtown/sdk | ||
``` | ||
|
||
## Running tests | ||
|
||
Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. | ||
|
||
```bash | ||
npx prism mock path/to/your/openapi.yml | ||
```sh | ||
$ npx prism mock path/to/your/openapi.yml | ||
``` | ||
|
||
```bash | ||
yarn run test | ||
```sh | ||
$ yarn run test | ||
``` | ||
|
||
## Linting and formatting | ||
|
@@ -82,14 +82,14 @@ This repository uses [prettier](https://www.npmjs.com/package/prettier) and | |
|
||
To lint: | ||
|
||
```bash | ||
yarn lint | ||
```sh | ||
$ yarn lint | ||
``` | ||
|
||
To format and fix all lint issues automatically: | ||
|
||
```bash | ||
yarn fix | ||
```sh | ||
$ yarn fix | ||
``` | ||
|
||
## Publishing and releases | ||
|
This file contains 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
This file contains 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,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eux | ||
|
||
# Build the project | ||
yarn build | ||
|
||
# Navigate to the dist directory | ||
cd dist-deno | ||
|
||
npx jsr publish ${JSR_TOKEN:+"--token=$JSR_TOKEN"} |
This file contains 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,10 @@ | ||
{ | ||
"name": "@valtown/sdk", | ||
"version": "0.24.0", | ||
"exports": "./index.ts", | ||
"publish": { | ||
"exclude": [ | ||
"!." | ||
] | ||
} | ||
} |
This file contains 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@valtown/sdk", | ||
"version": "0.23.0", | ||
"version": "0.24.0", | ||
"description": "The official TypeScript library for the Val Town API", | ||
"author": "Val Town <[email protected]>", | ||
"types": "dist/index.d.ts", | ||
|
@@ -10,7 +10,7 @@ | |
"license": "MIT", | ||
"packageManager": "[email protected]", | ||
"files": [ | ||
"*" | ||
"**/*" | ||
], | ||
"private": false, | ||
"scripts": { | ||
|
@@ -41,10 +41,10 @@ | |
"eslint": "^8.49.0", | ||
"eslint-plugin-prettier": "^5.0.1", | ||
"eslint-plugin-unused-imports": "^3.0.0", | ||
"iconv-lite": "^0.6.3", | ||
"jest": "^29.4.0", | ||
"prettier": "^3.0.0", | ||
"ts-jest": "^29.1.0", | ||
"ts-morph": "^19.0.0", | ||
"ts-node": "^10.5.0", | ||
"tsc-multi": "^1.1.0", | ||
"tsconfig-paths": "^4.0.0", | ||
|
This file contains 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
This file contains 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
This file contains 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,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -exuo pipefail | ||
|
||
cd "$(dirname "$0")/.." | ||
|
||
rm -rf dist-deno; mkdir dist-deno | ||
cp -rp src/* jsr.json dist-deno | ||
|
||
rm dist-deno/_shims/auto/*-node.ts | ||
for dir in dist-deno/_shims dist-deno/_shims/auto; do | ||
rm "${dir}"/*.{d.ts,js,mjs} | ||
for file in "${dir}"/*-deno.ts; do | ||
mv -- "$file" "${file%-deno.ts}.ts" | ||
done | ||
done | ||
for file in README.md LICENSE CHANGELOG.md; do | ||
if [ -e "${file}" ]; then cp "${file}" dist-deno; fi | ||
done |
This file contains 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
Oops, something went wrong.