Skip to content

Commit 630652a

Browse files
committed
Fix TS build artifacts
1 parent 18906dd commit 630652a

27 files changed

+251
-343
lines changed

.husky/pre-commit

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/bash
22

3+
max_cpus=$(sysctl -n hw.ncpu)
4+
max_cpus=$((max_cpus > 4 ? max_cpus : 4))
5+
max_cpus=$((max_cpus - 1))
6+
37
# Exit immediately if any command fails
48
set -e
59

@@ -20,32 +24,33 @@ yarn run lint
2024
# Build all packages
2125
echo ""
2226
echo "Building all packages..."
23-
yarn run build:all
24-
25-
# Auto-add package dist folders to git index immediately after build
26-
git add packages/core/dist/ || true
27-
git add packages/v5/dist/ || true
28-
git add packages/v6/dist/ || true
29-
git add packages/v7/dist/ || true
30-
git add docs/static/ || true
27+
yarn --silent run build:all
3128

3229
# Run Playwright tests (all e2e tests)
3330
echo ""
3431
echo "Running Playwright tests..."
35-
npx playwright test --quiet
32+
npx playwright test --quiet --workers $max_cpus
3633

37-
# Add dist files again in case Playwright tests modified them
34+
# Auto-add package dist folders to git index immediately after build
3835
git add packages/core/dist/ || true
3936
git add packages/v5/dist/ || true
4037
git add packages/v6/dist/ || true
4138
git add packages/v7/dist/ || true
4239
git add docs/static/ || true
40+
git add demos/v5/dist/ || true
41+
git add demos/v6/dist/ || true
42+
git add demos/v7/dist/ || true
43+
44+
# Refresh git index to ensure all changes are properly detected
45+
git update-index --refresh || true
4346

44-
echo "Checking for unstaged changes in built files..."
47+
echo "Checking for unstaged changes in non-build files..."
4548

46-
# Check for unstaged changes after build:all in package dist directories
47-
if git status --porcelain | grep -E "(packages/.*/dist/|docs/static/)" > /dev/null; then
48-
echo "Changes detected in built files. Please review and commit the changes." >&2
49+
# Check for unstaged changes OUTSIDE of build directories (these need manual review)
50+
# git status --porcelain format: XY filename where Y is workspace status (space = clean, M = modified)
51+
if git status --porcelain | grep '^.[M]' | grep -v -E "(packages/.*/dist/|docs/static/|demos/.*/dist/)" | grep . > /dev/null; then
52+
echo "Changes detected in non-build files. Please review and commit the following files:" >&2
53+
git status --porcelain | grep '^.[M]' | grep -v -E "(packages/.*/dist/|docs/static/|demos/.*/dist/)" >&2
4954
git update-index --again
5055
exit 1
5156
fi

demos/shared/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mui-flexy-demo-shared",
3-
"version": "2.0.1",
3+
"version": "2.0.2-rc.0",
44
"description": "Shared components for mui-flexy demos",
55
"private": true,
66
"dependencies": {

demos/v5/dist/bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demos/v5/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mui-flexy-demo-v5",
3-
"version": "2.0.1",
3+
"version": "2.0.2-rc.0",
44
"description": "Demo server for mui-flexy v5",
55
"private": true,
66
"scripts": {

demos/v6/dist/bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demos/v6/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mui-flexy-demo-v6",
3-
"version": "2.0.1",
3+
"version": "2.0.2-rc.0",
44
"description": "Demo server for mui-flexy v6",
55
"private": true,
66
"scripts": {

demos/v7/dist/bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demos/v7/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mui-flexy-demo-v7",
3-
"version": "2.0.1",
3+
"version": "2.0.2-rc.0",
44
"description": "Demo server for mui-flexy v7",
55
"private": true,
66
"scripts": {

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mui-flexy-docs",
3-
"version": "2.0.1",
3+
"version": "2.0.2-rc.0",
44
"description": "Documentation for mui-flexy",
55
"private": true,
66
"type": "module",

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mui-flexy",
3-
"version": "2.0.1",
3+
"version": "2.0.2-rc.0",
44
"description": "A flexbox convenience component for Material UI Box and Grid with handy shorthand props",
55
"type": "module",
66
"workspaces": [
@@ -19,7 +19,7 @@
1919
"build:all": "yarn build && yarn build:demos",
2020
"build:demos": "yarn workspaces foreach -p -A --include 'demos/*' run build",
2121
"build:docs": "cd docs && yarn build",
22-
"build:packages": "yarn workspaces foreach -p -A --include 'packages/*' run build",
22+
"build:packages": "yarn workspace @mui-flexy/core run build && yarn workspaces foreach -p -A --include 'packages/v*' run build",
2323
"clean": "rm -rf packages/core/dist packages/v5/dist packages/v6/dist packages/v7/dist && mkdir -p packages/core/dist packages/v5/dist packages/v6/dist packages/v7/dist",
2424
"clean:all": "yarn clean && yarn workspaces foreach -A run clean",
2525
"demo:all": "concurrently \"yarn demo:v5\" \"yarn demo:v6\" \"yarn demo:v7\"",
@@ -55,7 +55,7 @@
5555
"test:unit:v5": "yarn jest --selectProjects=v5-tests",
5656
"test:unit:v6": "yarn jest --selectProjects=v6-tests",
5757
"test:unit:v7": "yarn jest --selectProjects=v7-tests",
58-
"typecheck": "yarn workspaces foreach -A run typecheck",
58+
"typecheck": "yarn workspaces foreach -p -A run typecheck",
5959
"set-version": "./scripts/version.sh"
6060
},
6161
"devDependencies": {

0 commit comments

Comments
 (0)