flowquery 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -47,6 +47,12 @@ jobs:
47
47
  cp dist/flowquery.min.js flowquery-vscode/flowQueryEngine/
48
48
  ls -la flowquery-vscode/flowQueryEngine/
49
49
 
50
+ - name: Copy to docs folder
51
+ run: |
52
+ echo "Copying flowquery.min.js to docs folder for GitHub Pages..."
53
+ cp dist/flowquery.min.js docs/
54
+ ls -la docs/flowquery.min.js
55
+
50
56
  - name: Bump version
51
57
  id: version
52
58
  run: |
@@ -61,7 +67,7 @@ jobs:
61
67
  echo "tag=v${NEW_VERSION}" >> $GITHUB_OUTPUT
62
68
 
63
69
  # Commit the version bump
64
- git add package.json package-lock.json
70
+ git add package.json package-lock.json docs/flowquery.min.js
65
71
  git commit -m "chore: bump version to ${NEW_VERSION} [skip ci]"
66
72
  git push
67
73
 
package/README.md CHANGED
@@ -18,8 +18,61 @@ FlowQuery is written in TypeScript (https://www.typescriptlang.org/) and built/c
18
18
  - This will run all unit tests.
19
19
  - Build: ```npm run build``` (builds for both Node and web)
20
20
 
21
+ ## Installation & Usage
22
+
23
+ ### Node.js
24
+
25
+ Install FlowQuery from npm:
26
+
27
+ ```bash
28
+ npm install flowquery
29
+ ```
30
+
31
+ Then use it in your code:
32
+
33
+ ```javascript
34
+ const FlowQuery = require('flowquery').default;
35
+ // Or with ES modules:
36
+ // import FlowQuery from 'flowquery';
37
+
38
+ async function main() {
39
+ const query = new FlowQuery('WITH 1 AS x RETURN x + 1');
40
+ await query.run();
41
+ console.log(query.results); // [ { expr0: 2 } ]
42
+ }
43
+
44
+ main();
45
+ ```
46
+
47
+ ### Browser
48
+
49
+ Include the minified bundle in your HTML:
50
+
51
+ ```html
52
+ <script src="https://microsoft.github.io/FlowQuery/flowquery.min.js"></script>
53
+ <script>
54
+ async function main() {
55
+ const query = new FlowQuery('WITH 1 AS x RETURN x + 1');
56
+ await query.run();
57
+ console.log(query.results); // [ { expr0: 2 } ]
58
+ }
59
+
60
+ main();
61
+ </script>
62
+ ```
63
+
64
+ Or import from the browser-specific entry point:
65
+
66
+ ```javascript
67
+ import FlowQuery from 'flowquery/browser';
68
+
69
+ const query = new FlowQuery('WITH "Hello" AS greeting RETURN greeting');
70
+ await query.run();
71
+ console.log(query.results);
72
+ ```
73
+
21
74
  ## Examples
22
- See also .\queries and .\tests\compute\runner.test.ts for more examples.
75
+ See also ./misc/queries and ./tests/compute/runner.test.ts for more examples.
23
76
  ```cypher
24
77
  /*
25
78
  Collect 10 random pieces of wisdom and create a letter histogram.
@@ -52,7 +52,7 @@ const null_1 = __importDefault(require("./components/null"));
52
52
  * @example
53
53
  * ```typescript
54
54
  * const parser = new Parser();
55
- * const ast = parser.parse("unwind [1, 2, 3, 4, 5, 6] as num return num");
55
+ * const ast = parser.parse("unwind [1, 2, 3, 4, 5] as num return num");
56
56
  * ```
57
57
  */
58
58
  class Parser extends base_parser_1.default {
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const token_1 = __importDefault(require("../../src/tokenization/token"));
7
- const trie_1 = __importDefault(require("../../src/tokenization/trie"));
6
+ const token_1 = __importDefault(require("./token"));
7
+ const trie_1 = __importDefault(require("./trie"));
8
8
  /**
9
9
  * Maps string values to tokens using a Trie for efficient lookup.
10
10
  *
@@ -1 +1 @@
1
- {"version":3,"file":"token_mapper.js","sourceRoot":"","sources":["../../src/tokenization/token_mapper.ts"],"names":[],"mappings":";;;;;AAAA,yEAAiD;AACjD,uEAA+C;AAE/C;;;;;;;;;;;GAWG;AACH,MAAM,WAAW;IAGb;;;;OAIG;IACH,YAAoB,KAA6B;QAA7B,UAAK,GAAL,KAAK,CAAwB;QAPzC,UAAK,GAAS,IAAI,cAAI,EAAE,CAAC;QAQ7B,KAAI,MAAM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AO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACH,IAAW,UAAU;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC;IACjC,CAAC;CACJ;AAED,kBAAe,WAAW,CAAC"}
@@ -0,0 +1,48 @@
1
+ # RAG FlowQuery App
2
+
3
+ A RAG (Retrieval Augmented Generation) loop based on [FlowQuery](https://www.npmjs.com/package/flowquery).
4
+
5
+ ## Prerequisites
6
+
7
+ - Node.js 18+
8
+ - npm
9
+
10
+ ## Getting Started
11
+
12
+ ```bash
13
+ # Install dependencies
14
+ npm install
15
+
16
+ # Run in development mode (with ts-node)
17
+ npm run dev
18
+
19
+ # Or build and run
20
+ npm run build
21
+ npm start
22
+ ```
23
+
24
+ ## Available Scripts
25
+
26
+ | Script | Description |
27
+ |--------|-------------|
28
+ | `npm run dev` | Run directly with ts-node (for development) |
29
+ | `npm run build` | Compile TypeScript to `dist/` |
30
+ | `npm start` | Run the compiled JavaScript |
31
+ | `npm run build:bundle` | Create a webpack bundle |
32
+ | `npm run watch` | Watch mode for TypeScript compilation |
33
+
34
+ ## Project Structure
35
+
36
+ ```
37
+ RAG/
38
+ ├── src/
39
+ │ └── index.ts # Main entry point
40
+ ├── dist/ # Compiled output (generated)
41
+ ├── package.json
42
+ ├── tsconfig.json
43
+ └── webpack.config.js
44
+ ```
45
+
46
+ ## License
47
+
48
+ MIT
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "rag-flowquery",
3
+ "version": "1.0.0",
4
+ "description": "A RAG (Retrieval Augmented Generation) loop based on FlowQuery.",
5
+ "main": "dist/index.js",
6
+ "scripts": {
7
+ "start": "node dist/index.js",
8
+ "dev": "ts-node src/index.ts",
9
+ "build": "tsc",
10
+ "build:bundle": "webpack",
11
+ "watch": "tsc --watch"
12
+ },
13
+ "keywords": [
14
+ "rag",
15
+ "flowquery",
16
+ "retrieval-augmented-generation"
17
+ ],
18
+ "author": "",
19
+ "license": "MIT",
20
+ "dependencies": {
21
+ "flowquery": "^1.0.2"
22
+ },
23
+ "devDependencies": {
24
+ "@types/node": "^22.0.0",
25
+ "ts-loader": "^9.5.1",
26
+ "ts-node": "^10.9.2",
27
+ "typescript": "^5.7.2",
28
+ "webpack": "^5.97.1",
29
+ "webpack-cli": "^6.0.1"
30
+ }
31
+ }
@@ -0,0 +1,20 @@
1
+ import { run } from 'flowquery';
2
+
3
+ /**
4
+ * RAG (Retrieval Augmented Generation) loop using FlowQuery.
5
+ *
6
+ * This is a starter template - customize it for your RAG implementation.
7
+ */
8
+ async function main() {
9
+ // Example: Run a simple FlowQuery query
10
+ const query = `return 1`;
11
+
12
+ try {
13
+ const result = await run(query);
14
+ console.log('Result:', result);
15
+ } catch (error) {
16
+ console.error('Error running query:', error);
17
+ }
18
+ }
19
+
20
+ main();
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "outDir": "./dist",
4
+ "rootDir": "./src",
5
+ "target": "ES2020",
6
+ "module": "commonjs",
7
+ "moduleResolution": "node",
8
+ "esModuleInterop": true,
9
+ "forceConsistentCasingInFileNames": true,
10
+ "strict": true,
11
+ "skipLibCheck": true,
12
+ "declaration": true,
13
+ "sourceMap": true,
14
+ "resolveJsonModule": true,
15
+ "types": ["node"]
16
+ },
17
+ "include": ["src/**/*"],
18
+ "exclude": ["node_modules", "dist"]
19
+ }
@@ -0,0 +1,32 @@
1
+ const path = require('path');
2
+
3
+ module.exports = {
4
+ mode: 'production',
5
+ entry: './src/index.ts',
6
+ target: 'node',
7
+ output: {
8
+ filename: 'rag.bundle.js',
9
+ path: path.resolve(__dirname, 'dist'),
10
+ libraryTarget: 'commonjs2'
11
+ },
12
+ resolve: {
13
+ extensions: ['.ts', '.js']
14
+ },
15
+ module: {
16
+ rules: [
17
+ {
18
+ test: /\.ts$/,
19
+ use: 'ts-loader',
20
+ exclude: /node_modules/
21
+ }
22
+ ]
23
+ },
24
+ externals: {
25
+ // Add any externals here if needed
26
+ // For example, if you want to exclude flowquery from the bundle:
27
+ // 'flowquery': 'commonjs flowquery'
28
+ },
29
+ optimization: {
30
+ minimize: true
31
+ }
32
+ };
@@ -0,0 +1 @@
1
+ Example apps using FlowQuery.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowquery",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "A declarative query language for data processing pipelines.",
5
5
  "main": "dist/index.node.js",
6
6
  "types": "dist/index.node.d.ts",
@@ -37,6 +37,7 @@
37
37
  "jest": "^29.7.0",
38
38
  "ts-jest": "^29.2.5",
39
39
  "ts-loader": "^9.5.1",
40
+ "ts-node": "^10.9.2",
40
41
  "typedoc": "^0.28.14",
41
42
  "typescript": "^5.7.2",
42
43
  "webpack": "^5.97.1",
@@ -50,7 +50,7 @@ import Null from "./components/null";
50
50
  * @example
51
51
  * ```typescript
52
52
  * const parser = new Parser();
53
- * const ast = parser.parse("unwind [1, 2, 3, 4, 5, 6] as num return num");
53
+ * const ast = parser.parse("unwind [1, 2, 3, 4, 5] as num return num");
54
54
  * ```
55
55
  */
56
56
  class Parser extends BaseParser {
@@ -1,5 +1,5 @@
1
- import Token from "../../src/tokenization/token";
2
- import Trie from "../../src/tokenization/trie";
1
+ import Token from "./token";
2
+ import Trie from "./trie";
3
3
 
4
4
  /**
5
5
  * Maps string values to tokens using a Trie for efficient lookup.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes