Skip to content

Commit

Permalink
@dr-js/dev@0.4.0-dev.1
Browse files Browse the repository at this point in the history
notable change:
- break: use `webpack@5`
- break: use `@dr-js/*@0.4.0-dev.*`
- ci: unmark `windows-latest + 14.x` as unstable. issue may be fixed, check: nodejs/help#2660 and nodejs/node#33166
- script sort
- package update
  • Loading branch information
dr-js committed Oct 12, 2020
1 parent 532c123 commit a020c76
Show file tree
Hide file tree
Showing 10 changed files with 1,173 additions and 392 deletions.
11 changes: 1 addition & 10 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,10 @@ jobs:
strategy:
fail-fast: false # allow all test to run to the end
matrix:
os: [ ubuntu-latest, macos-latest ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
node-version: [ 12.x, 14.x ]
unstable: [ false ]
include:
- os: windows-latest
node-version: 12.x
unstable: false
- os: windows-latest
node-version: 14.x
unstable: true # check: https://github.com/nodejs/help/issues/2660 and https://github.com/nodejs/node/issues/33166

runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.unstable }}

steps:
- name: Reset Git config # fix win32 CI cause `something to commit` test error: https://github.com/actions/checkout/issues/135#issuecomment-602171132
Expand Down
12 changes: 6 additions & 6 deletions SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,14 @@
| babel-plugin-minify-replace | ^0.5.0 |
| babel-plugin-module-resolver | ^4.0.0 |
| babel-plugin-styled-components | ^1.11.1 |
| eslint | ^7.9.0 |
| eslint-plugin-import | ^2.22.0 |
| eslint | ^7.11.0 |
| eslint-plugin-import | ^2.22.1 |
| eslint-plugin-node | ^11.1.0 |
| eslint-plugin-promise | ^4.2.1 |
| eslint-plugin-react | ^7.20.6 |
| eslint-plugin-react | ^7.21.4 |
| prop-types | ^15.7.2 |
| puppeteer | ^5.3.0 |
| puppeteer | ^5.3.1 |
| react | ^16.13.1 |
| styled-components | ^5.2.0 |
| terser | ^5.3.1 |
| webpack | ^4.44.1 |
| terser | ^5.3.4 |
| webpack | ^5.0.0 |
1,508 changes: 1,148 additions & 360 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@dr-js/dev",
"version": "0.4.0-dev.0",
"version": "0.4.0-dev.1",
"description": "A collection of strange functions, for development",
"author": "dr-js",
"license": "MIT",
Expand Down Expand Up @@ -50,12 +50,13 @@
"npm": ">=6.14"
},
"dependencies": {
"@dr-js/core": "^0.3.0 || ^0.3.1-dev.0",
"@dr-js/node": "^0.3.0 || ^0.3.1-dev.0"
"@dr-js/core": "0.4.0-dev.4",
"@dr-js/node": "0.4.0-dev.0"
},
"devDependencies": {
"@dr-js/dev": "0.3.0",
"@dr-js/dev-web": "0.3.0"
"@dr-js/dev": "0.4.0-dev.0",
"@dr-js/dev-web": "0.4.0-dev.0",
"webpack": "^5.0.0"
},
"sideEffects": false
}
2 changes: 1 addition & 1 deletion resource/__config__/base-1-script/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"INIT#package.json"
],
"dependencies": {
"terser": "^5.3.1"
"terser": "^5.3.4"
},
"sideEffects": false
}
2 changes: 1 addition & 1 deletion resource/eslint/[react]/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"eslint-config-almost-standard-jsx-v8.js"
],
"dependencies": {
"eslint-plugin-react": "^7.20.6",
"eslint-plugin-react": "^7.21.4",
"babel-eslint": "^10.1.0"
}
}
4 changes: 2 additions & 2 deletions resource/eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"eslint-config-almost-standard-v14.js"
],
"dependencies": {
"eslint": "^7.9.0",
"eslint-plugin-import": "^2.22.0",
"eslint": "^7.11.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1"
}
Expand Down
2 changes: 1 addition & 1 deletion resource/puppeteer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"INIT#package.json"
],
"dependencies": {
"puppeteer": "^5.3.0"
"puppeteer": "^5.3.1"
}
}
2 changes: 1 addition & 1 deletion resource/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"INIT#package.json"
],
"dependencies": {
"webpack": "^4.44.1",
"webpack": "^5.0.0",
"babel-loader": "^8.1.0"
}
}
11 changes: 6 additions & 5 deletions source/webpack.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Webpack from 'webpack'
import { dirname } from 'path'
import { writeFileSync } from 'fs'
import webpack from 'webpack'

import { binary, time, padTable } from '@dr-js/core/module/common/format'
import { createDirectory } from '@dr-js/core/module/node/file/Directory'
Expand Down Expand Up @@ -69,7 +69,7 @@ const compileWithWebpack = async ({ config, isWatch, profileOutput, namedChunkGr
config.profile = true
}

const compiler = webpack(config)
const compiler = Webpack(config)
const logStats = getLogStats(isWatch, logger)

if (isWatch) {
Expand All @@ -79,6 +79,7 @@ const compileWithWebpack = async ({ config, isWatch, profileOutput, namedChunkGr
} else {
logger.log('[compile] start')
const stats = await new Promise((resolve, reject) => compiler.run(getStatsCheck(reject, resolve)))
await new Promise((resolve, reject) => compiler.close((error, result) => error ? reject(error) : resolve(result))) // close for Webpack5
logStats(stats)
let statsJSON
const getStatsJSON = () => {
Expand Down Expand Up @@ -130,20 +131,20 @@ const commonFlag = async ({
}) => ({
mode,
bail: isProduction,
target: isNodeEnv ? 'node' : 'web', // support node main modules like 'fs'
target: isNodeEnv ? 'node12' : 'web', // support node main modules like 'fs'
node: isNodeEnv ? false : undefined, // do not polyfill fake node environment when build for node
output,
entry,
resolve,
externals,
module: { rules: [ { test: /\.js$/, use: { loader: 'babel-loader', options: babelOption } } ] },
plugins: [
new webpack.DefinePlugin({
new Webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(mode),
__DEV__: !isProduction,
...extraDefine
}),
isNodeBin && new webpack.BannerPlugin({ banner: '#!/usr/bin/env node', raw: true }),
isNodeBin && new Webpack.BannerPlugin({ banner: '#!/usr/bin/env node', raw: true }),
...extraPluginList
].filter(Boolean),
optimization: { minimize: isMinimize },
Expand Down

0 comments on commit a020c76

Please sign in to comment.