Skip to content
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: 2 additions & 0 deletions .build/check-broken-links.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ if ! blc -rv
--exclude 'https://openai.com/' \
--exclude 'https://platform.openai.com/' \
--exclude 'https://www.akamai.com/why-akamai/global-infrastructure' \
`## returns 403` \
--exclude 'https://inviter.co/cncf' \
`## returns 429` \
--exclude 'developer.hashicorp.com' \
--exclude 'https://cursor.com/docs/context/mcp' \
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ env:

jobs:
build:
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- name: Setup Node
uses: actions/setup-node@v4
uses: actions/setup-node@v7
with:
node-version: 20

Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
npm test

- name: Archive app artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: app
# These are all of the paths referenced in spin.toml
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ on:

jobs:
deploy-preview:
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.head.repo.fork }}
name: Build and deploy
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- name: Setup `spin`
uses: fermyon/actions/spin/setup@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:
uses: ./.github/workflows/build.yaml

deploy:
runs-on: ubuntu-24.04
runs-on: ubuntu-latest
needs: build
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: app
path: "${{ github.workspace }}"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/update-cli-reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Create PR with CLI reference bumped
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- name: Download Spin
uses: fermyon/actions/spin/setup@v1
Expand All @@ -34,15 +34,15 @@ jobs:
run: spin maintenance generate-reference >>./content/v3/cli-reference.md

- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
uses: crazy-max/ghaction-import-gpg@v7
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true

