Skip to content

Commit

Permalink
chore: embed cruncher in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
IamShobe committed Jan 4, 2025
1 parent c062557 commit 839b970
Show file tree
Hide file tree
Showing 8 changed files with 477 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ jobs:
steps:
- name: Checkout your repository using git
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
- name: Install, and build the main Cruncher app
run: |
pnpm install
pnpm build
- name: Install, build, and upload your site
uses: withastro/action@v3
with:
Expand Down
2 changes: 2 additions & 0 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// @ts-check
import { defineConfig } from 'astro/config';
import react from '@astrojs/react';
import starlight from '@astrojs/starlight';

// https://astro.build/config
export default defineConfig({
site: 'https://cruncher.iamshobe.com',
integrations: [
react(),
starlight({
title: 'Cruncher',
logo: {
Expand Down
2 changes: 2 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/react": "^4.1.2",
"@astrojs/starlight": "^0.30.3",
"astro": "^5.0.2",
"cruncher": "link:..",
"sharp": "^0.32.5"
}
}
433 changes: 433 additions & 0 deletions docs/pnpm-lock.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,22 @@ title: QQL (Quick Query Language)
description: The main query language inside `Cruncher` - it's main goal is to have a quick - easy to learn language - that's powerful enought to allow power users access to enhanced capabilities over that data.
---

QQL is the main query language inside `Cruncher` - it's main goal is to have a quick - easy to learn language - that's powerful enought to allow power users access to enhanced capabilities over that data.
import {LocalContent} from 'cruncher';

QQL is the main query language inside `Cruncher` - it's main goal is to have a quick - easy to learn language - that's powerful enought to allow power users access to enhanced capabilities over that data.

The query language was heavily inspired from Splunk (SPL2) and Kusto (KQL).


<hr/>
<br/>

## Example

Here you can see cruncher embedded.
It will return the `name` and `address` of all `developers` found in mocked logs:


<LocalContent client:only="react" query={"developer | table name, address"}>
<p>Loading...</p>
</LocalContent>
1 change: 1 addition & 0 deletions lib/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export {default as MainContent} from "~core/MainContent";
export {LocalContent} from "~bundle/LocalContent";

// cosumers
export {DateType} from "~core/store/dateState";
Expand Down
12 changes: 12 additions & 0 deletions src/bundle/LocalContent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { MockController } from '~adapters/local/controller';
import MainContent from '~core/MainContent';

export const LocalContent = ({query}: {query: string}) => {
return (
<main style={{width: "100%", height: 500, display: "flex"}}>
<MainContent controller={MockController}
initialQuery={query}
/>
</main>
);
}
1 change: 1 addition & 0 deletions src/components/ui/editor/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ export const Editor = React.forwardRef<HTMLTextAreaElement, EditorProps>(({ valu
placeholder="Type your query here..."
value={value}
ref={setReferenceElement}
data-1p-ignore="disabled"
data-enable-grammarly="false"
style={{
position: "relative",
Expand Down

0 comments on commit 839b970

Please sign in to comment.