create-wdio 7.0.3 → 7.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.
@@ -3,8 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.UNSUPPORTED_NODE_VERSION = exports.PROGRAM_TITLE = exports.ASCII_ROBOT = void 0;
6
+ exports.UNSUPPORTED_NODE_VERSION = exports.PROGRAM_TITLE = exports.ASCII_ROBOT = exports.DEFAULT_NPM_TAG = void 0;
7
7
  const chalk_1 = __importDefault(require("chalk"));
8
+ exports.DEFAULT_NPM_TAG = 'latest';
8
9
  const colorItBold = chalk_1.default.bold.rgb(234, 89, 6);
9
10
  const colorIt = chalk_1.default.rgb(234, 89, 6);
10
11
  exports.ASCII_ROBOT = `
package/build/index.js CHANGED
@@ -15,7 +15,9 @@ let pkg = { version: 'unknown' };
15
15
  try {
16
16
  pkg = JSON.parse(fs_1.default.readFileSync(__dirname + '/../package.json').toString());
17
17
  }
18
- catch (e) { /* ignore */ }
18
+ catch (e) {
19
+ /* ignore */
20
+ }
19
21
  let projectName;
20
22
  let useYarn;
21
23
  function run(operation = createWebdriverIO) {
@@ -30,10 +32,11 @@ function run(operation = createWebdriverIO) {
30
32
  .arguments('[project]')
31
33
  .usage(`${chalk_1.default.green('[project]')} [options]`)
32
34
  .action(name => (projectName = name))
33
- .option('--use-yarn', 'Use Yarn package manager to install packages', false)
34
- .option('--verbose', 'print additional logs')
35
- .option('--yes', 'will fill in all config defaults without prompting', false)
36
- .option('--dev', 'Install all packages as into devDependencies', true)
35
+ .option('-t, --npm-tag <tag>', 'Which NPM version you like to install, e.g. @next', constants_1.DEFAULT_NPM_TAG)
36
+ .option('-u, --use-yarn', 'Use Yarn package manager to install packages', false)
37
+ .option('-v, --verbose', 'print additional logs')
38
+ .option('-y, --yes', 'will fill in all config defaults without prompting', false)
39
+ .option('-d, --dev', 'Install all packages as into devDependencies', true)
37
40
  .allowUnknownOption()
38
41
  .on('--help', () => console.log())
39
42
  .parse(process.argv);
@@ -53,7 +56,8 @@ function run(operation = createWebdriverIO) {
53
56
  }
54
57
  exports.run = run;
55
58
  async function createWebdriverIO(opts) {
56
- const ewd = process.cwd();
59
+ const cwd = process.cwd();
60
+ const npmTag = opts.npmTag.startsWith('@') ? opts.npmTag : `@${opts.npmTag}`;
57
61
  const unsupportedNodeVersion = !semver_1.default.satisfies(process.version, '>=12');
58
62
  if (unsupportedNodeVersion) {
59
63
  console.log(chalk_1.default.yellow(constants_1.UNSUPPORTED_NODE_VERSION));
@@ -80,7 +84,7 @@ async function createWebdriverIO(opts) {
80
84
  };
81
85
  await fs_1.default.promises.writeFile(pkgJsonPath, JSON.stringify(pkgJson, null, 4));
82
86
  }
83
- const deps = ['@wdio/cli'];
87
+ const deps = [`@wdio/cli${npmTag}`];
84
88
  await install(deps.flat(), root, opts);
85
89
  console.log('\nFinished installing packages.');
86
90
  console.log('\nRunning WDIO CLI Wizard...');
@@ -88,15 +92,15 @@ async function createWebdriverIO(opts) {
88
92
  if (await (0, utils_1.exists)(pkgJsonPath)) {
89
93
  console.log('Adding scripts to package.json');
90
94
  const pkgJson = require(pkgJsonPath);
91
- const isUsingTypescript = await (0, utils_1.exists)('wdio.conf.ts');
95
+ const isUsingTypescript = await (0, utils_1.exists)('test/wdio.conf.ts');
92
96
  if (!pkgJson.scripts) {
93
97
  pkgJson.scripts = {};
94
98
  }
95
- pkgJson.scripts['wdio'] = `wdio run wdio.conf.${isUsingTypescript ? 'ts' : 'js'}`;
99
+ pkgJson.scripts['wdio'] = `wdio run ${isUsingTypescript ? 'test/wdio.conf.ts' : 'wdio.conf.js'}`;
96
100
  await fs_1.default.promises.writeFile(pkgJsonPath, JSON.stringify(pkgJson, null, 4));
97
101
  }
98
102
  console.log(`\nšŸ¤– Successfully setup project at ${root} šŸŽ‰`);
99
- if (root != ewd) {
103
+ if (root != cwd) {
100
104
  console.log(`\n${chalk_1.default.yellow('⚠')} First, change the directory via: ${chalk_1.default.cyan('$ cd')} ${chalk_1.default.green(root)}`);
101
105
  }
102
106
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-wdio",
3
- "version": "7.0.3",
3
+ "version": "7.2.0",
4
4
  "description": "Install WebdriverIO with all its dependencies in a single run",
5
5
  "author": "Christian Bromann <christian@saucelabs.com>",
6
6
  "license": "MIT",
@@ -39,23 +39,23 @@
39
39
  "devDependencies": {
40
40
  "@schemastore/package": "^0.0.6",
41
41
  "@types/cross-spawn": "^6.0.2",
42
- "@types/jest": "^27.0.2",
43
- "@types/node": "^16.11.1",
44
- "@types/semver": "^7.3.8",
45
- "@typescript-eslint/eslint-plugin": "^5.0.0",
46
- "@typescript-eslint/parser": "^5.0.0",
47
- "eslint": "^8.0.1",
48
- "eslint-plugin-import": "^2.25.2",
49
- "jest": "^27.3.0",
42
+ "@types/jest": "^27.4.1",
43
+ "@types/node": "^18.0.0",
44
+ "@types/semver": "^7.3.9",
45
+ "@typescript-eslint/eslint-plugin": "^5.14.0",
46
+ "@typescript-eslint/parser": "^5.14.0",
47
+ "eslint": "^8.10.0",
48
+ "eslint-plugin-import": "^2.25.4",
49
+ "jest": "^27.5.1",
50
50
  "npm-run-all": "^4.1.5",
51
- "release-it": "^14.11.6",
52
- "ts-jest": "^27.0.7",
53
- "ts-node": "^10.3.0",
54
- "typescript": "^4.4.4"
51
+ "release-it": "^15.0.0",
52
+ "ts-jest": "^27.1.3",
53
+ "ts-node": "^10.7.0",
54
+ "typescript": "^4.6.2"
55
55
  },
56
56
  "dependencies": {
57
57
  "chalk": "^4.1.2",
58
- "commander": "^8.2.0",
58
+ "commander": "^9.0.0",
59
59
  "cross-spawn": "^7.0.3",
60
60
  "semver": "^7.3.5"
61
61
  }