🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@justeattakeaway/generator-pie-component

Package Overview
Dependencies
Maintainers
11
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@justeattakeaway/generator-pie-component

A generator for PIE Web Components

latest
Source
npmnpm
Version
0.31.1
Version published
Maintainers
11
Created
Source

Currently released NPM version

generator-pie-component

generator-pie-component is a generator for Pie Web Components.

Usage

Installation

Build the generator package locally (it is recommended you force the build)

$ yarn build --filter=generator-pie-component --force

Generating a new component

To run the generator, use this command from the root directory within the monorepo:

$ npx yo @justeattakeaway/pie-component

An interactive prompt should now be displayed asking for a component name.

Once you have completed all the prompts, your scaffolded component will be generated! 🎉

Setting up Visual Regression Testing:

  • Create a Percy project for the component on the Percy website.
  • From the "Project settings" page, copy the project token value.
  • You need to add the new token value as a repository secret in GitHub. It must be named PERCY_TOKEN_PIE_COMPONENT_NAME. Visual tests will not work/run if this is not set up correctly.

Exporting Sub-Components

The generator does not currently support automatic generation of sub-components. To add a sub-component, follow these steps:

  • Create a folder inside the component's src directory with the sub-component’s name (e.g., pie-breadcrumb-item).
  • Add the following files to the new folder:
    • index.ts – contains the component logic.
    • defs.ts – provides the component types.
    • defs-react.ts – provides the React wrapper type.
  • Modify the component's vite.config.ts to match the following:
export default viteConfig({
    build: {
        lib: {
            entry: {
                'pie-sub-component/index': 'src/pie-sub-component/index.ts',
                'pie-sub-component/react': 'src/pie-sub-component/react.ts',
            },
        },
    },
    dtsConfig: {
        entryRoot: 'src',
        rollupTypes: false,
    },
});
  • Run npx add-components from the monorepo root to update the webc package exports.

Local development

Install the dependencies. Note that this, and the following commands below, should be run from the root of the monorepo:

yarn

To build the generator-pie-component package, run the following command:

yarn build --filter=generator-pie-component

You can also build the component in watch mode if desired with the following command:

yarn watch --filter=generator-pie-component

Contributing

In order to contribute to the generator-pie-component, it's advised to link your local build of the generator to Yeoman.

To do this, run yarn link from the root of the generator-pie-component folder in the mono-repo.

Once you have done this, running npx yo @justeattakeaway/pie-component will run your local copy of the generator (rather than the version installed globally via NPM/Yarn).

Keywords

PIE

FAQs

Package last updated on 30 Sep 2025

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