Comparing version 0.3.0-beta.1 to 0.3.0
@@ -8,3 +8,3 @@ "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _chunkrYQnmsKjs = require('./chunk.r-YQnmsK.js'); | ||
var _chunknPjYlWVAjs = require('./chunk.nPjYlWVA.js'); | ||
@@ -162,3 +162,3 @@ // src/log.ts | ||
function check2(options) { | ||
return _chunkrYQnmsKjs.__async.call(void 0, this, [], function* () { | ||
return _chunknPjYlWVAjs.__async.call(void 0, this, [], function* () { | ||
const logger = new TableLogger({ | ||
@@ -173,3 +173,4 @@ columns: 7, | ||
const depBar = bars.create(1, 0); | ||
yield _chunkrYQnmsKjs.CheckPackages.call(void 0, options, { | ||
let hasChanges = false; | ||
yield _chunknPjYlWVAjs.CheckPackages.call(void 0, options, { | ||
afterPackagesLoaded(pkgs) { | ||
@@ -187,2 +188,4 @@ packagesBar = options.recursive ? bars.create(pkgs.length, 0, {type: _chalk2.default.cyan("pkg")}) : null; | ||
const changes = resolved.filter((i) => i.update); | ||
if (changes.length) | ||
hasChanges = true; | ||
printChanges(pkg, changes, relative, logger); | ||
@@ -192,6 +195,2 @@ }, | ||
depBar.update(progress, {name}); | ||
}, | ||
afterPackageWrite() { | ||
logger.log(_chalk2.default.yellow("changes wrote to package.json")); | ||
logger.log(); | ||
} | ||
@@ -204,4 +203,8 @@ }); | ||
logger.log(`Run ${_chalk2.default.cyan("taze major")} to check major updates`); | ||
logger.log(`Run ${_chalk2.default.green("taze -w")} to write package.json`); | ||
if (hasChanges) | ||
logger.log(`Run ${_chalk2.default.green("taze -w")} to write package.json`); | ||
logger.log(); | ||
} else if (hasChanges) { | ||
logger.log(_chalk2.default.yellow(`changes wrote to package.json, run ${_chalk2.default.cyan("npm i")} to install updates.`)); | ||
logger.log(); | ||
} | ||
@@ -217,3 +220,3 @@ logger.output(); | ||
} else { | ||
changes.forEach(({name, currentVersion, targetVersion: latestVersion, source, currentVersionTime, targetVersionTime}) => logger.row(` ${name}`, _chalk2.default.gray(_chunkrYQnmsKjs.DependenciesTypeShortMap[source]), timeDifference(currentVersionTime), _chalk2.default.gray(currentVersion), _chalk2.default.gray("โ"), colorizeDiff(currentVersion, latestVersion), timeDifference(targetVersionTime))); | ||
changes.forEach(({name, currentVersion, targetVersion: latestVersion, source, currentVersionTime, targetVersionTime}) => logger.row(` ${name}`, _chalk2.default.gray(_chunknPjYlWVAjs.DependenciesTypeShortMap[source]), timeDifference(currentVersionTime), _chalk2.default.gray(currentVersion), _chalk2.default.gray("โ"), colorizeDiff(currentVersion, latestVersion), timeDifference(targetVersionTime))); | ||
const counters = {}; | ||
@@ -255,5 +258,5 @@ changes.forEach(({diff: diff2}) => { | ||
function CheckUsages(options, callbacks = {}) { | ||
return _chunkrYQnmsKjs.__async.call(void 0, this, [], function* () { | ||
return _chunknPjYlWVAjs.__async.call(void 0, this, [], function* () { | ||
var _a; | ||
const packages4 = yield _chunkrYQnmsKjs.loadPackages.call(void 0, options); | ||
const packages4 = yield _chunknPjYlWVAjs.loadPackages.call(void 0, options); | ||
const names = {}; | ||
@@ -273,5 +276,5 @@ for (const pkg of packages4) { | ||
const total = usages.length; | ||
const resolveUsages = yield Promise.all(usages.map(({name, versionMap}) => _chunkrYQnmsKjs.__async.call(void 0, this, [], function* () { | ||
const resolveUsages = yield Promise.all(usages.map(({name, versionMap}) => _chunknPjYlWVAjs.__async.call(void 0, this, [], function* () { | ||
var _a2; | ||
const {tags} = yield _chunkrYQnmsKjs.getPackageData.call(void 0, name); | ||
const {tags} = yield _chunknPjYlWVAjs.getPackageData.call(void 0, name); | ||
progress += 1; | ||
@@ -288,3 +291,3 @@ (_a2 = callbacks.onDependencyResolved) == null ? void 0 : _a2.call(callbacks, null, name, progress, total); | ||
function usage2(options) { | ||
return _chunkrYQnmsKjs.__async.call(void 0, this, [], function* () { | ||
return _chunknPjYlWVAjs.__async.call(void 0, this, [], function* () { | ||
const bars = createMultiProgresBar(); | ||
@@ -374,3 +377,3 @@ console.log(); | ||
}).demandOption("recursive", _chalk2.default.yellow("Please add -r to analysis usages")); | ||
}, (args) => usage2(_chunkrYQnmsKjs.__assign.call(void 0, _chunkrYQnmsKjs.__assign.call(void 0, {}, args), {recursive: true}))).command("* [mode]", "Keeps your deps fresh", (args) => { | ||
}, (args) => usage2(_chunknPjYlWVAjs.__assign.call(void 0, _chunknPjYlWVAjs.__assign.call(void 0, {}, args), {recursive: true}))).command("* [mode]", "Keeps your deps fresh", (args) => { | ||
return commonOptions(args).positional("mode", { | ||
@@ -377,0 +380,0 @@ default: "default", |
@@ -8,3 +8,3 @@ import { | ||
loadPackages | ||
} from "./chunk.r-YQnmsK.js"; | ||
} from "./chunk.nPjYlWVA.js"; | ||
@@ -172,2 +172,3 @@ // src/log.ts | ||
const depBar = bars.create(1, 0); | ||
let hasChanges = false; | ||
yield CheckPackages(options, { | ||
@@ -186,2 +187,4 @@ afterPackagesLoaded(pkgs) { | ||
const changes = resolved.filter((i) => i.update); | ||
if (changes.length) | ||
hasChanges = true; | ||
printChanges(pkg, changes, relative, logger); | ||
@@ -191,6 +194,2 @@ }, | ||
depBar.update(progress, {name}); | ||
}, | ||
afterPackageWrite() { | ||
logger.log(chalk4.yellow("changes wrote to package.json")); | ||
logger.log(); | ||
} | ||
@@ -203,4 +202,8 @@ }); | ||
logger.log(`Run ${chalk4.cyan("taze major")} to check major updates`); | ||
logger.log(`Run ${chalk4.green("taze -w")} to write package.json`); | ||
if (hasChanges) | ||
logger.log(`Run ${chalk4.green("taze -w")} to write package.json`); | ||
logger.log(); | ||
} else if (hasChanges) { | ||
logger.log(chalk4.yellow(`changes wrote to package.json, run ${chalk4.cyan("npm i")} to install updates.`)); | ||
logger.log(); | ||
} | ||
@@ -207,0 +210,0 @@ logger.output(); |
@@ -12,3 +12,3 @@ import { | ||
writePackage | ||
} from "./chunk.r-YQnmsK.js"; | ||
} from "./chunk.nPjYlWVA.js"; | ||
@@ -15,0 +15,0 @@ // src/index.ts |
@@ -12,3 +12,3 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkrYQnmsKjs = require('./chunk.r-YQnmsK.js'); | ||
var _chunknPjYlWVAjs = require('./chunk.nPjYlWVA.js'); | ||
@@ -27,2 +27,2 @@ // src/index.ts | ||
exports.CheckPackages = _chunkrYQnmsKjs.CheckPackages; exports.DependenciesTypeShortMap = _chunkrYQnmsKjs.DependenciesTypeShortMap; exports.dumpDependencies = _chunkrYQnmsKjs.dumpDependencies; exports.loadPackage = _chunkrYQnmsKjs.loadPackage; exports.loadPackages = _chunkrYQnmsKjs.loadPackages; exports.parseDependencies = _chunkrYQnmsKjs.parseDependencies; exports.resolveDependencies = _chunkrYQnmsKjs.resolveDependencies; exports.resolveDependency = _chunkrYQnmsKjs.resolveDependency; exports.resolvePackage = _chunkrYQnmsKjs.resolvePackage; exports.writePackage = _chunkrYQnmsKjs.writePackage; | ||
exports.CheckPackages = _chunknPjYlWVAjs.CheckPackages; exports.DependenciesTypeShortMap = _chunknPjYlWVAjs.DependenciesTypeShortMap; exports.dumpDependencies = _chunknPjYlWVAjs.dumpDependencies; exports.loadPackage = _chunknPjYlWVAjs.loadPackage; exports.loadPackages = _chunknPjYlWVAjs.loadPackages; exports.parseDependencies = _chunknPjYlWVAjs.parseDependencies; exports.resolveDependencies = _chunknPjYlWVAjs.resolveDependencies; exports.resolveDependency = _chunknPjYlWVAjs.resolveDependency; exports.resolvePackage = _chunknPjYlWVAjs.resolvePackage; exports.writePackage = _chunknPjYlWVAjs.writePackage; |
{ | ||
"name": "taze", | ||
"version": "0.3.0-beta.1", | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"module": "dist/esm/index.js", | ||
"typing": "dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"bin": { | ||
"taze": "bin/taze.js" | ||
}, | ||
"dependencies": { | ||
"chalk": "^4.1.0", | ||
"cli-progress": "^3.8.2", | ||
"fast-glob": "^3.2.4", | ||
"libnpmconfig": "^1.2.1", | ||
"pacote": "^11.1.11", | ||
"semver": "^7.3.2", | ||
"yargs": "^15.4.1" | ||
} | ||
"name": "taze", | ||
"version": "0.3.0", | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"module": "dist/esm/index.js", | ||
"typing": "dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"bin": { | ||
"taze": "bin/taze.js" | ||
}, | ||
"dependencies": { | ||
"chalk": "^4.1.0", | ||
"cli-progress": "^3.8.2", | ||
"fast-glob": "^3.2.4", | ||
"libnpmconfig": "^1.2.1", | ||
"pacote": "^11.1.11", | ||
"semver": "^7.3.2", | ||
"yargs": "^15.4.1" | ||
} | ||
} |
@@ -91,1 +91,5 @@ <h1 align="center">๐ฅฆ Taze <sup>๐๐๐๐๐</sup></h1> | ||
Great thanks to [@sinoon](https://github.com/sinoon) who helped a lot on having idea brainstroming and feedback discussion. | ||
## License | ||
MIT License ยฉ 2020 [Anthony Fu](https://github.com/antfu) |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
60827
12
1648
95
0