Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: mono package is back! #2637

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
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
  •  
  •  
  •  
63 changes: 33 additions & 30 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 @@ -48,6 +48,7 @@ jobs:
paths:
- ~/.cache/yarn
- ~/welcome-ui/node_modules
- ~/welcome-ui/lib/node_modules
- ~/welcome-ui/website/node_modules

vulnerabilities_yarn:
Expand All @@ -60,25 +61,21 @@ jobs:
- attach_workspace:
at: ~/welcome-ui
- run:
name: Critical vulnerabilities (yarn audit), lib versions and missing deps
command: yarn check:audit && yarn check:deps
name: Critical vulnerabilities (yarn audit)
command: yarn check:audit

build:
<<: *default
executor: nodejs
resource_class: xlarge
resource_class: medium
steps:
- *checkout
- *restore_node_modules
- run: yarn icons:build
- run: yarn build
- persist_to_workspace:
root: ~/welcome-ui
paths:
- packages/**/dist
- packages/Themes/**/dist
- icons/dist
- packages/IconFont/fonts
- lib/dist

lint:
<<: *default
Expand All @@ -99,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 @@ -141,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 @@ -198,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 @@ -270,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 @@ -290,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 @@ -302,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 @@ -313,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 @@ -330,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
4 changes: 0 additions & 4 deletions .depcheckrc.json

This file was deleted.

4 changes: 2 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
**/node_modules/**
**/dist/**
node_modules/
dist/
9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
.env
dist/
website/out
website/.next
.cache/
node_modules/
.DS_Store
.size-snapshot.json
yarn-error.log
lerna-debug.log

# Output of 'npm pack'
*.tgz

# Fonts
packages/IconFont/fonts/
dist/

# vite
vite.config.mjs.*
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 lint:website && yarn test && yarn check:deps
yarn lint && yarn test
4 changes: 0 additions & 4 deletions .npmignore

This file was deleted.

8 changes: 8 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": ["./node_modules/wttj-config/lib/stylelint"],
"customSyntax": "postcss-styled-syntax",
"rules": {
"selector-type-no-unknown": [true, { "ignoreTypes": ["/-styled-mixin/", "$dummyValue"] }],
"no-empty-source": null
}
}
20 changes: 4 additions & 16 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
The MIT License

Copyright (c) 2019-2022 CORUSCANT (welcome to the jungle) - https://www.welcometothejungle.com
Copyright (c) 2019-2025 CORUSCANT (welcome to the jungle) - https://www.welcometothejungle.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 changes: 7 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ yarn add @xstyled/styled-components react styled-components
2 - Install the the **core** component and any other components you need for your webapp e.g. if you need just a button…

```bash
yarn add @welcome-ui/core @welcome-ui/button
yarn add welcome-ui
```

## Import library & Theme
Expand All @@ -34,8 +34,7 @@ Getting started

```js
import React from 'react'
import { createTheme, WuiProvider } from '@welcome-ui/core'
import { Button } from '@welcome-ui/button'
import { Button, createTheme, WuiProvider } from 'welcome-ui'

// Add theme options (if you want)
const options = {
Expand Down Expand Up @@ -71,22 +70,22 @@ export default function Root() {

## Develop on local

1. First install and build the packages _(only the first time)_
1. Install

```bash
yarn first:install
yarn
```

2. Start documentation website
2. Start a watch on all packages to rebuild them easily

```bash
yarn start
```

3. Start a watch on all packages to rebuild them easily
3. Start documentation website

```bash
yarn watch
yarn website
```

4. and go to http://localhost:3020
Expand Down Expand Up @@ -115,20 +114,8 @@ yarn dev:prerelease

NB: you can replace alpha with any other keyword (beta, rc, ...)

#### Force publish a package

In addition to the options shown above, you can use the --force-publish option to force bumping some packages.

#### Troubleshooting

##### How to release when the publish process failed having published some packages

Re-run the failed job with ssh, then ssh into the machine and run this command:

`cd welcome-ui/packages && find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c "cd '{}' && npm publish" \;`

This will publish each packages, those who are already published will fail and be ignored by the script.

##### How to rollback a release that has been stopped before publish to npm

Revert the last commit (which should be the commit that bumps package versions):
Expand Down
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
Loading