Skip to content

Commit 86e47d8

Browse files
authored
Merge pull request #55432 from nextcloud/feat/vue3-demi-2
refactor: prepare Vue 3 migration
2 parents 2369ad9 + 9993f4e commit 86e47d8

File tree

441 files changed

+41557
-24105
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

441 files changed

+41557
-24105
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ updates:
3838

3939
# Main master npm frontend dependencies
4040
- package-ecosystem: npm
41-
directory: "/"
41+
directories:
42+
- "/"
43+
- "/build/frontend"
44+
- "/build/frontend-legacy"
4245
schedule:
4346
interval: weekly
4447
day: saturday

.gitignore

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/apps/inc.php
1212
/assets
1313
/.htaccess
14-
/node_modules
14+
node_modules/
1515
/translationfiles
1616
/translationtool.phar
1717

@@ -55,10 +55,6 @@
5555
/apps/files_external/3rdparty/irodsphp/prods/test*
5656
/apps/files_external/tests/config.*.php
5757

58-
# apps modules
59-
/apps/*/node_modules
60-
61-
6258
# ignore themes except the example and the README
6359
/themes/*
6460
!/themes/example
@@ -131,9 +127,6 @@ nbproject
131127
# Tests
132128
/tests/phpunit.xml
133129

134-
# Node Modules
135-
/build/node_modules/
136-
137130
# nodejs
138131
/build/bin
139132
/build/lib/

REUSE.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ SPDX-FileCopyrightText = "2020 Nextcloud GmbH and Nextcloud contributors"
178178
SPDX-License-Identifier = "AGPL-3.0-or-later"
179179

180180
[[annotations]]
181-
path = ["cypress/tsconfig.json", "cypress/fixtures/appstore/apps.json", "dist/icons.css"]
181+
path = ["cypress/tsconfig.json", "cypress/fixtures/appstore/apps.json", "dist/*.css"]
182182
precedence = "aggregate"
183183
SPDX-FileCopyrightText = "2022 Nextcloud GmbH and Nextcloud contributors"
184184
SPDX-License-Identifier = "AGPL-3.0-or-later"

apps/sharebymail/lib/Settings/Admin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ public function getForm() {
2626
$this->initialState->provideInitialState('sendPasswordMail', $this->settingsManager->sendPasswordByMail());
2727
$this->initialState->provideInitialState('replyToInitiator', $this->settingsManager->replyToInitiator());
2828

29+
\OCP\Util::addStyle('sharebymail', 'admin-settings');
30+
\OCP\Util::addScript('sharebymail', 'admin-settings');
2931
return new TemplateResponse('sharebymail', 'settings-admin', [], '');
3032
}
3133

apps/sharebymail/src/components/AdminSettings.vue

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,11 @@
77
<NcSettingsSection
88
:name="t('sharebymail', 'Share by mail')"
99
:description="t('sharebymail', 'Allows people to share a personalized link to a file or folder by putting in an email address.')">
10-
<NcCheckboxRadioSwitch
11-
type="switch"
12-
:checked.sync="sendPasswordMail"
13-
@update:checked="update('sendpasswordmail', sendPasswordMail)">
10+
<NcCheckboxRadioSwitch v-model="sendPasswordMail" type="switch">
1411
{{ t('sharebymail', 'Send password by mail') }}
1512
</NcCheckboxRadioSwitch>
1613

17-
<NcCheckboxRadioSwitch
18-
type="switch"
19-
:checked.sync="replyToInitiator"
20-
@update:checked="update('replyToInitiator', replyToInitiator)">
14+
<NcCheckboxRadioSwitch v-model="replyToInitiator" type="switch">
2115
{{ t('sharebymail', 'Reply to initiator') }}
2216
</NcCheckboxRadioSwitch>
2317
</NcSettingsSection>
@@ -27,6 +21,7 @@
2721
import axios from '@nextcloud/axios'
2822
import { showError } from '@nextcloud/dialogs'
2923
import { loadState } from '@nextcloud/initial-state'
24+
import { t } from '@nextcloud/l10n'
3025
import { confirmPassword } from '@nextcloud/password-confirmation'
3126
import { generateOcsUrl } from '@nextcloud/router'
3227
import NcCheckboxRadioSwitch from '@nextcloud/vue/components/NcCheckboxRadioSwitch'
@@ -40,13 +35,27 @@ export default {
4035
NcSettingsSection,
4136
},
4237
38+
setup() {
39+
return { t }
40+
},
41+
4342
data() {
4443
return {
4544
sendPasswordMail: loadState('sharebymail', 'sendPasswordMail'),
4645
replyToInitiator: loadState('sharebymail', 'replyToInitiator'),
4746
}
4847
},
4948
49+
watch: {
50+
sendPasswordMail(newValue) {
51+
this.update('sendpasswordmail', newValue)
52+
},
53+
54+
replyToInitiator(newValue) {
55+
this.update('replyToInitiator', newValue)
56+
},
57+
},
58+
5059
methods: {
5160
async update(key, value) {
5261
await confirmPassword()

apps/sharebymail/src/main-admin.js

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
3+
* SPDX-License-Identifier: AGPL-3.0-or-later
4+
*/
5+
6+
import { createApp } from 'vue'
7+
import AdminSettings from './components/AdminSettings.vue'
8+
9+
const app = createApp(AdminSettings)
10+
app.mount('#vue-admin-sharebymail')