- name: Create pull request
uses: peter-evans/create-pull-request@v7
uses: peter-evans/create-pull-request@v8
with:
commit-message: "Update Spin CLI reference to latest"
title: "Update Spin CLI reference to latest"
Expand Down
4 changes: 2 additions & 2 deletions content/v4/cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ These directories are based on the [XDG specification](https://specifications.fr

Installed plugins are stored in `(DATA_DIR)/spin/plugins`. A snapshot of the plugins registry is also stored under that directory at `(DATA_DIR)/spin/plugins/.spin-plugins`; this is structured as a Git repository.

> Note: If you [install Spin](./install) using Homebrew, the plugins are stored at `$HOMEBREW_PREFIX/spinframework-spin/plugins` (previously `$HOMEBREW_PREFIX/fermyon-spin/plugins`).
> Note: If you [install Spin](./install) using Homebrew, the plugins are stored at `$HOMEBREW_PREFIX/etc/spinframework-spin/plugins` (previously `$HOMEBREW_PREFIX/etc/fermyon-spin/plugins`).

If you delete the plugins directory, you will no longer be able to run your plugins (until you reinstall them), but other Spin operations will be unaffected.

## Templates

Installed templates are stored in `(DATA_DIR)/spin/templates`.

> Note: If you [install Spin](install) using Homebrew, the templates are stored at at `$HOMEBREW_PREFIX/spinframework-spin/templates` (previously `$HOMEBREW_PREFIX/fermyon-spin/templates`).
> Note: If you [install Spin](install) using Homebrew, the templates are stored at `$HOMEBREW_PREFIX/etc/spinframework-spin/templates` (previously `$HOMEBREW_PREFIX/etc/fermyon-spin/templates`).

If you delete the templates directory, you will lose access to your installed templates (until you reinstall them), but other Spin operations will be unaffected.

Expand Down
2 changes: 1 addition & 1 deletion content/v4/http-outbound.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ You must still grant permission by including the relevant `spin.internal` hosts
allowed_outbound_hosts = ["http://authz.spin.internal", "https://reporting.spin.internal"]
```

You may use either the `http` or `https` scheme, and the scheme in the service chaining request is ignored: only the special host name matters.
You may use either the `http` or `https` scheme, but `allowed_outbound_hosts` must allow the chosen scheme. For example, if `allowed_outbound_hosts` contains only `https://authz.spin.internal`, then a request to `http://authz.spin.internal` will be disallowed.

To allow local chaining to _any_ component in your application, you can use a subdomain wildcard:

Expand Down
4 changes: 2 additions & 2 deletions content/v4/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ You can now move the Spin binary to the path knowing that it was indeed built by

```bash
$ git clone https://github.com/spinframework/spin
$ rustup target add wasm32-wasip2
$ cd spin && make build
$ ./target/release/spin --help
```
Expand Down Expand Up @@ -220,12 +221,11 @@ $ cd spin
$ # Check out the latest tagged release
$ # git checkout <latest release>
$ rustup target add wasm32-wasip2
$ rustup target add wasm32-unknown-unknown
$ cargo install --locked --path .
$ spin --help
```

> Please note: Installing Spin from source requires Rust 1.79 or newer. You can update Rust using the following command:
> Please note: Installing Spin from source requires Rust 1.94 or newer. You can update Rust using the following command:

<!-- @selectiveCpy -->

Expand Down
22 changes: 13 additions & 9 deletions content/v4/javascript-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,26 @@ The JavaScript/TypeScript templates can be installed from [spin-js-sdk repositor
$ spin templates install --git https://github.com/spinframework/spin-js-sdk --update
```

which will install the `http-js` and `http-ts` templates:
which will install the `http-js`, `http-ts`, `redis-js` and `redis-ts` templates:

<!-- @nocpy -->

```text
Copying remote template source
Installing template http-ts...
Installing template http-js...
Installed 2 template(s)

+-------------------------------------------------+
| Name Description |
+=================================================+
| http-js HTTP request handler using Javascript |
| http-ts HTTP request handler using Typescript |
+-------------------------------------------------+
Installing template redis-ts...
Installing template redis-js...
Installed 4 template(s)

+---------------------------------------------------+
| Name Description |
+===================================================+
| http-js HTTP request handler using JavaScript |
| http-ts HTTP request handler using TypeScript |
| redis-js Redis message handler using JavaScript |
| redis-ts Redis message handler using TypeScript |
+---------------------------------------------------+
```

## Structure of a JS/TS Component
Expand Down
2 changes: 1 addition & 1 deletion content/v4/manifest-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ The value of each key is a table with the following fields.
| `exclude_files` | Optional | Array of strings | Any files or glob patterns that should _not_ be available to the Wasm module at runtime, even though they match a `files` entry. | `[assets/images/test/**/*.*]` |
| `allowed_http_hosts` | Optional | Array of strings | The host names or addresses to which the Wasm component is allowed to send HTTP requests. This is retained to simplify transition from the [Version 1 manifest](../v3/manifest-reference-v1.md); new applications should use `allow_outbound_hosts` instead. | `["example.com", "localhost:8081"]` |
| `allowed_outbound_hosts` | Optional | Array of strings | The addresses to which the Wasm component is allowed to send network requests. This applies to the outbound HTTP, outbound Redis, MySQL and PostgreSQL APIs. (It does not apply to built-in storage services such as key-value and SQLite.) Each entry must contain both a scheme, a name (or IP address) and a port in `scheme://name:port` format. For known schemes, you may omit the port if it is the default for the scheme. Use `*` for wildcards. If this field is omitted or an empty list, no outbound access is permitted. | `["mysql://db.example.com", "*://example.com:4567", "http://127.0.0.1:*"]` |
| `key_value_stores` | Optional | Array of strings | An array of key-value stores that the Wasm module is allowed to read or write. A store named `default` is provided by the Spin runtime, though modules must still be permitted to access it. In current versions of Spin, `"default"` is the only store allowed. | `["default"]` |
| `key_value_stores` | Optional | Array of strings | An array of key-value stores that the Wasm module is allowed to read or write. A store named `default` is provided by the Spin runtime, though modules must still be permitted to access it. Stores other than `default` must be mapped to a backing store in the [runtime configuration](./dynamic-configuration#key-value-store-runtime-configuration). | `["default"]` |
Comment thread
ChihweiLHBird marked this conversation as resolved.
| `environment` | Optional | Table | Environment variables to be set for the Wasm module. This is a table. The table keys are user-defined; the values must be strings. | `{ DB_URL = "mysql://spin:spin@localhost/dev" }` |
| `build` | Optional | Table | The command that `spin build` uses to build this component. See [The `component.(id).build` Table](#the-componentidbuild-table) below. | `[component.cart.build]`<br />`command = "npm run build"` |
| `variables` | Optional | Table | Application configuration values to be made available to this component. The table keys are user-defined; the values must be strings, and may use template notation as described under [Application Variables](variables#adding-variables-to-your-applications). | `[component.cart.variables]`<br />`api_base_url = "https://{{ api_host }}/v1"` |
Expand Down
16 changes: 11 additions & 5 deletions content/v4/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,15 @@ $ spin templates install --git https://github.com/spinframework/spin-js-sdk --up
Copying remote template source
Installing template http-js...
Installing template http-ts...
Installing template redis-js...
Installing template redis-ts...
+------------------------------------------------------------------------+
| Name Description |
+========================================================================+
| http-js HTTP request handler using Javascript |
| http-ts HTTP request handler using Typescript |
| http-js HTTP request handler using JavaScript |
| http-ts HTTP request handler using TypeScript |
| redis-js Redis message handler using JavaScript |
| redis-ts Redis message handler using TypeScript |
+------------------------------------------------------------------------+
```

Expand Down Expand Up @@ -340,8 +344,10 @@ Use the `spin new` command and the `http-ts` template to scaffold a new Spin app
```bash
$ spin new
Pick a template to start your application with:
http-js (HTTP request handler using Javascript)
> http-ts (HTTP request handler using Typescript)
http-js (HTTP request handler using JavaScript)
> http-ts (HTTP request handler using TypeScript)
redis-js (Redis message handler using JavaScript)
redis-ts (Redis message handler using TypeScript)
Enter a name for your new application: hello_typescript
Project description: My first TypeScript Spin application
HTTP path: /...
Expand Down Expand Up @@ -696,7 +702,7 @@ If the build fails, check:

* Are you in the `hello_rust` directory?
* Did you successfully [install the `wasm32-wasip2` target](#install-the-tools)?
* Is your version of Rust up to date (`cargo --version`)? The Spin SDK needs Rust 1.91 or above.
* Is your version of Rust up to date (`cargo --version`)? The Spin SDK needs Rust 1.93 or above.

If you would like to know what build command Spin runs for a component, you can find it in the manifest, in the `component.(id).build` section:

Expand Down
2 changes: 2 additions & 0 deletions content/v4/rust-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ instance the trigger must connect to:

```toml
spin_manifest_version = 2

[application]
name = "spin-redis"
version = "0.1.0"

Expand Down
Loading