@adobe-commerce/aio-toolkit 1.0.10 → 1.0.11
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/CHANGELOG.md +34 -25
- package/dist/index.d.mts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js +1081 -755
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1095 -777
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -2
- package/scripts/postinstall.js +105 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,35 +5,44 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.0.11] - 2026-01-04
|
|
9
|
+
|
|
10
|
+
### 🐛 Bug Fixes
|
|
11
|
+
|
|
12
|
+
- **fix(telemetry):** Revert lazy-loading pattern from v1.0.10 that caused missing logs in New Relic
|
|
13
|
+
- Lazy-loaded logger proxy was causing race conditions where early logs used fallback Core.Logger
|
|
14
|
+
- Logs (`-started`, `-headers`, `-body`) were not being sent to OpenTelemetry/New Relic
|
|
15
|
+
- Only late logs (like `-completed`) appeared because telemetry logger loaded after initial execution
|
|
16
|
+
- Reverted to synchronous imports for `@adobe/aio-lib-telemetry` and `NewRelicTelemetry`
|
|
17
|
+
- Ensures telemetry logger is immediately available and properly connected to trace context
|
|
18
|
+
|
|
19
|
+
- **fix(telemetry):** Add automatic postinstall script to fix @adobe/aio-lib-telemetry exports bug
|
|
20
|
+
- **Problem**: `@adobe/aio-lib-telemetry@1.1.2` has incorrect exports configuration causing `ERR_PACKAGE_PATH_NOT_EXPORTED` error
|
|
21
|
+
- **Root Cause**: Package uses `"import"` instead of `"default"` in both import and require conditions
|
|
22
|
+
- **Solution**: Custom postinstall script (`scripts/postinstall.js`) automatically patches the telemetry package.json
|
|
23
|
+
- **Impact**: Zero configuration required by client projects - patch applies automatically during npm install
|
|
24
|
+
- **Compatibility**: Works with both CommonJS (require) and ESM (import) in TypeScript and JavaScript projects
|
|
25
|
+
- Added `@adobe/aio-lib-telemetry`, `@adobe/aio-lib-ims` to tsup external dependencies to prevent bundling
|
|
26
|
+
- Postinstall script runs automatically when toolkit is installed as a dependency
|
|
27
|
+
- Gracefully handles cases where telemetry package is not present
|
|
28
|
+
- No breaking changes - completely transparent to end users
|
|
29
|
+
|
|
30
|
+
### 📝 Technical Details
|
|
31
|
+
|
|
32
|
+
- Reverted changes from release v1.0.10 (commit d8229f7)
|
|
33
|
+
- Restored synchronous telemetry initialization pattern from v1.0.9
|
|
34
|
+
- All telemetry-related imports are now synchronous to prevent race conditions
|
|
35
|
+
- Added `scripts/postinstall.js` to automatically fix third-party package exports bug
|
|
36
|
+
- Updated `tsup.config.ts` to externalize Adobe SDK packages instead of bundling
|
|
37
|
+
- Postinstall script detects and patches telemetry package in client project's node_modules
|
|
38
|
+
|
|
8
39
|
## [1.0.10] - 2026-01-01
|
|
9
40
|
|
|
10
41
|
### 🐛 Bug Fixes
|
|
11
42
|
|
|
12
|
-
- **
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
- `getLogger` is now dynamically imported only when `ENABLE_TELEMETRY=true`
|
|
16
|
-
- Maintains synchronous API with immediate logger availability
|
|
17
|
-
- Graceful fallback to `Core.Logger` if telemetry loading fails
|
|
18
|
-
- **Impact:** Zero breaking changes - existing client code works without modification
|
|
19
|
-
- **Benefits:**
|
|
20
|
-
- Full OpenTelemetry integration preserved when telemetry is enabled
|
|
21
|
-
- Package size reduced by 92% (3.83 MB → 288 KB)
|
|
22
|
-
- No more import errors from broken dependency exports
|
|
23
|
-
|
|
24
|
-
### 🔧 Technical Changes
|
|
25
|
-
|
|
26
|
-
- **src/framework/telemetry/index.ts** - Implemented lazy-loading proxy pattern for `getLogger`
|
|
27
|
-
- **src/framework/telemetry/types.ts** - Added local `EntrypointInstrumentationConfig` type definition
|
|
28
|
-
- **src/commerce/adobe-auth/index.ts** - Changed to namespace import for ESM/CommonJS compatibility
|
|
29
|
-
- **tsconfig.json** - Added `"module": "ES2020"` to support dynamic imports
|
|
30
|
-
- **tsup.config.ts** - Configured to keep all dependencies external (not bundled)
|
|
31
|
-
|
|
32
|
-
### ✅ Quality Assurance
|
|
33
|
-
|
|
34
|
-
- Added 8 comprehensive test cases for lazy-loading telemetry behavior
|
|
35
|
-
- Maintained 100% test coverage (1902 tests passing)
|
|
36
|
-
- All validation checks passing (linting, formatting, type safety)
|
|
43
|
+
- **fix(telemetry):** Resolve ERR_PACKAGE_PATH_NOT_EXPORTED error with lazy-loading pattern
|
|
44
|
+
- **Note:** This version introduced a regression with missing logs in New Relic
|
|
45
|
+
- **Recommendation:** Skip this version and use v1.0.11 instead
|
|
37
46
|
|
|
38
47
|
## [1.0.9] - 2025-12-23
|
|
39
48
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import openwhisk, { Dict, Activation } from 'openwhisk';
|
|
2
|
+
import { EntrypointInstrumentationConfig } from '@adobe/aio-lib-telemetry';
|
|
2
3
|
import { LogRecordProcessor } from '@opentelemetry/sdk-logs';
|
|
3
4
|
import { SdkLogRecord } from '@adobe/aio-lib-telemetry/otel';
|
|
4
5
|
import { Response } from 'node-fetch';
|
|
@@ -276,7 +277,6 @@ declare class RuntimeApiGatewayService {
|
|
|
276
277
|
delete(endpoint: string, additionalHeaders?: Record<string, string>): Promise<any>;
|
|
277
278
|
}
|
|
278
279
|
|
|
279
|
-
type EntrypointInstrumentationConfig = any;
|
|
280
280
|
interface BaseTelemetryValidator {
|
|
281
281
|
isConfigured(params: Record<string, unknown>): boolean;
|
|
282
282
|
validateConfiguration(params: Record<string, unknown>): void;
|
|
@@ -289,7 +289,6 @@ interface BaseTelemetry {
|
|
|
289
289
|
|
|
290
290
|
declare class Telemetry {
|
|
291
291
|
static createLogger(name: string, params: Record<string, unknown>): any;
|
|
292
|
-
private static wrapLogger;
|
|
293
292
|
static formatError(error: unknown): Record<string, unknown>;
|
|
294
293
|
static initialize(action: (params: Record<string, unknown>) => any): (params: Record<string, unknown>) => any;
|
|
295
294
|
}
|
|
@@ -956,4 +955,4 @@ declare class AdminUiSdk {
|
|
|
956
955
|
getRegistration(): AdminUiSdkRegistration;
|
|
957
956
|
}
|
|
958
957
|
|
|
959
|
-
export { AdminUiSdk, type AdminUiSdkRegistration, AdobeAuth, AdobeCommerceClient, type AdobeIMSConfig, type BaseTelemetry, type BaseTelemetryValidator, BasicAuthConnection, BearerToken, type BearerTokenInfo, type CommerceEvent, type CommerceEventConfig, type CommerceEventField, type Connection, type CreateEventResult, CreateEvents, type CreateProviderParams, type CreateProviderResult, type CreateRegistrationResult, CreateRegistrations, type
|
|
958
|
+
export { AdminUiSdk, type AdminUiSdkRegistration, AdobeAuth, AdobeCommerceClient, type AdobeIMSConfig, type BaseTelemetry, type BaseTelemetryValidator, BasicAuthConnection, BearerToken, type BearerTokenInfo, type CommerceEvent, type CommerceEventConfig, type CommerceEventField, type Connection, type CreateEventResult, CreateEvents, type CreateProviderParams, type CreateProviderResult, type CreateRegistrationResult, CreateRegistrations, type ErrorResponse, EventConsumerAction, type EventData, type EventMetadata, type EventMetadataInputModel, type EventMetadataListResponse, EventMetadataManager, type ExtendedRequestError, type FileMetadata, type FileRecord, FileRepository, GenerateBasicAuthToken, type GetProviderQueryParams, type GetRegistrationQueryParams, GraphQlAction, type HALLink, type Headers, HttpMethod, HttpStatus, IOEventsApiError, type IOEventsError, ImsConnection, ImsToken, type ImsTokenResult, InfiniteLoopBreaker, type InfiniteLoopData, IoEventsGlobals, JsonMessageProcessor, type ListProvidersQueryParams, type ListRegistrationQueryParams, type MenuItem, Oauth1aConnection, OnboardCommerce, type OnboardCommerceConfig, type OnboardCommerceResult, OnboardEvents, type OnboardEventsInput, type OnboardEventsResponse, OnboardEvents as OnboardIOEvents, Openwhisk, OpenwhiskAction, type Page, Parameters, type Provider, type ProviderInputModel, ProviderManager, PublishEvent, type PublishEventResult, type Registration, type RegistrationCreateModel, type RegistrationListResponse, RegistrationManager, RestClient, RuntimeAction, RuntimeActionResponse, type RuntimeActionResponseType, RuntimeApiGatewayService, ShippingCarrier, type ShippingCarrierData, ShippingCarrierMethod, type ShippingCarrierMethodAdditionalData, type ShippingCarrierMethodData, ShippingCarrierResponse, SignatureVerification, SuccessChecker, type SuccessResponse, Telemetry, TelemetryInputError, type TokenResult, Validator, WebhookAction, type WebhookActionAddResponse, type WebhookActionExceptionResponse, WebhookActionOperation, type WebhookActionRemoveResponse, type WebhookActionReplaceResponse, WebhookActionResponse, type WebhookActionResponseType, type WebhookActionSuccessResponse, type WorkspaceConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import openwhisk, { Dict, Activation } from 'openwhisk';
|
|
2
|
+
import { EntrypointInstrumentationConfig } from '@adobe/aio-lib-telemetry';
|
|
2
3
|
import { LogRecordProcessor } from '@opentelemetry/sdk-logs';
|
|
3
4
|
import { SdkLogRecord } from '@adobe/aio-lib-telemetry/otel';
|
|
4
5
|
import { Response } from 'node-fetch';
|
|
@@ -276,7 +277,6 @@ declare class RuntimeApiGatewayService {
|
|
|
276
277
|
delete(endpoint: string, additionalHeaders?: Record<string, string>): Promise<any>;
|
|
277
278
|
}
|
|
278
279
|
|
|
279
|
-
type EntrypointInstrumentationConfig = any;
|
|
280
280
|
interface BaseTelemetryValidator {
|
|
281
281
|
isConfigured(params: Record<string, unknown>): boolean;
|
|
282
282
|
validateConfiguration(params: Record<string, unknown>): void;
|
|
@@ -289,7 +289,6 @@ interface BaseTelemetry {
|
|
|
289
289
|
|
|
290
290
|
declare class Telemetry {
|
|
291
291
|
static createLogger(name: string, params: Record<string, unknown>): any;
|
|
292
|
-
private static wrapLogger;
|
|
293
292
|
static formatError(error: unknown): Record<string, unknown>;
|
|
294
293
|
static initialize(action: (params: Record<string, unknown>) => any): (params: Record<string, unknown>) => any;
|
|
295
294
|
}
|
|
@@ -956,4 +955,4 @@ declare class AdminUiSdk {
|
|
|
956
955
|
getRegistration(): AdminUiSdkRegistration;
|
|
957
956
|
}
|
|
958
957
|
|
|
959
|
-
export { AdminUiSdk, type AdminUiSdkRegistration, AdobeAuth, AdobeCommerceClient, type AdobeIMSConfig, type BaseTelemetry, type BaseTelemetryValidator, BasicAuthConnection, BearerToken, type BearerTokenInfo, type CommerceEvent, type CommerceEventConfig, type CommerceEventField, type Connection, type CreateEventResult, CreateEvents, type CreateProviderParams, type CreateProviderResult, type CreateRegistrationResult, CreateRegistrations, type
|
|
958
|
+
export { AdminUiSdk, type AdminUiSdkRegistration, AdobeAuth, AdobeCommerceClient, type AdobeIMSConfig, type BaseTelemetry, type BaseTelemetryValidator, BasicAuthConnection, BearerToken, type BearerTokenInfo, type CommerceEvent, type CommerceEventConfig, type CommerceEventField, type Connection, type CreateEventResult, CreateEvents, type CreateProviderParams, type CreateProviderResult, type CreateRegistrationResult, CreateRegistrations, type ErrorResponse, EventConsumerAction, type EventData, type EventMetadata, type EventMetadataInputModel, type EventMetadataListResponse, EventMetadataManager, type ExtendedRequestError, type FileMetadata, type FileRecord, FileRepository, GenerateBasicAuthToken, type GetProviderQueryParams, type GetRegistrationQueryParams, GraphQlAction, type HALLink, type Headers, HttpMethod, HttpStatus, IOEventsApiError, type IOEventsError, ImsConnection, ImsToken, type ImsTokenResult, InfiniteLoopBreaker, type InfiniteLoopData, IoEventsGlobals, JsonMessageProcessor, type ListProvidersQueryParams, type ListRegistrationQueryParams, type MenuItem, Oauth1aConnection, OnboardCommerce, type OnboardCommerceConfig, type OnboardCommerceResult, OnboardEvents, type OnboardEventsInput, type OnboardEventsResponse, OnboardEvents as OnboardIOEvents, Openwhisk, OpenwhiskAction, type Page, Parameters, type Provider, type ProviderInputModel, ProviderManager, PublishEvent, type PublishEventResult, type Registration, type RegistrationCreateModel, type RegistrationListResponse, RegistrationManager, RestClient, RuntimeAction, RuntimeActionResponse, type RuntimeActionResponseType, RuntimeApiGatewayService, ShippingCarrier, type ShippingCarrierData, ShippingCarrierMethod, type ShippingCarrierMethodAdditionalData, type ShippingCarrierMethodData, ShippingCarrierResponse, SignatureVerification, SuccessChecker, type SuccessResponse, Telemetry, TelemetryInputError, type TokenResult, Validator, WebhookAction, type WebhookActionAddResponse, type WebhookActionExceptionResponse, WebhookActionOperation, type WebhookActionRemoveResponse, type WebhookActionReplaceResponse, WebhookActionResponse, type WebhookActionResponseType, type WebhookActionSuccessResponse, type WorkspaceConfig };
|