apps/sharebymail/templates/settings-admin.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
44
* SPDX-License-Identifier: AGPL-3.0-or-later
55
*/
6-
7-
\OCP\Util::addScript('sharebymail', 'vue-settings-admin-sharebymail');
86
?>
7+
98
<div id="vue-admin-sharebymail"></div>

build/demi.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
3+
# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
4+
# SPDX-License-Identifier: CC0-1.0
5+
6+
# This is a simple helper to execute npm COMMANDs in two directories
7+
# we need this as we cannot use npm workspaces as they break with 2 versions of vue.
8+
9+
COMMAND=""
10+
FRONTEND="$(dirname $0)/frontend"
11+
FRONTEND_LEGACY="$(dirname $0)/frontend-legacy"
12+
13+
build_command() {
14+
if [ "install" = "$1" ] || [ "ci" = "$1" ]; then
15+
COMMAND=$@
16+
elif [ "run" = "$1" ]; then
17+
COMMAND="run --if-present ${@:2}"
18+
else
19+
COMMAND="run --if-present $@"
20+
fi
21+
}
22+
23+
run_parallel() {
24+
npx concurrently \
25+
"cd \"$FRONTEND\" && npm $COMMAND" \
26+
"cd \"$FRONTEND_LEGACY\" && npm $COMMAND"
27+
}
28+
29+
run_sequentially() {
30+
echo -e "\e[1;34m>> Running 'npm $COMMAND' for Vue 3 based frontend\e[0m"
31+
echo
32+
pushd "$FRONTEND"
33+
npm $COMMAND
34+
popd
35+
36+
echo -e "\e[1;34m>> Running 'npm $COMMAND' for Vue 2 based frontend\e[0m"
37+
echo
38+
pushd "$FRONTEND_LEGACY"
39+
npm $COMMAND
40+
popd
41+
}
42+
43+
44+
if [ "--parallel" = "$1" ]; then
45+
build_command ${@:2}
46+
run_parallel
47+
else
48+
build_command $@
49+
run_sequentially
50+
fi

build/files-checker.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
'autotest-checkers.sh',
4646
'autotest-external.sh',
4747
'autotest.sh',
48-
'babel.config.js',
4948
'build',
5049
'codecov.yml',
5150
'composer.json',
@@ -59,7 +58,7 @@
5958
'cypress.config.ts',
6059
'cypress',
6160
'dist',
62-
'eslint.config.mjs',
61+
'eslint.config.js',
6362
'flake.lock',
6463
'flake.nix',
6564
'index.html',
@@ -86,10 +85,8 @@
8685
'tsconfig.json',
8786
'vendor-bin',
8887
'version.php',
89-
'vitest.config.mts',
90-
'webpack.common.cjs',
91-
'webpack.config.js',
92-
'webpack.modules.cjs',
88+
'vite.config.ts',
89+
'vitest.config.ts',
9390
'window.d.ts',
9491
];
9592
$actualFiles = [];

0 commit comments

Comments
 (0)