Skip to content

Commit

Permalink
Migrate NPM from VortexWest to RasaHQ organization (#82)
Browse files Browse the repository at this point in the history
MicicFilip authored Oct 3, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent b007711 commit c21d8f8
Showing 26 changed files with 47 additions and 65 deletions.
30 changes: 8 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -51,28 +51,22 @@ npm run build

## How to Use the Chat Widget in a React Application

```
# TODO: Replace npm organization with RasaHQ.
```

This guide will show you how to integrate the Rasa chatbot widget into your React application using the `@vortexwest/chat-widget-react` package.
This guide will show you how to integrate the Rasa chatbot widget into your React application using the `@rasahq/chat-widget-react` package.

### Step 1: Install the Package

First, you need to install the chat widget package via NPM. Run the following command in your project directory:

```bash
# TODO: Replace npm organization with RasaHQ.
npm install @vortexwest/chat-widget-react
npm install @rasahq/chat-widget-react
```

### Step 2: Import the Chat Widget

In your React component, import the RasaChatbotWidget from the installed package:

```javascript
// TODO: Replace npm organization with RasaHQ.
import { RasaChatbotWidget } from "@vortexwest/chat-widget-react";
import { RasaChatbotWidget } from "@rasahq/chat-widget-react";
```

### Step 3: Use the Chat Widget
@@ -96,11 +90,7 @@ export default App;

### Notes:

```
# TODO: Replace npm organization with RasaHQ.
```

- **Installing via NPM:** The package `@vortexwest/chat-widget-react` should be installed in your project via NPM. This package provides the RasaChatbotWidget component, making it easy to integrate the chatbot into your React application.
- **Installing via NPM:** The package `@rasahq/chat-widget-react` should be installed in your project via NPM. This package provides the RasaChatbotWidget component, making it easy to integrate the chatbot into your React application.
- **Handling Events:** You can handle various events such as `onChatWidgetOpened`, `onMessageSent`, etc., by passing the corresponding callback functions as props to the RasaChatbotWidget component.
- React example you can find [here](examples/react/src/App.tsx)
- For a complete list of available events and props, refer to the [documentation](packages/ui/src/rasa-chatbot-widget/readme.md)
@@ -114,10 +104,9 @@ This guide will show you how to integrate the Rasa chatbot widget into your webp
In the <head> section of your HTML file, include the script tag to load the chat widget module. This script fetches the necessary JavaScript from a CDN.

```html
<!-- TODO: Replace npm organization with RasaHQ. -->
<script
type="module"
src="https://unpkg.com/@vortexwest/chat-widget-ui/dist/rasa-chatwigdet/rasa-chatwigdet.esm.js"
src="https://unpkg.com/@rasahq/chat-widget-ui/dist/rasa-chatwigdet/rasa-chatwigdet.esm.js"
></script>
```

@@ -126,10 +115,9 @@ In the <head> section of your HTML file, include the script tag to load the chat
Also, include the CSS file to ensure the widget is styled correctly.

```html
<!-- TODO: Replace npm organization with RasaHQ. -->
<link
rel="stylesheet"
href="https://unpkg.com/@vortexwest/chat-widget-ui/dist/rasa-chatwigdet/rasa-chatwigdet.css"
href="https://unpkg.com/@rasahq/chat-widget-ui/dist/rasa-chatwigdet/rasa-chatwigdet.css"
/>
```

@@ -150,15 +138,13 @@ In the <body> section of your HTML, add the chat widget’s custom element. Make
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>HTML Example</title>
<!-- TODO: Replace npm organization with RasaHQ. -->
<script
type="module"
src="https://unpkg.com/@vortexwest/chat-widget-ui/dist/rasa-chatwigdet/rasa-chatwigdet.esm.js"
src="https://unpkg.com/@rasahq/chat-widget-ui/dist/rasa-chatwigdet/rasa-chatwigdet.esm.js"
></script>
<!-- TODO: Replace npm organization with RasaHQ. -->
<link
rel="stylesheet"
href="https://unpkg.com/@vortexwest/chat-widget-ui/dist/rasa-chatwigdet/rasa-chatwigdet.css"
href="https://unpkg.com/@rasahq/chat-widget-ui/dist/rasa-chatwigdet/rasa-chatwigdet.css"
/>
</head>
<body>
4 changes: 2 additions & 2 deletions e2e/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vortexwest/e2e-test-suite",
"version": "0.1.1",
"name": "@rasahq/e2e-test-suite",
"version": "0.1.0",
"private": true,
"description": "E2E test suite with Cypress framework",
"main": "index.js",
4 changes: 2 additions & 2 deletions examples/html/index.html
Original file line number Diff line number Diff line change
@@ -6,11 +6,11 @@
<title>HTML Example</title>
<script
type="module"
src="https://unpkg.com/@vortexwest/chat-widget-ui/dist/rasa-chatwigdet/rasa-chatwigdet.esm.js"
src="https://unpkg.com/@rasahq/chat-widget-ui/dist/rasa-chatwigdet/rasa-chatwigdet.esm.js"
></script>
<link
rel="stylesheet"
href="https://unpkg.com/@vortexwest/chat-widget-ui/dist/rasa-chatwigdet/rasa-chatwigdet.css"
href="https://unpkg.com/@rasahq/chat-widget-ui/dist/rasa-chatwigdet/rasa-chatwigdet.css"
/>
</head>
<body>
2 changes: 1 addition & 1 deletion examples/react/package.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
"preview": "vite preview"
},
"dependencies": {
"@vortexwest/chat-widget-react": "^0.1.0",
"@rasahq/chat-widget-react": "^0.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
2 changes: 1 addition & 1 deletion examples/react/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RasaChatbotWidget } from "@vortexwest/chat-widget-react";
import { RasaChatbotWidget } from "@rasahq/chat-widget-react";

