@typescript-tools/lerna-packages
Advanced tools
Comparing version 2.2.2 to 3.0.0-beta.2
@@ -5,5 +5,5 @@ /** | ||
*/ | ||
import { LernaPackage } from '@typescript-tools/io-ts'; | ||
import { MonorepoRootError } from '@typescript-tools/monorepo-root'; | ||
import * as TE from 'fp-ts/TaskEither'; | ||
import { MonorepoRootError } from '@typescript-tools/monorepo-root'; | ||
import { LernaPackage } from '@typescript-tools/io-ts/dist/lib/LernaPackage'; | ||
export declare type PackageDiscoveryError = MonorepoRootError | { | ||
@@ -10,0 +10,0 @@ type: 'unable to discover internal packages'; |
@@ -30,15 +30,14 @@ "use strict"; | ||
exports.lernaPackages = void 0; | ||
const t = __importStar(require("io-ts")); | ||
const io_ts_1 = require("@typescript-tools/io-ts"); | ||
const monorepo_root_1 = require("@typescript-tools/monorepo-root"); | ||
const execa_1 = __importDefault(require("execa")); | ||
const E = __importStar(require("fp-ts/Either")); | ||
const TE = __importStar(require("fp-ts/TaskEither")); | ||
const function_1 = require("fp-ts/function"); | ||
const t = __importStar(require("io-ts")); | ||
const PathReporter = __importStar(require("io-ts/lib/PathReporter")); | ||
const function_1 = require("fp-ts/function"); | ||
const monorepo_root_1 = require("@typescript-tools/monorepo-root"); | ||
const LernaPackage_1 = require("@typescript-tools/io-ts/dist/lib/LernaPackage"); | ||
const StringifiedJSON_1 = require("@typescript-tools/io-ts/dist/lib/StringifiedJSON"); | ||
const execa_1 = __importDefault(require("execa")); | ||
// Widens the type of a particular Err into an Err | ||
const err = (error) => error; | ||
const monorepoRoot = (path) => function_1.pipe(monorepo_root_1.monorepoRoot(path), E.mapLeft(err)); | ||
const decodeLernaPackages = (packages) => function_1.pipe(StringifiedJSON_1.StringifiedJSON(t.array(LernaPackage_1.LernaPackage)).decode(packages), E.mapLeft(errors => PathReporter.failure(errors).join('\n')), E.mapLeft(error => err({ type: 'unable to decode list of packages', error })), TE.fromEither); | ||
const monorepoRoot = (path) => (0, function_1.pipe)((0, monorepo_root_1.monorepoRoot)(path), E.mapLeft(err)); | ||
const decodeLernaPackages = (packages) => (0, function_1.pipe)((0, io_ts_1.StringifiedJSON)(t.array(io_ts_1.LernaPackage)).decode(packages), E.mapLeft((errors) => PathReporter.failure(errors).join('\n')), E.mapLeft((error) => err({ type: 'unable to decode list of packages', error })), TE.fromEither); | ||
/** | ||
@@ -48,5 +47,5 @@ * Search the monorepo and enumerate all internal packages. | ||
function lernaPackages(findRootFrom) { | ||
return function_1.pipe(E.fromNullable(err({ type: 'unable to discover internal packages', error: 'absurd' }))(findRootFrom), E.chain(monorepoRoot), E.orElse(() => monorepoRoot()), TE.fromEither, TE.chain(root => TE.tryCatch(() => execa_1.default.command('npx lerna list --all --json', { cwd: root }), error => err({ type: 'unable to discover internal packages', error }))), TE.map(({ stdout }) => stdout), TE.chain(decodeLernaPackages), TE.mapLeft(err)); | ||
return (0, function_1.pipe)(E.fromNullable(err({ type: 'unable to discover internal packages', error: 'absurd' }))(findRootFrom), E.chain(monorepoRoot), E.orElse(() => monorepoRoot()), TE.fromEither, TE.chain((root) => TE.tryCatch(() => execa_1.default.command('npx lerna list --all --json', { cwd: root }), (error) => err({ type: 'unable to discover internal packages', error }))), TE.map(({ stdout }) => stdout), TE.chain(decodeLernaPackages), TE.mapLeft(err)); | ||
} | ||
exports.lernaPackages = lernaPackages; | ||
//# sourceMappingURL=index.js.map |
180
package.json
{ | ||
"name": "@typescript-tools/lerna-packages", | ||
"version": "2.2.2", | ||
"description": "Discover internal packages", | ||
"homepage": "https://github.com/typescript-tools/typescript-tools", | ||
"bugs": { | ||
"url": "https://github.com/typescript-tools/typescript-tools/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/typescript-tools/typescript-tools.git" | ||
}, | ||
"license": "ISC", | ||
"author": "Eric Crosson <eric.s.crosson@utexas.edu> (https://github.com/ericcrosson)", | ||
"main": "dist/src/index.js", | ||
"types": "dist/src/index.d.ts", | ||
"name": "@typescript-tools/lerna-packages", | ||
"version": "3.0.0-beta.2", | ||
"description": "Discover internal packages", | ||
"keywords": [ | ||
"lerna", | ||
"package", | ||
"discover", | ||
"find" | ||
], | ||
"homepage": "https://github.com/typescript-tools/typescript-tools", | ||
"bugs": { | ||
"url": "https://github.com/typescript-tools/typescript-tools/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/typescript-tools/typescript-tools.git" | ||
}, | ||
"license": "ISC", | ||
"author": "Eric Crosson <eric.s.crosson@utexas.edu> (https://github.com/ericcrosson)", | ||
"main": "dist/src/index.js", | ||
"types": "dist/src/index.d.ts", | ||
"files": [ | ||
"dist/src/" | ||
], | ||
"scripts": { | ||
"ava": "echo 'No tests defined'", | ||
"build": "tsc --build --incremental .", | ||
"clean": "rimraf --no-glob dist", | ||
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov", | ||
"lint": "eslint --ext ts .", | ||
"lint-staged": "lint-staged", | ||
"lint:fix": "eslint --ext ts --fix . package.json", | ||
"prettier": "prettier --list-different .", | ||
"prettier:fix": "prettier --write .", | ||
"test": "echo 'No tests defined'" | ||
}, | ||
"pre-commit": "lint-staged", | ||
"dependencies": { | ||
"@typescript-tools/io-ts": "3.0.0-beta.2", | ||
"@typescript-tools/monorepo-root": "1.3.2", | ||
"execa": "^4.1.0", | ||
"fp-ts": "^2.9.3", | ||
"io-ts": "~2.1.3" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^14.14.6", | ||
"@typescript-eslint/eslint-plugin": "^5.0.0", | ||
"@typescript-eslint/parser": "^5.0.0", | ||
"ava": "^3.13.0", | ||
"ava-fast-check": "^3.0.0", | ||
"codecov": "^3.8.1", | ||
"eslint": "^7.32.0", | ||
"fast-check": "^2.6.0", | ||
"lint-staged": "^10.5.3", | ||
"nyc": "^15.1.0", | ||
"pre-commit": "^1.2.2", | ||
"prettier": "2.2.1", | ||
"rimraf": "^3.0.2", | ||
"ts-node": "^9.0.0", | ||
"typescript": "^4.4.4" | ||
}, | ||
"ava": { | ||
"extensions": [ | ||
"ts" | ||
], | ||
"files": [ | ||
"dist/src/" | ||
"!dist/**/*.d.ts", | ||
"test/**/test-*.ts" | ||
], | ||
"scripts": { | ||
"prepublishOnly": "npm run compile", | ||
"ava": "echo 'No tests defined'", | ||
"clean": "rimraf --no-glob dist", | ||
"compile": "tsc --build --incremental .", | ||
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov", | ||
"lint": "eslint --ext ts .", | ||
"lint:fix": "eslint --ext ts --fix .", | ||
"lint-staged": "lint-staged", | ||
"prettier:check": "prettier --list-different src/**/*.ts", | ||
"prettier:write": "prettier --write src/**/*.ts", | ||
"test": "echo 'No tests defined'", | ||
"watch:ava": "nodemon -e 'ts json' -x 'npm run ava -- -s -v --fail-fast || true'", | ||
"watch:compile": "nodemon -e 'ts json' -x 'npm run compile || true'", | ||
"watch:lint": "nodemon -e 'ts js json' -x 'npm run lint || true'", | ||
"watch:test": "nodemon -e 'ts json' -x 'npm test || true'" | ||
}, | ||
"pre-commit": "lint-staged", | ||
"lint-staged": { | ||
"*.ts": [ | ||
"eslint --fix", | ||
"prettier --write" | ||
] | ||
}, | ||
"dependencies": { | ||
"@typescript-tools/io-ts": "^2.2.0", | ||
"@typescript-tools/monorepo-root": "^1.3.2", | ||
"execa": "^4.1.0", | ||
"fp-ts": "^2.9.3", | ||
"io-ts": "~2.1.3" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^14.14.6", | ||
"@typescript-eslint/eslint-plugin": "^4.6.1", | ||
"@typescript-eslint/parser": "^4.6.1", | ||
"ava": "^3.13.0", | ||
"ava-fast-check": "^3.0.0", | ||
"codecov": "^3.8.1", | ||
"eslint": "^7.12.1", | ||
"fast-check": "^2.6.0", | ||
"lint-staged": "^10.5.1", | ||
"nyc": "^15.1.0", | ||
"pre-commit": "^1.2.2", | ||
"prettier": "2.1.2", | ||
"rimraf": "^3.0.2", | ||
"ts-node": "^9.0.0", | ||
"typescript": "^4.0.5" | ||
}, | ||
"ava": { | ||
"extensions": [ | ||
"ts" | ||
], | ||
"files": [ | ||
"!dist/**/*.d.ts", | ||
"test/**/test-*.ts" | ||
], | ||
"require": [ | ||
"ts-node/register" | ||
] | ||
}, | ||
"nyc": { | ||
"extension": [ | ||
".ts" | ||
], | ||
"include": [ | ||
"src/*.ts" | ||
], | ||
"require": [ | ||
"ts-node/register" | ||
] | ||
}, | ||
"keywords": [ | ||
"lerna", | ||
"package", | ||
"discover", | ||
"find" | ||
"require": [ | ||
"ts-node/register" | ||
] | ||
}, | ||
"nyc": { | ||
"extension": [ | ||
".ts" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"gitHead": "7939e6eb8ed5b05f49529f9e16cd5242f80c5d58" | ||
"include": [ | ||
"src/*.ts" | ||
], | ||
"require": [ | ||
"ts-node/register" | ||
] | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
# lerna-packages | ||
[![License][]](https://opensource.org/licenses/ISC) | ||
[![NPM Package][]](https://npmjs.org/package/@typescript-tools/lerna-packages) | ||
[![Build Status]](https://github.com/typescript-tools/typescript-tools/actions/workflows/ci.yml) | ||
[![semantic-release]](https://github.com/semantic-release/semantic-release) | ||
[license]: https://img.shields.io/badge/License-ISC-blue.svg | ||
[npm package]: https://img.shields.io/npm/v/@typescript-tools/lerna-packages.svg | ||
[build status]: https://github.com/typescript-tools/typescript-tools/actions/workflows/ci.yml/badge.svg | ||
[semantic-release]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg | ||
> Discover internal packages | ||
@@ -7,19 +17,12 @@ | ||
``` shell | ||
```shell | ||
npm install @typescript-tools/lerna-packages | ||
``` | ||
## Use | ||
## API | ||
``` typescript | ||
import { lernaPackages } from '@typescript-tools/lerna-packages' | ||
// TODO: describe usage | ||
```typescript | ||
export function lernaPackages( | ||
findRootFrom?: string, | ||
): TE.TaskEither<PackageDiscoveryError, LernaPackage[]> | ||
``` | ||
## Related | ||
TODO | ||
## Acknowledgments | ||
TODO |
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
28
9305
7
68
2
+ Added@typescript-tools/io-ts@3.0.0-beta.2(transitive)
+ Added@typescript-tools/monorepo-root@1.3.2(transitive)
- Removed@typescript-tools/io-ts@2.2.0(transitive)
- Removed@typescript-tools/monorepo-root@1.3.3(transitive)