Skip to content

refactor: rename Protect branding to Stack/Encryption#285

Closed
calvinbrewer wants to merge 10 commits into
mainfrom
refactor/protect-to-stack-branding
Closed

refactor: rename Protect branding to Stack/Encryption#285
calvinbrewer wants to merge 10 commits into
mainfrom
refactor/protect-to-stack-branding

Conversation

@calvinbrewer

Copy link
Copy Markdown
Contributor

Summary

  • Renames public API from Protect naming to Stack/Encryption (protect()Encryption(), csTable/csColumnencryptedTable/encryptedColumn, ProtectClientEncryptionClient, etc.)
  • All old names kept as deprecated aliases — nothing breaks
  • Adds packages/stack as the new core package (source copied from packages/protect, renamed internally)
  • Moves packages/protect-dynamodbpackages/dynamodb with imports updated to @cipherstash/stack
  • Updates @cipherstash/drizzle to depend on @cipherstash/stack instead of @cipherstash/protect
  • Updates all 8 example apps, all docs, READMEs, AGENTS.md, CONTRIBUTE.md, SECURITY.md, .cursorrules
  • Adds CLAUDE.md (Claude Code project instructions) and MIGRATION.md (public migration guide)

What changed

Area Changes
packages/stack/ New core package with all Protect→Encryption renames
packages/schema/ Added encryptedTable/encryptedColumn/encryptedValue exports + deprecated aliases for csTable/csColumn/csValue and Protect* types
packages/dynamodb/ Moved from packages/protect-dynamodb/, imports now use @cipherstash/stack
packages/drizzle/ Imports switched from @cipherstash/protect to @cipherstash/stack
examples/ All 8 examples updated: imports, types, factory calls, READMEs, package.json deps
docs/ All 17 doc files updated: code examples, prose, anchor links
Root files AGENTS.md, CONTRIBUTE.md, SECURITY.md, .cursorrules, .cursor/commands, .github/workflows

Test plan

  • pnpm run build passes
  • pnpm --filter @cipherstash/stack test passes (249/251, 2 pre-existing skips)
  • pnpm --filter @cipherstash/protect-dynamodb test passes (12/12)
  • pnpm --filter @cipherstash/drizzle test passes (69/69)
  • Deprecated imports still compile (protect, csTable, ProtectClient, etc.)

🤖 Generated with Claude Code

Rename public API from Protect naming to Stack/Encryption naming:
- protect() → Encryption()
- csTable/csColumn → encryptedTable/encryptedColumn
- ProtectClient → EncryptionClient
- ProtectError → EncryptionError
- @cipherstash/protect → @cipherstash/stack

All old names kept as deprecated aliases for backward compat.
Updates examples, docs, drizzle, dynamodb, and schema packages.
Adds packages/stack as the new core package.
Adds CLAUDE.md and MIGRATION.md.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Feb 11, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 4d44ce5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes changesets to release 11 packages
Name Type
@cipherstash/protect Minor
@cipherstash/schema Minor
@cipherstash/stack Minor
@cipherstash/drizzle Major
@cipherstash/protect-dynamodb Major
@cipherstash/basic-example Patch
@cipherstash/dynamo-example Patch
nest Patch
next-drizzle-mysql Patch
@cipherstash/nextjs-clerk-example Patch
@cipherstash/typeorm-example Patch

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Feb 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/protect-to-stack-branding

Comment @coderabbitai help to get the list of available commands and usage tips.

calvinbrewer and others added 9 commits February 11, 2026 14:35
Resolve merge conflicts and propagate incoming features (FFI error code
preservation, STE Vec/searchableJson query support) to the stack package
with rebranded naming.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace `ReturnType<typeof protect>` with `EncryptionClient` type in 8 stack test files
- Fix `ProtectClient` JSDoc reference in decrypt.ts → `EncryptionClient`
- Rename `[protect]` error prefix to `[encryption]` in 10 stack runtime files
- Update Nest example README: `ProtectClient` → `EncryptionClient`
- Update Drizzle docs prose: "protect operators" → "encryption operators"
- Update schema tests: `csTable`/`csColumn`/`csValue` → `encryptedTable`/`encryptedColumn`/`encryptedValue`

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixes from collated rename verification report:

