Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintenance/pnpm vite jsx (Enhancements to the Project Infrastructure) #1272

Merged
merged 29 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0f09faa
- Updated .js files to .jsx on frontend.
use-the-fork Nov 23, 2023
ea8e1c8
Merge branch 'main' of https://github.com/use-the-fork/Flowise into B…
use-the-fork Nov 23, 2023
e2b63e0
- fixing paths after merge
use-the-fork Nov 23, 2023
35ad74f
- Updated workflow and pre-commit to work with PNPM, modified package…
use-the-fork Nov 23, 2023
4061dd0
- Missed a few files that needed to be .jsx
use-the-fork Nov 23, 2023
3139152
Merge branch 'main' of https://github.com/use-the-fork/Flowise into m…
use-the-fork Nov 23, 2023
2c379b2
- Bring files up to date with latest merge
use-the-fork Nov 23, 2023
f0959fe
- Minor fixes to pass eslint checks.
use-the-fork Nov 23, 2023
c07c86e
- fixed new files that should be .jsx
use-the-fork Nov 24, 2023
4390734
- updated docker file to build with pnpm
use-the-fork Nov 24, 2023
ee39ce2
- Added VitePWA
use-the-fork Nov 24, 2023
98bdda5
Merge branch 'main' into maintenance/pnpm-vite-jsx
HenryHengZJ Nov 24, 2023
2356cc7
update component pnpm-lock.yaml
HenryHengZJ Nov 24, 2023
8ce3217
add turbo, changes to make it work across docker, docker-compose, npx
HenryHengZJ Nov 27, 2023
4e3f219
update readme and vite port
HenryHengZJ Nov 27, 2023
75a2915
Merge branch 'maintenance/pnpm-vite-jsx' of https://github.com/use-th…
use-the-fork Dec 5, 2023
5bc5378
Merge branch 'main' of https://github.com/use-the-fork/Flowise into m…
use-the-fork Dec 5, 2023
0ad9b9a
- Bring PR current with main branch.
use-the-fork Dec 5, 2023
8a3320a
Merge pull request #1 from use-the-fork/maintenance/vite-pnpm-tsup
use-the-fork Dec 5, 2023
53c330a
Minor changes to running in dev mode.
use-the-fork Dec 5, 2023
57f7bba
Merge pull request #2 from use-the-fork/maintenance/vite-pnpm-tsup
use-the-fork Dec 5, 2023
e3b5309
Fix merge conflicts
0xi4o Mar 6, 2024
6331a35
Fix build issues
0xi4o Mar 6, 2024
b804cea
Add type annotation for datasource
0xi4o Mar 6, 2024
fdc0baa
Fix missing image file
0xi4o Mar 6, 2024
de2ac1d
Update nuke command - remove .turbo dir
0xi4o Mar 7, 2024
7313891
Fix merge conflict
0xi4o Mar 12, 2024
e1e5ff6
Update lock file
0xi4o Mar 12, 2024
6db48a9
Fix build errors
0xi4o Mar 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ If applicable, add screenshots to help explain your problem.
If applicable, add exported flow in order to help replicating the problem.

**Setup**
- Installation [e.g. docker, `npx flowise start`, `yarn start`]

- Installation [e.g. docker, `npx flowise start`, `pnpm start`]
- Flowise Version [e.g. 1.2.11]
- OS: [e.g. macOS, Windows, Linux]
- Browser [e.g. chrome, safari]
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- run: npm i -g yarn
- run: npm i -g pnpm

- run: yarn install --ignore-engines
- run: pnpm install

- run: yarn lint
- run: pnpm lint

- run: yarn build
- run: pnpm build
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn quick # prettify
yarn lint-staged # eslint lint(also include prettify but prettify support more file extensions than eslint, so run prettify first)
pnpm quick # prettify
pnpm lint-staged # eslint lint(also include prettify but prettify support more file extensions than eslint, so run prettify first)
6 changes: 6 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
auto-install-peers = true
strict-peer-dependencies = false
prefer-workspace-packages = true
link-workspace-packages = deep
hoist = true
shamefully-hoist = true
20 changes: 10 additions & 10 deletions CONTRIBUTING-ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ Flowise 在一个单一的单体存储库中有 3 个不同的模块。

#### 先决条件

