Skip to content

Instantly share code, notes, and snippets.

@mikegehard
Last active December 22, 2016 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikegehard/4520746 to your computer and use it in GitHub Desktop.
Save mikegehard/4520746 to your computer and use it in GitHub Desktop.
Lineman questions
/* Exports an object that defines
* all of the configuration needed by the projects'
* depended-on grunt tasks.
*
* You can find the parent object in: node_modules/lineman/config/application.js
*/
module.exports = require('lineman').config.extend('application', {
appTasks: {
common: [
'coffee',
'less',
'lint',
'handlebars',
'jst',
'configure',
'concat:js',
'concat:spec',
'concat:css',
'images:dev',
'webfonts:dev'
],
dev: [
'server',
'watch'
],
dist: [
'min',
'mincss',
'images:dist',
'webfonts:dist'
]
},
watch: {
js: {
files: ['<config:files.glob.js.vendor>', '<config:files.glob.js.app>'],
tasks: 'configure concat:js'
},
coffee: {
files: '<config:files.glob.coffee.app>',
tasks: 'configure coffee configure concat:js'
},
jsSpecs: {
files: ['<config:files.glob.js.specHelpers>', '<config:files.glob.js.spec>'],
tasks: 'configure concat:spec'
},
coffeeSpecs: {
files: ['<config:files.glob.coffee.specHelpers>', '<config:files.glob.coffee.spec>'],
tasks: 'configure coffee configure concat:spec'
},
css: {
files: '<config:files.glob.css.app>',
tasks: 'configure concat:css'
},
less: {
files: '<config:files.glob.less.app>',
tasks: 'configure less configure concat:css'
},
handlebars: {
files: '<config:files.glob.template.handlebars>',
tasks: 'configure handlebars configure concat:js'
},
underscore: {
files: '<config:files.glob.template.underscore>',
tasks: 'configure jst configure concat:js'
},
images: {
files: ["<config:files.glob.img.app>", "<config:files.glob.img.vendor>"],
tasks: 'configure images:dev'
},
lint: {
files: '<config:files.glob.js.app>',
tasks: 'configure lint'
}
}
});

Background: I am using lineman as part of a Scala Playframework application that I am writing. As such, I have the following questions

  1. I have deleted the homepage template since the HTML is going to be served from the Play application. When I run lineman run and lineman build, I get the following error:

    Running "homepage:dev" (homepage) task Unable to read "app/templates/homepage.us" file (Error code: ENOENT). Use --force to continue.

I have tried to use config/application.js to override the application.js settings in the module. See application.js below.

  1. I need to put all of the application files from 'generated' and 'dist' directories into a directory outside of the directory that was created by lineman new so that Play will pick up changes (long story). Is that possible? I thought I could do it by finding all instances of 'generated' and 'dist' in the files.js and application.js files and replace that with '../../someDir' but that didn't seem to work.

Other than that, Lineman seems to be a great tool for bootstrapping Grunt projects. Thanks for all of the hard work.

@Egzaell
Copy link

Egzaell commented Dec 22, 2016

Hi, I have no idea how to configure server.js for handling post method used by $resource.save. I want to add new entry to this json:

app.get('/books', function (req, res) { res.json([ {id: 1, title: 'Great Expectations', isbn: '9807876322', author: 'Dickens', kind: 'Fantasy, Horror', borrowed: false, borrower: '', pageQuantity: 267}, {id: 2, title: 'Foundation Series', isbn: '9007836572', author: 'Asimov', kind: 'Adventure, Fantasy, Historical', borrowed: false, borrower: '', pageQuantity: 566}, {id: 3, title: 'Treasure Island', isbn: '9851415668', author: 'Stephenson', kind: 'Fantasy', borrowed: true, borrower: '', pageQuantity: 211}, {id: 4, title: 'Last Adventures of Captain Dog', isbn: '887452214', author: 'Blind', kind: 'Adventure, Historical', borrowed: false, borrower: '', pageQuantity: 667}, ]); });

Help needed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment