From b38ea8d773eb2cc4b86e5c77078b3513c01d2352 Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Sat, 15 Sep 2018 09:37:07 +0200 Subject: [PATCH] feat(intellisense): add type comments --- app/Models/Token.js | 1 + app/Models/User.js | 3 +++ database/factory.js | 13 ++++++------- database/migrations/1503248427885_user.js | 1 + database/migrations/1503248427886_token.js | 1 + start/kernel.js | 1 + start/routes.js | 1 + 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/app/Models/Token.js b/app/Models/Token.js index 6d1bceb..e089e87 100644 --- a/app/Models/Token.js +++ b/app/Models/Token.js @@ -1,5 +1,6 @@ 'use strict' +/** @type {typeof import('@adonisjs/lucid/src/Lucid/Model')} */ const Model = use('Model') class Token extends Model { diff --git a/app/Models/User.js b/app/Models/User.js index b046866..2804a44 100644 --- a/app/Models/User.js +++ b/app/Models/User.js @@ -1,6 +1,9 @@ 'use strict' +/** @type {import('@adonisjs/framework/src/Hash')} */ const Hash = use('Hash') + +/** @type {typeof import('@adonisjs/lucid/src/Lucid/Model')} */ const Model = use('Model') class User extends Model { diff --git a/database/factory.js b/database/factory.js index f70c2bc..16b5084 100644 --- a/database/factory.js +++ b/database/factory.js @@ -11,12 +11,11 @@ | */ +/** @type {import('@adonisjs/lucid/src/Factory')} */ // const Factory = use('Factory') -/** - Factory.blueprint('App/Models/User', (faker) => { - return { - username: faker.username() - } - }) -*/ +// Factory.blueprint('App/Models/User', (faker) => { +// return { +// username: faker.username() +// } +// }) diff --git a/database/migrations/1503248427885_user.js b/database/migrations/1503248427885_user.js index 4d4b969..1ade2f5 100644 --- a/database/migrations/1503248427885_user.js +++ b/database/migrations/1503248427885_user.js @@ -1,5 +1,6 @@ 'use strict' +/** @type {import('@adonisjs/lucid/src/Schema')} */ const Schema = use('Schema') class UserSchema extends Schema { diff --git a/database/migrations/1503248427886_token.js b/database/migrations/1503248427886_token.js index da2663f..c8bb9fc 100644 --- a/database/migrations/1503248427886_token.js +++ b/database/migrations/1503248427886_token.js @@ -1,5 +1,6 @@ 'use strict' +/** @type {import('@adonisjs/lucid/src/Schema')} */ const Schema = use('Schema') class TokensSchema extends Schema { diff --git a/start/kernel.js b/start/kernel.js index 105de3a..1a1bd36 100644 --- a/start/kernel.js +++ b/start/kernel.js @@ -1,5 +1,6 @@ 'use strict' +/** @type {import('@adonisjs/framework/src/Server')} */ const Server = use('Server') /* diff --git a/start/routes.js b/start/routes.js index 2d17cab..5f8f816 100644 --- a/start/routes.js +++ b/start/routes.js @@ -13,6 +13,7 @@ | */ +/** @type {import('@adonisjs/framework/src/Route/Manager'} */ const Route = use('Route') Route.on('/').render('welcome')