@stencil/core 4.40.1 → 4.41.0
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/config-flags.d.ts +2 -2
- package/cli/index.cjs +9 -4
- package/cli/index.js +9 -4
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +268 -136
- package/dev-server/client/index.js +12 -12
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +3 -3
- package/dev-server/index.js +2 -2
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +18 -11
- package/internal/app-data/package.json +1 -1
- package/internal/app-globals/package.json +1 -1
- package/internal/client/index.js +105 -25
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +64 -25
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +196 -135
- package/internal/package.json +1 -1
- package/internal/stencil-core/jsx-dev-runtime.cjs +7 -0
- package/internal/stencil-core/jsx-dev-runtime.d.ts +23 -0
- package/internal/stencil-core/jsx-dev-runtime.js +2 -0
- package/internal/stencil-core/jsx-runtime.cjs +8 -0
- package/internal/stencil-core/jsx-runtime.d.ts +22 -0
- package/internal/stencil-core/jsx-runtime.js +2 -0
- package/internal/stencil-private.d.ts +20 -0
- package/internal/stencil-public-compiler.d.ts +6 -0
- package/internal/stencil-public-docs.d.ts +11 -0
- package/internal/stencil-public-runtime.d.ts +29 -0
- package/internal/testing/index.js +753 -638
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +192 -135
- package/mock-doc/index.js +193 -135
- package/mock-doc/package.json +1 -1
- package/package.json +11 -1
- package/screenshot/index.js +29 -8
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +1 -1
- package/sys/node/index.js +29 -29
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +98 -70
- package/testing/package.json +1 -1
package/sys/node/package.json
CHANGED
package/sys/node/worker.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Stencil Node System Worker v4.
|
|
2
|
+
Stencil Node System Worker v4.41.0 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
"use strict";var f=Object.create;var d=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var g=(n,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of E(t))!R.call(n,e)&&e!==r&&d(n,e,{get:()=>t[e],enumerable:!(s=p(t,e))||s.enumerable});return n};var c=(n,t,r)=>(r=n!=null?f(y(n)):{},g(t||!n||!n.__esModule?d(r,"default",{value:n,enumerable:!0}):r,n));var l=c(require("../../compiler/stencil.js")),m=c(require("../../sys/node/index.js"));var a=(n,t)=>{let r=e=>{e&&e.code==="ERR_IPC_CHANNEL_CLOSED"&&n.exit(0)},s=(e,o)=>{let i={stencilId:e,stencilRtnValue:null,stencilRtnError:"Error"};typeof o=="string"?i.stencilRtnError+=": "+o:o&&(o.stack?i.stencilRtnError+=": "+o.stack:o.message&&(i.stencilRtnError+=":"+o.message)),n.send(i,r)};n.on("message",async e=>{if(e&&typeof e.stencilId=="number")try{let o={stencilId:e.stencilId,stencilRtnValue:await t(e),stencilRtnError:null};n.send(o,r)}catch(o){s(e.stencilId,o)}}),n.on("unhandledRejection",e=>{s(-1,e)})};var k=m.createNodeSys({process}),M=l.createWorkerMessageHandler(k);a(process,M);
|
package/testing/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Stencil Testing v4.
|
|
2
|
+
Stencil Testing v4.41.0 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
"use strict";
|
|
5
5
|
|
|
@@ -2032,6 +2032,8 @@ function newBrowserPage(browser) {
|
|
|
2032
2032
|
// src/testing/jest/jest-27-and-under/jest-environment.ts
|
|
2033
2033
|
function createJestPuppeteerEnvironment() {
|
|
2034
2034
|
const JestEnvironment = class extends import_jest_environment_node.default {
|
|
2035
|
+
browser;
|
|
2036
|
+
pages;
|
|
2035
2037
|
constructor(config) {
|
|
2036
2038
|
super(config);
|
|
2037
2039
|
this.browser = null;
|
|
@@ -2039,8 +2041,9 @@ function createJestPuppeteerEnvironment() {
|
|
|
2039
2041
|
}
|
|
2040
2042
|
async setup() {
|
|
2041
2043
|
if (process.env.__STENCIL_E2E_TESTS__ === "true") {
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
+
const globalContext = this.global;
|
|
2045
|
+
globalContext.__NEW_TEST_PAGE__ = this.newPuppeteerPage.bind(this);
|
|
2046
|
+
globalContext.__CLOSE_OPEN_PAGES__ = this.closeOpenPages.bind(this);
|
|
2044
2047
|
}
|
|
2045
2048
|
}
|
|
2046
2049
|
async newPuppeteerPage() {
|
|
@@ -4767,15 +4770,15 @@ var mockFetch = {
|
|
|
4767
4770
|
reset: mockFetchReset
|
|
4768
4771
|
};
|
|
4769
4772
|
var MockResponse404 = class extends import_mock_doc.MockResponse {
|
|
4773
|
+
ok = false;
|
|
4774
|
+
status = 404;
|
|
4775
|
+
statusText = "Not Found";
|
|
4770
4776
|
constructor() {
|
|
4771
4777
|
super("", {
|
|
4772
4778
|
headers: new import_mock_doc.MockHeaders({
|
|
4773
4779
|
"Content-Type": "text/plain"
|
|
4774
4780
|
})
|
|
4775
4781
|
});
|
|
4776
|
-
this.ok = false;
|
|
4777
|
-
this.status = 404;
|
|
4778
|
-
this.statusText = "Not Found";
|
|
4779
4782
|
}
|
|
4780
4783
|
async json() {
|
|
4781
4784
|
return { status: 404, statusText: "Not Found" };
|
|
@@ -5366,17 +5369,20 @@ var Jest27Stencil = class {
|
|
|
5366
5369
|
var import_jest_environment_node2 = require("jest-environment-node");
|
|
5367
5370
|
function createJestPuppeteerEnvironment2() {
|
|
5368
5371
|
const JestEnvironment = class extends import_jest_environment_node2.TestEnvironment {
|
|
5372
|
+
browser;
|
|
5373
|
+
pages;
|
|
5374
|
+
testPath;
|
|
5369
5375
|
constructor(config, context) {
|
|
5370
5376
|
super(config, context);
|
|
5371
5377
|
this.browser = null;
|
|
5372
5378
|
this.pages = [];
|
|
5373
|
-
this.testPath = null;
|
|
5374
5379
|
this.testPath = context.testPath;
|
|
5375
5380
|
}
|
|
5376
5381
|
async setup() {
|
|
5377
5382
|
if (process.env.__STENCIL_E2E_TESTS__ === "true") {
|
|
5378
|
-
|
|
5379
|
-
|
|
5383
|
+
const globalContext = this.global;
|
|
5384
|
+
globalContext.__NEW_TEST_PAGE__ = this.newPuppeteerPage.bind(this);
|
|
5385
|
+
globalContext.__CLOSE_OPEN_PAGES__ = this.closeOpenPages.bind(this);
|
|
5380
5386
|
}
|
|
5381
5387
|
}
|
|
5382
5388
|
/**
|
|
@@ -5397,7 +5403,8 @@ function createJestPuppeteerEnvironment2() {
|
|
|
5397
5403
|
fullName = `${currentParent.name} ${fullName}`;
|
|
5398
5404
|
currentParent = currentParent.parent;
|
|
5399
5405
|
}
|
|
5400
|
-
this.global
|
|
5406
|
+
const globalContext = this.global;
|
|
5407
|
+
globalContext.currentSpec = {
|
|
5401
5408
|
// the event's test's name is analogous to the original description in earlier versions of jest
|
|
5402
5409
|
description: eventTest.name,
|
|
5403
5410
|
fullName,
|
|
@@ -6399,17 +6406,20 @@ var Jest28Stencil = class {
|
|
|
6399
6406
|
var import_jest_environment_node3 = require("jest-environment-node");
|
|
6400
6407
|
function createJestPuppeteerEnvironment3() {
|
|
6401
6408
|
const JestEnvironment = class extends import_jest_environment_node3.TestEnvironment {
|
|
6409
|
+
browser;
|
|
6410
|
+
pages;
|
|
6411
|
+
testPath;
|
|
6402
6412
|
constructor(config, context) {
|
|
6403
6413
|
super(config, context);
|
|
6404
6414
|
this.browser = null;
|
|
6405
6415
|
this.pages = [];
|
|
6406
|
-
this.testPath = null;
|
|
6407
6416
|
this.testPath = context.testPath;
|
|
6408
6417
|
}
|
|
6409
6418
|
async setup() {
|
|
6410
6419
|
if (process.env.__STENCIL_E2E_TESTS__ === "true") {
|
|
6411
|
-
|
|
6412
|
-
|
|
6420
|
+
const globalContext = this.global;
|
|
6421
|
+
globalContext.__NEW_TEST_PAGE__ = this.newPuppeteerPage.bind(this);
|
|
6422
|
+
globalContext.__CLOSE_OPEN_PAGES__ = this.closeOpenPages.bind(this);
|
|
6413
6423
|
}
|
|
6414
6424
|
}
|
|
6415
6425
|
/**
|
|
@@ -6430,7 +6440,8 @@ function createJestPuppeteerEnvironment3() {
|
|
|
6430
6440
|
fullName = `${currentParent.name} ${fullName}`;
|
|
6431
6441
|
currentParent = currentParent.parent;
|
|
6432
6442
|
}
|
|
6433
|
-
this.global
|
|
6443
|
+
const globalContext = this.global;
|
|
6444
|
+
globalContext.currentSpec = {
|
|
6434
6445
|
// the event's test's name is analogous to the original description in earlier versions of jest
|
|
6435
6446
|
description: eventTest.name,
|
|
6436
6447
|
fullName,
|
|
@@ -7943,9 +7954,13 @@ var validateStats = (userConfig, userOutputs) => {
|
|
|
7943
7954
|
if (userConfig.flags.stats) {
|
|
7944
7955
|
const hasOutputTarget = userOutputs.some(isOutputTargetStats);
|
|
7945
7956
|
if (!hasOutputTarget) {
|
|
7946
|
-
|
|
7957
|
+
const statsOutput = {
|
|
7947
7958
|
type: STATS
|
|
7948
|
-
}
|
|
7959
|
+
};
|
|
7960
|
+
if (typeof userConfig.flags.stats === "string") {
|
|
7961
|
+
statsOutput.file = userConfig.flags.stats;
|
|
7962
|
+
}
|
|
7963
|
+
outputTargets.push(statsOutput);
|
|
7949
7964
|
}
|
|
7950
7965
|
}
|
|
7951
7966
|
outputTargets.push(...userOutputs.filter(isOutputTargetStats));
|
|
@@ -8220,6 +8235,9 @@ var validateDevServer = (config, diagnostics) => {
|
|
|
8220
8235
|
if (!isBoolean(devServer.websocket)) {
|
|
8221
8236
|
devServer.websocket = true;
|
|
8222
8237
|
}
|
|
8238
|
+
if (!isBoolean(devServer.strictPort)) {
|
|
8239
|
+
devServer.strictPort = false;
|
|
8240
|
+
}
|
|
8223
8241
|
if (flags.ssr) {
|
|
8224
8242
|
devServer.ssr = true;
|
|
8225
8243
|
} else {
|
|
@@ -8908,52 +8926,61 @@ var validateConfig = (userConfig = {}, bootstrapConfig) => {
|
|
|
8908
8926
|
|
|
8909
8927
|
// src/compiler/build/build-ctx.ts
|
|
8910
8928
|
var BuildContext = class {
|
|
8929
|
+
buildId = -1;
|
|
8930
|
+
buildMessages = [];
|
|
8931
|
+
buildResults = null;
|
|
8932
|
+
bundleBuildCount = 0;
|
|
8933
|
+
collections = [];
|
|
8934
|
+
completedTasks = [];
|
|
8935
|
+
compilerCtx;
|
|
8936
|
+
components = [];
|
|
8937
|
+
componentGraph = /* @__PURE__ */ new Map();
|
|
8938
|
+
config;
|
|
8939
|
+
data = {};
|
|
8940
|
+
buildStats = void 0;
|
|
8941
|
+
esmBrowserComponentBundle;
|
|
8942
|
+
esmComponentBundle;
|
|
8943
|
+
es5ComponentBundle;
|
|
8944
|
+
systemComponentBundle;
|
|
8945
|
+
commonJsComponentBundle;
|
|
8946
|
+
diagnostics = [];
|
|
8947
|
+
dirsAdded = [];
|
|
8948
|
+
dirsDeleted = [];
|
|
8949
|
+
entryModules = [];
|
|
8950
|
+
filesAdded = [];
|
|
8951
|
+
filesChanged = [];
|
|
8952
|
+
filesDeleted = [];
|
|
8953
|
+
filesUpdated = [];
|
|
8954
|
+
filesWritten = [];
|
|
8955
|
+
globalStyle = void 0;
|
|
8956
|
+
hasConfigChanges = false;
|
|
8957
|
+
hasFinished = false;
|
|
8958
|
+
hasHtmlChanges = false;
|
|
8959
|
+
hasPrintedResults = false;
|
|
8960
|
+
hasServiceWorkerChanges = false;
|
|
8961
|
+
hasScriptChanges = true;
|
|
8962
|
+
hasStyleChanges = true;
|
|
8963
|
+
hydrateAppFilePath = null;
|
|
8964
|
+
indexBuildCount = 0;
|
|
8965
|
+
indexDoc = void 0;
|
|
8966
|
+
isRebuild = false;
|
|
8967
|
+
moduleFiles = [];
|
|
8968
|
+
outputs = [];
|
|
8969
|
+
packageJson = {};
|
|
8970
|
+
packageJsonFilePath = null;
|
|
8971
|
+
pendingCopyTasks = [];
|
|
8972
|
+
requiresFullBuild = true;
|
|
8973
|
+
scriptsAdded = [];
|
|
8974
|
+
scriptsDeleted = [];
|
|
8975
|
+
startTime = Date.now();
|
|
8976
|
+
styleBuildCount = 0;
|
|
8977
|
+
stylesPromise = null;
|
|
8978
|
+
stylesUpdated = [];
|
|
8979
|
+
timeSpan = null;
|
|
8980
|
+
timestamp;
|
|
8981
|
+
transpileBuildCount = 0;
|
|
8982
|
+
validateTypesPromise;
|
|
8911
8983
|
constructor(config, compilerCtx) {
|
|
8912
|
-
this.buildId = -1;
|
|
8913
|
-
this.buildMessages = [];
|
|
8914
|
-
this.buildResults = null;
|
|
8915
|
-
this.bundleBuildCount = 0;
|
|
8916
|
-
this.collections = [];
|
|
8917
|
-
this.completedTasks = [];
|
|
8918
|
-
this.components = [];
|
|
8919
|
-
this.componentGraph = /* @__PURE__ */ new Map();
|
|
8920
|
-
this.data = {};
|
|
8921
|
-
this.buildStats = void 0;
|
|
8922
|
-
this.diagnostics = [];
|
|
8923
|
-
this.dirsAdded = [];
|
|
8924
|
-
this.dirsDeleted = [];
|
|
8925
|
-
this.entryModules = [];
|
|
8926
|
-
this.filesAdded = [];
|
|
8927
|
-
this.filesChanged = [];
|
|
8928
|
-
this.filesDeleted = [];
|
|
8929
|
-
this.filesUpdated = [];
|
|
8930
|
-
this.filesWritten = [];
|
|
8931
|
-
this.globalStyle = void 0;
|
|
8932
|
-
this.hasConfigChanges = false;
|
|
8933
|
-
this.hasFinished = false;
|
|
8934
|
-
this.hasHtmlChanges = false;
|
|
8935
|
-
this.hasPrintedResults = false;
|
|
8936
|
-
this.hasServiceWorkerChanges = false;
|
|
8937
|
-
this.hasScriptChanges = true;
|
|
8938
|
-
this.hasStyleChanges = true;
|
|
8939
|
-
this.hydrateAppFilePath = null;
|
|
8940
|
-
this.indexBuildCount = 0;
|
|
8941
|
-
this.indexDoc = void 0;
|
|
8942
|
-
this.isRebuild = false;
|
|
8943
|
-
this.moduleFiles = [];
|
|
8944
|
-
this.outputs = [];
|
|
8945
|
-
this.packageJson = {};
|
|
8946
|
-
this.packageJsonFilePath = null;
|
|
8947
|
-
this.pendingCopyTasks = [];
|
|
8948
|
-
this.requiresFullBuild = true;
|
|
8949
|
-
this.scriptsAdded = [];
|
|
8950
|
-
this.scriptsDeleted = [];
|
|
8951
|
-
this.startTime = Date.now();
|
|
8952
|
-
this.styleBuildCount = 0;
|
|
8953
|
-
this.stylesPromise = null;
|
|
8954
|
-
this.stylesUpdated = [];
|
|
8955
|
-
this.timeSpan = null;
|
|
8956
|
-
this.transpileBuildCount = 0;
|
|
8957
8984
|
this.config = validateConfig(config, {}).config;
|
|
8958
8985
|
this.compilerCtx = compilerCtx;
|
|
8959
8986
|
this.buildId = ++this.compilerCtx.activeBuildId;
|
|
@@ -9086,11 +9113,14 @@ var Cache = class {
|
|
|
9086
9113
|
constructor(config, cacheFs) {
|
|
9087
9114
|
this.config = config;
|
|
9088
9115
|
this.cacheFs = cacheFs;
|
|
9089
|
-
this.failed = 0;
|
|
9090
|
-
this.skip = false;
|
|
9091
9116
|
this.sys = config.sys;
|
|
9092
9117
|
this.logger = config.logger;
|
|
9093
9118
|
}
|
|
9119
|
+
failed = 0;
|
|
9120
|
+
skip = false;
|
|
9121
|
+
sys;
|
|
9122
|
+
logger;
|
|
9123
|
+
buildCacheDir;
|
|
9094
9124
|
async initCacheDir() {
|
|
9095
9125
|
if (this.config._isTesting || !this.config.cacheDir) {
|
|
9096
9126
|
return;
|
|
@@ -10065,9 +10095,7 @@ var stubComponentCompilerMeta = (overrides = {}) => ({
|
|
|
10065
10095
|
|
|
10066
10096
|
// src/testing/testing-logger.ts
|
|
10067
10097
|
var TestingLogger = class {
|
|
10068
|
-
|
|
10069
|
-
this.isEnabled = false;
|
|
10070
|
-
}
|
|
10098
|
+
isEnabled = false;
|
|
10071
10099
|
enable() {
|
|
10072
10100
|
this.isEnabled = true;
|
|
10073
10101
|
}
|
|
@@ -11074,10 +11102,10 @@ async function waitForEvent(page, eventName, elementHandle) {
|
|
|
11074
11102
|
var EventSpy = class {
|
|
11075
11103
|
constructor(eventName) {
|
|
11076
11104
|
this.eventName = eventName;
|
|
11077
|
-
this.events = [];
|
|
11078
|
-
this.cursor = 0;
|
|
11079
|
-
this.queuedHandler = [];
|
|
11080
11105
|
}
|
|
11106
|
+
events = [];
|
|
11107
|
+
cursor = 0;
|
|
11108
|
+
queuedHandler = [];
|
|
11081
11109
|
get length() {
|
|
11082
11110
|
return this.events.length;
|
|
11083
11111
|
}
|
|
@@ -11227,9 +11255,9 @@ var E2EElement = class extends import_mock_doc19.MockHTMLElement {
|
|
|
11227
11255
|
super(null, null);
|
|
11228
11256
|
this._page = _page;
|
|
11229
11257
|
this._elmHandle = _elmHandle;
|
|
11230
|
-
this._queuedActions = [];
|
|
11231
11258
|
_page._e2eElements.push(this);
|
|
11232
11259
|
}
|
|
11260
|
+
_queuedActions = [];
|
|
11233
11261
|
_queueAction(action) {
|
|
11234
11262
|
this._queuedActions.push(action);
|
|
11235
11263
|
}
|