Skip to content

Commit 2f9731b

Browse files
committed
Merge branch 'main' into v3.0.0-dev
2 parents eb511bc + 609217c commit 2f9731b

File tree

12 files changed

+1692
-2038
lines changed

12 files changed

+1692
-2038
lines changed

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,12 @@ updates:
1616
versions: ['17', '18']
1717
- dependency-name: 'typescript'
1818
versions: ['4.8']
19+
# disable Jest updates until the new testing architecture is in place
20+
- dependency-name: '@types/jest'
21+
versions: ['>=28']
22+
- dependency-name: 'jest'
23+
versions: ['>=28']
24+
- dependency-name: 'jest-cli'
25+
versions: ['>=28']
26+
- dependency-name: 'jest-environment-node'
27+
versions: ['>=28']

package-lock.json

Lines changed: 1640 additions & 2024 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"@rollup/plugin-json": "4.1.0",
6363
"@rollup/plugin-node-resolve": "9.0.0",
6464
"@rollup/plugin-replace": "2.3.4",
65-
"@rollup/pluginutils": "4.1.0",
65+
"@rollup/pluginutils": "4.2.1",
6666
"@types/eslint": "^8.4.6",
6767
"@types/exit": "^0.1.31",
6868
"@types/fs-extra": "^9.0.8",
@@ -71,10 +71,10 @@
7171
"@types/inquirer": "^7.3.1",
7272
"@types/jest": "^27.0.3",
7373
"@types/listr": "^0.14.4",
74-
"@types/node": "^14.14.35",
74+
"@types/node": "^16.11.62",
7575
"@types/parse5": "^6.0.0",
7676
"@types/pixelmatch": "^5.2.4",
77-
"@types/pngjs": "^3.4.2",
77+
"@types/pngjs": "^6.0.1",
7878
"@types/prompts": "^2.0.9",
7979
"@types/semver": "^7.3.12",
8080
"@types/sizzle": "^2.3.2",
@@ -87,7 +87,7 @@
8787
"ansi-colors": "4.1.1",
8888
"autoprefixer": "10.2.5",
8989
"conventional-changelog-cli": "^2.2.2",
90-
"dts-bundle-generator": "~6.12.0",
90+
"dts-bundle-generator": "~6.13.0",
9191
"eslint": "^8.23.1",
9292
"eslint-config-prettier": "^8.5.0",
9393
"eslint-plugin-jest": "^27.0.4",
@@ -107,7 +107,7 @@
107107
"magic-string": "^0.26.3",
108108
"merge-source-map": "^1.1.0",
109109
"mime-db": "^1.46.0",
110-
"minimatch": "3.0.4",
110+
"minimatch": "5.1.0",
111111
"node-fetch": "2.6.7",
112112
"open": "^8.4.0",
113113
"open-in-editor": "2.2.0",
@@ -116,7 +116,7 @@
116116
"pixelmatch": "5.3.0",
117117
"postcss": "^8.2.8",
118118
"prettier": "2.7.1",
119-
"prompts": "2.4.0",
119+
"prompts": "2.4.2",
120120
"puppeteer": "~10.0.0",
121121
"rollup": "2.42.3",
122122
"rollup-plugin-sourcemaps": "^0.6.3",

src/compiler/build/build-hmr.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,17 @@ const getImagesUpdated = (buildCtx: d.BuildCtx, outputTargetsWww: d.OutputTarget
205205
return imageFiles.sort();
206206
};
207207

