From a7e6b30f5dc15b3b6aef9e40067412646f967052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=AFd?= <20957603+ayewo@users.noreply.github.com> Date: Mon, 1 Apr 2024 10:41:06 +0100 Subject: [PATCH 1/4] add list of tools needed for development --- CONTRIBUTING.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2e3c66e0d..04b571a37 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,6 +9,19 @@ We welcome contributions in the form of pull requests and issues. Note that this codebase isn't yet extensively documented. If you get stuck, please ask for help [on Discord](https://docs.grit.io/discord). +## Development Setup + +A high level overview of tools you need to have installed: + +* Rust compiler. You'll need [`rustc`](https://rustup.rs/) v1.74 or newer. +* C/C++ compiler. macOS: [Xcode Command Line Tools](https://download.developer.apple.com/Developer_Tools/Command_Line_Tools_for_Xcode_15.3/Command_Line_Tools_for_Xcode_15.3.dmg) via `xcode-select --install`, Linux: [gcc](https://learnubuntu.com/install-gcc/), Windows: [Microsoft Visual C++](https://visualstudio.microsoft.com/vs/features/cplusplus/). +* Emscripten: a C/C++ compiler toolchain for WASM. Install v3.1.56 with [`emsdk`](https://emscripten.org/docs/getting_started/downloads.html). +* Node.js runtime. You'll need [`node`](https://nodejs.org/en/download) v18.5.0 or newer. +* Yarn package manager. You'll need [`yarn`](https://classic.yarnpkg.com/en/docs/install) (classic). Install v1.22.19 with `npm install --global yarn`. +* Tree-Sitter CLI: provides [`tree-sitter`](https://github.com/tree-sitter/tree-sitter/tree/master/cli) binary for testing grammars. Install v0.22.2 with `npm install --global tree-sitter-cli`. + + + ## Feature Flags We use [feature flags](https://doc.rust-lang.org/cargo/reference/features.html) to control which parts of the codebase are compiled. From 81d47d9d4c831804de0641752182a6f141e2b1f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=AFd?= <20957603+ayewo@users.noreply.github.com> Date: Mon, 1 Apr 2024 10:59:48 +0100 Subject: [PATCH 2/4] add basic steps on how to run tests --- CONTRIBUTING.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 04b571a37..e35b04c69 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,7 +20,23 @@ A high level overview of tools you need to have installed: * Yarn package manager. You'll need [`yarn`](https://classic.yarnpkg.com/en/docs/install) (classic). Install v1.22.19 with `npm install --global yarn`. * Tree-Sitter CLI: provides [`tree-sitter`](https://github.com/tree-sitter/tree-sitter/tree/master/cli) binary for testing grammars. Install v0.22.2 with `npm install --global tree-sitter-cli`. - +## Building the Code + +Use `git` to clone this repository into a location of your choice. +```bash +git clone https://github.com/getgrit/gritql.git +``` + +Change into the cloned repository and make sure all submodules are correctly set up, including any nested submodules: +```bash +cd gritql +git submodule update --init --recursive +``` + +Before making any changes to the code, make sure you can run the tests and everything is initially passing: +```bash +cargo test --workspace +``` ## Feature Flags From dbe396f4f73c18e616da0fb361d38079cb3bad53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=AFd?= <20957603+ayewo@users.noreply.github.com> Date: Mon, 1 Apr 2024 21:48:28 +0100 Subject: [PATCH 3/4] consolidate development tools section --- CONTRIBUTING.md | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a464ec4fa..d911e4761 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,12 +13,14 @@ Note that this codebase isn't yet extensively documented. If you get stuck, plea A high level overview of tools you need to have installed: -* Rust compiler. You'll need [`rustc`](https://rustup.rs/) v1.74 or newer. +* Rust toolchain: for compiling the codebase. You'll need [`rustc`](https://rustup.rs/) v1.74 or newer. + * In order to create WASM builds, you should run `rustup target install wasm32-unknown-unknown`. * C/C++ compiler. macOS: [Xcode Command Line Tools](https://download.developer.apple.com/Developer_Tools/Command_Line_Tools_for_Xcode_15.3/Command_Line_Tools_for_Xcode_15.3.dmg) via `xcode-select --install`, Linux: [gcc](https://learnubuntu.com/install-gcc/), Windows: [Microsoft Visual C++](https://visualstudio.microsoft.com/vs/features/cplusplus/). * Emscripten: a C/C++ compiler toolchain for WASM. Install v3.1.56 with [`emsdk`](https://emscripten.org/docs/getting_started/downloads.html). -* Node.js runtime. You'll need [`node`](https://nodejs.org/en/download) v18.5.0 or newer. +* Node.js runtime: `node`, `npm`, `npx` are used to generate parsers from `grammar.js` files. You'll need [`node`](https://nodejs.org/en/download) v18.5.0 or newer. * Yarn package manager. You'll need [`yarn`](https://classic.yarnpkg.com/en/docs/install) (classic). Install v1.22.19 with `npm install --global yarn`. * Tree-Sitter CLI: provides [`tree-sitter`](https://github.com/tree-sitter/tree-sitter/tree/master/cli) binary for testing grammars. Install v0.22.2 with `npm install --global tree-sitter-cli`. +* Terraform CLI. Install [`terraform`](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli) with `brew tap hashicorp/tap && brew install hashicorp/tap/terraform`. ## Building the Code @@ -98,12 +100,3 @@ These steps are done in our cloud environment and are not necessary for contribu - There are also `exhaustive` runtime checks that error if a switch case doesn’t handle a language, like `makeSingleLineComment`. Search for `exhaustive(lang` and fill those out too. - Regenerate both DB/prisma types to add it to the DB schema and GraphQL types. - Add the language to `language-selector.tsx`. Pick an icon from [https://react-icons.github.io](https://react-icons.github.io/), usually from the Simple Icons category. - -## Development Tools - -Make sure you have the following tools installed to guarantee everything works: - -- Rust Toolchain - - In order to create WASM builds, you should run `rustup target install wasm32-unknown-unknown` -- `terraform` CLI. See https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli -- `npx`. Install with Node.js: https://docs.npmjs.com/downloading-and-installing-node-js-and-npm From 8949c57c28faff0380d6c67d7c77c41c0d88b943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=AFd?= <20957603+ayewo@users.noreply.github.com> Date: Mon, 1 Apr 2024 21:51:14 +0100 Subject: [PATCH 4/4] add CodeRabbit suggestions --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d911e4761..91d4ecdd4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,10 +11,10 @@ Note that this codebase isn't yet extensively documented. If you get stuck, plea ## Development Setup -A high level overview of tools you need to have installed: +A high-level overview of tools you need to have installed: * Rust toolchain: for compiling the codebase. You'll need [`rustc`](https://rustup.rs/) v1.74 or newer. - * In order to create WASM builds, you should run `rustup target install wasm32-unknown-unknown`. + * To create WASM builds, run `rustup target install wasm32-unknown-unknown`. * C/C++ compiler. macOS: [Xcode Command Line Tools](https://download.developer.apple.com/Developer_Tools/Command_Line_Tools_for_Xcode_15.3/Command_Line_Tools_for_Xcode_15.3.dmg) via `xcode-select --install`, Linux: [gcc](https://learnubuntu.com/install-gcc/), Windows: [Microsoft Visual C++](https://visualstudio.microsoft.com/vs/features/cplusplus/). * Emscripten: a C/C++ compiler toolchain for WASM. Install v3.1.56 with [`emsdk`](https://emscripten.org/docs/getting_started/downloads.html). * Node.js runtime: `node`, `npm`, `npx` are used to generate parsers from `grammar.js` files. You'll need [`node`](https://nodejs.org/en/download) v18.5.0 or newer.