Git Product home page Git Product logo

legacy-docs's People

Contributors

antwaanh avatar assertchris avatar begueradj avatar benallfree avatar c5n8 avatar duyluonglc avatar elrafa-sg avatar fians avatar furey avatar ghosh avatar hiukky avatar jakesylvestre avatar marktinsley avatar mtamadon avatar n7olkachev avatar nikopeltoniemi avatar ntvsx193 avatar oscarmorrison avatar outluch avatar pazzavlad avatar perdjurner avatar radmen avatar rafaelfess avatar ramsesmoreno avatar rhwilr avatar romainlanz avatar suciptoid avatar targos avatar thetutlage avatar yariksav 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

legacy-docs's Issues

explain connection between Model Relationships and Migrations

In the model relationship section, it reads as if when you add a new relationship, the model's operations will continue to automatically. It isn't clear that you need to create the appropriate migrations.

Also, it's important to explain what Lucid relationships do for you so that you can know what migration to create.

For example, for this relationship:

owner {
  return this.belongsTo('App/Model/User')
}

I'd expect to add the following migration:

table.string('owner').references('id').inTable('users')

Whereas from looking at example code, this is what is done:

table.integer('user_id').references('id').inTable('users')

I've been using adonis-rally to help bring everything together, but I'd be great to see a full explanation or tutorial of how everything works together, especially for something as crucial as relationships/migrations. Thanks!

need more info on default Ace commands options

There's info on how to make your own ace commands, however I'm not seeing anything that goes into more depth about the default commands. What are the options for the commands?

landan@lj-desktop:~/www/adonuxt_test$ node ace -V
1.0.0
landan@lj-desktop:~/www/adonuxt_test$ node ace -h

  Usage: ace [options] [command]


  Commands:

    greet <name>                      Greet a user with a name
    nuxtbuild                         Build for production the nuxt.js application.
    auth:setup                        Setup migrations and models for authentication
    repl                              Start a new repl session when goodness of Es6 generators
    make:controller [options] <name>  Create a new controller
    route:list                        List all Routes registered for this app
    make:migration [options] <name>   Create a new migration file
    make:model [options] <name>       Create a new model with optional migration
    make:view [options] <name>        Create a new template view by optionally extending a master view
    make:command <name>               Create a new ace command
    make:hook [options] <name>        Create a new hook for your models
    make:middleware [options] <name>  Create a new middleware for Http requests
    make:seed <name>                  Create a new seeder
    make:listener [options] <name>    Create a new listener for your events
    migration:run [options]           Run all pending migrations and optionally seed database
    migration:rollback [options]      Rollback migrations to a given or last batch
    migration:refresh [options]       Refresh migrations by dropping and re-running all migrations
    migration:reset [options]         Reset migrations to latest batch
    db:seed [options]                 Seeds database by running all or a given seed file
    migration:status                  Check migrations current status
    key:generate [options]            Generate encryption key for your application

  Options:

    -h, --help     output usage information
    -V, --version  output the version number

landan@lj-desktop:~/www/adonuxt_test$ 

http://adonisjs.com/docs/3.2/interactive-shell

Add a local installation section

Hello, I propose a new adonis installation section for those who don't want global adonis binary:

prerequisites: npx

npx @adonisjs/cli new yarnstick
cd yarnstick
npm install -save-dev @adonisjs/cli # possibly to be integrated in the blueprints
npx adonis serve --dev

I also suggest adding a --local flag to the new command of adonis that would add the npm install --save-dev @adonisjs/cli command to the installation process
And modify in the end message adonis serve --dev by npx adonis serve --dev

.body > .overlay CSS issues

In chrome 59, the .overlay div causes a repaint when scrolling, also it has an invalid transform value which looks like it should be transition instead.

.overlay {
    background: rgba(0,0,0,.4);
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    opacity: 0;
    pointer-events: none;
-   transform: opacity .2s linear;
+   transition: opacity .2s linear;
+   will-change: transform, opacity;
}

Before:
image

After:
image
(75Hz monitor)

Mail.send wrong parameters

