@momo-webplatform/mobase 0.2.92 → 0.2.94

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 CHANGED
@@ -36,7 +36,7 @@ import { mobaseTW } from "@momo-webplatform/mobase";
36
36
  const config = {
37
37
  content: [
38
38
  // ...
39
- "node_modules/@momo-webplatform/mobase/dist/esm/**/*.js",
39
+ "node_modules/@momo-webplatform/mobase/dist/esm/**/*.js",
40
40
  ],
41
41
  darkMode: ["class"],
42
42
  plugins: [mobaseTW()],
@@ -63,6 +63,7 @@ const nextConfig = {
63
63
  }
64
64
  export default nextConfig;
65
65
  ```
66
+
66
67
  ### Install Mobase React
67
68
 
68
69
  1. Run the following command to install `@momo-webplatform/mobase`:
@@ -107,3 +108,66 @@ export default function MyPage() {
107
108
  If you need the Figma files for the components you can check out our website for more information:
108
109
 
109
110
  🎨 [Get access to the Figma design files](https://dev1.momo.vn:3000/figma/)
111
+
112
+ ## Dependencies
113
+
114
+ ### `peerDependencies`
115
+
116
+ `peerDependencies` are dependencies which must be installed and have their versions controlled by the user of `mobase` in order for them to work correctly.
117
+
118
+ There are three types of `peerDependencies` in `mobase`:
119
+
120
+ #### 1. Framework
121
+
122
+ These dependencies are the environment in which `mobase` runs. The list of dependencies of this type are:
123
+
124
+ - `react`
125
+ - `next`
126
+
127
+ #### 2. User-Configurable Libraries
128
+
129
+ These dependencies require configuration or data directly from the user.
130
+ To prevent issues from breaking changes, it is essential that the versions used by `mobase` and the user are identical.
131
+ This is particularly important for internal changes not covered by official documentation (e.g., `react-hook-form`).
132
+
133
+ - `embla-carousel`: the base package for `embla-carousel-react`.
134
+
135
+ - `embla-carousel-react`:
136
+
137
+ Check the implementation of [`Carousel` component](./src/components/Carousel/Carousel.tsx). The user may pass their `opts` or `plugins` into this component for customizing.
138
+
139
+ - `react-hook-form`:
140
+
141
+ Check the implementation of [form-related components](./src/components/Form/Form.tsx). The user need to pass properties created by `useForm` on their side to make use of these components (`Form` component of `mobase` is `FormProvider` of `react-hook-form`).
142
+
143
+ - `react-day-picker`:
144
+
145
+ Check the implementation of [`Calendar` component](./src/components/Calendar/Calendar.tsx). The user can customize this component by passing props of `DayPicker` component from `react-day-picker`.
146
+
147
+ #### 3. Related Libraries
148
+
149
+ These dependencies are required by the user-configurable libraries listed above.
150
+
151
+ - `@hookform/resolvers`: A dependency of `react-hook-form`.
152
+
153
+ - `zod`: A dependency of `@hookform/resolvers`.
154
+
155
+ - `embla-carousel-autoplay`: A dependency of `embla-carousel`.
156
+
157
+ Please refer to this [JIRA ticket](https://atlassiansuite.mservice.com.vn:8443/browse/WP-1303) for additional context.
158
+
159
+ ### `overrides` (`npm`, `pnpm`)/`resolutions` (`yarn`)
160
+
161
+ > **Important:** Use the following instructions with caution.
162
+ > Installing package versions not specified in `mobase`'s `package.json` may lead to unexpected errors, crashes, or other malfunctions.
163
+ > The `mobase` development team cannot guarantee support for issues resulting from such modifications.
164
+
165
+ To override a package version, you can utilize the `overrides`/`resolutions` feature of your package manager. This is useful in situations where the `mobase` team may have missed a peer dependency that conflicts with your project's version of the same package.
166
+
167
+ Consult the official documentation for more information:
168
+
169
+ - **`npm`/`pnpm`**: [doc](https://docs.npmjs.com/cli/v11/configuring-npm/package-json#overrides).
170
+
171
+ - **`yarn` (legacy)**: [doc](https://classic.yarnpkg.com/lang/en/docs/selective-version-resolutions/).
172
+
173
+ - **`yarn` (modern)**: [doc](https://yarnpkg.com/configuration/manifest#resolutions).