@putout/bundle 1.1.2 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -194,6 +194,8 @@ function requireApplyRemove () {
194
194
  return applyRemove;
195
195
  }
196
196
 
197
+ var checkReplaceCode = {};
198
+
197
199
  var tryCatch;
198
200
  var hasRequiredTryCatch;
199
201
 
@@ -316,8 +318,6 @@ function requireGenerateCode () {
316
318
  return generateCode;
317
319
  }
318
320
 
319
- var checkReplaceCode = {};
320
-
321
321
  var hasRequiredCheckReplaceCode;
322
322
 
323
323
  function requireCheckReplaceCode () {
@@ -933,96 +933,6 @@ function requireConvertReplaceToFunction () {
933
933
  return convertReplaceToFunction;
934
934
  }
935
935
 
936
- var convertReplaceWithMultiple = {};
937
-
938
- var hasRequiredConvertReplaceWithMultiple;
939
-
940
- function requireConvertReplaceWithMultiple () {
941
- if (hasRequiredConvertReplaceWithMultiple) return convertReplaceWithMultiple;
942
- hasRequiredConvertReplaceWithMultiple = 1;
943
-
944
- const {
945
- operator,
946
- template,
947
- types,
948
- } = require$$0$1;
949
-
950
- const {
951
- insertAfter,
952
- replaceWith,
953
- } = operator;
954
-
955
- const {
956
- Identifier,
957
- ObjectProperty,
958
- } = types;
959
-
960
- convertReplaceWithMultiple.report = () => {
961
- return `"operate.replaceWithMultiple" should be called instead of "path.replaceWithMultiple"`;
962
- };
963
-
964
- const replaceWithAST = template.ast(`
965
- const {replaceWithMultiple} = require('putout').operate;
966
- `);
967
-
968
- convertReplaceWithMultiple.fix = ({path, calleePath, property, object, program}) => {
969
- const strictModePath = program.get('body.0');
970
- const {bindings} = strictModePath.scope;
971
-
972
- replaceWith(calleePath, property);
973
- path.node.arguments.unshift(object);
974
-
975
- if (bindings.replaceWithMultiple)
976
- return;
977
-
978
- if (!bindings.replaceWith && !bindings.insertAfter)
979
- return insertAfter(strictModePath, replaceWithAST);
980
-
981
- const id = Identifier('replaceWithMultiple');
982
-
983
- const varPath = getVarPath(bindings);
984
- varPath.node.id.properties
985
- .push(ObjectProperty(id, id, false, true));
986
- };
987
-
988
- function getVarPath(bindings) {
989
- const {
990
- replaceWith,
991
- insertAfter,
992
- } = bindings;
993
-
994
- if (replaceWith)
995
- return replaceWith.path;
996
-
997
- return insertAfter.path;
998
- }
999
-
1000
- convertReplaceWithMultiple.traverse = ({push}) => ({
1001
- CallExpression(path) {
1002
- const calleePath = path.get('callee');
1003
-
1004
- if (!calleePath.isMemberExpression())
1005
- return;
1006
-
1007
- const {object, property} = calleePath.node;
1008
-
1009
- if (property.name !== 'replaceWithMultiple')
1010
- return;
1011
-
1012
- const program = path.findParent((path) => path.isProgram());
1013
-
1014
- push({
1015
- path,
1016
- object,
1017
- program,
1018
- calleePath,
1019
- property,
1020
- });
1021
- },
1022
- });
1023
- return convertReplaceWithMultiple;
1024
- }
1025
-
1026
936
  var convertReplaceWith = {};
1027
937
 
1028
938
  var fullstore;
@@ -1154,6 +1064,96 @@ function requireConvertReplaceWith () {
1154
1064
  return convertReplaceWith;
1155
1065
  }
1156
1066
 
1067
+ var convertReplaceWithMultiple = {};
1068
+
1069
+ var hasRequiredConvertReplaceWithMultiple;
1070
+
1071
+ function requireConvertReplaceWithMultiple () {
1072
+ if (hasRequiredConvertReplaceWithMultiple) return convertReplaceWithMultiple;
1073
+ hasRequiredConvertReplaceWithMultiple = 1;
1074
+
1075
+ const {
1076
+ operator,
1077
+ template,
1078
+ types,
1079
+ } = require$$0$1;
1080
+
1081
+ const {
1082
+ insertAfter,
1083
+ replaceWith,
1084
+ } = operator;
1085
+
1086
+ const {
1087
+ Identifier,
1088
+ ObjectProperty,
1089
+ } = types;
1090
+
1091
+ convertReplaceWithMultiple.report = () => {
1092
+ return `"operate.replaceWithMultiple" should be called instead of "path.replaceWithMultiple"`;
1093
+ };
1094
+
1095
+ const replaceWithAST = template.ast(`
1096
+ const {replaceWithMultiple} = require('putout').operate;
1097
+ `);
1098
+
1099
+ convertReplaceWithMultiple.fix = ({path, calleePath, property, object, program}) => {
1100
+ const strictModePath = program.get('body.0');
1101
+ const {bindings} = strictModePath.scope;
1102
+
1103
+ replaceWith(calleePath, property);
1104
+ path.node.arguments.unshift(object);
1105
+
1106
+ if (bindings.replaceWithMultiple)
1107
+ return;
1108
+
1109
+ if (!bindings.replaceWith && !bindings.insertAfter)
1110
+ return insertAfter(strictModePath, replaceWithAST);
1111
+
1112
+ const id = Identifier('replaceWithMultiple');
1113
+
1114
+ const varPath = getVarPath(bindings);
1115
+ varPath.node.id.properties
1116
+ .push(ObjectProperty(id, id, false, true));
1117
+ };
1118
+
1119
+ function getVarPath(bindings) {
1120
+ const {
1121
+ replaceWith,
1122
+ insertAfter,
1123
+ } = bindings;
1124
+
1125
+ if (replaceWith)
1126
+ return replaceWith.path;
1127
+
1128
+ return insertAfter.path;
1129
+ }
1130
+
1131
+ convertReplaceWithMultiple.traverse = ({push}) => ({
1132
+ CallExpression(path) {
1133
+ const calleePath = path.get('callee');
1134
+
1135
+ if (!calleePath.isMemberExpression())
1136
+ return;
1137
+
1138
+ const {object, property} = calleePath.node;
1139
+
1140
+ if (property.name !== 'replaceWithMultiple')
1141
+ return;
1142
+
1143
+ const program = path.findParent((path) => path.isProgram());
1144
+
1145
+ push({
1146
+ path,
1147
+ object,
1148
+ program,
1149
+ calleePath,
1150
+ property,
1151
+ });
1152
+ },
1153
+ });
1154
+ return convertReplaceWithMultiple;
1155
+ }
1156
+
1157
1157
  var convertReportToFunction = {};
1158
1158
 
1159
1159
  var hasRequiredConvertReportToFunction;
@@ -3037,41 +3037,71 @@ var dynamicModules;
3037
3037
 
3038
3038
  function getDynamicModules() {
3039
3039
  return dynamicModules || (dynamicModules = {
3040
+ "/node_modules/@putout/plugin-putout/lib/add-args": requireAddArgs,
3040
3041
  "/node_modules/@putout/plugin-putout/lib/add-args/index.js": requireAddArgs,
3042
+ "/node_modules/@putout/plugin-putout/lib/add-push": requireAddPush,
3041
3043
  "/node_modules/@putout/plugin-putout/lib/add-push/index.js": requireAddPush,
3044
+ "/node_modules/@putout/plugin-putout/lib/apply-async-formatter": requireApplyAsyncFormatter,
3042
3045
  "/node_modules/@putout/plugin-putout/lib/apply-async-formatter/index.js": requireApplyAsyncFormatter,
3046
+ "/node_modules/@putout/plugin-putout/lib/apply-create-test": requireApplyCreateTest,
3043
3047
  "/node_modules/@putout/plugin-putout/lib/apply-create-test/index.js": requireApplyCreateTest,
3048
+ "/node_modules/@putout/plugin-putout/lib/apply-processors-destructuring": requireApplyProcessorsDestructuring,
3044
3049
  "/node_modules/@putout/plugin-putout/lib/apply-processors-destructuring/index.js": requireApplyProcessorsDestructuring,
3050
+ "/node_modules/@putout/plugin-putout/lib/apply-remove": requireApplyRemove,
3045
3051
  "/node_modules/@putout/plugin-putout/lib/apply-remove/index.js": requireApplyRemove,
3046
- "/node_modules/@putout/plugin-putout/lib/check-replace-code/generate-code.js": requireGenerateCode,
3052
+ "/node_modules/@putout/plugin-putout/lib/check-replace-code": requireCheckReplaceCode,
3047
3053
  "/node_modules/@putout/plugin-putout/lib/check-replace-code/index.js": requireCheckReplaceCode,
3054
+ "/node_modules/@putout/plugin-putout/lib/convert-add-argument-to-add-args": requireConvertAddArgumentToAddArgs,
3048
3055
  "/node_modules/@putout/plugin-putout/lib/convert-add-argument-to-add-args/index.js": requireConvertAddArgumentToAddArgs,
3056
+ "/node_modules/@putout/plugin-putout/lib/convert-babel-types": requireConvertBabelTypes,
3049
3057
  "/node_modules/@putout/plugin-putout/lib/convert-babel-types/index.js": requireConvertBabelTypes,
3058
+ "/node_modules/@putout/plugin-putout/lib/convert-destructuring-to-identifier": requireConvertDestructuringToIdentifier,
3050
3059
  "/node_modules/@putout/plugin-putout/lib/convert-destructuring-to-identifier/index.js": requireConvertDestructuringToIdentifier,
3060
+ "/node_modules/@putout/plugin-putout/lib/convert-dirname-to-url": requireConvertDirnameToUrl,
3051
3061
  "/node_modules/@putout/plugin-putout/lib/convert-dirname-to-url/index.js": requireConvertDirnameToUrl,
3062
+ "/node_modules/@putout/plugin-putout/lib/convert-find-to-traverse": requireConvertFindToTraverse,
3052
3063
  "/node_modules/@putout/plugin-putout/lib/convert-find-to-traverse/index.js": requireConvertFindToTraverse,
3064
+ "/node_modules/@putout/plugin-putout/lib/convert-match-to-function": requireConvertMatchToFunction,
3053
3065
  "/node_modules/@putout/plugin-putout/lib/convert-match-to-function/index.js": requireConvertMatchToFunction,
3066
+ "/node_modules/@putout/plugin-putout/lib/convert-method-to-property": requireConvertMethodToProperty,
3054
3067
  "/node_modules/@putout/plugin-putout/lib/convert-method-to-property/index.js": requireConvertMethodToProperty,
3068
+ "/node_modules/@putout/plugin-putout/lib/convert-node-to-path-in-get-template-values": requireConvertNodeToPathInGetTemplateValues,
3055
3069
  "/node_modules/@putout/plugin-putout/lib/convert-node-to-path-in-get-template-values/index.js": requireConvertNodeToPathInGetTemplateValues,
3070
+ "/node_modules/@putout/plugin-putout/lib/convert-number-to-numeric": requireConvertNumberToNumeric,
3056
3071
  "/node_modules/@putout/plugin-putout/lib/convert-number-to-numeric/index.js": requireConvertNumberToNumeric,
3072
+ "/node_modules/@putout/plugin-putout/lib/convert-process-to-find": requireConvertProcessToFind,
3057
3073
  "/node_modules/@putout/plugin-putout/lib/convert-process-to-find/index.js": requireConvertProcessToFind,
3074
+ "/node_modules/@putout/plugin-putout/lib/convert-putout-test-to-create-test": requireConvertPutoutTestToCreateTest,
3058
3075
  "/node_modules/@putout/plugin-putout/lib/convert-putout-test-to-create-test/index.js": requireConvertPutoutTestToCreateTest,
3076
+ "/node_modules/@putout/plugin-putout/lib/convert-replace-to-function": requireConvertReplaceToFunction,
3059
3077
  "/node_modules/@putout/plugin-putout/lib/convert-replace-to-function/index.js": requireConvertReplaceToFunction,
3060
- "/node_modules/@putout/plugin-putout/lib/convert-replace-with-multiple/index.js": requireConvertReplaceWithMultiple,
3078
+ "/node_modules/@putout/plugin-putout/lib/convert-replace-with": requireConvertReplaceWith,
3061
3079
  "/node_modules/@putout/plugin-putout/lib/convert-replace-with/index.js": requireConvertReplaceWith,
3080
+ "/node_modules/@putout/plugin-putout/lib/convert-replace-with-multiple": requireConvertReplaceWithMultiple,
3081
+ "/node_modules/@putout/plugin-putout/lib/convert-replace-with-multiple/index.js": requireConvertReplaceWithMultiple,
3082
+ "/node_modules/@putout/plugin-putout/lib/convert-report-to-function": requireConvertReportToFunction,
3062
3083
  "/node_modules/@putout/plugin-putout/lib/convert-report-to-function/index.js": requireConvertReportToFunction,
3084
+ "/node_modules/@putout/plugin-putout/lib/convert-to-no-transform-code": requireConvertToNoTransformCode,
3063
3085
  "/node_modules/@putout/plugin-putout/lib/convert-to-no-transform-code/index.js": requireConvertToNoTransformCode,
3086
+ "/node_modules/@putout/plugin-putout/lib/convert-traverse-to-include": requireConvertTraverseToInclude,
3064
3087
  "/node_modules/@putout/plugin-putout/lib/convert-traverse-to-include/index.js": requireConvertTraverseToInclude,
3088
+ "/node_modules/@putout/plugin-putout/lib/convert-traverse-to-replace": requireConvertTraverseToReplace,
3065
3089
  "/node_modules/@putout/plugin-putout/lib/convert-traverse-to-replace/index.js": requireConvertTraverseToReplace,
3090
+ "/node_modules/@putout/plugin-putout/lib/convert-url-to-dirname": requireConvertUrlToDirname,
3066
3091
  "/node_modules/@putout/plugin-putout/lib/convert-url-to-dirname/index.js": requireConvertUrlToDirname,
3067
- "/node_modules/@putout/plugin-putout/lib/declare/declarations.js": requireDeclarations,
3092
+ "/node_modules/@putout/plugin-putout/lib/declare": requireDeclare,
3068
3093
  "/node_modules/@putout/plugin-putout/lib/declare/index.js": requireDeclare,
3069
- "/node_modules/@putout/plugin-putout/lib/declare/operator.js": requireOperator,
3094
+ "/node_modules/@putout/plugin-putout/lib/includer": requireIncluder,
3070
3095
  "/node_modules/@putout/plugin-putout/lib/includer/index.js": requireIncluder,
3096
+ "/node_modules/@putout/plugin-putout/lib/move-require-on-top-level": requireMoveRequireOnTopLevel,
3071
3097
  "/node_modules/@putout/plugin-putout/lib/move-require-on-top-level/index.js": requireMoveRequireOnTopLevel,
3098
+ "/node_modules/@putout/plugin-putout/lib/rename-operate-to-operator": requireRenameOperateToOperator,
3072
3099
  "/node_modules/@putout/plugin-putout/lib/rename-operate-to-operator/index.js": requireRenameOperateToOperator,
3100
+ "/node_modules/@putout/plugin-putout/lib/replace-operate-with-operator": requireReplaceOperateWithOperator,
3073
3101
  "/node_modules/@putout/plugin-putout/lib/replace-operate-with-operator/index.js": requireReplaceOperateWithOperator,
3102
+ "/node_modules/@putout/plugin-putout/lib/replace-test-message": requireReplaceTestMessage,
3074
3103
  "/node_modules/@putout/plugin-putout/lib/replace-test-message/index.js": requireReplaceTestMessage,
3104
+ "/node_modules/@putout/plugin-putout/lib/shorten-imports": requireShortenImports,
3075
3105
  "/node_modules/@putout/plugin-putout/lib/shorten-imports/index.js": requireShortenImports
3076
3106
  });
3077
3107
  }
package/bundle/putout.js CHANGED
@@ -76217,7 +76217,7 @@ var print_1 = (ast, options = {}) => {
76217
76217
  });
