Skip to content

Commit 3a9f902

Browse files
Alexey-Pavlovmocca102MudaafiZSnakeesezen
authored
[CDX-257] Publish revamped docs (#238)
* Ci 4255 os UI autocomplete add GitHub readme overview (#201) * Add Library overview and installation and quick guide * update title * update styles * update styles * updates * updates * Edit gif height * remove yarn * remove yarn * update * Update README Co-authored-by: Ahmad Mudaafi' <ahmad.mudaafi@constructor.io> Co-authored-by: Viktor Zavala <zavala.viktor@gmail.com> * Address comments --------- Co-authored-by: Ahmad Mudaafi' <ahmad.mudaafi@constructor.io> Co-authored-by: Viktor Zavala <zavala.viktor@gmail.com> * Add Advanced Features (#208) * Add Advanced Features * Add code examples section to readme (#209) * Add code examples section to readme * Update README.md Co-authored-by: Enes Kutay SEZEN <eneskutaysezen@gmail.com> * Update README.md Co-authored-by: Enes Kutay SEZEN <eneskutaysezen@gmail.com> --------- Co-authored-by: Enes Kutay SEZEN <eneskutaysezen@gmail.com> --------- Co-authored-by: Enes Kutay SEZEN <eneskutaysezen@gmail.com> * Add docs flag to storybook (#210) * Add Contributing section (#218) * [CI-4265] Add License to README.md (#216) * add license * lint * add complementary resources (#217) * Add API regerence section * [CI-4261] New Docs: Add Troubleshooting Section to Readme (#220) * add troubleshooting section * left align text in tables * use html instead of markdown to render table * Update discussions link * Update integration modes (#213) * Update integration modes * upload gif to repo --------- Co-authored-by: stanlp1 <stanley.peng@constructor.io> * [CI-4259] Add GitHub readme customization (#214) * [CI-4259] Add customization section to readme * [CI-4259] Summarize and shorten descriptions --------- Co-authored-by: Viktor Zavala <viktor.zavala@constructor.io> * [CI-4292] Automate Table of Contents Generation using Doctoc (#219) * add doctoc automation * Sets pre_push script to be git executable * Update pre_push hook to exclude changes made by doctoc * test pre_push hook * test: edits to doctoc section * test2: edits to doctoc section * update pre_push hook * update readme * update doctoc configs * lint * update pre-push hook to append a new commit instead of ammend * testing pre_push hook flow * revert back to amend * Test the hook * Test * testing * Test Removing section * a * b * c * Add thing * Add new topic * Revert "revert back to amend" This reverts commit e56366d. * Reapply "revert back to amend" This reverts commit 46be0f7. * Update readme * Change pre-push to pre-commit * base case * move to post-commit * fix post-commit script * Test: README Change outside TOC * docs: auto-update README TOC (post-commit) * fix post-commit script * test: local TOC change * test: addition outside TOC * docs: auto-update README TOC (post-commit) * test: removal outside TOC, TOC updated * run doctoc --------- Co-authored-by: Enes Kutay SEZEN <eneskutaysezen@gmail.com> Co-authored-by: mocca102 <islaam.agamy@gmail.com> * [CI-4320] Create a Props.mdx for CioAutocomplete (#225) * copy commits * match comments * display props page * update test * [NOCI] README Troubleshooting: How to Add Peer Dependencies (#222) * add peer dependencies to troubleshooting.md * lint * transform mardown links to html anchors * code block * [CDX-257] Update story title for CioAutocomplete component --------- Co-authored-by: Islam Moustafa <58053149+mocca102@users.noreply.github.com> Co-authored-by: Ahmad Mudaafi' <ahmad.mudaafi@constructor.io> Co-authored-by: Viktor Zavala <zavala.viktor@gmail.com> Co-authored-by: mocca102 <islaam.agamy@gmail.com> Co-authored-by: Enes Kutay SEZEN <eneskutaysezen@gmail.com> Co-authored-by: ST P <57369888+stanlp1@users.noreply.github.com> Co-authored-by: stanlp1 <stanley.peng@constructor.io> Co-authored-by: Viktor Zavala <viktor.zavala@constructor.io>
1 parent 81bf77f commit 3a9f902

File tree

10 files changed

+2112
-401
lines changed

10 files changed

+2112
-401
lines changed

.husky/post-commit

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
# --- Configuration ---
5+
README_FILE="README.md"
6+
AUTO_COMMIT_MESSAGE=""
7+
8+
# --- Script Logic ---
9+
echo "Husky (post-commit): Checking for ${README_FILE} changes in the last commit."
10+
11+
# Check if README_FILE was modified in the last commit (HEAD)
12+
if git diff-tree --no-commit-id --name-only -r HEAD | grep -q "^${README_FILE}$"; then
13+
echo "Husky (post-commit): ${README_FILE} was modified in the last commit."
14+
15+
# Get the diff content of README_FILE from the last commit (HEAD vs HEAD^)
16+
# Ensure we handle the case of the very first commit (no HEAD^)
17+
if git rev-parse -q --verify HEAD^ >/dev/null 2>&1; then
18+
# Get the diff content, removing the meta-headers
19+
DIFF_CONTENT=$(git diff HEAD HEAD^ -U1000 "${README_FILE}" | sed 1,4d)
20+
else
21+
# First commit, consider all content as added outside TOC if not within TOC markers
22+
DIFF_CONTENT=$(git show HEAD:"${README_FILE}" -U1000 | sed 1,4d)
23+
fi
24+
25+
# Look for added lines (+) outside the TOC section
26+
DIFF_CONTENT_EXCLUDING_TOC=$(echo "$DIFF_CONTENT" | sed '/<!-- START doctoc/,/<!-- END doctoc/d' | grep '^[+-]' || true)
27+
28+
if [ -n "$DIFF_CONTENT_EXCLUDING_TOC" ]; then
29+
echo "Husky (post-commit): Changes detected in ${README_FILE} outside of the TOC section in the last commit."
30+
echo "Husky (post-commit): Running 'npm run doctoc-readme' to update the TOC..."
31+
32+
# Run doctoc. It will modify the working directory file if needed.
33+
npm run doctoc-readme
34+
35+
# Check if doctoc actually modified the README_FILE in the working directory
36+
if ! git diff --quiet "${README_FILE}"; then # True if working dir has changes for README_FILE
37+
echo "Husky (post-commit): 'npm run doctoc-readme' has modified ${README_FILE}."
38+
echo "Husky (post-commit): Staging these changes and creating a new commit for the TOC update."
39+
git add "${README_FILE}"
40+
41+
# Create a new commit for the TOC changes. Use --no-verify to prevent hooks from running again.
42+
git commit --no-verify -m "docs: auto-update README TOC (post-commit)"
43+
if [ $? -ne 0 ]; then
44+
echo "Husky (post-commit): ERROR - Failed to commit TOC update."
45+
fi
46+
47+
else
48+
echo "Husky (post-commit): 'npm run doctoc-readme' ran. No further changes were needed for ${README_FILE} or it was already up-to-date."
49+
fi
50+
else
51+
echo "Husky (post-commit): No changes detected in ${README_FILE} outside of the TOC section in the last commit."
52+
fi
53+
else
54+
echo "Husky (post-commit): ${README_FILE} was not modified in the last commit. Skipping TOC check."
55+
fi
56+
57+
exit 0 # Post-commit hooks should always exit 0

.storybook/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ const isProduction = process.env.NODE_ENV === 'production';
22

33
module.exports = {
44
stories: isProduction
5-
? ['../src/**/Autocomplete/**/*.stories.mdx', '../src/**/Autocomplete/**/*.stories.@(js|jsx|ts|tsx)']
6-
: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
5+
? ['../src/**/Autocomplete/**/*.mdx', '../src/**/Autocomplete/**/*.stories.@(js|jsx|ts|tsx)']
6+
: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
77
addons: [
88
'@storybook/addon-links',
99
'@storybook/addon-essentials',

0 commit comments

Comments
 (0)