app-bundler 0.2.7 → 0.2.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.
- package/lib/bundler.js +1421 -1411
- package/lib/cli.js +1421 -1411
- package/package.json +1 -1
package/lib/bundler.js
CHANGED
|
@@ -4987,8 +4987,9 @@ var __register, __require, require;
|
|
|
4987
4987
|
// source ./ESM.js
|
|
4988
4988
|
$CUSTOM_IMPORTS_CODE$
|
|
4989
4989
|
|
|
4990
|
+
var exports = {};
|
|
4990
4991
|
var module = {
|
|
4991
|
-
exports:
|
|
4992
|
+
exports: exports
|
|
4992
4993
|
};
|
|
4993
4994
|
|
|
4994
4995
|
$MODULE$
|
|
@@ -5237,115 +5238,89 @@ exports.template_stringifyContent = template_stringifyContent;
|
|
|
5237
5238
|
|
|
5238
5239
|
|
|
5239
5240
|
// source ./ModuleSimplified.js
|
|
5240
|
-
var
|
|
5241
|
+
var _src_handlers_script_import_js_utils;
|
|
5241
5242
|
(function () {
|
|
5242
5243
|
// ensure AMD is not active for the model, so that any UMD exports as commonjs
|
|
5243
5244
|
var define = null;
|
|
5244
|
-
var exports =
|
|
5245
|
+
var exports = _src_handlers_script_import_js_utils != null ? _src_handlers_script_import_js_utils : {};
|
|
5245
5246
|
var module = { exports: exports };
|
|
5246
5247
|
|
|
5247
5248
|
"use strict";
|
|
5248
5249
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5249
|
-
exports.
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
wrapSimple(body) {
|
|
5279
|
-
return Templates_1.Templates
|
|
5280
|
-
.RootModule
|
|
5281
|
-
.replace('%BUNDLE%', () => body);
|
|
5282
|
-
}
|
|
5283
|
-
wrapWithIIF(body) {
|
|
5284
|
-
return Templates_1.Templates
|
|
5285
|
-
.RootModuleWrapped
|
|
5286
|
-
.replace('%BUNDLE%', () => body);
|
|
5287
|
-
}
|
|
5288
|
-
wrapWithUMD(body) {
|
|
5289
|
-
let opts = this.solution.opts.package;
|
|
5290
|
-
let name = opts.moduleName || '';
|
|
5291
|
-
return Templates_1.Templates
|
|
5292
|
-
.UMD
|
|
5293
|
-
.replace('%MODULE%', () => body)
|
|
5294
|
-
.replace('%NAME%', () => name);
|
|
5250
|
+
exports.u_asString = exports.u_readFile = exports.u_getFilesFromPath = exports.u_makeIndent = exports.u_getIndent = exports.u_getNewLine = void 0;
|
|
5251
|
+
function u_getNewLine(str, io) {
|
|
5252
|
+
var match = /(\r\n)|(\r)|(\n)/.exec(str);
|
|
5253
|
+
return (match && match[0]) || io.env.newLine;
|
|
5254
|
+
}
|
|
5255
|
+
exports.u_getNewLine = u_getNewLine;
|
|
5256
|
+
;
|
|
5257
|
+
function u_getIndent(str) {
|
|
5258
|
+
var match = /^[ \t]+/.exec(str);
|
|
5259
|
+
return match && match[0] || '';
|
|
5260
|
+
}
|
|
5261
|
+
exports.u_getIndent = u_getIndent;
|
|
5262
|
+
;
|
|
5263
|
+
function u_makeIndent(str, indent, io) {
|
|
5264
|
+
if (!indent || !str)
|
|
5265
|
+
return str;
|
|
5266
|
+
let newline = u_getNewLine(str, io);
|
|
5267
|
+
return str
|
|
5268
|
+
.split(newline)
|
|
5269
|
+
.map(line => indent + line)
|
|
5270
|
+
.join(newline);
|
|
5271
|
+
}
|
|
5272
|
+
exports.u_makeIndent = u_makeIndent;
|
|
5273
|
+
;
|
|
5274
|
+
function u_getFilesFromPath(path, io) {
|
|
5275
|
+
var file = new io.File(path);
|
|
5276
|
+
if (file.exists() === false) {
|
|
5277
|
+
console.error('File not found', file.uri.toLocalFile());
|
|
5278
|
+
return [];
|
|
5295
5279
|
}
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
});
|
|
5309
|
-
let strImports = arr.map(item => `import ${item.key} from '${item.url}';`).join('\n');
|
|
5310
|
-
let strCollection = `const bundlerDynamicRepository = {};\n`
|
|
5311
|
-
+ arr.map(item => `bundlerDynamicRepository['${item.url}'] = ${item.key};`)
|
|
5312
|
-
.join('\n');
|
|
5313
|
-
let strRequire = [
|
|
5314
|
-
`var bundlerOriginalRequire = require || function (url) { throw new Error('Not found: ' + url); };`,
|
|
5315
|
-
`var require = function (url) { return bundlerDynamicRepository[url] || bundlerOriginalRequire(url); };`
|
|
5316
|
-
].join('\n');
|
|
5317
|
-
importsCode = [
|
|
5318
|
-
strImports,
|
|
5319
|
-
strCollection,
|
|
5320
|
-
strRequire
|
|
5321
|
-
].join('\n');
|
|
5322
|
-
}
|
|
5323
|
-
return Templates_1.Templates
|
|
5324
|
-
.ESM
|
|
5325
|
-
.replace('$CUSTOM_IMPORTS_CODE$', () => importsCode)
|
|
5326
|
-
.replace('$CUSTOM_EXPORTS_CODE$', () => exportsCode)
|
|
5327
|
-
.replace('$MODULE$', () => body);
|
|
5280
|
+
return [file];
|
|
5281
|
+
}
|
|
5282
|
+
exports.u_getFilesFromPath = u_getFilesFromPath;
|
|
5283
|
+
;
|
|
5284
|
+
function u_readFile(io, file, indent, insertFileName) {
|
|
5285
|
+
var content = file.read().toString();
|
|
5286
|
+
var newline = u_getNewLine(content, io);
|
|
5287
|
+
if (indent) {
|
|
5288
|
+
content = content
|
|
5289
|
+
.split(newline)
|
|
5290
|
+
.map(line => indent + line)
|
|
5291
|
+
.join(newline);
|
|
5328
5292
|
}
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5293
|
+
if (insertFileName) {
|
|
5294
|
+
content = indent
|
|
5295
|
+
+ '// source '
|
|
5296
|
+
+ file.uri.file
|
|
5297
|
+
+ newline
|
|
5298
|
+
+ content;
|
|
5334
5299
|
}
|
|
5300
|
+
return content;
|
|
5335
5301
|
}
|
|
5336
|
-
exports.
|
|
5337
|
-
|
|
5338
|
-
|
|
5302
|
+
exports.u_readFile = u_readFile;
|
|
5303
|
+
;
|
|
5304
|
+
function u_asString(str) {
|
|
5305
|
+
str = str
|
|
5306
|
+
.replace(/[\n\r]/g, '\\n')
|
|
5307
|
+
.replace(/"/g, '\\"');
|
|
5308
|
+
return `"${str}"`;
|
|
5309
|
+
}
|
|
5310
|
+
exports.u_asString = u_asString;
|
|
5311
|
+
;
|
|
5312
|
+
//# sourceMappingURL=utils.js.map
|
|
5313
|
+
//# sourceMappingURL=utils.ts.map;
|
|
5339
5314
|
|
|
5340
5315
|
function __isObj(x) {
|
|
5341
5316
|
return x != null && typeof x === 'object' && x.constructor === Object;
|
|
5342
5317
|
}
|
|
5343
|
-
if (
|
|
5318
|
+
if (_src_handlers_script_import_js_utils === module.exports) {
|
|
5344
5319
|
// do nothing if
|
|
5345
|
-
} else if (__isObj(
|
|
5346
|
-
Object.assign(
|
|
5320
|
+
} else if (__isObj(_src_handlers_script_import_js_utils) && __isObj(module.exports)) {
|
|
5321
|
+
Object.assign(_src_handlers_script_import_js_utils, module.exports);
|
|
5347
5322
|
} else {
|
|
5348
|
-
|
|
5323
|
+
_src_handlers_script_import_js_utils = module.exports;
|
|
5349
5324
|
}
|
|
5350
5325
|
|
|
5351
5326
|
;
|
|
@@ -5355,215 +5330,107 @@ exports.ModuleWrapper = ModuleWrapper;
|
|
|
5355
5330
|
|
|
5356
5331
|
|
|
5357
5332
|
// source ./ModuleSimplified.js
|
|
5358
|
-
var
|
|
5333
|
+
var _src_handlers_script_import_js_Dictionary;
|
|
5359
5334
|
(function () {
|
|
5360
5335
|
// ensure AMD is not active for the model, so that any UMD exports as commonjs
|
|
5361
5336
|
var define = null;
|
|
5362
|
-
var exports =
|
|
5337
|
+
var exports = _src_handlers_script_import_js_Dictionary != null ? _src_handlers_script_import_js_Dictionary : {};
|
|
5363
5338
|
var module = { exports: exports };
|
|
5364
5339
|
|
|
5365
5340
|
"use strict";
|
|
5366
5341
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5367
|
-
exports.
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
const ModuleWrapper_1 = _src_handlers_script_common_js_ModuleWrapper;
|
|
5373
|
-
class CommonJsBuilder extends BaseScriptBuilder_1.BaseScriptBuilder {
|
|
5374
|
-
constructor(solution, handler) {
|
|
5375
|
-
super(solution, handler);
|
|
5376
|
-
this.solution = solution;
|
|
5377
|
-
this.handler = handler;
|
|
5378
|
-
var opts = this.solution.opts.package.commonjs;
|
|
5379
|
-
if (opts && opts.output === 'simplified') {
|
|
5380
|
-
this.wrapModule = CommonJsBuilderSimplified_1.CommonJsBuilderSimplified.wrapModule;
|
|
5381
|
-
this.getRootContent = CommonJsBuilderSimplified_1.CommonJsBuilderSimplified.getRootContent;
|
|
5382
|
-
this.getHeaderContent = CommonJsBuilderSimplified_1.CommonJsBuilderSimplified.getHeaderContent;
|
|
5383
|
-
}
|
|
5342
|
+
exports.Dictionary = void 0;
|
|
5343
|
+
class Dictionary {
|
|
5344
|
+
constructor() {
|
|
5345
|
+
this.hash = {};
|
|
5346
|
+
this.arr = [];
|
|
5384
5347
|
}
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
|
|
5348
|
+
add(...arr) {
|
|
5349
|
+
for (let i = 0; i < arr.length; i++) {
|
|
5350
|
+
let x = arr[i];
|
|
5351
|
+
if (this.hash[x.id] != null) {
|
|
5352
|
+
continue;
|
|
5353
|
+
}
|
|
5354
|
+
this.hash[x.id] = x;
|
|
5355
|
+
this.arr.push(x);
|
|
5392
5356
|
}
|
|
5393
|
-
return module === 'commonjs';
|
|
5394
5357
|
}
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
|
|
5398
|
-
opts.commonjs = {
|
|
5399
|
-
addHeading: true,
|
|
5400
|
-
hasHeading: false
|
|
5401
|
-
};
|
|
5402
|
-
}
|
|
5403
|
-
;
|
|
5404
|
-
var body = '';
|
|
5405
|
-
if (opts.commonjs.hasHeading === false && opts.commonjs.addHeading === true) {
|
|
5406
|
-
opts.commonjs.hasHeading = true;
|
|
5407
|
-
body = this.getHeaderContent();
|
|
5358
|
+
insert(x, i) {
|
|
5359
|
+
if (this.hash[x.id] != null) {
|
|
5360
|
+
this.remove(x);
|
|
5408
5361
|
}
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
.Module
|
|
5412
|
-
.replace('%MODULE_PATH%', () => url)
|
|
5413
|
-
.replace('%MODULE%', () => content)
|
|
5414
|
-
.replace('%FOOTER%', () => { var _a, _b; return ((_b = (_a = setts === null || setts === void 0 ? void 0 : setts.partials) === null || _a === void 0 ? void 0 : _a.footer) !== null && _b !== void 0 ? _b : ''); });
|
|
5415
|
-
return body + module;
|
|
5362
|
+
this.hash[x.id] = x;
|
|
5363
|
+
this.arr.splice(i, 0, x);
|
|
5416
5364
|
}
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
return Templates_1.Templates
|
|
5420
|
-
.Header
|
|
5421
|
-
.replace('%ROOT_DIR%', () => mainUrl);
|
|
5365
|
+
has(x) {
|
|
5366
|
+
return this.hash[x.id] != null;
|
|
5422
5367
|
}
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
.map(x => {
|
|
5428
|
-
let content = x.content;
|
|
5429
|
-
if (x.type === 'css') {
|
|
5430
|
-
content = (0, template_1.template_interpolate)(Templates_1.Templates.Style, { body: (0, template_1.template_stringifyContent)(content), url: x.url });
|
|
5431
|
-
}
|
|
5432
|
-
if (x.type === 'mask') {
|
|
5433
|
-
content = (0, template_1.template_interpolate)(Templates_1.Templates.Mask, { body: (0, template_1.template_stringifyContent)(content), url: x.url });
|
|
5368
|
+
indexOf(x) {
|
|
5369
|
+
for (let i = 0; i < this.arr.length; i++) {
|
|
5370
|
+
if (this.arr[i].id === x.id) {
|
|
5371
|
+
return i;
|
|
5434
5372
|
}
|
|
5435
|
-
|
|
5436
|
-
|
|
5437
|
-
.concat([content])
|
|
5438
|
-
.join('\n');
|
|
5439
|
-
var wrapper = new ModuleWrapper_1.ModuleWrapper(this.solution);
|
|
5440
|
-
root.content = wrapper.wrap(body);
|
|
5373
|
+
}
|
|
5374
|
+
return -1;
|
|
5441
5375
|
}
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
exports.CommonJsBuilder = CommonJsBuilder;
|
|
5447
|
-
;
|
|
5448
|
-
//# sourceMappingURL=CommonJsBuilder.js.map
|
|
5449
|
-
//# sourceMappingURL=CommonJsBuilder.ts.map;
|
|
5450
|
-
|
|
5451
|
-
function __isObj(x) {
|
|
5452
|
-
return x != null && typeof x === 'object' && x.constructor === Object;
|
|
5453
|
-
}
|
|
5454
|
-
if (_src_handlers_script_common_js_CommonJsBuilder === module.exports) {
|
|
5455
|
-
// do nothing if
|
|
5456
|
-
} else if (__isObj(_src_handlers_script_common_js_CommonJsBuilder) && __isObj(module.exports)) {
|
|
5457
|
-
Object.assign(_src_handlers_script_common_js_CommonJsBuilder, module.exports);
|
|
5458
|
-
} else {
|
|
5459
|
-
_src_handlers_script_common_js_CommonJsBuilder = module.exports;
|
|
5460
|
-
}
|
|
5461
|
-
|
|
5462
|
-
;
|
|
5463
|
-
}());
|
|
5464
|
-
|
|
5465
|
-
// end:source ./ModuleSimplified.js
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
// source ./ModuleSimplified.js
|
|
5469
|
-
var _src_handlers_script_common_js_CommonJsPathResolver;
|
|
5470
|
-
(function () {
|
|
5471
|
-
// ensure AMD is not active for the model, so that any UMD exports as commonjs
|
|
5472
|
-
var define = null;
|
|
5473
|
-
var exports = _src_handlers_script_common_js_CommonJsPathResolver != null ? _src_handlers_script_common_js_CommonJsPathResolver : {};
|
|
5474
|
-
var module = { exports: exports };
|
|
5475
|
-
|
|
5476
|
-
"use strict";
|
|
5477
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5478
|
-
exports.CommonJsPathResolver = void 0;
|
|
5479
|
-
const BasePathResolver_1 = _src_handlers_base_BasePathResolver;
|
|
5480
|
-
const path_1 = _src_utils_path;
|
|
5481
|
-
const global_1 = _src_global;
|
|
5482
|
-
class CommonJsPathResolver extends BasePathResolver_1.BasePathResolver {
|
|
5483
|
-
accepts(includeData) {
|
|
5484
|
-
if (includeData.type !== 'js' || includeData.module !== 'commonjs') {
|
|
5485
|
-
return false;
|
|
5486
|
-
}
|
|
5487
|
-
if (!/^[\w\-/]+$/.test(includeData.url)) {
|
|
5488
|
-
return false;
|
|
5489
|
-
}
|
|
5490
|
-
if (nodeCoreModules.indexOf(includeData.url) !== -1) {
|
|
5491
|
-
return false;
|
|
5492
|
-
}
|
|
5493
|
-
return true;
|
|
5494
|
-
}
|
|
5495
|
-
resolve(includeData, parentResource) {
|
|
5496
|
-
let filename = nodeModuleResolve(includeData.url, parentResource.directory);
|
|
5497
|
-
if (filename) {
|
|
5498
|
-
let url = this.solution.opts.toAppUrl(filename);
|
|
5499
|
-
this.solution.opts.mappings[includeData.url] = url;
|
|
5500
|
-
}
|
|
5501
|
-
return filename;
|
|
5376
|
+
remove(x) {
|
|
5377
|
+
delete this.hash[x.id];
|
|
5378
|
+
let i = this.arr.findIndex(module => module.id === x.id);
|
|
5379
|
+
this.arr.splice(i, 1);
|
|
5502
5380
|
}
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
if (global_1.io.File.exists(pckg) === false) {
|
|
5522
|
-
let next = current.replace(/[^\/\\]+[\/\\]?$/, '');
|
|
5523
|
-
if (next === current) {
|
|
5524
|
-
return root_ + 'package.json';
|
|
5381
|
+
removeByFn(fn) {
|
|
5382
|
+
let handled = new Dictionary();
|
|
5383
|
+
while (true) {
|
|
5384
|
+
let i = -1, length = this.arr.length;
|
|
5385
|
+
while (++i < length) {
|
|
5386
|
+
let x = this.arr[i];
|
|
5387
|
+
if (handled.has(x)) {
|
|
5388
|
+
continue;
|
|
5389
|
+
}
|
|
5390
|
+
handled.add(x);
|
|
5391
|
+
if (fn(x)) {
|
|
5392
|
+
this.arr.splice(i, 1);
|
|
5393
|
+
delete this.hash[x.id];
|
|
5394
|
+
}
|
|
5395
|
+
break;
|
|
5396
|
+
}
|
|
5397
|
+
if (i === length) {
|
|
5398
|
+
break;
|
|
5525
5399
|
}
|
|
5526
|
-
current = next;
|
|
5527
|
-
continue;
|
|
5528
5400
|
}
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5536
|
-
|
|
5401
|
+
}
|
|
5402
|
+
forEach(fn) {
|
|
5403
|
+
let handled = new Dictionary();
|
|
5404
|
+
while (true) {
|
|
5405
|
+
let i = -1, length = this.arr.length;
|
|
5406
|
+
while (++i < length) {
|
|
5407
|
+
let x = this.arr[i];
|
|
5408
|
+
if (handled.has(x)) {
|
|
5409
|
+
continue;
|
|
5537
5410
|
}
|
|
5538
|
-
|
|
5411
|
+
handled.add(x);
|
|
5412
|
+
fn(x, i);
|
|
5413
|
+
break;
|
|
5414
|
+
}
|
|
5415
|
+
if (i === length) {
|
|
5416
|
+
break;
|
|
5539
5417
|
}
|
|
5540
|
-
return path;
|
|
5541
|
-
}
|
|
5542
|
-
let json = global_1.io.File.read(pckg);
|
|
5543
|
-
if (typeof json === 'string') {
|
|
5544
|
-
json = JSON.parse(json);
|
|
5545
|
-
}
|
|
5546
|
-
if (json.main) {
|
|
5547
|
-
return (0, path_1.path_combine)(nodeModules, json.main);
|
|
5548
5418
|
}
|
|
5549
|
-
return nodeModules + 'index.js';
|
|
5550
5419
|
}
|
|
5551
5420
|
}
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
//# sourceMappingURL=CommonJsPathResolver.js.map
|
|
5556
|
-
//# sourceMappingURL=CommonJsPathResolver.ts.map;
|
|
5421
|
+
exports.Dictionary = Dictionary;
|
|
5422
|
+
//# sourceMappingURL=Dictionary.js.map
|
|
5423
|
+
//# sourceMappingURL=Dictionary.ts.map;
|
|
5557
5424
|
|
|
5558
5425
|
function __isObj(x) {
|
|
5559
5426
|
return x != null && typeof x === 'object' && x.constructor === Object;
|
|
5560
5427
|
}
|
|
5561
|
-
if (
|
|
5428
|
+
if (_src_handlers_script_import_js_Dictionary === module.exports) {
|
|
5562
5429
|
// do nothing if
|
|
5563
|
-
} else if (__isObj(
|
|
5564
|
-
Object.assign(
|
|
5430
|
+
} else if (__isObj(_src_handlers_script_import_js_Dictionary) && __isObj(module.exports)) {
|
|
5431
|
+
Object.assign(_src_handlers_script_import_js_Dictionary, module.exports);
|
|
5565
5432
|
} else {
|
|
5566
|
-
|
|
5433
|
+
_src_handlers_script_import_js_Dictionary = module.exports;
|
|
5567
5434
|
}
|
|
5568
5435
|
|
|
5569
5436
|
;
|
|
@@ -5573,41 +5440,35 @@ function hasExt(path) {
|
|
|
5573
5440
|
|
|
5574
5441
|
|
|
5575
5442
|
// source ./ModuleSimplified.js
|
|
5576
|
-
var
|
|
5443
|
+
var _src_handlers_script_import_js_String;
|
|
5577
5444
|
(function () {
|
|
5578
5445
|
// ensure AMD is not active for the model, so that any UMD exports as commonjs
|
|
5579
5446
|
var define = null;
|
|
5580
|
-
var exports =
|
|
5447
|
+
var exports = _src_handlers_script_import_js_String != null ? _src_handlers_script_import_js_String : {};
|
|
5581
5448
|
var module = { exports: exports };
|
|
5582
5449
|
|
|
5583
5450
|
"use strict";
|
|
5584
5451
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5585
|
-
exports.
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
}
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
CommonJsHandler.Rewriter = CommonJsRewriter_1.CommonJsRewriter;
|
|
5596
|
-
CommonJsHandler.Builder = CommonJsBuilder_1.CommonJsBuilder;
|
|
5597
|
-
CommonJsHandler.PathResolver = CommonJsPathResolver_1.CommonJsPathResolver;
|
|
5598
|
-
;
|
|
5599
|
-
//# sourceMappingURL=CommonJsHandler.js.map
|
|
5600
|
-
//# sourceMappingURL=CommonJsHandler.ts.map;
|
|
5452
|
+
exports.String = void 0;
|
|
5453
|
+
var String;
|
|
5454
|
+
(function (String) {
|
|
5455
|
+
function replace(str, i, length, ins = '') {
|
|
5456
|
+
return str.substring(0, i) + ins + str.substring(i + length);
|
|
5457
|
+
}
|
|
5458
|
+
String.replace = replace;
|
|
5459
|
+
})(String = exports.String || (exports.String = {}));
|
|
5460
|
+
//# sourceMappingURL=String.js.map
|
|
5461
|
+
//# sourceMappingURL=String.ts.map;
|
|
5601
5462
|
|
|
5602
5463
|
function __isObj(x) {
|
|
5603
5464
|
return x != null && typeof x === 'object' && x.constructor === Object;
|
|
5604
5465
|
}
|
|
5605
|
-
if (
|
|
5466
|
+
if (_src_handlers_script_import_js_String === module.exports) {
|
|
5606
5467
|
// do nothing if
|
|
5607
|
-
} else if (__isObj(
|
|
5608
|
-
Object.assign(
|
|
5468
|
+
} else if (__isObj(_src_handlers_script_import_js_String) && __isObj(module.exports)) {
|
|
5469
|
+
Object.assign(_src_handlers_script_import_js_String, module.exports);
|
|
5609
5470
|
} else {
|
|
5610
|
-
|
|
5471
|
+
_src_handlers_script_import_js_String = module.exports;
|
|
5611
5472
|
}
|
|
5612
5473
|
|
|
5613
5474
|
;
|
|
@@ -5617,112 +5478,255 @@ CommonJsHandler.PathResolver = CommonJsPathResolver_1.CommonJsPathResolver;
|
|
|
5617
5478
|
|
|
5618
5479
|
|
|
5619
5480
|
// source ./ModuleSimplified.js
|
|
5620
|
-
var
|
|
5481
|
+
var _src_handlers_script_import_js_ModuleFile;
|
|
5621
5482
|
(function () {
|
|
5622
5483
|
// ensure AMD is not active for the model, so that any UMD exports as commonjs
|
|
5623
5484
|
var define = null;
|
|
5624
|
-
var exports =
|
|
5485
|
+
var exports = _src_handlers_script_import_js_ModuleFile != null ? _src_handlers_script_import_js_ModuleFile : {};
|
|
5625
5486
|
var module = { exports: exports };
|
|
5626
5487
|
|
|
5627
5488
|
"use strict";
|
|
5628
5489
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5629
|
-
exports.
|
|
5630
|
-
const
|
|
5631
|
-
const
|
|
5632
|
-
const
|
|
5633
|
-
const
|
|
5634
|
-
class
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5490
|
+
exports.ModuleFile = exports.IImporterOptions = void 0;
|
|
5491
|
+
const io = require("atma-io");
|
|
5492
|
+
const utils_1 = _src_handlers_script_import_js_utils;
|
|
5493
|
+
const Dictionary_1 = _src_handlers_script_import_js_Dictionary;
|
|
5494
|
+
const String_1 = _src_handlers_script_import_js_String;
|
|
5495
|
+
class IImporterOptions {
|
|
5496
|
+
constructor() {
|
|
5497
|
+
this.removeUnusedExports = true;
|
|
5498
|
+
this.wrapper = 'iif';
|
|
5499
|
+
this.lazy = null;
|
|
5500
|
+
}
|
|
5501
|
+
}
|
|
5502
|
+
exports.IImporterOptions = IImporterOptions;
|
|
5503
|
+
class ModuleFile {
|
|
5504
|
+
constructor(content, file) {
|
|
5505
|
+
this.content = content;
|
|
5506
|
+
this.file = file;
|
|
5507
|
+
this.outer = new Dictionary_1.Dictionary();
|
|
5508
|
+
this.scoped = new Dictionary_1.Dictionary();
|
|
5509
|
+
this.imports = [];
|
|
5510
|
+
this.exports = [];
|
|
5511
|
+
this.scopedVars = [];
|
|
5512
|
+
this.id = file.uri.toLocalFile();
|
|
5513
|
+
this.path = file.uri.toRelativeString(io.env.currentDir);
|
|
5514
|
+
}
|
|
5515
|
+
hasDeep(x, ignore, hash = new Dictionary_1.Dictionary()) {
|
|
5516
|
+
function check(arr) {
|
|
5517
|
+
for (let i = 0; i < arr.length; i++) {
|
|
5518
|
+
let module = arr[i];
|
|
5519
|
+
if (module == ignore || hash.has(module)) {
|
|
5520
|
+
continue;
|
|
5521
|
+
}
|
|
5522
|
+
hash.add(module);
|
|
5523
|
+
let has = module.hasDeep(x, ignore, hash);
|
|
5524
|
+
if (has) {
|
|
5525
|
+
return true;
|
|
5526
|
+
}
|
|
5644
5527
|
}
|
|
5528
|
+
return false;
|
|
5529
|
+
}
|
|
5530
|
+
if (this.id === x.id) {
|
|
5645
5531
|
return true;
|
|
5646
|
-
}
|
|
5647
|
-
return
|
|
5532
|
+
}
|
|
5533
|
+
return check(this.outer.arr) || check(this.scoped.arr);
|
|
5648
5534
|
}
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5535
|
+
getAllModules() {
|
|
5536
|
+
let dict = new Dictionary_1.Dictionary();
|
|
5537
|
+
function add(module) {
|
|
5538
|
+
if (dict.has(module)) {
|
|
5539
|
+
return;
|
|
5540
|
+
}
|
|
5541
|
+
dict.add(module);
|
|
5542
|
+
module.outer.forEach(add);
|
|
5543
|
+
module.scoped.forEach(add);
|
|
5652
5544
|
}
|
|
5653
|
-
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5545
|
+
add(this);
|
|
5546
|
+
return dict.arr;
|
|
5547
|
+
}
|
|
5548
|
+
static getAllImports(modules) {
|
|
5549
|
+
let arr = [];
|
|
5550
|
+
modules.filter(x => x.imports != null).forEach(x => arr.push(...x.imports));
|
|
5551
|
+
return arr;
|
|
5552
|
+
// function read (module: ModuleFile, stack: ModuleFile[] = []): ImportNode[] {
|
|
5553
|
+
// if (stack.includes(module) || module.imports == null) {
|
|
5554
|
+
// return [];
|
|
5555
|
+
// }
|
|
5556
|
+
// stack.push(module);
|
|
5557
|
+
// let arr = [...module.imports];
|
|
5558
|
+
// module.imports.forEach(x => arr.push(...read(x.module, stack)));
|
|
5559
|
+
// return arr;
|
|
5560
|
+
// }
|
|
5561
|
+
// return read(this);
|
|
5562
|
+
}
|
|
5563
|
+
toScript(parents = [], options, indent = '') {
|
|
5564
|
+
let newLine = (0, utils_1.u_getNewLine)(this.content, io);
|
|
5565
|
+
let outerContent = this
|
|
5566
|
+
.outer
|
|
5567
|
+
.arr
|
|
5568
|
+
.map(x => x.toScript([...parents, this], options))
|
|
5569
|
+
.map(x => x.replace(/[\s]*$/, ''))
|
|
5570
|
+
.join(newLine);
|
|
5571
|
+
let scopedContent = this
|
|
5572
|
+
.scoped
|
|
5573
|
+
.arr
|
|
5574
|
+
.map(x => x.toScript([...parents, this], options))
|
|
5575
|
+
.map(x => x.replace(/[\s]*$/, ''))
|
|
5576
|
+
.join(newLine);
|
|
5577
|
+
let scopedRefs = this
|
|
5578
|
+
.scopedVars
|
|
5579
|
+
.filter(x => !options.removeUnusedExports || x.dependents.length > 0)
|
|
5580
|
+
.map(x => ` ${x.ref}`)
|
|
5581
|
+
.join(`,${newLine}`);
|
|
5582
|
+
if (scopedRefs) {
|
|
5583
|
+
scopedRefs = String_1.String.replace(scopedRefs, 0, 3, 'var');
|
|
5584
|
+
scopedRefs += ';';
|
|
5585
|
+
scopedContent = scopedRefs + newLine + scopedContent;
|
|
5658
5586
|
}
|
|
5659
|
-
let
|
|
5660
|
-
|
|
5661
|
-
|
|
5587
|
+
let content = this.content;
|
|
5588
|
+
// normalize exports
|
|
5589
|
+
this.exports.reverse().forEach(x => {
|
|
5590
|
+
if (options.removeUnusedExports && x.dependents.length === 0) {
|
|
5591
|
+
let str = content.substring(x.position, x.position + x.length);
|
|
5592
|
+
str = str.replace(/\s*export\s*/g, '');
|
|
5593
|
+
content = String_1.String.replace(content, x.position, x.length, str);
|
|
5594
|
+
return;
|
|
5595
|
+
}
|
|
5596
|
+
switch (x.type) {
|
|
5597
|
+
case 'ref':
|
|
5598
|
+
content = String_1.String.replace(content, x.position, x.length, x.ref);
|
|
5599
|
+
break;
|
|
5600
|
+
case 'function':
|
|
5601
|
+
content = String_1.String.replace(content, x.position, x.length, `${x.ref} = function `);
|
|
5602
|
+
break;
|
|
5603
|
+
case 'named':
|
|
5604
|
+
content = String_1.String.replace(content, x.position, x.length, '');
|
|
5605
|
+
break;
|
|
5606
|
+
case 'scoped':
|
|
5607
|
+
if (x.length > 0) {
|
|
5608
|
+
content = String_1.String.replace(content, x.position, x.length, '');
|
|
5609
|
+
}
|
|
5610
|
+
break;
|
|
5611
|
+
}
|
|
5612
|
+
});
|
|
5613
|
+
// remove imports
|
|
5614
|
+
this.imports.reverse().forEach(x => {
|
|
5615
|
+
content = String_1.String.replace(content, x.position, x.length, '');
|
|
5616
|
+
});
|
|
5617
|
+
// create var declaration
|
|
5618
|
+
let externalRefs = '';
|
|
5619
|
+
if (this.exports.length > 0) {
|
|
5620
|
+
this
|
|
5621
|
+
.exports
|
|
5622
|
+
.filter(x => {
|
|
5623
|
+
return x.dependents.length > 0 || options.removeUnusedExports === false;
|
|
5624
|
+
})
|
|
5625
|
+
.forEach(x => {
|
|
5626
|
+
/** Remove local scoped var declaration and make it global scoped */
|
|
5627
|
+
if (x.type === 'scoped') {
|
|
5628
|
+
let rgx = new RegExp(`\\b(var|let|const|function)\\s+${x.ref}`);
|
|
5629
|
+
content = content.replace(rgx, x.ref);
|
|
5630
|
+
}
|
|
5631
|
+
return x;
|
|
5632
|
+
});
|
|
5633
|
+
externalRefs = this
|
|
5634
|
+
.exports
|
|
5635
|
+
.reverse()
|
|
5636
|
+
.filter(x => {
|
|
5637
|
+
if (x.builder.movedToOuter) {
|
|
5638
|
+
return false;
|
|
5639
|
+
}
|
|
5640
|
+
if (options.removeUnusedExports === false) {
|
|
5641
|
+
return true;
|
|
5642
|
+
}
|
|
5643
|
+
if (x.dependents.length === 0) {
|
|
5644
|
+
console.warn(`Module ${this.id} has unused export ${x.ref}`);
|
|
5645
|
+
return false;
|
|
5646
|
+
}
|
|
5647
|
+
return true;
|
|
5648
|
+
})
|
|
5649
|
+
.filter(x => {
|
|
5650
|
+
let exportInOuter = parents
|
|
5651
|
+
.some(p => {
|
|
5652
|
+
let parentsExport = p.exports.find(e => e.hasExport(x.ref));
|
|
5653
|
+
if (parentsExport == null) {
|
|
5654
|
+
return false;
|
|
5655
|
+
}
|
|
5656
|
+
if (options.removeUnusedExports && parentsExport.dependents.length === 0) {
|
|
5657
|
+
return false;
|
|
5658
|
+
}
|
|
5659
|
+
return true;
|
|
5660
|
+
});
|
|
5661
|
+
return exportInOuter === false;
|
|
5662
|
+
})
|
|
5663
|
+
.map(x => ` ${x.ref}`)
|
|
5664
|
+
.join(`,${newLine}`);
|
|
5665
|
+
if (externalRefs.length > 0) {
|
|
5666
|
+
externalRefs = String_1.String.replace(externalRefs, 0, 3, 'var');
|
|
5667
|
+
externalRefs += ';';
|
|
5668
|
+
}
|
|
5662
5669
|
}
|
|
5663
|
-
|
|
5664
|
-
let
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
}
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
// do nothing if
|
|
5679
|
-
} else if (__isObj(_src_handlers_script_amd_js_AmdJsParser) && __isObj(module.exports)) {
|
|
5680
|
-
Object.assign(_src_handlers_script_amd_js_AmdJsParser, module.exports);
|
|
5681
|
-
} else {
|
|
5682
|
-
_src_handlers_script_amd_js_AmdJsParser = module.exports;
|
|
5683
|
-
}
|
|
5684
|
-
|
|
5685
|
-
;
|
|
5686
|
-
}());
|
|
5687
|
-
|
|
5688
|
-
// end:source ./ModuleSimplified.js
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
// source ./ModuleSimplified.js
|
|
5692
|
-
var _src_handlers_script_amd_js_AmdJsRewriter;
|
|
5693
|
-
(function () {
|
|
5694
|
-
// ensure AMD is not active for the model, so that any UMD exports as commonjs
|
|
5695
|
-
var define = null;
|
|
5696
|
-
var exports = _src_handlers_script_amd_js_AmdJsRewriter != null ? _src_handlers_script_amd_js_AmdJsRewriter : {};
|
|
5697
|
-
var module = { exports: exports };
|
|
5698
|
-
|
|
5699
|
-
"use strict";
|
|
5700
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5701
|
-
exports.AmdJsRewriter = void 0;
|
|
5702
|
-
const BaseRewriter_1 = _src_handlers_base_BaseRewriter;
|
|
5703
|
-
class AmdJsRewriter extends BaseRewriter_1.BaseRewriter {
|
|
5704
|
-
rewritePartial(content, ownerResource) {
|
|
5670
|
+
const SPACE = '\t';
|
|
5671
|
+
let indentScopedContent = `${(0, utils_1.u_makeIndent)(scopedContent || '', SPACE, io)}`;
|
|
5672
|
+
let indentContent = `${(0, utils_1.u_makeIndent)(content, SPACE, io)}`;
|
|
5673
|
+
let scopeLess = parents.length === 0 && options.wrapper !== 'iif';
|
|
5674
|
+
content = [
|
|
5675
|
+
`${outerContent}` || '',
|
|
5676
|
+
`${externalRefs}` || '',
|
|
5677
|
+
!scopeLess && (indentScopedContent || indentContent) ? `(function(){` : '',
|
|
5678
|
+
indentScopedContent,
|
|
5679
|
+
indentContent,
|
|
5680
|
+
!scopeLess && (indentScopedContent || indentContent) ? `}());` : ''
|
|
5681
|
+
]
|
|
5682
|
+
.filter(x => !!x)
|
|
5683
|
+
.join(newLine);
|
|
5684
|
+
return (0, utils_1.u_makeIndent)(content, indent, io);
|
|
5705
5685
|
}
|
|
5706
|
-
|
|
5686
|
+
toImportsJson() {
|
|
5687
|
+
function toJSON(module) {
|
|
5688
|
+
var json = {
|
|
5689
|
+
id: module.id,
|
|
5690
|
+
imports: null
|
|
5691
|
+
};
|
|
5692
|
+
if (module.imports) {
|
|
5693
|
+
json.imports = module.imports.map(x => toJSON(x.module));
|
|
5694
|
+
}
|
|
5695
|
+
return json;
|
|
5696
|
+
}
|
|
5697
|
+
return toJSON(this);
|
|
5707
5698
|
}
|
|
5708
|
-
|
|
5709
|
-
|
|
5699
|
+
toModulesJson() {
|
|
5700
|
+
function toJSON(module) {
|
|
5701
|
+
let json = {
|
|
5702
|
+
id: module.id,
|
|
5703
|
+
outer: module.outer.arr.map(x => toJSON(x)),
|
|
5704
|
+
scoped: module.scoped.arr.map(x => toJSON(x))
|
|
5705
|
+
};
|
|
5706
|
+
if (json.outer.length === 0) {
|
|
5707
|
+
delete json.outer;
|
|
5708
|
+
}
|
|
5709
|
+
if (json.scoped.length === 0) {
|
|
5710
|
+
delete json.scoped;
|
|
5711
|
+
}
|
|
5712
|
+
return json;
|
|
5713
|
+
}
|
|
5714
|
+
return toJSON(this);
|
|
5710
5715
|
}
|
|
5711
5716
|
}
|
|
5712
|
-
exports.
|
|
5713
|
-
|
|
5714
|
-
//# sourceMappingURL=
|
|
5715
|
-
//# sourceMappingURL=AmdJsRewriter.ts.map;
|
|
5717
|
+
exports.ModuleFile = ModuleFile;
|
|
5718
|
+
//# sourceMappingURL=ModuleFile.js.map
|
|
5719
|
+
//# sourceMappingURL=ModuleFile.ts.map;
|
|
5716
5720
|
|
|
5717
5721
|
function __isObj(x) {
|
|
5718
5722
|
return x != null && typeof x === 'object' && x.constructor === Object;
|
|
5719
5723
|
}
|
|
5720
|
-
if (
|
|
5724
|
+
if (_src_handlers_script_import_js_ModuleFile === module.exports) {
|
|
5721
5725
|
// do nothing if
|
|
5722
|
-
} else if (__isObj(
|
|
5723
|
-
Object.assign(
|
|
5726
|
+
} else if (__isObj(_src_handlers_script_import_js_ModuleFile) && __isObj(module.exports)) {
|
|
5727
|
+
Object.assign(_src_handlers_script_import_js_ModuleFile, module.exports);
|
|
5724
5728
|
} else {
|
|
5725
|
-
|
|
5729
|
+
_src_handlers_script_import_js_ModuleFile = module.exports;
|
|
5726
5730
|
}
|
|
5727
5731
|
|
|
5728
5732
|
;
|
|
@@ -5732,91 +5736,208 @@ exports.AmdJsRewriter = AmdJsRewriter;
|
|
|
5732
5736
|
|
|
5733
5737
|
|
|
5734
5738
|
// source ./ModuleSimplified.js
|
|
5735
|
-
var
|
|
5739
|
+
var _src_handlers_script_import_js_Parser;
|
|
5736
5740
|
(function () {
|
|
5737
5741
|
// ensure AMD is not active for the model, so that any UMD exports as commonjs
|
|
5738
5742
|
var define = null;
|
|
5739
|
-
var exports =
|
|
5743
|
+
var exports = _src_handlers_script_import_js_Parser != null ? _src_handlers_script_import_js_Parser : {};
|
|
5740
5744
|
var module = { exports: exports };
|
|
5741
5745
|
|
|
5742
5746
|
"use strict";
|
|
5743
5747
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5744
|
-
exports.
|
|
5745
|
-
const
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5748
|
+
exports.Parser = void 0;
|
|
5749
|
+
const ModuleFile_1 = _src_handlers_script_import_js_ModuleFile;
|
|
5750
|
+
const ResourceInfo_1 = _src_class_ResourceInfo;
|
|
5751
|
+
let Rgx = {
|
|
5752
|
+
Imports: {
|
|
5753
|
+
full: {
|
|
5754
|
+
rgx: /^[ \t]*import\s*(\*\s+as\s+\w+\s+from\s+)?['"](?<path>[^'"]+)['"][\t ;]*[\r\n]{0,2}/gm,
|
|
5755
|
+
map(match) {
|
|
5756
|
+
let $import = new ResourceInfo_1.ImportNode();
|
|
5757
|
+
$import.position = match.index;
|
|
5758
|
+
$import.length = match[0].length;
|
|
5759
|
+
$import.type = 'full';
|
|
5760
|
+
$import.path = match.groups.path;
|
|
5761
|
+
return $import;
|
|
5762
|
+
}
|
|
5763
|
+
},
|
|
5764
|
+
refs: {
|
|
5765
|
+
rgx: /^[ \t]*import\s*\{([^}]+)}\s*from\s*['"]([^'"]+)['"][\t ;]*[\r\n]{0,2}/gm,
|
|
5766
|
+
map(match) {
|
|
5767
|
+
let $import = new ResourceInfo_1.ImportNode();
|
|
5768
|
+
$import.position = match.index;
|
|
5769
|
+
$import.length = match[0].length;
|
|
5770
|
+
$import.type = 'refs';
|
|
5771
|
+
$import.path = match[2];
|
|
5772
|
+
$import.refs = match[1].split(',').map(x => x.trim());
|
|
5773
|
+
return $import;
|
|
5774
|
+
}
|
|
5775
|
+
},
|
|
5776
|
+
defaults: {
|
|
5777
|
+
rgx: /^[ \t]*import\s+(?<def>\w+)\s+from\s*['"](?<path>[^'"]+)['"][\t ;]*[\r\n]{0,2}/gm,
|
|
5778
|
+
map(match) {
|
|
5779
|
+
let $import = new ResourceInfo_1.ImportNode();
|
|
5780
|
+
$import.position = match.index;
|
|
5781
|
+
$import.length = match[0].length;
|
|
5782
|
+
$import.type = 'full';
|
|
5783
|
+
$import.path = match.groups.path;
|
|
5784
|
+
return $import;
|
|
5785
|
+
}
|
|
5786
|
+
},
|
|
5787
|
+
exportAll: {
|
|
5788
|
+
rgx: /^[ \t]*export\s+\*\s+from\s*['"]([^'"]+)['"][\t ;]*[\r\n]{0,2}/gm,
|
|
5789
|
+
map(match) {
|
|
5790
|
+
let $import = new ResourceInfo_1.ImportNode();
|
|
5791
|
+
$import.position = match.index;
|
|
5792
|
+
$import.length = match[0].length;
|
|
5793
|
+
$import.type = 'exportAll';
|
|
5794
|
+
$import.path = match[1];
|
|
5795
|
+
$import.exportAll = true;
|
|
5796
|
+
return $import;
|
|
5797
|
+
}
|
|
5798
|
+
},
|
|
5799
|
+
exportRefs: {
|
|
5800
|
+
rgx: /^[ \t]*export\s*\{([^}]+)}\s*from\s*['"]([^'"]+)['"][\t ;]*[\r\n]{0,2}/gm,
|
|
5801
|
+
map(match) {
|
|
5802
|
+
let $import = new ResourceInfo_1.ImportNode();
|
|
5803
|
+
$import.position = match.index;
|
|
5804
|
+
$import.length = match[0].length;
|
|
5805
|
+
$import.type = 'exportRefs';
|
|
5806
|
+
$import.path = match[2];
|
|
5807
|
+
$import.refs = match[1].split(',').map(x => x.trim());
|
|
5808
|
+
$import.exportRefs = true;
|
|
5809
|
+
return $import;
|
|
5810
|
+
}
|
|
5811
|
+
}
|
|
5812
|
+
},
|
|
5813
|
+
Exports: {
|
|
5814
|
+
ref: {
|
|
5815
|
+
rgx: /^[ \t]*export\s*(const|let|var)\s+([\w\d_$]+)(?=\s*[^\w\d_$;])/gm,
|
|
5816
|
+
map(match) {
|
|
5817
|
+
let $export = new ResourceInfo_1.ExportNode();
|
|
5818
|
+
$export.position = match.index;
|
|
5819
|
+
$export.length = match[0].length;
|
|
5820
|
+
$export.type = 'ref';
|
|
5821
|
+
$export.ref = match[2];
|
|
5822
|
+
return $export;
|
|
5823
|
+
}
|
|
5824
|
+
},
|
|
5825
|
+
named: {
|
|
5826
|
+
rgx: /^[ \t]*export\s*(const|let|var)\s+([\w\d_$]+)(?=\s*[;])/gm,
|
|
5827
|
+
map(match) {
|
|
5828
|
+
let $export = new ResourceInfo_1.ExportNode();
|
|
5829
|
+
$export.position = match.index;
|
|
5830
|
+
$export.length = match[0].length;
|
|
5831
|
+
$export.type = 'named';
|
|
5832
|
+
$export.ref = match[2];
|
|
5833
|
+
return $export;
|
|
5834
|
+
}
|
|
5835
|
+
},
|
|
5836
|
+
scoped: {
|
|
5837
|
+
rgx: /^[ \t]*export\s*\{([^}]+)}\s*;?(?!\s*from)/gm,
|
|
5838
|
+
map(match) {
|
|
5839
|
+
let refs = match[1].split(',').map(x => x.trim());
|
|
5840
|
+
let $export = new ResourceInfo_1.ExportNode();
|
|
5841
|
+
$export.position = match.index;
|
|
5842
|
+
$export.length = match[0].length;
|
|
5843
|
+
$export.type = 'scoped';
|
|
5844
|
+
$export.ref = refs[0];
|
|
5845
|
+
let other = refs.slice(1).map(ref => {
|
|
5846
|
+
let $export = new ResourceInfo_1.ExportNode();
|
|
5847
|
+
$export.position = match.index;
|
|
5848
|
+
$export.length = 0;
|
|
5849
|
+
$export.type = 'scoped';
|
|
5850
|
+
$export.ref = ref;
|
|
5851
|
+
return $export;
|
|
5852
|
+
});
|
|
5853
|
+
return [$export, ...other];
|
|
5854
|
+
}
|
|
5855
|
+
},
|
|
5856
|
+
function: {
|
|
5857
|
+
rgx: /^[ \t]*export\s*function\s+([\w\d_$]+)/gm,
|
|
5858
|
+
map(match) {
|
|
5859
|
+
let $export = new ResourceInfo_1.ExportNode();
|
|
5860
|
+
$export.position = match.index;
|
|
5861
|
+
$export.length = match[0].length;
|
|
5862
|
+
$export.type = 'function';
|
|
5863
|
+
$export.ref = match[1];
|
|
5864
|
+
return $export;
|
|
5865
|
+
}
|
|
5866
|
+
}
|
|
5751
5867
|
}
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
|
|
5868
|
+
};
|
|
5869
|
+
class Parser {
|
|
5870
|
+
static supports(content) {
|
|
5871
|
+
for (let type in Rgx) {
|
|
5872
|
+
for (let key in Rgx[type]) {
|
|
5873
|
+
let rgx = Rgx[type][key].rgx;
|
|
5874
|
+
rgx.lastIndex = 0;
|
|
5875
|
+
if (rgx.test(content)) {
|
|
5876
|
+
return true;
|
|
5877
|
+
}
|
|
5878
|
+
}
|
|
5755
5879
|
}
|
|
5756
|
-
|
|
5757
|
-
|
|
5758
|
-
|
|
5880
|
+
return false;
|
|
5881
|
+
}
|
|
5882
|
+
static parse(content, file) {
|
|
5883
|
+
let module = new ModuleFile_1.ModuleFile(content, file);
|
|
5884
|
+
if (Parser.supports(content) === false) {
|
|
5885
|
+
return module;
|
|
5759
5886
|
}
|
|
5760
|
-
|
|
5887
|
+
for (let key in Rgx.Imports) {
|
|
5888
|
+
let x = Rgx.Imports[key];
|
|
5889
|
+
x.rgx.lastIndex = 0;
|
|
5890
|
+
for (let match = x.rgx.exec(content); match != null; match = x.rgx.exec(content)) {
|
|
5891
|
+
let result = x.map(match, content);
|
|
5892
|
+
if (Array.isArray(result)) {
|
|
5893
|
+
module.imports.push(...result);
|
|
5894
|
+
}
|
|
5895
|
+
else {
|
|
5896
|
+
module.imports.push(result);
|
|
5897
|
+
}
|
|
5898
|
+
}
|
|
5899
|
+
}
|
|
5900
|
+
for (let key in Rgx.Exports) {
|
|
5901
|
+
let x = Rgx.Exports[key];
|
|
5902
|
+
x.rgx.lastIndex = 0;
|
|
5903
|
+
for (let match = x.rgx.exec(content); match != null; match = x.rgx.exec(content)) {
|
|
5904
|
+
let result = x.map(match, content);
|
|
5905
|
+
if (Array.isArray(result)) {
|
|
5906
|
+
module.exports.push(...result);
|
|
5907
|
+
}
|
|
5908
|
+
else {
|
|
5909
|
+
module.exports.push(result);
|
|
5910
|
+
}
|
|
5911
|
+
}
|
|
5912
|
+
}
|
|
5913
|
+
module.imports.forEach(m => m.parent = module);
|
|
5914
|
+
module.imports.filter(x => x.type === 'exportRefs').forEach(imp => {
|
|
5915
|
+
imp.refs.forEach(ref => {
|
|
5916
|
+
let exp = new ResourceInfo_1.ExportNode();
|
|
5917
|
+
exp.position = 0;
|
|
5918
|
+
exp.length = 0;
|
|
5919
|
+
exp.ref = ref;
|
|
5920
|
+
module.exports.push(exp);
|
|
5921
|
+
});
|
|
5922
|
+
});
|
|
5923
|
+
module.imports.sort((a, b) => a.position < b.position ? -1 : 1);
|
|
5924
|
+
module.exports.sort((a, b) => a.position < b.position ? -1 : 1);
|
|
5925
|
+
return module;
|
|
5761
5926
|
}
|
|
5762
5927
|
}
|
|
5763
|
-
exports.
|
|
5764
|
-
|
|
5765
|
-
//# sourceMappingURL=
|
|
5766
|
-
//# sourceMappingURL=AmdJsBuilder.ts.map;
|
|
5767
|
-
|
|
5768
|
-
function __isObj(x) {
|
|
5769
|
-
return x != null && typeof x === 'object' && x.constructor === Object;
|
|
5770
|
-
}
|
|
5771
|
-
if (_src_handlers_script_amd_js_AmdJsBuilder === module.exports) {
|
|
5772
|
-
// do nothing if
|
|
5773
|
-
} else if (__isObj(_src_handlers_script_amd_js_AmdJsBuilder) && __isObj(module.exports)) {
|
|
5774
|
-
Object.assign(_src_handlers_script_amd_js_AmdJsBuilder, module.exports);
|
|
5775
|
-
} else {
|
|
5776
|
-
_src_handlers_script_amd_js_AmdJsBuilder = module.exports;
|
|
5777
|
-
}
|
|
5778
|
-
|
|
5779
|
-
;
|
|
5780
|
-
}());
|
|
5781
|
-
|
|
5782
|
-
// end:source ./ModuleSimplified.js
|
|
5783
|
-
|
|
5784
|
-
|
|
5785
|
-
// source ./ModuleSimplified.js
|
|
5786
|
-
var _src_handlers_script_amd_js_AmdJsHandler;
|
|
5787
|
-
(function () {
|
|
5788
|
-
// ensure AMD is not active for the model, so that any UMD exports as commonjs
|
|
5789
|
-
var define = null;
|
|
5790
|
-
var exports = _src_handlers_script_amd_js_AmdJsHandler != null ? _src_handlers_script_amd_js_AmdJsHandler : {};
|
|
5791
|
-
var module = { exports: exports };
|
|
5792
|
-
|
|
5793
|
-
"use strict";
|
|
5794
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5795
|
-
exports.AmdJsHandler = void 0;
|
|
5796
|
-
const AmdJsParser_1 = _src_handlers_script_amd_js_AmdJsParser;
|
|
5797
|
-
const AmdJsRewriter_1 = _src_handlers_script_amd_js_AmdJsRewriter;
|
|
5798
|
-
const AmdJsBuilder_1 = _src_handlers_script_amd_js_AmdJsBuilder;
|
|
5799
|
-
const BaseHandler_1 = _src_handlers_base_BaseHandler;
|
|
5800
|
-
class AmdJsHandler extends BaseHandler_1.BaseHandler {
|
|
5801
|
-
}
|
|
5802
|
-
exports.AmdJsHandler = AmdJsHandler;
|
|
5803
|
-
AmdJsHandler.Parser = AmdJsParser_1.AmdJsParser;
|
|
5804
|
-
AmdJsHandler.Rewriter = AmdJsRewriter_1.AmdJsRewriter;
|
|
5805
|
-
AmdJsHandler.Builder = AmdJsBuilder_1.AmdJsBuilder;
|
|
5806
|
-
AmdJsHandler.PathResolver = null;
|
|
5807
|
-
;
|
|
5808
|
-
//# sourceMappingURL=AmdJsHandler.js.map
|
|
5809
|
-
//# sourceMappingURL=AmdJsHandler.ts.map;
|
|
5928
|
+
exports.Parser = Parser;
|
|
5929
|
+
//# sourceMappingURL=Parser.js.map
|
|
5930
|
+
//# sourceMappingURL=Parser.ts.map;
|
|
5810
5931
|
|
|
5811
5932
|
function __isObj(x) {
|
|
5812
5933
|
return x != null && typeof x === 'object' && x.constructor === Object;
|
|
5813
5934
|
}
|
|
5814
|
-
if (
|
|
5935
|
+
if (_src_handlers_script_import_js_Parser === module.exports) {
|
|
5815
5936
|
// do nothing if
|
|
5816
|
-
} else if (__isObj(
|
|
5817
|
-
Object.assign(
|
|
5937
|
+
} else if (__isObj(_src_handlers_script_import_js_Parser) && __isObj(module.exports)) {
|
|
5938
|
+
Object.assign(_src_handlers_script_import_js_Parser, module.exports);
|
|
5818
5939
|
} else {
|
|
5819
|
-
|
|
5940
|
+
_src_handlers_script_import_js_Parser = module.exports;
|
|
5820
5941
|
}
|
|
5821
5942
|
|
|
5822
5943
|
;
|
|
@@ -5826,70 +5947,124 @@ AmdJsHandler.PathResolver = null;
|
|
|
5826
5947
|
|
|
5827
5948
|
|
|
5828
5949
|
// source ./ModuleSimplified.js
|
|
5829
|
-
var
|
|
5950
|
+
var _src_handlers_script_common_js_ModuleWrapper;
|
|
5830
5951
|
(function () {
|
|
5831
5952
|
// ensure AMD is not active for the model, so that any UMD exports as commonjs
|
|
5832
5953
|
var define = null;
|
|
5833
|
-
var exports =
|
|
5954
|
+
var exports = _src_handlers_script_common_js_ModuleWrapper != null ? _src_handlers_script_common_js_ModuleWrapper : {};
|
|
5834
5955
|
var module = { exports: exports };
|
|
5835
5956
|
|
|
5836
5957
|
"use strict";
|
|
5837
5958
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5838
|
-
exports.
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5959
|
+
exports.ModuleWrapper = void 0;
|
|
5960
|
+
const global_1 = _src_global;
|
|
5961
|
+
const Templates_1 = _src_handlers_script_common_js_templates_Templates;
|
|
5962
|
+
const Parser_1 = _src_handlers_script_import_js_Parser;
|
|
5963
|
+
class ModuleWrapper {
|
|
5964
|
+
constructor(solution) {
|
|
5965
|
+
this.solution = solution;
|
|
5843
5966
|
}
|
|
5844
|
-
|
|
5845
|
-
let
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
5967
|
+
wrap(body) {
|
|
5968
|
+
let wrapper = this.solution.opts.package.moduleWrapper;
|
|
5969
|
+
switch (wrapper) {
|
|
5970
|
+
case 'script':
|
|
5971
|
+
body = this.wrapSimple(body);
|
|
5972
|
+
break;
|
|
5973
|
+
case 'iif':
|
|
5974
|
+
body = this.wrapWithIIF(body);
|
|
5975
|
+
break;
|
|
5976
|
+
case 'umd':
|
|
5977
|
+
body = this.wrapWithUMD(body);
|
|
5978
|
+
break;
|
|
5979
|
+
case 'esm':
|
|
5980
|
+
body = this.wrapWithESM(body);
|
|
5981
|
+
break;
|
|
5982
|
+
case 'custom':
|
|
5983
|
+
body = this.wrapWithCustom(body);
|
|
5984
|
+
break;
|
|
5985
|
+
default:
|
|
5986
|
+
throw new Error('Uknown module wrapper: ' + wrapper);
|
|
5863
5987
|
}
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
|
|
5988
|
+
return body;
|
|
5989
|
+
}
|
|
5990
|
+
wrapSimple(body) {
|
|
5991
|
+
return Templates_1.Templates
|
|
5992
|
+
.RootModule
|
|
5993
|
+
.replace('%BUNDLE%', () => body);
|
|
5994
|
+
}
|
|
5995
|
+
wrapWithIIF(body) {
|
|
5996
|
+
return Templates_1.Templates
|
|
5997
|
+
.RootModuleWrapped
|
|
5998
|
+
.replace('%BUNDLE%', () => body);
|
|
5999
|
+
}
|
|
6000
|
+
wrapWithUMD(body) {
|
|
6001
|
+
let opts = this.solution.opts.package;
|
|
6002
|
+
let name = opts.moduleName || '';
|
|
6003
|
+
return Templates_1.Templates
|
|
6004
|
+
.UMD
|
|
6005
|
+
.replace('%MODULE%', () => body)
|
|
6006
|
+
.replace('%NAME%', () => name);
|
|
6007
|
+
}
|
|
6008
|
+
wrapWithESM(body) {
|
|
6009
|
+
let opts = this.solution.opts.package;
|
|
6010
|
+
let exportsCode = opts.moduleExportsCode || '';
|
|
6011
|
+
let importsCode = opts.moduleImportsCode || '';
|
|
6012
|
+
let deps = this.solution.outputResources.dynamicDependencies;
|
|
6013
|
+
if (deps.length > 0) {
|
|
6014
|
+
let arr = deps.map(dep => {
|
|
6015
|
+
let key = `bundlerDynamic_${dep.url.replace(/[^\w]/g, '_')}`;
|
|
6016
|
+
return {
|
|
6017
|
+
url: dep.url,
|
|
6018
|
+
key
|
|
6019
|
+
};
|
|
6020
|
+
});
|
|
6021
|
+
let strImports = arr.map(item => `import ${item.key} from '${item.url}';`).join('\n');
|
|
6022
|
+
let strCollection = `const bundlerDynamicRepository = {};\n`
|
|
6023
|
+
+ arr.map(item => `bundlerDynamicRepository['${item.url}'] = ${item.key};`)
|
|
6024
|
+
.join('\n');
|
|
6025
|
+
let strRequire = [
|
|
6026
|
+
`var bundlerOriginalRequire = require || function (url) { throw new Error('Not found: ' + url); };`,
|
|
6027
|
+
`var require = function (url) { return bundlerDynamicRepository[url] || bundlerOriginalRequire(url); };`
|
|
6028
|
+
].join('\n');
|
|
6029
|
+
importsCode = [
|
|
6030
|
+
strImports,
|
|
6031
|
+
strCollection,
|
|
6032
|
+
strRequire
|
|
6033
|
+
].join('\n');
|
|
5876
6034
|
}
|
|
5877
|
-
|
|
6035
|
+
let rootPath = this.solution.path;
|
|
6036
|
+
let rootContentRaw = global_1.io.File.read(rootPath, { cached: false, skipHooks: true, encoding: 'utf8' });
|
|
6037
|
+
let module = Parser_1.Parser.parse(rootContentRaw, new global_1.io.File(this.solution.path));
|
|
6038
|
+
let exportsBefore = module.exports.map(x => {
|
|
6039
|
+
return `export const ${x.ref} = module.exports.${x.ref};`;
|
|
6040
|
+
}).join('\n');
|
|
6041
|
+
exportsCode = `${exportsBefore}\n${exportsCode}`;
|
|
6042
|
+
return Templates_1.Templates
|
|
6043
|
+
.ESM
|
|
6044
|
+
.replace('$CUSTOM_IMPORTS_CODE$', () => importsCode)
|
|
6045
|
+
.replace('$CUSTOM_EXPORTS_CODE$', () => exportsCode)
|
|
6046
|
+
.replace('$MODULE$', () => body);
|
|
6047
|
+
}
|
|
6048
|
+
wrapWithCustom(body) {
|
|
6049
|
+
let opts = this.solution.opts.package;
|
|
6050
|
+
let template = Templates_1.Templates.load(opts.moduleWrapperCustomPath);
|
|
6051
|
+
return template
|
|
6052
|
+
.replace('/**MODULE**/', () => body);
|
|
5878
6053
|
}
|
|
5879
6054
|
}
|
|
5880
|
-
exports.
|
|
5881
|
-
//# sourceMappingURL=
|
|
5882
|
-
//# sourceMappingURL=
|
|
6055
|
+
exports.ModuleWrapper = ModuleWrapper;
|
|
6056
|
+
//# sourceMappingURL=ModuleWrapper.js.map
|
|
6057
|
+
//# sourceMappingURL=ModuleWrapper.ts.map;
|
|
5883
6058
|
|
|
5884
6059
|
function __isObj(x) {
|
|
5885
6060
|
return x != null && typeof x === 'object' && x.constructor === Object;
|
|
5886
6061
|
}
|
|
5887
|
-
if (
|
|
6062
|
+
if (_src_handlers_script_common_js_ModuleWrapper === module.exports) {
|
|
5888
6063
|
// do nothing if
|
|
5889
|
-
} else if (__isObj(
|
|
5890
|
-
Object.assign(
|
|
6064
|
+
} else if (__isObj(_src_handlers_script_common_js_ModuleWrapper) && __isObj(module.exports)) {
|
|
6065
|
+
Object.assign(_src_handlers_script_common_js_ModuleWrapper, module.exports);
|
|
5891
6066
|
} else {
|
|
5892
|
-
|
|
6067
|
+
_src_handlers_script_common_js_ModuleWrapper = module.exports;
|
|
5893
6068
|
}
|
|
5894
6069
|
|
|
5895
6070
|
;
|
|
@@ -5899,200 +6074,108 @@ exports.ResourcePropMapping = ResourcePropMapping;
|
|
|
5899
6074
|
|
|
5900
6075
|
|
|
5901
6076
|
// source ./ModuleSimplified.js
|
|
5902
|
-
var
|
|
6077
|
+
var _src_handlers_script_common_js_CommonJsBuilder;
|
|
5903
6078
|
(function () {
|
|
5904
6079
|
// ensure AMD is not active for the model, so that any UMD exports as commonjs
|
|
5905
6080
|
var define = null;
|
|
5906
|
-
var exports =
|
|
6081
|
+
var exports = _src_handlers_script_common_js_CommonJsBuilder != null ? _src_handlers_script_common_js_CommonJsBuilder : {};
|
|
5907
6082
|
var module = { exports: exports };
|
|
5908
6083
|
|
|
5909
6084
|
"use strict";
|
|
5910
6085
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5911
|
-
exports.
|
|
5912
|
-
const
|
|
5913
|
-
const
|
|
5914
|
-
const
|
|
5915
|
-
const
|
|
5916
|
-
const
|
|
5917
|
-
class
|
|
6086
|
+
exports.CommonJsBuilder = void 0;
|
|
6087
|
+
const CommonJsBuilderSimplified_1 = _src_handlers_script_common_js_CommonJsBuilderSimplified;
|
|
6088
|
+
const Templates_1 = _src_handlers_script_common_js_templates_Templates;
|
|
6089
|
+
const BaseScriptBuilder_1 = _src_handlers_script_base_BaseScriptBuilder;
|
|
6090
|
+
const template_1 = _src_utils_template;
|
|
6091
|
+
const ModuleWrapper_1 = _src_handlers_script_common_js_ModuleWrapper;
|
|
6092
|
+
class CommonJsBuilder extends BaseScriptBuilder_1.BaseScriptBuilder {
|
|
5918
6093
|
constructor(solution, handler) {
|
|
5919
6094
|
super(solution, handler);
|
|
5920
|
-
|
|
5921
|
-
|
|
6095
|
+
this.solution = solution;
|
|
6096
|
+
this.handler = handler;
|
|
6097
|
+
var opts = this.solution.opts.package.commonjs;
|
|
6098
|
+
if (opts && opts.output === 'simplified') {
|
|
6099
|
+
this.wrapModule = CommonJsBuilderSimplified_1.CommonJsBuilderSimplified.wrapModule;
|
|
6100
|
+
this.getRootContent = CommonJsBuilderSimplified_1.CommonJsBuilderSimplified.getRootContent;
|
|
6101
|
+
this.getHeaderContent = CommonJsBuilderSimplified_1.CommonJsBuilderSimplified.getHeaderContent;
|
|
5922
6102
|
}
|
|
5923
6103
|
}
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
url: null,
|
|
5928
|
-
dependencies: [],
|
|
5929
|
-
meta: {
|
|
5930
|
-
includejs: {
|
|
5931
|
-
hasIncludes: false,
|
|
5932
|
-
hasExports: false,
|
|
5933
|
-
hasResponseObject: false,
|
|
5934
|
-
responseAccessors: null,
|
|
5935
|
-
}
|
|
5936
|
-
}
|
|
5937
|
-
};
|
|
5938
|
-
AstUtil_1.AstUtil.each(ast, AstUtil_1.AstUtil.is.includeFunction, (node, descend) => {
|
|
5939
|
-
function isIncludeSymbolRef(node) {
|
|
5940
|
-
return AstUtil_1.AstUtil.is.type(node, 'AST_SymbolRef') && node.name == 'include';
|
|
5941
|
-
}
|
|
5942
|
-
let scope = AstUtil_1.AstUtil.findNode(node, isIncludeSymbolRef).scope || ast;
|
|
5943
|
-
this._process(info, node, scope);
|
|
5944
|
-
return true;
|
|
5945
|
-
});
|
|
5946
|
-
if (this._getPropertySetter('exports', ast) != null) {
|
|
5947
|
-
info.meta.includejs.hasExports = true;
|
|
6104
|
+
accepts(resource) {
|
|
6105
|
+
if (resource.type !== 'js') {
|
|
6106
|
+
return false;
|
|
5948
6107
|
}
|
|
5949
|
-
|
|
6108
|
+
let module = resource.getModule();
|
|
6109
|
+
if (module == null || module === 'root') {
|
|
6110
|
+
module = this.solution.opts.package.module;
|
|
6111
|
+
}
|
|
6112
|
+
return module === 'commonjs';
|
|
5950
6113
|
}
|
|
5951
|
-
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
|
|
6114
|
+
wrapModule(resource, outputItem, outputItems, setts) {
|
|
6115
|
+
var opts = this.solution.iteration;
|
|
6116
|
+
if (opts.commonjs == null) {
|
|
6117
|
+
opts.commonjs = {
|
|
6118
|
+
addHeading: true,
|
|
6119
|
+
hasHeading: false
|
|
6120
|
+
};
|
|
5955
6121
|
}
|
|
5956
6122
|
;
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
-
case 'load':
|
|
5962
|
-
case 'lazy':
|
|
5963
|
-
case 'mask':
|
|
5964
|
-
case 'routes':
|
|
5965
|
-
case 'setBase':
|
|
5966
|
-
case 'cfg':
|
|
5967
|
-
let pckg = {
|
|
5968
|
-
type: node.expression.property,
|
|
5969
|
-
args: AstUtil_1.AstUtil.getArguments(node.args, scope),
|
|
5970
|
-
};
|
|
5971
|
-
if (pckg.args.length > 0) {
|
|
5972
|
-
arr.unshift(pckg);
|
|
5973
|
-
}
|
|
5974
|
-
info.meta.includejs.hasIncludes = true;
|
|
5975
|
-
break;
|
|
5976
|
-
case 'done':
|
|
5977
|
-
case 'ready':
|
|
5978
|
-
this._processIncludeCallback(info, node.args && node.args[0]);
|
|
5979
|
-
break;
|
|
5980
|
-
case 'instance':
|
|
5981
|
-
case 'embed':
|
|
5982
|
-
case 'plugin':
|
|
5983
|
-
case 'ajax':
|
|
5984
|
-
case 'promise':
|
|
5985
|
-
case 'client':
|
|
5986
|
-
case 'server':
|
|
5987
|
-
case 'use':
|
|
5988
|
-
case 'getPending':
|
|
5989
|
-
case 'getResource':
|
|
5990
|
-
case 'getResourceById':
|
|
5991
|
-
case 'getResources':
|
|
5992
|
-
case 'apply':
|
|
5993
|
-
break;
|
|
5994
|
-
default:
|
|
5995
|
-
this.solution.reporter.warn('getIncludes: Unknown function call', node.expression);
|
|
5996
|
-
break;
|
|
5997
|
-
}
|
|
5998
|
-
});
|
|
5999
|
-
let include = new Include_1.Include();
|
|
6000
|
-
arr.forEach(function (x) {
|
|
6001
|
-
include[x.type].apply(include, x.args);
|
|
6002
|
-
});
|
|
6003
|
-
info.dependencies.push(...include.includes);
|
|
6004
|
-
}
|
|
6005
|
-
_processIncludeCallback(info, CallbackNode) {
|
|
6006
|
-
if (AstUtil_1.AstUtil.is.type(CallbackNode, 'AST_Function') == false) {
|
|
6007
|
-
return;
|
|
6008
|
-
}
|
|
6009
|
-
let meta = info.meta.includejs, args = CallbackNode.argnames, responseObjectName = args.length > 0
|
|
6010
|
-
? args[args.length - 1].name
|
|
6011
|
-
: null;
|
|
6012
|
-
if (responseObjectName) {
|
|
6013
|
-
meta.hasResponseObject = true;
|
|
6014
|
-
let names = this._getPropertyAccessors(responseObjectName, CallbackNode);
|
|
6015
|
-
if (names) {
|
|
6016
|
-
meta.responseAccessors = (meta.responseAccessors || []).concat(names);
|
|
6017
|
-
}
|
|
6123
|
+
var body = '';
|
|
6124
|
+
if (opts.commonjs.hasHeading === false && opts.commonjs.addHeading === true) {
|
|
6125
|
+
opts.commonjs.hasHeading = true;
|
|
6126
|
+
body = this.getHeaderContent();
|
|
6018
6127
|
}
|
|
6128
|
+
var { url, content } = resource;
|
|
6129
|
+
var module = Templates_1.Templates
|
|
6130
|
+
.Module
|
|
6131
|
+
.replace('%MODULE_PATH%', () => url)
|
|
6132
|
+
.replace('%MODULE%', () => content)
|
|
6133
|
+
.replace('%FOOTER%', () => { var _a, _b; return ((_b = (_a = setts === null || setts === void 0 ? void 0 : setts.partials) === null || _a === void 0 ? void 0 : _a.footer) !== null && _b !== void 0 ? _b : ''); });
|
|
6134
|
+
return body + module;
|
|
6019
6135
|
}
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
Fn.body.forEach(function (x) {
|
|
6026
|
-
function isSymbolName(node) {
|
|
6027
|
-
return AstUtil_1.AstUtil.is.type(node, 'AST_SymbolRef') && node.name === name;
|
|
6028
|
-
}
|
|
6029
|
-
AstUtil_1.AstUtil.each(x, isSymbolName, function (node) {
|
|
6030
|
-
let chain = AstUtil_1.AstUtil.getPropertyChain(node, this.stack);
|
|
6031
|
-
if (chain) {
|
|
6032
|
-
references.push(chain);
|
|
6033
|
-
}
|
|
6034
|
-
});
|
|
6035
|
-
});
|
|
6036
|
-
return references;
|
|
6136
|
+
getHeaderContent() {
|
|
6137
|
+
var mainUrl = this.solution.outputResources.rootInput.url;
|
|
6138
|
+
return Templates_1.Templates
|
|
6139
|
+
.Header
|
|
6140
|
+
.replace('%ROOT_DIR%', () => mainUrl);
|
|
6037
6141
|
}
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6045
|
-
|
|
6142
|
+
buildRoot(root, outputDependencies) {
|
|
6143
|
+
outputDependencies.forEach(x => x.embed = true);
|
|
6144
|
+
let content = this.getRootContent(root, outputDependencies);
|
|
6145
|
+
let body = outputDependencies
|
|
6146
|
+
.map(x => {
|
|
6147
|
+
let content = x.content;
|
|
6148
|
+
if (x.type === 'css') {
|
|
6149
|
+
content = (0, template_1.template_interpolate)(Templates_1.Templates.Style, { body: (0, template_1.template_stringifyContent)(content), url: x.url });
|
|
6046
6150
|
}
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6151
|
+
if (x.type === 'mask') {
|
|
6152
|
+
content = (0, template_1.template_interpolate)(Templates_1.Templates.Mask, { body: (0, template_1.template_stringifyContent)(content), url: x.url });
|
|
6153
|
+
}
|
|
6154
|
+
return content;
|
|
6155
|
+
})
|
|
6156
|
+
.concat([content])
|
|
6157
|
+
.join('\n');
|
|
6158
|
+
var wrapper = new ModuleWrapper_1.ModuleWrapper(this.solution);
|
|
6159
|
+
root.content = wrapper.wrap(body);
|
|
6160
|
+
}
|
|
6161
|
+
getRootContent(root, outputDependencies) {
|
|
6162
|
+
return root.content;
|
|
6055
6163
|
}
|
|
6056
6164
|
}
|
|
6057
|
-
exports.
|
|
6165
|
+
exports.CommonJsBuilder = CommonJsBuilder;
|
|
6058
6166
|
;
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
asModules: (arr) => arr.indexOf('mask') > -1
|
|
6062
|
-
}, {
|
|
6063
|
-
asModules: (arr) => {
|
|
6064
|
-
let i = arr.indexOf('mask');
|
|
6065
|
-
arr[i] = 'includejs';
|
|
6066
|
-
return arr;
|
|
6067
|
-
}
|
|
6068
|
-
}),
|
|
6069
|
-
new ResourcePropMapping_1.ResourcePropMapping({
|
|
6070
|
-
asModules: (arr) => arr.indexOf('amd') > -1
|
|
6071
|
-
}, {
|
|
6072
|
-
asModules: (arr) => {
|
|
6073
|
-
let i = arr.indexOf('amd');
|
|
6074
|
-
arr[i] = 'includejs';
|
|
6075
|
-
return arr;
|
|
6076
|
-
}
|
|
6077
|
-
}),
|
|
6078
|
-
new ResourcePropMapping_1.ResourcePropMapping({
|
|
6079
|
-
type: 'mask'
|
|
6080
|
-
}, {
|
|
6081
|
-
type: 'load'
|
|
6082
|
-
})
|
|
6083
|
-
];
|
|
6084
|
-
//# sourceMappingURL=IncludeJsParser.js.map
|
|
6085
|
-
//# sourceMappingURL=IncludeJsParser.ts.map;
|
|
6167
|
+
//# sourceMappingURL=CommonJsBuilder.js.map
|
|
6168
|
+
//# sourceMappingURL=CommonJsBuilder.ts.map;
|
|
6086
6169
|
|
|
6087
6170
|
function __isObj(x) {
|
|
6088
6171
|
return x != null && typeof x === 'object' && x.constructor === Object;
|
|
6089
6172
|
}
|
|
6090
|
-
if (
|
|
6173
|
+
if (_src_handlers_script_common_js_CommonJsBuilder === module.exports) {
|
|
6091
6174
|
// do nothing if
|
|
6092
|
-
} else if (__isObj(
|
|
6093
|
-
Object.assign(
|
|
6175
|
+
} else if (__isObj(_src_handlers_script_common_js_CommonJsBuilder) && __isObj(module.exports)) {
|
|
6176
|
+
Object.assign(_src_handlers_script_common_js_CommonJsBuilder, module.exports);
|
|
6094
6177
|
} else {
|
|
6095
|
-
|
|
6178
|
+
_src_handlers_script_common_js_CommonJsBuilder = module.exports;
|
|
6096
6179
|
}
|
|
6097
6180
|
|
|
6098
6181
|
;
|
|
@@ -6102,193 +6185,148 @@ let IncludeJsMappings = [
|
|
|
6102
6185
|
|
|
6103
6186
|
|
|
6104
6187
|
// source ./ModuleSimplified.js
|
|
6105
|
-
var
|
|
6188
|
+
var _src_handlers_script_common_js_CommonJsPathResolver;
|
|
6106
6189
|
(function () {
|
|
6107
6190
|
// ensure AMD is not active for the model, so that any UMD exports as commonjs
|
|
6108
6191
|
var define = null;
|
|
6109
|
-
var exports =
|
|
6192
|
+
var exports = _src_handlers_script_common_js_CommonJsPathResolver != null ? _src_handlers_script_common_js_CommonJsPathResolver : {};
|
|
6110
6193
|
var module = { exports: exports };
|
|
6111
6194
|
|
|
6112
6195
|
"use strict";
|
|
6113
6196
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6114
|
-
exports.
|
|
6115
|
-
const
|
|
6116
|
-
const
|
|
6117
|
-
const
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
var jsResources = allResources.filter(x => this.accepts(x));
|
|
6123
|
-
var cssResources = allResources.filter(x => x.type === 'css');
|
|
6124
|
-
var loadResources = allResources.filter(x => x.type === 'load');
|
|
6125
|
-
var jsRegister = this._serializeRegister(jsResources, 'js');
|
|
6126
|
-
var cssRegister = this._serializeRegister(cssResources, 'css');
|
|
6127
|
-
var loadRegister = this._serializeRegister(loadResources, 'load');
|
|
6128
|
-
return `
|
|
6129
|
-
${jsRegister}
|
|
6130
|
-
${cssRegister}
|
|
6131
|
-
${loadRegister}
|
|
6132
|
-
`;
|
|
6133
|
-
}
|
|
6134
|
-
isMainBuilder(solution) {
|
|
6135
|
-
const KEY = 'includejs';
|
|
6136
|
-
const packageInfo = solution.opts.package;
|
|
6137
|
-
return packageInfo.module === KEY || packageInfo.moduleName === KEY;
|
|
6138
|
-
}
|
|
6139
|
-
wrapModule(resource, outputItem, otherOutputItems) {
|
|
6140
|
-
var opts = this.solution.opts;
|
|
6141
|
-
var page = (0, res_1.res_getPage)(resource, opts);
|
|
6142
|
-
var iteration = this.solution.iteration;
|
|
6143
|
-
if (iteration.includejs == null) {
|
|
6144
|
-
iteration.includejs = {};
|
|
6145
|
-
}
|
|
6146
|
-
if (iteration.includejs[page] == null) {
|
|
6147
|
-
iteration.includejs[page] = {
|
|
6148
|
-
addHeading: true,
|
|
6149
|
-
hasHeading: false,
|
|
6150
|
-
lastItem: null
|
|
6151
|
-
};
|
|
6152
|
-
}
|
|
6153
|
-
var builderOpts = iteration.includejs[page];
|
|
6154
|
-
var body = '';
|
|
6155
|
-
if (builderOpts.hasHeading === false && builderOpts.addHeading === true) {
|
|
6156
|
-
builderOpts.hasHeading = true;
|
|
6157
|
-
body = this._createHeading(builderOpts, resource, outputItem, otherOutputItems);
|
|
6197
|
+
exports.CommonJsPathResolver = void 0;
|
|
6198
|
+
const BasePathResolver_1 = _src_handlers_base_BasePathResolver;
|
|
6199
|
+
const path_1 = _src_utils_path;
|
|
6200
|
+
const global_1 = _src_global;
|
|
6201
|
+
class CommonJsPathResolver extends BasePathResolver_1.BasePathResolver {
|
|
6202
|
+
accepts(includeData) {
|
|
6203
|
+
if (includeData.type !== 'js' || includeData.module !== 'commonjs') {
|
|
6204
|
+
return false;
|
|
6158
6205
|
}
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
let aliases = resource.aliases == null ? 'null' : '[' + resource.aliases.map(x => `'${x}'`).join(',') + ']';
|
|
6162
|
-
body += `include.setCurrent({ url: '${url}', aliases: ${aliases} });\n`;
|
|
6163
|
-
body += content;
|
|
6164
|
-
body += `\ninclude.getResourceById('${url}', 'js').readystatechanged(3);`;
|
|
6165
|
-
if (builderOpts.hasHeading && builderOpts.lastItem === resource) {
|
|
6166
|
-
body += `\ninclude.resumeStack();`;
|
|
6206
|
+
if (!/^[\w\-/]+$/.test(includeData.url)) {
|
|
6207
|
+
return false;
|
|
6167
6208
|
}
|
|
6168
|
-
|
|
6169
|
-
}
|
|
6170
|
-
accepts(resource) {
|
|
6171
|
-
if (resource.type !== 'js') {
|
|
6209
|
+
if (nodeCoreModules.indexOf(includeData.url) !== -1) {
|
|
6172
6210
|
return false;
|
|
6173
6211
|
}
|
|
6174
|
-
|
|
6175
|
-
return module === 'includejs';
|
|
6176
|
-
}
|
|
6177
|
-
_createHeading(builderOpts, resource, outputItem, otherOutputItems) {
|
|
6178
|
-
var outputItems = [outputItem, ...otherOutputItems];
|
|
6179
|
-
var allResources = (0, arr_1.arr_flattern)(outputItems.map(x => x.resources));
|
|
6180
|
-
var jsResources = allResources.filter(x => this.accepts(x));
|
|
6181
|
-
var cssResources = allResources.filter(x => x.type === 'css');
|
|
6182
|
-
var loadResources = allResources.filter(x => x.type === 'load');
|
|
6183
|
-
builderOpts.lastItem = jsResources[jsResources.length - 1];
|
|
6184
|
-
var jsRegister = this._serializeRegister(jsResources, 'js');
|
|
6185
|
-
var cssRegister = this._serializeRegister(cssResources, 'css');
|
|
6186
|
-
var loadRegister = this._serializeRegister(loadResources, 'load');
|
|
6187
|
-
var version = this._serializeVersion();
|
|
6188
|
-
var config = this._serializeConfig();
|
|
6189
|
-
var heading = `
|
|
6190
|
-
${version}
|
|
6191
|
-
${config}
|
|
6192
|
-
include.pauseStack();
|
|
6193
|
-
${jsRegister}
|
|
6194
|
-
${cssRegister}
|
|
6195
|
-
${loadRegister}
|
|
6196
|
-
`;
|
|
6197
|
-
return heading;
|
|
6198
|
-
}
|
|
6199
|
-
_serializeVersion() {
|
|
6200
|
-
var v = this.solution.opts.version;
|
|
6201
|
-
if (!v)
|
|
6202
|
-
return '';
|
|
6203
|
-
return `include.cfg('version', '${v}');`;
|
|
6204
|
-
}
|
|
6205
|
-
_serializeConfig() {
|
|
6206
|
-
var opts = Include_1.Include.getConfig();
|
|
6207
|
-
var json = JSON.stringify(opts);
|
|
6208
|
-
if (json === '{}')
|
|
6209
|
-
return '';
|
|
6210
|
-
return `include.cfg(${json});`;
|
|
6212
|
+
return true;
|
|
6211
6213
|
}
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
.
|
|
6216
|
-
|
|
6217
|
-
type: type,
|
|
6218
|
-
url: x.toTargetUrl(this.solution)
|
|
6219
|
-
};
|
|
6220
|
-
});
|
|
6221
|
-
if (paths.length === 0) {
|
|
6222
|
-
return '';
|
|
6214
|
+
resolve(includeData, parentResource) {
|
|
6215
|
+
let filename = nodeModuleResolve(includeData.url, parentResource.directory);
|
|
6216
|
+
if (filename) {
|
|
6217
|
+
let url = this.solution.opts.toAppUrl(filename);
|
|
6218
|
+
this.solution.opts.mappings[includeData.url] = url;
|
|
6223
6219
|
}
|
|
6224
|
-
|
|
6225
|
-
[type]: paths
|
|
6226
|
-
});
|
|
6227
|
-
return `
|
|
6228
|
-
include.register(${json});
|
|
6229
|
-
`;
|
|
6220
|
+
return filename;
|
|
6230
6221
|
}
|
|
6231
6222
|
}
|
|
6232
|
-
exports.
|
|
6223
|
+
exports.CommonJsPathResolver = CommonJsPathResolver;
|
|
6233
6224
|
;
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6225
|
+
const nodeCoreModules = [
|
|
6226
|
+
'assert', 'buffer', 'child_process', 'cluster', 'console', 'constants',
|
|
6227
|
+
'crypto', 'dgram', 'dns', 'domain', 'events', 'fs', 'http', 'https', 'module', 'net', 'os', 'path',
|
|
6228
|
+
'process', 'punycode', 'querystring', 'readline', 'repl', 'stream', 'string_decoder', 'sys', 'timers',
|
|
6229
|
+
'tls', 'tty', 'url', 'util', 'vm', 'zlib'
|
|
6230
|
+
];
|
|
6231
|
+
function nodeModuleResolve(path, location_) {
|
|
6232
|
+
let location = location_.replace(/[\\\/]+$/, '');
|
|
6233
|
+
let name = /^([\w\-]+)/.exec(path)[0];
|
|
6234
|
+
let resource = path.substring(name.length + 1);
|
|
6235
|
+
let current = location;
|
|
6236
|
+
let root_ = current + '/node_modules/' + name + '/';
|
|
6237
|
+
while (true) {
|
|
6238
|
+
let nodeModules = (0, path_1.path_combine)(current, '/node_modules/' + name + '/');
|
|
6239
|
+
let pckg = nodeModules + 'package.json';
|
|
6240
|
+
if (global_1.io.File.exists(pckg) === false) {
|
|
6241
|
+
let next = current.replace(/[^\/\\]+[\/\\]?$/, '');
|
|
6242
|
+
if (next === current) {
|
|
6243
|
+
return root_ + 'package.json';
|
|
6244
|
+
}
|
|
6245
|
+
current = next;
|
|
6246
|
+
continue;
|
|
6247
|
+
}
|
|
6248
|
+
if (resource) {
|
|
6249
|
+
let path = nodeModules + resource;
|
|
6250
|
+
if (hasExt(path) === false) {
|
|
6251
|
+
let likelyTs = path.includes('/src/');
|
|
6252
|
+
if (likelyTs) {
|
|
6253
|
+
if (global_1.io.File.exists(path + '.ts')) {
|
|
6254
|
+
return path + '.ts';
|
|
6255
|
+
}
|
|
6256
|
+
}
|
|
6257
|
+
return path + '.js';
|
|
6258
|
+
}
|
|
6259
|
+
return path;
|
|
6260
|
+
}
|
|
6261
|
+
let json = global_1.io.File.read(pckg);
|
|
6262
|
+
if (typeof json === 'string') {
|
|
6263
|
+
json = JSON.parse(json);
|
|
6264
|
+
}
|
|
6265
|
+
if (json.main) {
|
|
6266
|
+
return (0, path_1.path_combine)(nodeModules, json.main);
|
|
6267
|
+
}
|
|
6268
|
+
return nodeModules + 'index.js';
|
|
6269
|
+
}
|
|
6270
|
+
}
|
|
6271
|
+
function hasExt(path) {
|
|
6272
|
+
return /\.[\w]{1,8}($|\?)/.test(path);
|
|
6273
|
+
}
|
|
6274
|
+
//# sourceMappingURL=CommonJsPathResolver.js.map
|
|
6275
|
+
//# sourceMappingURL=CommonJsPathResolver.ts.map;
|
|
6276
|
+
|
|
6277
|
+
function __isObj(x) {
|
|
6278
|
+
return x != null && typeof x === 'object' && x.constructor === Object;
|
|
6279
|
+
}
|
|
6280
|
+
if (_src_handlers_script_common_js_CommonJsPathResolver === module.exports) {
|
|
6281
|
+
// do nothing if
|
|
6282
|
+
} else if (__isObj(_src_handlers_script_common_js_CommonJsPathResolver) && __isObj(module.exports)) {
|
|
6283
|
+
Object.assign(_src_handlers_script_common_js_CommonJsPathResolver, module.exports);
|
|
6284
|
+
} else {
|
|
6285
|
+
_src_handlers_script_common_js_CommonJsPathResolver = module.exports;
|
|
6286
|
+
}
|
|
6287
|
+
|
|
6288
|
+
;
|
|
6249
6289
|
}());
|
|
6250
6290
|
|
|
6251
6291
|
// end:source ./ModuleSimplified.js
|
|
6252
6292
|
|
|
6253
6293
|
|
|
6254
6294
|
// source ./ModuleSimplified.js
|
|
6255
|
-
var
|
|
6295
|
+
var _src_handlers_script_common_js_CommonJsHandler;
|
|
6256
6296
|
(function () {
|
|
6257
6297
|
// ensure AMD is not active for the model, so that any UMD exports as commonjs
|
|
6258
6298
|
var define = null;
|
|
6259
|
-
var exports =
|
|
6299
|
+
var exports = _src_handlers_script_common_js_CommonJsHandler != null ? _src_handlers_script_common_js_CommonJsHandler : {};
|
|
6260
6300
|
var module = { exports: exports };
|
|
6261
6301
|
|
|
6262
6302
|
"use strict";
|
|
6263
6303
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6264
|
-
exports.
|
|
6265
|
-
const
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
resource.asModules = ['includejs'];
|
|
6272
|
-
}
|
|
6273
|
-
}
|
|
6274
|
-
accepts(type) {
|
|
6275
|
-
return type === 'js';
|
|
6276
|
-
}
|
|
6304
|
+
exports.CommonJsHandler = void 0;
|
|
6305
|
+
const CommonJsParser_1 = _src_handlers_script_common_js_CommonJsParser;
|
|
6306
|
+
const CommonJsRewriter_1 = _src_handlers_script_common_js_CommonJsRewriter;
|
|
6307
|
+
const CommonJsBuilder_1 = _src_handlers_script_common_js_CommonJsBuilder;
|
|
6308
|
+
const CommonJsPathResolver_1 = _src_handlers_script_common_js_CommonJsPathResolver;
|
|
6309
|
+
const BaseHandler_1 = _src_handlers_base_BaseHandler;
|
|
6310
|
+
class CommonJsHandler extends BaseHandler_1.BaseHandler {
|
|
6277
6311
|
}
|
|
6278
|
-
exports.
|
|
6312
|
+
exports.CommonJsHandler = CommonJsHandler;
|
|
6313
|
+
CommonJsHandler.Parser = CommonJsParser_1.CommonJsParser;
|
|
6314
|
+
CommonJsHandler.Rewriter = CommonJsRewriter_1.CommonJsRewriter;
|
|
6315
|
+
CommonJsHandler.Builder = CommonJsBuilder_1.CommonJsBuilder;
|
|
6316
|
+
CommonJsHandler.PathResolver = CommonJsPathResolver_1.CommonJsPathResolver;
|
|
6279
6317
|
;
|
|
6280
|
-
//# sourceMappingURL=
|
|
6281
|
-
//# sourceMappingURL=
|
|
6318
|
+
//# sourceMappingURL=CommonJsHandler.js.map
|
|
6319
|
+
//# sourceMappingURL=CommonJsHandler.ts.map;
|
|
6282
6320
|
|
|
6283
6321
|
function __isObj(x) {
|
|
6284
6322
|
return x != null && typeof x === 'object' && x.constructor === Object;
|
|
6285
6323
|
}
|
|
6286
|
-
if (
|
|
6324
|
+
if (_src_handlers_script_common_js_CommonJsHandler === module.exports) {
|
|
6287
6325
|
// do nothing if
|
|
6288
|
-
} else if (__isObj(
|
|
6289
|
-
Object.assign(
|
|
6326
|
+
} else if (__isObj(_src_handlers_script_common_js_CommonJsHandler) && __isObj(module.exports)) {
|
|
6327
|
+
Object.assign(_src_handlers_script_common_js_CommonJsHandler, module.exports);
|
|
6290
6328
|
} else {
|
|
6291
|
-
|
|
6329
|
+
_src_handlers_script_common_js_CommonJsHandler = module.exports;
|
|
6292
6330
|
}
|
|
6293
6331
|
|
|
6294
6332
|
;
|
|
@@ -6298,71 +6336,69 @@ exports.IncludeJsRewriter = IncludeJsRewriter;
|
|
|
6298
6336
|
|
|
6299
6337
|
|
|
6300
6338
|
// source ./ModuleSimplified.js
|
|
6301
|
-
var
|
|
6339
|
+
var _src_handlers_script_amd_js_AmdJsParser;
|
|
6302
6340
|
(function () {
|
|
6303
6341
|
// ensure AMD is not active for the model, so that any UMD exports as commonjs
|
|
6304
6342
|
var define = null;
|
|
6305
|
-
var exports =
|
|
6343
|
+
var exports = _src_handlers_script_amd_js_AmdJsParser != null ? _src_handlers_script_amd_js_AmdJsParser : {};
|
|
6306
6344
|
var module = { exports: exports };
|
|
6307
6345
|
|
|
6308
6346
|
"use strict";
|
|
6309
6347
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6310
|
-
exports.
|
|
6311
|
-
const
|
|
6348
|
+
exports.AmdJsParser = void 0;
|
|
6349
|
+
const BaseParser_1 = _src_handlers_base_BaseParser;
|
|
6350
|
+
const AstUtil_1 = _src_handlers_script_utils_AstUtil;
|
|
6351
|
+
const atma_utils_1 = require("atma-utils");
|
|
6312
6352
|
const Include_1 = _src_class_Include;
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6353
|
+
class AmdJsParser extends BaseParser_1.BaseParser {
|
|
6354
|
+
getDependencies(ast, ownerResource) {
|
|
6355
|
+
let info = {
|
|
6356
|
+
dependencies: []
|
|
6357
|
+
};
|
|
6358
|
+
AstUtil_1.AstUtil.each(ast, AstUtil_1.AstUtil.is.amdFunction, (node, descend) => {
|
|
6359
|
+
let scope = node.scope || ast;
|
|
6360
|
+
let deps = this._process(node, scope);
|
|
6361
|
+
if (deps) {
|
|
6362
|
+
info.dependencies.push(...deps);
|
|
6363
|
+
}
|
|
6364
|
+
return true;
|
|
6365
|
+
});
|
|
6366
|
+
return new atma_utils_1.class_Dfr().resolve(info);
|
|
6323
6367
|
}
|
|
6324
|
-
|
|
6325
|
-
if (
|
|
6326
|
-
return
|
|
6368
|
+
_process(node, scope) {
|
|
6369
|
+
if (node.args.length < 2) {
|
|
6370
|
+
return;
|
|
6327
6371
|
}
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
.
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
resolvePath(includeData, parent) {
|
|
6343
|
-
return Include_1.Include
|
|
6344
|
-
.PathResolver
|
|
6345
|
-
.resolveBasic(includeData.url, includeData.type, parent);
|
|
6372
|
+
let args = AstUtil_1.AstUtil.getArguments(node.args, scope);
|
|
6373
|
+
let res = new Include_1.Include();
|
|
6374
|
+
let dependencies = args.find(x => Array.isArray(x));
|
|
6375
|
+
if (dependencies == null) {
|
|
6376
|
+
return;
|
|
6377
|
+
}
|
|
6378
|
+
let groups = Include_1.Include.groupByType(dependencies, this.solution.opts);
|
|
6379
|
+
for (let type in groups) {
|
|
6380
|
+
res[type].apply(res, groups[type]);
|
|
6381
|
+
}
|
|
6382
|
+
res.includes.forEach(x => x.module = 'amd');
|
|
6383
|
+
let ignore = ['exports', 'require'];
|
|
6384
|
+
res.includes = res.includes.filter(x => ignore.indexOf(x.url) === -1);
|
|
6385
|
+
return res.includes;
|
|
6346
6386
|
}
|
|
6347
6387
|
}
|
|
6348
|
-
exports.
|
|
6349
|
-
IncludeJsHandler.Parser = IncludeJsParser_1.IncludeJsParser;
|
|
6350
|
-
IncludeJsHandler.Rewriter = IncludeJsRewriter_1.IncludeJsRewriter;
|
|
6351
|
-
IncludeJsHandler.Builder = IncludeJsBuilder_1.IncludeJsBuilder;
|
|
6352
|
-
IncludeJsHandler.PathResolver = null;
|
|
6388
|
+
exports.AmdJsParser = AmdJsParser;
|
|
6353
6389
|
;
|
|
6354
|
-
//# sourceMappingURL=
|
|
6355
|
-
//# sourceMappingURL=
|
|
6390
|
+
//# sourceMappingURL=AmdJsParser.js.map
|
|
6391
|
+
//# sourceMappingURL=AmdJsParser.ts.map;
|
|
6356
6392
|
|
|
6357
6393
|
function __isObj(x) {
|
|
6358
6394
|
return x != null && typeof x === 'object' && x.constructor === Object;
|
|
6359
6395
|
}
|
|
6360
|
-
if (
|
|
6396
|
+
if (_src_handlers_script_amd_js_AmdJsParser === module.exports) {
|
|
6361
6397
|
// do nothing if
|
|
6362
|
-
} else if (__isObj(
|
|
6363
|
-
Object.assign(
|
|
6398
|
+
} else if (__isObj(_src_handlers_script_amd_js_AmdJsParser) && __isObj(module.exports)) {
|
|
6399
|
+
Object.assign(_src_handlers_script_amd_js_AmdJsParser, module.exports);
|
|
6364
6400
|
} else {
|
|
6365
|
-
|
|
6401
|
+
_src_handlers_script_amd_js_AmdJsParser = module.exports;
|
|
6366
6402
|
}
|
|
6367
6403
|
|
|
6368
6404
|
;
|
|
@@ -6372,89 +6408,40 @@ IncludeJsHandler.PathResolver = null;
|
|
|
6372
6408
|
|
|
6373
6409
|
|
|
6374
6410
|
// source ./ModuleSimplified.js
|
|
6375
|
-
var
|
|
6411
|
+
var _src_handlers_script_amd_js_AmdJsRewriter;
|
|
6376
6412
|
(function () {
|
|
6377
6413
|
// ensure AMD is not active for the model, so that any UMD exports as commonjs
|
|
6378
6414
|
var define = null;
|
|
6379
|
-
var exports =
|
|
6415
|
+
var exports = _src_handlers_script_amd_js_AmdJsRewriter != null ? _src_handlers_script_amd_js_AmdJsRewriter : {};
|
|
6380
6416
|
var module = { exports: exports };
|
|
6381
6417
|
|
|
6382
6418
|
"use strict";
|
|
6383
6419
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6384
|
-
exports.
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
}
|
|
6389
|
-
exports.u_getNewLine = u_getNewLine;
|
|
6390
|
-
;
|
|
6391
|
-
function u_getIndent(str) {
|
|
6392
|
-
var match = /^[ \t]+/.exec(str);
|
|
6393
|
-
return match && match[0] || '';
|
|
6394
|
-
}
|
|
6395
|
-
exports.u_getIndent = u_getIndent;
|
|
6396
|
-
;
|
|
6397
|
-
function u_makeIndent(str, indent, io) {
|
|
6398
|
-
if (!indent || !str)
|
|
6399
|
-
return str;
|
|
6400
|
-
let newline = u_getNewLine(str, io);
|
|
6401
|
-
return str
|
|
6402
|
-
.split(newline)
|
|
6403
|
-
.map(line => indent + line)
|
|
6404
|
-
.join(newline);
|
|
6405
|
-
}
|
|
6406
|
-
exports.u_makeIndent = u_makeIndent;
|
|
6407
|
-
;
|
|
6408
|
-
function u_getFilesFromPath(path, io) {
|
|
6409
|
-
var file = new io.File(path);
|
|
6410
|
-
if (file.exists() === false) {
|
|
6411
|
-
console.error('File not found', file.uri.toLocalFile());
|
|
6412
|
-
return [];
|
|
6420
|
+
exports.AmdJsRewriter = void 0;
|
|
6421
|
+
const BaseRewriter_1 = _src_handlers_base_BaseRewriter;
|
|
6422
|
+
class AmdJsRewriter extends BaseRewriter_1.BaseRewriter {
|
|
6423
|
+
rewritePartial(content, ownerResource) {
|
|
6413
6424
|
}
|
|
6414
|
-
|
|
6415
|
-
}
|
|
6416
|
-
exports.u_getFilesFromPath = u_getFilesFromPath;
|
|
6417
|
-
;
|
|
6418
|
-
function u_readFile(io, file, indent, insertFileName) {
|
|
6419
|
-
var content = file.read().toString();
|
|
6420
|
-
var newline = u_getNewLine(content, io);
|
|
6421
|
-
if (indent) {
|
|
6422
|
-
content = content
|
|
6423
|
-
.split(newline)
|
|
6424
|
-
.map(line => indent + line)
|
|
6425
|
-
.join(newline);
|
|
6425
|
+
rewriteResource(resource) {
|
|
6426
6426
|
}
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
+ '// source '
|
|
6430
|
-
+ file.uri.file
|
|
6431
|
-
+ newline
|
|
6432
|
-
+ content;
|
|
6427
|
+
accepts(type) {
|
|
6428
|
+
return type === 'mask';
|
|
6433
6429
|
}
|
|
6434
|
-
return content;
|
|
6435
6430
|
}
|
|
6436
|
-
exports.
|
|
6437
|
-
;
|
|
6438
|
-
function u_asString(str) {
|
|
6439
|
-
str = str
|
|
6440
|
-
.replace(/[\n\r]/g, '\\n')
|
|
6441
|
-
.replace(/"/g, '\\"');
|
|
6442
|
-
return `"${str}"`;
|
|
6443
|
-
}
|
|
6444
|
-
exports.u_asString = u_asString;
|
|
6431
|
+
exports.AmdJsRewriter = AmdJsRewriter;
|
|
6445
6432
|
;
|
|
6446
|
-
//# sourceMappingURL=
|
|
6447
|
-
//# sourceMappingURL=
|
|
6433
|
+
//# sourceMappingURL=AmdJsRewriter.js.map
|
|
6434
|
+
//# sourceMappingURL=AmdJsRewriter.ts.map;
|
|
6448
6435
|
|
|
6449
6436
|
function __isObj(x) {
|
|
6450
6437
|
return x != null && typeof x === 'object' && x.constructor === Object;
|
|
6451
6438
|
}
|
|
6452
|
-
if (
|
|
6439
|
+
if (_src_handlers_script_amd_js_AmdJsRewriter === module.exports) {
|
|
6453
6440
|
// do nothing if
|
|
6454
|
-
} else if (__isObj(
|
|
6455
|
-
Object.assign(
|
|
6441
|
+
} else if (__isObj(_src_handlers_script_amd_js_AmdJsRewriter) && __isObj(module.exports)) {
|
|
6442
|
+
Object.assign(_src_handlers_script_amd_js_AmdJsRewriter, module.exports);
|
|
6456
6443
|
} else {
|
|
6457
|
-
|
|
6444
|
+
_src_handlers_script_amd_js_AmdJsRewriter = module.exports;
|
|
6458
6445
|
}
|
|
6459
6446
|
|
|
6460
6447
|
;
|
|
@@ -6464,107 +6451,48 @@ exports.u_asString = u_asString;
|
|
|
6464
6451
|
|
|
6465
6452
|
|
|
6466
6453
|
// source ./ModuleSimplified.js
|
|
6467
|
-
var
|
|
6454
|
+
var _src_handlers_script_amd_js_AmdJsBuilder;
|
|
6468
6455
|
(function () {
|
|
6469
6456
|
// ensure AMD is not active for the model, so that any UMD exports as commonjs
|
|
6470
6457
|
var define = null;
|
|
6471
|
-
var exports =
|
|
6458
|
+
var exports = _src_handlers_script_amd_js_AmdJsBuilder != null ? _src_handlers_script_amd_js_AmdJsBuilder : {};
|
|
6472
6459
|
var module = { exports: exports };
|
|
6473
6460
|
|
|
6474
6461
|
"use strict";
|
|
6475
6462
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6476
|
-
exports.
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
6480
|
-
this.arr = [];
|
|
6481
|
-
}
|
|
6482
|
-
add(...arr) {
|
|
6483
|
-
for (let i = 0; i < arr.length; i++) {
|
|
6484
|
-
let x = arr[i];
|
|
6485
|
-
if (this.hash[x.id] != null) {
|
|
6486
|
-
continue;
|
|
6487
|
-
}
|
|
6488
|
-
this.hash[x.id] = x;
|
|
6489
|
-
this.arr.push(x);
|
|
6490
|
-
}
|
|
6491
|
-
}
|
|
6492
|
-
insert(x, i) {
|
|
6493
|
-
if (this.hash[x.id] != null) {
|
|
6494
|
-
this.remove(x);
|
|
6495
|
-
}
|
|
6496
|
-
this.hash[x.id] = x;
|
|
6497
|
-
this.arr.splice(i, 0, x);
|
|
6498
|
-
}
|
|
6499
|
-
has(x) {
|
|
6500
|
-
return this.hash[x.id] != null;
|
|
6501
|
-
}
|
|
6502
|
-
indexOf(x) {
|
|
6503
|
-
for (let i = 0; i < this.arr.length; i++) {
|
|
6504
|
-
if (this.arr[i].id === x.id) {
|
|
6505
|
-
return i;
|
|
6506
|
-
}
|
|
6507
|
-
}
|
|
6508
|
-
return -1;
|
|
6463
|
+
exports.AmdJsBuilder = void 0;
|
|
6464
|
+
const BaseScriptBuilder_1 = _src_handlers_script_base_BaseScriptBuilder;
|
|
6465
|
+
class AmdJsBuilder extends BaseScriptBuilder_1.BaseScriptBuilder {
|
|
6466
|
+
buildRoot(resource, dependencies) {
|
|
6509
6467
|
}
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
let i = this.arr.findIndex(module => module.id === x.id);
|
|
6513
|
-
this.arr.splice(i, 1);
|
|
6468
|
+
wrapModule(resource, outputItem) {
|
|
6469
|
+
return resource.content;
|
|
6514
6470
|
}
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
let i = -1, length = this.arr.length;
|
|
6519
|
-
while (++i < length) {
|
|
6520
|
-
let x = this.arr[i];
|
|
6521
|
-
if (handled.has(x)) {
|
|
6522
|
-
continue;
|
|
6523
|
-
}
|
|
6524
|
-
handled.add(x);
|
|
6525
|
-
if (fn(x)) {
|
|
6526
|
-
this.arr.splice(i, 1);
|
|
6527
|
-
delete this.hash[x.id];
|
|
6528
|
-
}
|
|
6529
|
-
break;
|
|
6530
|
-
}
|
|
6531
|
-
if (i === length) {
|
|
6532
|
-
break;
|
|
6533
|
-
}
|
|
6471
|
+
accepts(resource) {
|
|
6472
|
+
if (resource.type !== 'js') {
|
|
6473
|
+
return false;
|
|
6534
6474
|
}
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
while (true) {
|
|
6539
|
-
let i = -1, length = this.arr.length;
|
|
6540
|
-
while (++i < length) {
|
|
6541
|
-
let x = this.arr[i];
|
|
6542
|
-
if (handled.has(x)) {
|
|
6543
|
-
continue;
|
|
6544
|
-
}
|
|
6545
|
-
handled.add(x);
|
|
6546
|
-
fn(x, i);
|
|
6547
|
-
break;
|
|
6548
|
-
}
|
|
6549
|
-
if (i === length) {
|
|
6550
|
-
break;
|
|
6551
|
-
}
|
|
6475
|
+
let module = resource.getModule();
|
|
6476
|
+
if (module === 'root' && resource.solution.opts.package.module === 'amd') {
|
|
6477
|
+
module = 'amd';
|
|
6552
6478
|
}
|
|
6479
|
+
return module === 'amd';
|
|
6553
6480
|
}
|
|
6554
6481
|
}
|
|
6555
|
-
exports.
|
|
6556
|
-
|
|
6557
|
-
//# sourceMappingURL=
|
|
6482
|
+
exports.AmdJsBuilder = AmdJsBuilder;
|
|
6483
|
+
;
|
|
6484
|
+
//# sourceMappingURL=AmdJsBuilder.js.map
|
|
6485
|
+
//# sourceMappingURL=AmdJsBuilder.ts.map;
|
|
6558
6486
|
|
|
6559
6487
|
function __isObj(x) {
|
|
6560
6488
|
return x != null && typeof x === 'object' && x.constructor === Object;
|
|
6561
6489
|
}
|
|
6562
|
-
if (
|
|
6490
|
+
if (_src_handlers_script_amd_js_AmdJsBuilder === module.exports) {
|
|
6563
6491
|
// do nothing if
|
|
6564
|
-
} else if (__isObj(
|
|
6565
|
-
Object.assign(
|
|
6492
|
+
} else if (__isObj(_src_handlers_script_amd_js_AmdJsBuilder) && __isObj(module.exports)) {
|
|
6493
|
+
Object.assign(_src_handlers_script_amd_js_AmdJsBuilder, module.exports);
|
|
6566
6494
|
} else {
|
|
6567
|
-
|
|
6495
|
+
_src_handlers_script_amd_js_AmdJsBuilder = module.exports;
|
|
6568
6496
|
}
|
|
6569
6497
|
|
|
6570
6498
|
;
|
|
@@ -6574,35 +6502,40 @@ exports.Dictionary = Dictionary;
|
|
|
6574
6502
|
|
|
6575
6503
|
|
|
6576
6504
|
// source ./ModuleSimplified.js
|
|
6577
|
-
var
|
|
6505
|
+
var _src_handlers_script_amd_js_AmdJsHandler;
|
|
6578
6506
|
(function () {
|
|
6579
6507
|
// ensure AMD is not active for the model, so that any UMD exports as commonjs
|
|
6580
6508
|
var define = null;
|
|
6581
|
-
var exports =
|
|
6509
|
+
var exports = _src_handlers_script_amd_js_AmdJsHandler != null ? _src_handlers_script_amd_js_AmdJsHandler : {};
|
|
6582
6510
|
var module = { exports: exports };
|
|
6583
6511
|
|
|
6584
6512
|
"use strict";
|
|
6585
6513
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6586
|
-
exports.
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6514
|
+
exports.AmdJsHandler = void 0;
|
|
6515
|
+
const AmdJsParser_1 = _src_handlers_script_amd_js_AmdJsParser;
|
|
6516
|
+
const AmdJsRewriter_1 = _src_handlers_script_amd_js_AmdJsRewriter;
|
|
6517
|
+
const AmdJsBuilder_1 = _src_handlers_script_amd_js_AmdJsBuilder;
|
|
6518
|
+
const BaseHandler_1 = _src_handlers_base_BaseHandler;
|
|
6519
|
+
class AmdJsHandler extends BaseHandler_1.BaseHandler {
|
|
6520
|
+
}
|
|
6521
|
+
exports.AmdJsHandler = AmdJsHandler;
|
|
6522
|
+
AmdJsHandler.Parser = AmdJsParser_1.AmdJsParser;
|
|
6523
|
+
AmdJsHandler.Rewriter = AmdJsRewriter_1.AmdJsRewriter;
|
|
6524
|
+
AmdJsHandler.Builder = AmdJsBuilder_1.AmdJsBuilder;
|
|
6525
|
+
AmdJsHandler.PathResolver = null;
|
|
6526
|
+
;
|
|
6527
|
+
//# sourceMappingURL=AmdJsHandler.js.map
|
|
6528
|
+
//# sourceMappingURL=AmdJsHandler.ts.map;
|
|
6596
6529
|
|
|
6597
6530
|
function __isObj(x) {
|
|
6598
6531
|
return x != null && typeof x === 'object' && x.constructor === Object;
|
|
6599
6532
|
}
|
|
6600
|
-
if (
|
|
6533
|
+
if (_src_handlers_script_amd_js_AmdJsHandler === module.exports) {
|
|
6601
6534
|
// do nothing if
|
|
6602
|
-
} else if (__isObj(
|
|
6603
|
-
Object.assign(
|
|
6535
|
+
} else if (__isObj(_src_handlers_script_amd_js_AmdJsHandler) && __isObj(module.exports)) {
|
|
6536
|
+
Object.assign(_src_handlers_script_amd_js_AmdJsHandler, module.exports);
|
|
6604
6537
|
} else {
|
|
6605
|
-
|
|
6538
|
+
_src_handlers_script_amd_js_AmdJsHandler = module.exports;
|
|
6606
6539
|
}
|
|
6607
6540
|
|
|
6608
6541
|
;
|
|
@@ -6612,255 +6545,469 @@ var String;
|
|
|
6612
6545
|
|
|
6613
6546
|
|
|
6614
6547
|
// source ./ModuleSimplified.js
|
|
6615
|
-
var
|
|
6548
|
+
var _src_class_ResourcePropMapping;
|
|
6616
6549
|
(function () {
|
|
6617
6550
|
// ensure AMD is not active for the model, so that any UMD exports as commonjs
|
|
6618
6551
|
var define = null;
|
|
6619
|
-
var exports =
|
|
6552
|
+
var exports = _src_class_ResourcePropMapping != null ? _src_class_ResourcePropMapping : {};
|
|
6620
6553
|
var module = { exports: exports };
|
|
6621
6554
|
|
|
6622
6555
|
"use strict";
|
|
6623
6556
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6624
|
-
exports.
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
class IImporterOptions {
|
|
6630
|
-
constructor() {
|
|
6631
|
-
this.removeUnusedExports = true;
|
|
6632
|
-
this.wrapper = 'iif';
|
|
6633
|
-
this.lazy = null;
|
|
6634
|
-
}
|
|
6635
|
-
}
|
|
6636
|
-
exports.IImporterOptions = IImporterOptions;
|
|
6637
|
-
class ModuleFile {
|
|
6638
|
-
constructor(content, file) {
|
|
6639
|
-
this.content = content;
|
|
6640
|
-
this.file = file;
|
|
6641
|
-
this.outer = new Dictionary_1.Dictionary();
|
|
6642
|
-
this.scoped = new Dictionary_1.Dictionary();
|
|
6643
|
-
this.imports = [];
|
|
6644
|
-
this.exports = [];
|
|
6645
|
-
this.scopedVars = [];
|
|
6646
|
-
this.id = file.uri.toLocalFile();
|
|
6647
|
-
this.path = file.uri.toRelativeString(io.env.currentDir);
|
|
6557
|
+
exports.ResourcePropMapping = void 0;
|
|
6558
|
+
class ResourcePropMapping {
|
|
6559
|
+
constructor(resA, resB) {
|
|
6560
|
+
this.resA = resA;
|
|
6561
|
+
this.resB = resB;
|
|
6648
6562
|
}
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6563
|
+
map(resource) {
|
|
6564
|
+
let match = true;
|
|
6565
|
+
for (let key in this.resA) {
|
|
6566
|
+
let val = this.resA[key];
|
|
6567
|
+
if (val == null)
|
|
6568
|
+
continue;
|
|
6569
|
+
let currentVal = resource[key];
|
|
6570
|
+
if (typeof val === 'function') {
|
|
6571
|
+
match = val(currentVal);
|
|
6572
|
+
}
|
|
6573
|
+
if (val instanceof RegExp) {
|
|
6574
|
+
match = val.exec(currentVal) != null;
|
|
6575
|
+
}
|
|
6576
|
+
if (typeof val === 'string' || typeof val === 'number') {
|
|
6577
|
+
match = val === currentVal;
|
|
6578
|
+
}
|
|
6579
|
+
if (match == false) {
|
|
6580
|
+
return resource;
|
|
6661
6581
|
}
|
|
6662
|
-
return false;
|
|
6663
|
-
}
|
|
6664
|
-
if (this.id === x.id) {
|
|
6665
|
-
return true;
|
|
6666
6582
|
}
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6583
|
+
let clone = resource.clone();
|
|
6584
|
+
for (let key in this.resB) {
|
|
6585
|
+
let val = this.resB[key];
|
|
6586
|
+
let currentVal = resource[key];
|
|
6587
|
+
if (typeof val === 'function') {
|
|
6588
|
+
clone[key] = val(currentVal, resource);
|
|
6589
|
+
continue;
|
|
6590
|
+
}
|
|
6591
|
+
if (typeof val === 'string' || typeof val === 'boolean') {
|
|
6592
|
+
clone[key] = val;
|
|
6593
|
+
continue;
|
|
6674
6594
|
}
|
|
6675
|
-
dict.add(module);
|
|
6676
|
-
module.outer.forEach(add);
|
|
6677
|
-
module.scoped.forEach(add);
|
|
6678
6595
|
}
|
|
6679
|
-
|
|
6680
|
-
return dict.arr;
|
|
6596
|
+
return clone;
|
|
6681
6597
|
}
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
//
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
}
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
|
|
6707
|
-
|
|
6708
|
-
|
|
6709
|
-
|
|
6710
|
-
|
|
6711
|
-
|
|
6712
|
-
|
|
6713
|
-
|
|
6714
|
-
|
|
6715
|
-
|
|
6716
|
-
|
|
6717
|
-
|
|
6718
|
-
|
|
6719
|
-
|
|
6598
|
+
}
|
|
6599
|
+
exports.ResourcePropMapping = ResourcePropMapping;
|
|
6600
|
+
//# sourceMappingURL=ResourcePropMapping.js.map
|
|
6601
|
+
//# sourceMappingURL=ResourcePropMapping.ts.map;
|
|
6602
|
+
|
|
6603
|
+
function __isObj(x) {
|
|
6604
|
+
return x != null && typeof x === 'object' && x.constructor === Object;
|
|
6605
|
+
}
|
|
6606
|
+
if (_src_class_ResourcePropMapping === module.exports) {
|
|
6607
|
+
// do nothing if
|
|
6608
|
+
} else if (__isObj(_src_class_ResourcePropMapping) && __isObj(module.exports)) {
|
|
6609
|
+
Object.assign(_src_class_ResourcePropMapping, module.exports);
|
|
6610
|
+
} else {
|
|
6611
|
+
_src_class_ResourcePropMapping = module.exports;
|
|
6612
|
+
}
|
|
6613
|
+
|
|
6614
|
+
;
|
|
6615
|
+
}());
|
|
6616
|
+
|
|
6617
|
+
// end:source ./ModuleSimplified.js
|
|
6618
|
+
|
|
6619
|
+
|
|
6620
|
+
// source ./ModuleSimplified.js
|
|
6621
|
+
var _src_handlers_script_include_js_IncludeJsParser;
|
|
6622
|
+
(function () {
|
|
6623
|
+
// ensure AMD is not active for the model, so that any UMD exports as commonjs
|
|
6624
|
+
var define = null;
|
|
6625
|
+
var exports = _src_handlers_script_include_js_IncludeJsParser != null ? _src_handlers_script_include_js_IncludeJsParser : {};
|
|
6626
|
+
var module = { exports: exports };
|
|
6627
|
+
|
|
6628
|
+
"use strict";
|
|
6629
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6630
|
+
exports.IncludeJsParser = void 0;
|
|
6631
|
+
const AstUtil_1 = _src_handlers_script_utils_AstUtil;
|
|
6632
|
+
const Include_1 = _src_class_Include;
|
|
6633
|
+
const ResourcePropMapping_1 = _src_class_ResourcePropMapping;
|
|
6634
|
+
const BaseParser_1 = _src_handlers_base_BaseParser;
|
|
6635
|
+
const atma_utils_1 = require("atma-utils");
|
|
6636
|
+
class IncludeJsParser extends BaseParser_1.BaseParser {
|
|
6637
|
+
constructor(solution, handler) {
|
|
6638
|
+
super(solution, handler);
|
|
6639
|
+
if (this.solution.opts.package.module === 'includejs') {
|
|
6640
|
+
this.solution.opts.mappers.push(...IncludeJsMappings);
|
|
6720
6641
|
}
|
|
6721
|
-
|
|
6722
|
-
|
|
6723
|
-
|
|
6724
|
-
|
|
6725
|
-
|
|
6726
|
-
|
|
6727
|
-
|
|
6728
|
-
|
|
6642
|
+
}
|
|
6643
|
+
getDependencies(ast, ownerResource) {
|
|
6644
|
+
let info = {
|
|
6645
|
+
type: null,
|
|
6646
|
+
url: null,
|
|
6647
|
+
dependencies: [],
|
|
6648
|
+
meta: {
|
|
6649
|
+
includejs: {
|
|
6650
|
+
hasIncludes: false,
|
|
6651
|
+
hasExports: false,
|
|
6652
|
+
hasResponseObject: false,
|
|
6653
|
+
responseAccessors: null,
|
|
6654
|
+
}
|
|
6729
6655
|
}
|
|
6730
|
-
|
|
6731
|
-
|
|
6732
|
-
|
|
6656
|
+
};
|
|
6657
|
+
AstUtil_1.AstUtil.each(ast, AstUtil_1.AstUtil.is.includeFunction, (node, descend) => {
|
|
6658
|
+
function isIncludeSymbolRef(node) {
|
|
6659
|
+
return AstUtil_1.AstUtil.is.type(node, 'AST_SymbolRef') && node.name == 'include';
|
|
6660
|
+
}
|
|
6661
|
+
let scope = AstUtil_1.AstUtil.findNode(node, isIncludeSymbolRef).scope || ast;
|
|
6662
|
+
this._process(info, node, scope);
|
|
6663
|
+
return true;
|
|
6664
|
+
});
|
|
6665
|
+
if (this._getPropertySetter('exports', ast) != null) {
|
|
6666
|
+
info.meta.includejs.hasExports = true;
|
|
6667
|
+
}
|
|
6668
|
+
return new atma_utils_1.class_Dfr().resolve(info);
|
|
6669
|
+
}
|
|
6670
|
+
_process(info, node, scope) {
|
|
6671
|
+
let arr = [];
|
|
6672
|
+
function isIncludeMethodCall(node) {
|
|
6673
|
+
return AstUtil_1.AstUtil.is.type(node, 'AST_Call') && node.start.value == 'include';
|
|
6674
|
+
}
|
|
6675
|
+
;
|
|
6676
|
+
AstUtil_1.AstUtil.each(node, isIncludeMethodCall, (node) => {
|
|
6677
|
+
switch (node.expression && node.expression.property) {
|
|
6678
|
+
case 'js':
|
|
6679
|
+
case 'css':
|
|
6680
|
+
case 'load':
|
|
6681
|
+
case 'lazy':
|
|
6682
|
+
case 'mask':
|
|
6683
|
+
case 'routes':
|
|
6684
|
+
case 'setBase':
|
|
6685
|
+
case 'cfg':
|
|
6686
|
+
let pckg = {
|
|
6687
|
+
type: node.expression.property,
|
|
6688
|
+
args: AstUtil_1.AstUtil.getArguments(node.args, scope),
|
|
6689
|
+
};
|
|
6690
|
+
if (pckg.args.length > 0) {
|
|
6691
|
+
arr.unshift(pckg);
|
|
6692
|
+
}
|
|
6693
|
+
info.meta.includejs.hasIncludes = true;
|
|
6733
6694
|
break;
|
|
6734
|
-
case '
|
|
6735
|
-
|
|
6695
|
+
case 'done':
|
|
6696
|
+
case 'ready':
|
|
6697
|
+
this._processIncludeCallback(info, node.args && node.args[0]);
|
|
6736
6698
|
break;
|
|
6737
|
-
case '
|
|
6738
|
-
|
|
6699
|
+
case 'instance':
|
|
6700
|
+
case 'embed':
|
|
6701
|
+
case 'plugin':
|
|
6702
|
+
case 'ajax':
|
|
6703
|
+
case 'promise':
|
|
6704
|
+
case 'client':
|
|
6705
|
+
case 'server':
|
|
6706
|
+
case 'use':
|
|
6707
|
+
case 'getPending':
|
|
6708
|
+
case 'getResource':
|
|
6709
|
+
case 'getResourceById':
|
|
6710
|
+
case 'getResources':
|
|
6711
|
+
case 'apply':
|
|
6739
6712
|
break;
|
|
6740
|
-
|
|
6741
|
-
|
|
6742
|
-
content = String_1.String.replace(content, x.position, x.length, '');
|
|
6743
|
-
}
|
|
6713
|
+
default:
|
|
6714
|
+
this.solution.reporter.warn('getIncludes: Unknown function call', node.expression);
|
|
6744
6715
|
break;
|
|
6745
6716
|
}
|
|
6746
6717
|
});
|
|
6747
|
-
|
|
6748
|
-
|
|
6749
|
-
|
|
6718
|
+
let include = new Include_1.Include();
|
|
6719
|
+
arr.forEach(function (x) {
|
|
6720
|
+
include[x.type].apply(include, x.args);
|
|
6750
6721
|
});
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
return x;
|
|
6766
|
-
});
|
|
6767
|
-
externalRefs = this
|
|
6768
|
-
.exports
|
|
6769
|
-
.reverse()
|
|
6770
|
-
.filter(x => {
|
|
6771
|
-
if (x.builder.movedToOuter) {
|
|
6772
|
-
return false;
|
|
6773
|
-
}
|
|
6774
|
-
if (options.removeUnusedExports === false) {
|
|
6775
|
-
return true;
|
|
6776
|
-
}
|
|
6777
|
-
if (x.dependents.length === 0) {
|
|
6778
|
-
console.warn(`Module ${this.id} has unused export ${x.ref}`);
|
|
6779
|
-
return false;
|
|
6780
|
-
}
|
|
6781
|
-
return true;
|
|
6782
|
-
})
|
|
6783
|
-
.filter(x => {
|
|
6784
|
-
let exportInOuter = parents
|
|
6785
|
-
.some(p => {
|
|
6786
|
-
let parentsExport = p.exports.find(e => e.hasExport(x.ref));
|
|
6787
|
-
if (parentsExport == null) {
|
|
6788
|
-
return false;
|
|
6789
|
-
}
|
|
6790
|
-
if (options.removeUnusedExports && parentsExport.dependents.length === 0) {
|
|
6791
|
-
return false;
|
|
6792
|
-
}
|
|
6793
|
-
return true;
|
|
6794
|
-
});
|
|
6795
|
-
return exportInOuter === false;
|
|
6796
|
-
})
|
|
6797
|
-
.map(x => ` ${x.ref}`)
|
|
6798
|
-
.join(`,${newLine}`);
|
|
6799
|
-
if (externalRefs.length > 0) {
|
|
6800
|
-
externalRefs = String_1.String.replace(externalRefs, 0, 3, 'var');
|
|
6801
|
-
externalRefs += ';';
|
|
6722
|
+
info.dependencies.push(...include.includes);
|
|
6723
|
+
}
|
|
6724
|
+
_processIncludeCallback(info, CallbackNode) {
|
|
6725
|
+
if (AstUtil_1.AstUtil.is.type(CallbackNode, 'AST_Function') == false) {
|
|
6726
|
+
return;
|
|
6727
|
+
}
|
|
6728
|
+
let meta = info.meta.includejs, args = CallbackNode.argnames, responseObjectName = args.length > 0
|
|
6729
|
+
? args[args.length - 1].name
|
|
6730
|
+
: null;
|
|
6731
|
+
if (responseObjectName) {
|
|
6732
|
+
meta.hasResponseObject = true;
|
|
6733
|
+
let names = this._getPropertyAccessors(responseObjectName, CallbackNode);
|
|
6734
|
+
if (names) {
|
|
6735
|
+
meta.responseAccessors = (meta.responseAccessors || []).concat(names);
|
|
6802
6736
|
}
|
|
6803
6737
|
}
|
|
6804
|
-
const SPACE = '\t';
|
|
6805
|
-
let indentScopedContent = `${(0, utils_1.u_makeIndent)(scopedContent || '', SPACE, io)}`;
|
|
6806
|
-
let indentContent = `${(0, utils_1.u_makeIndent)(content, SPACE, io)}`;
|
|
6807
|
-
let scopeLess = parents.length === 0 && options.wrapper !== 'iif';
|
|
6808
|
-
content = [
|
|
6809
|
-
`${outerContent}` || '',
|
|
6810
|
-
`${externalRefs}` || '',
|
|
6811
|
-
!scopeLess && (indentScopedContent || indentContent) ? `(function(){` : '',
|
|
6812
|
-
indentScopedContent,
|
|
6813
|
-
indentContent,
|
|
6814
|
-
!scopeLess && (indentScopedContent || indentContent) ? `}());` : ''
|
|
6815
|
-
]
|
|
6816
|
-
.filter(x => !!x)
|
|
6817
|
-
.join(newLine);
|
|
6818
|
-
return (0, utils_1.u_makeIndent)(content, indent, io);
|
|
6819
6738
|
}
|
|
6820
|
-
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
|
|
6739
|
+
/**
|
|
6740
|
+
* resolve %name%.propertyAccessor
|
|
6741
|
+
*/
|
|
6742
|
+
_getPropertyAccessors(name, Fn) {
|
|
6743
|
+
let references = [];
|
|
6744
|
+
Fn.body.forEach(function (x) {
|
|
6745
|
+
function isSymbolName(node) {
|
|
6746
|
+
return AstUtil_1.AstUtil.is.type(node, 'AST_SymbolRef') && node.name === name;
|
|
6828
6747
|
}
|
|
6829
|
-
|
|
6748
|
+
AstUtil_1.AstUtil.each(x, isSymbolName, function (node) {
|
|
6749
|
+
let chain = AstUtil_1.AstUtil.getPropertyChain(node, this.stack);
|
|
6750
|
+
if (chain) {
|
|
6751
|
+
references.push(chain);
|
|
6752
|
+
}
|
|
6753
|
+
});
|
|
6754
|
+
});
|
|
6755
|
+
return references;
|
|
6756
|
+
}
|
|
6757
|
+
/**
|
|
6758
|
+
* aim to find all **.exports = X
|
|
6759
|
+
*/
|
|
6760
|
+
_getPropertySetter(name, Fn) {
|
|
6761
|
+
let result = null;
|
|
6762
|
+
Fn.body.forEach(function (x) {
|
|
6763
|
+
function isPropertyName(node) {
|
|
6764
|
+
AstUtil_1.AstUtil.is.type(node, 'AST_Assign') && node.left.property === name;
|
|
6765
|
+
}
|
|
6766
|
+
AstUtil_1.AstUtil.each(x, isPropertyName, function (node) {
|
|
6767
|
+
let arr = ['include', 'module', 'exports'];
|
|
6768
|
+
if (arr.indexOf(node.start.value) > -1) {
|
|
6769
|
+
result = node;
|
|
6770
|
+
}
|
|
6771
|
+
});
|
|
6772
|
+
});
|
|
6773
|
+
return result;
|
|
6774
|
+
}
|
|
6775
|
+
}
|
|
6776
|
+
exports.IncludeJsParser = IncludeJsParser;
|
|
6777
|
+
;
|
|
6778
|
+
let IncludeJsMappings = [
|
|
6779
|
+
new ResourcePropMapping_1.ResourcePropMapping({
|
|
6780
|
+
asModules: (arr) => arr.indexOf('mask') > -1
|
|
6781
|
+
}, {
|
|
6782
|
+
asModules: (arr) => {
|
|
6783
|
+
let i = arr.indexOf('mask');
|
|
6784
|
+
arr[i] = 'includejs';
|
|
6785
|
+
return arr;
|
|
6830
6786
|
}
|
|
6831
|
-
|
|
6787
|
+
}),
|
|
6788
|
+
new ResourcePropMapping_1.ResourcePropMapping({
|
|
6789
|
+
asModules: (arr) => arr.indexOf('amd') > -1
|
|
6790
|
+
}, {
|
|
6791
|
+
asModules: (arr) => {
|
|
6792
|
+
let i = arr.indexOf('amd');
|
|
6793
|
+
arr[i] = 'includejs';
|
|
6794
|
+
return arr;
|
|
6795
|
+
}
|
|
6796
|
+
}),
|
|
6797
|
+
new ResourcePropMapping_1.ResourcePropMapping({
|
|
6798
|
+
type: 'mask'
|
|
6799
|
+
}, {
|
|
6800
|
+
type: 'load'
|
|
6801
|
+
})
|
|
6802
|
+
];
|
|
6803
|
+
//# sourceMappingURL=IncludeJsParser.js.map
|
|
6804
|
+
//# sourceMappingURL=IncludeJsParser.ts.map;
|
|
6805
|
+
|
|
6806
|
+
function __isObj(x) {
|
|
6807
|
+
return x != null && typeof x === 'object' && x.constructor === Object;
|
|
6808
|
+
}
|
|
6809
|
+
if (_src_handlers_script_include_js_IncludeJsParser === module.exports) {
|
|
6810
|
+
// do nothing if
|
|
6811
|
+
} else if (__isObj(_src_handlers_script_include_js_IncludeJsParser) && __isObj(module.exports)) {
|
|
6812
|
+
Object.assign(_src_handlers_script_include_js_IncludeJsParser, module.exports);
|
|
6813
|
+
} else {
|
|
6814
|
+
_src_handlers_script_include_js_IncludeJsParser = module.exports;
|
|
6815
|
+
}
|
|
6816
|
+
|
|
6817
|
+
;
|
|
6818
|
+
}());
|
|
6819
|
+
|
|
6820
|
+
// end:source ./ModuleSimplified.js
|
|
6821
|
+
|
|
6822
|
+
|
|
6823
|
+
// source ./ModuleSimplified.js
|
|
6824
|
+
var _src_handlers_script_include_js_IncludeJsBuilder;
|
|
6825
|
+
(function () {
|
|
6826
|
+
// ensure AMD is not active for the model, so that any UMD exports as commonjs
|
|
6827
|
+
var define = null;
|
|
6828
|
+
var exports = _src_handlers_script_include_js_IncludeJsBuilder != null ? _src_handlers_script_include_js_IncludeJsBuilder : {};
|
|
6829
|
+
var module = { exports: exports };
|
|
6830
|
+
|
|
6831
|
+
"use strict";
|
|
6832
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6833
|
+
exports.IncludeJsBuilder = void 0;
|
|
6834
|
+
const arr_1 = _src_utils_arr;
|
|
6835
|
+
const Include_1 = _src_class_Include;
|
|
6836
|
+
const res_1 = _src_utils_res;
|
|
6837
|
+
const BaseScriptBuilder_1 = _src_handlers_script_base_BaseScriptBuilder;
|
|
6838
|
+
class IncludeJsBuilder extends BaseScriptBuilder_1.BaseScriptBuilder {
|
|
6839
|
+
wrapScriptlessModule(otherOutputItems) {
|
|
6840
|
+
var allResources = (0, arr_1.arr_flattern)(otherOutputItems.map(x => x.resources));
|
|
6841
|
+
var jsResources = allResources.filter(x => this.accepts(x));
|
|
6842
|
+
var cssResources = allResources.filter(x => x.type === 'css');
|
|
6843
|
+
var loadResources = allResources.filter(x => x.type === 'load');
|
|
6844
|
+
var jsRegister = this._serializeRegister(jsResources, 'js');
|
|
6845
|
+
var cssRegister = this._serializeRegister(cssResources, 'css');
|
|
6846
|
+
var loadRegister = this._serializeRegister(loadResources, 'load');
|
|
6847
|
+
return `
|
|
6848
|
+
${jsRegister}
|
|
6849
|
+
${cssRegister}
|
|
6850
|
+
${loadRegister}
|
|
6851
|
+
`;
|
|
6832
6852
|
}
|
|
6833
|
-
|
|
6834
|
-
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
|
|
6853
|
+
isMainBuilder(solution) {
|
|
6854
|
+
const KEY = 'includejs';
|
|
6855
|
+
const packageInfo = solution.opts.package;
|
|
6856
|
+
return packageInfo.module === KEY || packageInfo.moduleName === KEY;
|
|
6857
|
+
}
|
|
6858
|
+
wrapModule(resource, outputItem, otherOutputItems) {
|
|
6859
|
+
var opts = this.solution.opts;
|
|
6860
|
+
var page = (0, res_1.res_getPage)(resource, opts);
|
|
6861
|
+
var iteration = this.solution.iteration;
|
|
6862
|
+
if (iteration.includejs == null) {
|
|
6863
|
+
iteration.includejs = {};
|
|
6864
|
+
}
|
|
6865
|
+
if (iteration.includejs[page] == null) {
|
|
6866
|
+
iteration.includejs[page] = {
|
|
6867
|
+
addHeading: true,
|
|
6868
|
+
hasHeading: false,
|
|
6869
|
+
lastItem: null
|
|
6839
6870
|
};
|
|
6840
|
-
if (json.outer.length === 0) {
|
|
6841
|
-
delete json.outer;
|
|
6842
|
-
}
|
|
6843
|
-
if (json.scoped.length === 0) {
|
|
6844
|
-
delete json.scoped;
|
|
6845
|
-
}
|
|
6846
|
-
return json;
|
|
6847
6871
|
}
|
|
6848
|
-
|
|
6872
|
+
var builderOpts = iteration.includejs[page];
|
|
6873
|
+
var body = '';
|
|
6874
|
+
if (builderOpts.hasHeading === false && builderOpts.addHeading === true) {
|
|
6875
|
+
builderOpts.hasHeading = true;
|
|
6876
|
+
body = this._createHeading(builderOpts, resource, outputItem, otherOutputItems);
|
|
6877
|
+
}
|
|
6878
|
+
let content = resource.content;
|
|
6879
|
+
let url = resource.toTargetUrl(this.solution);
|
|
6880
|
+
let aliases = resource.aliases == null ? 'null' : '[' + resource.aliases.map(x => `'${x}'`).join(',') + ']';
|
|
6881
|
+
body += `include.setCurrent({ url: '${url}', aliases: ${aliases} });\n`;
|
|
6882
|
+
body += content;
|
|
6883
|
+
body += `\ninclude.getResourceById('${url}', 'js').readystatechanged(3);`;
|
|
6884
|
+
if (builderOpts.hasHeading && builderOpts.lastItem === resource) {
|
|
6885
|
+
body += `\ninclude.resumeStack();`;
|
|
6886
|
+
}
|
|
6887
|
+
return body;
|
|
6888
|
+
}
|
|
6889
|
+
accepts(resource) {
|
|
6890
|
+
if (resource.type !== 'js') {
|
|
6891
|
+
return false;
|
|
6892
|
+
}
|
|
6893
|
+
const module = resource.getModule();
|
|
6894
|
+
return module === 'includejs';
|
|
6895
|
+
}
|
|
6896
|
+
_createHeading(builderOpts, resource, outputItem, otherOutputItems) {
|
|
6897
|
+
var outputItems = [outputItem, ...otherOutputItems];
|
|
6898
|
+
var allResources = (0, arr_1.arr_flattern)(outputItems.map(x => x.resources));
|
|
6899
|
+
var jsResources = allResources.filter(x => this.accepts(x));
|
|
6900
|
+
var cssResources = allResources.filter(x => x.type === 'css');
|
|
6901
|
+
var loadResources = allResources.filter(x => x.type === 'load');
|
|
6902
|
+
builderOpts.lastItem = jsResources[jsResources.length - 1];
|
|
6903
|
+
var jsRegister = this._serializeRegister(jsResources, 'js');
|
|
6904
|
+
var cssRegister = this._serializeRegister(cssResources, 'css');
|
|
6905
|
+
var loadRegister = this._serializeRegister(loadResources, 'load');
|
|
6906
|
+
var version = this._serializeVersion();
|
|
6907
|
+
var config = this._serializeConfig();
|
|
6908
|
+
var heading = `
|
|
6909
|
+
${version}
|
|
6910
|
+
${config}
|
|
6911
|
+
include.pauseStack();
|
|
6912
|
+
${jsRegister}
|
|
6913
|
+
${cssRegister}
|
|
6914
|
+
${loadRegister}
|
|
6915
|
+
`;
|
|
6916
|
+
return heading;
|
|
6917
|
+
}
|
|
6918
|
+
_serializeVersion() {
|
|
6919
|
+
var v = this.solution.opts.version;
|
|
6920
|
+
if (!v)
|
|
6921
|
+
return '';
|
|
6922
|
+
return `include.cfg('version', '${v}');`;
|
|
6923
|
+
}
|
|
6924
|
+
_serializeConfig() {
|
|
6925
|
+
var opts = Include_1.Include.getConfig();
|
|
6926
|
+
var json = JSON.stringify(opts);
|
|
6927
|
+
if (json === '{}')
|
|
6928
|
+
return '';
|
|
6929
|
+
return `include.cfg(${json});`;
|
|
6930
|
+
}
|
|
6931
|
+
_serializeRegister(resources, type) {
|
|
6932
|
+
var paths = resources
|
|
6933
|
+
.filter(x => x.type === type)
|
|
6934
|
+
.map(x => {
|
|
6935
|
+
return {
|
|
6936
|
+
type: type,
|
|
6937
|
+
url: x.toTargetUrl(this.solution)
|
|
6938
|
+
};
|
|
6939
|
+
});
|
|
6940
|
+
if (paths.length === 0) {
|
|
6941
|
+
return '';
|
|
6942
|
+
}
|
|
6943
|
+
var json = JSON.stringify({
|
|
6944
|
+
[type]: paths
|
|
6945
|
+
});
|
|
6946
|
+
return `
|
|
6947
|
+
include.register(${json});
|
|
6948
|
+
`;
|
|
6949
|
+
}
|
|
6950
|
+
}
|
|
6951
|
+
exports.IncludeJsBuilder = IncludeJsBuilder;
|
|
6952
|
+
;
|
|
6953
|
+
//# sourceMappingURL=IncludeJsBuilder.js.map
|
|
6954
|
+
//# sourceMappingURL=IncludeJsBuilder.ts.map;
|
|
6955
|
+
|
|
6956
|
+
function __isObj(x) {
|
|
6957
|
+
return x != null && typeof x === 'object' && x.constructor === Object;
|
|
6958
|
+
}
|
|
6959
|
+
if (_src_handlers_script_include_js_IncludeJsBuilder === module.exports) {
|
|
6960
|
+
// do nothing if
|
|
6961
|
+
} else if (__isObj(_src_handlers_script_include_js_IncludeJsBuilder) && __isObj(module.exports)) {
|
|
6962
|
+
Object.assign(_src_handlers_script_include_js_IncludeJsBuilder, module.exports);
|
|
6963
|
+
} else {
|
|
6964
|
+
_src_handlers_script_include_js_IncludeJsBuilder = module.exports;
|
|
6965
|
+
}
|
|
6966
|
+
|
|
6967
|
+
;
|
|
6968
|
+
}());
|
|
6969
|
+
|
|
6970
|
+
// end:source ./ModuleSimplified.js
|
|
6971
|
+
|
|
6972
|
+
|
|
6973
|
+
// source ./ModuleSimplified.js
|
|
6974
|
+
var _src_handlers_script_include_js_IncludeJsRewriter;
|
|
6975
|
+
(function () {
|
|
6976
|
+
// ensure AMD is not active for the model, so that any UMD exports as commonjs
|
|
6977
|
+
var define = null;
|
|
6978
|
+
var exports = _src_handlers_script_include_js_IncludeJsRewriter != null ? _src_handlers_script_include_js_IncludeJsRewriter : {};
|
|
6979
|
+
var module = { exports: exports };
|
|
6980
|
+
|
|
6981
|
+
"use strict";
|
|
6982
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6983
|
+
exports.IncludeJsRewriter = void 0;
|
|
6984
|
+
const BaseRewriter_1 = _src_handlers_base_BaseRewriter;
|
|
6985
|
+
class IncludeJsRewriter extends BaseRewriter_1.BaseRewriter {
|
|
6986
|
+
rewritePartial(content, ownerResource) {
|
|
6987
|
+
}
|
|
6988
|
+
rewriteResource(resource) {
|
|
6989
|
+
if (resource.getModule() === 'global' && resource && resource.meta && resource.meta.includejs && resource.meta.includejs.hasIncludes) {
|
|
6990
|
+
resource.asModules = ['includejs'];
|
|
6991
|
+
}
|
|
6992
|
+
}
|
|
6993
|
+
accepts(type) {
|
|
6994
|
+
return type === 'js';
|
|
6849
6995
|
}
|
|
6850
6996
|
}
|
|
6851
|
-
exports.
|
|
6852
|
-
|
|
6853
|
-
//# sourceMappingURL=
|
|
6997
|
+
exports.IncludeJsRewriter = IncludeJsRewriter;
|
|
6998
|
+
;
|
|
6999
|
+
//# sourceMappingURL=IncludeJsRewriter.js.map
|
|
7000
|
+
//# sourceMappingURL=IncludeJsRewriter.ts.map;
|
|
6854
7001
|
|
|
6855
7002
|
function __isObj(x) {
|
|
6856
7003
|
return x != null && typeof x === 'object' && x.constructor === Object;
|
|
6857
7004
|
}
|
|
6858
|
-
if (
|
|
7005
|
+
if (_src_handlers_script_include_js_IncludeJsRewriter === module.exports) {
|
|
6859
7006
|
// do nothing if
|
|
6860
|
-
} else if (__isObj(
|
|
6861
|
-
Object.assign(
|
|
7007
|
+
} else if (__isObj(_src_handlers_script_include_js_IncludeJsRewriter) && __isObj(module.exports)) {
|
|
7008
|
+
Object.assign(_src_handlers_script_include_js_IncludeJsRewriter, module.exports);
|
|
6862
7009
|
} else {
|
|
6863
|
-
|
|
7010
|
+
_src_handlers_script_include_js_IncludeJsRewriter = module.exports;
|
|
6864
7011
|
}
|
|
6865
7012
|
|
|
6866
7013
|
;
|
|
@@ -6870,208 +7017,71 @@ exports.ModuleFile = ModuleFile;
|
|
|
6870
7017
|
|
|
6871
7018
|
|
|
6872
7019
|
// source ./ModuleSimplified.js
|
|
6873
|
-
var
|
|
7020
|
+
var _src_handlers_script_include_js_IncludeJsHandler;
|
|
6874
7021
|
(function () {
|
|
6875
7022
|
// ensure AMD is not active for the model, so that any UMD exports as commonjs
|
|
6876
7023
|
var define = null;
|
|
6877
|
-
var exports =
|
|
7024
|
+
var exports = _src_handlers_script_include_js_IncludeJsHandler != null ? _src_handlers_script_include_js_IncludeJsHandler : {};
|
|
6878
7025
|
var module = { exports: exports };
|
|
6879
7026
|
|
|
6880
7027
|
"use strict";
|
|
6881
7028
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6882
|
-
exports.
|
|
6883
|
-
const
|
|
6884
|
-
const
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
return $import;
|
|
6896
|
-
}
|
|
6897
|
-
},
|
|
6898
|
-
refs: {
|
|
6899
|
-
rgx: /^[ \t]*import\s*\{([^}]+)}\s*from\s*['"]([^'"]+)['"][\t ;]*[\r\n]{0,2}/gm,
|
|
6900
|
-
map(match) {
|
|
6901
|
-
let $import = new ResourceInfo_1.ImportNode();
|
|
6902
|
-
$import.position = match.index;
|
|
6903
|
-
$import.length = match[0].length;
|
|
6904
|
-
$import.type = 'refs';
|
|
6905
|
-
$import.path = match[2];
|
|
6906
|
-
$import.refs = match[1].split(',').map(x => x.trim());
|
|
6907
|
-
return $import;
|
|
6908
|
-
}
|
|
6909
|
-
},
|
|
6910
|
-
defaults: {
|
|
6911
|
-
rgx: /^[ \t]*import\s+(?<def>\w+)\s+from\s*['"](?<path>[^'"]+)['"][\t ;]*[\r\n]{0,2}/gm,
|
|
6912
|
-
map(match) {
|
|
6913
|
-
let $import = new ResourceInfo_1.ImportNode();
|
|
6914
|
-
$import.position = match.index;
|
|
6915
|
-
$import.length = match[0].length;
|
|
6916
|
-
$import.type = 'full';
|
|
6917
|
-
$import.path = match.groups.path;
|
|
6918
|
-
return $import;
|
|
6919
|
-
}
|
|
6920
|
-
},
|
|
6921
|
-
exportAll: {
|
|
6922
|
-
rgx: /^[ \t]*export\s+\*\s+from\s*['"]([^'"]+)['"][\t ;]*[\r\n]{0,2}/gm,
|
|
6923
|
-
map(match) {
|
|
6924
|
-
let $import = new ResourceInfo_1.ImportNode();
|
|
6925
|
-
$import.position = match.index;
|
|
6926
|
-
$import.length = match[0].length;
|
|
6927
|
-
$import.type = 'exportAll';
|
|
6928
|
-
$import.path = match[1];
|
|
6929
|
-
$import.exportAll = true;
|
|
6930
|
-
return $import;
|
|
6931
|
-
}
|
|
6932
|
-
},
|
|
6933
|
-
exportRefs: {
|
|
6934
|
-
rgx: /^[ \t]*export\s*\{([^}]+)}\s*from\s*['"]([^'"]+)['"][\t ;]*[\r\n]{0,2}/gm,
|
|
6935
|
-
map(match) {
|
|
6936
|
-
let $import = new ResourceInfo_1.ImportNode();
|
|
6937
|
-
$import.position = match.index;
|
|
6938
|
-
$import.length = match[0].length;
|
|
6939
|
-
$import.type = 'exportRefs';
|
|
6940
|
-
$import.path = match[2];
|
|
6941
|
-
$import.refs = match[1].split(',').map(x => x.trim());
|
|
6942
|
-
$import.exportRefs = true;
|
|
6943
|
-
return $import;
|
|
6944
|
-
}
|
|
6945
|
-
}
|
|
6946
|
-
},
|
|
6947
|
-
Exports: {
|
|
6948
|
-
ref: {
|
|
6949
|
-
rgx: /^[ \t]*export\s*(const|let|var)\s+([\w\d_$]+)(?=\s*[^\w\d_$;])/gm,
|
|
6950
|
-
map(match) {
|
|
6951
|
-
let $export = new ResourceInfo_1.ExportNode();
|
|
6952
|
-
$export.position = match.index;
|
|
6953
|
-
$export.length = match[0].length;
|
|
6954
|
-
$export.type = 'ref';
|
|
6955
|
-
$export.ref = match[2];
|
|
6956
|
-
return $export;
|
|
6957
|
-
}
|
|
6958
|
-
},
|
|
6959
|
-
named: {
|
|
6960
|
-
rgx: /^[ \t]*export\s*(const|let|var)\s+([\w\d_$]+)(?=\s*[;])/gm,
|
|
6961
|
-
map(match) {
|
|
6962
|
-
let $export = new ResourceInfo_1.ExportNode();
|
|
6963
|
-
$export.position = match.index;
|
|
6964
|
-
$export.length = match[0].length;
|
|
6965
|
-
$export.type = 'named';
|
|
6966
|
-
$export.ref = match[2];
|
|
6967
|
-
return $export;
|
|
6968
|
-
}
|
|
6969
|
-
},
|
|
6970
|
-
scoped: {
|
|
6971
|
-
rgx: /^[ \t]*export\s*\{([^}]+)}\s*;?(?!\s*from)/gm,
|
|
6972
|
-
map(match) {
|
|
6973
|
-
let refs = match[1].split(',').map(x => x.trim());
|
|
6974
|
-
let $export = new ResourceInfo_1.ExportNode();
|
|
6975
|
-
$export.position = match.index;
|
|
6976
|
-
$export.length = match[0].length;
|
|
6977
|
-
$export.type = 'scoped';
|
|
6978
|
-
$export.ref = refs[0];
|
|
6979
|
-
let other = refs.slice(1).map(ref => {
|
|
6980
|
-
let $export = new ResourceInfo_1.ExportNode();
|
|
6981
|
-
$export.position = match.index;
|
|
6982
|
-
$export.length = 0;
|
|
6983
|
-
$export.type = 'scoped';
|
|
6984
|
-
$export.ref = ref;
|
|
6985
|
-
return $export;
|
|
6986
|
-
});
|
|
6987
|
-
return [$export, ...other];
|
|
6988
|
-
}
|
|
6989
|
-
},
|
|
6990
|
-
function: {
|
|
6991
|
-
rgx: /^[ \t]*export\s*function\s+([\w\d_$]+)/gm,
|
|
6992
|
-
map(match) {
|
|
6993
|
-
let $export = new ResourceInfo_1.ExportNode();
|
|
6994
|
-
$export.position = match.index;
|
|
6995
|
-
$export.length = match[0].length;
|
|
6996
|
-
$export.type = 'function';
|
|
6997
|
-
$export.ref = match[1];
|
|
6998
|
-
return $export;
|
|
6999
|
-
}
|
|
7000
|
-
}
|
|
7029
|
+
exports.IncludeJsHandler = void 0;
|
|
7030
|
+
const Templates_1 = _src_handlers_script_common_js_templates_Templates;
|
|
7031
|
+
const Include_1 = _src_class_Include;
|
|
7032
|
+
const IncludeJsParser_1 = _src_handlers_script_include_js_IncludeJsParser;
|
|
7033
|
+
const IncludeJsBuilder_1 = _src_handlers_script_include_js_IncludeJsBuilder;
|
|
7034
|
+
const BaseHandler_1 = _src_handlers_base_BaseHandler;
|
|
7035
|
+
const IncludeJsRewriter_1 = _src_handlers_script_include_js_IncludeJsRewriter;
|
|
7036
|
+
class IncludeJsHandler extends BaseHandler_1.BaseHandler {
|
|
7037
|
+
constructor(solution) {
|
|
7038
|
+
super(solution);
|
|
7039
|
+
// if (this.solution.opts.package.module === 'includejs') {
|
|
7040
|
+
// this.registerMappings_();
|
|
7041
|
+
// }
|
|
7001
7042
|
}
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
for (let type in Rgx) {
|
|
7006
|
-
for (let key in Rgx[type]) {
|
|
7007
|
-
let rgx = Rgx[type][key].rgx;
|
|
7008
|
-
rgx.lastIndex = 0;
|
|
7009
|
-
if (rgx.test(content)) {
|
|
7010
|
-
return true;
|
|
7011
|
-
}
|
|
7012
|
-
}
|
|
7043
|
+
accepts(resource) {
|
|
7044
|
+
if (resource.type !== 'js') {
|
|
7045
|
+
return false;
|
|
7013
7046
|
}
|
|
7014
|
-
|
|
7047
|
+
var module = resource.getModule();
|
|
7048
|
+
if (module == null || module === 'root')
|
|
7049
|
+
module = this.solution.opts.package.module;
|
|
7050
|
+
return module === 'includejs';
|
|
7015
7051
|
}
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
-
|
|
7026
|
-
|
|
7027
|
-
|
|
7028
|
-
|
|
7029
|
-
else {
|
|
7030
|
-
module.imports.push(result);
|
|
7031
|
-
}
|
|
7032
|
-
}
|
|
7033
|
-
}
|
|
7034
|
-
for (let key in Rgx.Exports) {
|
|
7035
|
-
let x = Rgx.Exports[key];
|
|
7036
|
-
x.rgx.lastIndex = 0;
|
|
7037
|
-
for (let match = x.rgx.exec(content); match != null; match = x.rgx.exec(content)) {
|
|
7038
|
-
let result = x.map(match, content);
|
|
7039
|
-
if (Array.isArray(result)) {
|
|
7040
|
-
module.exports.push(...result);
|
|
7041
|
-
}
|
|
7042
|
-
else {
|
|
7043
|
-
module.exports.push(result);
|
|
7044
|
-
}
|
|
7045
|
-
}
|
|
7046
|
-
}
|
|
7047
|
-
module.imports.forEach(m => m.parent = module);
|
|
7048
|
-
module.imports.filter(x => x.type === 'exportRefs').forEach(imp => {
|
|
7049
|
-
imp.refs.forEach(ref => {
|
|
7050
|
-
let exp = new ResourceInfo_1.ExportNode();
|
|
7051
|
-
exp.position = 0;
|
|
7052
|
-
exp.length = 0;
|
|
7053
|
-
exp.ref = ref;
|
|
7054
|
-
module.exports.push(exp);
|
|
7055
|
-
});
|
|
7056
|
-
});
|
|
7057
|
-
module.imports.sort((a, b) => a.position < b.position ? -1 : 1);
|
|
7058
|
-
module.exports.sort((a, b) => a.position < b.position ? -1 : 1);
|
|
7059
|
-
return module;
|
|
7052
|
+
rewriteRoot(root, dependencies) {
|
|
7053
|
+
dependencies.forEach(x => x.embed = true);
|
|
7054
|
+
var body = dependencies
|
|
7055
|
+
.map(x => x.content)
|
|
7056
|
+
.concat([root.content])
|
|
7057
|
+
.join('\n');
|
|
7058
|
+
body = Templates_1.Templates.RootModule.replace('%BUNDLE%', () => body);
|
|
7059
|
+
root.content = body;
|
|
7060
|
+
}
|
|
7061
|
+
resolvePath(includeData, parent) {
|
|
7062
|
+
return Include_1.Include
|
|
7063
|
+
.PathResolver
|
|
7064
|
+
.resolveBasic(includeData.url, includeData.type, parent);
|
|
7060
7065
|
}
|
|
7061
7066
|
}
|
|
7062
|
-
exports.
|
|
7063
|
-
|
|
7064
|
-
|
|
7067
|
+
exports.IncludeJsHandler = IncludeJsHandler;
|
|
7068
|
+
IncludeJsHandler.Parser = IncludeJsParser_1.IncludeJsParser;
|
|
7069
|
+
IncludeJsHandler.Rewriter = IncludeJsRewriter_1.IncludeJsRewriter;
|
|
7070
|
+
IncludeJsHandler.Builder = IncludeJsBuilder_1.IncludeJsBuilder;
|
|
7071
|
+
IncludeJsHandler.PathResolver = null;
|
|
7072
|
+
;
|
|
7073
|
+
//# sourceMappingURL=IncludeJsHandler.js.map
|
|
7074
|
+
//# sourceMappingURL=IncludeJsHandler.ts.map;
|
|
7065
7075
|
|
|
7066
7076
|
function __isObj(x) {
|
|
7067
7077
|
return x != null && typeof x === 'object' && x.constructor === Object;
|
|
7068
7078
|
}
|
|
7069
|
-
if (
|
|
7079
|
+
if (_src_handlers_script_include_js_IncludeJsHandler === module.exports) {
|
|
7070
7080
|
// do nothing if
|
|
7071
|
-
} else if (__isObj(
|
|
7072
|
-
Object.assign(
|
|
7081
|
+
} else if (__isObj(_src_handlers_script_include_js_IncludeJsHandler) && __isObj(module.exports)) {
|
|
7082
|
+
Object.assign(_src_handlers_script_include_js_IncludeJsHandler, module.exports);
|
|
7073
7083
|
} else {
|
|
7074
|
-
|
|
7084
|
+
_src_handlers_script_include_js_IncludeJsHandler = module.exports;
|
|
7075
7085
|
}
|
|
7076
7086
|
|
|
7077
7087
|
;
|