yummies 4.2.5 → 4.3.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.
- package/README.md +5 -0
- package/imports.d.ts +4 -0
- package/imports.d.ts.map +1 -1
- package/imports.js +12 -0
- package/package.json +15 -10
package/README.md
CHANGED
|
@@ -101,3 +101,8 @@ import { AnyObject } from 'yummies';
|
|
|
101
101
|
## [yummies/complex](src/complex/index.ts)
|
|
102
102
|
|
|
103
103
|
Additional set of complex utilities
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
## Contribution Guide
|
|
107
|
+
|
|
108
|
+
Want to contribute ? [Follow this guide](https://github.com/js2me/yummies/blob/master/CONTRIBUTING.md)
|
package/imports.d.ts
CHANGED
|
@@ -8,4 +8,8 @@
|
|
|
8
8
|
* ```
|
|
9
9
|
*/
|
|
10
10
|
export declare const fetchLazyModule: <T>(fetchModule: () => Promise<T>, attempts?: number, delay?: number) => Promise<T>;
|
|
11
|
+
export type PackedAsyncModule<T> = Promise<T | {
|
|
12
|
+
default: T;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const unpackAsyncModule: <T>(maybeModule: T | PackedAsyncModule<T>) => Promise<T>;
|
|
11
15
|
//# sourceMappingURL=imports.d.ts.map
|
package/imports.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../src/imports.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,GAAU,CAAC,EACrC,aAAa,MAAM,OAAO,CAAC,CAAC,CAAC,EAC7B,iBAAY,EACZ,cAAY,KACX,OAAO,CAAC,CAAC,CAkBX,CAAC"}
|
|
1
|
+
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../src/imports.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,GAAU,CAAC,EACrC,aAAa,MAAM,OAAO,CAAC,CAAC,CAAC,EAC7B,iBAAY,EACZ,cAAY,KACX,OAAO,CAAC,CAAC,CAkBX,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,GAAG;IAAE,OAAO,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAE/D,eAAO,MAAM,iBAAiB,GAAU,CAAC,EACvC,aAAa,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,KACpC,OAAO,CAAC,CAAC,CAYX,CAAC"}
|
package/imports.js
CHANGED
|
@@ -26,3 +26,15 @@ export const fetchLazyModule = async (fetchModule, attempts = 3, delay = 1000) =
|
|
|
26
26
|
}
|
|
27
27
|
throw lastError;
|
|
28
28
|
};
|
|
29
|
+
export const unpackAsyncModule = async (maybeModule) => {
|
|
30
|
+
if (maybeModule instanceof Promise) {
|
|
31
|
+
const data = (await maybeModule);
|
|
32
|
+
if (data.default) {
|
|
33
|
+
return data.default;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
return data;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return maybeModule;
|
|
40
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yummies",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": "js2me",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,17 +24,20 @@
|
|
|
24
24
|
"tailwind-merge": "^2.6.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
+
"@changesets/changelog-github": "^0.5.1",
|
|
28
|
+
"@changesets/cli": "^2.29.5",
|
|
27
29
|
"@types/node": "^20.17.30",
|
|
28
30
|
"@vitejs/plugin-react-swc": "^3.9.0",
|
|
29
31
|
"@vitest/coverage-istanbul": "^3.1.2",
|
|
32
|
+
"commitfmt": "^1.0.4",
|
|
30
33
|
"eslint": "^8.57.1",
|
|
31
34
|
"js2me-eslint-config": "^1.0.7",
|
|
32
|
-
"js2me-exports-post-build-script": "^
|
|
35
|
+
"js2me-exports-post-build-script": "^4.1.5",
|
|
33
36
|
"jsdom": "^26.1.0",
|
|
37
|
+
"lefthook": "^1.11.16",
|
|
34
38
|
"nodemon": "^3.1.9",
|
|
35
39
|
"rimraf": "^6.0.1",
|
|
36
40
|
"typescript": "^5.8.3",
|
|
37
|
-
"unplugin-swc": "^1.5.2",
|
|
38
41
|
"vitest": "^3.1.2"
|
|
39
42
|
},
|
|
40
43
|
"exports": {
|
|
@@ -203,26 +206,28 @@
|
|
|
203
206
|
"default": "./vibrate.js",
|
|
204
207
|
"types": "./vibrate.d.ts"
|
|
205
208
|
},
|
|
206
|
-
"./package.json": "./package.json"
|
|
207
|
-
"./utility-types": "./utility-types.d.ts"
|
|
209
|
+
"./package.json": "./package.json"
|
|
208
210
|
},
|
|
209
211
|
"files": [
|
|
210
212
|
"*"
|
|
211
213
|
],
|
|
212
214
|
"scripts": {
|
|
213
|
-
"clean": "
|
|
215
|
+
"clean": "rm -rf dist",
|
|
214
216
|
"lint:check": "eslint . --fix",
|
|
215
217
|
"ts:check": "tsc --noEmit",
|
|
216
218
|
"check": "npm run lint:check && npm run ts:check",
|
|
217
219
|
"prebuild": "npm run clean && npm run check",
|
|
218
220
|
"build:watch": "npm run build && nodemon --watch src --ext ts --exec \"tsc && node ./post-build.mjs\"",
|
|
219
221
|
"build": "tsc && node ./post-build.mjs",
|
|
222
|
+
"pub": "PUBLISH=true pnpm run build",
|
|
223
|
+
"pub-ci": "PUBLISH=true CI=true pnpm run build",
|
|
220
224
|
"pub:patch": "PUBLISH=true PUBLISH_VERSION=patch pnpm run build",
|
|
221
225
|
"pub:minor": "PUBLISH=true PUBLISH_VERSION=minor pnpm run build",
|
|
222
226
|
"pub:major": "PUBLISH=true PUBLISH_VERSION=major pnpm run build",
|
|
223
|
-
"test": "vitest run",
|
|
224
|
-
"test:watch": "vitest watch",
|
|
225
|
-
"test:coverage": "vitest run --coverage",
|
|
226
|
-
"dev": "pnpm test:watch"
|
|
227
|
+
"test": "vitest run --config vitest.config.ts",
|
|
228
|
+
"test:watch": "vitest watch --config vitest.config.ts",
|
|
229
|
+
"test:coverage": "vitest run --config vitest.config.ts --coverage",
|
|
230
|
+
"dev": "pnpm test:watch",
|
|
231
|
+
"dev:install-hooks": "if [ -z \"$CI\" ]; then lefthook install; fi"
|
|
227
232
|
}
|
|
228
233
|
}
|