-
Notifications
You must be signed in to change notification settings - Fork 51
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
feat: nuxt3 support #269
Closed
Closed
feat: nuxt3 support #269
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
53b3493
feat: update generated file structure
0264370
feat: update schematic and generator to mimic nuxi init
6bae602
feat: update nuxt dependency closes #236
c933efb
feat: change generated dependencies, update to correct nuxt3 version
552ad88
feat: Update build/serve executor to serve local with nuxt3 API part 1
08ffe8e
feat: work on build - serve executors
df283d0
feat: add new target mode also for tsconfig lib
80081ae
feat: update nuxt to latest release candidate
bb4fce7
feat: approach with module and module resolution changed to nodenext
fa5c8f7
feat: update nuxt rc version and fix for top level await test error
colinscz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<template> | ||
<div> | ||
<NuxtWelcome /> | ||
</div> | ||
</template> |
11 changes: 0 additions & 11 deletions
11
libs/nuxt/src/generators/application/files/components/NuxtLogo.vue.template
This file was deleted.
Oops, something went wrong.
46 changes: 0 additions & 46 deletions
46
libs/nuxt/src/generators/application/files/components/NuxtTutorial.vue.template
This file was deleted.
Oops, something went wrong.
43 changes: 0 additions & 43 deletions
43
libs/nuxt/src/generators/application/files/nuxt.config.js.template
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
libs/nuxt/src/generators/application/files/nuxt.config.ts.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { defineNuxtConfig } from 'nuxt' | ||
|
||
export default defineNuxtConfig({ | ||
|
||
app: { | ||
// Global page headers: https://v3.nuxtjs.org/api/configuration/nuxt.config#head | ||
head: { | ||
title: 'nuxt-app', | ||
htmlAttrs: { | ||
lang: 'en' | ||
}, | ||
meta: [ | ||
{ charset: 'utf-8' }, | ||
{ name: 'viewport', content: 'width=device-width, initial-scale=1' }, | ||
{ hid: 'description', name: 'description', content: '' }, | ||
{ name: 'format-detection', content: 'telephone=no' } | ||
], | ||
link: [ | ||
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' } | ||
] | ||
}, | ||
}, | ||
|
||
// Global CSS: https://v3.nuxtjs.org/api/configuration/nuxt.config#css | ||
css: [ | ||
], | ||
|
||
// Modules for dev and build (recommended): https://v3.nuxtjs.org/api/configuration/nuxt.config#modules | ||
modules: [ | ||
], | ||
|
||
|
||
// Build Configuration: https://v3.nuxtjs.org/api/configuration/nuxt.config#build | ||
build: { | ||
} | ||
}) |
9 changes: 0 additions & 9 deletions
9
libs/nuxt/src/generators/application/files/pages/index.vue.template
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
libs/nuxt/src/generators/application/files/test/Example.spec.js.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { mount } from '@vue/test-utils' | ||
import App from '../app.vue' | ||
|
||
describe('Mounted App', () => { | ||
const wrapper = mount(App); | ||
|
||
test('does a wrapper exist', () => { | ||
expect(wrapper.exists()).toBe(true) | ||
}) | ||
}) | ||
|
9 changes: 0 additions & 9 deletions
9
libs/nuxt/src/generators/application/files/test/NuxtLogo.spec.js.template
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@ZachJW34 I face an issue with the nx project setup where it's compiling the ESM to CJS. And this results in the error seen on the e2e tests of the pipeline.
You can reproduce it if you
I have mentioned the two potentially related issues of Nx in the issue description.
I'm open to ideas on how to solve this :)
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.
The way I've handled this in the past is to use a little hack utility method:
That way, the dynamic import won't get converted to a require. Like @Pekes317 pointed out, this can be fixed by changing the "module" target but making this change always leads to more errors in my experience from other dependencies.
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.
@ZachJW34 thanks for the hint, I will try out this approach with the latest nuxt framework release and give an update on the status. If that approach is not successful I would give @Pekes317 suggestion a try.
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.
@ZachJW34 unfortunately your approach and the one suggested by @Pekes317 still both result in an error.
With both approaches I currently run into a similar error. The latest committed changes are more towards the approach that @Pekes317 suggested. But the tests fail with the following error message, even though the resolutions were changed accordingly:
For now I will revert locally and will add a commit with the suggested approach of @ZachJW34, that way for testing you can switch easily between the different try outs. I will have a go again with your approach @ZachJW34, but if I don't succeed it would be great if you can have a look into it yourself. Thanks in advance :)
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.
After going a bit further with the NodeNext approach, I could fix the above issue with some changes to async functions and moving that top level definition to the only function it is used in. I now commited that latest status to remote instead of my previous plan.
It looks like I have now issues with the current version of Jest and the support for ES Modules. You need to run with a version of node that supports ES Modules in the VM API. See https://jestjs.io/docs/ecmascript-modules
This brings me to the following question:
@ZachJW34 You can contact me on Discord if you want to discuss this further and have a quick back and forth on how to tackle this :)
ignotus#3578