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

change to vue3 vite and typescript #3

Closed

Conversation

thlehmann-ionos
Copy link
Collaborator

No description provided.

When running webpack within the submodule/app directory,

* the Typescript compiler references the parent tsconfig.json
  (can be solved by adding an empty tsconfig.json, which is rather hacky)

* eslint still complains about unnecessary imports of bindings used
  below and, when removing the import it complains about undefined
  names

This creates an isolated environment assuming the NextCloud app build
system was not intended for operation withint the NextCloud source tree.
The build works, yet the generated filename has a random suffix, while
"main.js" is expected by Nextcloud. This will be fixed in the next
commit.

1. Run

   $ npm create vue@latest

2. Change vite.config.ts to add "rollupOptions"
Using the config generator function from [1].

* Followed the example of [1]
* Added @nextcloud/vite-config on top of the generated configs
  (the Vue+Vite config was generated using "npm create vue"
   in a previous commit)
* Due to lack of documentation, I looked at the source [2]
* vitest.config.ts adapted to use the vite.config.ts

[1]: https://github.com/nextcloud-libraries/nextcloud-vite-config
[2]: https://github.com/nextcloud-libraries/nextcloud-vite-config/blob/v2.0.0/lib/appConfig.ts
Left HelloWorld.vue and its tests as template. Can be removed later.
WIP: build fails with build error related likely to Vue 2.x API provided
by @nextcloud, incompatibe wwith Vue 3.x

Issues:

1. Nextcloud claims Vue 2.x as peer dependency, while this project uses
   Vue 3 and The Vite Vue plugin is not Vue 2.x compatible
2. Build fails (see above)

Adaptions:

* Added type definitions for Nextcloud globals
* Adapted relative import paths
* Removed .ts extensions from imports
* Added necessary packages (found in Nextcloud server's package.json)
* tsconfig: added noImplicitAny: false to workaround missing type defs
  for @nextcloud/vue components
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.

2 participants