Skip to content

Commit 757bfa3

Browse files
committed
chore: Move to Storybook to show off editor capabilities and local development
1 parent 96e5028 commit 757bfa3

13 files changed

+6505
-1094
lines changed

.storybook/main.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
"stories": [
3+
"../src/**/*.stories.mdx",
4+
"../src/**/*.stories.@(js|jsx|ts|tsx)"
5+
],
6+
"addons": [
7+
"@storybook/addon-links",
8+
"@storybook/addon-essentials"
9+
]
10+
}

.storybook/preview.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
export const parameters = {
3+
layout: "padded",
4+
actions: { argTypesRegex: "^on[A-Z].*" },
5+
}

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ This project uses [yarn](https://yarnpkg.com) to manage dependencies. You can us
299299
yarn install
300300
```
301301

302-
When running in development [webpack-serve](https://github.com/webpack-contrib/webpack-serve) is included to serve an example editor with hot reloading. After installing dependencies run `yarn start` to get going.
302+
When running in development Storybook is included to example editors with hot reloading. After installing dependencies run `yarn start` to get going.
303303

304304
When developing using `yarn link`, you can use `yarn watch` to continuously rebuild on change into `dist` as you make changes.
305305

example/dist/index.html

-27
This file was deleted.

example/src/index.js

-215
This file was deleted.

example/webpack.config.js

-35
This file was deleted.

package.json

+10-6
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
"scripts": {
1010
"test": "echo \"Error: no test specified\" && exit 1",
1111
"lint": "tsc --noEmit && eslint '*/**/*.{js,ts,tsx}' --quiet",
12-
"start": "webpack-serve --config example/webpack.config.js --port 9000",
12+
"start": "start-storybook -p 6006",
1313
"build": "tsc",
1414
"prepublish": "yarn build",
15-
"watch": "yarn tsc-watch"
15+
"watch": "yarn tsc-watch",
16+
"build-storybook": "build-storybook"
1617
},
1718
"serve": {
1819
"open": true,
@@ -51,6 +52,11 @@
5152
"styled-components": "^5.0.0"
5253
},
5354
"devDependencies": {
55+
"@babel/core": "^7.12.16",
56+
"@storybook/addon-actions": "^6.1.17",
57+
"@storybook/addon-essentials": "^6.1.17",
58+
"@storybook/addon-links": "^6.1.17",
59+
"@storybook/react": "^6.1.17",
5460
"@types/lodash": "^4.14.149",
5561
"@types/markdown-it": "^10.0.1",
5662
"@types/prosemirror-commands": "^1.0.1",
@@ -70,6 +76,7 @@
7076
"@types/styled-components": "^4.4.2",
7177
"@typescript-eslint/eslint-plugin": "^4.0.0",
7278
"@typescript-eslint/parser": "^4.0.0",
79+
"babel-loader": "^8.2.2",
7380
"eslint": "^7.13.0",
7481
"eslint-config-prettier": "^6.15.0",
7582
"eslint-config-react-app": "^6.0.0",
@@ -85,10 +92,7 @@
8592
"source-map-loader": "^0.2.4",
8693
"styled-components": "^5.2.1",
8794
"ts-loader": "^6.2.1",
88-
"tsc-watch": "^4.2.9",
89-
"webpack": "^4.29.6",
90-
"webpack-cli": "^3.2.3",
91-
"webpack-serve": "^3.2.0"
95+
"tsc-watch": "^4.2.9"
9296
},
9397
"resolutions": {
9498
"yargs-parser": "^15.0.1"

src/nodes/CodeFence.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export default class CodeFence extends Node {
107107
return () => setBlockType(type);
108108
}
109109

110-
keys({ type, schema }) {
110+
keys({ type }) {
111111
return {
112112
"Shift-Ctrl-\\": setBlockType(type),
113113
"Shift-Enter": (state, dispatch) => {

src/nodes/ListItem.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default class ListItem extends Node {
2121
};
2222
}
2323

24-
keys({ type, schema }) {
24+
keys({ type }) {
2525
return {
2626
Enter: splitListItem(type),
2727
Tab: sinkListItem(type),

0 commit comments

Comments
 (0)