Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/eighty-cheetahs-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@patternfly/pfe-tools": minor
---

Adds tsconfig option to dev server config
5 changes: 5 additions & 0 deletions .changeset/eleven-toys-unite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@patternfly/pfe-tools": patch
---

Update the TS target in dev server
3 changes: 2 additions & 1 deletion core/pfe-core/controllers/color-context.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ReactiveController, ReactiveElement } from 'lit';
import type { ReactiveController } from 'lit';
import type { Context, ContextCallback, UnknownContext } from '../context.js';

import { ReactiveElement } from 'lit';
import { ContextEvent, createContext } from '../context.js';
import { bound } from '../decorators/bound.js';
import { Logger } from './logger.js';
Expand Down
8 changes: 3 additions & 5 deletions core/pfe-core/decorators/color-context.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import type { ReactiveElement } from 'lit';
import {
ColorContextOptions,
ColorContextConsumer,
ColorContextProvider,
} from '../controllers/color-context.js';
import type { ColorContextOptions } from '../controllers/color-context.js';

import { ColorContextConsumer, ColorContextProvider } from '../controllers/color-context.js';

export function colorContextProvider<T extends ReactiveElement>(options?: ColorContextOptions) {
return function(proto: T, _key: string) {
Expand Down
4 changes: 3 additions & 1 deletion elements/pfe-accordion/pfe-accordion-header.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import type { ColorTheme } from '@patternfly/pfe-core';

import { LitElement, html } from 'lit';
import { customElement, property, query } from 'lit/decorators.js';
import { unsafeStatic, html as staticH } from 'lit/static-html.js';

import { ColorTheme, ComposedEvent } from '@patternfly/pfe-core';
import { ComposedEvent } from '@patternfly/pfe-core';
import { pfelement, bound, observed, initializer, colorContextConsumer } from '@patternfly/pfe-core/decorators.js';
import { getRandomId } from '@patternfly/pfe-core/functions/random.js';
import { deprecatedCustomEvent } from '@patternfly/pfe-core/functions/deprecatedCustomEvent.js';
Expand Down
3 changes: 2 additions & 1 deletion elements/pfe-accordion/pfe-accordion.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { TemplateResult } from 'lit';
import type { ColorPalette, ColorTheme } from '@patternfly/pfe-core';

import { LitElement, html } from 'lit';
import { customElement, property, state } from 'lit/decorators.js';
Expand All @@ -14,7 +15,7 @@ import {
pfelement,
} from '@patternfly/pfe-core/decorators.js';

import { NumberListConverter, ComposedEvent, ColorPalette, ColorTheme } from '@patternfly/pfe-core';
import { NumberListConverter, ComposedEvent } from '@patternfly/pfe-core';
import { deprecatedCustomEvent } from '@patternfly/pfe-core/functions/deprecatedCustomEvent.js';
import { Logger } from '@patternfly/pfe-core/controllers/logger.js';

Expand Down
3 changes: 1 addition & 2 deletions elements/pfe-autocomplete/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"types": "./pfe-autocomplete.d.ts",
"exports": {
".": "./pfe-autocomplete.js",
"./*": "./*.js",
"./*.js": "./*.js"
"./*": "./*"
},
"publishConfig": {
"access": "public",
Expand Down
9 changes: 3 additions & 6 deletions elements/pfe-autocomplete/pfe-autocomplete.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import type { DroplistSelectEvent, PfeSearchDroplist } from './pfe-search-droplist';
import type { DroplistSelectEvent, PfeSearchDroplist } from './pfe-search-droplist.js';
import type { ColorPalette, ColorTheme } from '@patternfly/pfe-core';

import { LitElement, html } from 'lit';
import { customElement, property, state, query } from 'lit/decorators.js';

import { ColorPalette, ColorTheme } from '@patternfly/pfe-core';

import { ComposedEvent } from '@patternfly/pfe-core';
import { pfelement, bound, observed, colorContextConsumer, colorContextProvider, deprecation } from '@patternfly/pfe-core/decorators.js';
import { deprecatedCustomEvent } from '@patternfly/pfe-core/functions/deprecatedCustomEvent.js';


import './pfe-search-droplist';

import './pfe-search-droplist.js';

import style from './pfe-autocomplete.scss';

Expand Down
4 changes: 3 additions & 1 deletion elements/pfe-autocomplete/pfe-search-droplist.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import type { ColorTheme } from '@patternfly/pfe-core';

import { LitElement, html } from 'lit';
import { customElement, property, state, query } from 'lit/decorators.js';
import { classMap } from 'lit/directives/class-map.js';
import { repeat } from 'lit/directives/repeat.js';

import { ComposedEvent, ColorTheme } from '@patternfly/pfe-core';
import { ComposedEvent } from '@patternfly/pfe-core';

import { pfelement, bound, observed, colorContextConsumer } from '@patternfly/pfe-core/decorators.js';
import { deprecatedCustomEvent } from '@patternfly/pfe-core/functions/deprecatedCustomEvent.js';
Expand Down
4 changes: 3 additions & 1 deletion elements/pfe-clipboard/pfe-clipboard.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import type { ColorTheme } from '@patternfly/pfe-core';

import { LitElement, html } from 'lit';
import { customElement, property, state } from 'lit/decorators.js';

import { ColorTheme, ComposedEvent } from '@patternfly/pfe-core';
import { ComposedEvent } from '@patternfly/pfe-core';
import { SlotController } from '@patternfly/pfe-core/controllers/slot-controller.js';
import { pfelement, bound, observed, colorContextConsumer } from '@patternfly/pfe-core/decorators.js';
import { deprecatedCustomEvent } from '@patternfly/pfe-core/functions/deprecatedCustomEvent.js';
Expand Down
4 changes: 3 additions & 1 deletion elements/pfe-clipboard/test/pfe-clipboard.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import type { SinonStub } from 'sinon';

import { expect, aTimeout, oneEvent, nextFrame, html } from '@open-wc/testing';
import { spy, stub, SinonStub } from 'sinon';
import { spy, stub } from 'sinon';
import { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';
import { getComposedText } from '@patternfly/pfe-tools/test/get-composed-text.js';
import { hexToRgb } from '@patternfly/pfe-tools/test/hex-to-rgb.js';
Expand Down
2 changes: 1 addition & 1 deletion elements/pfe-dropdown/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"types": "./pfe-dropdown.d.ts",
"exports": {
".": "./pfe-dropdown.js",
"./*": "./*.js"
"./*": "./*"
},
"publishConfig": {
"access": "public",
Expand Down
6 changes: 4 additions & 2 deletions elements/pfe-dropdown/test/pfe-dropdown.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import type { ActionOption, PfeDropdownOption, DropdownChangeEvent } from '@patternfly/pfe-dropdown';
import type { PfeDropdownItem } from '@patternfly/pfe-dropdown/pfe-dropdown-item.js';

import { expect, html, oneEvent } from '@open-wc/testing';
import { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';
import { sendKeys } from '@web/test-runner-commands';

import { PfeDropdown, PfeDropdownOption, DropdownChangeEvent, ActionOption } from '@patternfly/pfe-dropdown';
import { PfeDropdownItem } from '@patternfly/pfe-dropdown/pfe-dropdown-item.js';
import { PfeDropdown } from '@patternfly/pfe-dropdown';

describe('<pfe-dropdown>', function() {
it('should upgrade', async function() {
Expand Down
2 changes: 1 addition & 1 deletion elements/pfe-health-index/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"module": "./pfe-health-index.js",
"exports": {
".": "./pfe-health-index.js",
"./*": "./*.js"
"./*": "./*"
},
"publishConfig": {
"access": "public",
Expand Down
4 changes: 3 additions & 1 deletion elements/pfe-health-index/test/pfe-health-index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import type { SinonSpy } from 'sinon';

import { expect, html, nextFrame } from '@open-wc/testing';
import { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';

import { PfeHealthIndex } from '@patternfly/pfe-health-index';

import { spy, SinonSpy } from 'sinon';
import { spy } from 'sinon';

describe('<pfe-health-index>', function() {
let consoleSpy: SinonSpy;
Expand Down
2 changes: 1 addition & 1 deletion elements/pfe-icon/pfe-icon.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { ColorTheme } from '@patternfly/pfe-core';
import type { IconNameResolverFn } from './icon-set.js';

import { LitElement, html, svg } from 'lit';
Expand All @@ -13,7 +14,6 @@ import { PfeIconSet } from './icon-set.js';
import { addBuiltIns } from './builtin-icon-sets.js';

import style from './pfe-icon.scss';
import { ColorTheme } from '@patternfly/pfe-core';

export type IconColor = (
| 'accent'
Expand Down
4 changes: 3 additions & 1 deletion elements/pfe-jump-links/pfe-jump-links-nav.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import type { ColorPalette, ColorTheme } from '@patternfly/pfe-core';

import { LitElement, html } from 'lit';
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
import { customElement, property, query, state } from 'lit/decorators.js';

import { ColorPalette, ColorTheme, ComposedEvent } from '@patternfly/pfe-core';
import { ComposedEvent } from '@patternfly/pfe-core';
import { pfelement, bound, observed, colorContextConsumer, deprecation, colorContextProvider } from '@patternfly/pfe-core/decorators.js';
import { getRandomId } from '@patternfly/pfe-core/functions/random.js';
import { deprecatedCustomEvent } from '@patternfly/pfe-core/functions/deprecatedCustomEvent.js';
Expand Down
3 changes: 2 additions & 1 deletion elements/pfe-jump-links/test/pfe-jump-links.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import type { LitElement } from 'lit';
import type { SinonSpy } from 'sinon';

import { expect, html, oneEvent } from '@open-wc/testing';
import { createFixture } from '@patternfly/pfe-tools/test/create-fixture.js';

import { PfeJumpLinks, PfeJumpLinksPanel } from '@patternfly/pfe-jump-links';

import { spy, SinonSpy } from 'sinon';
import { spy } from 'sinon';
import { ChangeEvent } from '../pfe-jump-links-nav';

describe('<pfe-jump-links>', function() {
Expand Down
6 changes: 4 additions & 2 deletions elements/pfe-tooltip/BaseTooltip.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/* eslint-disable no-console */
import type { Placement } from '@patternfly/pfe-core/controllers/floating-dom-controller.js';

import { LitElement, html } from 'lit';
import { property } from 'lit/decorators.js';
import { FloatingDOMController } from '@patternfly/pfe-core/controllers/floating-dom-controller.js';

import style from './BaseTooltip.scss';
import { FloatingDOMController, Placement } from '@patternfly/pfe-core/controllers/floating-dom-controller.js';

export abstract class BaseTooltip extends LitElement {
static readonly styles = [style];
Expand Down
7 changes: 5 additions & 2 deletions tools/pfe-tools/dev-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export interface PfeDevServerConfigOptions extends Base {
hostname?: string;
importMap?: InjectSetting['importMap'];
litcssOptions?: LitCSSOptions,
tsconfig?: string;
/** Extra dev server plugins */
loadDemo?: boolean;
plugins?: Plugin[];
Expand Down Expand Up @@ -236,6 +237,8 @@ export function pfeDevServerConfig(options?: PfeDevServerConfigOptions): DevServ
.replace(/\/node_modules$/, '/')
.replace('//', '/');

const tsconfig = options?.tsconfig;

return {
rootDir,

Expand Down Expand Up @@ -267,8 +270,8 @@ export function pfeDevServerConfig(options?: PfeDevServerConfigOptions): DevServ
// serve typescript sources as javascript
esbuildPlugin({
ts: true,
// see https://github.com/evanw/esbuild/issues/2220
target: 'es2020'
target: 'es2022',
tsconfig,
}),

// load .scss files as lit CSSResult modules
Expand Down
1 change: 1 addition & 0 deletions web-dev-server.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export function fakePrismModule() {
}

export default pfeDevServerConfig({
tsconfig: 'tsconfig.settings.json',
plugins: [
fakePrismModule(),
],
Expand Down
1 change: 1 addition & 0 deletions web-test-runner.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { pfeTestRunnerConfig } from '@patternfly/pfe-tools/test-runner.js';
import { fakePrismModule } from './web-dev-server.config.js';

export default pfeTestRunnerConfig({
tsconfig: 'tsconfig.settings.json',
files: ['!tools/create-element/templates/**/*'],
// uncomment to get default wtr reporter
// reporter: 'default',
Expand Down