From 65beea9f0f515404c496f2e15ce5814455266c6b Mon Sep 17 00:00:00 2001 From: Vaughn Dice Date: Tue, 25 Mar 2025 13:12:46 -0600 Subject: [PATCH 1/2] ci(*): add build.yml and address some npm test errors Signed-off-by: Vaughn Dice --- .github/workflows/build.yml | 44 +++++++++++++++++++ content/v1/cli-reference.md | 1 - content/v1/index.md | 2 - content/v1/kv-store-api-guide.md | 1 - content/v1/python-components.md | 2 - content/v1/quickstart.md | 1 - content/v1/serverless-ai-api-guide.md | 1 - content/v1/serverless-ai-hello-world.md | 1 - content/v2/build.md | 1 - content/v2/cli-reference.md | 38 +--------------- content/v2/contributing-spin.md | 1 - content/v2/extending-and-embedding.md | 2 +- content/v2/javascript-components.md | 2 - content/v2/key-value-store-tutorial.md | 3 -- content/v2/observing-apps.md | 5 ++- content/v2/quickstart.md | 1 + content/v2/registry-tutorial.md | 3 +- content/v2/rust-components.md | 2 +- .../see-what-people-have-built-with-spin.md | 2 +- content/v2/serverless-ai-api-guide.md | 2 +- content/v2/serverless-ai-hello-world.md | 2 - content/v2/variables.md | 1 - content/v3/build.md | 1 - content/v3/deploying.md | 3 +- content/v3/extending-and-embedding.md | 2 +- content/v3/javascript-components.md | 2 - content/v3/key-value-store-tutorial.md | 3 -- content/v3/observing-apps.md | 4 +- content/v3/quickstart.md | 1 + content/v3/registry-tutorial.md | 3 +- content/v3/rust-components.md | 2 +- .../see-what-people-have-built-with-spin.md | 2 +- content/v3/serverless-ai-api-guide.md | 2 +- content/v3/serverless-ai-hello-world.md | 2 - content/v3/variables.md | 1 - content/v3/writing-apps.md | 8 ++-- migration_scripts/README.md | 1 - migration_scripts/clean_up_after_migration.sh | 1 - shortcodes/alert.rhai | 2 - spin-up-hub/src/components/Card.vue | 2 - spin-up-hub/src/components/ContentListing.vue | 1 - spin-up-hub/src/components/DeployPreview.vue | 4 -- .../src/components/FermyonCloudModal.vue | 1 - spin-up-hub/src/components/HubIntro.vue | 1 - spin-up-hub/src/components/PreviewModal.vue | 2 - static/js/src/modules/feedback.js | 2 - static/js/src/modules/utils.js | 1 - static/sass/developer-color-dark.scss | 1 - static/sass/developer-color.scss | 2 - static/sass/developer-include-search.scss | 4 -- static/sass/developer-include-sidebar.scss | 1 - static/sass/developer-include-topbar.scss | 1 - static/sass/developer-responsive.scss | 4 -- static/sass/styles.scss | 3 -- templates/404.hbs | 1 - templates/content_top.hbs | 1 - templates/main.hbs | 1 - templates/sidebar.hbs | 1 - 58 files changed, 67 insertions(+), 125 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..77ec294b7 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,44 @@ +name: Build +on: + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Setup Spin + uses: fermyon/actions/spin/setup@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install bart + run: | + curl -LOs https://github.com/fermyon/bartholomew/releases/download/v0.10.0/bart + chmod +x bart + mv bart /usr/local/bin + + - name: Check Docs + run: | + bart check --shortcodes shortcodes content/* && bart check --shortcodes shortcodes content/**/* + + - name: Install npm packages + run: | + npm ci + npm ci --prefix ./spin-up-hub + + - name: Build app + run: | + spin build + + - name: Run npm tests + run: | + npm test + diff --git a/content/v1/cli-reference.md b/content/v1/cli-reference.md index bc26c7407..93d5adaf4 100644 --- a/content/v1/cli-reference.md +++ b/content/v1/cli-reference.md @@ -239,7 +239,6 @@ $ spin add --help spin-add Scaffold a new component into an existing application - USAGE: spin add [OPTIONS] [ARGS] diff --git a/content/v1/index.md b/content/v1/index.md index 9cd244ad9..486b62c78 100644 --- a/content/v1/index.md +++ b/content/v1/index.md @@ -6,7 +6,6 @@ enable_shortcodes = true canonical_url = "https://spinframework.com/v2/index" url = "https://github.com/spinframework/spin-docs/blob/main/content/spin/v1/index.md" - --- Spin is a framework and CLI for building and running event-driven microservice applications with WebAssembly (Wasm) components. Spin uses Wasm because it is **sandboxed, portable, and fast**. Millisecond cold start times mean no need to keep applications "warm". @@ -21,7 +20,6 @@ Many languages have Wasm implementations, so **developers don't have to learn ne {{card_element "sample" "AI-assisted News Summarizer" "Read an RSS newsfeed and have AI summarize it for you" "/hub/preview/sample_newsreader_ai" "Typescript,Javascript,Ai" true }} {{blockEnd}} - Or dive into the documentation and get started: - [Take Spin for a spin](quickstart) diff --git a/content/v1/kv-store-api-guide.md b/content/v1/kv-store-api-guide.md index e7ebb36ae..8841d0a00 100644 --- a/content/v1/kv-store-api-guide.md +++ b/content/v1/kv-store-api-guide.md @@ -117,7 +117,6 @@ The key value functions are provided through the `spin_key_value` module in the from spin_http import Response from spin_key_value import kv_open_default - def handle_request(request): store = kv_open_default() diff --git a/content/v1/python-components.md b/content/v1/python-components.md index 5277a3f4c..1eba7ddd4 100644 --- a/content/v1/python-components.md +++ b/content/v1/python-components.md @@ -178,7 +178,6 @@ This next example will create an outbound request, to obtain a random fact about ```python from spin_http import Request, Response, http_send - def handle_request(request): response = http_send( @@ -273,7 +272,6 @@ from spin_http import Response from spin_redis import redis_del, redis_get, redis_incr, redis_set, redis_sadd, redis_srem, redis_smembers from spin_config import config_get - def handle_request(request): redis_address = config_get("redis_address") diff --git a/content/v1/quickstart.md b/content/v1/quickstart.md index 112fb79c2..9a3013a7e 100644 --- a/content/v1/quickstart.md +++ b/content/v1/quickstart.md @@ -802,7 +802,6 @@ Hello, Fermyon Congratulations! You just created, built and ran your first Spin application! - ## Next Steps - Learn more about [writing Spin components and manifests](writing-apps) diff --git a/content/v1/serverless-ai-api-guide.md b/content/v1/serverless-ai-api-guide.md index cc3cd86c8..9f4fc0342 100644 --- a/content/v1/serverless-ai-api-guide.md +++ b/content/v1/serverless-ai-api-guide.md @@ -149,7 +149,6 @@ export const handleRequest: HandleRequest = async function (request: HttpRequest from spin_http import Response from spin_llm import llm_infer - def handle_request(request): prompt="You are a stand up comedy writer. Tell me a joke." result=llm_infer("llama2-chat", prompt) diff --git a/content/v1/serverless-ai-hello-world.md b/content/v1/serverless-ai-hello-world.md index 399f3400b..0ccd31af0 100644 --- a/content/v1/serverless-ai-hello-world.md +++ b/content/v1/serverless-ai-hello-world.md @@ -269,7 +269,6 @@ def handle_request(request): except Exception as e: return Response(500, {"content-type": "text/plain"}, bytes(f"Error: {str(e)}", "utf-8")) - ``` {{ blockEnd }} diff --git a/content/v2/build.md b/content/v2/build.md index c06095d5a..e690b4260 100644 --- a/content/v2/build.md +++ b/content/v2/build.md @@ -68,7 +68,6 @@ command = "cargo build --target wasm32-wasi --release" For JavaScript and TypeScript applications, you must have [Node.js](https://nodejs.org). - It's normally convenient to put the detailed build instructions in `package.json`. The build script looks like: diff --git a/content/v2/cli-reference.md b/content/v2/cli-reference.md index c33e3168c..c7095c866 100644 --- a/content/v2/cli-reference.md +++ b/content/v2/cli-reference.md @@ -322,7 +322,6 @@ OPTIONS: {{ blockEnd }} - {{ blockEnd }} @@ -561,7 +560,6 @@ OPTIONS: {{ blockEnd }} - {{ blockEnd }} @@ -611,7 +609,6 @@ The `spin cloud` command is implemented by the [Fermyon Cloud Plugin](/cloud/clo {{ blockEnd }} - {{ blockEnd }} @@ -661,7 +658,6 @@ The `spin cloud apps` command is implemented by the [Fermyon Cloud Plugin](/clou {{ blockEnd }} - {{ blockEnd }} @@ -711,7 +707,6 @@ The `spin cloud deploy` command is implemented by the [Fermyon Cloud Plugin](/cl {{ blockEnd }} - {{ blockEnd }} @@ -761,7 +756,6 @@ The `spin cloud link` command is implemented by the [Fermyon Cloud Plugin](/clou {{ blockEnd }} - {{ blockEnd }} @@ -811,7 +805,6 @@ The `spin cloud login` command is implemented by the [Fermyon Cloud Plugin](/clo {{ blockEnd }} - {{ blockEnd }} @@ -861,7 +854,6 @@ The `spin cloud sqlite` command is implemented by the [Fermyon Cloud Plugin](/cl {{ blockEnd }} - {{ blockEnd }} @@ -911,7 +903,6 @@ The `spin cloud unlink` command is implemented by the [Fermyon Cloud Plugin](/cl {{ blockEnd }} - {{ blockEnd }} @@ -961,7 +952,6 @@ The `spin cloud variables` command is implemented by the [Fermyon Cloud Plugin]( {{ blockEnd }} - {{ blockEnd }} @@ -1128,7 +1118,6 @@ OPTIONS: {{ blockEnd }} - {{ blockEnd }} @@ -1178,7 +1167,6 @@ OPTIONS: {{ blockEnd }} - {{ blockEnd }} @@ -1204,7 +1192,6 @@ The `spin kube` command is implemented by the [`spin-kube` plugin](https://www.s {{ blockEnd }} - {{ blockEnd }} @@ -1230,7 +1217,6 @@ The `spin kube completion` command is implemented by the [`spin-kube` plugin](ht {{ blockEnd }} - {{ blockEnd }} @@ -1256,7 +1242,6 @@ The `spin kube scaffold` command is implemented by the [`spin-kube` plugin](http {{ blockEnd }} - {{ blockEnd }} @@ -1535,7 +1520,6 @@ OPTIONS: {{ blockEnd }} - {{ blockEnd }} **Please note: `spin new` vs `spin add`**. These commands are similar except that: @@ -1744,7 +1728,6 @@ SUBCOMMANDS: {{ blockEnd }} - {{ blockEnd }} @@ -2039,7 +2022,6 @@ OPTIONS: {{ blockEnd }} - {{ blockEnd }} @@ -2193,8 +2175,8 @@ OPTIONS: --installed List only installed plugins --summary List latest and installed versions of plugins ``` -{{ blockEnd }} +{{ blockEnd }} {{ blockEnd }} @@ -2350,7 +2332,6 @@ OPTIONS: {{ blockEnd }} - {{ blockEnd }} @@ -2512,7 +2493,6 @@ OPTIONS: {{ blockEnd }} - {{ blockEnd }} @@ -2653,7 +2633,6 @@ OPTIONS: {{ blockEnd }} - {{ blockEnd }} @@ -2969,7 +2948,6 @@ OPTIONS: {{ blockEnd }} - {{ blockEnd }} **Note:** For additional information, please see the [Managing Plugins](/spin/managing-plugins) and/or [Creating Plugins](/spin/plugin-authoring) sections of the documentation. @@ -3147,7 +3125,6 @@ SUBCOMMANDS: {{ blockEnd }} - {{ blockEnd }} @@ -3330,7 +3307,6 @@ OPTIONS: {{ blockEnd }} - {{ blockEnd }} @@ -3520,7 +3496,6 @@ OPTIONS: {{ blockEnd }} - {{ blockEnd }} @@ -3754,7 +3729,6 @@ OPTIONS: {{ blockEnd }} - {{ blockEnd }} @@ -3970,7 +3944,6 @@ SUBCOMMANDS: {{ blockEnd }} - {{ blockEnd }} @@ -4230,7 +4203,6 @@ OPTIONS: {{ blockEnd }} - {{ blockEnd }} @@ -4385,7 +4357,6 @@ OPTIONS: {{ blockEnd }} - {{ blockEnd }} @@ -4549,7 +4520,6 @@ OPTIONS: {{ blockEnd }} - {{ blockEnd }} @@ -4795,7 +4765,6 @@ OPTIONS: {{ blockEnd }} - {{ blockEnd }} **Note:** For additional information, please see the [Managing Templates](/spin/managing-templates) and/or [Creating Templates](/spin/template-authoring) sections of the documentation. @@ -4880,7 +4849,6 @@ Options: {{ blockEnd }} - {{ blockEnd }} @@ -5443,7 +5411,6 @@ HTTP TRIGGER OPTIONS: {{ blockEnd }} - {{ blockEnd }} > **Please note:** If the `-f` or `--from` options do not accurately infer the intended registry or `.toml` file for your application, then you can explicitly specify either the `--from-registry` or `--from-file` options to clarify this. @@ -5632,7 +5599,6 @@ The following additional trigger options are available for the [spin up](#spin-u {{ blockEnd }} - {{ blockEnd }} @@ -5843,7 +5809,6 @@ OPTIONS: {{ blockEnd }} - {{ blockEnd }} ## Stability Table @@ -5976,5 +5941,4 @@ CLI commands have four phases that indicate levels of stability: | spin test | Experimental | {{ blockEnd }} - {{ blockEnd }} diff --git a/content/v2/contributing-spin.md b/content/v2/contributing-spin.md index c356128c2..dc4ee1a4f 100644 --- a/content/v2/contributing-spin.md +++ b/content/v2/contributing-spin.md @@ -15,7 +15,6 @@ This document will guide you through making your first contribution to the proje We welcome and appreciate contributions of all types — opening issues, fixing typos, adding examples, one-liner code fixes, tests, or complete features. - ## Developer Community Calls
diff --git a/content/v2/extending-and-embedding.md b/content/v2/extending-and-embedding.md index 2b0e592dd..ee84c2cf2 100644 --- a/content/v2/extending-and-embedding.md +++ b/content/v2/extending-and-embedding.md @@ -110,7 +110,7 @@ impl TriggerExecutor for TimerTrigger { } ``` -### The Trigger is an Executable +### The Trigger Is an Executable A trigger is a separate program, so that it can be installed as a plugin. So it is a Rust `bin` project and has a `main` function. It can be useful to also provide a library crate, so that projects that embed Spin can load it in process if desired, but the timer sample doesn't currently show that. diff --git a/content/v2/javascript-components.md b/content/v2/javascript-components.md index b757f8886..7f8b31bec 100644 --- a/content/v2/javascript-components.md +++ b/content/v2/javascript-components.md @@ -359,14 +359,12 @@ This library only currently supports the following polyfills: - `fs` - only implements `readFileSync` and `readdirSync`. - `os` - Implements only `EOL` and `arch`. - ## Using External NPM Libraries > Not all the NPM packages are guaranteed to work with the SDK as it is not fully compatible with the browser or `Node.js`. It implements only a subset of the API. Some NPM packages can be installed and used in the component. If a popular library does not work, please open an issue/feature request in the [spin-js-sdk repository](https://github.com/spinframework/spin-js-sdk/issues). - ### Suggested Libraries for Common Tasks These are some of the suggested libraries that have been tested and confirmed to work with the SDK for common tasks. diff --git a/content/v2/key-value-store-tutorial.md b/content/v2/key-value-store-tutorial.md index a16341522..08a3dad76 100644 --- a/content/v2/key-value-store-tutorial.md +++ b/content/v2/key-value-store-tutorial.md @@ -147,7 +147,6 @@ key_value_stores = ["default"] ... ``` - ## Write Code to Save and Load Data In this section, we use the Spin SDK to open and persist our application's data inside our default key/value store. This is a special store that every environment running Spin applications will make available for their application. @@ -319,7 +318,6 @@ class IncomingHandler(http.IncomingHandler): {{ blockEnd }} - {{ startTab "TinyGo" }} ```go @@ -521,4 +519,3 @@ Congratulations, you have a Spin application and associated Key Value store runn * Explore the contents of your Key Value store with the [Key Value Store Explorer template](../../hub/preview/template_kv_explorer) * Learn about linking your applications to different [Key Value Stores on Fermyon Cloud](../../cloud/kv-cloud-tutorial.md) - diff --git a/content/v2/observing-apps.md b/content/v2/observing-apps.md index a88614142..0e0c966f3 100644 --- a/content/v2/observing-apps.md +++ b/content/v2/observing-apps.md @@ -33,13 +33,14 @@ We have a plugin that makes it easy to use OpenTelemetry with Spin. If you would spin plugins update spin plugins install otel ``` + - To see the available commands, you can run `spin otel --help` -## Configuring your own observability stack +## Configuring Your Own Observability Stack Follow this portion of the guide if you want to use Spin and OTel, but want to have more control than what the OTel plugin offers. -### Configure the Docker compose stack +### Configure the Docker Compose Stack In order to view the telemetry data you need to run an OTel compliant [collector](https://opentelemetry.io/docs/collector/) and the proper backends for each signal type. If you have Docker on your system you can easily start all the observability tools you need with the following commands: diff --git a/content/v2/quickstart.md b/content/v2/quickstart.md index 8d8c3f137..430a16141 100644 --- a/content/v2/quickstart.md +++ b/content/v2/quickstart.md @@ -554,6 +554,7 @@ source = "app.wasm" [component.hello-python.build] command = "componentize-py -w spin-http componentize app -o app.wasm" ``` + This represents a simple Spin HTTP application (triggered by an HTTP request). It has: * A single HTTP trigger, for the `/...` route, associated with the `hello-python` component. `/...` is a wildcard, meaning it will match any route. When the application gets an HTTP request that matches this route - that is, any HTTP request at all! - Spin will run the `hello-python` component. diff --git a/content/v2/registry-tutorial.md b/content/v2/registry-tutorial.md index 4faf9361c..6ea361b20 100644 --- a/content/v2/registry-tutorial.md +++ b/content/v2/registry-tutorial.md @@ -102,13 +102,12 @@ Lastly, let's run this Spin application: $ spin up -f ghcr.io/USERNAME/spin-react-fullstack:v1 ``` -## Deploy a Spin App from GHCR (or any registry) +## Deploy a Spin App From GHCR (or Any Registry) You can deploy a Spin app from any registry such as GHCR or DockerHub using the CLI command `spin deploy -f ` > **Note:** You need a Fermyon Cloud account to deploy to. The remote-reference can be private, as long as you are authenticated locally to the registry in question, since the CLI will pull it down prior to publishing it to Cloud's internal registry. - ## Conclusion Congratulations on completing this tutorial! You have now successfully built, pushed, pulled, and run a Spin app using GHCR. Behind the scenes, Spin uses [OCI artifacts](https://github.com/opencontainers/artifacts) project to distribute Spin apps across container registries. To learn more about how this feature works, take a look at [our proposal](https://github.com/spinframework/spin/blob/main/docs/content/sips/008-using-oci-registries.md) and [the implementation](https://github.com/spinframework/spin/pull/1014). diff --git a/content/v2/rust-components.md b/content/v2/rust-components.md index 38bcacd44..80a333fc2 100644 --- a/content/v2/rust-components.md +++ b/content/v2/rust-components.md @@ -508,7 +508,7 @@ annotated using the `http_component` macro, compiled to the `wasm32-wasi` target This means that any [crate](https://crates.io) that compiles to `wasm32-wasi` can be used when implementing the component. -### Using the `http` crate +### Using the `http` Crate If you're already familiar with the popular [`http` crate](https://crates.io/crates/http), you may wish to use that instead of using the HTTP types included in the Spin SDK. Generally, the `http` crate's types can be used anywhere the Spin SDK HTTP types can be used. For example, the first basic HTTP component can be rewritten to use the `http` crate like so: diff --git a/content/v2/see-what-people-have-built-with-spin.md b/content/v2/see-what-people-have-built-with-spin.md index 00dc31bd9..21e879e3c 100644 --- a/content/v2/see-what-people-have-built-with-spin.md +++ b/content/v2/see-what-people-have-built-with-spin.md @@ -19,7 +19,7 @@ url = "https://github.com/spinframework/spin-docs/blob/main/content/spin/v2/see- Spin can be used to build many different types of applications. The following blog articles show how different applications are built with Spin. -## AI-powered bookmarking app with Python and WebAssembly +## AI-Powered Bookmarking App with Python and WebAssembly [How to build an AI-powered bookmarking app with Python and WebAssembly](https://dev.to/fermyon/part-1-how-to-build-an-ai-powered-bookmarking-app-with-python-and-webassembly-2c5b). diff --git a/content/v2/serverless-ai-api-guide.md b/content/v2/serverless-ai-api-guide.md index 07a52d547..7fd77732e 100644 --- a/content/v2/serverless-ai-api-guide.md +++ b/content/v2/serverless-ai-api-guide.md @@ -235,7 +235,7 @@ func init() { ## Troubleshooting -### Error "Local LLM operations are not supported in this version of Spin" +### Error "Local LLM Operations Are Not Supported in This Version of Spin" If you see "Local LLM operations are not supported in this version of Spin", then your copy of Spin has been built without local LLM support. diff --git a/content/v2/serverless-ai-hello-world.md b/content/v2/serverless-ai-hello-world.md index 85353dbeb..e03972840 100644 --- a/content/v2/serverless-ai-hello-world.md +++ b/content/v2/serverless-ai-hello-world.md @@ -63,7 +63,6 @@ python3 --version If you do not have Python 3.10 or later, you can install it by following the instructions [here](https://www.python.org/downloads/). - To enable Serverless AI functionality via Python, please ensure you have the latest Python template installed: @@ -336,7 +335,6 @@ class IncomingHandler(http.IncomingHandler): bytes(res.text, "utf-8") ) - ``` {{ blockEnd }} diff --git a/content/v2/variables.md b/content/v2/variables.md index 2b499dc52..3076f1615 100644 --- a/content/v2/variables.md +++ b/content/v2/variables.md @@ -55,7 +55,6 @@ Variables can also be used in other sections of the application manifest that be allowed_outbound_hosts = [ "\{{ api_uri }}" ] ``` - All in all, an application manifest with `api_token` and `api_uri` variables and a component that uses them would look similar to the following: diff --git a/content/v3/build.md b/content/v3/build.md index 5ea512628..f5d64c3d4 100644 --- a/content/v3/build.md +++ b/content/v3/build.md @@ -70,7 +70,6 @@ command = "cargo build --target wasm32-wasip1 --release" For JavaScript and TypeScript applications, you must have [Node.js](https://nodejs.org). - It's normally convenient to put the detailed build instructions in `package.json`. The build script looks like: diff --git a/content/v3/deploying.md b/content/v3/deploying.md index 0f68335ee..b40f518a9 100644 --- a/content/v3/deploying.md +++ b/content/v3/deploying.md @@ -6,7 +6,7 @@ url = "https://github.com/spinframework/spin-docs/blob/main/content/spin/v3/depl --- -### Running locally on your workstation +### Running Locally on Your Workstation For instructions guiding you through running Spin apps on your development workstation, follow [this guide](/running-app). @@ -15,7 +15,6 @@ follow [this guide](/running-app). Spin applications can be deployed to a Kubernetes cluster with [SpinKube](https://www.spinkube.dev/docs/overview/) - an open source project that streamlines the experience of developing, deploying, and operating Wasm workloads on Kubernetes. Like Spin, SpinKube is a CNCF Sandbox project. - ## Fermyon Cloud [Fermyon Cloud](/cloud) is a self-service application platform for WebAssembly-based serverless functions and microservices. It enables you to run Spin applications, at scale, in the cloud, without any infrastructure setup or maintenance required. diff --git a/content/v3/extending-and-embedding.md b/content/v3/extending-and-embedding.md index efaeee089..1e7e20b55 100644 --- a/content/v3/extending-and-embedding.md +++ b/content/v3/extending-and-embedding.md @@ -111,7 +111,7 @@ impl Trigger for TimerTrigger { The `Trigger` trait is generic in the set of _factors_ supported by the trigger - this is roughly the set of APIs available to guest code. In most circumstances, your implementation should also be generic, as shown, because your trigger is only concerned with detecting events, and can do that regardless of what APIs are available to the guests that handle those events. -### The Trigger is an Executable +### The Trigger Is an Executable A trigger is a separate program, so that it can be installed as a plugin. So it is a Rust `bin` project and has a `main` function. It can be useful to also provide a library crate, so that projects that embed Spin can load it in process if desired, but the timer sample doesn't currently show that. diff --git a/content/v3/javascript-components.md b/content/v3/javascript-components.md index fde634904..590507f12 100644 --- a/content/v3/javascript-components.md +++ b/content/v3/javascript-components.md @@ -341,14 +341,12 @@ This library only currently supports the following polyfills: - `fs` - only implements `readFileSync` and `readdirSync`. - `os` - Implements only `EOL` and `arch`. - ## Using External NPM Libraries > Not all the NPM packages are guaranteed to work with the SDK as it is not fully compatible with the browser or `Node.js`. It implements only a subset of the API. Some NPM packages can be installed and used in the component. If a popular library does not work, please open an issue/feature request in the [spin-js-sdk repository](https://github.com/spinframework/spin-js-sdk/issues). - ### Suggested Libraries for Common Tasks These are some of the suggested libraries that have been tested and confirmed to work with the SDK for common tasks. diff --git a/content/v3/key-value-store-tutorial.md b/content/v3/key-value-store-tutorial.md index 238564682..05b07ef76 100644 --- a/content/v3/key-value-store-tutorial.md +++ b/content/v3/key-value-store-tutorial.md @@ -147,7 +147,6 @@ key_value_stores = ["default"] ... ``` - ## Write Code to Save and Load Data In this section, we use the Spin SDK to open and persist our application's data inside our default key/value store. This is a special store that every environment running Spin applications will make available for their application. @@ -321,7 +320,6 @@ class IncomingHandler(http.IncomingHandler): {{ blockEnd }} - {{ startTab "TinyGo" }} ```go @@ -523,4 +521,3 @@ Congratulations, you have a Spin application and associated Key Value store runn * Explore the contents of your Key Value store with the [Key Value Store Explorer template](../../hub/preview/template_kv_explorer) * Learn about linking your applications to different [Key Value Stores on Fermyon Cloud](../../cloud/kv-cloud-tutorial.md) - diff --git a/content/v3/observing-apps.md b/content/v3/observing-apps.md index 861f36b2e..6778a711f 100644 --- a/content/v3/observing-apps.md +++ b/content/v3/observing-apps.md @@ -55,11 +55,11 @@ As your observability stack of choice is executed using traditional containers, To see all available commands of the `otel` plugin, you can run `spin otel --help`. -## Configuring your own observability stack +## Configuring Your Own Observability Stack Follow this portion of the guide if you want to use Spin and OTel, but want to have more control than what the OTel plugin offers. -### Configure the Docker compose stack +### Configure the Docker Compose Stack In order to view the telemetry data you need to run an OTel compliant [collector](https://opentelemetry.io/docs/collector/) and the proper backends for each signal type. If you have Docker on your system you can easily start all the observability tools you need with the following commands: diff --git a/content/v3/quickstart.md b/content/v3/quickstart.md index 88e142b36..e072deaed 100644 --- a/content/v3/quickstart.md +++ b/content/v3/quickstart.md @@ -546,6 +546,7 @@ source = "app.wasm" [component.hello-python.build] command = "componentize-py -w spin-http componentize app -o app.wasm" ``` + This represents a simple Spin HTTP application (triggered by an HTTP request). It has: * A single HTTP trigger, for the `/...` route, associated with the `hello-python` component. `/...` is a wildcard, meaning it will match any route. When the application gets an HTTP request that matches this route - that is, any HTTP request at all! - Spin will run the `hello-python` component. diff --git a/content/v3/registry-tutorial.md b/content/v3/registry-tutorial.md index 8fb2a1950..3a12efe94 100644 --- a/content/v3/registry-tutorial.md +++ b/content/v3/registry-tutorial.md @@ -102,13 +102,12 @@ Lastly, let's run this Spin application: $ spin up -f ghcr.io/USERNAME/spin-react-fullstack:v1 ``` -## Deploy a Spin App from GHCR (or any registry) +## Deploy a Spin App From GHCR (or Any Registry) You can deploy a Spin app from any registry such as GHCR or DockerHub using the CLI command `spin deploy -f ` > **Note:** You need a Fermyon Cloud account to deploy to. The remote-reference can be private, as long as you are authenticated locally to the registry in question, since the CLI will pull it down prior to publishing it to Cloud's internal registry. - ## Conclusion Congratulations on completing this tutorial! You have now successfully built, pushed, pulled, and run a Spin app using GHCR. Behind the scenes, Spin uses [OCI artifacts](https://github.com/opencontainers/artifacts) project to distribute Spin apps across container registries. To learn more about how this feature works, take a look at [our proposal](https://github.com/spinframework/spin/blob/main/docs/content/sips/008-using-oci-registries.md) and [the implementation](https://github.com/spinframework/spin/pull/1014). diff --git a/content/v3/rust-components.md b/content/v3/rust-components.md index 550d20aa9..b9ee3683b 100644 --- a/content/v3/rust-components.md +++ b/content/v3/rust-components.md @@ -523,7 +523,7 @@ annotated using the `http_component` macro, compiled to the `wasm32-wasip1` targ This means that any [crate](https://crates.io) that compiles to `wasm32-wasip1` can be used when implementing the component. -### Using the `http` crate +### Using the `http` Crate If you're already familiar with the popular [`http` crate](https://crates.io/crates/http), you may wish to use that instead of using the HTTP types included in the Spin SDK. Generally, the `http` crate's types can be used anywhere the Spin SDK HTTP types can be used. For example, the first basic HTTP component can be rewritten to use the `http` crate like so: diff --git a/content/v3/see-what-people-have-built-with-spin.md b/content/v3/see-what-people-have-built-with-spin.md index 80e5771e8..a76014444 100644 --- a/content/v3/see-what-people-have-built-with-spin.md +++ b/content/v3/see-what-people-have-built-with-spin.md @@ -19,7 +19,7 @@ url = "https://github.com/spinframework/spin-docs/blob/main/content/spin/v3/see- Spin can be used to build many different types of applications. The following blog articles show how different applications are built with Spin. -## AI-powered bookmarking app with Python and WebAssembly +## AI-Powered Bookmarking App with Python and WebAssembly [How to build an AI-powered bookmarking app with Python and WebAssembly](https://dev.to/fermyon/part-1-how-to-build-an-ai-powered-bookmarking-app-with-python-and-webassembly-2c5b). diff --git a/content/v3/serverless-ai-api-guide.md b/content/v3/serverless-ai-api-guide.md index da5f5d34b..058ec6f36 100644 --- a/content/v3/serverless-ai-api-guide.md +++ b/content/v3/serverless-ai-api-guide.md @@ -247,7 +247,7 @@ func init() { ## Troubleshooting -### Error "Local LLM operations are not supported in this version of Spin" +### Error "Local LLM Operations Are Not Supported in This Version of Spin" If you see "Local LLM operations are not supported in this version of Spin", then your copy of Spin has been built without local LLM support. diff --git a/content/v3/serverless-ai-hello-world.md b/content/v3/serverless-ai-hello-world.md index 14980b6a7..00f02ff8f 100644 --- a/content/v3/serverless-ai-hello-world.md +++ b/content/v3/serverless-ai-hello-world.md @@ -63,7 +63,6 @@ python3 --version If you do not have Python 3.10 or later, you can install it by following the instructions [here](https://www.python.org/downloads/). - To enable Serverless AI functionality via Python, please ensure you have the latest Python template installed: @@ -346,7 +345,6 @@ class IncomingHandler(http.IncomingHandler): bytes(res.text, "utf-8") ) - ``` {{ blockEnd }} diff --git a/content/v3/variables.md b/content/v3/variables.md index fe4301574..40bf7aa5b 100644 --- a/content/v3/variables.md +++ b/content/v3/variables.md @@ -56,7 +56,6 @@ Variables can also be used in other sections of the application manifest that be allowed_outbound_hosts = [ "\{{ api_uri }}" ] ``` - All in all, an application manifest with `api_token` and `api_uri` variables and a component that uses them would look similar to the following: diff --git a/content/v3/writing-apps.md b/content/v3/writing-apps.md index fd4f839f0..ea1e816b2 100644 --- a/content/v3/writing-apps.md +++ b/content/v3/writing-apps.md @@ -456,7 +456,7 @@ During loading, Spin will download the package from the registry, locate its `se Spin supports three sources for dependencies. -#### Dependencies from a Registry +#### Dependencies From a Registry To use a dependency from a registry, specify the following fields: @@ -474,7 +474,7 @@ If you don't need any of the optional fields, you can provide the version constr "security:http/malice" = "2.0.0" ``` -#### Dependencies from a Local Component +#### Dependencies From a Local Component To use a dependency from a component on your file system, specify the following fields: @@ -483,7 +483,7 @@ To use a dependency from a component on your file system, specify the following | `path` | Required | The path to the Wasm file containing the component. | `"../validation/request-checker.wasm"` | | `export` | Optional | The name of the export in the package. If omitted, this defaults to the name of the import. | `"more-secure:checking-it-out/web"` | -#### Dependencies from a URL +#### Dependencies From a URL To use a dependency from an HTTP URL, such as a GitHub release, specify the following fields: @@ -493,7 +493,7 @@ To use a dependency from an HTTP URL, such as a GitHub release, specify the foll | `digest` | Required | The SHA256 digest of the Wasm file. This is required for integrity checking. | `"sha256:650376c33a0756b1a52cad7ca670f1126391b79050df0321407da9c741d32375"` | | `export` | Optional | The name of the export in the package. If omitted, this defaults to the name of the import. | `"more-secure:checking-it-out/web"` | -### Mapping All Imports from a Package +### Mapping All Imports From a Package If you are importing several interfaces from the same WIT package, and want them all satisfied by the same Wasm package, you can omit the interface from the dependency name. For example, suppose you import the `malice`, `tomfoolery`, and `shenanigans` WIT interfaces from the `security:http` package, and that your Bargain Security package exports all three of them. You can write: diff --git a/migration_scripts/README.md b/migration_scripts/README.md index ef103d1d8..ed80bfd41 100644 --- a/migration_scripts/README.md +++ b/migration_scripts/README.md @@ -71,7 +71,6 @@ python3 move_markdown_files_to_unified_location.py > If you are not satisfied with the outcome of this script, please run `./reset_content.sh` and try again. - Check that no files are left over in either `/spin/v2` or `/cloud` directories (except for cloud changelog which should stay where it is). # Create redirects diff --git a/migration_scripts/clean_up_after_migration.sh b/migration_scripts/clean_up_after_migration.sh index 09d46bca4..8e60f1fe8 100755 --- a/migration_scripts/clean_up_after_migration.sh +++ b/migration_scripts/clean_up_after_migration.sh @@ -5,4 +5,3 @@ rm -rf ./spin_toml_backup.toml rm -rf mapping_information.xlsx rm -rf latest_sidebar.hbs - diff --git a/shortcodes/alert.rhai b/shortcodes/alert.rhai index 94041a358..d47b7a64a 100644 --- a/shortcodes/alert.rhai +++ b/shortcodes/alert.rhai @@ -1,7 +1,6 @@ let type = params[0]; let msg = params[1]; - let colors = #{ primary:`alert-primary`, success:`alert-success`, @@ -16,7 +15,6 @@ let icons = #{ danger: `#exclamation-triangle-fill`, }; - ` diff --git a/spin-up-hub/src/components/Card.vue b/spin-up-hub/src/components/Card.vue index c81e62115..1595d5d88 100644 --- a/spin-up-hub/src/components/Card.vue +++ b/spin-up-hub/src/components/Card.vue @@ -74,7 +74,6 @@ export default {
- - diff --git a/spin-up-hub/src/components/HubIntro.vue b/spin-up-hub/src/components/HubIntro.vue index faa35beba..f81748d01 100644 --- a/spin-up-hub/src/components/HubIntro.vue +++ b/spin-up-hub/src/components/HubIntro.vue @@ -198,7 +198,6 @@ export default { background: linear-gradient(105deg, rgba(154, 103, 194, 0.21) 0%, rgba(124, 109, 185, 0.21) 100%); box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25); - h1.description { color: $thistle; diff --git a/spin-up-hub/src/components/PreviewModal.vue b/spin-up-hub/src/components/PreviewModal.vue index 9b6eb28ae..14ebd33e1 100644 --- a/spin-up-hub/src/components/PreviewModal.vue +++ b/spin-up-hub/src/components/PreviewModal.vue @@ -1,7 +1,6 @@