@bigbinary/neeto-commons-frontend 1.0.9
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 +93 -0
- package/initializers.js +822 -0
- package/package.json +92 -0
- package/react.js +1195 -0
- package/utils.js +932 -0
package/README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# neeto-commons-frontend
|
|
2
|
+
|
|
3
|
+
The commons frontend library for Neeto Applications.
|
|
4
|
+
|
|
5
|
+
## Installation Instructions
|
|
6
|
+
|
|
7
|
+
Install from npm:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
yarn add "@bigbinary/neeto-commons-frontend@1.0.9"
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This package relies on the host project's tailwind configuration. So add
|
|
14
|
+
neeto-commons-frontend to your project's tailwind.config.js file:
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
module.exports = {
|
|
18
|
+
purge: {
|
|
19
|
+
content: [
|
|
20
|
+
// ... other content directories
|
|
21
|
+
"./node_modules/@bigbinary/neeto-commons-frontend/**/*.js",
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
// ... other tailwind config options
|
|
25
|
+
};
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
This package exports four different sets of functions and components. Click on
|
|
31
|
+
them to read more:
|
|
32
|
+
|
|
33
|
+
1. [Initializers](./docs/initializers/README.md)
|
|
34
|
+
2. [React utilities](./docs/react/README.md)
|
|
35
|
+
3. [General utility functions](./docs/utils/README.md)
|
|
36
|
+
|
|
37
|
+
## Development instructions
|
|
38
|
+
|
|
39
|
+
1. Clone this repository.
|
|
40
|
+
2. Run `yarn install` to download the dependencies and setup the development
|
|
41
|
+
environment.
|
|
42
|
+
3. Have a host application ready.
|
|
43
|
+
4. Run `yarn build --watch` to automatically transpile code as you save the
|
|
44
|
+
file. You can omit the `--watch` flag if you want to run the build only once.
|
|
45
|
+
5. In a different terminal, run `yalc publish` to publish the
|
|
46
|
+
neeto-commons-frontend to the local yalc store.
|
|
47
|
+
6. Run `yalc install` to install the neeto-commons-frontend to the host
|
|
48
|
+
application.
|
|
49
|
+
7. After making all changes to `neeto-commons-frontend`, run `yal push` to push
|
|
50
|
+
the changes to the host application.
|
|
51
|
+
8. Video explanation on how to use yalc: https://vimeo.com/722958162/9e931b640c
|
|
52
|
+
|
|
53
|
+
## Building and releasing.
|
|
54
|
+
|
|
55
|
+
This is how releases are managed in this repo.
|
|
56
|
+
|
|
57
|
+
- We will create a branch with the next release version as its name (`1.0.x`)
|
|
58
|
+
from master branch.
|
|
59
|
+
- Version in
|
|
60
|
+
[README.md](https://github.com/bigbinary/neeto-commons-frontend/blob/master/README.md#L10)
|
|
61
|
+
and
|
|
62
|
+
[package.json](https://github.com/bigbinary/neeto-commons-frontend/blob/master/package.json#L3)
|
|
63
|
+
will be updated to the current branch name.
|
|
64
|
+
- From now on, we can install the package to neeto-applications using the
|
|
65
|
+
version `1.X.Y`.
|
|
66
|
+
- We will create a draft PR of this branch targeting master. This keeps the
|
|
67
|
+
branch in sync with master branch (bot-bigbinary will auto-merge the changes).
|
|
68
|
+
- When all features have been built, we will deploy it to all neeto-applications
|
|
69
|
+
locally using `yalc` package manager. We won't raise PR until the deployment
|
|
70
|
+
and verification is successfully done locally for all neeto-applications. The
|
|
71
|
+
usage of yalc is explained in this video:
|
|
72
|
+
https://vimeo.com/722958162/9e931b640c
|
|
73
|
+
- In case if we notice any problem during verification, like any missed edge
|
|
74
|
+
cases, we will fix the problem in this repo and re-run `yalc push` to install
|
|
75
|
+
the latest changes.
|
|
76
|
+
- Once everything is fine and the verification is complete, we will create a
|
|
77
|
+
[new github release](https://github.com/bigbinary/neeto-commons-frontend/releases/new)
|
|
78
|
+
from `1.X.Y` branch with the exact same name for the tag (`1.X.Y`). The target
|
|
79
|
+
branch will be kept as `1.X.Y`. This will create a tag from the latest `1.X.Y`
|
|
80
|
+
branch and this ensures that the latest commit on that branch will remain
|
|
81
|
+
intact even if that branch gets deleted.
|
|
82
|
+
- Whenever a new release is created with a new version number, the github
|
|
83
|
+
actions will automatically publish the built package to npm.
|
|
84
|
+
- Now we will squash and merge the PR `1.X.Y` to master and delete its source
|
|
85
|
+
branch. This will delete all commits except the top one (since we have created
|
|
86
|
+
a tag with it).
|
|
87
|
+
- Immediately, we will open another branch with the next version (`1.X.Y`) and
|
|
88
|
+
the cycle will continue.
|
|
89
|
+
- Now we can run `yalc remove neeto-commons-frontend` to remove yalc based
|
|
90
|
+
package and run `yarn add neeto-commons-frontend@1.X.Y` to fetch the latest
|
|
91
|
+
changes from npm in all repos and raise PR. You might be able to slightly
|
|
92
|
+
tweak this script to get the job done:
|
|
93
|
+
https://gist.github.com/jagannathBhat/42a584748d97fe134f0abadb191ef29a
|