@stencil/core 4.36.3-dev.1757653330.0456db1 → 4.37.0-dev.1757912532.d7ee800
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 +6 -1
- package/cli/index.js +6 -1
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +344 -266
- 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 +7 -2
- package/internal/app-data/package.json +1 -1
- package/internal/app-globals/package.json +1 -1
- package/internal/client/index.js +19 -4
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +23 -8
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +8 -2
- package/internal/package.json +1 -1
- package/internal/stencil-core/index.d.ts +1 -0
- package/internal/stencil-core/index.js +1 -0
- package/internal/stencil-public-runtime.d.ts +21 -0
- package/internal/testing/index.js +19 -3
- 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 +6 -1
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +1 -1
- package/sys/node/index.js +25 -25
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +1 -1
- package/testing/package.json +1 -1
package/compiler/stencil.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Stencil Compiler v4.
|
|
2
|
+
Stencil Compiler v4.37.0-dev.1757912532.d7ee800 | 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 ts71 = {};
|
|
2334
2334
|
((module3) => {
|
|
2335
2335
|
"use strict";
|
|
2336
2336
|
var _a2;
|
|
@@ -77616,10 +77616,10 @@ ${lanes.join("\n")}
|
|
|
77616
77616
|
const baseClassType = classType && getBaseTypes(classType)[0];
|
|
77617
77617
|
return baseClassType && getTypeOfPropertyOfType(baseClassType, property3.escapedName);
|
|
77618
77618
|
}
|
|
77619
|
-
function isPropertyInClassDerivedFrom(prop,
|
|
77619
|
+
function isPropertyInClassDerivedFrom(prop, baseClass2) {
|
|
77620
77620
|
return forEachProperty2(prop, (sp) => {
|
|
77621
77621
|
const sourceClass = getDeclaringClass(sp);
|
|
77622
|
-
return sourceClass ? hasBaseType(sourceClass,
|
|
77622
|
+
return sourceClass ? hasBaseType(sourceClass, baseClass2) : false;
|
|
77623
77623
|
});
|
|
77624
77624
|
}
|
|
77625
77625
|
function isValidOverrideOf(sourceProp, targetProp) {
|
|
@@ -207851,9 +207851,9 @@ ${e.message}`;
|
|
|
207851
207851
|
};
|
|
207852
207852
|
}
|
|
207853
207853
|
})({ get exports() {
|
|
207854
|
-
return
|
|
207854
|
+
return ts71;
|
|
207855
207855
|
}, set exports(v) {
|
|
207856
|
-
|
|
207856
|
+
ts71 = 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_typescript70.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_typescript70 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
232675
232675
|
|
|
232676
232676
|
// src/version.ts
|
|
232677
|
-
var buildId = "
|
|
232677
|
+
var buildId = "1757912532";
|
|
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.
|
|
232685
|
+
var vermoji = "\u{1F416}";
|
|
232686
|
+
var version = "4.37.0-dev.1757912532.d7ee800";
|
|
232687
232687
|
var versions = {
|
|
232688
232688
|
stencil: version,
|
|
232689
232689
|
parse5: parse5Version,
|
|
@@ -234255,6 +234255,11 @@ var scopeCss = (cssText, scopeId, commentOriginalSelector) => {
|
|
|
234255
234255
|
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
234256
234256
|
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
234257
234257
|
|
|
234258
|
+
// src/runtime/mixin.ts
|
|
234259
|
+
var baseClass = BUILD.lazyLoad ? class {
|
|
234260
|
+
} : globalThis.HTMLElement || class {
|
|
234261
|
+
};
|
|
234262
|
+
|
|
234258
234263
|
// src/utils/sourcemaps.ts
|
|
234259
234264
|
function rollupToStencilSourceMap(rollupSourceMap) {
|
|
234260
234265
|
if (!rollupSourceMap || !rollupSourceMap.file) {
|
|
@@ -234458,7 +234463,7 @@ var validateComponentTag = (tag) => {
|
|
|
234458
234463
|
};
|
|
234459
234464
|
|
|
234460
234465
|
// src/compiler/compiler.ts
|
|
234461
|
-
var
|
|
234466
|
+
var import_typescript66 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
234462
234467
|
|
|
234463
234468
|
// src/compiler/build/compiler-ctx.ts
|
|
234464
234469
|
var import_path4 = require("path");
|
|
@@ -254185,7 +254190,8 @@ var KEEP_IMPORTS = /* @__PURE__ */ new Set([
|
|
|
254185
254190
|
"forceUpdate",
|
|
254186
254191
|
"getRenderingRef",
|
|
254187
254192
|
"forceModeUpdate",
|
|
254188
|
-
"setErrorHandler"
|
|
254193
|
+
"setErrorHandler",
|
|
254194
|
+
"Mixin"
|
|
254189
254195
|
]);
|
|
254190
254196
|
|
|
254191
254197
|
// src/compiler/app-core/app-data.ts
|
|
@@ -254332,6 +254338,7 @@ var getCustomElementsBuildConditionals = (config, cmps) => {
|
|
|
254332
254338
|
build2.hydrateServerSide = false;
|
|
254333
254339
|
build2.asyncQueue = config.taskQueue === "congestionAsync";
|
|
254334
254340
|
build2.taskQueue = config.taskQueue !== "immediate";
|
|
254341
|
+
build2.initializeNextTick = config.extras.initializeNextTick;
|
|
254335
254342
|
updateBuildConditionals(config, build2);
|
|
254336
254343
|
build2.devTools = false;
|
|
254337
254344
|
return build2;
|
|
@@ -261863,7 +261870,7 @@ var filterDecorators = (decorators, excludeList) => {
|
|
|
261863
261870
|
|
|
261864
261871
|
// src/compiler/transformers/static-to-meta/parse-static.ts
|
|
261865
261872
|
var import_path51 = require("path");
|
|
261866
|
-
var
|
|
261873
|
+
var import_typescript63 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
261867
261874
|
|
|
261868
261875
|
// src/compiler/transformers/static-to-meta/call-expression.ts
|
|
261869
261876
|
var import_typescript56 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
@@ -261984,7 +261991,7 @@ var visitCallExpressionArg = (m, arg) => {
|
|
|
261984
261991
|
|
|
261985
261992
|
// src/compiler/transformers/static-to-meta/component.ts
|
|
261986
261993
|
var import_path47 = require("path");
|
|
261987
|
-
var
|
|
261994
|
+
var import_typescript60 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
261988
261995
|
|
|
261989
261996
|
// src/compiler/transformers/add-component-meta-static.ts
|
|
261990
261997
|
var import_typescript57 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
@@ -262058,24 +262065,24 @@ var setComponentBuildConditionals = (cmpMeta) => {
|
|
|
262058
262065
|
|
|
262059
262066
|
// src/compiler/transformers/detect-modern-prop-decls.ts
|
|
262060
262067
|
var import_typescript58 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
262061
|
-
var detectModernPropDeclarations = (classNode
|
|
262068
|
+
var detectModernPropDeclarations = (classNode) => {
|
|
262062
262069
|
const parsedProps = getStaticValue(classNode.members, "properties");
|
|
262063
262070
|
const parsedStates = getStaticValue(classNode.members, "states");
|
|
262064
262071
|
if (!parsedProps && !parsedStates) {
|
|
262065
|
-
cmp.hasModernPropertyDecls = false;
|
|
262066
262072
|
return false;
|
|
262067
262073
|
}
|
|
262068
262074
|
const members = [...Object.entries(parsedProps || {}), ...Object.entries(parsedStates || {})];
|
|
262075
|
+
let hasModernPropertyDecls = false;
|
|
262069
262076
|
for (const [propName, meta] of members) {
|
|
262070
262077
|
const dynamicPropName = meta.ogPropName || "";
|
|
262071
262078
|
const prop = classNode.members.find((m) => {
|
|
262072
262079
|
return import_typescript58.default.isPropertyDeclaration(m) && (import_typescript58.default.isComputedPropertyName(m.name) && m.name.expression.getText() === dynamicPropName || m.name.getText() === propName);
|
|
262073
262080
|
});
|
|
262074
262081
|
if (!prop) continue;
|
|
262075
|
-
|
|
262082
|
+
hasModernPropertyDecls = true;
|
|
262076
262083
|
break;
|
|
262077
262084
|
}
|
|
262078
|
-
return
|
|
262085
|
+
return hasModernPropertyDecls;
|
|
262079
262086
|
};
|
|
262080
262087
|
|
|
262081
262088
|
// src/compiler/transformers/static-to-meta/attach-internals.ts
|
|
@@ -262137,116 +262144,12 @@ var parseStaticShadowDelegatesFocus = (encapsulation, staticMembers) => {
|
|
|
262137
262144
|
return null;
|
|
262138
262145
|
};
|
|
262139
262146
|
|
|
262140
|
-
// src/compiler/transformers/static-to-meta/events.ts
|
|
262141
|
-
var parseStaticEvents = (staticMembers) => {
|
|
262142
|
-
const parsedEvents = getStaticValue(staticMembers, "events");
|
|
262143
|
-
if (!parsedEvents || parsedEvents.length === 0) {
|
|
262144
|
-
return [];
|
|
262145
|
-
}
|
|
262146
|
-
return parsedEvents.map((parsedEvent) => {
|
|
262147
|
-
return {
|
|
262148
|
-
name: parsedEvent.name,
|
|
262149
|
-
method: parsedEvent.method,
|
|
262150
|
-
bubbles: parsedEvent.bubbles,
|
|
262151
|
-
cancelable: parsedEvent.cancelable,
|
|
262152
|
-
composed: parsedEvent.composed,
|
|
262153
|
-
docs: parsedEvent.docs,
|
|
262154
|
-
complexType: parsedEvent.complexType,
|
|
262155
|
-
internal: isInternal(parsedEvent.docs)
|
|
262156
|
-
};
|
|
262157
|
-
});
|
|
262158
|
-
};
|
|
262159
|
-
|
|
262160
262147
|
// src/compiler/transformers/static-to-meta/form-associated.ts
|
|
262161
262148
|
var parseFormAssociated = (staticMembers) => {
|
|
262162
262149
|
const isFormAssociated = getStaticValue(staticMembers, "formAssociated");
|
|
262163
262150
|
return typeof isFormAssociated === "boolean" && isFormAssociated;
|
|
262164
262151
|
};
|
|
262165
262152
|
|
|
262166
|
-
// src/compiler/transformers/static-to-meta/listeners.ts
|
|
262167
|
-
var parseStaticListeners = (staticMembers) => {
|
|
262168
|
-
const parsedListeners = getStaticValue(staticMembers, "listeners");
|
|
262169
|
-
if (!parsedListeners || parsedListeners.length === 0) {
|
|
262170
|
-
return [];
|
|
262171
|
-
}
|
|
262172
|
-
return parsedListeners.map((parsedListener) => {
|
|
262173
|
-
return {
|
|
262174
|
-
name: parsedListener.name,
|
|
262175
|
-
method: parsedListener.method,
|
|
262176
|
-
capture: !!parsedListener.capture,
|
|
262177
|
-
passive: !!parsedListener.passive,
|
|
262178
|
-
target: parsedListener.target
|
|
262179
|
-
};
|
|
262180
|
-
});
|
|
262181
|
-
};
|
|
262182
|
-
|
|
262183
|
-
// src/compiler/transformers/static-to-meta/methods.ts
|
|
262184
|
-
var parseStaticMethods = (staticMembers) => {
|
|
262185
|
-
const parsedMethods = getStaticValue(staticMembers, "methods");
|
|
262186
|
-
if (!parsedMethods) {
|
|
262187
|
-
return [];
|
|
262188
|
-
}
|
|
262189
|
-
const methodNames = Object.keys(parsedMethods);
|
|
262190
|
-
if (methodNames.length === 0) {
|
|
262191
|
-
return [];
|
|
262192
|
-
}
|
|
262193
|
-
return methodNames.map((methodName) => {
|
|
262194
|
-
return {
|
|
262195
|
-
name: methodName,
|
|
262196
|
-
docs: parsedMethods[methodName].docs,
|
|
262197
|
-
complexType: parsedMethods[methodName].complexType,
|
|
262198
|
-
internal: isInternal(parsedMethods[methodName].docs)
|
|
262199
|
-
};
|
|
262200
|
-
});
|
|
262201
|
-
};
|
|
262202
|
-
|
|
262203
|
-
// src/compiler/transformers/static-to-meta/props.ts
|
|
262204
|
-
var parseStaticProps = (staticMembers) => {
|
|
262205
|
-
const parsedProps = getStaticValue(staticMembers, "properties");
|
|
262206
|
-
if (!parsedProps) {
|
|
262207
|
-
return [];
|
|
262208
|
-
}
|
|
262209
|
-
const propNames = Object.keys(parsedProps);
|
|
262210
|
-
if (propNames.length === 0) {
|
|
262211
|
-
return [];
|
|
262212
|
-
}
|
|
262213
|
-
return propNames.map((propName) => {
|
|
262214
|
-
const val = parsedProps[propName];
|
|
262215
|
-
return {
|
|
262216
|
-
name: propName,
|
|
262217
|
-
type: val.type,
|
|
262218
|
-
attribute: val.attribute ? val.attribute.toLowerCase() : void 0,
|
|
262219
|
-
reflect: typeof val.reflect === "boolean" ? val.reflect : false,
|
|
262220
|
-
mutable: !!val.mutable,
|
|
262221
|
-
required: !!val.required,
|
|
262222
|
-
optional: !!val.optional,
|
|
262223
|
-
defaultValue: val.defaultValue,
|
|
262224
|
-
complexType: val.complexType,
|
|
262225
|
-
docs: val.docs,
|
|
262226
|
-
internal: isInternal(val.docs),
|
|
262227
|
-
getter: !!val.getter,
|
|
262228
|
-
setter: !!val.setter
|
|
262229
|
-
};
|
|
262230
|
-
});
|
|
262231
|
-
};
|
|
262232
|
-
|
|
262233
|
-
// src/compiler/transformers/static-to-meta/states.ts
|
|
262234
|
-
var parseStaticStates = (staticMembers) => {
|
|
262235
|
-
const parsedStates = getStaticValue(staticMembers, "states");
|
|
262236
|
-
if (!parsedStates) {
|
|
262237
|
-
return [];
|
|
262238
|
-
}
|
|
262239
|
-
const stateNames = Object.keys(parsedStates);
|
|
262240
|
-
if (stateNames.length === 0) {
|
|
262241
|
-
return [];
|
|
262242
|
-
}
|
|
262243
|
-
return stateNames.map((stateName) => {
|
|
262244
|
-
return {
|
|
262245
|
-
name: stateName
|
|
262246
|
-
};
|
|
262247
|
-
});
|
|
262248
|
-
};
|
|
262249
|
-
|
|
262250
262153
|
// src/compiler/transformers/static-to-meta/string-literal.ts
|
|
262251
262154
|
var parseStringLiteral = (m, node) => {
|
|
262252
262155
|
if (typeof node.text === "string" && node.text.includes("</")) {
|
|
@@ -262369,6 +262272,113 @@ var parseStyleIdentifier = (parsedStyle, modeName) => {
|
|
|
262369
262272
|
return style;
|
|
262370
262273
|
};
|
|
262371
262274
|
|
|
262275
|
+
// src/compiler/transformers/static-to-meta/class-extension.ts
|
|
262276
|
+
var import_typescript59 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
262277
|
+
|
|
262278
|
+
// src/compiler/transformers/static-to-meta/events.ts
|
|
262279
|
+
var parseStaticEvents = (staticMembers) => {
|
|
262280
|
+
const parsedEvents = getStaticValue(staticMembers, "events");
|
|
262281
|
+
if (!parsedEvents || parsedEvents.length === 0) {
|
|
262282
|
+
return [];
|
|
262283
|
+
}
|
|
262284
|
+
return parsedEvents.map((parsedEvent) => {
|
|
262285
|
+
return {
|
|
262286
|
+
name: parsedEvent.name,
|
|
262287
|
+
method: parsedEvent.method,
|
|
262288
|
+
bubbles: parsedEvent.bubbles,
|
|
262289
|
+
cancelable: parsedEvent.cancelable,
|
|
262290
|
+
composed: parsedEvent.composed,
|
|
262291
|
+
docs: parsedEvent.docs,
|
|
262292
|
+
complexType: parsedEvent.complexType,
|
|
262293
|
+
internal: isInternal(parsedEvent.docs)
|
|
262294
|
+
};
|
|
262295
|
+
});
|
|
262296
|
+
};
|
|
262297
|
+
|
|
262298
|
+
// src/compiler/transformers/static-to-meta/listeners.ts
|
|
262299
|
+
var parseStaticListeners = (staticMembers) => {
|
|
262300
|
+
const parsedListeners = getStaticValue(staticMembers, "listeners");
|
|
262301
|
+
if (!parsedListeners || parsedListeners.length === 0) {
|
|
262302
|
+
return [];
|
|
262303
|
+
}
|
|
262304
|
+
return parsedListeners.map((parsedListener) => {
|
|
262305
|
+
return {
|
|
262306
|
+
name: parsedListener.name,
|
|
262307
|
+
method: parsedListener.method,
|
|
262308
|
+
capture: !!parsedListener.capture,
|
|
262309
|
+
passive: !!parsedListener.passive,
|
|
262310
|
+
target: parsedListener.target
|
|
262311
|
+
};
|
|
262312
|
+
});
|
|
262313
|
+
};
|
|
262314
|
+
|
|
262315
|
+
// src/compiler/transformers/static-to-meta/methods.ts
|
|
262316
|
+
var parseStaticMethods = (staticMembers) => {
|
|
262317
|
+
const parsedMethods = getStaticValue(staticMembers, "methods");
|
|
262318
|
+
if (!parsedMethods) {
|
|
262319
|
+
return [];
|
|
262320
|
+
}
|
|
262321
|
+
const methodNames = Object.keys(parsedMethods);
|
|
262322
|
+
if (methodNames.length === 0) {
|
|
262323
|
+
return [];
|
|
262324
|
+
}
|
|
262325
|
+
return methodNames.map((methodName) => {
|
|
262326
|
+
return {
|
|
262327
|
+
name: methodName,
|
|
262328
|
+
docs: parsedMethods[methodName].docs,
|
|
262329
|
+
complexType: parsedMethods[methodName].complexType,
|
|
262330
|
+
internal: isInternal(parsedMethods[methodName].docs)
|
|
262331
|
+
};
|
|
262332
|
+
});
|
|
262333
|
+
};
|
|
262334
|
+
|
|
262335
|
+
// src/compiler/transformers/static-to-meta/props.ts
|
|
262336
|
+
var parseStaticProps = (staticMembers) => {
|
|
262337
|
+
const parsedProps = getStaticValue(staticMembers, "properties");
|
|
262338
|
+
if (!parsedProps) {
|
|
262339
|
+
return [];
|
|
262340
|
+
}
|
|
262341
|
+
const propNames = Object.keys(parsedProps);
|
|
262342
|
+
if (propNames.length === 0) {
|
|
262343
|
+
return [];
|
|
262344
|
+
}
|
|
262345
|
+
return propNames.map((propName) => {
|
|
262346
|
+
const val = parsedProps[propName];
|
|
262347
|
+
return {
|
|
262348
|
+
name: propName,
|
|
262349
|
+
type: val.type,
|
|
262350
|
+
attribute: val.attribute ? val.attribute.toLowerCase() : void 0,
|
|
262351
|
+
reflect: typeof val.reflect === "boolean" ? val.reflect : false,
|
|
262352
|
+
mutable: !!val.mutable,
|
|
262353
|
+
required: !!val.required,
|
|
262354
|
+
optional: !!val.optional,
|
|
262355
|
+
defaultValue: val.defaultValue,
|
|
262356
|
+
complexType: val.complexType,
|
|
262357
|
+
docs: val.docs,
|
|
262358
|
+
internal: isInternal(val.docs),
|
|
262359
|
+
getter: !!val.getter,
|
|
262360
|
+
setter: !!val.setter
|
|
262361
|
+
};
|
|
262362
|
+
});
|
|
262363
|
+
};
|
|
262364
|
+
|
|
262365
|
+
// src/compiler/transformers/static-to-meta/states.ts
|
|
262366
|
+
var parseStaticStates = (staticMembers) => {
|
|
262367
|
+
const parsedStates = getStaticValue(staticMembers, "states");
|
|
262368
|
+
if (!parsedStates) {
|
|
262369
|
+
return [];
|
|
262370
|
+
}
|
|
262371
|
+
const stateNames = Object.keys(parsedStates);
|
|
262372
|
+
if (stateNames.length === 0) {
|
|
262373
|
+
return [];
|
|
262374
|
+
}
|
|
262375
|
+
return stateNames.map((stateName) => {
|
|
262376
|
+
return {
|
|
262377
|
+
name: stateName
|
|
262378
|
+
};
|
|
262379
|
+
});
|
|
262380
|
+
};
|
|
262381
|
+
|
|
262372
262382
|
// src/compiler/transformers/static-to-meta/watchers.ts
|
|
262373
262383
|
var parseStaticWatchers = (staticMembers) => {
|
|
262374
262384
|
const parsedWatchers = getStaticValue(staticMembers, "watchers");
|
|
@@ -262383,62 +262393,113 @@ var parseStaticWatchers = (staticMembers) => {
|
|
|
262383
262393
|
});
|
|
262384
262394
|
};
|
|
262385
262395
|
|
|
262386
|
-
// src/compiler/transformers/static-to-meta/
|
|
262387
|
-
var
|
|
262388
|
-
|
|
262389
|
-
|
|
262390
|
-
|
|
262391
|
-
|
|
262392
|
-
|
|
262393
|
-
|
|
262394
|
-
|
|
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
|
|
262396
|
+
// src/compiler/transformers/static-to-meta/class-extension.ts
|
|
262397
|
+
var deDupeMembers = (dedupeMembers, staticMembers) => {
|
|
262398
|
+
return dedupeMembers.filter(
|
|
262399
|
+
(s) => !staticMembers.some((d) => {
|
|
262400
|
+
if (d.methodName) {
|
|
262401
|
+
return d.methodName === s.methodName;
|
|
262402
|
+
}
|
|
262403
|
+
return d.name === s.name;
|
|
262404
|
+
})
|
|
262399
262405
|
);
|
|
262400
|
-
|
|
262401
|
-
|
|
262406
|
+
};
|
|
262407
|
+
function findClassWalk(node, name) {
|
|
262408
|
+
var _a2;
|
|
262409
|
+
if (!node) return void 0;
|
|
262410
|
+
if (node && import_typescript59.default.isClassDeclaration(node) && (!name || ((_a2 = node.name) == null ? void 0 : _a2.text) === name)) {
|
|
262411
|
+
return node;
|
|
262402
262412
|
}
|
|
262413
|
+
let found2;
|
|
262414
|
+
import_typescript59.default.forEachChild(node, (child) => {
|
|
262415
|
+
if (found2) return;
|
|
262416
|
+
const result2 = findClassWalk(child, name);
|
|
262417
|
+
if (result2) found2 = result2;
|
|
262418
|
+
});
|
|
262419
|
+
return found2;
|
|
262420
|
+
}
|
|
262421
|
+
function matchesNamedDeclaration(name) {
|
|
262422
|
+
return function(stmt) {
|
|
262423
|
+
var _a2, _b;
|
|
262424
|
+
if (import_typescript59.default.isClassDeclaration(stmt) && ((_a2 = stmt.name) == null ? void 0 : _a2.text) === name) {
|
|
262425
|
+
return true;
|
|
262426
|
+
}
|
|
262427
|
+
if (import_typescript59.default.isFunctionDeclaration(stmt) && ((_b = stmt.name) == null ? void 0 : _b.text) === name) {
|
|
262428
|
+
return true;
|
|
262429
|
+
}
|
|
262430
|
+
if (import_typescript59.default.isVariableStatement(stmt)) {
|
|
262431
|
+
for (const decl of stmt.declarationList.declarations) {
|
|
262432
|
+
if (import_typescript59.default.isIdentifier(decl.name) && decl.name.text === name) {
|
|
262433
|
+
return true;
|
|
262434
|
+
}
|
|
262435
|
+
}
|
|
262436
|
+
}
|
|
262437
|
+
return false;
|
|
262438
|
+
};
|
|
262439
|
+
}
|
|
262440
|
+
function buildExtendsTree(compilerCtx, classDeclaration3, dependentClasses, typeChecker, buildCtx) {
|
|
262441
|
+
const hasHeritageClauses = classDeclaration3.heritageClauses;
|
|
262442
|
+
if (!(hasHeritageClauses == null ? void 0 : hasHeritageClauses.length)) return dependentClasses;
|
|
262443
|
+
const extendsClause = hasHeritageClauses.find((clause) => clause.token === import_typescript59.default.SyntaxKind.ExtendsKeyword);
|
|
262444
|
+
if (!extendsClause) return dependentClasses;
|
|
262445
|
+
let classIdentifiers = [];
|
|
262446
|
+
let foundClassDeclaration;
|
|
262447
|
+
let keepLooking = true;
|
|
262403
262448
|
extendsClause.types.forEach((type) => {
|
|
262404
|
-
|
|
262449
|
+
if (import_typescript59.default.isExpressionWithTypeArguments(type) && import_typescript59.default.isCallExpression(type.expression) && type.expression.expression.getText() === "Mixin") {
|
|
262450
|
+
classIdentifiers = type.expression.arguments.filter(import_typescript59.default.isIdentifier);
|
|
262451
|
+
} else if (import_typescript59.default.isIdentifier(type.expression)) {
|
|
262452
|
+
classIdentifiers = [type.expression];
|
|
262453
|
+
}
|
|
262454
|
+
});
|
|
262455
|
+
classIdentifiers.forEach((extendee) => {
|
|
262456
|
+
var _a2, _b, _c;
|
|
262405
262457
|
try {
|
|
262406
|
-
const
|
|
262407
|
-
|
|
262408
|
-
|
|
262409
|
-
|
|
262458
|
+
const symbol = typeChecker.getSymbolAtLocation(extendee);
|
|
262459
|
+
const aliasedSymbol = symbol ? typeChecker.getAliasedSymbol(symbol) : void 0;
|
|
262460
|
+
foundClassDeclaration = (_a2 = aliasedSymbol == null ? void 0 : aliasedSymbol.declarations) == null ? void 0 : _a2.find(import_typescript59.default.isClassDeclaration);
|
|
262461
|
+
if (!foundClassDeclaration) {
|
|
262462
|
+
const node = (_b = aliasedSymbol == null ? void 0 : aliasedSymbol.declarations) == null ? void 0 : _b[0];
|
|
262463
|
+
foundClassDeclaration = findClassWalk(node);
|
|
262464
|
+
keepLooking = false;
|
|
262465
|
+
}
|
|
262466
|
+
if (foundClassDeclaration && !dependentClasses.some((dc) => dc.classNode === foundClassDeclaration)) {
|
|
262467
|
+
const foundModule = compilerCtx.moduleMap.get(foundClassDeclaration.getSourceFile().fileName);
|
|
262410
262468
|
if (foundModule) {
|
|
262411
262469
|
const source = foundModule.staticSourceFile;
|
|
262412
|
-
source.
|
|
262413
|
-
|
|
262414
|
-
|
|
262415
|
-
|
|
262470
|
+
const sourceClass = findClassWalk(source, (_c = foundClassDeclaration.name) == null ? void 0 : _c.getText());
|
|
262471
|
+
if (sourceClass) {
|
|
262472
|
+
dependentClasses.push({ classNode: sourceClass, fileName: source.fileName });
|
|
262473
|
+
if (keepLooking) {
|
|
262474
|
+
buildExtendsTree(compilerCtx, foundClassDeclaration, dependentClasses, typeChecker, buildCtx);
|
|
262416
262475
|
}
|
|
262417
|
-
}
|
|
262476
|
+
}
|
|
262418
262477
|
}
|
|
262419
262478
|
}
|
|
262420
|
-
} catch (
|
|
262479
|
+
} catch (_e) {
|
|
262421
262480
|
const currentSource = classDeclaration3.getSourceFile();
|
|
262422
|
-
|
|
262423
|
-
const
|
|
262424
|
-
|
|
262425
|
-
|
|
262426
|
-
|
|
262427
|
-
|
|
262428
|
-
|
|
262429
|
-
|
|
262430
|
-
|
|
262431
|
-
|
|
262432
|
-
|
|
262433
|
-
|
|
262481
|
+
if (!currentSource) return;
|
|
262482
|
+
const matchedStatement = currentSource.statements.find(matchesNamedDeclaration(extendee.getText()));
|
|
262483
|
+
if (matchedStatement && import_typescript59.default.isClassDeclaration(matchedStatement)) {
|
|
262484
|
+
foundClassDeclaration = matchedStatement;
|
|
262485
|
+
} else if (matchedStatement) {
|
|
262486
|
+
foundClassDeclaration = findClassWalk(matchedStatement);
|
|
262487
|
+
keepLooking = false;
|
|
262488
|
+
}
|
|
262489
|
+
if (foundClassDeclaration && !dependentClasses.some((dc) => dc.classNode === foundClassDeclaration)) {
|
|
262490
|
+
dependentClasses.push({ classNode: foundClassDeclaration, fileName: currentSource.fileName });
|
|
262491
|
+
if (keepLooking) {
|
|
262492
|
+
buildExtendsTree(compilerCtx, foundClassDeclaration, dependentClasses, typeChecker, buildCtx);
|
|
262493
|
+
}
|
|
262494
|
+
return;
|
|
262434
262495
|
}
|
|
262435
|
-
|
|
262496
|
+
const importStatements = currentSource.statements.filter(import_typescript59.default.isImportDeclaration);
|
|
262436
262497
|
importStatements.forEach((statement) => {
|
|
262437
|
-
var _a3,
|
|
262438
|
-
if (import_typescript59.default.isNamedImports((
|
|
262439
|
-
(
|
|
262498
|
+
var _a3, _b2, _c2;
|
|
262499
|
+
if (((_a3 = statement.importClause) == null ? void 0 : _a3.namedBindings) && import_typescript59.default.isNamedImports((_b2 = statement.importClause) == null ? void 0 : _b2.namedBindings)) {
|
|
262500
|
+
(_c2 = statement.importClause) == null ? void 0 : _c2.namedBindings.elements.forEach((element) => {
|
|
262440
262501
|
var _a4;
|
|
262441
|
-
if (element.name.getText() ===
|
|
262502
|
+
if (element.name.getText() === extendee.getText()) {
|
|
262442
262503
|
const className = ((_a4 = element.propertyName) == null ? void 0 : _a4.getText()) || element.name.getText();
|
|
262443
262504
|
const foundFile = tsResolveModuleName(
|
|
262444
262505
|
buildCtx.config,
|
|
@@ -262446,15 +262507,23 @@ var buildExtendsTree = (compilerCtx, classDeclaration3, dependentClasses, typeCh
|
|
|
262446
262507
|
statement.moduleSpecifier.getText().replaceAll(/['"]/g, ""),
|
|
262447
262508
|
currentSource.fileName
|
|
262448
262509
|
);
|
|
262449
|
-
if (foundFile) {
|
|
262510
|
+
if ((foundFile == null ? void 0 : foundFile.resolvedModule) && className) {
|
|
262450
262511
|
const foundModule = compilerCtx.moduleMap.get(foundFile.resolvedModule.resolvedFileName);
|
|
262451
|
-
(foundModule == null ? void 0 : foundModule.staticSourceFile).statements.
|
|
262452
|
-
|
|
262453
|
-
|
|
262454
|
-
|
|
262455
|
-
|
|
262512
|
+
const matchedStatement2 = (foundModule == null ? void 0 : foundModule.staticSourceFile).statements.find(
|
|
262513
|
+
matchesNamedDeclaration(className)
|
|
262514
|
+
);
|
|
262515
|
+
foundClassDeclaration = matchedStatement2 ? import_typescript59.default.isClassDeclaration(matchedStatement2) ? matchedStatement2 : void 0 : void 0;
|
|
262516
|
+
if (!foundClassDeclaration && matchedStatement2) {
|
|
262517
|
+
foundClassDeclaration = findClassWalk(matchedStatement2);
|
|
262518
|
+
keepLooking = false;
|
|
262519
|
+
}
|
|
262520
|
+
if (foundClassDeclaration && !dependentClasses.some((dc) => dc.classNode === foundClassDeclaration)) {
|
|
262521
|
+
dependentClasses.push({ classNode: foundClassDeclaration, fileName: currentSource.fileName });
|
|
262522
|
+
if (keepLooking) {
|
|
262523
|
+
buildExtendsTree(compilerCtx, foundClassDeclaration, dependentClasses, typeChecker, buildCtx);
|
|
262456
262524
|
}
|
|
262457
|
-
|
|
262525
|
+
return;
|
|
262526
|
+
}
|
|
262458
262527
|
}
|
|
262459
262528
|
}
|
|
262460
262529
|
});
|
|
@@ -262463,58 +262532,73 @@ var buildExtendsTree = (compilerCtx, classDeclaration3, dependentClasses, typeCh
|
|
|
262463
262532
|
}
|
|
262464
262533
|
});
|
|
262465
262534
|
return dependentClasses;
|
|
262466
|
-
}
|
|
262467
|
-
|
|
262468
|
-
|
|
262469
|
-
|
|
262470
|
-
|
|
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;
|
|
262479
|
-
if (cmpNode.members == null) {
|
|
262480
|
-
return cmpNode;
|
|
262481
|
-
}
|
|
262482
|
-
const staticMembers = cmpNode.members.filter(isStaticGetter);
|
|
262483
|
-
const tagName = getComponentTagName(staticMembers);
|
|
262484
|
-
if (tagName == null) {
|
|
262485
|
-
return cmpNode;
|
|
262486
|
-
}
|
|
262535
|
+
}
|
|
262536
|
+
function mergeExtendedClassMeta(compilerCtx, typeChecker, buildCtx, cmpNode, staticMembers) {
|
|
262537
|
+
const tree = buildExtendsTree(compilerCtx, cmpNode, [], typeChecker, buildCtx);
|
|
262538
|
+
let hasMixin = false;
|
|
262539
|
+
let doesExtend = false;
|
|
262487
262540
|
let properties = parseStaticProps(staticMembers);
|
|
262488
262541
|
let states = parseStaticStates(staticMembers);
|
|
262489
262542
|
let methods = parseStaticMethods(staticMembers);
|
|
262490
262543
|
let listeners = parseStaticListeners(staticMembers);
|
|
262491
262544
|
let events = parseStaticEvents(staticMembers);
|
|
262492
262545
|
let watchers = parseStaticWatchers(staticMembers);
|
|
262493
|
-
let hasMixin = false;
|
|
262494
262546
|
let classMethods = cmpNode.members.filter(import_typescript59.default.isMethodDeclaration);
|
|
262495
|
-
|
|
262496
|
-
|
|
262497
|
-
tree.map((extendedClass) => {
|
|
262498
|
-
var _a3, _b, _c, _d, _e, _f, _g;
|
|
262547
|
+
tree.forEach((extendedClass) => {
|
|
262548
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
262499
262549
|
const extendedStaticMembers = extendedClass.classNode.members.filter(isStaticGetter);
|
|
262500
|
-
const mixinProps = (
|
|
262550
|
+
const mixinProps = (_a2 = parseStaticProps(extendedStaticMembers)) != null ? _a2 : [];
|
|
262501
262551
|
const mixinStates = (_b = parseStaticStates(extendedStaticMembers)) != null ? _b : [];
|
|
262552
|
+
const mixinMethods = (_c = parseStaticMethods(extendedStaticMembers)) != null ? _c : [];
|
|
262502
262553
|
const isMixin = mixinProps.length > 0 || mixinStates.length > 0;
|
|
262503
262554
|
const module2 = compilerCtx.moduleMap.get(extendedClass.fileName);
|
|
262555
|
+
if (!module2) return;
|
|
262504
262556
|
module2.isMixin = isMixin;
|
|
262505
262557
|
module2.isExtended = true;
|
|
262506
262558
|
doesExtend = true;
|
|
262559
|
+
if (isMixin && !detectModernPropDeclarations(extendedClass.classNode)) {
|
|
262560
|
+
const err2 = buildWarn(buildCtx.diagnostics);
|
|
262561
|
+
const target = (_d = buildCtx.config.tsCompilerOptions) == null ? void 0 : _d.target;
|
|
262562
|
+
err2.messageText = `Component classes can only extend from other Stencil decorated base classes when targetting more modern JavaScript (ES2022 and above).
|
|
262563
|
+
${target ? `Your current TypeScript configuration is set to target \`${import_typescript59.default.ScriptTarget[target]}\`.` : ""} Please amend your tsconfig.json.`;
|
|
262564
|
+
if (!buildCtx.config._isTesting) augmentDiagnosticWithNode(err2, extendedClass.classNode);
|
|
262565
|
+
}
|
|
262507
262566
|
properties = [...deDupeMembers(mixinProps, properties), ...properties];
|
|
262508
262567
|
states = [...deDupeMembers(mixinStates, states), ...states];
|
|
262509
|
-
methods = [...deDupeMembers(
|
|
262510
|
-
listeners = [...deDupeMembers((
|
|
262511
|
-
events = [...deDupeMembers((
|
|
262512
|
-
watchers = [...deDupeMembers((
|
|
262513
|
-
classMethods = [...classMethods, ...(
|
|
262514
|
-
if (isMixin)
|
|
262515
|
-
hasMixin = true;
|
|
262516
|
-
}
|
|
262568
|
+
methods = [...deDupeMembers(mixinMethods, methods), ...methods];
|
|
262569
|
+
listeners = [...deDupeMembers((_e = parseStaticListeners(extendedStaticMembers)) != null ? _e : [], listeners), ...listeners];
|
|
262570
|
+
events = [...deDupeMembers((_f = parseStaticEvents(extendedStaticMembers)) != null ? _f : [], events), ...events];
|
|
262571
|
+
watchers = [...deDupeMembers((_g = parseStaticWatchers(extendedStaticMembers)) != null ? _g : [], watchers), ...watchers];
|
|
262572
|
+
classMethods = [...classMethods, ...(_h = extendedClass.classNode.members.filter(import_typescript59.default.isMethodDeclaration)) != null ? _h : []];
|
|
262573
|
+
if (isMixin) hasMixin = true;
|
|
262517
262574
|
});
|
|
262575
|
+
return { hasMixin, doesExtend, properties, states, methods, listeners, events, watchers, classMethods };
|
|
262576
|
+
}
|
|
262577
|
+
|
|
262578
|
+
// src/compiler/transformers/static-to-meta/component.ts
|
|
262579
|
+
var BLACKLISTED_COMPONENT_METHODS = [
|
|
262580
|
+
/**
|
|
262581
|
+
* If someone would define a getter called "shadowRoot" on a component
|
|
262582
|
+
* this would cause issues when Stencil tries to hydrate the component.
|
|
262583
|
+
*/
|
|
262584
|
+
"shadowRoot"
|
|
262585
|
+
];
|
|
262586
|
+
var parseStaticComponentMeta = (compilerCtx, typeChecker, cmpNode, moduleFile, buildCtx, transformOpts) => {
|
|
262587
|
+
if (cmpNode.members == null) {
|
|
262588
|
+
return cmpNode;
|
|
262589
|
+
}
|
|
262590
|
+
const staticMembers = cmpNode.members.filter(isStaticGetter);
|
|
262591
|
+
const tagName = getComponentTagName(staticMembers);
|
|
262592
|
+
if (tagName == null) {
|
|
262593
|
+
return cmpNode;
|
|
262594
|
+
}
|
|
262595
|
+
const { doesExtend, properties, states, methods, listeners, events, watchers, classMethods } = mergeExtendedClassMeta(
|
|
262596
|
+
compilerCtx,
|
|
262597
|
+
typeChecker,
|
|
262598
|
+
buildCtx,
|
|
262599
|
+
cmpNode,
|
|
262600
|
+
staticMembers
|
|
262601
|
+
);
|
|
262518
262602
|
const symbol = typeChecker ? typeChecker.getSymbolAtLocation(cmpNode.name) : void 0;
|
|
262519
262603
|
const docs = serializeSymbol(typeChecker, symbol);
|
|
262520
262604
|
const isCollectionDependency = moduleFile.isCollectionDependency;
|
|
@@ -262603,23 +262687,17 @@ var parseStaticComponentMeta = (compilerCtx, typeChecker, cmpNode, moduleFile, b
|
|
|
262603
262687
|
};
|
|
262604
262688
|
const visitComponentChildNode = (node, buildCtx2) => {
|
|
262605
262689
|
validateComponentMembers(node, buildCtx2);
|
|
262606
|
-
if (
|
|
262690
|
+
if (import_typescript60.default.isCallExpression(node)) {
|
|
262607
262691
|
parseCallExpression(cmp, node);
|
|
262608
|
-
} else if (
|
|
262692
|
+
} else if (import_typescript60.default.isStringLiteral(node)) {
|
|
262609
262693
|
parseStringLiteral(cmp, node);
|
|
262610
262694
|
}
|
|
262611
262695
|
node.forEachChild((child) => visitComponentChildNode(child, buildCtx2));
|
|
262612
262696
|
};
|
|
262613
262697
|
visitComponentChildNode(cmpNode, buildCtx);
|
|
262614
262698
|
parseClassMethods(classMethods, cmp);
|
|
262615
|
-
const hasModernPropertyDecls = detectModernPropDeclarations(cmpNode
|
|
262616
|
-
|
|
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
|
-
}
|
|
262699
|
+
const hasModernPropertyDecls = detectModernPropDeclarations(cmpNode);
|
|
262700
|
+
cmp.hasModernPropertyDecls = hasModernPropertyDecls;
|
|
262623
262701
|
cmp.htmlAttrNames = unique(cmp.htmlAttrNames);
|
|
262624
262702
|
cmp.htmlTagNames = unique(cmp.htmlTagNames);
|
|
262625
262703
|
cmp.potentialCmpRefs = unique(cmp.potentialCmpRefs);
|
|
@@ -262640,15 +262718,15 @@ var validateComponentMembers = (node, buildCtx) => {
|
|
|
262640
262718
|
/**
|
|
262641
262719
|
* the component has a getter called "shadowRoot"
|
|
262642
262720
|
*/
|
|
262643
|
-
|
|
262721
|
+
import_typescript60.default.isGetAccessorDeclaration(node) && import_typescript60.default.isIdentifier(node.name) && typeof node.name.escapedText === "string" && BLACKLISTED_COMPONENT_METHODS.includes(node.name.escapedText) && /**
|
|
262644
262722
|
* the parent node is a class declaration
|
|
262645
262723
|
*/
|
|
262646
|
-
node.parent &&
|
|
262724
|
+
node.parent && import_typescript60.default.isClassDeclaration(node.parent)
|
|
262647
262725
|
) {
|
|
262648
262726
|
const propName = node.name.escapedText;
|
|
262649
|
-
const decorator3 =
|
|
262650
|
-
if (
|
|
262651
|
-
(prop) =>
|
|
262727
|
+
const decorator3 = import_typescript60.default.getDecorators(node.parent)[0];
|
|
262728
|
+
if (import_typescript60.default.isCallExpression(decorator3.expression) && decorator3.expression.arguments.length === 1 && import_typescript60.default.isObjectLiteralExpression(decorator3.expression.arguments[0]) && decorator3.expression.arguments[0].properties.some(
|
|
262729
|
+
(prop) => import_typescript60.default.isPropertyAssignment(prop) && prop.name.getText() === "tag"
|
|
262652
262730
|
)) {
|
|
262653
262731
|
const componentName = node.parent.name.getText();
|
|
262654
262732
|
const err2 = buildWarn(buildCtx.diagnostics);
|
|
@@ -262694,7 +262772,7 @@ var parseAssetsDirs = (staticMembers, componentFilePath) => {
|
|
|
262694
262772
|
|
|
262695
262773
|
// src/compiler/transformers/static-to-meta/import.ts
|
|
262696
262774
|
var import_path50 = require("path");
|
|
262697
|
-
var
|
|
262775
|
+
var import_typescript62 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
262698
262776
|
|
|
262699
262777
|
// src/compiler/transformers/collections/add-external-import.ts
|
|
262700
262778
|
var import_path49 = require("path");
|
|
@@ -262703,7 +262781,7 @@ var import_path49 = require("path");
|
|
|
262703
262781
|
var import_path48 = require("path");
|
|
262704
262782
|
|
|
262705
262783
|
// src/compiler/transformers/collections/parse-collection-components.ts
|
|
262706
|
-
var
|
|
262784
|
+
var import_typescript61 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
262707
262785
|
var parseCollectionComponents = (config, compilerCtx, buildCtx, collectionDir, collectionManifest, collection) => {
|
|
262708
262786
|
if (collectionManifest.entries) {
|
|
262709
262787
|
collectionManifest.entries.forEach((entryPath) => {
|
|
@@ -262714,7 +262792,7 @@ var parseCollectionComponents = (config, compilerCtx, buildCtx, collectionDir, c
|
|
|
262714
262792
|
};
|
|
262715
262793
|
var transpileCollectionModule = (config, compilerCtx, buildCtx, collection, inputFileName) => {
|
|
262716
262794
|
const sourceText = compilerCtx.fs.readFileSync(inputFileName);
|
|
262717
|
-
const sourceFile =
|
|
262795
|
+
const sourceFile = import_typescript61.default.createSourceFile(inputFileName, sourceText, import_typescript61.default.ScriptTarget.ES2017, true, import_typescript61.default.ScriptKind.JS);
|
|
262718
262796
|
return updateModule(config, compilerCtx, buildCtx, sourceFile, sourceText, inputFileName, void 0, collection);
|
|
262719
262797
|
};
|
|
262720
262798
|
|
|
@@ -262862,7 +262940,7 @@ var addExternalImport = (config, compilerCtx, buildCtx, moduleFile, containingFi
|
|
|
262862
262940
|
|
|
262863
262941
|
// src/compiler/transformers/static-to-meta/import.ts
|
|
262864
262942
|
var parseModuleImport = (config, compilerCtx, buildCtx, moduleFile, dirPath, importNode, resolveCollections) => {
|
|
262865
|
-
if (importNode.moduleSpecifier &&
|
|
262943
|
+
if (importNode.moduleSpecifier && import_typescript62.default.isStringLiteral(importNode.moduleSpecifier)) {
|
|
262866
262944
|
let importPath = importNode.moduleSpecifier.text;
|
|
262867
262945
|
if (!moduleFile.originalImports.includes(importPath)) {
|
|
262868
262946
|
moduleFile.originalImports.push(importPath);
|
|
@@ -262910,15 +262988,15 @@ var updateModule = (config, compilerCtx, buildCtx, tsSourceFile, sourceFileText,
|
|
|
262910
262988
|
compilerCtx.moduleMap.set(moduleFileKey, moduleFile);
|
|
262911
262989
|
compilerCtx.changedModules.add(moduleFile.sourceFilePath);
|
|
262912
262990
|
const visitNode = (node) => {
|
|
262913
|
-
if (
|
|
262991
|
+
if (import_typescript63.default.isClassDeclaration(node)) {
|
|
262914
262992
|
parseStaticComponentMeta(compilerCtx, typeChecker, node, moduleFile, buildCtx, void 0);
|
|
262915
262993
|
return;
|
|
262916
|
-
} else if (
|
|
262994
|
+
} else if (import_typescript63.default.isImportDeclaration(node)) {
|
|
262917
262995
|
parseModuleImport(config, compilerCtx, buildCtx, moduleFile, srcDirPath, node, true);
|
|
262918
262996
|
return;
|
|
262919
|
-
} else if (
|
|
262997
|
+
} else if (import_typescript63.default.isCallExpression(node)) {
|
|
262920
262998
|
parseCallExpression(moduleFile, node);
|
|
262921
|
-
} else if (
|
|
262999
|
+
} else if (import_typescript63.default.isStringLiteral(node)) {
|
|
262922
263000
|
parseStringLiteral(moduleFile, node);
|
|
262923
263001
|
}
|
|
262924
263002
|
node.forEachChild(visitNode);
|
|
@@ -262930,12 +263008,12 @@ var updateModule = (config, compilerCtx, buildCtx, tsSourceFile, sourceFileText,
|
|
|
262930
263008
|
}
|
|
262931
263009
|
visitNode(tsSourceFile);
|
|
262932
263010
|
if (moduleFile.cmps.length > 0) {
|
|
262933
|
-
moduleFile.staticSourceFile =
|
|
263011
|
+
moduleFile.staticSourceFile = import_typescript63.default.createSourceFile(
|
|
262934
263012
|
sourceFilePath,
|
|
262935
263013
|
sourceFileText,
|
|
262936
263014
|
tsSourceFile.languageVersion,
|
|
262937
263015
|
true,
|
|
262938
|
-
|
|
263016
|
+
import_typescript63.default.ScriptKind.JS
|
|
262939
263017
|
);
|
|
262940
263018
|
}
|
|
262941
263019
|
return moduleFile;
|
|
@@ -264179,14 +264257,14 @@ var isWatchIgnorePath = (config, path7) => {
|
|
|
264179
264257
|
};
|
|
264180
264258
|
|
|
264181
264259
|
// src/compiler/transpile/create-watch-program.ts
|
|
264182
|
-
var
|
|
264260
|
+
var import_typescript64 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
264183
264261
|
var createTsWatchProgram = async (config, buildCallback) => {
|
|
264184
264262
|
let isRunning = false;
|
|
264185
264263
|
let lastTsBuilder;
|
|
264186
264264
|
let timeoutId;
|
|
264187
264265
|
const optionsToExtend = getTsOptionsToExtend(config);
|
|
264188
264266
|
const tsWatchSys = {
|
|
264189
|
-
...
|
|
264267
|
+
...import_typescript64.default.sys,
|
|
264190
264268
|
/**
|
|
264191
264269
|
* Override the default `setTimeout` implementation in the {@link ts.System}. The reasoning
|
|
264192
264270
|
* behind this change is not explicitly clear, but this appears to be related to debouncing
|
|
@@ -264214,7 +264292,7 @@ var createTsWatchProgram = async (config, buildCallback) => {
|
|
|
264214
264292
|
}
|
|
264215
264293
|
};
|
|
264216
264294
|
config.sys.addDestroy(() => tsWatchSys.clearTimeout(timeoutId));
|
|
264217
|
-
const tsWatchHost =
|
|
264295
|
+
const tsWatchHost = import_typescript64.default.createWatchCompilerHost(
|
|
264218
264296
|
// Use the TS config from the Stencil project
|
|
264219
264297
|
config.tsconfig,
|
|
264220
264298
|
optionsToExtend,
|
|
@@ -264222,7 +264300,7 @@ var createTsWatchProgram = async (config, buildCallback) => {
|
|
|
264222
264300
|
// We use the `createEmitAndSemanticDiagnosticsBuilderProgram` as opposed to the
|
|
264223
264301
|
// `createSemanticDiagnosticsBuilderProgram` because we need our program to emit
|
|
264224
264302
|
// output files in addition to checking for errors
|
|
264225
|
-
|
|
264303
|
+
import_typescript64.default.createEmitAndSemanticDiagnosticsBuilderProgram,
|
|
264226
264304
|
// Add a callback to log out diagnostics as the program runs
|
|
264227
264305
|
(reportDiagnostic) => {
|
|
264228
264306
|
config.logger.debug("watch reportDiagnostic:" + reportDiagnostic.messageText);
|
|
@@ -264249,7 +264327,7 @@ var createTsWatchProgram = async (config, buildCallback) => {
|
|
|
264249
264327
|
// Create the watch builder program instance and make it available on the
|
|
264250
264328
|
// returned object. This provides us an easy way to teardown the program
|
|
264251
264329
|
// down-the-road.
|
|
264252
|
-
program:
|
|
264330
|
+
program: import_typescript64.default.createWatchProgram(tsWatchHost),
|
|
264253
264331
|
// This will be called via a callback on the watch build whenever a file
|
|
264254
264332
|
// change is detected
|
|
264255
264333
|
rebuild: () => {
|
|
@@ -266306,7 +266384,7 @@ var extname9 = (str) => {
|
|
|
266306
266384
|
var SKIP_EXT = /* @__PURE__ */ new Set(["zip", "rar", "tar", "gz", "bz2", "png", "jpeg", "jpg", "gif", "pdf", "tiff", "psd"]);
|
|
266307
266385
|
|
|
266308
266386
|
// src/compiler/sys/node-require.ts
|
|
266309
|
-
var
|
|
266387
|
+
var import_typescript65 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
266310
266388
|
var nodeRequire = (id) => {
|
|
266311
266389
|
const results = {
|
|
266312
266390
|
module: void 0,
|
|
@@ -266321,13 +266399,13 @@ var nodeRequire = (id) => {
|
|
|
266321
266399
|
require.extensions[".ts"] = (module2, fileName) => {
|
|
266322
266400
|
let sourceText = fs2.readFileSync(fileName, "utf8");
|
|
266323
266401
|
if (fileName.endsWith(".ts")) {
|
|
266324
|
-
const tsResults =
|
|
266402
|
+
const tsResults = import_typescript65.default.transpileModule(sourceText, {
|
|
266325
266403
|
fileName,
|
|
266326
266404
|
compilerOptions: {
|
|
266327
|
-
module:
|
|
266328
|
-
moduleResolution:
|
|
266405
|
+
module: import_typescript65.default.ModuleKind.CommonJS,
|
|
266406
|
+
moduleResolution: import_typescript65.default.ModuleResolutionKind.NodeJs,
|
|
266329
266407
|
esModuleInterop: true,
|
|
266330
|
-
target:
|
|
266408
|
+
target: import_typescript65.default.ScriptTarget.ES2017,
|
|
266331
266409
|
allowJs: true
|
|
266332
266410
|
}
|
|
266333
266411
|
});
|
|
@@ -267129,7 +267207,7 @@ var createCompiler = async (userConfig) => {
|
|
|
267129
267207
|
const sys = config.sys;
|
|
267130
267208
|
const compilerCtx = new CompilerContext();
|
|
267131
267209
|
if (isFunction(config.sys.setupCompiler)) {
|
|
267132
|
-
config.sys.setupCompiler({ ts:
|
|
267210
|
+
config.sys.setupCompiler({ ts: import_typescript66.default });
|
|
267133
267211
|
}
|
|
267134
267212
|
compilerCtx.fs = createInMemoryFs(sys);
|
|
267135
267213
|
compilerCtx.cache = new Cache(config, createInMemoryFs(sys));
|
|
@@ -267163,7 +267241,7 @@ var import_path63 = require("path");
|
|
|
267163
267241
|
|
|
267164
267242
|
// src/compiler/sys/typescript/typescript-config.ts
|
|
267165
267243
|
var import_path62 = require("path");
|
|
267166
|
-
var
|
|
267244
|
+
var import_typescript67 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
267167
267245
|
var validateTsConfig = async (config, sys, init) => {
|
|
267168
267246
|
var _a2;
|
|
267169
267247
|
const tsconfig = {
|
|
@@ -267185,7 +267263,7 @@ var validateTsConfig = async (config, sys, init) => {
|
|
|
267185
267263
|
} else {
|
|
267186
267264
|
tsconfig.path = readTsConfig.path;
|
|
267187
267265
|
const host = {
|
|
267188
|
-
...
|
|
267266
|
+
...import_typescript67.default.sys,
|
|
267189
267267
|
readFile: (p) => {
|
|
267190
267268
|
if (p === tsconfig.path) {
|
|
267191
267269
|
return readTsConfig.content;
|
|
@@ -267196,7 +267274,7 @@ var validateTsConfig = async (config, sys, init) => {
|
|
|
267196
267274
|
fileExists: (p) => sys.accessSync(p),
|
|
267197
267275
|
onUnRecoverableConfigFileDiagnostic: (e) => console.error(e)
|
|
267198
267276
|
};
|
|
267199
|
-
const results =
|
|
267277
|
+
const results = import_typescript67.default.getParsedCommandLineOfConfigFile(tsconfig.path, {}, host);
|
|
267200
267278
|
if (results === void 0) {
|
|
267201
267279
|
throw "Encountered an error reading tsconfig!";
|
|
267202
267280
|
}
|
|
@@ -267240,12 +267318,12 @@ var validateTsConfig = async (config, sys, init) => {
|
|
|
267240
267318
|
}
|
|
267241
267319
|
if (results.options) {
|
|
267242
267320
|
tsconfig.compilerOptions = results.options;
|
|
267243
|
-
const target = (_a2 = tsconfig.compilerOptions.target) != null ? _a2 :
|
|
267244
|
-
if ([
|
|
267321
|
+
const target = (_a2 = tsconfig.compilerOptions.target) != null ? _a2 : import_typescript67.default.ScriptTarget.ES5;
|
|
267322
|
+
if ([import_typescript67.default.ScriptTarget.ES3, import_typescript67.default.ScriptTarget.ES5, import_typescript67.default.ScriptTarget.ES2015, import_typescript67.default.ScriptTarget.ES2016].includes(target)) {
|
|
267245
267323
|
const warn = buildWarn(tsconfig.diagnostics);
|
|
267246
267324
|
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.`;
|
|
267247
267325
|
}
|
|
267248
|
-
if (tsconfig.compilerOptions.module !==
|
|
267326
|
+
if (tsconfig.compilerOptions.module !== import_typescript67.default.ModuleKind.ESNext && !config._isTesting) {
|
|
267249
267327
|
const warn = buildWarn(tsconfig.diagnostics);
|
|
267250
267328
|
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.`;
|
|
267251
267329
|
}
|
|
@@ -268642,26 +268720,26 @@ var VALID_TARGET = /* @__PURE__ */ new Set(["latest", "esnext", "es2020", "es201
|
|
|
268642
268720
|
|
|
268643
268721
|
// src/compiler/transpile/transpile-module.ts
|
|
268644
268722
|
var import_sys_api_node5 = require("../sys/node/index.js");
|
|
268645
|
-
var
|
|
268723
|
+
var import_typescript69 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
268646
268724
|
|
|
268647
268725
|
// src/compiler/transformers/static-to-meta/visitor.ts
|
|
268648
268726
|
var import_path67 = require("path");
|
|
268649
|
-
var
|
|
268727
|
+
var import_typescript68 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
268650
268728
|
var convertStaticToMeta = (config, compilerCtx, buildCtx, typeChecker, collection, transformOpts) => {
|
|
268651
268729
|
return (transformCtx) => {
|
|
268652
268730
|
let dirPath;
|
|
268653
268731
|
let moduleFile;
|
|
268654
268732
|
const visitNode = (node) => {
|
|
268655
|
-
if (
|
|
268733
|
+
if (import_typescript68.default.isClassDeclaration(node)) {
|
|
268656
268734
|
return parseStaticComponentMeta(compilerCtx, typeChecker, node, moduleFile, buildCtx, transformOpts);
|
|
268657
|
-
} else if (
|
|
268735
|
+
} else if (import_typescript68.default.isImportDeclaration(node)) {
|
|
268658
268736
|
parseModuleImport(config, compilerCtx, buildCtx, moduleFile, dirPath, node, !transformOpts.isolatedModules);
|
|
268659
|
-
} else if (
|
|
268737
|
+
} else if (import_typescript68.default.isCallExpression(node)) {
|
|
268660
268738
|
parseCallExpression(moduleFile, node);
|
|
268661
|
-
} else if (
|
|
268739
|
+
} else if (import_typescript68.default.isStringLiteral(node)) {
|
|
268662
268740
|
parseStringLiteral(moduleFile, node);
|
|
268663
268741
|
}
|
|
268664
|
-
return
|
|
268742
|
+
return import_typescript68.default.visitEachChild(node, visitNode, transformCtx);
|
|
268665
268743
|
};
|
|
268666
268744
|
return (tsSourceFile) => {
|
|
268667
268745
|
dirPath = (0, import_path67.dirname)(tsSourceFile.fileName);
|
|
@@ -268707,13 +268785,13 @@ var transpileModule = (config, input, transformOpts) => {
|
|
|
268707
268785
|
moduleFile: null
|
|
268708
268786
|
};
|
|
268709
268787
|
if (transformOpts.module === "cjs") {
|
|
268710
|
-
tsCompilerOptions.module =
|
|
268788
|
+
tsCompilerOptions.module = import_typescript69.default.ModuleKind.CommonJS;
|
|
268711
268789
|
} else {
|
|
268712
|
-
tsCompilerOptions.module =
|
|
268790
|
+
tsCompilerOptions.module = import_typescript69.default.ModuleKind.ESNext;
|
|
268713
268791
|
}
|
|
268714
268792
|
tsCompilerOptions.target = getScriptTargetKind(transformOpts);
|
|
268715
268793
|
if ((sourceFilePath.endsWith(".tsx") || sourceFilePath.endsWith(".jsx")) && tsCompilerOptions.jsx == null) {
|
|
268716
|
-
tsCompilerOptions.jsx =
|
|
268794
|
+
tsCompilerOptions.jsx = import_typescript69.default.JsxEmit.React;
|
|
268717
268795
|
}
|
|
268718
268796
|
if (tsCompilerOptions.jsx != null && !isString(tsCompilerOptions.jsxFactory)) {
|
|
268719
268797
|
tsCompilerOptions.jsxFactory = "h";
|
|
@@ -268724,7 +268802,7 @@ var transpileModule = (config, input, transformOpts) => {
|
|
|
268724
268802
|
if (tsCompilerOptions.paths && !isString(tsCompilerOptions.baseUrl)) {
|
|
268725
268803
|
tsCompilerOptions.baseUrl = ".";
|
|
268726
268804
|
}
|
|
268727
|
-
const sourceFile =
|
|
268805
|
+
const sourceFile = import_typescript69.default.createSourceFile(sourceFilePath, input, tsCompilerOptions.target);
|
|
268728
268806
|
const compilerHost = {
|
|
268729
268807
|
getSourceFile: (fileName) => {
|
|
268730
268808
|
return normalizePath(fileName) === normalizePath(sourceFilePath) ? sourceFile : void 0;
|
|
@@ -268740,13 +268818,13 @@ var transpileModule = (config, input, transformOpts) => {
|
|
|
268740
268818
|
useCaseSensitiveFileNames: () => false,
|
|
268741
268819
|
getCanonicalFileName: (fileName) => fileName,
|
|
268742
268820
|
getCurrentDirectory: () => transformOpts.currentDirectory || process.cwd(),
|
|
268743
|
-
getNewLine: () =>
|
|
268821
|
+
getNewLine: () => import_typescript69.default.sys.newLine || "\n",
|
|
268744
268822
|
fileExists: (fileName) => normalizePath(fileName) === normalizePath(sourceFilePath),
|
|
268745
268823
|
readFile: () => "",
|
|
268746
268824
|
directoryExists: () => true,
|
|
268747
268825
|
getDirectories: () => []
|
|
268748
268826
|
};
|
|
268749
|
-
const program3 =
|
|
268827
|
+
const program3 = import_typescript69.default.createProgram([sourceFilePath], tsCompilerOptions, compilerHost);
|
|
268750
268828
|
const typeChecker = program3.getTypeChecker();
|
|
268751
268829
|
const transformers = {
|
|
268752
268830
|
before: [
|
|
@@ -268778,10 +268856,10 @@ var transpileModule = (config, input, transformOpts) => {
|
|
|
268778
268856
|
};
|
|
268779
268857
|
var getScriptTargetKind = (transformOpts) => {
|
|
268780
268858
|
const target = transformOpts.target && transformOpts.target.toUpperCase();
|
|
268781
|
-
if (isNumber(
|
|
268782
|
-
return
|
|
268859
|
+
if (isNumber(import_typescript69.default.ScriptTarget[target])) {
|
|
268860
|
+
return import_typescript69.default.ScriptTarget[target];
|
|
268783
268861
|
}
|
|
268784
|
-
return
|
|
268862
|
+
return import_typescript69.default.ScriptTarget.Latest;
|
|
268785
268863
|
};
|
|
268786
268864
|
|
|
268787
268865
|
// src/compiler/transpile.ts
|