GithubHelp home page GithubHelp logo

akatopo / enyo-deploy-walker Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 8 KB

A simple node library to extract the paths of script, css, and asset dependencies for an enyo bootplate project

License: ISC License

JavaScript 100.00%
enyo enyo-bootplate

enyo-deploy-walker's Introduction

๐Ÿพ enyo-deploy-walker

A simple node library to extract the paths of script, css, and asset dependencies for an enyo bootplate project, useful when wanting to build enyo apps with gulp etc.

Installation

$ npm install enyo-deploy-walker --save-dev

Example usage

Get the dependencies for enyo and the app:

const enyoWalker = require('enyo-deploy-walker').default;

const boot = enyoWalker.getDependencies('./bootplate/lib/enyo/source/boot');
const source = enyoWalker.getDependencies('./bootplate/lib/enyo/source');
const enyo = enyoWalker.mergeDependencyCollections(boot, source);
const app = enyoWalker.getDependencies('./bootplate');

And later use them in gulp tasks:

return gulp.src(enyo.scripts)
  .pipe(concat('enyo.js'))
  .pipe(gulp.dest('./dist/build'));
return gulp.src(enyo.css)
  .pipe(concat('enyo.css'))
  .pipe(gulp.dest('./dist/build'));
return gulp.src(app.scripts)
  .pipe(concat('app.js'))
  // sourcemaps, babel, etc.
  .pipe(gulp.dest('./dist/build'));
return gulp.src(app.css)
  // possibly rebase css urls and other preprocessing here
  .pipe(concat('app.css'))
  .pipe(gulp.dest('./dist/build'));

API

getDependencies(bootplatePath, opts)

(string, { verbose: boolean }) โ†’ DependencyCollection

Given a bootplatePath path to a directory, it parses its deploy.json, or package.js if deploy.json is not present, and returns a DependencyCollection object.

Prints logging messages if opts.verbose is truthy.

mergeDependencyCollections(c1, c2)

(DependencyCollection, DependencyCollection) โ†’ DependencyCollection

Merges two DependencyCollections into a new DependencyCollection.

pushDependecyCollection(c1, c2)

(DependencyCollection, DependencyCollection) โ†’ DependencyCollection

Pushes DependencyCollection c2 to c1.

createDependencyCollection()

* โ†’ DependencyCollection

Creates a new DependencyCollection.

DependencyCollection

An object that holds string arrays with the paths of scripts, css, and assets

{
  scripts: [string],
  css: [string],
  assets: [string]
}

enyo-deploy-walker's People

Contributors

akatopo avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.