neo-cmp-cli 1.8.7 → 1.8.8

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.
Files changed (124) hide show
  1. package/bin/index.js +2 -2
  2. package/dist/_virtual/_commonjsHelpers.js +12 -0
  3. package/dist/_virtual/array-set.js +7 -0
  4. package/dist/_virtual/base64-vlq.js +7 -0
  5. package/dist/_virtual/base64.js +7 -0
  6. package/dist/_virtual/binary-search.js +7 -0
  7. package/dist/_virtual/mapping-list.js +7 -0
  8. package/dist/_virtual/quick-sort.js +7 -0
  9. package/dist/_virtual/source-map-consumer.js +7 -0
  10. package/dist/_virtual/source-map-generator.js +7 -0
  11. package/dist/_virtual/source-map-support.js +7 -0
  12. package/dist/_virtual/source-map.js +7 -0
  13. package/dist/_virtual/source-node.js +7 -0
  14. package/dist/_virtual/typescript.js +7 -0
  15. package/dist/_virtual/util.js +7 -0
  16. package/dist/config/auth.config.js +43 -0
  17. package/dist/config/default.config.js +192 -0
  18. package/dist/config/index.js +26 -0
  19. package/dist/main.js +9 -0
  20. package/dist/main2.js +259 -0
  21. package/dist/module/inspect.js +63 -0
  22. package/dist/module/neoInit.js +75 -0
  23. package/dist/module/neoInitByCopy.js +83 -0
  24. package/dist/neo/neoLogin.js +590 -0
  25. package/dist/neo/neoRequire.js +123 -0
  26. package/dist/neo/neoService.js +898 -0
  27. package/dist/node_modules/buffer-from/index.js +86 -0
  28. package/dist/node_modules/source-map/lib/array-set.js +138 -0
  29. package/dist/node_modules/source-map/lib/base64-vlq.js +157 -0
  30. package/dist/node_modules/source-map/lib/base64.js +83 -0
  31. package/dist/node_modules/source-map/lib/binary-search.js +129 -0
  32. package/dist/node_modules/source-map/lib/mapping-list.js +96 -0
  33. package/dist/node_modules/source-map/lib/quick-sort.js +130 -0
  34. package/dist/node_modules/source-map/lib/source-map-consumer.js +1166 -0
  35. package/dist/node_modules/source-map/lib/source-map-generator.js +445 -0
  36. package/dist/node_modules/source-map/lib/source-node.js +431 -0
  37. package/dist/node_modules/source-map/lib/util.js +506 -0
  38. package/dist/node_modules/source-map/source-map.js +27 -0
  39. package/dist/node_modules/source-map-support/source-map-support.js +646 -0
  40. package/dist/node_modules/typescript/lib/typescript.js +174130 -0
  41. package/dist/oss/publish2oss.js +331 -0
  42. package/dist/plugins/AddNeoRequirePlugin.js +195 -0
  43. package/dist/utils/autoEntryRootDir.js +103 -0
  44. package/dist/utils/cmpUtils/createCmpByTemplate.js +82 -0
  45. package/dist/utils/cmpUtils/createCmpByZip.js +433 -0
  46. package/dist/utils/cmpUtils/createCommonModulesCode.js +139 -0
  47. package/dist/utils/cmpUtils/deleteCmp.js +81 -0
  48. package/dist/utils/cmpUtils/getCmpModelRegisterCode.js +47 -0
  49. package/dist/utils/cmpUtils/getCmpPreviewCode.js +60 -0
  50. package/dist/utils/cmpUtils/getCmpRegisterCode.js +47 -0
  51. package/dist/utils/cmpUtils/getCmpTypeByDir.js +59 -0
  52. package/dist/utils/cmpUtils/hasCmpTypeByDir.js +27 -0
  53. package/dist/utils/cmpUtils/previewCmp.js +75 -0
  54. package/dist/utils/cmpUtils/pullCmp.js +126 -0
  55. package/dist/utils/cmpUtils/pushCmp.js +254 -0
  56. package/dist/utils/common.js +125 -0
  57. package/dist/utils/configureNeoBuild.js +129 -0
  58. package/dist/utils/generateEntries.js +80 -0
  59. package/dist/utils/neoConfigInit.js +30 -0
  60. package/dist/utils/neoParams.js +26 -0
  61. package/dist/utils/pathUtils.js +40 -0
  62. package/dist/utils/projectNameValidator.js +90 -0
  63. package/dist/utils/projectUtils/createCmpProjectByTemplate.js +81 -0
  64. package/dist/utils/projectUtils/createCmpProjectZip.js +141 -0
  65. package/dist/utils/projectUtils/getEntries.js +99 -0
  66. package/dist/utils/projectUtils/getEntriesWithAutoRegister.js +129 -0
  67. package/dist/utils/projectUtils/hasNeoProject.js +34 -0
  68. package/dist/utils/projectUtils/openProject.js +117 -0
  69. package/dist/utils/projectUtils/updatePublishLog.js +47 -0
  70. package/dist/utils/replaceInFilesByMap.js +71 -0
  71. package/dist/utils/replaceInPackage.js +151 -0
  72. package/dist/utils/resetPackageVersion.js +132 -0
  73. package/package.json +6 -8
  74. package/test/demo.js +0 -2
  75. package/src/config/auth.config.js +0 -27
  76. package/src/config/default.config.js +0 -176
  77. package/src/config/index.js +0 -9
  78. package/src/initData/defaultTemplate.html +0 -13
  79. package/src/initData/neo.config.js +0 -138
  80. package/src/main.js +0 -221
  81. package/src/module/inspect.js +0 -41
  82. package/src/module/neoInit.js +0 -55
  83. package/src/module/neoInitByCopy.js +0 -61
  84. package/src/neo/NeoUMDContent.js +0 -30
  85. package/src/neo/neoLogin.js +0 -565
  86. package/src/neo/neoRequire.js +0 -125
  87. package/src/neo/neoService.js +0 -874
  88. package/src/neo/webpack.mf.js +0 -60
  89. package/src/neo/wrapperContent.js +0 -16
  90. package/src/oss/publish2oss.js +0 -348
  91. package/src/plugins/AddNeoRequirePlugin-v1.js +0 -47
  92. package/src/plugins/AddNeoRequirePlugin.js +0 -179
  93. package/src/plugins/README.md +0 -109
  94. package/src/utils/autoEntryRootDir.js +0 -85
  95. package/src/utils/cmpUtils/createCmpByTemplate.js +0 -60
  96. package/src/utils/cmpUtils/createCmpByZip.js +0 -408
  97. package/src/utils/cmpUtils/createCommonModulesCode.js +0 -121
  98. package/src/utils/cmpUtils/deleteCmp.js +0 -63
  99. package/src/utils/cmpUtils/getCmpModelRegisterCode.js +0 -31
  100. package/src/utils/cmpUtils/getCmpPreviewCode.js +0 -43
  101. package/src/utils/cmpUtils/getCmpRegisterCode.js +0 -31
  102. package/src/utils/cmpUtils/getCmpTypeByDir.js +0 -41
  103. package/src/utils/cmpUtils/hasCmpTypeByDir.js +0 -11
  104. package/src/utils/cmpUtils/previewCmp.js +0 -55
  105. package/src/utils/cmpUtils/pullCmp.js +0 -104
  106. package/src/utils/cmpUtils/pushCmp.js +0 -230
  107. package/src/utils/common.js +0 -107
  108. package/src/utils/configureNeoBuild.js +0 -109
  109. package/src/utils/generateEntries.js +0 -63
  110. package/src/utils/neoConfigInit.js +0 -13
  111. package/src/utils/neoParams.js +0 -12
  112. package/src/utils/pathUtils.js +0 -23
  113. package/src/utils/projectNameValidator.js +0 -76
  114. package/src/utils/projectUtils/createCmpProjectByTemplate.js +0 -59
  115. package/src/utils/projectUtils/createCmpProjectZip.js +0 -120
  116. package/src/utils/projectUtils/getEntries.js +0 -80
  117. package/src/utils/projectUtils/getEntriesWithAutoRegister.js +0 -108
  118. package/src/utils/projectUtils/hasNeoProject.js +0 -17
  119. package/src/utils/projectUtils/openProject.js +0 -96
  120. package/src/utils/projectUtils/updatePublishLog.js +0 -30
  121. package/src/utils/replaceInFiles.js +0 -47
  122. package/src/utils/replaceInFilesByMap.js +0 -54
  123. package/src/utils/replaceInPackage.js +0 -134
  124. package/src/utils/resetPackageVersion.js +0 -115
