create-wdio 9.0.0 → 9.17.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.
Files changed (83) hide show
  1. package/README.md +12 -7
  2. package/assets/demo.gif +0 -0
  3. package/build/cli/config.d.ts +51 -0
  4. package/build/cli/config.d.ts.map +1 -0
  5. package/build/cli/install.d.ts +12 -0
  6. package/build/cli/install.d.ts.map +1 -0
  7. package/build/cli/utils.d.ts +18 -0
  8. package/build/cli/utils.d.ts.map +1 -0
  9. package/build/config/cli.d.ts +2 -0
  10. package/build/config/cli.d.ts.map +1 -0
  11. package/build/config/cli.js +1632 -0
  12. package/build/constants.d.ts +248 -0
  13. package/build/constants.d.ts.map +1 -0
  14. package/build/index.d.ts +4 -0
  15. package/build/index.d.ts.map +1 -0
  16. package/build/index.js +1018 -54
  17. package/build/install/cli.d.ts +2 -0
  18. package/build/install/cli.d.ts.map +1 -0
  19. package/build/install/cli.js +1719 -0
  20. package/build/install.d.ts +4 -0
  21. package/build/install.d.ts.map +1 -0
  22. package/build/templates/EjsHelpers.d.ts +18 -0
  23. package/build/templates/EjsHelpers.d.ts.map +1 -0
  24. package/build/templates/exampleFiles/browser/Component.css.ejs +121 -0
  25. package/build/templates/exampleFiles/browser/Component.lit.ejs +154 -0
  26. package/build/templates/exampleFiles/browser/Component.lit.test.ejs +24 -0
  27. package/build/templates/exampleFiles/browser/Component.preact.ejs +28 -0
  28. package/build/templates/exampleFiles/browser/Component.preact.test.ejs +59 -0
  29. package/build/templates/exampleFiles/browser/Component.react.ejs +29 -0
  30. package/build/templates/exampleFiles/browser/Component.react.test.ejs +58 -0
  31. package/build/templates/exampleFiles/browser/Component.solid.ejs +28 -0
  32. package/build/templates/exampleFiles/browser/Component.solid.test.ejs +58 -0
  33. package/build/templates/exampleFiles/browser/Component.stencil.ejs +43 -0
  34. package/build/templates/exampleFiles/browser/Component.stencil.test.ejs +45 -0
  35. package/build/templates/exampleFiles/browser/Component.svelte.ejs +47 -0
  36. package/build/templates/exampleFiles/browser/Component.svelte.test.ejs +58 -0
  37. package/build/templates/exampleFiles/browser/Component.vue.ejs +34 -0
  38. package/build/templates/exampleFiles/browser/Component.vue.test.ejs +62 -0
  39. package/build/templates/exampleFiles/browser/standalone.test.ejs +13 -0
  40. package/build/templates/exampleFiles/cucumber/features/login.feature +12 -0
  41. package/build/templates/exampleFiles/cucumber/step_definitions/steps.js.ejs +55 -0
  42. package/build/templates/exampleFiles/mochaJasmine/test.e2e.js.ejs +11 -0
  43. package/build/templates/exampleFiles/pageobjects/login.page.js.ejs +45 -0
  44. package/build/templates/exampleFiles/pageobjects/page.js.ejs +17 -0
  45. package/build/templates/exampleFiles/pageobjects/secure.page.js.ejs +20 -0
  46. package/build/templates/exampleFiles/serenity-js/common/config/serenity.properties.ejs +1 -0
  47. package/build/templates/exampleFiles/serenity-js/common/serenity/github-api/GitHubStatus.ts.ejs +41 -0
  48. package/build/templates/exampleFiles/serenity-js/common/serenity/todo-list-app/TodoList.ts.ejs +100 -0
  49. package/build/templates/exampleFiles/serenity-js/common/serenity/todo-list-app/TodoListItem.ts.ejs +36 -0
  50. package/build/templates/exampleFiles/serenity-js/cucumber/step-definitions/steps.ts.ejs +37 -0
  51. package/build/templates/exampleFiles/serenity-js/cucumber/support/parameter.config.ts.ejs +18 -0
  52. package/build/templates/exampleFiles/serenity-js/cucumber/todo-list/completing_items.feature.ejs +23 -0
  53. package/build/templates/exampleFiles/serenity-js/cucumber/todo-list/narrative.md.ejs +17 -0
  54. package/build/templates/exampleFiles/serenity-js/jasmine/example.spec.ts.ejs +86 -0
  55. package/build/templates/exampleFiles/serenity-js/mocha/example.spec.ts.ejs +88 -0
  56. package/build/templates/snippets/afterTest.ejs +20 -0
  57. package/build/templates/snippets/capabilities.ejs +57 -0
  58. package/build/templates/snippets/cucumber.ejs +50 -0
  59. package/build/templates/snippets/electronTest.js.ejs +7 -0
  60. package/build/templates/snippets/jasmine.ejs +20 -0
  61. package/build/templates/snippets/macosTest.js.ejs +11 -0
  62. package/build/templates/snippets/mocha.ejs +14 -0
  63. package/build/templates/snippets/reporters.ejs +14 -0
  64. package/build/templates/snippets/serenity.ejs +18 -0
  65. package/build/templates/snippets/services.ejs +18 -0
  66. package/build/templates/snippets/testWithPO.js.ejs +22 -0
  67. package/build/templates/snippets/testWithoutPO.js.ejs +19 -0
  68. package/build/templates/snippets/vscodeTest.js.ejs +9 -0
  69. package/build/templates/wdio.conf.tpl.ejs +412 -0
  70. package/build/types.d.ts +99 -0
  71. package/build/types.d.ts.map +1 -0
  72. package/build/utils/index.d.ts +2 -0
  73. package/build/utils/index.d.ts.map +1 -0
  74. package/build/utils/index.js +849 -0
  75. package/build/utils.d.ts +78 -0
  76. package/build/utils.d.ts.map +1 -0
  77. package/package.json +60 -41
  78. package/.eslintrc.cjs +0 -37
  79. package/__mocks__/commander.ts +0 -18
  80. package/build/constants.js +0 -51
  81. package/build/types.js +0 -1
  82. package/build/utils.js +0 -38
  83. package/vitest.config.ts +0 -23
