2.3.0 • Published 3 years ago

@volusion/element-block-scripts v2.3.0

Weekly downloads
13
License
Unlicensed
Repository
-
Last release
3 years ago

block-scripts

Consolidate the pieces around block development for the Element ecosystem

Installing block-scripts

Install via npm and save as a devDependency:

npm install --save-dev @volusion/block-scripts

Using block-scripts

After installing the block-scripts package, it becomes an executable. Use it on its own or as an npm script in your block's package.json (recommended):

block-scripts start

Start the block server, using rollup

block-scripts build

Builds the block, also using rollup

block-scripts lint

Lints the block, using eslint

block-scripts test

Tests the block, using jest

Developing

Clone the repo, change to the directory, and run npm install.

To use the executable, run npm link after running npm run build. Then, the executable block-scripts will be available to run in another terminal, as long as the same version of Node.js is loaded as the version present when you ran npm link.

The .node-version file

To ensure we're all using the same version of Node.js while developing, please use either n or nvm to install the project's Node.js version, and then install AVN, along with the relevant helper:

npm install -g avn

# If you're managing Node versions with NVM:
npm install -g avn-nvm

# If you're managing Node versions with n:
npm install -g avn-n

Then, set up AVN with

avn setup

and after following the on-screen instructions, you should be good to go upon changing to this directory, you'll be automatically switched to use the correct version of Node.js, specified in the .node-version file.