npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@getcommunity/gc-validators

v0.0.169

Published

Schema Validator for GetCommunity web-stack types

Readme


name: "Get Community Validators" description: "A validation library for Get Community defining and validating data structures used throughout the application." category: "Web Development" repository: "https://github.com/getcommunity/gc-validators" author: "Joey Grable" authorUrl: "https://github.com/joeygrable94" tags: [ "Get Community", "homebuilder digital marketing", "website development", "validation library", "TypeScript", "NodeJS", "ValiBot" ] lastUpdated: "2025-10"

🪨 GC Validators

@getcommunity/gc-validators

Project Overview

The Get Community Validators package provides a set of validation rules and utilities for ensuring data integrity and consistency across the Get Community application. It defines and validates data structures used throughout the application, ensuring that all data conforms to expected formats and business rules.

Tech Stack

Main technologies and tools used:

  • TypeScript
  • NodeJS
  • ValiBot
  • Pnpm
  • NPM

Project Structure

gc-validators/
├── scripts/
├── src/
│   ├── constants/
│   ├── schemas/
│   ├── types/
│   │   ├── components/
│   │   │   ├── blocks/
│   │   │   ├── brand/
│   │   │   ├── forms/
│   │   │   ├── shared/
│   │   │   ├── slideshow/
│   │   │   ├── utm/
│   │   │   └── index.ts
│   │   ├── core/
│   │   ├── documents/
│   │   ├── singles/
│   │   └── index.ts
│   ├── utilities/
│   ├── validators/
│   └── index.ts
├── .vscode/
├── .env
├── .gitignore
├── .npmignore
├── .npmrc
├── .pre-commit-config.yaml
├── .prettierignore
├── .prettierrc.mjs
├── tsconfig.json
├── tsup.config.ts
├── pnpm-lock.yaml
└── package.json

Development Guidelines

Code Style

  • Use consistent code formatting tools
    • Use Prettier for code formatting
    • Use ESLint for linting
    • Use pre-commit hooks for code quality checks
  • Follow language-specific best practices
  • Keep code clean and readable

Naming Conventions

  • File naming: (snake-case)
    • all lowercase with hyphens
    • append file type as suffix
    • e.g., entity-schema.tsx, pagination-constants.ts
  • Variable naming: (PascalCase, or UPPER_SNAKE_CASE)
    • types should be in PascalCase (e.g., ClientDocument, BlogPostDocument)
    • global constants should be in UPPER_SNAKE_CASE (e.g., LIMIT_SHORT_STRING_MAX_LENGTH)
  • Function naming: (camelCase)
    • use camelCase for function names (e.g., datePlusDays, hasPermission)
  • Class and Schema naming: (PascalCase)
    • use PascalCase for classes and schemas (e.g., PermissionCheck, RolesWithPermissions)
    • prefix entity action schemas with "S" and the CRUD operation (e.g., SUpdateClientDocument, SCreateContentPillarDocument)

Git Workflow

Branching Strategy

  • production branch is used for production releases
  • main branch is used for staged production
  • dev branch is used for development
  • test branch is used for testing
  • upgrade branch is used for upgrading dependencies
  • feat-* branches are used for new features
  • bugfix-* branches are used for bug fixes

Commit message format

Pull Request process

  • All pull requests should be reviewed by at least one other team member and approved by by a code manager before merging.
  • Ensure that all tests pass before merging.
  • Use descriptive titles and provide context in the PR description.

Environment Setup

Each submodule contains an .env.example file that outlines the necessary environment variables. Copy this file to .env and fill in the appropriate values. Many of the env variable are managed in a secure vault and can be retrieved from the project manager.

Development Requirements

  • Node.js version: >=22.x (LTS)
  • Package manager: pnpm
  • Other dependencies: Git

Installation Steps

# 1. Clone the library
git clone [repository-url]

# 2. Install dependencies
pnpm install

# 3. Build the library
pnpm build

Core Feature Implementation (TO DO)

Feature Module 1

Describe the implementation approach and key code examples for main features.

// Example code
function exampleFunction() {
  // Implementation logic
}

Testing Strategy

Unit Testing

  • Testing framework:
  • Test coverage requirements:
  • Test file organization:

Integration Testing

  • Test scenarios:
  • Testing tools:

