Skip to content

Commit

Permalink
feat: bump (dev)Dependencies expect @rollup/plugin-typescript
Browse files Browse the repository at this point in the history
fix related errors
  • Loading branch information
JounQin committed Feb 19, 2021
1 parent 520e969 commit d49518b
Show file tree
Hide file tree
Showing 27 changed files with 4,785 additions and 5,880 deletions.
85 changes: 44 additions & 41 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,72 +36,73 @@
"pretest": "yarn clean",
"serve": "serve dist",
"test": "jest",
"type-coverage": "type-coverage --cache --detail --ignore-catch --ignore-files '*.d.ts' --strict",
"type-coverage": "type-coverage --cache --detail --ignore-catch --ignore-files '*.d.ts' --strict -u",
"w:build": "ts-node --files packages/webpack/src/cli",
"w:dev": "ts-node -T --files packages/webpack/src/cli"
},
"devDependencies": {
"@1stg/app-config": "^0.5.5",
"@1stg/lib-config": "^0.5.5",
"@1stg/tslint-config": "^0.8.5",
"@angular/common": "^10.0.10",
"@angular/compiler": "^10.0.10",
"@angular/compiler-cli": "^10.0.10",
"@angular/core": "^10.0.10",
"@angular/platform-browser": "^10.0.10",
"@angular/platform-browser-dynamic": "^10.0.10",
"@babel/types": "^7.11.0",
"@1stg/app-config": "^1.1.2",
"@1stg/lib-config": "^1.0.4",
"@1stg/tslint-config": "^1.0.0",
"@angular/common": "^11.2.1",
"@angular/compiler": "^11.2.1",
"@angular/compiler-cli": "^11.2.1",
"@angular/core": "^11.2.1",
"@angular/platform-browser": "^11.2.1",
"@angular/platform-browser-dynamic": "^11.2.1",
"@babel/types": "^7.12.17",
"@d-ts/core": "^0.7.3",
"@d-ts/rollup-plugins": "^0.4.0",
"@d-ts/svelte": "^0.2.4",
"@d-ts/vue": "^0.4.3",
"@d-ts/webpack-plugins": "^0.4.0",
"@types/babel__core": "^7.1.9",
"@types/babel__core": "^7.1.12",
"@types/case-sensitive-paths-webpack-plugin": "^2.1.4",
"@types/copy-webpack-plugin": "^6.0.0",
"@types/copy-webpack-plugin": "^6.4.0",
"@types/cross-spawn": "^6.0.2",
"@types/debug": "^4.1.5",
"@types/friendly-errors-webpack-plugin": "^0.1.2",
"@types/imagemin": "^7.0.0",
"@types/is-glob": "^4.0.1",
"@types/jest": "^26.0.10",
"@types/lodash": "^4.14.159",
"@types/jest": "^26.0.20",
"@types/lodash": "^4.14.168",
"@types/micromatch": "^4.0.1",
"@types/mini-css-extract-plugin": "^0.9.1",
"@types/node": "^14.6.0",
"@types/mini-css-extract-plugin": "^1.2.2",
"@types/node": "^14.14.30",
"@types/postcss-load-config": "^2.0.1",
"@types/prettier": "^2.0.2",
"@types/react": "^16.9.46",
"@types/react-dom": "^16.9.8",
"@types/resolve": "^1.17.1",
"@types/rollup-plugin-postcss": "^2.0.0",
"@types/prettier": "^2.2.1",
"@types/react": "^17.0.2",
"@types/react-dom": "^17.0.1",
"@types/resolve": "^1.20.0",
"@types/rollup__plugin-url": "npm:@types/rollup-plugin-url",
"@types/webpack": "^4.41.21",
"@types/webpack-dev-server": "^3.11.0",
"@types/webpack-env": "^1.15.2",
"@types/workbox-webpack-plugin": "^5.1.4",
"core-js": "^3.6.4",
"@types/webpack-dev-server": "^3.11.1",
"@types/webpack-env": "^1.16.0",
"@types/workbox-webpack-plugin": "^5.1.5",
"core-js": "^3.9.0",
"husky": "^4.3.8",
"lerna": "^3.22.1",
"npm-run-all": "^4.1.5",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"postcss": "^8.2.6",
"postcss-loader": "^5.0.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^6.6.2",
"rxjs": "^6.6.3",
"serve": "^11.3.2",
"svelte": "^3.24.1",
"ts-jest": "^26.2.0",
"ts-node": "^8.10.2",
"svelte": "^3.32.3",
"ts-jest": "^26.5.1",
"ts-node": "^9.1.1",
"tslint": "^6.1.3",
"type-coverage": "^2.9.0",
"typescript": "^3.9.7",
"vue": "^2.6.11",
"vue-template-compiler": "^2.6.11",
"yarn-deduplicate": "^2.1.1",
"zone.js": "^0.10.3"
"type-coverage": "^2.15.1",
"typescript": "^4.1.5",
"vue": "^2.6.12",
"vue-template-compiler": "^2.6.12",
"yarn-deduplicate": "^3.1.0",
"zone.js": "^0.11.4"
},
"resolutions": {
"rollup": "^2.22.2"
"rollup": "^2.39.0"
},
"commitlint": {
"extends": [
Expand All @@ -122,7 +123,9 @@
},
"prettier": "@1stg/prettier-config",
"renovate": {
"extends": "@1stg"
"extends": [
"@1stg"
]
},
"typeCoverage": {
"atLeast": 96
Expand Down
1 change: 1 addition & 0 deletions packages/es-modules/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const MODULE_DEFINITIONS: ModuleDefinitions = {
target: 'lodash-es',
exact: false,
},
marked: 'marked/lib/marked.esm',
systemjs: 'systemjs/dist/system',
}

Expand Down
6 changes: 3 additions & 3 deletions packages/imagemin/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ process.argv
glob(file, {
filesOnly: true,
}),
]).then(([files, matched]) => files.concat(matched))
: files.then(files => files.concat(file)),
]).then(([files, matched]) => [...files, ...matched])
: files.then(files => [...files, file]),
Promise.resolve<string[]>([]),
)
.then(files => Promise.all(files.map(imagemin)))
.catch(e => {
.catch((e: Error) => {
console.error(e)
process.exitCode = 1
})
15 changes: 4 additions & 11 deletions packages/imagemin/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import fs from 'fs'
import { promisify } from 'util'

const readFile = promisify(fs.readFile)
const writeFile = promisify(fs.writeFile)

const plugins = ([
[
Expand Down Expand Up @@ -58,10 +54,7 @@ const plugins = ([
require(`imagemin-${name}`)(opts) as import('imagemin').Plugin,
)

export default (filename: string): (() => Promise<void>) =>
// @ts-ignore
[...plugins, (it: Buffer) => writeFile(filename, it)].reduce(
// @ts-ignore
(acc: Promise<void>, it: () => Promise<void>) => acc.then(it),
readFile(filename),
)
export default (filename: string) =>
plugins
.reduce((acc, it) => acc.then(it), fs.promises.readFile(filename))
.then(it => fs.promises.writeFile(filename, it))
13 changes: 7 additions & 6 deletions packages/rollup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,31 @@
],
"dependencies": {
"@babel/preset-env": "^7.11.0",
"@babel/plugin-transform-runtime": "^7.12.17",
"@pkgr/es-modules": "^0.3.3",
"@pkgr/named-exports": "^0.5.2",
"@pkgr/umd-globals": "^0.4.3",
"@pkgr/utils": "^0.4.5",
"@rollup/plugin-babel": "^5.2.0",
"@rollup/plugin-commonjs": "^14.0.0",
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-json": "^4.0.3",
"@rollup/plugin-node-resolve": "^8.0.0",
"@rollup/plugin-node-resolve": "^11.2.0",
"@rollup/plugin-replace": "^2.3.2",
"@rollup/plugin-typescript": "^3.1.1",
"@rollup/plugin-url": "^5.0.0",
"@rollup/plugin-url": "^6.0.0",
"@rxts/rollup-plugin-alias": "^0.1.1",
"builtin-modules": "^3.1.0",
"commander": "^6.0.0",
"commander": "^7.1.0",
"debug": "^4.1.1",
"is-glob": "^4.0.1",
"jsox": "^1.1.121",
"lodash": "^4.17.20",
"micromatch": "^4.0.2",
"rollup": "^2.26.3",
"rollup-plugin-copy": "^3.3.0",
"rollup-plugin-postcss": "^3.1.5",
"rollup-plugin-postcss": "^4.0.0",
"rollup-plugin-terser": "^7.0.0",
"rollup-plugin-vue": "^5.1.9",
"rollup-plugin-vue": "^6.0.0",
"tslib": "^2.0.1"
},
"publishConfig": {
Expand Down
29 changes: 17 additions & 12 deletions packages/rollup/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env node
import { tryRequirePkg } from '@pkgr/utils'
import program from 'commander'
import debug from 'debug'
import JSOX from 'jsox'
Expand All @@ -11,12 +12,11 @@ const info = debug('r:info')

const parseArrayArgs = (curr: string, prev?: string[]) => {
const next = curr.split(',')
return prev ? prev.concat(next) : next
return prev ? [...prev, ...next] : next
}

program
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-var-requires
.version(require('../package.json').version)
.version(tryRequirePkg<{ version: string }>('../package.json')!.version)
.option('-i, --input <filename>', 'input entry file path')
.option('--exclude <path>', 'exclude package(s) for monorepo', parseArrayArgs)
.option('-o, --output-dir [output]', 'output destination directory')
Expand Down Expand Up @@ -64,31 +64,35 @@ program
'-w, --watch [boolean]',
'whether to enable watch mode for development',
)
// FIXME: should be removed this option and PR to `rollup-plugin-typescript` instead
.option(
'-b, --babel <JSOX>',
'Overrides the Babel plugin options for `@rollup/plugin-babel`',
JSOX.parse,
)
.option(
'-t, --typescript <JSOX>',
'Overrides the TypeScript compiler options for `rollup-plugin-typescript`',
'Overrides the TypeScript compiler options for `@rollup/plugin-typescript`',
JSOX.parse,
)
.option('--postcss <JSOX>', 'options for `rollup-plugin-postcss`', JSOX.parse)
.option('--vue <JSOX>', 'options for `rollup-plugin-vue`', JSOX.parse)
// eslint-disable-next-line @typescript-eslint/ban-types
.option<boolean | object>(
'-d, --define [boolean | JSOX]',
'options for `rollup-plugin-replace`, enable `__DEV__` and `__PROD__` by default',
'options for `@rollup/plugin-replace`, enable `__DEV__` and `__PROD__` by default',
// @ts-ignore
JSOX.parse,
true,
)
.option('--terser <JSOX>', 'options for `rollup-plugin-terser`', JSOX.parse)
.option('--terser <JSOX>', 'options for `@rollup/plugin-terser`', JSOX.parse)
.option(
'-p, --prod [boolean]',
'whether to enable production(.min.js) bundle together at the same time',
)
.parse(process.argv)

const options = (pick(
program,
const options = pick(
program.opts(),
'input',
'exclude',
'outputDir',
Expand All @@ -100,12 +104,13 @@ const options = (pick(
'globals',
'aliasEntries',
'sourceMap',
'babel',
'typescript',
'postcss',
'vue',
'terser',
'prod',
) as unknown) as ConfigOptions
) as ConfigOptions

info('options: %O', options)

Expand All @@ -128,14 +133,14 @@ const startWatcher = (configs: InputOptions[]) => {

const configs = config(options)

if (program.watch) {
if (options.watch) {
startWatcher(configs)
} else {
Promise.all(
configs.map(opts =>
rollup(opts).then(bundle => bundle.write(opts.output as OutputOptions)),
),
).catch(e => {
).catch((e: Error) => {
console.error(e)
process.exitCode = 1
})
Expand Down
Loading

0 comments on commit d49518b

Please sign in to comment.