@stencil/core 4.37.1-dev.1759208528.341fec4 → 4.37.1-dev.1759381328.967c234
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 +2 -2
- package/cli/index.js +2 -2
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +329 -166
- 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 +3 -3
- package/internal/app-data/index.cjs +1 -1
- package/internal/app-data/index.js +1 -1
- package/internal/app-data/package.json +1 -1
- package/internal/app-globals/package.json +1 -1
- package/internal/client/index.js +95 -46
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +116 -64
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.d.ts +2 -0
- package/internal/hydrate/runner.js +1 -1
- package/internal/package.json +1 -1
- package/internal/stencil-core/index.d.ts +2 -0
- package/internal/stencil-private.d.ts +33 -8
- package/internal/stencil-public-runtime.d.ts +16 -2
- package/internal/testing/index.js +91 -44
- 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 +1 -1
- package/screenshot/index.js +2 -2
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +1 -1
- package/sys/node/index.js +34 -34
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +19 -12
- package/testing/package.json +1 -1
package/compiler/stencil.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Stencil Compiler v4.37.1-dev.
|
|
2
|
+
Stencil Compiler v4.37.1-dev.1759381328.967c234 | 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 ts72 = {};
|
|
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 ts72;
|
|
207855
207855
|
}, set exports(v) {
|
|
207856
|
-
|
|
207856
|
+
ts72 = 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_typescript71.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_typescript71 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
232675
232675
|
|
|
232676
232676
|
// src/version.ts
|
|
232677
|
-
var buildId = "
|
|
232677
|
+
var buildId = "1759381328";
|
|
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.37.1-dev.
|
|
232685
|
+
var vermoji = "\u{1F3B8}";
|
|
232686
|
+
var version = "4.37.1-dev.1759381328.967c234";
|
|
232687
232687
|
var versions = {
|
|
232688
232688
|
stencil: version,
|
|
232689
232689
|
parse5: parse5Version,
|
|
@@ -232760,13 +232760,17 @@ var formatComponentRuntimeMeta = (compilerMeta, includeMethods) => {
|
|
|
232760
232760
|
}
|
|
232761
232761
|
const members = formatComponentRuntimeMembers(compilerMeta, includeMethods);
|
|
232762
232762
|
const hostListeners = formatHostListeners(compilerMeta);
|
|
232763
|
-
const watchers =
|
|
232763
|
+
const watchers = formatComponentRuntimeReactiveHandlers(compilerMeta, "watchers");
|
|
232764
|
+
const serializers = formatComponentRuntimeReactiveHandlers(compilerMeta, "serializers");
|
|
232765
|
+
const deserializers = formatComponentRuntimeReactiveHandlers(compilerMeta, "deserializers");
|
|
232764
232766
|
return trimFalsy([
|
|
232765
232767
|
flags,
|
|
232766
232768
|
compilerMeta.tagName,
|
|
232767
232769
|
Object.keys(members).length > 0 ? members : void 0,
|
|
232768
232770
|
hostListeners.length > 0 ? hostListeners : void 0,
|
|
232769
|
-
Object.keys(watchers).length > 0 ? watchers : void 0
|
|
232771
|
+
Object.keys(watchers).length > 0 ? watchers : void 0,
|
|
232772
|
+
Object.keys(serializers).length > 0 ? serializers : void 0,
|
|
232773
|
+
Object.keys(deserializers).length > 0 ? deserializers : void 0
|
|
232770
232774
|
]);
|
|
232771
232775
|
};
|
|
232772
232776
|
var stringifyRuntimeData = (data) => {
|
|
@@ -232776,13 +232780,14 @@ var stringifyRuntimeData = (data) => {
|
|
|
232776
232780
|
}
|
|
232777
232781
|
return json2;
|
|
232778
232782
|
};
|
|
232779
|
-
var
|
|
232780
|
-
|
|
232781
|
-
|
|
232782
|
-
|
|
232783
|
-
|
|
232783
|
+
var formatComponentRuntimeReactiveHandlers = (compilerMeta, decorator3) => {
|
|
232784
|
+
var _a2;
|
|
232785
|
+
const handlers = {};
|
|
232786
|
+
(_a2 = compilerMeta[decorator3]) == null ? void 0 : _a2.forEach(({ propName, methodName }) => {
|
|
232787
|
+
var _a3;
|
|
232788
|
+
handlers[propName] = [...(_a3 = handlers[propName]) != null ? _a3 : [], methodName];
|
|
232784
232789
|
});
|
|
232785
|
-
return
|
|
232790
|
+
return handlers;
|
|
232786
232791
|
};
|
|
232787
232792
|
var formatComponentRuntimeMembers = (compilerMeta, includeMethods = true) => {
|
|
232788
232793
|
return {
|
|
@@ -233772,7 +233777,7 @@ var BUILD = {
|
|
|
233772
233777
|
vdomRender: true,
|
|
233773
233778
|
vdomStyle: true,
|
|
233774
233779
|
vdomText: true,
|
|
233775
|
-
|
|
233780
|
+
propChangeCallback: true,
|
|
233776
233781
|
taskQueue: true,
|
|
233777
233782
|
hotModuleReplacement: false,
|
|
233778
233783
|
isDebug: false,
|
|
@@ -234463,7 +234468,7 @@ var validateComponentTag = (tag) => {
|
|
|
234463
234468
|
};
|
|
234464
234469
|
|
|
234465
234470
|
// src/compiler/compiler.ts
|
|
234466
|
-
var
|
|
234471
|
+
var import_typescript67 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
234467
234472
|
|
|
234468
234473
|
// src/compiler/build/compiler-ctx.ts
|
|
234469
234474
|
var import_path4 = require("path");
|
|
@@ -236503,6 +236508,7 @@ var STATIC_GETTERS_TO_REMOVE = [
|
|
|
236503
236508
|
// step through to the `ComponentCompilerMeta` phase, but we want to keep the
|
|
236504
236509
|
// `formAssociated` prop that we also set at the same time.
|
|
236505
236510
|
"attachInternalsMemberName",
|
|
236511
|
+
"deserializers",
|
|
236506
236512
|
"elementRef",
|
|
236507
236513
|
"encapsulation",
|
|
236508
236514
|
"events",
|
|
@@ -236511,6 +236517,7 @@ var STATIC_GETTERS_TO_REMOVE = [
|
|
|
236511
236517
|
"methods",
|
|
236512
236518
|
"originalStyleUrls",
|
|
236513
236519
|
"properties",
|
|
236520
|
+
"serializers",
|
|
236514
236521
|
"states",
|
|
236515
236522
|
"style",
|
|
236516
236523
|
"styleMode",
|
|
@@ -237220,7 +237227,7 @@ var retrieveTsModifiers = (node) => {
|
|
|
237220
237227
|
};
|
|
237221
237228
|
function foundSuper(constructorBodyStatements) {
|
|
237222
237229
|
return constructorBodyStatements == null ? void 0 : constructorBodyStatements.find(
|
|
237223
|
-
(s) => import_typescript9.default.isExpressionStatement(s) && import_typescript9.default.isCallExpression(s.expression) && s.expression.expression.kind === import_typescript9.default.SyntaxKind.SuperKeyword
|
|
237230
|
+
(s) => import_typescript9.default.isExpressionStatement(s) && import_typescript9.default.isCallExpression(s.expression) && (s.expression.expression.kind === import_typescript9.default.SyntaxKind.SuperKeyword || import_typescript9.default.isIdentifier(s.expression.expression) && s.expression.expression.escapedText === "super")
|
|
237224
237231
|
);
|
|
237225
237232
|
}
|
|
237226
237233
|
var updateConstructor = (classNode, classMembers, statements, parameters, includeFalseArg) => {
|
|
@@ -253610,15 +253617,15 @@ var syntheticRender = (moduleFile, hasRender) => {
|
|
|
253610
253617
|
};
|
|
253611
253618
|
var INTERNAL_RENDER = "__stencil_render";
|
|
253612
253619
|
|
|
253613
|
-
// src/compiler/transformers/
|
|
253614
|
-
var
|
|
253615
|
-
if (cmp.
|
|
253620
|
+
// src/compiler/transformers/reactive-handler-meta-transform.ts
|
|
253621
|
+
var addReactivePropHandlers = (classMembers, cmp, decorator3) => {
|
|
253622
|
+
if (cmp[decorator3].length > 0) {
|
|
253616
253623
|
const watcherObj = {};
|
|
253617
|
-
cmp.
|
|
253624
|
+
cmp[decorator3].forEach(({ propName, methodName }) => {
|
|
253618
253625
|
watcherObj[propName] = watcherObj[propName] || [];
|
|
253619
253626
|
watcherObj[propName].push(methodName);
|
|
253620
253627
|
});
|
|
253621
|
-
classMembers.push(createStaticGetter(
|
|
253628
|
+
classMembers.push(createStaticGetter(decorator3, convertValueToLiteral(watcherObj)));
|
|
253622
253629
|
}
|
|
253623
253630
|
};
|
|
253624
253631
|
|
|
@@ -253977,7 +253984,9 @@ var updateNativeHostComponentMembers = (transformOpts, classNode, moduleFile, cm
|
|
|
253977
253984
|
updateNativeConstructor(classMembers, moduleFile, cmp, classNode);
|
|
253978
253985
|
addNativeConnectedCallback(classMembers, cmp);
|
|
253979
253986
|
addNativeElementGetter(classMembers, cmp);
|
|
253980
|
-
|
|
253987
|
+
addReactivePropHandlers(classMembers, cmp, "watchers");
|
|
253988
|
+
addReactivePropHandlers(classMembers, cmp, "serializers");
|
|
253989
|
+
addReactivePropHandlers(classMembers, cmp, "deserializers");
|
|
253981
253990
|
if (cmp.isPlain) {
|
|
253982
253991
|
addNativeComponentMeta(classMembers, cmp);
|
|
253983
253992
|
}
|
|
@@ -254202,6 +254211,7 @@ var getBuildFeatures = (cmps) => {
|
|
|
254202
254211
|
const f = {
|
|
254203
254212
|
allRenderFn: cmps.every((c) => c.hasRenderFn),
|
|
254204
254213
|
formAssociated: cmps.some((c) => c.formAssociated),
|
|
254214
|
+
deserializer: cmps.some((c) => c.hasDeserializer),
|
|
254205
254215
|
element: cmps.some((c) => c.hasElement),
|
|
254206
254216
|
event: cmps.some((c) => c.hasEvent),
|
|
254207
254217
|
hasRenderFn: cmps.some((c) => c.hasRenderFn),
|
|
@@ -254217,14 +254227,16 @@ var getBuildFeatures = (cmps) => {
|
|
|
254217
254227
|
method: cmps.some((c) => c.hasMethod),
|
|
254218
254228
|
mode: cmps.some((c) => c.hasMode),
|
|
254219
254229
|
modernPropertyDecls: cmps.some((c) => c.hasModernPropertyDecls),
|
|
254220
|
-
observeAttribute: cmps.some((c) => c.hasAttribute || c.hasWatchCallback),
|
|
254230
|
+
observeAttribute: cmps.some((c) => c.hasAttribute || c.hasWatchCallback || c.hasDeserializer),
|
|
254221
254231
|
prop: cmps.some((c) => c.hasProp),
|
|
254222
254232
|
propBoolean: cmps.some((c) => c.hasPropBoolean),
|
|
254233
|
+
propChangeCallback: cmps.some((c) => c.hasWatchCallback || c.hasDeserializer || c.hasSerializer),
|
|
254223
254234
|
propNumber: cmps.some((c) => c.hasPropNumber),
|
|
254224
254235
|
propString: cmps.some((c) => c.hasPropString),
|
|
254225
254236
|
propMutable: cmps.some((c) => c.hasPropMutable),
|
|
254226
|
-
reflect: cmps.some((c) => c.hasReflect),
|
|
254237
|
+
reflect: cmps.some((c) => c.hasReflect || c.hasSerializer),
|
|
254227
254238
|
scoped: cmps.some((c) => c.encapsulation === "scoped"),
|
|
254239
|
+
serializer: cmps.some((c) => c.hasSerializer),
|
|
254228
254240
|
shadowDom,
|
|
254229
254241
|
shadowDelegatesFocus: shadowDom && cmps.some((c) => c.shadowDelegatesFocus),
|
|
254230
254242
|
slot,
|
|
@@ -254244,7 +254256,6 @@ var getBuildFeatures = (cmps) => {
|
|
|
254244
254256
|
vdomRender: cmps.some((c) => c.hasVdomRender),
|
|
254245
254257
|
vdomStyle: cmps.some((c) => c.hasVdomStyle),
|
|
254246
254258
|
vdomText: cmps.some((c) => c.hasVdomText),
|
|
254247
|
-
watchCallback: cmps.some((c) => c.hasWatchCallback),
|
|
254248
254259
|
taskQueue: true
|
|
254249
254260
|
};
|
|
254250
254261
|
f.vdomAttribute = f.vdomAttribute || f.reflect;
|
|
@@ -254610,7 +254621,9 @@ var updateHydrateHostComponentMembers = (classNode, moduleFile, cmp) => {
|
|
|
254610
254621
|
const classMembers = removeStaticMetaProperties(classNode);
|
|
254611
254622
|
updateLazyComponentConstructor(classMembers, classNode, moduleFile, cmp);
|
|
254612
254623
|
addLazyElementGetter(classMembers, moduleFile, cmp);
|
|
254613
|
-
|
|
254624
|
+
addReactivePropHandlers(classMembers, cmp, "watchers");
|
|
254625
|
+
addReactivePropHandlers(classMembers, cmp, "serializers");
|
|
254626
|
+
addReactivePropHandlers(classMembers, cmp, "deserializers");
|
|
254614
254627
|
addHydrateRuntimeCmpMeta(classMembers, cmp);
|
|
254615
254628
|
transformHostData(classMembers, moduleFile);
|
|
254616
254629
|
return classMembers;
|
|
@@ -255278,7 +255291,9 @@ var updateLazyComponentMembers = (transformOpts, styleStatements, classNode, mod
|
|
|
255278
255291
|
const classMembers = removeStaticMetaProperties(classNode);
|
|
255279
255292
|
updateLazyComponentConstructor(classMembers, classNode, moduleFile, cmp);
|
|
255280
255293
|
addLazyElementGetter(classMembers, moduleFile, cmp);
|
|
255281
|
-
|
|
255294
|
+
addReactivePropHandlers(classMembers, cmp, "watchers");
|
|
255295
|
+
addReactivePropHandlers(classMembers, cmp, "serializers");
|
|
255296
|
+
addReactivePropHandlers(classMembers, cmp, "deserializers");
|
|
255282
255297
|
transformHostData(classMembers, moduleFile);
|
|
255283
255298
|
if (transformOpts.style === "static") {
|
|
255284
255299
|
addStaticStylePropertyToClass(styleStatements, cmp);
|
|
@@ -260380,7 +260395,7 @@ function attrNameToString(attr) {
|
|
|
260380
260395
|
}
|
|
260381
260396
|
|
|
260382
260397
|
// src/compiler/transformers/decorators-to-static/convert-decorators.ts
|
|
260383
|
-
var
|
|
260398
|
+
var import_typescript55 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
260384
260399
|
|
|
260385
260400
|
// src/compiler/transformers/decorators-to-static/attach-internals.ts
|
|
260386
260401
|
var import_typescript43 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
@@ -260613,6 +260628,8 @@ var findTagNode = (propName, node) => {
|
|
|
260613
260628
|
// src/compiler/transformers/decorators-to-static/decorators-constants.ts
|
|
260614
260629
|
var STENCIL_DECORATORS = [
|
|
260615
260630
|
"AttachInternals",
|
|
260631
|
+
"AttrDeserialize",
|
|
260632
|
+
"PropSerialize",
|
|
260616
260633
|
"Component",
|
|
260617
260634
|
"Element",
|
|
260618
260635
|
"Event",
|
|
@@ -260625,6 +260642,8 @@ var STENCIL_DECORATORS = [
|
|
|
260625
260642
|
var CLASS_DECORATORS_TO_REMOVE = ["Component"];
|
|
260626
260643
|
var MEMBER_DECORATORS_TO_REMOVE = [
|
|
260627
260644
|
"AttachInternals",
|
|
260645
|
+
"AttrDeserialize",
|
|
260646
|
+
"PropSerialize",
|
|
260628
260647
|
"Element",
|
|
260629
260648
|
"Event",
|
|
260630
260649
|
"Listen",
|
|
@@ -261480,13 +261499,25 @@ var validateMethods = (diagnostics, members) => {
|
|
|
261480
261499
|
|
|
261481
261500
|
// src/compiler/transformers/decorators-to-static/prop-decorator.ts
|
|
261482
261501
|
var import_typescript51 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
261483
|
-
var propDecoratorsToStatic = (config, diagnostics, decoratedProps, typeChecker, program3, newMembers, decoratorName) => {
|
|
261484
|
-
const properties = decoratedProps.filter((prop) => import_typescript51.default.isPropertyDeclaration(prop) || import_typescript51.default.isGetAccessor(prop)).map(
|
|
261502
|
+
var propDecoratorsToStatic = (config, diagnostics, decoratedProps, typeChecker, program3, newMembers, decoratorName, serializers, deserializers) => {
|
|
261503
|
+
const properties = decoratedProps.filter((prop) => import_typescript51.default.isPropertyDeclaration(prop) || import_typescript51.default.isGetAccessor(prop)).map(
|
|
261504
|
+
(prop) => parsePropDecorator(
|
|
261505
|
+
config,
|
|
261506
|
+
diagnostics,
|
|
261507
|
+
typeChecker,
|
|
261508
|
+
program3,
|
|
261509
|
+
prop,
|
|
261510
|
+
decoratorName,
|
|
261511
|
+
newMembers,
|
|
261512
|
+
serializers,
|
|
261513
|
+
deserializers
|
|
261514
|
+
)
|
|
261515
|
+
).filter((prop) => prop != null);
|
|
261485
261516
|
if (properties.length > 0) {
|
|
261486
261517
|
newMembers.push(createStaticGetter("properties", import_typescript51.default.factory.createObjectLiteralExpression(properties, true)));
|
|
261487
261518
|
}
|
|
261488
261519
|
};
|
|
261489
|
-
var parsePropDecorator = (config, diagnostics, typeChecker, program3, prop, decoratorName, newMembers) => {
|
|
261520
|
+
var parsePropDecorator = (config, diagnostics, typeChecker, program3, prop, decoratorName, newMembers, serializers, deserializers) => {
|
|
261490
261521
|
var _a2, _b;
|
|
261491
261522
|
const propDecorator = (_a2 = retrieveTsDecorators(prop)) == null ? void 0 : _a2.find(isDecoratorNamed(decoratorName));
|
|
261492
261523
|
if (propDecorator == null) {
|
|
@@ -261513,7 +261544,6 @@ var parsePropDecorator = (config, diagnostics, typeChecker, program3, prop, deco
|
|
|
261513
261544
|
const foundSetter = import_typescript51.default.isGetAccessor(prop) ? findSetter(propName, newMembers) : null;
|
|
261514
261545
|
const propMeta = {
|
|
261515
261546
|
type: typeStr,
|
|
261516
|
-
attribute: getAttributeName(propName, propOptions),
|
|
261517
261547
|
mutable: !!propOptions.mutable,
|
|
261518
261548
|
complexType: getComplexType2(typeChecker, prop, type, program3),
|
|
261519
261549
|
required: prop.exclamationToken !== void 0 && propName !== "mode",
|
|
@@ -261525,8 +261555,14 @@ var parsePropDecorator = (config, diagnostics, typeChecker, program3, prop, deco
|
|
|
261525
261555
|
if (ogPropName && ogPropName !== propName) {
|
|
261526
261556
|
propMeta.ogPropName = ogPropName;
|
|
261527
261557
|
}
|
|
261528
|
-
|
|
261529
|
-
|
|
261558
|
+
const foundSerializer = !!serializers.find((s) => s.propName === propName);
|
|
261559
|
+
const foundDeserializer = !!deserializers.find((s) => s.propName === propName);
|
|
261560
|
+
if (typeStr !== "unknown" || foundSerializer) {
|
|
261561
|
+
const explicitReflect = getReflect(diagnostics, propDecorator, propOptions);
|
|
261562
|
+
propMeta.reflect = explicitReflect === null ? foundSerializer : explicitReflect;
|
|
261563
|
+
}
|
|
261564
|
+
if (typeStr !== "unknown" || propMeta.reflect || foundDeserializer) {
|
|
261565
|
+
propMeta.attribute = getAttributeName(propName, propOptions);
|
|
261530
261566
|
}
|
|
261531
261567
|
if (import_typescript51.default.isPropertyDeclaration(prop) && prop.initializer) {
|
|
261532
261568
|
propMeta.defaultValue = prop.initializer.getText();
|
|
@@ -261574,7 +261610,7 @@ var getReflect = (diagnostics, propDecorator, propOptions) => {
|
|
|
261574
261610
|
augmentDiagnosticWithNode(err2, propDecorator);
|
|
261575
261611
|
return propOptions.reflectToAttr;
|
|
261576
261612
|
}
|
|
261577
|
-
return
|
|
261613
|
+
return null;
|
|
261578
261614
|
};
|
|
261579
261615
|
var getComplexType2 = (typeChecker, node, type, program3) => {
|
|
261580
261616
|
const nodeType = node.type;
|
|
@@ -261702,19 +261738,58 @@ var parseWatchDecorator = (typeChecker, method, decoratorName) => {
|
|
|
261702
261738
|
});
|
|
261703
261739
|
};
|
|
261704
261740
|
|
|
261741
|
+
// src/compiler/transformers/decorators-to-static/serialize-decorators.ts
|
|
261742
|
+
var import_typescript54 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
261743
|
+
var serializeDecoratorsToStatic = (typeChecker, decoratedProps, newMembers, decoratorName, translateType, propDecoratorName) => {
|
|
261744
|
+
const props = decoratedProps.filter((prop) => import_typescript54.default.isPropertyDeclaration(prop) || import_typescript54.default.isGetAccessor(prop)).flatMap((prop) => {
|
|
261745
|
+
var _a2;
|
|
261746
|
+
if ((_a2 = retrieveTsDecorators(prop)) == null ? void 0 : _a2.find(isDecoratorNamed(propDecoratorName))) {
|
|
261747
|
+
const { staticName } = tsPropDeclName(prop, typeChecker);
|
|
261748
|
+
return [staticName];
|
|
261749
|
+
}
|
|
261750
|
+
return [];
|
|
261751
|
+
});
|
|
261752
|
+
const serializers = decoratedProps.filter(import_typescript54.default.isMethodDeclaration).flatMap((method) => parseSerializeDecorator(typeChecker, method, decoratorName, props));
|
|
261753
|
+
if (serializers.length > 0) {
|
|
261754
|
+
if (translateType === "PropSerialize") {
|
|
261755
|
+
newMembers.push(createStaticGetter("serializers", convertValueToLiteral(serializers)));
|
|
261756
|
+
} else {
|
|
261757
|
+
newMembers.push(createStaticGetter("deserializers", convertValueToLiteral(serializers)));
|
|
261758
|
+
}
|
|
261759
|
+
}
|
|
261760
|
+
return serializers;
|
|
261761
|
+
};
|
|
261762
|
+
var parseSerializeDecorator = (typeChecker, method, decoratorName, props) => {
|
|
261763
|
+
var _a2;
|
|
261764
|
+
const methodName = method.name.getText();
|
|
261765
|
+
const decorators = (_a2 = retrieveTsDecorators(method)) != null ? _a2 : [];
|
|
261766
|
+
return decorators.filter(isDecoratorNamed(decoratorName)).flatMap((decorator3) => {
|
|
261767
|
+
const [propName] = getDecoratorParameters(decorator3, typeChecker);
|
|
261768
|
+
if (!props.includes(propName)) {
|
|
261769
|
+
return [];
|
|
261770
|
+
}
|
|
261771
|
+
return [
|
|
261772
|
+
{
|
|
261773
|
+
propName,
|
|
261774
|
+
methodName
|
|
261775
|
+
}
|
|
261776
|
+
];
|
|
261777
|
+
});
|
|
261778
|
+
};
|
|
261779
|
+
|
|
261705
261780
|
// src/compiler/transformers/decorators-to-static/convert-decorators.ts
|
|
261706
261781
|
var convertDecoratorsToStatic = (config, diagnostics, typeChecker, program3) => {
|
|
261707
261782
|
return (transformCtx) => {
|
|
261708
261783
|
let sourceFile;
|
|
261709
261784
|
const visit2 = (node) => {
|
|
261710
|
-
if (
|
|
261785
|
+
if (import_typescript55.default.isClassDeclaration(node)) {
|
|
261711
261786
|
return visitClassDeclaration(config, diagnostics, typeChecker, program3, node, sourceFile);
|
|
261712
261787
|
}
|
|
261713
|
-
return
|
|
261788
|
+
return import_typescript55.default.visitEachChild(node, visit2, transformCtx);
|
|
261714
261789
|
};
|
|
261715
261790
|
return (tsSourceFile) => {
|
|
261716
261791
|
sourceFile = tsSourceFile;
|
|
261717
|
-
return
|
|
261792
|
+
return import_typescript55.default.visitEachChild(tsSourceFile, visit2, transformCtx);
|
|
261718
261793
|
};
|
|
261719
261794
|
};
|
|
261720
261795
|
};
|
|
@@ -261742,6 +261817,22 @@ var visitClassDeclaration = (config, diagnostics, typeChecker, program3, classNo
|
|
|
261742
261817
|
);
|
|
261743
261818
|
}
|
|
261744
261819
|
if (decoratedMembers.length > 0) {
|
|
261820
|
+
const serializers = serializeDecoratorsToStatic(
|
|
261821
|
+
typeChecker,
|
|
261822
|
+
decoratedMembers,
|
|
261823
|
+
filteredMethodsAndFields,
|
|
261824
|
+
importAliasMap.get("PropSerialize"),
|
|
261825
|
+
"PropSerialize",
|
|
261826
|
+
importAliasMap.get("Prop")
|
|
261827
|
+
);
|
|
261828
|
+
const deserializers = serializeDecoratorsToStatic(
|
|
261829
|
+
typeChecker,
|
|
261830
|
+
decoratedMembers,
|
|
261831
|
+
filteredMethodsAndFields,
|
|
261832
|
+
importAliasMap.get("AttrDeserialize"),
|
|
261833
|
+
"AttrDeserialize",
|
|
261834
|
+
importAliasMap.get("Prop")
|
|
261835
|
+
);
|
|
261745
261836
|
propDecoratorsToStatic(
|
|
261746
261837
|
config,
|
|
261747
261838
|
diagnostics,
|
|
@@ -261749,7 +261840,9 @@ var visitClassDeclaration = (config, diagnostics, typeChecker, program3, classNo
|
|
|
261749
261840
|
typeChecker,
|
|
261750
261841
|
program3,
|
|
261751
261842
|
filteredMethodsAndFields,
|
|
261752
|
-
importAliasMap.get("Prop")
|
|
261843
|
+
importAliasMap.get("Prop"),
|
|
261844
|
+
serializers,
|
|
261845
|
+
deserializers
|
|
261753
261846
|
);
|
|
261754
261847
|
stateDecoratorsToStatic(decoratedMembers, filteredMethodsAndFields, typeChecker, importAliasMap.get("State"));
|
|
261755
261848
|
eventDecoratorsToStatic(
|
|
@@ -261790,7 +261883,7 @@ var visitClassDeclaration = (config, diagnostics, typeChecker, program3, classNo
|
|
|
261790
261883
|
validateMethods(diagnostics, classMembers);
|
|
261791
261884
|
const currentDecorators = retrieveTsDecorators(classNode);
|
|
261792
261885
|
const updatedClassFields = updateConstructor(classNode, filteredMethodsAndFields, []);
|
|
261793
|
-
return
|
|
261886
|
+
return import_typescript55.default.factory.updateClassDeclaration(
|
|
261794
261887
|
classNode,
|
|
261795
261888
|
[
|
|
261796
261889
|
...(_b = filterDecorators(
|
|
@@ -261814,8 +261907,8 @@ var removeStencilMethodDecorators = (classMembers, diagnostics, importAliasMap)
|
|
|
261814
261907
|
MEMBER_DECORATORS_TO_REMOVE.map((decorator3) => importAliasMap.get(decorator3))
|
|
261815
261908
|
);
|
|
261816
261909
|
if (currentDecorators !== newDecorators) {
|
|
261817
|
-
if (
|
|
261818
|
-
return
|
|
261910
|
+
if (import_typescript55.default.isMethodDeclaration(member2)) {
|
|
261911
|
+
return import_typescript55.default.factory.updateMethodDeclaration(
|
|
261819
261912
|
member2,
|
|
261820
261913
|
[...newDecorators != null ? newDecorators : [], ...(_a2 = retrieveTsModifiers(member2)) != null ? _a2 : []],
|
|
261821
261914
|
member2.asteriskToken,
|
|
@@ -261826,8 +261919,8 @@ var removeStencilMethodDecorators = (classMembers, diagnostics, importAliasMap)
|
|
|
261826
261919
|
member2.type,
|
|
261827
261920
|
member2.body
|
|
261828
261921
|
);
|
|
261829
|
-
} else if (
|
|
261830
|
-
return
|
|
261922
|
+
} else if (import_typescript55.default.isGetAccessor(member2)) {
|
|
261923
|
+
return import_typescript55.default.factory.updateGetAccessorDeclaration(
|
|
261831
261924
|
member2,
|
|
261832
261925
|
[...newDecorators != null ? newDecorators : [], ...(_b = retrieveTsModifiers(member2)) != null ? _b : []],
|
|
261833
261926
|
member2.name,
|
|
@@ -261835,13 +261928,13 @@ var removeStencilMethodDecorators = (classMembers, diagnostics, importAliasMap)
|
|
|
261835
261928
|
member2.type,
|
|
261836
261929
|
member2.body
|
|
261837
261930
|
);
|
|
261838
|
-
} else if (
|
|
261931
|
+
} else if (import_typescript55.default.isSetAccessor(member2)) {
|
|
261839
261932
|
const err2 = buildError(diagnostics);
|
|
261840
261933
|
err2.messageText = "A get accessor should be decorated before a set accessor";
|
|
261841
261934
|
augmentDiagnosticWithNode(err2, member2);
|
|
261842
|
-
} else if (
|
|
261935
|
+
} else if (import_typescript55.default.isPropertyDeclaration(member2)) {
|
|
261843
261936
|
const modifiers = retrieveTsModifiers(member2);
|
|
261844
|
-
return
|
|
261937
|
+
return import_typescript55.default.factory.updatePropertyDeclaration(
|
|
261845
261938
|
member2,
|
|
261846
261939
|
[...newDecorators != null ? newDecorators : [], ...modifiers != null ? modifiers : []],
|
|
261847
261940
|
member2.name,
|
|
@@ -261861,13 +261954,13 @@ var removeStencilMethodDecorators = (classMembers, diagnostics, importAliasMap)
|
|
|
261861
261954
|
var filterDecorators = (decorators, excludeList) => {
|
|
261862
261955
|
if (decorators) {
|
|
261863
261956
|
const updatedDecoratorList = decorators.filter((dec) => {
|
|
261864
|
-
const decoratorName =
|
|
261957
|
+
const decoratorName = import_typescript55.default.isCallExpression(dec.expression) && import_typescript55.default.isIdentifier(dec.expression.expression) && dec.expression.expression.text;
|
|
261865
261958
|
return typeof decoratorName === "boolean" || !excludeList.includes(decoratorName);
|
|
261866
261959
|
});
|
|
261867
261960
|
if (updatedDecoratorList.length === 0) {
|
|
261868
261961
|
return void 0;
|
|
261869
261962
|
} else if (updatedDecoratorList.length !== decorators.length) {
|
|
261870
|
-
return
|
|
261963
|
+
return import_typescript55.default.factory.createNodeArray(updatedDecoratorList);
|
|
261871
261964
|
}
|
|
261872
261965
|
}
|
|
261873
261966
|
return decorators;
|
|
@@ -261875,22 +261968,22 @@ var filterDecorators = (decorators, excludeList) => {
|
|
|
261875
261968
|
|
|
261876
261969
|
// src/compiler/transformers/static-to-meta/parse-static.ts
|
|
261877
261970
|
var import_path51 = require("path");
|
|
261878
|
-
var
|
|
261971
|
+
var import_typescript64 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
261879
261972
|
|
|
261880
261973
|
// src/compiler/transformers/static-to-meta/call-expression.ts
|
|
261881
|
-
var
|
|
261974
|
+
var import_typescript57 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
261882
261975
|
|
|
261883
261976
|
// src/compiler/transformers/static-to-meta/vdom.ts
|
|
261884
|
-
var
|
|
261977
|
+
var import_typescript56 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
261885
261978
|
var gatherVdomMeta = (m, args) => {
|
|
261886
261979
|
m.hasVdomRender = true;
|
|
261887
261980
|
const hTag = args[0];
|
|
261888
|
-
if (!
|
|
261981
|
+
if (!import_typescript56.default.isStringLiteral(hTag) && (!import_typescript56.default.isIdentifier(hTag) || hTag.text !== "Host")) {
|
|
261889
261982
|
m.hasVdomFunctional = true;
|
|
261890
261983
|
}
|
|
261891
261984
|
if (args.length > 1) {
|
|
261892
261985
|
const objectLiteral = args[1];
|
|
261893
|
-
if (
|
|
261986
|
+
if (import_typescript56.default.isCallExpression(objectLiteral) || import_typescript56.default.isIdentifier(objectLiteral)) {
|
|
261894
261987
|
m.hasVdomAttribute = true;
|
|
261895
261988
|
m.hasVdomClass = true;
|
|
261896
261989
|
m.hasVdomKey = true;
|
|
@@ -261899,10 +261992,10 @@ var gatherVdomMeta = (m, args) => {
|
|
|
261899
261992
|
m.hasVdomRef = true;
|
|
261900
261993
|
m.hasVdomStyle = true;
|
|
261901
261994
|
m.hasVdomXlink = true;
|
|
261902
|
-
} else if (
|
|
261995
|
+
} else if (import_typescript56.default.isObjectLiteralExpression(objectLiteral)) {
|
|
261903
261996
|
objectLiteral.properties.forEach((prop) => {
|
|
261904
261997
|
m.hasVdomAttribute = true;
|
|
261905
|
-
if (
|
|
261998
|
+
if (import_typescript56.default.isSpreadAssignment(prop) || import_typescript56.default.isComputedPropertyName(prop.name)) {
|
|
261906
261999
|
m.hasVdomClass = true;
|
|
261907
262000
|
m.hasVdomKey = true;
|
|
261908
262001
|
m.hasVdomListener = true;
|
|
@@ -261928,8 +262021,8 @@ var gatherVdomMeta = (m, args) => {
|
|
|
261928
262021
|
} else {
|
|
261929
262022
|
m.hasVdomPropOrAttr = true;
|
|
261930
262023
|
}
|
|
261931
|
-
|
|
261932
|
-
if (attrName === "part" &&
|
|
262024
|
+
import_typescript56.default.SyntaxKind.StringLiteral;
|
|
262025
|
+
if (attrName === "part" && import_typescript56.default.isPropertyAssignment(prop) && import_typescript56.default.isStringLiteral(prop.initializer)) {
|
|
261933
262026
|
m.htmlParts.push(
|
|
261934
262027
|
...prop.initializer.text.toLowerCase().split(" ").filter((part) => part.length > 0)
|
|
261935
262028
|
);
|
|
@@ -261942,7 +262035,7 @@ var gatherVdomMeta = (m, args) => {
|
|
|
261942
262035
|
if (!m.hasVdomText) {
|
|
261943
262036
|
for (let i = 2; i < args.length; i++) {
|
|
261944
262037
|
const arg = args[i];
|
|
261945
|
-
if (!
|
|
262038
|
+
if (!import_typescript56.default.isCallExpression(arg) || !import_typescript56.default.isIdentifier(arg.expression) || arg.expression.text !== "h") {
|
|
261946
262039
|
m.hasVdomText = true;
|
|
261947
262040
|
break;
|
|
261948
262041
|
}
|
|
@@ -261953,11 +262046,11 @@ var gatherVdomMeta = (m, args) => {
|
|
|
261953
262046
|
// src/compiler/transformers/static-to-meta/call-expression.ts
|
|
261954
262047
|
var parseCallExpression = (m, node) => {
|
|
261955
262048
|
if (node.arguments != null && node.arguments.length > 0) {
|
|
261956
|
-
if (
|
|
262049
|
+
if (import_typescript57.default.isIdentifier(node.expression)) {
|
|
261957
262050
|
visitCallExpressionArgs(m, node.expression, node.arguments);
|
|
261958
|
-
} else if (
|
|
262051
|
+
} else if (import_typescript57.default.isPropertyAccessExpression(node.expression)) {
|
|
261959
262052
|
const n3 = node.expression.name;
|
|
261960
|
-
if (
|
|
262053
|
+
if (import_typescript57.default.isIdentifier(n3) && n3) {
|
|
261961
262054
|
visitCallExpressionArgs(m, n3, node.arguments);
|
|
261962
262055
|
}
|
|
261963
262056
|
}
|
|
@@ -261974,7 +262067,7 @@ var visitCallExpressionArgs = (m, callExpressionName, args) => {
|
|
|
261974
262067
|
visitCallExpressionArg(m, args[1]);
|
|
261975
262068
|
} else if (fnName === "require" && args.length > 0 && m.originalImports) {
|
|
261976
262069
|
const arg = args[0];
|
|
261977
|
-
if (
|
|
262070
|
+
if (import_typescript57.default.isStringLiteral(arg)) {
|
|
261978
262071
|
if (!m.originalImports.includes(arg.text)) {
|
|
261979
262072
|
m.originalImports.push(arg.text);
|
|
261980
262073
|
}
|
|
@@ -261982,7 +262075,7 @@ var visitCallExpressionArgs = (m, callExpressionName, args) => {
|
|
|
261982
262075
|
}
|
|
261983
262076
|
};
|
|
261984
262077
|
var visitCallExpressionArg = (m, arg) => {
|
|
261985
|
-
if (
|
|
262078
|
+
if (import_typescript57.default.isStringLiteral(arg)) {
|
|
261986
262079
|
let tag = arg.text;
|
|
261987
262080
|
if (typeof tag === "string") {
|
|
261988
262081
|
tag = tag.toLowerCase();
|
|
@@ -261996,15 +262089,15 @@ var visitCallExpressionArg = (m, arg) => {
|
|
|
261996
262089
|
|
|
261997
262090
|
// src/compiler/transformers/static-to-meta/component.ts
|
|
261998
262091
|
var import_path47 = require("path");
|
|
261999
|
-
var
|
|
262092
|
+
var import_typescript61 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
262000
262093
|
|
|
262001
262094
|
// src/compiler/transformers/add-component-meta-static.ts
|
|
262002
|
-
var
|
|
262095
|
+
var import_typescript58 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
262003
262096
|
var addComponentMetaStatic = (cmpNode, cmpMeta) => {
|
|
262004
262097
|
const publicCompilerMeta = getPublicCompilerMeta(cmpMeta);
|
|
262005
262098
|
const cmpMetaStaticProp = createStaticGetter("COMPILER_META", convertValueToLiteral(publicCompilerMeta));
|
|
262006
262099
|
const classMembers = [...cmpNode.members, cmpMetaStaticProp];
|
|
262007
|
-
return
|
|
262100
|
+
return import_typescript58.default.factory.updateClassDeclaration(
|
|
262008
262101
|
cmpNode,
|
|
262009
262102
|
retrieveModifierLike(cmpNode),
|
|
262010
262103
|
cmpNode.name,
|
|
@@ -262044,6 +262137,12 @@ var setComponentBuildConditionals = (cmpMeta) => {
|
|
|
262044
262137
|
if (cmpMeta.watchers.length > 0) {
|
|
262045
262138
|
cmpMeta.hasWatchCallback = true;
|
|
262046
262139
|
}
|
|
262140
|
+
if (cmpMeta.serializers.length > 0) {
|
|
262141
|
+
cmpMeta.hasSerializer = true;
|
|
262142
|
+
}
|
|
262143
|
+
if (cmpMeta.deserializers.length > 0) {
|
|
262144
|
+
cmpMeta.hasDeserializer = true;
|
|
262145
|
+
}
|
|
262047
262146
|
if (cmpMeta.methods.length > 0) {
|
|
262048
262147
|
cmpMeta.hasMethod = true;
|
|
262049
262148
|
}
|
|
@@ -262069,7 +262168,7 @@ var setComponentBuildConditionals = (cmpMeta) => {
|
|
|
262069
262168
|
};
|
|
262070
262169
|
|
|
262071
262170
|
// src/compiler/transformers/detect-modern-prop-decls.ts
|
|
262072
|
-
var
|
|
262171
|
+
var import_typescript59 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
262073
262172
|
var detectModernPropDeclarations = (classNode) => {
|
|
262074
262173
|
const parsedProps = getStaticValue(classNode.members, "properties");
|
|
262075
262174
|
const parsedStates = getStaticValue(classNode.members, "states");
|
|
@@ -262081,7 +262180,7 @@ var detectModernPropDeclarations = (classNode) => {
|
|
|
262081
262180
|
for (const [propName, meta] of members) {
|
|
262082
262181
|
const dynamicPropName = meta.ogPropName || "";
|
|
262083
262182
|
const prop = classNode.members.find((m) => {
|
|
262084
|
-
return
|
|
262183
|
+
return import_typescript59.default.isPropertyDeclaration(m) && (import_typescript59.default.isComputedPropertyName(m.name) && m.name.expression.getText() === dynamicPropName || m.name.getText() === propName);
|
|
262085
262184
|
});
|
|
262086
262185
|
if (!prop) continue;
|
|
262087
262186
|
hasModernPropertyDecls = true;
|
|
@@ -262278,7 +262377,7 @@ var parseStyleIdentifier = (parsedStyle, modeName) => {
|
|
|
262278
262377
|
};
|
|
262279
262378
|
|
|
262280
262379
|
// src/compiler/transformers/static-to-meta/class-extension.ts
|
|
262281
|
-
var
|
|
262380
|
+
var import_typescript60 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
262282
262381
|
|
|
262283
262382
|
// src/compiler/transformers/static-to-meta/events.ts
|
|
262284
262383
|
var parseStaticEvents = (staticMembers) => {
|
|
@@ -262398,6 +262497,20 @@ var parseStaticWatchers = (staticMembers) => {
|
|
|
262398
262497
|
});
|
|
262399
262498
|
};
|
|
262400
262499
|
|
|
262500
|
+
// src/compiler/transformers/static-to-meta/serializers.ts
|
|
262501
|
+
var parseStaticSerializers = (staticMembers, translateType) => {
|
|
262502
|
+
const parsedSerializers = getStaticValue(staticMembers, translateType);
|
|
262503
|
+
if (!parsedSerializers || parsedSerializers.length === 0) {
|
|
262504
|
+
return [];
|
|
262505
|
+
}
|
|
262506
|
+
return parsedSerializers.map((parsedSerial) => {
|
|
262507
|
+
return {
|
|
262508
|
+
propName: parsedSerial.propName,
|
|
262509
|
+
methodName: parsedSerial.methodName
|
|
262510
|
+
};
|
|
262511
|
+
});
|
|
262512
|
+
};
|
|
262513
|
+
|
|
262401
262514
|
// src/compiler/transformers/static-to-meta/class-extension.ts
|
|
262402
262515
|
var deDupeMembers = (dedupeMembers, staticMembers) => {
|
|
262403
262516
|
return dedupeMembers.filter(
|
|
@@ -262412,11 +262525,11 @@ var deDupeMembers = (dedupeMembers, staticMembers) => {
|
|
|
262412
262525
|
function findClassWalk(node, name) {
|
|
262413
262526
|
var _a2;
|
|
262414
262527
|
if (!node) return void 0;
|
|
262415
|
-
if (node &&
|
|
262528
|
+
if (node && import_typescript60.default.isClassDeclaration(node) && (!name || ((_a2 = node.name) == null ? void 0 : _a2.text) === name)) {
|
|
262416
262529
|
return node;
|
|
262417
262530
|
}
|
|
262418
262531
|
let found2;
|
|
262419
|
-
|
|
262532
|
+
import_typescript60.default.forEachChild(node, (child) => {
|
|
262420
262533
|
if (found2) return;
|
|
262421
262534
|
const result2 = findClassWalk(child, name);
|
|
262422
262535
|
if (result2) found2 = result2;
|
|
@@ -262426,15 +262539,15 @@ function findClassWalk(node, name) {
|
|
|
262426
262539
|
function matchesNamedDeclaration(name) {
|
|
262427
262540
|
return function(stmt) {
|
|
262428
262541
|
var _a2, _b;
|
|
262429
|
-
if (
|
|
262542
|
+
if (import_typescript60.default.isClassDeclaration(stmt) && ((_a2 = stmt.name) == null ? void 0 : _a2.text) === name) {
|
|
262430
262543
|
return true;
|
|
262431
262544
|
}
|
|
262432
|
-
if (
|
|
262545
|
+
if (import_typescript60.default.isFunctionDeclaration(stmt) && ((_b = stmt.name) == null ? void 0 : _b.text) === name) {
|
|
262433
262546
|
return true;
|
|
262434
262547
|
}
|
|
262435
|
-
if (
|
|
262548
|
+
if (import_typescript60.default.isVariableStatement(stmt)) {
|
|
262436
262549
|
for (const decl of stmt.declarationList.declarations) {
|
|
262437
|
-
if (
|
|
262550
|
+
if (import_typescript60.default.isIdentifier(decl.name) && decl.name.text === name) {
|
|
262438
262551
|
return true;
|
|
262439
262552
|
}
|
|
262440
262553
|
}
|
|
@@ -262442,18 +262555,18 @@ function matchesNamedDeclaration(name) {
|
|
|
262442
262555
|
return false;
|
|
262443
262556
|
};
|
|
262444
262557
|
}
|
|
262445
|
-
function buildExtendsTree(compilerCtx, classDeclaration3, dependentClasses, typeChecker, buildCtx) {
|
|
262558
|
+
function buildExtendsTree(compilerCtx, classDeclaration3, dependentClasses, typeChecker, buildCtx, ogModule) {
|
|
262446
262559
|
const hasHeritageClauses = classDeclaration3.heritageClauses;
|
|
262447
262560
|
if (!(hasHeritageClauses == null ? void 0 : hasHeritageClauses.length)) return dependentClasses;
|
|
262448
|
-
const extendsClause = hasHeritageClauses.find((clause) => clause.token ===
|
|
262561
|
+
const extendsClause = hasHeritageClauses.find((clause) => clause.token === import_typescript60.default.SyntaxKind.ExtendsKeyword);
|
|
262449
262562
|
if (!extendsClause) return dependentClasses;
|
|
262450
262563
|
let classIdentifiers = [];
|
|
262451
262564
|
let foundClassDeclaration;
|
|
262452
262565
|
let keepLooking = true;
|
|
262453
262566
|
extendsClause.types.forEach((type) => {
|
|
262454
|
-
if (
|
|
262455
|
-
classIdentifiers = type.expression.arguments.filter(
|
|
262456
|
-
} else if (
|
|
262567
|
+
if (import_typescript60.default.isExpressionWithTypeArguments(type) && import_typescript60.default.isCallExpression(type.expression) && type.expression.expression.getText() === "Mixin") {
|
|
262568
|
+
classIdentifiers = type.expression.arguments.filter(import_typescript60.default.isIdentifier);
|
|
262569
|
+
} else if (import_typescript60.default.isIdentifier(type.expression)) {
|
|
262457
262570
|
classIdentifiers = [type.expression];
|
|
262458
262571
|
}
|
|
262459
262572
|
});
|
|
@@ -262462,7 +262575,7 @@ function buildExtendsTree(compilerCtx, classDeclaration3, dependentClasses, type
|
|
|
262462
262575
|
try {
|
|
262463
262576
|
const symbol = typeChecker.getSymbolAtLocation(extendee);
|
|
262464
262577
|
const aliasedSymbol = symbol ? typeChecker.getAliasedSymbol(symbol) : void 0;
|
|
262465
|
-
foundClassDeclaration = (_a2 = aliasedSymbol == null ? void 0 : aliasedSymbol.declarations) == null ? void 0 : _a2.find(
|
|
262578
|
+
foundClassDeclaration = (_a2 = aliasedSymbol == null ? void 0 : aliasedSymbol.declarations) == null ? void 0 : _a2.find(import_typescript60.default.isClassDeclaration);
|
|
262466
262579
|
if (!foundClassDeclaration) {
|
|
262467
262580
|
const node = (_b = aliasedSymbol == null ? void 0 : aliasedSymbol.declarations) == null ? void 0 : _b[0];
|
|
262468
262581
|
foundClassDeclaration = findClassWalk(node);
|
|
@@ -262476,16 +262589,22 @@ function buildExtendsTree(compilerCtx, classDeclaration3, dependentClasses, type
|
|
|
262476
262589
|
if (sourceClass) {
|
|
262477
262590
|
dependentClasses.push({ classNode: sourceClass, fileName: source.fileName });
|
|
262478
262591
|
if (keepLooking) {
|
|
262479
|
-
buildExtendsTree(compilerCtx, foundClassDeclaration, dependentClasses, typeChecker, buildCtx);
|
|
262592
|
+
buildExtendsTree(compilerCtx, foundClassDeclaration, dependentClasses, typeChecker, buildCtx, ogModule);
|
|
262480
262593
|
}
|
|
262481
262594
|
}
|
|
262482
262595
|
}
|
|
262483
262596
|
}
|
|
262484
262597
|
} catch (_e) {
|
|
262485
|
-
|
|
262598
|
+
let currentSource = classDeclaration3.getSourceFile();
|
|
262599
|
+
let matchedStatement;
|
|
262600
|
+
if (!currentSource) {
|
|
262601
|
+
currentSource = ogModule == null ? void 0 : ogModule.staticSourceFile;
|
|
262602
|
+
matchedStatement = findClassWalk(currentSource, extendee.getText());
|
|
262603
|
+
} else {
|
|
262604
|
+
matchedStatement = currentSource.statements.find(matchesNamedDeclaration(extendee.getText()));
|
|
262605
|
+
}
|
|
262486
262606
|
if (!currentSource) return;
|
|
262487
|
-
|
|
262488
|
-
if (matchedStatement && import_typescript59.default.isClassDeclaration(matchedStatement)) {
|
|
262607
|
+
if (matchedStatement && import_typescript60.default.isClassDeclaration(matchedStatement)) {
|
|
262489
262608
|
foundClassDeclaration = matchedStatement;
|
|
262490
262609
|
} else if (matchedStatement) {
|
|
262491
262610
|
foundClassDeclaration = findClassWalk(matchedStatement);
|
|
@@ -262494,14 +262613,14 @@ function buildExtendsTree(compilerCtx, classDeclaration3, dependentClasses, type
|
|
|
262494
262613
|
if (foundClassDeclaration && !dependentClasses.some((dc) => dc.classNode === foundClassDeclaration)) {
|
|
262495
262614
|
dependentClasses.push({ classNode: foundClassDeclaration, fileName: currentSource.fileName });
|
|
262496
262615
|
if (keepLooking) {
|
|
262497
|
-
buildExtendsTree(compilerCtx, foundClassDeclaration, dependentClasses, typeChecker, buildCtx);
|
|
262616
|
+
buildExtendsTree(compilerCtx, foundClassDeclaration, dependentClasses, typeChecker, buildCtx, ogModule);
|
|
262498
262617
|
}
|
|
262499
262618
|
return;
|
|
262500
262619
|
}
|
|
262501
|
-
const importStatements = currentSource.statements.filter(
|
|
262620
|
+
const importStatements = currentSource.statements.filter(import_typescript60.default.isImportDeclaration);
|
|
262502
262621
|
importStatements.forEach((statement) => {
|
|
262503
262622
|
var _a3, _b2, _c2;
|
|
262504
|
-
if (((_a3 = statement.importClause) == null ? void 0 : _a3.namedBindings) &&
|
|
262623
|
+
if (((_a3 = statement.importClause) == null ? void 0 : _a3.namedBindings) && import_typescript60.default.isNamedImports((_b2 = statement.importClause) == null ? void 0 : _b2.namedBindings)) {
|
|
262505
262624
|
(_c2 = statement.importClause) == null ? void 0 : _c2.namedBindings.elements.forEach((element) => {
|
|
262506
262625
|
var _a4;
|
|
262507
262626
|
if (element.name.getText() === extendee.getText()) {
|
|
@@ -262517,7 +262636,7 @@ function buildExtendsTree(compilerCtx, classDeclaration3, dependentClasses, type
|
|
|
262517
262636
|
const matchedStatement2 = (foundModule == null ? void 0 : foundModule.staticSourceFile).statements.find(
|
|
262518
262637
|
matchesNamedDeclaration(className)
|
|
262519
262638
|
);
|
|
262520
|
-
foundClassDeclaration = matchedStatement2 ?
|
|
262639
|
+
foundClassDeclaration = matchedStatement2 ? import_typescript60.default.isClassDeclaration(matchedStatement2) ? matchedStatement2 : void 0 : void 0;
|
|
262521
262640
|
if (!foundClassDeclaration && matchedStatement2) {
|
|
262522
262641
|
foundClassDeclaration = findClassWalk(matchedStatement2);
|
|
262523
262642
|
keepLooking = false;
|
|
@@ -262525,7 +262644,14 @@ function buildExtendsTree(compilerCtx, classDeclaration3, dependentClasses, type
|
|
|
262525
262644
|
if (foundClassDeclaration && !dependentClasses.some((dc) => dc.classNode === foundClassDeclaration)) {
|
|
262526
262645
|
dependentClasses.push({ classNode: foundClassDeclaration, fileName: currentSource.fileName });
|
|
262527
262646
|
if (keepLooking) {
|
|
262528
|
-
buildExtendsTree(
|
|
262647
|
+
buildExtendsTree(
|
|
262648
|
+
compilerCtx,
|
|
262649
|
+
foundClassDeclaration,
|
|
262650
|
+
dependentClasses,
|
|
262651
|
+
typeChecker,
|
|
262652
|
+
buildCtx,
|
|
262653
|
+
ogModule
|
|
262654
|
+
);
|
|
262529
262655
|
}
|
|
262530
262656
|
return;
|
|
262531
262657
|
}
|
|
@@ -262538,8 +262664,8 @@ function buildExtendsTree(compilerCtx, classDeclaration3, dependentClasses, type
|
|
|
262538
262664
|
});
|
|
262539
262665
|
return dependentClasses;
|
|
262540
262666
|
}
|
|
262541
|
-
function mergeExtendedClassMeta(compilerCtx, typeChecker, buildCtx, cmpNode, staticMembers) {
|
|
262542
|
-
const tree = buildExtendsTree(compilerCtx, cmpNode, [], typeChecker, buildCtx);
|
|
262667
|
+
function mergeExtendedClassMeta(compilerCtx, typeChecker, buildCtx, cmpNode, staticMembers, moduleFile) {
|
|
262668
|
+
const tree = buildExtendsTree(compilerCtx, cmpNode, [], typeChecker, buildCtx, moduleFile);
|
|
262543
262669
|
let hasMixin = false;
|
|
262544
262670
|
let doesExtend = false;
|
|
262545
262671
|
let properties = parseStaticProps(staticMembers);
|
|
@@ -262548,36 +262674,59 @@ function mergeExtendedClassMeta(compilerCtx, typeChecker, buildCtx, cmpNode, sta
|
|
|
262548
262674
|
let listeners = parseStaticListeners(staticMembers);
|
|
262549
262675
|
let events = parseStaticEvents(staticMembers);
|
|
262550
262676
|
let watchers = parseStaticWatchers(staticMembers);
|
|
262551
|
-
let classMethods = cmpNode.members.filter(
|
|
262677
|
+
let classMethods = cmpNode.members.filter(import_typescript60.default.isMethodDeclaration);
|
|
262678
|
+
let serializers = parseStaticSerializers(staticMembers, "serializers");
|
|
262679
|
+
let deserializers = parseStaticSerializers(staticMembers, "deserializers");
|
|
262552
262680
|
tree.forEach((extendedClass) => {
|
|
262553
|
-
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
262681
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
262554
262682
|
const extendedStaticMembers = extendedClass.classNode.members.filter(isStaticGetter);
|
|
262555
262683
|
const mixinProps = (_a2 = parseStaticProps(extendedStaticMembers)) != null ? _a2 : [];
|
|
262556
262684
|
const mixinStates = (_b = parseStaticStates(extendedStaticMembers)) != null ? _b : [];
|
|
262557
262685
|
const mixinMethods = (_c = parseStaticMethods(extendedStaticMembers)) != null ? _c : [];
|
|
262558
|
-
const
|
|
262686
|
+
const mixinEvents = (_d = parseStaticEvents(extendedStaticMembers)) != null ? _d : [];
|
|
262687
|
+
const isMixin = mixinProps.length > 0 || mixinStates.length > 0 || mixinMethods.length > 0 || mixinEvents.length > 0;
|
|
262559
262688
|
const module2 = compilerCtx.moduleMap.get(extendedClass.fileName);
|
|
262560
262689
|
if (!module2) return;
|
|
262561
262690
|
module2.isMixin = isMixin;
|
|
262562
262691
|
module2.isExtended = true;
|
|
262563
262692
|
doesExtend = true;
|
|
262564
|
-
if (
|
|
262693
|
+
if ((mixinProps.length > 0 || mixinStates.length > 0) && !detectModernPropDeclarations(extendedClass.classNode)) {
|
|
262565
262694
|
const err2 = buildWarn(buildCtx.diagnostics);
|
|
262566
|
-
const target = (
|
|
262695
|
+
const target = (_e = buildCtx.config.tsCompilerOptions) == null ? void 0 : _e.target;
|
|
262567
262696
|
err2.messageText = `Component classes can only extend from other Stencil decorated base classes when targetting more modern JavaScript (ES2022 and above).
|
|
262568
|
-
${target ? `Your current TypeScript configuration is set to target \`${
|
|
262697
|
+
${target ? `Your current TypeScript configuration is set to target \`${import_typescript60.default.ScriptTarget[target]}\`.` : ""} Please amend your tsconfig.json.`;
|
|
262569
262698
|
if (!buildCtx.config._isTesting) augmentDiagnosticWithNode(err2, extendedClass.classNode);
|
|
262570
262699
|
}
|
|
262571
262700
|
properties = [...deDupeMembers(mixinProps, properties), ...properties];
|
|
262572
262701
|
states = [...deDupeMembers(mixinStates, states), ...states];
|
|
262573
262702
|
methods = [...deDupeMembers(mixinMethods, methods), ...methods];
|
|
262574
|
-
|
|
262575
|
-
|
|
262703
|
+
events = [...deDupeMembers(mixinEvents, events), ...events];
|
|
262704
|
+
listeners = [...deDupeMembers((_f = parseStaticListeners(extendedStaticMembers)) != null ? _f : [], listeners), ...listeners];
|
|
262576
262705
|
watchers = [...deDupeMembers((_g = parseStaticWatchers(extendedStaticMembers)) != null ? _g : [], watchers), ...watchers];
|
|
262577
|
-
|
|
262706
|
+
serializers = [
|
|
262707
|
+
...deDupeMembers((_h = parseStaticSerializers(extendedStaticMembers, "serializers")) != null ? _h : [], serializers),
|
|
262708
|
+
...serializers
|
|
262709
|
+
];
|
|
262710
|
+
deserializers = [
|
|
262711
|
+
...deDupeMembers((_i = parseStaticSerializers(extendedStaticMembers, "deserializers")) != null ? _i : [], deserializers),
|
|
262712
|
+
...deserializers
|
|
262713
|
+
];
|
|
262714
|
+
classMethods = [...classMethods, ...(_j = extendedClass.classNode.members.filter(import_typescript60.default.isMethodDeclaration)) != null ? _j : []];
|
|
262578
262715
|
if (isMixin) hasMixin = true;
|
|
262579
262716
|
});
|
|
262580
|
-
return {
|
|
262717
|
+
return {
|
|
262718
|
+
hasMixin,
|
|
262719
|
+
doesExtend,
|
|
262720
|
+
properties,
|
|
262721
|
+
states,
|
|
262722
|
+
methods,
|
|
262723
|
+
listeners,
|
|
262724
|
+
events,
|
|
262725
|
+
watchers,
|
|
262726
|
+
classMethods,
|
|
262727
|
+
serializers,
|
|
262728
|
+
deserializers
|
|
262729
|
+
};
|
|
262581
262730
|
}
|
|
262582
262731
|
|
|
262583
262732
|
// src/compiler/transformers/static-to-meta/component.ts
|
|
@@ -262597,13 +262746,18 @@ var parseStaticComponentMeta = (compilerCtx, typeChecker, cmpNode, moduleFile, b
|
|
|
262597
262746
|
if (tagName == null) {
|
|
262598
262747
|
return cmpNode;
|
|
262599
262748
|
}
|
|
262600
|
-
const {
|
|
262601
|
-
|
|
262602
|
-
|
|
262603
|
-
|
|
262604
|
-
|
|
262605
|
-
|
|
262606
|
-
|
|
262749
|
+
const {
|
|
262750
|
+
doesExtend,
|
|
262751
|
+
properties,
|
|
262752
|
+
states,
|
|
262753
|
+
methods,
|
|
262754
|
+
listeners,
|
|
262755
|
+
events,
|
|
262756
|
+
watchers,
|
|
262757
|
+
classMethods,
|
|
262758
|
+
serializers,
|
|
262759
|
+
deserializers
|
|
262760
|
+
} = mergeExtendedClassMeta(compilerCtx, typeChecker, buildCtx, cmpNode, staticMembers, moduleFile);
|
|
262607
262761
|
const symbol = typeChecker ? typeChecker.getSymbolAtLocation(cmpNode.name) : void 0;
|
|
262608
262762
|
const docs = serializeSymbol(typeChecker, symbol);
|
|
262609
262763
|
const isCollectionDependency = moduleFile.isCollectionDependency;
|
|
@@ -262634,6 +262788,8 @@ var parseStaticComponentMeta = (compilerCtx, typeChecker, cmpNode, moduleFile, b
|
|
|
262634
262788
|
jsFilePath: moduleFile.jsFilePath,
|
|
262635
262789
|
sourceFilePath: moduleFile.sourceFilePath,
|
|
262636
262790
|
sourceMapPath: moduleFile.sourceMapPath,
|
|
262791
|
+
serializers,
|
|
262792
|
+
deserializers,
|
|
262637
262793
|
hasAttributeChangedCallbackFn: false,
|
|
262638
262794
|
hasComponentWillLoadFn: false,
|
|
262639
262795
|
hasComponentDidLoadFn: false,
|
|
@@ -262643,6 +262799,7 @@ var parseStaticComponentMeta = (compilerCtx, typeChecker, cmpNode, moduleFile, b
|
|
|
262643
262799
|
hasComponentWillRenderFn: false,
|
|
262644
262800
|
hasComponentDidRenderFn: false,
|
|
262645
262801
|
hasConnectedCallbackFn: false,
|
|
262802
|
+
hasDeserializer: false,
|
|
262646
262803
|
hasDisconnectedCallbackFn: false,
|
|
262647
262804
|
hasElement: false,
|
|
262648
262805
|
hasEvent: false,
|
|
@@ -262665,6 +262822,7 @@ var parseStaticComponentMeta = (compilerCtx, typeChecker, cmpNode, moduleFile, b
|
|
|
262665
262822
|
hasPropMutable: false,
|
|
262666
262823
|
hasReflect: false,
|
|
262667
262824
|
hasRenderFn: false,
|
|
262825
|
+
hasSerializer: false,
|
|
262668
262826
|
hasState: false,
|
|
262669
262827
|
hasStyle: false,
|
|
262670
262828
|
hasVdomAttribute: false,
|
|
@@ -262692,17 +262850,18 @@ var parseStaticComponentMeta = (compilerCtx, typeChecker, cmpNode, moduleFile, b
|
|
|
262692
262850
|
};
|
|
262693
262851
|
const visitComponentChildNode = (node, buildCtx2) => {
|
|
262694
262852
|
validateComponentMembers(node, buildCtx2);
|
|
262695
|
-
if (
|
|
262853
|
+
if (import_typescript61.default.isCallExpression(node)) {
|
|
262696
262854
|
parseCallExpression(cmp, node);
|
|
262697
|
-
} else if (
|
|
262855
|
+
} else if (import_typescript61.default.isStringLiteral(node)) {
|
|
262698
262856
|
parseStringLiteral(cmp, node);
|
|
262699
262857
|
}
|
|
262700
262858
|
node.forEachChild((child) => visitComponentChildNode(child, buildCtx2));
|
|
262701
262859
|
};
|
|
262702
262860
|
visitComponentChildNode(cmpNode, buildCtx);
|
|
262703
262861
|
parseClassMethods(classMethods, cmp);
|
|
262704
|
-
|
|
262705
|
-
|
|
262862
|
+
if (!moduleFile.isCollectionDependency) {
|
|
262863
|
+
cmp.hasModernPropertyDecls = detectModernPropDeclarations(cmpNode);
|
|
262864
|
+
}
|
|
262706
262865
|
cmp.htmlAttrNames = unique(cmp.htmlAttrNames);
|
|
262707
262866
|
cmp.htmlTagNames = unique(cmp.htmlTagNames);
|
|
262708
262867
|
cmp.potentialCmpRefs = unique(cmp.potentialCmpRefs);
|
|
@@ -262723,15 +262882,15 @@ var validateComponentMembers = (node, buildCtx) => {
|
|
|
262723
262882
|
/**
|
|
262724
262883
|
* the component has a getter called "shadowRoot"
|
|
262725
262884
|
*/
|
|
262726
|
-
|
|
262885
|
+
import_typescript61.default.isGetAccessorDeclaration(node) && import_typescript61.default.isIdentifier(node.name) && typeof node.name.escapedText === "string" && BLACKLISTED_COMPONENT_METHODS.includes(node.name.escapedText) && /**
|
|
262727
262886
|
* the parent node is a class declaration
|
|
262728
262887
|
*/
|
|
262729
|
-
node.parent &&
|
|
262888
|
+
node.parent && import_typescript61.default.isClassDeclaration(node.parent)
|
|
262730
262889
|
) {
|
|
262731
262890
|
const propName = node.name.escapedText;
|
|
262732
|
-
const decorator3 =
|
|
262733
|
-
if (
|
|
262734
|
-
(prop) =>
|
|
262891
|
+
const decorator3 = import_typescript61.default.getDecorators(node.parent)[0];
|
|
262892
|
+
if (import_typescript61.default.isCallExpression(decorator3.expression) && decorator3.expression.arguments.length === 1 && import_typescript61.default.isObjectLiteralExpression(decorator3.expression.arguments[0]) && decorator3.expression.arguments[0].properties.some(
|
|
262893
|
+
(prop) => import_typescript61.default.isPropertyAssignment(prop) && prop.name.getText() === "tag"
|
|
262735
262894
|
)) {
|
|
262736
262895
|
const componentName = node.parent.name.getText();
|
|
262737
262896
|
const err2 = buildWarn(buildCtx.diagnostics);
|
|
@@ -262777,7 +262936,7 @@ var parseAssetsDirs = (staticMembers, componentFilePath) => {
|
|
|
262777
262936
|
|
|
262778
262937
|
// src/compiler/transformers/static-to-meta/import.ts
|
|
262779
262938
|
var import_path50 = require("path");
|
|
262780
|
-
var
|
|
262939
|
+
var import_typescript63 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
262781
262940
|
|
|
262782
262941
|
// src/compiler/transformers/collections/add-external-import.ts
|
|
262783
262942
|
var import_path49 = require("path");
|
|
@@ -262786,7 +262945,7 @@ var import_path49 = require("path");
|
|
|
262786
262945
|
var import_path48 = require("path");
|
|
262787
262946
|
|
|
262788
262947
|
// src/compiler/transformers/collections/parse-collection-components.ts
|
|
262789
|
-
var
|
|
262948
|
+
var import_typescript62 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
262790
262949
|
var parseCollectionComponents = (config, compilerCtx, buildCtx, collectionDir, collectionManifest, collection) => {
|
|
262791
262950
|
if (collectionManifest.entries) {
|
|
262792
262951
|
collectionManifest.entries.forEach((entryPath) => {
|
|
@@ -262797,7 +262956,7 @@ var parseCollectionComponents = (config, compilerCtx, buildCtx, collectionDir, c
|
|
|
262797
262956
|
};
|
|
262798
262957
|
var transpileCollectionModule = (config, compilerCtx, buildCtx, collection, inputFileName) => {
|
|
262799
262958
|
const sourceText = compilerCtx.fs.readFileSync(inputFileName);
|
|
262800
|
-
const sourceFile =
|
|
262959
|
+
const sourceFile = import_typescript62.default.createSourceFile(inputFileName, sourceText, import_typescript62.default.ScriptTarget.ES2017, true, import_typescript62.default.ScriptKind.JS);
|
|
262801
262960
|
return updateModule(config, compilerCtx, buildCtx, sourceFile, sourceText, inputFileName, void 0, collection);
|
|
262802
262961
|
};
|
|
262803
262962
|
|
|
@@ -262945,7 +263104,7 @@ var addExternalImport = (config, compilerCtx, buildCtx, moduleFile, containingFi
|
|
|
262945
263104
|
|
|
262946
263105
|
// src/compiler/transformers/static-to-meta/import.ts
|
|
262947
263106
|
var parseModuleImport = (config, compilerCtx, buildCtx, moduleFile, dirPath, importNode, resolveCollections) => {
|
|
262948
|
-
if (importNode.moduleSpecifier &&
|
|
263107
|
+
if (importNode.moduleSpecifier && import_typescript63.default.isStringLiteral(importNode.moduleSpecifier)) {
|
|
262949
263108
|
let importPath = importNode.moduleSpecifier.text;
|
|
262950
263109
|
if (!moduleFile.originalImports.includes(importPath)) {
|
|
262951
263110
|
moduleFile.originalImports.push(importPath);
|
|
@@ -262993,15 +263152,15 @@ var updateModule = (config, compilerCtx, buildCtx, tsSourceFile, sourceFileText,
|
|
|
262993
263152
|
compilerCtx.moduleMap.set(moduleFileKey, moduleFile);
|
|
262994
263153
|
compilerCtx.changedModules.add(moduleFile.sourceFilePath);
|
|
262995
263154
|
const visitNode = (node) => {
|
|
262996
|
-
if (
|
|
263155
|
+
if (import_typescript64.default.isClassDeclaration(node)) {
|
|
262997
263156
|
parseStaticComponentMeta(compilerCtx, typeChecker, node, moduleFile, buildCtx, void 0);
|
|
262998
263157
|
return;
|
|
262999
|
-
} else if (
|
|
263158
|
+
} else if (import_typescript64.default.isImportDeclaration(node)) {
|
|
263000
263159
|
parseModuleImport(config, compilerCtx, buildCtx, moduleFile, srcDirPath, node, true);
|
|
263001
263160
|
return;
|
|
263002
|
-
} else if (
|
|
263161
|
+
} else if (import_typescript64.default.isCallExpression(node)) {
|
|
263003
263162
|
parseCallExpression(moduleFile, node);
|
|
263004
|
-
} else if (
|
|
263163
|
+
} else if (import_typescript64.default.isStringLiteral(node)) {
|
|
263005
263164
|
parseStringLiteral(moduleFile, node);
|
|
263006
263165
|
}
|
|
263007
263166
|
node.forEachChild(visitNode);
|
|
@@ -263013,12 +263172,12 @@ var updateModule = (config, compilerCtx, buildCtx, tsSourceFile, sourceFileText,
|
|
|
263013
263172
|
}
|
|
263014
263173
|
visitNode(tsSourceFile);
|
|
263015
263174
|
if (moduleFile.cmps.length > 0) {
|
|
263016
|
-
moduleFile.staticSourceFile =
|
|
263175
|
+
moduleFile.staticSourceFile = import_typescript64.default.createSourceFile(
|
|
263017
263176
|
sourceFilePath,
|
|
263018
263177
|
sourceFileText,
|
|
263019
263178
|
tsSourceFile.languageVersion,
|
|
263020
263179
|
true,
|
|
263021
|
-
|
|
263180
|
+
import_typescript64.default.ScriptKind.JS
|
|
263022
263181
|
);
|
|
263023
263182
|
}
|
|
263024
263183
|
return moduleFile;
|
|
@@ -264262,14 +264421,14 @@ var isWatchIgnorePath = (config, path7) => {
|
|
|
264262
264421
|
};
|
|
264263
264422
|
|
|
264264
264423
|
// src/compiler/transpile/create-watch-program.ts
|
|
264265
|
-
var
|
|
264424
|
+
var import_typescript65 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
264266
264425
|
var createTsWatchProgram = async (config, buildCallback) => {
|
|
264267
264426
|
let isRunning = false;
|
|
264268
264427
|
let lastTsBuilder;
|
|
264269
264428
|
let timeoutId;
|
|
264270
264429
|
const optionsToExtend = getTsOptionsToExtend(config);
|
|
264271
264430
|
const tsWatchSys = {
|
|
264272
|
-
...
|
|
264431
|
+
...import_typescript65.default.sys,
|
|
264273
264432
|
/**
|
|
264274
264433
|
* Override the default `setTimeout` implementation in the {@link ts.System}. The reasoning
|
|
264275
264434
|
* behind this change is not explicitly clear, but this appears to be related to debouncing
|
|
@@ -264297,7 +264456,7 @@ var createTsWatchProgram = async (config, buildCallback) => {
|
|
|
264297
264456
|
}
|
|
264298
264457
|
};
|
|
264299
264458
|
config.sys.addDestroy(() => tsWatchSys.clearTimeout(timeoutId));
|
|
264300
|
-
const tsWatchHost =
|
|
264459
|
+
const tsWatchHost = import_typescript65.default.createWatchCompilerHost(
|
|
264301
264460
|
// Use the TS config from the Stencil project
|
|
264302
264461
|
config.tsconfig,
|
|
264303
264462
|
optionsToExtend,
|
|
@@ -264305,7 +264464,7 @@ var createTsWatchProgram = async (config, buildCallback) => {
|
|
|
264305
264464
|
// We use the `createEmitAndSemanticDiagnosticsBuilderProgram` as opposed to the
|
|
264306
264465
|
// `createSemanticDiagnosticsBuilderProgram` because we need our program to emit
|
|
264307
264466
|
// output files in addition to checking for errors
|
|
264308
|
-
|
|
264467
|
+
import_typescript65.default.createEmitAndSemanticDiagnosticsBuilderProgram,
|
|
264309
264468
|
// Add a callback to log out diagnostics as the program runs
|
|
264310
264469
|
(reportDiagnostic) => {
|
|
264311
264470
|
config.logger.debug("watch reportDiagnostic:" + reportDiagnostic.messageText);
|
|
@@ -264332,7 +264491,7 @@ var createTsWatchProgram = async (config, buildCallback) => {
|
|
|
264332
264491
|
// Create the watch builder program instance and make it available on the
|
|
264333
264492
|
// returned object. This provides us an easy way to teardown the program
|
|
264334
264493
|
// down-the-road.
|
|
264335
|
-
program:
|
|
264494
|
+
program: import_typescript65.default.createWatchProgram(tsWatchHost),
|
|
264336
264495
|
// This will be called via a callback on the watch build whenever a file
|
|
264337
264496
|
// change is detected
|
|
264338
264497
|
rebuild: () => {
|
|
@@ -266389,7 +266548,7 @@ var extname9 = (str) => {
|
|
|
266389
266548
|
var SKIP_EXT = /* @__PURE__ */ new Set(["zip", "rar", "tar", "gz", "bz2", "png", "jpeg", "jpg", "gif", "pdf", "tiff", "psd"]);
|
|
266390
266549
|
|
|
266391
266550
|
// src/compiler/sys/node-require.ts
|
|
266392
|
-
var
|
|
266551
|
+
var import_typescript66 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
266393
266552
|
var nodeRequire = (id) => {
|
|
266394
266553
|
const results = {
|
|
266395
266554
|
module: void 0,
|
|
@@ -266404,13 +266563,13 @@ var nodeRequire = (id) => {
|
|
|
266404
266563
|
require.extensions[".ts"] = (module2, fileName) => {
|
|
266405
266564
|
let sourceText = fs2.readFileSync(fileName, "utf8");
|
|
266406
266565
|
if (fileName.endsWith(".ts")) {
|
|
266407
|
-
const tsResults =
|
|
266566
|
+
const tsResults = import_typescript66.default.transpileModule(sourceText, {
|
|
266408
266567
|
fileName,
|
|
266409
266568
|
compilerOptions: {
|
|
266410
|
-
module:
|
|
266411
|
-
moduleResolution:
|
|
266569
|
+
module: import_typescript66.default.ModuleKind.CommonJS,
|
|
266570
|
+
moduleResolution: import_typescript66.default.ModuleResolutionKind.NodeJs,
|
|
266412
266571
|
esModuleInterop: true,
|
|
266413
|
-
target:
|
|
266572
|
+
target: import_typescript66.default.ScriptTarget.ES2017,
|
|
266414
266573
|
allowJs: true
|
|
266415
266574
|
}
|
|
266416
266575
|
});
|
|
@@ -267212,7 +267371,7 @@ var createCompiler = async (userConfig) => {
|
|
|
267212
267371
|
const sys = config.sys;
|
|
267213
267372
|
const compilerCtx = new CompilerContext();
|
|
267214
267373
|
if (isFunction(config.sys.setupCompiler)) {
|
|
267215
|
-
config.sys.setupCompiler({ ts:
|
|
267374
|
+
config.sys.setupCompiler({ ts: import_typescript67.default });
|
|
267216
267375
|
}
|
|
267217
267376
|
compilerCtx.fs = createInMemoryFs(sys);
|
|
267218
267377
|
compilerCtx.cache = new Cache(config, createInMemoryFs(sys));
|
|
@@ -267246,7 +267405,7 @@ var import_path63 = require("path");
|
|
|
267246
267405
|
|
|
267247
267406
|
// src/compiler/sys/typescript/typescript-config.ts
|
|
267248
267407
|
var import_path62 = require("path");
|
|
267249
|
-
var
|
|
267408
|
+
var import_typescript68 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
267250
267409
|
var validateTsConfig = async (config, sys, init) => {
|
|
267251
267410
|
var _a2;
|
|
267252
267411
|
const tsconfig = {
|
|
@@ -267268,7 +267427,7 @@ var validateTsConfig = async (config, sys, init) => {
|
|
|
267268
267427
|
} else {
|
|
267269
267428
|
tsconfig.path = readTsConfig.path;
|
|
267270
267429
|
const host = {
|
|
267271
|
-
...
|
|
267430
|
+
...import_typescript68.default.sys,
|
|
267272
267431
|
readFile: (p) => {
|
|
267273
267432
|
if (p === tsconfig.path) {
|
|
267274
267433
|
return readTsConfig.content;
|
|
@@ -267279,7 +267438,7 @@ var validateTsConfig = async (config, sys, init) => {
|
|
|
267279
267438
|
fileExists: (p) => sys.accessSync(p),
|
|
267280
267439
|
onUnRecoverableConfigFileDiagnostic: (e) => console.error(e)
|
|
267281
267440
|
};
|
|
267282
|
-
const results =
|
|
267441
|
+
const results = import_typescript68.default.getParsedCommandLineOfConfigFile(tsconfig.path, {}, host);
|
|
267283
267442
|
if (results === void 0) {
|
|
267284
267443
|
throw "Encountered an error reading tsconfig!";
|
|
267285
267444
|
}
|
|
@@ -267323,12 +267482,12 @@ var validateTsConfig = async (config, sys, init) => {
|
|
|
267323
267482
|
}
|
|
267324
267483
|
if (results.options) {
|
|
267325
267484
|
tsconfig.compilerOptions = results.options;
|
|
267326
|
-
const target = (_a2 = tsconfig.compilerOptions.target) != null ? _a2 :
|
|
267327
|
-
if ([
|
|
267485
|
+
const target = (_a2 = tsconfig.compilerOptions.target) != null ? _a2 : import_typescript68.default.ScriptTarget.ES5;
|
|
267486
|
+
if ([import_typescript68.default.ScriptTarget.ES3, import_typescript68.default.ScriptTarget.ES5, import_typescript68.default.ScriptTarget.ES2015, import_typescript68.default.ScriptTarget.ES2016].includes(target)) {
|
|
267328
267487
|
const warn = buildWarn(tsconfig.diagnostics);
|
|
267329
267488
|
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.`;
|
|
267330
267489
|
}
|
|
267331
|
-
if (tsconfig.compilerOptions.module !==
|
|
267490
|
+
if (tsconfig.compilerOptions.module !== import_typescript68.default.ModuleKind.ESNext && !config._isTesting) {
|
|
267332
267491
|
const warn = buildWarn(tsconfig.diagnostics);
|
|
267333
267492
|
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.`;
|
|
267334
267493
|
}
|
|
@@ -268725,26 +268884,26 @@ var VALID_TARGET = /* @__PURE__ */ new Set(["latest", "esnext", "es2020", "es201
|
|
|
268725
268884
|
|
|
268726
268885
|
// src/compiler/transpile/transpile-module.ts
|
|
268727
268886
|
var import_sys_api_node5 = require("../sys/node/index.js");
|
|
268728
|
-
var
|
|
268887
|
+
var import_typescript70 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
268729
268888
|
|
|
268730
268889
|
// src/compiler/transformers/static-to-meta/visitor.ts
|
|
268731
268890
|
var import_path67 = require("path");
|
|
268732
|
-
var
|
|
268891
|
+
var import_typescript69 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
268733
268892
|
var convertStaticToMeta = (config, compilerCtx, buildCtx, typeChecker, collection, transformOpts) => {
|
|
268734
268893
|
return (transformCtx) => {
|
|
268735
268894
|
let dirPath;
|
|
268736
268895
|
let moduleFile;
|
|
268737
268896
|
const visitNode = (node) => {
|
|
268738
|
-
if (
|
|
268897
|
+
if (import_typescript69.default.isClassDeclaration(node)) {
|
|
268739
268898
|
return parseStaticComponentMeta(compilerCtx, typeChecker, node, moduleFile, buildCtx, transformOpts);
|
|
268740
|
-
} else if (
|
|
268899
|
+
} else if (import_typescript69.default.isImportDeclaration(node)) {
|
|
268741
268900
|
parseModuleImport(config, compilerCtx, buildCtx, moduleFile, dirPath, node, !transformOpts.isolatedModules);
|
|
268742
|
-
} else if (
|
|
268901
|
+
} else if (import_typescript69.default.isCallExpression(node)) {
|
|
268743
268902
|
parseCallExpression(moduleFile, node);
|
|
268744
|
-
} else if (
|
|
268903
|
+
} else if (import_typescript69.default.isStringLiteral(node)) {
|
|
268745
268904
|
parseStringLiteral(moduleFile, node);
|
|
268746
268905
|
}
|
|
268747
|
-
return
|
|
268906
|
+
return import_typescript69.default.visitEachChild(node, visitNode, transformCtx);
|
|
268748
268907
|
};
|
|
268749
268908
|
return (tsSourceFile) => {
|
|
268750
268909
|
dirPath = (0, import_path67.dirname)(tsSourceFile.fileName);
|
|
@@ -268758,6 +268917,10 @@ var convertStaticToMeta = (config, compilerCtx, buildCtx, typeChecker, collectio
|
|
|
268758
268917
|
moduleFile.isCollectionDependency = false;
|
|
268759
268918
|
moduleFile.collectionName = null;
|
|
268760
268919
|
}
|
|
268920
|
+
if (!moduleFile.staticSourceFile) {
|
|
268921
|
+
moduleFile.staticSourceFile = tsSourceFile;
|
|
268922
|
+
moduleFile.staticSourceFileText = tsSourceFile.getFullText();
|
|
268923
|
+
}
|
|
268761
268924
|
return visitNode(tsSourceFile);
|
|
268762
268925
|
};
|
|
268763
268926
|
};
|
|
@@ -268790,13 +268953,13 @@ var transpileModule = (config, input, transformOpts) => {
|
|
|
268790
268953
|
moduleFile: null
|
|
268791
268954
|
};
|
|
268792
268955
|
if (transformOpts.module === "cjs") {
|
|
268793
|
-
tsCompilerOptions.module =
|
|
268956
|
+
tsCompilerOptions.module = import_typescript70.default.ModuleKind.CommonJS;
|
|
268794
268957
|
} else {
|
|
268795
|
-
tsCompilerOptions.module =
|
|
268958
|
+
tsCompilerOptions.module = import_typescript70.default.ModuleKind.ESNext;
|
|
268796
268959
|
}
|
|
268797
268960
|
tsCompilerOptions.target = getScriptTargetKind(transformOpts);
|
|
268798
268961
|
if ((sourceFilePath.endsWith(".tsx") || sourceFilePath.endsWith(".jsx")) && tsCompilerOptions.jsx == null) {
|
|
268799
|
-
tsCompilerOptions.jsx =
|
|
268962
|
+
tsCompilerOptions.jsx = import_typescript70.default.JsxEmit.React;
|
|
268800
268963
|
}
|
|
268801
268964
|
if (tsCompilerOptions.jsx != null && !isString(tsCompilerOptions.jsxFactory)) {
|
|
268802
268965
|
tsCompilerOptions.jsxFactory = "h";
|
|
@@ -268807,7 +268970,7 @@ var transpileModule = (config, input, transformOpts) => {
|
|
|
268807
268970
|
if (tsCompilerOptions.paths && !isString(tsCompilerOptions.baseUrl)) {
|
|
268808
268971
|
tsCompilerOptions.baseUrl = ".";
|
|
268809
268972
|
}
|
|
268810
|
-
const sourceFile =
|
|
268973
|
+
const sourceFile = import_typescript70.default.createSourceFile(sourceFilePath, input, tsCompilerOptions.target);
|
|
268811
268974
|
const compilerHost = {
|
|
268812
268975
|
getSourceFile: (fileName) => {
|
|
268813
268976
|
return normalizePath(fileName) === normalizePath(sourceFilePath) ? sourceFile : void 0;
|
|
@@ -268823,13 +268986,13 @@ var transpileModule = (config, input, transformOpts) => {
|
|
|
268823
268986
|
useCaseSensitiveFileNames: () => false,
|
|
268824
268987
|
getCanonicalFileName: (fileName) => fileName,
|
|
268825
268988
|
getCurrentDirectory: () => transformOpts.currentDirectory || process.cwd(),
|
|
268826
|
-
getNewLine: () =>
|
|
268989
|
+
getNewLine: () => import_typescript70.default.sys.newLine || "\n",
|
|
268827
268990
|
fileExists: (fileName) => normalizePath(fileName) === normalizePath(sourceFilePath),
|
|
268828
268991
|
readFile: () => "",
|
|
268829
268992
|
directoryExists: () => true,
|
|
268830
268993
|
getDirectories: () => []
|
|
268831
268994
|
};
|
|
268832
|
-
const program3 =
|
|
268995
|
+
const program3 = import_typescript70.default.createProgram([sourceFilePath], tsCompilerOptions, compilerHost);
|
|
268833
268996
|
const typeChecker = program3.getTypeChecker();
|
|
268834
268997
|
const transformers = {
|
|
268835
268998
|
before: [
|
|
@@ -268861,10 +269024,10 @@ var transpileModule = (config, input, transformOpts) => {
|
|
|
268861
269024
|
};
|
|
268862
269025
|
var getScriptTargetKind = (transformOpts) => {
|
|
268863
269026
|
const target = transformOpts.target && transformOpts.target.toUpperCase();
|
|
268864
|
-
if (isNumber(
|
|
268865
|
-
return
|
|
269027
|
+
if (isNumber(import_typescript70.default.ScriptTarget[target])) {
|
|
269028
|
+
return import_typescript70.default.ScriptTarget[target];
|
|
268866
269029
|
}
|
|
268867
|
-
return
|
|
269030
|
+
return import_typescript70.default.ScriptTarget.Latest;
|
|
268868
269031
|
};
|
|
268869
269032
|
|
|
268870
269033
|
// src/compiler/transpile.ts
|