chore(create-playwright): some nits (#9133)
This commit is contained in:
parent
a885e95646
commit
9d3513ab13
|
|
@ -1,8 +1,9 @@
|
|||
# This ignores everything by default, except for package.json and LICENSE and README.md.
|
||||
# See https://docs.npmjs.com/misc/developers
|
||||
**/*
|
||||
|
||||
!/lib/**/*
|
||||
/node_modules/
|
||||
/test-results/
|
||||
/src/**/*
|
||||
/tests/**/*
|
||||
/playwright.config.ts
|
||||
/tsconfig.json
|
||||
!index.js
|
||||
|
||||
!/assets/**/*
|
||||
/assets/.eslintrc.js
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// Example files here do not need the copyright notice.
|
||||
module.exports = {
|
||||
"extends": "../../../.eslintrc.js",
|
||||
"rules": {
|
||||
"notice/notice": 0
|
||||
}
|
||||
'extends': '../../../.eslintrc.js',
|
||||
'rules': {
|
||||
'notice/notice': 0
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
// @ts-check
|
||||
const { devices } = require('@playwright/test');
|
||||
const path = require('path')
|
||||
const path = require('path');
|
||||
|
||||
/**
|
||||
* @see https://playwright.dev/docs/test-configuration
|
||||
* @type{import('@playwright/test').PlaywrightTestConfig}
|
||||
* @type {import('@playwright/test').PlaywrightTestConfig}
|
||||
*/
|
||||
const config = {
|
||||
// Timeout per test
|
||||
|
|
|
|||
1
packages/create-playwright/package-lock.json
generated
1
packages/create-playwright/package-lock.json
generated
|
|
@ -5,7 +5,6 @@
|
|||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "create-playwright",
|
||||
"version": "0.1.7",
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import fs from 'fs';
|
|||
import { prompt } from 'enquirer';
|
||||
import colors from 'ansi-colors';
|
||||
|
||||
import { executeCommands, createFiles, determinePackageManager, executeTemplate, determineRootDir, Command, languagetoFileExtension } from './utils';
|
||||
import { executeCommands, createFiles, determinePackageManager, executeTemplate, Command, languagetoFileExtension } from './utils';
|
||||
|
||||
export type PromptOptions = {
|
||||
testDir: string,
|
||||
|
|
@ -189,7 +189,7 @@ export function commandToRunTests(packageManager: 'npm' | 'yarn', args?: string)
|
|||
}
|
||||
|
||||
(async () => {
|
||||
const rootDir = determineRootDir();
|
||||
const rootDir = path.resolve(process.cwd(), process.argv[2] || '');
|
||||
const generator = new Generator(rootDir);
|
||||
await generator.run();
|
||||
})().catch(error => {
|
||||
|
|
|
|||
|
|
@ -55,14 +55,6 @@ export async function createFiles(rootDir: string, files: Map<string, string>, f
|
|||
}
|
||||
}
|
||||
|
||||
export function determineRootDir() {
|
||||
const givenPath = process.argv[2];
|
||||
if (givenPath)
|
||||
return path.isAbsolute(givenPath) ? process.argv[2] : path.join(process.cwd(), process.argv[2]);
|
||||
|
||||
return process.cwd();
|
||||
}
|
||||
|
||||
export function determinePackageManager(rootDir: string): 'yarn' | 'npm' {
|
||||
if (fs.existsSync(path.join(rootDir, 'yarn.lock')))
|
||||
return 'yarn';
|
||||
|
|
|
|||
Loading…
Reference in a new issue