Skip to content

Commit 69cb54e

Browse files
chore: upgrade to storybook 10
1 parent 9976b8f commit 69cb54e

4 files changed

Lines changed: 595 additions & 419 deletions

File tree

.storybook/main.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// Direct path required because the package exports field doesn't expose this subpath
2+
import { createRequire } from 'node:module'
3+
const require = createRequire(import.meta.url)
24
const makeBabelConfig = require('../node_modules/@dhis2/cli-app-scripts/config/makeBabelConfig.js')
35

4-
module.exports = {
6+
export default {
57
addons: ['@storybook/preset-create-react-app'],
68
stories: ['../src/__demo__/**/*.stories.@(js)'],
79

.storybook/preview.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { CssReset } from '@dhis2/ui'
22
import React from 'react'
3-
const { withJsx } = require('@mihkeleidast/storybook-addon-source')
43

54
export const decorators = [
6-
withJsx,
75
(Story) => (
86
<div>
97
<CssReset />

package.json

Lines changed: 82 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,83 @@
11
{
2-
"name": "@dhis2/analytics",
3-
"version": "29.4.2",
4-
"main": "./build/cjs/index.js",
5-
"module": "./build/es/index.js",
6-
"exports": {
7-
"import": "./build/es/index.js",
8-
"require": "./build/cjs/index.js"
9-
},
10-
"sideEffects": [
11-
"./build/es/locales/index.js",
12-
"./build/cjs/locales/index.js"
13-
],
14-
"repository": "git@github.com:dhis2/analytics.git",
15-
"author": "Jennifer Jones Arnesen <jennifer@dhis2.org>",
16-
"license": "BSD-3-Clause",
17-
"private": false,
18-
"publishConfig": {
19-
"access": "public"
20-
},
21-
"scripts": {
22-
"build": "d2-app-scripts build",
23-
"build-storybook": "storybook build",
24-
"start-storybook": "storybook dev --port 5000",
25-
"start": "yarn start-storybook",
26-
"test": "d2-app-scripts test",
27-
"lint": "d2-style check",
28-
"format": "d2-style apply",
29-
"validate-commit": "d2-style check --staged",
30-
"validate-push": "yarn test"
31-
},
32-
"devDependencies": {
33-
"@dhis2/app-runtime": "^3.14.1",
34-
"@dhis2/cli-app-scripts": "^12.11.0",
35-
"@dhis2/cli-style": "^10.7.9",
36-
"@dhis2/d2-i18n": "^1.1.0",
37-
"@dhis2/ui": "^10.12.7",
38-
"@mihkeleidast/storybook-addon-source": "^1.0.1",
39-
"@storybook/preset-create-react-app": "^8.3.6",
40-
"@storybook/react": "^8.3.6",
41-
"@storybook/react-webpack5": "^8.3.6",
42-
"@testing-library/dom": "^10.4.0",
43-
"@testing-library/jest-dom": "^6.6.3",
44-
"@testing-library/react": "^16.3.0",
45-
"@testing-library/user-event": "^14.6.1",
46-
"fs-extra": "^10.1.0",
47-
"prop-types": "^15",
48-
"react": "^18.3.1",
49-
"react-dom": "^18.3.1",
50-
"react-scripts": "^5.0.1",
51-
"storybook": "^8.3.6",
52-
"styled-jsx": "^4.0.1"
53-
},
54-
"peerDependencies": {
55-
"@dhis2/app-runtime": "^3",
56-
"@dhis2/d2-i18n": "^1.1",
57-
"@dhis2/ui": "^10",
58-
"prop-types": "^15",
59-
"react": "^16.3 || ^18",
60-
"react-dom": "^16.3 || ^ 18",
61-
"styled-jsx": "^4.0.1"
62-
},
63-
"dependencies": {
64-
"@dhis2/multi-calendar-dates": "^1.2.2",
65-
"@dnd-kit/core": "^6.0.7",
66-
"@dnd-kit/sortable": "^7.0.2",
67-
"@dnd-kit/utilities": "^3.2.1",
68-
"@react-hook/debounce": "^4.0.0",
69-
"classnames": "^2.3.1",
70-
"crypto-js": "^4.2.0",
71-
"d2-utilizr": "^0.2.16",
72-
"d3-color": "^1.2.3",
73-
"highcharts": "^12.1.2",
74-
"lodash": "^4.17.21",
75-
"markdown-it": "^13.0.1",
76-
"mathjs": "^9.4.2",
77-
"react-beautiful-dnd": "^10.1.1",
78-
"resize-observer-polyfill": "^1.5.1"
79-
},
80-
"files": [
81-
"build"
82-
],
83-
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
84-
}
2+
"name": "@dhis2/analytics",
3+
"version": "29.4.2",
4+
"main": "./build/cjs/index.js",
5+
"module": "./build/es/index.js",
6+
"exports": {
7+
"import": "./build/es/index.js",
8+
"require": "./build/cjs/index.js"
9+
},
10+
"sideEffects": [
11+
"./build/es/locales/index.js",
12+
"./build/cjs/locales/index.js"
13+
],
14+
"repository": "git@github.com:dhis2/analytics.git",
15+
"author": "Jennifer Jones Arnesen <jennifer@dhis2.org>",
16+
"license": "BSD-3-Clause",
17+
"private": false,
18+
"publishConfig": {
19+
"access": "public"
20+
},
21+
"scripts": {
22+
"build": "d2-app-scripts build",
23+
"build-storybook": "storybook build",
24+
"start-storybook": "storybook dev --port 5000",
25+
"start": "yarn start-storybook",
26+
"test": "d2-app-scripts test",
27+
"lint": "d2-style check",
28+
"format": "d2-style apply",
29+
"validate-commit": "d2-style check --staged",
30+
"validate-push": "yarn test"
31+
},
32+
"devDependencies": {
33+
"@dhis2/app-runtime": "^3.14.1",
34+
"@dhis2/cli-app-scripts": "^12.11.0",
35+
"@dhis2/cli-style": "^10.7.9",
36+
"@dhis2/d2-i18n": "^1.1.0",
37+
"@dhis2/ui": "^10.12.7",
38+
"@storybook/preset-create-react-app": "^10.3.4",
39+
"@storybook/react-webpack5": "^10.3.4",
40+
"@testing-library/dom": "^10.4.0",
41+
"@testing-library/jest-dom": "^6.6.3",
42+
"@testing-library/react": "^16.3.0",
43+
"@testing-library/user-event": "^14.6.1",
44+
"fs-extra": "^10.1.0",
45+
"prop-types": "^15",
46+
"react": "^18.3.1",
47+
"react-dom": "^18.3.1",
48+
"react-scripts": "^5.0.1",
49+
"storybook": "^10.3.4",
50+
"styled-jsx": "^4.0.1",
51+
"eslint-plugin-storybook": "10.3.4"
52+
},
53+
"peerDependencies": {
54+
"@dhis2/app-runtime": "^3",
55+
"@dhis2/d2-i18n": "^1.1",
56+
"@dhis2/ui": "^10",
57+
"prop-types": "^15",
58+
"react": "^16.3 || ^18",
59+
"react-dom": "^16.3 || ^ 18",
60+
"styled-jsx": "^4.0.1"
61+
},
62+
"dependencies": {
63+
"@dhis2/multi-calendar-dates": "^1.2.2",
64+
"@dnd-kit/core": "^6.0.7",
65+
"@dnd-kit/sortable": "^7.0.2",
66+
"@dnd-kit/utilities": "^3.2.1",
67+
"@react-hook/debounce": "^4.0.0",
68+
"classnames": "^2.3.1",
69+
"crypto-js": "^4.2.0",
70+
"d2-utilizr": "^0.2.16",
71+
"d3-color": "^1.2.3",
72+
"highcharts": "^12.1.2",
73+
"lodash": "^4.17.21",
74+
"markdown-it": "^13.0.1",
75+
"mathjs": "^9.4.2",
76+
"react-beautiful-dnd": "^10.1.1",
77+
"resize-observer-polyfill": "^1.5.1"
78+
},
79+
"files": [
80+
"build"
81+
],
82+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
83+
}

0 commit comments

Comments
 (0)