@cypress/vite-dev-server 5.1.0 → 5.2.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.
@@ -2,8 +2,8 @@
2
2
  /// <reference types="node" />
3
3
  import type { UserConfig } from 'vite-5';
4
4
  declare const ALL_FRAMEWORKS: readonly ["react", "vue"];
5
- declare type ConfigHandler = UserConfig | (() => UserConfig | Promise<UserConfig>);
6
- export declare type ViteDevServerConfig = {
5
+ type ConfigHandler = UserConfig | (() => UserConfig | Promise<UserConfig>);
6
+ export type ViteDevServerConfig = {
7
7
  specs: Cypress.Spec[];
8
8
  cypressConfig: Cypress.PluginConfigOptions;
9
9
  devServerEvents: NodeJS.EventEmitter;
package/dist/devServer.js CHANGED
@@ -32,7 +32,11 @@ async function devServer(config) {
32
32
  port,
33
33
  // Close is for unit testing only. We kill this child process which will handle the closing of the server
34
34
  close(cb) {
35
- return server.close().then(() => cb === null || cb === void 0 ? void 0 : cb()).catch(cb);
35
+ debug('closing dev server');
36
+ return server.close().then(() => {
37
+ debug('closed dev server');
38
+ cb === null || cb === void 0 ? void 0 : cb();
39
+ }).catch(cb);
36
40
  },
37
41
  };
38
42
  }
package/dist/getVite.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import type { ViteDevServerConfig } from './devServer';
2
- export declare type Vite = typeof import('vite-5');
2
+ export type Vite = typeof import('vite-5');
3
3
  export declare function getVite(config: ViteDevServerConfig): Vite;
@@ -24,6 +24,7 @@ const Cypress = (options, vite) => {
24
24
  // eslint-disable-next-line no-restricted-syntax
25
25
  let loader = fs_1.default.readFileSync(INIT_FILEPATH, 'utf8');
26
26
  devServerEvents.on('dev-server:specs:changed', (specs) => {
27
+ debug(`dev-server:secs:changed: ${specs.map((spec) => spec.relative)}`);
27
28
  specsPathsSet = getSpecsPathsSet(specs);
28
29
  });
29
30
  return {
@@ -52,7 +52,7 @@ const createViteDevServerConfig = async (config, vite) => {
52
52
  exports.createViteDevServerConfig = createViteDevServerConfig;
53
53
  function makeCypressViteConfig(config, vite) {
54
54
  var _a, _b, _c;
55
- const { cypressConfig: { port, projectRoot, devServerPublicPathRoute, supportFile, cypressBinaryRoot, isTextTerminal, }, specs, } = config;
55
+ const { cypressConfig: { experimentalJustInTimeCompile, port, projectRoot, devServerPublicPathRoute, supportFile, cypressBinaryRoot, isTextTerminal, }, specs, } = config;
56
56
  const vitePort = port !== null && port !== void 0 ? port : undefined;
57
57
  // Vite caches its output in the .vite directory in the node_modules where vite lives.
58
58
  // So we want to find that node_modules path and ensure it's added to the "allow" list
@@ -95,7 +95,7 @@ function makeCypressViteConfig(config, vite) {
95
95
  // Supported from Vite v3 - add null check for v2 users.
96
96
  (_a = vite.searchForWorkspaceRoot) === null || _a === void 0 ? void 0 : _a.call(vite, process.cwd()),
97
97
  ],
98
- }, port: vitePort, host: '127.0.0.1' }, (isTextTerminal
98
+ }, port: vitePort, host: '127.0.0.1' }, (isTextTerminal && !experimentalJustInTimeCompile
99
99
  ? { watch: { ignored: '**/*' }, hmr: false }
100
100
  : {})),
101
101
  plugins: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cypress/vite-dev-server",
3
- "version": "5.1.0",
3
+ "version": "5.2.0",
4
4
  "description": "Launches Vite Dev Server for Component Testing",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -27,7 +27,7 @@
27
27
  "mocha": "^9.2.2",
28
28
  "sinon": "^13.0.1",
29
29
  "ts-node": "^10.9.2",
30
- "vite-4": "npm:vite@^4.5.2",
30
+ "vite-4": "npm:vite@^4.5.3",
31
31
  "vite-5": "npm:vite@^5.2.8",
32
32
  "vite-plugin-inspect": "0.8.4"
33
33
  },