Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 0 additions & 5 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,9 @@ bower_components
copyright.js
coverage
lib
clayui.com/.cache
clayui.com/public
clayui.com/react-docgen
clayui.com/static
node_modules
package-lock.json
/packages/clay-css/src/js/**/*.js
packages/generator-clay-component/app/templates
yarn.lock
.next
/www
2 changes: 0 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ jobs:
run: yarn checkDeps
- name: Run Jest
env:
BROWSERSLIST_CONFIG: './packages/browserslist-config-clay/config'
BROWSERSLIST_DISABLE_CACHE: 1
CI: true
run: yarn test --coverage
- name: Push to Coveralls
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ jobs:
run: yarn checkDeps
- name: Run Jest
env:
BROWSERSLIST_CONFIG: './packages/browserslist-config-clay/config'
BROWSERSLIST_DISABLE_CACHE: 1
CI: true
run: yarn test

Expand Down
119 changes: 119 additions & 0 deletions .github/workflows/sync-source.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: Nightly Sync from liferay-portal

on:
push:
workflow_dispatch:

env:
CLAY_REPO_BRANCH: master-test
DEST_DIR: synced-source
PORTAL_REPO_BRANCH: master
PORTAL_REPO: liferay/liferay-portal
SOURCE_DIR: modules/apps/frontend-js/frontend-js-clay-web/clay
TAG_PREFIX: 7.4

jobs:
sync:
runs-on: ubuntu-latest

steps:
- name: Checkout Clay repo
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ env.CLAY_REPO_BRANCH }}

- name: Copy clay source to repo
run: |
git clone \
--filter=blob:none --no-checkout \
--branch ${{ env.PORTAL_REPO_BRANCH }} \
--single-branch \
--depth 1 \
https://github.com/${{ env.PORTAL_REPO }}.git liferay-portal
cd liferay-portal
git sparse-checkout init --cone
git sparse-checkout set ${{ env.SOURCE_DIR }}
git checkout ${{ env.PORTAL_REPO_BRANCH }}

cd ..
rsync -av --ignore-times --exclude=".git" "liferay-portal/${{ env.SOURCE_DIR }}/" "${{ env.DEST_DIR }}"
rm -rf liferay-portal

- name: Diff
run: |
git diff --name-only

- name: Check if there are changes
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
if git diff --quiet; then
echo "No changes to commit"
exit 0
fi

- name: Commit and push changes
run: |
git add ${{ env.DEST_DIR }}
git commit -m "Nightly sync from liferay-portal"
git push origin ${{ env.CLAY_REPO_BRANCH }}

update-version:
needs: sync
runs-on: ubuntu-latest

steps:
- name: Checkout Clay repo
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ env.CLAY_REPO_BRANCH }}

- name: Get latest version of liferay-portal from release.properties
run: |
# Download release.properties from the portal repo
curl -sL https://raw.githubusercontent.com/${{ env.PORTAL_REPO }}/${{ env.PORTAL_REPO_BRANCH }}/release.properties -o release.properties

MAJOR=$(grep -E 'release\.info\.version\.major=' release.properties | cut -d= -f2)
MINOR=$(grep -E 'release\.info\.version\.minor=' release.properties | cut -d= -f2)
BUGFIX=$(grep -E 'release\.info\.version\.bug\.fix=' release.properties | cut -d= -f2)
TRIVIAL=$(grep -E 'release\.info\.version\.trivial=' release.properties | cut -d= -f2)

rm release.properties

# Build full version string
LATEST_VERSION="$MAJOR.$MINOR.$BUGFIX.$TRIVIAL"
echo "LATEST_VERSION=$LATEST_VERSION" >> $GITHUB_ENV
echo "Latest version: $LATEST_VERSION"

- name: Update version in lerna.json
run: |
echo "Updating lerna.json version to $LATEST_VERSION"
sed -i -E "s/([[:space:]]*\"version\"[[:space:]]*:[[:space:]]*\")[^\"]+(\")/\1$LATEST_VERSION\2/" lerna.json

- name: Check for changes
id: changes
run: |
if git diff --quiet; then
echo "changes=false" >> $GITHUB_ENV
else
echo "changes=true" >> $GITHUB_ENV
fi

- name: Commit and push changes
if: env.changes == 'true'
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add lerna.json
git commit -m "Update lerna.json version to $LATEST_VERSION"
git push origin ${{ env.CLAY_REPO_BRANCH }}

# TODO:
# - name: Trigger release workflow
# if: env.changes == 'true'
# run: |
# gh workflow run release.yml \
# --ref ${{ env.CLAY_REPO_BRANCH }} \
# --repo ${{ github.repository }}
5 changes: 0 additions & 5 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,10 @@ bower_components
copyright.js
coverage
lib
/clayui.com/.cache
/clayui.com/public
/clayui.com/react-docgen
/clayui.com/static
node_modules
package-lock.json
/packages/clay-css/**/*.md
/packages/clay-css/src/js/**/*.js
/packages/clay-css/src/scss/bootstrap/**/*.scss
/packages/generator-clay-component/app/templates
yarn.lock
.next
43 changes: 0 additions & 43 deletions all.js

This file was deleted.

