Skip to content

Commit cc117c3

Browse files
B4nanclaude
andcommitted
fix: clean up exports, add proxy set trap, update docs and test mock
- Remove unnecessary exports (coerceNumber, logLevelSchema, z from zod) - Add set trap to serviceLocator proxy for a helpful error message - Document resetGlobalState() removal in upgrade guide - Fix mock logger method name (internal → logWithLevel) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 92ce25f commit cc117c3

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

docs/upgrading/upgrading_v4.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ The following methods and properties have been removed from `Configuration`:
184184
- `Configuration.getEventManager()` - moved to `ServiceLocator.getEventManager()`
185185
- `Configuration.useStorageClient()` - use `ServiceLocator.setStorageClient()` instead
186186
- `Configuration.useEventManager()` - use `ServiceLocator.setEventManager()` instead
187+
- `Configuration.resetGlobalState()` - use `serviceLocator.reset()` instead
187188
- `Configuration.storageManagers` - moved to `ServiceLocator.storageManagers`
188189

189190
The `EventManager` and `LocalEventManager` constructors now accept an options object for configuring event intervals (e.g. `persistStateIntervalMillis`, `systemInfoIntervalMillis`). You can also use the new `LocalEventManager.fromConfig()` factory method to create an instance with intervals derived from a `Configuration` object.

packages/core/src/configuration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ export const coerceBoolean = z.preprocess((val) => {
3131
return val;
3232
}, z.boolean());
3333

34-
export const coerceNumber = z.preprocess((val) => {
34+
const coerceNumber = z.preprocess((val) => {
3535
if (typeof val === 'string') return Number(val);
3636
return val;
3737
}, z.number());
3838

3939
/** Zod schema accepting both LogLevel enum values and string names (case-insensitive). */
40-
export const logLevelSchema = z.preprocess((val) => {
40+
const logLevelSchema = z.preprocess((val) => {
4141
if (val == null) return val;
4242
const s = String(val);
4343
if (Number.isFinite(+s)) return +s;

packages/core/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,3 @@ export * from './cookie_utils.js';
1717
export * from './recoverable_state.js';
1818
export { PseudoUrl } from '@apify/pseudo_url';
1919
export { Dictionary, Awaitable, Constructor, StorageClient, Cookie, QueueOperationInfo } from '@crawlee/types';
20-
export { z } from 'zod';

0 commit comments

Comments
 (0)