Skip to content

mono - chore: moving keyv to better mono structure#1838

Merged
jaredwray merged 1 commit intomainfrom
mono---chore-moving-keyv-to-better-mono-structure
Feb 12, 2026
Merged

mono - chore: moving keyv to better mono structure#1838
jaredwray merged 1 commit intomainfrom
mono---chore-moving-keyv-to-better-mono-structure

Conversation

@jaredwray
Copy link
Owner

@jaredwray jaredwray commented Feb 12, 2026

Please check if the PR fulfills these requirements

  • Followed the Contributing and Code of Conduct guidelines.
  • Tests for the changes have been added (for bug fixes/features) with 100% code coverage.

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
mono - chore: moving keyv to better mono structure

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jaredwray, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request undertakes a substantial refactoring of the project's monorepo architecture. The primary goal is to enhance the clarity and organization of the codebase by grouping related packages into logical categories such as core components, compression adapters, serialization utilities, and various storage adapters. This change impacts file paths across the repository, necessitating updates to configuration files, documentation, and build scripts to ensure consistency and proper functionality within the new structure.

Highlights

  • Monorepo Structure Reorganization: The project's monorepo structure has been significantly reorganized, moving packages from a flat 'packages/' directory into categorized 'core/', 'compression/', 'serialization/', and 'storage/' directories for better organization and maintainability.
  • Documentation Updates: The main README.md has been extensively refactored to provide a clearer 'Getting Started' guide and reflect the new monorepo layout. The AGENTS.md file and internal documentation links within various READMEs were also updated to align with the new directory structure.
  • Build and Configuration Updates: The pnpm-workspace.yaml file was updated to define the new workspace structure. Docker Compose files for ARM64 and standard environments were modified to reflect the updated paths for database services (PostgreSQL, MySQL, Redis). The Node.js version in .nvmrc was upgraded from 20 to 24.
  • Documentation Generation Script Refactor: The script responsible for generating documentation for the website was refactored and moved to accommodate the new monorepo structure.
Changelog
  • .gitignore
    • Updated paths for SQLite test database and website documentation to reflect the new monorepo structure.
    • Removed 'pnpm-lock.yaml' from ignored files.
  • .nvmrc
    • Updated the specified Node.js version from 20 to 24.
  • AGENTS.md
    • Updated test command examples to use the new category-based paths.
    • Revised the monorepo structure description to reflect the new 'core', 'serialization', 'compression', and 'storage' directories.
  • README.md
    • Refactored the 'Getting Started' section to be more concise and user-friendly.
    • Introduced a detailed 'Project Structure' section outlining the new monorepo organization.
    • Updated all internal links to packages and adapters to point to their new locations.
    • Moved the 'Keyv v5 to v6' migration notice to the end of the document.
  • packages/website/src/docs.ts
    • Removed the old documentation generation script.
  • pnpm-workspace.yaml
    • Updated workspace definitions to include 'core/', 'serialization/', 'compression/', 'storage/', and 'website' directories.
  • scripts/docker-compose-arm64.yaml
    • Updated build contexts for PostgreSQL, MySQL, and Redis services to reflect their new locations under the 'storage/' directory.
  • scripts/docker-compose.yaml
    • Updated build contexts for PostgreSQL, MySQL, and Redis services to reflect their new locations under the 'storage/' directory.
  • website/src/docs.ts
    • Added a new documentation generation script, refactored to work with the updated monorepo structure.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/bun-test.yaml
    • .github/workflows/deploy-website.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (cf66acd) to head (3c5eee2).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1838   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           32        32           
  Lines         2434      2434           
  Branches       446       446           
=========================================
  Hits          2434      2434           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3c5eee2488

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jaredwray jaredwray merged commit da2a5a1 into main Feb 12, 2026
10 checks passed
@jaredwray jaredwray deleted the mono---chore-moving-keyv-to-better-mono-structure branch February 12, 2026 03:06
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly refactors the monorepo structure, organizing packages into directories like core, storage, and compression. While this is a great organizational improvement, a critical Path Traversal vulnerability was identified in the new documentation generation script website/src/docs.ts, which could allow an attacker to read or write arbitrary files on the build server. Additionally, consider reverting the Node.js version bump in .nvmrc to an LTS release for stability, and address maintainability and readability suggestions in website/src/docs.ts.

