How to get started

97 views
Skip to first unread message

Vic Cekvenich

unread,
Jun 30, 2012, 9:41:37 AM6/30/12
to ja...@googlegroups.com
Hi,
I'm trying to figure out how to add a 'package', ex: moo-tools or my own app.js.

Lets say I have a function console.log('bla'); 
and I make the package.json and point 'main' property to http://localhost:8000/libs/myapp/myapp.js
with package.json in the same folder as myapp.js. Is that right?

I don't plan to use node.js for http server if that makes a difference.

Vic

Caolan McMahon

unread,
Jun 30, 2012, 2:37:43 PM6/30/12
to ja...@googlegroups.com
The "main" property is supposed to point to the file relative to the
package directory on disk. So if you have package.json in the same
directory as myapp.js, then main would just be "myapp.js". See the
documentation on Developing packages for more information:
http://jamjs.org/docs#Developing_packages - if you think anything is
missing then let me know :)
> --
> You received this message because you are subscribed to the Google Groups
> "jamjs" group.
> To view this discussion on the web, visit
> https://groups.google.com/d/msg/jamjs/-/7JUsxgaWY7wJ.
> To post to this group, send an email to ja...@googlegroups.com.
> To unsubscribe from this group, send email to
> jamjs+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/jamjs?hl=en-GB.

Jesse House

unread,
Aug 26, 2012, 4:22:44 PM8/26/12
to ja...@googlegroups.com
I found the publishing process a little painful (jamjs newbie), 
- if package.json is invalid get some very cryptic error messages
- if the file paths in jam/main and jam/include are invalid, it does not warn or error and publishes anyhow
- typing password every time you publish hurts for people using password managers

in my case I already have a 'build' step which puts my published js in a release directory
- minified with version number in the file name
- non-mini with version number in the file name

some things I was unclear on
- should I publish minified version or standard?
- best way to handle directory structures for the jam main and include configuration

after reading the 'production compilation' i figured out the best way to publish was standard, non-minified
might want to include a note on that in the publishing section?

I have my package.json file in the root of my code base and reference the release directory, so when you install it via jamjs
it will have that same nested structure, i guess it doesn't really matter, maybe I should have put my package.json in the release directory as well?
seems like a source -> target syntax might be nice?
jam: main: { source: "release/xxxxx-v1.2.3.js", target: "xxxxx.js" }

i don't know if you'll get much out of this feedback but figured I might as well pass it on

Cheers,
- Jesse
Reply all
Reply to author
Forward
0 new messages