@@ -0,0 +1,78 @@
1
+ import type { SpawnOptions } from 'node:child_process';
2
+ import type { ParsedAnswers, ProjectProps, Questionnair, SupportedPackage } from './types.js';
3
+ export declare function runProgram(command: string, args: string[], options: SpawnOptions): Promise<void>;
4
+ export declare function getPackageVersion(): Promise<string>;
5
+ export declare function convertPackageHashToObject(pkg: string, hash?: string): SupportedPackage;
6
+ export declare function getAnswers(yes: boolean): Promise<Questionnair>;
7
+ /**
8
+ * Receive project properties
9
+ * @returns {@type ProjectProps} if a package.json can be found in cwd or parent directories, otherwise undefined
10
+ * which means that a new project can be created
11
+ */
12
+ export declare function getProjectProps(cwd?: string): Promise<ProjectProps | undefined>;
13
+ export declare function getPathForFileGeneration(answers: Questionnair, projectRootDir: string): {
14
+ destSpecRootPath: string;
15
+ destStepRootPath: string;
16
+ destPageObjectRootPath: string;
17
+ destSerenityLibRootPath: string;
18
+ relativePath: string;
19
+ };
20
+ /**
21
+ * Get project root directory based on questionaire answers
22
+ * @param answers questionaire answers
23
+ * @param projectProps project properties received via `getProjectProps`
24
+ * @returns project root path
25
+ */
26
+ export declare function getProjectRoot(parsedAnswers?: Questionnair): Promise<string>;
27
+ /**
28
+ * create package.json if not already existing
29
+ */
30
+ export declare function createPackageJSON(parsedAnswers: ParsedAnswers): Promise<false | undefined>;
31
+ /**
32
+ * set up TypeScript if it is desired but not installed
33
+ */
34
+ export declare function setupTypeScript(parsedAnswers: ParsedAnswers): Promise<void>;
35
+ export declare function npmInstall(parsedAnswers: ParsedAnswers, npmTag: string): Promise<void>;
36
+ export declare function addServiceDeps(names: SupportedPackage[], packages: string[], update?: boolean): void;
37
+ export declare function createWDIOConfig(parsedAnswers: ParsedAnswers): Promise<void>;
38
+ export declare const renderFile: (path: string, data: Record<string, unknown>) => Promise<string>;
39
+ export declare function createWDIOScript(parsedAnswers: ParsedAnswers): Promise<boolean>;
40
+ export declare function runAppiumInstaller(parsedAnswers: ParsedAnswers): Promise<void | import("execa").Result<{
41
+ stdio: "inherit";
42
+ }>>;
43
+ export declare function getSerenityPackages(answers: Questionnair): string[];
44
+ /**
45
+ * detect the package manager that was used
46
+ * uses the environment variable `npm_config_user_agent` to detect the package manager
47
+ * falls back to `npm` if no package manager could be detected
48
+ */
49
+ export declare function detectPackageManager(): import("./constants.js").PACKAGE_MANAGER;
50
+ export declare function getDefaultFiles(answers: Questionnair, pattern: string): Promise<string>;
51
+ /**
52
+ * detect if project has a compiler file
53
+ */
54
+ export declare function detectCompiler(answers: Questionnair): Promise<boolean>;
55
+ /**
56
+ * Ensure core WebdriverIO packages have the same version as cli so that if someone
57
+ * installs `@wdio/cli@next` and runs the wizard, all related packages have the same version.
58
+ * running `matchAll` to a version like "8.0.0-alpha.249+4bc237701", results in:
59
+ * ['8.0.0-alpha.249+4bc237701', '8', '0', '0', 'alpha', '249', '4bc237701']
60
+ */
61
+ export declare function specifyVersionIfNeeded(packagesToInstall: string[], version: string, npmTag: string): string[];
62
+ /**
63
+ * generate test files based on CLI answers
64
+ */
65
+ export declare function generateTestFiles(answers: ParsedAnswers): Promise<void>;
66
+ export declare function generateBrowserRunnerTestFiles(answers: ParsedAnswers): Promise<void>;
67
+ /**
68
+ * Helper utility used in `run` and `install` command to format a provided config path,
69
+ * giving it back as an absolute path, and a version without the file extension
70
+ * @param config the initially given file path to the WDIO config file
71
+ */
72
+ export declare function formatConfigFilePaths(config: string): Promise<{
73
+ fullPath: string;
74
+ fullPathNoExtension: string;
75
+ }>;
76
+ export declare function findInConfig(config: string, type: string): RegExpMatchArray | null;
77
+ export declare function replaceConfig(config: string, type: string, name: string): string | undefined;
78
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAKtD,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAY7F,wBAAgB,UAAU,CAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,YAAY,iBAcjF;AAED,wBAAsB,iBAAiB,oBAStC;AAYD,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,SAAS,GAAG,gBAAgB,CAGvF;AAED,wBAAsB,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,CAmFpE;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,GAAG,SAAgB,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAkB5F;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM;;;;;;EA0BrF;AAaD;;;;;GAKG;AACH,wBAAsB,cAAc,CAAE,aAAa,CAAC,EAAE,YAAY,mBAajE;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,aAAa,EAAE,aAAa,8BAgCnE;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,aAAa,EAAE,aAAa,iBAmHjE;AAMD,wBAAsB,UAAU,CAAC,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,iBA+F5E;AAMD,wBAAgB,cAAc,CAAC,KAAK,EAAE,gBAAgB,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,MAAM,UAAQ,QAmB3F;AAED,wBAAsB,gBAAgB,CAAC,aAAa,EAAE,aAAa,iBAmBlE;AAED,eAAO,MAAM,UAAU,EAAgC,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;AAGvH,wBAAsB,gBAAgB,CAAC,aAAa,EAAE,aAAa,oBAmClE;AAGD,wBAAsB,kBAAkB,CAAC,aAAa,EAAE,aAAa;;IAoBpE;AACD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,EAAE,CA0CnE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,6CASnC;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,mBAU3E;AAID;;GAEG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,YAAY,oBASzD;AAGD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,iBAAiB,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAelG;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,aAAa,iBAU7D;AA8DD,wBAAsB,8BAA8B,CAAC,OAAO,EAAE,aAAa,iBAiC1E;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,MAAM;;;GAMzD;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,2BASxD;AAoBD,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,sBAYvE"}
package/package.json CHANGED
@@ -1,16 +1,42 @@
1
1
  {
2
2
  "name": "create-wdio",
3
- "version": "9.0.0",
3
+ "version": "9.17.0",
4
4
  "description": "Install and setup a WebdriverIO project with all its dependencies in a single run",
5
- "author": "Christian Bromann <mail@bromann.dev>",
5
+ "author": "WebdriverIO Team <mail@webdriver.io>",
6
+ "homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/create-wdio",
6
7
  "license": "MIT",
7
- "homepage": "https://github.com/webdriverio/create-wdio#readme",
8
+ "type": "module",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./build/index.d.ts",
12
+ "import": "./build/index.js",
13
+ "importSource": "./src/index.ts"
14
+ },
15
+ "./config/cli": {
16
+ "types": "./build/config/cli.d.ts",
17
+ "import": "./build/config/cli.js",
18
+ "importSource": "./src/config/cli.ts"
19
+ },
20
+ "./install/cli": {
21
+ "types": "./build/install/cli.d.ts",
22
+ "import": "./build/install/cli.js",
23
+ "importSource": "./src/install/cli.ts"
24
+ },
25
+ "./utils": {
26
+ "types": "./build/utils/index.d.ts",
27
+ "import": "./build/utils/index.js",
28
+ "importSource": "./src/utils/index.ts"
29
+ }
30
+ },
31
+ "types": "./build/index.d.ts",
32
+ "typeScriptVersion": "3.8.3",
33
+ "engines": {
34
+ "node": ">=12.0.0"
35
+ },
8
36
  "repository": {
9
37
  "type": "git",
10
- "url": "git+https://github.com/webdriverio/create-wdio.git"
11
- },
12
- "bugs": {
13
- "url": "https://github.com/webdriverio/create-wdio/issues"
38
+ "url": "git+https://github.com/webdriverio/webdriverio.git",
39
+ "directory": "packages/create-wdio"
14
40
  },