In the docs you have yield Mail.send('emails/welcome', function (message) { but when I do that, I get callback must be a function error, because it is expecting the callback to be the 3rd paramaters, not the second.

* send (view, data, callback, config) {

Not sure what data (view merge fields?). I just put yield Mail.send('emails/test', '', function(message) { as a test and it worked.

Files and Nunjucks Templates links

Hey! I've just noticed that links for 'Files' and 'Nunjucks Templates' are broken. They both open 'Files' page but content is about templates. I've no problem reading from this repo but it will be nice to be fixed, you know πŸ˜„

screenshot

Add arrow up in docs.

First time i needed so hard in docs 'arrow up' on site :) Need it for easy return on start document.
Please. Thx in advance.

http://adonisjs.com/docs/3.0/seeds-and-factories

Hi,
Just noticed this and saving it for a pull request later. faker.email and everything following should be fake.email() ....

const Factory = use('Factory')

Factory.blueprint('App/Model/User', (fake) => {

  return {
    username: fake.username(),
    email: faker.email(),
    password: faker.password(),
    firstName: faker.first(),
    lastName: faker.last()
  }

})

Lucid Realtionship Doc Issues

Inside the Lucid Relationship docs, there are few errors to fix.

First one is the hasManyThrough table digram shows a wrong filed in a posts table. post_id must be changed to user_id.

Image

and the second thing is hasManyThrough Table "Default Value" column descriptions are wrong.

Add Example for Routing with a Public Path

Looking for a way to serve my vue dist directory as the wildcard route, I came across this post:
https://forum.adonisjs.com/t/vue-js-spa-within-adonis-js/363/3

I would be nice to have an example like this (as in the post):
const Helpers = use(β€˜Helpers’)
Route.any('*', ({response}) => response.download(Helpers.publicPath('main.html')))

This fits for the main ways of creating react and vue front end apps, with create-react-app and vue-cli respectively.

Docs for 'Providers'

I'd love to see how to add custom Providers. Is there any plan to write docs for this?

Thank you!

Resource Middleware not working

I am attempting to add multiple middleware (['auth', 'admin']) to a route resource that looks something like this:

Route.group('api', () => {
  Route
    .resource('parent/child', 'ChildController')
    .apiOnly()
}).prefix('api/v2')

The middleware should only apply to store, update and delete methods - the index and show methods are to be publicly available. In the documentation for Resource Middleware (http://dev.adonisjs.com/docs/4.0/routing#_resource_middleware) it has the following snippet which is meant to solve this problem:

Route
  .resource('users', 'UsersController')
  .middleware(new Map([
    ['auth']: ['users.store', 'users.update', 'users.delete']
  ]))

Unfortunately this is not syntactically correct as an Array of Arrays should be comma separated. It also throws an Unexpected token : error when trying to run using adonis serve --dev. I have tried a variety of ways to get this to work such as the following:

Route
  .resource('parent/child', 'ChildController')
  .apiOnly()
  .middleware(new Map([
    ['auth', 'admin'], ['parent/child.store', 'parent/child.update', 'parent/child.delete'],
  ]))

Unfortunately none of the ways I have tried appear to work.

Obviously I can get around this for the time being by simply listing out all my route methods and attaching the middleware to them individually but I would prefer to be able to do it similar to how it is suggested in the documentation.

Many 2 Many - Table migration

Need to be specified in the docs:

In a many 2 many relationship you have to create a migration for the pivot table too.

Flesh out the docs on adonis-ally

I recently started with adonis, and the first thing I wanted to do was get some kind of social authentication going, and there were a few pain points that took me a while to solve and I think would be valuable additions to the social auth docs.

  1. I think it would be useful to go over specifically what you need to setup your database to handle user authentication. A basic review covering just the barebones users migration and user model (noting it can be empty and still work). I feel like the docs are lacking in this regard, repetition isn't used as much as it could to improve understanding.

  2. Add in the common use case of an already-logged-in guard to the "basic example", something like this:

      try {
        await auth.check()
      } catch (error) {
        await auth.login(user)
      }
  1. Add a "show/getUser" method to the example, showing how to retrieve the current user once you are authenticated, like this:
  async show({ auth, params }) {
    try {
      let user = await auth.getUser()
      return { status: true, data: user }
    } catch (e) {
      return { status: false, data: 'Not Logged In' }
    }
  }
  1. Add a note about the session config option sameSite. I don't know if this is a consistent issue, but using google auth I had a huge issues and I had no idea about this until I found an obscure issue regarding it.

  2. Add an example about the remember(true) setting, because it seems to need a token model and migration setup with the user. I still haven't figured out how to set this up, though I didn't need it that badly.

Seeds and factories

Hi,

Thanks for this Node.js MVC Framework. I am very glad I found.

http://www.adonisjs.com/docs/3.0/seeds-and-factories

each(callback)

const users = Factory.model('App/Model/User').create(5)
users.each(function * (user) {
    const post = Factory.model('App/Model/Post').make()
    yield user.posts().save(post);
})

=> TypeError: users.each is not a function

When I change by

const users = Factory.model('App/Model/User').create(5)
for (var user of users){
    const post  = Factory.model('App/Model/Post').make()
    yield user.posts().save(post );
}

=> TypeError: user.posts is not a function

With post model

'use strict'
const Lucid = use('Lucid')
class User extends Lucid {
  posts() {
    return this.hasMany('App/Model/Post')
  }
}
module.exports = User

any ideas ?

Cheers,

Error in the view documantaion

Hi,

In the documentation on the adonisjs.com site at version 4.1 it is not clear where to put the global code.

At the Extending Views section the following is written:

Since the code to extend the View needs to be executed once, you can make use of providers or ignitor hooks. Make sure to read how to extend guide before continuing.

but the link is pointing to the Views page when expected to point to the extend guide.

Thanks.


This is the same issue as here: adonisjs/core#809

Add redis session driver config docs

It was not clear to me that the redis config for the redis session driver needs to go in config.session.redis. I was putting it in config.redis as per the redis docs.

View Presenters

Should we add some docs on on view presenters? It is a pretty useful thing that is not well documented at the moment.

wrong require in websocket wit cluster section

Hello guys, first a big thanks for your hard work ! trully a marvellous tool you have build there.

There is a small error in the doc in the ws cluster section
you said to require

require('@adonisjs/websocket-client/clusterPubSub')()

but it should be

require('@adonisjs/websocket/clusterPubSub')()

Am i wrong ?

Upgrade to webpack 4

The "managing frontend assets" recipe contains config that is incompatible with the latest webpack 4. I already created a pull request with a fix that explicitly downloads webpack 3 instead of webpack 4, but I think that eventually, the guide should use the latest webpack.

wrong namespace on View page in doc

at Views ##Basic example page has wrong namespace.

File: docs/04-http-lifecycle/05-views.adoc

below snippet is

const providers = [
  '@adonisjs/frameworks/providers/ViewProvider'
]

should be ...

const providers = [
  '@adonisjs/framework/providers/ViewProvider'
]

UserController vs UsersController

I see a mixed use of UserController and UsersController in the docs, probably depending on time written. I believe the convention is UserController (singular). Might be good to correct it for clarity.

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.