Comparing version 5.2.0-rc.9 to 5.2.0-rc.10
72
cli.js
@@ -7,6 +7,7 @@ 'use strict'; | ||
var inquirer = _interopDefault(require('inquirer')); | ||
var libLicenseTools = require('@pagedip/lib-license-tools'); | ||
var name = "pagedip"; | ||
var version = "5.2.0-rc.9"; | ||
var version = "5.2.0-rc.10"; | ||
@@ -21,2 +22,4 @@ var main$1 = "Usage: pagedip <command> [--debug] [--silent] [--dev] [--help]\n [--version]\n\n The Pagedip CLI tool.\n\nCommands\n register Register this host with a Pagedip License key.\n install Install a Pagedip package by name.\n run Run a Pagedip app.\n start, server, ee Start a basic Pagedip Enterprise server.\n\n This is the main Pagedip CLI tool. With this tool you can install Pagedip\n packages, run servers, and more.\n\n The following app names can be used as commands directly: api, auth,\n couchdb-setup, editor, enterprise-edition, live, setup, theme, theme-server\n\n Run --help on any command for further help documentation.\n\nOptions\n --debug Show debug messages.\n -s, --silent All logs will be hidden.\n --dev Run in development mode.\n -h, -H, --help Shows this message.\n -v, -V, --version Prints the version and exits."; | ||
var license$1 = "Usage: pagedip license [license] [--help]\n\n Verify and print information about a Pagedip license key.\n\n This will verify a license key and print some basic information about it. If\n you do not pass a license key, this will display info on the installed key.\n\nOptions\n -h, -H, --help Shows this message."; | ||
var apps = [".babelrc", ".template", "api", "auth", "couchdb-setup", "editor", "enterprise-edition", "live", "setup", "theme", "theme-server"]; | ||
@@ -168,2 +171,26 @@ | ||
var _extends = Object.assign || function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
var install = function () { | ||
@@ -176,3 +203,3 @@ var _ref2 = asyncToGenerator(function* (args, config, logger) { | ||
yield require("./").install(args, { logger: logger }); | ||
yield require("./").install(args, _extends({}, config.data, { logger: logger })); | ||
}); | ||
@@ -224,4 +251,20 @@ | ||
var license = function () { | ||
var _ref5 = asyncToGenerator(function* (args, config, logger) { | ||
if (this.help()) { | ||
logger.info(license$1); | ||
return; | ||
} | ||
var data = yield libLicenseTools.verify(libLicenseTools.getLicense(args[0])); | ||
printLicense(data, logger); | ||
}); | ||
return function license(_x10, _x11, _x12) { | ||
return _ref5.apply(this, arguments); | ||
}; | ||
}(); | ||
var register = function () { | ||
var _ref5 = asyncToGenerator(function* (args, config, logger) { | ||
var _ref6 = asyncToGenerator(function* (args, config, logger) { | ||
if (!args.length || this.help()) { | ||
@@ -232,7 +275,10 @@ logger.info(register$1); | ||
yield require("./").register(args[0]); | ||
var data = yield libLicenseTools.verifyInstall(args[0]); | ||
logger.log(""); | ||
printLicense(data, logger); | ||
logger.log(logger.color.green("Thank you for registering! You can now download and use Pagedip packages. \uD83C\uDF89\n")); | ||
}); | ||
return function register(_x10, _x11, _x12) { | ||
return _ref5.apply(this, arguments); | ||
return function register(_x13, _x14, _x15) { | ||
return _ref6.apply(this, arguments); | ||
}; | ||
@@ -242,3 +288,6 @@ }(); | ||
var cli = command("pagedip", { | ||
module: module | ||
module: module, | ||
alias: { | ||
tag: "t" | ||
} | ||
}, function () { | ||
@@ -266,2 +315,6 @@ var _ref = asyncToGenerator(function* (args, config, logger) { | ||
case "license": | ||
yield license.call(this, args.slice(1), config, logger); | ||
break; | ||
case "start": | ||
@@ -290,2 +343,7 @@ case "server": | ||
function printLicense(data, logger) { | ||
logger.log("%s\nID: %s\nRegistered To: %s\nIssued: %s\nExpires: %s", logger.color.white.bgGreen("Valid Pagedip license key."), data.id, data.user, new Date(data.issued).toString(), new Date(data.ttl).toString()); | ||
logger.log("\n%s\n", data.payload); | ||
} | ||
module.exports = cli; |
23
index.js
@@ -10,6 +10,2 @@ 'use strict'; | ||
var resolve__default = _interopDefault(resolve); | ||
var fs = _interopDefault(require('mz/fs')); | ||
var child_process = require('mz/child_process'); | ||
var libRc = require('@pagedip/lib-rc'); | ||
var path = require('path'); | ||
@@ -203,2 +199,8 @@ var asyncGenerator = function () { | ||
if (opts.tag) { | ||
pkgs = pkgs.map(function (p) { | ||
return p + "@" + opts.tag; | ||
}); | ||
} | ||
if (opts.logger) opts.logger.debug("Installing packages '%s'", pkgs); | ||
@@ -242,16 +244,3 @@ | ||
var register = (function () { | ||
var _ref = asyncToGenerator(function* (license) { | ||
yield fs.writeFile(path.join(libRc.globalPath, ".pdlicense"), license); | ||
yield child_process.exec("npm config set @pagedip:registry https://license.system.pagedip.com/npm"); | ||
yield child_process.exec("npm config set //license.system.pagedip.com/:_authToken " + license); | ||
}); | ||
return function (_x) { | ||
return _ref.apply(this, arguments); | ||
}; | ||
})(); | ||
exports.install = install; | ||
exports.load = load; | ||
exports.register = register; |
@@ -5,3 +5,3 @@ { | ||
"public": true, | ||
"version": "5.2.0-rc.9", | ||
"version": "5.2.0-rc.10", | ||
"author": "Tyler Johnson <tyler@beneaththeink.com>", | ||
@@ -29,6 +29,6 @@ "repository": { | ||
"@pagedip/lib-rc": "^1.0.0-rc.6", | ||
"@pagedip/lib-license-tools": "^1.0.0-rc.0", | ||
"@pagedip/util-resolve": "^1.0.0-rc.4", | ||
"@pagedip/util-npm": "^1.0.0-rc.0", | ||
"inquirer": "^3.1.1", | ||
"mz": "^2.7.0", | ||
"npm-cli-path": "^2.0.0" | ||
@@ -47,3 +47,3 @@ }, | ||
], | ||
"gitHead": "ce3fa13eca8a4eb4e82e0890ae9889b961d8fec0" | ||
"gitHead": "0acb0cdefc94b9a4ae48367fa3cfcb8aee0e72d4" | ||
} |
16667
460
+ Added@pagedip/lib-license-errors@2.1.0(transitive)
+ Added@pagedip/lib-license-tools@1.4.0(transitive)
+ Added@pagedip/lib-rc@2.1.23(transitive)
+ Added@pagedip/util-error@2.0.17(transitive)
+ Added@pagedip/util-merge-plain-objects@2.1.6(transitive)
+ Added@types/body-parser@1.19.5(transitive)
+ Added@types/connect@3.4.38(transitive)
+ Added@types/express@4.17.21(transitive)
+ Added@types/express-serve-static-core@4.19.5(transitive)
+ Added@types/http-errors@2.0.4(transitive)
+ Added@types/mime@1.3.5(transitive)
+ Added@types/node@22.5.0(transitive)
+ Added@types/qs@6.9.15(transitive)
+ Added@types/range-parser@1.2.7(transitive)
+ Added@types/send@0.17.4(transitive)
+ Added@types/serve-static@1.15.7(transitive)
+ Addeddebug@4.3.6(transitive)
+ Addedfast-safe-stringify@2.1.1(transitive)
+ Addedfind-up@4.1.0(transitive)
+ Addedform-data@3.0.1(transitive)
+ Addedlocate-path@5.0.0(transitive)
+ Addedmime@2.6.0(transitive)
+ Addedms@2.1.2(transitive)
+ Addedp-limit@2.3.0(transitive)
+ Addedp-locate@4.1.0(transitive)
+ Addedp-try@2.2.0(transitive)
+ Addedpath-exists@4.0.0(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedsemver@7.6.3(transitive)
+ Addedsuperagent@5.3.1(transitive)
+ Addedtoml@3.0.0(transitive)
+ Addedtslib@1.14.1(transitive)
+ Addedundici-types@6.19.8(transitive)
- Removedmz@^2.7.0
- Removedaproba@2.0.0(transitive)
- Removedsafe-buffer@5.2.1(transitive)