Skip to content

Commit

Permalink
Merge pull request #1272 from use-the-fork/maintenance/pnpm-vite-jsx
Browse files Browse the repository at this point in the history
Maintenance/pnpm vite jsx (Enhancements to the Project Infrastructure)
  • Loading branch information
0xi4o authored Mar 12, 2024
2 parents 188e2ad + 6db48a9 commit 63d9c94
Show file tree
Hide file tree
Showing 151 changed files with 30,755 additions and 530 deletions.
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": "[email protected]",
"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

0 comments on commit 63d9c94

Please sign in to comment.