generator-reackt 0.5.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.prettierrc +1 -1
- package/.stylelintrc +3 -102
- package/LICENSE +17 -5
- package/README.md +4 -2
- package/generators/app/index.js +1 -1
- package/generators/component/index.js +1 -1
- package/generators/module/index.js +1 -1
- package/generators/util/fs.js +1 -1
- package/package.json +53 -39
- package/templates/app/.lintstagedrc +1 -1
- package/templates/app/.prettierrc +1 -1
- package/templates/app/.storybook/main.ts +19 -0
- package/templates/app/.storybook/preview.ts +36 -0
- package/templates/app/.stylelintrc +2 -268
- package/templates/app/.yarnrc.yml +3 -0
- package/templates/app/_eslint.config.mjs +51 -0
- package/templates/app/{package.json → _package.json} +2 -2
- package/templates/app/_stories/SuspenseFallback.stories.tsx +17 -0
- package/templates/app/gitignore +1 -0
- package/templates/app/jest.config.js +1 -1
- package/templates/app/src/components/ErrorBoundary.tsx +45 -0
- package/templates/app/src/components/Layout.tsx +142 -0
- package/templates/app/src/components/SuspenseFallback.tsx +96 -0
- package/templates/app/src/{index.scss → index.nscss} +8 -7
- package/templates/app/src/index.tsx +60 -0
- package/templates/app/src/pages/index.tsx +3 -0
- package/templates/app/src/reducers/application.ts +36 -0
- package/templates/app/src/reducers/{index.js → index.ts} +1 -0
- package/templates/app/src/sagas/application.ts +9 -0
- package/templates/app/src/sagas/{index.js → index.ts} +1 -0
- package/templates/app/src/selectors/application.test.ts +18 -0
- package/templates/app/src/selectors/application.ts +6 -0
- package/templates/app/src/types/globals.d.ts +1 -0
- package/templates/app/src/types/index.ts +11 -0
- package/templates/app/src/utils/{index.js → index.ts} +3 -3
- package/templates/app/tsconfig.json +18 -0
- package/templates/app/webpack.config.nts +121 -0
- package/templates/component/index.stories.tsx +14 -0
- package/templates/component/{index.js → index.tsx} +2 -5
- package/generators/es.regexp.flags-ccfbed60.js +0 -1
- package/templates/app/.babelrc +0 -9
- package/templates/app/.eslintrc.js +0 -185
- package/templates/app/.storybook/addons.js +0 -1
- package/templates/app/.storybook/config.js +0 -14
- package/templates/app/.storybook/webpack.config.babel.js +0 -7
- package/templates/app/jsconfig.json +0 -8
- package/templates/app/src/components/App.js +0 -14
- package/templates/app/src/icons.js +0 -4
- package/templates/app/src/index.js +0 -50
- package/templates/app/src/reducers/application.js +0 -21
- package/templates/app/src/sagas/application.js +0 -9
- package/templates/app/src/selectors/application.js +0 -1
- package/templates/app/src/selectors/application.test.js +0 -13
- package/templates/app/webpack.config.babel.js +0 -103
- /package/templates/component/{index.test.js → index.test.tsx} +0 -0
- /package/templates/module/reducer/{index.test.js → index.test.ts} +0 -0
- /package/templates/module/reducer/{index.js → index.ts} +0 -0
- /package/templates/module/saga/{index.test.js → index.test.ts} +0 -0
- /package/templates/module/saga/{index.js → index.ts} +0 -0
- /package/templates/module/selector/{index.js → index.test.ts} +0 -0
- /package/templates/module/selector/{index.test.js → index.ts} +0 -0
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { buildActions } from 'utils';
|
|
2
|
-
|
|
3
|
-
export const types = buildActions('application', ['INIT_APP']);
|
|
4
|
-
|
|
5
|
-
const initApp = () => ({
|
|
6
|
-
type: types.INIT_APP
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
export const actions = {
|
|
10
|
-
initApp
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const initialState = {};
|
|
14
|
-
|
|
15
|
-
export const reducer = (state = initialState, action = {}) => {
|
|
16
|
-
switch (action.type) {
|
|
17
|
-
default:
|
|
18
|
-
return state;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const getApplication = state => state.application;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { getApplication } from './application';
|
|
2
|
-
|
|
3
|
-
describe('application selectors', () => {
|
|
4
|
-
const state = {
|
|
5
|
-
application: {
|
|
6
|
-
test: true
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
it('getApplication', () => {
|
|
11
|
-
expect(getApplication(state)).toBe(state.application);
|
|
12
|
-
});
|
|
13
|
-
});
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { resolve } from 'path';
|
|
2
|
-
import HtmlPlugin from 'html-webpack-plugin';
|
|
3
|
-
import ESLintPlugin from 'eslint-webpack-plugin';
|
|
4
|
-
import TerserPlugin from 'terser-webpack-plugin';
|
|
5
|
-
import StylelintPlugin from 'stylelint-webpack-plugin';
|
|
6
|
-
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
7
|
-
import { CleanWebpackPlugin as CleanPlugin } from 'clean-webpack-plugin';
|
|
8
|
-
import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';
|
|
9
|
-
|
|
10
|
-
const dev = process.env.NODE_ENV === 'development';
|
|
11
|
-
|
|
12
|
-
const plugins = [
|
|
13
|
-
new CleanPlugin(),
|
|
14
|
-
new StylelintPlugin({
|
|
15
|
-
configFile: '.stylelintrc',
|
|
16
|
-
context: 'src',
|
|
17
|
-
files: '**/*.scss',
|
|
18
|
-
failOnError: true,
|
|
19
|
-
quiet: false,
|
|
20
|
-
customSyntax: 'postcss-scss'
|
|
21
|
-
}),
|
|
22
|
-
new HtmlPlugin({
|
|
23
|
-
template: './src/index.html'
|
|
24
|
-
}),
|
|
25
|
-
new ESLintPlugin(),
|
|
26
|
-
new MiniCssExtractPlugin()
|
|
27
|
-
];
|
|
28
|
-
|
|
29
|
-
export default {
|
|
30
|
-
mode: dev ? 'development' : 'production',
|
|
31
|
-
devtool: dev ? 'eval-cheap-module-source-map' : 'cheap-module-source-map',
|
|
32
|
-
entry: './src/index.js',
|
|
33
|
-
devServer: {
|
|
34
|
-
compress: dev,
|
|
35
|
-
open: true,
|
|
36
|
-
historyApiFallback: true,
|
|
37
|
-
hot: dev,
|
|
38
|
-
port: 9000
|
|
39
|
-
},
|
|
40
|
-
module: {
|
|
41
|
-
rules: [
|
|
42
|
-
{
|
|
43
|
-
test: /\.js$/,
|
|
44
|
-
exclude: /node_modules/,
|
|
45
|
-
use: ['babel-loader']
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
test: /\.(sa|sc|c)ss$/,
|
|
49
|
-
use: [
|
|
50
|
-
MiniCssExtractPlugin.loader,
|
|
51
|
-
'css-loader',
|
|
52
|
-
{
|
|
53
|
-
loader: 'postcss-loader',
|
|
54
|
-
options: {
|
|
55
|
-
postcssOptions: {
|
|
56
|
-
ident: 'postcss',
|
|
57
|
-
plugins: [
|
|
58
|
-
require('autoprefixer'),
|
|
59
|
-
require('postcss-flexbugs-fixes')
|
|
60
|
-
]
|
|
61
|
-
},
|
|
62
|
-
sourceMap: dev
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
'sass-loader'
|
|
66
|
-
]
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
test: /\.html$/,
|
|
70
|
-
use: [
|
|
71
|
-
{
|
|
72
|
-
loader: 'html-loader',
|
|
73
|
-
options: { minimize: true }
|
|
74
|
-
}
|
|
75
|
-
]
|
|
76
|
-
}
|
|
77
|
-
]
|
|
78
|
-
},
|
|
79
|
-
output: {
|
|
80
|
-
path: resolve(__dirname, 'dist'),
|
|
81
|
-
filename: 'main.js',
|
|
82
|
-
chunkFilename: '[name].js'
|
|
83
|
-
},
|
|
84
|
-
plugins,
|
|
85
|
-
resolve: {
|
|
86
|
-
extensions: ['.js', '.json'],
|
|
87
|
-
modules: ['node_modules', 'src'],
|
|
88
|
-
alias: {
|
|
89
|
-
components: resolve(__dirname, 'src/components'),
|
|
90
|
-
utils: resolve(__dirname, 'src/utils')
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
optimization: {
|
|
94
|
-
minimizer: [
|
|
95
|
-
new TerserPlugin({
|
|
96
|
-
terserOptions: {
|
|
97
|
-
ecma: 12
|
|
98
|
-
}
|
|
99
|
-
}),
|
|
100
|
-
new CssMinimizerPlugin()
|
|
101
|
-
]
|
|
102
|
-
}
|
|
103
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|