{"_id":"@biotope/storybook-addon-compiled-code","_rev":"2-1f2613475e2fa2d2e7564bc6ea44771e","name":"@biotope/storybook-addon-compiled-code","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.4":{"name":"@biotope/storybook-addon-compiled-code","version":"1.0.4","description":"Compiled code addon for storybook","keywords":["addon","storybook"],"homepage":"https://github.com/biotope/storybook-addon-compiled-code","bugs":{"url":"https://github.com/biotope/storybook-addon-compiled-code/issues"},"repository":{"type":"git","url":"git+https://github.com/biotope/storybook-addon-compiled-code.git"},"license":"MIT","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"prepare":"node ./scripts/prepare.js","release":"np --no-yarn"},"dependencies":{"@babel/cli":"^7.10.1","@babel/core":"^7.10.2","@babel/plugin-proposal-class-properties":"^7.10.1","@babel/plugin-proposal-decorators":"^7.10.1","@babel/plugin-proposal-export-default-from":"^7.10.1","@babel/plugin-proposal-object-rest-spread":"^7.10.1","@babel/plugin-proposal-private-methods":"^7.10.1","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/preset-env":"^7.10.2","@babel/preset-flow":"^7.10.1","@babel/preset-react":"^7.10.1","@babel/preset-typescript":"^7.10.1","@babel/runtime":"^7.10.2","@storybook/addons":"6.0.0-beta.17","@storybook/api":"6.0.0-beta.17","@storybook/client-logger":"6.0.0-beta.17","@storybook/components":"6.0.0-beta.17","@storybook/core-events":"^5.3.19","@storybook/router":"6.0.0-beta.17","@storybook/source-loader":"6.0.0-beta.17","@storybook/theming":"6.0.0-beta.17","@types/jest":"^25.2.3","@types/webpack-env":"^1.15.2","chalk":"^4.0.0","core-js":"^3.0.1","downlevel-dts":"^0.4.0","estraverse":"^4.2.0","fs":"0.0.1-security","loader-utils":"^2.0.0","np":"^6.2.3","npmlog":"^4.1.2","prettier":"^2.0.5","prop-types":"^15.7.2","react":"^16.9.17","react-syntax-highlighter":"^12.2.1","regenerator-runtime":"^0.13.3","shelljs":"^0.8.4","typescript":"^3.9.3"},"devDependencies":{"@types/react":"^16.9.27","@types/react-syntax-highlighter":"^11.0.4"},"peerDependencies":{"@storybook/source-loader":"*","react":"*","react-dom":"*"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"gitHead":"4b9d901add9452525135caae98ae5f78dd8da9ff","_id":"@biotope/storybook-addon-compiled-code@1.0.4","_nodeVersion":"10.15.3","_npmVersion":"6.14.1","dist":{"integrity":"sha512-Hj0Hcuwt7RI7XHCwvSad8w0I5HkJA8N2Y7b/0h8VktFVDqyHW6v/nc3Q2S3UYqp/r5WwZXvd+aLmEuQaHn2icQ==","shasum":"bd2f2ce7129c61269a9c541886bba7315a6c513d","tarball":"https://registry.npmjs.org/@biotope/storybook-addon-compiled-code/-/storybook-addon-compiled-code-1.0.4.tgz","fileCount":18,"unpackedSize":25641,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1gm/CRA9TVsSAnZWagAA/pwP/39Pmx6I3SJjFD/SHtTW\nd+VbcinX3zft32YBNqwdZWFM1gFtp0Ge5iE1TrrNGmynryNCqch5k2V08Gr3\nX3xFhws69GdMlCdEF9WRSWOpbOdKLEpzmcioRVwpHt5qYWob9vS6pFL6Tp7P\nEUh8ROPjqyFujh8Ogo9hp+LuAsxDpqzXE2dozazaWCsbejIoxmL0e502KyYL\n8ZhPGg49EcBx1BwczkQ0HucOXqMEmwEYE39nBdZEl6LJvjd3QA1WD1zBM/mO\nxLXL9TNmfpi3Wm7yLQ8UecSurUVgwlWT8CiAS8sEYhTx3Gd5juowvqI9Umpn\ncS0CFFybkjPkf6f8k6MU94JdDGUqXALCm9ykR50gkZqGr5K0vmmZdiVQoNoY\niOjpT0LWidHDuofOxSp2vsat1DRq8Y8aFT9jAz+WdvpmZa+7nPGgrWEXiNrP\niS0jA3go580ajOWD4d2kZkhZUW8IUgdasbKGtaF85JzeyOlQcBK39A7vqW98\nrFN3ngRqW+2WGnXXR9sBpzP3RMzcHU3h0xGSG3RZKIPpNneIy3Ip/nGLHefB\nsTa3OAUAbPrpYTDg70KTGZ5+IWeLXhwak7FBtL86X7ireaIW32jPgRdJT6/6\nEobZRqFYUPS4xvpNzjBt/UijUjpk5Loc73E+wCwcRYxFZvZ0Zo4J1neHXpIY\nxxqp\r\n=Z7XS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFVHaKOoVA49026m3Y765xK8DK7Ca7DRxKXzkCtYMOycAiA5QzcQTiK0Pfx+sCHa8RKp8gntJX/YUTfYxhuoReDOqQ=="}]},"maintainers":[{"name":"kai.wissler","email":"kai.wissler@virtual-identity.com"},{"name":"sheepfromheaven","email":"marcwissler@gmail.com"},{"name":"legendary.gates","email":"legendary.gates@gmail.com"},{"name":"timomayer","email":"timo.mayer@lan-force.de"}],"_npmUser":{"name":"kai.wissler","email":"kai.wissler@virtual-identity.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/storybook-addon-compiled-code_1.0.4_1591085502788_0.9213329174722273"},"_hasShrinkwrap":false}},"time":{"created":"2020-06-02T08:11:42.535Z","1.0.4":"2020-06-02T08:11:42.910Z","modified":"2022-04-04T18:54:05.914Z"},"maintainers":[{"email":"cesar.marques@virtual-identity.com","name":"ctmm"},{"email":"kai.wissler@virtual-identity.com","name":"kai.wissler"},{"email":"marcwissler@gmail.com","name":"sheepfromheaven"},{"email":"legendary.gates@gmail.com","name":"legendary.gates"},{"email":"timo.mayer@lan-force.de","name":"timomayer"}],"description":"Compiled code addon for storybook","homepage":"https://github.com/biotope/storybook-addon-compiled-code","keywords":["addon","storybook"],"repository":{"type":"git","url":"git+https://github.com/biotope/storybook-addon-compiled-code.git"},"bugs":{"url":"https://github.com/biotope/storybook-addon-compiled-code/issues"},"license":"MIT","readme":"# Storybook Compiled Code Addon\n\nThis addon is used to show the compiled code of stories in the addon panel.\n\n## Getting Started\n\nFirst, install the addon\n\n```sh\nyarn add @biotope/storybook-addon-compiled-code --dev\n```\n\nYou can add configuration for this addon by using a preset or by using the addon config with webpack\n\n### Install using preset\n\nAdd the following to your `.storybook/main.js` exports:\n\n```js\nmodule.exports = {\n  addons: ['@storybook/addon-compiled-code'],\n};\n```\n\nYou can pass configurations into the addon-compiled-code loader in your `.storybook/main.js` file, e.g.:\n\n```js\nmodule.exports = {\n  addons: [\n    {\n      name: '@storybook/addon-compiled-code',\n      options: {\n        rule: {\n          // test: [/\\.stories\\.jsx?$/], This is default\n          include: [path.resolve(__dirname, '../src')], // You can specify directories\n        },\n        loaderOptions: {\n          prettierConfig: { printWidth: 80, singleQuote: false },\n        },\n      },\n    },\n  ],\n};\n```\n\n## Loader Options\n\nThe loader can be customized with the following options:\n\n### parser\n\nThe parser that will be parsing your code to AST (based on [prettier](https://github.com/prettier/prettier/tree/master/src/language-js))\n\nAllowed values:\n\n- `javascript` - default\n- `typescript`\n- `flow`\n\nBe sure to update the regex test for the webpack rule if utilizing Typescript files.\n\nUsage:\n\n```js\nmodule.exports = function({ config }) {\n  config.module.rules.push({\n    test: /\\.stories\\.tsx?$/,\n    loaders: [\n      {\n        loader: require.resolve('@storybook/source-loader'),\n        options: { parser: 'typescript' },\n      },\n    ],\n    enforce: 'pre',\n  });\n\n  return config;\n};\n```\n\n### prettierConfig\n\nThe prettier configuration that will be used to format the story source in the addon panel.\n\nDefaults:\n\n```js\n{\n  printWidth: 100,\n  tabWidth: 2,\n  bracketSpacing: true,\n  trailingComma: 'es5',\n  singleQuote: true,\n}\n```\n\nUsage:\n\n```js\nmodule.exports = function({ config }) {\n  config.module.rules.push({\n    test: /\\.stories\\.jsx?$/,\n    loaders: [\n      {\n        loader: require.resolve('@storybook/source-loader'),\n        options: {\n          prettierConfig: {\n            printWidth: 100,\n            singleQuote: false,\n          },\n        },\n      },\n    ],\n    enforce: 'pre',\n  });\n\n  return config;\n};\n```\n\n### uglyCommentsRegex\n\nThe array of regex that is used to remove \"ugly\" comments.\n\nDefaults:\n\n```js\n[/^eslint-.*/, /^global.*/];\n```\n\nUsage:\n\n```js\nmodule.exports = function({ config }) {\n  config.module.rules.push({\n    test: /\\.stories\\.jsx?$/,\n    loaders: [\n      {\n        loader: require.resolve('@storybook/source-loader'),\n        options: {\n          uglyCommentsRegex: [/^eslint-.*/, /^global.*/],\n        },\n      },\n    ],\n    enforce: 'pre',\n  });\n\n  return config;\n};\n```\n\n### injectDecorator\n\nTell storysource whether you need inject decorator. If false, you need to add the decorator by yourself;\n\nDefaults: true\n\nUsage:\n\n```js\nmodule.exports = function({ config }) {\n  config.module.rules.push({\n    test: /\\.stories\\.jsx?$/,\n    loaders: [\n      {\n        loader: require.resolve('@storybook/source-loader'),\n        options: { injectDecorator: false },\n      },\n    ],\n    enforce: 'pre',\n  });\n\n  return config;\n};\n```\n\n## Theming\n\nCompiled Code will automatically use the light or dark syntax theme based on your storybook theme. See [Theming Storybook](https://storybook.js.org/docs/configurations/theming/) for more information.\n","readmeFilename":"README.md"}