|
| 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). |
0 commit comments