@stencil/core 4.36.3-dev.1756357315.1a20bb5 → 4.36.3-dev.1756702916.0456db1
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/cli/index.cjs +1 -1
- package/cli/index.js +1 -1
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +1023 -806
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/internal/app-data/package.json +1 -1
- package/internal/app-globals/package.json +1 -1
- package/internal/client/index.js +23 -12
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +23 -12
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +1 -1
- package/internal/package.json +1 -1
- package/internal/stencil-private.d.ts +3 -0
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +1 -1
- package/mock-doc/index.js +1 -1
- package/mock-doc/package.json +1 -1
- package/package.json +2 -2
- package/screenshot/index.js +1 -1
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +1 -1
- package/sys/node/index.js +1 -1
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +3 -1
- package/testing/package.json +1 -1
package/compiler/stencil.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Stencil Compiler v4.36.3-dev.
|
|
2
|
+
Stencil Compiler v4.36.3-dev.1756702916.0456db1 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
"use strict";
|
|
5
5
|
var __create = Object.create;
|
|
@@ -2330,7 +2330,7 @@ var require_typescript_5_5_4_bundle_cache_min = __commonJS({
|
|
|
2330
2330
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
2331
2331
|
and limitations under the License.
|
|
2332
2332
|
***************************************************************************** */
|
|
2333
|
-
var
|
|
2333
|
+
var ts70 = {};
|
|
2334
2334
|
((module3) => {
|
|
2335
2335
|
"use strict";
|
|
2336
2336
|
var _a2;
|
|
@@ -207851,9 +207851,9 @@ ${e.message}`;
|
|
|
207851
207851
|
};
|
|
207852
207852
|
}
|
|
207853
207853
|
})({ get exports() {
|
|
207854
|
-
return
|
|
207854
|
+
return ts70;
|
|
207855
207855
|
}, set exports(v) {
|
|
207856
|
-
|
|
207856
|
+
ts70 = v;
|
|
207857
207857
|
if (typeof module2 !== "undefined" && module2.exports) {
|
|
207858
207858
|
module2.exports = v;
|
|
207859
207859
|
}
|
|
@@ -232664,17 +232664,17 @@ __export(index_exports, {
|
|
|
232664
232664
|
optimizeJs: () => optimizeJs,
|
|
232665
232665
|
transpile: () => transpile,
|
|
232666
232666
|
transpileSync: () => transpileSync,
|
|
232667
|
-
ts: () =>
|
|
232667
|
+
ts: () => import_typescript69.default,
|
|
232668
232668
|
validateConfig: () => validateConfig,
|
|
232669
232669
|
vermoji: () => vermoji,
|
|
232670
232670
|
version: () => version,
|
|
232671
232671
|
versions: () => versions
|
|
232672
232672
|
});
|
|
232673
232673
|
module.exports = __toCommonJS(index_exports);
|
|
232674
|
-
var
|
|
232674
|
+
var import_typescript69 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
232675
232675
|
|
|
232676
232676
|
// src/version.ts
|
|
232677
|
-
var buildId = "
|
|
232677
|
+
var buildId = "1756702916";
|
|
232678
232678
|
var minfyJsId = "terser5.37.0_7";
|
|
232679
232679
|
var optimizeCssId = "autoprefixer10.4.19_postcss8.5.3_7";
|
|
232680
232680
|
var parse5Version = "7.2.1";
|
|
@@ -232682,8 +232682,8 @@ var rollupVersion = "4.34.9";
|
|
|
232682
232682
|
var jqueryVersion = "4.0.0-pre";
|
|
232683
232683
|
var terserVersion = "5.37.0";
|
|
232684
232684
|
var typescriptVersion = "5.5.4";
|
|
232685
|
-
var vermoji = "\u{
|
|
232686
|
-
var version = "4.36.3-dev.
|
|
232685
|
+
var vermoji = "\u{1F60E}";
|
|
232686
|
+
var version = "4.36.3-dev.1756702916.0456db1";
|
|
232687
232687
|
var versions = {
|
|
232688
232688
|
stencil: version,
|
|
232689
232689
|
parse5: parse5Version,
|
|
@@ -234458,7 +234458,7 @@ var validateComponentTag = (tag) => {
|
|
|
234458
234458
|
};
|
|
234459
234459
|
|
|
234460
234460
|
// src/compiler/compiler.ts
|
|
234461
|
-
var
|
|
234461
|
+
var import_typescript65 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
234462
234462
|
|
|
234463
234463
|
// src/compiler/build/compiler-ctx.ts
|
|
234464
234464
|
var import_path4 = require("path");
|
|
@@ -234585,6 +234585,8 @@ var getModuleLegacy = (compilerCtx, sourceFilePath) => {
|
|
|
234585
234585
|
sourceFilePath,
|
|
234586
234586
|
jsFilePath,
|
|
234587
234587
|
cmps: [],
|
|
234588
|
+
isExtended: false,
|
|
234589
|
+
isMixin: false,
|
|
234588
234590
|
coreRuntimeApis: [],
|
|
234589
234591
|
outputTargetCoreRuntimeApis: {},
|
|
234590
234592
|
collectionName: null,
|
|
@@ -236260,17 +236262,261 @@ var transformToAbs = (copyTask, dest) => {
|
|
|
236260
236262
|
};
|
|
236261
236263
|
|
|
236262
236264
|
// src/compiler/output-targets/dist-collection/index.ts
|
|
236263
|
-
var
|
|
236265
|
+
var import_typescript11 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
236264
236266
|
|
|
236265
236267
|
// src/compiler/transformers/map-imports-to-path-aliases.ts
|
|
236266
236268
|
var import_path7 = require("path");
|
|
236267
|
-
var
|
|
236269
|
+
var import_typescript10 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
236268
236270
|
|
|
236269
236271
|
// src/compiler/transformers/transform-utils.ts
|
|
236272
|
+
var import_typescript9 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
236273
|
+
|
|
236274
|
+
// src/compiler/transformers/component-lazy/lazy-constructor.ts
|
|
236275
|
+
var import_typescript5 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
236276
|
+
|
|
236277
|
+
// src/compiler/transformers/core-runtime-apis.ts
|
|
236278
|
+
var CREATE_EVENT = "__stencil_createEvent";
|
|
236279
|
+
var DEFINE_CUSTOM_ELEMENT = "__stencil_defineCustomElement";
|
|
236280
|
+
var GET_ELEMENT = "__stencil_getElement";
|
|
236281
|
+
var HOST = "__stencil_Host";
|
|
236282
|
+
var HTML_ELEMENT = "HTMLElement";
|
|
236283
|
+
var PROXY_CUSTOM_ELEMENT = "__stencil_proxyCustomElement";
|
|
236284
|
+
var REGISTER_INSTANCE = "__stencil_registerInstance";
|
|
236285
|
+
var REGISTER_HOST = "__stencil_registerHost";
|
|
236286
|
+
var H2 = "__stencil_h";
|
|
236287
|
+
var RUNTIME_APIS = {
|
|
236288
|
+
createEvent: `createEvent as ${CREATE_EVENT}`,
|
|
236289
|
+
defineCustomElement: `defineCustomElement as ${DEFINE_CUSTOM_ELEMENT}`,
|
|
236290
|
+
getElement: `getElement as ${GET_ELEMENT}`,
|
|
236291
|
+
h: `h as ${H2}`,
|
|
236292
|
+
legacyH: `h`,
|
|
236293
|
+
Host: `Host as ${HOST}`,
|
|
236294
|
+
HTMLElement: HTML_ELEMENT,
|
|
236295
|
+
proxyCustomElement: `proxyCustomElement as ${PROXY_CUSTOM_ELEMENT}`,
|
|
236296
|
+
registerHost: `registerHost as ${REGISTER_HOST}`,
|
|
236297
|
+
registerInstance: `registerInstance as ${REGISTER_INSTANCE}`
|
|
236298
|
+
};
|
|
236299
|
+
var addCoreRuntimeApi = (moduleFile, coreRuntimeApi) => {
|
|
236300
|
+
if (!moduleFile.coreRuntimeApis.includes(coreRuntimeApi)) {
|
|
236301
|
+
moduleFile.coreRuntimeApis.push(coreRuntimeApi);
|
|
236302
|
+
}
|
|
236303
|
+
};
|
|
236304
|
+
var addOutputTargetCoreRuntimeApi = (moduleFile, outputTarget, coreRuntimeApi) => {
|
|
236305
|
+
if (!moduleFile.outputTargetCoreRuntimeApis[outputTarget]) {
|
|
236306
|
+
moduleFile.outputTargetCoreRuntimeApis[outputTarget] = [];
|
|
236307
|
+
}
|
|
236308
|
+
if (!moduleFile.outputTargetCoreRuntimeApis[outputTarget].includes(coreRuntimeApi)) {
|
|
236309
|
+
moduleFile.outputTargetCoreRuntimeApis[outputTarget].push(coreRuntimeApi);
|
|
236310
|
+
}
|
|
236311
|
+
};
|
|
236312
|
+
var addLegacyApis = (moduleFile) => {
|
|
236313
|
+
addCoreRuntimeApi(moduleFile, RUNTIME_APIS.legacyH);
|
|
236314
|
+
};
|
|
236315
|
+
|
|
236316
|
+
// src/compiler/transformers/create-event.ts
|
|
236317
|
+
var import_typescript3 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
236318
|
+
var addCreateEvents = (moduleFile, cmp) => {
|
|
236319
|
+
var _a2;
|
|
236320
|
+
if (!((_a2 = cmp == null ? void 0 : cmp.events) == null ? void 0 : _a2.length)) {
|
|
236321
|
+
return [];
|
|
236322
|
+
}
|
|
236323
|
+
return cmp.events.map((ev) => {
|
|
236324
|
+
addCoreRuntimeApi(moduleFile, RUNTIME_APIS.createEvent);
|
|
236325
|
+
return import_typescript3.default.factory.createExpressionStatement(
|
|
236326
|
+
import_typescript3.default.factory.createAssignment(
|
|
236327
|
+
import_typescript3.default.factory.createPropertyAccessExpression(import_typescript3.default.factory.createThis(), import_typescript3.default.factory.createIdentifier(ev.method)),
|
|
236328
|
+
import_typescript3.default.factory.createCallExpression(import_typescript3.default.factory.createIdentifier(CREATE_EVENT), void 0, [
|
|
236329
|
+
import_typescript3.default.factory.createThis(),
|
|
236330
|
+
import_typescript3.default.factory.createStringLiteral(ev.name),
|
|
236331
|
+
import_typescript3.default.factory.createNumericLiteral(computeFlags(ev))
|
|
236332
|
+
])
|
|
236333
|
+
)
|
|
236334
|
+
);
|
|
236335
|
+
});
|
|
236336
|
+
};
|
|
236337
|
+
var computeFlags = (eventMeta) => {
|
|
236338
|
+
let flags = 0;
|
|
236339
|
+
if (eventMeta.bubbles) {
|
|
236340
|
+
flags |= 4 /* Bubbles */;
|
|
236341
|
+
}
|
|
236342
|
+
if (eventMeta.composed) {
|
|
236343
|
+
flags |= 2 /* Composed */;
|
|
236344
|
+
}
|
|
236345
|
+
if (eventMeta.cancelable) {
|
|
236346
|
+
flags |= 1 /* Cancellable */;
|
|
236347
|
+
}
|
|
236348
|
+
return flags;
|
|
236349
|
+
};
|
|
236350
|
+
|
|
236351
|
+
// src/compiler/transformers/component-lazy/attach-internals.ts
|
|
236270
236352
|
var import_typescript4 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
236271
236353
|
|
|
236354
|
+
// src/compiler/transformers/component-lazy/constants.ts
|
|
236355
|
+
var HOST_REF_ARG = "hostRef";
|
|
236356
|
+
|
|
236357
|
+
// src/compiler/transformers/component-lazy/attach-internals.ts
|
|
236358
|
+
function createLazyAttachInternalsBinding(cmp) {
|
|
236359
|
+
if (!(cmp == null ? void 0 : cmp.attachInternalsMemberName)) {
|
|
236360
|
+
return [];
|
|
236361
|
+
}
|
|
236362
|
+
if (cmp.attachInternalsMemberName) {
|
|
236363
|
+
return [
|
|
236364
|
+
import_typescript4.default.factory.createIfStatement(
|
|
236365
|
+
// the condition for the `if` statement here is just whether the
|
|
236366
|
+
// following is defined:
|
|
236367
|
+
//
|
|
236368
|
+
// ```ts
|
|
236369
|
+
// hostRef.$hostElement$["s-ei"]
|
|
236370
|
+
// ```
|
|
236371
|
+
hostRefElementInternalsPropAccess(),
|
|
236372
|
+
import_typescript4.default.factory.createBlock(
|
|
236373
|
+
[
|
|
236374
|
+
// this `ts.factory` call creates the following statement:
|
|
236375
|
+
//
|
|
236376
|
+
// ```ts
|
|
236377
|
+
// this.${ cmp.formInternalsMemberName } = hostRef.$hostElement$['s-ei'];
|
|
236378
|
+
// ```
|
|
236379
|
+
import_typescript4.default.factory.createExpressionStatement(
|
|
236380
|
+
import_typescript4.default.factory.createBinaryExpression(
|
|
236381
|
+
import_typescript4.default.factory.createPropertyAccessExpression(
|
|
236382
|
+
import_typescript4.default.factory.createThis(),
|
|
236383
|
+
// use the name set on the {@link d.ComponentCompilerMeta}
|
|
236384
|
+
import_typescript4.default.factory.createIdentifier(cmp.attachInternalsMemberName)
|
|
236385
|
+
),
|
|
236386
|
+
import_typescript4.default.factory.createToken(import_typescript4.default.SyntaxKind.EqualsToken),
|
|
236387
|
+
hostRefElementInternalsPropAccess()
|
|
236388
|
+
)
|
|
236389
|
+
)
|
|
236390
|
+
],
|
|
236391
|
+
true
|
|
236392
|
+
),
|
|
236393
|
+
import_typescript4.default.factory.createBlock(
|
|
236394
|
+
[
|
|
236395
|
+
// this `ts.factory` call creates the following statement:
|
|
236396
|
+
//
|
|
236397
|
+
// ```ts
|
|
236398
|
+
// this.${ cmp.attachInternalsMemberName } = hostRef.$hostElement$.attachInternals();
|
|
236399
|
+
// ```
|
|
236400
|
+
import_typescript4.default.factory.createExpressionStatement(
|
|
236401
|
+
import_typescript4.default.factory.createBinaryExpression(
|
|
236402
|
+
import_typescript4.default.factory.createPropertyAccessExpression(
|
|
236403
|
+
import_typescript4.default.factory.createThis(),
|
|
236404
|
+
// use the name set on the {@link d.ComponentCompilerMeta}
|
|
236405
|
+
import_typescript4.default.factory.createIdentifier(cmp.attachInternalsMemberName)
|
|
236406
|
+
),
|
|
236407
|
+
import_typescript4.default.factory.createToken(import_typescript4.default.SyntaxKind.EqualsToken),
|
|
236408
|
+
import_typescript4.default.factory.createCallExpression(
|
|
236409
|
+
import_typescript4.default.factory.createPropertyAccessExpression(
|
|
236410
|
+
import_typescript4.default.factory.createPropertyAccessExpression(
|
|
236411
|
+
import_typescript4.default.factory.createIdentifier(HOST_REF_ARG),
|
|
236412
|
+
import_typescript4.default.factory.createIdentifier("$hostElement$")
|
|
236413
|
+
),
|
|
236414
|
+
import_typescript4.default.factory.createIdentifier("attachInternals")
|
|
236415
|
+
),
|
|
236416
|
+
void 0,
|
|
236417
|
+
[]
|
|
236418
|
+
)
|
|
236419
|
+
)
|
|
236420
|
+
),
|
|
236421
|
+
// this `ts.factory` call produces the following:
|
|
236422
|
+
//
|
|
236423
|
+
// ```ts
|
|
236424
|
+
// hostRef.$hostElement$['s-ei'] = this.${ cmp.attachInternalsMemberName };
|
|
236425
|
+
// ```
|
|
236426
|
+
import_typescript4.default.factory.createExpressionStatement(
|
|
236427
|
+
import_typescript4.default.factory.createBinaryExpression(
|
|
236428
|
+
hostRefElementInternalsPropAccess(),
|
|
236429
|
+
import_typescript4.default.factory.createToken(import_typescript4.default.SyntaxKind.EqualsToken),
|
|
236430
|
+
import_typescript4.default.factory.createPropertyAccessExpression(
|
|
236431
|
+
import_typescript4.default.factory.createThis(),
|
|
236432
|
+
// use the name set on the {@link d.ComponentCompilerMeta}
|
|
236433
|
+
import_typescript4.default.factory.createIdentifier(cmp.attachInternalsMemberName)
|
|
236434
|
+
)
|
|
236435
|
+
)
|
|
236436
|
+
)
|
|
236437
|
+
],
|
|
236438
|
+
true
|
|
236439
|
+
)
|
|
236440
|
+
)
|
|
236441
|
+
];
|
|
236442
|
+
} else {
|
|
236443
|
+
return [];
|
|
236444
|
+
}
|
|
236445
|
+
}
|
|
236446
|
+
function hostRefElementInternalsPropAccess() {
|
|
236447
|
+
return import_typescript4.default.factory.createElementAccessExpression(
|
|
236448
|
+
import_typescript4.default.factory.createPropertyAccessExpression(
|
|
236449
|
+
import_typescript4.default.factory.createIdentifier(HOST_REF_ARG),
|
|
236450
|
+
import_typescript4.default.factory.createIdentifier("$hostElement$")
|
|
236451
|
+
),
|
|
236452
|
+
import_typescript4.default.factory.createStringLiteral("s-ei")
|
|
236453
|
+
);
|
|
236454
|
+
}
|
|
236455
|
+
|
|
236456
|
+
// src/compiler/transformers/component-lazy/lazy-constructor.ts
|
|
236457
|
+
var updateLazyComponentConstructor = (classMembers, classNode, moduleFile, cmp) => {
|
|
236458
|
+
const cstrMethodArgs = [
|
|
236459
|
+
import_typescript5.default.factory.createParameterDeclaration(void 0, void 0, import_typescript5.default.factory.createIdentifier(HOST_REF_ARG))
|
|
236460
|
+
];
|
|
236461
|
+
const cstrStatements = [
|
|
236462
|
+
registerInstanceStatement(moduleFile),
|
|
236463
|
+
...addCreateEvents(moduleFile, cmp),
|
|
236464
|
+
...createLazyAttachInternalsBinding(cmp)
|
|
236465
|
+
];
|
|
236466
|
+
updateConstructor(classNode, classMembers, cstrStatements, cstrMethodArgs);
|
|
236467
|
+
};
|
|
236468
|
+
var registerInstanceStatement = (moduleFile) => {
|
|
236469
|
+
addCoreRuntimeApi(moduleFile, RUNTIME_APIS.registerInstance);
|
|
236470
|
+
return import_typescript5.default.factory.createExpressionStatement(
|
|
236471
|
+
import_typescript5.default.factory.createCallExpression(import_typescript5.default.factory.createIdentifier(REGISTER_INSTANCE), void 0, [
|
|
236472
|
+
import_typescript5.default.factory.createThis(),
|
|
236473
|
+
import_typescript5.default.factory.createIdentifier(HOST_REF_ARG)
|
|
236474
|
+
])
|
|
236475
|
+
);
|
|
236476
|
+
};
|
|
236477
|
+
|
|
236478
|
+
// src/compiler/transformers/remove-static-meta-properties.ts
|
|
236479
|
+
var import_typescript6 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
236480
|
+
var removeStaticMetaProperties = (classNode) => {
|
|
236481
|
+
if (classNode.members == null) {
|
|
236482
|
+
return [];
|
|
236483
|
+
}
|
|
236484
|
+
return classNode.members.filter((classMember) => {
|
|
236485
|
+
var _a2;
|
|
236486
|
+
if ((_a2 = retrieveTsModifiers(classMember)) == null ? void 0 : _a2.some((m) => m.kind === import_typescript6.default.SyntaxKind.StaticKeyword)) {
|
|
236487
|
+
const memberName = classMember.name.escapedText;
|
|
236488
|
+
if (readOnlyArrayHasStringMember(STATIC_GETTERS_TO_REMOVE, memberName)) {
|
|
236489
|
+
return false;
|
|
236490
|
+
}
|
|
236491
|
+
}
|
|
236492
|
+
return true;
|
|
236493
|
+
});
|
|
236494
|
+
};
|
|
236495
|
+
var STATIC_GETTERS_TO_REMOVE = [
|
|
236496
|
+
// we want to remove `attachInternalsMemberName`, which is an 'internal' static
|
|
236497
|
+
// property used to pass a string value along from the 'decorators-to-static'
|
|
236498
|
+
// step through to the `ComponentCompilerMeta` phase, but we want to keep the
|
|
236499
|
+
// `formAssociated` prop that we also set at the same time.
|
|
236500
|
+
"attachInternalsMemberName",
|
|
236501
|
+
"elementRef",
|
|
236502
|
+
"encapsulation",
|
|
236503
|
+
"events",
|
|
236504
|
+
"is",
|
|
236505
|
+
"listeners",
|
|
236506
|
+
"methods",
|
|
236507
|
+
"originalStyleUrls",
|
|
236508
|
+
"properties",
|
|
236509
|
+
"states",
|
|
236510
|
+
"style",
|
|
236511
|
+
"styleMode",
|
|
236512
|
+
"styleUrl",
|
|
236513
|
+
"styleUrls",
|
|
236514
|
+
"styles",
|
|
236515
|
+
"watchers"
|
|
236516
|
+
];
|
|
236517
|
+
|
|
236272
236518
|
// src/compiler/transformers/type-library.ts
|
|
236273
|
-
var
|
|
236519
|
+
var import_typescript7 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
236274
236520
|
var TYPE_LIBRARY = {};
|
|
236275
236521
|
function addToLibrary(type, typeName, checker, pathToTypeModule) {
|
|
236276
236522
|
pathToTypeModule = relative(process.cwd(), pathToTypeModule);
|
|
@@ -236295,13 +236541,13 @@ function getTypeLibrary() {
|
|
|
236295
236541
|
}
|
|
236296
236542
|
function addFileToLibrary(config, filePath) {
|
|
236297
236543
|
const options = {
|
|
236298
|
-
...
|
|
236299
|
-
module:
|
|
236300
|
-
moduleResolution:
|
|
236544
|
+
...import_typescript7.default.getDefaultCompilerOptions(),
|
|
236545
|
+
module: import_typescript7.default.ModuleKind.ESNext,
|
|
236546
|
+
moduleResolution: import_typescript7.default.ModuleResolutionKind.Node10
|
|
236301
236547
|
};
|
|
236302
|
-
const program3 =
|
|
236548
|
+
const program3 = import_typescript7.default.createProgram([filePath], options);
|
|
236303
236549
|
const checker = program3.getTypeChecker();
|
|
236304
|
-
const compilerHost =
|
|
236550
|
+
const compilerHost = import_typescript7.default.createCompilerHost(options);
|
|
236305
236551
|
const sourceFile = program3.getSourceFile(filePath);
|
|
236306
236552
|
if (!sourceFile) {
|
|
236307
236553
|
config.logger.warn(
|
|
@@ -236310,25 +236556,25 @@ function addFileToLibrary(config, filePath) {
|
|
|
236310
236556
|
return;
|
|
236311
236557
|
}
|
|
236312
236558
|
function exportedTypesInSourceFile(sourceFile2, exportedTypeNodes = []) {
|
|
236313
|
-
|
|
236559
|
+
import_typescript7.default.forEachChild(sourceFile2, (node) => {
|
|
236314
236560
|
if (isTypeDeclLike(node) && isExported(node) && isNotPrivate(node)) {
|
|
236315
236561
|
exportedTypeNodes.push(node);
|
|
236316
|
-
} else if (
|
|
236317
|
-
if (!node.moduleSpecifier || !
|
|
236562
|
+
} else if (import_typescript7.default.isExportDeclaration(node)) {
|
|
236563
|
+
if (!node.moduleSpecifier || !import_typescript7.default.isStringLiteral(node.moduleSpecifier)) {
|
|
236318
236564
|
return;
|
|
236319
236565
|
}
|
|
236320
236566
|
const exportHomeModule = getHomeModule(sourceFile2, node.moduleSpecifier.text, options, compilerHost, program3);
|
|
236321
236567
|
if (!exportHomeModule) {
|
|
236322
236568
|
return;
|
|
236323
236569
|
}
|
|
236324
|
-
if (node.exportClause &&
|
|
236570
|
+
if (node.exportClause && import_typescript7.default.isNamedExports(node.exportClause)) {
|
|
236325
236571
|
for (const exportSpecifier3 of node.exportClause.elements) {
|
|
236326
236572
|
const identifier3 = exportSpecifier3.getChildAt(0);
|
|
236327
236573
|
if (!identifier3) {
|
|
236328
236574
|
return;
|
|
236329
236575
|
}
|
|
236330
236576
|
const name = getOriginalTypeName(identifier3, checker);
|
|
236331
|
-
|
|
236577
|
+
import_typescript7.default.forEachChild(exportHomeModule, (child) => {
|
|
236332
236578
|
if (isTypeDeclLike(child) && child.name.getText() === name) {
|
|
236333
236579
|
exportedTypeNodes.push(child);
|
|
236334
236580
|
}
|
|
@@ -236349,7 +236595,7 @@ function addFileToLibrary(config, filePath) {
|
|
|
236349
236595
|
}
|
|
236350
236596
|
function getHomeModule(importer, importPath, options, compilerHost, program3) {
|
|
236351
236597
|
var _a2;
|
|
236352
|
-
const module2 =
|
|
236598
|
+
const module2 = import_typescript7.default.resolveModuleName(importPath, importer.fileName, options, compilerHost);
|
|
236353
236599
|
const resolvedFileName = (_a2 = module2 == null ? void 0 : module2.resolvedModule) == null ? void 0 : _a2.resolvedFileName;
|
|
236354
236600
|
if (!resolvedFileName) {
|
|
236355
236601
|
return void 0;
|
|
@@ -236359,7 +236605,7 @@ function getHomeModule(importer, importPath, options, compilerHost, program3) {
|
|
|
236359
236605
|
}
|
|
236360
236606
|
function findTypeWithName(module2, typeName) {
|
|
236361
236607
|
let typeWithName;
|
|
236362
|
-
|
|
236608
|
+
import_typescript7.default.forEachChild(module2, (child) => {
|
|
236363
236609
|
if (isTypeDeclLike(child) && child.name.getText() === typeName) {
|
|
236364
236610
|
typeWithName = child;
|
|
236365
236611
|
}
|
|
@@ -236376,16 +236622,16 @@ function getOriginalTypeName(identifier3, checker) {
|
|
|
236376
236622
|
return name;
|
|
236377
236623
|
}
|
|
236378
236624
|
function unalias(symbol, checker) {
|
|
236379
|
-
return symbol.flags &
|
|
236625
|
+
return symbol.flags & import_typescript7.default.SymbolFlags.Alias ? checker.getAliasedSymbol(symbol) : symbol;
|
|
236380
236626
|
}
|
|
236381
236627
|
function isTypeDeclLike(node) {
|
|
236382
|
-
return
|
|
236628
|
+
return import_typescript7.default.isInterfaceDeclaration(node) || import_typescript7.default.isTypeAliasDeclaration(node) || import_typescript7.default.isEnumDeclaration(node);
|
|
236383
236629
|
}
|
|
236384
236630
|
function isExported(node) {
|
|
236385
|
-
return (
|
|
236631
|
+
return (import_typescript7.default.getCombinedModifierFlags(node) & import_typescript7.default.ModifierFlags.Export) !== 0;
|
|
236386
236632
|
}
|
|
236387
236633
|
function isNotPrivate(node) {
|
|
236388
|
-
const jsDocTags =
|
|
236634
|
+
const jsDocTags = import_typescript7.default.getJSDocTags(node);
|
|
236389
236635
|
return !jsDocTags.some((tag) => tag.tagName.text === "private");
|
|
236390
236636
|
}
|
|
236391
236637
|
function getTypeDeclaration(checker, type) {
|
|
@@ -236400,7 +236646,7 @@ function getTypeDeclaration(checker, type) {
|
|
|
236400
236646
|
}
|
|
236401
236647
|
function getTypeDocstring(type, checker) {
|
|
236402
236648
|
const symbol = type == null ? void 0 : type.symbol;
|
|
236403
|
-
return symbol ?
|
|
236649
|
+
return symbol ? import_typescript7.default.displayPartsToString(symbol.getDocumentationComment(checker)) : "";
|
|
236404
236650
|
}
|
|
236405
236651
|
var getTypeId = (pathToTypeModule, typeName) => {
|
|
236406
236652
|
return `${normalizePath(pathToTypeModule, false)}::${typeName}`;
|
|
@@ -236415,11 +236661,67 @@ function getSymbolForType(type) {
|
|
|
236415
236661
|
return null;
|
|
236416
236662
|
}
|
|
236417
236663
|
|
|
236664
|
+
// src/compiler/transformers/update-component-class.ts
|
|
236665
|
+
var import_typescript8 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
236666
|
+
var updateComponentClass = (transformOpts, classNode, heritageClauses, members) => {
|
|
236667
|
+
var _a2, _b, _c;
|
|
236668
|
+
let classModifiers = (_b = (_a2 = retrieveTsModifiers(classNode)) == null ? void 0 : _a2.slice()) != null ? _b : [];
|
|
236669
|
+
if (transformOpts.module === "cjs") {
|
|
236670
|
+
if (transformOpts.componentExport === "customelement") {
|
|
236671
|
+
classModifiers = classModifiers.filter((m) => {
|
|
236672
|
+
return m.kind !== import_typescript8.default.SyntaxKind.ExportKeyword;
|
|
236673
|
+
});
|
|
236674
|
+
}
|
|
236675
|
+
return import_typescript8.default.factory.updateClassDeclaration(
|
|
236676
|
+
classNode,
|
|
236677
|
+
[...(_c = retrieveTsDecorators(classNode)) != null ? _c : [], ...classModifiers],
|
|
236678
|
+
classNode.name,
|
|
236679
|
+
classNode.typeParameters,
|
|
236680
|
+
heritageClauses,
|
|
236681
|
+
members
|
|
236682
|
+
);
|
|
236683
|
+
}
|
|
236684
|
+
return createConstClass(transformOpts, classNode, heritageClauses, members);
|
|
236685
|
+
};
|
|
236686
|
+
var createConstClass = (transformOpts, classNode, heritageClauses, members) => {
|
|
236687
|
+
var _a2;
|
|
236688
|
+
const className = classNode.name;
|
|
236689
|
+
const tsModifiers = (_a2 = retrieveTsModifiers(classNode)) != null ? _a2 : [];
|
|
236690
|
+
const classHasExportKeyword = tsModifiers.some((m) => m.kind === import_typescript8.default.SyntaxKind.ExportKeyword);
|
|
236691
|
+
const classModifiers = tsModifiers.filter((m) => {
|
|
236692
|
+
return m.kind !== import_typescript8.default.SyntaxKind.ExportKeyword;
|
|
236693
|
+
});
|
|
236694
|
+
const constModifiers = [];
|
|
236695
|
+
if (transformOpts.componentExport !== "customelement" && classHasExportKeyword) {
|
|
236696
|
+
constModifiers.push(import_typescript8.default.factory.createModifier(import_typescript8.default.SyntaxKind.ExportKeyword));
|
|
236697
|
+
}
|
|
236698
|
+
return import_typescript8.default.factory.createVariableStatement(
|
|
236699
|
+
constModifiers,
|
|
236700
|
+
import_typescript8.default.factory.createVariableDeclarationList(
|
|
236701
|
+
[
|
|
236702
|
+
import_typescript8.default.factory.createVariableDeclaration(
|
|
236703
|
+
className,
|
|
236704
|
+
void 0,
|
|
236705
|
+
void 0,
|
|
236706
|
+
import_typescript8.default.factory.createClassExpression(
|
|
236707
|
+
classModifiers,
|
|
236708
|
+
void 0,
|
|
236709
|
+
classNode.typeParameters,
|
|
236710
|
+
heritageClauses,
|
|
236711
|
+
members
|
|
236712
|
+
)
|
|
236713
|
+
)
|
|
236714
|
+
],
|
|
236715
|
+
import_typescript8.default.NodeFlags.Const
|
|
236716
|
+
)
|
|
236717
|
+
);
|
|
236718
|
+
};
|
|
236719
|
+
|
|
236418
236720
|
// src/compiler/transformers/transform-utils.ts
|
|
236419
236721
|
var isMemberPrivate = (member2) => {
|
|
236420
236722
|
var _a2;
|
|
236421
236723
|
return !!((_a2 = retrieveTsModifiers(member2)) == null ? void 0 : _a2.some(
|
|
236422
|
-
(m) => m.kind ===
|
|
236724
|
+
(m) => m.kind === import_typescript9.default.SyntaxKind.PrivateKeyword || m.kind === import_typescript9.default.SyntaxKind.ProtectedKeyword
|
|
236423
236725
|
));
|
|
236424
236726
|
};
|
|
236425
236727
|
var convertValueToLiteral = (val, refs = null) => {
|
|
@@ -236427,70 +236729,70 @@ var convertValueToLiteral = (val, refs = null) => {
|
|
|
236427
236729
|
refs = /* @__PURE__ */ new WeakSet();
|
|
236428
236730
|
}
|
|
236429
236731
|
if (val === String) {
|
|
236430
|
-
return
|
|
236732
|
+
return import_typescript9.default.factory.createIdentifier("String");
|
|
236431
236733
|
}
|
|
236432
236734
|
if (val === Number) {
|
|
236433
|
-
return
|
|
236735
|
+
return import_typescript9.default.factory.createIdentifier("Number");
|
|
236434
236736
|
}
|
|
236435
236737
|
if (val === Boolean) {
|
|
236436
|
-
return
|
|
236738
|
+
return import_typescript9.default.factory.createIdentifier("Boolean");
|
|
236437
236739
|
}
|
|
236438
236740
|
if (val === void 0) {
|
|
236439
|
-
return
|
|
236741
|
+
return import_typescript9.default.factory.createIdentifier("undefined");
|
|
236440
236742
|
}
|
|
236441
236743
|
if (val === null) {
|
|
236442
|
-
return
|
|
236744
|
+
return import_typescript9.default.factory.createIdentifier("null");
|
|
236443
236745
|
}
|
|
236444
236746
|
if (Array.isArray(val)) {
|
|
236445
236747
|
return arrayToArrayLiteral(val, refs);
|
|
236446
236748
|
}
|
|
236447
236749
|
if (typeof val === "object") {
|
|
236448
236750
|
if (val.__identifier && val.__escapedText) {
|
|
236449
|
-
return
|
|
236751
|
+
return import_typescript9.default.factory.createIdentifier(val.__escapedText);
|
|
236450
236752
|
}
|
|
236451
236753
|
return objectToObjectLiteral(val, refs);
|
|
236452
236754
|
}
|
|
236453
236755
|
if (typeof val === "number") {
|
|
236454
|
-
return
|
|
236756
|
+
return import_typescript9.default.factory.createNumericLiteral(val);
|
|
236455
236757
|
}
|
|
236456
236758
|
if (typeof val === "object" && "base10Value" in val) {
|
|
236457
|
-
return
|
|
236759
|
+
return import_typescript9.default.factory.createBigIntLiteral(val);
|
|
236458
236760
|
}
|
|
236459
236761
|
if (typeof val === "boolean") {
|
|
236460
|
-
return val ?
|
|
236762
|
+
return val ? import_typescript9.default.factory.createTrue() : import_typescript9.default.factory.createFalse();
|
|
236461
236763
|
}
|
|
236462
236764
|
if (typeof val === "string") {
|
|
236463
|
-
return
|
|
236765
|
+
return import_typescript9.default.factory.createStringLiteral(val, void 0);
|
|
236464
236766
|
}
|
|
236465
|
-
return
|
|
236767
|
+
return import_typescript9.default.factory.createStringLiteralFromNode(val);
|
|
236466
236768
|
};
|
|
236467
236769
|
var arrayToArrayLiteral = (list, refs) => {
|
|
236468
236770
|
const newList = list.map((l) => {
|
|
236469
236771
|
return convertValueToLiteral(l, refs);
|
|
236470
236772
|
});
|
|
236471
|
-
return
|
|
236773
|
+
return import_typescript9.default.factory.createArrayLiteralExpression(newList);
|
|
236472
236774
|
};
|
|
236473
236775
|
var objectToObjectLiteral = (obj, refs) => {
|
|
236474
236776
|
if (refs.has(obj)) {
|
|
236475
|
-
return
|
|
236777
|
+
return import_typescript9.default.factory.createIdentifier("undefined");
|
|
236476
236778
|
}
|
|
236477
236779
|
refs.add(obj);
|
|
236478
236780
|
const newProperties = Object.keys(obj).map((key) => {
|
|
236479
|
-
const prop =
|
|
236480
|
-
|
|
236781
|
+
const prop = import_typescript9.default.factory.createPropertyAssignment(
|
|
236782
|
+
import_typescript9.default.factory.createStringLiteral(key),
|
|
236481
236783
|
convertValueToLiteral(obj[key], refs)
|
|
236482
236784
|
);
|
|
236483
236785
|
return prop;
|
|
236484
236786
|
});
|
|
236485
|
-
return
|
|
236787
|
+
return import_typescript9.default.factory.createObjectLiteralExpression(newProperties, true);
|
|
236486
236788
|
};
|
|
236487
236789
|
var createStaticGetter = (propName, returnExpression) => {
|
|
236488
|
-
return
|
|
236489
|
-
[
|
|
236790
|
+
return import_typescript9.default.factory.createGetAccessorDeclaration(
|
|
236791
|
+
[import_typescript9.default.factory.createToken(import_typescript9.default.SyntaxKind.StaticKeyword)],
|
|
236490
236792
|
propName,
|
|
236491
236793
|
[],
|
|
236492
236794
|
void 0,
|
|
236493
|
-
|
|
236795
|
+
import_typescript9.default.factory.createBlock([import_typescript9.default.factory.createReturnStatement(returnExpression)])
|
|
236494
236796
|
);
|
|
236495
236797
|
};
|
|
236496
236798
|
var getStaticValue = (staticMembers, staticName) => {
|
|
@@ -236504,31 +236806,31 @@ var getStaticValue = (staticMembers, staticName) => {
|
|
|
236504
236806
|
return null;
|
|
236505
236807
|
}
|
|
236506
236808
|
const rtnStatement = staticMember.body.statements.find(
|
|
236507
|
-
(s) => s.kind ===
|
|
236809
|
+
(s) => s.kind === import_typescript9.default.SyntaxKind.ReturnStatement
|
|
236508
236810
|
);
|
|
236509
236811
|
if (!rtnStatement || !rtnStatement.expression) {
|
|
236510
236812
|
return null;
|
|
236511
236813
|
}
|
|
236512
236814
|
const expKind = rtnStatement.expression.kind;
|
|
236513
|
-
if (expKind ===
|
|
236815
|
+
if (expKind === import_typescript9.default.SyntaxKind.StringLiteral) {
|
|
236514
236816
|
return rtnStatement.expression.text;
|
|
236515
236817
|
}
|
|
236516
|
-
if (expKind ===
|
|
236818
|
+
if (expKind === import_typescript9.default.SyntaxKind.NoSubstitutionTemplateLiteral) {
|
|
236517
236819
|
return rtnStatement.expression.text;
|
|
236518
236820
|
}
|
|
236519
|
-
if (expKind ===
|
|
236821
|
+
if (expKind === import_typescript9.default.SyntaxKind.TrueKeyword) {
|
|
236520
236822
|
return true;
|
|
236521
236823
|
}
|
|
236522
|
-
if (expKind ===
|
|
236824
|
+
if (expKind === import_typescript9.default.SyntaxKind.FalseKeyword) {
|
|
236523
236825
|
return false;
|
|
236524
236826
|
}
|
|
236525
|
-
if (expKind ===
|
|
236827
|
+
if (expKind === import_typescript9.default.SyntaxKind.ObjectLiteralExpression) {
|
|
236526
236828
|
return objectLiteralToObjectMap(rtnStatement.expression);
|
|
236527
236829
|
}
|
|
236528
|
-
if (expKind ===
|
|
236830
|
+
if (expKind === import_typescript9.default.SyntaxKind.ArrayLiteralExpression && rtnStatement.expression.elements) {
|
|
236529
236831
|
return arrayLiteralToArray(rtnStatement.expression);
|
|
236530
236832
|
}
|
|
236531
|
-
if (expKind ===
|
|
236833
|
+
if (expKind === import_typescript9.default.SyntaxKind.Identifier) {
|
|
236532
236834
|
const identifier3 = rtnStatement.expression;
|
|
236533
236835
|
if (typeof identifier3.escapedText === "string") {
|
|
236534
236836
|
return getIdentifierValue(identifier3.escapedText);
|
|
@@ -236547,19 +236849,19 @@ var arrayLiteralToArray = (arr) => {
|
|
|
236547
236849
|
return arr.elements.map((element) => {
|
|
236548
236850
|
let val;
|
|
236549
236851
|
switch (element.kind) {
|
|
236550
|
-
case
|
|
236852
|
+
case import_typescript9.default.SyntaxKind.ObjectLiteralExpression:
|
|
236551
236853
|
val = objectLiteralToObjectMap(element);
|
|
236552
236854
|
break;
|
|
236553
|
-
case
|
|
236855
|
+
case import_typescript9.default.SyntaxKind.StringLiteral:
|
|
236554
236856
|
val = element.text;
|
|
236555
236857
|
break;
|
|
236556
|
-
case
|
|
236858
|
+
case import_typescript9.default.SyntaxKind.TrueKeyword:
|
|
236557
236859
|
val = true;
|
|
236558
236860
|
break;
|
|
236559
|
-
case
|
|
236861
|
+
case import_typescript9.default.SyntaxKind.FalseKeyword:
|
|
236560
236862
|
val = false;
|
|
236561
236863
|
break;
|
|
236562
|
-
case
|
|
236864
|
+
case import_typescript9.default.SyntaxKind.Identifier:
|
|
236563
236865
|
const escapedText = element.escapedText;
|
|
236564
236866
|
if (escapedText === "String") {
|
|
236565
236867
|
val = String;
|
|
@@ -236569,7 +236871,7 @@ var arrayLiteralToArray = (arr) => {
|
|
|
236569
236871
|
val = Boolean;
|
|
236570
236872
|
}
|
|
236571
236873
|
break;
|
|
236572
|
-
case
|
|
236874
|
+
case import_typescript9.default.SyntaxKind.PropertyAccessExpression:
|
|
236573
236875
|
default:
|
|
236574
236876
|
val = element;
|
|
236575
236877
|
}
|
|
@@ -236582,29 +236884,29 @@ var objectLiteralToObjectMap = (objectLiteral) => {
|
|
|
236582
236884
|
for (const propAssignment of properties) {
|
|
236583
236885
|
const propName = getTextOfPropertyName(propAssignment.name);
|
|
236584
236886
|
let val;
|
|
236585
|
-
if (
|
|
236887
|
+
if (import_typescript9.default.isShorthandPropertyAssignment(propAssignment)) {
|
|
236586
236888
|
val = getIdentifierValue(propName);
|
|
236587
|
-
} else if (
|
|
236889
|
+
} else if (import_typescript9.default.isPropertyAssignment(propAssignment)) {
|
|
236588
236890
|
switch (propAssignment.initializer.kind) {
|
|
236589
|
-
case
|
|
236891
|
+
case import_typescript9.default.SyntaxKind.ArrayLiteralExpression:
|
|
236590
236892
|
val = arrayLiteralToArray(propAssignment.initializer);
|
|
236591
236893
|
break;
|
|
236592
|
-
case
|
|
236894
|
+
case import_typescript9.default.SyntaxKind.ObjectLiteralExpression:
|
|
236593
236895
|
val = objectLiteralToObjectMap(propAssignment.initializer);
|
|
236594
236896
|
break;
|
|
236595
|
-
case
|
|
236897
|
+
case import_typescript9.default.SyntaxKind.StringLiteral:
|
|
236596
236898
|
val = propAssignment.initializer.text;
|
|
236597
236899
|
break;
|
|
236598
|
-
case
|
|
236900
|
+
case import_typescript9.default.SyntaxKind.NoSubstitutionTemplateLiteral:
|
|
236599
236901
|
val = propAssignment.initializer.text;
|
|
236600
236902
|
break;
|
|
236601
|
-
case
|
|
236903
|
+
case import_typescript9.default.SyntaxKind.TrueKeyword:
|
|
236602
236904
|
val = true;
|
|
236603
236905
|
break;
|
|
236604
|
-
case
|
|
236906
|
+
case import_typescript9.default.SyntaxKind.FalseKeyword:
|
|
236605
236907
|
val = false;
|
|
236606
236908
|
break;
|
|
236607
|
-
case
|
|
236909
|
+
case import_typescript9.default.SyntaxKind.Identifier:
|
|
236608
236910
|
const escapedText = propAssignment.initializer.escapedText;
|
|
236609
236911
|
if (escapedText === "String") {
|
|
236610
236912
|
val = String;
|
|
@@ -236620,7 +236922,7 @@ var objectLiteralToObjectMap = (objectLiteral) => {
|
|
|
236620
236922
|
val = getIdentifierValue(propAssignment.initializer.escapedText);
|
|
236621
236923
|
}
|
|
236622
236924
|
break;
|
|
236623
|
-
case
|
|
236925
|
+
case import_typescript9.default.SyntaxKind.PropertyAccessExpression:
|
|
236624
236926
|
default:
|
|
236625
236927
|
val = propAssignment.initializer;
|
|
236626
236928
|
}
|
|
@@ -236638,14 +236940,14 @@ var getIdentifierValue = (escapedText) => {
|
|
|
236638
236940
|
};
|
|
236639
236941
|
var getTextOfPropertyName = (propName) => {
|
|
236640
236942
|
switch (propName.kind) {
|
|
236641
|
-
case
|
|
236943
|
+
case import_typescript9.default.SyntaxKind.Identifier:
|
|
236642
236944
|
return propName.text;
|
|
236643
|
-
case
|
|
236644
|
-
case
|
|
236945
|
+
case import_typescript9.default.SyntaxKind.StringLiteral:
|
|
236946
|
+
case import_typescript9.default.SyntaxKind.NumericLiteral:
|
|
236645
236947
|
return propName.text;
|
|
236646
|
-
case
|
|
236948
|
+
case import_typescript9.default.SyntaxKind.ComputedPropertyName:
|
|
236647
236949
|
const expression = propName.expression;
|
|
236648
|
-
if (
|
|
236950
|
+
if (import_typescript9.default.isStringLiteral(expression) || import_typescript9.default.isNumericLiteral(expression)) {
|
|
236649
236951
|
return propName.expression.text;
|
|
236650
236952
|
}
|
|
236651
236953
|
}
|
|
@@ -236660,7 +236962,7 @@ var getAttributeTypeInfo = (baseNode, sourceFile, checker, program3) => {
|
|
|
236660
236962
|
return allReferences;
|
|
236661
236963
|
};
|
|
236662
236964
|
var getEntityName = (entity) => {
|
|
236663
|
-
if (
|
|
236965
|
+
if (import_typescript9.default.isIdentifier(entity)) {
|
|
236664
236966
|
return entity.escapedText.toString();
|
|
236665
236967
|
} else {
|
|
236666
236968
|
return getEntityName(entity.left);
|
|
@@ -236669,13 +236971,13 @@ var getEntityName = (entity) => {
|
|
|
236669
236971
|
var getAllTypeReferences = (checker, node) => {
|
|
236670
236972
|
const referencedTypes = [];
|
|
236671
236973
|
const visit2 = (node2) => {
|
|
236672
|
-
if (
|
|
236974
|
+
if (import_typescript9.default.isTypeReferenceNode(node2)) {
|
|
236673
236975
|
referencedTypes.push({
|
|
236674
236976
|
name: getEntityName(node2.typeName),
|
|
236675
236977
|
type: checker.getTypeFromTypeNode(node2)
|
|
236676
236978
|
});
|
|
236677
236979
|
if (node2.typeArguments) {
|
|
236678
|
-
node2.typeArguments.filter((typeArg) =>
|
|
236980
|
+
node2.typeArguments.filter((typeArg) => import_typescript9.default.isTypeReferenceNode(typeArg)).forEach((typeRef) => {
|
|
236679
236981
|
const typeName = typeRef.typeName;
|
|
236680
236982
|
if (typeName && typeName.escapedText) {
|
|
236681
236983
|
referencedTypes.push({
|
|
@@ -236686,7 +236988,7 @@ var getAllTypeReferences = (checker, node) => {
|
|
|
236686
236988
|
});
|
|
236687
236989
|
}
|
|
236688
236990
|
}
|
|
236689
|
-
return
|
|
236991
|
+
return import_typescript9.default.forEachChild(node2, visit2);
|
|
236690
236992
|
};
|
|
236691
236993
|
visit2(node);
|
|
236692
236994
|
return referencedTypes;
|
|
@@ -236694,17 +236996,17 @@ var getAllTypeReferences = (checker, node) => {
|
|
|
236694
236996
|
var getTypeReferenceLocation = (typeName, type, sourceFile, checker, program3) => {
|
|
236695
236997
|
var _a2;
|
|
236696
236998
|
const importTypeDeclaration = sourceFile.statements.find((st) => {
|
|
236697
|
-
const statement =
|
|
236999
|
+
const statement = import_typescript9.default.isImportDeclaration(st) && st.importClause && import_typescript9.default.isImportClause(st.importClause) && st.importClause.namedBindings && import_typescript9.default.isNamedImports(st.importClause.namedBindings) && Array.isArray(st.importClause.namedBindings.elements) && st.importClause.namedBindings.elements.find((nbe) => nbe.name.getText() === typeName);
|
|
236698
237000
|
if (!statement) {
|
|
236699
237001
|
return false;
|
|
236700
237002
|
}
|
|
236701
237003
|
return true;
|
|
236702
237004
|
});
|
|
236703
237005
|
const namedImportBindings = (_a2 = importTypeDeclaration == null ? void 0 : importTypeDeclaration.importClause) == null ? void 0 : _a2.namedBindings;
|
|
236704
|
-
if (importTypeDeclaration &&
|
|
237006
|
+
if (importTypeDeclaration && import_typescript9.default.isNamedImports(namedImportBindings)) {
|
|
236705
237007
|
const localImportPath = importTypeDeclaration.moduleSpecifier.text;
|
|
236706
237008
|
const options = program3.getCompilerOptions();
|
|
236707
|
-
const compilerHost =
|
|
237009
|
+
const compilerHost = import_typescript9.default.createCompilerHost(options);
|
|
236708
237010
|
const importHomeModule = getHomeModule(sourceFile, localImportPath, options, compilerHost, program3);
|
|
236709
237011
|
if (importHomeModule) {
|
|
236710
237012
|
const importName = namedImportBindings.elements.find((nbe) => nbe.name.getText() === typeName).name;
|
|
@@ -236721,11 +237023,11 @@ var getTypeReferenceLocation = (typeName, type, sourceFile, checker, program3) =
|
|
|
236721
237023
|
}
|
|
236722
237024
|
const isExported2 = sourceFile.statements.some((st) => {
|
|
236723
237025
|
const statementModifiers = retrieveTsModifiers(st);
|
|
236724
|
-
const isDeclarationExported = (statement) => statement.name.getText() === typeName && Array.isArray(statementModifiers) && statementModifiers.some((mod) => mod.kind ===
|
|
236725
|
-
const isInterfaceDeclarationExported =
|
|
236726
|
-
const isTypeAliasDeclarationExported =
|
|
236727
|
-
const isEnumDeclarationExported =
|
|
236728
|
-
const isTypeInExportDeclaration =
|
|
237026
|
+
const isDeclarationExported = (statement) => statement.name.getText() === typeName && Array.isArray(statementModifiers) && statementModifiers.some((mod) => mod.kind === import_typescript9.default.SyntaxKind.ExportKeyword);
|
|
237027
|
+
const isInterfaceDeclarationExported = import_typescript9.default.isInterfaceDeclaration(st) && isDeclarationExported(st);
|
|
237028
|
+
const isTypeAliasDeclarationExported = import_typescript9.default.isTypeAliasDeclaration(st) && isDeclarationExported(st);
|
|
237029
|
+
const isEnumDeclarationExported = import_typescript9.default.isEnumDeclaration(st) && isDeclarationExported(st);
|
|
237030
|
+
const isTypeInExportDeclaration = import_typescript9.default.isExportDeclaration(st) && import_typescript9.default.isNamedExports(st.exportClause) && st.exportClause.elements.some((nee) => nee.name.getText() === typeName);
|
|
236729
237031
|
return isInterfaceDeclarationExported || isTypeAliasDeclarationExported || isEnumDeclarationExported || isTypeInExportDeclaration;
|
|
236730
237032
|
});
|
|
236731
237033
|
if (isExported2) {
|
|
@@ -236768,7 +237070,7 @@ var resolveType = (checker, type) => {
|
|
|
236768
237070
|
}
|
|
236769
237071
|
};
|
|
236770
237072
|
var typeToString = (checker, type) => {
|
|
236771
|
-
const TYPE_FORMAT_FLAGS =
|
|
237073
|
+
const TYPE_FORMAT_FLAGS = import_typescript9.default.TypeFormatFlags.NoTruncation | import_typescript9.default.TypeFormatFlags.InTypeAlias | import_typescript9.default.TypeFormatFlags.InElementType;
|
|
236772
237074
|
return checker.typeToString(type, void 0, TYPE_FORMAT_FLAGS);
|
|
236773
237075
|
};
|
|
236774
237076
|
var parseDocsType = (checker, type, parts) => {
|
|
@@ -236805,6 +237107,11 @@ var getComponentMeta = (compilerCtx, tsSourceFile, node) => {
|
|
|
236805
237107
|
}
|
|
236806
237108
|
return void 0;
|
|
236807
237109
|
};
|
|
237110
|
+
var updateMixin = (classNode, moduleFile, cmp, transformOpts) => {
|
|
237111
|
+
const classMembers = removeStaticMetaProperties(classNode);
|
|
237112
|
+
updateLazyComponentConstructor(classMembers, classNode, moduleFile, cmp);
|
|
237113
|
+
return updateComponentClass(transformOpts, classNode, classNode.heritageClauses, classMembers);
|
|
237114
|
+
};
|
|
236808
237115
|
var getComponentTagName = (staticMembers) => {
|
|
236809
237116
|
if (staticMembers.length > 0) {
|
|
236810
237117
|
const tagName = getStaticValue(staticMembers, "is");
|
|
@@ -236817,7 +237124,7 @@ var getComponentTagName = (staticMembers) => {
|
|
|
236817
237124
|
var isStaticGetter = (member2) => {
|
|
236818
237125
|
var _a2;
|
|
236819
237126
|
const modifiers = retrieveTsModifiers(member2);
|
|
236820
|
-
return (_a2 = member2.kind ===
|
|
237127
|
+
return (_a2 = member2.kind === import_typescript9.default.SyntaxKind.GetAccessor && Array.isArray(modifiers) && modifiers.some(({ kind }) => kind === import_typescript9.default.SyntaxKind.StaticKeyword)) != null ? _a2 : false;
|
|
236821
237128
|
};
|
|
236822
237129
|
var serializeSymbol = (checker, symbol) => {
|
|
236823
237130
|
if (!checker || !symbol) {
|
|
@@ -236828,7 +237135,7 @@ var serializeSymbol = (checker, symbol) => {
|
|
|
236828
237135
|
}
|
|
236829
237136
|
return {
|
|
236830
237137
|
tags: mapJSDocTagInfo(symbol.getJsDocTags()),
|
|
236831
|
-
text:
|
|
237138
|
+
text: import_typescript9.default.displayPartsToString(symbol.getDocumentationComment(checker))
|
|
236832
237139
|
};
|
|
236833
237140
|
};
|
|
236834
237141
|
var mapJSDocTagInfo = (tags) => {
|
|
@@ -236841,7 +237148,7 @@ var isInternal = (jsDocs) => {
|
|
|
236841
237148
|
return !!(jsDocs && jsDocs.tags.some((s) => s.name === "internal"));
|
|
236842
237149
|
};
|
|
236843
237150
|
var isMethod = (member2, methodName) => {
|
|
236844
|
-
return
|
|
237151
|
+
return import_typescript9.default.isMethodDeclaration(member2) && member2.name && member2.name.escapedText === methodName;
|
|
236845
237152
|
};
|
|
236846
237153
|
var createImportStatement = (importFnNames, importPath) => {
|
|
236847
237154
|
const importSpecifiers = importFnNames.map((importKey) => {
|
|
@@ -236852,20 +237159,20 @@ var createImportStatement = (importFnNames, importPath) => {
|
|
|
236852
237159
|
importAs = splt[1];
|
|
236853
237160
|
importFnName = splt[0];
|
|
236854
237161
|
}
|
|
236855
|
-
return
|
|
237162
|
+
return import_typescript9.default.factory.createImportSpecifier(
|
|
236856
237163
|
false,
|
|
236857
|
-
typeof importFnName === "string" && importFnName !== importAs ?
|
|
236858
|
-
|
|
237164
|
+
typeof importFnName === "string" && importFnName !== importAs ? import_typescript9.default.factory.createIdentifier(importFnName) : void 0,
|
|
237165
|
+
import_typescript9.default.factory.createIdentifier(importAs)
|
|
236859
237166
|
);
|
|
236860
237167
|
});
|
|
236861
|
-
return
|
|
237168
|
+
return import_typescript9.default.factory.createImportDeclaration(
|
|
236862
237169
|
void 0,
|
|
236863
|
-
|
|
236864
|
-
|
|
237170
|
+
import_typescript9.default.factory.createImportClause(false, void 0, import_typescript9.default.factory.createNamedImports(importSpecifiers)),
|
|
237171
|
+
import_typescript9.default.factory.createStringLiteral(importPath)
|
|
236865
237172
|
);
|
|
236866
237173
|
};
|
|
236867
237174
|
var createRequireStatement = (importFnNames, importPath) => {
|
|
236868
|
-
const importBinding =
|
|
237175
|
+
const importBinding = import_typescript9.default.factory.createObjectBindingPattern(
|
|
236869
237176
|
importFnNames.map((importKey) => {
|
|
236870
237177
|
const splt = importKey.split(" as ");
|
|
236871
237178
|
let importAs = importKey;
|
|
@@ -236874,25 +237181,25 @@ var createRequireStatement = (importFnNames, importPath) => {
|
|
|
236874
237181
|
importAs = splt[1];
|
|
236875
237182
|
importFnName = splt[0];
|
|
236876
237183
|
}
|
|
236877
|
-
return
|
|
237184
|
+
return import_typescript9.default.factory.createBindingElement(void 0, importFnName, importAs);
|
|
236878
237185
|
})
|
|
236879
237186
|
);
|
|
236880
|
-
return
|
|
237187
|
+
return import_typescript9.default.factory.createVariableStatement(
|
|
236881
237188
|
void 0,
|
|
236882
|
-
|
|
237189
|
+
import_typescript9.default.factory.createVariableDeclarationList(
|
|
236883
237190
|
[
|
|
236884
|
-
|
|
237191
|
+
import_typescript9.default.factory.createVariableDeclaration(
|
|
236885
237192
|
importBinding,
|
|
236886
237193
|
void 0,
|
|
236887
237194
|
void 0,
|
|
236888
|
-
|
|
236889
|
-
|
|
237195
|
+
import_typescript9.default.factory.createCallExpression(
|
|
237196
|
+
import_typescript9.default.factory.createIdentifier("require"),
|
|
236890
237197
|
[],
|
|
236891
|
-
[
|
|
237198
|
+
[import_typescript9.default.factory.createStringLiteral(importPath)]
|
|
236892
237199
|
)
|
|
236893
237200
|
)
|
|
236894
237201
|
],
|
|
236895
|
-
|
|
237202
|
+
import_typescript9.default.NodeFlags.Const
|
|
236896
237203
|
)
|
|
236897
237204
|
);
|
|
236898
237205
|
};
|
|
@@ -236901,36 +237208,49 @@ var retrieveModifierLike = (node) => {
|
|
|
236901
237208
|
return [...(_a2 = retrieveTsDecorators(node)) != null ? _a2 : [], ...(_b = retrieveTsModifiers(node)) != null ? _b : []];
|
|
236902
237209
|
};
|
|
236903
237210
|
var retrieveTsDecorators = (node) => {
|
|
236904
|
-
return
|
|
237211
|
+
return import_typescript9.default.canHaveDecorators(node) ? import_typescript9.default.getDecorators(node) : void 0;
|
|
236905
237212
|
};
|
|
236906
237213
|
var retrieveTsModifiers = (node) => {
|
|
236907
|
-
return
|
|
237214
|
+
return import_typescript9.default.canHaveModifiers(node) ? import_typescript9.default.getModifiers(node) : void 0;
|
|
236908
237215
|
};
|
|
236909
|
-
|
|
236910
|
-
|
|
236911
|
-
|
|
237216
|
+
function foundSuper(constructorBodyStatements) {
|
|
237217
|
+
return constructorBodyStatements == null ? void 0 : constructorBodyStatements.find(
|
|
237218
|
+
(s) => import_typescript9.default.isExpressionStatement(s) && import_typescript9.default.isCallExpression(s.expression) && s.expression.expression.kind === import_typescript9.default.SyntaxKind.SuperKeyword
|
|
237219
|
+
);
|
|
237220
|
+
}
|
|
237221
|
+
var updateConstructor = (classNode, classMembers, statements, parameters, includeFalseArg) => {
|
|
237222
|
+
var _a2, _b;
|
|
237223
|
+
const constructorIndex = classMembers.findIndex((m) => m.kind === import_typescript9.default.SyntaxKind.Constructor);
|
|
236912
237224
|
const constructorMethod = classMembers[constructorIndex];
|
|
236913
237225
|
if (constructorIndex < 0 && !(statements == null ? void 0 : statements.length) && !needsSuper(classNode)) return classMembers;
|
|
236914
|
-
if (constructorIndex >= 0 &&
|
|
236915
|
-
const constructorBodyStatements = (
|
|
236916
|
-
|
|
236917
|
-
if (!
|
|
236918
|
-
statements = [createConstructorBodyWithSuper(), ...statements, ...constructorBodyStatements];
|
|
237226
|
+
if (constructorIndex >= 0 && import_typescript9.default.isConstructorDeclaration(constructorMethod)) {
|
|
237227
|
+
const constructorBodyStatements = (_a2 = constructorMethod.body) == null ? void 0 : _a2.statements;
|
|
237228
|
+
let foundSuperCall = foundSuper(constructorBodyStatements);
|
|
237229
|
+
if (!foundSuperCall && needsSuper(classNode)) {
|
|
237230
|
+
statements = [createConstructorBodyWithSuper(includeFalseArg), ...statements, ...constructorBodyStatements];
|
|
236919
237231
|
} else {
|
|
236920
|
-
|
|
237232
|
+
const updatedStatements = constructorBodyStatements.filter((s) => s !== foundSuperCall);
|
|
237233
|
+
if (foundSuperCall) {
|
|
237234
|
+
if (includeFalseArg) {
|
|
237235
|
+
foundSuperCall = createConstructorBodyWithSuper(includeFalseArg);
|
|
237236
|
+
}
|
|
237237
|
+
statements = [foundSuperCall, ...statements, ...updatedStatements];
|
|
237238
|
+
} else {
|
|
237239
|
+
statements = [...statements, ...updatedStatements];
|
|
237240
|
+
}
|
|
236921
237241
|
}
|
|
236922
|
-
classMembers[constructorIndex] =
|
|
237242
|
+
classMembers[constructorIndex] = import_typescript9.default.factory.updateConstructorDeclaration(
|
|
236923
237243
|
constructorMethod,
|
|
236924
237244
|
retrieveTsModifiers(constructorMethod),
|
|
236925
237245
|
constructorMethod.parameters.concat(parameters != null ? parameters : []),
|
|
236926
|
-
|
|
237246
|
+
import_typescript9.default.factory.updateBlock((_b = constructorMethod == null ? void 0 : constructorMethod.body) != null ? _b : import_typescript9.default.factory.createBlock([]), statements)
|
|
236927
237247
|
);
|
|
236928
237248
|
} else {
|
|
236929
237249
|
if (needsSuper(classNode)) {
|
|
236930
|
-
statements = [createConstructorBodyWithSuper(), ...statements];
|
|
237250
|
+
statements = [createConstructorBodyWithSuper(includeFalseArg), ...statements];
|
|
236931
237251
|
}
|
|
236932
237252
|
classMembers.unshift(
|
|
236933
|
-
|
|
237253
|
+
import_typescript9.default.factory.createConstructorDeclaration(void 0, parameters != null ? parameters : [], import_typescript9.default.factory.createBlock(statements, true))
|
|
236934
237254
|
);
|
|
236935
237255
|
}
|
|
236936
237256
|
return classMembers;
|
|
@@ -236938,20 +237258,24 @@ var updateConstructor = (classNode, classMembers, statements, parameters) => {
|
|
|
236938
237258
|
var needsSuper = (classDeclaration3) => {
|
|
236939
237259
|
const hasHeritageClauses = classDeclaration3.heritageClauses && classDeclaration3.heritageClauses.length > 0;
|
|
236940
237260
|
if (hasHeritageClauses) {
|
|
236941
|
-
return classDeclaration3.heritageClauses.some((clause) => clause.token ===
|
|
237261
|
+
return classDeclaration3.heritageClauses.some((clause) => clause.token === import_typescript9.default.SyntaxKind.ExtendsKeyword);
|
|
236942
237262
|
}
|
|
236943
237263
|
return false;
|
|
236944
237264
|
};
|
|
236945
|
-
var createConstructorBodyWithSuper = () => {
|
|
236946
|
-
return
|
|
236947
|
-
|
|
237265
|
+
var createConstructorBodyWithSuper = (includeFalseArg) => {
|
|
237266
|
+
return import_typescript9.default.factory.createExpressionStatement(
|
|
237267
|
+
import_typescript9.default.factory.createCallExpression(
|
|
237268
|
+
import_typescript9.default.factory.createIdentifier("super"),
|
|
237269
|
+
void 0,
|
|
237270
|
+
includeFalseArg ? [import_typescript9.default.factory.createFalse()] : void 0
|
|
237271
|
+
)
|
|
236948
237272
|
);
|
|
236949
237273
|
};
|
|
236950
237274
|
var tsPropDeclName = (node, typeChecker) => {
|
|
236951
|
-
const declarationName =
|
|
237275
|
+
const declarationName = import_typescript9.default.getNameOfDeclaration(node);
|
|
236952
237276
|
let staticName = declarationName.getText();
|
|
236953
237277
|
let dynamicName;
|
|
236954
|
-
if (
|
|
237278
|
+
if (import_typescript9.default.isComputedPropertyName(declarationName)) {
|
|
236955
237279
|
dynamicName = declarationName.expression.getText();
|
|
236956
237280
|
const type = typeChecker.getTypeAtLocation(declarationName.expression);
|
|
236957
237281
|
if (type != null && type.isLiteral()) {
|
|
@@ -236972,19 +237296,19 @@ function getExternalStyles(style) {
|
|
|
236972
237296
|
// src/compiler/transformers/map-imports-to-path-aliases.ts
|
|
236973
237297
|
var mapImportsToPathAliases = (config, destinationFilePath, outputTarget) => {
|
|
236974
237298
|
return (transformCtx) => {
|
|
236975
|
-
const compilerHost =
|
|
237299
|
+
const compilerHost = import_typescript10.default.createCompilerHost(config.tsCompilerOptions);
|
|
236976
237300
|
const visit2 = (sourceFile) => (node) => {
|
|
236977
237301
|
var _a2, _b;
|
|
236978
|
-
if (outputTarget.transformAliasedImportPaths &&
|
|
237302
|
+
if (outputTarget.transformAliasedImportPaths && import_typescript10.default.isImportDeclaration(node) && import_typescript10.default.isStringLiteral(node.moduleSpecifier)) {
|
|
236979
237303
|
let importPath = node.moduleSpecifier.text;
|
|
236980
237304
|
if (!importPath.startsWith(".")) {
|
|
236981
|
-
const module2 =
|
|
237305
|
+
const module2 = import_typescript10.default.resolveModuleName(importPath, sourceFile, config.tsCompilerOptions, compilerHost);
|
|
236982
237306
|
const hasResolvedFileName = ((_a2 = module2.resolvedModule) == null ? void 0 : _a2.resolvedFileName) != null;
|
|
236983
237307
|
const isModuleFromNodeModules = ((_b = module2.resolvedModule) == null ? void 0 : _b.isExternalLibraryImport) === true;
|
|
236984
237308
|
const shouldTranspileImportPath = hasResolvedFileName && !isModuleFromNodeModules;
|
|
236985
237309
|
if (shouldTranspileImportPath) {
|
|
236986
237310
|
const extensionRegex = new RegExp(
|
|
236987
|
-
Object.values(
|
|
237311
|
+
Object.values(import_typescript10.default.Extension).map((extension) => `${extension}$`).join("|")
|
|
236988
237312
|
);
|
|
236989
237313
|
const resolvePathInDestination = module2.resolvedModule.resolvedFileName.replace(
|
|
236990
237314
|
config.srcDir,
|
|
@@ -237004,10 +237328,10 @@ var mapImportsToPathAliases = (config, destinationFilePath, outputTarget) => {
|
|
|
237004
237328
|
node.assertClause
|
|
237005
237329
|
);
|
|
237006
237330
|
}
|
|
237007
|
-
return
|
|
237331
|
+
return import_typescript10.default.visitEachChild(node, visit2(sourceFile), transformCtx);
|
|
237008
237332
|
};
|
|
237009
237333
|
return (tsSourceFile) => {
|
|
237010
|
-
return
|
|
237334
|
+
return import_typescript10.default.visitEachChild(tsSourceFile, visit2(tsSourceFile.fileName), transformCtx);
|
|
237011
237335
|
};
|
|
237012
237336
|
};
|
|
237013
237337
|
};
|
|
@@ -237033,10 +237357,10 @@ ${code}`;
|
|
|
237033
237357
|
outputTargets.map(async (target) => {
|
|
237034
237358
|
const relPath = relative(config.srcDir, mod.jsFilePath);
|
|
237035
237359
|
const filePath = join(target.collectionDir, relPath);
|
|
237036
|
-
const { outputText } =
|
|
237360
|
+
const { outputText } = import_typescript11.default.transpileModule(code, {
|
|
237037
237361
|
fileName: mod.sourceFilePath,
|
|
237038
237362
|
compilerOptions: {
|
|
237039
|
-
target:
|
|
237363
|
+
target: import_typescript11.default.ScriptTarget.Latest
|
|
237040
237364
|
},
|
|
237041
237365
|
transformers: {
|
|
237042
237366
|
after: [mapImportsToPathAliases(config, filePath, target)]
|
|
@@ -241683,10 +242007,10 @@ var createComponentExport = (cmp) => {
|
|
|
241683
242007
|
|
|
241684
242008
|
// src/compiler/bundle/app-data-plugin.ts
|
|
241685
242009
|
var import_path12 = require("path");
|
|
241686
|
-
var
|
|
242010
|
+
var import_typescript13 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
241687
242011
|
|
|
241688
242012
|
// src/compiler/transformers/remove-collection-imports.ts
|
|
241689
|
-
var
|
|
242013
|
+
var import_typescript12 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
241690
242014
|
var removeCollectionImports = (compilerCtx) => {
|
|
241691
242015
|
return () => {
|
|
241692
242016
|
return (tsSourceFile) => {
|
|
@@ -241694,8 +242018,8 @@ var removeCollectionImports = (compilerCtx) => {
|
|
|
241694
242018
|
const statements = tsSourceFile.statements.slice();
|
|
241695
242019
|
for (let i = statements.length - 1; i >= 0; i--) {
|
|
241696
242020
|
const n3 = statements[i];
|
|
241697
|
-
if (
|
|
241698
|
-
if (!n3.importClause && n3.moduleSpecifier &&
|
|
242021
|
+
if (import_typescript12.default.isImportDeclaration(n3)) {
|
|
242022
|
+
if (!n3.importClause && n3.moduleSpecifier && import_typescript12.default.isStringLiteral(n3.moduleSpecifier)) {
|
|
241699
242023
|
const importPath = n3.moduleSpecifier.text;
|
|
241700
242024
|
const isCollectionImport = compilerCtx.collections.some((c) => {
|
|
241701
242025
|
return c.collectionName === importPath || c.moduleId === importPath;
|
|
@@ -241708,7 +242032,7 @@ var removeCollectionImports = (compilerCtx) => {
|
|
|
241708
242032
|
}
|
|
241709
242033
|
}
|
|
241710
242034
|
if (madeUpdates) {
|
|
241711
|
-
return
|
|
242035
|
+
return import_typescript12.default.factory.updateSourceFile(tsSourceFile, statements);
|
|
241712
242036
|
}
|
|
241713
242037
|
return tsSourceFile;
|
|
241714
242038
|
};
|
|
@@ -241791,8 +242115,8 @@ var appDataPlugin = (config, compilerCtx, buildCtx, buildConditionals, platform)
|
|
|
241791
242115
|
const defaultExport = needsDefault ? "\nexport const globalFn = () => {};\nexport default globalFn;" : "";
|
|
241792
242116
|
code = code + defaultExport;
|
|
241793
242117
|
const compilerOptions = { ...config.tsCompilerOptions };
|
|
241794
|
-
compilerOptions.module =
|
|
241795
|
-
const results =
|
|
242118
|
+
compilerOptions.module = import_typescript13.default.ModuleKind.ESNext;
|
|
242119
|
+
const results = import_typescript13.default.transpileModule(code, {
|
|
241796
242120
|
compilerOptions,
|
|
241797
242121
|
fileName: id,
|
|
241798
242122
|
transformers: {
|
|
@@ -243215,15 +243539,15 @@ var serverPlugin = (config, platform) => {
|
|
|
243215
243539
|
|
|
243216
243540
|
// src/compiler/bundle/typescript-plugin.ts
|
|
243217
243541
|
var import_path24 = require("path");
|
|
243218
|
-
var
|
|
243542
|
+
var import_typescript16 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
243219
243543
|
|
|
243220
243544
|
// src/compiler/sys/typescript/typescript-resolve-module.ts
|
|
243221
243545
|
var import_path23 = require("path");
|
|
243222
|
-
var
|
|
243546
|
+
var import_typescript15 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
243223
243547
|
|
|
243224
243548
|
// src/compiler/sys/typescript/typescript-sys.ts
|
|
243225
243549
|
var import_path22 = require("path");
|
|
243226
|
-
var
|
|
243550
|
+
var import_typescript14 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
243227
243551
|
|
|
243228
243552
|
// src/compiler/sys/environment.ts
|
|
243229
243553
|
var IS_WINDOWS_ENV = process.platform === "win32";
|
|
@@ -243302,7 +243626,7 @@ var patchTsSystemFileSystem = (config, compilerSys, inMemoryFs, tsSys) => {
|
|
|
243302
243626
|
};
|
|
243303
243627
|
tsSys.readDirectory = (path7, extensions, exclude, include, depth) => {
|
|
243304
243628
|
const cwd = compilerSys.getCurrentDirectory();
|
|
243305
|
-
return
|
|
243629
|
+
return import_typescript14.default.matchFiles(
|
|
243306
243630
|
path7,
|
|
243307
243631
|
extensions,
|
|
243308
243632
|
exclude,
|
|
@@ -243338,11 +243662,11 @@ var patchTsSystemWatch = (compilerSystem, tsSys) => {
|
|
|
243338
243662
|
tsSys.watchFile = (p, cb) => {
|
|
243339
243663
|
const watcher = compilerSystem.watchFile(p, (filePath, eventKind) => {
|
|
243340
243664
|
if (eventKind === "fileAdd") {
|
|
243341
|
-
cb(filePath,
|
|
243665
|
+
cb(filePath, import_typescript14.default.FileWatcherEventKind.Created);
|
|
243342
243666
|
} else if (eventKind === "fileUpdate") {
|
|
243343
|
-
cb(filePath,
|
|
243667
|
+
cb(filePath, import_typescript14.default.FileWatcherEventKind.Changed);
|
|
243344
243668
|
} else if (eventKind === "fileDelete") {
|
|
243345
|
-
cb(filePath,
|
|
243669
|
+
cb(filePath, import_typescript14.default.FileWatcherEventKind.Deleted);
|
|
243346
243670
|
}
|
|
243347
243671
|
});
|
|
243348
243672
|
return {
|
|
@@ -243353,15 +243677,15 @@ var patchTsSystemWatch = (compilerSystem, tsSys) => {
|
|
|
243353
243677
|
};
|
|
243354
243678
|
};
|
|
243355
243679
|
var patchTypescript = (config, inMemoryFs) => {
|
|
243356
|
-
if (!
|
|
243357
|
-
patchTsSystemFileSystem(config, config.sys, inMemoryFs,
|
|
243358
|
-
patchTsSystemWatch(config.sys,
|
|
243359
|
-
|
|
243680
|
+
if (!import_typescript14.default.__patched) {
|
|
243681
|
+
patchTsSystemFileSystem(config, config.sys, inMemoryFs, import_typescript14.default.sys);
|
|
243682
|
+
patchTsSystemWatch(config.sys, import_typescript14.default.sys);
|
|
243683
|
+
import_typescript14.default.__patched = true;
|
|
243360
243684
|
}
|
|
243361
243685
|
};
|
|
243362
243686
|
var patchTypeScriptSysMinimum = () => {
|
|
243363
|
-
if (!
|
|
243364
|
-
|
|
243687
|
+
if (!import_typescript14.default.sys) {
|
|
243688
|
+
import_typescript14.default.sys = {
|
|
243365
243689
|
args: [],
|
|
243366
243690
|
createDirectory: noop,
|
|
243367
243691
|
directoryExists: () => false,
|
|
@@ -243397,9 +243721,9 @@ var getTypescriptPathFromUrl = (config, tsExecutingUrl, url) => {
|
|
|
243397
243721
|
|
|
243398
243722
|
// src/compiler/sys/typescript/typescript-resolve-module.ts
|
|
243399
243723
|
var tsResolveModuleName = (config, compilerCtx, moduleName, containingFile) => {
|
|
243400
|
-
const resolveModuleName =
|
|
243724
|
+
const resolveModuleName = import_typescript15.default.__resolveModuleName || import_typescript15.default.resolveModuleName;
|
|
243401
243725
|
if (moduleName && resolveModuleName && config.tsCompilerOptions) {
|
|
243402
|
-
const host = patchTsSystemFileSystem(config, config.sys, compilerCtx.fs,
|
|
243726
|
+
const host = patchTsSystemFileSystem(config, config.sys, compilerCtx.fs, import_typescript15.default.sys);
|
|
243403
243727
|
const compilerOptions = { ...config.tsCompilerOptions };
|
|
243404
243728
|
compilerOptions.resolveJsonModule = true;
|
|
243405
243729
|
return resolveModuleName(moduleName, containingFile, compilerOptions, host);
|
|
@@ -243438,6 +243762,8 @@ var createModule = (staticSourceFile, staticSourceFileText, emitFilepath) => ({
|
|
|
243438
243762
|
staticSourceFile,
|
|
243439
243763
|
staticSourceFileText,
|
|
243440
243764
|
cmps: [],
|
|
243765
|
+
isExtended: false,
|
|
243766
|
+
isMixin: false,
|
|
243441
243767
|
coreRuntimeApis: [],
|
|
243442
243768
|
outputTargetCoreRuntimeApis: {},
|
|
243443
243769
|
collectionName: null,
|
|
@@ -243505,8 +243831,8 @@ var typescriptPlugin = (compilerCtx, bundleOpts, config) => {
|
|
|
243505
243831
|
if ((0, import_path24.isAbsolute)(id)) {
|
|
243506
243832
|
const fsFilePath = normalizeFsPath(id);
|
|
243507
243833
|
const mod = getModule(compilerCtx, fsFilePath);
|
|
243508
|
-
if (mod
|
|
243509
|
-
const tsResult =
|
|
243834
|
+
if (mod == null ? void 0 : mod.cmps) {
|
|
243835
|
+
const tsResult = import_typescript16.default.transpileModule(mod.staticSourceFileText, {
|
|
243510
243836
|
compilerOptions: config.tsCompilerOptions,
|
|
243511
243837
|
fileName: mod.sourceFilePath,
|
|
243512
243838
|
transformers: {
|
|
@@ -243566,7 +243892,7 @@ var userIndexPlugin = (config, compilerCtx) => {
|
|
|
243566
243892
|
|
|
243567
243893
|
// src/compiler/optimize/optimize-module.ts
|
|
243568
243894
|
var import_merge_source_map = __toESM(require_merge_source_map());
|
|
243569
|
-
var
|
|
243895
|
+
var import_typescript17 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
243570
243896
|
|
|
243571
243897
|
// node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs
|
|
243572
243898
|
var schemeRegex = /^[\w+.-]+:\/\//;
|
|
@@ -252186,13 +252512,13 @@ var prepareModule = async (input, minifyOpts, transpileToEs5, inlineHelpers) =>
|
|
|
252186
252512
|
sourceMap: null
|
|
252187
252513
|
};
|
|
252188
252514
|
if (transpileToEs5) {
|
|
252189
|
-
const tsResults =
|
|
252515
|
+
const tsResults = import_typescript17.default.transpileModule(input, {
|
|
252190
252516
|
fileName: "module.ts",
|
|
252191
252517
|
compilerOptions: {
|
|
252192
252518
|
sourceMap: !!minifyOpts.sourceMap,
|
|
252193
252519
|
allowJs: true,
|
|
252194
|
-
target:
|
|
252195
|
-
module:
|
|
252520
|
+
target: import_typescript17.default.ScriptTarget.ES5,
|
|
252521
|
+
module: import_typescript17.default.ModuleKind.ESNext,
|
|
252196
252522
|
removeComments: false,
|
|
252197
252523
|
isolatedModules: true,
|
|
252198
252524
|
skipLibCheck: true,
|
|
@@ -252768,7 +253094,7 @@ function assertIsObjectHook(hook) {
|
|
|
252768
253094
|
}
|
|
252769
253095
|
|
|
252770
253096
|
// src/compiler/transformers/component-native/add-define-custom-element-function.ts
|
|
252771
|
-
var
|
|
253097
|
+
var import_typescript18 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
252772
253098
|
var addDefineCustomElementFunctions = (compilerCtx, components, outputTarget) => {
|
|
252773
253099
|
return () => {
|
|
252774
253100
|
return (tsSourceFile) => {
|
|
@@ -252779,10 +253105,10 @@ var addDefineCustomElementFunctions = (compilerCtx, components, outputTarget) =>
|
|
|
252779
253105
|
if (moduleFile.cmps.length) {
|
|
252780
253106
|
const principalComponent = moduleFile.cmps[0];
|
|
252781
253107
|
tagNames.push(principalComponent.tagName);
|
|
252782
|
-
const customElementsDefineCallExpression =
|
|
252783
|
-
|
|
253108
|
+
const customElementsDefineCallExpression = import_typescript18.default.factory.createCallExpression(
|
|
253109
|
+
import_typescript18.default.factory.createPropertyAccessExpression(import_typescript18.default.factory.createIdentifier("customElements"), "define"),
|
|
252784
253110
|
void 0,
|
|
252785
|
-
[
|
|
253111
|
+
[import_typescript18.default.factory.createIdentifier("tagName"), import_typescript18.default.factory.createIdentifier(principalComponent.componentClassName)]
|
|
252786
253112
|
);
|
|
252787
253113
|
caseStatements.push(
|
|
252788
253114
|
createCustomElementsDefineCase(principalComponent.tagName, customElementsDefineCallExpression)
|
|
@@ -252796,7 +253122,7 @@ var addDefineCustomElementFunctions = (compilerCtx, components, outputTarget) =>
|
|
|
252796
253122
|
newStatements.push(conditionalDefineCustomElementCall);
|
|
252797
253123
|
}
|
|
252798
253124
|
}
|
|
252799
|
-
tsSourceFile =
|
|
253125
|
+
tsSourceFile = import_typescript18.default.factory.updateSourceFile(tsSourceFile, [...tsSourceFile.statements, ...newStatements]);
|
|
252800
253126
|
return tsSourceFile;
|
|
252801
253127
|
};
|
|
252802
253128
|
};
|
|
@@ -252809,83 +253135,83 @@ var setupComponentDependencies = (moduleFile, components, newStatements, caseSta
|
|
|
252809
253135
|
const importAs = `$${exportName}DefineCustomElement`;
|
|
252810
253136
|
tagNames.push(foundDep.tagName);
|
|
252811
253137
|
newStatements.push(createImportStatement([`defineCustomElement as ${importAs}`], foundDep.sourceFilePath));
|
|
252812
|
-
const callExpression3 =
|
|
253138
|
+
const callExpression3 = import_typescript18.default.factory.createCallExpression(import_typescript18.default.factory.createIdentifier(importAs), void 0, []);
|
|
252813
253139
|
caseStatements.push(createCustomElementsDefineCase(foundDep.tagName, callExpression3));
|
|
252814
253140
|
});
|
|
252815
253141
|
});
|
|
252816
253142
|
};
|
|
252817
253143
|
var createCustomElementsDefineCase = (tagName, actionExpression) => {
|
|
252818
|
-
return
|
|
252819
|
-
|
|
252820
|
-
|
|
252821
|
-
|
|
252822
|
-
|
|
252823
|
-
|
|
253144
|
+
return import_typescript18.default.factory.createCaseClause(import_typescript18.default.factory.createStringLiteral(tagName), [
|
|
253145
|
+
import_typescript18.default.factory.createIfStatement(
|
|
253146
|
+
import_typescript18.default.factory.createPrefixUnaryExpression(
|
|
253147
|
+
import_typescript18.default.SyntaxKind.ExclamationToken,
|
|
253148
|
+
import_typescript18.default.factory.createCallExpression(
|
|
253149
|
+
import_typescript18.default.factory.createPropertyAccessExpression(import_typescript18.default.factory.createIdentifier("customElements"), "get"),
|
|
252824
253150
|
void 0,
|
|
252825
|
-
[
|
|
253151
|
+
[import_typescript18.default.factory.createIdentifier("tagName")]
|
|
252826
253152
|
)
|
|
252827
253153
|
),
|
|
252828
|
-
|
|
253154
|
+
import_typescript18.default.factory.createBlock([import_typescript18.default.factory.createExpressionStatement(actionExpression)])
|
|
252829
253155
|
),
|
|
252830
|
-
|
|
253156
|
+
import_typescript18.default.factory.createBreakStatement()
|
|
252831
253157
|
]);
|
|
252832
253158
|
};
|
|
252833
253159
|
var addDefineCustomElementFunction = (tagNames, newStatements, caseStatements) => {
|
|
252834
|
-
const newExpression3 =
|
|
252835
|
-
[
|
|
253160
|
+
const newExpression3 = import_typescript18.default.factory.createFunctionDeclaration(
|
|
253161
|
+
[import_typescript18.default.factory.createModifier(import_typescript18.default.SyntaxKind.ExportKeyword)],
|
|
252836
253162
|
void 0,
|
|
252837
|
-
|
|
253163
|
+
import_typescript18.default.factory.createIdentifier("defineCustomElement"),
|
|
252838
253164
|
void 0,
|
|
252839
253165
|
[],
|
|
252840
253166
|
void 0,
|
|
252841
|
-
|
|
253167
|
+
import_typescript18.default.factory.createBlock(
|
|
252842
253168
|
[
|
|
252843
|
-
|
|
252844
|
-
|
|
252845
|
-
|
|
252846
|
-
|
|
253169
|
+
import_typescript18.default.factory.createIfStatement(
|
|
253170
|
+
import_typescript18.default.factory.createStrictEquality(
|
|
253171
|
+
import_typescript18.default.factory.createTypeOfExpression(import_typescript18.default.factory.createIdentifier("customElements")),
|
|
253172
|
+
import_typescript18.default.factory.createStringLiteral("undefined")
|
|
252847
253173
|
),
|
|
252848
|
-
|
|
253174
|
+
import_typescript18.default.factory.createBlock([import_typescript18.default.factory.createReturnStatement()])
|
|
252849
253175
|
),
|
|
252850
|
-
|
|
253176
|
+
import_typescript18.default.factory.createVariableStatement(
|
|
252851
253177
|
void 0,
|
|
252852
|
-
|
|
253178
|
+
import_typescript18.default.factory.createVariableDeclarationList(
|
|
252853
253179
|
[
|
|
252854
|
-
|
|
253180
|
+
import_typescript18.default.factory.createVariableDeclaration(
|
|
252855
253181
|
"components",
|
|
252856
253182
|
void 0,
|
|
252857
253183
|
void 0,
|
|
252858
|
-
|
|
252859
|
-
tagNames.map((tagName) =>
|
|
253184
|
+
import_typescript18.default.factory.createArrayLiteralExpression(
|
|
253185
|
+
tagNames.map((tagName) => import_typescript18.default.factory.createStringLiteral(tagName))
|
|
252860
253186
|
)
|
|
252861
253187
|
)
|
|
252862
253188
|
],
|
|
252863
|
-
|
|
253189
|
+
import_typescript18.default.NodeFlags.Const
|
|
252864
253190
|
)
|
|
252865
253191
|
),
|
|
252866
|
-
|
|
252867
|
-
|
|
252868
|
-
|
|
253192
|
+
import_typescript18.default.factory.createExpressionStatement(
|
|
253193
|
+
import_typescript18.default.factory.createCallExpression(
|
|
253194
|
+
import_typescript18.default.factory.createPropertyAccessExpression(import_typescript18.default.factory.createIdentifier("components"), "forEach"),
|
|
252869
253195
|
void 0,
|
|
252870
253196
|
[
|
|
252871
|
-
|
|
253197
|
+
import_typescript18.default.factory.createArrowFunction(
|
|
252872
253198
|
void 0,
|
|
252873
253199
|
void 0,
|
|
252874
253200
|
[
|
|
252875
|
-
|
|
253201
|
+
import_typescript18.default.factory.createParameterDeclaration(
|
|
252876
253202
|
void 0,
|
|
252877
253203
|
void 0,
|
|
252878
|
-
|
|
253204
|
+
import_typescript18.default.factory.createIdentifier("tagName"),
|
|
252879
253205
|
void 0,
|
|
252880
253206
|
void 0
|
|
252881
253207
|
)
|
|
252882
253208
|
],
|
|
252883
253209
|
void 0,
|
|
252884
|
-
|
|
252885
|
-
|
|
252886
|
-
|
|
252887
|
-
|
|
252888
|
-
|
|
253210
|
+
import_typescript18.default.factory.createToken(import_typescript18.default.SyntaxKind.EqualsGreaterThanToken),
|
|
253211
|
+
import_typescript18.default.factory.createBlock([
|
|
253212
|
+
import_typescript18.default.factory.createSwitchStatement(
|
|
253213
|
+
import_typescript18.default.factory.createIdentifier("tagName"),
|
|
253214
|
+
import_typescript18.default.factory.createCaseBlock(caseStatements)
|
|
252889
253215
|
)
|
|
252890
253216
|
])
|
|
252891
253217
|
)
|
|
@@ -252899,72 +253225,31 @@ var addDefineCustomElementFunction = (tagNames, newStatements, caseStatements) =
|
|
|
252899
253225
|
newStatements.push(newExpression3);
|
|
252900
253226
|
};
|
|
252901
253227
|
function createAutoDefinitionExpression(componentName) {
|
|
252902
|
-
return
|
|
252903
|
-
|
|
252904
|
-
|
|
253228
|
+
return import_typescript18.default.factory.createExpressionStatement(
|
|
253229
|
+
import_typescript18.default.factory.createCallExpression(import_typescript18.default.factory.createIdentifier("defineCustomElement"), void 0, [
|
|
253230
|
+
import_typescript18.default.factory.createIdentifier(componentName)
|
|
252905
253231
|
])
|
|
252906
253232
|
);
|
|
252907
253233
|
}
|
|
252908
253234
|
|
|
252909
253235
|
// src/compiler/transformers/component-native/proxy-custom-element-function.ts
|
|
252910
|
-
var
|
|
252911
|
-
|
|
252912
|
-
// src/compiler/transformers/add-component-meta-proxy.ts
|
|
252913
|
-
var import_typescript14 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
252914
|
-
|
|
252915
|
-
// src/compiler/transformers/core-runtime-apis.ts
|
|
252916
|
-
var CREATE_EVENT = "__stencil_createEvent";
|
|
252917
|
-
var DEFINE_CUSTOM_ELEMENT = "__stencil_defineCustomElement";
|
|
252918
|
-
var GET_ELEMENT = "__stencil_getElement";
|
|
252919
|
-
var HOST = "__stencil_Host";
|
|
252920
|
-
var HTML_ELEMENT = "HTMLElement";
|
|
252921
|
-
var PROXY_CUSTOM_ELEMENT = "__stencil_proxyCustomElement";
|
|
252922
|
-
var REGISTER_INSTANCE = "__stencil_registerInstance";
|
|
252923
|
-
var REGISTER_HOST = "__stencil_registerHost";
|
|
252924
|
-
var H2 = "__stencil_h";
|
|
252925
|
-
var RUNTIME_APIS = {
|
|
252926
|
-
createEvent: `createEvent as ${CREATE_EVENT}`,
|
|
252927
|
-
defineCustomElement: `defineCustomElement as ${DEFINE_CUSTOM_ELEMENT}`,
|
|
252928
|
-
getElement: `getElement as ${GET_ELEMENT}`,
|
|
252929
|
-
h: `h as ${H2}`,
|
|
252930
|
-
legacyH: `h`,
|
|
252931
|
-
Host: `Host as ${HOST}`,
|
|
252932
|
-
HTMLElement: HTML_ELEMENT,
|
|
252933
|
-
proxyCustomElement: `proxyCustomElement as ${PROXY_CUSTOM_ELEMENT}`,
|
|
252934
|
-
registerHost: `registerHost as ${REGISTER_HOST}`,
|
|
252935
|
-
registerInstance: `registerInstance as ${REGISTER_INSTANCE}`
|
|
252936
|
-
};
|
|
252937
|
-
var addCoreRuntimeApi = (moduleFile, coreRuntimeApi) => {
|
|
252938
|
-
if (!moduleFile.coreRuntimeApis.includes(coreRuntimeApi)) {
|
|
252939
|
-
moduleFile.coreRuntimeApis.push(coreRuntimeApi);
|
|
252940
|
-
}
|
|
252941
|
-
};
|
|
252942
|
-
var addOutputTargetCoreRuntimeApi = (moduleFile, outputTarget, coreRuntimeApi) => {
|
|
252943
|
-
if (!moduleFile.outputTargetCoreRuntimeApis[outputTarget]) {
|
|
252944
|
-
moduleFile.outputTargetCoreRuntimeApis[outputTarget] = [];
|
|
252945
|
-
}
|
|
252946
|
-
if (!moduleFile.outputTargetCoreRuntimeApis[outputTarget].includes(coreRuntimeApi)) {
|
|
252947
|
-
moduleFile.outputTargetCoreRuntimeApis[outputTarget].push(coreRuntimeApi);
|
|
252948
|
-
}
|
|
252949
|
-
};
|
|
252950
|
-
var addLegacyApis = (moduleFile) => {
|
|
252951
|
-
addCoreRuntimeApi(moduleFile, RUNTIME_APIS.legacyH);
|
|
252952
|
-
};
|
|
253236
|
+
var import_typescript21 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
252953
253237
|
|
|
252954
253238
|
// src/compiler/transformers/add-component-meta-proxy.ts
|
|
253239
|
+
var import_typescript19 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
252955
253240
|
var addModuleMetadataProxies = (tsSourceFile, moduleFile) => {
|
|
252956
253241
|
const statements = tsSourceFile.statements.slice();
|
|
252957
253242
|
addCoreRuntimeApi(moduleFile, RUNTIME_APIS.proxyCustomElement);
|
|
252958
253243
|
statements.push(...moduleFile.cmps.map(createComponentMetadataProxy));
|
|
252959
|
-
return
|
|
253244
|
+
return import_typescript19.default.factory.updateSourceFile(tsSourceFile, statements);
|
|
252960
253245
|
};
|
|
252961
253246
|
var createComponentMetadataProxy = (compilerMeta) => {
|
|
252962
253247
|
const compactMeta = formatComponentRuntimeMeta(compilerMeta, true);
|
|
252963
|
-
const literalCmpClassName =
|
|
253248
|
+
const literalCmpClassName = import_typescript19.default.factory.createIdentifier(compilerMeta.componentClassName);
|
|
252964
253249
|
const literalMeta = convertValueToLiteral(compactMeta);
|
|
252965
|
-
return
|
|
252966
|
-
|
|
252967
|
-
|
|
253250
|
+
return import_typescript19.default.factory.createExpressionStatement(
|
|
253251
|
+
import_typescript19.default.factory.createCallExpression(
|
|
253252
|
+
import_typescript19.default.factory.createIdentifier(PROXY_CUSTOM_ELEMENT),
|
|
252968
253253
|
[],
|
|
252969
253254
|
[literalCmpClassName, literalMeta]
|
|
252970
253255
|
)
|
|
@@ -252973,11 +253258,11 @@ var createComponentMetadataProxy = (compilerMeta) => {
|
|
|
252973
253258
|
var createClassMetadataProxy = (compilerMeta, clazz) => {
|
|
252974
253259
|
const compactMeta = formatComponentRuntimeMeta(compilerMeta, true);
|
|
252975
253260
|
const literalMeta = convertValueToLiteral(compactMeta);
|
|
252976
|
-
return
|
|
253261
|
+
return import_typescript19.default.factory.createCallExpression(import_typescript19.default.factory.createIdentifier(PROXY_CUSTOM_ELEMENT), [], [clazz, literalMeta]);
|
|
252977
253262
|
};
|
|
252978
253263
|
|
|
252979
253264
|
// src/compiler/transformers/add-imports.ts
|
|
252980
|
-
var
|
|
253265
|
+
var import_typescript20 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
252981
253266
|
var addImports = (transformOpts, tsSourceFile, importFnNames, importPath) => {
|
|
252982
253267
|
if (importFnNames.length === 0) {
|
|
252983
253268
|
return tsSourceFile;
|
|
@@ -252986,12 +253271,12 @@ var addImports = (transformOpts, tsSourceFile, importFnNames, importPath) => {
|
|
|
252986
253271
|
const newRequire = createRequireStatement(importFnNames, importPath);
|
|
252987
253272
|
const statements2 = tsSourceFile.statements.slice();
|
|
252988
253273
|
statements2.splice(2, 0, newRequire);
|
|
252989
|
-
return
|
|
253274
|
+
return import_typescript20.default.factory.updateSourceFile(tsSourceFile, statements2);
|
|
252990
253275
|
}
|
|
252991
253276
|
const newImport = createImportStatement(importFnNames, importPath);
|
|
252992
253277
|
const statements = tsSourceFile.statements.slice();
|
|
252993
253278
|
statements.unshift(newImport);
|
|
252994
|
-
return
|
|
253279
|
+
return import_typescript20.default.factory.updateSourceFile(tsSourceFile, statements);
|
|
252995
253280
|
};
|
|
252996
253281
|
|
|
252997
253282
|
// src/compiler/transformers/component-native/proxy-custom-element-function.ts
|
|
@@ -253004,42 +253289,42 @@ var proxyCustomElement2 = (compilerCtx, transformOpts) => {
|
|
|
253004
253289
|
}
|
|
253005
253290
|
const principalComponent = moduleFile.cmps[0];
|
|
253006
253291
|
for (const [stmtIndex, stmt] of tsSourceFile.statements.entries()) {
|
|
253007
|
-
if (
|
|
253292
|
+
if (import_typescript21.default.isVariableStatement(stmt)) {
|
|
253008
253293
|
for (const [declarationIndex, declaration] of stmt.declarationList.declarations.entries()) {
|
|
253009
253294
|
if (declaration.name.getText() !== principalComponent.componentClassName) {
|
|
253010
253295
|
continue;
|
|
253011
253296
|
}
|
|
253012
|
-
if (!
|
|
253297
|
+
if (!import_typescript21.default.isClassExpression(declaration.initializer)) {
|
|
253013
253298
|
continue;
|
|
253014
253299
|
}
|
|
253015
|
-
const renamedClassExpression =
|
|
253300
|
+
const renamedClassExpression = import_typescript21.default.factory.updateClassExpression(
|
|
253016
253301
|
declaration.initializer,
|
|
253017
|
-
|
|
253018
|
-
|
|
253302
|
+
import_typescript21.default.getModifiers(declaration.initializer),
|
|
253303
|
+
import_typescript21.default.factory.createIdentifier(principalComponent.componentClassName),
|
|
253019
253304
|
declaration.initializer.typeParameters,
|
|
253020
253305
|
declaration.initializer.heritageClauses,
|
|
253021
253306
|
declaration.initializer.members
|
|
253022
253307
|
);
|
|
253023
253308
|
const proxyCreationCall = createClassMetadataProxy(principalComponent, renamedClassExpression);
|
|
253024
|
-
|
|
253025
|
-
const proxiedComponentDeclaration =
|
|
253309
|
+
import_typescript21.default.addSyntheticLeadingComment(proxyCreationCall, import_typescript21.default.SyntaxKind.MultiLineCommentTrivia, "@__PURE__", false);
|
|
253310
|
+
const proxiedComponentDeclaration = import_typescript21.default.factory.updateVariableDeclaration(
|
|
253026
253311
|
declaration,
|
|
253027
253312
|
declaration.name,
|
|
253028
253313
|
declaration.exclamationToken,
|
|
253029
253314
|
declaration.type,
|
|
253030
253315
|
proxyCreationCall
|
|
253031
253316
|
);
|
|
253032
|
-
const updatedDeclarationList =
|
|
253317
|
+
const updatedDeclarationList = import_typescript21.default.factory.updateVariableDeclarationList(stmt.declarationList, [
|
|
253033
253318
|
...stmt.declarationList.declarations.slice(0, declarationIndex),
|
|
253034
253319
|
proxiedComponentDeclaration,
|
|
253035
253320
|
...stmt.declarationList.declarations.slice(declarationIndex + 1)
|
|
253036
253321
|
]);
|
|
253037
|
-
const updatedVariableStatement =
|
|
253322
|
+
const updatedVariableStatement = import_typescript21.default.factory.updateVariableStatement(
|
|
253038
253323
|
stmt,
|
|
253039
253324
|
stmt.modifiers,
|
|
253040
253325
|
updatedDeclarationList
|
|
253041
253326
|
);
|
|
253042
|
-
tsSourceFile =
|
|
253327
|
+
tsSourceFile = import_typescript21.default.factory.updateSourceFile(tsSourceFile, [
|
|
253043
253328
|
...tsSourceFile.statements.slice(0, stmtIndex),
|
|
253044
253329
|
updatedVariableStatement,
|
|
253045
253330
|
...tsSourceFile.statements.slice(stmtIndex + 1)
|
|
@@ -253060,10 +253345,10 @@ var proxyCustomElement2 = (compilerCtx, transformOpts) => {
|
|
|
253060
253345
|
};
|
|
253061
253346
|
|
|
253062
253347
|
// src/compiler/transformers/component-native/tranform-to-native-component.ts
|
|
253063
|
-
var
|
|
253348
|
+
var import_typescript32 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
253064
253349
|
|
|
253065
253350
|
// src/compiler/transformers/define-custom-element.ts
|
|
253066
|
-
var
|
|
253351
|
+
var import_typescript22 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
253067
253352
|
var defineCustomElement2 = (tsSourceFile, moduleFile, transformOpts) => {
|
|
253068
253353
|
let statements = tsSourceFile.statements.slice();
|
|
253069
253354
|
statements.push(
|
|
@@ -253074,31 +253359,31 @@ var defineCustomElement2 = (tsSourceFile, moduleFile, transformOpts) => {
|
|
|
253074
253359
|
if (transformOpts.module === "cjs") {
|
|
253075
253360
|
statements = removeComponentCjsExport(statements, moduleFile);
|
|
253076
253361
|
}
|
|
253077
|
-
return
|
|
253362
|
+
return import_typescript22.default.factory.updateSourceFile(tsSourceFile, statements);
|
|
253078
253363
|
};
|
|
253079
253364
|
var addDefineCustomElement = (moduleFile, compilerMeta) => {
|
|
253080
253365
|
if (compilerMeta.isPlain) {
|
|
253081
|
-
return
|
|
253082
|
-
|
|
253083
|
-
|
|
253084
|
-
|
|
253085
|
-
|
|
253366
|
+
return import_typescript22.default.factory.createExpressionStatement(
|
|
253367
|
+
import_typescript22.default.factory.createCallExpression(
|
|
253368
|
+
import_typescript22.default.factory.createPropertyAccessExpression(
|
|
253369
|
+
import_typescript22.default.factory.createIdentifier("customElements"),
|
|
253370
|
+
import_typescript22.default.factory.createIdentifier("define")
|
|
253086
253371
|
),
|
|
253087
253372
|
[],
|
|
253088
253373
|
[
|
|
253089
|
-
|
|
253090
|
-
|
|
253374
|
+
import_typescript22.default.factory.createStringLiteral(compilerMeta.tagName),
|
|
253375
|
+
import_typescript22.default.factory.createIdentifier(compilerMeta.componentClassName)
|
|
253091
253376
|
]
|
|
253092
253377
|
)
|
|
253093
253378
|
);
|
|
253094
253379
|
}
|
|
253095
253380
|
addCoreRuntimeApi(moduleFile, RUNTIME_APIS.defineCustomElement);
|
|
253096
253381
|
const compactMeta = formatComponentRuntimeMeta(compilerMeta, true);
|
|
253097
|
-
const liternalCmpClassName =
|
|
253382
|
+
const liternalCmpClassName = import_typescript22.default.factory.createIdentifier(compilerMeta.componentClassName);
|
|
253098
253383
|
const liternalMeta = convertValueToLiteral(compactMeta);
|
|
253099
|
-
return
|
|
253100
|
-
|
|
253101
|
-
|
|
253384
|
+
return import_typescript22.default.factory.createExpressionStatement(
|
|
253385
|
+
import_typescript22.default.factory.createCallExpression(
|
|
253386
|
+
import_typescript22.default.factory.createIdentifier(DEFINE_CUSTOM_ELEMENT),
|
|
253102
253387
|
[],
|
|
253103
253388
|
[liternalCmpClassName, liternalMeta]
|
|
253104
253389
|
)
|
|
@@ -253107,12 +253392,12 @@ var addDefineCustomElement = (moduleFile, compilerMeta) => {
|
|
|
253107
253392
|
var removeComponentCjsExport = (statements, moduleFile) => {
|
|
253108
253393
|
const cmpClassNames = new Set(moduleFile.cmps.map((cmp) => cmp.componentClassName));
|
|
253109
253394
|
return statements.filter((s) => {
|
|
253110
|
-
if (s.kind ===
|
|
253395
|
+
if (s.kind === import_typescript22.default.SyntaxKind.ExpressionStatement) {
|
|
253111
253396
|
const exp = s.expression;
|
|
253112
|
-
if (exp && exp.kind ===
|
|
253397
|
+
if (exp && exp.kind === import_typescript22.default.SyntaxKind.BinaryExpression) {
|
|
253113
253398
|
const left = exp.left;
|
|
253114
|
-
if (left && left.kind ===
|
|
253115
|
-
if (left.expression && left.expression.kind ===
|
|
253399
|
+
if (left && left.kind === import_typescript22.default.SyntaxKind.PropertyAccessExpression) {
|
|
253400
|
+
if (left.expression && left.expression.kind === import_typescript22.default.SyntaxKind.Identifier) {
|
|
253116
253401
|
const leftText = left.expression;
|
|
253117
253402
|
if (leftText.text === "exports") {
|
|
253118
253403
|
const right = exp.right;
|
|
@@ -253129,7 +253414,7 @@ var removeComponentCjsExport = (statements, moduleFile) => {
|
|
|
253129
253414
|
};
|
|
253130
253415
|
|
|
253131
253416
|
// src/compiler/transformers/style-imports.ts
|
|
253132
|
-
var
|
|
253417
|
+
var import_typescript23 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
253133
253418
|
var updateStyleImports = (transformOpts, tsSourceFile, moduleFile) => {
|
|
253134
253419
|
if (transformOpts.module === "cjs") {
|
|
253135
253420
|
return updateCjsStyleRequires(transformOpts, tsSourceFile, moduleFile);
|
|
@@ -253155,27 +253440,27 @@ var updateEsmStyleImports = (transformOpts, tsSourceFile, moduleFile) => {
|
|
|
253155
253440
|
if (updateSourceFile) {
|
|
253156
253441
|
let lastImportIndex = -1;
|
|
253157
253442
|
for (let i = 0; i < statements.length; i++) {
|
|
253158
|
-
if (
|
|
253443
|
+
if (import_typescript23.default.isImportDeclaration(statements[i])) {
|
|
253159
253444
|
lastImportIndex = i;
|
|
253160
253445
|
}
|
|
253161
253446
|
}
|
|
253162
253447
|
statements.splice(lastImportIndex + 1, 0, ...styleImports);
|
|
253163
|
-
return
|
|
253448
|
+
return import_typescript23.default.factory.updateSourceFile(tsSourceFile, statements);
|
|
253164
253449
|
}
|
|
253165
253450
|
return tsSourceFile;
|
|
253166
253451
|
};
|
|
253167
253452
|
var updateEsmStyleImportPath = (transformOpts, tsSourceFile, statements, cmp, style) => {
|
|
253168
253453
|
for (let i = 0; i < statements.length; i++) {
|
|
253169
253454
|
const n3 = statements[i];
|
|
253170
|
-
if (
|
|
253455
|
+
if (import_typescript23.default.isImportDeclaration(n3) && n3.importClause && n3.moduleSpecifier && import_typescript23.default.isStringLiteral(n3.moduleSpecifier)) {
|
|
253171
253456
|
if (n3.importClause.name && n3.importClause.name.escapedText === style.styleIdentifier) {
|
|
253172
253457
|
const orgImportPath = n3.moduleSpecifier.text;
|
|
253173
253458
|
const importPath = getStyleImportPath(transformOpts, tsSourceFile, cmp, style, orgImportPath);
|
|
253174
|
-
statements[i] =
|
|
253459
|
+
statements[i] = import_typescript23.default.factory.updateImportDeclaration(
|
|
253175
253460
|
n3,
|
|
253176
253461
|
retrieveTsModifiers(n3),
|
|
253177
253462
|
n3.importClause,
|
|
253178
|
-
|
|
253463
|
+
import_typescript23.default.factory.createStringLiteral(importPath),
|
|
253179
253464
|
void 0
|
|
253180
253465
|
);
|
|
253181
253466
|
break;
|
|
@@ -253188,34 +253473,34 @@ var createStyleImport = (transformOpts, tsSourceFile, cmp, style, moduleType = "
|
|
|
253188
253473
|
const imports = [];
|
|
253189
253474
|
for (const [i, externalStyle] of Object.entries(getExternalStyles(style))) {
|
|
253190
253475
|
const styleIdentifier = `${style.styleIdentifier}${i}`;
|
|
253191
|
-
const importIdentifier =
|
|
253476
|
+
const importIdentifier = import_typescript23.default.factory.createIdentifier(styleIdentifier);
|
|
253192
253477
|
const importPath = getStyleImportPath(transformOpts, tsSourceFile, cmp, style, externalStyle);
|
|
253193
253478
|
if (moduleType === "esm") {
|
|
253194
253479
|
imports.push(
|
|
253195
|
-
|
|
253480
|
+
import_typescript23.default.factory.createImportDeclaration(
|
|
253196
253481
|
void 0,
|
|
253197
|
-
|
|
253198
|
-
|
|
253482
|
+
import_typescript23.default.factory.createImportClause(false, importIdentifier, void 0),
|
|
253483
|
+
import_typescript23.default.factory.createStringLiteral(importPath)
|
|
253199
253484
|
)
|
|
253200
253485
|
);
|
|
253201
253486
|
} else if (moduleType === "cjs") {
|
|
253202
253487
|
imports.push(
|
|
253203
|
-
|
|
253488
|
+
import_typescript23.default.factory.createVariableStatement(
|
|
253204
253489
|
void 0,
|
|
253205
|
-
|
|
253490
|
+
import_typescript23.default.factory.createVariableDeclarationList(
|
|
253206
253491
|
[
|
|
253207
|
-
|
|
253492
|
+
import_typescript23.default.factory.createVariableDeclaration(
|
|
253208
253493
|
importIdentifier,
|
|
253209
253494
|
void 0,
|
|
253210
253495
|
void 0,
|
|
253211
|
-
|
|
253212
|
-
|
|
253496
|
+
import_typescript23.default.factory.createCallExpression(
|
|
253497
|
+
import_typescript23.default.factory.createIdentifier("require"),
|
|
253213
253498
|
[],
|
|
253214
|
-
[
|
|
253499
|
+
[import_typescript23.default.factory.createStringLiteral(importPath)]
|
|
253215
253500
|
)
|
|
253216
253501
|
)
|
|
253217
253502
|
],
|
|
253218
|
-
|
|
253503
|
+
import_typescript23.default.NodeFlags.Const
|
|
253219
253504
|
)
|
|
253220
253505
|
)
|
|
253221
253506
|
);
|
|
@@ -253235,7 +253520,7 @@ var updateCjsStyleRequires = (transformOpts, tsSourceFile, moduleFile) => {
|
|
|
253235
253520
|
});
|
|
253236
253521
|
});
|
|
253237
253522
|
if (styleRequires.length > 0) {
|
|
253238
|
-
return
|
|
253523
|
+
return import_typescript23.default.factory.updateSourceFile(tsSourceFile, [...styleRequires, ...tsSourceFile.statements]);
|
|
253239
253524
|
}
|
|
253240
253525
|
return tsSourceFile;
|
|
253241
253526
|
};
|
|
@@ -253251,25 +253536,25 @@ var getStyleImportPath = (transformOpts, tsSourceFile, cmp, style, importPath) =
|
|
|
253251
253536
|
};
|
|
253252
253537
|
|
|
253253
253538
|
// src/compiler/transformers/component-native/native-component.ts
|
|
253254
|
-
var
|
|
253539
|
+
var import_typescript31 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
253255
253540
|
|
|
253256
253541
|
// src/compiler/transformers/host-data-transform.ts
|
|
253257
|
-
var
|
|
253542
|
+
var import_typescript24 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
253258
253543
|
var transformHostData = (classElements, moduleFile) => {
|
|
253259
253544
|
const hasHostData = classElements.some(
|
|
253260
|
-
(e) =>
|
|
253545
|
+
(e) => import_typescript24.default.isMethodDeclaration(e) && e.name.escapedText === "hostData"
|
|
253261
253546
|
);
|
|
253262
253547
|
if (hasHostData) {
|
|
253263
253548
|
const renderIndex = classElements.findIndex(
|
|
253264
|
-
(e) =>
|
|
253549
|
+
(e) => import_typescript24.default.isMethodDeclaration(e) && e.name.escapedText === "render"
|
|
253265
253550
|
);
|
|
253266
253551
|
if (renderIndex >= 0) {
|
|
253267
253552
|
const renderMethod = classElements[renderIndex];
|
|
253268
|
-
classElements[renderIndex] =
|
|
253553
|
+
classElements[renderIndex] = import_typescript24.default.factory.updateMethodDeclaration(
|
|
253269
253554
|
renderMethod,
|
|
253270
253555
|
retrieveModifierLike(renderMethod),
|
|
253271
253556
|
renderMethod.asteriskToken,
|
|
253272
|
-
|
|
253557
|
+
import_typescript24.default.factory.createIdentifier(INTERNAL_RENDER),
|
|
253273
253558
|
renderMethod.questionToken,
|
|
253274
253559
|
renderMethod.typeParameters,
|
|
253275
253560
|
renderMethod.parameters,
|
|
@@ -253285,10 +253570,10 @@ var syntheticRender = (moduleFile, hasRender) => {
|
|
|
253285
253570
|
addCoreRuntimeApi(moduleFile, RUNTIME_APIS.h);
|
|
253286
253571
|
const hArguments = [
|
|
253287
253572
|
// __stencil_Host
|
|
253288
|
-
|
|
253573
|
+
import_typescript24.default.factory.createIdentifier(HOST),
|
|
253289
253574
|
// this.hostData()
|
|
253290
|
-
|
|
253291
|
-
|
|
253575
|
+
import_typescript24.default.factory.createCallExpression(
|
|
253576
|
+
import_typescript24.default.factory.createPropertyAccessExpression(import_typescript24.default.factory.createThis(), "hostData"),
|
|
253292
253577
|
void 0,
|
|
253293
253578
|
void 0
|
|
253294
253579
|
)
|
|
@@ -253296,14 +253581,14 @@ var syntheticRender = (moduleFile, hasRender) => {
|
|
|
253296
253581
|
if (hasRender) {
|
|
253297
253582
|
hArguments.push(
|
|
253298
253583
|
// this.render()
|
|
253299
|
-
|
|
253300
|
-
|
|
253584
|
+
import_typescript24.default.factory.createCallExpression(
|
|
253585
|
+
import_typescript24.default.factory.createPropertyAccessExpression(import_typescript24.default.factory.createThis(), INTERNAL_RENDER),
|
|
253301
253586
|
void 0,
|
|
253302
253587
|
void 0
|
|
253303
253588
|
)
|
|
253304
253589
|
);
|
|
253305
253590
|
}
|
|
253306
|
-
return
|
|
253591
|
+
return import_typescript24.default.factory.createMethodDeclaration(
|
|
253307
253592
|
void 0,
|
|
253308
253593
|
void 0,
|
|
253309
253594
|
"render",
|
|
@@ -253311,111 +253596,15 @@ var syntheticRender = (moduleFile, hasRender) => {
|
|
|
253311
253596
|
void 0,
|
|
253312
253597
|
[],
|
|
253313
253598
|
void 0,
|
|
253314
|
-
|
|
253315
|
-
|
|
253316
|
-
|
|
253599
|
+
import_typescript24.default.factory.createBlock([
|
|
253600
|
+
import_typescript24.default.factory.createReturnStatement(
|
|
253601
|
+
import_typescript24.default.factory.createCallExpression(import_typescript24.default.factory.createIdentifier(H2), void 0, hArguments)
|
|
253317
253602
|
)
|
|
253318
253603
|
])
|
|
253319
253604
|
);
|
|
253320
253605
|
};
|
|
253321
253606
|
var INTERNAL_RENDER = "__stencil_render";
|
|
253322
253607
|
|
|
253323
|
-
// src/compiler/transformers/remove-static-meta-properties.ts
|
|
253324
|
-
var import_typescript20 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
253325
|
-
var removeStaticMetaProperties = (classNode) => {
|
|
253326
|
-
if (classNode.members == null) {
|
|
253327
|
-
return [];
|
|
253328
|
-
}
|
|
253329
|
-
return classNode.members.filter((classMember) => {
|
|
253330
|
-
var _a2;
|
|
253331
|
-
if ((_a2 = retrieveTsModifiers(classMember)) == null ? void 0 : _a2.some((m) => m.kind === import_typescript20.default.SyntaxKind.StaticKeyword)) {
|
|
253332
|
-
const memberName = classMember.name.escapedText;
|
|
253333
|
-
if (readOnlyArrayHasStringMember(STATIC_GETTERS_TO_REMOVE, memberName)) {
|
|
253334
|
-
return false;
|
|
253335
|
-
}
|
|
253336
|
-
}
|
|
253337
|
-
return true;
|
|
253338
|
-
});
|
|
253339
|
-
};
|
|
253340
|
-
var STATIC_GETTERS_TO_REMOVE = [
|
|
253341
|
-
// we want to remove `attachInternalsMemberName`, which is an 'internal' static
|
|
253342
|
-
// property used to pass a string value along from the 'decorators-to-static'
|
|
253343
|
-
// step through to the `ComponentCompilerMeta` phase, but we want to keep the
|
|
253344
|
-
// `formAssociated` prop that we also set at the same time.
|
|
253345
|
-
"attachInternalsMemberName",
|
|
253346
|
-
"elementRef",
|
|
253347
|
-
"encapsulation",
|
|
253348
|
-
"events",
|
|
253349
|
-
"is",
|
|
253350
|
-
"listeners",
|
|
253351
|
-
"methods",
|
|
253352
|
-
"originalStyleUrls",
|
|
253353
|
-
"properties",
|
|
253354
|
-
"states",
|
|
253355
|
-
"style",
|
|
253356
|
-
"styleMode",
|
|
253357
|
-
"styleUrl",
|
|
253358
|
-
"styleUrls",
|
|
253359
|
-
"styles",
|
|
253360
|
-
"watchers"
|
|
253361
|
-
];
|
|
253362
|
-
|
|
253363
|
-
// src/compiler/transformers/update-component-class.ts
|
|
253364
|
-
var import_typescript21 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
253365
|
-
var updateComponentClass = (transformOpts, classNode, heritageClauses, members) => {
|
|
253366
|
-
var _a2, _b, _c;
|
|
253367
|
-
let classModifiers = (_b = (_a2 = retrieveTsModifiers(classNode)) == null ? void 0 : _a2.slice()) != null ? _b : [];
|
|
253368
|
-
if (transformOpts.module === "cjs") {
|
|
253369
|
-
if (transformOpts.componentExport === "customelement") {
|
|
253370
|
-
classModifiers = classModifiers.filter((m) => {
|
|
253371
|
-
return m.kind !== import_typescript21.default.SyntaxKind.ExportKeyword;
|
|
253372
|
-
});
|
|
253373
|
-
}
|
|
253374
|
-
return import_typescript21.default.factory.updateClassDeclaration(
|
|
253375
|
-
classNode,
|
|
253376
|
-
[...(_c = retrieveTsDecorators(classNode)) != null ? _c : [], ...classModifiers],
|
|
253377
|
-
classNode.name,
|
|
253378
|
-
classNode.typeParameters,
|
|
253379
|
-
heritageClauses,
|
|
253380
|
-
members
|
|
253381
|
-
);
|
|
253382
|
-
}
|
|
253383
|
-
return createConstClass(transformOpts, classNode, heritageClauses, members);
|
|
253384
|
-
};
|
|
253385
|
-
var createConstClass = (transformOpts, classNode, heritageClauses, members) => {
|
|
253386
|
-
var _a2;
|
|
253387
|
-
const className = classNode.name;
|
|
253388
|
-
const tsModifiers = (_a2 = retrieveTsModifiers(classNode)) != null ? _a2 : [];
|
|
253389
|
-
const classHasExportKeyword = tsModifiers.some((m) => m.kind === import_typescript21.default.SyntaxKind.ExportKeyword);
|
|
253390
|
-
const classModifiers = tsModifiers.filter((m) => {
|
|
253391
|
-
return m.kind !== import_typescript21.default.SyntaxKind.ExportKeyword;
|
|
253392
|
-
});
|
|
253393
|
-
const constModifiers = [];
|
|
253394
|
-
if (transformOpts.componentExport !== "customelement" && classHasExportKeyword) {
|
|
253395
|
-
constModifiers.push(import_typescript21.default.factory.createModifier(import_typescript21.default.SyntaxKind.ExportKeyword));
|
|
253396
|
-
}
|
|
253397
|
-
return import_typescript21.default.factory.createVariableStatement(
|
|
253398
|
-
constModifiers,
|
|
253399
|
-
import_typescript21.default.factory.createVariableDeclarationList(
|
|
253400
|
-
[
|
|
253401
|
-
import_typescript21.default.factory.createVariableDeclaration(
|
|
253402
|
-
className,
|
|
253403
|
-
void 0,
|
|
253404
|
-
void 0,
|
|
253405
|
-
import_typescript21.default.factory.createClassExpression(
|
|
253406
|
-
classModifiers,
|
|
253407
|
-
void 0,
|
|
253408
|
-
classNode.typeParameters,
|
|
253409
|
-
heritageClauses,
|
|
253410
|
-
members
|
|
253411
|
-
)
|
|
253412
|
-
)
|
|
253413
|
-
],
|
|
253414
|
-
import_typescript21.default.NodeFlags.Const
|
|
253415
|
-
)
|
|
253416
|
-
);
|
|
253417
|
-
};
|
|
253418
|
-
|
|
253419
253608
|
// src/compiler/transformers/watcher-meta-transform.ts
|
|
253420
253609
|
var addWatchers = (classMembers, cmp) => {
|
|
253421
253610
|
if (cmp.watchers.length > 0) {
|
|
@@ -253429,24 +253618,24 @@ var addWatchers = (classMembers, cmp) => {
|
|
|
253429
253618
|
};
|
|
253430
253619
|
|
|
253431
253620
|
// src/compiler/transformers/component-native/native-connected-callback.ts
|
|
253432
|
-
var
|
|
253621
|
+
var import_typescript25 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
253433
253622
|
var addNativeConnectedCallback = (classMembers, cmp) => {
|
|
253434
253623
|
if (cmp.isPlain && cmp.hasRenderFn) {
|
|
253435
|
-
const fnCall =
|
|
253436
|
-
|
|
253437
|
-
|
|
253438
|
-
|
|
253439
|
-
|
|
253624
|
+
const fnCall = import_typescript25.default.factory.createExpressionStatement(
|
|
253625
|
+
import_typescript25.default.factory.createAssignment(
|
|
253626
|
+
import_typescript25.default.factory.createPropertyAccessExpression(import_typescript25.default.factory.createThis(), "textContent"),
|
|
253627
|
+
import_typescript25.default.factory.createCallExpression(
|
|
253628
|
+
import_typescript25.default.factory.createPropertyAccessExpression(import_typescript25.default.factory.createThis(), "render"),
|
|
253440
253629
|
void 0,
|
|
253441
253630
|
void 0
|
|
253442
253631
|
)
|
|
253443
253632
|
)
|
|
253444
253633
|
);
|
|
253445
253634
|
const connectedCallback2 = classMembers.find((classMember) => {
|
|
253446
|
-
return
|
|
253635
|
+
return import_typescript25.default.isMethodDeclaration(classMember) && classMember.name.escapedText === CONNECTED_CALLBACK;
|
|
253447
253636
|
});
|
|
253448
253637
|
if (connectedCallback2 != null) {
|
|
253449
|
-
const callbackMethod =
|
|
253638
|
+
const callbackMethod = import_typescript25.default.factory.createMethodDeclaration(
|
|
253450
253639
|
void 0,
|
|
253451
253640
|
void 0,
|
|
253452
253641
|
CONNECTED_CALLBACK,
|
|
@@ -253454,12 +253643,12 @@ var addNativeConnectedCallback = (classMembers, cmp) => {
|
|
|
253454
253643
|
void 0,
|
|
253455
253644
|
[],
|
|
253456
253645
|
void 0,
|
|
253457
|
-
|
|
253646
|
+
import_typescript25.default.factory.createBlock([fnCall, ...connectedCallback2.body.statements], true)
|
|
253458
253647
|
);
|
|
253459
253648
|
const index2 = classMembers.indexOf(connectedCallback2);
|
|
253460
253649
|
classMembers[index2] = callbackMethod;
|
|
253461
253650
|
} else {
|
|
253462
|
-
const callbackMethod =
|
|
253651
|
+
const callbackMethod = import_typescript25.default.factory.createMethodDeclaration(
|
|
253463
253652
|
void 0,
|
|
253464
253653
|
void 0,
|
|
253465
253654
|
CONNECTED_CALLBACK,
|
|
@@ -253467,7 +253656,7 @@ var addNativeConnectedCallback = (classMembers, cmp) => {
|
|
|
253467
253656
|
void 0,
|
|
253468
253657
|
[],
|
|
253469
253658
|
void 0,
|
|
253470
|
-
|
|
253659
|
+
import_typescript25.default.factory.createBlock([fnCall], true)
|
|
253471
253660
|
);
|
|
253472
253661
|
classMembers.push(callbackMethod);
|
|
253473
253662
|
}
|
|
@@ -253476,56 +253665,25 @@ var addNativeConnectedCallback = (classMembers, cmp) => {
|
|
|
253476
253665
|
var CONNECTED_CALLBACK = "connectedCallback";
|
|
253477
253666
|
|
|
253478
253667
|
// src/compiler/transformers/component-native/native-constructor.ts
|
|
253479
|
-
var
|
|
253480
|
-
|
|
253481
|
-
// src/compiler/transformers/create-event.ts
|
|
253482
|
-
var import_typescript23 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
253483
|
-
var addCreateEvents = (moduleFile, cmp) => {
|
|
253484
|
-
return cmp.events.map((ev) => {
|
|
253485
|
-
addCoreRuntimeApi(moduleFile, RUNTIME_APIS.createEvent);
|
|
253486
|
-
return import_typescript23.default.factory.createExpressionStatement(
|
|
253487
|
-
import_typescript23.default.factory.createAssignment(
|
|
253488
|
-
import_typescript23.default.factory.createPropertyAccessExpression(import_typescript23.default.factory.createThis(), import_typescript23.default.factory.createIdentifier(ev.method)),
|
|
253489
|
-
import_typescript23.default.factory.createCallExpression(import_typescript23.default.factory.createIdentifier(CREATE_EVENT), void 0, [
|
|
253490
|
-
import_typescript23.default.factory.createThis(),
|
|
253491
|
-
import_typescript23.default.factory.createStringLiteral(ev.name),
|
|
253492
|
-
import_typescript23.default.factory.createNumericLiteral(computeFlags(ev))
|
|
253493
|
-
])
|
|
253494
|
-
)
|
|
253495
|
-
);
|
|
253496
|
-
});
|
|
253497
|
-
};
|
|
253498
|
-
var computeFlags = (eventMeta) => {
|
|
253499
|
-
let flags = 0;
|
|
253500
|
-
if (eventMeta.bubbles) {
|
|
253501
|
-
flags |= 4 /* Bubbles */;
|
|
253502
|
-
}
|
|
253503
|
-
if (eventMeta.composed) {
|
|
253504
|
-
flags |= 2 /* Composed */;
|
|
253505
|
-
}
|
|
253506
|
-
if (eventMeta.cancelable) {
|
|
253507
|
-
flags |= 1 /* Cancellable */;
|
|
253508
|
-
}
|
|
253509
|
-
return flags;
|
|
253510
|
-
};
|
|
253668
|
+
var import_typescript27 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
253511
253669
|
|
|
253512
253670
|
// src/compiler/transformers/component-native/attach-internals.ts
|
|
253513
|
-
var
|
|
253671
|
+
var import_typescript26 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
253514
253672
|
function createNativeAttachInternalsBinding(cmp) {
|
|
253515
253673
|
if (cmp.attachInternalsMemberName) {
|
|
253516
253674
|
return [
|
|
253517
|
-
|
|
253518
|
-
|
|
253519
|
-
|
|
253520
|
-
|
|
253675
|
+
import_typescript26.default.factory.createExpressionStatement(
|
|
253676
|
+
import_typescript26.default.factory.createBinaryExpression(
|
|
253677
|
+
import_typescript26.default.factory.createPropertyAccessExpression(
|
|
253678
|
+
import_typescript26.default.factory.createThis(),
|
|
253521
253679
|
// use the name set on the {@link d.ComponentCompilerMeta}
|
|
253522
|
-
|
|
253680
|
+
import_typescript26.default.factory.createIdentifier(cmp.attachInternalsMemberName)
|
|
253523
253681
|
),
|
|
253524
|
-
|
|
253525
|
-
|
|
253526
|
-
|
|
253527
|
-
|
|
253528
|
-
|
|
253682
|
+
import_typescript26.default.factory.createToken(import_typescript26.default.SyntaxKind.EqualsToken),
|
|
253683
|
+
import_typescript26.default.factory.createCallExpression(
|
|
253684
|
+
import_typescript26.default.factory.createPropertyAccessExpression(
|
|
253685
|
+
import_typescript26.default.factory.createThis(),
|
|
253686
|
+
import_typescript26.default.factory.createIdentifier("attachInternals")
|
|
253529
253687
|
),
|
|
253530
253688
|
void 0,
|
|
253531
253689
|
[]
|
|
@@ -253543,12 +253701,15 @@ var updateNativeConstructor = (classMembers, moduleFile, cmp, classNode) => {
|
|
|
253543
253701
|
if (cmp.isPlain) {
|
|
253544
253702
|
return;
|
|
253545
253703
|
}
|
|
253704
|
+
const cstrMethodArgs = [
|
|
253705
|
+
import_typescript27.default.factory.createParameterDeclaration(void 0, void 0, import_typescript27.default.factory.createIdentifier("registerHost"))
|
|
253706
|
+
];
|
|
253546
253707
|
const nativeCstrStatements = [
|
|
253547
253708
|
...nativeInit(cmp),
|
|
253548
253709
|
...addCreateEvents(moduleFile, cmp),
|
|
253549
253710
|
...createNativeAttachInternalsBinding(cmp)
|
|
253550
253711
|
];
|
|
253551
|
-
updateConstructor(classNode, classMembers, nativeCstrStatements);
|
|
253712
|
+
updateConstructor(classNode, classMembers, nativeCstrStatements, cstrMethodArgs, cmp.doesExtend);
|
|
253552
253713
|
};
|
|
253553
253714
|
var nativeInit = (cmp) => {
|
|
253554
253715
|
const initStatements = [nativeRegisterHostStatement()];
|
|
@@ -253558,18 +253719,30 @@ var nativeInit = (cmp) => {
|
|
|
253558
253719
|
return initStatements;
|
|
253559
253720
|
};
|
|
253560
253721
|
var nativeRegisterHostStatement = () => {
|
|
253561
|
-
return
|
|
253562
|
-
|
|
253563
|
-
|
|
253564
|
-
|
|
253565
|
-
|
|
253566
|
-
)
|
|
253722
|
+
return import_typescript27.default.factory.createIfStatement(
|
|
253723
|
+
import_typescript27.default.factory.createBinaryExpression(
|
|
253724
|
+
import_typescript27.default.factory.createIdentifier("registerHost"),
|
|
253725
|
+
import_typescript27.default.SyntaxKind.ExclamationEqualsEqualsToken,
|
|
253726
|
+
import_typescript27.default.factory.createFalse()
|
|
253727
|
+
),
|
|
253728
|
+
import_typescript27.default.factory.createBlock([
|
|
253729
|
+
import_typescript27.default.factory.createExpressionStatement(
|
|
253730
|
+
import_typescript27.default.factory.createCallExpression(
|
|
253731
|
+
import_typescript27.default.factory.createPropertyAccessExpression(
|
|
253732
|
+
import_typescript27.default.factory.createThis(),
|
|
253733
|
+
import_typescript27.default.factory.createIdentifier("__registerHost")
|
|
253734
|
+
),
|
|
253735
|
+
void 0,
|
|
253736
|
+
void 0
|
|
253737
|
+
)
|
|
253738
|
+
)
|
|
253739
|
+
])
|
|
253567
253740
|
);
|
|
253568
253741
|
};
|
|
253569
253742
|
var nativeAttachShadowStatement = () => {
|
|
253570
|
-
return
|
|
253571
|
-
|
|
253572
|
-
|
|
253743
|
+
return import_typescript27.default.factory.createExpressionStatement(
|
|
253744
|
+
import_typescript27.default.factory.createCallExpression(
|
|
253745
|
+
import_typescript27.default.factory.createPropertyAccessExpression(import_typescript27.default.factory.createThis(), import_typescript27.default.factory.createIdentifier("__attachShadow")),
|
|
253573
253746
|
void 0,
|
|
253574
253747
|
void 0
|
|
253575
253748
|
)
|
|
@@ -253577,21 +253750,21 @@ var nativeAttachShadowStatement = () => {
|
|
|
253577
253750
|
};
|
|
253578
253751
|
|
|
253579
253752
|
// src/compiler/transformers/component-native/native-element-getter.ts
|
|
253580
|
-
var
|
|
253753
|
+
var import_typescript28 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
253581
253754
|
var addNativeElementGetter = (classMembers, cmp) => {
|
|
253582
253755
|
if (cmp.elementRef) {
|
|
253583
|
-
const getter =
|
|
253756
|
+
const getter = import_typescript28.default.factory.createGetAccessorDeclaration(
|
|
253584
253757
|
void 0,
|
|
253585
253758
|
cmp.elementRef,
|
|
253586
253759
|
[],
|
|
253587
253760
|
void 0,
|
|
253588
|
-
|
|
253761
|
+
import_typescript28.default.factory.createBlock([import_typescript28.default.factory.createReturnStatement(import_typescript28.default.factory.createThis())])
|
|
253589
253762
|
);
|
|
253590
|
-
|
|
253763
|
+
import_typescript28.default.SyntaxKind.AmpersandToken;
|
|
253591
253764
|
const index2 = classMembers.findIndex(
|
|
253592
253765
|
(member2) => {
|
|
253593
253766
|
var _a2;
|
|
253594
|
-
return member2.kind ===
|
|
253767
|
+
return member2.kind === import_typescript28.default.SyntaxKind.PropertyDeclaration && ((_a2 = member2.name) == null ? void 0 : _a2.escapedText) === cmp.elementRef;
|
|
253595
253768
|
}
|
|
253596
253769
|
);
|
|
253597
253770
|
if (index2 >= 0) {
|
|
@@ -253608,10 +253781,10 @@ var addNativeComponentMeta = (classMembers, cmp) => {
|
|
|
253608
253781
|
};
|
|
253609
253782
|
|
|
253610
253783
|
// src/compiler/transformers/component-native/native-static-style.ts
|
|
253611
|
-
var
|
|
253784
|
+
var import_typescript30 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
253612
253785
|
|
|
253613
253786
|
// src/compiler/transformers/add-static-style.ts
|
|
253614
|
-
var
|
|
253787
|
+
var import_typescript29 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
253615
253788
|
var addStaticStyleGetterWithinClass = (classMembers, cmp) => {
|
|
253616
253789
|
const styleLiteral = getStyleLiteral(cmp);
|
|
253617
253790
|
if (styleLiteral) {
|
|
@@ -253621,9 +253794,9 @@ var addStaticStyleGetterWithinClass = (classMembers, cmp) => {
|
|
|
253621
253794
|
var addStaticStylePropertyToClass = (styleStatements, cmp) => {
|
|
253622
253795
|
const styleLiteral = getStyleLiteral(cmp);
|
|
253623
253796
|
if (styleLiteral) {
|
|
253624
|
-
const statement =
|
|
253625
|
-
|
|
253626
|
-
|
|
253797
|
+
const statement = import_typescript29.default.factory.createExpressionStatement(
|
|
253798
|
+
import_typescript29.default.factory.createAssignment(
|
|
253799
|
+
import_typescript29.default.factory.createPropertyAccessExpression(import_typescript29.default.factory.createIdentifier(cmp.componentClassName), "style"),
|
|
253627
253800
|
styleLiteral
|
|
253628
253801
|
)
|
|
253629
253802
|
);
|
|
@@ -253645,19 +253818,19 @@ var getMultipleModeStyle = (cmp, styles2) => {
|
|
|
253645
253818
|
styles2.forEach((style) => {
|
|
253646
253819
|
if (typeof style.styleStr === "string") {
|
|
253647
253820
|
const styleLiteral = createStyleLiteral(cmp, style);
|
|
253648
|
-
const propStr =
|
|
253821
|
+
const propStr = import_typescript29.default.factory.createPropertyAssignment(style.modeName, styleLiteral);
|
|
253649
253822
|
styleModes.push(propStr);
|
|
253650
253823
|
} else if (Array.isArray(style.externalStyles) && style.externalStyles.length > 0) {
|
|
253651
253824
|
const styleUrlIdentifier = createStyleIdentifier(cmp, style);
|
|
253652
|
-
const propUrlIdentifier =
|
|
253825
|
+
const propUrlIdentifier = import_typescript29.default.factory.createPropertyAssignment(style.modeName, styleUrlIdentifier);
|
|
253653
253826
|
styleModes.push(propUrlIdentifier);
|
|
253654
253827
|
} else if (typeof style.styleIdentifier === "string") {
|
|
253655
|
-
const styleIdentifier =
|
|
253656
|
-
const propIdentifier =
|
|
253828
|
+
const styleIdentifier = import_typescript29.default.factory.createIdentifier(style.styleIdentifier);
|
|
253829
|
+
const propIdentifier = import_typescript29.default.factory.createPropertyAssignment(style.modeName, styleIdentifier);
|
|
253657
253830
|
styleModes.push(propIdentifier);
|
|
253658
253831
|
}
|
|
253659
253832
|
});
|
|
253660
|
-
return
|
|
253833
|
+
return import_typescript29.default.factory.createObjectLiteralExpression(styleModes, true);
|
|
253661
253834
|
};
|
|
253662
253835
|
var getSingleStyle = (cmp, style) => {
|
|
253663
253836
|
if (typeof style.styleStr === "string") {
|
|
@@ -253667,16 +253840,16 @@ var getSingleStyle = (cmp, style) => {
|
|
|
253667
253840
|
return createStyleIdentifier(cmp, style);
|
|
253668
253841
|
}
|
|
253669
253842
|
if (typeof style.styleIdentifier === "string") {
|
|
253670
|
-
return
|
|
253843
|
+
return import_typescript29.default.factory.createIdentifier(style.styleIdentifier);
|
|
253671
253844
|
}
|
|
253672
253845
|
return null;
|
|
253673
253846
|
};
|
|
253674
253847
|
var createStyleLiteral = (cmp, style) => {
|
|
253675
253848
|
if (cmp.encapsulation === "scoped") {
|
|
253676
253849
|
const scopeId = getScopeId2(cmp.tagName, style.modeName);
|
|
253677
|
-
return
|
|
253850
|
+
return import_typescript29.default.factory.createStringLiteral(scopeCss(style.styleStr, scopeId, false));
|
|
253678
253851
|
}
|
|
253679
|
-
return
|
|
253852
|
+
return import_typescript29.default.factory.createStringLiteral(style.styleStr);
|
|
253680
253853
|
};
|
|
253681
253854
|
var createStyleIdentifier = (cmp, style) => {
|
|
253682
253855
|
const externalStyles = getExternalStyles(style);
|
|
@@ -253690,11 +253863,11 @@ var createStyleIdentifier = (cmp, style) => {
|
|
|
253690
253863
|
var createIdentifierFromStyleIdentifier = (styleIdentifier, externalStyleIds) => {
|
|
253691
253864
|
const id = externalStyleIds[0];
|
|
253692
253865
|
if (externalStyleIds.length === 1) {
|
|
253693
|
-
return
|
|
253866
|
+
return import_typescript29.default.factory.createIdentifier(styleIdentifier + id);
|
|
253694
253867
|
}
|
|
253695
|
-
return
|
|
253868
|
+
return import_typescript29.default.factory.createBinaryExpression(
|
|
253696
253869
|
createIdentifierFromStyleIdentifier(styleIdentifier, [id]),
|
|
253697
|
-
|
|
253870
|
+
import_typescript29.default.SyntaxKind.PlusToken,
|
|
253698
253871
|
createIdentifierFromStyleIdentifier(styleIdentifier, externalStyleIds.slice(1))
|
|
253699
253872
|
);
|
|
253700
253873
|
};
|
|
@@ -253714,19 +253887,19 @@ var addMultipleModeStyleGetter = (classMembers, cmp, styles2) => {
|
|
|
253714
253887
|
styles2.forEach((style) => {
|
|
253715
253888
|
if (typeof style.styleStr === "string") {
|
|
253716
253889
|
const styleLiteral = createStyleLiteral2(cmp, style);
|
|
253717
|
-
const propStr =
|
|
253890
|
+
const propStr = import_typescript30.default.factory.createPropertyAssignment(style.modeName, styleLiteral);
|
|
253718
253891
|
styleModes.push(propStr);
|
|
253719
253892
|
} else if (Array.isArray(style.externalStyles) && style.externalStyles.length > 0) {
|
|
253720
253893
|
const styleUrlIdentifier = createStyleIdentifier(cmp, style);
|
|
253721
|
-
const propUrlIdentifier =
|
|
253894
|
+
const propUrlIdentifier = import_typescript30.default.factory.createPropertyAssignment(style.modeName, styleUrlIdentifier);
|
|
253722
253895
|
styleModes.push(propUrlIdentifier);
|
|
253723
253896
|
} else if (typeof style.styleIdentifier === "string") {
|
|
253724
|
-
const styleIdentifier =
|
|
253725
|
-
const propIdentifier =
|
|
253897
|
+
const styleIdentifier = import_typescript30.default.factory.createIdentifier(style.styleIdentifier);
|
|
253898
|
+
const propIdentifier = import_typescript30.default.factory.createPropertyAssignment(style.modeName, styleIdentifier);
|
|
253726
253899
|
styleModes.push(propIdentifier);
|
|
253727
253900
|
}
|
|
253728
253901
|
});
|
|
253729
|
-
const styleObj =
|
|
253902
|
+
const styleObj = import_typescript30.default.factory.createObjectLiteralExpression(styleModes, true);
|
|
253730
253903
|
classMembers.push(createStaticGetter("style", styleObj));
|
|
253731
253904
|
};
|
|
253732
253905
|
var addSingleStyleGetter = (classMembers, cmp, style) => {
|
|
@@ -253737,16 +253910,16 @@ var addSingleStyleGetter = (classMembers, cmp, style) => {
|
|
|
253737
253910
|
const styleUrlIdentifier = createStyleIdentifier(cmp, style);
|
|
253738
253911
|
classMembers.push(createStaticGetter("style", styleUrlIdentifier));
|
|
253739
253912
|
} else if (typeof style.styleIdentifier === "string") {
|
|
253740
|
-
const styleIdentifier =
|
|
253913
|
+
const styleIdentifier = import_typescript30.default.factory.createIdentifier(style.styleIdentifier);
|
|
253741
253914
|
classMembers.push(createStaticGetter("style", styleIdentifier));
|
|
253742
253915
|
}
|
|
253743
253916
|
};
|
|
253744
253917
|
var createStyleLiteral2 = (cmp, style) => {
|
|
253745
253918
|
if (cmp.encapsulation === "scoped") {
|
|
253746
253919
|
const scopeId = getScopeId2(cmp.tagName, style.modeName);
|
|
253747
|
-
return
|
|
253920
|
+
return import_typescript30.default.factory.createStringLiteral(scopeCss(style.styleStr, scopeId, false));
|
|
253748
253921
|
}
|
|
253749
|
-
return
|
|
253922
|
+
return import_typescript30.default.factory.createStringLiteral(style.styleStr);
|
|
253750
253923
|
};
|
|
253751
253924
|
|
|
253752
253925
|
// src/compiler/transformers/component-native/native-component.ts
|
|
@@ -253755,17 +253928,37 @@ var updateNativeComponentClass = (transformOpts, classNode, moduleFile, cmp) =>
|
|
|
253755
253928
|
const members = updateNativeHostComponentMembers(transformOpts, withHeritageClauses, moduleFile, cmp);
|
|
253756
253929
|
return updateComponentClass(transformOpts, withHeritageClauses, withHeritageClauses.heritageClauses, members);
|
|
253757
253930
|
};
|
|
253931
|
+
var updateNativeExtendedClass = (node, moduleFile, transformOpts) => {
|
|
253932
|
+
var _a2, _b;
|
|
253933
|
+
let withHeritageClauses = updateNativeHostComponentHeritageClauses(node, moduleFile);
|
|
253934
|
+
const ctor = withHeritageClauses.members.find(import_typescript31.default.isConstructorDeclaration);
|
|
253935
|
+
if (!foundSuper((_a2 = ctor == null ? void 0 : ctor.body) == null ? void 0 : _a2.statements)) {
|
|
253936
|
+
const params = Array.from((_b = ctor == null ? void 0 : ctor.parameters) != null ? _b : []);
|
|
253937
|
+
withHeritageClauses = import_typescript31.default.factory.updateClassDeclaration(
|
|
253938
|
+
withHeritageClauses,
|
|
253939
|
+
withHeritageClauses.modifiers,
|
|
253940
|
+
withHeritageClauses.name,
|
|
253941
|
+
withHeritageClauses.typeParameters,
|
|
253942
|
+
withHeritageClauses.heritageClauses,
|
|
253943
|
+
updateConstructor(withHeritageClauses, Array.from(withHeritageClauses.members), [], params, true)
|
|
253944
|
+
);
|
|
253945
|
+
}
|
|
253946
|
+
return updateComponentClass(
|
|
253947
|
+
transformOpts,
|
|
253948
|
+
withHeritageClauses,
|
|
253949
|
+
withHeritageClauses.heritageClauses,
|
|
253950
|
+
removeStaticMetaProperties(withHeritageClauses)
|
|
253951
|
+
);
|
|
253952
|
+
};
|
|
253758
253953
|
var updateNativeHostComponentHeritageClauses = (classNode, moduleFile) => {
|
|
253759
253954
|
if (classNode.heritageClauses != null && classNode.heritageClauses.length > 0) {
|
|
253760
253955
|
return classNode;
|
|
253761
253956
|
}
|
|
253762
|
-
|
|
253763
|
-
|
|
253764
|
-
|
|
253765
|
-
const heritageClause = import_typescript29.default.factory.createHeritageClause(import_typescript29.default.SyntaxKind.ExtendsKeyword, [
|
|
253766
|
-
import_typescript29.default.factory.createExpressionWithTypeArguments(import_typescript29.default.factory.createIdentifier(HTML_ELEMENT), [])
|
|
253957
|
+
addOutputTargetCoreRuntimeApi(moduleFile, DIST_CUSTOM_ELEMENTS, RUNTIME_APIS.HTMLElement);
|
|
253958
|
+
const heritageClause = import_typescript31.default.factory.createHeritageClause(import_typescript31.default.SyntaxKind.ExtendsKeyword, [
|
|
253959
|
+
import_typescript31.default.factory.createExpressionWithTypeArguments(import_typescript31.default.factory.createIdentifier(HTML_ELEMENT), [])
|
|
253767
253960
|
]);
|
|
253768
|
-
return
|
|
253961
|
+
return import_typescript31.default.factory.updateClassDeclaration(
|
|
253769
253962
|
classNode,
|
|
253770
253963
|
classNode.modifiers,
|
|
253771
253964
|
classNode.name,
|
|
@@ -253797,15 +253990,18 @@ var nativeComponentTransform = (compilerCtx, transformOpts) => {
|
|
|
253797
253990
|
var _a2, _b;
|
|
253798
253991
|
const moduleFile = getModuleFromSourceFile(compilerCtx, tsSourceFile);
|
|
253799
253992
|
const visitNode = (node) => {
|
|
253800
|
-
|
|
253993
|
+
var _a3;
|
|
253994
|
+
if (import_typescript32.default.isClassDeclaration(node)) {
|
|
253801
253995
|
const cmp = getComponentMeta(compilerCtx, tsSourceFile, node);
|
|
253802
253996
|
if (cmp != null) {
|
|
253803
253997
|
return updateNativeComponentClass(transformOpts, node, moduleFile, cmp);
|
|
253998
|
+
} else if ((_a3 = compilerCtx.moduleMap.get(tsSourceFile.fileName)) == null ? void 0 : _a3.isExtended) {
|
|
253999
|
+
return updateNativeExtendedClass(node, moduleFile, transformOpts);
|
|
253804
254000
|
}
|
|
253805
254001
|
}
|
|
253806
|
-
return
|
|
254002
|
+
return import_typescript32.default.visitEachChild(node, visitNode, transformCtx);
|
|
253807
254003
|
};
|
|
253808
|
-
tsSourceFile =
|
|
254004
|
+
tsSourceFile = import_typescript32.default.visitEachChild(tsSourceFile, visitNode, transformCtx);
|
|
253809
254005
|
if (moduleFile.cmps.length > 0) {
|
|
253810
254006
|
if (transformOpts.componentExport === "customelement") {
|
|
253811
254007
|
tsSourceFile = defineCustomElement2(tsSourceFile, moduleFile, transformOpts);
|
|
@@ -253829,23 +254025,23 @@ var nativeComponentTransform = (compilerCtx, transformOpts) => {
|
|
|
253829
254025
|
|
|
253830
254026
|
// src/compiler/transformers/rewrite-aliased-paths.ts
|
|
253831
254027
|
var import_path25 = require("path");
|
|
253832
|
-
var
|
|
254028
|
+
var import_typescript33 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
253833
254029
|
function rewriteAliasedDTSImportPaths(transformCtx) {
|
|
253834
|
-
const compilerHost =
|
|
254030
|
+
const compilerHost = import_typescript33.default.createCompilerHost(transformCtx.getCompilerOptions());
|
|
253835
254031
|
return (tsBundleOrSourceFile) => {
|
|
253836
|
-
const fileName =
|
|
253837
|
-
return
|
|
254032
|
+
const fileName = import_typescript33.default.isBundle(tsBundleOrSourceFile) ? tsBundleOrSourceFile.getSourceFile().fileName : tsBundleOrSourceFile.fileName;
|
|
254033
|
+
return import_typescript33.default.visitEachChild(tsBundleOrSourceFile, visit(compilerHost, transformCtx, fileName), transformCtx);
|
|
253838
254034
|
};
|
|
253839
254035
|
}
|
|
253840
254036
|
function rewriteAliasedSourceFileImportPaths(transformCtx) {
|
|
253841
|
-
const compilerHost =
|
|
254037
|
+
const compilerHost = import_typescript33.default.createCompilerHost(transformCtx.getCompilerOptions());
|
|
253842
254038
|
return (tsSourceFile) => {
|
|
253843
|
-
return
|
|
254039
|
+
return import_typescript33.default.visitEachChild(tsSourceFile, visit(compilerHost, transformCtx, tsSourceFile.fileName), transformCtx);
|
|
253844
254040
|
};
|
|
253845
254041
|
}
|
|
253846
254042
|
function visit(compilerHost, transformCtx, sourceFilePath) {
|
|
253847
254043
|
return (node) => {
|
|
253848
|
-
if (!
|
|
254044
|
+
if (!import_typescript33.default.isImportDeclaration(node)) {
|
|
253849
254045
|
return node;
|
|
253850
254046
|
}
|
|
253851
254047
|
return rewriteAliasedImport(compilerHost, transformCtx, sourceFilePath, node);
|
|
@@ -253853,14 +254049,14 @@ function visit(compilerHost, transformCtx, sourceFilePath) {
|
|
|
253853
254049
|
}
|
|
253854
254050
|
function rewriteAliasedImport(compilerHost, transformCtx, sourceFilePath, node) {
|
|
253855
254051
|
var _a2, _b;
|
|
253856
|
-
if (!
|
|
254052
|
+
if (!import_typescript33.default.isStringLiteral(node.moduleSpecifier)) {
|
|
253857
254053
|
return node;
|
|
253858
254054
|
}
|
|
253859
254055
|
let importPath = node.moduleSpecifier.text;
|
|
253860
254056
|
if (importPath.startsWith(".")) {
|
|
253861
254057
|
return node;
|
|
253862
254058
|
}
|
|
253863
|
-
const module2 =
|
|
254059
|
+
const module2 = import_typescript33.default.resolveModuleName(importPath, sourceFilePath, transformCtx.getCompilerOptions(), compilerHost);
|
|
253864
254060
|
const hasResolvedFileName = ((_a2 = module2.resolvedModule) == null ? void 0 : _a2.resolvedFileName) != null;
|
|
253865
254061
|
const isModuleFromNodeModules = ((_b = module2.resolvedModule) == null ? void 0 : _b.isExternalLibraryImport) === true;
|
|
253866
254062
|
const shouldTranspileImportPath = hasResolvedFileName && !isModuleFromNodeModules;
|
|
@@ -253868,7 +254064,7 @@ function rewriteAliasedImport(compilerHost, transformCtx, sourceFilePath, node)
|
|
|
253868
254064
|
return node;
|
|
253869
254065
|
}
|
|
253870
254066
|
const extensionRegex = new RegExp(
|
|
253871
|
-
Object.values(
|
|
254067
|
+
Object.values(import_typescript33.default.Extension).map((extension) => `${extension}$`.replace(".", "\\.")).join("|")
|
|
253872
254068
|
);
|
|
253873
254069
|
const resolvePathInDestination = module2.resolvedModule.resolvedFileName;
|
|
253874
254070
|
importPath = normalizePath(relative((0, import_path25.dirname)(sourceFilePath), resolvePathInDestination).replace(extensionRegex, ""));
|
|
@@ -253916,7 +254112,7 @@ function rewriteAliasedImport(compilerHost, transformCtx, sourceFilePath, node)
|
|
|
253916
254112
|
}
|
|
253917
254113
|
|
|
253918
254114
|
// src/compiler/transformers/update-stencil-core-import.ts
|
|
253919
|
-
var
|
|
254115
|
+
var import_typescript34 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
253920
254116
|
var updateStencilCoreImports = (updatedCoreImportPath) => {
|
|
253921
254117
|
return () => {
|
|
253922
254118
|
return (tsSourceFile) => {
|
|
@@ -253926,26 +254122,26 @@ var updateStencilCoreImports = (updatedCoreImportPath) => {
|
|
|
253926
254122
|
let madeChanges = false;
|
|
253927
254123
|
const newStatements = [];
|
|
253928
254124
|
tsSourceFile.statements.forEach((s) => {
|
|
253929
|
-
if (
|
|
253930
|
-
if (s.moduleSpecifier != null &&
|
|
254125
|
+
if (import_typescript34.default.isImportDeclaration(s)) {
|
|
254126
|
+
if (s.moduleSpecifier != null && import_typescript34.default.isStringLiteral(s.moduleSpecifier)) {
|
|
253931
254127
|
if (s.moduleSpecifier.text === STENCIL_CORE_ID) {
|
|
253932
|
-
if (s.importClause && s.importClause.namedBindings && s.importClause.namedBindings.kind ===
|
|
254128
|
+
if (s.importClause && s.importClause.namedBindings && s.importClause.namedBindings.kind === import_typescript34.default.SyntaxKind.NamedImports) {
|
|
253933
254129
|
const origImports = s.importClause.namedBindings.elements;
|
|
253934
254130
|
const keepImports = origImports.map((e) => e.getText()).filter((name) => KEEP_IMPORTS.has(name));
|
|
253935
254131
|
if (keepImports.length > 0) {
|
|
253936
|
-
const newImport =
|
|
254132
|
+
const newImport = import_typescript34.default.factory.updateImportDeclaration(
|
|
253937
254133
|
s,
|
|
253938
254134
|
void 0,
|
|
253939
|
-
|
|
254135
|
+
import_typescript34.default.factory.createImportClause(
|
|
253940
254136
|
false,
|
|
253941
254137
|
void 0,
|
|
253942
|
-
|
|
254138
|
+
import_typescript34.default.factory.createNamedImports(
|
|
253943
254139
|
keepImports.map(
|
|
253944
|
-
(name) =>
|
|
254140
|
+
(name) => import_typescript34.default.factory.createImportSpecifier(false, void 0, import_typescript34.default.factory.createIdentifier(name))
|
|
253945
254141
|
)
|
|
253946
254142
|
)
|
|
253947
254143
|
),
|
|
253948
|
-
|
|
254144
|
+
import_typescript34.default.factory.createStringLiteral(updatedCoreImportPath),
|
|
253949
254145
|
void 0
|
|
253950
254146
|
);
|
|
253951
254147
|
newStatements.push(newImport);
|
|
@@ -253959,7 +254155,7 @@ var updateStencilCoreImports = (updatedCoreImportPath) => {
|
|
|
253959
254155
|
newStatements.push(s);
|
|
253960
254156
|
});
|
|
253961
254157
|
if (madeChanges) {
|
|
253962
|
-
return
|
|
254158
|
+
return import_typescript34.default.factory.updateSourceFile(
|
|
253963
254159
|
tsSourceFile,
|
|
253964
254160
|
newStatements,
|
|
253965
254161
|
tsSourceFile.isDeclarationFile,
|
|
@@ -254330,133 +254526,6 @@ var import_typescript37 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
|
254330
254526
|
// src/compiler/transformers/component-hydrate/hydrate-component.ts
|
|
254331
254527
|
var import_typescript36 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
254332
254528
|
|
|
254333
|
-
// src/compiler/transformers/component-lazy/lazy-constructor.ts
|
|
254334
|
-
var import_typescript34 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
254335
|
-
|
|
254336
|
-
// src/compiler/transformers/component-lazy/attach-internals.ts
|
|
254337
|
-
var import_typescript33 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
254338
|
-
|
|
254339
|
-
// src/compiler/transformers/component-lazy/constants.ts
|
|
254340
|
-
var HOST_REF_ARG = "hostRef";
|
|
254341
|
-
|
|
254342
|
-
// src/compiler/transformers/component-lazy/attach-internals.ts
|
|
254343
|
-
function createLazyAttachInternalsBinding(cmp) {
|
|
254344
|
-
if (cmp.attachInternalsMemberName) {
|
|
254345
|
-
return [
|
|
254346
|
-
import_typescript33.default.factory.createIfStatement(
|
|
254347
|
-
// the condition for the `if` statement here is just whether the
|
|
254348
|
-
// following is defined:
|
|
254349
|
-
//
|
|
254350
|
-
// ```ts
|
|
254351
|
-
// hostRef.$hostElement$["s-ei"]
|
|
254352
|
-
// ```
|
|
254353
|
-
hostRefElementInternalsPropAccess(),
|
|
254354
|
-
import_typescript33.default.factory.createBlock(
|
|
254355
|
-
[
|
|
254356
|
-
// this `ts.factory` call creates the following statement:
|
|
254357
|
-
//
|
|
254358
|
-
// ```ts
|
|
254359
|
-
// this.${ cmp.formInternalsMemberName } = hostRef.$hostElement$['s-ei'];
|
|
254360
|
-
// ```
|
|
254361
|
-
import_typescript33.default.factory.createExpressionStatement(
|
|
254362
|
-
import_typescript33.default.factory.createBinaryExpression(
|
|
254363
|
-
import_typescript33.default.factory.createPropertyAccessExpression(
|
|
254364
|
-
import_typescript33.default.factory.createThis(),
|
|
254365
|
-
// use the name set on the {@link d.ComponentCompilerMeta}
|
|
254366
|
-
import_typescript33.default.factory.createIdentifier(cmp.attachInternalsMemberName)
|
|
254367
|
-
),
|
|
254368
|
-
import_typescript33.default.factory.createToken(import_typescript33.default.SyntaxKind.EqualsToken),
|
|
254369
|
-
hostRefElementInternalsPropAccess()
|
|
254370
|
-
)
|
|
254371
|
-
)
|
|
254372
|
-
],
|
|
254373
|
-
true
|
|
254374
|
-
),
|
|
254375
|
-
import_typescript33.default.factory.createBlock(
|
|
254376
|
-
[
|
|
254377
|
-
// this `ts.factory` call creates the following statement:
|
|
254378
|
-
//
|
|
254379
|
-
// ```ts
|
|
254380
|
-
// this.${ cmp.attachInternalsMemberName } = hostRef.$hostElement$.attachInternals();
|
|
254381
|
-
// ```
|
|
254382
|
-
import_typescript33.default.factory.createExpressionStatement(
|
|
254383
|
-
import_typescript33.default.factory.createBinaryExpression(
|
|
254384
|
-
import_typescript33.default.factory.createPropertyAccessExpression(
|
|
254385
|
-
import_typescript33.default.factory.createThis(),
|
|
254386
|
-
// use the name set on the {@link d.ComponentCompilerMeta}
|
|
254387
|
-
import_typescript33.default.factory.createIdentifier(cmp.attachInternalsMemberName)
|
|
254388
|
-
),
|
|
254389
|
-
import_typescript33.default.factory.createToken(import_typescript33.default.SyntaxKind.EqualsToken),
|
|
254390
|
-
import_typescript33.default.factory.createCallExpression(
|
|
254391
|
-
import_typescript33.default.factory.createPropertyAccessExpression(
|
|
254392
|
-
import_typescript33.default.factory.createPropertyAccessExpression(
|
|
254393
|
-
import_typescript33.default.factory.createIdentifier(HOST_REF_ARG),
|
|
254394
|
-
import_typescript33.default.factory.createIdentifier("$hostElement$")
|
|
254395
|
-
),
|
|
254396
|
-
import_typescript33.default.factory.createIdentifier("attachInternals")
|
|
254397
|
-
),
|
|
254398
|
-
void 0,
|
|
254399
|
-
[]
|
|
254400
|
-
)
|
|
254401
|
-
)
|
|
254402
|
-
),
|
|
254403
|
-
// this `ts.factory` call produces the following:
|
|
254404
|
-
//
|
|
254405
|
-
// ```ts
|
|
254406
|
-
// hostRef.$hostElement$['s-ei'] = this.${ cmp.attachInternalsMemberName };
|
|
254407
|
-
// ```
|
|
254408
|
-
import_typescript33.default.factory.createExpressionStatement(
|
|
254409
|
-
import_typescript33.default.factory.createBinaryExpression(
|
|
254410
|
-
hostRefElementInternalsPropAccess(),
|
|
254411
|
-
import_typescript33.default.factory.createToken(import_typescript33.default.SyntaxKind.EqualsToken),
|
|
254412
|
-
import_typescript33.default.factory.createPropertyAccessExpression(
|
|
254413
|
-
import_typescript33.default.factory.createThis(),
|
|
254414
|
-
// use the name set on the {@link d.ComponentCompilerMeta}
|
|
254415
|
-
import_typescript33.default.factory.createIdentifier(cmp.attachInternalsMemberName)
|
|
254416
|
-
)
|
|
254417
|
-
)
|
|
254418
|
-
)
|
|
254419
|
-
],
|
|
254420
|
-
true
|
|
254421
|
-
)
|
|
254422
|
-
)
|
|
254423
|
-
];
|
|
254424
|
-
} else {
|
|
254425
|
-
return [];
|
|
254426
|
-
}
|
|
254427
|
-
}
|
|
254428
|
-
function hostRefElementInternalsPropAccess() {
|
|
254429
|
-
return import_typescript33.default.factory.createElementAccessExpression(
|
|
254430
|
-
import_typescript33.default.factory.createPropertyAccessExpression(
|
|
254431
|
-
import_typescript33.default.factory.createIdentifier(HOST_REF_ARG),
|
|
254432
|
-
import_typescript33.default.factory.createIdentifier("$hostElement$")
|
|
254433
|
-
),
|
|
254434
|
-
import_typescript33.default.factory.createStringLiteral("s-ei")
|
|
254435
|
-
);
|
|
254436
|
-
}
|
|
254437
|
-
|
|
254438
|
-
// src/compiler/transformers/component-lazy/lazy-constructor.ts
|
|
254439
|
-
var updateLazyComponentConstructor = (classMembers, classNode, moduleFile, cmp) => {
|
|
254440
|
-
const cstrMethodArgs = [
|
|
254441
|
-
import_typescript34.default.factory.createParameterDeclaration(void 0, void 0, import_typescript34.default.factory.createIdentifier(HOST_REF_ARG))
|
|
254442
|
-
];
|
|
254443
|
-
const cstrStatements = [
|
|
254444
|
-
registerInstanceStatement(moduleFile),
|
|
254445
|
-
...addCreateEvents(moduleFile, cmp),
|
|
254446
|
-
...createLazyAttachInternalsBinding(cmp)
|
|
254447
|
-
];
|
|
254448
|
-
updateConstructor(classNode, classMembers, cstrStatements, cstrMethodArgs);
|
|
254449
|
-
};
|
|
254450
|
-
var registerInstanceStatement = (moduleFile) => {
|
|
254451
|
-
addCoreRuntimeApi(moduleFile, RUNTIME_APIS.registerInstance);
|
|
254452
|
-
return import_typescript34.default.factory.createExpressionStatement(
|
|
254453
|
-
import_typescript34.default.factory.createCallExpression(import_typescript34.default.factory.createIdentifier(REGISTER_INSTANCE), void 0, [
|
|
254454
|
-
import_typescript34.default.factory.createThis(),
|
|
254455
|
-
import_typescript34.default.factory.createIdentifier(HOST_REF_ARG)
|
|
254456
|
-
])
|
|
254457
|
-
);
|
|
254458
|
-
};
|
|
254459
|
-
|
|
254460
254529
|
// src/compiler/transformers/component-lazy/lazy-element-getter.ts
|
|
254461
254530
|
var import_typescript35 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
254462
254531
|
var addLazyElementGetter = (classMembers, moduleFile, cmp) => {
|
|
@@ -254546,10 +254615,13 @@ var hydrateComponentTransform = (compilerCtx, transformOpts) => {
|
|
|
254546
254615
|
return (tsSourceFile) => {
|
|
254547
254616
|
const moduleFile = getModuleFromSourceFile(compilerCtx, tsSourceFile);
|
|
254548
254617
|
const visitNode = (node) => {
|
|
254618
|
+
var _a2;
|
|
254549
254619
|
if (import_typescript37.default.isClassDeclaration(node)) {
|
|
254550
254620
|
const cmp = getComponentMeta(compilerCtx, tsSourceFile, node);
|
|
254551
254621
|
if (cmp != null) {
|
|
254552
254622
|
return updateHydrateComponentClass(node, moduleFile, cmp);
|
|
254623
|
+
} else if ((_a2 = compilerCtx.moduleMap.get(tsSourceFile.fileName)) == null ? void 0 : _a2.isMixin) {
|
|
254624
|
+
return updateMixin(node, moduleFile, cmp, transformOpts);
|
|
254553
254625
|
}
|
|
254554
254626
|
}
|
|
254555
254627
|
return import_typescript37.default.visitEachChild(node, visitNode, transformCtx);
|
|
@@ -255216,8 +255288,11 @@ var lazyComponentTransform = (compilerCtx, transformOpts) => {
|
|
|
255216
255288
|
const visitNode = (node) => {
|
|
255217
255289
|
if (import_typescript38.default.isClassDeclaration(node)) {
|
|
255218
255290
|
const cmp = getComponentMeta(compilerCtx, tsSourceFile, node);
|
|
255291
|
+
const module2 = compilerCtx.moduleMap.get(tsSourceFile.fileName);
|
|
255219
255292
|
if (cmp != null) {
|
|
255220
255293
|
return updateLazyComponentClass(transformOpts, styleStatements, node, moduleFile, cmp);
|
|
255294
|
+
} else if (module2 == null ? void 0 : module2.isMixin) {
|
|
255295
|
+
return updateMixin(node, moduleFile, cmp, transformOpts);
|
|
255221
255296
|
}
|
|
255222
255297
|
}
|
|
255223
255298
|
return import_typescript38.default.visitEachChild(node, visitNode, transformCtx);
|
|
@@ -255276,9 +255351,9 @@ var generateRollupOutput = async (build2, options, config, entryModules) => {
|
|
|
255276
255351
|
};
|
|
255277
255352
|
|
|
255278
255353
|
// src/compiler/output-targets/dist-lazy/write-lazy-entry-module.ts
|
|
255279
|
-
var writeLazyModule = async (
|
|
255280
|
-
const
|
|
255281
|
-
const
|
|
255354
|
+
var writeLazyModule = async (compilerCtx, outputTargetType, destinations, code, sourceMap, rollupResult) => {
|
|
255355
|
+
const fileName = rollupResult.fileName;
|
|
255356
|
+
const bundleId = fileName.replace(".entry.js", "");
|
|
255282
255357
|
if (sourceMap) {
|
|
255283
255358
|
code = code + getSourceMappingUrlForEndOfFile(fileName);
|
|
255284
255359
|
}
|
|
@@ -255296,21 +255371,9 @@ var writeLazyModule = async (config, compilerCtx, outputTargetType, destinations
|
|
|
255296
255371
|
code
|
|
255297
255372
|
};
|
|
255298
255373
|
};
|
|
255299
|
-
var getBundleId = async (config, entryKey, shouldHash, code, sufix) => {
|
|
255300
|
-
if (shouldHash) {
|
|
255301
|
-
const hash = await config.sys.generateContentHash(code, config.hashedFileNameLength);
|
|
255302
|
-
return `p-${hash}${sufix}`;
|
|
255303
|
-
}
|
|
255304
|
-
const components = entryKey.split(".");
|
|
255305
|
-
let bundleId = components[0];
|
|
255306
|
-
if (components.length > 2) {
|
|
255307
|
-
bundleId = `${bundleId}_${components.length - 1}`;
|
|
255308
|
-
}
|
|
255309
|
-
return bundleId + sufix;
|
|
255310
|
-
};
|
|
255311
255374
|
|
|
255312
255375
|
// src/compiler/output-targets/dist-lazy/generate-lazy-module.ts
|
|
255313
|
-
var generateLazyModules = async (config, compilerCtx, buildCtx, outputTargetType, destinations, results, sourceTarget, isBrowserBuild
|
|
255376
|
+
var generateLazyModules = async (config, compilerCtx, buildCtx, outputTargetType, destinations, results, sourceTarget, isBrowserBuild) => {
|
|
255314
255377
|
if (!Array.isArray(destinations) || destinations.length === 0) {
|
|
255315
255378
|
return [];
|
|
255316
255379
|
}
|
|
@@ -255329,8 +255392,7 @@ var generateLazyModules = async (config, compilerCtx, buildCtx, outputTargetType
|
|
|
255329
255392
|
destinations,
|
|
255330
255393
|
sourceTarget,
|
|
255331
255394
|
shouldMinify,
|
|
255332
|
-
isBrowserBuild
|
|
255333
|
-
sufix
|
|
255395
|
+
isBrowserBuild
|
|
255334
255396
|
);
|
|
255335
255397
|
})
|
|
255336
255398
|
);
|
|
@@ -255419,9 +255481,8 @@ var generateCaseClauseCjs = (bundleId) => {
|
|
|
255419
255481
|
/* webpackMode: "lazy" */
|
|
255420
255482
|
'./${bundleId}.entry.js')); }).then(processMod, consoleError);`;
|
|
255421
255483
|
};
|
|
255422
|
-
var generateLazyEntryModule = async (config, compilerCtx, buildCtx, rollupResult, outputTargetType, destinations, sourceTarget, shouldMinify, isBrowserBuild
|
|
255484
|
+
var generateLazyEntryModule = async (config, compilerCtx, buildCtx, rollupResult, outputTargetType, destinations, sourceTarget, shouldMinify, isBrowserBuild) => {
|
|
255423
255485
|
const entryModule = buildCtx.entryModules.find((entryModule2) => entryModule2.entryKey === rollupResult.entryKey);
|
|
255424
|
-
const shouldHash = config.hashFileNames && isBrowserBuild;
|
|
255425
255486
|
const { code, sourceMap } = await convertChunk(
|
|
255426
255487
|
config,
|
|
255427
255488
|
compilerCtx,
|
|
@@ -255433,17 +255494,7 @@ var generateLazyEntryModule = async (config, compilerCtx, buildCtx, rollupResult
|
|
|
255433
255494
|
rollupResult.code,
|
|
255434
255495
|
rollupResult.map
|
|
255435
255496
|
);
|
|
255436
|
-
const output = await writeLazyModule(
|
|
255437
|
-
config,
|
|
255438
|
-
compilerCtx,
|
|
255439
|
-
outputTargetType,
|
|
255440
|
-
destinations,
|
|
255441
|
-
entryModule,
|
|
255442
|
-
shouldHash,
|
|
255443
|
-
code,
|
|
255444
|
-
sourceMap,
|
|
255445
|
-
sufix
|
|
255446
|
-
);
|
|
255497
|
+
const output = await writeLazyModule(compilerCtx, outputTargetType, destinations, code, sourceMap, rollupResult);
|
|
255447
255498
|
return {
|
|
255448
255499
|
rollupResult,
|
|
255449
255500
|
entryKey: rollupResult.entryKey,
|
|
@@ -255586,6 +255637,54 @@ var convertChunk = async (config, compilerCtx, buildCtx, sourceTarget, shouldMin
|
|
|
255586
255637
|
return { code, sourceMap };
|
|
255587
255638
|
};
|
|
255588
255639
|
|
|
255640
|
+
// src/compiler/output-targets/dist-lazy/lazy-bundleid-plugin.ts
|
|
255641
|
+
var lazyBundleIdPlugin = (buildCtx, config, shouldHash, suffix) => {
|
|
255642
|
+
const getBundleId = async (entryKey, code, suffix2) => {
|
|
255643
|
+
var _a2;
|
|
255644
|
+
if (shouldHash && ((_a2 = config.sys) == null ? void 0 : _a2.generateContentHash)) {
|
|
255645
|
+
const hash = await config.sys.generateContentHash(code, config.hashedFileNameLength);
|
|
255646
|
+
return `p-${hash}${suffix2}`;
|
|
255647
|
+
}
|
|
255648
|
+
const components = entryKey.split(".");
|
|
255649
|
+
let bundleId = components[0];
|
|
255650
|
+
if (components.length > 2) {
|
|
255651
|
+
bundleId = `${bundleId}_${components.length - 1}`;
|
|
255652
|
+
}
|
|
255653
|
+
return bundleId + suffix2;
|
|
255654
|
+
};
|
|
255655
|
+
return {
|
|
255656
|
+
name: "lazyBundleIdPlugin",
|
|
255657
|
+
async generateBundle(_, bundle) {
|
|
255658
|
+
const files = Object.entries(bundle);
|
|
255659
|
+
const map2 = /* @__PURE__ */ new Map();
|
|
255660
|
+
for (const [_key, file] of files) {
|
|
255661
|
+
if (!file.isEntry) continue;
|
|
255662
|
+
const entryModule = buildCtx.entryModules.find((em) => em.entryKey === file.name);
|
|
255663
|
+
if (!entryModule) continue;
|
|
255664
|
+
map2.set(file.fileName, await getBundleId(file.name, file.code, suffix) + ".entry.js");
|
|
255665
|
+
}
|
|
255666
|
+
if (!map2.size) return;
|
|
255667
|
+
for (const [_key, file] of files) {
|
|
255668
|
+
if (!file.isEntry) continue;
|
|
255669
|
+
file.facadeModuleId = map2.get(file.fileName) || file.facadeModuleId;
|
|
255670
|
+
file.fileName = map2.get(file.fileName) || file.fileName;
|
|
255671
|
+
const magicString = new MagicString(file.code);
|
|
255672
|
+
file.imports.forEach((imported, i) => {
|
|
255673
|
+
const replaced = map2.get(imported);
|
|
255674
|
+
if (replaced) {
|
|
255675
|
+
magicString.replaceAll(imported, replaced);
|
|
255676
|
+
file.imports[i] = replaced;
|
|
255677
|
+
}
|
|
255678
|
+
});
|
|
255679
|
+
file.code = magicString.toString();
|
|
255680
|
+
if (config.sourceMap) {
|
|
255681
|
+
file.map = magicString.generateMap();
|
|
255682
|
+
}
|
|
255683
|
+
}
|
|
255684
|
+
}
|
|
255685
|
+
};
|
|
255686
|
+
};
|
|
255687
|
+
|
|
255589
255688
|
// src/compiler/output-targets/dist-lazy/generate-cjs.ts
|
|
255590
255689
|
var generateCjs = async (config, compilerCtx, buildCtx, rollupBuild, outputTargets) => {
|
|
255591
255690
|
const cjsOutputs = outputTargets.filter((o) => !!o.cjsDir);
|
|
@@ -255596,7 +255695,8 @@ var generateCjs = async (config, compilerCtx, buildCtx, rollupBuild, outputTarge
|
|
|
255596
255695
|
format: "cjs",
|
|
255597
255696
|
entryFileNames: "[name].cjs.js",
|
|
255598
255697
|
assetFileNames: "[name]-[hash][extname]",
|
|
255599
|
-
sourcemap: config.sourceMap
|
|
255698
|
+
sourcemap: config.sourceMap,
|
|
255699
|
+
plugins: [lazyBundleIdPlugin(buildCtx, config, false, ".cjs")]
|
|
255600
255700
|
};
|
|
255601
255701
|
if (!!config.extras.experimentalImportInjection || !!config.extras.enableImportInjection) {
|
|
255602
255702
|
esmOpts.interop = "auto";
|
|
@@ -255613,8 +255713,7 @@ var generateCjs = async (config, compilerCtx, buildCtx, rollupBuild, outputTarge
|
|
|
255613
255713
|
destinations,
|
|
255614
255714
|
results,
|
|
255615
255715
|
"es2017",
|
|
255616
|
-
false
|
|
255617
|
-
".cjs"
|
|
255716
|
+
false
|
|
255618
255717
|
);
|
|
255619
255718
|
await generateShortcuts(compilerCtx, results, cjsOutputs);
|
|
255620
255719
|
}
|
|
@@ -255646,7 +255745,8 @@ var generateEsm = async (config, compilerCtx, buildCtx, rollupBuild, outputTarge
|
|
|
255646
255745
|
format: "es",
|
|
255647
255746
|
entryFileNames: "[name].js",
|
|
255648
255747
|
assetFileNames: "[name]-[hash][extname]",
|
|
255649
|
-
sourcemap: config.sourceMap
|
|
255748
|
+
sourcemap: config.sourceMap,
|
|
255749
|
+
plugins: [lazyBundleIdPlugin(buildCtx, config, false, "")]
|
|
255650
255750
|
};
|
|
255651
255751
|
const outputTargetType = esmOutputs[0].type;
|
|
255652
255752
|
const output = await generateRollupOutput(rollupBuild, esmOpts, config, buildCtx.entryModules);
|
|
@@ -255660,8 +255760,7 @@ var generateEsm = async (config, compilerCtx, buildCtx, rollupBuild, outputTarge
|
|
|
255660
255760
|
es2017destinations,
|
|
255661
255761
|
output,
|
|
255662
255762
|
"es2017",
|
|
255663
|
-
false
|
|
255664
|
-
""
|
|
255763
|
+
false
|
|
255665
255764
|
);
|
|
255666
255765
|
const es5destinations = esmEs5Outputs.map((o) => o.esmEs5Dir).filter((esmEs5Dir) => typeof esmEs5Dir === "string");
|
|
255667
255766
|
buildCtx.es5ComponentBundle = await generateLazyModules(
|
|
@@ -255672,8 +255771,7 @@ var generateEsm = async (config, compilerCtx, buildCtx, rollupBuild, outputTarge
|
|
|
255672
255771
|
es5destinations,
|
|
255673
255772
|
output,
|
|
255674
255773
|
"es5",
|
|
255675
|
-
false
|
|
255676
|
-
""
|
|
255774
|
+
false
|
|
255677
255775
|
);
|
|
255678
255776
|
if (config.buildEs5) {
|
|
255679
255777
|
await copyPolyfills(config, compilerCtx, esmOutputs);
|
|
@@ -255725,7 +255823,8 @@ var generateEsmBrowser = async (config, compilerCtx, buildCtx, rollupBuild, outp
|
|
|
255725
255823
|
entryFileNames: "[name].esm.js",
|
|
255726
255824
|
chunkFileNames: config.hashFileNames ? "p-[hash].js" : "[name]-[hash].js",
|
|
255727
255825
|
assetFileNames: config.hashFileNames ? "p-[hash][extname]" : "[name]-[hash][extname]",
|
|
255728
|
-
sourcemap: config.sourceMap
|
|
255826
|
+
sourcemap: config.sourceMap,
|
|
255827
|
+
plugins: [lazyBundleIdPlugin(buildCtx, config, config.hashFileNames, "")]
|
|
255729
255828
|
};
|
|
255730
255829
|
const output = await generateRollupOutput(rollupBuild, esmOpts, config, buildCtx.entryModules);
|
|
255731
255830
|
if (output != null) {
|
|
@@ -255738,8 +255837,7 @@ var generateEsmBrowser = async (config, compilerCtx, buildCtx, rollupBuild, outp
|
|
|
255738
255837
|
es2017destinations,
|
|
255739
255838
|
output,
|
|
255740
255839
|
"es2017",
|
|
255741
|
-
true
|
|
255742
|
-
""
|
|
255840
|
+
true
|
|
255743
255841
|
);
|
|
255744
255842
|
}
|
|
255745
255843
|
}
|
|
@@ -255778,7 +255876,8 @@ var generateSystem = async (config, compilerCtx, buildCtx, rollupBuild, outputTa
|
|
|
255778
255876
|
entryFileNames: config.hashFileNames ? "p-[hash].system.js" : "[name].system.js",
|
|
255779
255877
|
chunkFileNames: config.hashFileNames ? "p-[hash].system.js" : "[name]-[hash].system.js",
|
|
255780
255878
|
assetFileNames: config.hashFileNames ? "p-[hash][extname]" : "[name]-[hash][extname]",
|
|
255781
|
-
sourcemap: config.sourceMap
|
|
255879
|
+
sourcemap: config.sourceMap,
|
|
255880
|
+
plugins: [lazyBundleIdPlugin(buildCtx, config, config.hashFileNames, ".system")]
|
|
255782
255881
|
};
|
|
255783
255882
|
const results = await generateRollupOutput(rollupBuild, esmOpts, config, buildCtx.entryModules);
|
|
255784
255883
|
if (results != null) {
|
|
@@ -255791,8 +255890,7 @@ var generateSystem = async (config, compilerCtx, buildCtx, rollupBuild, outputTa
|
|
|
255791
255890
|
destinations,
|
|
255792
255891
|
results,
|
|
255793
255892
|
"es5",
|
|
255794
|
-
true
|
|
255795
|
-
".system"
|
|
255893
|
+
true
|
|
255796
255894
|
);
|
|
255797
255895
|
await generateSystemLoaders(config, compilerCtx, results, systemOutputs);
|
|
255798
255896
|
}
|
|
@@ -260435,14 +260533,6 @@ var componentDecoratorToStatic = (config, typeChecker, diagnostics, cmpNode, new
|
|
|
260435
260533
|
};
|
|
260436
260534
|
var validateComponent = (config, diagnostics, typeChecker, componentOptions, cmpNode, componentDecorator) => {
|
|
260437
260535
|
var _a2;
|
|
260438
|
-
const extendNode = cmpNode.heritageClauses && cmpNode.heritageClauses.find((c) => c.token === import_typescript45.default.SyntaxKind.ExtendsKeyword);
|
|
260439
|
-
if (extendNode) {
|
|
260440
|
-
const err2 = buildError(diagnostics);
|
|
260441
|
-
err2.messageText = `Classes decorated with @Component can not extend from a base class.
|
|
260442
|
-
Stencil needs to be able to switch between different base classes in order to implement the different output targets such as: lazy and raw web components.`;
|
|
260443
|
-
augmentDiagnosticWithNode(err2, extendNode);
|
|
260444
|
-
return false;
|
|
260445
|
-
}
|
|
260446
260536
|
if (componentOptions.shadow && componentOptions.scoped) {
|
|
260447
260537
|
const err2 = buildError(diagnostics);
|
|
260448
260538
|
err2.messageText = `Components cannot be "scoped" and "shadow" at the same time, they are mutually exclusive configurations.`;
|
|
@@ -261621,16 +261711,25 @@ var visitClassDeclaration = (config, diagnostics, typeChecker, program3, classNo
|
|
|
261621
261711
|
var _a2, _b, _c;
|
|
261622
261712
|
const importAliasMap = new ImportAliasMap(sourceFile);
|
|
261623
261713
|
const componentDecorator = (_a2 = retrieveTsDecorators(classNode)) == null ? void 0 : _a2.find(isDecoratorNamed(importAliasMap.get("Component")));
|
|
261624
|
-
if (!componentDecorator) {
|
|
261625
|
-
return classNode;
|
|
261626
|
-
}
|
|
261627
261714
|
const classMembers = classNode.members;
|
|
261628
261715
|
const decoratedMembers = classMembers.filter((member2) => {
|
|
261629
261716
|
var _a3, _b2;
|
|
261630
261717
|
return ((_b2 = (_a3 = retrieveTsDecorators(member2)) == null ? void 0 : _a3.length) != null ? _b2 : 0) > 0;
|
|
261631
261718
|
});
|
|
261719
|
+
if (!decoratedMembers.length && !componentDecorator) {
|
|
261720
|
+
return classNode;
|
|
261721
|
+
}
|
|
261632
261722
|
const filteredMethodsAndFields = removeStencilMethodDecorators(Array.from(classMembers), diagnostics, importAliasMap);
|
|
261633
|
-
|
|
261723
|
+
if (componentDecorator) {
|
|
261724
|
+
componentDecoratorToStatic(
|
|
261725
|
+
config,
|
|
261726
|
+
typeChecker,
|
|
261727
|
+
diagnostics,
|
|
261728
|
+
classNode,
|
|
261729
|
+
filteredMethodsAndFields,
|
|
261730
|
+
componentDecorator
|
|
261731
|
+
);
|
|
261732
|
+
}
|
|
261634
261733
|
if (decoratedMembers.length > 0) {
|
|
261635
261734
|
propDecoratorsToStatic(
|
|
261636
261735
|
diagnostics,
|
|
@@ -261764,7 +261863,7 @@ var filterDecorators = (decorators, excludeList) => {
|
|
|
261764
261863
|
|
|
261765
261864
|
// src/compiler/transformers/static-to-meta/parse-static.ts
|
|
261766
261865
|
var import_path51 = require("path");
|
|
261767
|
-
var
|
|
261866
|
+
var import_typescript62 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
261768
261867
|
|
|
261769
261868
|
// src/compiler/transformers/static-to-meta/call-expression.ts
|
|
261770
261869
|
var import_typescript56 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
@@ -261885,7 +261984,7 @@ var visitCallExpressionArg = (m, arg) => {
|
|
|
261885
261984
|
|
|
261886
261985
|
// src/compiler/transformers/static-to-meta/component.ts
|
|
261887
261986
|
var import_path47 = require("path");
|
|
261888
|
-
var
|
|
261987
|
+
var import_typescript59 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
261889
261988
|
|
|
261890
261989
|
// src/compiler/transformers/add-component-meta-static.ts
|
|
261891
261990
|
var import_typescript57 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
@@ -261964,7 +262063,7 @@ var detectModernPropDeclarations = (classNode, cmp) => {
|
|
|
261964
262063
|
const parsedStates = getStaticValue(classNode.members, "states");
|
|
261965
262064
|
if (!parsedProps && !parsedStates) {
|
|
261966
262065
|
cmp.hasModernPropertyDecls = false;
|
|
261967
|
-
return;
|
|
262066
|
+
return false;
|
|
261968
262067
|
}
|
|
261969
262068
|
const members = [...Object.entries(parsedProps || {}), ...Object.entries(parsedStates || {})];
|
|
261970
262069
|
for (const [propName, meta] of members) {
|
|
@@ -261976,6 +262075,7 @@ var detectModernPropDeclarations = (classNode, cmp) => {
|
|
|
261976
262075
|
cmp.hasModernPropertyDecls = true;
|
|
261977
262076
|
break;
|
|
261978
262077
|
}
|
|
262078
|
+
return cmp.hasModernPropertyDecls;
|
|
261979
262079
|
};
|
|
261980
262080
|
|
|
261981
262081
|
// src/compiler/transformers/static-to-meta/attach-internals.ts
|
|
@@ -261989,14 +262089,8 @@ var parseAttachInternals = (staticMembers) => {
|
|
|
261989
262089
|
};
|
|
261990
262090
|
|
|
261991
262091
|
// src/compiler/transformers/static-to-meta/class-methods.ts
|
|
261992
|
-
var
|
|
261993
|
-
|
|
261994
|
-
const classMembers = cmpNode.members;
|
|
261995
|
-
if (!classMembers || classMembers.length === 0) {
|
|
261996
|
-
return;
|
|
261997
|
-
}
|
|
261998
|
-
const classMethods = classMembers.filter((m) => import_typescript59.default.isMethodDeclaration(m));
|
|
261999
|
-
if (classMethods.length === 0) {
|
|
262092
|
+
var parseClassMethods = (classMethods, cmpMeta) => {
|
|
262093
|
+
if (!(classMethods == null ? void 0 : classMethods.length)) {
|
|
262000
262094
|
return;
|
|
262001
262095
|
}
|
|
262002
262096
|
const hasHostData = classMethods.some((m) => isMethod(m, "hostData"));
|
|
@@ -262297,7 +262391,91 @@ var BLACKLISTED_COMPONENT_METHODS = [
|
|
|
262297
262391
|
*/
|
|
262298
262392
|
"shadowRoot"
|
|
262299
262393
|
];
|
|
262300
|
-
var
|
|
262394
|
+
var buildExtendsTree = (compilerCtx, classDeclaration3, dependentClasses, typeChecker, buildCtx) => {
|
|
262395
|
+
const hasHeritageClauses = classDeclaration3.heritageClauses && classDeclaration3.heritageClauses.length > 0;
|
|
262396
|
+
if (!hasHeritageClauses) return dependentClasses;
|
|
262397
|
+
const extendsClause = classDeclaration3.heritageClauses.find(
|
|
262398
|
+
(clause) => clause.token === import_typescript59.default.SyntaxKind.ExtendsKeyword
|
|
262399
|
+
);
|
|
262400
|
+
if (!extendsClause) {
|
|
262401
|
+
return dependentClasses;
|
|
262402
|
+
}
|
|
262403
|
+
extendsClause.types.forEach((type) => {
|
|
262404
|
+
var _a2;
|
|
262405
|
+
try {
|
|
262406
|
+
const aliasedSymbol = typeChecker.getAliasedSymbol(typeChecker.getSymbolAtLocation(type.expression));
|
|
262407
|
+
classDeclaration3 = (_a2 = aliasedSymbol == null ? void 0 : aliasedSymbol.declarations) == null ? void 0 : _a2.find(import_typescript59.default.isClassDeclaration);
|
|
262408
|
+
if (classDeclaration3 && !dependentClasses.some((dc) => dc.classNode === classDeclaration3)) {
|
|
262409
|
+
const foundModule = compilerCtx.moduleMap.get(classDeclaration3.getSourceFile().fileName);
|
|
262410
|
+
if (foundModule) {
|
|
262411
|
+
const source = foundModule.staticSourceFile;
|
|
262412
|
+
source.statements.forEach((statement) => {
|
|
262413
|
+
if (import_typescript59.default.isClassDeclaration(statement)) {
|
|
262414
|
+
dependentClasses.push({ classNode: statement, fileName: source.fileName });
|
|
262415
|
+
buildExtendsTree(compilerCtx, statement, dependentClasses, typeChecker, buildCtx);
|
|
262416
|
+
}
|
|
262417
|
+
});
|
|
262418
|
+
}
|
|
262419
|
+
}
|
|
262420
|
+
} catch (e) {
|
|
262421
|
+
const currentSource = classDeclaration3.getSourceFile();
|
|
262422
|
+
const importStatements = currentSource.statements.filter(import_typescript59.default.isImportDeclaration);
|
|
262423
|
+
const classDeclarations = currentSource.statements.filter(import_typescript59.default.isClassDeclaration);
|
|
262424
|
+
let found2 = false;
|
|
262425
|
+
if (classDeclarations.length > 1) {
|
|
262426
|
+
classDeclarations.forEach((statement) => {
|
|
262427
|
+
var _a3;
|
|
262428
|
+
if (((_a3 = statement.name) == null ? void 0 : _a3.getText()) === type.expression.getText() && !dependentClasses.some((dc) => dc.classNode === statement)) {
|
|
262429
|
+
found2 = true;
|
|
262430
|
+
dependentClasses.push({ classNode: statement, fileName: currentSource.fileName });
|
|
262431
|
+
buildExtendsTree(compilerCtx, statement, dependentClasses, typeChecker, buildCtx);
|
|
262432
|
+
}
|
|
262433
|
+
});
|
|
262434
|
+
}
|
|
262435
|
+
if (found2) return;
|
|
262436
|
+
importStatements.forEach((statement) => {
|
|
262437
|
+
var _a3, _b;
|
|
262438
|
+
if (import_typescript59.default.isNamedImports((_a3 = statement.importClause) == null ? void 0 : _a3.namedBindings)) {
|
|
262439
|
+
(_b = statement.importClause) == null ? void 0 : _b.namedBindings.elements.forEach((element) => {
|
|
262440
|
+
var _a4;
|
|
262441
|
+
if (element.name.getText() === type.expression.getText()) {
|
|
262442
|
+
const className = ((_a4 = element.propertyName) == null ? void 0 : _a4.getText()) || element.name.getText();
|
|
262443
|
+
const foundFile = tsResolveModuleName(
|
|
262444
|
+
buildCtx.config,
|
|
262445
|
+
compilerCtx,
|
|
262446
|
+
statement.moduleSpecifier.getText().replaceAll(/['"]/g, ""),
|
|
262447
|
+
currentSource.fileName
|
|
262448
|
+
);
|
|
262449
|
+
if (foundFile) {
|
|
262450
|
+
const foundModule = compilerCtx.moduleMap.get(foundFile.resolvedModule.resolvedFileName);
|
|
262451
|
+
(foundModule == null ? void 0 : foundModule.staticSourceFile).statements.forEach((statement2) => {
|
|
262452
|
+
var _a5;
|
|
262453
|
+
if (import_typescript59.default.isClassDeclaration(statement2) && ((_a5 = statement2.name) == null ? void 0 : _a5.getText()) === className && !dependentClasses.some((dc) => dc.classNode === statement2)) {
|
|
262454
|
+
dependentClasses.push({ classNode: statement2, fileName: foundModule.staticSourceFile.fileName });
|
|
262455
|
+
buildExtendsTree(compilerCtx, statement2, dependentClasses, typeChecker, buildCtx);
|
|
262456
|
+
}
|
|
262457
|
+
});
|
|
262458
|
+
}
|
|
262459
|
+
}
|
|
262460
|
+
});
|
|
262461
|
+
}
|
|
262462
|
+
});
|
|
262463
|
+
}
|
|
262464
|
+
});
|
|
262465
|
+
return dependentClasses;
|
|
262466
|
+
};
|
|
262467
|
+
var deDupeMembers = (dedupeMembers, staticMembers) => {
|
|
262468
|
+
return dedupeMembers.filter(
|
|
262469
|
+
(s) => !staticMembers.some((d) => {
|
|
262470
|
+
if (d.methodName) {
|
|
262471
|
+
return d.methodName === s.methodName;
|
|
262472
|
+
}
|
|
262473
|
+
return d.name === s.name;
|
|
262474
|
+
})
|
|
262475
|
+
);
|
|
262476
|
+
};
|
|
262477
|
+
var parseStaticComponentMeta = (compilerCtx, typeChecker, cmpNode, moduleFile, buildCtx, transformOpts) => {
|
|
262478
|
+
var _a2;
|
|
262301
262479
|
if (cmpNode.members == null) {
|
|
262302
262480
|
return cmpNode;
|
|
262303
262481
|
}
|
|
@@ -262306,6 +262484,37 @@ var parseStaticComponentMeta = (compilerCtx, typeChecker, cmpNode, moduleFile, t
|
|
|
262306
262484
|
if (tagName == null) {
|
|
262307
262485
|
return cmpNode;
|
|
262308
262486
|
}
|
|
262487
|
+
let properties = parseStaticProps(staticMembers);
|
|
262488
|
+
let states = parseStaticStates(staticMembers);
|
|
262489
|
+
let methods = parseStaticMethods(staticMembers);
|
|
262490
|
+
let listeners = parseStaticListeners(staticMembers);
|
|
262491
|
+
let events = parseStaticEvents(staticMembers);
|
|
262492
|
+
let watchers = parseStaticWatchers(staticMembers);
|
|
262493
|
+
let hasMixin = false;
|
|
262494
|
+
let classMethods = cmpNode.members.filter(import_typescript59.default.isMethodDeclaration);
|
|
262495
|
+
let doesExtend = false;
|
|
262496
|
+
const tree = buildExtendsTree(compilerCtx, cmpNode, [], typeChecker, buildCtx);
|
|
262497
|
+
tree.map((extendedClass) => {
|
|
262498
|
+
var _a3, _b, _c, _d, _e, _f, _g;
|
|
262499
|
+
const extendedStaticMembers = extendedClass.classNode.members.filter(isStaticGetter);
|
|
262500
|
+
const mixinProps = (_a3 = parseStaticProps(extendedStaticMembers)) != null ? _a3 : [];
|
|
262501
|
+
const mixinStates = (_b = parseStaticStates(extendedStaticMembers)) != null ? _b : [];
|
|
262502
|
+
const isMixin = mixinProps.length > 0 || mixinStates.length > 0;
|
|
262503
|
+
const module2 = compilerCtx.moduleMap.get(extendedClass.fileName);
|
|
262504
|
+
module2.isMixin = isMixin;
|
|
262505
|
+
module2.isExtended = true;
|
|
262506
|
+
doesExtend = true;
|
|
262507
|
+
properties = [...deDupeMembers(mixinProps, properties), ...properties];
|
|
262508
|
+
states = [...deDupeMembers(mixinStates, states), ...states];
|
|
262509
|
+
methods = [...deDupeMembers((_c = parseStaticMethods(extendedStaticMembers)) != null ? _c : [], methods), ...methods];
|
|
262510
|
+
listeners = [...deDupeMembers((_d = parseStaticListeners(extendedStaticMembers)) != null ? _d : [], listeners), ...listeners];
|
|
262511
|
+
events = [...deDupeMembers((_e = parseStaticEvents(extendedStaticMembers)) != null ? _e : [], events), ...events];
|
|
262512
|
+
watchers = [...deDupeMembers((_f = parseStaticWatchers(extendedStaticMembers)) != null ? _f : [], watchers), ...watchers];
|
|
262513
|
+
classMethods = [...classMethods, ...(_g = extendedClass.classNode.members.filter(import_typescript59.default.isMethodDeclaration)) != null ? _g : []];
|
|
262514
|
+
if (isMixin) {
|
|
262515
|
+
hasMixin = true;
|
|
262516
|
+
}
|
|
262517
|
+
});
|
|
262309
262518
|
const symbol = typeChecker ? typeChecker.getSymbolAtLocation(cmpNode.name) : void 0;
|
|
262310
262519
|
const docs = serializeSymbol(typeChecker, symbol);
|
|
262311
262520
|
const isCollectionDependency = moduleFile.isCollectionDependency;
|
|
@@ -262320,13 +262529,14 @@ var parseStaticComponentMeta = (compilerCtx, typeChecker, cmpNode, moduleFile, t
|
|
|
262320
262529
|
elementRef: parseStaticElementRef(staticMembers),
|
|
262321
262530
|
encapsulation,
|
|
262322
262531
|
shadowDelegatesFocus: !!parseStaticShadowDelegatesFocus(encapsulation, staticMembers),
|
|
262323
|
-
properties
|
|
262532
|
+
properties,
|
|
262324
262533
|
virtualProperties: parseVirtualProps(docs),
|
|
262325
|
-
states
|
|
262326
|
-
methods
|
|
262327
|
-
listeners
|
|
262328
|
-
events
|
|
262329
|
-
watchers
|
|
262534
|
+
states,
|
|
262535
|
+
methods,
|
|
262536
|
+
listeners,
|
|
262537
|
+
events,
|
|
262538
|
+
watchers,
|
|
262539
|
+
doesExtend,
|
|
262330
262540
|
styles: parseStaticStyles(compilerCtx, tagName, moduleFile.sourceFilePath, isCollectionDependency, staticMembers),
|
|
262331
262541
|
internal: isInternal(docs),
|
|
262332
262542
|
assetsDirs: parseAssetsDirs(staticMembers, moduleFile.jsFilePath),
|
|
@@ -262391,18 +262601,25 @@ var parseStaticComponentMeta = (compilerCtx, typeChecker, cmpNode, moduleFile, t
|
|
|
262391
262601
|
directDependents: [],
|
|
262392
262602
|
directDependencies: []
|
|
262393
262603
|
};
|
|
262394
|
-
const visitComponentChildNode = (node) => {
|
|
262395
|
-
validateComponentMembers(node);
|
|
262396
|
-
if (
|
|
262604
|
+
const visitComponentChildNode = (node, buildCtx2) => {
|
|
262605
|
+
validateComponentMembers(node, buildCtx2);
|
|
262606
|
+
if (import_typescript59.default.isCallExpression(node)) {
|
|
262397
262607
|
parseCallExpression(cmp, node);
|
|
262398
|
-
} else if (
|
|
262608
|
+
} else if (import_typescript59.default.isStringLiteral(node)) {
|
|
262399
262609
|
parseStringLiteral(cmp, node);
|
|
262400
262610
|
}
|
|
262401
|
-
node.forEachChild(visitComponentChildNode);
|
|
262611
|
+
node.forEachChild((child) => visitComponentChildNode(child, buildCtx2));
|
|
262402
262612
|
};
|
|
262403
|
-
visitComponentChildNode(cmpNode);
|
|
262404
|
-
parseClassMethods(
|
|
262405
|
-
detectModernPropDeclarations(cmpNode, cmp);
|
|
262613
|
+
visitComponentChildNode(cmpNode, buildCtx);
|
|
262614
|
+
parseClassMethods(classMethods, cmp);
|
|
262615
|
+
const hasModernPropertyDecls = detectModernPropDeclarations(cmpNode, cmp);
|
|
262616
|
+
if (!hasModernPropertyDecls && hasMixin) {
|
|
262617
|
+
const err2 = buildWarn(buildCtx.diagnostics);
|
|
262618
|
+
const target = (_a2 = buildCtx.config.tsCompilerOptions) == null ? void 0 : _a2.target;
|
|
262619
|
+
err2.messageText = `Component classes can only extend from other Stencil decorated base classes when targetting more modern JavaScript (ES2022 and above).
|
|
262620
|
+
${target ? `Your current TypeScript configuration is set to target \`${import_typescript59.default.ScriptTarget[target]}\`.` : ""} Please amend your tsconfig.json.`;
|
|
262621
|
+
if (!buildCtx.config._isTesting) augmentDiagnosticWithNode(err2, cmpNode);
|
|
262622
|
+
}
|
|
262406
262623
|
cmp.htmlAttrNames = unique(cmp.htmlAttrNames);
|
|
262407
262624
|
cmp.htmlTagNames = unique(cmp.htmlTagNames);
|
|
262408
262625
|
cmp.potentialCmpRefs = unique(cmp.potentialCmpRefs);
|
|
@@ -262418,25 +262635,25 @@ var parseStaticComponentMeta = (compilerCtx, typeChecker, cmpNode, moduleFile, t
|
|
|
262418
262635
|
compilerCtx.nodeMap.set(cmpNode, cmp);
|
|
262419
262636
|
return cmpNode;
|
|
262420
262637
|
};
|
|
262421
|
-
var validateComponentMembers = (node) => {
|
|
262638
|
+
var validateComponentMembers = (node, buildCtx) => {
|
|
262422
262639
|
if (
|
|
262423
262640
|
/**
|
|
262424
262641
|
* the component has a getter called "shadowRoot"
|
|
262425
262642
|
*/
|
|
262426
|
-
|
|
262643
|
+
import_typescript59.default.isGetAccessorDeclaration(node) && import_typescript59.default.isIdentifier(node.name) && typeof node.name.escapedText === "string" && BLACKLISTED_COMPONENT_METHODS.includes(node.name.escapedText) && /**
|
|
262427
262644
|
* the parent node is a class declaration
|
|
262428
262645
|
*/
|
|
262429
|
-
node.parent &&
|
|
262646
|
+
node.parent && import_typescript59.default.isClassDeclaration(node.parent)
|
|
262430
262647
|
) {
|
|
262431
262648
|
const propName = node.name.escapedText;
|
|
262432
|
-
const decorator3 =
|
|
262433
|
-
if (
|
|
262434
|
-
(prop) =>
|
|
262649
|
+
const decorator3 = import_typescript59.default.getDecorators(node.parent)[0];
|
|
262650
|
+
if (import_typescript59.default.isCallExpression(decorator3.expression) && decorator3.expression.arguments.length === 1 && import_typescript59.default.isObjectLiteralExpression(decorator3.expression.arguments[0]) && decorator3.expression.arguments[0].properties.some(
|
|
262651
|
+
(prop) => import_typescript59.default.isPropertyAssignment(prop) && prop.name.getText() === "tag"
|
|
262435
262652
|
)) {
|
|
262436
262653
|
const componentName = node.parent.name.getText();
|
|
262437
|
-
|
|
262438
|
-
|
|
262439
|
-
);
|
|
262654
|
+
const err2 = buildWarn(buildCtx.diagnostics);
|
|
262655
|
+
err2.messageText = `The component "${componentName}" has a getter called "${propName}". This getter is reserved for use by Stencil components and should not be defined by the user.`;
|
|
262656
|
+
augmentDiagnosticWithNode(err2, node);
|
|
262440
262657
|
}
|
|
262441
262658
|
}
|
|
262442
262659
|
};
|
|
@@ -262477,7 +262694,7 @@ var parseAssetsDirs = (staticMembers, componentFilePath) => {
|
|
|
262477
262694
|
|
|
262478
262695
|
// src/compiler/transformers/static-to-meta/import.ts
|
|
262479
262696
|
var import_path50 = require("path");
|
|
262480
|
-
var
|
|
262697
|
+
var import_typescript61 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
262481
262698
|
|
|
262482
262699
|
// src/compiler/transformers/collections/add-external-import.ts
|
|
262483
262700
|
var import_path49 = require("path");
|
|
@@ -262486,7 +262703,7 @@ var import_path49 = require("path");
|
|
|
262486
262703
|
var import_path48 = require("path");
|
|
262487
262704
|
|
|
262488
262705
|
// src/compiler/transformers/collections/parse-collection-components.ts
|
|
262489
|
-
var
|
|
262706
|
+
var import_typescript60 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
262490
262707
|
var parseCollectionComponents = (config, compilerCtx, buildCtx, collectionDir, collectionManifest, collection) => {
|
|
262491
262708
|
if (collectionManifest.entries) {
|
|
262492
262709
|
collectionManifest.entries.forEach((entryPath) => {
|
|
@@ -262497,7 +262714,7 @@ var parseCollectionComponents = (config, compilerCtx, buildCtx, collectionDir, c
|
|
|
262497
262714
|
};
|
|
262498
262715
|
var transpileCollectionModule = (config, compilerCtx, buildCtx, collection, inputFileName) => {
|
|
262499
262716
|
const sourceText = compilerCtx.fs.readFileSync(inputFileName);
|
|
262500
|
-
const sourceFile =
|
|
262717
|
+
const sourceFile = import_typescript60.default.createSourceFile(inputFileName, sourceText, import_typescript60.default.ScriptTarget.ES2017, true, import_typescript60.default.ScriptKind.JS);
|
|
262501
262718
|
return updateModule(config, compilerCtx, buildCtx, sourceFile, sourceText, inputFileName, void 0, collection);
|
|
262502
262719
|
};
|
|
262503
262720
|
|
|
@@ -262645,7 +262862,7 @@ var addExternalImport = (config, compilerCtx, buildCtx, moduleFile, containingFi
|
|
|
262645
262862
|
|
|
262646
262863
|
// src/compiler/transformers/static-to-meta/import.ts
|
|
262647
262864
|
var parseModuleImport = (config, compilerCtx, buildCtx, moduleFile, dirPath, importNode, resolveCollections) => {
|
|
262648
|
-
if (importNode.moduleSpecifier &&
|
|
262865
|
+
if (importNode.moduleSpecifier && import_typescript61.default.isStringLiteral(importNode.moduleSpecifier)) {
|
|
262649
262866
|
let importPath = importNode.moduleSpecifier.text;
|
|
262650
262867
|
if (!moduleFile.originalImports.includes(importPath)) {
|
|
262651
262868
|
moduleFile.originalImports.push(importPath);
|
|
@@ -262693,15 +262910,15 @@ var updateModule = (config, compilerCtx, buildCtx, tsSourceFile, sourceFileText,
|
|
|
262693
262910
|
compilerCtx.moduleMap.set(moduleFileKey, moduleFile);
|
|
262694
262911
|
compilerCtx.changedModules.add(moduleFile.sourceFilePath);
|
|
262695
262912
|
const visitNode = (node) => {
|
|
262696
|
-
if (
|
|
262697
|
-
parseStaticComponentMeta(compilerCtx, typeChecker, node, moduleFile);
|
|
262913
|
+
if (import_typescript62.default.isClassDeclaration(node)) {
|
|
262914
|
+
parseStaticComponentMeta(compilerCtx, typeChecker, node, moduleFile, buildCtx, void 0);
|
|
262698
262915
|
return;
|
|
262699
|
-
} else if (
|
|
262916
|
+
} else if (import_typescript62.default.isImportDeclaration(node)) {
|
|
262700
262917
|
parseModuleImport(config, compilerCtx, buildCtx, moduleFile, srcDirPath, node, true);
|
|
262701
262918
|
return;
|
|
262702
|
-
} else if (
|
|
262919
|
+
} else if (import_typescript62.default.isCallExpression(node)) {
|
|
262703
262920
|
parseCallExpression(moduleFile, node);
|
|
262704
|
-
} else if (
|
|
262921
|
+
} else if (import_typescript62.default.isStringLiteral(node)) {
|
|
262705
262922
|
parseStringLiteral(moduleFile, node);
|
|
262706
262923
|
}
|
|
262707
262924
|
node.forEachChild(visitNode);
|
|
@@ -262713,12 +262930,12 @@ var updateModule = (config, compilerCtx, buildCtx, tsSourceFile, sourceFileText,
|
|
|
262713
262930
|
}
|
|
262714
262931
|
visitNode(tsSourceFile);
|
|
262715
262932
|
if (moduleFile.cmps.length > 0) {
|
|
262716
|
-
moduleFile.staticSourceFile =
|
|
262933
|
+
moduleFile.staticSourceFile = import_typescript62.default.createSourceFile(
|
|
262717
262934
|
sourceFilePath,
|
|
262718
262935
|
sourceFileText,
|
|
262719
262936
|
tsSourceFile.languageVersion,
|
|
262720
262937
|
true,
|
|
262721
|
-
|
|
262938
|
+
import_typescript62.default.ScriptKind.JS
|
|
262722
262939
|
);
|
|
262723
262940
|
}
|
|
262724
262941
|
return moduleFile;
|
|
@@ -263962,14 +264179,14 @@ var isWatchIgnorePath = (config, path7) => {
|
|
|
263962
264179
|
};
|
|
263963
264180
|
|
|
263964
264181
|
// src/compiler/transpile/create-watch-program.ts
|
|
263965
|
-
var
|
|
264182
|
+
var import_typescript63 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
263966
264183
|
var createTsWatchProgram = async (config, buildCallback) => {
|
|
263967
264184
|
let isRunning = false;
|
|
263968
264185
|
let lastTsBuilder;
|
|
263969
264186
|
let timeoutId;
|
|
263970
264187
|
const optionsToExtend = getTsOptionsToExtend(config);
|
|
263971
264188
|
const tsWatchSys = {
|
|
263972
|
-
...
|
|
264189
|
+
...import_typescript63.default.sys,
|
|
263973
264190
|
/**
|
|
263974
264191
|
* Override the default `setTimeout` implementation in the {@link ts.System}. The reasoning
|
|
263975
264192
|
* behind this change is not explicitly clear, but this appears to be related to debouncing
|
|
@@ -263997,7 +264214,7 @@ var createTsWatchProgram = async (config, buildCallback) => {
|
|
|
263997
264214
|
}
|
|
263998
264215
|
};
|
|
263999
264216
|
config.sys.addDestroy(() => tsWatchSys.clearTimeout(timeoutId));
|
|
264000
|
-
const tsWatchHost =
|
|
264217
|
+
const tsWatchHost = import_typescript63.default.createWatchCompilerHost(
|
|
264001
264218
|
// Use the TS config from the Stencil project
|
|
264002
264219
|
config.tsconfig,
|
|
264003
264220
|
optionsToExtend,
|
|
@@ -264005,7 +264222,7 @@ var createTsWatchProgram = async (config, buildCallback) => {
|
|
|
264005
264222
|
// We use the `createEmitAndSemanticDiagnosticsBuilderProgram` as opposed to the
|
|
264006
264223
|
// `createSemanticDiagnosticsBuilderProgram` because we need our program to emit
|
|
264007
264224
|
// output files in addition to checking for errors
|
|
264008
|
-
|
|
264225
|
+
import_typescript63.default.createEmitAndSemanticDiagnosticsBuilderProgram,
|
|
264009
264226
|
// Add a callback to log out diagnostics as the program runs
|
|
264010
264227
|
(reportDiagnostic) => {
|
|
264011
264228
|
config.logger.debug("watch reportDiagnostic:" + reportDiagnostic.messageText);
|
|
@@ -264032,7 +264249,7 @@ var createTsWatchProgram = async (config, buildCallback) => {
|
|
|
264032
264249
|
// Create the watch builder program instance and make it available on the
|
|
264033
264250
|
// returned object. This provides us an easy way to teardown the program
|
|
264034
264251
|
// down-the-road.
|
|
264035
|
-
program:
|
|
264252
|
+
program: import_typescript63.default.createWatchProgram(tsWatchHost),
|
|
264036
264253
|
// This will be called via a callback on the watch build whenever a file
|
|
264037
264254
|
// change is detected
|
|
264038
264255
|
rebuild: () => {
|
|
@@ -266089,7 +266306,7 @@ var extname9 = (str) => {
|
|
|
266089
266306
|
var SKIP_EXT = /* @__PURE__ */ new Set(["zip", "rar", "tar", "gz", "bz2", "png", "jpeg", "jpg", "gif", "pdf", "tiff", "psd"]);
|
|
266090
266307
|
|
|
266091
266308
|
// src/compiler/sys/node-require.ts
|
|
266092
|
-
var
|
|
266309
|
+
var import_typescript64 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
266093
266310
|
var nodeRequire = (id) => {
|
|
266094
266311
|
const results = {
|
|
266095
266312
|
module: void 0,
|
|
@@ -266104,13 +266321,13 @@ var nodeRequire = (id) => {
|
|
|
266104
266321
|
require.extensions[".ts"] = (module2, fileName) => {
|
|
266105
266322
|
let sourceText = fs2.readFileSync(fileName, "utf8");
|
|
266106
266323
|
if (fileName.endsWith(".ts")) {
|
|
266107
|
-
const tsResults =
|
|
266324
|
+
const tsResults = import_typescript64.default.transpileModule(sourceText, {
|
|
266108
266325
|
fileName,
|
|
266109
266326
|
compilerOptions: {
|
|
266110
|
-
module:
|
|
266111
|
-
moduleResolution:
|
|
266327
|
+
module: import_typescript64.default.ModuleKind.CommonJS,
|
|
266328
|
+
moduleResolution: import_typescript64.default.ModuleResolutionKind.NodeJs,
|
|
266112
266329
|
esModuleInterop: true,
|
|
266113
|
-
target:
|
|
266330
|
+
target: import_typescript64.default.ScriptTarget.ES2017,
|
|
266114
266331
|
allowJs: true
|
|
266115
266332
|
}
|
|
266116
266333
|
});
|
|
@@ -266912,7 +267129,7 @@ var createCompiler = async (userConfig) => {
|
|
|
266912
267129
|
const sys = config.sys;
|
|
266913
267130
|
const compilerCtx = new CompilerContext();
|
|
266914
267131
|
if (isFunction(config.sys.setupCompiler)) {
|
|
266915
|
-
config.sys.setupCompiler({ ts:
|
|
267132
|
+
config.sys.setupCompiler({ ts: import_typescript65.default });
|
|
266916
267133
|
}
|
|
266917
267134
|
compilerCtx.fs = createInMemoryFs(sys);
|
|
266918
267135
|
compilerCtx.cache = new Cache(config, createInMemoryFs(sys));
|
|
@@ -266946,7 +267163,7 @@ var import_path63 = require("path");
|
|
|
266946
267163
|
|
|
266947
267164
|
// src/compiler/sys/typescript/typescript-config.ts
|
|
266948
267165
|
var import_path62 = require("path");
|
|
266949
|
-
var
|
|
267166
|
+
var import_typescript66 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
266950
267167
|
var validateTsConfig = async (config, sys, init) => {
|
|
266951
267168
|
var _a2;
|
|
266952
267169
|
const tsconfig = {
|
|
@@ -266968,7 +267185,7 @@ var validateTsConfig = async (config, sys, init) => {
|
|
|
266968
267185
|
} else {
|
|
266969
267186
|
tsconfig.path = readTsConfig.path;
|
|
266970
267187
|
const host = {
|
|
266971
|
-
...
|
|
267188
|
+
...import_typescript66.default.sys,
|
|
266972
267189
|
readFile: (p) => {
|
|
266973
267190
|
if (p === tsconfig.path) {
|
|
266974
267191
|
return readTsConfig.content;
|
|
@@ -266979,7 +267196,7 @@ var validateTsConfig = async (config, sys, init) => {
|
|
|
266979
267196
|
fileExists: (p) => sys.accessSync(p),
|
|
266980
267197
|
onUnRecoverableConfigFileDiagnostic: (e) => console.error(e)
|
|
266981
267198
|
};
|
|
266982
|
-
const results =
|
|
267199
|
+
const results = import_typescript66.default.getParsedCommandLineOfConfigFile(tsconfig.path, {}, host);
|
|
266983
267200
|
if (results === void 0) {
|
|
266984
267201
|
throw "Encountered an error reading tsconfig!";
|
|
266985
267202
|
}
|
|
@@ -267023,12 +267240,12 @@ var validateTsConfig = async (config, sys, init) => {
|
|
|
267023
267240
|
}
|
|
267024
267241
|
if (results.options) {
|
|
267025
267242
|
tsconfig.compilerOptions = results.options;
|
|
267026
|
-
const target = (_a2 = tsconfig.compilerOptions.target) != null ? _a2 :
|
|
267027
|
-
if ([
|
|
267243
|
+
const target = (_a2 = tsconfig.compilerOptions.target) != null ? _a2 : import_typescript66.default.ScriptTarget.ES5;
|
|
267244
|
+
if ([import_typescript66.default.ScriptTarget.ES3, import_typescript66.default.ScriptTarget.ES5, import_typescript66.default.ScriptTarget.ES2015, import_typescript66.default.ScriptTarget.ES2016].includes(target)) {
|
|
267028
267245
|
const warn = buildWarn(tsconfig.diagnostics);
|
|
267029
267246
|
warn.messageText = `To improve bundling, it is always recommended to set the tsconfig.json \u201Ctarget\u201D setting to "es2017". Note that the compiler will automatically handle transpilation for ES5-only browsers.`;
|
|
267030
267247
|
}
|
|
267031
|
-
if (tsconfig.compilerOptions.module !==
|
|
267248
|
+
if (tsconfig.compilerOptions.module !== import_typescript66.default.ModuleKind.ESNext && !config._isTesting) {
|
|
267032
267249
|
const warn = buildWarn(tsconfig.diagnostics);
|
|
267033
267250
|
warn.messageText = `To improve bundling, it is always recommended to set the tsconfig.json \u201Cmodule\u201D setting to \u201Cesnext\u201D. Note that the compiler will automatically handle bundling both modern and legacy builds.`;
|
|
267034
267251
|
}
|
|
@@ -268425,26 +268642,26 @@ var VALID_TARGET = /* @__PURE__ */ new Set(["latest", "esnext", "es2020", "es201
|
|
|
268425
268642
|
|
|
268426
268643
|
// src/compiler/transpile/transpile-module.ts
|
|
268427
268644
|
var import_sys_api_node5 = require("../sys/node/index.js");
|
|
268428
|
-
var
|
|
268645
|
+
var import_typescript68 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
268429
268646
|
|
|
268430
268647
|
// src/compiler/transformers/static-to-meta/visitor.ts
|
|
268431
268648
|
var import_path67 = require("path");
|
|
268432
|
-
var
|
|
268649
|
+
var import_typescript67 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
268433
268650
|
var convertStaticToMeta = (config, compilerCtx, buildCtx, typeChecker, collection, transformOpts) => {
|
|
268434
268651
|
return (transformCtx) => {
|
|
268435
268652
|
let dirPath;
|
|
268436
268653
|
let moduleFile;
|
|
268437
268654
|
const visitNode = (node) => {
|
|
268438
|
-
if (
|
|
268439
|
-
return parseStaticComponentMeta(compilerCtx, typeChecker, node, moduleFile, transformOpts);
|
|
268440
|
-
} else if (
|
|
268655
|
+
if (import_typescript67.default.isClassDeclaration(node)) {
|
|
268656
|
+
return parseStaticComponentMeta(compilerCtx, typeChecker, node, moduleFile, buildCtx, transformOpts);
|
|
268657
|
+
} else if (import_typescript67.default.isImportDeclaration(node)) {
|
|
268441
268658
|
parseModuleImport(config, compilerCtx, buildCtx, moduleFile, dirPath, node, !transformOpts.isolatedModules);
|
|
268442
|
-
} else if (
|
|
268659
|
+
} else if (import_typescript67.default.isCallExpression(node)) {
|
|
268443
268660
|
parseCallExpression(moduleFile, node);
|
|
268444
|
-
} else if (
|
|
268661
|
+
} else if (import_typescript67.default.isStringLiteral(node)) {
|
|
268445
268662
|
parseStringLiteral(moduleFile, node);
|
|
268446
268663
|
}
|
|
268447
|
-
return
|
|
268664
|
+
return import_typescript67.default.visitEachChild(node, visitNode, transformCtx);
|
|
268448
268665
|
};
|
|
268449
268666
|
return (tsSourceFile) => {
|
|
268450
268667
|
dirPath = (0, import_path67.dirname)(tsSourceFile.fileName);
|
|
@@ -268490,13 +268707,13 @@ var transpileModule = (config, input, transformOpts) => {
|
|
|
268490
268707
|
moduleFile: null
|
|
268491
268708
|
};
|
|
268492
268709
|
if (transformOpts.module === "cjs") {
|
|
268493
|
-
tsCompilerOptions.module =
|
|
268710
|
+
tsCompilerOptions.module = import_typescript68.default.ModuleKind.CommonJS;
|
|
268494
268711
|
} else {
|
|
268495
|
-
tsCompilerOptions.module =
|
|
268712
|
+
tsCompilerOptions.module = import_typescript68.default.ModuleKind.ESNext;
|
|
268496
268713
|
}
|
|
268497
268714
|
tsCompilerOptions.target = getScriptTargetKind(transformOpts);
|
|
268498
268715
|
if ((sourceFilePath.endsWith(".tsx") || sourceFilePath.endsWith(".jsx")) && tsCompilerOptions.jsx == null) {
|
|
268499
|
-
tsCompilerOptions.jsx =
|
|
268716
|
+
tsCompilerOptions.jsx = import_typescript68.default.JsxEmit.React;
|
|
268500
268717
|
}
|
|
268501
268718
|
if (tsCompilerOptions.jsx != null && !isString(tsCompilerOptions.jsxFactory)) {
|
|
268502
268719
|
tsCompilerOptions.jsxFactory = "h";
|
|
@@ -268507,7 +268724,7 @@ var transpileModule = (config, input, transformOpts) => {
|
|
|
268507
268724
|
if (tsCompilerOptions.paths && !isString(tsCompilerOptions.baseUrl)) {
|
|
268508
268725
|
tsCompilerOptions.baseUrl = ".";
|
|
268509
268726
|
}
|
|
268510
|
-
const sourceFile =
|
|
268727
|
+
const sourceFile = import_typescript68.default.createSourceFile(sourceFilePath, input, tsCompilerOptions.target);
|
|
268511
268728
|
const compilerHost = {
|
|
268512
268729
|
getSourceFile: (fileName) => {
|
|
268513
268730
|
return normalizePath(fileName) === normalizePath(sourceFilePath) ? sourceFile : void 0;
|
|
@@ -268523,13 +268740,13 @@ var transpileModule = (config, input, transformOpts) => {
|
|
|
268523
268740
|
useCaseSensitiveFileNames: () => false,
|
|
268524
268741
|
getCanonicalFileName: (fileName) => fileName,
|
|
268525
268742
|
getCurrentDirectory: () => transformOpts.currentDirectory || process.cwd(),
|
|
268526
|
-
getNewLine: () =>
|
|
268743
|
+
getNewLine: () => import_typescript68.default.sys.newLine || "\n",
|
|
268527
268744
|
fileExists: (fileName) => normalizePath(fileName) === normalizePath(sourceFilePath),
|
|
268528
268745
|
readFile: () => "",
|
|
268529
268746
|
directoryExists: () => true,
|
|
268530
268747
|
getDirectories: () => []
|
|
268531
268748
|
};
|
|
268532
|
-
const program3 =
|
|
268749
|
+
const program3 = import_typescript68.default.createProgram([sourceFilePath], tsCompilerOptions, compilerHost);
|
|
268533
268750
|
const typeChecker = program3.getTypeChecker();
|
|
268534
268751
|
const transformers = {
|
|
268535
268752
|
before: [
|
|
@@ -268561,10 +268778,10 @@ var transpileModule = (config, input, transformOpts) => {
|
|
|
268561
268778
|
};
|
|
268562
268779
|
var getScriptTargetKind = (transformOpts) => {
|
|
268563
268780
|
const target = transformOpts.target && transformOpts.target.toUpperCase();
|
|
268564
|
-
if (isNumber(
|
|
268565
|
-
return
|
|
268781
|
+
if (isNumber(import_typescript68.default.ScriptTarget[target])) {
|
|
268782
|
+
return import_typescript68.default.ScriptTarget[target];
|
|
268566
268783
|
}
|
|
268567
|
-
return
|
|
268784
|
+
return import_typescript68.default.ScriptTarget.Latest;
|
|
268568
268785
|
};
|
|
268569
268786
|
|
|
268570
268787
|
// src/compiler/transpile.ts
|