Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module.exports = {
globals: {
EMOJIS: true,
SCOPE_VERSION: true,
TRANSLATIONS: true,
oc_userconfig: true,
appName: true,
appVersion: true,
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ yarn-error.log*
# Unit test / coverage reports
coverage

# genereated file
docs/components

# Docs compiled build
styleguide/build/
styleguide/index.html
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ stylelint-fix:
clean:
rm -rf dist/
rm -rf src/fonts/
rm -rf styleguide/build/

clean-dev:
rm -rf node_modules
Expand Down
42 changes: 21 additions & 21 deletions build/extract-l10n.js
Original file line number Diff line number Diff line change
@@ -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()
7 changes: 0 additions & 7 deletions build/usernameToColor-export.js

This file was deleted.

27 changes: 27 additions & 0 deletions cypress.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { defineConfig } from 'cypress'
import plugins from './cypress/plugins/index.mjs'
import viteConfig from './vite.config.mjs'

export default defineConfig({
projectId: '3paxvy',
viewportWidth: 1920,
viewportHeight: 1080,
defaultCommandTimeout: 6000,

env: viteConfig.test.env,

screenshotsFolder: 'cypress/snapshots/actual',
trashAssetsBeforeRuns: true,

component: {
devServer: {
framework: 'vue',
bundler: 'vite',
viteConfig,
},
specPattern: 'tests/visual/**/*.visual.*',
setupNodeEvents(on, config) {
return plugins(on, config)
},
},
})
18 changes: 0 additions & 18 deletions cypress.json

This file was deleted.

25 changes: 2 additions & 23 deletions cypress/plugins/index.js → cypress/plugins/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,10 @@
// https://on.cypress.io/plugins-guide
// ***********************************************************

// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)

const getCompareSnapshotsPlugin = require('cypress-visual-regression/dist/plugin')

const webpack = require('@cypress/webpack-preprocessor')
const { startDevServer } = require('@cypress/webpack-dev-server')

module.exports = async (on, config) => {
const webpackOptions = await require('../../webpack.config.js')()
webpackOptions.externals = {}

const options = {
// send in the options from your webpack.config.js, so it works the same
// as your app's code
webpackOptions,
watchOptions: {},
}
import getCompareSnapshotsPlugin from 'cypress-visual-regression/dist/plugin.js'

export default async (on, config) => {
getCompareSnapshotsPlugin(on, config)
on('file:preprocessor', webpack(options))

on('dev-server:start', (options) => {
return startDevServer({ options, webpackConfig: webpackOptions })
})

// Disable spell checking to prevent rendering differences
on('before:browser:launch', (browser, launchOptions) => {
Expand Down
3 changes: 0 additions & 3 deletions cypress/support/commands.js

This file was deleted.

13 changes: 13 additions & 0 deletions cypress/support/component-index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Components App</title>
<div id="__next_css__DO_NOT_USE__"></div>
</head>
<body>
<div data-cy-root></div>
</body>
</html>
16 changes: 14 additions & 2 deletions cypress/support/index.js → cypress/support/component.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ***********************************************************
// This example support/index.js is processed and
// This example support/component.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
Expand All @@ -13,4 +13,16 @@
// https://on.cypress.io/configuration
// ***********************************************************

import './commands'
import { mount } from 'cypress/vue2'
import compareSnapshotCommand from 'cypress-visual-regression/dist/command.js'

compareSnapshotCommand()

const Cypress = window.Cypress

Cypress.Commands.add('mount', mount)

if (global.process === undefined) global.process = {}
global.process.env = {
...Cypress.env(),
}
24 changes: 24 additions & 0 deletions docgen.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const { defineConfig } = require('vue-docgen-cli')
const fs = require('fs')

const generatePages = () => {
const path = 'src/components'
return fs.readdirSync(path)
.filter(file => fs.statSync(`${path}/${file}`).isDirectory())
.map(file => {
return {
components: `${file}/*.vue`,
outFile: `${file}.md`,
}
})
}

module.exports = defineConfig({
componentsRoot: 'src/components',
docsRepo: 'nextcloud/nextcloud-vue',
docsBranch: 'master',
editLinkLabel: 'Fork me on GitHub',
outDir: 'docs/components',

pages: generatePages(),
})
Empty file removed docs/components.md
Empty file.
1 change: 1 addition & 0 deletions docs/directives.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Directives
## Tooltip

```js static
Expand Down
Loading