0.1.81 • Published 1 year ago

@wantable/header v0.1.81

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Wantable Header Component

NPM version

Technologies

Rollup

The components are processed and bundled by rollup. There is a script defined in the package.json file that runs the rollup -c command. This command uses the configuration set within the rollup.config.js file located in the root of the project repository.

TypeScript / React

The components are bundled with their respective type definition files index.d.ts. This allows the component user to use TypeScript if they so choose. Additionally, defining typed props within the components enforces the component prop requirements at development. The TypeScript definition settings are configured within tsconfig.json then bundled within the package using the settings configured in rollup.config.js.

TailwindCSS

The wantable-headless repository does not bundle any css within the packaged components. That said, TailwindCSS classes are present in the jsx of each component which allows their styles to be processed by the hh-wantable-theme Shopify Theme repository. All the TailwindCSS processing configuration is placed in the hh-wantable-theme repository's tailwind.config.js file.

Directories

  • ./src - the main src directory for this component library
  • ./src/components - the component folder will house all the component folders
  • ./src/components/[ComponentName] - the respective component folders where each component will be housed, please use CapitalizedCamel case for the naming convention for these folders

Getting Started

  1. Start by installing all the dependencies within this repository
yarn
# or
npm i
  1. Once installed, you can start building out the components within their respective folders ./src/components/[ComponentName]

Building Components

1. Create a component directory

Create a directory within ./src/components using CapitalizedCamel case in the naming convention. For example: ./src/components/ExampleComponent

cd ./src & mkdir ExampleComponent

2. Create an index.tsx file

Create an index.tsx file inside the folder you've created. Within the file, export default and target the component folder.

export { default } from './ExampleComponent'

3. Create a corresponding component .tsx file

In the same folder, create a .tsx file of the same name as the directory. For example: ./src/components/ExampleComponent/ExampleComponent.tsx

Inside the new TypeScript file, create the functionality and logic for your component.

import React from "react";

// Declare types for your props
interface ExampleComponentProps {
    class: string;
    label: string;
}

const ExampleComponent = (props: ExampleComponentProps) => {
    // Ensure to use all props you've declared
    return <button className={props.class}>{props.label}</button>;
}

// Export the component appropriately using the same naming convention
export default ExampleComponent;

Connect your NPM account

For documentation on how to connect your npm account with the repository, please read: Half Helix - Wantable / Technical Documentation / wantable-headless / Connect your NPM Account

Once you are connected you can build your package and publish it. Run the following commands in the package's root directory

npm run rollup
npm login 
npm publish --access=public

Governance

Please do not update or modify the following files:

  • rollup.config.js - configuration file for rollup, used to bundle the component appropriately
  • tsconfig.json - configuration file for TypeScript, this contains logic for parsing types and bundling type declarations with the compiled component code
0.1.52

1 year ago

0.1.53

1 year ago

0.1.54

1 year ago

0.1.55

1 year ago

0.1.56

1 year ago

0.1.57

1 year ago

0.1.58

1 year ago

0.1.59

1 year ago

0.1.50

1 year ago

0.1.51

1 year ago

0.1.49

1 year ago

0.1.41

1 year ago

0.0.73

1 year ago

0.1.42

1 year ago

0.0.74

1 year ago

0.1.43

1 year ago

0.0.75

1 year ago

0.1.44

1 year ago

0.0.76

1 year ago

0.1.45

1 year ago

0.1.46

1 year ago

0.1.47

1 year ago

0.1.48

1 year ago

0.0.70

1 year ago

0.0.71

1 year ago

0.1.40

1 year ago

0.0.72

1 year ago

0.1.38

1 year ago

0.1.39

1 year ago

0.1.30

1 year ago

0.0.62

2 years ago

0.1.31

1 year ago

0.0.63

2 years ago

0.1.32

1 year ago

0.0.64

2 years ago

0.1.33

1 year ago

0.0.65

2 years ago

0.1.34

1 year ago

0.0.66

2 years ago

0.1.35

1 year ago

0.0.67

1 year ago

0.1.36

1 year ago

0.0.68

1 year ago

0.1.37

1 year ago

0.0.69

1 year ago

0.0.61

2 years ago

0.1.27

1 year ago

0.1.28

1 year ago

0.1.29

1 year ago

0.1.20

1 year ago

0.1.21

1 year ago

0.1.22

1 year ago

0.1.23

1 year ago

0.1.24

1 year ago

0.1.25

1 year ago

0.1.26

1 year ago

0.1.16

1 year ago

0.1.17

1 year ago

0.1.18

1 year ago

0.1.19

1 year ago

0.1.10

1 year ago

0.1.11

1 year ago

0.1.12

1 year ago

0.1.13

1 year ago

0.1.14

1 year ago

0.1.15

1 year ago

0.1.80

1 year ago

0.1.81

1 year ago

0.1.0

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.9

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.74

1 year ago

0.1.75

1 year ago

0.1.76

1 year ago

0.1.77

1 year ago

0.1.78

1 year ago

0.1.79

1 year ago

0.1.70

1 year ago

0.1.71

1 year ago

0.1.72

1 year ago

0.1.73

1 year ago

0.1.63

1 year ago

0.1.64

1 year ago

0.1.65

1 year ago

0.1.66

1 year ago

0.1.67

1 year ago

0.1.68

1 year ago

0.1.69

1 year ago

0.1.60

1 year ago

0.1.61

1 year ago

0.1.62

1 year ago

0.0.60

2 years ago

0.0.40

2 years ago

0.0.41

2 years ago

0.0.42

2 years ago

0.0.43

2 years ago

0.0.45

2 years ago

0.0.46

2 years ago

0.0.47

2 years ago

0.0.37

2 years ago

0.0.38

2 years ago

0.0.39

2 years ago

0.0.30

2 years ago

0.0.31

2 years ago

0.0.32

2 years ago

0.0.33

2 years ago

0.0.35

2 years ago

0.0.36

2 years ago

0.0.26

2 years ago

0.0.27

2 years ago

0.0.28

2 years ago

0.0.29

2 years ago

0.0.59

2 years ago

0.0.51

2 years ago

0.0.52

2 years ago

0.0.53

2 years ago

0.0.54

2 years ago

0.0.55

2 years ago

0.0.56

2 years ago

0.0.57

2 years ago

0.0.58

2 years ago

0.0.50

2 years ago

0.0.48

2 years ago

0.0.49

2 years ago

0.0.20

2 years ago

0.0.21

2 years ago

0.0.22

2 years ago

0.0.23

2 years ago

0.0.24

2 years ago

0.0.25

2 years ago

0.0.15

2 years ago

0.0.16

2 years ago

0.0.17

2 years ago

0.0.18

2 years ago

0.0.19

2 years ago

0.0.10

2 years ago

0.0.11

2 years ago

0.0.13

2 years ago

0.0.14

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago