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

fix(starters): improve drizzle integration #7288

Merged
merged 8 commits into from
Jan 29, 2025
Merged

Conversation

sreeisalso
Copy link
Contributor

@sreeisalso sreeisalso commented Jan 28, 2025

What is it?

  • Feature / enhancement

Description

Updated to latest drizzle and better-sqlite3

Checklist

  • My code follows the developer guidelines of this project
  • I performed a self-review of my own code
  • I added a changeset with pnpm change
  • I made corresponding changes to the Qwik docs
  • I added new tests to cover the fix / functionality

Copy link

changeset-bot bot commented Jan 28, 2025

🦋 Changeset detected

Latest commit: 4f5a393

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@builder.io/qwik Patch
eslint-plugin-qwik Patch
@builder.io/qwik-city Patch
create-qwik Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

pkg-pr-new bot commented Jan 28, 2025

Open in Stackblitz

npm i https://pkg.pr.new/@builder.io/qwik@7288
npm i https://pkg.pr.new/@builder.io/qwik-city@7288
npm i https://pkg.pr.new/eslint-plugin-qwik@7288
npm i https://pkg.pr.new/create-qwik@7288

commit: 4f5a393

Copy link
Contributor

github-actions bot commented Jan 28, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
qwik-docs ✅ Ready (View Log) Visit Preview 58e0da0

@sreeisalso
Copy link
Contributor Author

sreeisalso commented Jan 28, 2025

@wmertens
Why does the Build Qwik step is skipped in this pr, I have no expertise to check github workflow, due to which I'm not able to check the working of this pr.

@gioboa
Copy link
Member

gioboa commented Jan 28, 2025

Why does the Build Qwik step is skipped in this pr, I have no expertise to check github workflow, due to which I'm not able to check the working of this pr.

Thanks @sreeisalso , that's because you didn't change anything about Qwik core in this PR.
is it ready for review?

@sreeisalso
Copy link
Contributor Author

sreeisalso commented Jan 28, 2025

need to test, everythig is ready , for testing qwik-cli has to re build

@gioboa
Copy link
Member

gioboa commented Jan 28, 2025

Can you add a comment with a screenshot about the working starter with Drizzle please?

@sreeisalso
Copy link
Contributor Author

sreeisalso commented Jan 28, 2025

@gioboa changes not reflecting because qwik cli is not rebuilt?

Can you add a comment with a screenshot about the working starter with Drizzle please?

Screenshot from 2025-01-28 14-46-53
Screenshot from 2025-01-28 14-51-20

@gioboa
Copy link
Member

gioboa commented Jan 28, 2025

changes not reflecting because qwik cli is not rebuilt?

Yep, you need to use pnpm build.local and then link the packages.
you can use these versions as well.

@sreeisalso
Copy link
Contributor Author

sreeisalso commented Jan 28, 2025

Yep, you need to use pnpm build.local and then link the packages. you can use these versions as well.

@gioboa tried given link also, but the result is same as previous screen shot,
my machine is not able to build localy 😞

@gioboa
Copy link
Member

gioboa commented Jan 28, 2025

Yep, you need to use pnpm build.local and then link the packages. you can use these versions as well.

@gioboa tried given link also, but the result is same as previous screen shot, my machine is not able to build localy 😞

Let me check.

@gioboa
Copy link
Member

gioboa commented Jan 28, 2025

You can run build.local and then link.dist
Now in a new Qwik application you can run pnpm link -g @builder.io/qwik
now you can run pnpm qwik add drizzle correctly

@gioboa
Copy link
Member

gioboa commented Jan 28, 2025

@sreeisalso do you need help to test it?

@sreeisalso
Copy link
Contributor Author

@sreeisalso do you need help to test it?

I will try today once back to system

@sreeisalso
Copy link
Contributor Author

I'm getting following error while building

⚛️  supabase-auth-helpers-qwik
packages/docs/src/repl/worker/repl-dependencies.ts:51:3 - error TS2740: Type '{ isServer: true; isBrowser: false; isDev: false; }' is missing the following properties from type 'typeof import("/home/sreeisalso/workspace/github/qwik/packages/qwik/dist/core")': getLocale, useServerData, withLocale, $, and 86 more.

