Skip to content

Commit 3cdd6cc

Browse files
authored
Merge pull request #658 from nextcloud-libraries/feat/vu2-and-vue3-compatibility
feat: Vue 2 and Vue 3 compatibility
2 parents 04a7e96 + fb852f4 commit 3cdd6cc

24 files changed

+8880
-12510
lines changed

.github/workflows/node-test.yml

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -24,43 +24,11 @@ jobs:
2424
- name: Checkout
2525
uses: actions/checkout@v3
2626

27-
- name: Read package.json node and npm engines version
28-
uses: skjnldsv/[email protected]
29-
id: versions
30-
with:
31-
fallbackNode: '^12'
32-
fallbackNpm: '^6'
33-
34-
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
27+
- name: Set up node
3528
uses: actions/setup-node@v3
36-
with:
37-
node-version: ${{ steps.versions.outputs.nodeVersion }}
38-
39-
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
40-
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
41-
42-
- name: Install webpack-vue-config dependencies & build lib
43-
run: |
44-
npm ci
45-
npm pack
4629

4730
- name: Install dependencies
48-
run: |
49-
cd tests
50-
npm ci
51-
# Manually install dependency to check for incompatibilities
52-
version=$(cat ../package.json | jq --raw-output .version)
53-
npm install -D ../nextcloud-webpack-vue-config-$version.tgz
54-
55-
- name: Build test app
56-
run: |
57-
# Build test app dev and production
58-
cd tests
59-
npm run dev
60-
npm run build
31+
run: npm ci
6132

62-
- name: Lint with eslint and stylelint
63-
run: |
64-
cd tests
65-
npm run lint
66-
npm run stylelint
33+
- name: Test
34+
run: npm test

.github/workflows/node.yml

Lines changed: 0 additions & 102 deletions
This file was deleted.

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,28 @@ module.exports = webpackConfig
3232
...
3333
```
3434

35+
## Note on Vue 2 support
36+
37+
This package supports both **Vue 2** and **Vue 3** by installing legacy `vue-loader` for Vue 2 in a `postinstall` script.
38+
39+
In Vue 2 it may result in different `vue-loader` version in the `package-lock.json` and `node_modules`.
40+
41+
### Troubleshooting in Vue 2 apps
42+
43+
In case of `npm error code ENOTEMPTY` - remove `node_modules` and try again:
44+
45+
```sh
46+
# In case of "npm error code ENOTEMPTY" in Vue 2
47+
rm -rf node_modules
48+
```
49+
50+
To avoid any errors and have explicitly specified `vue-loader` - install it as dependency:
51+
52+
```sh
53+
# Install legacy vue-loader for Vue 2
54+
npm i -D vue-loader@legacy
55+
```
56+
3557
## Hot module replacement
3658

3759
To enjoy hot module replacement, follow those instructions:

REUSE.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ SPDX-FileCopyrightText = "2019 Nextcloud GmbH and Nextcloud contributors"
1212
SPDX-License-Identifier = "AGPL-3.0-or-later"
1313

1414
[[annotations]]
15-
path = ["tests/package-lock.json", "tests/package.json"]
15+
path = ["test-apps/vue2/package-lock.json", "test-apps/vue2/package.json", "test-apps/vue3/package-lock.json", "test-apps/vue3/package.json"]
1616
precedence = "aggregate"
17-
SPDX-FileCopyrightText = "2019 Nextcloud GmbH and Nextcloud contributors"
17+
SPDX-FileCopyrightText = "2025 Nextcloud GmbH and Nextcloud contributors"
1818
SPDX-License-Identifier = "AGPL-3.0-or-later"

0 commit comments

Comments
 (0)