From 200bada0545fbeb9a1d038e5f54b2a46b7b961a0 Mon Sep 17 00:00:00 2001 From: Christian Murphy Date: Wed, 25 Aug 2021 16:24:30 -0700 Subject: [PATCH] build: migrate lerna to npm workspaces --- .github/workflows/main.yml | 1 + lerna.json | 3 --- package.json | 7 ++++--- test/api.js | 8 ++++---- test/parse-error.js | 6 +++--- 5 files changed, 12 insertions(+), 13 deletions(-) delete mode 100644 lerna.json diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fe284ad1..fdb14109 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,6 +11,7 @@ jobs: - uses: dcodeIO/setup-node-nvm@master with: node-version: ${{matrix.node}} + - run: npm install -g npm - run: npm install - run: npm test - uses: codecov/codecov-action@v1 diff --git a/lerna.json b/lerna.json deleted file mode 100644 index 053f72e2..00000000 --- a/lerna.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "version": "independent" -} diff --git a/package.json b/package.json index c9f7dd66..2dab0ef8 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,6 @@ "bail": "^2.0.0", "c8": "^7.0.0", "hast-util-assert": "^3.0.0", - "lerna": "^4.0.0", "mdast-zone": "^5.0.0", "prettier": "^2.0.0", "remark-cli": "^10.0.0", @@ -30,9 +29,11 @@ "unist-util-remove-position": "^4.0.0", "xo": "^0.44.0" }, + "workspaces": [ + "packages/*" + ], "scripts": { - "postinstall": "lerna bootstrap --no-ci", - "build-workspace": "lerna run build", + "build-workspace": "npm run build --workspaces", "build-monorepo": "rimraf \"*.d.ts\" \"{test,script}/**/*.d.ts\" && tsc && type-coverage", "build": "npm run build-workspace && npm run build-monorepo", "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", diff --git a/test/api.js b/test/api.js index 82572afa..444fc7f9 100644 --- a/test/api.js +++ b/test/api.js @@ -8,10 +8,10 @@ import test from 'tape' import {readSync} from 'to-vfile' import {removePosition} from 'unist-util-remove-position' import {assert} from 'hast-util-assert' -import {unified} from '../packages/rehype/node_modules/unified/index.js' -import rehypeParse from '../packages/rehype-parse/index.js' -import rehypeStringify from '../packages/rehype-stringify/index.js' -import {rehype} from '../packages/rehype/index.js' +import {unified} from 'unified' +import rehypeParse from 'rehype-parse' +import rehypeStringify from 'rehype-stringify' +import {rehype} from 'rehype' const fragment = {fragment: true} diff --git a/test/parse-error.js b/test/parse-error.js index 99a07f10..baee9983 100644 --- a/test/parse-error.js +++ b/test/parse-error.js @@ -2,10 +2,10 @@ import fs from 'node:fs' import path from 'node:path' import test from 'tape' import {toVFile, readSync} from 'to-vfile' -import {rehype} from '../packages/rehype/index.js' +import {rehype} from 'rehype' // @ts-expect-error: untyped. -import p5errors from '../packages/rehype-parse/node_modules/parse5/lib/common/error-codes.js' -import {errors as rerrors} from '../packages/rehype-parse/lib/errors.js' +import p5errors from 'parse5/lib/common/error-codes.js' +import {errors as rerrors} from 'rehype-parse/lib/errors.js' // Related to https://github.com/inikulin/parse5/issues/255 // and https://github.com/inikulin/parse5/pull/257.