@playwright/experimental-ct-core 1.47.0 → 1.48.0-alpha-2024-09-06

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/index.js CHANGED
@@ -16,7 +16,6 @@
16
16
 
17
17
  const { test: baseTest, expect, devices, defineConfig: originalDefineConfig } = require('playwright/test');
18
18
  const { fixtures } = require('./lib/mount');
19
- const { clearCacheCommand, findRelatedTestFilesCommand } = require('./lib/cliOverrides');
20
19
  const { createPlugin } = require('./lib/vitePlugin');
21
20
 
22
21
  const defineConfig = (...configs) => {
@@ -29,10 +28,6 @@ const defineConfig = (...configs) => {
29
28
  babelPlugins: [
30
29
  [require.resolve('./lib/tsxTransform')]
31
30
  ],
32
- cli: {
33
- 'clear-cache': clearCacheCommand,
34
- 'find-related-test-files': findRelatedTestFilesCommand,
35
- },
36
31
  }
37
32
  };
38
33
  };
package/lib/vitePlugin.js CHANGED
@@ -15,6 +15,7 @@ var _indexSource = require("./generated/indexSource");
15
15
  var _viteUtils = require("./viteUtils");
16
16
  var _transform = require("playwright/lib/transform/transform");
17
17
  var _devServer = require("./devServer");
18
+ var _util = require("playwright/lib/util");
18
19
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
20
  /**
20
21
  * Copyright (c) Microsoft Corporation.
@@ -70,6 +71,11 @@ function createPlugin() {
70
71
  },
71
72
  startDevServer: async () => {
72
73
  return await (0, _devServer.runDevServer)(config);
74
+ },
75
+ clearCache: async () => {
76
+ const configDir = config.configFile ? _path.default.dirname(config.configFile) : config.rootDir;
77
+ const dirs = await (0, _viteUtils.resolveDirs)(configDir, config);
78
+ if (dirs) await (0, _util.removeDirAndLogToConsole)(dirs.outDir);
73
79
  }
74
80
  };
75
81
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playwright/experimental-ct-core",
3
- "version": "1.47.0",
3
+ "version": "1.48.0-alpha-2024-09-06",
4
4
  "description": "Playwright Component Testing Helpers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,8 +26,8 @@
26
26
  }
27
27
  },
28
28
  "dependencies": {
29
- "playwright-core": "1.47.0",
29
+ "playwright-core": "1.48.0-alpha-2024-09-06",
30
30
  "vite": "^5.2.8",
31
- "playwright": "1.47.0"
31
+ "playwright": "1.48.0-alpha-2024-09-06"
32
32
  }
33
33
  }
@@ -1,38 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.clearCacheCommand = clearCacheCommand;
7
- exports.findRelatedTestFilesCommand = findRelatedTestFilesCommand;
8
- var _compilationCache = require("playwright/lib/transform/compilationCache");
9
- var _vitePlugin = require("./vitePlugin");
10
- var _viteUtils = require("./viteUtils");
11
- var _testServer = require("playwright/lib/runner/testServer");
12
- /**
13
- * Copyright (c) Microsoft Corporation.
14
- *
15
- * Licensed under the Apache License, Version 2.0 (the "License");
16
- * you may not use this file except in compliance with the License.
17
- * You may obtain a copy of the License at
18
- *
19
- * http://www.apache.org/licenses/LICENSE-2.0
20
- *
21
- * Unless required by applicable law or agreed to in writing, software
22
- * distributed under the License is distributed on an "AS IS" BASIS,
23
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24
- * See the License for the specific language governing permissions and
25
- * limitations under the License.
26
- */
27
-
28
- async function clearCacheCommand(config) {
29
- const dirs = await (0, _viteUtils.resolveDirs)(config.configDir, config.config);
30
- if (dirs) await (0, _testServer.removeFolderAndLogToConsole)(dirs.outDir);
31
- await (0, _testServer.removeFolderAndLogToConsole)(_compilationCache.cacheDir);
32
- }
33
- async function findRelatedTestFilesCommand(files, config) {
34
- await (0, _vitePlugin.buildBundle)(config.config, config.configDir);
35
- return {
36
- testFiles: (0, _compilationCache.affectedTestFiles)(files)
37
- };
38
- }