Skip to content

Commit

Permalink
refactor: 全部依赖更新至ESM最新版 (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
otakustay committed Jan 15, 2022
1 parent 475c02f commit fd493f9
Show file tree
Hide file tree
Showing 45 changed files with 1,119 additions and 892 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"prepare": "husky install"
},
"devDependencies": {
"@commitlint/cli": "^15.0.0",
"@commitlint/config-conventional": "^15.0.0",
"@commitlint/cli": "^16.0.2",
"@commitlint/config-conventional": "^16.0.0",
"cpy": "^8.1.2",
"husky": "^7.0.4",
"lerna": "^4.0.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/babel-plugin-add-react-display-name/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
"@types/node": "^17.0.4",
"c8": "^7.10.0",
"eslint": "^8.6.0",
"typescript": "4.6.0-dev.20220105",
"vite": "^2.7.7",
"vitest": "^0.0.115"
"typescript": "4.6.0-dev.20220114",
"vite": "^2.7.12",
"vitest": "^0.1.16"
},
"dependencies": {
"@babel/core": "^7.16.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
"c8": "^7.10.0",
"eslint": "^8.6.0",
"react": "^17.0.2",
"typescript": "4.6.0-dev.20220105",
"vite": "^2.7.7",
"vitest": "^0.0.115"
"typescript": "4.6.0-dev.20220114",
"vite": "^2.7.12",
"vitest": "^0.1.16"
},
"dependencies": {
"@babel/core": "^7.16.5",
Expand Down
6 changes: 3 additions & 3 deletions packages/babel-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
"@types/node": "^17.0.4",
"c8": "^7.10.0",
"eslint": "^8.6.0",
"typescript": "4.6.0-dev.20220105",
"vite": "^2.7.7",
"vitest": "^0.0.115"
"typescript": "4.6.0-dev.20220114",
"vite": "^2.7.12",
"vitest": "^0.1.16"
},
"peerDependencies": {
"@babel/core": "^7.14.6",
Expand Down
4 changes: 2 additions & 2 deletions packages/cli-babel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
"@types/jest": "^27.0.3",
"@types/node": "^17.0.4",
"eslint": "^8.6.0",
"typescript": "4.6.0-dev.20220105"
"typescript": "4.6.0-dev.20220114"
},
"dependencies": {
"@babel/core": "^7.16.5",
"@reskript/config-babel": "3.0.2",
"@reskript/core": "3.0.2",
"cli-highlight": "^2.1.11",
"globby": "^12.0.2",
"globby": "^12.1.0",
"p-limit": "^4.0.0"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@types/jest": "^27.0.3",
"@types/node": "^17.0.4",
"@types/ramda": "^0.27.62",
"typescript": "4.6.0-dev.20220105",
"typescript": "4.6.0-dev.20220114",
"webpack": "^5.65.0"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@types/jest": "^27.0.3",
"@types/node": "^17.0.4",
"eslint": "^8.6.0",
"typescript": "4.6.0-dev.20220105",
"typescript": "4.6.0-dev.20220114",
"webpack": "^5.65.0"
},
"dependencies": {
Expand Down
6 changes: 3 additions & 3 deletions packages/cli-lint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@
"test": "echo 'No test in @reskript/cli-lint'"
},
"devDependencies": {
"@types/eslint": "^7.29.0",
"@types/eslint": "^8.2.2",
"@types/jest": "^27.0.3",
"@types/node": "^17.0.4",
"@types/ramda": "^0.27.62",
"typescript": "4.6.0-dev.20220105"
"typescript": "4.6.0-dev.20220114"
},
"dependencies": {
"@reskript/config-lint": "3.0.2",
"@reskript/core": "3.0.2",
"eslint": "^8.6.0",
"eslint-formatter-pretty": "^4.1.0",
"execa": "^6.0.0",
"globby": "^12.0.2",
"globby": "^12.1.0",
"ramda": "^0.27.1",
"stylelint": "^14.2.0"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/cli-lint/src/style.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {lint, LintResult as StyleLintResult, Warning, WarningOptions} from 'stylelint';
import styleLint, {LintResult as StyleLintResult, Warning, WarningOptions} from 'stylelint';
import {isEmpty} from 'ramda';
import {ESLint, Linter} from 'eslint';
import {resolveCacheLocation} from '@reskript/core';
Expand Down Expand Up @@ -68,6 +68,6 @@ export default async (files: string[], cmd: ResolveOptions): Promise<LintResult[
cache: false,
cacheLocation: await resolveCacheLocation('stylelint'),
};
const report = await lint(lintConfig);
const report = await styleLint.lint(lintConfig);
return report.results.map(adaptStyleResultToScriptResult);
};
18 changes: 9 additions & 9 deletions packages/cli-play/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@types/body-parser": "^1.19.2",
"@types/debounce": "^1.2.1",
"@types/dedent": "^0.7.0",
"@types/marked": "^3.0.3",
"@types/marked": "^4.0.1",
"@types/mdast": "^3.0.10",
"@types/node": "^17.0.4",
"@types/ramda": "^0.27.62",
Expand All @@ -38,9 +38,9 @@
"eslint": "^8.6.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"typescript": "4.6.0-dev.20220105",
"vite": "^2.7.7",
"vitest": "^0.0.115",
"typescript": "4.6.0-dev.20220114",
"vite": "^2.7.12",
"vitest": "^0.1.16",
"webpack": "^5.65.0"
},
"dependencies": {
Expand All @@ -54,14 +54,14 @@
"debounce": "^1.2.1",
"internal-ip": "^7.0.0",
"localforage": "^1.10.0",
"marked": "^3.0.8",
"marked": "^4.0.10",
"ramda": "^0.27.1",
"remark-gfm": "^1.0.0",
"remark-parse": "^9.0.0",
"remark-stringify": "^9.0.1",
"remark-gfm": "^3.0.1",
"remark-parse": "^10.0.1",
"remark-stringify": "^10.0.2",
"socket.io": "^4.4.0",
"socket.io-client": "^4.4.0",
"unified": "^9.2.2",
"unified": "^10.1.1",
"webpack-dev-server": "^4.7.1"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-play/src/Playground/CaseDescription/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import marked from 'marked';
import {marked} from 'marked';
import {PlayCase} from '../../interface.js';
import './index.css';

Expand Down
4 changes: 2 additions & 2 deletions packages/cli-play/src/utils/case.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {findLast, reject, isNil} from 'ramda';
import parse from 'remark-parse';
import gfm from 'remark-gfm';
import stringify from 'remark-stringify';
import unified from 'unified';
import {unified} from 'unified';
import {Content, Root, Text, Code, List} from 'mdast';
import {currentUserName, pMap} from '@reskript/core';
import {PlayCase, PlayCaseMeta} from '../interface.js';
Expand Down Expand Up @@ -106,7 +106,7 @@ interface ParseContext {
}

export const splitToCaseNodes = (markdown: string): Content[][] => {
const root = parser.parse(markdown) as Root;
const root = parser.parse(markdown);
const {saved, workingInProgress} = root.children.reduce(
(context, node) => {
// 每个二级标题是一个用例
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@types/node": "^17.0.4",
"@types/ramda": "^0.27.62",
"eslint": "^8.6.0",
"typescript": "4.6.0-dev.20220105"
"typescript": "4.6.0-dev.20220114"
},
"dependencies": {
"@reskript/config-jest": "3.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@types/jest": "^27.0.3",
"@types/node": "^17.0.4",
"eslint": "^8.6.0",
"typescript": "4.6.0-dev.20220105"
"typescript": "4.6.0-dev.20220114"
},
"dependencies": {
"@reskript/core": "3.0.2",
Expand Down
10 changes: 5 additions & 5 deletions packages/config-babel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
},
"devDependencies": {
"@babel/plugin-transform-typescript": "^7.16.7",
"@rollup/plugin-babel": "^5.3.0",
"@reskript/core": "3.0.2",
"@rollup/plugin-babel": "^5.3.0",
"@types/babel__core": "^7.1.17",
"@types/lodash": "^4.14.178",
"@types/node": "^17.0.4",
"c8": "^7.10.0",
"eslint": "^8.6.0",
"rollup": "^2.62.0",
"typescript": "4.6.0-dev.20220105",
"vite": "^2.7.7",
"vitest": "^0.0.115"
"rollup": "^2.64.0",
"typescript": "4.6.0-dev.20220114",
"vite": "^2.7.12",
"vitest": "^0.1.16"
},
"dependencies": {
"@babel/core": "^7.16.5",
Expand Down
11 changes: 5 additions & 6 deletions packages/config-img-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,17 @@
"@types/imagemin-mozjpeg": "^8.0.1",
"@types/imagemin-optipng": "^5.2.1",
"@types/node": "^17.0.4",
"@types/resolve": "^1.20.1",
"eslint": "^8.6.0",
"typescript": "4.6.0-dev.20220105",
"typescript": "4.6.0-dev.20220114",
"webpack": "^5.65.0"
},
"dependencies": {
"imagemin": "^7.0.1",
"@reskript/core": "3.0.2",
"imagemin": "^8.0.1",
"imagemin-gifsicle": "^7.0.0",
"imagemin-mozjpeg": "^9.0.0",
"imagemin-mozjpeg": "^10.0.0",
"imagemin-optipng": "^8.0.0",
"img-loader": "^3.0.2",
"resolve": "^1.20.0"
"img-loader": "^4.0.0"
},
"peerDependencies": {
"webpack": "5.x"
Expand Down
4 changes: 2 additions & 2 deletions packages/config-img-loader/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import resolve from 'resolve';
import {RuleSetUseItem} from 'webpack';
import gif from 'imagemin-gifsicle';
import jpeg from 'imagemin-mozjpeg';
import png from 'imagemin-optipng';
import {resolveSync} from '@reskript/core';

const pluginOptions = {
gifsicle: {
Expand All @@ -26,7 +26,7 @@ export default (): RuleSetUseItem => {
];

return {
loader: resolve.sync('img-loader'),
loader: resolveSync('img-loader'),
options: {plugins},
};
};
8 changes: 6 additions & 2 deletions packages/config-jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
"type": "commonjs",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": "./dist/index.js",
"./config/*": "./config/*.js"
},
"engines": {
"node": ">=14.18.0"
},
Expand All @@ -17,7 +21,7 @@
},
"scripts": {
"clean": "rm -rf dist",
"build": "rm -rf dist config && tsc -p tsconfig.build.json && node scripts/post-build.js",
"build": "rm -rf dist config && tsc -p tsconfig.build.json && node scripts/post-build.mjs",
"lint": "eslint --max-warnings=0 src",
"test": "echo 'No test in @reskript/config-jest'"
},
Expand All @@ -31,7 +35,7 @@
"@types/resolve": "^1.20.1",
"eslint": "^8.6.0",
"prettier": "^2.5.1",
"typescript": "4.6.0-dev.20220105"
"typescript": "4.6.0-dev.20220114"
},
"dependencies": {
"@babel/core": "^7.16.5",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const fs = require('fs');
const path = require('path');
const prettier = require('prettier');
const {getJestPresetConfig} = require('../dist');
import fs from 'fs';
import path from 'path';
import prettier from 'prettier';
import {dirFromImportMeta} from '@reskript/core';
import {getJestPresetConfig} from '../dist/index.js';

const dumpAsModule = (json, destination) => {
// 有几个东西是用了`resolve('xxx')`变成了绝对路径,在这里要换回来再替换成`require.resolve`
Expand Down Expand Up @@ -41,7 +42,7 @@ const dumpAsModule = (json, destination) => {
};

const jestPresetConfig = target => getJestPresetConfig(target, '%RESKRIPT_NODE_MODULE_JEST_PATH%');
const destination = path.join(__dirname, '..', 'config');
const destination = path.join(dirFromImportMeta(import.meta.url), '..', 'config');
fs.mkdirSync(destination, {recursive: true});
dumpAsModule(jestPresetConfig('react'), path.join(destination, 'jest-react.js'));
dumpAsModule(jestPresetConfig('node'), path.join(destination, 'jest-node.js'));
6 changes: 3 additions & 3 deletions packages/config-lint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"@types/resolve": "^1.20.1",
"eslint": "^8.6.0",
"prettier": "^2.5.1",
"rollup": "^2.62.0",
"typescript": "4.6.0-dev.20220105"
"rollup": "^2.64.0",
"typescript": "4.6.0-dev.20220114"
},
"dependencies": {
"@babel/core": "^7.16.5",
Expand All @@ -55,7 +55,7 @@
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-reskript": "^0.1.2",
"postcss-less": "^5.0.0",
"postcss-less": "^6.0.0",
"resolve": "^1.20.0"
},
"peerDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/config-webpack-dev-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
"@types/node": "^17.0.4",
"c8": "^7.10.0",
"eslint": "^8.6.0",
"typescript": "4.6.0-dev.20220105",
"vite": "^2.7.7",
"vitest": "^0.0.115",
"typescript": "4.6.0-dev.20220114",
"vite": "^2.7.12",
"vitest": "^0.1.16",
"webpack": "^5.65.0",
"webpack-dev-server": "^4.7.1"
},
Expand All @@ -40,9 +40,9 @@
"@reskript/core": "3.0.2",
"@reskript/settings": "3.0.2",
"@soda/friendly-errors-webpack-plugin": "^1.8.1",
"kolorist": "^1.5.1",
"cli-progress": "^3.9.1",
"internal-ip": "^7.0.0",
"kolorist": "^1.5.1",
"launch-editor-middleware": "^2.3.0",
"proxy-agent": "^5.0.0",
"react-refresh": "^0.11.0",
Expand Down
Loading

0 comments on commit fd493f9

Please sign in to comment.