Skip to content

Commit

Permalink
Migrate from Lerna to npm workspaces (#570)
Browse files Browse the repository at this point in the history
* chore(lerna) migrate from lerna to npm workspaces
* build on Node v18

Signed-off-by: Dan Selman <danscode@selman.org>
  • Loading branch information
dselman committed Sep 27, 2023
1 parent 2b97862 commit dd9751c
Show file tree
Hide file tree
Showing 35 changed files with 5,047 additions and 13,636 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
- name: build and publish
run: |
export NODE_OPTIONS="--max_old_space_size=6144"
npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
npm version --no-git-tag-version --yes --exact ${{ steps.timestamp.outputs.stamp }}
npx lerna version --no-git-tag-version --yes --exact ${{ steps.timestamp.outputs.stamp }}
npx lerna exec --ignore dingus -- npm publish --access public --ignore-scripts --tag=unstable 2>&1
npm version --workspaces --include-workspace-root --no-git-tag-version --yes --exact ${{ steps.timestamp.outputs.stamp }}
npm publish --workspaces --access public --tag=unstable 2>&1
5 changes: 2 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ jobs:
run: |
export NODE_OPTIONS="--max_old_space_size=6144"
npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
npm version --no-git-tag-version --yes --exact ${{ github.event.release.tag_name }}
npx lerna version --no-git-tag-version --yes --exact ${{ github.event.release.tag_name }}
npx lerna exec --ignore dingus -- npm publish --access public ${{ steps.tag.outputs.tag }} 2>&1
npm version --workspaces --include-workspace-root --no-git-tag-version --yes --exact ${{ github.event.release.tag_name }}
npm publish --workspaces --access public ${{ steps.tag.outputs.tag }} 2>&1
- name: Create PR to increment version
uses: peter-evans/create-pull-request@v3
Expand Down
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,17 @@
</a>
</p>

### Visit the [TemplateMark Dingus](https://templatemark-dingus.netlify.app)

## Introduction

A transformation and parsing framework for converting markdown content to HTML, Slate (for rich-text editing) and other structured document object models (DOMs).
A transformation and parsing framework for converting markdown content to HTML, PDF, DOCX, Slate (for rich-text editing) and other structured document object models (DOMs).

![Transformations](./packages/markdown-transform/transformations.png)

## Structure of the Code Repository

Top level repository (markdown-transform), with sub packages. Each sub-package is published as an independent npm module using `lerna`:
Top level repository (markdown-transform), with sub packages. Each sub-package is published as an independent npm module using `npm workspaces`:
* [markdown-cli](https://github.com/accordproject/markdown-transform/tree/main/packages/markdown-cli) : command line utilities
* [markdown-transform](https://github.com/accordproject/markdown-transform/tree/main/packages/markdown-transform) : High-level API to transform markdown into different formats
* [markdown-transform](https://github.com/accordproject/markdown-transform/tree/main/packages/markdown-transform) : High-level API to transform files into different formats
* [markdown-common](https://github.com/accordproject/markdown-transform/tree/main/packages/markdown-common) : converts between markdown strings and the CommonMark DOM
* [markdown-cicero](https://github.com/accordproject/markdown-transform/tree/main/packages/markdown-cicero) : converts between the CommonMark DOM and the CiceroMark DOM
* [markdown-template](https://github.com/accordproject/markdown-transform/tree/main/packages/markdown-template) : converts between JSON data + markdown strings and TemplateMark
Expand All @@ -37,7 +35,6 @@ Top level repository (markdown-transform), with sub packages. Each sub-package i
* [markdown-docx](https://github.com/accordproject/markdown-transform/tree/main/packages/markdown-docx) : converts a DOCX file to the CiceroMark DOM
* [markdown-it-cicero](https://github.com/accordproject/markdown-transform/tree/main/packages/markdown-it-cicero) : markdown-it plugin for contracts and CiceroMark
* [markdown-it-template](https://github.com/accordproject/markdown-transform/tree/main/packages/markdown-it-template) : markdown-it plugin for templates and TemplateMark
* [dingus](https://github.com/accordproject/markdown-transform/tree/main/packages/dingus) : published tool to edit markdown as HTML or a DOM

### CommonMark DOM

Expand Down Expand Up @@ -82,9 +79,7 @@ markus --help

### For developers

To install for development, in the project directory, you will need to first install [lerna](https://lerna.js.org):
```
npm install -g lerna@^3.20.2
npm install
```

Expand All @@ -94,7 +89,7 @@ Then run:
npm run test
```

Invokes _lerna_ to run the test suite.
This command uses npm workspaces to run the tests for each package in the monorepo.

---

Expand Down
Loading

0 comments on commit dd9751c

Please sign in to comment.