Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

chore: Convert to monorepo #613

Merged
merged 44 commits into from
Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
5f73759
Move to monorepo setup
mayank99 Apr 1, 2022
a483695
Fix build
mayank99 Apr 1, 2022
b54e98a
Oopsie
mayank99 Apr 1, 2022
0e5631b
Fix README
mayank99 Apr 1, 2022
e6db666
Fix deprecation
mayank99 Apr 1, 2022
f1c4901
Fix publish workflows
mayank99 Apr 1, 2022
c976537
Install webpack5 in root
mayank99 Apr 1, 2022
aad0c98
Increase delay in Header tests
mayank99 Apr 1, 2022
0a768df
Merge branch 'main' into mayank/monorepo
mayank99 Apr 1, 2022
ee5dc5b
Merge branch 'main' into mayank/monorepo
mayank99 Apr 8, 2022
8de8b26
Fix typo in tsconfig
mayank99 Apr 8, 2022
724299d
Clean up gitignore
mayank99 Apr 8, 2022
042926e
Whoops bad merge
mayank99 Apr 8, 2022
6693de4
Remove leftovers
mayank99 Apr 8, 2022
4ca5ca5
Fix parallel yarn dev
mayank99 Apr 8, 2022
3ea4d4f
Fix `format` command
mayank99 Apr 8, 2022
257efe9
tests
veekeys Apr 8, 2022
363d5e0
Clean up nested gitignores
mayank99 Apr 8, 2022
23ef614
Remove favicon and font family from playground
mayank99 Apr 8, 2022
f4175ee
Move vscode to root and ignore md from prettier
mayank99 Apr 8, 2022
b0a62ad
Only keep README in root
mayank99 Apr 8, 2022
1cdc02f
Update deps
mayank99 Apr 8, 2022
e85bb71
Even cleaner README
mayank99 Apr 8, 2022
871507a
Merge branch 'main' into mayank/monorepo
mayank99 Apr 8, 2022
e4763db
Copy README on build
mayank99 Apr 8, 2022
213c2d5
Revert README
mayank99 Apr 8, 2022
58c2f19
Revert delay in Header.stories.tsx
mayank99 Apr 8, 2022
07ef30a
Merge branch 'main' into mayank/monorepo
mayank99 Apr 11, 2022
60ce4f1
Use `yarn dev` in github workflow
mayank99 Apr 11, 2022
4639a7b
Merge branch 'main' into mayank/monorepo
mayank99 Apr 11, 2022
dcc01f4
Fix linting and move configs into separate package
mayank99 Apr 18, 2022
23d82d5
Merge branch 'main' into mayank/monorepo
mayank99 Apr 18, 2022
457bcda
Match os theme in playground
mayank99 Apr 18, 2022
2e6979f
Disallow pushing with eslint warnings
mayank99 Apr 18, 2022
94d170e
Clean up eslintignore
mayank99 Apr 18, 2022
112ecd1
Fix bad merge
mayank99 Apr 18, 2022
be2eee7
Merge branch 'main' into mayank/monorepo
mayank99 Apr 20, 2022
d3a1212
Merge branch 'main' into mayank/monorepo
mayank99 Apr 20, 2022
28cbabf
Merge branch 'main' into mayank/monorepo
mayank99 Apr 21, 2022
80daaea
Wrap tooltip timer in `act` to fix warning
mayank99 Apr 21, 2022
0523924
Lock to patch version of `turbo`
mayank99 Apr 21, 2022
b6c1f5f
Remove `eslint-plugin-node`
mayank99 Apr 21, 2022
0b92fe3
Include md files in package
mayank99 Apr 21, 2022
13c0c35
Fix `copy-files` syntax
mayank99 Apr 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 0 additions & 6 deletions .eslintignore

This file was deleted.

44 changes: 0 additions & 44 deletions .eslintrc.js

This file was deleted.

24 changes: 12 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Use Node 12.X
- name: Use Node 16.X
uses: actions/setup-node@v2
with:
node-version: 12.x
node-version: 16.x
cache: yarn

- run: yarn install --frozen-lockfile

- run: yarn audit

- run: yarn lint
- run: yarn lint:copyright ${{ github.workspace }}/*/**.{js,ts,tsx}
- run: yarn workspace @itwin/itwinui-react lint:copyright ${{ github.workspace }}/*/**.{js,ts,tsx}
- run: yarn build
- run: yarn build-storybook
- run: yarn workspace @itwin/itwinui-react build-storybook

unit-test:
name: Run unit tests
Expand All @@ -37,21 +37,21 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Use Node 12.X
- name: Use Node 16.X
uses: actions/setup-node@v2
with:
node-version: 12.x
node-version: 16.x
cache: yarn

- run: yarn install --frozen-lockfile

