Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/spotty-students-pump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@vue-storefront/multistore": patch
---

[UPDATED] Set the return type of the createMultistoreExtension helper to `ApiClientExtension`.
5 changes: 5 additions & 0 deletions .changeset/strong-scissors-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@vue-storefront/middleware": major
---

[CHANGED] Updated the type of the `hooks` property in the `ApiClientExtension` interface so that the hooks' `configuration` param is typed properly. This is a breaking change if you are using `@vue-storefront/middleware` version `4.1.2` or lower.
4 changes: 2 additions & 2 deletions packages/middleware/src/types/common.ts
Original file line number Diff line number Diff line change
@@ -108,7 +108,7 @@ export interface ApiClientExtension<API = any, CONTEXT = any, CONFIG = any> {
req: AlokaiRequest,
res: AlokaiResponse,
hooksContext: AlokaiContainer
) => ApiClientExtensionHooks;
) => ApiClientExtensionHooks<CONFIG>;
}

export type ErrorHandler = (
@@ -129,7 +129,7 @@ export interface Integration<
extensions: ApiClientExtension<API, CONTEXT>[]
// TODO(IN-4338): There is a bug in the types here
// we're not able to verify if the methods are namespaced or not with this implementation.
) => ApiClientExtension<API, CONTEXT>[];
) => ApiClientExtension<API, CONTEXT, CONFIG>[];
customQueries?: Record<string, CustomQueryFunction>;
initConfig?: TObject;
/**
4 changes: 2 additions & 2 deletions packages/multistore/src/extension.ts
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ import { fetchConfigWithCache } from "./cache/fetchConfigWithCache";

export const createMultistoreExtension = (
multistoreConfig: MultistoreExtensionMethods
) => {
): ApiClientExtension => {
const cacheManager = multistoreConfig.cacheManagerFactory();

return {
@@ -37,5 +37,5 @@ export const createMultistoreExtension = (
},
};
},
} satisfies ApiClientExtension;
};
};

Unchanged files with check annotations Beta

import { baseConfig } from "@vue-storefront/jest-config";

Check warning on line 1 in packages/cli/jest.config.ts

GitHub Actions / Continuous Integration / Run CI

'@vue-storefront/jest-config' should be listed in the project's dependencies. Run 'npm i -S @vue-storefront/jest-config' to add it
export default {
...baseConfig,
});
if (isCancel(name)) {
console.log("Endpoint creation has been canceled");

Check warning on line 23 in packages/cli/src/domains/add/endpoint/helpers/prompts/endpointName.ts

GitHub Actions / Continuous Integration / Run CI

Unexpected console statement
process.exit(0);
}
const endpointsInterface = sourceFile.getInterface("Endpoints");
if (!endpointsInterface) {
console.error(`The "Endpoints" interface was not found in ${fileName}`);

Check warning on line 18 in packages/cli/src/domains/add/endpoint/helpers/write/writeTypescriptFile.ts

GitHub Actions / Continuous Integration / Run CI

Unexpected console statement
process.exit(1);
}
commandArg,
endpoint,
self,
}: CheckCommandAndSuggest) => {

Check warning on line 24 in packages/cli/src/utils/commands/checkCommandAndSuggest.ts

GitHub Actions / Continuous Integration / Run CI

Expected to return a value at the end of async arrow function
const similarCommand = commands.find(({ command }) =>
isCloseEnough(commandArg, command)
);
const noFramework = "Could not detect framework. No page will be generated.";
console.warn(noFramework);

Check warning on line 17 in packages/cli/src/utils/frameworks/getFrameworkName.ts

GitHub Actions / Continuous Integration / Run CI

Unexpected console statement
return noFramework;
};
sp.stop(picocolors.green(exitMessage));
} catch (error) {
console.error("Error installing dependencies:", error);

Check warning on line 29 in packages/cli/src/utils/installDeps.ts

GitHub Actions / Continuous Integration / Run CI

Unexpected console statement
}
};
import { baseConfig } from "@vue-storefront/jest-config";

Check warning on line 1 in packages/sdk-axios-request-sender/jest.config.ts

GitHub Actions / Continuous Integration / Run CI

'@vue-storefront/jest-config' should be listed in the project's dependencies. Run 'npm i -S @vue-storefront/jest-config' to add it
export default {
...baseConfig,
import { generateSDKConfig } from "@vue-storefront/rollup-config";

Check warning on line 1 in packages/sdk-axios-request-sender/rollup.config.js

GitHub Actions / Continuous Integration / Run CI

'@vue-storefront/rollup-config' should be listed in the project's dependencies. Run 'npm i -S @vue-storefront/rollup-config' to add it
import package_ from "./package.json";
export default [generateSDKConfig(package_)];
it("it logs at the correct level", () => {
const logger = createConsolaStructuredLogger(mockStructuredLog);
const infoSpy = jest.spyOn(logger, "info").mockImplementation(() => {});

Check warning on line 31 in packages/logger/__tests__/unit/consolaStructuredLogger.spec.ts

GitHub Actions / Continuous Integration / Run CI

Unexpected empty arrow function
logger.info(logData, metadata);
expect(infoSpy).toHaveBeenCalledTimes(1);
const errorSpy = jest.spyOn(logger, "error").mockImplementation(() => {});

Check warning on line 35 in packages/logger/__tests__/unit/consolaStructuredLogger.spec.ts

GitHub Actions / Continuous Integration / Run CI

Unexpected empty arrow function
logger.error(logData, metadata);
expect(errorSpy).toHaveBeenCalledTimes(1);