danzen / zimjs

ZIM JavaScript Canvas Framework - Code Creativity! Interactive Media For All.
Other
507 stars 47 forks source link

Add to NPM #8

Closed brianbest closed 4 years ago

brianbest commented 7 years ago

Hey @danzen can you add Zim to npmjs registry?

danzen commented 7 years ago

Sure... it will be zimjs - just created an organization...

brianbest commented 7 years ago

Woot! On Mon, May 1, 2017 at 1:13 PM Dan Zen notifications@github.com wrote:

Sure... it will be zimjs - just created an organization...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/danzen/zimjs/issues/8#issuecomment-298364315, or mute the thread https://github.com/notifications/unsubscribe-auth/AB-iPMKKi4ThaC_utQbdZWNgKDm_x_D_ks5r1gS1gaJpZM4NDbif .

danzen commented 7 years ago

Just started the package... continuing to work through details.

neo commented 6 years ago

@danzen let me know if you need help with this 😬

danzen commented 6 years ago

Sure @neo I will message you on the FB...

danzen commented 6 years ago

Okay - we have a plan for the new year... for ZIM HEP (7).

danzen commented 6 years ago

Hi @brianbest, @neo has been working on this a little - would you like to take a look https://github.com/danzen/zimjs/compare/master...neo:master and offer any suggestions. He says there is still work to do and points to an issue that CreateJS is not set up either - CreateJS 2 apparently will be. We are trying to make it so that ZIM can still function the way it does now with script tags to the libraries - or be brought in with includes, etc. Any recommendations or even a confirmation that it works... would be great! Thanks and hope all is well!

neo commented 6 years ago

another solution would be we wait for createjs to support npm first as zim depends on createjs anyway

josiahbryan commented 5 years ago

Any progress on this? Can I npm install zimjs yet?

josiahbryan commented 5 years ago

createjs is on npm ... https://www.npmjs.com/package/createjs

danzen commented 5 years ago

Thanks @josiahbryan - will see what we can do for version 10 due out in a beta hopefully this week.

wutschkef42 commented 5 years ago

@danzen Hi Dan, I also really need zim on npm.. It would be great if you could make that happen for version 10 :)

danzen commented 5 years ago

Well... got stalled again - I just don't understand this stuff. It seems like the CreateJS version on NPM just lets you download all the CDN files - and is not in a module format. So, when I try and do a test page, it does not know how to import CreateJS. So should we be trying to do the same - just let NPM give you the latest ZIM file - not in module format? And you would still use script tags on your main file to bring in CreateJS and ZIMjs? If anyone has any advice that would be great. I have a message out to @neo but I know he is busy with a very active job...

neo commented 5 years ago

This is hard if not impossible as I don't think the dependency createjs is done the right way on npm.

neo commented 5 years ago

so we would either need to do a fork of createjs and fix it on their side first, or wait until they fix their npm implementation.

danzen commented 5 years ago

Perhaps someone can confirm that the CreateJS npm is not giving us what we need - from the looks of it... that was my conclusion but I could be wrong. If I could get a confirmation... then perhaps working through that on their github would help.

neo commented 5 years ago

the line before this mentions that it "can not yet be used with RequireJS, CommonJS, etc." and I think this issue also kinda describe the problem, not 100% sure if that's the problem tho: https://github.com/CreateJS/Combined/issues/12

danzen commented 5 years ago

Is it worth it to anyone to have a ZIM npm that just gives you the CDN version? I don't think so, I mean, I would rather not have to update another location just for that... so the advice would be to work with CreateJS to get them in proper format - and NEO, is that what you started to do by forking CreateJS, etc. did you feel you got it into a format that actually worked? When I tried to run the code you put together, I don't think I got it working....

danzen commented 5 years ago

Had an idea... we like to run our CreateJS anyway because we have some current things in there not on their CDN - so... why don't we adjust CreateJS so it can be read like a module and ZIM so it can be read like a module and include them both in the same NPM as they have to work together anyway. Does that sound like a good plan?

danzen commented 5 years ago

Okay.. ZIMjs is on NPM as a test. npm install zimjs It makes its dependency @danzen/createjs and both are running as modules but each is just running a test function. I am now planning on putting all of ZIM and all of Createjs in place of the zim and createjs test objects. When I tried, I could not run from node because there is no window and no console, etc. So my question is... once it gets browersfied, or whatever will it all work? I have some global functions like zog() and zid() - since they are not stored on the zim object I suspect they will not work? Is there a work around? I also use them in hundreds of places inside ZIM as global functions. Thoughts? I guess the answer is reprogram them - now that we use ZIM without the namespace, the same system would still let them be global.

danzen commented 5 years ago

ZIM is on NPM. Was able to get it running using Browserify. Here are the steps:

Using ZIM with NPM and Browserify http://browserify.org/

Assuming NodeJS installed with NPM. https://nodejs.org/

Open Node command prompt and get Browserify: npm install -g browserify Marvel at the 139 packages used to make Browserify - arrrg.

Get ZIM (which gets CreateJS too) npm install -g zimjs

Change to the node_modules/zimjs/ directory and: browserify code.js -o bundle.js

run code.html in browser

ajerni commented 5 years ago

Can we use ZIM as a React component now? For example wit Gatsby.js etc.

danzen commented 5 years ago

Hi @ajerni - I am not sure - please try it if you have a moment and let us know. We had a some people using ZIM with React and they got it working. If you want, you are welcome to come in to https://zimjs.com/slack and ask the folks. We would love to have you there!

ajerni commented 5 years ago

Here is what I try to do: https://github.com/ajerni/gatsby-zim

danzen commented 5 years ago

Excellent presentation... will have a look - it would be cool to get ZIM working with PWA.

iyobo commented 4 years ago

I still don't think zim is a clean npm module at the moment given the need for some of those manual build steps. I would suggest perhaps putting all necessary build steps into a postinstall script to make the zim install process seamless and just work like most mature npm modules.

danzen commented 4 years ago

@iyobo - that would be great - just not sure what is supposed to happen. For those that work with node it is probably a simple thing so you are welcome to let us know what to do. Let us know if we can help in any way. If you want to work "off-line" with us... we have a Slack channel at https://zimjs.com/slack and a #technology topic that we can add you to. Cheers.

danzen commented 1 year ago

We have now updated our npm to be more robust. https://www.npmjs.com/package/zimjs. There is now a repo of templates for Vue, Svelte, React and Angular here https://github.com/yoanhg421/zimjs-templates