15
41
  "keywords": [
16
42
  "webdriverio",
@@ -19,44 +45,37 @@
19
45
  "installer",
20
46
  "e2e"
21
47
  ],
48
+ "bugs": {
49
+ "url": "https://github.com/webdriverio/webdriverio/issues"
50
+ },
22
51
  "bin": {
23
52
  "create-wdio": "./bin/wdio.js"
24
53
  },
25
- "type": "module",
26
- "scripts": {
27
- "build": "run-s clean compile",
28
- "clean": "rimraf tsconfig.tsbuildinfo ./build ./coverage",
29
- "compile": "tsc -p ./tsconfig.json",
30
- "release": "release-it --github.release",
31
- "release:ci": "npm run release -- --ci --npm.skipChecks --no-git.requireCleanWorkingDir",
32
- "release:patch": "npm run release -- patch",
33
- "release:minor": "npm run release -- minor",
34
- "release:major": "npm run release -- major",
35
- "test": "run-s build test:*",
36
- "test:eslint": "eslint -c ./.eslintrc.cjs ./src/**/*.ts ./tests/**/*.ts",
37
- "test:unit": "vitest",
38
- "watch": "npm run compile -- --watch"
54
+ "dependencies": {
55
+ "chalk": "^5.3.0",
56
+ "commander": "^14.0.0",
57
+ "cross-spawn": "^7.0.3",
58
+ "ejs": "^3.1.10",
59
+ "execa": "^9.6.0",
60
+ "import-meta-resolve": "^4.1.0",
61
+ "inquirer": "^12.7.0",
62
+ "normalize-package-data": "^7.0.0",
63
+ "read-pkg-up": "^10.1.0",
64
+ "recursive-readdir": "^2.2.3",
65
+ "semver": "^7.6.3",
66
+ "type-fest": "^4.41.0",
67
+ "yargs": "^17.7.2"
39
68
  },
40
69
  "devDependencies": {
41
- "@types/cross-spawn": "^6.0.2",
42
- "@types/node": "^18.7.23",
43
- "@types/semver": "^7.3.12",
44
- "@typescript-eslint/eslint-plugin": "^5.38.1",
45
- "@typescript-eslint/parser": "^5.38.1",
46
- "@vitest/coverage-c8": "^0.25.0",
47
- "c8": "^7.12.0",
48
- "eslint": "^8.24.0",
49
- "eslint-plugin-import": "^2.26.0",
50
- "eslint-plugin-unicorn": "^45.0.0",
51
- "npm-run-all": "^4.1.5",
52
- "release-it": "^15.4.2",
53
- "typescript": "^4.8.4",
54
- "vitest": "^0.25.0"
70
+ "@types/cross-spawn": "^6.0.6",
71
+ "@types/ejs": "^3.1.5",
72
+ "@types/fs-extra": "^11.0.4",
73
+ "@types/normalize-package-data": "^2.4.4",
74
+ "@types/semver": "^7.5.8",
75
+ "@types/yargs": "^17.0.33"
55
76
  },
56
- "dependencies": {
57
- "chalk": "^5.0.1",
58
- "commander": "^9.4.0",
59
- "cross-spawn": "^7.0.3",
60
- "semver": "^7.3.7"
61
- }
77
+ "publishConfig": {
78
+ "access": "public"
79
+ },
80
+ "gitHead": "796df04f0f5c744d5ef4bafd3759995fa4829d6f"
62
81
  }
