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.270

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.

Examples

Check if a user can be assigned a specific resource permission

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"
  }
}

// Check if user can be assigned permission to create client projects
canAssignPermission(user, "client-project", "create")
// true

Check if a user has permission to access a client assigned entity

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