51   self.qwikBuild = {
     ~~~~~~~~~~~~~~


Found 1 error in packages/docs/src/repl/worker/repl-dependencies.ts:51


❌ Error: Command failed with exit code 2: tsc -p packages/docs/tsconfig.json
    at makeError (file:///home/sreeisalso/workspace/github/qwik/node_modules/.pnpm/[email protected]/node_modules/execa/lib/error.js:60:11)
    at handlePromise (file:///home/sreeisalso/workspace/github/qwik/node_modules/.pnpm/[email protected]/node_modules/execa/index.js:124:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async tscDocs (/home/sreeisalso/workspace/github/qwik/scripts/tsc-docs.ts:8:18)
    at async build (/home/sreeisalso/workspace/github/qwik/scripts/build.ts:147:7)
 Error: Error: Command failed with exit code 2: tsc -p packages/docs/tsconfig.json
    at makeError (file:///home/sreeisalso/workspace/github/qwik/node_modules/.pnpm/[email protected]/node_modules/execa/lib/error.js:60:11)
    at handlePromise (file:///home/sreeisalso/workspace/github/qwik/node_modules/.pnpm/[email protected]/node_modules/execa/index.js:124:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async tscDocs (/home/sreeisalso/workspace/github/qwik/scripts/tsc-docs.ts:8:18)
    at async build (/home/sreeisalso/workspace/github/qwik/scripts/build.ts:147:7)
    at panic (/home/sreeisalso/workspace/github/qwik/scripts/util.ts:287:33)
    at build (/home/sreeisalso/workspace/github/qwik/scripts/build.ts:192:5)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
 ELIFECYCLE  Command failed with exit code 1.

@sreeisalso
Copy link
Contributor Author

tried

pnpm build.core
pnpm link.dist

for test 
pnpm link -g @builder.io/qwik
pnpm i

after this it is working, please find the below logs

pnpm qwik add drizzle

> my-qwik-empty-starter@ qwik /home/sreeisalso/workspace/tmp/qwik-app
> qwik "add" "drizzle"


      ............
    .::: :--------:.
   .::::  .:-------:.
  .:::::.   .:-------.
  ::::::.     .:------.
 ::::::.        :-----:
 ::::::.       .:-----.
  :::::::.     .-----.
   ::::::::..   ---:.
    .:::::::::. :-:.
     ..::::::::::::
             ...::::
     

┌  🦋  Add Integration  drizzle
│
◇  👻  Ready?  Add drizzle to your app?
│
│  🐬 Modify
│     - package.json
│
│  🌟 Create
│     - drizzle.config.ts
│     - drizzle/schema.ts
│     - drizzle/migrations/.gitkeep
│     - drizzle/db/.gitkeep
│     - src/routes/users/index.tsx
│     - src/routes/users/[userId]/index.tsx
│     - src/routes/create/index.tsx
│
│  💾 Install pnpm dependencies:
│     - @types/better-sqlite3 ^7.6.12
│     - drizzle-kit ^0.30.3
│     - better-sqlite3 ^11.8.1
│     - drizzle-orm ^0.39.0
│
│  📜 New pnpm scripts:
│     - pnpm drizzle:generate
│     - pnpm drizzle:migrate
│     - pnpm drizzle:push
│     - pnpm drizzle:pull
│     - pnpm drizzle:check
│     - pnpm drizzle:up
│     - pnpm drizzle:studio
│     - pnpm postinstall
│
◆  Ready to apply the drizzle updates to your app?
│  ● Yes looks good, finish update!
│  ○ Nope, cancel update
└

result after successfull addition

◇  App updated
│
◇  New scripts added ───────╮
│                           │
│  - pnpm drizzle:generate  │
│  - pnpm drizzle:migrate   │
│  - pnpm drizzle:push      │
│  - pnpm drizzle:pull      │
│  - pnpm drizzle:check     │
│  - pnpm drizzle:up        │
│  - pnpm drizzle:studio    │
│  - pnpm postinstall       │
│                           │
├───────────────────────────╯
│
◇  🟣  Next Steps  ──────────────────────────────────────────────────────────────────────────╮
│                                                                                            │
│   Drizzle was installed with a simple DB schema and some demo routes,                      │
│                                                                                            │
│   better-sqlite3 was configured by default, but in production                              │
│   you'll want to use Postgres or MySQL.                                                    │
│                                                                                            │
│                                                                                            │
│   Drizzle studio was also added which you can access by running `npm run drizzle:studio`,  │
│                                                                                            │
│   Check out the Drizzle docs for more info:                                                │
│     - https://orm.drizzle.team/docs/overview                                               │
│                                                                                            │
├────────────────────────────────────────────────────────────────────────────────────────────╯

└  🦄  Success!  Added drizzle to your app

package.json file screenshot

Screenshot from 2025-01-29 10-54-45

@sreeisalso sreeisalso marked this pull request as ready for review January 29, 2025 05:25
@sreeisalso sreeisalso requested a review from a team as a code owner January 29, 2025 05:25
Copy link
Member

@gioboa gioboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🎉 that's great 👏
Let me try it

Copy link
Member

@gioboa gioboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice PR @sreeisalso Thanks 🥳

@gioboa gioboa enabled auto-merge (squash) January 29, 2025 09:26
@gioboa gioboa disabled auto-merge January 29, 2025 09:27
@gioboa gioboa changed the title fix:drizzle latest fix(starter): improve drizzle integration Jan 29, 2025
@gioboa gioboa changed the title fix(starter): improve drizzle integration fix(starters): improve drizzle integration Jan 29, 2025
@gioboa gioboa enabled auto-merge (squash) January 29, 2025 09:28
@gioboa gioboa merged commit a784e77 into QwikDev:main Jan 29, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants