Skip to content

Commit

Permalink
build: use Lerna v6 + Nx (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
z0al authored Nov 23, 2022
1 parent 73269ee commit f019aff
Show file tree
Hide file tree
Showing 33 changed files with 23,516 additions and 57,257 deletions.
11 changes: 6 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ commands:
npm_install:
steps:
- restore_cache: *cache-key
- run: npm ci --prefer-offline --no-audit --no-package-lock
- run: npm ci
- save_cache:
<<: *cache-key
paths:
Expand All @@ -37,8 +37,9 @@ jobs:
- vault/get-secrets:
template-preset: npm-read
- npm_install
# TODO: investigate why this has different results than running locally
# - run: npm run prettier:check
- run: npm run build
- run: npm run lint
- run: npm run prettier:check
- run: npm run test:ci
resource_class: medium+

Expand All @@ -53,8 +54,8 @@ jobs:
- run: git remote set-url origin "https://$GIT_AUTHOR_NAME:[email protected]/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME"
- npm_install
- run: npm run build
- run: npm run lerna -- version --no-private --conventional-commits --create-release github --yes
- run: npm run lerna -- publish from-git --yes
- run: npm run lerna:version
- run: npm run lerna:publish

compressed-size:
executor: default
Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/node_modules
**/dist
**/coverage
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Text documents.
- Converts rich text documents to plain text
- [`rich-text-types`](https://github.com/contentful/rich-text/tree/master/packages/rich-text-types)
- Type definitions and constants for the rich text field type
- [`gatsby-transformer-contentful-richtext`](https://github.com/contentful/rich-text/tree/master/packages/gatsby-transformer-contentful-richtext) [DEPRECATED]
- [`gatsby-transformer-contentful-richtext`](https://github.com/contentful/rich-text/tree/master/deprecated/gatsby-transformer-contentful-richtext) [DEPRECATED]
- Parses a Contentful Rich Text document to HTML in Gatsby
- [`rich-text-react-renderer`](https://github.com/contentful/rich-text/tree/master/packages/rich-text-react-renderer)
- Parses a Contentful Rich Text document to React components
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 4 additions & 10 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
{
"$schema": "node_modules/@lerna-lite/cli/schemas/lerna-schema.json",
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"useWorkspaces": true,
"version": "15.14.0",
"packages": [
"packages/contentful-slatejs-adapter",
"packages/rich-text-from-markdown",
"packages/rich-text-html-renderer",
"packages/rich-text-links",
"packages/rich-text-plain-text-renderer",
"packages/rich-text-react-renderer",
"packages/rich-text-types"
],
"packages": ["packages/*"],
"command": {
"version": {
"allowBranch": "master",
Expand All @@ -19,6 +12,7 @@
"*.md",
"*.mdx",
"**/*.spec.*",
"**/*.test.*",
"**/*.stories.*",
"**/__fixtures__/**",
"**/__tests__/**"
Expand Down
50 changes: 50 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": [
"build",
"lint",
"prebuild",
"test",
"test:prod",
"generate-json-schema"
]
}
}
},
"targetDefaults": {
"build": {
"dependsOn": ["^build"],
"outputs": ["{projectRoot}/dist"]
},
"lint": {
"dependsOn": ["^lint"],
"outputs": ["{projectRoot}/]"]
},
"prebuild": {
"dependsOn": ["^prebuild"]
},
"test": {
"dependsOn": ["^test"]
},
"test:prod": {
"dependsOn": ["^test:prod"]
},
"generate-json-schema": {
"dependsOn": ["^generate-json-schema"],
"outputs": ["{projectRoot}/src/schemas/generated"]
}
},
"affected": {
"defaultBase": "origin/master"
},
"defaultBase": "master",
"namedInputs": {
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"sharedGlobals": [],
"production": ["default"]
}
}
Loading

0 comments on commit f019aff

Please sign in to comment.