Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update spin v2 docs to point at sdk-v2 branch for JS #1471

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/spin/v2/ai-sentiment-analysis-api-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ The above installation script automatically installs the latest SDKs for Rust (w
<!-- @selectiveCpy -->

```bash
$ spin templates install --git https://github.com/fermyon/spin-js-sdk --upgrade
$ spin templates install --git https://github.com/fermyon/spin-js-sdk --upgrade --branch sdk-v2
```

**Python**
Expand Down
2 changes: 1 addition & 1 deletion content/spin/v2/http-outbound.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const response = await fetch("https://example.com/users");

**Notes**

You can find a complete example of using outbound HTTP in the JavaScript SDK repository on [GitHub](https://github.com/fermyon/spin-js-sdk/tree/main/examples/common-patterns/outbound-http)
You can find a complete example of using outbound HTTP in the JavaScript SDK repository on [GitHub](https://github.com/fermyon/spin-js-sdk/tree/sdk-v2/examples/common-patterns/outbound-http)

**Note**: `fetch` currently only works when building for the HTTP trigger.

Expand Down
2 changes: 1 addition & 1 deletion content/spin/v2/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ Spin JS SDK:
<!-- @selectiveCpy -->

```bash
$ spin templates install --git https://github.com/fermyon/spin-js-sdk --upgrade
$ spin templates install --git https://github.com/fermyon/spin-js-sdk --upgrade --branch sdk-v2
```

To list installed templates, run:
Expand Down
8 changes: 4 additions & 4 deletions content/spin/v2/javascript-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ With JavaScript being a very popular language, Spin provides an SDK to support b
> This guide assumes you are familiar with the JavaScript programming language,
> but if you are just getting started, be sure to check [the MDN guide](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide).

> All examples from this page can be found in [the JavaScript SDK repository on GitHub](https://github.com/fermyon/spin-js-sdk/tree/main/examples).
> All examples from this page can be found in [the JavaScript SDK repository on GitHub](https://github.com/fermyon/spin-js-sdk/tree/sdk-v2/examples).

[**Want to go straight to the Spin SDK reference documentation?** Find it here.](https://fermyon.github.io/spin-js-sdk/)

## Installing Templates

The JavaScript/TypeScript templates can be installed from [spin-js-sdk repository](https://github.com/fermyon/spin-js-sdk/tree/main/) using the following command:
The JavaScript/TypeScript templates can be installed from [spin-js-sdk repository](https://github.com/fermyon/spin-js-sdk/tree/sdk-v2/) using the following command:

<!-- @selectiveCpy -->

```bash
$ spin templates install --git https://github.com/fermyon/spin-js-sdk --update
$ spin templates install --git https://github.com/fermyon/spin-js-sdk --update --branch sdk-v2
```

which will install the `http-js` and `http-ts` templates:
Expand Down Expand Up @@ -238,7 +238,7 @@ proxies or URL shorteners.
## Storing Data in Redis From JS/TS Components

> You can find a complete example for using outbound Redis from an HTTP component
> in the [spin-js-sdk repository on GitHub](https://github.com/fermyon/spin-js-sdk/blob/main/examples/spin-host-apis/spin-redis).
> in the [spin-js-sdk repository on GitHub](https://github.com/fermyon/spin-js-sdk/blob/sdk-v2/examples/spin-host-apis/spin-redis).

Using the Spin's JS SDK, you can use the Redis key/value store and to publish messages to Redis channels.

Expand Down
2 changes: 1 addition & 1 deletion content/spin/v2/key-value-store-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ $ spin new -t http-rust spin-key-value
```bash
$ spin new -t http-ts spin-key-value

# Reference: https://github.com/fermyon/spin-js-sdk/tree/main/examples/spin-host-apis/spin-kv
# Reference: https://github.com/fermyon/spin-js-sdk/tree/sdk-v2/examples/spin-host-apis/spin-kv
```

{{ blockEnd }}
Expand Down
2 changes: 1 addition & 1 deletion content/spin/v2/mqtt-outbound.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ connection.publish("pets", catPicture, QoS.AtleastOnce);

For full details of the MQTT API, see the [Spin SDK reference documentation](https://fermyon.github.io/spin-js-sdk/modules/Mqtt.html)

You can find a complete Rust code example for using outbound MQTT from an HTTP component in the [Spin Rust SDK repository on GitHub](https://github.com/fermyon/spin-js-sdk/tree/main/examples/spin-host-apis/spin-mqtt).
You can find a complete Rust code example for using outbound MQTT from an HTTP component in the [Spin Rust SDK repository on GitHub](https://github.com/fermyon/spin-js-sdk/tree/sdk-v2/examples/spin-host-apis/spin-mqtt).

{{ blockEnd }}

Expand Down
2 changes: 1 addition & 1 deletion content/spin/v2/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Note: The Rust templates are in a repo that contains several other languages; th
<!-- @selectiveCpy -->

```bash
$ spin templates install --git https://github.com/fermyon/spin-js-sdk --update
$ spin templates install --git https://github.com/fermyon/spin-js-sdk --update --branch sdk-v2
Copying remote template source
Installing template http-js...
Installing template http-ts...
Expand Down
3 changes: 2 additions & 1 deletion content/spin/v2/rdbms-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ url = "https://github.com/fermyon/developer/blob/main/content/spin/v2/rdbms-stor
---
- [Using MySQL and PostgreSQL From Applications](#using-mysql-and-postgresql-from-applications)
- [Granting Network Permissions to Components](#granting-network-permissions-to-components)
- [Configuration-Based Permissions](#configuration-based-permissions)

Spin provides two interfaces for relational (SQL) databases:

Expand Down Expand Up @@ -72,7 +73,7 @@ For full information about the MySQL and PostgreSQL APIs, see [the Spin SDK refe

> [**Want to go straight to the reference documentation?** Find it here.](https://fermyon.github.io/spin-js-sdk/)

The code below is an [Outbound MySQL example](https://github.com/fermyon/spin-js-sdk/tree/main/examples/spin-host-apis/spin-mysql). There is also an outbound [PostgreSQL example](https://github.com/fermyon/spin-js-sdk/tree/main/examples/spin-host-apis/spin-postgres) available.
The code below is an [Outbound MySQL example](https://github.com/fermyon/spin-js-sdk/tree/sdk-v2/examples/spin-host-apis/spin-mysql). There is also an outbound [PostgreSQL example](https://github.com/fermyon/spin-js-sdk/tree/sdk-v2/examples/spin-host-apis/spin-postgres) available.

```ts
import { ResponseBuilder, Mysql } from '@fermyon/spin-sdk';
Expand Down
2 changes: 1 addition & 1 deletion content/spin/v2/redis-outbound.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ let value = db.get(key);

* The arguments and results can be either numbers or buffers. (In TypeScript they are union types, e.g. `BigInt | Uint8Array`.)

You can find a complete TypeScript example for using outbound Redis from an HTTP component in the [JavaScript SDK repository on GitHub](https://github.com/fermyon/spin-js-sdk/tree/main/examples/spin-host-apis/spin-redis). Please also see this, related, [outbound Redis (using TypeScript) section](./javascript-components#storing-data-in-redis-from-jsts-components).
You can find a complete TypeScript example for using outbound Redis from an HTTP component in the [JavaScript SDK repository on GitHub](https://github.com/fermyon/spin-js-sdk/tree/sdk-v2/examples/spin-host-apis/spin-redis). Please also see this, related, [outbound Redis (using TypeScript) section](./javascript-components#storing-data-in-redis-from-jsts-components).

{{ blockEnd }}

Expand Down
2 changes: 1 addition & 1 deletion content/spin/v2/serverless-ai-hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ To enable Serverless AI functionality via TypeScript/Javascript, please ensure y
<!-- @selectiveCpy -->

```bash
$ spin templates install --git https://github.com/fermyon/spin-js-sdk --upgrade
$ spin templates install --git https://github.com/fermyon/spin-js-sdk --upgrade --branch sdk-v2
```

**Python**
Expand Down
Loading