Skip to content

Commit

Permalink
依赖更新
Browse files Browse the repository at this point in the history
  • Loading branch information
bplok20010 committed Oct 10, 2020
1 parent a15f23c commit cd819e1
Show file tree
Hide file tree
Showing 13 changed files with 1,584 additions and 1,328 deletions.
2 changes: 1 addition & 1 deletion lib/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function _default(api, opts) {
amd: require.resolve("@babel/plugin-transform-modules-amd"),
systemjs: require.resolve("@babel/plugin-transform-modules-systemjs")
};
var modulePlugin = modulesMap[modules] && [modulesMap[modules], {
var modulePlugin = strictMode && modulesMap[modules] && [modulesMap[modules], {
strictMode
}]; // class-properties 开启 `loose` 后 private-methods 也要同时开启

Expand Down
2,490 changes: 1,426 additions & 1,064 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "babel-preset-packez",
"version": "1.1.0",
"version": "1.1.1",
"description": "",
"main": "./lib/index.js",
"scripts": {
Expand Down Expand Up @@ -58,10 +58,10 @@
"@babel/runtime": "^7.10.2",
"babel-plugin-dev-expression": "^0.2.2",
"babel-plugin-macros": "^2.8.0",
"lodash": "^4.17.15"
"lodash": "^4.17.20"
},
"devDependencies": {
"@babel/cli": "^7.10.1",
"@babel/cli": "^7.11.6",
"transform-es": "^3.3.3"
},
"browserslist": [
Expand Down
2 changes: 1 addition & 1 deletion src/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function (api, opts) {
amd: require.resolve("@babel/plugin-transform-modules-amd"),
systemjs: require.resolve("@babel/plugin-transform-modules-systemjs"),
};
const modulePlugin = modulesMap[modules] && [
const modulePlugin = strictMode && modulesMap[modules] && [
modulesMap[modules],
{
strictMode,
Expand Down
28 changes: 12 additions & 16 deletions test/lib/a.b.c.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));

var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _toArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toArray"));

function _decorate(decorators, factory, superClass, mixins) { var api = _getDecoratorsApi(); if (mixins) { for (var i = 0; i < mixins.length; i++) { api = mixins[i](api); } } var r = factory(function initialize(O) { api.initializeInstanceElements(O, decorated.elements); }, superClass); var decorated = api.decorateClass(_coalesceClassElements(r.d.map(_createElementDescriptor)), decorators); api.initializeClassElements(r.F, decorated.elements); return api.runClassFinishers(r.F, decorated.finishers); }
Expand Down Expand Up @@ -35,11 +35,12 @@ var fs = require("fs-extra");
var glob = require('fast-glob');

var MyApp = _decorate([ta], function (_initialize) {
var MyApp = function MyApp() {
(0, _classCallCheck2.default)(this, MyApp);
class MyApp {
constructor() {
_initialize(this);
}

_initialize(this);
};
}

return {
F: MyApp,
Expand Down Expand Up @@ -69,7 +70,7 @@ var MyApp = _decorate([ta], function (_initialize) {
key: "a",

value() {
return function () {};
return () => {};
}

}]
Expand Down Expand Up @@ -105,15 +106,10 @@ function _test() {
}

test();
new Promise(function (r) {
return r(1);
});
new Promise(r => r(1));
var x = new Set();

module.exports = function () {
var appSrc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'src';
var appDist = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'dest';
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
module.exports = function (appSrc = 'src', appDist = 'dest', options = {}) {
var defaults = {
cwd: process.cwd(),
cleanDist: true,
Expand All @@ -131,8 +127,8 @@ module.exports = function () {

}, options.globOptions, {
cwd: path.resolve(options.cwd, appSrc)
})).then(function (files) {
files.forEach(function (file) {
})).then(files => {
files.forEach(file => {
var absSrcFile = path.resolve(options.cwd, appSrc, file);
var absDestFile = path.resolve(options.cwd, appDist, file);
fs.copySync(absSrcFile, absDestFile);
Expand Down
11 changes: 5 additions & 6 deletions test/lib/app/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
"use strict";

var path = require('path');

var fs = require("fs-extra");

var glob = require('fast-glob');

module.exports = function () {
var appSrc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'src';
var appDist = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'dest';
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
module.exports = function (appSrc = 'src', appDist = 'dest', options = {}) {
var defaults = {
cwd: process.cwd(),
cleanDist: true,
Expand All @@ -25,8 +24,8 @@ module.exports = function () {

}, options.globOptions, {
cwd: path.resolve(options.cwd, appSrc)
})).then(function (files) {
files.forEach(function (file) {
})).then(files => {
files.forEach(file => {
var absSrcFile = path.resolve(options.cwd, appSrc, file);
var absDestFile = path.resolve(options.cwd, appDist, file);
fs.copySync(absSrcFile, absDestFile);
Expand Down
Loading

0 comments on commit cd819e1

Please sign in to comment.