Skip to content

Commit

Permalink
🚀 Initial open source release
Browse files Browse the repository at this point in the history
  • Loading branch information
morgante committed Mar 8, 2024
1 parent 4f06ca7 commit 205788c
Show file tree
Hide file tree
Showing 4,269 changed files with 5,029,137 additions and 1 deletion.
The diff you're trying to view is too large. We only load the first 3000 changed files.
108 changes: 108 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: main

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
# test-rust:
# name: Rust tests (marzano)
# timeout-minutes: 20
# strategy:
# fail-fast: false
# matrix:
# os: [nscloud-ubuntu-22.04-amd64-8x32]
# runs-on: ${{ matrix.os }}
# permissions:
# contents: "read"
# id-token: "write"
# env:
# ROOT_ANALYSIS_DIR: "${{ github.workspace }}/data"
# BUILD_OS: ${{ matrix.os }}
# os: ${{ matrix.os }}
# BUILD_PLATFORM: amd64
# steps:
# - name: clone code
# uses: actions/checkout@v3
# with:
# submodules: true
# fetch-depth: 0
# - name: Install Protoc
# run: sudo apt-get install -y protobuf-compiler
# - uses: dopplerhq/[email protected]
# id: doppler
# with:
# doppler-token: ${{ secrets.DOPPLER_SECRETS_TOKEN }}
# - name: install Rust
# uses: actions-rs/toolchain@v1
# with:
# # If you update this, also update build.mjs
# toolchain: nightly-2023-08-01
# override: true
# - name: install Terraform
# run: |
# wget https://releases.hashicorp.com/terraform/1.6.0/terraform_1.6.0_linux_amd64.zip
# unzip terraform_1.6.0_linux_amd64.zip
# chmod +x terraform
# sudo mv terraform /usr/local/bin/
# - name: install dependencies
# run: |
# cargo install buildkite-test-collector
# - name: setup node.js environment
# uses: actions/setup-node@v3
# - name: Install prettier
# run: |
# npm install -g prettier
# prettier --version
# - name: test
# env:
# GRIT_API_URL: ${{ steps.doppler.outputs.GRIT_API_URL }}
# API_TESTING_TOKEN: ${{ steps.doppler.outputs.API_TESTING_TOKEN }}
# run: |
# cargo test --workspace \
# --features test_ci \
# --exclude marzano-wasm-bindings \
# --exclude rustfsm \
# --exclude temporal-sdk-core-test-utils \
# --exclude temporal-client \
# --exclude temporal-sdk-core-protos \
# --exclude temporal-sdk \
# --exclude temporal-sdk-core \
# --exclude rustfsm_procmacro \
# --exclude rustfsm_codegen \
# --exclude google-cloud-metadata \
# --exclude google-cloud-auth \
# --exclude google-cloud-googleapis \
# --exclude google-cloud-gax \
# --exclude google-cloud-pubsub \
# -- -Z unstable-options
test-rust-wasm:
name: Rust wasm
timeout-minutes: 15
strategy:
fail-fast: false
runs-on:
- ubuntu-latest
permissions:
contents: "read"
id-token: "write"
steps:
- name: clone code
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: install wasm-pack
run: |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: build wasm
working-directory: ./crates/wasm-bindings
run: |
wasm-pack build --target web
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target
.grit
61 changes: 61 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
[submodule "resources/language-submodules/tree-sitter-solidity"]
path = resources/language-submodules/tree-sitter-solidity
url = https://github.com/JoranHonig/tree-sitter-solidity
[submodule "resources/language-submodules/tree-sitter-typescript"]
path = resources/language-submodules/tree-sitter-typescript
url = https://github.com/tree-sitter/tree-sitter-typescript
[submodule "resources/language-submodules/tree-sitter-javascript"]
path = resources/language-submodules/tree-sitter-javascript
url = https://github.com/tree-sitter/tree-sitter-javascript
[submodule "resources/language-submodules/tree-sitter-html"]
path = resources/language-submodules/tree-sitter-html
url = https://github.com/tree-sitter/tree-sitter-html
[submodule "resources/language-submodules/tree-sitter-css"]
path = resources/language-submodules/tree-sitter-css
url = https://github.com/tree-sitter/tree-sitter-css
[submodule "resources/language-submodules/tree-sitter-json"]
path = resources/language-submodules/tree-sitter-json
url = https://github.com/tree-sitter/tree-sitter-json
[submodule "resources/language-submodules/tree-sitter-java"]
path = resources/language-submodules/tree-sitter-java
url = https://github.com/tree-sitter/tree-sitter-java
[submodule "resources/language-submodules/tree-sitter-c-sharp"]
path = resources/language-submodules/tree-sitter-c-sharp
url = https://github.com/tree-sitter/tree-sitter-c-sharp
[submodule "resources/language-submodules/tree-sitter-go"]
path = resources/language-submodules/tree-sitter-go
url = https://github.com/tree-sitter/tree-sitter-go
[submodule "resources/language-submodules/tree-sitter-rust"]
path = resources/language-submodules/tree-sitter-rust
url = https://github.com/tree-sitter/tree-sitter-rust
[submodule "resources/language-submodules/tree-sitter-ruby"]
path = resources/language-submodules/tree-sitter-ruby
url = https://github.com/tree-sitter/tree-sitter-ruby
[submodule "resources/language-submodules/tree-sitter-yaml"]
path = resources/language-submodules/tree-sitter-yaml
url = https://github.com/ikatyang/tree-sitter-yaml.git
[submodule "resources/language-submodules/tree-sitter-hcl"]
path = resources/language-submodules/tree-sitter-hcl
url = https://github.com/MichaHoffmann/tree-sitter-hcl
[submodule "resources/language-submodules/tree-sitter-markdown"]
path = resources/language-submodules/tree-sitter-markdown
url = https://github.com/MDeiml/tree-sitter-markdown.git
[submodule "resources/language-submodules/tree-sitter-sql"]
path = resources/language-submodules/tree-sitter-sql
url = https://github.com/DerekStride/tree-sitter-sql
[submodule "resources/language-submodules/tree-sitter-vue"]
path = resources/language-submodules/tree-sitter-vue
url = https://github.com/ikatyang/tree-sitter-vue.git
[submodule "resources/language-submodules/tree-sitter-python"]
path = resources/language-submodules/tree-sitter-python
url = https://github.com/tree-sitter/tree-sitter-python
ignore = dirty
[submodule "web-tree-sitter"]
path = vendor/web-tree-sitter
url = https://github.com/getgrit/web-tree-sitter.git
[submodule "tree-sitter-facade"]
path = vendor/tree-sitter-facade
url = https://github.com/getgrit/tree-sitter-facade.git
[submodule "tree-sitter-gritql"]
path = vendor/tree-sitter-gritql
url = https://github.com/getgrit/tree-sitter-gritql.git
30 changes: 30 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Contributing to GritQL

Welcome! We'd love to help you contribute to GritQL.


## Welcome

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).

## Language Grammars

If GritQL is failing to match a code snippet, this can typically be fixed simply by adjusting the metavariable grammar for the target language.

Metavariable grammars are found under [./resources/metavariable-grammars]. Typical fixes include:
- Adding a new named field for a relevant node you want to manipulate.
- Adding a `grit_metavariable` node as a choice in the corresponding spot where you want to substitute the metavariable.

After making your changes, run the [./resources/edit_grammars.mjs] script to regenerate the matching grammar.

## Feature Flags

We use [feature flags](https://doc.rust-lang.org/cargo/reference/features.html) to control which parts of the codebase are compiled.

Note that some proprietary server-only integrations are hidden behind the "server" feature flag. This flag is disabled by default and code should compile without any additions.

For major changes, we put new features should be put into the `grit_alpha` feature flag. Features that are ready for broad release should be put into the `grit_beta` feature flag. This is used for all public releases.

Features that should be tested in CI should be put into the `grit_ci` feature flag. This is used for all CI tests.
Loading

0 comments on commit 205788c

Please sign in to comment.