Skip to content

Commit e32a42d

Browse files
committed
Merge branch 'main' into yogesh-split-publish-ci
# Conflicts: # .github/workflows/publish-backend.yml
2 parents fa8431b + 5617465 commit e32a42d

File tree

207 files changed

+7073
-2520
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

207 files changed

+7073
-2520
lines changed

.github/workflows/backend-ci.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,13 @@ jobs:
2121
shell: bash -l {0}
2222
run: |
2323
cd chartlets.py
24-
pytest
24+
pytest --cov=chartlets --cov-report=xml
25+
26+
- name: Upload coverage reports to Codecov
27+
uses: codecov/codecov-action@v4
28+
with:
29+
fail_ci_if_error: true
30+
directory: chartlets.py/
31+
flags: backend
32+
verbose: true
33+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/frontend-ci.yml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,46 @@ jobs:
1717
with:
1818
node-version: '18.x'
1919

20-
- name: Install dependencies
20+
- name: Install common dependencies
2121
run: |
2222
cd chartlets.js
2323
npm install
2424
25-
- name: Linter
25+
- name: Lib lint
2626
run: |
27-
cd chartlets.js
27+
cd chartlets.js/packages/lib
2828
npm run lint
2929
30-
- name: Run frontend tests
30+
- name: Lib tests
3131
run: |
32-
cd chartlets.js
32+
cd chartlets.js/packages/lib
3333
npm run test
3434
35-
- name: Build frontend application
35+
- name: Lib coverage
3636
run: |
37-
cd chartlets.js
37+
cd chartlets.js/packages/lib
38+
npm run coverage
39+
40+
- name: Upload coverage reports for lib to Codecov
41+
uses: codecov/codecov-action@v4
42+
with:
43+
fail_ci_if_error: true
44+
directory: chartlets.js/packages/lib/coverage/
45+
flags: frontend
46+
verbose: true
47+
token: ${{ secrets.CODECOV_TOKEN }}
48+
49+
- name: Lib build
50+
run: |
51+
cd chartlets.js/packages/lib
52+
npm run build
53+
54+
- name: Demo lint
55+
run: |
56+
cd chartlets.js/packages/demo
57+
npm run lint
58+
59+
- name: Demo build
60+
run: |
61+
cd chartlets.js/packages/demo
3862
npm run build

.github/workflows/publish-backend.yml

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
pytest --cov=chartlets
4242
4343
- name: Upload coverage reports to Codecov
44-
uses: codecov/codecov-action@v3
44+
uses: codecov/codecov-action@v4
4545
env:
4646
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
4747

@@ -77,3 +77,53 @@ jobs:
7777
password: ${{ secrets.PYPI_API_TOKEN }}
7878
packages_dir: chartlets.py/dist
7979
verbose: true
80+
81+
npm-tests:
82+
runs-on: ubuntu-latest
83+
strategy:
84+
matrix:
85+
node-version: [16.x, 18.x, 20.x]
86+
# See supported Node.js release schedule at
87+
# https://nodejs.org/en/about/releases/
88+
defaults:
89+
run:
90+
working-directory: chartlets.js
91+
92+
steps:
93+
- uses: actions/checkout@v3
94+
- name: Use Node.js ${{ matrix.node-version }}
95+
uses: actions/setup-node@v3
96+
with:
97+
node-version: ${{ matrix.node-version }}
98+
cache: 'npm'
99+
cache-dependency-path: chartlets.js/package-lock.json
100+
101+
- run: npm ci
102+
- run: npm run lint
103+
- run: npm run build
104+
- run: npm run test
105+
106+
npm-Deploy:
107+
name: Publish TS-React Package to npmjs
108+
runs-on: ubuntu-latest
109+
needs: npm-tests
110+
defaults:
111+
run:
112+
working-directory: chartlets.js
113+
114+
steps:
115+
- uses: actions/checkout@v4
116+
117+
- name: Set up Node.js
118+
uses: actions/setup-node@v4
119+
with:
120+
node-version: '18.x'
121+
registry-url: 'https://registry.npmjs.org'
122+
cache: 'npm'
123+
cache-dependency-path: chartlets.js/package-lock.json
124+
125+
- run: npm ci
126+
- run: npm run build
127+
- run: npm publish --access public
128+
env:
129+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ node_modules
1212
__pycache__
1313
# mkdocs
1414
site
15+
# pytest --cov
16+
.coverage
1517

1618
# Editor directories and files
1719
.vscode/*

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Chartlets
22

3+
[![CI](https://github.com/bcdev/chartlets/actions/workflows/frontend-ci.yml/badge.svg)](https://github.com/bcdev/chartlets/actions/workflows/frontend-ci.yml)
4+
[![npm](https://badge.fury.io/js/chartlets.svg)](https://npmjs.org/package/chartlets)
5+
6+
[![CI](https://github.com/bcdev/chartlets/actions/workflows/backend-ci.yml/badge.svg)](https://github.com/bcdev/chartlets/actions/workflows/backend-ci.yml)
7+
[![PyPI](https://img.shields.io/pypi/v/chartlets)](https://pypi.org/project/chartlets/)
8+
39
Chartlets is a software framework that allows websites developed with
410
React to be extended by server-side UI contributions programmed in Python
511
or other programming languages.
@@ -11,10 +17,11 @@ Please see the [Documentation](https://bcdev.github.io/chartlets/) for more info
1117

1218
## Features
1319

14-
- Enhance your React web application by UI-contributions programmed in Python
15-
- Enhance your (Python) web API to serve server-side UI-contributions.
16-
- Uses [Material UI](https://mui.com/material-ui/) components and
17-
[Vega-Lite](https://vega.github.io/vega-lite/) charts.
20+
- Enhance your React web application by UI-contributions programmed in Python.
21+
- Enhance your Python REST server to publish server-side UI-contributions.
22+
- Support your favorite charting library or UI component library by plugins.
23+
- Use provided plugins for [Vega-Lite](https://vega.github.io/vega-lite/) charts and [Material UI](https://mui.com/material-ui/)
24+
components.
1825

1926
## License
2027

chartlets.js/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ yarn-error.log*
77
pnpm-debug.log*
88
lerna-debug.log*
99

10-
node_modules
10+
packages/lib/node_modules
1111
dist
1212
dist-ssr
1313
*.local

chartlets.js/CHANGES.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,54 @@
1+
## Version 0.1.0 (in development)
2+
3+
* Reorganised Chartlets project to better separate demo from library code.
4+
Using monorepo layout for `chartlets.js` with workspaces `lib` and `demo`
5+
that host the packages for `chartlets` and `chartlets-demo`.
6+
7+
* Other code reorganisations:
8+
- moved `component/Registry` into `store`
9+
- renamed module `component` into `components`
10+
- no longer exposing `Registry` type
11+
12+
* Chartlets now allows for plugins that can provide individual component
13+
implementations.
14+
The Vega-based chart and MUI components are now optional and have been
15+
moved into respective plugin modules `chartlets/plugins/vega` and
16+
`chartlets/plugins/mui`.
17+
To activate them, use the new `plugins: PluginLike[]` option
18+
of `FrameworkOptions`:
19+
```TypeScript
20+
import { configureFramework } from "chartlets";
21+
import mui from "chartlets/plugins/mui";
22+
import vega from "chartlets/plugins/vega";
23+
24+
configureFramework({ plugins: [mui(), vega()], ... });
25+
```
26+
27+
* Renamed `Plot` component into `VegaChart`.
28+
29+
* The new `VegaChart` component respects a `theme` property. If not given,
30+
it will respect the current theme mode `"dark"` otherwise fallback to the
31+
Vega default theme.
32+
33+
* The demo application now allows for switching the theme mode between
34+
dark, light, and system mode.
35+
36+
* Changed the yet unused descriptor type `CbFunction` for callback functions.
37+
- using `schema` instead of `type` property for callback arguments
38+
- using `return` object with `schema` property for callback return values
39+
40+
* New (MUI) components
41+
- `LinearProgress`
42+
- `RadioGroup` and `Radio`
43+
- `Switch`
44+
- `Tabs`
45+
46+
* Supporting `tooltip` property for interactive MUI components.
47+
48+
## Version 0.0.29 (from 2024/11/26)
49+
50+
* Resolved warnings that appeared when using Vega charts.
51+
152
## Version 0.0.28 (from 2024/11/26)
253

354
* Updated docs.

chartlets.js/README.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
1-
# chartlets
1+
# Chartlets
22

3-
[![Frontend CI workflow](https://github.com/bcdev/chartlets/actions/workflows/frontend-ci.yml/badge.svg)](https://github.com/bcdev/chartlets/actions/workflows/frontend-ci.yml)
4-
[![NPM Version](https://badge.fury.io/js/chartlets.svg)](https://npmjs.org/package/chartlets)
3+
[![CI](https://github.com/bcdev/chartlets/actions/workflows/frontend-ci.yml/badge.svg)](https://github.com/bcdev/chartlets/actions/workflows/frontend-ci.yml)
4+
[![npm](https://badge.fury.io/js/chartlets.svg)](https://npmjs.org/package/chartlets)
55
![](https://img.shields.io/badge/Linting-TypeScript%20%26%20Prettier-blue?logo=typescript&logoColor=white)
66

7-
8-
[![NPM Download Stats](https://nodei.co/npm/chartlets.png?downloads=true)](https://www.npmjs.com/package/chartlets)
9-
107
Chartlets is a software framework that allows websites developed with
118
React to be extended by server-side widgets programmed in Python or other
129
programming languages.
1310

14-
This is the JavaScript/React library of the framework.
11+
This is the **JavaScript/React library** of the framework.
1512

1613
For details refer to the [documentation](https://bcdev.github.io/chartlets/).
1714

18-
## Run the demo UI
19-
20-
``` bash
21-
npm install
22-
npm run dev
23-
```

0 commit comments

Comments
 (0)