Skip to content

Commit

Permalink
feat: rework circle
Browse files Browse the repository at this point in the history
  • Loading branch information
theo-mesnil committed Jan 15, 2025
1 parent d5a8c8f commit 7a7cda5
Show file tree
Hide file tree
Showing 33 changed files with 2,969 additions and 231 deletions.
56 changes: 28 additions & 28 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ orbs:
parameters:
cache_version:
type: string
default: v5
default: v6
nodejs_base_image:
type: string
default: 'cimg/node:20.17.0'
Expand Down Expand Up @@ -71,17 +71,11 @@ jobs:
steps:
- *checkout
- *restore_node_modules
- run: yarn icons:build
- run: yarn build
- run: yarn build:monorepo
- persist_to_workspace:
root: ~/welcome-ui
paths:
- packages/**/dist
- lib/dist
- packages/Themes/**/dist
- icons/dist
- packages/IconFont/fonts

lint:
<<: *default
Expand All @@ -102,35 +96,32 @@ jobs:
- *restore_node_modules
- attach_workspace:
at: ~/welcome-ui
- run: yarn jest --detectOpenHandles $(circleci tests glob "./packages/**/*.test.{ts,js,tsx}" | circleci tests split | xargs)
- run: yarn jest --detectOpenHandles $(circleci tests glob "./lib/**/*.test.{ts,js,tsx}" | circleci tests split | xargs)

build_and_release_icon_font:
release_icon_font:
<<: *default
executor: nodejs
steps:
- *checkout
- *restore_node_modules
- attach_workspace:
at: ~/welcome-ui
- run: yarn icons:collect --force
- run: yarn webfont:build
- run:
name: Prepare font hash
command: |
echo "export ICON_FONT_HASH=$(sha1sum packages/IconFont/fonts/welcome-icon-font.woff2 | awk '{ print $1 }')" >> $BASH_ENV
echo "export ICON_FONT_HASH=$(sha1sum lib/src/components/IconFont/fonts/welcome-icon-font.woff2 | awk '{ print $1 }')" >> $BASH_ENV
source $BASH_ENV
yarn build:core
- aws-cli/setup:
aws_access_key_id: AWS_ACCESS_KEY_ID
aws_secret_access_key: AWS_SECRET_ACCESS_KEY
region: ${AWS_REGION}
- aws-s3/sync:
from: packages/IconFont/fonts
from: lib/src/components/IconFont/fonts
to: s3://welcome-ui/public/fonts/icon-font/$ICON_FONT_HASH
arguments: |
--cache-control "public, max-age=31536000" --exclude "*" --include "welcome-icon-font.woff" --include "welcome-icon-font.woff2" --metadata GitCommit=$CIRCLE_SHA1 --delete
- aws-s3/sync:
from: packages/IconFont/fonts
from: lib/src/components/IconFont/fonts
to: s3://wttj-production/fonts/icon-font/$ICON_FONT_HASH
arguments: |
--cache-control "public, max-age=31536000" --exclude "*" --include "welcome-icon-font.woff" --include "welcome-icon-font.woff2" --metadata GitCommit=$CIRCLE_SHA1 --delete
Expand All @@ -144,7 +135,7 @@ jobs:
- *restore_node_modules
- attach_workspace:
at: ~/welcome-ui
- run: yarn website:build
- run: yarn build:website
- persist_to_workspace:
root: ~/welcome-ui
paths:
Expand Down Expand Up @@ -201,7 +192,7 @@ jobs:
at: ~/welcome-ui
- run:
name: build w/ prefix
command: VERSION=$CIRCLE_BRANCH yarn website:build
command: VERSION=$CIRCLE_BRANCH yarn build:website
- aws-cli/setup:
aws_access_key_id: AWS_ACCESS_KEY_ID
aws_secret_access_key: AWS_SECRET_ACCESS_KEY
Expand Down Expand Up @@ -273,15 +264,14 @@ workflows:
only: /.*/
requires:
- build
- build_and_release_icon_font:
- release_icon_font:
filters:
tags:
only: /.*/
context:
- aws
requires:
- lint
- test
- build
- website_build:
filters:
tags:
Expand All @@ -293,8 +283,10 @@ workflows:
- aws
- welcome-ui
requires:
- lint
- test
- website_build
- build_and_release_icon_font
- release_icon_font
- website_deploy_prod:
filters:
branches:
Expand All @@ -305,8 +297,10 @@ workflows:
- aws
- welcome-ui
requires:
- lint
- test
- website_build
- build_and_release_icon_font
- release_icon_font
- previous_website_versions_build_deploy_prod:
filters:
# should add branches here to keep previous doc version of future majors
Expand All @@ -316,14 +310,18 @@ workflows:
- aws
- welcome-ui
requires:
- build
- build_and_release_icon_font
- lint
- test
- website_build
- release_icon_font
- release:
context:
- welcome-ui
requires:
- build
- build_and_release_icon_font
- lint
- test
- website_build
- release_icon_font
filters:
branches:
ignore: /.*/
Expand All @@ -333,8 +331,10 @@ workflows:
context:
- welcome-ui
requires:
- build
- build_and_release_icon_font
- lint
- test
- website_build
- release_icon_font
filters:
branches:
ignore: /.*/
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.env
website/out
website/.next
node_modules/
Expand All @@ -10,7 +9,6 @@ yarn-error.log
*.tgz

