You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
End-to-end testing, CI script, and JavaScript QoL improvements:
- **Environment variable formatting** - Updated environment variable configuration from array format to object format to comply with Lefthook schema validation requirements.
- **Unified link testing** - Consolidated multiple product-specific link testing commands into a single `e2e-links` command that processes all staged Markdown and HTML files across content directories.
- **Package script integration** - Modified commands to use centralized yarn scripts instead of direct execution, improving maintainability and consistency.
- **Source information extraction** - Enhanced to correctly extract and report source information from frontmatter.
- **URL and source mapping** - Improved handling of URL to source path mapping for better reporting.
- **Ignored anchor links configuration** - Added proper exclusion of behavior-triggering anchor links (like tab navigation) to prevent false positives.
- **Request options correction** - Fixed Cypress request options to ensure `failOnStatusCode` is properly set when `retryOnStatusCodeFailure` is enabled.
- **Improved error reporting** - Enhanced error reporting with more context about broken links.
- **New test scripts added** - Added centralized testing scripts for link checking and codeblock validation.
- **Product-specific test commands** - Added commands for each product version (InfluxDB v2, v3 Core, Enterprise, Cloud, etc.).
- **API docs testing** - Added specialized commands for testing API documentation links.
- **Comprehensive test runners** - Added commands to run all tests of a specific type (`test:links:all`, `test:codeblocks:all`).
- Fix Docker build command and update CONTRIBUTING.
chore(js): JavaScript QoL improvements:
- Refactor main.js with a componentRegistry object and clear initialization of components and globals
- Add a standard index.js with all necessary exports.
- Update javascript.html to use the index.js
- Remove jQuery script tag from header javascript.html (remains in footer)
- Update package file to improve module discovery.
- Improve Hugo and ESLint config for module discovery and ES6 syntax
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,8 +28,10 @@ For the linting and tests to run, you need to install Docker and Node.js
28
28
dependencies.
29
29
30
30
\_**Note:**
31
-
We strongly recommend running linting and tests, but you can skip them
32
-
(and avoid installing dependencies)
31
+
The git pre-commit and pre-push hooks are configured to run linting and tests automatically
32
+
when you commit or push changes.
33
+
We strongly recommend letting them run, but you can skip them
34
+
(and avoid installing related dependencies)
33
35
by including the `--no-verify` flag with your commit--for example, enter the following command in your terminal:
34
36
35
37
```sh
@@ -51,7 +53,7 @@ dev dependencies used in pre-commit hooks for linting, syntax-checking, and test
51
53
Dev dependencies include:
52
54
53
55
-[Lefthook](https://github.com/evilmartians/lefthook): configures and
54
-
manages pre-commit hooks for linting and testing Markdown content.
56
+
manages git pre-commit and pre-push hooks for linting and testing Markdown content.
55
57
-[prettier](https://prettier.io/docs/en/): formats code, including Markdown, according to style rules for consistency
56
58
-[Cypress]: e2e testing for UI elements and URLs in content
57
59
@@ -93,9 +95,11 @@ Make your suggested changes being sure to follow the [style and formatting guide
93
95
94
96
## Lint and test your changes
95
97
98
+
`package.json` contains scripts for running tests and linting.
99
+
96
100
### Automatic pre-commit checks
97
101
98
-
docs-v2 uses Lefthook to manage Git hooks, such as pre-commit hooks that lint Markdown and test code blocks.
102
+
docs-v2 uses Lefthook to manage Git hooks that run during pre-commit and pre-push. The hooks run the scripts defined in `package.json` to lint Markdown and test code blocks.
99
103
When you try to commit changes (`git commit`), Git runs
100
104
the commands configured in `lefthook.yml` which pass your **staged** files to Vale,
101
105
Prettier, Cypress (for UI tests and link-checking), and Pytest (for testing Python and shell code in code blocks).
// On content loaded, initialize (not-component-ready) UI interaction modules
77
-
// To differentiate these from component-ready modules, these modules typically export an initialize function that wraps UI interactions and event listeners.
117
+
/**
118
+
* Initialize all non-component modules
119
+
*/
120
+
functioninitModules(){
78
121
modals.initialize();
79
122
apiLibs.initialize();
80
123
codeControls.initialize();
@@ -84,67 +127,24 @@ document.addEventListener('DOMContentLoaded', function () {
84
127
pageFeedback.initialize();
85
128
tabbedContent.initialize();
86
129
v3Wayfinding.initialize();
130
+
}
87
131
88
-
/** Initialize components
89
-
Component Structure: Each component is structured as a jQuery anonymous function that listens for the document ready state.
90
-
Initialization in main.js: Each component is called in main.js inside a jQuery document ready function to ensure they are initialized when the document is ready.
91
-
Note: These components should *not* be called directly in the HTML.
0 commit comments