mirror of https://github.com/alibaba/ice.git
chore: bump dependencies version (#4034)
* chore: update typescript version * chore: bump version * fix: remove css-hot-loader * fix: eslint * fix: mini-css-extract-plugin params * fix: example lint * fix: example lint
This commit is contained in:
parent
7fb3749e4f
commit
b9afe83e2a
|
@ -26,11 +26,16 @@ const jsRules = deepmerge(eslint, {
|
|||
const tsRules = deepmerge(tslint, {
|
||||
rules: {
|
||||
...commonRules,
|
||||
"@typescript-eslint/ban-ts-ignore": 0,
|
||||
"@typescript-eslint/ban-types": 0,
|
||||
"@typescript-eslint/ban-ts-comment": 0,
|
||||
"@typescript-eslint/no-explicit-any": 0,
|
||||
"@typescript-eslint/interface-name-prefix": 0,
|
||||
"@typescript-eslint/explicit-function-return-type": 0,
|
||||
"@typescript-eslint/no-var-requires": 0
|
||||
"@typescript-eslint/no-var-requires": 0,
|
||||
"@typescript-eslint/explicit-module-boundary-types": 0,
|
||||
"no-use-before-define": 0,
|
||||
"no-unused-vars": 0,
|
||||
"@typescript-eslint/no-unused-vars": 1,
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
@ -37,5 +37,8 @@ packages/*/lib/
|
|||
# temp folder .ice
|
||||
examples/*/.ice
|
||||
|
||||
# temp file of test
|
||||
packages/webpack-plugin-extract-css-assets/test/actual/*
|
||||
|
||||
build
|
||||
.history
|
||||
|
|
|
@ -4,6 +4,6 @@ function Auth({ children, hasAuth, fallback }) {
|
|||
} else {
|
||||
return fallback || null;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export default Auth;
|
||||
|
|
|
@ -3,7 +3,7 @@ import modelAbout from './model';
|
|||
|
||||
interface IAppStoreModels extends IStoreModels {
|
||||
about: typeof modelAbout;
|
||||
};
|
||||
}
|
||||
|
||||
const appModels: IAppStoreModels = {
|
||||
about: modelAbout
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
// config runtime APP_MODE
|
||||
// @ts-ignore
|
||||
window.__app_mode__ = 'build';
|
||||
|
|
|
@ -2,7 +2,7 @@ import { IRootDispatch, APP_MODE } from 'ice';
|
|||
|
||||
console.log('APP_MODE:', APP_MODE);
|
||||
|
||||
export const delay = (time) => new Promise((resolve) => setTimeout(() => resolve(), time));
|
||||
export const delay = (time) => new Promise<void>((resolve) => setTimeout(() => resolve(), time));
|
||||
|
||||
export default {
|
||||
state: {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { IRootDispatch } from 'ice';
|
||||
|
||||
export const delay = (time) => new Promise((resolve) => setTimeout(() => resolve(), time));
|
||||
export const delay = (time) => new Promise<void>((resolve) => setTimeout(() => resolve(), time));
|
||||
|
||||
export default {
|
||||
state: {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const delay = (time) => new Promise((resolve) => setTimeout(() => resolve(), time));
|
||||
const delay = (time) => new Promise<void>((resolve) => setTimeout(() => resolve(), time));
|
||||
|
||||
export default {
|
||||
state: {
|
||||
|
|
|
@ -6,7 +6,7 @@ class Text extends React.PureComponent {
|
|||
return (
|
||||
<div>Text</div>
|
||||
);
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export default Text;
|
||||
|
|
14
package.json
14
package.json
|
@ -40,6 +40,7 @@
|
|||
"@ice/spec": "^1.0.0",
|
||||
"@testing-library/react-hooks": "^3.2.1",
|
||||
"@types/jest": "^25.2.1",
|
||||
"@types/node": "^14.14.21",
|
||||
"@types/puppeteer": "^5.4.2",
|
||||
"ali-oss": "^6.7.0",
|
||||
"codecov": "^3.6.5",
|
||||
|
@ -53,7 +54,7 @@
|
|||
"glob": "^7.1.6",
|
||||
"husky": "^3.1.0",
|
||||
"ice-npm-utils": "^2.0.1",
|
||||
"jest": "^25.4.0",
|
||||
"jest": "^26.0.0",
|
||||
"lerna": "^3.16.4",
|
||||
"mark-twain": "^2.0.3",
|
||||
"nodejieba": "^2.4.1",
|
||||
|
@ -65,12 +66,17 @@
|
|||
"rimraf": "^3.0.0",
|
||||
"semver": "^7.3.2",
|
||||
"simple-git": "^1.132.0",
|
||||
"ts-jest": "^25.4.0",
|
||||
"ts-node": "^8.6.1",
|
||||
"typescript": "^3.7.4"
|
||||
"ts-jest": "^26.0.0",
|
||||
"ts-node": "^9.0.0",
|
||||
"typescript": "^4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"core-js": "^3.6.4",
|
||||
"path-to-regexp": "6.1.0"
|
||||
},
|
||||
"resolutions": {
|
||||
"@typescript-eslint/eslint-plugin": "^4.0.0",
|
||||
"@typescript-eslint/parser": "^4.0.0",
|
||||
"@typescript-eslint/typescript-estree": "^4.0.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,13 @@ import * as fse from 'fs-extra';
|
|||
import { parse } from '@babel/parser';
|
||||
import traverse from '@babel/traverse';
|
||||
|
||||
function parseCode(code) {
|
||||
return parse(code, {
|
||||
sourceType: 'module',
|
||||
plugins: ['jsx', 'typescript', 'decorators-legacy', 'dynamicImport', 'classProperties'],
|
||||
});
|
||||
}
|
||||
|
||||
function checkExportDefaultDeclarationExists(sourcePath: string) {
|
||||
if (!fse.existsSync(sourcePath)) {
|
||||
const ext = ['.ts', '.js', '.tsx', '.jsx'].find((extension) => fse.existsSync(`${sourcePath}${extension}`));
|
||||
|
@ -23,11 +30,4 @@ function checkExportDefaultDeclarationExists(sourcePath: string) {
|
|||
return exportDefaultDeclarationExists;
|
||||
}
|
||||
|
||||
function parseCode(code) {
|
||||
return parse(code, {
|
||||
sourceType: 'module',
|
||||
plugins: ['jsx', 'typescript', 'decorators-legacy', 'dynamicImport', 'classProperties'],
|
||||
});
|
||||
}
|
||||
|
||||
export default checkExportDefaultDeclarationExists;
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
"camelcase": "^5.3.1",
|
||||
"case-sensitive-paths-webpack-plugin": "^2.2.0",
|
||||
"core-js": "^3.3.1",
|
||||
"css-hot-loader": "^1.4.4",
|
||||
"css-loader": "^3.2.0",
|
||||
"file-loader": "^5.0.2",
|
||||
"identity-obj-proxy": "^3.0.0",
|
||||
|
@ -31,7 +30,7 @@
|
|||
"less-loader": "^5.0.0",
|
||||
"loader-utils": "^1.2.3",
|
||||
"lodash.clonedeep": "^4.5.0",
|
||||
"mini-css-extract-plugin": "^0.8.0",
|
||||
"mini-css-extract-plugin": "^1.0.0",
|
||||
"node-sass": "^4.12.0",
|
||||
"optimize-css-assets-webpack-plugin": "^5.0.3",
|
||||
"postcss-loader": "^3.0.0",
|
||||
|
@ -42,7 +41,7 @@
|
|||
"terser-webpack-plugin": "^2.3.1",
|
||||
"time-fix-plugin": "^2.0.6",
|
||||
"ts-loader": "^6.1.2",
|
||||
"typescript": "^3.6.3",
|
||||
"typescript": "^4.0.0",
|
||||
"url-loader": "^2.1.0",
|
||||
"webpack-chain": "^6.0.0",
|
||||
"webpack-filter-warnings-plugin": "^1.2.1",
|
||||
|
|
|
@ -35,17 +35,6 @@ const configCSSRule = (config, style, mode, loaders = []) => {
|
|||
.exclude.add(cssModuleReg).end();
|
||||
}
|
||||
|
||||
if (mode === 'development') {
|
||||
const cssHotLoader = rule.use('css-hot-loader')
|
||||
.loader(require.resolve('css-hot-loader'));
|
||||
if (ruleKey === 'module') {
|
||||
// https://www.npmjs.com/package/css-hot-loader#cssmodule
|
||||
// TODO: now the mini-css-extract-plugin support css hot reload (since 0.6.x)
|
||||
// use hmr option instead of css-hot-loader after mini-css-extract-plugin support css-modules hmr
|
||||
cssHotLoader.tap(() => ({ cssModule: true }));
|
||||
}
|
||||
}
|
||||
|
||||
rule
|
||||
.use('MiniCssExtractPlugin.loader')
|
||||
.loader(MiniCssExtractPlugin.loader)
|
||||
|
|
|
@ -1,13 +1,6 @@
|
|||
module.exports = (config, disableReload) => {
|
||||
if (disableReload) {
|
||||
config.plugins.delete('HotModuleReplacementPlugin');
|
||||
|
||||
// remove css hot loader of scss/module-scss/css/module-css/less/module-less
|
||||
['scss', 'scss-module', 'css', 'css-module', 'less', 'less-module'].forEach((rule) => {
|
||||
if (config.module.rules.get(rule)) {
|
||||
config.module.rule(rule).uses.delete('css-hot-loader');
|
||||
}
|
||||
});
|
||||
config.devServer.hot(false).inline(false);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -17,6 +17,6 @@ function transformToVw(value) {
|
|||
const pixels = parseFloat(value);
|
||||
const parsedVal = toFixed(pixels / defaults.viewportWidth * 100, defaults.unitPrecision);
|
||||
return parsedVal + defaults.viewportUnit;
|
||||
};
|
||||
}
|
||||
|
||||
export default transformToVw;
|
||||
|
|
|
@ -37,7 +37,7 @@ function createShareAPI({ withRouter, createElement, useEffect, initHistory = tr
|
|||
addNativeEventListener,
|
||||
removeNativeEventListener
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export {
|
||||
history
|
||||
|
|
|
@ -265,7 +265,7 @@ export function createWithRouter(api) {
|
|||
function Wrapper(props) {
|
||||
const history = router.history;
|
||||
return createElement(Component, { ...props, history, location: history.location });
|
||||
};
|
||||
}
|
||||
|
||||
Wrapper.displayName = `withRouter(${ Component.displayName || Component.name })`;
|
||||
Wrapper.WrappedComponent = Component;
|
||||
|
|
|
@ -57,6 +57,6 @@ function miniappRenderer(
|
|||
}
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export default miniappRenderer;
|
||||
|
|
|
@ -232,6 +232,6 @@ export default class Generator {
|
|||
public addDisableRuntimePlugin = (pluginName: string) => {
|
||||
if (!this.disableRuntimePlugins.includes(pluginName)) {
|
||||
this.disableRuntimePlugins.push(pluginName);
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,4 +30,4 @@ export default async function (api) {
|
|||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@alib/build-scripts": "^0.1.24",
|
||||
"typescript": "^3.7.2"
|
||||
"typescript": "^4.0.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
"@types/fs-extra": "^8.0.1",
|
||||
"@types/glob": "^7.1.1",
|
||||
"@types/node": "^12.12.12",
|
||||
"typescript": "^3.7.2"
|
||||
"typescript": "^4.0.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
"@types/glob": "^7.1.1",
|
||||
"react": "^16.12.0",
|
||||
"react-dom": "^16.12.0",
|
||||
"typescript": "^3.7.2"
|
||||
"typescript": "^4.0.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@alib/build-scripts": "^0.1.24",
|
||||
"typescript": "^3.7.2"
|
||||
"typescript": "^4.0.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -41,6 +41,6 @@ module.exports = (api) => {
|
|||
// Remove default CopyWebpackPlugin
|
||||
config.plugins.delete('CopyWebpackPlugin');
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
"core-js": "^3.7.0",
|
||||
"debug": "^4.1.1",
|
||||
"fs-extra": "^8.1.0",
|
||||
"html-webpack-plugin": "^3.2.0",
|
||||
"html-webpack-plugin": "^4.0.0",
|
||||
"lodash": "^4.17.15",
|
||||
"mkcert": "^1.2.0",
|
||||
"path-exists": "^4.0.0",
|
||||
|
|
|
@ -17,7 +17,7 @@ const module = ({ appConfig }) => {
|
|||
const axiosInstance = createAxiosInstance().default;
|
||||
setAxiosInstance(requestConfig, axiosInstance);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -39,7 +39,7 @@ function useRequest<R = any, Item = any, U extends Item = any>(
|
|||
service: CombineService<R, PaginatedParams>,
|
||||
options: PaginatedOptionsWithFormat<R, Item, U>
|
||||
): IcePaginatedResult<Item>
|
||||
function useRequest<R = any, Item = any, U extends Item = any>(
|
||||
function useRequest<Item = any, U extends Item = any>(
|
||||
service: CombineService<PaginatedFormatReturn<Item>, PaginatedParams>,
|
||||
options: BasePaginatedOptions<U>
|
||||
): IcePaginatedResult<Item>
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@alib/build-scripts": "^0.1.20",
|
||||
"typescript": "^3.8.3"
|
||||
"typescript": "^4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@reactml/loader": "^0.1.3"
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
"@types/history": "^4.7.5",
|
||||
"@types/node": "^12.12.12",
|
||||
"@types/react-router-dom": "^5.1.4",
|
||||
"typescript": "^3.7.2"
|
||||
"typescript": "^4.0.0"
|
||||
},
|
||||
"files": [
|
||||
"lib",
|
||||
|
|
|
@ -3,23 +3,15 @@ import {
|
|||
RouteComponentProps,
|
||||
} from 'react-router-dom';
|
||||
|
||||
interface IModifyFn {
|
||||
(routes: RouteItemProps[]): RouteItemProps[];
|
||||
}
|
||||
|
||||
export interface IModifyRoutes {
|
||||
(modifyFn: IModifyFn): void;
|
||||
export interface IDynamicImportComponent {
|
||||
__LAZY__: boolean;
|
||||
dynamicImport: () => Promise<{ default: React.ComponentType<any> }>;
|
||||
}
|
||||
|
||||
export interface IRouteWrapper {
|
||||
(props: any): React.ComponentType<any>;
|
||||
}
|
||||
|
||||
export interface IDynamicImportComponent {
|
||||
__LAZY__: boolean;
|
||||
dynamicImport: () => Promise<{ default: React.ComponentType<any> }>;
|
||||
}
|
||||
|
||||
export interface RouteItemProps extends Omit<DefaultRouteProps, 'component'> {
|
||||
children?: RouteItemProps[];
|
||||
// disable string[]
|
||||
|
@ -34,4 +26,12 @@ export interface RouteItemProps extends Omit<DefaultRouteProps, 'component'> {
|
|||
|
||||
// custom route wrappers
|
||||
wrappers?: IRouteWrapper[];
|
||||
};
|
||||
}
|
||||
|
||||
interface IModifyFn {
|
||||
(routes: RouteItemProps[]): RouteItemProps[];
|
||||
}
|
||||
|
||||
export interface IModifyRoutes {
|
||||
(modifyFn: IModifyFn): void;
|
||||
}
|
||||
|
|
|
@ -19,12 +19,12 @@ export interface RouterProps {
|
|||
initialIndex?: number;
|
||||
fallback?: React.ReactNode;
|
||||
history: History;
|
||||
};
|
||||
}
|
||||
|
||||
export interface RoutesProps {
|
||||
routes: IRouterConfig[];
|
||||
fallback?: React.ReactNode;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IRouterOptions {
|
||||
caseSensitive?: boolean;
|
||||
|
|
|
@ -41,8 +41,8 @@ interface IService {
|
|||
}
|
||||
|
||||
export default function<S>(apiConfigs: IApiConfigs, defaultConfig?: IBaseConfing, dataHandler?: IDataHandler) {
|
||||
type T<S> = {
|
||||
[K in keyof S]: S[K] & IResult;
|
||||
type T<R> = {
|
||||
[K in keyof R]: R[K] & IResult;
|
||||
}
|
||||
const service = transform(apiConfigs, (result, config, name) => {
|
||||
const { options, dataHandler: configDataHandler } = getConfig(name);
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
"fs-extra": "^9.0.0",
|
||||
"jest": "^25.4.0",
|
||||
"ts-jest": "^25.4.0",
|
||||
"typescript": "^3.8.3",
|
||||
"typescript": "^4.0.0",
|
||||
"webpack-chain": "^6.4.0"
|
||||
},
|
||||
"jest": {
|
||||
|
|
|
@ -32,4 +32,4 @@ export default function pageSourceLoader(appJSON) {
|
|||
return route;
|
||||
});
|
||||
return JSON.stringify(content);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ export function getPageStorePath({ rootDir, srcDir, projectType, pagePath }) {
|
|||
const pageStoreFilePath = path.join(pageNameDir, `store.${projectType}`);
|
||||
|
||||
return pageStoreFilePath;
|
||||
};
|
||||
}
|
||||
|
||||
export function getPageModelPath({ rootDir, srcDir, projectType, pagePath }) {
|
||||
pagePath = path.join('pages', pagePath);
|
||||
|
@ -32,7 +32,7 @@ export function getPageModelPath({ rootDir, srcDir, projectType, pagePath }) {
|
|||
const pageModelFile = path.join(pageNameDir, `model.${projectType}`);
|
||||
|
||||
return { pageNameDir, pageModelsDir, pageModelFile };
|
||||
};
|
||||
}
|
||||
|
||||
export function getRaxPagesPath(rootDir) {
|
||||
const absoluteAppJSONPath = path.join(rootDir, 'src/app.json');
|
||||
|
@ -41,4 +41,4 @@ export function getRaxPagesPath(rootDir) {
|
|||
const pagesPath = routes.map(route => route.source);
|
||||
|
||||
return pagesPath;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@alib/build-scripts": "^0.1.18",
|
||||
"typescript": "^3.8.3"
|
||||
"typescript": "^4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"html-webpack-plugin": "^4.3.0",
|
||||
|
|
|
@ -42,6 +42,6 @@ function matchPath(req, mockConfig) {
|
|||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export default matchPath;
|
|
@ -29,7 +29,7 @@ module.exports = {
|
|||
plugins: [
|
||||
new MiniCssExtractPlugin({
|
||||
filename: 'css/[name].css',
|
||||
chunkFileName: 'css/[id].css',
|
||||
chunkFilename: 'css/[id].css',
|
||||
}),
|
||||
new ExtractCssAssetsPlugin({
|
||||
outputPath: 'cssassets/',
|
||||
|
|
|
@ -27,7 +27,7 @@ module.exports = {
|
|||
plugins: [
|
||||
new MiniCssExtractPlugin({
|
||||
filename: '[name].css',
|
||||
chunkFileName: '[id].css',
|
||||
chunkFilename: '[id].css',
|
||||
}),
|
||||
new ExtractCssAssetsPlugin({
|
||||
outputPath: 'cssassets/',
|
||||
|
|
|
@ -29,7 +29,7 @@ module.exports = {
|
|||
plugins: [
|
||||
new MiniCssExtractPlugin({
|
||||
filename: '[name].css',
|
||||
chunkFileName: '[id].css',
|
||||
chunkFilename: '[id].css',
|
||||
}),
|
||||
new ExtractCssAssetsPlugin({
|
||||
outputPath: 'cssassets/',
|
||||
|
|
|
@ -29,7 +29,7 @@ module.exports = {
|
|||
plugins: [
|
||||
new MiniCssExtractPlugin({
|
||||
filename: '[name].css',
|
||||
chunkFileName: '[id].css',
|
||||
chunkFilename: '[id].css',
|
||||
}),
|
||||
new ExtractCssAssetsPlugin({
|
||||
outputPath: 'cssassets/',
|
||||
|
|
|
@ -27,7 +27,7 @@ module.exports = {
|
|||
plugins: [
|
||||
new MiniCssExtractPlugin({
|
||||
filename: '[name].css',
|
||||
chunkFileName: '[id].css',
|
||||
chunkFilename: '[id].css',
|
||||
}),
|
||||
new ExtractCssAssetsPlugin({
|
||||
outputPath: 'cssassets/',
|
||||
|
|
|
@ -29,7 +29,7 @@ module.exports = {
|
|||
plugins: [
|
||||
new MiniCssExtractPlugin({
|
||||
filename: '[name].css',
|
||||
chunkFileName: '[id].css',
|
||||
chunkFilename: '[id].css',
|
||||
}),
|
||||
new ExtractCssAssetsPlugin({
|
||||
outputPath: 'cssassets/',
|
||||
|
|
|
@ -29,7 +29,7 @@ module.exports = {
|
|||
plugins: [
|
||||
new MiniCssExtractPlugin({
|
||||
filename: '[name].css',
|
||||
chunkFileName: '[id].css',
|
||||
chunkFilename: '[id].css',
|
||||
}),
|
||||
new ExtractCssAssetsPlugin({
|
||||
outputPath: 'cssassets/',
|
||||
|
|
|
@ -62,7 +62,7 @@ function updatePackageJson(betaPackageInfos: IBetaPackageInfo[]): void {
|
|||
|
||||
fs.writeFileSync(packageFile, JSON.stringify(packageData, null, 2));
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function publish(pkg: string, betaVersion: string, directory: string): void {
|
||||
|
||||
|
|
Loading…
Reference in New Issue