@@ -0,0 +1,506 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const util = require('../../../_virtual/util.js');
6
+
7
+ /* -*- Mode: js; js-indent-level: 2; -*- */
8
+
9
+ var hasRequiredUtil;
10
+
11
+ function requireUtil () {
12
+ if (hasRequiredUtil) return util.__exports;
13
+ hasRequiredUtil = 1;
14
+ (function (exports$1) {
15
+ /*
16
+ * Copyright 2011 Mozilla Foundation and contributors
17
+ * Licensed under the New BSD license. See LICENSE or:
18
+ * http://opensource.org/licenses/BSD-3-Clause
19
+ */
20
+
21
+ /**
22
+ * This is a helper function for getting values from parameter/options
23
+ * objects.
24
+ *
25
+ * @param args The object we are extracting values from
26
+ * @param name The name of the property we are getting.
27
+ * @param defaultValue An optional value to return if the property is missing
28
+ * from the object. If this is not specified and the property is missing, an
29
+ * error will be thrown.
30
+ */
31
+ function getArg(aArgs, aName, aDefaultValue) {
32
+ if (aName in aArgs) {
33
+ return aArgs[aName];
34
+ } else if (arguments.length === 3) {
35
+ return aDefaultValue;
36
+ } else {
37
+ throw new Error('"' + aName + '" is a required argument.');
38
+ }
39
+ }
40
+ exports$1.getArg = getArg;
41
+
42
+ var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
43
+ var dataUrlRegexp = /^data:.+\,.+$/;
44
+
45
+ function urlParse(aUrl) {
46
+ var match = aUrl.match(urlRegexp);
47
+ if (!match) {
48
+ return null;
49
+ }
50
+ return {
51
+ scheme: match[1],
52
+ auth: match[2],
53
+ host: match[3],
54
+ port: match[4],
55
+ path: match[5]
56
+ };
57
+ }
58
+ exports$1.urlParse = urlParse;
59
+
60
+ function urlGenerate(aParsedUrl) {
61
+ var url = '';
62
+ if (aParsedUrl.scheme) {
63
+ url += aParsedUrl.scheme + ':';
64
+ }
65
+ url += '//';
66
+ if (aParsedUrl.auth) {
67
+ url += aParsedUrl.auth + '@';
68
+ }
69
+ if (aParsedUrl.host) {
70
+ url += aParsedUrl.host;
71
+ }
72
+ if (aParsedUrl.port) {
73
+ url += ":" + aParsedUrl.port;
74
+ }
75
+ if (aParsedUrl.path) {
76
+ url += aParsedUrl.path;
77
+ }
78
+ return url;
79
+ }
80
+ exports$1.urlGenerate = urlGenerate;
81
+
82
+ /**
83
+ * Normalizes a path, or the path portion of a URL:
84
+ *
85
+ * - Replaces consecutive slashes with one slash.
86
+ * - Removes unnecessary '.' parts.
87
+ * - Removes unnecessary '<dir>/..' parts.
88
+ *
89
+ * Based on code in the Node.js 'path' core module.
90
+ *
91
+ * @param aPath The path or url to normalize.
92
+ */
93
+ function normalize(aPath) {
94
+ var path = aPath;
95
+ var url = urlParse(aPath);
96
+ if (url) {
97
+ if (!url.path) {
98
+ return aPath;
99
+ }
100
+ path = url.path;
101
+ }
102
+ var isAbsolute = exports$1.isAbsolute(path);
103
+
104
+ var parts = path.split(/\/+/);
105
+ for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
106
+ part = parts[i];
107
+ if (part === '.') {
108
+ parts.splice(i, 1);
109
+ } else if (part === '..') {
110
+ up++;
111
+ } else if (up > 0) {
112
+ if (part === '') {
113
+ // The first part is blank if the path is absolute. Trying to go
114
+ // above the root is a no-op. Therefore we can remove all '..' parts
115
+ // directly after the root.
116
+ parts.splice(i + 1, up);
117
+ up = 0;
118
+ } else {
119
+ parts.splice(i, 2);
120
+ up--;
121
+ }
122
+ }
123
+ }
124
+ path = parts.join('/');
125
+
126
+ if (path === '') {
127
+ path = isAbsolute ? '/' : '.';
128
+ }
129
+
130
+ if (url) {
131
+ url.path = path;
132
+ return urlGenerate(url);
133
+ }
134
+ return path;
135
+ }
136
+ exports$1.normalize = normalize;
137
+
138
+ /**
139
+ * Joins two paths/URLs.
140
+ *
141
+ * @param aRoot The root path or URL.
142
+ * @param aPath The path or URL to be joined with the root.
143
+ *
144
+ * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
145
+ * scheme-relative URL: Then the scheme of aRoot, if any, is prepended
146
+ * first.
147
+ * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
148
+ * is updated with the result and aRoot is returned. Otherwise the result
149
+ * is returned.
150
+ * - If aPath is absolute, the result is aPath.
151
+ * - Otherwise the two paths are joined with a slash.
152
+ * - Joining for example 'http://' and 'www.example.com' is also supported.
153
+ */
154
+ function join(aRoot, aPath) {
155
+ if (aRoot === "") {
156
+ aRoot = ".";
157
+ }
158
+ if (aPath === "") {
159
+ aPath = ".";
160
+ }
161
+ var aPathUrl = urlParse(aPath);
162
+ var aRootUrl = urlParse(aRoot);
163
+ if (aRootUrl) {
164
+ aRoot = aRootUrl.path || '/';
165
+ }
166
+
167
+ // `join(foo, '//www.example.org')`
168
+ if (aPathUrl && !aPathUrl.scheme) {
169
+ if (aRootUrl) {
170
+ aPathUrl.scheme = aRootUrl.scheme;
171
+ }
172
+ return urlGenerate(aPathUrl);
173
+ }
174
+
175
+ if (aPathUrl || aPath.match(dataUrlRegexp)) {
176
+ return aPath;
177
+ }
178
+
179
+ // `join('http://', 'www.example.com')`
180
+ if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
181
+ aRootUrl.host = aPath;
182
+ return urlGenerate(aRootUrl);
183
+ }
184
+
185
+ var joined = aPath.charAt(0) === '/'
186
+ ? aPath
187
+ : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
188
+
189
+ if (aRootUrl) {
190
+ aRootUrl.path = joined;
191
+ return urlGenerate(aRootUrl);
192
+ }
193
+ return joined;
194
+ }
195
+ exports$1.join = join;
196
+
197
+ exports$1.isAbsolute = function (aPath) {
198
+ return aPath.charAt(0) === '/' || urlRegexp.test(aPath);
199
+ };
200
+
201
+ /**
202
+ * Make a path relative to a URL or another path.
203
+ *
204
+ * @param aRoot The root path or URL.
205
+ * @param aPath The path or URL to be made relative to aRoot.
206
+ */
207
+ function relative(aRoot, aPath) {
208
+ if (aRoot === "") {
209
+ aRoot = ".";
210
+ }
211
+
212
+ aRoot = aRoot.replace(/\/$/, '');
213
+
214
+ // It is possible for the path to be above the root. In this case, simply
215
+ // checking whether the root is a prefix of the path won't work. Instead, we
216
+ // need to remove components from the root one by one, until either we find
217
+ // a prefix that fits, or we run out of components to remove.
218
+ var level = 0;
219
+ while (aPath.indexOf(aRoot + '/') !== 0) {
220
+ var index = aRoot.lastIndexOf("/");
221
+ if (index < 0) {
222
+ return aPath;
223
+ }
224
+
225
+ // If the only part of the root that is left is the scheme (i.e. http://,
226
+ // file:///, etc.), one or more slashes (/), or simply nothing at all, we
227
+ // have exhausted all components, so the path is not relative to the root.
228
+ aRoot = aRoot.slice(0, index);
229
+ if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
230
+ return aPath;
231
+ }
232
+
233
+ ++level;
234
+ }
235
+
236
+ // Make sure we add a "../" for each component we removed from the root.
237
+ return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
238
+ }
239
+ exports$1.relative = relative;
240
+
241
+ var supportsNullProto = (function () {
242
+ var obj = Object.create(null);
243
+ return !('__proto__' in obj);
244
+ }());
245
+
246
+ function identity (s) {
247
+ return s;
248
+ }
249
+
250
+ /**
251
+ * Because behavior goes wacky when you set `__proto__` on objects, we
252
+ * have to prefix all the strings in our set with an arbitrary character.
253
+ *
254
+ * See https://github.com/mozilla/source-map/pull/31 and
255
+ * https://github.com/mozilla/source-map/issues/30
256
+ *
257
+ * @param String aStr
258
+ */
259
+ function toSetString(aStr) {
260
+ if (isProtoString(aStr)) {
261
+ return '$' + aStr;
262
+ }
263
+
264
+ return aStr;
265
+ }
266
+ exports$1.toSetString = supportsNullProto ? identity : toSetString;
267
+
268
+ function fromSetString(aStr) {
269
+ if (isProtoString(aStr)) {
270
+ return aStr.slice(1);
271
+ }
272
+
273
+ return aStr;
274
+ }
275
+ exports$1.fromSetString = supportsNullProto ? identity : fromSetString;
276
+
277
+ function isProtoString(s) {
278
+ if (!s) {
279
+ return false;
280
+ }
281
+
282
+ var length = s.length;
283
+
284
+ if (length < 9 /* "__proto__".length */) {
285
+ return false;
286
+ }
287
+
288
+ if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||
289
+ s.charCodeAt(length - 2) !== 95 /* '_' */ ||
290
+ s.charCodeAt(length - 3) !== 111 /* 'o' */ ||
291
+ s.charCodeAt(length - 4) !== 116 /* 't' */ ||
292
+ s.charCodeAt(length - 5) !== 111 /* 'o' */ ||
293
+ s.charCodeAt(length - 6) !== 114 /* 'r' */ ||
294
+ s.charCodeAt(length - 7) !== 112 /* 'p' */ ||
295
+ s.charCodeAt(length - 8) !== 95 /* '_' */ ||
296
+ s.charCodeAt(length - 9) !== 95 /* '_' */) {
297
+ return false;
298
+ }
299
+
300
+ for (var i = length - 10; i >= 0; i--) {
301
+ if (s.charCodeAt(i) !== 36 /* '$' */) {
302
+ return false;
303
+ }
304
+ }
305
+
306
+ return true;
307
+ }
308
+
309
+ /**
310
+ * Comparator between two mappings where the original positions are compared.
311
+ *
312
+ * Optionally pass in `true` as `onlyCompareGenerated` to consider two
313
+ * mappings with the same original source/line/column, but different generated
314
+ * line and column the same. Useful when searching for a mapping with a
315
+ * stubbed out mapping.
316
+ */
317
+ function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
318
+ var cmp = strcmp(mappingA.source, mappingB.source);
319
+ if (cmp !== 0) {
320
+ return cmp;
321
+ }
322
+
323
+ cmp = mappingA.originalLine - mappingB.originalLine;
324
+ if (cmp !== 0) {
325
+ return cmp;
326
+ }
327
+
328
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
329
+ if (cmp !== 0 || onlyCompareOriginal) {
330
+ return cmp;
331
+ }
332
+
333
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
334
+ if (cmp !== 0) {
335
+ return cmp;
336
+ }
337
+
338
+ cmp = mappingA.generatedLine - mappingB.generatedLine;
339
+ if (cmp !== 0) {
340
+ return cmp;
341
+ }
342
+
343
+ return strcmp(mappingA.name, mappingB.name);
344
+ }
345
+ exports$1.compareByOriginalPositions = compareByOriginalPositions;
346
+
347
+ /**
348
+ * Comparator between two mappings with deflated source and name indices where
349
+ * the generated positions are compared.
350
+ *
351
+ * Optionally pass in `true` as `onlyCompareGenerated` to consider two
352
+ * mappings with the same generated line and column, but different
353
+ * source/name/original line and column the same. Useful when searching for a
354
+ * mapping with a stubbed out mapping.
355
+ */
356
+ function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
357
+ var cmp = mappingA.generatedLine - mappingB.generatedLine;
358
+ if (cmp !== 0) {
359
+ return cmp;
360
+ }
361
+
362
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
363
+ if (cmp !== 0 || onlyCompareGenerated) {
364
+ return cmp;
365
+ }
366
+
367
+ cmp = strcmp(mappingA.source, mappingB.source);
368
+ if (cmp !== 0) {
369
+ return cmp;
370
+ }
371
+
372
+ cmp = mappingA.originalLine - mappingB.originalLine;
373
+ if (cmp !== 0) {
374
+ return cmp;
375
+ }
376
+
377
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
378
+ if (cmp !== 0) {
379
+ return cmp;
380
+ }
381
+
382
+ return strcmp(mappingA.name, mappingB.name);
383
+ }
384
+ exports$1.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
385
+
386
+ function strcmp(aStr1, aStr2) {
387
+ if (aStr1 === aStr2) {
388
+ return 0;
389
+ }
390
+
391
+ if (aStr1 === null) {
392
+ return 1; // aStr2 !== null
393
+ }
394
+
395
+ if (aStr2 === null) {
396
+ return -1; // aStr1 !== null
397
+ }
398
+
399
+ if (aStr1 > aStr2) {
400
+ return 1;
401
+ }
402
+
403
+ return -1;
404
+ }
405
+
406
+ /**
407
+ * Comparator between two mappings with inflated source and name strings where
408
+ * the generated positions are compared.
409
+ */
410
+ function compareByGeneratedPositionsInflated(mappingA, mappingB) {
411
+ var cmp = mappingA.generatedLine - mappingB.generatedLine;
412
+ if (cmp !== 0) {
413
+ return cmp;
414
+ }
415
+
416
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
417
+ if (cmp !== 0) {
418
+ return cmp;
419
+ }
420
+
421
+ cmp = strcmp(mappingA.source, mappingB.source);
422
+ if (cmp !== 0) {
423
+ return cmp;
424
+ }
425
+
426
+ cmp = mappingA.originalLine - mappingB.originalLine;
427
+ if (cmp !== 0) {
428
+ return cmp;
429
+ }
430
+
431
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
432
+ if (cmp !== 0) {
433
+ return cmp;
434
+ }
435
+
436
+ return strcmp(mappingA.name, mappingB.name);
437
+ }
438
+ exports$1.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
439
+
440
+ /**
441
+ * Strip any JSON XSSI avoidance prefix from the string (as documented
442
+ * in the source maps specification), and then parse the string as
443
+ * JSON.
444
+ */
445
+ function parseSourceMapInput(str) {
446
+ return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ''));
447
+ }
448
+ exports$1.parseSourceMapInput = parseSourceMapInput;
449
+
450
+ /**
451
+ * Compute the URL of a source given the the source root, the source's
452
+ * URL, and the source map's URL.
453
+ */
454
+ function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
455
+ sourceURL = sourceURL || '';
456
+
457
+ if (sourceRoot) {
458
+ // This follows what Chrome does.
459
+ if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {
460
+ sourceRoot += '/';
461
+ }
462
+ // The spec says:
463
+ // Line 4: An optional source root, useful for relocating source
464
+ // files on a server or removing repeated values in the
465
+ // “sources” entry. This value is prepended to the individual
466
+ // entries in the “source” field.
467
+ sourceURL = sourceRoot + sourceURL;
468
+ }
469
+
470
+ // Historically, SourceMapConsumer did not take the sourceMapURL as
471
+ // a parameter. This mode is still somewhat supported, which is why
472
+ // this code block is conditional. However, it's preferable to pass
473
+ // the source map URL to SourceMapConsumer, so that this function
474
+ // can implement the source URL resolution algorithm as outlined in
475
+ // the spec. This block is basically the equivalent of:
476
+ // new URL(sourceURL, sourceMapURL).toString()
477
+ // ... except it avoids using URL, which wasn't available in the
478
+ // older releases of node still supported by this library.
479
+ //
480
+ // The spec says:
481
+ // If the sources are not absolute URLs after prepending of the
482
+ // “sourceRoot”, the sources are resolved relative to the
483
+ // SourceMap (like resolving script src in a html document).
484
+ if (sourceMapURL) {
485
+ var parsed = urlParse(sourceMapURL);
486
+ if (!parsed) {
487
+ throw new Error("sourceMapURL could not be parsed");
488
+ }
489
+ if (parsed.path) {
490
+ // Strip the last path component, but keep the "/".
491
+ var index = parsed.path.lastIndexOf('/');
492
+ if (index >= 0) {
493
+ parsed.path = parsed.path.substring(0, index + 1);
494
+ }
495
+ }
496
+ sourceURL = join(urlGenerate(parsed), sourceURL);
497
+ }
498
+
499
+ return normalize(sourceURL);
500
+ }
501
+ exports$1.computeSourceURL = computeSourceURL;
502
+ } (util.__exports));
503
+ return util.__exports;
504
+ }
505
+
506
+ exports.__require = requireUtil;
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const sourceMap = require('../../_virtual/source-map.js');
6
+ const sourceMapGenerator = require('./lib/source-map-generator.js');
7
+ const sourceMapConsumer = require('./lib/source-map-consumer.js');
8
+ const sourceNode = require('./lib/source-node.js');
9
+
10
+ /*
11
+ * Copyright 2009-2011 Mozilla Foundation and contributors
12
+ * Licensed under the New BSD license. See LICENSE.txt or:
13
+ * http://opensource.org/licenses/BSD-3-Clause
14
+ */
15
+
16
+ var hasRequiredSourceMap;
17
+
18
+ function requireSourceMap () {
19
+ if (hasRequiredSourceMap) return sourceMap.__exports;
20
+ hasRequiredSourceMap = 1;
21
+ sourceMap.__exports.SourceMapGenerator = sourceMapGenerator.__require().SourceMapGenerator;
22
+ sourceMap.__exports.SourceMapConsumer = sourceMapConsumer.__require().SourceMapConsumer;
23
+ sourceMap.__exports.SourceNode = sourceNode.__require().SourceNode;
24
+ return sourceMap.__exports;
25
+ }
26
+
27
+ exports.__require = requireSourceMap;