Skip to content

Commit

Permalink
Deprecate and remove awesome styled grid from main bundle (#677)
Browse files Browse the repository at this point in the history
  • Loading branch information
nowyDEV authored Oct 26, 2023
1 parent 6e97a26 commit 704ab7b
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 29 deletions.
63 changes: 45 additions & 18 deletions package-lock.json

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

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@nordcloud/gnui",
"description": "Nordcloud Design System - a collection of reusable React components used in Nordcloud's SaaS products",
"version": "9.2.0",
"version": "10.0.0",
"license": "MIT",
"repository": {
"type": "git",
Expand Down Expand Up @@ -35,8 +35,7 @@
"lint:css:quiet": "npm run lint:css -- --quiet",
"lint:lockfile": "lockfile-lint",
"validate:all": "npm-run-all --parallel check:types check:format check:knip lint:quiet lint:css:quiet lint:lockfile test:all",
"postinstall": "patch-package",
"prepare": "husky install"
"prepare": "patch-package && husky install"
},
"engines": {
"node": "~18.12.0 || ~18.13.0",
Expand Down Expand Up @@ -64,7 +63,6 @@
"date-fns": "^2.30.0",
"lodash.clonedeep": "^4.5.0",
"polished": "^4.2.2",
"react-awesome-styled-grid": "^3.1.4",
"react-content-loader": "^6.2.1",
"react-day-picker": "^8.8.2",
"react-helmet": "^6.1.0",
Expand Down Expand Up @@ -105,6 +103,7 @@
"patch-package": "^6.5.1",
"prettier": "^3.0.3",
"react": "^18.2.0",
"react-awesome-styled-grid": "^3.1.4",
"react-copy-to-clipboard": "^5.1.0",
"react-dom": "^18.2.0",
"rollup": "^3.29.4",
Expand Down
7 changes: 0 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
export {
Container,
Row,
Col,
Hidden,
Visible,
} from "react-awesome-styled-grid";
export { DayPicker } from "react-day-picker";

export * from "./components";
Expand Down
43 changes: 43 additions & 0 deletions src/stories/Grid.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,49 @@ import * as GridStories from "./Grid.stories";

<Meta of={GridStories} />

## Note

Below guide is deprecated, the grid library mentioned here is no longer maintained and has a bug that requires additional setup.

### Setup

#### Install grid library

```bash
npm install react-awesome-styled-grid
```

#### Implement required fix

```bash
npm install -D patch-package
```

Make necessary changes inside two files:

`/node_modules/react-awesome-styled-grid/lib/react-awesome-styled-grid.cjs.js`
`/node_modules/react-awesome-styled-grid/lib/react-awesome-styled-grid.es.js`

```text
- void 0 === i && (i = global);
+ void 0 === i && (i = window);
```

Apply patch:

```text
npx patch-package react-awesome-styled-grid
```

Update `package.json`:

```text
"scripts": {
...
"postinstall": "patch-package"
}
```

## Basic usage

<Canvas>
Expand Down

0 comments on commit 704ab7b

Please sign in to comment.