4 changes: 1 addition & 3 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
"**/*.md",
"**/*.mdx",
"**/docs/*",
"**/packages/demos/**",
"**/packages/generator-clay-component/**",
"**/packages/browserslist-config-clay/**"
"**/packages/demos/**"
],
"message": "chore(release): publish %s packages"
}
Expand Down
29 changes: 8 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,20 @@
{
"private": true,
"repository": "https://github.com/liferay/clay",
"size-limit": [
{
"path": "all.js",
"limit": "165 kb",
"ignore": [
"react",
"react-dom"
]
}
],
"scripts": {
"build:csb": "yarn build && yarn buildTypes",
"build": "turbo run build --filter=@clayui/*",
"buildTypes": "turbo run buildTypes --filter=@clayui/*",
"checkDeps": "turbo run build --filter=@clayui/* && node scripts/check-deps/check-dependencies.js",
"checkDeps": "turbo run build --filter=@clayui/* && node synced-source/scripts/check-deps/check-dependencies.js",
"ci": "yarn lint && yarn format:check && yarn test && yarn checkDeps",
"coverage": "jest --coverage",
"format": "prettier --write \"**/*.{js,ts,mjs,tsx,md,mdx,json,scss}\"",
"format:all": "yarn lint:fix && yarn format",
"format:changed": "git ls-files -mz \"*.js\" \"**/*.js\" \"**/*.ts\" \"**/*.tsx\" \"*.md\" \"**/*.md\" \"**/*.mdx\" \"*.json\" \"**/*.json\" \"**/*.scss\" | xargs -0 prettier --write --",
"format:check": "prettier --list-different -- \"**/*.{js,ts,tsx,md,mdx,json,scss}\"",
"genBuildSize:compare": "NODE_ENV=production node scripts/check-size/index.mjs --compare",
"genBuildSize": "NODE_ENV=production node scripts/check-size/index.mjs",
"genGlobalChangeLog": "node scripts/generate-global-changelog.js && prettier --write -- \"CHANGELOG.md\"",
"genBuildSize:compare": "NODE_ENV=production node synced-source/scripts/check-size/index.mjs --compare",
"genBuildSize": "NODE_ENV=production node synced-source/scripts/check-size/index.mjs",
"genGlobalChangeLog": "node synced-source/scripts/generate-global-changelog.js && prettier --write -- \"CHANGELOG.md\"",
"lerna:version": "lerna version --conventional-commits",
"lerna:publish": "lerna publish from-package --no-verify-access --yes",
"lint:changed": "git ls-files -mz \"*.js\" \"**/*.js\" \"**/*.ts\" \"**/*.tsx\" | xargs -0 eslint",
Expand All @@ -33,11 +23,10 @@
"lint:typescript": "tsc --project ./tsconfig.global.json",
"lint": "eslint \".*.js\" \"!(www)/**/*.{js,ts,tsx}\"",
"site": "cd www && yarn && yarn build",
"sizeLimit": "size-limit",
"storybook:build": "NODE_OPTIONS=--max_old_space_size=8192 build-storybook -c .storybook -o .storybook-static",
"storybook:build": "NODE_OPTIONS=--max_old_space_size=8192 build-storybook -c ./synced-source/.storybook -o ./synced-source/.storybook-static",
"storybook": "start-storybook -p 8888",
"test": "jest",
"version": "prettier --write -- \"**/CHANGELOG.md\" \"lerna.json\" && git add -- \"packages/clay-css/src/scss/_license-text.scss\"",
"test": "jest --config ./synced-source/jest.config.js",
"version": "prettier --write -- \"**/CHANGELOG.md\" \"lerna.json\" && git add -- \"synced-source/packages/clay-css/src/scss/_license-text.scss\"",
"chromatic": "chromatic --exit-zero-on-changes --build-script-name=storybook:build"
},
"devDependencies": {
Expand All @@ -47,7 +36,6 @@
"@babel/preset-react": "^7.14.5",
"@babel/preset-typescript": "^7.15.0",
"@liferay/eslint-plugin": "^1.0.0",
"@size-limit/preset-small-lib": "^6.0.3",
"@storybook/addon-a11y": "^6.5.10",
"@storybook/addon-controls": "^6.5.10",
"@storybook/addon-essentials": "^6.5.10",
Expand Down Expand Up @@ -98,7 +86,6 @@
"react-test-renderer": "^18.2.0",
"resize-observer-polyfill": "^1.5.1",
"sass-loader": "^7.1.0",
"size-limit": "^6.0.3",
"source-map-loader": "^0.2.4",
"storybook": "^8.5.8",
"style-loader": "^0.23.1",
Expand All @@ -110,7 +97,7 @@
},
"workspaces": {
"packages": [
"packages/*"
"synced-source/packages/*"
],
"nohoist": [
"gatsby",
Expand Down
3 changes: 0 additions & 3 deletions packages/browserslist-config-clay/.yarnrc

This file was deleted.

20 changes: 0 additions & 20 deletions packages/browserslist-config-clay/CHANGELOG.md

This file was deleted.

19 changes: 0 additions & 19 deletions packages/browserslist-config-clay/README.md

This file was deleted.

9 changes: 0 additions & 9 deletions packages/browserslist-config-clay/config

This file was deleted.

16 changes: 0 additions & 16 deletions packages/browserslist-config-clay/index.js

This file was deleted.

13 changes: 0 additions & 13 deletions packages/browserslist-config-clay/package.json

This file was deleted.

4 changes: 0 additions & 4 deletions packages/clay-alert/tsconfig.json

This file was deleted.

4 changes: 0 additions & 4 deletions packages/clay-autocomplete/tsconfig.json

This file was deleted.

Loading
Loading