@vtex/vtex-scripts

Default VTEX store components

Showing:

Popularity

Downloads/wk

0

GitHub Stars

38

Maintenance

Last Commit

22d ago

Contributors

146

Package

Dependencies

26

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

Readme

VTEX Scripts

This package contains the scripts and build configuration for the VTEX modules.

Usage

  1. Inside the NPM Store Components repo

Just run the bellow in the terminal

$ lerna add @vtex/vtex-scripts --scope=your-component
$ lerna bootstrap

And add the following lines to your package.json

{
  "scripts": {
    "build": "vtex-scripts build",
    "test": "vtex-scripts test"
  }
}
  1. In a vtex init'ed module

Add the @vtex/vtex-scripts to your devDependencies

$ yarn add @vtex/vtex-scripts --dev

Also, if you want testing you need to install some required packages

$ yarn add enzyme enzyme-adapter-react-16 jsdom --dev

And add the following to a setupTests.js in the root of your source directory

import Enzyme from 'enzyme'
import Adapter from 'enzyme-adapter-react-16'
import { JSDOM } from 'jsdom'

const jsdom = new JSDOM('<!doctype html><html><body></body></html>')

global.window = jsdom.window
global.document = window.document

Enzyme.configure({ adapter: new Adapter() })

Then, just add the scripts to your package.json

{
  "scripts": {
    "test": "vtex-scripts test"
  }
}

Configurations

You can also customize some default configurations that comes with vtex-scripts

The following properties can be supplied in a vtexScriptsOverride property inside your package.json

NameTypeDescription
srcPathStringThe relative path of your sources directory (e.g. ./src)
distPathStringThe relative path of your compiled files directory (e.g. ./dist)
setupTestsFilenameStringThe filename of the tests setup file (e.g. setupTests.js)

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100