@itcase/storybook-config 1.0.15 → 1.0.16
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/config/addonsNextJs.js +2 -0
- package/config/addonsReact.js +2 -0
- package/config/addonsReactVite.js +2 -0
- package/config/index.js +2 -0
- package/config/sourceLink.js +25 -0
- package/package.json +3 -1
package/config/addonsNextJs.js
CHANGED
package/config/addonsReact.js
CHANGED
package/config/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import { FRAMEWORK_REACT_VITE } from './frameworkReactVite'
|
|
|
9
9
|
import { MAIN_CONFIG } from './mainConfig'
|
|
10
10
|
import { MAIN_CONFIG_VITE } from './mainConfigVite'
|
|
11
11
|
import { REFS } from './refs'
|
|
12
|
+
import { SOURCELINK } from './sourceLink'
|
|
12
13
|
import { STATIC_DIRS_NEXTJS } from './staticDirsNextJs'
|
|
13
14
|
import { STATIC_DIRS_REACT } from './staticDirsReact'
|
|
14
15
|
import { STATIC_DIRS_REACT_VITE } from './staticDirsReactVite'
|
|
@@ -25,6 +26,7 @@ export {
|
|
|
25
26
|
FRAMEWORK_REACT,
|
|
26
27
|
FRAMEWORK_REACT_VITE,
|
|
27
28
|
ADDONS_REACT,
|
|
29
|
+
SOURCELINK,
|
|
28
30
|
ADDONS_REACT_VITE,
|
|
29
31
|
BACKGROUNDS,
|
|
30
32
|
MAIN_CONFIG,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { getFileUrl } from 'storybook-addon-source-link'
|
|
2
|
+
|
|
3
|
+
const SOURCELINK = {
|
|
4
|
+
links: {
|
|
5
|
+
before: { label: '', href: '', order: 0, icon: '' },
|
|
6
|
+
'component-vscode': ({ importPath, rootPath }) => {
|
|
7
|
+
if (!rootPath) return undefined
|
|
8
|
+
const componentPath = importPath.replace(/\.stories\.(js|tsx)?$/, '.js')
|
|
9
|
+
const labelPath = 'Source — ' + importPath.replace(/\.stories\.(js|tsx)?$/, '')
|
|
10
|
+
const componentFileUrl = getFileUrl(rootPath, componentPath)
|
|
11
|
+
const href = `vscode://${componentFileUrl.href}`
|
|
12
|
+
return { label: labelPath, href, icon: 'VSCodeIcon' }
|
|
13
|
+
},
|
|
14
|
+
'story-vscode': ({ importPath, rootPath }) => {
|
|
15
|
+
if (!rootPath) return undefined
|
|
16
|
+
const fileUrl = getFileUrl(rootPath, importPath)
|
|
17
|
+
const labelPath = 'Story — ' + importPath.replace(/\.(js|tsx)?$/, '')
|
|
18
|
+
const href = `vscode://${fileUrl.href}`
|
|
19
|
+
return { label: labelPath, href, icon: 'StorybookIcon' }
|
|
20
|
+
},
|
|
21
|
+
'addon-powered-by': { label: '', href: '', order: 1000, icon: '' },
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { SOURCELINK }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itcase/storybook-config",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
4
4
|
"author": "ITCase",
|
|
5
5
|
"description": "Code style linter configuration presets",
|
|
6
6
|
"engines": {
|
|
@@ -34,6 +34,8 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@itcase/config": "^1.0.6",
|
|
37
|
+
"@storybook/addon-designs": "^8.1.0",
|
|
38
|
+
"storybook-addon-source-link": "^0.2.1",
|
|
37
39
|
"@itcase/storybook-addon-auth": "^1.0.4",
|
|
38
40
|
"@storybook/addon-actions": "^8.5.3",
|
|
39
41
|
"@storybook/addon-controls": "^8.5.3",
|