diff --git a/machines/parse-machinepack-metadata.js b/machines/parse-machinepack-metadata.js index 56f09f6..be83b16 100644 --- a/machines/parse-machinepack-metadata.js +++ b/machines/parse-machinepack-metadata.js @@ -32,6 +32,9 @@ module.exports = { iconSrc: 'http://machinepack-facebook.org/icon.png', version: '0.1.1', keywords: ['machine'], + private: false, + registry: 'http://npmjs.org', + usesPublicRegistry: true, latestVersionPublishedAt: '2015-01-19T22:26:54.588Z', author: 'Marty McFly ', nodeMachineUrl: 'http://node-machine.org/machinepack-foo', @@ -90,6 +93,9 @@ module.exports = { machinepack.npmUrl = _npmMetadata.npmUrl; machinepack.contributors = _npmMetadata.contributors; machinepack.dependencies = _npmMetadata.dependencies; + machinepack.private = _npmMetadata.private; + machinepack.registry = _npmMetadata.registry; + machinepack.usesPublicRegistry = _npmMetadata.usesPublicRegistry; // Then parse the raw json to extract the `machinepack` property. var _data; @@ -144,9 +150,13 @@ module.exports = { catch (e){ return []; } })(); - // Build docs url. - machinepack.nodeMachineUrl = util.format('http://node-machine.org/%s', machinepack.identity); - machinepack.docsUrl = machinepack.nodeMachineUrl; + // Build docs url for public packages. + if (!machinepack.private && machinepack.usesPublicRegistry) { + machinepack.nodeMachineUrl = util.format('http://node-machine.org/%s', + machinepack.identity + ); + machinepack.docsUrl = machinepack.nodeMachineUrl; + } // Extract more metadata from the `machinepack` property in the package.json data. machinepack.extendedDescription = latestVersion.machinepack.extendedDescription; @@ -181,6 +191,7 @@ module.exports = { return exits.notMachinepack(); } + return exits.success(machinepack); }, diff --git a/machines/read-package-json.js b/machines/read-package-json.js index 18208c3..40f000b 100644 --- a/machines/read-package-json.js +++ b/machines/read-package-json.js @@ -30,6 +30,9 @@ module.exports = { iconSrc: 'http://machinepack-facebook.org/icon.png', version: '0.1.1', keywords: ['machine'], + private: false, + registry: 'http://npmjs.org', + usesPublicRegistry: false, latestVersionPublishedAt: '2015-01-19T22:26:54.588Z', author: 'Marty McFly ', nodeMachineUrl: 'http://node-machine.org/machinepack-foo',