Code Monkey home page Code Monkey logo

lux's People

Contributors

adampash avatar gitter-badger avatar greenkeeperio-bot avatar jamemackson avatar jhliberty avatar kev5873 avatar kevboh avatar kureuil avatar kylemac avatar neojp avatar nickschot avatar nightire avatar nryoung avatar such avatar willviles avatar zacharygolba 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lux's Issues

Passing Invalid JSON to a POST/PATCH request crashes

Passing invalid JSON to a POST/PATCH requests crashes lux, and generates no response.

/Users/kevin/Documents/lux-todo/node_modules/lux-framework/src/packages/server/utils/body-parser.js:13
      JSON.parse(body) : parseQueryString(body);
           ^
SyntaxError: Unexpected token ; in JSON at position 96
    at Object.parse (native)
    at IncomingMessage.onEnd (/Users/kevin/Documents/lux-todo/node_modules/lux-framework/src/packages/server/utils/body-parser.js:13:12)
    at IncomingMessage.g (events.js:286:16)
    at emitNone (events.js:86:13)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:934:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Creating this issue just to document it.

Return Promise from Model#relationship

We should return Promises when a relationship is accessed on an instance of Model in case the related records were not eager loaded.

const user = await User.find(1);
const posts = await user.posts;

Ensure all params are sanitized

Parameters passed to controllers for filtering, creating and updating records must be sanitized by whitelisting an array of attribute keys to prevent security risks.

class PostsController extends Controller {
  params = [
    'title',
    'body'
  ];
}

Cannot find module '../appindex.js'

Followed instructions from: https://github.com/postlight/lux/wiki/Getting-Started

After creating a new app, 'lux serve' fails:

~/projects/ember/lux-test-2 (master) $ lux serve
Error: Cannot find module '../appindex.js' from 'c:/Users/xxxxx/projects/ember/lux-test-2/dist'
    at C:\Users\xxxx\projects\ember\lux-test-2\node_modules\resolve\lib\async.js:55:21
    at load (C:\Users\xxxx\projects\ember\lux-test-2\node_modules\resolve\lib\async.js:69:43)
    at onex (C:\Users\xxxx\projects\ember\lux-test-2\node_modules\resolve\lib\async.js:92:31)
    at C:\Users\xxxx\projects\ember\lux-test-2\node_modules\resolve\lib\async.js:22:47
    at FSReqWrap.oncomplete (fs.js:117:15)
~/projects/ember/lux-test-2 (master) $

Improve Documentation

Lux looks to be a very cool project, and I'm currently evaluating whether I can use it to build the core data APIs for my project. Kudos to a great effort thus far!

That said, I've gotten bitten following some outdated information in the wiki, most notably the first statement on the Models page:

Models wrap a typical node-orm2 model in a ES2015 class to provide a more modern syntax.

It was only after a couple of days of R&D into node-orm2 & things not working as I'd expect that I noticed in the commit log that node-orm2 had been replaced by an custom ORM wrapping knex.

I'm also finding myself reading through Lux's source code to determine whether some features I'll need are A) not (yet) implemented, or B) not documented well enough for me to figure out how to use them. It'd be really great to see JSDoc (or similar) incorporated into the source code and generated API docs.

If I decide I'm able to use Lux for my project, I'll be happy to contribute to that effort.

[feat] Pagination links and JSON API spec

Pagination links served in Lux:

"links": {
    "self": "http://example.com/articles?page=3",
    "first": "http://example.com/articles?page=1",
    "prev": "http://example.com/articles?page=2",
    "next": "http://example.com/articles?page=4",
    "last": "http://example.com/articles?page=13"
  }

Pagination links according to JSON API spec:

"links": {
    "self": "http://example.com/articles?page[number]=3&page[size]=1",
    "first": "http://example.com/articles?page[number]=1&page[size]=1",
    "prev": "http://example.com/articles?page[number]=2&page[size]=1",
    "next": "http://example.com/articles?page[number]=4&page[size]=1",
    "last": "http://example.com/articles?page[number]=13&page[size]=1"
  }

Don't want to use MySQL

Hi,
I like framework and looks awesome. I don't want to use MySQL as I am writing service which calls another XML service via HTTP so don't need MySQL. How can I skip mySQL?

Docker help

I've been banging my head against a wall trying to run lux in docker. Do you happen to have a docker/docker-compose setup that you use? If not, I can keep trying to "dockerize" this.

Add Windows Support

