0.0.103 • Published 2 years ago

csc-breeann-webcomponents-stencil v0.0.103

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Built With Stencil

Columbia Sportswear Company Web Components with AEM + SFCC

CSC Web Components library - taking basic AEM configurations values that can be passed and previewed using StencilJS and then viewed as a published SFCC Content Asset that can be useable in SFCC Content Slots.

Prerequisites:

StencilJS - Installation of StencilJS in your local development environment

AEM - Access to local AEM instance

SFCC - Access to a local SFCC sandbox environment

Stencil

Stencil is a compiler for building fast web apps using Web Components.

Stencil combines the best concepts of the most popular frontend frameworks into a compile-time rather than run-time tool. Stencil takes TypeScript, JSX, a tiny virtual DOM layer, efficient one-way data binding, an asynchronous rendering pipeline (similar to React Fiber), and lazy-loading out of the box, and generates 100% standards-based Web Components that run in any browser supporting the Custom Elements v1 spec.

Stencil components are just Web Components, so they work in any major framework or with no framework at all.

Getting Started

To start building a new web component using Stencil, clone this repo to a new directory:

git clone git@bitbucket.org:columbiasportswear/webcomponents.git
cd webcomponents

and run:

npm install
npm start

To build the component for production, run:

npm run build

Need help?

  • View our Stencil Documentation in Confluence here
  • Check out Stencil First Component docs here.

Naming Components

Prefix your component tag names with csc (ex: <csc-text> <csc-hero>, etc.) Later on, if we need specific components for specific brands we can look into branching off and naming them according to brand name (ex: <pra-text> <pra-hero>, <sor-text> <sor-hero>, <mhw-text> <mhw-hero> etc.)

When creating new component tags, we recommend not using stencil in the component name (ex: <stencil-datepicker>). This is because the generated component has little to nothing to do with Stencil; it's just a web component!

Instead, use a prefix that fits your company or any name for a group of related components. For example, all of the Ionic generated web components use the prefix ion.

Unit Testing

To run the unit tests for the components, run:

npm test

This will test all .spec.ts and .e2e.ts files in the components directory.

When creating a new component, be sure to create these two files for Unit Testing (.spec.ts) and End to End Testing (.e2e.ts) your code.

Be sure to test the code prior to making a PR.

  • For more information on Unit Testing in Stencil here

Linting

To run ESLint, run:

npm run lint

This will validate all .ts,.tsx files in the code base.

If there are eny warnings/errors, it will report the files that need to be fixed. A successful linting should result in no warnings or errors.

Script tag

  • Put a script tag similar to this <script type='module' src='https://unpkg.com/webcomponents@0.0.1/dist/webcomponents.esm.js'></script> in the head of your index.html
  • Then you can use the element anywhere in your template, JSX, html etc

Node Modules

  • Run npm install csc-webcomponents --save
  • Put a script tag similar to this <script type='module' src='node_modules/webcomponents/dist/webcomponents.esm.js'></script> in the head of your index.html
  • Then you can use the element anywhere in your template, JSX, html etc

In a stencil-starter app

  • Run npm install csc-webcomponents --save
  • Add an import to the npm packages import my-component;
  • Then you can use the element anywhere in your template, JSX, html etc

Production Build

This repository is being built using our Production Jenkins cluster at here. The build checks out the master branch and then does a replace on the version number in package.json and the .npmrc_config file has the token field replaced with a valid deployment token. Then the following:

  • mv .npmrc_config .npmrc
  • npm ci
  • npm run build
  • npm run lint
  • npm test
  • npm publish

Slack notifications are sent to the #auto-deploy-webcomponents channel on Build Start, Build Success, and Build aborted

There is a custom Docker image built for this currently in the public Docker account Name: columbiaecomm/jnlp-agent-node:latest that we use but in the future we will migrate this to our Private ECR images

Note: it is named .npmrc_config to prevent credentials being introduced into the repository

0.0.103

2 years ago

0.0.102

2 years ago

0.0.101

2 years ago

0.0.84

2 years ago

0.0.85

2 years ago

0.0.86

2 years ago

0.0.87

2 years ago

0.0.88

2 years ago

0.0.89

2 years ago

0.0.80

2 years ago

0.0.81

2 years ago

0.0.82

2 years ago

0.0.83

2 years ago

0.0.73

2 years ago

0.0.74

2 years ago

0.0.75

2 years ago

0.0.76

2 years ago

0.0.77

2 years ago

0.0.78

2 years ago

0.0.79

2 years ago

0.0.70

2 years ago

0.0.71

2 years ago

0.0.72

2 years ago

0.0.62

2 years ago

0.0.63

2 years ago

0.0.64

2 years ago

0.0.65

2 years ago

0.0.66

2 years ago

0.0.67

2 years ago

0.0.68

2 years ago

0.0.69

2 years ago

0.0.60

3 years ago

0.0.61

2 years ago

0.0.59

3 years ago

0.0.51

3 years ago

0.0.53

3 years ago

0.0.54

3 years ago

0.0.55

3 years ago

0.0.56

3 years ago

0.0.57

3 years ago

0.0.58

3 years ago

0.0.100

2 years ago

0.0.50

3 years ago

0.0.48

3 years ago

0.0.40

3 years ago

0.0.41

3 years ago

0.0.42

3 years ago

0.0.43

3 years ago

0.0.44

3 years ago

0.0.45

3 years ago

0.0.46

3 years ago

0.0.47

3 years ago

0.0.37

3 years ago

0.0.38

3 years ago

0.0.39

3 years ago

0.0.30

3 years ago

0.0.31

3 years ago

0.0.32

3 years ago

0.0.33

3 years ago

0.0.34

3 years ago

0.0.35

3 years ago

0.0.36

3 years ago

0.0.26

3 years ago

0.0.27

3 years ago

0.0.28

3 years ago

0.0.29

3 years ago

0.0.20

3 years ago

0.0.21

3 years ago

0.0.22

3 years ago

0.0.23

3 years ago

0.0.24

3 years ago

0.0.25

3 years ago

0.0.95

2 years ago

0.0.96

2 years ago

0.0.97

2 years ago

0.0.98

2 years ago

0.0.99

2 years ago

0.0.90

2 years ago

0.0.91

2 years ago

0.0.92

2 years ago

0.0.93

2 years ago

0.0.19

3 years ago

0.0.18

3 years ago

0.0.17

3 years ago

0.0.16

3 years ago

0.0.15

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago