diff --git a/.eslintrc.js b/.eslintrc.js index 6dfc3b8b09..c961dd2f5a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -7,6 +7,8 @@ module.exports = { oc_userconfig: true, appName: true, appVersion: true, + TRANSLATIONS: true, + SCOPE_VERSION: true, }, extends: [ '@nextcloud', diff --git a/.github/workflows/server-styling-update.yml b/.github/workflows/server-styling-update.yml index 70d047e060..9b38f9444c 100644 --- a/.github/workflows/server-styling-update.yml +++ b/.github/workflows/server-styling-update.yml @@ -14,7 +14,7 @@ jobs: - name: Download css run: | - cd styleguide/assets + cd docs/.vitepress/theme/assets # Fix img css import curl https://nextcloud.github.io/server/apps/theming/css/default.css | sed 's|/apps/theming/img|./img|g' > default.css # Fix icons and img css import diff --git a/.gitignore b/.gitignore index be9bc9d4b8..a229ed79c3 100644 --- a/.gitignore +++ b/.gitignore @@ -20,9 +20,12 @@ yarn-error.log* # Unit test / coverage reports coverage +# genereated file +docs/components +docs/.vitepress + # Docs compiled build -styleguide/build/ -styleguide/index.html +styleguide/* # Cypress files cypress/videos diff --git a/Makefile b/Makefile index 4c9e5fa909..2e0a5ef3ba 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,7 @@ stylelint-fix: clean: rm -rf dist/ rm -rf src/fonts/ + rm -rf styleguide/build/ clean-dev: rm -rf node_modules diff --git a/build/extract-l10n.js b/build/extract-l10n.js index 401e106300..98911490ef 100644 --- a/build/extract-l10n.js +++ b/build/extract-l10n.js @@ -1,28 +1,28 @@ -const { GettextExtractor, JsExtractors } = require('gettext-extractor'); +const { GettextExtractor, JsExtractors } = require('gettext-extractor') -let extractor = new GettextExtractor(); +const extractor = new GettextExtractor() extractor - .createJsParser([ - JsExtractors.callExpression('t', { - arguments: { - text: 0, - } - }), - JsExtractors.callExpression('n', { - arguments: { - text: 0, - textPlural: 1, - } - }), - ]) - .parseFilesGlob('./src/**/*.@(ts|js|vue)'); + .createJsParser([ + JsExtractors.callExpression('t', { + arguments: { + text: 0, + }, + }), + JsExtractors.callExpression('n', { + arguments: { + text: 0, + textPlural: 1, + }, + }), + ]) + .parseFilesGlob('./src/**/*.@(ts|js|vue)') // remove references to avoid conflicts extractor.getMessages().forEach((msg) => { - msg.references = []; -}); - -extractor.savePotFile('./l10n/messages.pot'); + msg.references = [] +}) -extractor.printStats(); +extractor.savePotFile('./l10n/messages.pot') + +extractor.printStats() diff --git a/build/usernameToColor-export.js b/build/usernameToColor-export.js deleted file mode 100644 index 7ed3cf6358..0000000000 --- a/build/usernameToColor-export.js +++ /dev/null @@ -1,7 +0,0 @@ -const snapshot = require('./../src/functions/usernameToColor/__snapshots__/usernameToColor.spec.js.snap') -const result = {} -Object.keys(snapshot).map((key) => { - const uid = key.replace('usernameToColor ', '').replace(' has the proper color 1', '') - result[uid] = JSON.parse(snapshot[key]) -}) -console.log(JSON.stringify(result)) diff --git a/cypress.config.ts b/cypress.config.ts index e6bf7f2cd4..7daeff0858 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -1,31 +1,7 @@ import { defineConfig } from 'cypress' -import { DefinePlugin } from 'webpack' import getCompareSnapshotsPlugin from 'cypress-visual-regression/dist/plugin' -import path from 'path' -import webpackConfig from '@nextcloud/webpack-vue-config' -import webpackRules from '@nextcloud/webpack-vue-config/rules' -import { loadTranslations } from './resources/translations' - -const SCOPE_VERSION = Date.now() -webpackRules.RULE_SCSS.use.push({ - loader: 'sass-loader', - options: { - additionalData: `@use 'sass:math'; $scope_version:${SCOPE_VERSION}; @import 'variables'; @import 'material-icons';`, - /** - * ! needed for resolve-url-loader - */ - sourceMap: true, - sassOptions: { - sourceMapContents: false, - includePaths: [ - path.resolve(__dirname, './src/assets'), - ], - }, - }, -}) - -webpackConfig.module.rules = Object.values(webpackRules) +import viteConfig from './vite.config.mjs' export default defineConfig({ projectId: '3paxvy', @@ -67,17 +43,8 @@ export default defineConfig({ devServer: { framework: 'vue', - bundler: 'webpack', - webpackConfig: async () => { - const translations = await loadTranslations(path.resolve(__dirname, './l10n')) - webpackConfig.plugins.push(new DefinePlugin({ - PRODUCTION: false, - SCOPE_VERSION, - TRANSLATIONS: JSON.stringify(translations), - })) - - return webpackConfig - }, + bundler: 'vite', + viteConfig, }, }, }) diff --git a/cypress/support/component-index.html b/cypress/support/component-index.html index ac6e79fd83..5f9622ae29 100644 --- a/cypress/support/component-index.html +++ b/cypress/support/component-index.html @@ -9,4 +9,4 @@
-