# Fonts
fonts/
dist/

# vite
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1 +1 @@
yarn icons:collect && yarn lint && yarn test
yarn lint && yarn test
11 changes: 9 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@ module.exports = {
},
},
presets: [
['@babel/preset-env', { modules: false, loose: true }],
'@babel/preset-typescript',
['@babel/preset-env', { targets: { node: 'current' } }],
'@babel/preset-react',
[
'babel-preset-vite',
{
env: true,
glob: false,
},
],
'@babel/preset-typescript',
],
plugins: [
'@babel/plugin-proposal-optional-chaining',
Expand Down
4 changes: 2 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ module.exports = {
'\\.(css|less)$': '<rootDir>/mocks/styleMock.js',
},
transform: {
'^.+\\.(ts|tsx|js|jsx)?$': '@swc/jest',
'^.+\\.(ts|tsx|js|jsx)?$': 'babel-jest',
},
setupFilesAfterEnv: ['<rootDir>/mocks/setup.js'],
modulePaths: ['<rootDir>/node_modules'],
testEnvironment: 'jsdom',
testEnvironment: 'jest-environment-jsdom',
}
1 change: 1 addition & 0 deletions lib/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_ICON_FONT_HASH=f19d0de47a5f6f7446d37111f075c0901835bf12
2 changes: 1 addition & 1 deletion lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "welcome-ui",
"version": "1.0.0-beta.4",
"version": "1.0.0-beta.6",
"description": "Customizable design system with react • styled-components • styled-system and ariakit.",
"files": [
"dist"
Expand Down
1 change: 1 addition & 0 deletions lib/src/components/Breadcrumb/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ category: navigation
description: The Breadcrumb component provides a trail of links to help users understand their location within the application's hierarchy and navigate back to previous pages. It enhances user experience by improving navigation and context within complex interfaces.
packageName: breadcrumb
title: Breadcrumb
peerDependencies: '@juggle/resize-observer'
---

### Separator
Expand Down
11 changes: 4 additions & 7 deletions lib/src/components/Breadcrumb/docs/properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,12 @@
},
{
"value": "ReactElement<any, string | JSXElementConstructor<any>>",
"description": "Represents a JSX element.\n\nWhere {@link ReactNode} represents everything that can be rendered, `ReactElement`\nonly represents JSX.",
"fullComment": "Represents a JSX element.\n\nWhere {@link ReactNode} represents everything that can be rendered, `ReactElement`\nonly represents JSX.\n@template P The type of the props object\n@template T The type of the component or tag\n@example ```tsx\nconst element: ReactElement = <div />;\n```",
"tags": {
"template": "P The type of the props object\nT The type of the component or tag",
"example": "```tsx\nconst element: ReactElement = <div />;\n```"
}
"description": "",
"fullComment": "",
"tags": {}
},
{
"value": "Iterable<ReactNode>",
"value": "ReactFragment",
"description": "",
"fullComment": "",
"tags": {}
Expand Down
29 changes: 7 additions & 22 deletions lib/src/components/Checkbox/docs/properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"required": false,
"type": {
"name": "enum",
"raw": "ElementType<any, keyof IntrinsicElements>",
"raw": "ElementType<any>",
"value": [
{
"value": "\"symbol\""
Expand Down Expand Up @@ -82,9 +82,6 @@
{
"value": "\"caption\""
},
{
"value": "\"center\""
},
{
"value": "\"cite\""
},
Expand Down Expand Up @@ -289,9 +286,6 @@
{
"value": "\"samp\""
},
{
"value": "\"search\""
},
{
"value": "\"slot\""
},
Expand Down Expand Up @@ -532,9 +526,6 @@
{
"value": "\"rect\""
},
{
"value": "\"set\""
},
{
"value": "\"stop\""
},
Expand All @@ -558,21 +549,15 @@
},
{
"value": "ComponentClass<any, any>",
"description": "Represents a component class in React.",
"fullComment": "Represents a component class in React.\n@template P The props the component accepts.\n@template S The internal state of the component.",
"tags": {
"template": "P The props the component accepts.\nS The internal state of the component."
}
"description": "",
"fullComment": "",
"tags": {}
},
{
"value": "FunctionComponent<any>",
"description": "Represents the type of a function component. Can optionally\nreceive a type argument that represents the props the component\naccepts.",
"fullComment": "Represents the type of a function component. Can optionally\nreceive a type argument that represents the props the component\naccepts.\n@template P The props the component accepts.\n@see {@link https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/function_components React TypeScript Cheatsheet}\n@example ```tsx\n// With props:\ntype Props = { name: string }\n\nconst MyComponent: FunctionComponent<Props> = (props) => {\n return <div>{props.name}</div>\n}\n```\n@example ```tsx\n// Without props:\nconst MyComponentWithoutProps: FunctionComponent = () => {\n return <div>MyComponentWithoutProps</div>\n}\n```",
"tags": {
"template": "P The props the component accepts.",
"see": "{@link https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/function_components React TypeScript Cheatsheet}",
"example": "```tsx\n// With props:\ntype Props = { name: string }\n\nconst MyComponent: FunctionComponent<Props> = (props) => {\n return <div>{props.name}</div>\n}\n```\n```tsx\n// Without props:\nconst MyComponentWithoutProps: FunctionComponent = () => {\n return <div>MyComponentWithoutProps</div>\n}\n```"
}
"description": "",
"fullComment": "",
"tags": {}
}
]
}
Expand Down
24 changes: 6 additions & 18 deletions lib/src/components/Drawer/docs/properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,6 @@
{
"value": "\"caption\""
},
{
"value": "\"center\""
},
{
"value": "\"cite\""
},
Expand Down Expand Up @@ -483,9 +480,6 @@
{
"value": "\"samp\""
},
{
"value": "\"search\""
},
{
"value": "\"section\""
},
Expand Down Expand Up @@ -1083,16 +1077,16 @@
"required": false,
"type": {
"name": "enum",
"raw": "RenderProp<HTMLAttributes<any> & { ref?: Ref<any>; }> | ReactElement<any, string | JSXElementConstructor<any>>",
"raw": "ReactElement<any, string | JSXElementConstructor<any>> | RenderProp<HTMLAttributes<any> & { ref?: Ref<any>; }>",
"value": [
{
"value": "RenderProp<HTMLAttributes<any> & { ref?: Ref<any>; }>",
"value": "ReactElement<any, string | JSXElementConstructor<any>>",
"description": "",
"fullComment": "",
"tags": {}
},
{
"value": "ReactElement<any, string | JSXElementConstructor<any>>",
"value": "RenderProp<HTMLAttributes<any> & { ref?: Ref<any>; }>",
"description": "",
"fullComment": "",
"tags": {}
Expand Down Expand Up @@ -1499,9 +1493,6 @@
{
"value": "\"caption\""
},
{
"value": "\"center\""
},
{
"value": "\"cite\""
},
Expand Down Expand Up @@ -1610,9 +1601,6 @@
{
"value": "\"samp\""
},
{
"value": "\"search\""
},
{
"value": "\"section\""
},
Expand Down Expand Up @@ -2174,16 +2162,16 @@
"required": false,
"type": {
"name": "enum",
"raw": "RenderProp<HTMLAttributes<any> & { ref?: Ref<any>; }> | ReactElement<any, string | JSXElementConstructor<any>>",
"raw": "ReactElement<any, string | JSXElementConstructor<any>> | RenderProp<HTMLAttributes<any> & { ref?: Ref<any>; }>",
"value": [
{
"value": "RenderProp<HTMLAttributes<any> & { ref?: Ref<any>; }>",
"value": "ReactElement<any, string | JSXElementConstructor<any>>",
"description": "",
"fullComment": "",
"tags": {}
},
{
"value": "ReactElement<any, string | JSXElementConstructor<any>>",
"value": "RenderProp<HTMLAttributes<any> & { ref?: Ref<any>; }>",
"description": "",
"fullComment": "",
"tags": {}
Expand Down
Loading

0 comments on commit 7a7cda5

Please sign in to comment.