|
| 1 | +# Contributing / Developing Guide for this project |
| 2 | + |
| 3 | +## Build the project |
| 4 | + |
| 5 | +This is a React-Vite project. So checkout [package.json](/package.json) for available commands. |
| 6 | + |
| 7 | +The major purpose of this project is to provide a web playground for Apache DataFusion (uses [datafusion-wasm-bindings](https://github.com/datafusion-contrib/datafusion-wasm-bindings)). |
| 8 | + |
| 9 | +Command to install dependencies: |
| 10 | + |
| 11 | +```bash |
| 12 | +npm install |
| 13 | +``` |
| 14 | + |
| 15 | +Command to start the playground: |
| 16 | + |
| 17 | +``` |
| 18 | +vite |
| 19 | +``` |
| 20 | + |
| 21 | +## Local Development with datafusion-wasm-bindings |
| 22 | + |
| 23 | +1. Build datafusion-wasm-bindings, see [instructions](https://github.com/datafusion-contrib/datafusion-wasm-bindings/blob/main/CONTRIBUTING.md) to generate the `pkg` folder on local. |
| 24 | + |
| 25 | +2. Add the global path alias for `pkg` to your local vite.config.ts file. |
| 26 | + For example: |
| 27 | + |
| 28 | + ```javascript |
| 29 | + export default defineConfig({ |
| 30 | + base: "/datafusion-wasm-playground/", |
| 31 | + resolve: { |
| 32 | + alias: { |
| 33 | + "datafusion-wasm": resolve(__dirname, "${PATH_TO_YOUR_PKG}"), |
| 34 | + }, |
| 35 | + }, |
| 36 | + plugins: [ |
| 37 | + wasm(), |
| 38 | + topLevelAwait(), |
| 39 | + ... |
| 40 | + ], |
| 41 | + }); |
| 42 | + ``` |
| 43 | + |
| 44 | + This way your `package.json` dependencies can be alias to your local development package. |
| 45 | + |
| 46 | +3. Start the Playground! |
| 47 | + |
| 48 | +This will generate a `pkg` directory containing the WASM binary and a JavaScript wrapper. You can use it as a npm package. The `--target web` specifies that the WASM binary is for web usage (inside browser), other options like `nodejs` or `deno` also exist if you want to use it in other environments. |
| 49 | + |
| 50 | +## How to Contribute |
| 51 | + |
| 52 | +### Find an Issue or Feature |
| 53 | + |
| 54 | +- Browse the issues to find something to work on, or suggest a new feature by opening an issue. |
| 55 | + |
| 56 | +### Development Workflow |
| 57 | + |
| 58 | +- Fork the repository and create a new branch for your changes. |
| 59 | +- Make your changes and ensure all tests pass. |
| 60 | +- Commit your changes with clear messages. |
| 61 | +- Push your branch and open a Pull Request (PR) against the main repository. |
| 62 | + |
| 63 | +Happy Coding 🚀 |
0 commit comments