-
Notifications
You must be signed in to change notification settings - Fork 75
feat: add Nuxt module and documentation #187
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 81eab85 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔧 Build Fix:
The Nuxt module incorrectly references 'workflow/nitro' when registering a Nitro module, but it should reference '@workflow/nitro' directly to avoid module resolution issues during the build process.
View Details
📝 Patch Details
diff --git a/packages/nuxt/src/module.ts b/packages/nuxt/src/module.ts
index 1002d59..9777a12 100644
--- a/packages/nuxt/src/module.ts
+++ b/packages/nuxt/src/module.ts
@@ -14,8 +14,8 @@ export default defineNuxtModule<ModuleOptions>({
setup(_options, nuxt) {
nuxt.options.nitro ||= {};
nuxt.options.nitro.modules ||= [];
- if (!nuxt.options.nitro.modules.includes('workflow/nitro')) {
- nuxt.options.nitro.modules.push('workflow/nitro');
+ if (!nuxt.options.nitro.modules.includes('@workflow/nitro')) {
+ nuxt.options.nitro.modules.push('@workflow/nitro');
}
},
});
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index b305d06..1542d93 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -516,6 +516,9 @@ importers:
'@workflow/nitro':
specifier: workspace:*
version: link:../nitro
+ workflow:
+ specifier: workspace:*
+ version: link:../workflow
devDependencies:
'@nuxt/module-builder':
specifier: ^1.0.2
Analysis
Nuxt build fails due to incorrect module reference
What fails: The @workflow/nuxt package build fails during the nuxt-module-build step when trying to resolve the module 'workflow/nitro'
How to reproduce:
cd packages/nuxt
pnpm run buildResult:
ERROR Cannot find module '/vercel/sandbox/primary/node_modules/.pnpm/node_modules/workflow/dist/nitro.js'The error occurs because the Nuxt module tries to register 'workflow/nitro' as a Nitro module, but should reference '@workflow/nitro' directly instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Suggestion:
The import statement is missing readRawBody from the h3 library, but the code on line 5 calls readRawBody(event), which will cause a runtime error.
View Details
📝 Patch Details
diff --git a/workbench/nitro-v2/server/api/hook.post.ts b/workbench/nitro-v2/server/api/hook.post.ts
index ba655f1..52aba06 100644
--- a/workbench/nitro-v2/server/api/hook.post.ts
+++ b/workbench/nitro-v2/server/api/hook.post.ts
@@ -1,4 +1,4 @@
-import { defineEventHandler, readBody } from 'h3';
+import { defineEventHandler, readRawBody } from 'h3';
import { getHookByToken, resumeHook } from 'workflow/api';
export default defineEventHandler(async (event) => {
Analysis
Missing import of readRawBody in hook.post.ts
What fails: File workbench/nitro-v2/server/api/hook.post.ts imports readBody from 'h3' on line 1 but calls readRawBody(event) on line 5, causing a runtime error when the endpoint is invoked.
How to reproduce:
# In workbench/nitro-v2:
npx tsc --noEmit server/api/hook.post.tsResult: TypeScript error TS2552 on line 5:
error TS2552: Cannot find name 'readRawBody'. Did you mean 'readBody'?
At runtime, this would throw ReferenceError: readRawBody is not defined when the POST /hook endpoint is called.
Expected: The import statement should include readRawBody from the h3 library, which is available as a named export in h3 v1.15.4. This matches the pattern correctly used in trigger.post.ts which properly imports readRawBody.
Fix applied: Updated line 1 import to:
import { defineEventHandler, readRawBody } from 'h3';| DEPLOYMENT_URL: "http://localhost:3000" | ||
| - name: Run E2E Tests (Nuxt) | ||
| if: matrix.app.name == 'nuxt' | ||
| run: cd workbench/${{ matrix.app.name }} && pnpm dev & echo "starting tests in 10 seconds" && sleep 10 && pnpm vitest run packages/core/e2e/e2e.test.ts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should also run the nuxt dev tests (cc @adriandlam - either in this PR or in that one)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good. if this is merged then i can update dev tests for nuxt in #199. or if mine's merged first ill do that directly in this PR
Add support for
workflow/nuxt:Added documentation page + updated landing page for available frameworks.