Open
Conversation
9d915c7 to
a2ae684
Compare
Replace Map-based get()/set() API with Zod-based field definitions and direct property access. Configuration is now immutable, and constructor options take precedence over environment variables. Priority order: constructor options > env vars > crawlee.json > defaults Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… and z Allow `envVar` to accept `string | string[]` so the Apify SDK can map ACTOR_/APIFY_/CRAWLEE_ prefixed env vars to a single config field. Also export `coerceNumber` and `z` for SDK reuse. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
a2ae684 to
1a2f7f0
Compare
Constructor options and crawlee.json values were returned raw from _resolve(), bypassing schema validation that env vars already went through. Now all four resolution paths (constructor, env, file, defaults) consistently run through fieldDef.schema.parse(). Adds tests for crawlee.json loading and constructor option coercion. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The declaration merging pattern is intentional — properties are defined at runtime via Object.defineProperties in registerAccessors(). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…link The ConfigurationOptions interface was replaced by ConfigurationInput type alias in v4. Updated docs to reference the Configuration class directly and reflect the new immutable API (no more get/set methods). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…x broken refs - Cache all resolved Configuration values at construction time instead of re-running Zod parsing on every property access (perf fix for hot paths like emitSystemInfoEvent which reads config every ~1s) - Replace 13-method manual serviceLocator proxy with a Proxy object - Fix broken Configuration.getStorageClient() calls in test and e2e files to use serviceLocator.getStorageClient() - Move EventEmitter.defaultMaxListeners to module scope (run once, not per instance) - Extract readEnvVar() helper, remove TOCTOU pathExistsSync before readFileSync - Add systemInfoV2 to "Removed symbols" in upgrade guide Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- 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>
Revert the Proxy-based serviceLocator back to the explicit delegation style. The proxy refactor is unrelated to the Configuration redesign and has been split into its own PR (#3515) for separate discussion. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
get()/set()with direct property access —config.headlessinstead ofconfig.get('headless'). Both methods are removed (v4 breaking change).new Configuration({ headless: false })works even whenCRAWLEE_HEADLESS=trueis set. New priority: constructor > env vars > crawlee.json > schema defaults.TypeError.crawleeConfigFields).protected static fieldsto register additional config fields (e.g. Apify SDK).Closes #3080
🤖 Generated with Claude Code