Skip to content

Commit

Permalink
♻️ Use bun, biome, better ts config, new license and remove all barre…
Browse files Browse the repository at this point in the history
…l files (#1801)

Closes [#1754](#1754)
  • Loading branch information
baptisteArno authored Sep 25, 2024
1 parent 706a095 commit 10750f5
Show file tree
Hide file tree
Showing 2,870 changed files with 120,368 additions and 131,287 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Make sure to change this to your own random string of 32 characters (https://docs.typebot.io/self-hosting/docker#2-add-the-required-configuration)
# Make sure to change this to your own random string of 32 characters (https://docs.typebot.io/self-hosting/deploy/docker#2-add-the-required-configuration)
ENCRYPTION_SECRET=do+UspMmB/rewbX2K/rskFmtgGSSZ8Ta

DATABASE_URL=postgresql://postgres:typebot@typebot-db:5432/typebot
Expand All @@ -9,4 +9,4 @@ NEXTAUTH_URL=
NEXT_PUBLIC_VIEWER_URL=

ADMIN_EMAIL=
# For more configuration options check out: https://docs.typebot.io/self-hosting/configuration
# For more configuration options check out: https://docs.typebot.io/self-hosting/configuration
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

40 changes: 20 additions & 20 deletions .github/workflows/check-and-report-chats-usage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Check and report chats usage

on:
schedule:
- cron: '0 * * * *'
- cron: "0 * * * *"

jobs:
send:
Expand All @@ -11,24 +11,24 @@ jobs:
run:
working-directory: ./packages/scripts
env:
DATABASE_URL: '${{ secrets.DATABASE_URL }}'
ENCRYPTION_SECRET: '${{ secrets.ENCRYPTION_SECRET }}'
NEXTAUTH_URL: '${{ secrets.NEXTAUTH_URL }}'
NEXT_PUBLIC_VIEWER_URL: '${{ secrets.NEXT_PUBLIC_VIEWER_URL }}'
NEXT_PUBLIC_POSTHOG_KEY: '${{ secrets.NEXT_PUBLIC_POSTHOG_KEY }}'
NEXT_PUBLIC_POSTHOG_HOST: '${{ secrets.NEXT_PUBLIC_POSTHOG_HOST }}'
SMTP_USERNAME: '${{ secrets.SMTP_USERNAME }}'
SMTP_PASSWORD: '${{ secrets.SMTP_PASSWORD }}'
SMTP_HOST: '${{ secrets.SMTP_HOST }}'
SMTP_PORT: '${{ secrets.SMTP_PORT }}'
NEXT_PUBLIC_SMTP_FROM: '${{ secrets.NEXT_PUBLIC_SMTP_FROM }}'
STRIPE_SECRET_KEY: '${{ secrets.STRIPE_SECRET_KEY }}'
STRIPE_STARTER_PRICE_ID: '${{ secrets.STRIPE_STARTER_PRICE_ID }}'
STRIPE_STARTER_CHATS_PRICE_ID: '${{ secrets.STRIPE_STARTER_CHATS_PRICE_ID }}'
STRIPE_PRO_PRICE_ID: '${{ secrets.STRIPE_PRO_PRICE_ID }}'
STRIPE_PRO_CHATS_PRICE_ID: '${{ secrets.STRIPE_PRO_CHATS_PRICE_ID }}'
DATABASE_URL: "${{ secrets.DATABASE_URL }}"
ENCRYPTION_SECRET: "${{ secrets.ENCRYPTION_SECRET }}"
NEXTAUTH_URL: "${{ secrets.NEXTAUTH_URL }}"
NEXT_PUBLIC_VIEWER_URL: "${{ secrets.NEXT_PUBLIC_VIEWER_URL }}"
NEXT_PUBLIC_POSTHOG_KEY: "${{ secrets.NEXT_PUBLIC_POSTHOG_KEY }}"
NEXT_PUBLIC_POSTHOG_HOST: "${{ secrets.NEXT_PUBLIC_POSTHOG_HOST }}"
SMTP_USERNAME: "${{ secrets.SMTP_USERNAME }}"
SMTP_PASSWORD: "${{ secrets.SMTP_PASSWORD }}"
SMTP_HOST: "${{ secrets.SMTP_HOST }}"
SMTP_PORT: "${{ secrets.SMTP_PORT }}"
NEXT_PUBLIC_SMTP_FROM: "${{ secrets.NEXT_PUBLIC_SMTP_FROM }}"
STRIPE_SECRET_KEY: "${{ secrets.STRIPE_SECRET_KEY }}"
STRIPE_STARTER_PRICE_ID: "${{ secrets.STRIPE_STARTER_PRICE_ID }}"
STRIPE_STARTER_CHATS_PRICE_ID: "${{ secrets.STRIPE_STARTER_CHATS_PRICE_ID }}"
STRIPE_PRO_PRICE_ID: "${{ secrets.STRIPE_PRO_PRICE_ID }}"
STRIPE_PRO_CHATS_PRICE_ID: "${{ secrets.STRIPE_PRO_CHATS_PRICE_ID }}"
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v4
- run: pnpm i --frozen-lockfile
- run: pnpm turbo run checkAndReportChatsUsage
- uses: oven-sh/setup-bun@v2
- run: bun install
- run: bunx turbo run checkAndReportChatsUsage
16 changes: 8 additions & 8 deletions .github/workflows/clean-database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Daily database cleanup

on:
schedule:
- cron: '0 6 * * *'
- cron: "0 6 * * *"

jobs:
clean:
Expand All @@ -11,12 +11,12 @@ jobs:
run:
working-directory: ./packages/scripts
env:
DATABASE_URL: '${{ secrets.DATABASE_URL }}'
ENCRYPTION_SECRET: '${{ secrets.ENCRYPTION_SECRET }}'
NEXTAUTH_URL: 'http://localhost:3000'
NEXT_PUBLIC_VIEWER_URL: 'http://localhost:3001'
DATABASE_URL: "${{ secrets.DATABASE_URL }}"
ENCRYPTION_SECRET: "${{ secrets.ENCRYPTION_SECRET }}"
NEXTAUTH_URL: "http://localhost:3000"
NEXT_PUBLIC_VIEWER_URL: "http://localhost:3001"
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v4
- run: pnpm i --frozen-lockfile
- run: pnpm turbo run db:cleanDatabase
- uses: oven-sh/setup-bun@v2
- run: bun install
- run: bunx turbo run db:cleanDatabase
12 changes: 6 additions & 6 deletions .github/workflows/publish-lib-to-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish typebot-js to NPM
on:
push:
tags:
- 'js-lib-v*'
- "js-lib-v*"

jobs:
publish:
Expand All @@ -12,12 +12,12 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v4
- run: pnpm i --frozen-lockfile
- run: pnpm turbo build --filter=typebot-js...
- uses: oven-sh/setup-bun@v2
- run: bun install
- run: bunx turbo build --filter=typebot-js...
- name: Set NPM_TOKEN in config
run: pnpm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
run: bun run npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
working-directory: ./packages/typebot-js
- name: Publish
run: pnpm publish --no-git-checks --access public
run: bun run npm publish --no-git-checks --access public
working-directory: ./packages/typebot-js
10 changes: 5 additions & 5 deletions .github/workflows/publish-typebot-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish @typebot.io/js package to NPM
on:
push:
tags:
- 'js-v*'
- "js-v*"

jobs:
publish:
Expand All @@ -12,7 +12,7 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v4
- run: pnpm i --frozen-lockfile
- run: pnpm turbo build [email protected]/js...
- run: cd packages/embeds/js && pnpm publish --no-git-checks --access public
- uses: oven-sh/setup-bun@v2
- run: bun install
- run: bunx turbo build [email protected]/js...
- run: cd packages/embeds/js && bun run npm publish --no-git-checks --access public
10 changes: 5 additions & 5 deletions .github/workflows/publish-typebot-nextjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish @typebot.io/nextjs package to NPM
on:
push:
tags:
- 'nextjs-v*'
- "nextjs-v*"

jobs:
publish:
Expand All @@ -12,7 +12,7 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v4
- run: pnpm i --frozen-lockfile
- run: pnpm turbo build [email protected]/nextjs...
- run: cd packages/embeds/nextjs && pnpm publish --no-git-checks --access public
- uses: oven-sh/setup-bun@v2
- run: bun install
- run: bunx turbo build [email protected]/nextjs...
- run: cd packages/embeds/nextjs && bun run npm publish --no-git-checks --access public
10 changes: 5 additions & 5 deletions .github/workflows/publish-typebot-react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish @typebot.io/react package to NPM
on:
push:
tags:
- 'react-v*'
- "react-v*"

jobs:
publish:
Expand All @@ -12,7 +12,7 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v4
- run: pnpm i --frozen-lockfile
- run: pnpm turbo build [email protected]/react...
- run: cd packages/embeds/react && pnpm publish --no-git-checks --access public
- uses: oven-sh/setup-bun@v2
- run: bun install
- run: bunx turbo build [email protected]/react...
- run: cd packages/embeds/react && bun run npm publish --no-git-checks --access public
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,10 @@ snapshots
.env
.typebot-build

.tolgee
.tolgee

*.tsbuildinfo

.tsup

.env.docker
5 changes: 1 addition & 4 deletions .husky/pre-commit
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm lint && pnpm format:check
bun pre-commit
18 changes: 0 additions & 18 deletions .pnpmfile.cjs

This file was deleted.

4 changes: 0 additions & 4 deletions .prettierignore

This file was deleted.

6 changes: 0 additions & 6 deletions .prettierrc

This file was deleted.

2 changes: 2 additions & 0 deletions .prototools
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bun = "1.1.29"
node = "20.17.0"
6 changes: 2 additions & 4 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"bradlc.vscode-tailwindcss",
"unifiedjs.vscode-mdx",
"lokalise.i18n-ally",
"Prisma.prisma"
"Prisma.prisma",
"biomejs.biome"
]
}
27 changes: 0 additions & 27 deletions .vscode/i18n-ally-custom-framework.yml

This file was deleted.

33 changes: 21 additions & 12 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
{
"i18n-ally.localesPaths": ["apps/builder/src/i18n"],
"i18n-ally.keystyle": "flat",
"i18n-ally.displayLanguage": "en",
"i18n-ally.enabledFrameworks": ["custom"],
"i18n-ally.sortKeys": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.tabSize": 2,
"typescript.updateImportsOnFileMove.enabled": "always",
"[prisma]": {
"editor.defaultFormatter": "Prisma.prisma"
}
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.preferences.autoImportFileExcludePatterns": [
"next/router.d.ts",
"next/dist/client/router.d.ts"
],
"editor.defaultFormatter": "biomejs.biome",
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit",
"source.organizeImports.biome": "explicit"
},
"eslint.enable": false,
"prettier.enable": false
}
Loading

0 comments on commit 10750f5

Please sign in to comment.