@mittwald/react-ghostmaker 1.4.6 → 1.4.8
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/dist/esm/index.js +7 -7
- package/dist/esm/makeGhost.js +6 -6
- package/dist/esm/makeGhost.test-d.js +1 -1
- package/dist/esm/makeGhost.test.js +4 -4
- package/dist/esm/maybeGhost/index.js +2 -2
- package/dist/esm/maybeGhost/types.test-d.js +1 -1
- package/dist/esm/polytype.js +2 -2
- package/dist/esm/queries.js +3 -3
- package/dist/esm/queries.test.js +1 -1
- package/dist/esm/resolveGhostChain.js +1 -1
- package/dist/esm/testMocks.js +1 -1
- package/dist/esm/useGhostChain.js +5 -5
- package/dist/types/index.d.ts +8 -8
- package/dist/types/invalidate.d.ts +1 -1
- package/dist/types/makeGhost.d.ts +1 -1
- package/dist/types/maybeGhost/asGhost.d.ts +1 -1
- package/dist/types/maybeGhost/index.d.ts +2 -2
- package/dist/types/modelIdentifier.d.ts +1 -1
- package/dist/types/polytype.d.ts +1 -1
- package/dist/types/queries.d.ts +1 -1
- package/dist/types/resolveGhostChain.d.ts +1 -1
- package/dist/types/testMocks.d.ts +2 -2
- package/dist/types/useGhostChain.d.ts +1 -1
- package/package.json +23 -23
package/dist/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { makeGhost } from "./makeGhost";
|
|
2
|
-
export { registerModelIdentifier } from "./modelIdentifier";
|
|
3
|
-
export { getQueryContext, forwardQueryContext } from "./context";
|
|
4
|
-
export { invalidateGhosts } from "./invalidate";
|
|
5
|
-
export * from "./maybeGhost";
|
|
6
|
-
export { GhostMakerModel, ghostMakerModel } from "./metaData";
|
|
7
|
-
export { getModelId, getModelName } from "./queries";
|
|
1
|
+
export { makeGhost } from "./makeGhost.js";
|
|
2
|
+
export { registerModelIdentifier } from "./modelIdentifier.js";
|
|
3
|
+
export { getQueryContext, forwardQueryContext } from "./context.js";
|
|
4
|
+
export { invalidateGhosts } from "./invalidate.js";
|
|
5
|
+
export * from "./maybeGhost/index.js";
|
|
6
|
+
export { GhostMakerModel, ghostMakerModel } from "./metaData.js";
|
|
7
|
+
export { getModelId, getModelName } from "./queries.js";
|
package/dist/esm/makeGhost.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createElement } from "react";
|
|
2
|
-
import { isGhostMarker, transformFnProp, } from "./types";
|
|
3
|
-
import { useGhostChain } from "./useGhostChain";
|
|
4
|
-
import { RenderComponent } from "./RenderComponent";
|
|
5
|
-
import { resolveGhostChain } from "./resolveGhostChain";
|
|
6
|
-
import { invalidateGhosts } from "./invalidate";
|
|
7
|
-
import { queries } from "./queries";
|
|
2
|
+
import { isGhostMarker, transformFnProp, } from "./types.js";
|
|
3
|
+
import { useGhostChain } from "./useGhostChain.js";
|
|
4
|
+
import { RenderComponent } from "./RenderComponent.js";
|
|
5
|
+
import { resolveGhostChain } from "./resolveGhostChain.js";
|
|
6
|
+
import { invalidateGhosts } from "./invalidate.js";
|
|
7
|
+
import { queries } from "./queries.js";
|
|
8
8
|
function buildGhostDeep(target, ghostChain) {
|
|
9
9
|
const proxyTarget = (() => {
|
|
10
10
|
// Dummy function to allow ghosting function calls
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cleanup, render } from "@testing-library/react";
|
|
3
3
|
import { describe, expect, test, vitest, beforeEach, afterEach } from "vitest";
|
|
4
|
-
import { CustomerDetailed, CustomerGhost, Project, ProjectDetailed, ProjectGhost, advanceSleepTimer, customerMocks, getCustomerNameGhostIds, projectMocks, } from "./testMocks";
|
|
4
|
+
import { CustomerDetailed, CustomerGhost, Project, ProjectDetailed, ProjectGhost, advanceSleepTimer, customerMocks, getCustomerNameGhostIds, projectMocks, } from "./testMocks.js";
|
|
5
5
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
6
|
-
import { invalidateGhosts } from "./invalidate";
|
|
7
|
-
import { makeGhost } from "./makeGhost";
|
|
8
|
-
import { cleanupTargetHashes } from "./useGhostChain";
|
|
6
|
+
import { invalidateGhosts } from "./invalidate.js";
|
|
7
|
+
import { makeGhost } from "./makeGhost.js";
|
|
8
|
+
import { cleanupTargetHashes } from "./useGhostChain.js";
|
|
9
9
|
beforeEach(() => {
|
|
10
10
|
vitest.useFakeTimers();
|
|
11
11
|
cleanupTargetHashes();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./asGhost";
|
|
2
|
-
export * from "./types";
|
|
1
|
+
export * from "./asGhost.js";
|
|
2
|
+
export * from "./types.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expectTypeOf, test } from "vitest";
|
|
2
|
-
import { asGhostProps } from "./asGhost";
|
|
2
|
+
import { asGhostProps } from "./asGhost.js";
|
|
3
3
|
describe("fixupMaybeReactGhostProps()", () => {
|
|
4
4
|
test("works for one prop", () => {
|
|
5
5
|
expectTypeOf(asGhostProps({})).toEqualTypeOf();
|
package/dist/esm/polytype.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { getPrototypeListOf } from "polytype";
|
|
2
|
-
import { getProtoypes } from "./metaData";
|
|
2
|
+
import { getProtoypes } from "./metaData.js";
|
|
3
3
|
getProtoypes.current = getPrototypeListOf;
|
|
4
|
-
export { GhostMakerModel } from "./metaData";
|
|
4
|
+
export { GhostMakerModel } from "./metaData.js";
|
package/dist/esm/queries.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import is from "@sindresorhus/is";
|
|
2
|
-
import { hashObject } from "./hash";
|
|
3
|
-
import { getMetaData } from "./metaData";
|
|
4
|
-
import { modelIdentifiers } from "./modelIdentifier";
|
|
2
|
+
import { hashObject } from "./hash.js";
|
|
3
|
+
import { getMetaData } from "./metaData.js";
|
|
4
|
+
import { modelIdentifiers } from "./modelIdentifier.js";
|
|
5
5
|
export const getModelName = (something) => {
|
|
6
6
|
return getMetaData(something)?.name;
|
|
7
7
|
};
|
package/dist/esm/queries.test.js
CHANGED
|
@@ -32,7 +32,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
32
32
|
}
|
|
33
33
|
return useValue ? value : void 0;
|
|
34
34
|
};
|
|
35
|
-
import { getMetaData, GhostMakerModel } from "./metaData";
|
|
35
|
+
import { getMetaData, GhostMakerModel } from "./metaData.js";
|
|
36
36
|
import { expect, test } from "vitest";
|
|
37
37
|
let GrandParent = (() => {
|
|
38
38
|
let _classDecorators = [GhostMakerModel({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import is, { assert } from "@sindresorhus/is";
|
|
2
|
-
import { isReactGhost, transformFnProp, } from "./types";
|
|
2
|
+
import { isReactGhost, transformFnProp, } from "./types.js";
|
|
3
3
|
const resolveGhostChainItem = async (target, item) => {
|
|
4
4
|
const { propName, args } = item;
|
|
5
5
|
if (propName === transformFnProp) {
|
package/dist/esm/testMocks.js
CHANGED
|
@@ -34,7 +34,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
34
34
|
};
|
|
35
35
|
import { beforeEach, vitest } from "vitest";
|
|
36
36
|
import { getQueryContext, makeGhost } from ".";
|
|
37
|
-
import { GhostMakerModel } from "./metaData";
|
|
37
|
+
import { GhostMakerModel } from "./metaData.js";
|
|
38
38
|
const sleep = () => new Promise((resolve) => setTimeout(resolve, 200));
|
|
39
39
|
export const advanceSleepTimer = async (times = 1) => {
|
|
40
40
|
for (let i = 0; i < times; i++) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import is, { assert } from "@sindresorhus/is";
|
|
2
2
|
import { useEffect, useEffectEvent, useMemo } from "react";
|
|
3
|
-
import { transformFnProp, } from "./types";
|
|
3
|
+
import { transformFnProp, } from "./types.js";
|
|
4
4
|
import { useQueryClient, useSuspenseQuery } from "@tanstack/react-query";
|
|
5
|
-
import { queries } from "./queries";
|
|
6
|
-
import { ghostFnContext } from "./context";
|
|
7
|
-
import { invalidateGhosts } from "./invalidate";
|
|
8
|
-
import { hashObject } from "./hash";
|
|
5
|
+
import { queries } from "./queries.js";
|
|
6
|
+
import { ghostFnContext } from "./context.js";
|
|
7
|
+
import { invalidateGhosts } from "./invalidate.js";
|
|
8
|
+
import { hashObject } from "./hash.js";
|
|
9
9
|
export const useGhostChain = (target, chain, options) => {
|
|
10
10
|
const queryClient = useQueryClient();
|
|
11
11
|
const context = {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { makeGhost } from "./makeGhost";
|
|
2
|
-
export { registerModelIdentifier } from "./modelIdentifier";
|
|
3
|
-
export { type ReactGhost, UseGhostReturn } from "./types";
|
|
4
|
-
export { getQueryContext, forwardQueryContext } from "./context";
|
|
5
|
-
export { invalidateGhosts } from "./invalidate";
|
|
6
|
-
export * from "./maybeGhost";
|
|
7
|
-
export { GhostMakerModel, ghostMakerModel } from "./metaData";
|
|
8
|
-
export { getModelId, getModelName } from "./queries";
|
|
1
|
+
export { makeGhost } from "./makeGhost.ts";
|
|
2
|
+
export { registerModelIdentifier } from "./modelIdentifier.ts";
|
|
3
|
+
export { type ReactGhost, UseGhostReturn } from "./types.ts";
|
|
4
|
+
export { getQueryContext, forwardQueryContext } from "./context.ts";
|
|
5
|
+
export { invalidateGhosts } from "./invalidate.ts";
|
|
6
|
+
export * from "./maybeGhost/index.ts";
|
|
7
|
+
export { GhostMakerModel, ghostMakerModel } from "./metaData.ts";
|
|
8
|
+
export { getModelId, getModelName } from "./queries.ts";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ReactGhost } from "./types";
|
|
1
|
+
import { type ReactGhost } from "./types.ts";
|
|
2
2
|
export declare function makeGhost<T>(target: T): ReactGhost<T>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type ReactGhost } from "../types";
|
|
2
|
-
import type { MaybeReactGhost, PropsWithFixedUpReactGhosts, PropsWithMaybeReactGhosts } from "./types";
|
|
2
|
+
import type { MaybeReactGhost, PropsWithFixedUpReactGhosts, PropsWithMaybeReactGhosts } from "./types.ts";
|
|
3
3
|
export declare function asGhost<T>(maybeGhost: MaybeReactGhost<T>): ReactGhost<T>;
|
|
4
4
|
export declare function asGhostProps<T, TProps extends (keyof T)[] = (keyof T)[]>(props: PropsWithMaybeReactGhosts<T, TProps>, keys?: TProps): PropsWithFixedUpReactGhosts<T, TProps>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./asGhost";
|
|
2
|
-
export * from "./types";
|
|
1
|
+
export * from "./asGhost.ts";
|
|
2
|
+
export * from "./types.ts";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ModelIdentifier } from "./types";
|
|
1
|
+
import type { ModelIdentifier } from "./types.ts";
|
|
2
2
|
export declare const modelIdentifiers: ModelIdentifier[];
|
|
3
3
|
/** @deprecated Use GhostMakerModel (decorator) instead */
|
|
4
4
|
export declare const registerModelIdentifier: (identifier: ModelIdentifier) => void;
|
package/dist/types/polytype.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { GhostMakerModel } from "./metaData";
|
|
1
|
+
export { GhostMakerModel } from "./metaData.ts";
|
package/dist/types/queries.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GhostChain, GhostChainItem, QueryKey } from "./types";
|
|
1
|
+
import type { GhostChain, GhostChainItem, QueryKey } from "./types.ts";
|
|
2
2
|
export declare const getModelName: (something: unknown) => string | undefined;
|
|
3
3
|
export declare const getModelId: (something: unknown) => string | undefined;
|
|
4
4
|
export declare const queries: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type GhostChain } from "./types";
|
|
1
|
+
import { type GhostChain } from "./types.ts";
|
|
2
2
|
export declare const resolveGhostChain: (target: unknown, stack: GhostChain) => Promise<unknown>;
|
|
@@ -41,5 +41,5 @@ export declare class ProjectDetailed {
|
|
|
41
41
|
getName(): string;
|
|
42
42
|
getStatus(): Promise<string>;
|
|
43
43
|
}
|
|
44
|
-
export declare const ProjectGhost: import("./types").ReactGhost<typeof Project>;
|
|
45
|
-
export declare const CustomerGhost: import("./types").ReactGhost<typeof Customer>;
|
|
44
|
+
export declare const ProjectGhost: import("./types.ts").ReactGhost<typeof Project>;
|
|
45
|
+
export declare const CustomerGhost: import("./types.ts").ReactGhost<typeof Customer>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type GhostChain, type UseGhostOptions, type UseGhostReturn } from "./types";
|
|
1
|
+
import { type GhostChain, type UseGhostOptions, type UseGhostReturn } from "./types.ts";
|
|
2
2
|
export declare const useGhostChain: <T>(target: unknown, chain: GhostChain, options?: UseGhostOptions<T>) => UseGhostReturn<T>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/react-ghostmaker",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.8",
|
|
4
4
|
"author": "Mittwald CM Service GmbH & Co. KG <opensource@mittwald.de>",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Marco Falkenberg <m.falkenberg@mittwald.de>"
|
|
@@ -38,38 +38,38 @@
|
|
|
38
38
|
"dist"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@sindresorhus/is": "^7.
|
|
41
|
+
"@sindresorhus/is": "^7.2.0",
|
|
42
42
|
"context": "^3.0.33",
|
|
43
|
-
"object-code": "^
|
|
44
|
-
"type-fest": "^5.
|
|
43
|
+
"object-code": "^2.0.0",
|
|
44
|
+
"type-fest": "^5.4.4"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@eslint/eslintrc": "^3.3.
|
|
48
|
-
"@eslint/js": "^9.39.
|
|
49
|
-
"@tanstack/react-query": "^5.90.
|
|
47
|
+
"@eslint/eslintrc": "^3.3.3",
|
|
48
|
+
"@eslint/js": "^9.39.2",
|
|
49
|
+
"@tanstack/react-query": "^5.90.20",
|
|
50
50
|
"@testing-library/dom": "^10.4.1",
|
|
51
|
-
"@testing-library/react": "^16.3.
|
|
52
|
-
"@types/react": "^19.2.
|
|
53
|
-
"@types/react-dom": "^19.2.
|
|
54
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
55
|
-
"@typescript-eslint/parser": "^8.
|
|
56
|
-
"eslint": "^9.
|
|
51
|
+
"@testing-library/react": "^16.3.2",
|
|
52
|
+
"@types/react": "^19.2.13",
|
|
53
|
+
"@types/react-dom": "^19.2.3",
|
|
54
|
+
"@typescript-eslint/eslint-plugin": "^8.54.0",
|
|
55
|
+
"@typescript-eslint/parser": "^8.54.0",
|
|
56
|
+
"eslint": "^9.39.2",
|
|
57
57
|
"eslint-config-prettier": "^10.1.8",
|
|
58
58
|
"eslint-plugin-json": "^4.0.1",
|
|
59
|
-
"eslint-plugin-prettier": "^5.5.
|
|
59
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
60
60
|
"globals": "^16.5.0",
|
|
61
|
-
"happy-dom": "^20.
|
|
61
|
+
"happy-dom": "^20.5.3",
|
|
62
62
|
"license-checker-rseidelsohn": "^4.4.2",
|
|
63
63
|
"polytype": "^0.17.0",
|
|
64
|
-
"prettier": "^3.
|
|
65
|
-
"prettier-plugin-jsdoc": "^1.
|
|
66
|
-
"prettier-plugin-pkgsort": "^0.
|
|
67
|
-
"prettier-plugin-sort-json": "^4.
|
|
68
|
-
"react": "^19.2.
|
|
69
|
-
"react-dom": "^19.2.
|
|
70
|
-
"rimraf": "^6.
|
|
64
|
+
"prettier": "^3.8.1",
|
|
65
|
+
"prettier-plugin-jsdoc": "^1.8.0",
|
|
66
|
+
"prettier-plugin-pkgsort": "^0.3.0",
|
|
67
|
+
"prettier-plugin-sort-json": "^4.2.0",
|
|
68
|
+
"react": "^19.2.4",
|
|
69
|
+
"react-dom": "^19.2.4",
|
|
70
|
+
"rimraf": "^6.1.2",
|
|
71
71
|
"typescript": "^5.9.3",
|
|
72
|
-
"vitest": "^
|
|
72
|
+
"vitest": "^4.0.18"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"@tanstack/react-query": "^5",
|