@typescript-tools/internal-dependencies
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [1.3.0](https://github.com/typescript-tools/typescript-tools/compare/@typescript-tools/internal-dependencies@1.2.0...@typescript-tools/internal-dependencies@1.3.0) (2021-01-17) | ||
### Features | ||
* add lock-internal-packages ([44e2ed1](https://github.com/typescript-tools/typescript-tools/commit/44e2ed1cebba3a02e48ca5c6bd9c67aa21b178ed)) | ||
# [1.2.0](https://github.com/typescript-tools/typescript-tools/compare/@typescript-tools/internal-dependencies@1.1.0...@typescript-tools/internal-dependencies@1.2.0) (2021-01-05) | ||
@@ -8,0 +19,0 @@ |
@@ -30,2 +30,3 @@ #!/usr/bin/env node | ||
const t = __importStar(require("io-ts")); | ||
const F = __importStar(require("fluture")); | ||
const A = __importStar(require("fp-ts/Array")); | ||
@@ -35,3 +36,3 @@ const E = __importStar(require("fp-ts/Either")); | ||
const Ord_1 = require("fp-ts/Ord"); | ||
const F = __importStar(require("fluture")); | ||
const PathReporter_1 = require("io-ts/lib/PathReporter"); | ||
const shades_1 = require("shades"); | ||
@@ -41,3 +42,2 @@ const ts_pattern_1 = require("ts-pattern"); | ||
const function_1 = require("fp-ts/function"); | ||
const error_1 = require("@typescript-tools/io-ts/dist/lib/error"); | ||
const dependency_graph_1 = require("@typescript-tools/dependency-graph"); | ||
@@ -65,4 +65,12 @@ const io_ts_docopt_1 = require("io-ts-docopt"); | ||
const unary = (f) => (a) => f(a); | ||
// Temporary helper to infer types, see https://github.com/fluture-js/Fluture/issues/455 | ||
function map(mapper) { | ||
return F.map(mapper); | ||
} | ||
// Widens the type of a particular Err into an Err | ||
const error = (error) => error; | ||
const decodeDocopt = (codec, docstring, options) => pipeable_1.pipe(io_ts_docopt_1.decodeDocopt(codec, docstring, options), E.mapLeft((err) => ({ type: 'docopt decode', err: PathReporter_1.PathReporter.report(E.left(err)).join('\n') })), E.map(options => F.resolve(options)), E.getOrElse(err => F.reject(err))); | ||
const dependencyGraph = (root) => pipeable_1.pipe(dependency_graph_1.dependencyGraph(root), F.mapRej(error)); | ||
function main() { | ||
pipeable_1.pipe(io_ts_docopt_1.decodeDocopt(CommandLineOptions, docstring, { | ||
pipeable_1.pipe(decodeDocopt(CommandLineOptions, docstring, { | ||
argv: [ | ||
@@ -73,18 +81,7 @@ ...process.argv.slice(2), | ||
] | ||
}), E.map(options => dependency_graph_1.dependencyGraph(options.root) | ||
.pipe(F.map( | ||
// FIXME: bug in fluture's type inferencing | ||
(graph) => pipeable_1.pipe(options.packages.map(pkg => O.getOrElse(function_1.constant([]))(O.fromNullable(graph.get(pkg)))), A.flatten))) | ||
.pipe(F.map( | ||
// FIXME: bug in fluture's type inferencing | ||
(dependencies) => ts_pattern_1.match(options.mode) | ||
}), F.chain(options => pipeable_1.pipe(dependencyGraph(options.root), map(graph => pipeable_1.pipe(options.packages, A.chain(pkg => pipeable_1.pipe(O.fromNullable(graph.get(pkg)), O.getOrElseW(function_1.constant(A.empty)))))), map(dependencies => ts_pattern_1.match(options.mode) | ||
.with('path', () => dependencies | ||
.map(shades_1.get('location')) | ||
.map(location => path.relative(options.root, location))) | ||
.otherwise(() => dependencies.map(shades_1.get('name'))))) | ||
.pipe(F.map(A.uniq(Ord_1.ordString))) | ||
.pipe(F.map((dependencies) => dependencies.forEach(unary(console.log))))), E.getOrElseW(errors => F.reject(error_1.validationErrors('argv', errors))), F.fork(error => { | ||
console.error(error); | ||
process.exit(1); | ||
})(function_1.constVoid)); | ||
.otherwise(() => dependencies.map(shades_1.get('name')))), map(A.uniq(Ord_1.ordString)), map((dependencies) => dependencies.forEach(unary(console.log))))), F.fork(error => (console.error(error), process.exit(1)))(function_1.constVoid)); | ||
} | ||
@@ -91,0 +88,0 @@ main(); |
{ | ||
"name": "@typescript-tools/internal-dependencies", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Calculate package dependencies living in the same monorepo", | ||
@@ -52,4 +52,4 @@ "main": "dist/src/index.js", | ||
"dependencies": { | ||
"@typescript-tools/dependency-graph": "^1.3.1", | ||
"@typescript-tools/io-ts": "^1.3.0", | ||
"@typescript-tools/dependency-graph": "^1.4.0", | ||
"@typescript-tools/io-ts": "^1.4.0", | ||
"fluture": "^13.0.1", | ||
@@ -63,2 +63,3 @@ "fp-ts": "^2.9.3", | ||
"devDependencies": { | ||
"@types/docopt": "^0.6.31", | ||
"@types/node": "^14.14.6", | ||
@@ -113,3 +114,3 @@ "@typescript-eslint/eslint-plugin": "^4.6.1", | ||
}, | ||
"gitHead": "04181f0eb7b51eb174f528d4cf7c84b1d5090d84" | ||
"gitHead": "f0613e503219af51d238a10b2d95fd008a5128be" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17415
16
93