- 安装 [Yarn v1](https://classic.yarnpkg.com/en/docs/install)
- 安装 [PNPM](https://pnpm.io/installation)
```bash
npm i -g yarn
npm i -g pnpm
```

#### 逐步指南
Expand All @@ -71,45 +71,45 @@ Flowise 在一个单一的单体存储库中有 3 个不同的模块。
6. 安装所有模块的依赖项:

```bash
yarn install
pnpm install
```

7. 构建所有代码:

```bash
yarn build
pnpm build
```

8. 在[http://localhost:3000](http://localhost:3000)上启动应用程序

```bash
yarn start
pnpm start
```

9. 开发时:

- 在`packages/ui`中创建`.env`文件并指定`PORT`(参考`.env.example`)
- 在`packages/ui`中创建`.env`文件并指定`VITE_PORT`(参考`.env.example`)
- 在`packages/server`中创建`.env`文件并指定`PORT`(参考`.env.example`)
- 运行

```bash
yarn dev
pnpm dev
```

对`packages/ui`或`packages/server`进行的任何更改都将反映在[http://localhost:8080](http://localhost:8080)上

对于`packages/components`中进行的更改,再次运行`yarn build`以应用更改。
对于`packages/components`中进行的更改,再次运行`pnpm build`以应用更改。

10. 做完所有的更改后,运行以下命令来确保在生产环境中一切正常:

```bash
yarn build
pnpm build
```


```bash
yarn start
pnpm start
```

11. 提交代码并从指向 [Flowise 主分支](https://github.com/FlowiseAI/Flowise/tree/master) 的分叉分支上提交 Pull Request。
Expand Down
20 changes: 10 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ Flowise has 3 different modules in a single mono repository.

#### Prerequisite

- Install [Yarn v1](https://classic.yarnpkg.com/en/docs/install)
- Install [PNPM](https://pnpm.io/installation)
```bash
npm i -g yarn
npm i -g pnpm
```

#### Step by step
Expand All @@ -71,45 +71,45 @@ Flowise has 3 different modules in a single mono repository.
6. Install all dependencies of all modules:

```bash
yarn install
pnpm install
```

7. Build all the code:

```bash
yarn build
pnpm build
```

8. Start the app on [http://localhost:3000](http://localhost:3000)

```bash
yarn start
pnpm start
```

9. For development:

- Create `.env` file and specify the `PORT` (refer to `.env.example`) in `packages/ui`
- Create `.env` file and specify the `VITE_PORT` (refer to `.env.example`) in `packages/ui`
- Create `.env` file and specify the `PORT` (refer to `.env.example`) in `packages/server`
- Run

```bash
yarn dev
pnpm dev
```

Any changes made in `packages/ui` or `packages/server` will be reflected on [http://localhost:8080](http://localhost:8080)

For changes made in `packages/components`, run `yarn build` again to pickup the changes.
For changes made in `packages/components`, run `pnpm build` again to pickup the changes.

10. After making all the changes, run

```bash
yarn build
pnpm build
```

and

```bash
yarn start
pnpm start
```

to make sure everything works fine in production.
Expand Down
25 changes: 8 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,21 @@ RUN apk add --no-cache build-base cairo-dev pango-dev
# Install Chromium
RUN apk add --no-cache chromium

#install PNPM globaly
RUN npm install -g pnpm

ENV PUPPETEER_SKIP_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser

WORKDIR /usr/src/packages

# Copy root package.json and lockfile
COPY package.json yarn.loc[k] ./

# Copy components package.json
COPY packages/components/package.json ./packages/components/package.json

# Copy ui package.json
COPY packages/ui/package.json ./packages/ui/package.json

# Copy server package.json
COPY packages/server/package.json ./packages/server/package.json

RUN yarn install
WORKDIR /usr/src

# Copy app source
COPY . .

RUN yarn build
RUN pnpm install

RUN pnpm build

EXPOSE 3000

CMD [ "yarn", "start" ]
CMD [ "pnpm", "start" ]
14 changes: 7 additions & 7 deletions README-ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ Flowise 在一个单一的代码库中有 3 个不同的模块。

### 先决条件

- 安装 [Yarn v1](https://classic.yarnpkg.com/en/docs/install)
- 安装 [PNPM](https://pnpm.io/installation)
```bash
npm i -g yarn
npm i -g pnpm
```

### 设置
Expand All @@ -97,31 +97,31 @@ Flowise 在一个单一的代码库中有 3 个不同的模块。
3. 安装所有模块的依赖:

```bash
yarn install
pnpm install
```

4. 构建所有代码:

```bash
yarn build
pnpm build
```

5. 启动应用:

```bash
yarn start
pnpm start
```

现在可以在 [http://localhost:3000](http://localhost:3000) 访问应用

6. 用于开发构建:

- 在 `packages/ui` 中创建 `.env` 文件并指定 `PORT`(参考 `.env.example`)
- 在 `packages/ui` 中创建 `.env` 文件并指定 `VITE_PORT`(参考 `.env.example`)
- 在 `packages/server` 中创建 `.env` 文件并指定 `PORT`(参考 `.env.example`)
- 运行

```bash
yarn dev
pnpm dev
```

任何代码更改都会自动重新加载应用程序,访问 [http://localhost:8080](http://localhost:8080)
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ Flowise has 3 different modules in a single mono repository.

### Prerequisite

- Install [Yarn v1](https://classic.yarnpkg.com/en/docs/install)
- Install [Yarn v1](https://pnpm.io/installation)
```bash
npm i -g yarn
npm i -g pnpm
```

### Setup
Expand All @@ -97,31 +97,31 @@ Flowise has 3 different modules in a single mono repository.
3. Install all dependencies of all modules:

```bash
yarn install
pnpm install
```

4. Build all the code:

```bash
yarn build
pnpm build
```

5. Start the app:

```bash
yarn start
pnpm start
```

You can now access the app on [http://localhost:3000](http://localhost:3000)

6. For development build:

- Create `.env` file and specify the `PORT` (refer to `.env.example`) in `packages/ui`
- Create `.env` file and specify the `VITE_PORT` (refer to `.env.example`) in `packages/ui`
- Create `.env` file and specify the `PORT` (refer to `.env.example`) in `packages/server`
- Run

```bash
yarn dev
pnpm dev
```

Any code changes will reload the app automatically on [http://localhost:8080](http://localhost:8080)
Expand Down
21 changes: 14 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
],
"scripts": {
"build": "turbo run build",
"build-force": "turbo run build --force",
"build-force": "pnpm clean && turbo run build --force",
"dev": "turbo run dev --parallel",
"start": "run-script-os",
"start:windows": "cd packages/server/bin && run start",
"start:default": "cd packages/server/bin && ./run start",
"clean": "npm exec -ws -- rimraf dist build",
"clean": "pnpm --filter \"./packages/**\" clean",
"nuke": "pnpm --filter \"./packages/**\" nuke && rimraf node_modules .turbo",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"test": "turbo run test",
"lint": "eslint \"**/*.{js,jsx,ts,tsx,json,md}\"",
"lint-fix": "yarn lint --fix",
"lint-fix": "pnpm lint --fix",
"quick": "pretty-quick --staged",
"postinstall": "husky install",
"migration:create": "yarn typeorm migration:create"
"migration:create": "pnpm typeorm migration:create"
},
"lint-staged": {
"*.{js,jsx,ts,tsx,json,md}": "eslint --fix"
Expand All @@ -43,16 +43,23 @@
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-unused-imports": "^2.0.0",
"husky": "^8.0.1",
"kill-port": "^2.0.1",
"lint-staged": "^13.0.3",
"prettier": "^2.7.1",
"pretty-quick": "^3.1.3",
"rimraf": "^3.0.2",
"run-script-os": "^1.1.6",
"turbo": "^1.7.4",
"turbo": "1.10.16",
"typescript": "^4.8.4"
},
"packageManager": "pnpm@8.14.0",
"pnpm": {
"onlyBuiltDependencies": [
"sqlite3"
]
},
"engines": {
"node": ">=18.15.0"
"node": ">=18.15.0 <19.0.0 || ^20"
},
"resolutions": {
"@qdrant/openapi-typescript-fetch": "1.2.1"
Expand Down
4 changes: 1 addition & 3 deletions packages/components/gulpfile.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import gulp from 'gulp'

const { src, dest } = gulp
const { src, dest } = require('gulp')

function copyIcons() {
return src(['nodes/**/*.{jpg,png,svg}']).pipe(dest('dist/nodes'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export class HuggingFaceInference extends LLM implements HFInput {
const { HfInference } = await import('@huggingface/inference')
return { HfInference }
} catch (e) {
throw new Error('Please install huggingface as a dependency with, e.g. `yarn add @huggingface/inference`')
throw new Error('Please install huggingface as a dependency with, e.g. `pnpm install @huggingface/inference`')
}
}
}
2 changes: 1 addition & 1 deletion packages/components/nodes/llms/Cohere/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class Cohere extends LLM implements CohereInput {
const { default: cohere } = await import('cohere-ai')
return { cohere }
} catch (e) {
throw new Error('Please install cohere-ai as a dependency with, e.g. `yarn add cohere-ai`')
throw new Error('Please install cohere-ai as a dependency with, e.g. `pnpm install cohere-ai`')
}
}
}
Loading
Loading