@toptal/davinci-storybook-addons 5.0.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -1
- package/README.md +0 -16
- package/bin/build.mjs +6 -5
- package/package.json +8 -18
- package/src/constants.js +6 -29
- package/src/custom-addons/segment-analytics/src/register.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @toptal/davinci-storybook-addons
|
|
2
2
|
|
|
3
|
+
## 6.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#2669](https://github.com/toptal/davinci/pull/2669) [`5bf4768`](https://github.com/toptal/davinci/commit/5bf4768b9e4f55faf8fa2aa3fe198b2bdfea66ee) Thanks [@DaveHellsmith](https://github.com/DaveHellsmith)!
|
|
8
|
+
Migrate to Storybook 9
|
|
9
|
+
- update all @storybook/\* peer dependencies from v8 to v9
|
|
10
|
+
- remove 7 addons absorbed into Storybook 9 core (backgrounds, controls, measure, outline, toolbars, viewport, storysource)
|
|
11
|
+
- migrate import paths to Storybook 9 subpath exports (storybook/theming, storybook/manager-api, storybook/internal/types, storybook/internal/core-events)
|
|
12
|
+
- move doc block exports to @storybook/addon-docs/blocks
|
|
13
|
+
- remove webpack compiler addon references (no v9 releases)
|
|
14
|
+
|
|
3
15
|
## 5.0.0
|
|
4
16
|
|
|
5
17
|
### Major Changes
|
|
@@ -12,7 +24,7 @@
|
|
|
12
24
|
- convert Yarn `resolutions` to `pnpm.overrides` in root `package.json`
|
|
13
25
|
- update lerna `npmClient` from `yarn` to `pnpm`
|
|
14
26
|
- replace `yarn` with `pnpm` in root scripts (postinstall, test, test:unit:update)
|
|
15
|
-
|
|
27
|
+
**HOW to update:**
|
|
16
28
|
- install pnpm (`corepack enable` or `npm install -g pnpm@10.6.1`)
|
|
17
29
|
- replace `yarn install` with `pnpm install` in local workflows
|
|
18
30
|
- replace `yarn <script>` with `pnpm <script>` when running commands
|
package/README.md
CHANGED
|
@@ -65,26 +65,10 @@ Here's a list of all addons used in `davinci-storybook-addons` package
|
|
|
65
65
|
|
|
66
66
|
* [a11y](https://github.com/storybookjs/storybook/tree/master/addons/a11y)
|
|
67
67
|
|
|
68
|
-
* [actions](https://github.com/storybookjs/storybook/tree/master/addons/actions)
|
|
69
|
-
|
|
70
|
-
* [backgrounds](https://github.com/storybookjs/storybook/tree/master/addons/backgrounds)
|
|
71
|
-
|
|
72
|
-
* [controls](https://github.com/storybookjs/storybook/tree/master/addons/controls)
|
|
73
|
-
|
|
74
68
|
* [docs](https://github.com/storybookjs/storybook/tree/master/addons/docs)
|
|
75
69
|
|
|
76
70
|
* [links](https://github.com/storybookjs/storybook/tree/master/addons/links)
|
|
77
71
|
|
|
78
|
-
* [measure](https://github.com/storybookjs/storybook/tree/master/addons/measure)
|
|
79
|
-
|
|
80
|
-
* [outline](https://github.com/storybookjs/storybook/tree/master/addons/outline)
|
|
81
|
-
|
|
82
|
-
* [storysource](https://github.com/storybookjs/storybook/tree/master/addons/storysource)
|
|
83
|
-
|
|
84
|
-
* [toolbars](https://github.com/storybookjs/storybook/tree/master/addons/toolbars)
|
|
85
|
-
|
|
86
|
-
* [viewport](https://github.com/storybookjs/storybook/tree/master/addons/viewport)
|
|
87
|
-
|
|
88
72
|
### Custom addons
|
|
89
73
|
|
|
90
74
|
* [@toptal/storybook-segment-addon](src/custom-addons/segment-analytics/README.md)
|
package/bin/build.mjs
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import fs from 'fs'
|
|
3
|
+
import path from 'path'
|
|
4
|
+
import { fileURLToPath } from 'url'
|
|
3
5
|
import { remark } from 'remark'
|
|
4
6
|
import {
|
|
5
7
|
text,
|
|
@@ -11,10 +13,12 @@ import {
|
|
|
11
13
|
heading,
|
|
12
14
|
} from 'mdast-builder'
|
|
13
15
|
import { headingRange } from 'mdast-util-heading-range'
|
|
14
|
-
import { files } from '@toptal/davinci-cli-shared'
|
|
15
16
|
|
|
16
17
|
import { STORYBOOK_ADDONS, CUSTOM_ADDONS } from '../src/constants.js'
|
|
17
18
|
|
|
19
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
20
|
+
const packageRoot = path.resolve(__dirname, '..')
|
|
21
|
+
|
|
18
22
|
const storybookAddonLinkSkelet =
|
|
19
23
|
'https://github.com/storybookjs/storybook/tree/master/addons/'
|
|
20
24
|
|
|
@@ -49,10 +53,7 @@ const updateAddonsList = () => tree => {
|
|
|
49
53
|
}
|
|
50
54
|
|
|
51
55
|
const updateReadme = async () => {
|
|
52
|
-
const readmePath =
|
|
53
|
-
'@toptal/davinci-storybook-addons',
|
|
54
|
-
'README.md'
|
|
55
|
-
)
|
|
56
|
+
const readmePath = path.join(packageRoot, 'README.md')
|
|
56
57
|
const readmeContent = await fs.promises.readFile(readmePath, 'utf8')
|
|
57
58
|
|
|
58
59
|
const processedContent = await remark()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toptal/davinci-storybook-addons",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"addon",
|
|
6
6
|
"essentials",
|
|
@@ -19,31 +19,21 @@
|
|
|
19
19
|
"CHANGELOG.md"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@storybook/addon-a11y": "^
|
|
23
|
-
"@storybook/addon-
|
|
24
|
-
"@storybook/addon-
|
|
25
|
-
"
|
|
26
|
-
"@storybook/addon-docs": "^8.6.9",
|
|
27
|
-
"@storybook/addon-links": "^8.6.9",
|
|
28
|
-
"@storybook/addon-measure": "^8.6.9",
|
|
29
|
-
"@storybook/addon-outline": "^8.6.9",
|
|
30
|
-
"@storybook/addon-storysource": "^8.6.9",
|
|
31
|
-
"@storybook/addon-toolbars": "^8.6.9",
|
|
32
|
-
"@storybook/addon-viewport": "^8.6.9",
|
|
33
|
-
"@storybook/core-events": "^8.6.9",
|
|
34
|
-
"@storybook/manager-api": "^8.6.9",
|
|
35
|
-
"@storybook/theming": "^8.6.9",
|
|
36
|
-
"@storybook/types": "^8.6.9",
|
|
22
|
+
"@storybook/addon-a11y": "^9.1.0",
|
|
23
|
+
"@storybook/addon-docs": "^9.1.0",
|
|
24
|
+
"@storybook/addon-links": "^9.1.0",
|
|
25
|
+
"storybook": "^9.1.0",
|
|
37
26
|
"@toptal/davinci-cli-shared": "^3.0.0"
|
|
38
27
|
},
|
|
39
28
|
"devDependencies": {
|
|
40
|
-
"@storybook/react": "^
|
|
29
|
+
"@storybook/react": "^9.1.0",
|
|
41
30
|
"mdast-builder": "^1.1.1",
|
|
42
31
|
"mdast-util-heading-range": "^3.0.0",
|
|
43
32
|
"remark": "^15.0.1"
|
|
44
33
|
},
|
|
45
34
|
"peerDependencies": {
|
|
46
|
-
"@storybook/react": "
|
|
35
|
+
"@storybook/react": "9",
|
|
36
|
+
"storybook": "9"
|
|
47
37
|
},
|
|
48
38
|
"publishConfig": {
|
|
49
39
|
"access": "public"
|
package/src/constants.js
CHANGED
|
@@ -1,45 +1,22 @@
|
|
|
1
1
|
const path = require('path')
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5
|
-
const getPackageFilePath = (davinciPackageName, filename) => {
|
|
6
|
-
const packageIndexPath = require.resolve(davinciPackageName, {
|
|
7
|
-
paths: [process.cwd()],
|
|
8
|
-
})
|
|
9
|
-
const davinciQARoot = path.join(packageIndexPath, '../..')
|
|
3
|
+
const packageRoot = path.resolve(__dirname, '..')
|
|
10
4
|
|
|
11
|
-
|
|
5
|
+
const getPackageFilePath = filename => {
|
|
6
|
+
return path.join(packageRoot, filename)
|
|
12
7
|
}
|
|
13
8
|
|
|
14
|
-
const STORYBOOK_ADDONS = [
|
|
15
|
-
'a11y',
|
|
16
|
-
'actions',
|
|
17
|
-
'backgrounds',
|
|
18
|
-
'controls',
|
|
19
|
-
'docs',
|
|
20
|
-
'links',
|
|
21
|
-
'measure',
|
|
22
|
-
'outline',
|
|
23
|
-
'storysource',
|
|
24
|
-
'toolbars',
|
|
25
|
-
'viewport',
|
|
26
|
-
]
|
|
9
|
+
const STORYBOOK_ADDONS = ['a11y', 'docs', 'links']
|
|
27
10
|
|
|
28
11
|
const CUSTOM_ADDONS = [
|
|
29
12
|
{
|
|
30
13
|
name: '@toptal/storybook-segment-addon',
|
|
31
|
-
path: getPackageFilePath(
|
|
32
|
-
'@toptal/davinci-storybook-addons',
|
|
33
|
-
'src/custom-addons/segment-analytics'
|
|
34
|
-
),
|
|
14
|
+
path: getPackageFilePath('src/custom-addons/segment-analytics'),
|
|
35
15
|
url: 'src/custom-addons/segment-analytics/README.md',
|
|
36
16
|
},
|
|
37
17
|
{
|
|
38
18
|
name: '@toptal/storybook-highlight-story',
|
|
39
|
-
path: getPackageFilePath(
|
|
40
|
-
'@toptal/davinci-storybook-addons',
|
|
41
|
-
'src/custom-addons/highlight-story'
|
|
42
|
-
),
|
|
19
|
+
path: getPackageFilePath('src/custom-addons/highlight-story'),
|
|
43
20
|
url: 'src/custom-addons/highlight-story/README.md',
|
|
44
21
|
},
|
|
45
22
|
]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const { addons } = require('
|
|
2
|
-
const { STORY_CHANGED } = require('
|
|
1
|
+
const { addons } = require('storybook/manager-api')
|
|
2
|
+
const { STORY_CHANGED } = require('storybook/internal/core-events')
|
|
3
3
|
|
|
4
4
|
const initSegment = writeKey => {
|
|
5
5
|
const analytics = (window.analytics = window.analytics || [])
|