Skip to content

Commit 17683b1

Browse files
Merge branch 'master' into asset-validation-error-per-asset-6.x
2 parents 2d626a9 + e4eb1c3 commit 17683b1

File tree

1,022 files changed

+10406
-3325
lines changed

Some content is hidden

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

1,022 files changed

+10406
-3325
lines changed

.github/workflows/pr-title.yml

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,56 @@ jobs:
88
pr-title:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: deepakputhraya/action-pr-title@master
12-
with:
13-
regex: '^\[\d+\.x\]\s'
11+
- name: Validate PR title matches target branch
12+
env:
13+
PR_TITLE: ${{ github.event.pull_request.title }}
14+
BASE_BRANCH: ${{ github.event.pull_request.base.ref }}
15+
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
16+
run: |
17+
# Validates PR title against target branch
18+
# Returns error message if invalid, empty string if valid
19+
validate_pr_title() {
20+
local target_branch="$1"
21+
local pr_title="$2"
22+
local default_branch="$3"
23+
24+
# Check if target branch is a version branch (e.g., 5.x, 4.x)
25+
if [[ $target_branch =~ ^([0-9]+)\.x$ ]]; then
26+
local version="${BASH_REMATCH[1]}"
27+
if [[ ! $pr_title =~ ^\[$version\.x\][[:space:]] ]]; then
28+
echo "PR targeting '$target_branch' must have title starting with '[$version.x] '"
29+
return
30+
fi
31+
32+
# Check if target branch is master (next major version)
33+
elif [[ $target_branch == "master" ]]; then
34+
local current_version="${default_branch//\.x/}"
35+
local next_version=$((current_version + 1))
36+
if [[ ! $pr_title =~ ^\[$next_version\.x\][[:space:]] ]]; then
37+
echo "PR targeting 'master' must have title starting with '[$next_version.x] '"
38+
return
39+
fi
40+
41+
# For other branches, just enforce that there's a version prefix
42+
else
43+
if [[ ! $pr_title =~ ^\[[0-9]+\.x\][[:space:]] ]]; then
44+
echo "PR title must start with a version prefix like '[5.x] '"
45+
return
46+
fi
47+
fi
48+
49+
echo ""
50+
}
51+
52+
echo "PR Title: $PR_TITLE"
53+
echo "Base Branch: $BASE_BRANCH"
54+
echo "Default Branch: $DEFAULT_BRANCH"
55+
56+
ERROR=$(validate_pr_title "$BASE_BRANCH" "$PR_TITLE" "$DEFAULT_BRANCH")
57+
58+
if [[ -n $ERROR ]]; then
59+
echo $ERROR
60+
exit 1
61+
fi
62+
63+
echo "PR title validation passed"

.github/workflows/release.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,7 @@ jobs:
8080
asset_name: dist-package.tar.gz
8181
asset_content_type: application/tar+gz
8282

83-
- name: Upload dist-ui zip to release
84-
uses: actions/[email protected]
85-
env:
86-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87-
with:
88-
upload_url: ${{ steps.create_release.outputs.upload_url }}
89-
asset_path: ./resources/dist-ui.tar.gz
90-
asset_name: dist-ui.tar.gz
91-
asset_content_type: application/tar+gz
83+
- name: Deploy Storybook to Forge
84+
continue-on-error: true
85+
run: |
86+
curl -X POST "${{ secrets.FORGE_STORYBOOK_WEBHOOK }}"

.github/workflows/tests.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,13 @@ jobs:
1616

1717
strategy:
1818
matrix:
19-
php: [8.2, 8.3, 8.4]
20-
laravel: [11.*, 12.*]
19+
php: [8.3, 8.4, 8.5]
20+
laravel: [12.*]
2121
stability: [prefer-lowest, prefer-stable]
2222
os: [ubuntu-latest]
2323
include:
2424
- os: windows-latest
25-
php: 8.4
26-
laravel: 11.*
27-
stability: prefer-stable
28-
- os: windows-latest
29-
php: 8.4
25+
php: 8.5
3026
laravel: 12.*
3127
stability: prefer-stable
3228

@@ -130,13 +126,21 @@ jobs:
130126
if: steps.should-run-tests.outputs.result == 'true'
131127
run: npm ci
132128

129+
- name: Install Playwright browsers
130+
if: steps.should-run-tests.outputs.result == 'true'
131+
run: npx playwright install chromium
132+
133133
- name: Execute tests
134134
if: steps.should-run-tests.outputs.result == 'true'
135135
run: npm run test
136136
env:
137137
CI: true
138138
LARAVEL_BYPASS_ENV_CHECK: 1
139139

140+
- name: Verify build succeeds
141+
if: steps.should-run-tests.outputs.result == 'true'
142+
run: npm run build
143+
140144
slack:
141145
name: Slack Notification
142146
runs-on: ubuntu-latest

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ resources/dist
1111
resources/dist-dev
1212
resources/dist-frontend
1313
resources/dist-package
14-
resources/dist-ui
1514
packages/cms/src/ui.css
1615
composer.lock
1716
.env
1817
bundle-stats.html
1918
.claude
19+
storybook-static

.storybook/clean-code-snippet.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
export default function cleanCodeSnippet(code) {
2+
// Extract template content from render functions or template tags
3+
let cleaned = code;
4+
5+
// Handle render function format
6+
const renderMatch = code.match(/template:\s*`([\s\S]*?)`/);
7+
if (renderMatch) {
8+
cleaned = renderMatch[1];
9+
} else {
10+
// Handle simple template format
11+
cleaned = code.replace(/<template>([\s\S]*?)<\/template>/, '$1');
12+
}
13+
14+
// Split into lines and remove common leading whitespace
15+
const lines = cleaned.split('\n').filter(line => line.length > 0 || line.trim().length > 0);
16+
17+
// Find minimum indentation (ignoring empty lines)
18+
const indents = lines
19+
.filter(line => line.trim().length > 0)
20+
.map(line => line.match(/^(\s*)/)?.[1].length || 0);
21+
22+
const minIndent = indents.length > 0 ? Math.min(...indents) : 0;
23+
24+
// Remove the common indentation and trim
25+
return lines
26+
.map(line => line.slice(minIndent))
27+
.join('\n')
28+
.trim();
29+
}

.storybook/main.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import type { StorybookConfig } from '@storybook/vue3-vite';
2+
3+
const config: StorybookConfig = {
4+
stories: [
5+
'../resources/js/stories/**/*.mdx',
6+
'../resources/js/stories/**/*.stories.@(js|jsx|mjs|ts|tsx)'
7+
],
8+
addons: [
9+
'@storybook/addon-docs',
10+
'@storybook/addon-a11y'
11+
],
12+
staticDirs: ['./public'],
13+
framework: {
14+
name: '@storybook/vue3-vite',
15+
options: {
16+
docgen: 'vue-component-meta'
17+
}
18+
},
19+
};
20+
21+
export default config;

.storybook/manager-head.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<link rel="preconnect" href="https://fonts.googleapis.com">
2+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
3+
<link href="https://fonts.googleapis.com/css2?family=Lexend:wght@400;500;600;700&family=Source+Code+Pro:wght@400;500&display=swap" rel="stylesheet">

.storybook/manager.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.sidebar-container {
2+
background: linear-gradient(225deg, #e6f8ff, #f9e6ff, hsl(35deg 100% 95%)) !important;
3+
}

.storybook/manager.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { addons } from 'storybook/manager-api';
2+
import { create } from 'storybook/theming';
3+
import './manager.css';
4+
5+
const theme = create({
6+
base: 'light',
7+
brandTitle: 'Statamic UI Components',
8+
brandUrl: 'https://statamic.dev',
9+
brandImage: '/logo.png',
10+
fontBase: '"Lexend", sans-serif',
11+
fontCode: '"Source Code Pro", monospace'
12+
});
13+
14+
addons.setConfig({
15+
theme,
16+
});

.storybook/preview-head.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<link rel="preconnect" href="https://use.typekit.net" crossorigin>
2+
<link rel="preconnect" href="https://p.typekit.net" crossorigin>
3+
<link rel="stylesheet" href="https://use.typekit.net/wyy0pka.css"/>
4+
5+
<link rel="preconnect" href="https://fonts.googleapis.com">
6+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
7+
<link href="https://fonts.googleapis.com/css2?family=Lexend:[email protected]&family=Source+Code+Pro:ital,wght@0,200..800;1,200..900&display=swap" rel="stylesheet">

0 commit comments

Comments
 (0)