Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Here is builder in nodejs #93

Closed
bmatusiak opened this issue May 14, 2013 · 11 comments
Closed

Here is builder in nodejs #93

bmatusiak opened this issue May 14, 2013 · 11 comments

Comments

@bmatusiak
Copy link

https://gist.github.com/bmatusiak/5578424

@liverbool
Copy link

small add for build by packages you want.
https://gist.github.com/liverbool/6256341

@bmatusiak
Copy link
Author

cool!

@bmatusiak
Copy link
Author

i few more tweaks and we can add this to a PR 😄

@kvz
Copy link
Collaborator

kvz commented Aug 17, 2013

I'd probably accept a builder in ./_tools/bundler/bundler.js as a pr. But if you do decide to pr, please make sure the coding standards are applied, and use an npm like cli so it's behavior can be easily controlled via commandline arguments. Putting it in a subdir also allows having a dedicated package.json to declare it's dependencies.

@bmatusiak
Copy link
Author

sounds good! my thoughts exactly...
coding standards errors show up in my IDE so thats not a problem,

i do need to add a proper header.

but when you say npm like cli can you give me a better idea on how you want it because theres about 2 or 3 different ways it can be done

ex

npm install
bundler --out PHPJS.js

let me know if this is what you want above

@bmatusiak
Copy link
Author

also if you can give me a short list of arguments you want to use that would be good too

@kvz
Copy link
Collaborator

kvz commented Aug 17, 2013

I used cli here and kinda liked it, could be worth checking out for argument parsing, progress animations, etc. It's got a lot of cool cli stuff built in.

as for the options, i noticed you guys already made it optional to minify, and to include different categories. so maybe. it would also be cool if you can choose export format.

 --include array/*
 --include var/is_array
 --exclude array/array_uintersect_uassoc
 --minify
 --format commonjs | globalscope | object
 --output <filename> | - for STDOUT 

I realise it's much, but just consider it as ideas you can use.

One other thing to consider that just popped into my head. Maybe grunt can do the heavy lifting here. It seems to be the bundler of choice nowadays, and I would not be surprised if we can just put this in one Gruntfile.js..

@liverbool
Copy link

++1

// declare dependencies with this format: [package,package.name]
--include [array,datetime,...]
--exclude [array,var.is_array,var.is_object]

@bmatusiak
Copy link
Author

i was going to use var argv = require('optimist').argv; for argument parsing

--out    =    argv.out;

or

-o     =    argv.o;

and then ill resubmit a updated gist..

and show you what i come up with

@liverbool
Copy link

ok, up to you and thanks for make my life easy.
👍

@kvz
Copy link
Collaborator

kvz commented Feb 7, 2014

Hey, we support npm now through https://npmjs.org/phpjs.

You can build your own via

node bin/phpjs.js --action buildnpm --output build/npm.js
# or
node bin/phpjs.js --action buildnpm --output build/php_string.js --category strings

@kvz kvz closed this as completed Feb 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants