Skip to content

Commit

Permalink
New repo structure (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztofzuraw authored Jan 12, 2023
1 parent a8c3427 commit 54a5b7c
Show file tree
Hide file tree
Showing 548 changed files with 19,159 additions and 292 deletions.
49 changes: 49 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
module.exports = {
env: {
browser: true,
es2021: true,
},
settings: {
react: {
version: "detect",
},
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"],
},
},
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/recommended",
"plugin:import/typescript",
"prettier",
],
overrides: [],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
plugins: ["react", "@typescript-eslint", "react-hooks", "import"],
rules: {
"react/react-in-jsx-scope": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"import/no-unresolved": "error",
"import/order": [
"error",
{
groups: [
"external",
"builtin",
"internal",
"sibling",
"parent",
"index",
],
},
],
},
ignorePatterns: [".eslintrc.cjs"],
};
33 changes: 16 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,34 @@ name: CI
on: [push]
jobs:
build:
name: Build, lint, and test
name: Lint, check types and test

runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0 # Required for Chromatic to retrieve full git history
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1
- name: Install legacy deps
run: npm ci
working-directory: legacy

- name: Lint
run: npm run lint
- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: latest
run_install: true

- name: Test
run: npm test --ci --coverage --maxWorkers=2
- name: Lint
run: pnpm lint

- name: Build
run: npm run build
- name: Check types
run: pnpm check-types

- name: Publish to Chromatic
uses: chromaui/action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
- name: Test
run: pnpm test
12 changes: 0 additions & 12 deletions .github/workflows/size.yml

This file was deleted.

33 changes: 23 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
.*
!.husky
!.eslintrc.js
!.svgrrc.js
!.svgrrc-nomaterial.js
!.gitignore
!.gitkeep
!.storybook
!.github
!.nvmrc
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# Storybook
storybook-static
6 changes: 3 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint
pnpm dlx lint-staged
7 changes: 3 additions & 4 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint
npm run build-tsc
pnpm dlx npm-run-all --parallel lint check-types test
4 changes: 4 additions & 0 deletions .lintstagedrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
"*.{ts,tsx,js,jsx}": "eslint --fix",
"*": "prettier --ignore-unknown --write",
};
1 change: 0 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
puppeteer_skip_chromium_download = true
legacy-peer-deps=true
6 changes: 6 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
printWidth: 80,
semi: true,
singleQuote: false,
trailingComma: "es5",
};
7 changes: 7 additions & 0 deletions .release-it.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
github: {
release: true,
draft: true,
releaseName: "${version}",
},
};
22 changes: 22 additions & 0 deletions .storybook/main.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const { mergeConfig } = require("vite");

module.exports = {
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
],
framework: "@storybook/react",
core: {
builder: "@storybook/builder-vite",
},
features: {
storyStoreV7: true,
},
async viteFinal(config) {
return mergeConfig(config, {
plugins: [require("@vanilla-extract/vite-plugin").vanillaExtractPlugin()],
});
},
};
3 changes: 3 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<script>
window.global = window;
</script>
9 changes: 9 additions & 0 deletions .storybook/preview.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
}
37 changes: 3 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,15 @@
</div>

# MacawUI

