-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: modularize repository into several packages
- Loading branch information
1 parent
c166020
commit 235c105
Showing
65 changed files
with
9,220 additions
and
5,857 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[{*.md,*.snap}] | ||
trim_trailing_whitespace = false | ||
|
||
[package.json] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Contributing | ||
|
||
This repository follows a _monorepo_ structure, for which we use [lerna](https://lerna.js.org) to manage versions of changed packages, as well as the release and publishing process. | ||
|
||
To learn more about what commands are available for lerna, how it works and how it can be configured, please check out [lerna's repository](https://github.com/lerna/lerna/). | ||
|
||
It's relevant to note, though, that the main workflow using lerna has already been setup as _npm-scripts_, which means that you should not need to use lerna commands while contributing. | ||
|
||
## Tests | ||
|
||
In order to test all packages, you simply need to run the following command: | ||
|
||
```sh | ||
$ npm run test | ||
``` | ||
|
||
## Release and publish | ||
|
||
To release and publish the packages in which changes have been made, run: | ||
|
||
```sh | ||
$ npm run release | ||
``` | ||
|
||
❗️ **IMPORTANT** : do not try to release a single package from that package's root directory. _Lerna_ takes care of figuring out which packages have suffered changes and only releases and publishes the updated packages. Please use the release scripts provided in the repository's root `package.json`. | ||
|
||
We are using _lerna_ in fixed version mode, which means that when multiple packages are changed between releases, they will all be updated to the same version. We also use [_conventional-commits_](https://www.conventionalcommits.org), which means the subject of the commit messages will decide the version bump that will occur. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Migration guide | ||
|
||
The previous package that existed in this repository, `@moxy/jest-config`, has been deprecated. To learn how to migrate into the new configuration structure, read below. | ||
|
||
## Migrating from <= 4.2.1 | ||
|
||
Until v4.2.1, you would have to import `@moxy/jest-config` to apply the **base** configuration and the **enhancers** you wished to use (`withWeb`, `withReactNative`, `withRTL`, ...). | ||
|
||
Your `jest.config.js` would look similar to this: | ||
|
||
```js | ||
const { compose, baseConfig, withWeb, withRTL } = require('@moxy/jest-config'); | ||
|
||
module.exports = compose( | ||
baseConfig(), | ||
withWeb(), | ||
withRTL(), | ||
); | ||
``` | ||
|
||
Now, the package has been refactored into a **base** configuration package and several **enhancer** packages (more info on what packages exist and how to use them is in this repository's [README](README.md)). Enhancer APIs were not subject to any breaking changes during this process. | ||
|
||
For example, the example given above would look like this after migrating to the newest version: | ||
|
||
```js | ||
const { compose, baseConfig } = require('@moxy/jest-config'); | ||
const withWeb = require('@moxy/jest-config-web'); | ||
const { withRTL } = require('@moxy/jest-config-testing-library'); | ||
|
||
module.exports = compose( | ||
baseConfig(), | ||
withWeb(), | ||
withRTL(), | ||
); | ||
``` | ||
|
||
## New features | ||
|
||
In addition to the previously existing `withRTL` enhancer, `@moxy/jest-config-testing-library` now offers a `withNTL` enhancer for React Native apps that use [Native Testing Library (NTL)](https://github.com/testing-library/native-testing-library) framework for testing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
'use strict'; | ||
|
||
module.exports = require('./lib').baseConfig(); | ||
module.exports = require('./packages/jest-config-base').baseConfig(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"packages": [ | ||
"packages/*" | ||
], | ||
"version": "5.0.0", | ||
"command": { | ||
"bootstrap": { | ||
"hoist": true | ||
}, | ||
"version": { | ||
"conventionalCommits": true, | ||
"changelogPreset": "conventionalcommits", | ||
"message": "chore(release): %v" | ||
} | ||
}, | ||
"ignoreChanges": [ | ||
"**/?(*.)test.js", | ||
"**/__mocks__/**", | ||
"**/*.md" | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.