package/.eslintrc.cjs DELETED
@@ -1,37 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- parser: '@typescript-eslint/parser',
4
- plugins: ['@typescript-eslint', 'unicorn'],
5
- extends: [
6
- 'eslint:recommended',
7
- 'plugin:import/errors',
8
- 'plugin:import/warnings'
9
- ],
10
- env: {
11
- node: true,
12
- es6: true,
13
- jest: true
14
- },
15
- parserOptions: {
16
- ecmaVersion: 2019,
17
- sourceType: 'module'
18
- },
19
- rules: {
20
- semi: ['error', 'never'],
21
- quotes: ['error', 'single'],
22
- indent: [2, 4],
23
-
24
- 'no-constant-condition': 0,
25
- // see https://stackoverflow.com/questions/55280555/typescript-eslint-eslint-plugin-error-route-is-defined-but-never-used-no-un
26
- 'no-unused-vars': 'off',
27
- '@typescript-eslint/no-unused-vars': 'error',
28
-
29
- 'import/no-unresolved': 0,
30
- 'import/named': 2,
31
- 'import/namespace': 2,
32
- 'import/default': 2,
33
- 'import/export': 2,
34
-
35
- 'unicorn/prefer-node-protocol': ['error']
36
- }
37
- }
@@ -1,18 +0,0 @@
1
- import { vi } from 'vitest'
2
-
3
- const command: any = {}
4
- command.name = vi.fn().mockReturnValue(command)
5
- command.version = vi.fn().mockReturnValue(command)
6
- command.usage = vi.fn().mockReturnValue(command)
7
- command.arguments = vi.fn().mockReturnValue(command)
8
- command.action = vi.fn((cb) => {
9
- cb('someProjectName')
10
- return command
11
- })
12
- command.option = vi.fn().mockReturnValue(command)
13
- command.allowUnknownOption = vi.fn().mockReturnValue(command)
14
- command.on = vi.fn().mockReturnValue(command)
15
- command.parse = vi.fn().mockReturnValue(command)
16
- command.opts = vi.fn().mockReturnValue('foobar')
17
-
18
- export const Command = vi.fn().mockReturnValue(command)
@@ -1,51 +0,0 @@
1
- import { colorItBold, colorIt } from './utils.js';
2
- export const DEFAULT_NPM_TAG = 'latest';
3
- export const ASCII_ROBOT = `
4
- -:...........................-:.
5
- + +
6
- \`\` + \`...\` \`...\` + \`
7
- ./+/ + .:://:::\` \`::///::\` \` + ++/.
8
- .+oo+ + /:+ooo+-/ /-+ooo+-/ ./ + +oo+.
9
- -ooo+ + /-+ooo+-/ /-+ooo+-/ .: + +ooo.
10
- -+o+ + \`::///:-\` \`::///::\` + +o+-
11
- \`\`. /. \`\`\`\`\` \`\`\`\`\` .: .\`\`
12
- .----------------------------.
13
- \`-::::::::::::::::::::::::::::::::::::::::-\`
14
- .+oooo/:------------------------------:/oooo+.
15
- \`.--/oooo- :oooo/--.\`
16
- .::-\`\`:oooo\` .oooo-\`\`-::.
17
- ./-\` -oooo\`--.: :.-- .oooo- \`-/.
18
- -/\` \`-/oooo////////////////////////////////////oooo/.\` \`/-
19
- \`+\` \`/+oooooooooooooooooooooooooooooooooooooooooooooooo+:\` .+\`
20
- -/ +o/.:oooooooooooooooooooooooooooooooooooooooooooo:-/o/ +.
21
- -/ .o+ -oooosoooososssssooooo------------------:oooo- \`oo\` +.
22
- -/ .o+ -oooodooohyyssosshoooo\` .oooo- oo. +.
23
- -/ .o+ -oooodooysdooooooyyooo\` \`.--.\`\` .:::-oooo- oo. +.
24
- -/ .o+ -oooodoyyodsoooooyyooo.//-..-:/:.\`.//.\`./oooo- oo. +.
25
- -/ .o+ -oooohsyoooyysssysoooo+-\` \`-:::. .oooo- oo. +.
26
- -/ .o+ -ooooosooooooosooooooo+//////////////////oooo- oo. +.
27
- -/ .o+ -oooooooooooooooooooooooooooooooooooooooooooo- oo. +.
28
- -/ .o+ -oooooooooooooooooooooooooooooooooooooooooooo- oo. +.
29
- -+////o+\` -oooo---:///:----://::------------------:oooo- \`oo////+-
30
- +ooooooo/\`-oooo\`\`:-\`\`\`.:\`.:.\`.+/- .::::::::::\` .oooo-\`+ooooooo+
31
- oooooooo+\`-oooo\`-- \`/\` .:+ -/-\`/\` .:::::::::: .oooo-.+oooooooo
32
- +-/+://-/ -oooo-\`:\`.o-\`:.:-\`\`\`\`.: .///:\`\`\`\`\`\` -oooo-\`/-//:+:-+
33
- : :..--:-:.+ooo+/://o+/-.-:////:-....-::::-....--/+ooo+.:.:--.-- /
34
- - /./\`-:-\` .:///+/ooooo/+///////////////+++ooooo/+///:. .-:.\`+./ :
35
- :-:/. :\`ooooo\`/\` .:.ooooo : ./---
36
- :\`ooooo\`/\` .:.ooooo :
37
- :\`ooooo./\` .:-ooooo :
38
- :\`ooooo./\` .:-ooooo :
39
- \`...:-+++++:/. ./:+++++-:...\`
40
- :-.\`\`\`\`\`\`\`\`/../ /.-:\`\`\`\`\`\`\`\`.:-
41
- -/::::::::://:/+ \`+/:+::::::::::+.
42
- :oooooooooooo++/ +++oooooooooooo-
43
- `;
44
- export const PROGRAM_TITLE = `
45
- ${colorItBold('Webdriver.IO')}
46
- ${colorIt('Next-gen browser and mobile automation')}
47
- ${colorIt('test framework for Node.js')}
48
- `;
49
- export const UNSUPPORTED_NODE_VERSION = ('⚠️ Unsupported Node.js Version Error ⚠️\n' +
50
- `You are using Node.js ${process.version} which is to old to be used with WebdriverIO.\n` +
51
- 'Please update to Node.js v16 to continue.\n');
package/build/types.js DELETED
@@ -1 +0,0 @@
1
- export {};
package/build/utils.js DELETED
@@ -1,38 +0,0 @@
1
- import url from 'node:url';
2
- import path from 'node:path';
3
- import fs from 'node:fs/promises';
4
- import spawn from 'cross-spawn';
5
- import chalk from 'chalk';
6
- const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
7
- export const colorItBold = chalk.bold.rgb(234, 89, 6);
8
- export const colorIt = chalk.rgb(234, 89, 6);
9
- export function runProgram(command, args, options) {
10
- const child = spawn(command, args, { stdio: 'inherit', ...options });
11
- return new Promise((resolve, reject) => {
12
- let error;
13
- child.on('error', (e) => (error = e));
14
- child.on('close', code => {
15
- if (code !== 0) {
16
- return reject(new Error((error && error.message) ||
17
- `Error calling: ${command} ${args.join(' ')}`));
18
- }
19
- resolve();
20
- });
21
- });
22
- }
23
- /* c8 ignore start */
24
- export function shouldUseYarn() {
25
- return runProgram('yarnpkg', ['--version'], { stdio: 'ignore' }).then(() => true, () => false);
26
- }
27
- /* c8 ignore end */
28
- export async function getPackageVersion() {
29
- try {
30
- const pkgJsonPath = path.join(__dirname, '..', 'package.json');
31
- const pkg = JSON.parse((await fs.readFile(pkgJsonPath)).toString());
32
- return `v${pkg.version}`;
33
- }
34
- catch (e) {
35
- /* ignore */
36
- }
37
- return 'unknown';
38
- }
package/vitest.config.ts DELETED
@@ -1,23 +0,0 @@
1
- /// <reference types="vitest" />
2
- import { defineConfig } from 'vite'
3
-
4
- export default defineConfig({
5
- test: {
6
- include: ['tests/**/*.test.ts'],
7
- /**
8
- * not to ESM ported packages
9
- */
10
- exclude: [
11
- 'build', '.idea', '.git', '.cache',
12
- '**/node_modules/**', '__mocks__'
13
- ],
14
- coverage: {
15
- enabled: true,
16
- exclude: ['**/build/**', '__mocks__', '**/*.test.ts'],
17
- lines: 100,
18
- functions: 82,
19
- branches: 85,
20
- statements: 100
21
- }
22
- }
23
- })