@wdio/cli 8.13.3 → 8.13.5
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/build/templates/exampleFiles/browser/Component.css.ejs +2 -1
- package/build/templates/exampleFiles/browser/Component.lit.ejs +35 -9
- package/build/templates/exampleFiles/browser/Component.lit.test.ejs +1 -1
- package/build/templates/exampleFiles/browser/Component.preact.ejs +1 -1
- package/build/templates/exampleFiles/browser/Component.preact.test.ejs +5 -5
- package/build/templates/exampleFiles/browser/Component.react.ejs +1 -1
- package/build/templates/exampleFiles/browser/Component.react.test.ejs +5 -5
- package/build/templates/exampleFiles/browser/Component.solid.ejs +1 -1
- package/build/templates/exampleFiles/browser/Component.solid.test.ejs +5 -5
- package/build/templates/exampleFiles/browser/Component.svelte.ejs +1 -1
- package/build/templates/exampleFiles/browser/Component.svelte.test.ejs +5 -5
- package/build/templates/exampleFiles/browser/Component.vue.ejs +1 -1
- package/build/templates/exampleFiles/browser/Component.vue.test.ejs +5 -5
- package/build/utils.d.ts.map +1 -1
- package/build/utils.js +55 -8
- package/package.json +4 -4
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { LitElement, css, html } from 'lit'
|
|
2
|
-
import { customElement, property } from 'lit/decorators.js'
|
|
3
|
-
|
|
2
|
+
<%- answers.isUsingTypeScript ? `import { customElement, property } from 'lit/decorators.js'\n` : ''
|
|
3
|
+
%>
|
|
4
4
|
/**
|
|
5
5
|
* An example element.
|
|
6
6
|
*
|
|
7
7
|
* @slot - This element has a slot
|
|
8
8
|
* @csspart button - The button
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
|
-
export class MyElement extends LitElement {
|
|
10
|
+
<%- answers.isUsingTypeScript ? `@customElement('my-element')\n` : ''
|
|
11
|
+
%>export class MyElement extends LitElement {<%
|
|
12
|
+
if (answers.isUsingTypeScript) { %>
|
|
12
13
|
/**
|
|
13
14
|
* Copy for the read the docs hint.
|
|
14
15
|
*/
|
|
@@ -20,7 +21,27 @@ export class MyElement extends LitElement {
|
|
|
20
21
|
*/
|
|
21
22
|
@property({ type: Number })
|
|
22
23
|
count = 0
|
|
24
|
+
<% } else { %>
|
|
25
|
+
static get properties() {
|
|
26
|
+
return {
|
|
27
|
+
/**
|
|
28
|
+
* Copy for the read the docs hint.
|
|
29
|
+
*/
|
|
30
|
+
docsHint: { type: String },
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The number of times the button has been clicked.
|
|
34
|
+
*/
|
|
35
|
+
count: { type: Number },
|
|
36
|
+
}
|
|
37
|
+
}
|
|
23
38
|
|
|
39
|
+
constructor() {
|
|
40
|
+
super()
|
|
41
|
+
this.docsHint = 'Click on the Vite and Lit logos to learn more'
|
|
42
|
+
this.count = 0
|
|
43
|
+
}
|
|
44
|
+
<% } %>
|
|
24
45
|
render() {
|
|
25
46
|
return html`
|
|
26
47
|
<div>
|
|
@@ -37,18 +58,19 @@ export class MyElement extends LitElement {
|
|
|
37
58
|
count is ${this.count}
|
|
38
59
|
</button>
|
|
39
60
|
<p>
|
|
40
|
-
Edit <code>src/Component.test.
|
|
61
|
+
Edit <code>src/Component.test.<%- answers.isUsingTypeScript ? `ts` : 'js' %></code> and save to test HMR
|
|
41
62
|
</p>
|
|
42
63
|
</div>
|
|
43
64
|
<p class="read-the-docs">${this.docsHint}</p>
|
|
44
65
|
`
|
|
45
66
|
}
|
|
46
67
|
|
|
47
|
-
private _onClick() {
|
|
68
|
+
<%- answers.isUsingTypeScript ? `private ` : ''%>_onClick() {
|
|
48
69
|
this.count++
|
|
49
70
|
}
|
|
50
71
|
|
|
51
|
-
static styles = css
|
|
72
|
+
<% if (answers.isUsingTypeScript) { %>static styles = css`<% } else { %>static get styles() {
|
|
73
|
+
return css`<% } %>
|
|
52
74
|
:host {
|
|
53
75
|
max-width: 1280px;
|
|
54
76
|
margin: 0 auto;
|
|
@@ -119,10 +141,14 @@ export class MyElement extends LitElement {
|
|
|
119
141
|
}
|
|
120
142
|
}
|
|
121
143
|
`
|
|
144
|
+
<% if (!answers.isUsingTypeScript) { %>}<% } %>
|
|
122
145
|
}
|
|
123
|
-
|
|
146
|
+
<% if (answers.isUsingTypeScript) { %>
|
|
124
147
|
declare global {
|
|
125
148
|
interface HTMLElementTagNameMap {
|
|
126
149
|
'my-element': MyElement
|
|
127
150
|
}
|
|
128
|
-
}
|
|
151
|
+
}<%
|
|
152
|
+
} else { %>
|
|
153
|
+
window.customElements.define('my-element', MyElement)<%
|
|
154
|
+
} %>
|
|
@@ -17,7 +17,7 @@ export default function ExampleComponent () {
|
|
|
17
17
|
count is {count}
|
|
18
18
|
</button>
|
|
19
19
|
<p>
|
|
20
|
-
Edit <code>src/Component.test.tsx
|
|
20
|
+
Edit <code>src/Component.test.<%- answers.isUsingTypeScript ? `tsx` : 'jsx' %></code> and save to test HMR
|
|
21
21
|
</p>
|
|
22
22
|
</div>
|
|
23
23
|
<p class="read-the-docs">
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<%
|
|
2
|
-
const harnessImport = installTestingLibrary
|
|
2
|
+
const harnessImport = answers.installTestingLibrary
|
|
3
3
|
? `import { h } from 'preact'\nimport { render, screen, fireEvent } from '@testing-library/preact'`
|
|
4
4
|
: `import { h, render } from 'preact'\nimport htm from 'https://esm.sh/htm'`
|
|
5
|
-
const renderCommand = installTestingLibrary
|
|
5
|
+
const renderCommand = answers.installTestingLibrary
|
|
6
6
|
? `render(<ExampleComponent />)`
|
|
7
7
|
: "render(html`<${ExampleComponent} />`, container)"
|
|
8
8
|
%>
|
|
9
9
|
import { expect, $ } from '@wdio/globals'
|
|
10
10
|
<%- harnessImport %>
|
|
11
|
-
<% if (installTestingLibrary) { %>
|
|
11
|
+
<% if (answers.installTestingLibrary) { %>
|
|
12
12
|
import * as matchers from '@testing-library/jest-dom/matchers'
|
|
13
13
|
expect.extend(matchers)
|
|
14
14
|
<% } else { %>
|
|
@@ -18,7 +18,7 @@ const html = htm.bind(h);
|
|
|
18
18
|
import ExampleComponent from './Component'
|
|
19
19
|
|
|
20
20
|
describe('Preact Component Tests', () => {
|
|
21
|
-
<% if (installTestingLibrary) { %>
|
|
21
|
+
<% if (answers.installTestingLibrary) { %>
|
|
22
22
|
it('should test component with Testing Library', async () => {
|
|
23
23
|
render(<ExampleComponent />)
|
|
24
24
|
const component = screen.getByText(/count is 0/i)
|
|
@@ -30,7 +30,7 @@ describe('Preact Component Tests', () => {
|
|
|
30
30
|
expect(screen.getByText(/count is 2/i)).toBeInTheDocument()
|
|
31
31
|
})
|
|
32
32
|
<% } else { %>
|
|
33
|
-
let container<%- isUsingTypeScript ? `: Element` : '' %>
|
|
33
|
+
let container<%- answers.isUsingTypeScript ? `: Element` : '' %>
|
|
34
34
|
|
|
35
35
|
beforeEach(() => {
|
|
36
36
|
container = document.createElement('div')
|
|
@@ -18,7 +18,7 @@ export default function ExampleComponent () {
|
|
|
18
18
|
count is {count}
|
|
19
19
|
</button>
|
|
20
20
|
<p>
|
|
21
|
-
Edit <code>src/Component.test.tsx
|
|
21
|
+
Edit <code>src/Component.test.<%- answers.isUsingTypeScript ? `tsx` : 'jsx' %></code> and save to test HMR
|
|
22
22
|
</p>
|
|
23
23
|
</div>
|
|
24
24
|
<p className="read-the-docs">
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<%
|
|
2
|
-
const harnessImport = installTestingLibrary
|
|
2
|
+
const harnessImport = answers.installTestingLibrary
|
|
3
3
|
? `import { render, screen, fireEvent } from '@testing-library/react'`
|
|
4
4
|
: `import { createRoot } from 'react-dom/client'`
|
|
5
|
-
const renderCommand = installTestingLibrary
|
|
5
|
+
const renderCommand = answers.installTestingLibrary
|
|
6
6
|
? `render(<ExampleComponent />)`
|
|
7
7
|
: `const root = createRoot(container)
|
|
8
8
|
root.render(<ExampleComponent />)`
|
|
@@ -10,14 +10,14 @@ const renderCommand = installTestingLibrary
|
|
|
10
10
|
import React from 'react'
|
|
11
11
|
import { expect, $ } from '@wdio/globals'
|
|
12
12
|
<%- harnessImport %>
|
|
13
|
-
<% if (installTestingLibrary) { %>
|
|
13
|
+
<% if (answers.installTestingLibrary) { %>
|
|
14
14
|
import * as matchers from '@testing-library/jest-dom/matchers'
|
|
15
15
|
expect.extend(matchers)
|
|
16
16
|
<% } %>
|
|
17
17
|
import ExampleComponent from './Component'
|
|
18
18
|
|
|
19
19
|
describe('React Component Tests', () => {
|
|
20
|
-
<% if (installTestingLibrary) { %>
|
|
20
|
+
<% if (answers.installTestingLibrary) { %>
|
|
21
21
|
it('should test component with Testing Library', async () => {
|
|
22
22
|
render(<ExampleComponent />)
|
|
23
23
|
const component = screen.getByText(/count is 0/i)
|
|
@@ -29,7 +29,7 @@ describe('React Component Tests', () => {
|
|
|
29
29
|
expect(screen.getByText(/count is 2/i)).toBeInTheDocument()
|
|
30
30
|
})
|
|
31
31
|
<% } else { %>
|
|
32
|
-
let container<%- isUsingTypeScript ? `: Element` : '' %>
|
|
32
|
+
let container<%- answers.isUsingTypeScript ? `: Element` : '' %>
|
|
33
33
|
|
|
34
34
|
beforeEach(() => {
|
|
35
35
|
container = document.createElement('div')
|
|
@@ -17,7 +17,7 @@ export default function ExampleComponent () {
|
|
|
17
17
|
count is {count}
|
|
18
18
|
</button>
|
|
19
19
|
<p>
|
|
20
|
-
Edit <code>src/Component.test.tsx
|
|
20
|
+
Edit <code>src/Component.test.<%- answers.isUsingTypeScript ? `tsx` : 'jsx' %></code> and save to test HMR
|
|
21
21
|
</p>
|
|
22
22
|
</div>
|
|
23
23
|
<p class="read-the-docs">
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
<%
|
|
2
|
-
const harnessImport = installTestingLibrary
|
|
2
|
+
const harnessImport = answers.installTestingLibrary
|
|
3
3
|
? `import { cleanup, render, screen, fireEvent } from 'solid-testing-library'`
|
|
4
4
|
: `import { render } from 'solid-js/web'`
|
|
5
|
-
const renderCommand = installTestingLibrary
|
|
5
|
+
const renderCommand = answers.installTestingLibrary
|
|
6
6
|
? `render(() => <ExampleComponent />)`
|
|
7
7
|
: `render(<ExampleComponent />, container)`
|
|
8
8
|
%>
|
|
9
9
|
import { expect, $ } from '@wdio/globals'
|
|
10
10
|
<%- harnessImport %>
|
|
11
|
-
<% if (installTestingLibrary) { %>
|
|
11
|
+
<% if (answers.installTestingLibrary) { %>
|
|
12
12
|
import * as matchers from '@testing-library/jest-dom/matchers'
|
|
13
13
|
expect.extend(matchers)
|
|
14
14
|
<% } %>
|
|
15
15
|
import ExampleComponent from './Component'
|
|
16
16
|
|
|
17
17
|
describe('Preact Component Tests', () => {
|
|
18
|
-
<% if (installTestingLibrary) { %>
|
|
18
|
+
<% if (answers.installTestingLibrary) { %>
|
|
19
19
|
afterEach(cleanup)
|
|
20
20
|
|
|
21
21
|
it('should test component with Testing Library', async () => {
|
|
@@ -29,7 +29,7 @@ describe('Preact Component Tests', () => {
|
|
|
29
29
|
expect(screen.getByText(/count is 2/i)).toBeInTheDocument()
|
|
30
30
|
})
|
|
31
31
|
<% } else { %>
|
|
32
|
-
let container<%- isUsingTypeScript ? `: Element` : '' %>
|
|
32
|
+
let container<%- answers.isUsingTypeScript ? `: Element` : '' %>
|
|
33
33
|
|
|
34
34
|
beforeEach(() => {
|
|
35
35
|
container = document.createElement('div')
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<%
|
|
2
|
-
const harnessImport = installTestingLibrary
|
|
2
|
+
const harnessImport = answers.installTestingLibrary
|
|
3
3
|
? `import { render, fireEvent } from '@testing-library/svelte'`
|
|
4
4
|
: ``
|
|
5
|
-
const renderCommand = installTestingLibrary
|
|
5
|
+
const renderCommand = answers.installTestingLibrary
|
|
6
6
|
? `render(ExampleComponent)`
|
|
7
7
|
: `new ExampleComponent({ target: container, props: {} })`
|
|
8
8
|
%>
|
|
9
9
|
import { $, expect } from '@wdio/globals'
|
|
10
10
|
<%- harnessImport %>
|
|
11
|
-
<% if (installTestingLibrary) { %>
|
|
11
|
+
<% if (answers.installTestingLibrary) { %>
|
|
12
12
|
import * as matchers from '@testing-library/jest-dom/matchers'
|
|
13
13
|
expect.extend(matchers)
|
|
14
14
|
<% } %>
|
|
@@ -16,7 +16,7 @@ import ExampleComponent from './Component.svelte'
|
|
|
16
16
|
import './Component.css'
|
|
17
17
|
|
|
18
18
|
describe('Svelte Component Testing', () => {
|
|
19
|
-
<% if (installTestingLibrary) { %>
|
|
19
|
+
<% if (answers.installTestingLibrary) { %>
|
|
20
20
|
it('should test component with Testing Library', async () => {
|
|
21
21
|
const { getByText } = render(ExampleComponent)
|
|
22
22
|
|
|
@@ -29,7 +29,7 @@ describe('Svelte Component Testing', () => {
|
|
|
29
29
|
expect(getByText(/count is 2/i)).toBeInTheDocument()
|
|
30
30
|
})
|
|
31
31
|
<% } else { %>
|
|
32
|
-
let container<%- isUsingTypeScript ? `: Element` : '' %>
|
|
32
|
+
let container<%- answers.isUsingTypeScript ? `: Element` : '' %>
|
|
33
33
|
|
|
34
34
|
beforeEach(() => {
|
|
35
35
|
container = document.createElement('div')
|
|
@@ -19,7 +19,7 @@ const count = ref(0)
|
|
|
19
19
|
<div class="card">
|
|
20
20
|
<button type="button" @click="count++">count is {{ count }}</button>
|
|
21
21
|
<p>
|
|
22
|
-
Edit <code>src/Component.test.
|
|
22
|
+
Edit <code>src/Component.test.<%- answers.isUsingTypeScript ? `ts` : 'js' %></code> and save to test HMR
|
|
23
23
|
</p>
|
|
24
24
|
</div>
|
|
25
25
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<%
|
|
2
|
-
const harnessImport = installTestingLibrary
|
|
2
|
+
const harnessImport = answers.installTestingLibrary
|
|
3
3
|
? `import { render, fireEvent } from '@testing-library/vue'`
|
|
4
4
|
: `import { createApp } from 'vue'`
|
|
5
|
-
const renderCommand = installTestingLibrary
|
|
5
|
+
const renderCommand = answers.installTestingLibrary
|
|
6
6
|
? `render(ExampleComponent, { props: { msg: 'WebdriverIO Component Testing' } })`
|
|
7
7
|
: `createApp(ExampleComponent, { msg: 'WebdriverIO Component Testing' }).mount(container)`
|
|
8
8
|
%>
|
|
9
9
|
import { $, expect } from '@wdio/globals'
|
|
10
10
|
<%- harnessImport %>
|
|
11
|
-
<% if (installTestingLibrary) { %>
|
|
11
|
+
<% if (answers.installTestingLibrary) { %>
|
|
12
12
|
import * as matchers from '@testing-library/jest-dom/matchers'
|
|
13
13
|
expect.extend(matchers)
|
|
14
14
|
<% } %>
|
|
@@ -16,7 +16,7 @@ import ExampleComponent from './Component.vue'
|
|
|
16
16
|
import './Component.css'
|
|
17
17
|
|
|
18
18
|
describe('Vue Component Testing', () => {
|
|
19
|
-
<% if (installTestingLibrary) { %>
|
|
19
|
+
<% if (answers.installTestingLibrary) { %>
|
|
20
20
|
it('should test component with Testing Library', async () => {
|
|
21
21
|
// The render method returns a collection of utilities to query your component.
|
|
22
22
|
const { getByText } = render(ExampleComponent, {
|
|
@@ -32,7 +32,7 @@ describe('Vue Component Testing', () => {
|
|
|
32
32
|
expect(getByText(/count is 2/i)).toBeInTheDocument()
|
|
33
33
|
})
|
|
34
34
|
<% } else { %>
|
|
35
|
-
let container<%- isUsingTypeScript ? `: Element` : '' %>
|
|
35
|
+
let container<%- answers.isUsingTypeScript ? `: Element` : '' %>
|
|
36
36
|
|
|
37
37
|
beforeEach(() => {
|
|
38
38
|
container = document.createElement('div')
|
package/build/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAetD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAGhD,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAMlE,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;A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;AAED,wBAAsB,kBAAkB,CAAC,aAAa,EAAE,aAAa,4DAoBpE"}
|
package/build/utils.js
CHANGED
|
@@ -326,16 +326,14 @@ export async function generateTestFiles(answers) {
|
|
|
326
326
|
const TSX_BASED_FRAMEWORKS = ['react', 'preact', 'solid'];
|
|
327
327
|
export async function generateBrowserRunnerTestFiles(answers) {
|
|
328
328
|
const isUsingFramework = typeof answers.preset === 'string';
|
|
329
|
-
const preset =
|
|
330
|
-
? answers.preset || 'lit'
|
|
331
|
-
: '';
|
|
329
|
+
const preset = getPreset(answers);
|
|
332
330
|
const tplRootDir = path.join(TEMPLATE_ROOT_DIR, 'browser');
|
|
333
331
|
await fs.mkdir(answers.destSpecRootPath, { recursive: true });
|
|
334
332
|
/**
|
|
335
333
|
* render css file
|
|
336
334
|
*/
|
|
337
335
|
if (isUsingFramework) {
|
|
338
|
-
const renderedCss = await renderFile(path.join(tplRootDir, 'Component.css.ejs'), answers);
|
|
336
|
+
const renderedCss = await renderFile(path.join(tplRootDir, 'Component.css.ejs'), { answers });
|
|
339
337
|
await fs.writeFile(path.join(answers.destSpecRootPath, 'Component.css'), renderedCss);
|
|
340
338
|
}
|
|
341
339
|
/**
|
|
@@ -347,14 +345,14 @@ export async function generateBrowserRunnerTestFiles(answers) {
|
|
|
347
345
|
: testExt;
|
|
348
346
|
if (preset) {
|
|
349
347
|
const componentOutFileName = `Component.${fileExt}`;
|
|
350
|
-
const renderedComponent = await renderFile(path.join(tplRootDir, `Component.${preset}.ejs`), answers);
|
|
348
|
+
const renderedComponent = await renderFile(path.join(tplRootDir, `Component.${preset}.ejs`), { answers });
|
|
351
349
|
await fs.writeFile(path.join(answers.destSpecRootPath, componentOutFileName), renderedComponent);
|
|
352
350
|
}
|
|
353
351
|
/**
|
|
354
352
|
* render test file
|
|
355
353
|
*/
|
|
356
354
|
const componentFileName = preset ? `Component.${preset}.test.ejs` : 'standalone.test.ejs';
|
|
357
|
-
const renderedTest = await renderFile(path.join(tplRootDir, componentFileName), answers);
|
|
355
|
+
const renderedTest = await renderFile(path.join(tplRootDir, componentFileName), { answers });
|
|
358
356
|
await fs.writeFile(path.join(answers.destSpecRootPath, `Component.test.${testExt}`), renderedTest);
|
|
359
357
|
}
|
|
360
358
|
async function generateLocalRunnerTestFiles(answers) {
|
|
@@ -589,6 +587,13 @@ export function npmInstall(parsedAnswers, useYarn, npmTag) {
|
|
|
589
587
|
if (presetPackage.short === 'solid') {
|
|
590
588
|
parsedAnswers.packagesToInstall.push('solid-js');
|
|
591
589
|
}
|
|
590
|
+
/**
|
|
591
|
+
* add dependency for Lit testing
|
|
592
|
+
*/
|
|
593
|
+
const preset = getPreset(parsedAnswers);
|
|
594
|
+
if (preset === 'lit') {
|
|
595
|
+
parsedAnswers.packagesToInstall.push('lit');
|
|
596
|
+
}
|
|
592
597
|
/**
|
|
593
598
|
* add helper for React rendering when not using Testing Library
|
|
594
599
|
*/
|
|
@@ -666,19 +671,61 @@ export async function setupTypeScript(parsedAnswers) {
|
|
|
666
671
|
.filter(service => service.startsWith('@wdio'))
|
|
667
672
|
];
|
|
668
673
|
if (!parsedAnswers.hasRootTSConfig) {
|
|
674
|
+
const preset = getPreset(parsedAnswers);
|
|
669
675
|
const config = {
|
|
670
676
|
compilerOptions: {
|
|
677
|
+
// compiler
|
|
671
678
|
moduleResolution: 'node',
|
|
672
679
|
module: !parsedAnswers.esmSupport ? 'commonjs' : 'ESNext',
|
|
673
|
-
types,
|
|
674
680
|
target: 'es2022',
|
|
675
|
-
|
|
681
|
+
types,
|
|
682
|
+
skipLibCheck: true,
|
|
683
|
+
// bundler
|
|
684
|
+
noEmit: true,
|
|
685
|
+
allowImportingTsExtensions: true,
|
|
686
|
+
resolveJsonModule: true,
|
|
687
|
+
isolatedModules: true,
|
|
688
|
+
// linting
|
|
689
|
+
strict: true,
|
|
690
|
+
noUnusedLocals: true,
|
|
691
|
+
noUnusedParameters: true,
|
|
692
|
+
noFallthroughCasesInSwitch: true,
|
|
693
|
+
...Object.assign(preset === 'lit'
|
|
694
|
+
? {
|
|
695
|
+
experimentalDecorators: true,
|
|
696
|
+
useDefineForClassFields: false
|
|
697
|
+
}
|
|
698
|
+
: {}, preset === 'react'
|
|
699
|
+
? {
|
|
700
|
+
jsx: 'react-jsx'
|
|
701
|
+
}
|
|
702
|
+
: {}, preset === 'preact'
|
|
703
|
+
? {
|
|
704
|
+
jsx: 'react-jsx',
|
|
705
|
+
jsxImportSource: 'preact'
|
|
706
|
+
}
|
|
707
|
+
: {}, preset === 'solid'
|
|
708
|
+
? {
|
|
709
|
+
jsx: 'preserve',
|
|
710
|
+
jsxImportSource: 'solid-js'
|
|
711
|
+
}
|
|
712
|
+
: {})
|
|
713
|
+
},
|
|
714
|
+
include: preset === 'svelte'
|
|
715
|
+
? ['src/**/*.d.ts', 'src/**/*.ts', 'src/**/*.js', 'src/**/*.svelte']
|
|
716
|
+
: preset === 'vue'
|
|
717
|
+
? ['src/**/*.ts', 'src/**/*.d.ts', 'src/**/*.tsx', 'src/**/*.vue']
|
|
718
|
+
: ['src']
|
|
676
719
|
};
|
|
677
720
|
await fs.mkdir(path.dirname(parsedAnswers.tsConfigFilePath), { recursive: true });
|
|
678
721
|
await fs.writeFile(parsedAnswers.tsConfigFilePath, JSON.stringify(config, null, 4));
|
|
679
722
|
}
|
|
680
723
|
console.log(chalk.green.bold('✔ Success!\n'));
|
|
681
724
|
}
|
|
725
|
+
function getPreset(parsedAnswers) {
|
|
726
|
+
const isUsingFramework = typeof parsedAnswers.preset === 'string';
|
|
727
|
+
return isUsingFramework ? (parsedAnswers.preset || 'lit') : '';
|
|
728
|
+
}
|
|
682
729
|
/**
|
|
683
730
|
* add @babel/register package if not installed
|
|
684
731
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/cli",
|
|
3
|
-
"version": "8.13.
|
|
3
|
+
"version": "8.13.5",
|
|
4
4
|
"description": "WebdriverIO testrunner command line interface",
|
|
5
5
|
"author": "Christian Bromann <mail@bromann.dev>",
|
|
6
6
|
"homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-cli",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@types/node": "^20.1.1",
|
|
49
49
|
"@wdio/config": "8.12.1",
|
|
50
|
-
"@wdio/globals": "8.13.
|
|
50
|
+
"@wdio/globals": "8.13.4",
|
|
51
51
|
"@wdio/logger": "8.11.0",
|
|
52
52
|
"@wdio/protocols": "8.11.0",
|
|
53
53
|
"@wdio/types": "8.10.4",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"lodash.union": "^4.6.0",
|
|
66
66
|
"read-pkg-up": "9.1.0",
|
|
67
67
|
"recursive-readdir": "^2.2.3",
|
|
68
|
-
"webdriverio": "8.13.
|
|
68
|
+
"webdriverio": "8.13.4",
|
|
69
69
|
"yargs": "^17.7.2",
|
|
70
70
|
"yarn-install": "^1.0.0"
|
|
71
71
|
},
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"publishConfig": {
|
|
83
83
|
"access": "public"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "479ce833c57a8c87d30de35df519d69ca9b3229e"
|
|
86
86
|
}
|