Skip to content
This repository has been archived by the owner on Dec 30, 2023. It is now read-only.

cesconix/storeden-deploy

Repository files navigation

⚠️ Archived Repository: This project is no longer maintained and is kept here for archival purposes only. Please note that the code may be outdated and no longer functional.

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

Parameter Type Mandatory Default Description
apiKey String yes API Key associated with your Storeden Store
apiExchange String yes API Exchange associated with your Storeden Store
sourcePath String, Object yes Local 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.