From bc9f9b79c8d0a116e48ee1a8d852dbc99d2665b4 Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Mon, 22 May 2023 12:37:08 -0700 Subject: [PATCH] cherry-pick(#23203): chore: fix playwright-core cli --- packages/playwright-core/cli.js | 17 +++++++++++++++++ packages/playwright-core/package.json | 3 +++ packages/playwright-ct-core/cli.js | 2 +- packages/playwright-test/cli.js | 2 +- packages/playwright-test/package.json | 1 - 5 files changed, 22 insertions(+), 3 deletions(-) create mode 100755 packages/playwright-core/cli.js diff --git a/packages/playwright-core/cli.js b/packages/playwright-core/cli.js new file mode 100755 index 0000000000000..bd995de11422c --- /dev/null +++ b/packages/playwright-core/cli.js @@ -0,0 +1,17 @@ +#!/usr/bin/env node +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +module.exports = require('playwright-core/lib/cli/cli'); diff --git a/packages/playwright-core/package.json b/packages/playwright-core/package.json index 7cb183a49992a..ee3fa36899ac0 100644 --- a/packages/playwright-core/package.json +++ b/packages/playwright-core/package.json @@ -35,5 +35,8 @@ "./types/protocol": "./types/protocol.d.ts", "./types/structs": "./types/structs.d.ts" }, + "bin": { + "playwright": "./cli.js" + }, "types": "types/types.d.ts" } diff --git a/packages/playwright-ct-core/cli.js b/packages/playwright-ct-core/cli.js index 6b702d0014b53..bff00995d9a77 100755 --- a/packages/playwright-ct-core/cli.js +++ b/packages/playwright-ct-core/cli.js @@ -14,4 +14,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -module.exports = require('@playwright/test/cli'); +module.exports = require('@playwright/test/lib/cli'); diff --git a/packages/playwright-test/cli.js b/packages/playwright-test/cli.js index d4eb087af8879..bff00995d9a77 100755 --- a/packages/playwright-test/cli.js +++ b/packages/playwright-test/cli.js @@ -14,4 +14,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -module.exports = require('./lib/cli'); +module.exports = require('@playwright/test/lib/cli'); diff --git a/packages/playwright-test/package.json b/packages/playwright-test/package.json index 52f947f3eceb4..aefd00d01de17 100644 --- a/packages/playwright-test/package.json +++ b/packages/playwright-test/package.json @@ -15,7 +15,6 @@ "require": "./index.js", "default": "./index.js" }, - "./cli": "./cli.js", "./package.json": "./package.json", "./lib/cli": "./lib/cli.js", "./lib/common/babelBundle": "./lib/common/babelBundle.js",