76218
76218
  };
76219
76219
 
76220
- const {assign: assign$6} = Object;
76220
+ const {assign: assign$7} = Object;
76221
76221
 
76222
76222
  const {
76223
76223
  isFunctionExpression,
@@ -76235,7 +76235,7 @@ var traverseObjectExpression$1 = (propertiesPaths) => {
76235
76235
  if (isFunctionExpression(value)) {
76236
76236
  propPath.replaceWith(ObjectMethod('method', key, value.params, value.body, computed));
76237
76237
 
76238
- assign$6(propPath.node, {
76238
+ assign$7(propPath.node, {
76239
76239
  id: null,
76240
76240
  method: true,
76241
76241
  generator: value.generator,
@@ -76260,7 +76260,7 @@ const {
76260
76260
  classMethod,
76261
76261
  } = requireLib$a();
76262
76262
 
76263
- const {assign: assign$5} = Object;
76263
+ const {assign: assign$6} = Object;
76264
76264
 
76265
76265
  var setClassMethod$1 = (path) => {
76266
76266
  const {node} = path;
@@ -76288,7 +76288,7 @@ var setClassMethod$1 = (path) => {
76288
76288
  });
76289
76289
 
76290
76290
  path.replaceWith(method);
76291
- assign$5(path.node, {
76291
+ assign$6(path.node, {
76292
76292
  loc,
76293
76293
  expression,
76294
76294
  generator,
@@ -76414,12 +76414,12 @@ var convertImportDeclaration$1 = (path) => {
76414
76414
  path.node.assertions = assertions;
76415
76415
  };
76416
76416
 
76417
- const {assign: assign$4} = Object;
76417
+ const {assign: assign$5} = Object;
76418
76418
 
76419
76419
  var convertExportDeclaration$1 = (path) => {
76420
76420
  const {assertions = []} = path.node;
76421
76421
 
76422
- assign$4(path.node, {
76422
+ assign$5(path.node, {
76423
76423
  assertions,
76424
76424
  });
76425
76425
  };
@@ -83561,7 +83561,7 @@ function requireMoveOutDirectives () {
83561
83561
  return moveOutDirectives$1;
83562
83562
  }
83563
83563
 
83564
- const {assign: assign$3} = Object;
83564
+ const {assign: assign$4} = Object;
83565
83565
 
83566
83566
  const once$6 = once$9.exports;
83567
83567
 
@@ -83593,7 +83593,7 @@ babel$2.parse = function babelParse(source, {sourceFilename, isTS, isJSX = true,
83593
83593
  ]),
83594
83594
  };
83595
83595
 
83596
- sourceFilename && assign$3(parserOptions, {
83596
+ sourceFilename && assign$4(parserOptions, {
83597
83597
  sourceFilename,
83598
83598
  });
83599
83599
 
@@ -119399,7 +119399,7 @@ simpleImport$1.simpleImport = async (url) => {
119399
119399
  const tryToCatch = tryToCatch$1;
119400
119400
  const {simpleImport} = simpleImport$1;
119401
119401
 
119402
- const {assign: assign$2} = Object;
119402
+ const {assign: assign$3} = Object;
119403
119403
  const stub$2 = () => () => {};
119404
119404
 
119405
119405
  asyncLoader.createAsyncLoader = (type) => async (name, load) => {
@@ -119430,14 +119430,14 @@ async function cleverLoad(names, load = simpleImport) {
119430
119430
  if (e.code === 'ERR_MODULE_NOT_FOUND')
119431
119431
  continue;
119432
119432
 
119433
- assign$2(e, {
119433
+ assign$3(e, {
119434
119434
  message: `${name}: ${e.message}`,
119435
119435
  });
119436
119436
 
119437
119437
  return [e];
119438
119438
  }
119439
119439
 
119440
- assign$2(e, {
119440
+ assign$3(e, {
119441
119441
  message: e.message.replace(/\simported.*/, ''),
119442
119442
  });
119443
119443
 
@@ -119983,7 +119983,7 @@ var store = {};
119983
119983
  const {
119984
119984
  values,
119985
119985
  entries: entries$2,
119986
- assign: assign$1,
119986
+ assign: assign$2,
119987
119987
  } = Object;
119988
119988
 
119989
119989
  const toArray = (a) => Array.from(a);
@@ -120024,7 +120024,7 @@ store.upStore = createStore({
120024
120024
  },
120025
120025
  set(map, name, data) {
120026
120026
  map[name] = map[name] || {};
120027
- assign$1(map[name], data);
120027
+ assign$2(map[name], data);
120028
120028
  },
120029
120029
  });
120030
120030
 
@@ -120078,7 +120078,7 @@ const {
120078
120078
  const shouldSkip = (a) => !a.parent;
120079
120079
  const {merge: merge$1} = traverse$4.visitors;
120080
120080
 
120081
- const {assign} = Object;
120081
+ const {assign: assign$1} = Object;
120082
120082
  const parse = (name, plugin, options) => {
120083
120083
  const list = [];
120084
120084
 
@@ -120126,7 +120126,7 @@ var mergeVisitors$1 = (pluginsToMerge, {fix, shebang, template}) => {
120126
120126
  if (!visitor)
120127
120127
  throw Error(`Visitors cannot be empty in "${rule}"`);
120128
120128
 
120129
- assign(options, {
120129
+ assign$1(options, {
120130
120130
  include: parse('include', plugin, options),
120131
120131
  exclude: parse('exclude', plugin, options),
120132
120132
  });
@@ -131017,6 +131017,20 @@ function putout(...a) {
131017
131017
  return putoutExports(...a);
131018
131018
  }
131019
131019
 
131020
+ const {assign} = Object;
131021
+
131022
+ assign(putout, {
131023
+ parse: putoutExports.parse,
131024
+ print: putoutExports.print,
131025
+ traverse: putoutExports.traverse,
131026
+ generate: putoutExports.generate,
131027
+ template: putoutExports.template,
131028
+ operator: putoutExports.operator,
131029
+ transform: putoutExports.transform,
131030
+ findPlaces: putoutExports.findPlaces,
131031
+ types: putoutExports.types,
131032
+ });
131033
+
131020
131034
  var findPlaces = putoutExports.findPlaces;
131021
131035
  var generate$6 = putoutExports.generate;
131022
131036
  var operator = putoutExports.operator;
@@ -131025,4 +131039,5 @@ var print$3 = putoutExports.print;
131025
131039
  var template$4 = putoutExports.template;
131026
131040
  var transform$2 = putoutExports.transform;
131027
131041
  var traverse$9 = putoutExports.traverse;
131028
- export { putout as default, findPlaces, generate$6 as generate, operator, parse$8 as parse, print$3 as print, template$4 as template, transform$2 as transform, traverse$9 as traverse };
131042
+ var types$4 = putoutExports.types;
131043
+ export { putout as default, findPlaces, generate$6 as generate, operator, parse$8 as parse, print$3 as print, template$4 as template, transform$2 as transform, traverse$9 as traverse, types$4 as types };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/bundle",
3
- "version": "1.1.2",
3
+ "version": "1.1.5",
4
4
  "type": "module",
5
5
  "commitType": "colon",
6
6
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
@@ -29,8 +29,9 @@
29
29
  "fix:lint": "madrun fix:lint",
30
30
  "coverage": "madrun coverage",
31
31
  "report": "madrun report",
32
+ "build": "madrun build",
32
33
  "build:putout": "madrun build:putout",
33
- "build:plugin:putout": "madrun build:plugin:putout",
34
+ "build:plugins:putout": "madrun build:plugins:putout",
34
35
  "wisdom": "madrun wisdom"
35
36
  },
36
37
  "dependencies": {},