Official React UI components kit for [Saleor](https://saleor.io/) — an open-source GraphQL-first and Next.js ready e-commerce platform. You can find most of the elements used in the creation of Saleor's dashboard interface and use it to create Saleor Apps. Have a great time working on your projects and empowering your users. If you have any questions, feel free to let us know on [GitHub Discussions](https://github.com/mirumee/saleor/discussions).

## Installation
```sh
npm i @saleor/macaw-ui
```

Note that this package depends on the following Material-UI **v4** packages: `@material-ui/core`, `@material-ui/icons` and `@material-ui/lab`. If your project doesn't have them installed and you're not using npm v7 with [automatically installed peer dependencies](https://github.blog/2020-10-13-presenting-v7-0-0-of-the-npm-cli/) then you'll need to install them manually:

```sh
npm i @material-ui/core @material-ui/icons @material-ui/lab
npm i @saleor/macaw-ui
```

## Documentation
Take a look at our [storybook docs](https://macaw-ui.vercel.app). You can find guides, component overview, and project ideas there.

### Development

To begin, you need to install dependencies:
Expand All @@ -31,31 +24,8 @@ To begin, you need to install dependencies:
npm install
```

We use [husky](https://www.npmjs.com/package/husky) to provide precommit and prepush git hooks:

```sh
npx husky install
```

To develop our components we utilize [Storybook](https://storybook.js.org/) which is playing very nicely with our development flow. To run storybook's developer server run:

```sh
npm run storybook
```

### Working with Material-UI
MacawUI was created to integrate with [Material-UI](https://material-ui.com/) seamlessly. It exports a `ThemeProvider` that will override Material-UI component styles:
```jsx
import { ThemeProvider } from "@saleor/macaw-ui";

// ...

<ThemeProvider>
<App />
</ThemeProvider>
```

## License

Distributed under the Creative Common Attribution 4.0 International License
[https://creativecommons.org/licenses/by/4.0/](https://creativecommons.org/licenses/by/4.0/)

Expand All @@ -64,4 +34,3 @@ Distributed under the Creative Common Attribution 4.0 International License
<a href="https://www.chromatic.com/"><img src="https://user-images.githubusercontent.com/321738/84662277-e3db4f80-af1b-11ea-88f5-91d67a5e59f6.png" width="153" height="30" alt="Chromatic" /></a>

Thanks to [Chromatic](https://www.chromatic.com/) for providing the visual testing platform that helps us review UI changes and catch visual regressions.

1 change: 1 addition & 0 deletions .eslintrc.js → legacy/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: {
sourceType: "module",
Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions legacy/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint
5 changes: 5 additions & 0 deletions legacy/.husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint
npm run build-tsc
2 changes: 2 additions & 0 deletions legacy/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
puppeteer_skip_chromium_download = true
legacy-peer-deps=true
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
67 changes: 67 additions & 0 deletions legacy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<div align="center">
<a href="https://macaw-ui.vercel.app/" rel="noopener" target="_blank"><img src="/stories/assets/macaw-ui-logo.svg" alt="Material-ui-pickers logo"></a></p>

[![npm package](https://img.shields.io/npm/v/@saleor/macaw-ui.svg)](https://www.npmjs.com/package/@saleor/macaw-ui)
[![npm download](https://img.shields.io/npm/dm/@saleor/macaw-ui.svg)](https://www.npmjs.com/package/@saleor/macaw-ui)
[![Bundle Size](https://badgen.net/bundlephobia/minzip/@saleor/macaw-ui)](https://bundlephobia.com/package/@saleor/macaw-ui@latest)
</div>

# MacawUI
Official React UI components kit for [Saleor](https://saleor.io/) — an open-source GraphQL-first and Next.js ready e-commerce platform. You can find most of the elements used in the creation of Saleor's dashboard interface and use it to create Saleor Apps. Have a great time working on your projects and empowering your users. If you have any questions, feel free to let us know on [GitHub Discussions](https://github.com/mirumee/saleor/discussions).

## Installation
```sh
npm i @saleor/macaw-ui
```

Note that this package depends on the following Material-UI **v4** packages: `@material-ui/core`, `@material-ui/icons` and `@material-ui/lab`. If your project doesn't have them installed and you're not using npm v7 with [automatically installed peer dependencies](https://github.blog/2020-10-13-presenting-v7-0-0-of-the-npm-cli/) then you'll need to install them manually:

```sh
npm i @material-ui/core @material-ui/icons @material-ui/lab
```

## Documentation
Take a look at our [storybook docs](https://macaw-ui.vercel.app). You can find guides, component overview, and project ideas there.

### Development

To begin, you need to install dependencies:

```sh
npm install
```

We use [husky](https://www.npmjs.com/package/husky) to provide precommit and prepush git hooks:

```sh
npx husky install
```

To develop our components we utilize [Storybook](https://storybook.js.org/) which is playing very nicely with our development flow. To run storybook's developer server run:

```sh
npm run storybook
```

### Working with Material-UI
MacawUI was created to integrate with [Material-UI](https://material-ui.com/) seamlessly. It exports a `ThemeProvider` that will override Material-UI component styles:
```jsx
import { ThemeProvider } from "@saleor/macaw-ui";

// ...

<ThemeProvider>
<App />
</ThemeProvider>
```

## License
Distributed under the Creative Common Attribution 4.0 International License
[https://creativecommons.org/licenses/by/4.0/](https://creativecommons.org/licenses/by/4.0/)

## Thanks

<a href="https://www.chromatic.com/"><img src="https://user-images.githubusercontent.com/321738/84662277-e3db4f80-af1b-11ea-88f5-91d67a5e59f6.png" width="153" height="30" alt="Chromatic" /></a>

Thanks to [Chromatic](https://www.chromatic.com/) for providing the visual testing platform that helps us review UI changes and catch visual regressions.

File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion package-lock.json → legacy/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 54a5b7c

Please sign in to comment.