Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Ghost
@ghost~54f494ed15522ed4b3dcafad
i've written a normal module earlier and i thought it's the same for compilers
i see now
David Bashford
@dbashford
all of the compilers have to implement an extensions function, which tells mimosa which extensions the module is responsible for "compiling"
if no compiler registers for an extension, then those files are not processed and, usually, you'll get a message: https://github.com/dbashford/mimosa/blob/master/src/util/workflow.coffee#L182
have to run myself =) let me know if you have any questions!
Ghost
@ghost~54f494ed15522ed4b3dcafad
alright
thanks for the help :)
Anachron
@Anachron
@dbashford I had this idea of how to maybe bring more people to mimosa. I think it would help a lot to maybe allow gulp or grunt plugins to work with mimosa. But for that either mimosa has to be rewritten or the core has to get some drastic changes. I get why people use tools like those, they have a big community and a lot of tutorials and example apps are out of it. Not even sure a big work like this is good, maybe a new (build)tool would be a better choice. I have ideas that inject those gulp/grunt-tasks in a pre-defined workflow already prepared by the tool.
David Bashford
@dbashford
If you want to fork mimosa and tinker with that, you are totally welcome to. Can see if you end up someplace workable where grunt/gulp tasks can be shimmed in. My next few months are fairly clear cut in terms of where my effort is going to be.
David Bashford
@dbashford
If you were to come up with an elegant solution I'd be happy to fold it back in. Obviously needs to be played with.
Ghost
@ghost~54f494ed15522ed4b3dcafad
I am starting with the copy-all compiler and I am wondering, is module.exports.name shown anywhere? Or is it just an internal name?
Anachron
@Anachron
@dbashford will try to mess around with it. My first idea would be hooking it up in the register one that already exist for modules/compilers, like a small api layer that will pass the data through. But I have to check mimosas internal working more, especially when it writes back to harddisk.
David Bashford
@dbashford
it is mostly an internal name, but occasionally it'll show up in a log message. usually debug logging.
hahahahahahahahahahahahahahahaha
@hahahahahahahahahahahahahahahaha
quick question, is there an easy config flag to turn on source-maps in the stylus config that I'm overlooking? I feel like I'm just missing where it's documented.
David Bashford
@dbashford
Don't think I ever implemented stylus source maps. We stopped using stylus ourselves so I stopped paying attention to whether or not they had managed to figure out how to do them. It was an open issue for a very very long time.
hahahahahahahahahahahahahahahaha
@hahahahahahahahahahahahahahahaha
It's just a flag that needs to be passed according to their docs, that's why I was curious because I feel like it should be simple
I can hack it in express but I'd prefer to keep all the JS and CSS compiling with Mimosa's standards ootb
if it's possible
David Bashford
@dbashford
could you toss an issue into mimosa-stylus for this? I can knock it out next spare moment I get. I agree, should be fairly easy to add.
hahahahahahahahahahahahahahahaha
@hahahahahahahahahahahahahahahaha
okay awesome, will do, thanks @dbashford
David Bashford
@dbashford
:+1:
David Bashford
@dbashford
@boltforge wrapped up the stylus source map stuff last night, give it a go and let me know if you have any trouble.
hahahahahahahahahahahahahahahaha
@hahahahahahahahahahahahahahahaha
@dbashford looks good man, quick question, does it take only a boolean, or a boolean || config object like the Stylus spec states?
just might good to specifically note that if not so people don't spin on it, I can put in a ticket if it helps
hahahahahahahahahahahahahahahaha
@hahahahahahahahahahahahahahahaha
This message was deleted

Hmmm still not showing the sourcemaps for me...

