Skip to content

Commit cd858a6

Browse files
authored
feat: add ui devtools #30
feat: add ui devtools
2 parents 7816cce + a31a8a2 commit cd858a6

File tree

109 files changed

+24541
-313
lines changed

Some content is hidden

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

109 files changed

+24541
-313
lines changed

.babelrc.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"sourceType": "unambiguous",
3+
"presets": [
4+
[
5+
"@babel/preset-env",
6+
{
7+
"targets": {
8+
"chrome": 100
9+
}
10+
}
11+
],
12+
"@babel/preset-typescript",
13+
"@babel/preset-react"
14+
],
15+
"plugins": []
16+
}

.eslintignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ dist
22
node_modules
33
build
44
.eslintrc.js
5-
coverage
5+
coverage
6+
react-shim.js
7+
__mocks__/styleMock.js

.eslintrc.js

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module.exports = {
99
'plugin:react-hooks/recommended',
1010
'plugin:import/recommended',
1111
'plugin:import/typescript',
12+
'plugin:storybook/recommended',
1213
],
1314
plugins: [
1415
'@typescript-eslint',
@@ -25,34 +26,50 @@ module.exports = {
2526
es6: true,
2627
},
2728
parserOptions: {
29+
project: './tsconfig.json',
2830
ecmaVersion: 2018,
2931
sourceType: 'module',
30-
ecmaFeatures: {
31-
jsx: true,
32-
},
3332
},
3433
rules: {
3534
eqeqeq: 'error',
3635
'no-var': 'error',
3736
'prefer-const': 'error',
3837
curly: ['warn', 'multi-line', 'consistent'],
39-
'no-console': 'off',
40-
'import/no-unresolved': ['error', { commonjs: true, amd: true }],
38+
'no-console': ['error', { allow: ['warn', 'info', 'error'] }],
39+
'import/no-unresolved': [
40+
'error',
41+
{
42+
commonjs: true,
43+
amd: true,
44+
},
45+
],
4146
'import/export': 'error',
4247
'@typescript-eslint/no-duplicate-imports': ['error'],
4348
'@typescript-eslint/explicit-module-boundary-types': 'off',
4449
'@typescript-eslint/no-unused-vars': [
4550
'warn',
46-
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
51+
{
52+
argsIgnorePattern: '^_',
53+
varsIgnorePattern: '^_',
54+
},
4755
],
4856
'@typescript-eslint/no-use-before-define': 'off',
4957
'@typescript-eslint/no-empty-function': 'off',
5058
'@typescript-eslint/no-explicit-any': 'off',
51-
'jest/consistent-test-it': ['error', { fn: 'it', withinDescribe: 'it' }],
59+
'jest/consistent-test-it': [
60+
'error',
61+
{
62+
fn: 'it',
63+
withinDescribe: 'it',
64+
},
65+
],
5266
'import/order': [
5367
'error',
5468
{
55-
alphabetize: { order: 'asc', caseInsensitive: true },
69+
alphabetize: {
70+
order: 'asc',
71+
caseInsensitive: true,
72+
},
5673
groups: [
5774
'builtin',
5875
'external',
@@ -73,8 +90,9 @@ module.exports = {
7390
pathGroupsExcludedImportTypes: ['builtin'],
7491
},
7592
],
76-
'react/jsx-uses-react': 'off',
77-
'react/react-in-jsx-scope': 'off',
93+
// Disable it until we start supporting `react-jsx` again.
94+
// 'react/jsx-uses-react': 'off',
95+
// 'react/react-in-jsx-scope': 'off',
7896
'sort-imports': [
7997
'error',
8098
{

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18.13.0
1+
16.13.2

.storybook/main.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { StorybookConfig } from '@storybook/react-webpack5';
2+
3+
const webpack = require('webpack');
4+
const config: StorybookConfig = {
5+
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
6+
addons: [
7+
'@storybook/addon-links',
8+
'@storybook/addon-essentials',
9+
'@storybook/addon-interactions',
10+
'@storybook/addon-a11y',
11+
],
12+
framework: {
13+
name: '@storybook/react-webpack5',
14+
options: {},
15+
},
16+
docs: {
17+
autodocs: true,
18+
},
19+
typescript: {
20+
reactDocgen: 'react-docgen-typescript',
21+
reactDocgenTypescriptOptions: {
22+
compilerOptions: {
23+
allowSyntheticDefaultImports: false,
24+
esModuleInterop: false,
25+
},
26+
},
27+
},
28+
core: {
29+
disableTelemetry: true, // 👈 Disables telemetry
30+
enableCrashReports: false, // 👈 Appends the crash reports to the telemetry events
31+
},
32+
webpackFinal: async (config, { configType }) => {
33+
// `configType` has a value of 'DEVELOPMENT' or 'PRODUCTION'
34+
// You can change the configuration based on that.
35+
// 'PRODUCTION' is used when building the static version of storybook.
36+
37+
config?.plugins?.push(
38+
new webpack.DefinePlugin({
39+
__DEV__: configType === 'DEVELOPMENT',
40+
}),
41+
);
42+
43+
// Return the altered config
44+
return config;
45+
},
46+
};
47+
48+
export default config;

.storybook/preview.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export const parameters = {
2+
actions: { argTypesRegex: '^on[A-Z].*' },
3+
controls: {
4+
matchers: {
5+
color: /(background|color)$/i,
6+
date: /Date$/,
7+
},
8+
},
9+
};

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
3+
}

.vscode/settings.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"[javascript,typescript]": {
4+
"editor.defaultFormatter": "esbenp.prettier-vscode"
5+
},
6+
"files.autoSave": "onFocusChange",
7+
"editor.smoothScrolling": true,
8+
"eslint.validate": [
9+
"javascript",
10+
"javascriptreact",
11+
"typescript",
12+
"typescriptreact"
13+
],
14+
"editor.codeActionsOnSave": {
15+
"source.fixAll.eslint": true
16+
}
17+
}

CHANGELOG.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,61 @@
1+
# [0.3.0-next.4](https://github.com/jotai-labs/jotai-devtools/compare/v0.3.0-next.3...v0.3.0-next.4) (2023-03-02)
2+
3+
### Bug Fixes
4+
5+
- bundle in fonts for better stability
6+
([236cd75](https://github.com/jotai-labs/jotai-devtools/commit/236cd75c82add160635b0ded2fa2e0bfadc60e71))
7+
- fonts css
8+
([be8c16c](https://github.com/jotai-labs/jotai-devtools/commit/be8c16ccab78a0b9153b2a6c655d4f840547c73c))
9+
- use JetBrains mono fonts on NavLink
10+
([68cbe5a](https://github.com/jotai-labs/jotai-devtools/commit/68cbe5a4427ed1b5ea1bb968c1554a50f5ce1127))
11+
12+
### Features
13+
14+
- add option to display private atoms
15+
([d1875ee](https://github.com/jotai-labs/jotai-devtools/commit/d1875ee58ca2faa49512e30d1efc17f10b93de3b))
16+
17+
# [0.3.0-next.3](https://github.com/jotai-labs/jotai-devtools/compare/v0.3.0-next.2...v0.3.0-next.3) (2023-02-17)
18+
19+
### Bug Fixes
20+
21+
- infer options type from Jotai
22+
([8ddad63](https://github.com/jotai-labs/jotai-devtools/commit/8ddad63821ce825b8871a14e7a6cc37eb2c93622))
23+
- use exactOptionalPropertyTypes
24+
([6c9cbdf](https://github.com/jotai-labs/jotai-devtools/commit/6c9cbdffa020e9f15e1e0198d18eefae0b2e4f28))
25+
26+
### Features
27+
28+
- add custom style nonce + remove global normalized styles
29+
([10d3c4a](https://github.com/jotai-labs/jotai-devtools/commit/10d3c4a93494bd27fc16d1607cc42ea3f2e00ae4))
30+
31+
# [0.3.0-next.2](https://github.com/jotai-labs/jotai-devtools/compare/v0.3.0-next.1...v0.3.0-next.2) (2023-02-12)
32+
33+
### Features
34+
35+
- add error boundary
36+
([5667a05](https://github.com/jotai-labs/jotai-devtools/commit/5667a059da325ee8d0452e5d097d4eb14ab97c5e))
37+
38+
# [0.3.0-next.1](https://github.com/jotai-labs/jotai-devtools/compare/v0.3.0-next.0...v0.3.0-next.1) (2023-02-10)
39+
40+
### Bug Fixes
41+
42+
- handle atom containing undefined values
43+
([c086a75](https://github.com/jotai-labs/jotai-devtools/commit/c086a75ed92066c78a3d42f5b3e5b924576bbee5))
44+
- inject react shim to the build
45+
([a20a235](https://github.com/jotai-labs/jotai-devtools/commit/a20a2355b08193fc4f8cde6dec85602ead7229df))
46+
47+
### Features
48+
49+
- make raw and parse value copyable
50+
([5348337](https://github.com/jotai-labs/jotai-devtools/commit/5348337530177f8db80e53d0d35e339cd78ad84c))
51+
52+
# [0.3.0-next.0](https://github.com/jotai-labs/jotai-devtools/compare/v0.2.0...v0.3.0-next.0) (2023-02-07)
53+
54+
### Features
55+
56+
- **ui-devtools:** initial commit
57+
([7c38133](https://github.com/jotai-labs/jotai-devtools/commit/7c38133a360c0c97db6406becdc1bf939e1001e7))
58+
159
# [0.2.0](https://github.com/jotai-labs/jotai-devtools/compare/v0.2.0-next.1...v0.2.0) (2023-02-01)
260

361
# [0.2.0-next.1](https://github.com/jotai-labs/jotai-devtools/compare/v0.2.0-next.0...v0.2.0-next.1) (2023-01-17)

0 commit comments

Comments
 (0)