Currently we do not support Windows.

Most reasons why Windows does not currently work is related to path differences between UNIX and Windows (/ vs \).

Invalid Session Key/Secret Pairs Causes 500 Error

Problem:

When switching between two different Lux projects with the same sessionKey without a clean session or domain you get 500 error because of the key/secret miss-match.

Solution:

We should catch the miss-match error here and ignore the offending cookie allowing the request to pass through as if no session previously existed (in turn writing a new Set-Cookie header).

cli to check existing files

The CLI should check for existing files when generating the file with the same name and ask for user input before replacing any, with the option to skip if they deny the permission.

model "hasMany" undefined error

Lux beta7 | Node v4.2.1 | MariaDB v10.1.11

I'm new to this. I'm also interested in contributing when I get my bearings.

I noticed this:
on default npm install and after generating user, post and account models with CLI resource

I took the user model from the guides:

class User extends Model {
  static hasOne = {
    account: {
      model: 'account',
      reverse: 'user'
    }
  };
  static hasMany = {
    posts: {
      model: 'post',
      reverse: 'author'
    }
  };
}

I get this lovely error when starting the server, and I'm not sure where I should look to debug it:

[5/12/16 7:48:48 PM] Starting Lux Server with 4 worker processes
{ [ORMError: Unknown property type: undefined]
  message: 'Unknown property type: undefined',
  code: 4,
  literalCode: 'NO_SUPPORT' }

However, when I remove the hasMany from the user model, everything seems to work as expected.

I've attempted this on 2 machines. Any initial ideas on the reason for the error?

Autogenerate controllers and serializers on the fly

At the moment you require a route, controller, model and a serializer to exist to be able to return some sort of content.

From the README.md

Automatic CRUD actions in controllers
Automatic pagination, sorting, filtering via query params in controllers

I misunderstood this by thinking controllers and serializers where autogenerated on the fly the way it works on Ember (Ember spoils you). And there weren't any good error messages when they didn't exist.

Would definitely consider these files optional since they work by being empty. Eg.

import { Controller } from 'lux-framework';

class UsersController extends Controller {

}

export default UsersController;

Generate `resource` task on CLI

It would be nice if there was a task that batches editing the routes.js, creates the controller, model and serializer.

lux generate resource user

Create a cli

The best part of a framework arguably is the cli taking care of boilerplate and common tasks for you.

Access the payload of request

I can't figure out how to access the payload of the request.

I can see the following attributes of the request object

"readable",
"domain",
"socket",
"connection",
"httpVersionMajor",
"httpVersionMinor",
"httpVersion",
"complete",
"headers",
"rawHeaders",
"trailers",
"rawTrailers",
"upgrade",
"url",
"method",
"statusCode",
"statusMessage",
"client",
"read",
"route",
"params"

'lux new' fails on Windows

Did 'npm install -g' but 'lux new' fails with the following error:

~/projects/ember $ lux new lux-test
c:\Users\xxxx\AppData\Roaming\npm\node_modules\lux-framework\dist\cli.js:198
    let rescue = arguments.length <= 1 || arguments[1] === undefined ? K : arguments[1];
    ^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (c:\Users\bwyse\AppData\Roaming\npm\node_modules\lux-framework\bin\lux:9:3)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
~/projects/ember $ npm -v
3.6.0
~/projects/ember $ node -v
v5.6.0
~/projects/ember $

Add CHANGELOG.md

This is extremely useful when troubleshooting bugs between versions or for people considering upgrading to a newer version.

This could probably wait until lux is out of beta, but I think it is important to include eventually.

Whitelist hidden files from globbing

Renamed a controller to have a . in front of the file and caused the following error when running lux serve.

This can pose a problem when using hidden files for custom linting .eslintrc, ignoring files .gitignore .eslintignore or even keeping an empty directory on git .gitkeep

Lux Generator Creates Class Name with Bad Characters

Generating a new Lux App with the following name

lux new lux-test-app

Then calling lux s produces the following error.

{ SyntaxError: /Users/kevin/Documents/lux-test-app/app/index.js: Unexpected token (3:13)
  1 | import { Application } from 'lux-framework';
  2 | 
> 3 | class LuxTest-app extends Application {
    |              ^
  4 | 
  5 | }
  6 | 

Fill out README

Fill out README with:

  • Development instructions
  • Contributing guidelines
  • A short description why this framework exists
  • Documentation on public APIs provided by the framework

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.