Skip to content

Comments

feat: migrate to Nuxt 3#5

Merged
hsluoyz merged 3 commits intomasterfrom
copilot/support-nuxt3-sdk
Feb 4, 2026
Merged

feat: migrate to Nuxt 3#5
hsluoyz merged 3 commits intomasterfrom
copilot/support-nuxt3-sdk

Conversation

Copy link
Contributor

Copilot AI commented Feb 4, 2026

fix: #4

The SDK was built on Nuxt 2/Vue 2, which is now legacy. This migrates to Nuxt 3/Vue 3 for modern framework support.

Changes

Dependencies

  • Nuxt 2.15.8 → 3.10.0
  • Vue 2.7.10 → 3.4.15
  • Removed deprecated @nuxtjs/auth-next and @nuxtjs/axios modules

Configuration

  • nuxt.config.jsnuxt.config.ts with defineNuxtConfig()
  • Middleware renamed to .global.ts for automatic global application

Code Migration

  • Pages converted to Composition API with <script setup>
  • Middleware uses defineNuxtRouteMiddleware() and navigateTo() instead of context-based routing
  • Components updated: <router-view><NuxtPage>, router-linkNuxtLink

Example of page migration:

<!-- Before (Nuxt 2) -->
<script>
export default {
  mounted() {
    const user = Cookies.get('casdoorUser');
    this.userJson = user ? JSON.parse(user) : {};
  },
  methods: {
    handleLogout() {
      Cookies.remove('casdoorUser');
      this.$router.push('/');
    }
  }
}
</script>

<!-- After (Nuxt 3) -->
<script setup>
const router = useRouter();
const userJson = ref({});

onMounted(() => {
  const user = Cookies.get('casdoorUser');
  userJson.value = user ? JSON.parse(user) : {};
});

const handleLogout = () => {
  Cookies.remove('casdoorUser');
  router.push('/');
};
</script>

@vercel
Copy link

vercel bot commented Feb 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nuxt-auth Ready Ready Preview, Comment Feb 4, 2026 8:43am

@hsluoyz hsluoyz marked this pull request as ready for review February 4, 2026 08:37
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@hsluoyz
Copy link
Member

hsluoyz commented Feb 4, 2026

@copilot fix error:

16:37:06.951 Running build in Washington, D.C., USA (East) – iad1
16:37:06.952 Build machine configuration: 2 cores, 8 GB
16:37:07.074 Cloning github.com/casdoor/nuxt-auth (Branch: copilot/support-nuxt3-sdk, Commit: 05de739)
16:37:07.075 Previous build caches not available.
16:37:07.320 Cloning completed: 246.000ms
16:37:07.763 Running "vercel build"
16:37:08.993 Vercel CLI 50.9.6
16:37:09.591 Installing dependencies...
16:37:14.280 npm warn deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
16:37:14.724 npm warn deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
16:37:14.725 npm warn deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
16:37:14.746 npm warn deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
16:37:14.838 npm warn deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
16:37:16.131 npm warn deprecated figgy-pudding@3.5.2: This module is no longer supported.
16:37:16.483 npm warn deprecated consolidate@0.15.1: Please upgrade to consolidate v1.0.0+ as it has been modernized with several long-awaited fixes implemented. Maintenance is supported by Forward Email at https://forwardemail.net ; follow/watch https://github.com/ladjs/consolidate for updates and release changelog
16:37:17.115 npm warn deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
16:37:17.691 npm warn deprecated @babel/plugin-proposal-private-property-in-object@7.21.11: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead.
16:37:17.707 npm warn deprecated @babel/plugin-proposal-private-methods@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead.
16:37:17.708 npm warn deprecated @babel/plugin-proposal-nullish-coalescing-operator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
16:37:17.708 npm warn deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
16:37:17.740 npm warn deprecated @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
16:37:18.278 npm warn deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
16:37:20.492 npm warn deprecated vue@2.7.16: Vue 2 has reached EOL and is no longer actively maintained. See https://v2.vuejs.org/eol/ for more details.
16:37:26.920 
16:37:26.921 added 1461 packages in 17s
16:37:26.922 
16:37:26.923 230 packages are looking for funding
16:37:26.923   run `npm fund` for details
16:37:27.003 Running "npm run build"
16:37:27.100 
16:37:27.100 > nuxt-auth@1.0.0 build
16:37:27.101 > nuxt build
16:37:27.101 
16:37:28.049 [info] Production build
16:37:28.051 [info] Bundling for server and client side
16:37:28.051 [info] Target: static
16:37:28.060 [info] Using components loader to optimize imports
16:37:28.061 [info] Discovered Components: .nuxt/components/readme.md
16:37:28.077 [success] Builder initialized
16:37:28.184 [success] Nuxt files generated
16:37:28.435 [warn] Browserslist: caniuse-lite is outdated. Please run:
16:37:28.436   npx update-browserslist-db@latest
16:37:28.436   Why you should do it regularly: https://github.com/browserslist/update-db#readme
16:37:36.525 [info] Ready to run `nuxt generate`
16:37:37.122 Error: No Output Directory named "dist" found after the Build completed. Configure the Output Directory in your Project Settings. Alternatively, configure vercel.json#outputDirectory.
16:37:37.123 Learn More: https://vercel.link/missing-public-directory

Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for Nuxt3 in SDK Migrate to Nuxt 3 Feb 4, 2026
Copilot AI requested a review from hsluoyz February 4, 2026 08:46
@hsluoyz hsluoyz changed the title Migrate to Nuxt 3 feat: migrate to Nuxt 3 Feb 4, 2026
@hsluoyz hsluoyz merged commit ff5f847 into master Feb 4, 2026
3 of 5 checks passed
Copilot stopped work on behalf of hsluoyz due to an error February 4, 2026 08:48
hsluoyz added a commit that referenced this pull request Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for Nuxt3

3 participants