Skip to content

Commit 6b78e02

Browse files
committed
Merge branch 'main' into refactor-migrated-package-manager-to-pnpm
2 parents e82152d + 7334809 commit 6b78e02

File tree

98 files changed

+272
-217
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+272
-217
lines changed

.config/.lintstagedrc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@ export default {
88
'stylelint.config.*': 'stylelint --validate --allow-empty-input',
99
// And elsewhere we don't, compare to https://github.com/stylelint/stylelint/pull/8009
1010
'*.{css,scss}': 'stylelint --fix --allow-empty-input --no-validate',
11-
'*.{js,ts,tsx,jsx,mjs,cjs}': 'xo --fix'
11+
'*.{js,ts,tsx,jsx,mjs,cjs}': 'xo --fix',
12+
// ensure that security vulnerabilities are fixed before committing
13+
'package-lock.json': 'npm audit fix --omit=dev'
1214
};

.github/dependabot.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,6 @@ updates:
8787
guidepup:
8888
patterns:
8989
- "@guidepup/*"
90+
stylelint:
91+
patterns:
92+
- "stylelint*"

.husky/pre-push

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Configuration: Define checks as functions for better maintainability
2+
# Each check function should:
3+
# - Define a PATTERN variable for file matching
4+
# - Define a COMMAND variable for the command to run
5+
# - Define a DESCRIPTION variable for user feedback
6+
7+
check_npm_files() {
8+
PATTERN='^(package\.json|package-lock\.json)$'
9+
COMMAND='npm install --package-lock-only --ignore-scripts'
10+
DESCRIPTION='package.json or package-lock.json – please run npm install to update dependencies'
11+
}
12+
13+
check_pnpm_files() {
14+
PATTERN='^(package\.json|pnpm-lock\.yaml)$'
15+
COMMAND='pnpm install --lockfile-only --ignore-scripts'
16+
DESCRIPTION='package.json or pnpm-lock.yaml – please run pnpm install to update dependencies'
17+
}
18+
19+
# List of all check functions
20+
# Detect the lock file to determine the package manager
21+
if [ -f "pnpm-lock.yaml" ]; then
22+
CHECK_FUNCTIONS=(
23+
"check_pnpm_files"
24+
)
25+
elif [ -f "package-lock.json" ]; then
26+
CHECK_FUNCTIONS=(
27+
"check_npm_files"
28+
)
29+
else
30+
echo "No lock file detected for pnpm or npm. Aborting pre-push checks."
31+
exit 1
32+
fi
33+
34+
# Check for changes in specified files before pushing and run corresponding commands
35+
## Get the upstream branch
36+
UPSTREAM=$(git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null || echo "")
37+
if [ -z "$UPSTREAM" ]; then
38+
echo "No upstream configured, detecting default branch."
39+
# Try to detect the default branch from origin/HEAD
40+
DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@')
41+
if [ -z "$DEFAULT_BRANCH" ]; then
42+
echo "Could not detect default branch, falling back to 'main'."
43+
DEFAULT_BRANCH="main"
44+
fi
45+
UPSTREAM="$DEFAULT_BRANCH"
46+
fi
47+
48+
## Get the list of files changed between upstream and HEAD
49+
FILES=$(git diff --name-only "$UPSTREAM"..HEAD)
50+
51+
## Check each pattern and run corresponding command
52+
for check_function in "${CHECK_FUNCTIONS[@]}"; do
53+
# Call the check function to set variables
54+
$check_function
55+
56+
if echo "$FILES" | grep --exclude-dir={.git,node_modules,__snapshots__,output} --quiet --extended-regexp --recursive "$PATTERN"; then
57+
echo "Detected changes in $DESCRIPTION"
58+
59+
## Run the corresponding command
60+
$COMMAND
61+
62+
if [ $? -ne 0 ]; then
63+
echo "Command failed: $COMMAND. Aborting push."
64+
exit 1
65+
fi
66+
67+
# Check for file modifications after running the command
68+
MODIFIED_FILES=$(git diff --name-only)
69+
if [ -n "$MODIFIED_FILES" ]; then
70+
echo "Detected file modifications after running $COMMAND:"
71+
echo "$MODIFIED_FILES"
72+
echo "Please stage the changes before pushing."
73+
exit 1
74+
fi
75+
fi
76+
done
77+
78+
echo "No monitored file changes detected. Skipping checks."