- run: yarn test --coverage
- run: yarn workspace @itwin/itwinui-react test --coverage
bentleyvk marked this conversation as resolved.
Show resolved Hide resolved

- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v1.16
if: always()
with:
files: 'coverage/junit.xml'
files: 'packages/iTwinUI-react/coverage/junit.xml'
comment_mode: off
check_name: 'Test results'
fail_on: 'nothing'
Expand All @@ -63,14 +63,14 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Use Node 12.X
- name: Use Node 16.X
uses: actions/setup-node@v2
with:
node-version: 12.x
node-version: 16.x
cache: yarn

- run: yarn install --frozen-lockfile

# `&` symbol is needed as it prevents Storybook from running endlessly
- run: yarn storybook &
- run: yarn creevey
- run: yarn dev &
- run: yarn workspace @itwin/itwinui-react creevey
9 changes: 5 additions & 4 deletions .github/workflows/publish-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Use Node 12.X
uses: actions/setup-node@v2.1.5
- name: Use Node 16.X
uses: actions/setup-node@v2
with:
node-version: 12.x
node-version: 16.x
cache: yarn

- run: yarn install --frozen-lockfile
- run: yarn build-storybook
- run: yarn workspace @itwin/itwinui-react build-storybook

- name: Publish storybook
uses: peaceiris/actions-gh-pages@v3.7.3
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Use Node 12.X
- name: Use Node 16.X
uses: actions/setup-node@v2
with:
node-version: 12.x
node-version: 16.x
registry-url: https://registry.npmjs.org/
bentleyvk marked this conversation as resolved.
Show resolved Hide resolved

- run: yarn install
- run: yarn build

- run: npm publish --access public
working-directory: './lib'
working-directory: './packages/iTwinUI-react'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_ITWIN }}

Expand Down
43 changes: 8 additions & 35 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,40 +1,13 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
node_modules/
node_modules/*

# testing
coverage/
coverage/*

# production
build/
build/*

# misc
node_modules
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
.turbo

# Error/Debug logs
npm-debug.log*
# debug
yarn-debug.log*
yarn-error.log*
debug.log*

# Compiled Components
lib/
lib/*

# Compiled Styles
src/**/*.css

# Storybook
storybook-static/*

# Yalc
.yalc/*
yalc.lock
# local env files
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move these up so not shown as change

.env.local
.env.development.local
.env.test.local
.env.production.local
1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

9 changes: 0 additions & 9 deletions .prettierrc

This file was deleted.

13 changes: 3 additions & 10 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,10 @@
"editor.formatOnSave": true,
"editor.tabSize": 2,
"editor.insertSpaces": true,
"prettier.disableLanguages": ["vue", "markdown"],
"files.insertFinalNewline": true,
"files.exclude": {
"**/src/**/*.css": true
},
"search.exclude": {
"**/src/**/*.css": true
},
"files.watcherExclude": {
"**/lib/**": true,
"**/src/**/*.css": true
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[markdown]": {
"editor.defaultFormatter": "vscode.markdown-language-features"
veekeys marked this conversation as resolved.
Show resolved Hide resolved
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
Expand Down
7 changes: 7 additions & 0 deletions apps/playground/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Logs
veekeys marked this conversation as resolved.
Show resolved Hide resolved
logs
*.log

dist
dist-ssr
*.local
12 changes: 12 additions & 0 deletions apps/playground/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>iTwinUI test app</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
26 changes: 26 additions & 0 deletions apps/playground/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "itwinui-playground",
"private": true,
"version": "0.0.0",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"@itwin/itwinui-react": "*",
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"devDependencies": {
"@types/react": "^17.0.33",
"@types/react-dom": "^17.0.10",
"@vitejs/plugin-react": "^1.0.7",
"configs": "*",
"linaria": "^2.3.1",
"typescript": "^4.5.4",
"vite": "^2.8.0",
"vite-plugin-linaria": "^1.0.0"
},
"prettier": "configs/prettier-config"
}
7 changes: 7 additions & 0 deletions apps/playground/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Button } from '@itwin/itwinui-react';

const App = () => {
return <Button>Hello world</Button>;
};

export default App;
8 changes: 8 additions & 0 deletions apps/playground/src/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
* {
box-sizing: border-box;
margin: 0;
}

html {
color-scheme: dark light;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it have influence on our theming?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It influences default colors that the browser provides (e.g. default background, text, scrolllbar, input, etc). I use it in every app I build.

I think we should add it to our theming because we are starting to use system colors in some places (e.g. I noticed CanvasText in the breadcrumbs PR).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FlyersPh9 You might want to check it then

}
69 changes: 69 additions & 0 deletions apps/playground/src/main.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import React from 'react';
import ReactDOM from 'react-dom';
import './main.css';
import { styled } from 'linaria/react';
import { useTheme } from '@itwin/itwinui-react';
import App from './App';

