4.5.1 • Published 7 months ago

@tipser/tipser-elements v4.5.1

Weekly downloads
8,996
License
ISC
Repository
github
Last release
7 months ago

Tipser Elements

Tipser Elements is a React components library from Tipser enabling you to add shopable content to your site with minimal effort. You can add simple components like products with buy buttons, collections of products.

Learn more about Tipser Script or Tipser Elements React library on our official documentation site.

Demos

Important Scripts

PackageCommandDescition
Root
npm startStarts demo and build server for ./library
npm ci-allInstall dependencies for all packages without updating lock file
npm formatRuns prettier check for each package
npm format-fixRuns prettier with fix for each package
npm i18nDownloads translations from webtranslateit
npm release:<major/minor/patch>Runs release script
npm licencesChecks licences
Library
npm startStarts build server
npm testRuns tests
npm check-typesChecks for typescript issues
npm format-fixRuns prettier with fix
npm lintRuns eslint checks
Widget
npm startStarts build server
npm testRuns tests
npm check-typesChecks for typescript issues
npm format-fixRuns prettier with fix
npm lintRuns eslint checks
Analytics
npm startStarts build server
npm testRuns tests
npm check-typesChecks for typescript issues
npm format-fixRuns prettier with fix
npm lintRuns eslint checks
Cypress
npm startStarts cypress server
npm testRuns e2e tests
npm format-fixRuns prettier with fix
npm prettierRuns prettier checks
Demo
npm startStarts cypress server
npm format-fixRuns prettier with fix
npm prettierRuns prettier checks
Analytics Demo
npm startStarts build server and two http servers
npm build-analyticsBuilds analytics script code

Quick Start with NPM version

  • Install with npm: npm install @tipser/tipser-elements@latest

Quick start with scripted injectable version

There is a bundled, out-of-the-box solution to be placed on your website called Tipser Script. For more information and instructions how to use it, please refer to Tipser Elements docs.

If you feel comfortable with React and need to address more advanced use cases, read further!

Quick React example

Create a React app using e.g. Create React App (follow the instructions on their page).

npx create-react-app my-tipser-elements-app
cd my-tipser-elements-app

Add Tipser Elements to the project with npm:

npm install @tipser/tipser-elements

Put your Elements code (e.g. copy the example below) in src/index.js file.

Start the application

npm start

Developing Tipser Elements

Running locally

Make sure you are using latest Node 16 version (nvm install v16 && nvm use default 16)

  1. Clone the project from git
  2. Run npm ci && npm run ci-all
  3. Run npm start then you can see the demo page under: http://localhost:3001/

Running tests

  • npm test executes all tests in the project

Contributing

npm run format-fix fixes the formatting according to our Prettier rules.

npm run check-types checks TypeScript types.

Test Scaffolding

There is configured basic scaffolding of test file for React component.

Install scaffolding tool globally:

npm -g @chmurson/scaffolding

Navigate to folder where test need to be created

cd /library/component/steam-rocket

Run command to create the test file.

scaffolding test.json

Tool will ask you for a name of a component. Let say it's SteamRocket, then file steam-rocket.test.tsx will be created in current directory with basic test setup.

Publishing new versions

  1. Run git checkout master to switch to master branch (master-v3 for v3 version - EU)
  2. Run git pull to ensure having the newest version of the code.
  3. Execute npm run release -- $(cat ~/.git-private-token), (where .git-private-key contains GH personal token. How to create it?)
    • this script will update patch version, e.g. v1.4.3 -> v1.4.4
    • to update to minor or major version use npm run release:minor or npm run release:major
  4. Open a PR created by previous step (check console output for url)
  5. Do the review of CHANGELOG.md: - Mark all unreleased/unpublished changes to a correct version number together with release date. E.g. change ## [Unpublished] into e.g. ## [v1.4.3] - 2022-03-04 - check if nothing is missing or there something that shouldn't be there.
  6. If everything is okay merge the PR (target is set to master branch).
    • The merge method is locked to merge & squash.
    • Make sure the final commit message has a following format: "Release vX.Y.Z".
  7. After the merge, we need to publish: npm package, widget and analytics libs.
    • That happens automatically. GH Actions workflow checks for commit message "Release vX.Y.Z" on master branch to trigger publishing a new version.
    • Make sure the automatic release process is successful: check GH actions logs, npm site for a new version.

Testing the library in other projects without releasing it

Sometimes it's handy to see how the changes in tipser-elements work in client apps before a new version of tipser-elements is ready to be deployed to NPM.

The following commands make it possible: 1. In tipser-elements directory run: npm run build && npm link to build and create a symlink for the locally modified version 2. In the client app directory run: npm link @tipser/tipser-elements to switch to the locally modified version 3. After every subsequent change rebuild tipser-elements with npm build command or use npm start for continuous rebuilds

If the consumer project is using webpack, ensure that resolve.symlinks is set to false, to properly resolve react and react-dom dependency.

In case of linking tipser-elements with local project, using 'npm link' mechanism, a problem with solving React references may occur. Tipser-elements require React to be provided by the client app. In this case in the project, which uses tipser-elements, a flag should be set in webpack.config.js:

module.exports = { //... resolve: { symlinks: true, }, };

Here is the link to webpack documentation: https://webpack.js.org/configuration/resolve/#resolvesymlinks

Checking Elements version in use

If Elements is used as a npm module, its version number is available under global TIPSER_ELEMENTS_VERSION variable.

If Elements is loaded from CDN (widget), its version number is available in the comment that makes the first line of the script response (usually dev.js or latest.js).

4.2.4-dev-6867b44

9 months ago

4.3.0-dev-3efe9c5

9 months ago

4.2.4-dev-0f0fd4a

10 months ago

4.4.3-dev-88fd320

8 months ago

4.2.4-dev-9fdef18

10 months ago

4.5.0-dev-98ae0ca

8 months ago

4.2.4-dev-7a04f7b

10 months ago

4.4.3-dev-ba2e50d

8 months ago

4.4.1

9 months ago

4.4.0

9 months ago

4.4.3

9 months ago

4.4.2

9 months ago

4.4.0-dev-9db332c

9 months ago

4.2.4-dev-98cf0c3

10 months ago

4.2.4-dev-005772e

10 months ago

4.4.3-dev-06567c6

8 months ago

4.5.0

8 months ago

4.5.1

7 months ago

4.3.0-dev-6180e0c

9 months ago

4.4.0-dev-93f86de

9 months ago

4.3.0-dev-3933bdd

9 months ago

4.3.0

9 months ago

4.2.4-dev-608aacd

10 months ago

4.2.4-dev-afddfbf

10 months ago

4.2.4-dev-4536f0b

10 months ago

4.3.0-dev-70deab0

9 months ago

4.3.0-dev-310dddd

9 months ago

4.3.0-dev-d0eeaec

9 months ago

4.4.2-dev-b016621

9 months ago

4.4.3-dev-106f7d3

8 months ago

4.2.4-dev-d65a28e

9 months ago

4.5.0-dev-460d7d4

7 months ago

4.2.4-dev-91baacc

10 months ago

4.4.1-dev-209bcf9

9 months ago

4.4.3-dev-d6f0ddd

8 months ago

4.4.2-dev-1d61a8d

9 months ago

4.3.0-dev-e72fb45

9 months ago

4.2.4-dev-9ba497b

11 months ago

4.2.3

1 year ago

4.2.2

1 year ago

4.2.4

1 year ago

4.2.1

1 year ago

4.2.0

1 year ago

4.1.0

1 year ago

3.3.30

1 year ago

3.3.31

1 year ago

4.0.12

1 year ago

4.0.11

1 year ago

4.0.14

1 year ago

4.0.13

1 year ago

4.0.7

2 years ago

4.0.9

2 years ago

4.0.8

2 years ago

3.3.28

2 years ago

3.3.29

2 years ago

4.0.10

2 years ago

4.0.5

2 years ago

4.0.6

2 years ago

3.3.27

2 years ago

4.0.4

2 years ago

4.0.1

2 years ago

4.0.0

2 years ago

4.0.3

2 years ago

4.0.2

2 years ago

3.3.18

2 years ago

3.3.19

2 years ago

3.3.24

2 years ago

3.3.25

2 years ago

3.3.26

2 years ago

3.3.21

2 years ago

3.3.22

2 years ago

3.3.23

2 years ago

3.3.14

2 years ago

3.3.15

2 years ago

3.3.17

2 years ago

3.3.13

2 years ago

3.3.12

2 years ago

3.3.11

2 years ago

3.3.9

2 years ago

3.3.10

2 years ago

3.3.8

2 years ago

3.3.7

2 years ago

3.3.6

2 years ago

3.3.1

2 years ago

3.3.5

2 years ago

3.3.4

2 years ago

3.3.3

2 years ago

3.3.2

2 years ago

3.3.0

2 years ago

2.3.32

2 years ago

3.2.2

2 years ago

3.2.1

2 years ago

3.2.3

2 years ago

3.2.0

3 years ago

3.1.12

3 years ago

3.1.13

3 years ago

3.1.11

3 years ago

2.3.31

3 years ago

3.1.9

3 years ago

3.1.10

3 years ago

3.1.7

3 years ago

3.1.8

3 years ago

3.1.6

3 years ago

3.1.5

3 years ago

3.1.4

3 years ago

3.1.3

3 years ago

3.1.2

3 years ago

3.1.1

3 years ago

3.1.0

3 years ago

3.0.26

3 years ago

3.0.25

3 years ago

3.0.23

3 years ago

3.0.24

3 years ago

3.0.22

3 years ago

2.3.30

3 years ago

3.0.21

3 years ago

2.3.29

3 years ago

3.0.20

3 years ago

3.0.19

3 years ago

2.3.28

3 years ago

3.0.18

3 years ago

3.0.17

3 years ago

3.0.16

3 years ago

2.3.27

3 years ago

3.0.15

3 years ago

2.3.26

3 years ago

2.3.25

3 years ago

3.0.14

3 years ago

2.3.24

3 years ago

3.0.12

3 years ago

3.0.13

3 years ago

3.0.11

3 years ago

3.0.10

3 years ago

3.0.8

3 years ago

3.0.7

3 years ago

3.0.9

3 years ago

2.3.23

3 years ago

3.0.6

3 years ago

2.3.17

3 years ago

2.3.16

3 years ago

2.3.19

3 years ago

2.3.18

3 years ago

2.3.13

3 years ago

2.3.12

3 years ago

2.3.15

3 years ago

2.3.14

3 years ago

2.3.11

3 years ago

2.3.20

3 years ago

2.3.22

3 years ago

2.3.21

3 years ago

3.0.4

3 years ago

3.0.3

3 years ago

3.0.5

3 years ago

3.0.2

3 years ago

2.3.10

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.3.9

3 years ago

2.3.8

3 years ago

2.3.6

3 years ago

2.3.5

3 years ago

2.3.7

3 years ago

2.3.4

3 years ago

2.3.0

3 years ago

2.3.2

3 years ago

2.3.3

3 years ago

2.2.14

3 years ago

2.2.13

3 years ago

2.2.12

3 years ago

2.2.11

3 years ago

2.2.10

3 years ago

2.2.9

3 years ago

2.2.8

3 years ago

2.2.7

3 years ago

2.2.6

3 years ago

2.2.5

3 years ago

2.2.4

3 years ago

2.2.3

3 years ago

2.2.2

3 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.1.69

3 years ago

2.1.68

3 years ago

2.1.67

3 years ago

2.1.66

3 years ago

2.1.65

3 years ago

2.1.64

3 years ago

2.1.63

3 years ago

2.1.62

3 years ago

2.1.61

3 years ago

2.1.60

3 years ago

2.1.57

3 years ago

2.1.56

3 years ago

2.1.53

3 years ago

2.1.52

4 years ago

2.1.50

4 years ago

2.1.51

4 years ago

2.1.49

4 years ago

2.1.48

4 years ago

2.1.47

4 years ago

2.1.46

4 years ago

2.1.45

4 years ago

2.1.44

4 years ago

2.1.43

4 years ago

2.1.42

4 years ago

2.1.41

4 years ago

2.1.40

4 years ago

2.1.38

4 years ago

2.1.37

4 years ago

2.1.36

4 years ago

2.1.35

4 years ago

2.1.34

4 years ago

2.1.33

4 years ago

2.1.32

4 years ago

2.1.31

4 years ago

2.1.30

4 years ago

2.1.29

4 years ago

2.1.28

4 years ago

2.1.27

4 years ago

2.1.26

4 years ago

2.1.25

4 years ago

2.1.23

4 years ago

2.1.22

4 years ago

2.1.21

4 years ago

2.1.20

4 years ago

2.1.19

4 years ago

2.1.18

4 years ago

2.1.17

4 years ago

2.1.16

4 years ago

2.1.15

4 years ago

2.1.14

4 years ago

2.1.12

4 years ago

2.1.13

4 years ago

2.1.11

4 years ago

2.1.10

4 years ago

2.1.9

4 years ago

2.1.8

4 years ago

2.1.7

4 years ago

2.1.6

4 years ago

2.1.5

4 years ago

2.1.4

4 years ago

2.1.3

4 years ago

2.1.2

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.11

4 years ago

2.0.10

4 years ago

2.0.9

4 years ago

2.0.8

4 years ago

2.0.5

4 years ago

2.0.6

4 years ago

2.0.4

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.120

4 years ago

1.0.119

4 years ago

1.0.118

4 years ago

1.0.117

4 years ago

1.0.116

4 years ago

1.0.115

4 years ago

1.0.114

4 years ago

1.0.113

4 years ago

1.0.112

4 years ago

1.0.111

4 years ago

1.0.110

4 years ago

1.0.109

5 years ago

1.0.108

5 years ago

1.0.107

5 years ago

1.0.106

5 years ago

1.0.105

5 years ago

1.0.104

5 years ago

1.0.103

5 years ago

1.0.102

5 years ago

1.0.101

5 years ago

1.0.100

5 years ago

1.0.99

5 years ago

1.0.98

5 years ago

1.0.97

5 years ago

1.0.96

5 years ago

1.0.93-1

5 years ago

1.0.95

5 years ago

1.0.94

5 years ago

1.0.93

5 years ago

1.0.92

5 years ago

1.0.90

5 years ago

10.0.89-123

5 years ago

1.0.89-4

5 years ago

1.0.89

5 years ago

1.0.89-3

5 years ago

1.0.89-2

5 years ago

1.0.89-0

5 years ago

1.0.88

5 years ago

1.0.88-1

5 years ago

1.0.87

5 years ago

1.0.86

5 years ago

1.0.85

5 years ago

1.0.84

5 years ago

1.0.83

5 years ago

1.0.82

5 years ago

1.0.81

5 years ago

1.0.79

5 years ago

1.0.78

5 years ago

1.0.76

5 years ago

1.0.75

5 years ago

1.0.74

5 years ago

1.0.73

5 years ago

1.0.71

5 years ago

1.0.69

5 years ago

1.0.68

5 years ago

1.0.67

5 years ago

1.0.65

5 years ago

1.0.66

5 years ago

1.0.64

5 years ago

1.0.63

5 years ago

1.0.62

5 years ago

1.0.60

5 years ago

1.0.59

5 years ago

1.0.58

5 years ago

1.0.57

5 years ago

1.0.56

5 years ago

1.0.53

5 years ago

1.0.52

5 years ago

1.0.50

5 years ago

1.0.49

5 years ago

1.0.48

5 years ago

1.0.46

5 years ago

1.0.45

5 years ago

1.0.44

5 years ago

1.0.43

5 years ago

1.0.41

5 years ago

1.0.40

5 years ago

1.0.39

5 years ago

1.0.36

5 years ago

1.0.35

5 years ago

1.0.34

5 years ago

1.0.31

5 years ago

1.0.30

5 years ago

1.0.29

5 years ago

1.0.28

5 years ago

1.0.27

5 years ago

1.0.26

5 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.23

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

0.0.49

5 years ago

0.0.46

5 years ago

0.0.45

5 years ago

0.0.43

5 years ago

0.0.40

5 years ago

0.0.38

5 years ago

0.0.37

5 years ago

0.0.27

5 years ago

0.0.26

5 years ago

0.0.25

5 years ago

0.0.24

5 years ago

0.0.21

5 years ago

0.0.20

5 years ago

0.0.19

5 years ago

0.0.18

5 years ago

0.0.17

6 years ago