@civitai/blocks-react 0.53.1 → 0.55.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 +326 -6
- package/dist/hooks/useAppStorage.d.ts +39 -8
- package/dist/hooks/useAppStorage.d.ts.map +1 -1
- package/dist/hooks/useAppStorage.js +14 -1
- package/dist/hooks/useAppStorage.js.map +1 -1
- package/dist/hooks/useBlockContext.d.ts +5 -1
- package/dist/hooks/useBlockContext.d.ts.map +1 -1
- package/dist/hooks/useBlockContext.js +5 -1
- package/dist/hooks/useBlockContext.js.map +1 -1
- package/dist/internal/liveHost.d.ts +3 -1
- package/dist/internal/liveHost.d.ts.map +1 -1
- package/dist/internal/liveHost.js +22 -21
- package/dist/internal/liveHost.js.map +1 -1
- package/dist/internal/mockHost.d.ts +37 -5
- package/dist/internal/mockHost.d.ts.map +1 -1
- package/dist/internal/mockHost.js +80 -34
- package/dist/internal/mockHost.js.map +1 -1
- package/dist/internal/transport.d.ts +4 -3
- package/dist/internal/transport.d.ts.map +1 -1
- package/dist/internal/transport.js.map +1 -1
- package/dist/internal/validate.d.ts.map +1 -1
- package/dist/internal/validate.js +22 -17
- package/dist/internal/validate.js.map +1 -1
- package/dist/live.d.ts +24 -0
- package/dist/live.d.ts.map +1 -0
- package/dist/live.js +24 -0
- package/dist/live.js.map +1 -0
- package/dist/testing.d.ts +16 -22
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +15 -23
- package/dist/testing.js.map +1 -1
- package/package.json +75 -40
package/dist/live.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@civitai/blocks-react/live` — THE REAL BACKEND. THIS SPENDS REAL BUZZ.
|
|
3
|
+
*
|
|
4
|
+
* `createLiveHost` forwards the App-Block postMessage protocol to the REAL
|
|
5
|
+
* Civitai backend over a pasted short-lived dev block token,
|
|
6
|
+
* `blocks.submitWorkflow` included. A successful generation DEBITS THE TOKEN
|
|
7
|
+
* HOLDER'S OWN BUZZ. There is no dry-run mode and no confirmation. It exists for
|
|
8
|
+
* one caller: a `pnpm dev:live` harness. The free one is `createMockHost`, on
|
|
9
|
+
* `@civitai/blocks-react/testing`.
|
|
10
|
+
*
|
|
11
|
+
* WHY ITS OWN SUBPATH (#334): a client that spends the caller's money should not
|
|
12
|
+
* be reachable through an import path named `testing`. The import line is the
|
|
13
|
+
* one piece of context that travels with every call site, so it is where the
|
|
14
|
+
* warning belongs. It does NOT make the package smaller — `files` is
|
|
15
|
+
* `["dist", "README.md"]` and `tsconfig` compiles the whole source tree, so the
|
|
16
|
+
* code ships either way.
|
|
17
|
+
*
|
|
18
|
+
* Surface, rationale and stability are documented in exactly one place — README
|
|
19
|
+
* § "The `/live` subexport". Do not restate them here; a second copy is what
|
|
20
|
+
* went stale and became #334. `test/subpathSurfaces.test.ts` pins this module's
|
|
21
|
+
* runtime export set.
|
|
22
|
+
*/
|
|
23
|
+
export { createLiveHost, type LiveHostOptions } from './internal/liveHost.js';
|
|
24
|
+
//# sourceMappingURL=live.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live.d.ts","sourceRoot":"","sources":["../src/live.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/live.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@civitai/blocks-react/live` — THE REAL BACKEND. THIS SPENDS REAL BUZZ.
|
|
3
|
+
*
|
|
4
|
+
* `createLiveHost` forwards the App-Block postMessage protocol to the REAL
|
|
5
|
+
* Civitai backend over a pasted short-lived dev block token,
|
|
6
|
+
* `blocks.submitWorkflow` included. A successful generation DEBITS THE TOKEN
|
|
7
|
+
* HOLDER'S OWN BUZZ. There is no dry-run mode and no confirmation. It exists for
|
|
8
|
+
* one caller: a `pnpm dev:live` harness. The free one is `createMockHost`, on
|
|
9
|
+
* `@civitai/blocks-react/testing`.
|
|
10
|
+
*
|
|
11
|
+
* WHY ITS OWN SUBPATH (#334): a client that spends the caller's money should not
|
|
12
|
+
* be reachable through an import path named `testing`. The import line is the
|
|
13
|
+
* one piece of context that travels with every call site, so it is where the
|
|
14
|
+
* warning belongs. It does NOT make the package smaller — `files` is
|
|
15
|
+
* `["dist", "README.md"]` and `tsconfig` compiles the whole source tree, so the
|
|
16
|
+
* code ships either way.
|
|
17
|
+
*
|
|
18
|
+
* Surface, rationale and stability are documented in exactly one place — README
|
|
19
|
+
* § "The `/live` subexport". Do not restate them here; a second copy is what
|
|
20
|
+
* went stale and became #334. `test/subpathSurfaces.test.ts` pins this module's
|
|
21
|
+
* runtime export set.
|
|
22
|
+
*/
|
|
23
|
+
export { createLiveHost } from './internal/liveHost.js';
|
|
24
|
+
//# sourceMappingURL=live.js.map
|
package/dist/live.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live.js","sourceRoot":"","sources":["../src/live.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,cAAc,EAAwB,MAAM,wBAAwB,CAAC"}
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,32 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* surface — block apps should never import from here in production code (the
|
|
4
|
-
* `./testing` subpath keeps accidental prod imports visible in review).
|
|
2
|
+
* `@civitai/blocks-react/testing` — the HOST-SIMULATION subpath.
|
|
5
3
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* host (usable from node/jsdom/happy-dom tests AND a dev harness).
|
|
10
|
-
* - `<Harness>` / `<MockHostProvider>` — a thin React wrapper that installs a
|
|
11
|
-
* mock host for local dev, with an optional on-screen message log.
|
|
4
|
+
* This is NOT "two test helpers". It is the surface a block app's dev harness
|
|
5
|
+
* and test suite use to stand in for civitai.com: a mock host, a React wrapper
|
|
6
|
+
* around it, and a transport reset.
|
|
12
7
|
*
|
|
13
|
-
*
|
|
8
|
+
* EVERYTHING HERE IS A MOCK. No network, no Buzz, no real backend. That is a
|
|
9
|
+
* property of the subpath, not a claim in a comment: `createLiveHost`, which
|
|
10
|
+
* spends the token holder's own Buzz, lives at `@civitai/blocks-react/live`
|
|
11
|
+
* (#334).
|
|
12
|
+
*
|
|
13
|
+
* Surface, rationale and stability are documented in exactly one place — README
|
|
14
|
+
* § "The `/testing` subexport". Do not restate them here; a second copy is what
|
|
15
|
+
* went stale and became #334. `test/subpathSurfaces.test.ts` pins that ledger to
|
|
16
|
+
* this module (runtime values and, via the TypeScript checker, types) and to the
|
|
17
|
+
* README section, failing on growth and on shrinkage alike.
|
|
14
18
|
*/
|
|
15
19
|
import { type ReactNode } from 'react';
|
|
16
20
|
import { __resetTransport } from './internal/singleton.js';
|
|
17
21
|
import { type MockHostOptions } from './internal/mockHost.js';
|
|
18
22
|
export { __resetTransport as resetTransport };
|
|
19
|
-
export { createMockHost, readMockHostUrlOptions,
|
|
20
|
-
export { createLiveHost, decodeBlockTokenPayload, type LiveHostOptions, } from './internal/liveHost.js';
|
|
21
|
-
export { buildCatalogUrl, fetchCatalog, modelToCard, responseToPage, edgeThumb, cardToCheckpoint, cardToResource, filterCardsByFamily, CATALOG_API_BASE, CATALOG_API_BASE_BLOCKS, DEFAULT_LIMIT, type CatalogQuery, type CatalogCard, type CatalogPage, type CatalogResult, type CatalogModelType, } from './internal/catalog.js';
|
|
22
|
-
export { openPickerOverlay, type PickerOverlayHandle, type PickerSelection, type OpenPickerOptions, } from './internal/pickerOverlay.js';
|
|
23
|
-
/**
|
|
24
|
-
* Builds a `MessageEvent` that mimics a parent-frame postMessage so tests can
|
|
25
|
-
* exercise `IframeTransport.handleMessage` without a real cross-frame setup.
|
|
26
|
-
*/
|
|
27
|
-
export declare function mockParentMessage(data: unknown, origin: string): MessageEvent;
|
|
23
|
+
export { createMockHost, readMockHostUrlOptions, type MockHost, type MockHostOptions, type MockHostFailMode, type MockHostScenarioPatch, type MockGenerationScenario, type MockBuzzScenario, type MockBuzzBalance, type MockBuzzHandle, type MockStorageScenario, type MockSharedScenario, type MockSharedSeed, type MockCannedImageScan, type CostSpec, type ImageSpec, type CannedPick, } from './internal/mockHost.js';
|
|
28
24
|
/**
|
|
29
|
-
* Props for the dev
|
|
25
|
+
* Props for the dev {@link Harness}.
|
|
30
26
|
*/
|
|
31
27
|
export interface HarnessProps extends MockHostOptions {
|
|
32
28
|
/** The block app to render inside the mocked host. */
|
|
@@ -66,6 +62,4 @@ export interface HarnessProps extends MockHostOptions {
|
|
|
66
62
|
* );
|
|
67
63
|
*/
|
|
68
64
|
export declare function Harness({ children, applyUrlToggles, showLog, ...options }: HarnessProps): import("react/jsx-runtime").JSX.Element;
|
|
69
|
-
/** Alias of {@link Harness} — same component, clearer name when used as a context provider. */
|
|
70
|
-
export declare const MockHostProvider: typeof Harness;
|
|
71
65
|
//# sourceMappingURL=testing.d.ts.map
|
package/dist/testing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,gBAAgB,IAAI,cAAc,EAAE,CAAC;AAE9C,OAAO,EACL,cAAc,EACd,sBAAsB,EAKtB,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,UAAU,GAChB,MAAM,wBAAwB,CAAC;AAYhC;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,eAAe;IACnD,sDAAsD;IACtD,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAgDD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EACR,eAAsB,EACtB,OAAc,EACd,GAAG,OAAO,EACX,EAAE,YAAY,2CAuEd"}
|
package/dist/testing.js
CHANGED
|
@@ -1,33 +1,27 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* surface — block apps should never import from here in production code (the
|
|
5
|
-
* `./testing` subpath keeps accidental prod imports visible in review).
|
|
3
|
+
* `@civitai/blocks-react/testing` — the HOST-SIMULATION subpath.
|
|
6
4
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* host (usable from node/jsdom/happy-dom tests AND a dev harness).
|
|
11
|
-
* - `<Harness>` / `<MockHostProvider>` — a thin React wrapper that installs a
|
|
12
|
-
* mock host for local dev, with an optional on-screen message log.
|
|
5
|
+
* This is NOT "two test helpers". It is the surface a block app's dev harness
|
|
6
|
+
* and test suite use to stand in for civitai.com: a mock host, a React wrapper
|
|
7
|
+
* around it, and a transport reset.
|
|
13
8
|
*
|
|
14
|
-
*
|
|
9
|
+
* EVERYTHING HERE IS A MOCK. No network, no Buzz, no real backend. That is a
|
|
10
|
+
* property of the subpath, not a claim in a comment: `createLiveHost`, which
|
|
11
|
+
* spends the token holder's own Buzz, lives at `@civitai/blocks-react/live`
|
|
12
|
+
* (#334).
|
|
13
|
+
*
|
|
14
|
+
* Surface, rationale and stability are documented in exactly one place — README
|
|
15
|
+
* § "The `/testing` subexport". Do not restate them here; a second copy is what
|
|
16
|
+
* went stale and became #334. `test/subpathSurfaces.test.ts` pins that ledger to
|
|
17
|
+
* this module (runtime values and, via the TypeScript checker, types) and to the
|
|
18
|
+
* README section, failing on growth and on shrinkage alike.
|
|
15
19
|
*/
|
|
16
20
|
import { useEffect, useRef, useState } from 'react';
|
|
17
21
|
import { __resetTransport } from './internal/singleton.js';
|
|
18
22
|
import { createMockHost, readMockHostUrlOptions, } from './internal/mockHost.js';
|
|
19
23
|
export { __resetTransport as resetTransport };
|
|
20
|
-
export { createMockHost, readMockHostUrlOptions,
|
|
21
|
-
export { createLiveHost, decodeBlockTokenPayload, } from './internal/liveHost.js';
|
|
22
|
-
export { buildCatalogUrl, fetchCatalog, modelToCard, responseToPage, edgeThumb, cardToCheckpoint, cardToResource, filterCardsByFamily, CATALOG_API_BASE, CATALOG_API_BASE_BLOCKS, DEFAULT_LIMIT, } from './internal/catalog.js';
|
|
23
|
-
export { openPickerOverlay, } from './internal/pickerOverlay.js';
|
|
24
|
-
/**
|
|
25
|
-
* Builds a `MessageEvent` that mimics a parent-frame postMessage so tests can
|
|
26
|
-
* exercise `IframeTransport.handleMessage` without a real cross-frame setup.
|
|
27
|
-
*/
|
|
28
|
-
export function mockParentMessage(data, origin) {
|
|
29
|
-
return new MessageEvent('message', { data, origin, source: null });
|
|
30
|
-
}
|
|
24
|
+
export { createMockHost, readMockHostUrlOptions, } from './internal/mockHost.js';
|
|
31
25
|
/**
|
|
32
26
|
* What the harness chrome's `consent=` readout says, from the TWO INDEPENDENT
|
|
33
27
|
* booleans that describe consent in the mock host.
|
|
@@ -124,8 +118,6 @@ export function Harness({ children, applyUrlToggles = true, showLog = true, ...o
|
|
|
124
118
|
.map((m, i) => `${i + 1}. ${m.type} ${JSON.stringify(m.payload ?? {})}`)
|
|
125
119
|
.join('\n') })] }))] }));
|
|
126
120
|
}
|
|
127
|
-
/** Alias of {@link Harness} — same component, clearer name when used as a context provider. */
|
|
128
|
-
export const MockHostProvider = Harness;
|
|
129
121
|
// Minimal console / terminal aesthetic: dark terminal slab, monospace, a
|
|
130
122
|
// subtle accent top border, dim chrome text with brighter accents for the
|
|
131
123
|
// live readout values. Compact + unobtrusive — shared chrome rendered by
|
package/dist/testing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.js","sourceRoot":"","sources":["../src/testing.tsx"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"testing.js","sourceRoot":"","sources":["../src/testing.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,cAAc,EACd,sBAAsB,GAEvB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,gBAAgB,IAAI,cAAc,EAAE,CAAC;AAE9C,OAAO,EACL,cAAc,EACd,sBAAsB,GAoBvB,MAAM,wBAAwB,CAAC;AAkChC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAS,mBAAmB,CAAC,IAG5B;IACC,+EAA+E;IAC/E,8DAA8D;IAC9D,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC;IAChD,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;IACtC,IAAI,SAAS;QAAE,OAAO,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC;IACvD,OAAO,OAAO,CAA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C;AAEX,MAAM,mBAAmB,GAAG;IAC1B,MAAM,EAAE,SAAS;IACjB,aAAa,EAAE,MAAM;IACrB,KAAK,EAAE,SAAS;IAChB,SAAS,EAAE,MAAM;IACjB,UAAU,EAAE,MAAM;CACV,CAAC;AAEX,MAAM,eAAe,GAAG;IACtB,MAAM,EAAE,SAAS;IACjB,UAAU,EAAE,CAAC;IACb,SAAS,EAAE,kCAAkC;IAC7C,SAAS,EAAE,GAAG;IACd,QAAQ,EAAE,MAAM;IAChB,KAAK,EAAE,SAAS;IAChB,aAAa,EAAE,MAAM;CACb,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@civitai/blocks-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.55.0",
|
|
4
4
|
"description": "React hooks and iframe transport for Civitai Apps. Pairs with @civitai/app-sdk/blocks.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -21,6 +21,10 @@
|
|
|
21
21
|
"./testing": {
|
|
22
22
|
"types": "./dist/testing.d.ts",
|
|
23
23
|
"import": "./dist/testing.js"
|
|
24
|
+
},
|
|
25
|
+
"./live": {
|
|
26
|
+
"types": "./dist/live.d.ts",
|
|
27
|
+
"import": "./dist/live.js"
|
|
24
28
|
}
|
|
25
29
|
},
|
|
26
30
|
"files": [
|
|
@@ -31,54 +35,83 @@
|
|
|
31
35
|
"node": ">=20"
|
|
32
36
|
},
|
|
33
37
|
"dependencies": {
|
|
34
|
-
"@civitai/
|
|
35
|
-
"@civitai/
|
|
38
|
+
"@civitai/theme": "0.3.1",
|
|
39
|
+
"@civitai/components": "0.4.1"
|
|
36
40
|
},
|
|
37
41
|
"comment-peerDependencies": [
|
|
38
42
|
"The @civitai/app-sdk floor is DERIVED, not chosen: it is the lowest published",
|
|
39
43
|
"version that exports every symbol this package imports from the peer.",
|
|
40
44
|
"",
|
|
41
|
-
"🔴 RAISED 0.
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
45
|
+
"🔴 RAISED 0.45.0 -> 0.47.0 (THE THIRD TIME THIS CLASS HAS BITTEN: #309, then",
|
|
46
|
+
"#317 caught it in review, then this) when `internal/mockHost.ts` began importing",
|
|
47
|
+
"three NEW peer VALUE symbols -- `APP_STORAGE_MAX_BYTES`, `APP_STORAGE_MAX_ROWS`",
|
|
48
|
+
"and `APP_STORAGE_MAX_VALUE_BYTES`, the App Storage ceilings, which it assigns to",
|
|
49
|
+
"its mock storage defaults. All three ship for the first time in the app-sdk minor",
|
|
50
|
+
"released alongside this change.",
|
|
51
|
+
"",
|
|
52
|
+
"HOW 0.47.0 WAS DERIVED (computed, not predicted from release ordering):",
|
|
53
|
+
" - in-tree `packages/civitai-app-sdk/package.json` is 0.46.0, and 0.46.0 is also",
|
|
54
|
+
" `npm view @civitai/app-sdk version` -- the tree is at the last published",
|
|
55
|
+
" version, so nothing is mid-flight.",
|
|
56
|
+
" - the pending changeset set is exactly ONE file, `.changeset/",
|
|
57
|
+
" app-storage-real-ceilings-2026-09-19.md`, declaring `@civitai/app-sdk: minor`;",
|
|
58
|
+
" `git ls-tree -r origin/main .changeset/` shows main carries no others.",
|
|
59
|
+
" - `pnpm exec changeset status --verbose` on this branch prints",
|
|
60
|
+
" `@civitai/app-sdk 0.47.0` (and `@civitai/blocks-react 0.54.0`). That is the",
|
|
61
|
+
" tool that will actually run, answering with the number it will actually write.",
|
|
54
62
|
"",
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
63
|
+
"MEASURED, both directions, against the REAL tarballs (not the workspace copy):",
|
|
64
|
+
" - published 0.46.0 -- which the OLD `>=0.45.0` range SATISFIED, installing with",
|
|
65
|
+
" no peer warning at all -- does not export any of the three. `node -e` on a",
|
|
66
|
+
" scratch `npm i @civitai/app-sdk@0.46.0`:",
|
|
67
|
+
" SyntaxError: The requested module '@civitai/app-sdk/blocks'",
|
|
68
|
+
" does not provide an export named 'APP_STORAGE_MAX_BYTES'",
|
|
69
|
+
" Controls were run BOTH ways before believing that zero: an impossible symbol",
|
|
70
|
+
" reported absent (the probe can go red) and `BrowsingLevel`/`SFW_LEVELS`",
|
|
71
|
+
" resolved (the probe can see a symbol that IS there).",
|
|
72
|
+
" - blast radius is the `./testing` subpath ONLY, and that is measured too, by",
|
|
73
|
+
" `pnpm pack`ing this package and importing both entries against 0.46.0:",
|
|
74
|
+
" `@civitai/blocks-react` resolved 61 exports fine; `@civitai/blocks-react/",
|
|
75
|
+
" testing` threw the SyntaxError above out of `dist/internal/mockHost.js`.",
|
|
76
|
+
" `src/testing.tsx` reaches `mockHost`, `src/index.ts` does not -- so the block",
|
|
77
|
+
" boots and every dev harness and downstream test suite dies instead.",
|
|
78
|
+
" - with the floor at 0.47.0, that same install is refused: npm reports",
|
|
79
|
+
" ERESOLVE against `@civitai/app-sdk@0.46.0`.",
|
|
61
80
|
"",
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
81
|
+
"⚠️ THE RESIDUAL RISK IS RELEASE ORDERING, AND IT IS NOT REMOVABLE FROM HERE.",
|
|
82
|
+
"0.47.0 is the version THIS changeset publishes from THIS base. If another app-sdk",
|
|
83
|
+
"minor merges and publishes before this PR does, 0.47.0 ships WITHOUT the",
|
|
84
|
+
"constants, this changeset publishes 0.48.0, and this range admits a broken",
|
|
85
|
+
"version -- #309's shape exactly. So: RE-RUN `changeset status --verbose` after any",
|
|
86
|
+
"rebase onto a moved main, and re-read this range. The number here is a",
|
|
87
|
+
"measurement of a base, and a rebase invalidates the base.",
|
|
88
|
+
"",
|
|
89
|
+
"🔴 `changeset version` WILL NOT FIX A STALE FLOOR -- IT IS NOT A BACKSTOP.",
|
|
90
|
+
"`.changeset/config.json` sets `onlyUpdatePeerDependentsWhenOutOfRange: true`, so a",
|
|
91
|
+
"peer range is rewritten ONLY when the computed version falls OUT of it. A floor",
|
|
92
|
+
"that is too LOW is, by construction, still satisfied -- so it is left exactly as",
|
|
93
|
+
"it is and ships stale. (The flag does bite in the other direction, which an",
|
|
94
|
+
"earlier note recorded: run before a rebase, when the computed version is BELOW the",
|
|
95
|
+
"declared floor, it rewrites the range DOWNWARD and drops the upper bound. Both",
|
|
96
|
+
"readings say the same thing -- never let this number be the flag's problem.)",
|
|
73
97
|
"",
|
|
74
98
|
"🔴 A PEER RANGE IS METADATA AND NOTHING CHECKS IT AGAINST THE CODE. 0.49.0-0.51.0",
|
|
75
99
|
"declared >=0.29.0 while importing `effectiveBrowsingCeiling` (app-sdk 0.39.0) and",
|
|
76
100
|
"the create-post types (0.40.0). The range was SATISFIED, so no install warned;",
|
|
77
101
|
"the failure landed at module evaluation in a consumer's tests, where 27 of 43",
|
|
78
102
|
"test files collected ZERO tests -- 292 tests stopped running and the summary line",
|
|
79
|
-
"reported no failures. See #309.
|
|
80
|
-
"peer to the workspace copy, so every in-repo typecheck
|
|
81
|
-
"
|
|
103
|
+
"reported no failures. See #309. NO BUILD OR TYPECHECK CAN CATCH THIS:",
|
|
104
|
+
"`pnpm.overrides` maps the peer to the workspace copy, so every in-repo typecheck,",
|
|
105
|
+
"test and build resolves the symbol from `packages/civitai-app-sdk` and is",
|
|
106
|
+
"structurally blind to whatever this range says.",
|
|
107
|
+
"",
|
|
108
|
+
"🔴 SINCE #344 ONE GATE DOES SEE PART OF IT: `tests/guards/",
|
|
109
|
+
"blocks-react-peer-floor.test.mjs` fails when this range admits an app-sdk version",
|
|
110
|
+
"measured NOT to export the App Storage constants, and when the derivation below",
|
|
111
|
+
"stops being recorded here. Read its KNOWN LIMITS before relying on it -- CI checks",
|
|
112
|
+
"out at `fetch-depth: 1` and the guard job has no registry access, so it is",
|
|
113
|
+
"offline and tree-local: it re-asserts a measurement taken by hand, it does not",
|
|
114
|
+
"take one. The steps below are still the only way to MAKE the measurement.",
|
|
82
115
|
"",
|
|
83
116
|
"🔴 AND #309'S OWN SUGGESTED FLOOR (>=0.39.0) WAS WRONG. `effectiveBrowsingCeiling`",
|
|
84
117
|
"arrives in 0.39.0, but `BlockCreatePostRequest`, `BlockCreatePostResult`,",
|
|
@@ -89,8 +122,10 @@
|
|
|
89
122
|
"TO RE-DERIVE IT (do this when this package starts importing a new peer symbol):",
|
|
90
123
|
" 1. collect the symbols -- every named `import`/`export … from '@civitai/app-sdk*'`",
|
|
91
124
|
" clause in src/, plus bare and star forms, which name a SUBPATH and no symbols",
|
|
92
|
-
" but still have to resolve.
|
|
93
|
-
" ('/blocks' and '/safe-storage')
|
|
125
|
+
" but still have to resolve. Measured at #344: 64 distinct symbols over 2",
|
|
126
|
+
" subpaths ('/blocks' and '/safe-storage'), counting unique names across every",
|
|
127
|
+
" named import clause in src/**/*.ts{,x}. An earlier derivation recorded 62;",
|
|
128
|
+
" re-count rather than trusting either figure.",
|
|
94
129
|
" 2. in a scratch dir OUTSIDE this workspace (pnpm would resolve the peer to the",
|
|
95
130
|
" workspace copy and measure nothing), `npm i @civitai/app-sdk@<version>` and",
|
|
96
131
|
" typecheck a file importing all of them -- each in the POSITION it is imported",
|
|
@@ -107,7 +142,7 @@
|
|
|
107
142
|
"the tool was the expensive half."
|
|
108
143
|
],
|
|
109
144
|
"peerDependencies": {
|
|
110
|
-
"@civitai/app-sdk": ">=0.
|
|
145
|
+
"@civitai/app-sdk": ">=0.47.0 <1.0.0",
|
|
111
146
|
"react": "^18.0.0 || ^19.0.0"
|
|
112
147
|
},
|
|
113
148
|
"devDependencies": {
|
|
@@ -122,7 +157,7 @@
|
|
|
122
157
|
"react-dom": "^19.0.0",
|
|
123
158
|
"typescript": "^5.9.2",
|
|
124
159
|
"vitest": "^4.1.11",
|
|
125
|
-
"@civitai/app-sdk": "^0.
|
|
160
|
+
"@civitai/app-sdk": "^0.48.0"
|
|
126
161
|
},
|
|
127
162
|
"publishConfig": {
|
|
128
163
|
"access": "public"
|