- E1-A1: Fix TypeORM example type error (EncryptionClientConfig → EncryptionClient)
- E9-A2: Update CLI branding from "CipherStash Protect" to "CipherStash Stash"
- E10-A2: Add @cipherstash/stack to SECURITY.md supported packages
- C3: Rename internal AtLeastOneCsTable → AtLeastOneEncryptedTable
- E3-A1: Update JSDoc eqlClient variable references → encryptionClient
- E12-A2: Fix Drizzle JSDoc "ProtectTable" → "EncryptedTable"
- E2-A1: Replace [protect]: error prefix with [encryption]: in 232 test assertions
- E15-A2: Update schema test describe block ProtectTable → encryptedTable
- E6-A2: Add deprecation notice to protect package README
- E11-A2: Add @cipherstash/stack to changeset

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Rename class Stash → SecretsClient, interface StashConfig → SecretsConfig
- Add deprecated aliases: Stash, StashConfig
- Update CLI (stash.ts) to use new names and import from secrets/
- Fix tsup.config.ts entry path: src/stash/ → src/secrets/
- Remove stale src/stash/ directory (was duplicate of src/secrets/)
- Update all JSDoc examples to use Secrets() factory pattern

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Bulk rename of protectClient variable to encryptionClient across the
entire repo, plus related branding fixes.

Changes by area:
- utils/logger: [protect] → [encryption] log prefix
- dynamodb: protectClient → encryptionClient, ProtectDynamoDB* types →
  EncryptedDynamoDB* (with deprecated aliases), protectDynamoDB() →
  encryptedDynamoDB(), PROTECT_DYNAMODB_ERROR → DYNAMODB_ENCRYPTION_ERROR
- drizzle: protectClient/protectTable/protectColumn internal vars renamed,
  test protectOps → encryptionOps
- stack tests: protectClient → encryptionClient across all 16 test files
- stack source: EQL client → Encryption client, Stash Encryption → Encryption
- all 7 examples: protectClient → encryptionClient, [protect]: → [encryption]:,
  initializeProtectClient → initializeEncryptionClient, ProtectEntityHelper →
  EncryptionEntityHelper
- all docs/READMEs: protectClient → encryptionClient (~180 replacements)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…s (round 2)

Renamed internal variables, error classes, and public API functions:
- dynamodb: protectTable→table params, ProtectDynamoDBError→EncryptedDynamoDBError
- drizzle: ProtectOperatorError→EncryptionOperatorError, createProtectOperators→createEncryptionOperators
- nest example: full ProtectModule→EncryptionModule rebrand across all files
- docs/examples: remaining protect* variable and function references

All deprecated aliases preserved for backward compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…js middleware, docs (round 3)

File/directory renames:
- Stack test files: *-protect.test.ts → *-encryption.test.ts (5 files)
- Example directories: protect/ → encryption/ (nest, drizzle, nextjs-clerk, next-drizzle-mysql, dynamo, basic, typeorm)
- Example files: protect.ts → encryption.ts, protect-entity.ts → encryption-entity.ts
- Nest example: protect.module.ts → encryption.module.ts, etc. (6 files)
- Doc files: drizzle-protect.md → drizzle-encryption.md, init-protect.md → init-encryption.md

Source code:
- FfiProtectError → FfiEncryptionError (with deprecated alias)
- protectClerkMiddleware → encryptionClerkMiddleware (with deprecated alias)
- protectMiddleware → encryptionMiddleware (with deprecated alias)
- PROTECT_LOG_LEVEL → CS_LOG_LEVEL (with backward compat fallback)
- extractProtectSchema → extractEncryptionSchema in drizzle example
- docs.test.ts context key protect → encryption
- protectedUser → encryptedUser in typeorm example

Documentation:
- All ./protect paths → ./encryption in READMEs, getting-started, schema, model-operations
- Cross-references updated for renamed doc files
- PROTECT_LOG_LEVEL → CS_LOG_LEVEL in env var docs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nd 4)

Comments:
- "protected table schema" → "encrypted table schema" in 6 dynamo example files + dynamodb README
- "protectjs" → "CipherStash" in nextjs-clerk schema comment
- eql_payload_created_by_protect → eql_payload_created_by_encryption in docs

Environment variables:
- PROTECT_LOG_LEVEL → CS_LOG_LEVEL in .env files and nest module
- AGENTS.md env var reference updated

Database/infrastructure:
- protect_example → encryption_example in next-drizzle-mysql (docker-compose, drizzle config, .env.example)
- protectNestedJson → encryptedNestedJson in dynamodb test

Documentation:
- protect-example → encryption-example in getting-started.md
- jsprotect.git → protectjs.git in hono-supabase README
- Updated product URLs in next-drizzle-mysql README
- MIGRATION.md: updated "after" examples with new function names
- Nest README: fixed src/protect/ → src/encryption/ path

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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