From fdaaca4fead070cdbb996266a0697b168cf29961 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Tue, 8 Jul 2025 09:39:06 +0200 Subject: [PATCH 1/9] refactor: extract common cmp for examples Signed-off-by: David Dal Busco --- .../how-to-start.mdx} | 6 ++++-- docs/examples/frontend/angular.mdx | 2 +- docs/examples/frontend/nextjs.mdx | 2 +- docs/examples/frontend/react-javascript.mdx | 2 +- docs/examples/frontend/react-typescript.mdx | 2 +- docs/examples/frontend/sveltekit.mdx | 2 +- docs/examples/frontend/vanilla-javascript.mdx | 2 +- docs/examples/frontend/vue.mdx | 2 +- docs/examples/functions/rust/assertions.mdx | 18 ++---------------- docs/examples/functions/rust/hooks.mdx | 18 ++---------------- 10 files changed, 15 insertions(+), 41 deletions(-) rename docs/examples/{frontend/components/how-to-start.md => components/how-to-start.mdx} (54%) diff --git a/docs/examples/frontend/components/how-to-start.md b/docs/examples/components/how-to-start.mdx similarity index 54% rename from docs/examples/frontend/components/how-to-start.md rename to docs/examples/components/how-to-start.mdx index f3bc877c..d6ad8a31 100644 --- a/docs/examples/frontend/components/how-to-start.md +++ b/docs/examples/components/how-to-start.mdx @@ -1,10 +1,12 @@ -1. **Install dependencies**: +export const index = 1; + +{props.index}. **Install dependencies**: ```bash npm install ``` -2. **Start Juno local emulator**: +{props.index + 1}. **Start Juno local emulator**: :::important diff --git a/docs/examples/frontend/angular.mdx b/docs/examples/frontend/angular.mdx index 0c318fb6..987d07cc 100644 --- a/docs/examples/frontend/angular.mdx +++ b/docs/examples/frontend/angular.mdx @@ -69,7 +69,7 @@ import KeyFeatures from "./components/key-features.md"; ## How to Run -import HowToStart from "./components/how-to-start.md"; +import HowToStart from "../components/how-to-start.mdx"; diff --git a/docs/examples/frontend/nextjs.mdx b/docs/examples/frontend/nextjs.mdx index bdaa05a9..c00455d9 100644 --- a/docs/examples/frontend/nextjs.mdx +++ b/docs/examples/frontend/nextjs.mdx @@ -69,7 +69,7 @@ export type Note = Doc; ## How to Run -import HowToStart from "./components/how-to-start.md"; +import HowToStart from "../components/how-to-start.mdx"; diff --git a/docs/examples/frontend/react-javascript.mdx b/docs/examples/frontend/react-javascript.mdx index 364dceaa..addd3cca 100644 --- a/docs/examples/frontend/react-javascript.mdx +++ b/docs/examples/frontend/react-javascript.mdx @@ -77,7 +77,7 @@ import KeyFeatures from "./components/key-features.md"; ## How to Run -import HowToStart from "./components/how-to-start.md"; +import HowToStart from "../components/how-to-start.mdx"; diff --git a/docs/examples/frontend/react-typescript.mdx b/docs/examples/frontend/react-typescript.mdx index 47b0252d..4dc257f8 100644 --- a/docs/examples/frontend/react-typescript.mdx +++ b/docs/examples/frontend/react-typescript.mdx @@ -75,7 +75,7 @@ export type Note = Doc; ## How to Run -import HowToStart from "./components/how-to-start.md"; +import HowToStart from "../components/how-to-start.mdx"; diff --git a/docs/examples/frontend/sveltekit.mdx b/docs/examples/frontend/sveltekit.mdx index 91eac938..227593f2 100644 --- a/docs/examples/frontend/sveltekit.mdx +++ b/docs/examples/frontend/sveltekit.mdx @@ -70,7 +70,7 @@ export interface Note { ## How to Run -import HowToStart from "./components/how-to-start.md"; +import HowToStart from "../components/how-to-start.mdx"; diff --git a/docs/examples/frontend/vanilla-javascript.mdx b/docs/examples/frontend/vanilla-javascript.mdx index 45dfc463..e3c4ab1f 100644 --- a/docs/examples/frontend/vanilla-javascript.mdx +++ b/docs/examples/frontend/vanilla-javascript.mdx @@ -71,7 +71,7 @@ import KeyFeatures from "./components/key-features.md"; ## How to Run -import HowToStart from "./components/how-to-start.md"; +import HowToStart from "../components/how-to-start.mdx"; diff --git a/docs/examples/frontend/vue.mdx b/docs/examples/frontend/vue.mdx index 73a82b2e..f992dccd 100644 --- a/docs/examples/frontend/vue.mdx +++ b/docs/examples/frontend/vue.mdx @@ -71,7 +71,7 @@ export interface Note { ## How to Run -import HowToStart from "./components/how-to-start.md"; +import HowToStart from "../components/how-to-start.mdx"; diff --git a/docs/examples/functions/rust/assertions.mdx b/docs/examples/functions/rust/assertions.mdx index 2bae5072..ebdc542d 100644 --- a/docs/examples/functions/rust/assertions.mdx +++ b/docs/examples/functions/rust/assertions.mdx @@ -106,23 +106,9 @@ git clone https://github.com/junobuild/examples cd rust/assertions ``` -2. **Install dependencies**: +import HowToStart from "../../components/how-to-start.mdx"; -```bash -npm install -``` - -3. **Start Juno local emulator**: - -:::important - -Requires the Juno CLI to be available `npm i -g @junobuild/cli` - -::: - -```bash -juno dev start -``` + 4. **Create a Satellite** for local dev: diff --git a/docs/examples/functions/rust/hooks.mdx b/docs/examples/functions/rust/hooks.mdx index 8b143fe5..d7cddca0 100644 --- a/docs/examples/functions/rust/hooks.mdx +++ b/docs/examples/functions/rust/hooks.mdx @@ -160,23 +160,9 @@ git clone https://github.com/junobuild/examples cd rust/hooks ``` -2. **Install dependencies**: +import HowToStart from "../../components/how-to-start.mdx"; -```bash -npm install -``` - -3. **Start Juno local emulator**: - -:::important - -Requires the Juno CLI to be available `npm i -g @junobuild/cli` - -::: - -```bash -juno dev start -``` + 4. **Create a Satellite** for local dev: From 81092011530a5885b79bf8b07617bd1db51048b4 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 8 Jul 2025 07:40:42 +0000 Subject: [PATCH 2/9] =?UTF-8?q?=F0=9F=93=84=20Update=20LLMs.txt=20snapshot?= =?UTF-8?q?=20for=20PR=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .llms-snapshots/llms-full.txt | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.llms-snapshots/llms-full.txt b/.llms-snapshots/llms-full.txt index 14841048..2b8dccdb 100644 --- a/.llms-snapshots/llms-full.txt +++ b/.llms-snapshots/llms-full.txt @@ -2246,13 +2246,13 @@ angular-example/├── public/ # Static assets├── src/ ## How to Run -1. **Install dependencies**: +. **Install dependencies**: ``` npm install ``` -2. **Start Juno local emulator**: +NaN. **Start Juno local emulator**: **Important:** @@ -2378,13 +2378,13 @@ export interface NoteData { text: string; url?: string;}export type Note = Doc ## How to Run -1. **Install dependencies**: +. **Install dependencies**: ``` npm install ``` -2. **Start Juno local emulator**: +NaN. **Start Juno local emulator**: **Important:** @@ -2512,13 +2512,13 @@ react-example/├── public/ # Static assets├── src/│ ## How to Run -1. **Install dependencies**: +. **Install dependencies**: ``` npm install ``` -2. **Start Juno local emulator**: +NaN. **Start Juno local emulator**: **Important:** @@ -2646,13 +2646,13 @@ export interface NoteData { text: string; url?: string;}export type Note = Doc ## How to Run -1. **Install dependencies**: +. **Install dependencies**: ``` npm install ``` -2. **Start Juno local emulator**: +NaN. **Start Juno local emulator**: **Important:** @@ -2775,13 +2775,13 @@ export interface Note { text: string; url?: string;} ## How to Run -1. **Install dependencies**: +. **Install dependencies**: ``` npm install ``` -2. **Start Juno local emulator**: +NaN. **Start Juno local emulator**: **Important:** @@ -2904,13 +2904,13 @@ vanilla-js-example/├── public/ # Static assets├── src ## How to Run -1. **Install dependencies**: +. **Install dependencies**: ``` npm install ``` -2. **Start Juno local emulator**: +NaN. **Start Juno local emulator**: **Important:** @@ -3035,13 +3035,13 @@ export interface Note { text: string; url?: string;} ## How to Run -1. **Install dependencies**: +. **Install dependencies**: ``` npm install ``` -2. **Start Juno local emulator**: +NaN. **Start Juno local emulator**: **Important:** @@ -3172,13 +3172,13 @@ Here’s the actual Rust logic from `lib.rs`: git clone https://github.com/junobuild/examplescd rust/assertions ``` -2. **Install dependencies**: +2. **Install dependencies**: ``` npm install ``` -3. **Start Juno local emulator**: +3. **Start Juno local emulator**: **Important:** @@ -3348,13 +3348,13 @@ use ic_cdk::print;use junobuild_macros::{on_delete_doc, on_set_doc, on_set_many_ git clone https://github.com/junobuild/examplescd rust/hooks ``` -2. **Install dependencies**: +2. **Install dependencies**: ``` npm install ``` -3. **Start Juno local emulator**: +3. **Start Juno local emulator**: **Important:** From 33ba0a44b189e4966fd77f7045d6d8b73bb459a6 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Tue, 8 Jul 2025 09:54:51 +0200 Subject: [PATCH 3/9] refactor: extract common cmp for examples Signed-off-by: David Dal Busco --- docs/examples/components/create-a-satellite.mdx | 16 ++++++++++++++++ docs/examples/frontend/nextjs.mdx | 5 ++--- docs/examples/frontend/react-javascript.mdx | 5 ++--- docs/examples/frontend/react-typescript.mdx | 5 ++--- docs/examples/frontend/sveltekit.mdx | 5 ++--- docs/examples/frontend/vanilla-javascript.mdx | 5 ++--- docs/examples/frontend/vue.mdx | 5 ++--- docs/examples/functions/rust/assertions.mdx | 5 ++--- docs/examples/functions/rust/hooks.mdx | 5 ++--- 9 files changed, 32 insertions(+), 24 deletions(-) create mode 100644 docs/examples/components/create-a-satellite.mdx diff --git a/docs/examples/components/create-a-satellite.mdx b/docs/examples/components/create-a-satellite.mdx new file mode 100644 index 00000000..be111e12 --- /dev/null +++ b/docs/examples/components/create-a-satellite.mdx @@ -0,0 +1,16 @@ +export default function ({ index = 3, config = "juno.config.ts" }) { + return ( + <> +