End-to-End Testing

  • Test workflow:
  • Automation tools:

Deployment Guide

Build Process

# Build command
pnpm build

Deployment Steps

  1. Prepare production environment
  2. Configure environment variables
  3. Execute deployment scripts
  4. Verify deployment results

Environment Variables

# Example environment variables

Performance Optimization

Frontend Optimization

  • Code splitting
  • Lazy loading
  • Caching strategies

Backend Optimization

  • Database query optimization
  • Caching mechanisms
  • Load balancing

Security Considerations

Data Security

  • Input validation
  • SQL injection protection
  • XSS protection

Authentication & Authorization

  • User authentication flow
  • Permission control
  • Token management

Monitoring and Logging

Application Monitoring

  • Performance metrics
  • Error tracking
  • User behavior analytics

Log Management

  • Log levels
  • Log format
  • Log storage

Reference Resources

  • [Official Documentation Link]
  • [Related Tutorials]
  • [Community Resources]
  • [Best Practices Guide]

Examples

Permission Constants Usage

const userDoc: UserDocument = {
  id: 1,
  documentId: "1234asdfhjkl",
  createdAt: "2024-01-01T00:00:00.000Z",
  updatedAt: "2024-01-01T00:00:00.000Z",
  publishedAt: "2024-01-01T00:00:00.000Z",
  username: "tester",
  email: "[email protected]",
  provider: "local",
  confirmed: true,
  blocked: true,
  clerk_user_id: ""
}
const user: AuthorizedUserDocument = {
  ...userDoc,
  role: {
    id: 1,
    documentId: "1234asdfhjkl",
    createdAt: "2024-01-01T00:00:00.000Z",
    updatedAt: "2024-01-01T00:00:00.000Z",
    publishedAt: "2024-01-01T00:00:00.000Z",
    type: "employee",
    name: "Employee",
    description: "Employee role with access to client data",
    permissions: []
  },
  account: {
    id: 1,
    documentId: "1234asdfhjkl",
    createdAt: "2024-01-01T00:00:00.000Z",
    updatedAt: "2024-01-01T00:00:00.000Z",
    publishedAt: "2024-01-01T00:00:00.000Z",
    preferred_name: "Test Account",
    first_name: "Test",
    last_name: "User"
  }
}
const client: ClientDocument = {
  id: 1,
  documentId: "1234asdfhjkl",
  createdAt: "2024-01-01T00:00:00.000Z",
  updatedAt: "2024-01-01T00:00:00.000Z",
  publishedAt: "2024-01-01T00:00:00.000Z",
  title: "Test Client",
  teamwork_name: "Test Client",
  teamwork_id: "123456",
  is_featured: true,
  utm_sheet_id: "asdkjhflawhfl",
  allow_create_utm_link: true,
  is_organic_social: true,
  is_paid_media: true,
  is_active: true,
  classification: ["organic", "paid"]
}
const clientUserStatus: ClientUserDocumentStatus = {
  verified: true,
  clientUser: {
    id: 1,
    documentId: "1234asdfhjkl",
    createdAt: "2024-01-01T00:00:00.000Z",
    updatedAt: "2024-01-01T00:00:00.000Z",
    publishedAt: "2024-01-01T00:00:00.000Z",
    client: client,
    user: userDoc,
    scopes: ["client:access", "client:manager", "client-project:udate"]
  },
  scopes: ["client:access", "client:manager", "client-project:udate"]
}
const clientProject: ClientProjectDocument = {
  id: 1,
  documentId: "1234asdfhjkl",
  createdAt: "2024-01-01T00:00:00.000Z",
  updatedAt: "2024-01-01T00:00:00.000Z",
  publishedAt: "2024-01-01T00:00:00.000Z",
  title: "Test Client Project",
  slug: "test-client-project",
  project_status: ["for-sale"]
  project_phase: "p1"
  featured_image: null
}

// Check if user has permission to create a client project
hasPermission(user, clientUserStatus, "client-project", "create")
// > false

// Check if user has permission to update a client project
hasPermission(user, clientUserStatus, "client-project", "update", clientProject)
// > true

// Check if user has permission to access a client
hasPermission(user, clientUserStatus, "client", "access", client)
// > true