@bigbinary/neeto-commons-frontend 1.0.9 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -9
- package/initializers.js +85 -533
- package/package.json +7 -6
- package/pure.js +392 -0
- package/{react.js → react-utils.js} +88 -22
- package/utils.js +27 -334
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ The commons frontend library for Neeto Applications.
|
|
|
7
7
|
Install from npm:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
yarn add "@bigbinary/neeto-commons-frontend@
|
|
10
|
+
yarn add "@bigbinary/neeto-commons-frontend@2.0.1"
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
This package relies on the host project's tailwind configuration. So add
|
|
@@ -32,7 +32,39 @@ them to read more:
|
|
|
32
32
|
|
|
33
33
|
1. [Initializers](./docs/initializers/README.md)
|
|
34
34
|
2. [React utilities](./docs/react/README.md)
|
|
35
|
-
3. [
|
|
35
|
+
3. [Pure utility functions](./docs/pure/README.md)
|
|
36
|
+
4. [Web utility functions](./docs/utils/README.md)
|
|
37
|
+
|
|
38
|
+
## Migrating from version 1 to 2
|
|
39
|
+
|
|
40
|
+
There is only a single breaking change from version 1 to version 2. The pure
|
|
41
|
+
functions (which has only ramda as its peerDependency) have been moved to a
|
|
42
|
+
separate bundle (named pure). You can import them from
|
|
43
|
+
`@bigbinary/neeto-commons-frontend/pure` instead of
|
|
44
|
+
`@bigbinary/neeto-commons-frontend/utils`.
|
|
45
|
+
|
|
46
|
+
Here is a list of functions that have been moved:
|
|
47
|
+
|
|
48
|
+
`removeById`, `findById`, `replaceById`, `modifyById`, `findBy`, `removeBy`,
|
|
49
|
+
`replaceBy`,`modifyBy`, `existsById`, `existsBy`, `findLastBy`, `findIndexById`,
|
|
50
|
+
`findIndexBy`,`findLastIndexBy`, `filterBy`, `countBy`, `copyKeys`,
|
|
51
|
+
`renameKeys`, `copyKeysDeep`
|
|
52
|
+
|
|
53
|
+
`noop`, `toLabelAndValue`, `getRandomInt`, `randomPick`, `dynamicArray`,
|
|
54
|
+
`isNotNil`, `isNotEmpty`, `notEquals`, `isNot`, `notEqualsDeep`,
|
|
55
|
+
`isNotEqualDeep`
|
|
56
|
+
|
|
57
|
+
`transformObjectDeep`, `keysToCamelCase`, `keysToSnakeCase`, `deepFreezeObject`,
|
|
58
|
+
`matches`, `filterNonNull`
|
|
59
|
+
|
|
60
|
+
`slugify`, `humanize`, `snakeToCamelCase`, `camelToSnakeCase`, `capitalize`,
|
|
61
|
+
`truncate`
|
|
62
|
+
|
|
63
|
+
When you are migrating from version 1 to version 2, do the following:
|
|
64
|
+
|
|
65
|
+
1. Search for all imports from `@bigbinary/neeto-commons-frontend/utils` and
|
|
66
|
+
delete the above mentioned functions from those imports.
|
|
67
|
+
2. Import these functions from `@bigbinary/neeto-commons-frontend/pure` instead.
|
|
36
68
|
|
|
37
69
|
## Development instructions
|
|
38
70
|
|
|
@@ -46,7 +78,7 @@ them to read more:
|
|
|
46
78
|
neeto-commons-frontend to the local yalc store.
|
|
47
79
|
6. Run `yalc install` to install the neeto-commons-frontend to the host
|
|
48
80
|
application.
|
|
49
|
-
7. After making all changes to `neeto-commons-frontend`, run `
|
|
81
|
+
7. After making all changes to `neeto-commons-frontend`, run `yalc push` to push
|
|
50
82
|
the changes to the host application.
|
|
51
83
|
8. Video explanation on how to use yalc: https://vimeo.com/722958162/9e931b640c
|
|
52
84
|
|
|
@@ -62,7 +94,7 @@ This is how releases are managed in this repo.
|
|
|
62
94
|
[package.json](https://github.com/bigbinary/neeto-commons-frontend/blob/master/package.json#L3)
|
|
63
95
|
will be updated to the current branch name.
|
|
64
96
|
- From now on, we can install the package to neeto-applications using the
|
|
65
|
-
version `
|
|
97
|
+
version `2.X.Y`.
|
|
66
98
|
- We will create a draft PR of this branch targeting master. This keeps the
|
|
67
99
|
branch in sync with master branch (bot-bigbinary will auto-merge the changes).
|
|
68
100
|
- When all features have been built, we will deploy it to all neeto-applications
|
|
@@ -75,19 +107,19 @@ This is how releases are managed in this repo.
|
|
|
75
107
|
the latest changes.
|
|
76
108
|
- Once everything is fine and the verification is complete, we will create a
|
|
77
109
|
[new github release](https://github.com/bigbinary/neeto-commons-frontend/releases/new)
|
|
78
|
-
from `
|
|
79
|
-
branch will be kept as `
|
|
110
|
+
from `2.X.Y` branch with the exact same name for the tag (`2.X.Y`). The target
|
|
111
|
+
branch will be kept as `2.X.Y`. This will create a tag from the latest `2.X.Y`
|
|
80
112
|
branch and this ensures that the latest commit on that branch will remain
|
|
81
113
|
intact even if that branch gets deleted.
|
|
82
114
|
- Whenever a new release is created with a new version number, the github
|
|
83
115
|
actions will automatically publish the built package to npm.
|
|
84
|
-
- Now we will squash and merge the PR `
|
|
116
|
+
- Now we will squash and merge the PR `2.X.Y` to master and delete its source
|
|
85
117
|
branch. This will delete all commits except the top one (since we have created
|
|
86
118
|
a tag with it).
|
|
87
|
-
- Immediately, we will open another branch with the next version (`
|
|
119
|
+
- Immediately, we will open another branch with the next version (`2.X.Y`) and
|
|
88
120
|
the cycle will continue.
|
|
89
121
|
- Now we can run `yalc remove neeto-commons-frontend` to remove yalc based
|
|
90
|
-
package and run `yarn add neeto-commons-frontend@
|
|
122
|
+
package and run `yarn add neeto-commons-frontend@2.X.Y` to fetch the latest
|
|
91
123
|
changes from npm in all repos and raise PR. You might be able to slightly
|
|
92
124
|
tweak this script to get the job done:
|
|
93
125
|
https://gist.github.com/jagannathBhat/42a584748d97fe134f0abadb191ef29a
|