Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update dependency auto-config-loader to v2 #22

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Dec 11, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
auto-config-loader (source) ^1.7.7 -> ^2.0.0 age adoption passing confidence

Release Notes

jaywcjlove/auto-config-loader (auto-config-loader)

v2.0.2

Compare Source

Buy me a coffee

Documentation v2.0.2: https://raw.githack.com/jaywcjlove/auto-config-loader/e3ec651/index.html

v2.0.1

Compare Source

Buy me a coffee

Documentation v2.0.1: https://raw.githack.com/jaywcjlove/auto-config-loader/61285d8/index.html

v2.0.0

Compare Source

Buy me a coffee

Documentation v2.0.0: https://raw.githack.com/jaywcjlove/auto-config-loader/790defe/index.html

  1. test: update test case. @​jaywcjlove
  2. fix: ensure consistent handling of default exports across platforms. @​jaywcjlove
  3. fix: ensure consistent handling of default exports across platforms. @​jaywcjlove
  4. fix(deps): update dependency jiti to v2 #​13 @​jaywcjlove

V1 To V2 Migration

This guide provides the steps to migrate to the latest version of the configuration loader API.

Key Changes
  1. Loader Functions Support Async

    • LoaderFunc<T> now supports returning T or Promise<T>.
    • Update custom loaders to handle asynchronous operations if needed.

    Example:

    export type LoaderFunc<T> = (
      filepath: string,
      content: string,
      jsOption?: LoadConfOption
    ) => T | Promise<T>;
  2. autoConf Returns a Promise

    • The autoConf function now returns a Promise instead of a synchronous result.
    • Update your code to handle asynchronous calls.

    Example:

    export declare function autoConf<T>(
      namespace?: string,
      option?: AutoConfOption<T>
    ): Promise<{} & T>;
Migration Steps
1. Update Custom Loader Functions

If you have custom loaders, update their return types to support asynchronous operations:

Example:

const jsonLoader: LoaderFunc<MyConfig> = async (
  filepath, content
) => JSON.parse(content);
2. Handle Asynchronous autoConf Calls

Update all calls to autoConf to use await or .then to handle Promises:

Example Using await:

const config = await autoConf('myNamespace', options);
console.log(config);

Example Using .then:

autoConf('myNamespace', options).then(config => {
  console.log(config);
});

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants