Git Product home page Git Product logo

Comments (11)

arboleya avatar arboleya commented on August 29, 2024

Hi, do you have any suggestion on how to do it?

Also, I'd be nice if you could elaborate a little more about your need, I didn't get the specifics.

from electrify.

hems avatar hems commented on August 29, 2024

@arboleya he wants to add some extra commands ( like a makefile would do ) after the build, probably before the app is launched

@AlexFrazer would a makefile help you out?

#makefile

my_custom_build:
  echo 'do something'
  echo 'do somthing else'

then execute

make my_custom_build

from electrify.

AlexFrazer avatar AlexFrazer commented on August 29, 2024

yeah pretty much. For example,

var pwd = path.resolve('.');
var build = path.join(pwd, 'meteor/.electron/.dist');

bundle:
  echo('electrifying app');
  electrify();
  echo('Copying icon');
  cp(path.join(pwd, 'meteor/public/favicon.ico'), path.join(build, 'resources/atom.icns'));

from electrify.

hems avatar hems commented on August 29, 2024

@AlexFrazer can't you do that now?

just using a makefile or executing a shell command "electrify" ?

from electrify.

AlexFrazer avatar AlexFrazer commented on August 29, 2024

I am having trouble executing the shell command "electrify". It seems to be a very odd process to manage in a build find.
Opening meteor, then opening meteor shell, then passing the command "electrify" isn't intuitive in an automated system, at least.
Can the npm package just include some bundling functionality?

var electrify = require('electrify');

target.bundle = function () {
  var METEOR = path.join(__dirname, 'meteor');
  electrify.bundle(METEOR);
}

from electrify.

hems avatar hems commented on August 29, 2024

@AlexFrazer agreed on the meteor shell thing, but maybe there is a way of making this one-liner and i'm not aware.. maybe @arboleya has knows workaround for this?

from electrify.

AlexFrazer avatar AlexFrazer commented on August 29, 2024

I have a workaround but it's not really the best...

Meteor.startup(function () {
  if (process.env.ELECTRIFY) {
    this.electrify();
    process.exit(0);
  }
});

Then in makefile:

target.bundle = function () {
  return exec('ELECTRIFY=true meteor --once');
}

just not exactly very friendly to do it that way

from electrify.

arboleya avatar arboleya commented on August 29, 2024

@hems @AlexFrazer I thought you wanted to put something in the middle of the build system, but actually you want a post build thing.

Yes, it is a little odd and surely hard to automate. But not that hard.

At first I wanted a custom Meteor command such as meteor release electrify or something like that, there is a way to have custom commands, but it felt too complicated and nonsense.

As for the NPM package, currently it's needed only by the Electron application for the boot process, not for the Meteor package itself. As I wanted to have the Meteor thing completely independent from local NodeJS or global Npm packages, I ended up executing Meteor's server code through the interactive meteor shell, which was the only way I found.

Your workaround sounds reasonable but it looks like it doesn't work on windows, right?

Another approach would be to spawn meteor, then spawn meteor shell and manipulate the stdin and stdout to type electrify in the meteor shell and then send a SIGINT signal, something like that.

I'm redesigning things to accommodate plugins, I'll revisit this question in time, for sure.

I agree it's odd not to have a simple command to build the whole thing.

from electrify.

arboleya avatar arboleya commented on August 29, 2024

@AlexFrazer Here it is: https://github.com/arboleya/electrify#npm-way

from electrify.

hems avatar hems commented on August 29, 2024

🎱

from electrify.

AlexFrazer avatar AlexFrazer commented on August 29, 2024

Thank you good sir!

from electrify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.