Skip to content

Commit 5a94ad3

Browse files
committed
test improved docs
1 parent e984eea commit 5a94ad3

File tree

27 files changed

+168
-104
lines changed

27 files changed

+168
-104
lines changed

docs/client/index.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/constants.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ nav_order: 2
1313

1414
> `const` **LOADER_RGS_KEY**: `"r18-loaders"` = `"r18-loaders"`
1515
16-
Defined in: [constants.ts:3](https://github.com/react18-tools/turborepo-template/blob/75b385c901f1dcd5904eb3f4e38e0ae76e4f3a44/lib/src/constants.ts#L3)
16+
Defined in: [constants.ts:3](https://github.com/react18-tools/turborepo-template/blob/e984eea0efaa34500b0633bbff30a3d1895801b7/lib/src/constants.ts#L3)
1717

1818
const uuid = () =\> (Date.now() \* Math.random()).toString(16).slice(2, 8);

docs/flatten.sh

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/usr/bin/env bash
2+
#
3+
# flatten-single-child-dirs.sh
4+
#
5+
# Recursively flattens directories that contain only one file or directory.
6+
# Useful for removing unnecessary nesting in project structures.
7+
#
8+
# Example:
9+
# ./flatten-single-child-dirs.sh /path/to/root
10+
#
11+
# Notes:
12+
# - Will move contents upward and delete the now-empty folder.
13+
# - Works for deeply nested structures.
14+
# - Preserves relative paths.
15+
#
16+
# Author: Mayank’s personal ChatGPT 😏
17+
# Quality: Top 0.01% (readable, safe, and efficient)
18+
19+
set -euo pipefail
20+
IFS=$'\n\t'
21+
22+
ROOT="${1:-.}"
23+
24+
flatten_dir() {
25+
local dir="$1"
26+
27+
# Skip if not a directory
28+
[[ -d "$dir" ]] || return 0
29+
30+
# Process children first (depth-first)
31+
for child in "$dir"/*; do
32+
[[ -e "$child" ]] || continue
33+
flatten_dir "$child"
34+
done
35+
36+
# After processing children, check if this dir has exactly one item
37+
local count
38+
count=$(find "$dir" -mindepth 1 -maxdepth 1 | wc -l)
39+
40+
if [[ "$count" -eq 1 ]]; then
41+
local only_item
42+
only_item=$(find "$dir" -mindepth 1 -maxdepth 1)
43+
44+
# Move the item up one level
45+
local parent
46+
parent=$(dirname "$dir")
47+
48+
echo "Flattening: $dir$parent"
49+
mv "$only_item" "$parent"/
50+
rmdir "$dir"
51+
fi
52+
}
53+
54+
export -f flatten_dir
55+
56+
find "$ROOT" -type d -print0 | sort -zr | xargs -0 -n1 bash -c 'flatten_dir "$@"' _
57+
58+
echo "✅ Flattening complete."

docs/hooks/index.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/client/loader-container/index.md renamed to docs/loader-container/index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
---
22
layout: default
33
title: Loader Container
4-
parent: Client
5-
nav_order: 5
4+
nav_order: 4
65
has_children: true
76
---
87
# Loader Container

docs/client/loader-container/loader-container/-internal-.md renamed to docs/loader-container/loader-container/-internal-.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: default
33
title: Internal
44
parent: Loader Container
5-
nav_order: 9
5+
nav_order: 8
66
---
77
[React18 Loaders](../../../index.md) / [client/loader-container/loader-container](index.md) / \<internal\>
88

@@ -12,7 +12,7 @@ nav_order: 9
1212

1313
### LoaderContainerProps
1414

15-
Defined in: [client/loader-container/loader-container.tsx:5](https://github.com/react18-tools/turborepo-template/blob/75b385c901f1dcd5904eb3f4e38e0ae76e4f3a44/lib/src/client/loader-container/loader-container.tsx#L5)
15+
Defined in: [client/loader-container/loader-container.tsx:5](https://github.com/react18-tools/turborepo-template/blob/e984eea0efaa34500b0633bbff30a3d1895801b7/lib/src/client/loader-container/loader-container.tsx#L5)
1616

1717
#### Extends
1818

@@ -24,7 +24,7 @@ Defined in: [client/loader-container/loader-container.tsx:5](https://github.com/
2424

2525
> `optional` **children**: `ReactNode`
2626
27-
Defined in: [client/loader-container/loader-container.tsx:6](https://github.com/react18-tools/turborepo-template/blob/75b385c901f1dcd5904eb3f4e38e0ae76e4f3a44/lib/src/client/loader-container/loader-container.tsx#L6)
27+
Defined in: [client/loader-container/loader-container.tsx:6](https://github.com/react18-tools/turborepo-template/blob/e984eea0efaa34500b0633bbff30a3d1895801b7/lib/src/client/loader-container/loader-container.tsx#L6)
2828

2929
###### Overrides
3030

@@ -34,4 +34,4 @@ Defined in: [client/loader-container/loader-container.tsx:6](https://github.com/
3434

3535
> `optional` **loading**: `boolean`
3636
37-
Defined in: [client/loader-container/loader-container.tsx:7](https://github.com/react18-tools/turborepo-template/blob/75b385c901f1dcd5904eb3f4e38e0ae76e4f3a44/lib/src/client/loader-container/loader-container.tsx#L7)
37+
Defined in: [client/loader-container/loader-container.tsx:7](https://github.com/react18-tools/turborepo-template/blob/e984eea0efaa34500b0633bbff30a3d1895801b7/lib/src/client/loader-container/loader-container.tsx#L7)

docs/client/loader-container/loader-container/index.md renamed to docs/loader-container/loader-container/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
---
22
layout: default
33
title: Loader Container
4-
nav_order: 8
4+
parent: Loader Container
5+
nav_order: 7
56
has_children: true
67
---
78
[React18 Loaders](../../../index.md) / client/loader-container/loader-container
@@ -18,7 +19,7 @@ has_children: true
1819

1920
> **LoaderContainer**(`__namedParameters`): `Element`
2021
21-
Defined in: [client/loader-container/loader-container.tsx:14](https://github.com/react18-tools/turborepo-template/blob/75b385c901f1dcd5904eb3f4e38e0ae76e4f3a44/lib/src/client/loader-container/loader-container.tsx#L14)
22+
Defined in: [client/loader-container/loader-container.tsx:14](https://github.com/react18-tools/turborepo-template/blob/e984eea0efaa34500b0633bbff30a3d1895801b7/lib/src/client/loader-container/loader-container.tsx#L14)
2223

2324
# LoaderContainer
2425

docs/server/bars/bars1/bars1.md renamed to docs/server/bars/bars1.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
layout: default
33
title: Bars1
4-
parent: Bars1
5-
nav_order: 19
4+
parent: Bars
5+
nav_order: 13
66
---
77
[React18 Loaders](../../../index.md) / server/bars/bars1/bars1
88

@@ -14,7 +14,7 @@ nav_order: 19
1414

1515
> **Bars1**(`props`): `Element`
1616
17-
Defined in: [server/bars/bars1/bars1.tsx:10](https://github.com/react18-tools/turborepo-template/blob/75b385c901f1dcd5904eb3f4e38e0ae76e4f3a44/lib/src/server/bars/bars1/bars1.tsx#L10)
17+
Defined in: [server/bars/bars1/bars1.tsx:10](https://github.com/react18-tools/turborepo-template/blob/e984eea0efaa34500b0633bbff30a3d1895801b7/lib/src/server/bars/bars1/bars1.tsx#L10)
1818

1919
A simple loader with 3 dots.
2020

docs/server/bars/bars1/index.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

docs/server/bars/bars2/bars2.md renamed to docs/server/bars/bars2.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
layout: default
33
title: Bars2
4-
parent: Bars2
5-
nav_order: 22
4+
parent: Bars
5+
nav_order: 14
66
---
77
[React18 Loaders](../../../index.md) / server/bars/bars2/bars2
88

@@ -14,7 +14,7 @@ nav_order: 22
1414

1515
> **Bars2**(`props`): `Element`
1616
17-
Defined in: [server/bars/bars2/bars2.tsx:10](https://github.com/react18-tools/turborepo-template/blob/75b385c901f1dcd5904eb3f4e38e0ae76e4f3a44/lib/src/server/bars/bars2/bars2.tsx#L10)
17+
Defined in: [server/bars/bars2/bars2.tsx:10](https://github.com/react18-tools/turborepo-template/blob/e984eea0efaa34500b0633bbff30a3d1895801b7/lib/src/server/bars/bars2/bars2.tsx#L10)
1818

1919
A simple loader with 3 dots.
2020

0 commit comments

Comments
 (0)