Skip to content

Commit

Permalink
chore(website): fix build for Node 20 and update all versions
Browse files Browse the repository at this point in the history
  • Loading branch information
rakannimer committed Sep 22, 2024
1 parent 418ebc9 commit 3dab09f
Show file tree
Hide file tree
Showing 44 changed files with 38,203 additions and 23,595 deletions.
6 changes: 4 additions & 2 deletions .clean-publish
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"packageManager": "yarn",
"files": ["website"]
"packageManager": "npm",
"files": [
"website"
]
}
10 changes: 4 additions & 6 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
CI_JOB_NUMBER: 1
steps:
- name: Checkout the repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Check size
uses: andresz1/size-limit-action@v1
with:
Expand All @@ -27,10 +27,8 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: 16
node-version: 20
- name: Install dependencies
uses: bahmutov/npm-install@v1
with:
install-command: yarn --frozen-lockfile --ignore-engines
run: npm i
- name: Check storybook
run: yarn build:storybook
run: npm run build:storybook
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@ jobs:
with:
node-version: 16
- name: Install dependencies
uses: bahmutov/npm-install@v1
with:
install-command: yarn --frozen-lockfile --ignore-engines
run: npm i
- name: Run tests
run: yarn test
run: npm run test
- name: Collect coverage
uses: codecov/codecov-action@v2
if: success()
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
uses: bahmutov/npm-install@v1
with:
install-command: yarn --frozen-lockfile --ignore-engines
run: npm i
- name: Publish
run: |
yarn cleanPublish --without-publish --temp-dir package
yarn publish --non-interactive package
npm run cleanPublish --without-publish --temp-dir package
npm run publish --non-interactive package
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 3 additions & 3 deletions .simple-git-hooks.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"commit-msg": "yarn commitlint --edit \"$1\"",
"pre-commit": "yarn nano-staged",
"pre-push": "yarn test"
"commit-msg": "npm run commitlint",
"pre-commit": "npm run nano-staged",
"pre-push": "npm run test"
}
2 changes: 1 addition & 1 deletion .size-limit
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
{
"path": "dist/index.js",
"limit": "6 KB",
"limit": "6.3 KB",
"webpack": false,
"running": false
},
Expand Down
41 changes: 35 additions & 6 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,43 @@
const path = require('path');
const path = require("path");

module.exports = {
stories: ['../stories/*.tsx'],
stories: ["../stories/*.tsx"],

addons: [
'@storybook/addon-docs',
'@storybook/addon-controls',
'@storybook/addon-actions',
"@storybook/addon-docs",
"@storybook/addon-controls",
"@storybook/addon-actions",
"@storybook/addon-webpack5-compiler-babel",
"@chromatic-com/storybook",
],

webpackFinal(config) {
config.resolve.alias['react-google-charts'] = path.resolve(__dirname, '../src');
config.resolve.alias["react-google-charts"] = path.resolve(
__dirname,
"../src"
);
return config;
},

framework: {
name: "@storybook/react-webpack5",
options: {},
},

docs: {},

typescript: {
reactDocgen: "react-docgen-typescript",
},

babel: async (options) => {
return {
...options,
presets: [
...(options.presets ?? []),
"@babel/preset-react",
"@babel/preset-typescript",
],
};
},
};
6 changes: 3 additions & 3 deletions .storybook/manager.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { addons } from '@storybook/addons';
import { addons } from "@storybook/manager-api";

import { theme } from './theme';
import { theme } from "./theme";

addons.setConfig({
theme,
panelPosition: 'right',
panelPosition: "right",
});
3 changes: 2 additions & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { configureActions } from '@storybook/addon-actions';
import { configureActions } from "@storybook/addon-actions";

configureActions({
depth: 5,
});
export const tags = ["autodocs"];
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

## Installation

- Running `yarn` in the components's root directory will install everything you need for development.
- Running `npm i` in the components's root directory will install everything you need for development.

## Demo Development Server

- `yarn start` will run a development server with the component's demo app at [http://localhost:1234](http://localhost:1234) with hot module reloading.
- `npm start` will run a development server with the component's demo app at [http://localhost:1234](http://localhost:1234) with hot module reloading.

## Build

- `yarn build`
- `npm run build`
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,7 @@ A thin, typed, React wrapper for [Google Charts](https://developers.google.com/c
Install this library with your favorite package manager:

```bash
yarn add react-google-charts
```

or

```bash
npm install --save react-google-charts
npm i react-google-charts
```

Then, import and use it:
Expand All @@ -41,11 +35,15 @@ import { Chart } from "react-google-charts";

<Chart
chartType="ScatterChart"
data={[["Age", "Weight"], [4, 5.5], [8, 12]]}
data={[
["Age", "Weight"],
[4, 5.5],
[8, 12],
]}
width="100%"
height="400px"
legendToggle
/>
/>;
```

## Docs
Expand All @@ -65,6 +63,6 @@ Contributions are very welcome. Check out [CONTRIBUTING.md](CONTRIBUTING.md)
```bash
git clone https://www.github.com/rakannimer/react-google-charts
cd react-google-charts
yarn
yarn start:storybook
npm i
npm run start:storybook
```
Loading

0 comments on commit 3dab09f

Please sign in to comment.