.stylelintrc.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{
2-
"extends": [
3-
"stylelint-config-standard",
4-
"stylelint-config-recommended-scss"
5-
],
2+
"extends": ["stylelint-config-standard-scss"],
63
"plugins": [
74
"stylelint-use-logical",
85
"@double-great/stylelint-a11y",

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"generate:component-research": "node scripts/component-research/generate-component-research.js"
1414
},
1515
"devDependencies": {
16-
"inquirer": "12.9.1"
16+
"inquirer": "12.9.2"
1717
},
1818
"publishConfig": {
1919
"registry": "https://registry.npmjs.org/",

docs/stylelint-scss-config.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Differences in between `stylelint-config-standard-scss` and `stylelint-config-recommended-scss`
2+
3+
## Short version
4+
5+
- `stylelint-config-recommended-scss`
6+
- Minimal, “avoid bugs” preset for SCSS.
7+
- Extends the core recommended rules and the SCSS plugin’s recommended rules.
8+
- Turns off core rules that conflict with SCSS syntax.
9+
- Little to no stylistic/opinionated formatting. Fewer warnings; great if you use Prettier.
10+
11+
- `stylelint-config-standard-scss`
12+
- Superset of recommended-scss with opinions.
13+
- Adds many formatting/convention rules (mostly via `stylelint-stylistic`) for quotes, spacing, commas, hex case/length, newline placement, etc.
14+
- Still disables core rules that conflict with SCSS, but enforces a consistent style and will surface more issues (mostly auto-fixable).
15+
16+
## Practical guidance
17+
18+
- Use recommended-scss if you want just correctness checks for SCSS and let Prettier handle formatting.
19+
- Use standard-scss if you want Stylelint to also enforce style conventions across SCSS.
20+
- Either SCSS preset avoids CSS‑Nesting‑only checks on .scss files (the “missing scoping root” issue appears when using non‑SCSS presets like `stylelint-config-standard` on SCSS).

output/stencil/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,6 @@
4040
"registry": "https://registry.npmjs.org/",
4141
"access": "public"
4242
},
43-
"web-types": "./dist/web-types.json"
43+
"web-types": "./dist/web-types.json",
44+
"customElements": "dist/custom-elements.json"
4445
}

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"@playwright/experimental-ct-react": "1.54.2",
9191
"@playwright/experimental-ct-vue": "1.54.2",
9292
"@playwright/test": "1.54.2",
93-
"accessibility-checker": "4.0.7",
93+
"accessibility-checker": "4.0.8",
9494
"adm-zip": "0.5.16",
9595
"commander": "14.0.0",
9696
"cpr": "3.0.1",
@@ -120,8 +120,7 @@
120120
"rimraf": "6.0.1",
121121
"rxjs": "7.8.2",
122122
"stylelint": "16.23.1",
123-
"stylelint-config-recommended-scss": "15.0.1",
124-
"stylelint-config-standard": "38.0.0",
123+
"stylelint-config-standard-scss": "^15.0.1",
125124
"stylelint-use-logical": "2.1.2",
126125
"tslib": "2.8.1",
127126
"tsx": "4.20.4",

packages/components/src/components/accordion/accordion.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The spacings are not part of the styling of the accordion items themselves.
2121

2222
&[data-variant="divider"],
2323
&:not([data-variant]) {
24-
@include accordion-subsequent-item-selector() {
24+
@include accordion-subsequent-item-selector {
2525
// One space each before and after the divider results in a double spacing
2626
margin-block-start: calc(2 * #{variables.$db-spacing-fixed-sm});
2727

@@ -35,7 +35,7 @@ The spacings are not part of the styling of the accordion items themselves.
3535
}
3636

3737
&[data-variant="card"] {
38-
@include accordion-subsequent-item-selector() {
38+
@include accordion-subsequent-item-selector {
3939
margin-block-start: variables.$db-spacing-fixed-sm;
4040
}
4141

packages/components/src/components/badge/badge.scss

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
@extend %component-border;
4747
@extend %db-overwrite-font-size-2xs;
4848
@extend %default-button;
49-
5049
@include tag-components.get-tag-colors("badge");
5150

5251
border-radius: variables.$db-border-radius-full;
@@ -55,6 +54,13 @@
5554
inline-size: fit-content;
5655
font-weight: 700;
5756

57+
// Added a minimum inline size, especially for single-character content, to ensure that it won't be any narrower than a circle.
58+
&:not(:empty) {
59+
min-inline-size: calc(1.4em - 2 * #{variables.$db-spacing-fixed-2xs});
60+
box-sizing: content-box;
61+
}
62+
63+
// Icon specific settings
5864
&:has(.db-icon) {
5965
padding: variables.$db-spacing-fixed-3xs;
6066
}

0 commit comments

Comments
 (0)