Skip to content

Commit a5397d8

Browse files
committed
Continue TypeScript conversion
1 parent d06c09c commit a5397d8

File tree

126 files changed

+29289
-27905
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+29289
-27905
lines changed

.babelrc.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ module.exports = {
77
},
88
],
99
"@babel/preset-react",
10-
"@babel/preset-flow",
1110
],
1211
env: {
1312
test: {
@@ -21,9 +20,7 @@ module.exports = {
2120
},
2221
],
2322
"@babel/preset-react",
24-
"@babel/preset-flow",
2523
],
26-
plugins: ["require-context-hook"],
2724
},
2825
},
2926
};

.eslintrc.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@ module.exports = {
33
extends: [
44
"plugin:@thibaudcolas/eslint-plugin-cookbook/recommended",
55
"plugin:compat/recommended",
6-
"plugin:flowtype/recommended",
76
],
8-
plugins: ["flowtype"],
97
rules: {
10-
"flowtype/space-after-type-colon": [0],
11-
"flowtype/generic-spacing": [0],
128
"@thibaudcolas/cookbook/react/require-default-props": [
139
"error",
1410
{ forbidDefaultForRequired: false },

.flowconfig

Lines changed: 0 additions & 26 deletions
This file was deleted.

.githooks/pre-commit.6.lint.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,3 @@ if [ -n "$SCSS_STAGED" ];
99
then
1010
npx stylelint $SCSS_STAGED
1111
fi
12-
13-
FLOW_STAGED=$(grep -e '.flowconfig$' <<< "$STAGED" || true)
14-
15-
if [ -n "$JS_STAGED" ] || [ -n "$FLOW_STAGED" ];
16-
then
17-
npx flow
18-
fi

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ jobs:
88
test:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
12-
- uses: actions/setup-node@v2
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-node@v3
1313
with:
1414
node-version-file: .nvmrc
15-
- uses: actions/cache@v2
15+
- uses: actions/cache@v3
1616
with:
1717
path: ~/.npm
1818
key: ${{ runner.os }}-node-${{ hashFiles('**/.nvmrc') }}-${{ hashFiles('**/package-lock.json') }}
@@ -31,7 +31,7 @@ jobs:
3131
- uses: coverallsapp/github-action@master
3232
with:
3333
github-token: ${{ secrets.GITHUB_TOKEN }}
34-
- uses: actions/upload-artifact@v2
34+
- uses: actions/upload-artifact@v3
3535
with:
3636
name: reports
3737
path: public

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16
1+
18

.storybook/main.js

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
const fs = require("fs");
22
const path = require("path");
33
const webpack = require("webpack");
4-
const sass = require("sass");
54
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
65

7-
require("dotenv").config();
8-
96
const pkg = require("../package.json");
107

118
const examplesPath = path.join(__dirname, "..", "examples");
@@ -19,22 +16,34 @@ const SVG_ICONS = fs.readFileSync(
1916
const EMBEDLY_API_KEY_PROD = "d23c29a928fe4d89bda46b0291914c9c";
2017
const EMBEDLY_API_KEY = process.env.EMBEDLY_API_KEY || EMBEDLY_API_KEY_PROD;
2118

22-
const SENTRY_DSN_PROD =
23-
"https://[email protected]/251576";
24-
2519
module.exports = {
2620
stories: ["../examples/**/*.story.*"],
2721
framework: "@storybook/react",
22+
core: {
23+
builder: {
24+
name: "webpack5",
25+
options: {
26+
lazyCompilation: true,
27+
fsCache: true,
28+
},
29+
},
30+
disableTelemetry: true,
31+
},
2832
staticDirs: ["../public"],
2933
webpackFinal: (config, { configType }) => {
3034
const isProduction = configType === "PRODUCTION";
3135

32-
// See http://webpack.github.io/docs/configuration.html#devtool
3336
config.devtool = "source-map";
3437

38+
config.resolve.alias = {
39+
...config.resolve.alias,
40+
// "react-dom": path.resolve("..", "node_modules", "react-dom"),
41+
// "react-dom/client": path.resolve("..", "node_modules", "react-dom"),
42+
};
43+
3544
config.module.rules.push({
3645
test: /\.(scss|css)$/,
37-
loaders: ["style-loader", "css-loader", "sass-loader"],
46+
use: ["style-loader", "css-loader", "sass-loader"],
3847
include: path.resolve(__dirname, "../"),
3948
});
4049

@@ -46,7 +55,6 @@ module.exports = {
4655
),
4756
PKG_VERSION: JSON.stringify(pkg.version),
4857
SVG_ICONS: JSON.stringify(SVG_ICONS),
49-
SENTRY_DSN: JSON.stringify(isProduction ? SENTRY_DSN_PROD : ""),
5058
}),
5159
);
5260

.storybook/preview.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
import "../examples/main.scss";
2-
import "../examples/utils/polyfills";
32

43
const iconWrapper = document.createElement("div");
54
iconWrapper.innerHTML = SVG_ICONS;
65
document.body.appendChild(iconWrapper);
76

87
document.querySelector("html").setAttribute("lang", "en");
98

10-
if (SENTRY_DSN) {
11-
const Sentry = require("@sentry/browser");
12-
Sentry.init({
13-
dsn: SENTRY_DSN,
14-
release: PKG_VERSION,
15-
});
16-
}
17-
189
const consoleWarn = console.warn;
1910

2011
console.warn = function filterWarnings(msg, ...args) {

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Draftail aims for a mouse-free, keyboard-centric experience. Here are important
2020
- API to build custom controls for links, images, and more.
2121
- Compatibility with the [`draft-js-plugins`](https://www.draft-js-plugins.com) ecosystem to build more advanced extensions.
2222

23-
> This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html), and measures performance and [code coverage](https://coveralls.io/github/springload/draftail). It uses [Flow](https://flow.org/) types. We also try to follow accessibility best practices (tested with [aXe](https://www.axe-core.org/)) – please [get in touch](https://github.com/springload/draftail/issues/149#issuecomment-389476151) if you can help us do better in this area.
23+
> This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html), and measures performance and [code coverage](https://coveralls.io/github/springload/draftail). We also try to follow accessibility best practices (tested with [aXe](https://www.axe-core.org/)) – please [get in touch](https://github.com/springload/draftail/issues/149#issuecomment-389476151) if you can help us do better in this area.
2424
2525
## Documentation
2626

docs/CONTRIBUTING.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ nvm use
4848
npm run start
4949
# Runs linting.
5050
npm run lint
51-
# Start a Flow server for type errors.
52-
npx flow
5351
# Re-formats all of the files in the project (with Prettier).
5452
npm run format
5553
# Run tests in a watcher.

0 commit comments

Comments
 (0)