Skip to content

Commit c2738d6

Browse files
committed
feat: Migrate to build the frontend using vite
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent e57bba1 commit c2738d6

File tree

13 files changed

+4800
-10675
lines changed

13 files changed

+4800
-10675
lines changed

.eslintrc.js

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

.eslintrc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": [
3+
"@nextcloud"
4+
],
5+
"globals": {
6+
"__dirname": "readonly"
7+
}
8+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
css/
12
js/
23
node_modules/
34

File renamed without changes.

babel.config.js

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

lib/Settings/Admin.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ public function getForm() {
6565
'newUserGenerateUserID' => $this->config->isGenerateUserId(),
6666
]
6767
);
68+
69+
\OCP\Util::addScript(Application::APP_ID, 'ldap_write_suppport-admin-settings');
70+
\OCP\Util::addStyle(Application::APP_ID, 'ldap_write_suppport-admin-settings');
71+
6872
return new TemplateResponse(Application::APP_ID, 'settings-admin');
6973
}
7074

package-lock.json

Lines changed: 4769 additions & 10616 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
"private": true,
66
"author": "Arthur Schiwon",
77
"license": "AGPL-3.0",
8+
"type": "module",
89
"scripts": {
9-
"build": "NODE_ENV=production webpack --progress --config webpack.js",
10-
"dev": "NODE_ENV=development webpack --config webpack.js",
10+
"build": "vite --mode production build",
11+
"dev": "vite --mode development build",
1112
"lint": "eslint --ext .js,.vue src",
1213
"lint:fix": "eslint --ext .js,.vue src --fix",
1314
"stylelint": "stylelint src css",
@@ -20,22 +21,20 @@
2021
"esversion": 6
2122
},
2223
"dependencies": {
23-
"@nextcloud/dialogs": "^4.2.5",
24+
"@nextcloud/dialogs": "^5.2.0",
2425
"@nextcloud/initial-state": "^2.1.0",
25-
"@nextcloud/vue": "^8.6.2",
26+
"@nextcloud/vue": "^8.9.1",
2627
"vue": "^2.7.16"
2728
},
2829
"engines": {
2930
"node": "^20.0.0",
3031
"npm": "^10.0.0"
3132
},
3233
"devDependencies": {
33-
"@nextcloud/babel-config": "^1.0.0",
3434
"@nextcloud/browserslist-config": "^3.0.0",
3535
"@nextcloud/eslint-config": "^8.3.0",
3636
"@nextcloud/stylelint-config": "^2.4.0",
37-
"@nextcloud/webpack-vue-config": "^6.0.1",
38-
"file-loader": "^6.2.0",
39-
"url-loader": "^4.1.1"
37+
"@nextcloud/vite-config": "^1.2.2",
38+
"vite": "^5.1.5"
4039
}
4140
}

src/components/AdminSettings.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ import NcActionCheckbox from '@nextcloud/vue/dist/Components/NcActionCheckbox.js
6161
import { showError } from '@nextcloud/dialogs'
6262
import i10n from '../mixins/i10n.js'
6363
64-
import '@nextcloud/dialogs/dist/index.css'
64+
import '@nextcloud/dialogs/style.css'
6565
6666
export default {
6767
name: 'AdminSettings',

src/main-settings.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@
1919
* along with this program. If not, see <http://www.gnu.org/licenses/>.
2020
*/
2121

22-
import Vue from 'vue'
2322
import { loadState } from '@nextcloud/initial-state'
23+
import Vue from 'vue'
2424

2525
import AdminSettings from './components/AdminSettings.vue'
2626

27+
// eslint-disable-next-line import/no-unresolved, n/no-missing-import
28+
import 'vite/modulepreload-polyfill'
29+
2730
const View = Vue.extend(AdminSettings)
2831
const AppID = 'ldap_write_support'
2932

0 commit comments

Comments
 (0)