Skip to content

Commit b682179

Browse files
authored
Update README file to include new carton 1.0 implementation. (#243)
* Update README file to include new carton 1.0 implementation. * Update README to include the updated Carton 1.0 dependency to the JavaScriptKit Example. * Collapsible Legacy Section. * Fix Readme Package description for carton usage. * Add horizontal rules to Legacy block for readability. * Added instruction to run carton from swift in README.
1 parent 8780e5f commit b682179

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

README.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ a few additional steps though (you can skip these steps if your app depends on
6666
name: "JavaScriptKitExample",
6767
dependencies: [
6868
"JavaScriptKit",
69-
.product(name: "JavaScriptEventLoop", package: "JavaScriptKit")
69+
.product(name: "JavaScriptEventLoop", package: "JavaScriptKit"),
7070
]
7171
)
7272
```
@@ -179,7 +179,33 @@ Not all of these versions are tested on regular basis though, compatibility repo
179179
## Usage in a browser application
180180

181181
The easiest way to get started with JavaScriptKit in your browser app is with [the `carton`
182-
bundler](https://carton.dev).
182+
bundler](https://carton.dev). Add carton to your swift package dependencies:
183+
184+
```diff
185+
dependencies: [
186+
+ .package(url: "https://github.com/swiftwasm/carton", from: "1.0.0"),
187+
],
188+
```
189+
190+
Now you can activate the package dependency through swift:
191+
192+
```
193+
swift run carton dev
194+
```
195+
196+
If you have multiple products in your package, you can also used the product flag:
197+
198+
```
199+
swift run carton dev --product MyApp
200+
```
201+
202+
> [!WARNING]
203+
> - 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.
204+
> - Also please remove the old `.build` directory before using the new `carton`
205+
206+
<details><summary>Legacy Installation</summary>
207+
208+
---
183209

184210
As a part of these steps
185211
you'll install `carton` via [Homebrew](https://brew.sh/) on macOS (you can also use the
@@ -218,6 +244,10 @@ carton init --template basic
218244
carton dev
219245
```
220246

247+
---
248+
249+
</details>
250+
221251
5. Open [http://127.0.0.1:8080/](http://127.0.0.1:8080/) in your browser and a developer console
222252
within it. You'll see `Hello, world!` output in the console. You can edit the app source code in
223253
your favorite editor and save it, `carton` will immediately rebuild the app and reload all

0 commit comments

Comments
 (0)