0.1.5 • Published 5 years ago

storeden-deploy v0.1.5

Weekly downloads
11
License
MIT
Repository
github
Last release
5 years ago

Storeden Deploy

deploy template made easy

build status npm version dependencies devDependencies vulnerabilities coverage javascript style guide conventional commits

Utility to deploy store theme on a Storeden instance.

Installation

npm install storeden-deploy

Usage

import deploy from 'storeden-deploy'

deploy({
  apiKey: '<api-key>',
  apiExchange: '<api-exchange>',
  sourcePath: { source: '<source-path>', exclude: '<glob-pattern>' }
})

Parameters

ParameterTypeMandatoryDefaultDescription
apiKeyStringyesAPI Key associated with your Storeden Store
apiExchangeStringyesAPI Exchange associated with your Storeden Store
sourcePathString, ObjectyesLocal source path where the script will look for template to deploy

Returns

A Promise fulfilled with true if deploy process succeded, otherwise an error object.

Example - Deploy template

import deploy from 'storeden-deploy'

let deployed

try {
  deployed = await deploy({
    apiKey: '927f134fe4c92986a528376f34a16c3FAKEd9b4d198359435da5f4f1f1a2d78042566d',
    apiExchange: '23c79cc5fb832839465df5d96fef55cae10584b58ab937FAKEecbdd9bbe33ad3',
    sourcePath: './myProject/dist'
  })
} catch (e) {
  deployed = false
}

console.log(deployed) // true for sure!

Example - Deploy template excluding some directory or file

import deploy from 'storeden-deploy'

let deployed

try {
  deployed = await deploy({
    apiKey: '927f134fe4c92986a528376f34a16c3FAKEd9b4d198359435da5f4f1f1a2d78042566d',
    apiExchange: '23c79cc5fb832839465df5d96fef55cae10584b58ab937FAKEecbdd9bbe33ad3',
    sourcePath: {
      source: './myProject/dist',
      exclude: '**/{widgets,generated/**'
    } // `exclude` property value must be a glob pattern'
  })
} catch (e) {
  deployed = false
}

console.log(deployed) // true for sure!

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT. Copyright (C) 2019 H-FARM (Enabling Solutions) - Francesco Pasqua.