From 8d6ecd0710732a6f707d79c0d27a325dc55de261 Mon Sep 17 00:00:00 2001 From: Derek Kuhl Date: Wed, 1 May 2024 12:05:33 -0600 Subject: [PATCH 1/6] Update README file to include new carton 1.0 implementation. --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7c27b0671..32d75c411 100644 --- a/README.md +++ b/README.md @@ -179,7 +179,20 @@ Not all of these versions are tested on regular basis though, compatibility repo ## Usage in a browser application The easiest way to get started with JavaScriptKit in your browser app is with [the `carton` -bundler](https://carton.dev). +bundler](https://carton.dev). Add carton to your swift package dependencies: + +```swift +dependencies: [ + .package(url: "https://github.com/swiftwasm/carton", from: "1.0.0"), +], +``` + +> [!WARNING] +> - If you already use `carton` before 0.x.x versions via Homebrew, you can remove it with `brew uninstall carton` and install the new version as a SwiftPM dependency. +> - Also please remove the old `.build` directory before using the new `carton` + +## Legacy Installation + As a part of these steps you'll install `carton` via [Homebrew](https://brew.sh/) on macOS (you can also use the From 395a09dffe0f6a0e87914147a0ab1d0908d5355b Mon Sep 17 00:00:00 2001 From: Derek Kuhl Date: Wed, 1 May 2024 12:31:43 -0600 Subject: [PATCH 2/6] Update README to include the updated Carton 1.0 dependency to the JavaScriptKit Example. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 32d75c411..94659c986 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,8 @@ a few additional steps though (you can skip these steps if your app depends on name: "JavaScriptKitExample", dependencies: [ "JavaScriptKit", - .product(name: "JavaScriptEventLoop", package: "JavaScriptKit") + .package(url: "https://github.com/swiftwasm/carton", from: "1.0.0"), + .product(name: "JavaScriptEventLoop", package: "JavaScriptKit"), ] ) ``` From a837927c0e438ab4a829a17f0a57f361391f5cc0 Mon Sep 17 00:00:00 2001 From: Derek Kuhl Date: Wed, 1 May 2024 16:15:49 -0600 Subject: [PATCH 3/6] Collapsible Legacy Section. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 94659c986..f61a75ba8 100644 --- a/README.md +++ b/README.md @@ -192,7 +192,7 @@ dependencies: [ > - If you already use `carton` before 0.x.x versions via Homebrew, you can remove it with `brew uninstall carton` and install the new version as a SwiftPM dependency. > - Also please remove the old `.build` directory before using the new `carton` -## Legacy Installation +
Legacy Installation As a part of these steps @@ -232,6 +232,8 @@ carton init --template basic carton dev ``` +
+ 5. Open [http://127.0.0.1:8080/](http://127.0.0.1:8080/) in your browser and a developer console within it. You'll see `Hello, world!` output in the console. You can edit the app source code in your favorite editor and save it, `carton` will immediately rebuild the app and reload all From 3d89a4dbd677e5e9069b5ec7ef5655a6c597f591 Mon Sep 17 00:00:00 2001 From: Derek Kuhl Date: Wed, 1 May 2024 16:23:27 -0600 Subject: [PATCH 4/6] Fix Readme Package description for carton usage. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index f61a75ba8..8c91644a8 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,6 @@ a few additional steps though (you can skip these steps if your app depends on name: "JavaScriptKitExample", dependencies: [ "JavaScriptKit", - .package(url: "https://github.com/swiftwasm/carton", from: "1.0.0"), .product(name: "JavaScriptEventLoop", package: "JavaScriptKit"), ] ) From a386fa03d5dd814126a94fdfc05630de2d669c38 Mon Sep 17 00:00:00 2001 From: Derek Kuhl Date: Wed, 1 May 2024 16:48:44 -0600 Subject: [PATCH 5/6] Add horizontal rules to Legacy block for readability. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 8c91644a8..86d352265 100644 --- a/README.md +++ b/README.md @@ -193,6 +193,7 @@ dependencies: [
Legacy Installation +--- As a part of these steps you'll install `carton` via [Homebrew](https://brew.sh/) on macOS (you can also use the @@ -231,6 +232,8 @@ carton init --template basic carton dev ``` +--- +
5. Open [http://127.0.0.1:8080/](http://127.0.0.1:8080/) in your browser and a developer console From d36cf5b20cf95c8b5e1f28222e0f88d724ab4317 Mon Sep 17 00:00:00 2001 From: Derek Kuhl Date: Thu, 2 May 2024 10:55:46 -0600 Subject: [PATCH 6/6] Added instruction to run carton from swift in README. --- README.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 86d352265..401e68893 100644 --- a/README.md +++ b/README.md @@ -181,12 +181,24 @@ Not all of these versions are tested on regular basis though, compatibility repo The easiest way to get started with JavaScriptKit in your browser app is with [the `carton` bundler](https://carton.dev). Add carton to your swift package dependencies: -```swift +```diff dependencies: [ - .package(url: "https://github.com/swiftwasm/carton", from: "1.0.0"), ++ .package(url: "https://github.com/swiftwasm/carton", from: "1.0.0"), ], ``` +Now you can activate the package dependency through swift: + +``` +swift run carton dev +``` + +If you have multiple products in your package, you can also used the product flag: + +``` +swift run carton dev --product MyApp +``` + > [!WARNING] > - If you already use `carton` before 0.x.x versions via Homebrew, you can remove it with `brew uninstall carton` and install the new version as a SwiftPM dependency. > - Also please remove the old `.build` directory before using the new `carton`