Skip to content

Commit 9586d23

Browse files
committed
fix: format files with prettier v3
Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ac050e3 commit 9586d23

4 files changed

Lines changed: 32 additions & 17 deletions

File tree

packages/polyfills-loader/src/createPolyfillsData.ts

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ export async function createPolyfillsData(cfg: PolyfillsLoaderConfig): Promise<P
5454
}
5555

5656
if (polyfills.constructibleStylesheets) {
57-
const constructibleStylesheetsPath = await import.meta.resolve('construct-style-sheets-polyfill');
57+
const constructibleStylesheetsPath = await import.meta
58+
.resolve('construct-style-sheets-polyfill');
5859
addPolyfillConfig({
5960
name: 'constructible-style-sheets-polyfill',
6061
test: '!("adoptedStyleSheets" in document)',
@@ -129,7 +130,8 @@ export async function createPolyfillsData(cfg: PolyfillsLoaderConfig): Promise<P
129130
}
130131

131132
if (polyfills.dynamicImport) {
132-
const dynamicImportPath = await import.meta.resolve('dynamic-import-polyfill/dist/dynamic-import-polyfill.umd.js');
133+
const dynamicImportPath = await import.meta
134+
.resolve('dynamic-import-polyfill/dist/dynamic-import-polyfill.umd.js');
133135
addPolyfillConfig({
134136
name: 'dynamic-import',
135137
/**
@@ -149,7 +151,8 @@ export async function createPolyfillsData(cfg: PolyfillsLoaderConfig): Promise<P
149151
}
150152

151153
if (polyfills.intersectionObserver) {
152-
const intersectionObserverPath = await import.meta.resolve('intersection-observer/intersection-observer.js');
154+
const intersectionObserverPath = await import.meta
155+
.resolve('intersection-observer/intersection-observer.js');
153156
addPolyfillConfig({
154157
name: 'intersection-observer',
155158
test: "!('IntersectionObserver' in window && 'IntersectionObserverEntry' in window && 'intersectionRatio' in window.IntersectionObserverEntry.prototype)",
@@ -159,7 +162,8 @@ export async function createPolyfillsData(cfg: PolyfillsLoaderConfig): Promise<P
159162
}
160163

161164
if (polyfills.resizeObserver) {
162-
const resizeObserverPath = await import.meta.resolve('resize-observer-polyfill/dist/ResizeObserver.global.js');
165+
const resizeObserverPath = await import.meta
166+
.resolve('resize-observer-polyfill/dist/ResizeObserver.global.js');
163167
addPolyfillConfig({
164168
name: 'resize-observer',
165169
test: "!('ResizeObserver' in window)",
@@ -169,9 +173,8 @@ export async function createPolyfillsData(cfg: PolyfillsLoaderConfig): Promise<P
169173
}
170174

171175
if (polyfills.scopedCustomElementRegistry) {
172-
const scopedRegistryPath = await import.meta.resolve(
173-
'@webcomponents/scoped-custom-element-registry/scoped-custom-element-registry.min.js',
174-
);
176+
const scopedRegistryPath = await import.meta
177+
.resolve('@webcomponents/scoped-custom-element-registry/scoped-custom-element-registry.min.js');
175178
addPolyfillConfig({
176179
name: 'scoped-custom-element-registry',
177180
test: "!('createElement' in ShadowRoot.prototype)",
@@ -180,7 +183,8 @@ export async function createPolyfillsData(cfg: PolyfillsLoaderConfig): Promise<P
180183
}
181184

182185
if (polyfills.webcomponents && !polyfills.shadyCssCustomStyle) {
183-
const webcomponentsPath = await import.meta.resolve('@webcomponents/webcomponentsjs/webcomponents-bundle.js');
186+
const webcomponentsPath = await import.meta
187+
.resolve('@webcomponents/webcomponentsjs/webcomponents-bundle.js');
184188
addPolyfillConfig({
185189
name: 'webcomponents',
186190
test: "!('attachShadow' in Element.prototype) || !('getRootNode' in Element.prototype) || (window.ShadyDOM && window.ShadyDOM.force)",
@@ -189,7 +193,8 @@ export async function createPolyfillsData(cfg: PolyfillsLoaderConfig): Promise<P
189193

190194
// If a browser does not support nomodule attribute, but does support custom elements, we need
191195
// to load the custom elements es5 adapter. This is the case for Safari 10.1
192-
const es5AdapterPath = await import.meta.resolve('@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js');
196+
const es5AdapterPath = await import.meta
197+
.resolve('@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js');
193198
addPolyfillConfig({
194199
name: 'custom-elements-es5-adapter',
195200
test: "!('noModule' in HTMLScriptElement.prototype) && 'getRootNode' in Element.prototype",
@@ -201,9 +206,12 @@ export async function createPolyfillsData(cfg: PolyfillsLoaderConfig): Promise<P
201206
// shadycss/custom-style-interface polyfill *must* load after the webcomponents polyfill or it doesn't work.
202207
// to get around that, concat the two together.
203208

204-
const webcomponentsBundlePath = await import.meta.resolve('@webcomponents/webcomponentsjs/webcomponents-bundle.js');
205-
const customStylePath = await import.meta.resolve('@webcomponents/shadycss/custom-style-interface.min.js');
206-
const shadyCssScopedPath = await import.meta.resolve('shady-css-scoped-element/shady-css-scoped-element.min.js');
209+
const webcomponentsBundlePath = await import.meta
210+
.resolve('@webcomponents/webcomponentsjs/webcomponents-bundle.js');
211+
const customStylePath = await import.meta
212+
.resolve('@webcomponents/shadycss/custom-style-interface.min.js');
213+
const shadyCssScopedPath = await import.meta
214+
.resolve('shady-css-scoped-element/shady-css-scoped-element.min.js');
207215

208216
addPolyfillConfig({
209217
name: 'webcomponents-shady-css-custom-style',

packages/storybook-builder/src/generate-iframe-html.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ import { virtualAppFilename } from './virtual-file-names.ts';
99
export type PreviewHtml = string | undefined;
1010

1111
export async function generateIframeHtml(options: Options): Promise<string> {
12-
const iframeHtmlTemplate = await readFile(fileURLToPath(import.meta.resolve('../static/iframe-template.html')), {
13-
encoding: 'utf-8',
14-
});
12+
const iframeHtmlTemplate = await readFile(
13+
fileURLToPath(import.meta.resolve('../static/iframe-template.html')),
14+
{
15+
encoding: 'utf-8',
16+
},
17+
);
1518
const { configType, features, presets } = options;
1619
const build = await presets.apply('build');
1720
const frameworkOptions = await presets.apply<Record<string, any> | null>('frameworkOptions');

packages/storybook-builder/src/rollup-plugin-prebundle-modules.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ async function getIsReactVersion18or19(options: Options) {
108108
}
109109

110110
const resolvedReact = await options.presets.apply<{ reactDom?: string }>('resolvedReact', {});
111-
const reactDom = resolvedReact.reactDom || dirname(fileURLToPath(import.meta.resolve('react-dom/package.json')));
111+
const reactDom =
112+
resolvedReact.reactDom || dirname(fileURLToPath(import.meta.resolve('react-dom/package.json')));
112113

113114
if (!isAbsolute(reactDom)) {
114115
// if react-dom is not resolved to a file we can't be sure if the version in package.json is correct or even if package.json exists

packages/test-runner-saucelabs/src/SauceLabsLauncherManager.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { BrowserLauncher } from '@web/test-runner-core';
22
import * as _SaucelabsModule from 'saucelabs';
3-
const SaucelabsAPI = (_SaucelabsModule as any).default?.default ?? (_SaucelabsModule as any).default ?? _SaucelabsModule;
3+
const SaucelabsAPI =
4+
(_SaucelabsModule as any).default?.default ??
5+
(_SaucelabsModule as any).default ??
6+
_SaucelabsModule;
47
type SauceLabsOptions = import('saucelabs').SauceLabsOptions;
58
type SauceConnectOptions = import('saucelabs').SauceConnectOptions;
69
type SauceConnectInstance = import('saucelabs').SauceConnectInstance;

0 commit comments

Comments
 (0)