How vtex-apps/store-components works
Project type and purpose
• This is an open-source component library (VTEX Store Components) that supplies reusable React blocks to be consumed by VTEX Store Theme apps.
• It uses VTEX’s store and styles builders, exposes a manifest.json, GraphQL queries/mutations, i18n message bundles, docs, tests, and mocks.
File structure
• Top level:
• Configuration and tooling (.eslintrc, .prettierrc, .github workflows, husky hooks)
• docs/ – Markdown docs per UI block
• messages/ – JSON bundles for internationalization
• manifest.json – VTEX IO app definition (builders & dependencies)
• react/ – source code of the component library:
– components (each block under react/components/…)
– GraphQL schemas (react/graphql/*.gql)
– typings, utils, tests, mocks, package.json, tsconfig
• store/ – JSON schemas for VTEX store builder
• Patterns:
• Modular React components organized per block
• Usage of GraphQL for data fetching (queries & mutations)
• CSS Handles pattern for style overrides
• Mocks and tests emphasize isolation for CI
Key insights from README
• Uses the store builder (block architecture) and styles builder
• Consumers import “vtex.store-components” in their store theme’s manifest
• Each component is a “block” in the VTEX Store framework
• Extensibility via CSS API and custom style files
• CI via Travis/GitHub Actions, tests via Jest
Detail
• Every folder/module that contributes to the public API or build
• Both development-time (lint, test, build) and runtime flows
• Don’t shy away from breaking out sub-modules if they represent distinct responsibilities (e.g., GraphQL vs. Styling vs. i18n)