cujojs / curl

curl.js is small, fast, extensible module loader that handles AMD, CommonJS Modules/1.1, CSS, HTML/text, and legacy scripts.
https://github.com/cujojs/curl/wiki
Other
1.88k stars 216 forks source link

base.js 404 after upgrading 0.5.3 to 0.6.2 #64

Closed dizzib closed 12 years ago

dizzib commented 12 years ago

After upgrade from 0.5.3 to 0.6.2 curl.js tries to load wire's base.js from the same path as curl.js resulting in a 404. I can fix this by moving wire.js into the \wire folder but is there a better solution ? Here's my curl config...

curl = { baseUrl: '/', pluginPath: 'library/thirdparty/curl/plugin', paths: { curl: 'library/thirdparty/curl', when: 'library/thirdparty/when' }, packages: [ { name: 'aop', path: 'library/thirdparty', main: 'wire', lib: 'aop' }, { name: 'wire', path: 'library/thirdparty', main: 'wire', lib: 'wire' } ] };

Cheers! Andy.

unscriptable commented 12 years ago

Hey @dizzib!

There were some subtle "improvements" to package specs in 0.6.x. It's now more consistent with the package.json proposal. Try this:

curl = {
    baseUrl: '/',
    pluginPath: 'library/thirdparty/curl/plugin',
    paths: {
        curl: 'library/thirdparty/curl',
        when: 'library/thirdparty/when'
    },
    packages: [
        { name: 'aop', path: 'library/thirdparty/aop', main: 'wire', lib: '.' },
        { name: 'wire', path: 'library/thirdparty/wire', main: 'wire', lib: '.' }
    ]
};

Sorry if this caused some confusion.

-- John

dizzib commented 12 years ago

Hi John,

Thanks for your quick reply which turned out to be nearly correct :-)

I got it to work by following your lead and changing the packages section to this...

packages: [
        { name: 'wire', path: 'library/thirdparty/wire', main: '.\wire', lib: '.' }
]

Thanks once again for your help! Andy.

unscriptable commented 12 years ago

Oops. I blindly "corrected" your config. ...and by "corrected", I mean "made worse". :)

Try this one:

curl = {
    baseUrl: '/',
    pluginPath: 'library/thirdparty/curl/plugin',
    paths: {
        curl: 'library/thirdparty/curl',
        when: 'library/thirdparty/when'
    },
    packages: [
        { name: 'aop', location: 'library/thirdparty/aop', main: '.' },
        { name: 'wire', location: 'library/thirdparty/wire', main: '..' }
    ]
};

When should probably be a package (like aop) if you're using it's other modules, fwiw.

-- John

unscriptable commented 12 years ago

I see our messages crossed :).

Two notes:

"lib" is obsolete. I need to update the docs. :/

".\wire" should be "./wire". I assume that was just a typo. :)

-- John

dizzib commented 12 years ago

Hmm, this gives a 404 on /library.js...

{ name:'wire', path:'library/thirdparty/wire', main:'..' }

However the following works nicely...

{ name:'wire', path:'library/thirdparty/wire', main:'./wire' }

Cheers!