second
parent
a36720a54d
commit
9ee8f219af
|
@ -0,0 +1,21 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
const Path = require('path');
|
||||||
|
const Hoek = require('@hapi/hoek');
|
||||||
|
const Manifest = require('./server/manifest');
|
||||||
|
const Plugin = require('./lib/plugins/@hapipal.schwifty');
|
||||||
|
|
||||||
|
// Take schwifty registration's knex option
|
||||||
|
// but specify the plugin's migrations directory
|
||||||
|
|
||||||
|
module.exports = Hoek.applyToDefaults(
|
||||||
|
{
|
||||||
|
migrations: {
|
||||||
|
directory: Path.relative(process.cwd(), Plugin.options.migrationsDir)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Manifest
|
||||||
|
.get('/register/plugins', process.env)
|
||||||
|
.find(({ plugin }) => plugin === '@hapipal/schwifty')
|
||||||
|
.options.knex
|
||||||
|
);
|
|
@ -0,0 +1,7 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
options: {
|
||||||
|
migrationsDir: `${__dirname}/../migrations`
|
||||||
|
}
|
||||||
|
};
|
16
package.json
16
package.json
|
@ -17,7 +17,12 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@hapi/boom": "9.x.x",
|
"@hapi/boom": "9.x.x",
|
||||||
"@hapipal/haute-couture": "4.x.x",
|
"@hapipal/haute-couture": "4.x.x",
|
||||||
"joi": "17.x.x"
|
"@hapipal/schwifty": "6.x.x",
|
||||||
|
"joi": "17.x.x",
|
||||||
|
"objection": "2.x.x"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"knex": "0.21.x"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@hapi/code": "8.x.x",
|
"@hapi/code": "8.x.x",
|
||||||
|
@ -25,7 +30,11 @@
|
||||||
"@hapi/eslint-plugin-hapi": "4.x.x",
|
"@hapi/eslint-plugin-hapi": "4.x.x",
|
||||||
"@hapi/glue": "8.x.x",
|
"@hapi/glue": "8.x.x",
|
||||||
"@hapi/hapi": "20.x.x",
|
"@hapi/hapi": "20.x.x",
|
||||||
|
<<<<<<< HEAD
|
||||||
"@hapi/inert": "6.x.x",
|
"@hapi/inert": "6.x.x",
|
||||||
|
=======
|
||||||
|
"@hapi/hoek": "9.x.x",
|
||||||
|
>>>>>>> 66973ef ((flavor) objection v3.0.0)
|
||||||
"@hapi/lab": "24.x.x",
|
"@hapi/lab": "24.x.x",
|
||||||
"@hapi/vision": "6.x.x",
|
"@hapi/vision": "6.x.x",
|
||||||
"@hapipal/confidence": "6.x.x",
|
"@hapipal/confidence": "6.x.x",
|
||||||
|
@ -36,6 +45,11 @@
|
||||||
"dotenv": "8.x.x",
|
"dotenv": "8.x.x",
|
||||||
"eslint": "7.x.x",
|
"eslint": "7.x.x",
|
||||||
"exiting": "6.x.x",
|
"exiting": "6.x.x",
|
||||||
|
<<<<<<< HEAD
|
||||||
"hapi-swagger": "14.x.x"
|
"hapi-swagger": "14.x.x"
|
||||||
|
=======
|
||||||
|
"knex": "0.21.x",
|
||||||
|
"sqlite3": "5.x.x"
|
||||||
|
>>>>>>> 66973ef ((flavor) objection v3.0.0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
const Dotenv = require('dotenv');
|
const Dotenv = require('dotenv');
|
||||||
const Confidence = require('@hapipal/confidence');
|
const Confidence = require('@hapipal/confidence');
|
||||||
const Toys = require('@hapipal/toys');
|
const Toys = require('@hapipal/toys');
|
||||||
|
const Schwifty = require('@hapipal/schwifty');
|
||||||
|
|
||||||
// Pull .env into process.env
|
// Pull .env into process.env
|
||||||
Dotenv.config({ path: `${__dirname}/.env` });
|
Dotenv.config({ path: `${__dirname}/.env` });
|
||||||
|
@ -34,7 +35,31 @@ module.exports = new Confidence.Store({
|
||||||
options: {}
|
options: {}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
<<<<<<< HEAD
|
||||||
plugin: './plugins/swagger'
|
plugin: './plugins/swagger'
|
||||||
|
=======
|
||||||
|
plugin: '@hapipal/schwifty',
|
||||||
|
options: {
|
||||||
|
$filter: 'NODE_ENV',
|
||||||
|
$default: {},
|
||||||
|
$base: {
|
||||||
|
migrateOnStart: true,
|
||||||
|
knex: {
|
||||||
|
client: 'sqlite3',
|
||||||
|
useNullAsDefault: true, // Suggested for sqlite3
|
||||||
|
connection: {
|
||||||
|
filename: ':memory:'
|
||||||
|
},
|
||||||
|
migrations: {
|
||||||
|
stub: Schwifty.migrationsStubPath
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
production: {
|
||||||
|
migrateOnStart: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
>>>>>>> 66973ef ((flavor) objection v3.0.0)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
plugin: {
|
plugin: {
|
||||||
|
|
Loading…
Reference in New Issue