const Shell = () => {
const [theme, setTheme] = React.useState<'light' | 'dark'>(() =>
matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light',
);

useTheme(theme);

return (
<Main>
<ThemeButton
onClick={() => setTheme((prev) => (prev === 'dark' ? 'light' : 'dark'))}
>
<svg aria-hidden viewBox='0 0 15 15'>
<path
fill='currentColor'
fillRule='evenodd'
clipRule='evenodd'
d={
theme === 'light'
? 'M7.5 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2a.5.5 0 0 1 .5-.5ZM2.197 2.197a.5.5 0 0 1 .707 0L4.318 3.61a.5.5 0 0 1-.707.707L2.197 2.904a.5.5 0 0 1 0-.707ZM.5 7a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1h-2Zm1.697 5.803a.5.5 0 0 1 0-.707l1.414-1.414a.5.5 0 1 1 .707.707l-1.414 1.414a.5.5 0 0 1-.707 0ZM12.5 7a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1h-2Zm-1.818-2.682a.5.5 0 0 1 0-.707l1.414-1.414a.5.5 0 1 1 .707.707L11.39 4.318a.5.5 0 0 1-.707 0ZM8 12.5a.5.5 0 0 0-1 0v2a.5.5 0 0 0 1 0v-2Zm2.682-1.818a.5.5 0 0 1 .707 0l1.414 1.414a.5.5 0 1 1-.707.707l-1.414-1.414a.5.5 0 0 1 0-.707ZM5.5 7.5a2 2 0 1 1 4 0a2 2 0 0 1-4 0Zm2-3a3 3 0 1 0 0 6a3 3 0 0 0 0-6Z'
: 'M2.9.5a.4.4 0 0 0-.8 0v.6h-.6a.4.4 0 1 0 0 .8h.6v.6a.4.4 0 1 0 .8 0v-.6h.6a.4.4 0 0 0 0-.8h-.6V.5Zm3 3a.4.4 0 1 0-.8 0v.6h-.6a.4.4 0 1 0 0 .8h.6v.6a.4.4 0 1 0 .8 0v-.6h.6a.4.4 0 0 0 0-.8h-.6v-.6Zm-4 3a.4.4 0 1 0-.8 0v.6H.5a.4.4 0 1 0 0 .8h.6v.6a.4.4 0 0 0 .8 0v-.6h.6a.4.4 0 0 0 0-.8h-.6v-.6ZM8.544.982l-.298-.04c-.213-.024-.34.224-.217.4A6.57 6.57 0 0 1 9.203 5.1a6.602 6.602 0 0 1-6.243 6.59c-.214.012-.333.264-.183.417a6.8 6.8 0 0 0 .21.206l.072.066l.26.226l.188.148l.121.09l.187.131l.176.115c.12.076.244.149.37.217l.264.135l.26.12l.303.122l.244.086a6.568 6.568 0 0 0 1.103.26l.317.04l.267.02a6.6 6.6 0 0 0 6.943-7.328l-.037-.277a6.557 6.557 0 0 0-.384-1.415l-.113-.268l-.077-.166l-.074-.148a6.602 6.602 0 0 0-.546-.883l-.153-.2l-.199-.24l-.163-.18l-.12-.124l-.16-.158l-.223-.2l-.32-.26l-.245-.177l-.292-.19l-.321-.186l-.328-.165l-.113-.052l-.24-.101l-.276-.104l-.252-.082l-.325-.09l-.265-.06l-.292-.053Zm1.86 4.318a7.578 7.578 0 0 0-.572-2.894a5.601 5.601 0 1 1-4.748 10.146a7.61 7.61 0 0 0 3.66-2.51a.749.749 0 0 0 1.355-.442a.75.75 0 0 0-.584-.732c.062-.116.122-.235.178-.355A1.25 1.25 0 1 0 10.35 6.2c.034-.295.052-.595.052-.9Z'
}
></path>
</svg>
</ThemeButton>
<App />
</Main>
);
};

const Main = styled.main`
margin: 2rem 1rem;
`;

const ThemeButton = styled.button`
all: unset;
display: inline-grid;
place-items: center;
position: fixed;
top: 0;
right: 0;
width: 2.5rem;
height: 2.5rem;
cursor: pointer;
border-radius: 50%;

&:hover {
background: hsl(0 0% 0% / 0.2);
}

& > * {
width: 1.5rem;
height: 1.5rem;
}
`;

ReactDOM.render(
<React.StrictMode>
<Shell />
</React.StrictMode>,
document.getElementById('root'),
);
1 change: 1 addition & 0 deletions apps/playground/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />