Skip to content

Commit 59758b7

Browse files
milanMilan MagudiaScriptedAlchemy
authored
fix: retry-plugin package.json main, module and types paths (#2931)
Co-authored-by: Milan Magudia <[email protected]> Co-authored-by: Zack Jackson <[email protected]>
1 parent e327fbf commit 59758b7

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

.changeset/eighty-seals-lay.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@module-federation/retry-plugin': patch
3+
---
4+
5+
Use correct paths for export

packages/retry-plugin/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "@module-federation/retry-plugin",
33
"version": "0.6.1",
44
"author": "danpeen <[email protected]>",
5-
"main": "./dist/index.cjs.js",
6-
"module": "./dist/index.esm.js",
7-
"types": "./dist/index.cjs.d.ts",
5+
"main": "./dist/index.js",
6+
"module": "./dist/esm/index.js",
7+
"types": "./dist/index.d.ts",
88
"license": "MIT",
99
"publishConfig": {
1010
"access": "public"

packages/retry-plugin/src/fetch-retry.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ReqiuredUrl, FetchWithRetryOptions } from './types';
1+
import type { RequiredUrl, FetchWithRetryOptions } from './types';
22
import { defaultRetries, defaultRetryDelay } from './constant';
33

44
async function fetchWithRetry({
@@ -7,7 +7,7 @@ async function fetchWithRetry({
77
retryTimes = defaultRetries, // retry times
88
retryDelay = defaultRetryDelay, // retry delay
99
fallback, // fallback url
10-
}: ReqiuredUrl<FetchWithRetryOptions>) {
10+
}: RequiredUrl<FetchWithRetryOptions>) {
1111
try {
1212
const response = await fetch(url, options);
1313

packages/retry-plugin/src/script-retry.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ScriptWithRetryOptions, CreateScriptFunc, ReqiuredUrl } from './types';
1+
import { ScriptWithRetryOptions, CreateScriptFunc, RequiredUrl } from './types';
22
import { defaultRetries, defaultRetryDelay, loadStatus } from './constant';
33

44
export const defaultCreateScript = (
@@ -96,7 +96,7 @@ function scriptWithRetry({
9696
retryTimes = defaultRetries, // retry times
9797
retryDelay = defaultRetryDelay, // retry delay
9898
customCreateScript, // user script create function
99-
}: ReqiuredUrl<ScriptWithRetryOptions>) {
99+
}: RequiredUrl<ScriptWithRetryOptions>) {
100100
const script = getScript(url, attrs, customCreateScript);
101101
const originOnerror = script.onerror;
102102
const originOnLoad = script.onload;

packages/retry-plugin/src/types.d.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,10 @@ export type RetryPluginParams = {
1919
script?: ScriptWithRetryOptions; // script retry options
2020
};
2121

22-
export type ReqiuredUrl<T extends { url?: string }> = Required<Pick<T, 'url'>> &
23-
Omit<T, 'url'>;
24-
2522
export type CreateScriptFunc = (
2623
url: string,
2724
attrs: Record<string, any>,
2825
) => HTMLScriptElement;
2926

30-
export type ReqiuredUrl<T extends { url?: string }> = Required<Pick<T, 'url'>> &
27+
export type RequiredUrl<T extends { url?: string }> = Required<Pick<T, 'url'>> &
3128
Omit<T, 'url'>;

0 commit comments

Comments
 (0)