Giter Site home page Giter Site logo

makfy's People

Contributors

dependabot[bot] avatar sanderronde avatar xaviergonz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sanderronde

makfy's Issues

Fails when `SHELL` environment variable is not defined

When using makfy in an environment where the SHELL environment variable is not defined, will exit with the error "[ERROR] The "file" argument must be of type string. Received undefined". This is because on this line the assumption is made that SHELL is always defined. However, this is not defined in Github Actions containers.

I'd suggest falling back to sh if process.env.SHELL is not defined, since that seems to work fine at least in the github actions case.

FYI you can use act to create a local github actions container in case you want to experiment with it yourself.

Make configuration available from `utils`

I'd like to autogenerate my package.json from makfy, including adding the makfy scripts into it.

To do that, I would need to read the current makfyfile, but I don't necessarily know where that it, so it would be nice if there was a getCommands() function which simply returns the current configuration…

Optional shorter syntax

makfy is just what I've been looking for! There are a couple of things its missing to make it perfect for me but I'm happy to contribute.

Many of my commands are simple one-liners with not much else. The rest simply call other commands in series and parallel. This makes the full syntax quite verbose in places.

Could users optionally just set the command to array of commands which get passed straight to await exec(...)? It appears this would still work even with stacked series/parallel arrays or commands.

module.exports = {
  commands: {
    clean: {
      run: async (exec) => {
        await exec('del-cli ./dist/**');
      }
    },
    build: {
      run: async (exec) => {
        await exec('tsc --pretty');
      }
    }
  }
};

becomes:

module.exports = {
  commands: {
    clean: ['del-cli ./dist/**'],
    build: ['tsc --pretty']
  }
};

[POLL] automatic babelization/typescript compilation of makfyfile.js

Since right now async/await is only supported by node 7.6+, would it be interesting if makfy automatically babelized (if the file ends in .es6) and/or compiled using typescript (if the file ends in .ts) the makfyfile at runtime?

Or should we just assume node 8 will soon come and leave it up to users to babelize/typescript compile the file if they are using node 6.

Alternatively, using typescript could be cool since the whole thing already uses typescript and could export its types to make sure the makfyfile.ts file is well formed without having to run the program...

Thoughts?

Commands undetected when running with global binary

When running makfy from the global binary, the list of commands will always be empty. I looked at the code and it appears the global makfy installation requires the local makfyfile.(js|ts), which in turn requires the local makfy installation. So the global makfy installation is never actually required by it and no commands are registered on it.

This might be fixable with something like intercepting require calls to the local makfy installation and re-routing them to whichever instance is handling the current CLI call. Or maybe even requiring the local makfy installation and copying its commands back to the global one.

Cannot use two setEnvVars in one exec

when I run

			await exec(
				util.setEnvVar('NODE_ENV', 'development'),
				args.inspect ? util.setEnvVar('DEBUG_SERVER', 'true') : null,
				// TODO find a wp plugin that clears the output dir before writing
				`rimraf ${buildPath}`,
				`webpack --config ${wpConfPath} --watch --color`
			)

with the --inspect arg given, I get the error [ERROR] only one command can be run at the same time. Without --inspect it works fine.

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.