Giter VIP home page Giter VIP logo

houl's Introduction

Houl

npm version Greenkeeper badge

Full-contained static site workflow

Documentation

You can read Houl documentation on https://houl.netlify.com/

License

MIT

houl's People

Contributors

acgotakuatoro avatar greenkeeper[bot] avatar ktsn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

houl's Issues

Possibly fail a build with cache when some deps are removed

I'm not sure a root cause yet but posting as a note.

$ yarn build-cache
yarn build-cache v0.24.5
$ houl build -c houl/houl.config.js --cache houl/.cache
/.../node_modules/progeny/index.js:339
        throw err;
        ^

Error: ENOENT: no such file or directory, open '/.../src/_pug/_components/_social_banner.pug'
    at Error (native)
    at Object.fs.openSync (fs.js:641:18)
    at Object.fs.readFileSync (fs.js:509:33)
    at Object.readFile (/.../node_modules/cbify/index.js:33:16)
    at progeny (/.../node_modules/progeny/index.js:322:16)
    at progenySync (/.../node_modules/progeny/index.js:337:5)
    at DepResolver (/.../node_modules/houl/lib/cli/build.js:52:47)
    at DepResolver.register (/.../node_modules/houl/lib/dep-resolver.js:15:25)
    at loop (/.../node_modules/houl/lib/cache-stream.js:55:19)
    at depResolver.getOutDeps.forEach.fileName (/.../node_modules/houl/lib/cache-stream.js:58:9)
error Command failed with exit code 1.

Filter input for build

Sometimes, we may want to build a part of source files in a project for various purpose. (e.g. generating styleguide by using built css files)

--filter **/*.scss option would be helpful in that case.

Allow to set options to presets

To customize a preset behavior, it would be nice if we can specify preset options. The preset option may have an object to do that.

{
  "input": "src",
  "output": "dist",
  "preset": {
    "name": "some-houl-preset",
    "options": { /* the preset options goes here */ }
  }
}

Then, in the some-houl-preset, the preset author can define houl.config.js with a function that receive the preset options as its 1st argument.

module.exports = function config(options) {
  // Must return preset config
  return {
    rules: {
      // ...
    }
  }
}

Cache for dev server

The current dev server implementation is quite slow because it always compiles all requested files. We should cache already compiled files in the same dev server session so that the response time will be faster.

extname should be transformed after executing tasks

Some gulp plugins behaves incorrectly if we change extnames before executing them. e.g. gulp-stylelint will treat .scss files as .css files when we change the extname to .css and it occurs unexpected behavior.

We should move the code to change extname after executing tasks.

Cache of nested dependencies are not saved on the first build

$ git checkout houl-build
$ npm i
$ rm -rf dist
$ rm houl/.cache
$ npm run build-cache
$ cat houl/.cache | wc
       0       1   74726
$  tail houl/.cache
...
...img/img-vol5_top.png":"01e24225"},"deps":{}}%

(build without modifications for sources)

$ npm run build-cache
$ cat houl/.cache | wc
       0       1 1048606

(deps are updated in this step)

This is because cache stream does not look into deps if the source file does not hit with cache. We need to always resolve and register nested deps in cache.

Error: File not found with singular glob

Maybe this error happens because there is an old cache having files which no longer exist in dependencies.
We should verity and update the cache based on the latest files.

Inline task

Sometimes having two files (houl.config.js and houl.task.js) is cumbersome especially for small build setting. It would be useful if we can define tasks in config file directly.

const pug = require('gulp-pug')

module.exports = {
  tasks: {
    pug: stream => {
      return stream.pipe(pug())
    }
  },
  rules: {
    pug: {
      task: 'pug',
      outputExt: 'html'
    }
  }
}

mtime of output files are not updated even if the dependent files are changed

Let we have a file base.scss and variable.scss, and base.scss dependes on variable.scss.

When the user modifies variable.scss, base.scss will be updated and output to dist directory. However, the last modified time of output file of base.scss is not updated.

This can be problematic under some cache systems that look last modified time such as Ruby on Rails asset pipe line.

proxy option

It would be nice if houl can proxies to other servers. The use case is when there is a backend server that provide views or apis while a frontend app depends on them.

The proxy option would look like:

module.exports = {
  input: 'src',
  output: 'dist',
  // ...
  proxy: {
    '/api': 'http://localhost:4000/api/',
    '/other': {
      target: 'http://localhost:4000/other/',
      logLevel: 'silent'
    }
  }
}

This is the same interface as webpack-dev-server's proxy.
We may use http-proxy-middleware to achieve this as well.

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.