Skip to content

Commit

Permalink
Feature: Init @storybook/addon-webpack5-compiler-babel
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinpalkovic committed Jan 3, 2024
1 parent 35b040a commit 5ab111e
Show file tree
Hide file tree
Showing 16 changed files with 7,472 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Code quality

on:
push:
pull_request:

jobs:
quality:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Biome
uses: biomejs/setup-biome@v1
with:
version: latest
- name: Run Biome
run: biome ci .
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["biomejs.biome"]
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
}
}
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @valentinpalkovic
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Storybook contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# @storybook/addon-webpack5-compiler-babel

This addon adds babel support to Storybook's webpack5 compiler. It adds the babel-loader to the webpack config and sets the `babel-loader` as the default loader for JavaScript and TypeScript files.

## Installation

```sh
npm install --save-dev @storybook/addon-webpack5-compiler-babel
```

## Usage

```js
// .storybook/main.js

const config = {
addons: ["@storybook/addon-webpack5-compiler-babel"],
};

export default config;
```
15 changes: 15 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://biomejs.dev/schemas/1.4.1/schema.json",
"organizeImports": {
"enabled": true
},
"files": {
"include": ["src/**/*.ts"]
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
}
}
68 changes: 68 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"name": "@storybook/addon-webpack5-compiler-babel",
"version": "1.0.0",
"type": "module",
"description": "Adds babel as a Webpack5 compiler to Storybook",
"keywords": [
"storybook-addons",
"webpack5",
"babel"
],
"repository": {
"type": "git",
"url": "https://github.com/storybookjs/addon-webpack5-compiler-babel"
},
"scripts": {
"build": "tsup",
"format": "biome format ./src",
"format:write": "pnpm format --write",
"check": "biome check --apply ./src",
"check:apply": "pnpm check --apply",
"check:apply-unsafe": "pnpm check --apply-unsafe"
},
"exports": {
".": {
"require": "./dist/index.cjs",
"import": "./dist/index.js"
},
"./preset": {
"require": "./dist/preset.cjs",
"import": "./dist/preset.js"
},
"./package.json": "./package.json"
},
"main": "dist/esm/preset.js",
"files": [
"dist/**/*",
"src/**/*",
"README.md"
],
"license": "MIT",
"publishConfig": {
"access": "public"
},
"storybook": {
"displayName": "Addon Webpack5 Compiler Babel",
"supportedFrameworks": [
"react",
"preact",
"vue",
"web-components",
"html",
"svelte"
]
},
"dependencies": {
"@storybook/core-common": "next"
},
"devDependencies": {
"@biomejs/biome": "^1.4.1",
"@storybook/types": "next",
"tsup": "^8.0.1",
"typescript": "^5.3.3",
"webpack": "^5.89.0"
},
"engines": {
"node": ">=18"
}
}
Loading

0 comments on commit 5ab111e

Please sign in to comment.