exports.config = {
    modules: [
        "bower",
        "copy",
        "jade",
        "stylus",
        "react",
        "require",
        "server",
        "client-jade-static",
        "server-template-compile",
        "live-reload",
        "server-reload",
        "web-package"
    ],
    bower: {
        watch: true,
        bowerDir: {
            path: ".mimosa/bower_components",
            clean: false
        },
        copy: {
            enabled: true,
            trackChanges: true,
            outRoot: null,
            exclude: [],
            unknownMainFullCopy: true,
            mainOverrides: {
                "font-awesome": [{
                        "fonts": "../../font"
                    },
                    "css/font-awesome.css",
                    "fonts/fontawesome-webfont.ttf"
                ]
            },
            strategy: "packageRoot",
            togetherRoot: "components",
            forceLatest: true,
            pathMod: []
        }
    },
    serverReload: {
        watch: ["server.js", "server.ls", "server.iced", "routes", "src", "lib", "/assets/javascripts/json/data.json"],
        exclude: [],
        validate: true
    },
    stylus: {
        lib: require('stylus'),
        extensions: ["styl"],
        use: ['nib'],
        import: ['nib'],
        define: {},
        includes: [],
        sourceMap: true
    },
    clientJadeStatic: {
        context: {},
        outputExtension: '.html',
        extensionRegex: /.html.[a-zA-Z]+$/,
        prettyOutput: true
    },
    react: {
        lib: undefined,
        extensions: ["jsx"],
        options: {
            harmony: false,
            sourceMap: true
        }
    }
};

Anyone see anything I'm missing that would prevent it from working?

blob
I have it enabled in Chrome too so I'm kind of scratching my head atm...
hahahahahahahahahahahahahahahaha
@hahahahahahahahahahahahahahahaha
This weekend I'll back out stylus control from the mimosa config and hardwire it with Express and see if that works, that will isolate the issue to Mimosa and then I can work from there, but I want all my preprocessor config through Mimosa as much as possible :shipit:
David Bashford
@dbashford
if you could, look at the compiled .css, does it have an inlined sourceMap at the bottom?
As far as the various options go, as a whole I'm moving away from supporting source maps as separate files. So I just force it to inline.
that is widely supported at this point
also, make sure you remove the node_modules/mimosa-stylus to force the reload of the latest module. Or you can update your modules list to have mimosa-stylus@1.4.0
hahahahahahahahahahahahahahahaha
@hahahahahahahahahahahahahahahaha
yeah, I'm using the latest version, it's all good, even going the standard supported way doesn't seem to be working, but I am getting the linenos
{
  "name": "mimosa-stylus",
  "version": "1.4.0",
But not seeing the sourcemap file being created, or the sourcemap ref being created at the bottom of the css file
My naming conventions are good enough and the code is organized enough that it's really overkill, at the same time I want it there for when the more junior or new people start looking into the code
David Bashford
@dbashford
you running mimosa watch?
Daniel Bartholomae
@dbartholomae
Hi there, I am currently struggeling with getting mimosa to work with requirejs on the server side:
When requirejs looks for modules, it uses the mimosa build dir as working directory instead of the project directory. Any ideas how to change this? :)
David Bashford
@dbashford
So you are using AMD within your server code as well as your UI code? mimosa-require definitely looks at the watch.sourceDir as do pretty much all the modules. Your options are probably 1) Get your server and UI code both within the watch.sourceDir or 2) run two projects, one for server, one for UI. Future releases will allow having a single project with entirely different profiles running differently on different folders, but for now its a single input folder.
Daniel Bartholomae
@dbartholomae
For the first solution, do you expect problems if I use jade for server and client? The server templates might get rendered to the client templates.js, if I understand mimosa correctly
Daniel Bartholomae
@dbartholomae

I managed to shim it with this configuration:

exports.startServer = (config, callback) ->
  requirejs = require 'requirejs'

  requirejs.config(
    nodeRequire = require
  )

  requirejs ["#{__dirname}/app"], (app) ->
    app.startServer config, callback

Thanks for Mimosa, it really helped me to get started on NodeJS! :)

David Bashford
@dbashford
:+1:
hahahahahahahahahahahahahahahaha
@hahahahahahahahahahahahahahahaha
does anyone else prototype over HTTPS rather than HTTP?
curious if anyone would like a flag in a skeleton for a BS certificate but eh LOE is low but ROI is also low lol
David Bashford
@dbashford
so I'm down to 5 files to test and convert, but they are the biggies.
Daniel Bartholomae
@dbartholomae
Hi there, one quick question: Is it possible to create a mimosa module that does something with a file outside the watched dir (e.g. assets)? I would like to write a module that automatically copies all .coffee files from /app/shared to /assets/javascript/shared before they are compiled, but I'm not sure this is possible.
David Bashford
@dbashford
Check this out and see if its close to what you need? https://github.com/dbashford/mimosa-import-source If not then at least its a good place to start a conversation. =)
Daniel Bartholomae
@dbartholomae
Great, that's exactly what I was looking for! :)
David Bashford
@dbashford
:+1: