1- # Development Guide for @bytechef/embedded-react
1+ # Development Guide for @bytechef/embedded
22
3- This guide explains how to develop and test the ` @bytechef/embedded-react ` library with hot reload capabilities.
3+ This guide explains how to develop and test the ` @bytechef/embedded ` library with hot reload capabilities.
44
55## Table of Contents
66
@@ -34,7 +34,7 @@ npm run setup:link
3434This command does the following:
3535
36361 . Builds the library
37- 2 . Creates a global npm link for ` @bytechef/embedded-react `
37+ 2 . Creates a global npm link for ` @bytechef/embedded `
38383 . Links the test app to use the globally linked library
3939
4040### Development Workflow
@@ -44,20 +44,20 @@ Open **two terminal windows**:
4444** Terminal 1 - Library (with watch mode):**
4545
4646``` bash
47- cd library/react
47+ cd library
4848npm run watch
4949```
5050
5151** Terminal 2 - Test App:**
5252
5353``` bash
54- cd test-apps/react
54+ cd test-apps
5555npm run dev
5656```
5757
5858Now:
5959
60- - Make changes to the library source code in ` library/react/ src/ `
60+ - Make changes to the library source code in ` library/src/ `
6161- Vite will automatically rebuild the library
6262- Next.js will detect the changes and hot reload the test app
6363- See your changes immediately in the browser
6767To unlink the library:
6868
6969``` bash
70- # From test-apps/react directory
70+ # From test-apps directory
7171npm run unlink:library
7272
73- # From library/react directory
73+ # From library directory
7474npm run unlink:local
7575```
7676
@@ -113,7 +113,7 @@ npm run publish:library
113113npm run install:test-app
114114
115115# Start the test app
116- cd test-apps/react
116+ cd test-apps
117117npm run dev
118118```
119119
@@ -124,14 +124,14 @@ When using the local registry, you need to republish after changes:
1241241 . Make changes to library code
1251252 . Rebuild and republish:
126126 ``` bash
127- cd library/react
127+ cd library
128128 npm run build
129129 npm run publish:local
130130 ```
1311313. Reinstall in test app:
132132 ` ` ` bash
133- cd ../../test-apps/react
134- npm install @bytechef/embedded-react @latest --registry http://localhost:4873
133+ cd ../../test-apps
134+ npm install @bytechef/embedded@latest --registry http://localhost:4873
135135 ` ` `
1361364. Next.js will hot reload with the new version
137137
@@ -147,7 +147,7 @@ To automatically use the local registry for `@bytechef` packages, edit `.npmrc`:
147147Then you can use standard npm commands:
148148
149149` ` ` bash
150- npm install @bytechef/embedded-react @latest
150+ npm install @bytechef/embedded@latest
151151` ` `
152152
153153# ## Stop the Registry
@@ -167,8 +167,8 @@ This is the **recommended approach** for active development:
167167npm run setup:link
168168
169169# Development (in separate terminals)
170- cd library/react && npm run watch # Terminal 1
171- cd test-apps/react && npm run dev # Terminal 2
170+ cd library && npm run watch # Terminal 1
171+ cd test-apps && npm run dev # Terminal 2
172172` ` `
173173
174174** Advantages:**
@@ -190,7 +190,7 @@ Occasionally test the full build process:
190190
191191` ` ` bash
192192# Build the library
193- cd library/react
193+ cd library
194194npm run build
195195
196196# Test the built output
@@ -210,22 +210,20 @@ npm run publish:library
210210
211211# Install and test in test-app
212212npm run install:test-app
213- cd test-apps/react && npm run build
213+ cd test-apps && npm run build
214214` ` `
215215
216216# # Project Structure
217217
218218```
219219frontend/embedded/
220- ├── library/ # SDK libraries
221- │ └── react/ # React SDK library
222- │ ├── src/ # Source code
223- │ ├── dist/ # Built output (generated)
224- │ └── package.json
225- ├── test-apps/ # Test applications
226- │ └── react/ # Next.js test application
227- │ ├── app/ # Next.js pages
228- │ └── package.json
220+ ├── library/ # React SDK library
221+ │ ├── src/ # Source code
222+ │ ├── dist/ # Built output (generated)
223+ │ └── package.json
224+ ├── test-apps/ # Next.js test application
225+ │ ├── app/ # Next.js pages
226+ │ └── package.json
229227├── verdaccio.config.yaml # Local registry config
230228├── .npmrc # NPM configuration
231229├── .gitignore # Git ignore file
@@ -248,7 +246,7 @@ frontend/embedded/
248246| `npm run build:all` | Build the library |
249247| `npm run clean` | Clean all build artifacts and node_modules |
250248
251- ### Library (`library/react/ `)
249+ ### Library (`library/`)
252250
253251| Script | Description |
254252| ------------------------- | ---------------------------------------- |
@@ -262,12 +260,12 @@ frontend/embedded/
262260| `npm run storybook` | Run Storybook dev server |
263261| `npm run build-storybook` | Build Storybook |
264262
265- ### Test App (`test-apps/react/ `)
263+ ### Test App (`test-apps/`)
266264
267265| Script | Description |
268266| ------------------------ | --------------------------------------- |
269267| `npm run dev` | Start Next.js development server |
270- | `npm run link:library` | Link to global @bytechef/embedded-react |
268+ | `npm run link:library` | Link to global @bytechef/embedded |
271269| `npm run unlink:library` | Unlink from global package |
272270| `npm run install:local` | Install from local registry |
273271| `npm run build` | Build production test app |
@@ -278,21 +276,21 @@ frontend/embedded/
278276
279277**Using npm link:**
280278
281- 1. Ensure `npm run watch` is running in library/react directory
282- 2. Check that the test app is linked: `ls -la test-apps/react/ node_modules/@bytechef/embedded-react ` (should show symlink)
279+ 1. Ensure `npm run watch` is running in library directory
280+ 2. Check that the test app is linked: `ls -la test-apps/node_modules/@bytechef/embedded` (should show symlink)
2832813. Try restarting the Next.js dev server
284282
285283**Using Verdaccio:**
286284
2872851. You need to republish after changes
2882862. Ensure test app is installing from local registry: check `@bytechef:registry` in `.npmrc`
289287
290- ### "Cannot find module @bytechef/embedded-react "
288+ ### "Cannot find module @bytechef/embedded"
291289
2922901. Check if the library is linked or installed:
293291
294292 ```bash
295- cd test-apps/react
293+ cd test-apps
296294 ls -la node_modules/@bytechef
297295 ```
298296
@@ -328,17 +326,17 @@ npm run setup:link # or your preferred method
328326
329327### Hot reload not working
330328
331- 1 . Ensure library watch mode is running: ` cd library/react && npm run watch `
329+ 1 . Ensure library watch mode is running: ` cd library && npm run watch `
3323302 . Check Vite output for build errors
333- 3 . Restart Next.js dev server: ` cd test-apps/react && npm run dev `
334- 4 . Check symlink exists: ` ls -la test-apps/react/ node_modules/@bytechef/embedded-react `
331+ 3 . Restart Next.js dev server: ` cd test-apps && npm run dev `
332+ 4 . Check symlink exists: ` ls -la test-apps/node_modules/@bytechef/embedded `
335333
336334### Type errors in test app
337335
338336The test app may cache old type definitions:
339337
340338``` bash
341- cd test-apps/react
339+ cd test-apps
342340rm -rf .next
343341npm run dev
344342```
@@ -375,4 +373,4 @@ npm run dev
3753733 . Start development servers
3763744 . Make changes and see them live!
377375
378- For more information about the library itself, see the main [ README.md] ( library/react/ README.md ) .
376+ For more information about the library itself, see the main [ README.md] ( library/README.md ) .
0 commit comments