@davidsneighbour/cypress-config 3.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Patrick Kollitsch / David's Neighbour
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,65 @@
1
+ ## @davidsneighbour/cypress-config
2
+
3
+ ### Installation
4
+
5
+ Use npm to install this package as development dependency:
6
+
7
+ ```shell
8
+ npm install --save-dev @davidsneighbour/cypress-config
9
+ ```
10
+
11
+ ### Configuration
12
+
13
+ Create `tests/cypress/plugins.index.js` with the following content:
14
+
15
+ ```js
16
+ // noinspection JSUnresolvedVariable
17
+ module.exports = (on, config) =>
18
+ // eslint-disable-next-line global-require
19
+ require("@davidsneighbour/cypress-config")(config.configFile);
20
+ ```
21
+
22
+ Then add in `cypress.json` at least the following two lines:
23
+
24
+ ```json
25
+ {
26
+ "extends": "@davidsneighbour/cypress-config/base.json",
27
+ "pluginsFile": "tests/cypress/plugins/index.js"
28
+ }
29
+ ```
30
+
31
+ This configuration setup uses the approach of [Gleb Bahmutov's blog post](https://www.cypress.io/blog/2020/06/18/extending-the-cypress-config-file/).
32
+
33
+ ## Default settings of this configuration
34
+
35
+ - All cypress files reside within the `tests` directory (no need for additional directories in the root directory).
36
+ - The base url is set to http://localhost:1313 - default for all Hugo dev server instances.
37
+ - IDEs like IntelliJ import the schema to offer typeahead code hints.
38
+ - `watchForFileChanges` is enabled.
39
+
40
+ <!--- CONFIGURATIONS BEGIN --->
41
+
42
+ ## davidsneighbour/Configurations
43
+
44
+ A collection of configurations for website development at DNB Org.
45
+
46
+ <!-- prettier-ignore -->
47
+ | Package | Description |
48
+ | --- | ---- |
49
+ | [babel-config](https://github.com/davidsneighbour/configurations/tree/main/packages/babel-config) | [Babel](https://babeljs.io/) configuration |
50
+ | [bootstrap-config](https://github.com/davidsneighbour/configurations/tree/main/packages/bootstrap-config) | [Bootstrap](https://getbootstrap.com/) configuration |
51
+ | [browserslist-config](https://github.com/davidsneighbour/configurations/tree/main/packages/browserslist-config) | [Browserslist](https://github.com/browserslist/browserslist) configuration |
52
+ | [commitlint-config](https://github.com/davidsneighbour/configurations/tree/main/packages/commitlint-config) | [Commitlint](https://github.com/conventional-changelog/commitlint) configuration |
53
+ | [cssnano-config](https://github.com/davidsneighbour/configurations/tree/main/packages/cssnano-config) | [CSSnano](https://cssnano.co/) configuration |
54
+ | [cypress-config](https://github.com/davidsneighbour/configurations/tree/main/packages/cypress-config) | [Cypress](https://www.cypress.io/) configuration |
55
+ | [eslint-config](https://github.com/davidsneighbour/configurations/tree/main/packages/eslint-config) | [ESLint](https://github.com/eslint/eslint) configuration |
56
+ | [postcss-config](https://github.com/davidsneighbour/configurations/tree/main/packages/postcss-config) | [PostCSS](https://postcss.org/) configuration |
57
+ | [prettier-config](https://github.com/davidsneighbour/configurations/tree/main/packages/prettier-config) | [Prettier](https://prettier.io/) configuration |
58
+ | [remark-config](https://github.com/davidsneighbour/configurations/tree/main/packages/remark-config) | [ReMark](https://github.com/remarkjs/remark-lint) configuration |
59
+ | [standard-version-config](https://github.com/davidsneighbour/configurations/tree/main/packages/standard-version-config) | [Standard Version](https://github.com/conventional-changelog/standard-version) configuration |
60
+ | [stylelint-config](https://github.com/davidsneighbour/configurations/tree/main/packages/stylelint-config) | [StyleLint](https://github.com/stylelint/stylelint) configuration |
61
+ | [textlint-config](https://github.com/davidsneighbour/configurations/tree/main/packages/textlint-config) | [TextLint](https://github.com/textlint/textlint) configuration |
62
+ | [webpack-config](https://github.com/davidsneighbour/configurations/tree/main/packages/webpack-config) | [Webpack](https://webpack.js.org/) configuration |
63
+ | [tools](https://github.com/davidsneighbour/configurations/tree/main/packages/tools) | Tools |
64
+
65
+ <!--- CONFIGURATIONS END --->
package/base-hugo.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "baseUrl": "http://192.168.1.201:1313",
3
+ "$schema": "https://on.cypress.io/cypress.schema.json",
4
+ "watchForFileChanges": true,
5
+ "downloadsFolder": "tests/cypress/downloads",
6
+ "fixturesFolder": "tests/cypress/fixtures",
7
+ "integrationFolder": "tests/cypress/integration",
8
+ "screenshotsFolder": "tests/cypress/screenshots",
9
+ "supportFile": "tests/cypress/support/index.js",
10
+ "videosFolder": "tests/cypress/videos"
11
+ }
package/base.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "baseUrl": "http://localhost:8888",
3
+ "$schema": "https://on.cypress.io/cypress.schema.json",
4
+ "watchForFileChanges": true,
5
+ "downloadsFolder": "tests/cypress/downloads",
6
+ "fixturesFolder": "tests/cypress/fixtures",
7
+ "integrationFolder": "tests/cypress/integration",
8
+ "screenshotsFolder": "tests/cypress/screenshots",
9
+ "supportFile": "tests/cypress/support/index.js",
10
+ "videosFolder": "tests/cypress/videos"
11
+ }
package/index.js ADDED
@@ -0,0 +1,21 @@
1
+ const deepmerge = require("deepmerge");
2
+ const path = require("path");
3
+
4
+ function loadConfig(filename) {
5
+ // console.log("reading config file %s", filename);
6
+ const configJson = require(filename);
7
+ if (configJson.extends) {
8
+ const baseConfigFilename = configJson.extends.startsWith(".")
9
+ ? path.join(path.dirname(filename), configJson.extends)
10
+ : require.resolve(configJson.extends);
11
+ // console.log("config file extends %s", baseConfigFilename);
12
+ const baseConfig = loadConfig(baseConfigFilename);
13
+ // console.log("merging %s with %s", baseConfigFilename, filename);
14
+ return deepmerge(baseConfig, configJson);
15
+ }
16
+ // console.log("config file %s does not extend", filename);
17
+ // console.log(configJson);
18
+ return configJson;
19
+ }
20
+
21
+ module.exports = loadConfig;
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@davidsneighbour/cypress-config",
3
+ "version": "3.5.9",
4
+ "license": "MIT",
5
+ "description": "Cypress configuration for davidsneighbour projects.",
6
+ "author": {
7
+ "name": "Patrick Kollitsch",
8
+ "email": "patrick@davids-neighbour.com",
9
+ "web": "https://davids-neighbour.com"
10
+ },
11
+ "repository": "git+https://github.com/davidsneighbour/configurations/",
12
+ "bugs": {
13
+ "url": "https://github.com/davidsneighbour/configurations/issues"
14
+ },
15
+ "dependencies": {
16
+ "axe-core": "^4.4.1",
17
+ "cypress": "^9.5.3",
18
+ "cypress-axe": "^0.14.0",
19
+ "debug": "^4.3.4",
20
+ "deepmerge": "^4.2.2",
21
+ "eslint-plugin-cypress": "^2.12.1"
22
+ },
23
+ "commitlint": {
24
+ "extends": [
25
+ "@davidsneighbour/commitlint-config"
26
+ ]
27
+ },
28
+ "engines": {
29
+ "node": ">=16",
30
+ "npm": ">=7"
31
+ },
32
+ "gitHead": "55c20949cd12651b0dfc600b5b316c8a42776506",
33
+ "main": "index.js"
34
+ }