function App() {
return (
6 changes: 3 additions & 3 deletions packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vortexwest/chat-widget-react",
"version": "0.1.2",
"name": "@rasahq/chat-widget-react",
"version": "0.1.0",
"publishConfig": {
"access": "restricted"
},
@@ -27,7 +27,7 @@
"test": "jest"
},
"dependencies": {
"@vortexwest/chat-widget-ui": "^0.1.2"
"@rasahq/chat-widget-ui": "^0.1.0"
},
"devDependencies": {
"@babel/preset-env": "^7.24.8",
6 changes: 2 additions & 4 deletions packages/sdk/README.md
Original file line number Diff line number Diff line change
@@ -7,8 +7,7 @@ The core package provides essential functionality to connect and interact with a
Install the core package using npm:

```bash
# TODO: Replace npm organization with RasaHQ.
npm install '@vortexwest/chat-widget-sdk'
npm install '@rasahq/chat-widget-sdk'
```

## Initialization
@@ -69,8 +68,7 @@ this.rasa.on('message', this.onNewMessage);
## Full Example

```typescript
// TODO: Replace npm organization with RasaHQ.
import { Rasa } from '@vortexwest/chat-widget-sdk';
import { Rasa } from '@rasahq/chat-widget-sdk';

const rasa = new Rasa({
url: 'http://example.com',
4 changes: 2 additions & 2 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vortexwest/chat-widget-sdk",
"version": "0.1.2",
"name": "@rasahq/chat-widget-sdk",
"version": "0.1.0",
"publishConfig": {
"access": "restricted"
},
8 changes: 3 additions & 5 deletions packages/ui/README.md
Original file line number Diff line number Diff line change
@@ -9,18 +9,16 @@ A customizable chat widget built with StencilJS. This widget can be easily integ
To install the chat widget via npm, run the following command:

```bash
# TODO: Replace npm organization with RasaHQ.
npm install @vortexwest/chat-widget-ui
npm install @rasahq/chat-widget-ui
```

### Using CDN

Alternatively, you can use a CDN to include the chat widget in your project:

```html
<!-- TODO: Replace npm organization with RasaHQ. -->
<script type="module" src="https://unpkg.com/@vortexwest/chat-widget-ui/dist/rasa-chatwigdet/rasa-chatwigdet.esm.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@vortexwest/chat-widget-ui/dist/rasa-chatwigdet/rasa-chatwigdet.css" />
<script type="module" src="https://unpkg.com/@rasahq/chat-widget-ui/dist/rasa-chatwigdet/rasa-chatwigdet.esm.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@rasahq/chat-widget-ui/dist/rasa-chatwigdet/rasa-chatwigdet.css" />
```

## Usage
2 changes: 1 addition & 1 deletion packages/ui/jest.config.js
Original file line number Diff line number Diff line change
@@ -8,6 +8,6 @@ module.exports = {
'^.+\\.(js|jsx)$': 'babel-jest',
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
transformIgnorePatterns: ['/node_modules/(?!(@vortexwest)/).*/'],
transformIgnorePatterns: ['/node_modules/(?!(@rasahq)/).*/'],
preset: '@stencil/core/testing',
};
6 changes: 3 additions & 3 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vortexwest/chat-widget-ui",
"version": "0.1.2",
"name": "@rasahq/chat-widget-ui",
"version": "0.1.0",
"publishConfig": {
"access": "restricted"
},
@@ -31,7 +31,7 @@
"generate:icons": "node ./scripts/generate-icons.js"
},
"dependencies": {
"@vortexwest/chat-widget-sdk": "^0.1.2",
"@rasahq/chat-widget-sdk": "^0.1.0",
"uuid": "^10.0.0"
},
"devDependencies": {
2 changes: 1 addition & 1 deletion packages/ui/src/components/carousel/carousel.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CarouselElement } from '@vortexwest/chat-widget-sdk';
import { CarouselElement } from '@rasahq/chat-widget-sdk';
import { Component, h, State, Element, Prop, Event, EventEmitter } from '@stencil/core';
import { messageQueueService } from '../../store/message-queue';

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CUSTOM_ERROR_NAME, CustomErrorClass, ErrorSeverity } from '@vortexwest/chat-widget-sdk';
import { CUSTOM_ERROR_NAME, CustomErrorClass, ErrorSeverity } from '@rasahq/chat-widget-sdk';
import { Component, Host, h } from '@stencil/core';

import { errorMessageService } from '../../store/error-message';
2 changes: 1 addition & 1 deletion packages/ui/src/components/error-toast/error-toast.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, Element, Host, State, h } from '@stencil/core';

import { CustomErrorClass } from '@vortexwest/chat-widget-sdk';
import { CustomErrorClass } from '@rasahq/chat-widget-sdk';
import { configStore } from '../../store/config-store';
import { errorMessageService } from '../../store/error-message';

2 changes: 1 addition & 1 deletion packages/ui/src/components/quick-reply/quick-reply.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, Event, EventEmitter, Host, Listen, Prop, State, h } from '@stencil/core';
import { QuickReply, QuickReplyMessage, SENDER } from '@vortexwest/chat-widget-sdk';
import { QuickReply, QuickReplyMessage, SENDER } from '@rasahq/chat-widget-sdk';

import { messageQueueService } from '../../store/message-queue';
import { widgetState } from '../../store/widget-state-store';
4 changes: 2 additions & 2 deletions packages/ui/src/components/text-message/text-message.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, Host, Prop, h } from '@stencil/core';

import { SENDER } from '@vortexwest/chat-widget-sdk';
import { SenderType } from '@vortexwest/chat-widget-sdk/dist/types/common.types';
import { SENDER } from '@rasahq/chat-widget-sdk';
import { SenderType } from '@rasahq/chat-widget-sdk/dist/types/common.types';
import { configStore } from '../../store/config-store';
import { messageQueueService } from '../../store/message-queue';

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, h } from '@stencil/core';

import { SENDER } from '@vortexwest/chat-widget-sdk/dist/constants';
import { SENDER } from '@rasahq/chat-widget-sdk/dist/constants';

@Component({
tag: 'rasa-typing-indicator',
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, Element, Event, EventEmitter, Listen, Prop, State, Watch, h } from '@stencil/core/internal';
import { v4 as uuidv4 } from 'uuid';

import { MESSAGE_TYPES, Message, QuickReply, QuickReplyMessage, Rasa, SENDER } from '@vortexwest/chat-widget-sdk';
import { MESSAGE_TYPES, Message, QuickReply, QuickReplyMessage, Rasa, SENDER } from '@rasahq/chat-widget-sdk';

import { Messenger } from '../components/messenger';
import { configStore, setConfigStore } from '../store/config-store';
2 changes: 1 addition & 1 deletion packages/ui/src/store/error-message.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CustomErrorClass } from '@vortexwest/chat-widget-sdk';
import { CustomErrorClass } from '@rasahq/chat-widget-sdk';
import { createStore } from '@stencil/store';

const { state, onChange } = createStore({
2 changes: 1 addition & 1 deletion packages/ui/src/store/message-queue.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Message } from '@vortexwest/chat-widget-sdk';
import { Message } from '@rasahq/chat-widget-sdk';
import { createStore } from '@stencil/store';

const { state, onChange } = createStore({
2 changes: 1 addition & 1 deletion packages/ui/src/utils/construct-video-url.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CustomErrorClass, ErrorSeverity } from '@vortexwest/chat-widget-sdk';
import { CustomErrorClass, ErrorSeverity } from '@rasahq/chat-widget-sdk';

interface constructVideoUrlProps {
videoSrc: string;
2 changes: 1 addition & 1 deletion packages/ui/src/utils/format-datetime.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CustomErrorClass, ErrorSeverity } from '@vortexwest/chat-widget-sdk';
import { CustomErrorClass, ErrorSeverity } from '@rasahq/chat-widget-sdk';

export const formatDateTime = (date: Date) => {
if (!date) {
2 changes: 1 addition & 1 deletion packages/ui/src/utils/text-parser.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Supporting Bold Italic and Link commonmark markdown

import { CustomErrorClass, ErrorSeverity } from '@vortexwest/chat-widget-sdk';
import { CustomErrorClass, ErrorSeverity } from '@rasahq/chat-widget-sdk';

// For more information check https://commonmark.org/help/
export interface TextSegment {
2 changes: 1 addition & 1 deletion packages/ui/stencil.config.ts
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ export const config: Config = {
copy: [{ src: 'assets/fonts', dest: 'assets/fonts' }],
},
reactOutputTarget({
componentCorePackage: '@vortexwest/chat-widget-ui',
componentCorePackage: '@rasahq/chat-widget-ui',
proxiesFile: '../react/lib/components/stencil-generated/index.ts',
includeDefineCustomElements: true,
excludeComponents: [
6 changes: 3 additions & 3 deletions storybook/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import "@vortexwest/chat-widget-ui/dist/rasa-chatwigdet/rasa-chatwigdet.css";
import "@rasahq/chat-widget-ui/dist/rasa-chatwigdet/rasa-chatwigdet.css";

import { defineCustomElements } from "@vortexwest/chat-widget-ui/loader";
import docJson from "@vortexwest/chat-widget-ui/doc/docs.json";
import { defineCustomElements } from "@rasahq/chat-widget-ui/loader";
import docJson from "@rasahq/chat-widget-ui/doc/docs.json";
import { setStencilDocJson } from "../addons/doc-stenciljs";

defineCustomElements();
4 changes: 2 additions & 2 deletions storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@vortexwest/storybook",
"name": "@rasahq/storybook",
"version": "0.1.0",
"private": true,
"type": "module",
@@ -24,7 +24,7 @@
"vite": "^5.2.0"
},
"dependencies": {
"@vortexwest/chat-widget-ui": "^0.1.11",
"@rasahq/chat-widget-ui": "^0.1.0",
"storybook": "^8.1.10"
}
}

0 comments on commit c21d8f8

Please sign in to comment.