Skip to content

Commit 115ca29

Browse files
Add CONTRIBUTING.md
1 parent 1546b94 commit 115ca29

File tree

2 files changed

+69
-27
lines changed

2 files changed

+69
-27
lines changed

CONTRIBUTING.md

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Contributing to JavaScriptKit
2+
3+
Thank you for considering contributing to JavaScriptKit! We welcome contributions of all kinds and value your time and effort.
4+
5+
## Getting Started
6+
7+
### Reporting Issues
8+
- If you find a bug, have a feature request, or need help, please [open an issue](https://github.com/swiftwasm/JavaScriptKit/issues).
9+
- Provide as much detail as possible:
10+
- Steps to reproduce the issue
11+
- Expected vs. actual behavior
12+
- Relevant error messages or logs
13+
14+
### Setting Up the Development Environment
15+
1. Clone the repository:
16+
```bash
17+
git clone https://github.com/swiftwasm/JavaScriptKit.git
18+
cd JavaScriptKit
19+
```
20+
21+
2. Install **OSS** Swift toolchain (not the one from Xcode):
22+
<details>
23+
<summary>For macOS users</summary>
24+
25+
```bash
26+
(
27+
SWIFT_TOOLCHAIN_CHANNEL=swift-6.0.2-release;
28+
SWIFT_TOOLCHAIN_TAG="swift-6.0.2-RELEASE";
29+
SWIFT_SDK_TAG="swift-wasm-6.0.2-RELEASE";
30+
pkg="$(mktemp -d)/InstallMe.pkg"; set -ex;
31+
curl -o "$pkg" "https://download.swift.org/$SWIFT_TOOLCHAIN_CHANNEL/xcode/$SWIFT_TOOLCHAIN_TAG/$SWIFT_TOOLCHAIN_TAG-osx.pkg";
32+
installer -pkg "$pkg" -target CurrentUserHomeDirectory;
33+
export TOOLCHAINS="$(plutil -extract CFBundleIdentifier raw ~/Library/Developer/Toolchains/$SWIFT_TOOLCHAIN_TAG.xctoolchain/Info.plist)";
34+
swift sdk install "https://github.com/swiftwasm/swift/releases/download/$SWIFT_SDK_TAG/$SWIFT_SDK_TAG-wasm32-unknown-wasi.artifactbundle.zip";
35+
)
36+
```
37+
38+
</details>
39+
40+
<details>
41+
<summary>For Linux users</summary>
42+
Install Swift 6.0.2 by following the instructions on the <a href="https://www.swift.org/install/linux/tarball/">official Swift website</a>.
43+
44+
```bash
45+
(
46+
SWIFT_SDK_TAG="swift-wasm-6.0.2-RELEASE";
47+
swift sdk install "https://github.com/swiftwasm/swift/releases/download/$SWIFT_SDK_TAG/$SWIFT_SDK_TAG-wasm32-unknown-wasi.artifactbundle.zip";
48+
)
49+
```
50+
51+
</details>
52+
53+
3. Install dependencies:
54+
```bash
55+
make bootstrap
56+
```
57+
58+
### Running Tests
59+
- Run unit tests:
60+
```bash
61+
make unittest SWIFT_SDK_ID=wasm32-unknown-wasi
62+
```
63+
- Run integration tests:
64+
```bash
65+
make test SWIFT_SDK_ID=wasm32-unknown-wasi
66+
```
67+
68+
## Support
69+
If you have any questions or need assistance, feel free to reach out via [GitHub Issues](https://github.com/swiftwasm/JavaScriptKit/issues) or [Discord](https://discord.gg/ashJW8T8yp).

README.md

-27
Original file line numberDiff line numberDiff line change
@@ -257,33 +257,6 @@ You can also build your project with webpack.js and a manually installed SwiftWa
257257
see the following sections and the [Example](https://github.com/swiftwasm/JavaScriptKit/tree/main/Example)
258258
directory for more information in this more advanced use case.
259259

260-
## Manual toolchain installation
261-
262-
This library only supports [`swiftwasm/swift`](https://github.com/swiftwasm/swift) toolchain distribution.
263-
The toolchain can be installed via [`swiftenv`](https://github.com/kylef/swiftenv), in
264-
the same way as the official Swift nightly toolchain.
265-
266-
You have to install the toolchain manually when working on the source code of JavaScriptKit itself,
267-
especially if you change anything in the JavaScript runtime parts. This is because the runtime parts are
268-
embedded in `carton` and currently can't be replaced dynamically with the JavaScript code you've
269-
updated locally.
270-
271-
Just pass a toolchain archive URL for [the latest SwiftWasm 5.6
272-
release](https://github.com/swiftwasm/swift/releases/tag/swift-wasm-5.6.0-RELEASE) appropriate for your platform:
273-
274-
```sh
275-
$ swiftenv install "https://github.com/swiftwasm/swift/releases/download/swift-wasm-5.6.0-RELEASE/swift-wasm-5.6.0-RELEASE-macos_$(uname -m).pkg"
276-
```
277-
278-
You can also use the `install-toolchain.sh` helper script that uses a hardcoded toolchain snapshot:
279-
280-
```sh
281-
$ ./scripts/install-toolchain.sh
282-
$ swift --version
283-
Swift version 5.6 (swiftlang-5.6.0)
284-
Target: arm64-apple-darwin20.6.0
285-
```
286-
287260
## Sponsoring
288261

289262
[Become a gold or platinum sponsor](https://github.com/sponsors/swiftwasm/) and contact maintainers to add your logo on our README on Github with a link to your site.

0 commit comments

Comments
 (0)