Skip to content

Commit 70b8b00

Browse files
authored
Merge pull request #70 from ShMcK/feature/emotion
Feature/emotion
2 parents 76aadee + 453d8ec commit 70b8b00

File tree

28 files changed

+2731
-826
lines changed

28 files changed

+2731
-826
lines changed

‎.eslintrc.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ module.exports = {
1515
'@typescript-eslint/no-explicit-any': 'off',
1616
'@typescript-eslint/ban-ts-ignore': 'off',
1717
'@typescript-eslint/no-unused-vars': 'off',
18-
'@typescript-eslint/camelcase': 'off',
18+
'@typescript-eslint/camelcase': 'off',
19+
// 'react/forbid-component-props': [1, { forbid: ['style'] }],
20+
// 'react/forbid-dom-props': [1, { forbid: ['style'] }],
1921
},
20-
};
22+
}

‎.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"editor.formatOnSave": true,
33
"editor.codeActionsOnSave": {
4-
"source.organizeImports": true,
4+
"source.organizeImports": false,
55
"source.fixAll": true
66
},
77
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],

‎src/webview/render.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,12 @@ async function render(panel: vscode.WebviewPanel, rootPath: string) {
6666
cspMeta.httpEquiv = 'Content-Security-Policy'
6767
cspMeta.content =
6868
[
69+
`default-src 'self'`,
70+
`connect-src https: http:`,
6971
`font-src ${panel.webview.cspSource} http: https: data:`,
7072
`img-src ${panel.webview.cspSource} https:`,
7173
`script-src ${nonces.map(nonce => `'nonce-${nonce}'`).join(' ')} data:`,
72-
`style-src ${panel.webview.cspSource} https:`,
74+
`style-src ${panel.webview.cspSource} https: 'self' 'unsafe-inline'`,
7375
].join('; ') + ';'
7476
document.head.appendChild(cspMeta)
7577

‎web-app/.storybook/.babelrc

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

‎web-app/.storybook/webpack.config.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,38 @@
11
const path = require('path')
2+
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
23

34
// see typescript setup
45
// https://storybook.js.org/docs/configurations/typescript-config/
56
module.exports = ({ config }) => {
67
config.module.rules.push({
78
test: /\.scss$/,
8-
use: ['style-loader', 'css-loader', 'sass-loader'],
9+
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader'],
910
include: path.resolve(__dirname, '../'),
1011
})
1112
config.module.rules.push({
1213
test: /\.(ts|tsx)$/,
1314
loader: require.resolve('babel-loader'),
1415
options: {
15-
presets: [['react-app', { flow: false, typescript: true }]],
16+
plugins: [
17+
[
18+
'babel-plugin-import',
19+
{
20+
libraryName: '@alifd/next',
21+
style: true,
22+
},
23+
],
24+
],
25+
presets: [
26+
// react-app
27+
['react-app', { flow: false, typescript: true }],
28+
// allow emotion css prop on html
29+
['@emotion/babel-preset-css-prop'],
30+
],
1631
},
1732
})
33+
34+
config.plugins.push(new MiniCssExtractPlugin({ filename: '[name].css' }))
35+
1836
config.resolve.extensions.push('.ts', '.tsx')
1937

2038
config.resolve.modules = ['node_modules', path.resolve(__dirname, '../src')]

‎web-app/.vscode/settings.json

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,20 @@
1111
},
1212
// styles
1313
"workbench.colorCustomizations": {
14-
"activityBar.background": "#000000",
14+
"activityBar.background": "#1a1a1a",
15+
"activityBar.activeBorder": "#606020",
16+
"activityBar.foreground": "#e7e7e7",
17+
"activityBar.inactiveForeground": "#e7e7e799",
18+
"activityBarBadge.background": "#606020",
19+
"activityBarBadge.foreground": "#e7e7e7",
1520
"titleBar.activeBackground": "#000000",
16-
"titleBar.activeForeground": "#FFFFFF"
17-
}
21+
"titleBar.inactiveBackground": "#00000099",
22+
"titleBar.activeForeground": "#e7e7e7",
23+
"titleBar.inactiveForeground": "#e7e7e799",
24+
"statusBar.background": "#000000",
25+
"statusBarItem.hoverBackground": "#1a1a1a",
26+
"statusBar.foreground": "#e7e7e7"
27+
},
28+
"peacock.color": "#000000"
1829
}
1930

‎web-app/config-overrides.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/* eslint-disable @typescript-eslint/no-var-requires */
2+
const path = require('path')
3+
const { addBabelPreset, addBabelPlugin, addWebpackModuleRule } = require('customize-cra')
4+
5+
module.exports = function override(config) {
6+
addWebpackModuleRule({
7+
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
8+
use: [
9+
{
10+
loader: 'file-loader',
11+
options: {
12+
name: '[name].[ext]',
13+
outputPath: 'fonts/',
14+
},
15+
},
16+
],
17+
})(config)
18+
19+
// load @alifd/next component css
20+
addBabelPlugin([
21+
'babel-plugin-import',
22+
{
23+
libraryName: '@alifd/next',
24+
style: true,
25+
},
26+
])(config)
27+
28+
// setup emotion styles
29+
addBabelPreset('@emotion/babel-preset-css-prop')(config)
30+
31+
return config
32+
}

0 commit comments

Comments
 (0)