Comment on lines +110 to +129
async function createDoc(adapterName: string, path: string, outputPath: string, parent:string) {
const originalFileName = "README.md";
const newFileName = `${adapterName}.md`;
const packageJSONPath = `${path}/${adapterName}/package.json`;
const packageJSONContent = await fs.promises.readFile(packageJSONPath);
const packageJSON = JSON.parse(packageJSONContent.toString());
const originalFileText = await fs.promises.readFile(`${path}/${adapterName}/${originalFileName}`, "utf8");
let newFileText = "---\n";
newFileText += `title: '${packageJSON.name}'\n`;
newFileText += `sidebarTitle: '${packageJSON.name}'\n`;
newFileText += `parent: '${parent}'\n`;
newFileText += "---\n";
newFileText += "\n";
newFileText += originalFileText;

newFileText = cleanDocumentFromImage(newFileText);

await fs.promises.mkdir(outputPath, {recursive: true});
await fs.promises.writeFile(`${outputPath}/${newFileName}`, newFileText);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-high high

The createDoc function is vulnerable to path traversal. The adapterName parameter, which is derived from directory listings, is used to construct file paths for reading and writing without proper sanitization. An attacker who can control the names of files or directories in the source directories could use path traversal sequences (e.g., ../) to cause the script to read or write files from arbitrary locations on the file system where the script is executed. This could lead to information disclosure or arbitrary file writes on the build server. It is recommended to use the path module for constructing paths and to sanitize the input from readdir.

async function createDoc(adapterName: string, basePath: string, outputPath: string, parent:string) {
	const path = await import('node:path');
	const safeAdapterName = path.basename(adapterName);
	const originalFileName = "README.md";
	const newFileName = `${safeAdapterName}.md`;
	const packageJSONPath = path.join(basePath, safeAdapterName, 'package.json');
	const packageJSONContent = await fs.promises.readFile(packageJSONPath);
	const packageJSON = JSON.parse(packageJSONContent.toString());
	const originalFileText = await fs.promises.readFile(path.join(basePath, safeAdapterName, originalFileName), "utf8");
	let newFileText = "---\
";
	newFileText += `title: '${packageJSON.name}'\
`;
	newFileText += `sidebarTitle: '${packageJSON.name}'\
`;
	newFileText += `parent: '${parent}'\
`;
	newFileText += "---\
";
	newFileText += "\
";
	newFileText += originalFileText;

	newFileText = cleanDocumentFromImage(newFileText);

	await fs.promises.mkdir(outputPath, {recursive: true});
	await fs.promises.writeFile(path.join(outputPath, newFileName), newFileText);
}

@@ -1 +1 @@
20 No newline at end of file
24 No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The Node.js version has been updated from 20 (LTS) to 24 (Current). For better stability and long-term support, it is recommended to use an LTS version. Consider using Node.js 22, which is the next LTS release, or sticking with Node.js 20.

22

const basePath = await getBasePath();

console.log("base path:" + basePath);
console.log("docs path:" + await getRelativeDocsPath());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The function getRelativeDocsPath is called here, but its return value is only used for logging and is not used elsewhere. This line and the getRelativeDocsPath function (lines 100-108) appear to be dead code and can be removed to improve maintainability.

Comment on lines +75 to +78
document = document.replace(`<h1 align="center"><img width="250" src="https://jaredwray.com/images/keyv.svg" alt="keyv"></h1>`, "");
document = document.replace(`[<img width="100" align="right" src="https://jaredwray.com/images/keyv.svg" alt="keyv">](https://github.com/jaredwra/keyv)`, "");
document = document.replace(`[<img width="100" align="right" src="https://jaredwray.com/images/keyv-symbol.svg" alt="keyv">](https://github.com/jaredwra/keyv)`, "");
return document;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This function can be written more concisely by chaining the replace calls. This improves readability and avoids reassigning the document variable multiple times.

Suggested change
document = document.replace(`<h1 align="center"><img width="250" src="https://jaredwray.com/images/keyv.svg" alt="keyv"></h1>`, "");
document = document.replace(`[<img width="100" align="right" src="https://jaredwray.com/images/keyv.svg" alt="keyv">](https://github.com/jaredwra/keyv)`, "");
document = document.replace(`[<img width="100" align="right" src="https://jaredwray.com/images/keyv-symbol.svg" alt="keyv">](https://github.com/jaredwra/keyv)`, "");
return document;
return document
.replace(`<h1 align="center"><img width="250" src="https://jaredwray.com/images/keyv.svg" alt="keyv"></h1>`, "")
.replace(`[<img width="100" align="right" src="https://jaredwray.com/images/keyv.svg" alt="keyv">](https://github.com/jaredwra/keyv)`, "")
.replace(`[<img width="100" align="right" src="https://jaredwray.com/images/keyv-symbol.svg" alt="keyv">](https://github.com/jaredwra/keyv)`, "");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant