Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions machines/parse-machinepack-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <marty@mcfly.com>',
nodeMachineUrl: 'http://node-machine.org/machinepack-foo',
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -181,6 +191,7 @@ module.exports = {
return exits.notMachinepack();
}


return exits.success(machinepack);
},

Expand Down
3 changes: 3 additions & 0 deletions machines/read-package-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <marty@mcfly.com>',
nodeMachineUrl: 'http://node-machine.org/machinepack-foo',
Expand Down