πŸš€ Big News:Socket Has Acquired Secure Annex.Learn More β†’
Socket
Book a DemoSign in
Socket

@cooperco/cooper-component-library

Package Overview
Dependencies
Maintainers
3
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cooperco/cooper-component-library

A Vue 3 component library built with TypeScript, Vite, and Tailwind CSS. Published as `@cooperco/cooper-component-library` and designed for integration with Contentful CMS via GraphQL.

latest
npmnpm
Version
0.1.91
Version published
Maintainers
3
Created
Source

Cooper Component Library

A Vue 3 component library built with TypeScript, Vite, and Tailwind CSS. Published as @cooperco/cooper-component-library and designed for integration with Contentful CMS via GraphQL.

Tech Stack

  • Vue 3.5+ - Composition API with <script setup>
  • TypeScript 5.3+ - Strict mode enabled
  • Tailwind CSS 3.4+ - Utility-first styling
  • Vite 5.2+ - Library build mode
  • Storybook 8.2+ - Component documentation
  • GraphQL - Contentful CMS integration
  • pnpm - Package manager
  • VS Code + Vue - Official (previously Volar) and disable Vetur

Development

# Install dependencies
pnpm install

# Start Storybook dev server
pnpm run dev

# Run linter
pnpm run lint

# Fix linting issues
pnpm run lint:fix

# Type check
pnpm run check-types

Testing Locally

To test the component library in a consuming project before publishing:

# 1. Build and pack the library
pnpm run local-test

This creates a .tgz file in the root directory (e.g., cooperco-cooper-component-library-0.1.61.tgz)

# 2. In the consuming project, install the local package
pnpm add /path/to/cooperco-cooper-component-library-0.1.61.tgz

This allows you to test changes locally before publishing to npm.

Building and Publishing

The build and publish process needs to happen manually when changes are merged to main:

Workflow

  • Merge to main - Merge your feature branch to main
  • Patch version - Update version number using npm version patch (or minor/major)
  • Publish - Run npm publish to publish to npm registry
  • Push - Push changes and tags to GitHub

Build Process

When you run pnpm run build, the following happens in order:

  • build:types - Compiles Vue component TypeScript definitions
  • build:cms - Compiles GraphQL queries for Contentful
  • vite build - Builds the component library bundle

All build artifacts are output to the dist/ directory.

Package Exports

The package exports multiple entry points:

  • Components: @cooperco/cooper-component-library - Main component library
  • Styles: @cooperco/cooper-component-library/css/main.css - Main styles
  • Theme: @cooperco/cooper-component-library/css/theme.css - Theme variables
  • Queries: @cooperco/cooper-component-library/cms/contentful/graphql - GraphQL queries

Project Structure

β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/          # Vue components
β”‚   β”‚   β”œβ”€β”€ ComponentName/
β”‚   β”‚   β”‚   β”œβ”€β”€ ComponentName.vue
β”‚   β”‚   β”‚   └── ComponentName.ts
β”‚   β”‚   β”œβ”€β”€ components.ts    # Component exports
β”‚   β”‚   └── types.ts         # Type exports
β”‚   β”œβ”€β”€ config/              # Configuration (color palettes, passthroughs)
β”‚   └── utils/               # Utility functions
β”œβ”€β”€ cms/
β”‚   └── contentful/
β”‚       └── queries/         # GraphQL queries (see cms/contentful/queries/README.md)
β”œβ”€β”€ .storybook/              # Storybook configuration
β”‚   └── components/          # Component stories
└── dist/                    # Build output (generated)

Documentation

TODO Issues

  • There are many places where class is not recognized by TypeScript. Examples are "start"/"end" in ContainerModule. This is because we are not defining class on the component types. Defining them explicitly overrides the default Attribute Inheritance behavior of Vue. Need to find a way to get around this

FAQs

Package last updated on 06 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts