Cole-Greer commented on code in PR #3341: URL: https://github.com/apache/tinkerpop/pull/3341#discussion_r2984529592
########## gremlin-js/gremlin-javascript/AGENTS.md: ########## @@ -0,0 +1,138 @@ +### gremlin-javascript AGENTS.md + +This document provides stack-specific guidance for developers and AI agents working on the `gremlin-javascript` +module. It supplements the root `AGENTS.md` file. + +--- + +### 1. Maven and npm Workspace Relationship + +`gremlin-javascript` is part of the `gremlin-js` Maven parent module. Understanding this relationship is +critical before making build or path changes. + +**Maven hierarchy:** +``` +tinkerpop/pom.xml +└── gremlin-js/pom.xml ← Maven parent; runs `npm ci` at workspace root + ├── gremlin-javascript/pom.xml ← this module + ├── gremlin-mcp/pom.xml + └── gremlint/pom.xml +``` + +**npm workspace hierarchy:** +``` +gremlin-js/package.json ← workspace root (node_modules/ lives here) +├── gremlin-javascript/ ← workspace member "gremlin" +├── gremlin-mcp/ ← workspace member "gremlin-mcp" +└── gremlint/ ← workspace member "gremlint" +``` + +Because npm workspaces hoist shared dependencies to `gremlin-js/node_modules/`, packages such as `mocha`, +`antlr4ng`, and `typescript` may **not** exist under `gremlin-javascript/node_modules/`. Scripts must +reference them by name (e.g. `mocha`) rather than by relative path (e.g. `./node_modules/mocha/bin/mocha.js`). +The `postinstall` script (`scripts/patch-antlr4ng.js`) uses `createRequire` to resolve packages through +the workspace rather than assuming a local `node_modules/`. + +--- + +### 2. Directory Structure + +``` +gremlin-javascript/ +├── lib/ TypeScript source (driver, process, structure, language) +│ └── language/ Review Comment: We should also include the driver, process, and structure directories here. These are likely the most important directories for agents to navigate gremlin-javascript -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
