Skip to content

Commit

Permalink
Updated README (#1044)
Browse files Browse the repository at this point in the history
* Updated README

* Minor changes

* Minor changes
  • Loading branch information
gaagul authored Mar 18, 2024
1 parent cac86c7 commit ae075c4
Showing 1 changed file with 58 additions and 23 deletions.
81 changes: 58 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,73 @@ yarn add @bigbinary/neeto-editor
For setting up image upload refer
https://neeto-editor.neeto.com/?path=/docs/examples-customize-options-addons--addons.

## Development
## Instructions for development

Install all the dependencies by executing following command.

```
yarn
```

Running the `yarn start` command starts a storybook application. Use this
Running the `yarn storybook` command starts a storybook application. Use this
application to test out changes.

# Building and releasing.

The `@bigbinary/neeto-editor` package gets published to NPM when we
merge a PR with `patch`, `minor` or `major` label to the `main` branch. The
`patch` label is used for bug fixes, `minor` label is used for new features and
`major` label is used for breaking changes. You can checkout the
`Create and publish releases` workflow in GitHub Actions to get a live update.

In case if you missed to add the label, you can manually publish the package.
For that first you need to create a PR to update the version number in the
`package.json` file and merge it to the `main` branch. After merging the PR, you
need to create a
[new github release](https://github.com/bigbinary/neeto-editor/releases/new)
from main branch. Whenever a new release is created with a new version number,
the github actions will automatically publish the built package to npm. You can
checkout the `Publish to npm` workflow in GitHub Actions to get a live update.

Please note that before publishing the package, you need to verify the
functionality in some of the neeto web-apps locally using `yalc` package
manager. The usage of yalc is explained in this video:
https://youtu.be/F4zZFnrNTq8
When developing frontend packages, it's crucial to test changes in a live environment using a host application.
There are two ways to do this:

1. Using yalc package manager: https://youtu.be/F4zZFnrNTq8

> Note: If you are using yalc, you need to run `yarn bundle` after making changes to the package instead of `yarn build` which is described in the video.
2. Directly updating the node_modules of the host application.

1. Start the host application server
2. Inside the package, execute the command:

```
yarn bundle --watch --app ../neeto-site-web
```
Here replace ../neeto-site-web with path to the host project.
Now, any changes made to the neetoEditor codebase will be instantly reflected in the UI.
3. Remove local installation
Run the following command to reset to the initial state.
```
yarn install --check-files
```
4. Translation File Changes (optional)
Modifications in the neeto-editor translation files will not automatically update the UI. To verify these changes, update your neeto-site-web/app/javascript/packs/application.js file with the following code:
```
import en from "translations/en.json";
import editorEn from "neetofilters/app/javascript/src/translations/en.json";
import { mergeDeepLeft } from "ramda";
initializeApplication({
translationResources: { en: { translation: mergeDeepLeft(editorEn, en) } },
});
```
## Instructions for Publishing
### Package Release Process
A package is released upon merging a PR labeled as patch, minor, or major into the main branch. The patch label addresses bug fixes, minor signifies the addition of new features, and major denotes breaking changes, adhering to the principles outlined in [Semantic Versioning (SemVer)](https://semver.org/).
You can checkout the Create and publish releases workflow in GitHub Actions to get a live update.
### Manual Package Publishing
If you missed adding the label, you can manually publish the package. For that first, you need to create a PR to update the version number in the package.json file and merge it into the main branch. After merging the PR, you need to create a [new GitHub release](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository) from the main branch. Whenever a new release is created with a new version number, the GitHub actions will automatically publish the built package to npm. You can check out the Publish to npm workflow in GitHub Actions to get a live update.
> Note: before publishing the package, you must verify the functionality in host application [locally](#instructions-for-development).
## Documentation
Expand Down

0 comments on commit ae075c4

Please sign in to comment.