About Monkey 2 › Forums › Monkey 2 Development › Monkey Package Manager
Tagged: package manager
This topic contains 7 replies, has 3 voices, and was last updated by 
 Tibit 3 years ago.
- 
		AuthorPosts
 - 
		
			
				
March 31, 2016 at 9:54 pm #615
I’m hyped about monkey2 getting a nice package manager.
Been using npm a lot, and for me it is day and night compared to how it was in monkey 1.
@Mark, have you seen it? I am curious to hear your thoughts on package managers.
April 1, 2016 at 2:00 am #623All I know about npm is that it broke the internet recently! But that page is interesting, I’ll definitely take a closer look at it.
I’ve vaguely been thinking about implementing something similar to haxelib…
…but I’m not sure how that deals with version conflicts.
I kind of like how macos frameworks do it – there’s just top-level ‘VersionA’, ‘VersionB’ etc. subdirs inside each framework. Simple but effective.
April 1, 2016 at 8:54 pm #646Seems to be quite similar.
This was a fun read, did not know, how-one-programmer-broke-the-internet-by-deleting-a-tiny-piece-of-code/, everything in web development does seem to have a dependancy to npm these days
Seems Macos also use semver version notation, and seems npm does similar with sub-dir but only when there is version conflicts. So in the form of X.Y.Z, changes in Y has non breaking API changes or API additions, Z never breaks but include bug fixes and X is breaking current API calls. So if I want a more stable build I could listen for version 0.* which is fairly intuitive.
So in npm versioning the way I get it. An module has a package.json file, something like this:
JavaScript12345678910111213{"name": "nucleus-gamestudio","productName": "Nucleus Game Studio","identifier": "com.tibitinteractive.nucleus-game-studio","description": "A game developer friendly code editor for Monkey 2.","version": "0.2.0","author": "Tibit","copyright": "© 2016, Tibit Interactive","main": "background.js","dependencies": {"fs-jetpack": "^0.7.0"}}All modules to the App are found in a app/modules folder, and the modules get there by typing “npm install or npm update” and the modules folder is then updated to match my package.json file (which is the default name if none is specified). This is the same process when I clone from github. git clone && npm install. However I rarly manually edit the package.json in order to install packages.
Then if I find a npm module I like on the internet the how to install usually looks like:
Install the electron command globally in your $PATH
npm install electron-prebuilt -gWhich downloads the module to the apps local /module/ folder or with -g the global /modules/ folder and any dependancies that this module needs that I do not already have in my local module folder. I think that only if a module in it’s package.json depends on an older version that one currently have that it adds it as a “sub-module” to that module.
I guess you are able to device more cleaver solutions more specific to monkey 2.
Local and sub-module versioning seems to relieve the dependancy-fear that a module used might get a breaking API update, might avoid the feeling that you “should” inline code instead of using a proper module.
I also used meteor(meteor.com)’s package manager which has an even simpler interface:
meteor add author:package <– download and compile package
meteor remove author:package meteor <– compiles and starts local dev server if the local folder contains a .meteor folder where all modules and build stuff is in
meteor deploy your-app.com –settings production-settings.json
meteor add-platform ios <– build an app
meteor run iosWhat I hope at the end of the day is just a simple command-tool, so the editor can provide an really user friendly interface for easily finding, installing and removing modules + docs + examples which I think could be a key piece of building a flourishing monkey2 community.
April 1, 2016 at 8:57 pm #647Owff seems codeboxes are not working, but they where in preview! Let me know if there is something I missed.
April 3, 2016 at 9:55 pm #729
AnonymousOwff seems codeboxes are not working,
Hopefully fixed now!
April 3, 2016 at 10:32 pm #735Maybe there is a timeout on edits, I cannot find any edit link now.
April 3, 2016 at 11:14 pm #736Ok, found the time limit on edits setting and changed it to 999999.
Not sure if it works retroactively though – can you edit now?
Look like it’ll take me a while to get the forums ‘tuned’. Still way better than having to write them myself!
April 4, 2016 at 9:19 pm #743Solved, I can edit now!
 - 
		AuthorPosts
 
You must be logged in to reply to this topic.