{index}. Create a Satellite for local dev:

+
    +
  • + Visit http://localhost:5866 and follow the instructions. +
  • +
  • + Update {config} with your Satellite ID. +
  • +
+ + ); + +} diff --git a/docs/examples/frontend/nextjs.mdx b/docs/examples/frontend/nextjs.mdx index c00455d9..3e37c5ef 100644 --- a/docs/examples/frontend/nextjs.mdx +++ b/docs/examples/frontend/nextjs.mdx @@ -73,10 +73,9 @@ import HowToStart from "../components/how-to-start.mdx"; -3. **Create a Satellite** for local dev: +import CreateSatellite from "../components/create-a-satellite.mdx"; -- Visit [http://localhost:5866](http://localhost:5866) and follow the instructions. -- Update `juno.config.mjs` with your Satellite ID. + import HowToRun from "./components/how-to-run.md"; diff --git a/docs/examples/frontend/react-javascript.mdx b/docs/examples/frontend/react-javascript.mdx index addd3cca..0db92457 100644 --- a/docs/examples/frontend/react-javascript.mdx +++ b/docs/examples/frontend/react-javascript.mdx @@ -81,10 +81,9 @@ import HowToStart from "../components/how-to-start.mdx"; -3. **Create a Satellite** for local dev: +import CreateSatellite from "../components/create-a-satellite.mdx"; -- Visit [http://localhost:5866](http://localhost:5866) and follow the instructions. -- Update `juno.config.mjs` with your Satellite ID. + import HowToRun from "./components/how-to-run.md"; diff --git a/docs/examples/frontend/react-typescript.mdx b/docs/examples/frontend/react-typescript.mdx index 4dc257f8..7b421892 100644 --- a/docs/examples/frontend/react-typescript.mdx +++ b/docs/examples/frontend/react-typescript.mdx @@ -79,10 +79,9 @@ import HowToStart from "../components/how-to-start.mdx"; -3. **Create a Satellite** for local dev: +import CreateSatellite from "../components/create-a-satellite.mdx"; -- Visit [http://localhost:5866](http://localhost:5866) and follow the instructions. -- Update `juno.config.ts` with your Satellite ID. + import HowToRun from "./components/how-to-run.md"; diff --git a/docs/examples/frontend/sveltekit.mdx b/docs/examples/frontend/sveltekit.mdx index 227593f2..6b63faee 100644 --- a/docs/examples/frontend/sveltekit.mdx +++ b/docs/examples/frontend/sveltekit.mdx @@ -74,10 +74,9 @@ import HowToStart from "../components/how-to-start.mdx"; -3. **Create a Satellite** for local dev: +import CreateSatellite from "../components/create-a-satellite.mdx"; -- Visit [http://localhost:5866](http://localhost:5866) and follow the instructions. -- Update `juno.config.ts` with your Satellite ID. + import HowToRun from "./components/how-to-run.md"; diff --git a/docs/examples/frontend/vanilla-javascript.mdx b/docs/examples/frontend/vanilla-javascript.mdx index e3c4ab1f..1dcdeb01 100644 --- a/docs/examples/frontend/vanilla-javascript.mdx +++ b/docs/examples/frontend/vanilla-javascript.mdx @@ -75,10 +75,9 @@ import HowToStart from "../components/how-to-start.mdx"; -3. **Create a Satellite** for local dev: +import CreateSatellite from "../components/create-a-satellite.mdx"; -- Visit [http://localhost:5866](http://localhost:5866) and follow the instructions. -- Update `juno.config.mjs` with your Satellite ID. + import HowToRun from "./components/how-to-run.md"; diff --git a/docs/examples/frontend/vue.mdx b/docs/examples/frontend/vue.mdx index f992dccd..45feb7dc 100644 --- a/docs/examples/frontend/vue.mdx +++ b/docs/examples/frontend/vue.mdx @@ -75,10 +75,9 @@ import HowToStart from "../components/how-to-start.mdx"; -3. **Create a Satellite** for local dev: +import CreateSatellite from "../components/create-a-satellite.mdx"; -- Visit [http://localhost:5866](http://localhost:5866) and follow the instructions. -- Update `juno.config.ts` with your Satellite ID. + import HowToRun from "./components/how-to-run.md"; diff --git a/docs/examples/functions/rust/assertions.mdx b/docs/examples/functions/rust/assertions.mdx index ebdc542d..ecf730c7 100644 --- a/docs/examples/functions/rust/assertions.mdx +++ b/docs/examples/functions/rust/assertions.mdx @@ -110,10 +110,9 @@ import HowToStart from "../../components/how-to-start.mdx"; -4. **Create a Satellite** for local dev: +import CreateSatellite from "../../components/create-a-satellite.mdx"; -- Visit [http://localhost:5866](http://localhost:5866) and follow the instructions. -- Update `juno.config.ts` with your Satellite ID. + 5. **Create required collections**: diff --git a/docs/examples/functions/rust/hooks.mdx b/docs/examples/functions/rust/hooks.mdx index d7cddca0..379ce277 100644 --- a/docs/examples/functions/rust/hooks.mdx +++ b/docs/examples/functions/rust/hooks.mdx @@ -164,10 +164,9 @@ import HowToStart from "../../components/how-to-start.mdx"; -4. **Create a Satellite** for local dev: +import CreateSatellite from "../../components/create-a-satellite.mdx"; -- Visit [http://localhost:5866](http://localhost:5866) and follow the instructions. -- Update `juno.config.ts` with your Satellite ID. + 5. **Create required collections**: From e5defc7ade733ed1feac41307abae195ff20b8b9 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 8 Jul 2025 07:59:14 +0000 Subject: [PATCH 4/9] =?UTF-8?q?=F0=9F=93=84=20Update=20LLMs.txt=20snapshot?= =?UTF-8?q?=20for=20PR=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .llms-snapshots/llms-full.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.llms-snapshots/llms-full.txt b/.llms-snapshots/llms-full.txt index 2b8dccdb..a4e98c53 100644 --- a/.llms-snapshots/llms-full.txt +++ b/.llms-snapshots/llms-full.txt @@ -2394,7 +2394,7 @@ Requires the Juno CLI to be available `npm i -g @junobuild/cli` juno dev start ``` -3. **Create a Satellite** for local dev: +3. **Create a Satellite** for local dev: * Visit [http://localhost:5866](http://localhost:5866) and follow the instructions. * Update `juno.config.mjs` with your Satellite ID. @@ -2528,7 +2528,7 @@ Requires the Juno CLI to be available `npm i -g @junobuild/cli` juno dev start ``` -3. **Create a Satellite** for local dev: +3. **Create a Satellite** for local dev: * Visit [http://localhost:5866](http://localhost:5866) and follow the instructions. * Update `juno.config.mjs` with your Satellite ID. @@ -2662,7 +2662,7 @@ Requires the Juno CLI to be available `npm i -g @junobuild/cli` juno dev start ``` -3. **Create a Satellite** for local dev: +3. **Create a Satellite** for local dev: * Visit [http://localhost:5866](http://localhost:5866) and follow the instructions. * Update `juno.config.ts` with your Satellite ID. @@ -2791,7 +2791,7 @@ Requires the Juno CLI to be available `npm i -g @junobuild/cli` juno dev start ``` -3. **Create a Satellite** for local dev: +3. **Create a Satellite** for local dev: * Visit [http://localhost:5866](http://localhost:5866) and follow the instructions. * Update `juno.config.ts` with your Satellite ID. @@ -2920,7 +2920,7 @@ Requires the Juno CLI to be available `npm i -g @junobuild/cli` juno dev start ``` -3. **Create a Satellite** for local dev: +3. **Create a Satellite** for local dev: * Visit [http://localhost:5866](http://localhost:5866) and follow the instructions. * Update `juno.config.mjs` with your Satellite ID. @@ -3051,7 +3051,7 @@ Requires the Juno CLI to be available `npm i -g @junobuild/cli` juno dev start ``` -3. **Create a Satellite** for local dev: +3. **Create a Satellite** for local dev: * Visit [http://localhost:5866](http://localhost:5866) and follow the instructions. * Update `juno.config.ts` with your Satellite ID. @@ -3188,7 +3188,7 @@ Requires the Juno CLI to be available `npm i -g @junobuild/cli` juno dev start ``` -4. **Create a Satellite** for local dev: +4. **Create a Satellite** for local dev: * Visit [http://localhost:5866](http://localhost:5866) and follow the instructions. * Update `juno.config.ts` with your Satellite ID. @@ -3364,7 +3364,7 @@ Requires the Juno CLI to be available `npm i -g @junobuild/cli` juno dev start ``` -4. **Create a Satellite** for local dev: +4. **Create a Satellite** for local dev: * Visit [http://localhost:5866](http://localhost:5866) and follow the instructions. * Update `juno.config.ts` with your Satellite ID. From 741c2572380acff0ad22eca5789a0511688dec02 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Tue, 8 Jul 2025 10:07:50 +0200 Subject: [PATCH 5/9] refactor: extract common cmp for examples Signed-off-by: David Dal Busco --- docs/examples/frontend/angular.mdx | 9 ++-- .../frontend/components/prod-deploy.mdx | 10 +++++ docs/examples/frontend/nextjs.mdx | 9 +--- docs/examples/frontend/react-javascript.mdx | 9 +--- docs/examples/frontend/react-typescript.mdx | 11 ++--- docs/examples/frontend/sveltekit.mdx | 9 +--- docs/examples/frontend/vanilla-javascript.mdx | 9 +--- docs/examples/frontend/vue.mdx | 9 +--- .../functions/components/how-to-run.md | 13 ++++++ .../functions/components/prod-deploy.md | 15 +++++++ docs/examples/functions/rust/assertions.mdx | 45 +++---------------- .../rust/components/proposals-network.md | 14 ++++++ docs/examples/functions/rust/hooks.mdx | 45 +++---------------- 13 files changed, 83 insertions(+), 124 deletions(-) create mode 100644 docs/examples/frontend/components/prod-deploy.mdx create mode 100644 docs/examples/functions/components/how-to-run.md create mode 100644 docs/examples/functions/components/prod-deploy.md create mode 100644 docs/examples/functions/rust/components/proposals-network.md diff --git a/docs/examples/frontend/angular.mdx b/docs/examples/frontend/angular.mdx index 987d07cc..fd9897b9 100644 --- a/docs/examples/frontend/angular.mdx +++ b/docs/examples/frontend/angular.mdx @@ -97,10 +97,11 @@ import HowToRun from "./components/how-to-run.md"; - Create a Satellite on the [Juno Console](https://console.juno.build) for mainnet. - Update `src/environments/environment.prod.ts` and `juno.config.mjs` with the production Satellite ID. - Build and deploy: - ```bash - npm run build - juno deploy - ``` + +```bash +npm run build +juno deploy +``` --- diff --git a/docs/examples/frontend/components/prod-deploy.mdx b/docs/examples/frontend/components/prod-deploy.mdx new file mode 100644 index 00000000..2bc403e5 --- /dev/null +++ b/docs/examples/frontend/components/prod-deploy.mdx @@ -0,0 +1,10 @@ +export const config = "juno.config.ts"; + +- Create a Satellite on the [Juno Console](https://console.juno.build) for mainnet. +- Update {props.config} with the production Satellite ID. +- Build and deploy: + +```bash +npm run build +juno deploy +``` diff --git a/docs/examples/frontend/nextjs.mdx b/docs/examples/frontend/nextjs.mdx index 3e37c5ef..f8d15ee1 100644 --- a/docs/examples/frontend/nextjs.mdx +++ b/docs/examples/frontend/nextjs.mdx @@ -92,14 +92,9 @@ import HowToRun from "./components/how-to-run.md"; ## Production Deployment -- Create a Satellite on the [Juno Console](https://console.juno.build) for mainnet. -- Update `juno.config.mjs` with the production Satellite ID. -- Build and deploy: +import ProdDeploy from "./components/prod-deploy.mdx"; -```bash -npm run build -juno deploy -``` + --- diff --git a/docs/examples/frontend/react-javascript.mdx b/docs/examples/frontend/react-javascript.mdx index 0db92457..f49a3270 100644 --- a/docs/examples/frontend/react-javascript.mdx +++ b/docs/examples/frontend/react-javascript.mdx @@ -100,14 +100,9 @@ import HowToRun from "./components/how-to-run.md"; ## Production Deployment -- Create a Satellite on the [Juno Console](https://console.juno.build) for mainnet. -- Update `juno.config.mjs` with the production Satellite ID. -- Build and deploy: +import ProdDeploy from "./components/prod-deploy.mdx"; -```bash -npm run build -juno deploy -``` + --- diff --git a/docs/examples/frontend/react-typescript.mdx b/docs/examples/frontend/react-typescript.mdx index 7b421892..f4365d0b 100644 --- a/docs/examples/frontend/react-typescript.mdx +++ b/docs/examples/frontend/react-typescript.mdx @@ -98,14 +98,11 @@ import HowToRun from "./components/how-to-run.md"; ## Production Deployment -- Create a Satellite on the [Juno Console](https://console.juno.build) for mainnet. -- Update `juno.config.ts` with the production Satellite ID. -- Build and deploy: +import ProdDeploy from "./components/prod-deploy.mdx"; -```bash -npm run build -juno deploy -``` + + +--- ## Notes diff --git a/docs/examples/frontend/sveltekit.mdx b/docs/examples/frontend/sveltekit.mdx index 6b63faee..c75f7340 100644 --- a/docs/examples/frontend/sveltekit.mdx +++ b/docs/examples/frontend/sveltekit.mdx @@ -93,14 +93,9 @@ import HowToRun from "./components/how-to-run.md"; ## Production Deployment -- Create a Satellite on the [Juno Console](https://juno.build) for mainnet. -- Update `juno.config.ts` with the production Satellite ID. -- Build and deploy: +import ProdDeploy from "./components/prod-deploy.mdx"; -```bash -npm run build -juno deploy -``` + --- diff --git a/docs/examples/frontend/vanilla-javascript.mdx b/docs/examples/frontend/vanilla-javascript.mdx index 1dcdeb01..6439e62f 100644 --- a/docs/examples/frontend/vanilla-javascript.mdx +++ b/docs/examples/frontend/vanilla-javascript.mdx @@ -94,14 +94,9 @@ import HowToRun from "./components/how-to-run.md"; ## Production Deployment -- Create a Satellite on the [Juno Console](https://juno.build) for mainnet. -- Update `juno.config.mjs` with the production Satellite ID. -- Build and deploy: +import ProdDeploy from "./components/prod-deploy.mdx"; -```bash -npm run build -juno deploy -``` + --- diff --git a/docs/examples/frontend/vue.mdx b/docs/examples/frontend/vue.mdx index 45feb7dc..20ef8a00 100644 --- a/docs/examples/frontend/vue.mdx +++ b/docs/examples/frontend/vue.mdx @@ -94,14 +94,9 @@ import HowToRun from "./components/how-to-run.md"; ## Production Deployment -- Create a Satellite on the [Juno Console](https://juno.build) for mainnet. -- Update `juno.config.ts` with the production Satellite ID. -- Build and deploy: +import ProdDeploy from "./components/prod-deploy.mdx"; -```bash -npm run build -juno deploy -``` + --- diff --git a/docs/examples/functions/components/how-to-run.md b/docs/examples/functions/components/how-to-run.md new file mode 100644 index 00000000..cc5ad662 --- /dev/null +++ b/docs/examples/functions/components/how-to-run.md @@ -0,0 +1,13 @@ +6. **Start the frontend dev server** (in a separate terminal): + +```bash +npm run dev +``` + +7. **Build the serverless functions** (in a separate terminal): + +```bash +juno functions build +``` + +The emulator will automatically upgrade your Satellite and live reload the changes. diff --git a/docs/examples/functions/components/prod-deploy.md b/docs/examples/functions/components/prod-deploy.md new file mode 100644 index 00000000..aeb83ead --- /dev/null +++ b/docs/examples/functions/components/prod-deploy.md @@ -0,0 +1,15 @@ +- Create a Satellite on the [Juno Console](https://console.juno.build) for mainnet. +- Update `juno.config.ts` with the production Satellite ID. +- Build and deploy the frontend: + +```bash +npm run build +juno deploy +``` + +- Build and upgrade the serverless functions: + +```bash +juno functions build +juno functions upgrade +``` diff --git a/docs/examples/functions/rust/assertions.mdx b/docs/examples/functions/rust/assertions.mdx index ecf730c7..056c1bf0 100644 --- a/docs/examples/functions/rust/assertions.mdx +++ b/docs/examples/functions/rust/assertions.mdx @@ -119,19 +119,9 @@ import CreateSatellite from "../../components/create-a-satellite.mdx"; - `notes` in Datastore: [http://localhost:5866/datastore](http://localhost:5866/datastore) - `images` in Storage: [http://localhost:5866/storage](http://localhost:5866/storage) -6. **Start the frontend dev server** (in a separate terminal): +import HowToRun from "../components/how-to-run.md"; -```bash -npm run dev -``` - -7. **Build the serverless functions** (in a separate terminal): - -```bash -juno functions build -``` - -The emulator will automatically upgrade your Satellite and live reload the changes. + --- @@ -144,21 +134,9 @@ The emulator will automatically upgrade your Satellite and live reload the chang ## Production Deployment -- Create a Satellite on the [Juno Console](https://console.juno.build) for mainnet. -- Update `juno.config.ts` with the production Satellite ID. -- Build and deploy the frontend: +import ProdDeploy from "../components/prod-deploy.md"; -```bash -npm run build -juno deploy -``` - -- Build and upgrade the serverless functions: - -```bash -juno functions build -juno functions upgrade -``` + --- @@ -171,20 +149,9 @@ juno functions upgrade ## Real-World Example -Want to see how assertions and serverless logic are used in a live project? - -Check out [proposals.network](https://proposals.network), an open-source app built with Juno: - -- GitHub: [github.com/peterpeterparker/proposals.network](https://github.com/peterpeterparker/proposals.network) -- Example logic: [src/satellite/src/lib.rs](https://github.com/peterpeterparker/proposals.network/blob/main/src/satellite/src/lib.rs) - -This app uses: - -- `#[on_delete_doc]` and `#[assert_delete_doc]` to validate and clean up related documents and assets -- Shared helper modules like `assert`, `delete`, and `types` to keep logic organized -- A real-world pattern of chaining asset/document deletions with assertions +import ProposalsNetwork from "./components/proposals-network.md"; -It’s a great reference for more advanced setups and multi-collection coordination. + --- diff --git a/docs/examples/functions/rust/components/proposals-network.md b/docs/examples/functions/rust/components/proposals-network.md new file mode 100644 index 00000000..744a0319 --- /dev/null +++ b/docs/examples/functions/rust/components/proposals-network.md @@ -0,0 +1,14 @@ +Want to see how assertions and serverless logic are used in a live project? + +Check out [proposals.network](https://proposals.network), an open-source app built with Juno: + +- GitHub: [github.com/peterpeterparker/proposals.network](https://github.com/peterpeterparker/proposals.network) +- Example logic: [src/satellite/src/lib.rs](https://github.com/peterpeterparker/proposals.network/blob/main/src/satellite/src/lib.rs) + +This app uses: + +- `#[on_delete_doc]` and `#[assert_delete_doc]` to validate and clean up related documents and assets +- Shared helper modules like `assert`, `delete`, and `types` to keep logic organized +- A real-world pattern of chaining asset/document deletions with assertions + +It’s a great reference for more advanced setups and multi-collection coordination. diff --git a/docs/examples/functions/rust/hooks.mdx b/docs/examples/functions/rust/hooks.mdx index 379ce277..dfbade53 100644 --- a/docs/examples/functions/rust/hooks.mdx +++ b/docs/examples/functions/rust/hooks.mdx @@ -173,19 +173,9 @@ import CreateSatellite from "../../components/create-a-satellite.mdx"; - `demo` in Datastore: [http://localhost:5866/datastore](http://localhost:5866/datastore) - `images` in Storage: [http://localhost:5866/storage](http://localhost:5866/storage) -6. **Start the frontend dev server** (in a separate terminal): +import HowToRun from "../components/how-to-run.md"; -```bash -npm run dev -``` - -7. **Build the serverless functions** (in a separate terminal): - -```bash -juno functions build -``` - -The emulator will automatically upgrade your Satellite and live reload the changes. + --- @@ -198,21 +188,9 @@ The emulator will automatically upgrade your Satellite and live reload the chang ## Production Deployment -- Create a Satellite on the [Juno Console](https://console.juno.build) for mainnet. -- Update `juno.config.ts` with the production Satellite ID. -- Build and deploy the frontend: +import ProdDeploy from "../components/prod-deploy.md"; -```bash -npm run build -juno deploy -``` - -- Build and upgrade the serverless functions: - -```bash -juno functions build -juno functions upgrade -``` + --- @@ -225,20 +203,9 @@ juno functions upgrade ## Real-World Example -Want to see how assertions and serverless logic are used in a live project? - -Check out [proposals.network](https://proposals.network), an open-source app built with Juno: - -- GitHub: [github.com/peterpeterparker/proposals.network](https://github.com/peterpeterparker/proposals.network) -- Example logic: [src/satellite/src/lib.rs](https://github.com/peterpeterparker/proposals.network/blob/main/src/satellite/src/lib.rs) - -This app uses: - -- `#[on_delete_doc]` and `#[assert_delete_doc]` to validate and clean up related documents and assets -- Shared helper modules like `assert`, `delete`, and `types` to keep logic organized -- A real-world pattern of chaining asset/document deletions with assertions +import ProposalsNetwork from "./components/proposals-network.md"; -It’s a great reference for more advanced setups and multi-collection coordination. + --- From 4af946aa8535c0a16f0cd5c0be51cc781fd55f65 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 8 Jul 2025 08:09:25 +0000 Subject: [PATCH 6/9] =?UTF-8?q?=F0=9F=93=84=20Update=20LLMs.txt=20snapshot?= =?UTF-8?q?=20for=20PR=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .llms-snapshots/llms-full.txt | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.llms-snapshots/llms-full.txt b/.llms-snapshots/llms-full.txt index a4e98c53..6ef47476 100644 --- a/.llms-snapshots/llms-full.txt +++ b/.llms-snapshots/llms-full.txt @@ -2293,11 +2293,10 @@ npm run dev * Create a Satellite on the [Juno Console](https://console.juno.build) for mainnet. * Update `src/environments/environment.prod.ts` and `juno.config.mjs` with the production Satellite ID. * Build and deploy: - - ``` - npm run buildjuno deploy - ``` - + +``` +npm run buildjuno deploy +``` --- @@ -2690,13 +2689,15 @@ npm run dev ## Production Deployment * Create a Satellite on the [Juno Console](https://console.juno.build) for mainnet. -* Update `juno.config.ts` with the production Satellite ID. +* Update with the production Satellite ID. * Build and deploy: ``` npm run buildjuno deploy ``` +--- + ## Notes * The app is intended as a starting point for Juno-based projects. @@ -2818,8 +2819,8 @@ npm run dev ## Production Deployment -* Create a Satellite on the [Juno Console](https://juno.build) for mainnet. -* Update `juno.config.ts` with the production Satellite ID. +* Create a Satellite on the [Juno Console](https://console.juno.build) for mainnet. +* Update with the production Satellite ID. * Build and deploy: ``` @@ -2947,7 +2948,7 @@ npm run dev ## Production Deployment -* Create a Satellite on the [Juno Console](https://juno.build) for mainnet. +* Create a Satellite on the [Juno Console](https://console.juno.build) for mainnet. * Update `juno.config.mjs` with the production Satellite ID. * Build and deploy: @@ -3078,8 +3079,8 @@ npm run dev ## Production Deployment -* Create a Satellite on the [Juno Console](https://juno.build) for mainnet. -* Update `juno.config.ts` with the production Satellite ID. +* Create a Satellite on the [Juno Console](https://console.juno.build) for mainnet. +* Update with the production Satellite ID. * Build and deploy: ``` From 5bb92c6e85829f3d538802e62b5d7f432126feee Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Tue, 8 Jul 2025 11:51:02 +0200 Subject: [PATCH 7/9] refactor: extract common cmp for examples Signed-off-by: David Dal Busco --- docs/examples/functions/rust/assertions.mdx | 21 ++----------------- .../functions/rust/components/references.md | 20 ++++++++++++++++++ docs/examples/functions/rust/hooks.mdx | 21 ++----------------- 3 files changed, 24 insertions(+), 38 deletions(-) create mode 100644 docs/examples/functions/rust/components/references.md diff --git a/docs/examples/functions/rust/assertions.mdx b/docs/examples/functions/rust/assertions.mdx index 056c1bf0..89af1812 100644 --- a/docs/examples/functions/rust/assertions.mdx +++ b/docs/examples/functions/rust/assertions.mdx @@ -155,23 +155,6 @@ import ProposalsNetwork from "./components/proposals-network.md"; --- -## References +import References from "./components/references.md"; -- [Serverless Functions Guide](../../../guides/rust.mdx) -- [Rust Functions Development](../../../build/functions/index.md) -- [Rust SDK Reference](../../../reference/functions/rust/sdk.mdx) -- [Rust Utils Reference](../../../reference/functions/rust/utils.mdx) -- [Run Local Development](../../../guides/local-development.mdx) -- [CLI Reference](../../../reference/cli) -- [Configuration Reference](../../../reference/configuration.mdx) -- [Datastore Collections](../../../build/datastore/collections.md) - ---- - -## Crate Docs - -These crates are used to build and extend serverless functions in Rust with Juno: - -- [junobuild-satellite](https://docs.rs/junobuild-satellite): Core features and runtime for building a Satellite in Rust, including hooks, assertions, and datastore integration. -- [junobuild-macros](https://docs.rs/junobuild-macros): Procedural macros for declaratively attaching hooks and assertions (e.g., `#[assert_set_doc]`, `#[on_delete_doc]`). -- [junobuild-utils](https://docs.rs/junobuild-utils): Utility helpers for working with documents, including data encoding, decoding, and assertion context handling. + diff --git a/docs/examples/functions/rust/components/references.md b/docs/examples/functions/rust/components/references.md new file mode 100644 index 00000000..a384182d --- /dev/null +++ b/docs/examples/functions/rust/components/references.md @@ -0,0 +1,20 @@ +## References + +- [Serverless Functions Guide](../../../../guides/rust.mdx) +- [Rust Functions Development](../../../../build/functions/index.md) +- [Rust SDK Reference](../../../../reference/functions/rust/sdk.mdx) +- [Rust Utils Reference](../../../../reference/functions/rust/utils.mdx) +- [Run Local Development](../../../../guides/local-development.mdx) +- [CLI Reference](../../../../reference/cli) +- [Configuration Reference](../../../../reference/configuration.mdx) +- [Datastore Collections](../../../../build/datastore/collections.md) + +--- + +## Crate Docs + +These crates are used to build and extend serverless functions in Rust with Juno: + +- [junobuild-satellite](https://docs.rs/junobuild-satellite): Core features and runtime for building a Satellite in Rust, including hooks, assertions, and datastore integration. +- [junobuild-macros](https://docs.rs/junobuild-macros): Procedural macros for declaratively attaching hooks and assertions. +- [junobuild-utils](https://docs.rs/junobuild-utils): Utility helpers for working with documents, including data encoding, decoding, and assertion context handling. diff --git a/docs/examples/functions/rust/hooks.mdx b/docs/examples/functions/rust/hooks.mdx index dfbade53..3471f9b3 100644 --- a/docs/examples/functions/rust/hooks.mdx +++ b/docs/examples/functions/rust/hooks.mdx @@ -209,23 +209,6 @@ import ProposalsNetwork from "./components/proposals-network.md"; --- -## References +import References from "./components/references.md"; -- [Serverless Functions Guide](../../../guides/rust.mdx) -- [Rust Functions Development](../../../build/functions/index.md) -- [Rust SDK Reference](../../../reference/functions/rust/sdk.mdx) -- [Rust Utils Reference](../../../reference/functions/rust/utils.mdx) -- [Run Local Development](../../../guides/local-development.mdx) -- [CLI Reference](../../../reference/cli) -- [Configuration Reference](../../../reference/configuration.mdx) -- [Datastore Collections](../../../build/datastore/collections.md) - ---- - -## Crate Docs - -These crates are used to build and extend serverless functions in Rust with Juno: - -- [junobuild-satellite](https://docs.rs/junobuild-satellite): Core features and runtime for building a Satellite in Rust, including hooks, assertions, and datastore integration. -- [junobuild-macros](https://docs.rs/junobuild-macros): Procedural macros for declaratively attaching hooks and assertions (e.g., `#[on_set_doc]`, `#[on_delete_doc]`). -- [junobuild-utils](https://docs.rs/junobuild-utils): Utility helpers for working with documents, including data encoding, decoding, and assertion context handling. + From b669d2f68a8419dd6130b30f8bcc9506d54a1646 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Tue, 8 Jul 2025 11:55:26 +0200 Subject: [PATCH 8/9] fix: path Signed-off-by: David Dal Busco --- docs/examples/functions/rust/components/references.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/examples/functions/rust/components/references.md b/docs/examples/functions/rust/components/references.md index a384182d..e0c46fb0 100644 --- a/docs/examples/functions/rust/components/references.md +++ b/docs/examples/functions/rust/components/references.md @@ -5,7 +5,7 @@ - [Rust SDK Reference](../../../../reference/functions/rust/sdk.mdx) - [Rust Utils Reference](../../../../reference/functions/rust/utils.mdx) - [Run Local Development](../../../../guides/local-development.mdx) -- [CLI Reference](../../../../reference/cli) +- [CLI Reference](pathname:///docs/reference/cli) - [Configuration Reference](../../../../reference/configuration.mdx) - [Datastore Collections](../../../../build/datastore/collections.md) From 435ea6f8f8272939787dc33530c19e68d265acc8 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 8 Jul 2025 09:57:09 +0000 Subject: [PATCH 9/9] =?UTF-8?q?=F0=9F=93=84=20Update=20LLMs.txt=20snapshot?= =?UTF-8?q?=20for=20PR=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .llms-snapshots/llms-full.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.llms-snapshots/llms-full.txt b/.llms-snapshots/llms-full.txt index 6ef47476..323e8e2f 100644 --- a/.llms-snapshots/llms-full.txt +++ b/.llms-snapshots/llms-full.txt @@ -3284,7 +3284,7 @@ It’s a great reference for more advanced setups and multi-collection coordinat These crates are used to build and extend serverless functions in Rust with Juno: * [junobuild-satellite](https://docs.rs/junobuild-satellite): Core features and runtime for building a Satellite in Rust, including hooks, assertions, and datastore integration. -* [junobuild-macros](https://docs.rs/junobuild-macros): Procedural macros for declaratively attaching hooks and assertions (e.g., `#[assert_set_doc]`, `#[on_delete_doc]`). +* [junobuild-macros](https://docs.rs/junobuild-macros): Procedural macros for declaratively attaching hooks and assertions. * [junobuild-utils](https://docs.rs/junobuild-utils): Utility helpers for working with documents, including data encoding, decoding, and assertion context handling. # Rust Hooks Example @@ -3460,7 +3460,7 @@ It’s a great reference for more advanced setups and multi-collection coordinat These crates are used to build and extend serverless functions in Rust with Juno: * [junobuild-satellite](https://docs.rs/junobuild-satellite): Core features and runtime for building a Satellite in Rust, including hooks, assertions, and datastore integration. -* [junobuild-macros](https://docs.rs/junobuild-macros): Procedural macros for declaratively attaching hooks and assertions (e.g., `#[on_set_doc]`, `#[on_delete_doc]`). +* [junobuild-macros](https://docs.rs/junobuild-macros): Procedural macros for declaratively attaching hooks and assertions. * [junobuild-utils](https://docs.rs/junobuild-utils): Utility helpers for working with documents, including data encoding, decoding, and assertion context handling. # Using Juno with AI