208-
const excludeHmrFiles = (config: d.Config, excludeHmr: string[], filesChanged: string[]) => {
208+
/**
209+
* Determine a list of files (if any) which should be excluded from HMR updates.
210+
*
211+
* @param config a user-supplied config
212+
* @param excludeHmr a list of glob patterns that should be used to determine
213+
* whether to exclude a file or not (a file will be excluded if it matches one
214+
* @param filesChanged an array of files which are changed in the HMR update
215+
* currently under consideration
216+
* @returns a sorted list of files to exclude
217+
*/
218+
const excludeHmrFiles = (config: d.Config, excludeHmr: string[], filesChanged: string[]): string[] => {
209219
const excludeFiles: string[] = [];
210220

211221
if (!excludeHmr || excludeHmr.length === 0) {

src/declarations/stencil-public-compiler.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,10 @@ export interface StencilDevServerConfig {
554554
export interface DevServerConfig extends StencilDevServerConfig {
555555
browserUrl?: string;
556556
devServerDir?: string;
557+
/**
558+
* A list of glob patterns like `subdir/*.js` to exclude from hot-module
559+
* reloading updates.
560+
*/
557561
excludeHmr?: string[];
558562
historyApiFallback?: HistoryApiFallback;
559563
openBrowser?: boolean;

src/dev-server/test/req-handler.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ describe('request-handler', () => {
5656

5757
res.end = () => {
5858
res.$content = res.$contentWrite;
59+
return this;
5960
};
6061

6162
sendMsg = () => {};

src/testing/jest/jest-environment.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export function createJestPuppeteerEnvironment() {
2828

2929
const page = await newBrowserPage(this.browser);
3030
this.pages.push(page);
31-
const env: E2EProcessEnv = process.env;
31+
// during E2E tests, we can safely assume that the current environment is a `E2EProcessEnv`
32+
const env: E2EProcessEnv = process.env as E2EProcessEnv;
3233
if (typeof env.__STENCIL_DEFAULT_TIMEOUT__ === 'string') {
3334
page.setDefaultTimeout(parseInt(env.__STENCIL_DEFAULT_TIMEOUT__, 10));
3435
}

src/testing/jest/jest-setup-test-framework.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { BUILD, Env } from '@app-data';
22
import type * as d from '@stencil/core/internal';
3+
import { E2EProcessEnv } from '@stencil/core/internal';
34
import {
45
modeResolutionChain,
56
resetPlatform,
@@ -56,7 +57,8 @@ export function jestSetupTestFramework() {
5657

5758
global.screenshotDescriptions = new Set();
5859

59-
const env: d.E2EProcessEnv = process.env;
60+
// during E2E tests, we can safely assume that the current environment is a `E2EProcessEnv`
61+
const env: E2EProcessEnv = process.env as E2EProcessEnv;
6062

6163
if (typeof env.__STENCIL_DEFAULT_TIMEOUT__ === 'string') {
6264
const time = parseInt(env.__STENCIL_DEFAULT_TIMEOUT__, 10);

src/testing/puppeteer/puppeteer-browser.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ export async function startPuppeteerBrowser(config: ValidatedConfig) {
66
return null;
77
}
88

9-
const env: E2EProcessEnv = process.env;
9+
// during E2E tests, we can safely assume that the current environment is a `E2EProcessEnv`
10+
const env: E2EProcessEnv = process.env as E2EProcessEnv;
1011
const puppeteerDep = config.testing.browserExecutablePath ? 'puppeteer-core' : 'puppeteer';
1112

1213
const puppeteerModulePath = config.sys.lazyRequire.getModulePath(config.rootDir, puppeteerDep);
@@ -73,7 +74,9 @@ export async function connectBrowser() {
7374
// a web socket is because jest probably has us
7475
// in a different thread, this is also why this
7576
// uses process.env for data
76-
const env: E2EProcessEnv = process.env;
77+
//
78+
// during E2E tests, we can safely assume that the current environment is a `E2EProcessEnv`
79+
const env: E2EProcessEnv = process.env as E2EProcessEnv;
7780

7881
const wsEndpoint = env.__STENCIL_BROWSER_WS_ENDPOINT__;
7982
if (!wsEndpoint) {

src/testing/puppeteer/puppeteer-page.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ import { initPageScreenshot } from './puppeteer-screenshot';
1515

1616
declare const global: JestEnvironmentGlobal;
1717

18-
const env: E2EProcessEnv = process.env;
18+
// during E2E tests, we can safely assume that the current environment is a `E2EProcessEnv`
19+
const env: E2EProcessEnv = process.env as E2EProcessEnv;
1920
export async function newE2EPage(opts: NewE2EPageOptions = {}): Promise<E2EPage> {
2021
if (!global.__NEW_TEST_PAGE__) {
2122
throw new Error(`newE2EPage() is only available from E2E tests, and ran with the --e2e cmd line flag.`);

0 commit comments

Comments
 (0)