1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-24 15:49:46 +02:00

Add start script for Docker image, pre-commit lint check, package.json scripts cleanup

This commit is contained in:
Maksim Eltyshev 2020-04-24 21:44:54 +05:00
parent 73bd7aab89
commit 5481ccb91f
11 changed files with 1236 additions and 11 deletions

View file

@ -28,6 +28,11 @@ module.exports = {
},
async fn(inputs, exits) {
// TODO: allow over HTTP without subscription
if (!this.req.isSocket) {
return this.res.badRequest();
}
const project = await Project.findOne(inputs.projectId);
if (!project) {
@ -38,6 +43,8 @@ module.exports = {
const board = await sails.helpers.createBoard(project, values, this.req);
sails.sockets.join(this.req, `board:${board.id}`); // TODO: only when subscription needed
return exits.success({
item: board,
included: {

View file

@ -46,7 +46,6 @@ module.exports = {
values: {
coverAttachmentId: attachment.id,
},
request: inputs.request,
});
}

View file

@ -10,6 +10,10 @@ module.exports = {
connection: process.env.DATABASE_URL,
migrations: {
tableName: 'migration',
directory: path.join(__dirname, 'migrations'),
},
seeds: {
directory: path.join(__dirname, 'seeds'),
},
wrapIdentifier: (value, origImpl) => origImpl(_.snakeCase(value)),
};

View file

@ -5,12 +5,11 @@
"scripts": {
"console": "dotenv sails console",
"custom-tests": "echo \"(No other custom tests yet.)\" && echo",
"db:init": "cd db && node init.js",
"db:migrate": "knex migrate:latest --cwd db",
"db:seed": "knex seed:run --cwd db",
"lint": "eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔ Your .js files look good.'",
"start": "npm run db:init && NODE_ENV=production node app.js",
"start:dev": "nodemon",
"start": "nodemon",
"start:prod": "node app.js --prod",
"test": "npm run lint && npm run custom-tests && echo 'Done.'"
},
"eslintConfig": {