GithubHelp home page GithubHelp logo

knit's People

Contributors

cbaatz avatar musically-ut avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

musically-ut

knit's Issues

Make compiler dependencies optional

Only load/include compilers for which the required libraries are available (require 'name' does not throw error and version is acceptable). That way, we could add compilers without bloating dependencies.

Allow custom headers

Don't just allow mime-type header, but any header. If the second argument to the put callback is a string, assume mime-type, if object, assume header map.

Odd file reading error

Some temporary files created by Emacs are found in the directory but can't be read by Node.js, so test for existence:

ENOENT, no such file or directory 'scripts/views/.#main.js'

Create a repository for example projects

To help with getting started, create a repository with example uses. So people can get something working and playing with it by simply:

  1. Installing knit and knit-common.
  2. clone the example repo
  3. knit serve

The example repo should have one root level knit.coffee file with a basic example, then subdirectories with more specialised examples.

Clean up messages

Clean up the format, indentation, and content of the status messages that Knit displays to the user.

Allow overlapping nested routes

It should be possible to specifying overlapping nested routes:

'/js/': {'hello.js': handler}
'/js/': {'world.js': handler}

Currently only /js/world.js is served.

init command

An init command would help create static files useful for development. This might be a template for knit.coffee or a useful JavaScript library. Example usage might be:

knit init requirejs ./libs/require.js
knit init jquery-min ./libs/jquery
knit init base-app

It's some kind of mapping from a name to a file that gets read or downloaded. Exactly how it should work (using versions, tags, or similar for files, or specifying full directory structures) needs to be worked out.

Allow custom compilers

Allow users to specify ad-hoc compilers from the config file. Probably also use this to parameterise existing compilers (e.g. mimetype for string/file).

Catch some interrupt to reload configs?

To allow caching later, we might not want to reload the config files on each request; instead we might want to reload config files on an interrupt signal (SIGQUIT / Ctrl-D say) to Knit. Alternatively when a special URL is requested (/reload/).

Go up directory tree to find knit file

Not convinced this is sensible, but could go up directory tree to find the knit file. Then we could do knit serve from any folder in the project. Would need to set $PWD correctly.

Create a Knit Writable Stream

Instead of passing the actual HTTP response/file write streams to handlers, create a Knit specific writeable stream that can be created from an HTTP response or file stream. This is neater and allows us to add Knit specific functionality to the stream.

Change resource file API

Expect the routes export in resource files to be a function (parameters, log) { return <routes>; } instead of an object. Requiring a resource file should have no immediate effect. Allow resource files to export a description so we can list all available resource files with their descriptions. This also allows us to remove the knit global variable. Could allow routes export to alternatively be a routes definition object that can't access the knit parameters.

Serve files from paths

It should be possible to serve files from directory paths such as /something/. Now, these get rewritten to /something (i.e. loses the trailing slash).

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.