Skip to content

fix: update localConfig from appwrite.json to appwrite.config.json #1116

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

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

Conversation

ChiragAgg5k
Copy link
Member

What does this PR do?

since frameworks like vite allow direct import of json files, appwrite.json can be confused with the appwrite package import. this PR shifts default config to be appwrite.config.json while keeping backwards compatibility with appwrite.json

Test Plan

Related PRs and Issues

Have you read the Contributing Guidelines on issues?

yes.

@ChiragAgg5k ChiragAgg5k requested a review from Copilot July 22, 2025 03:33
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the default configuration file name from appwrite.json to appwrite.config.json to avoid naming conflicts with the appwrite package import in frameworks like Vite. The changes maintain backward compatibility by still supporting the legacy appwrite.json filename.

  • Introduces new default config filename appwrite.config.json while preserving legacy support
  • Refactors config file discovery logic into a reusable static method
  • Updates constructor to check for both new and legacy config file locations

Comment on lines +128 to +129
static CONFIG_FILE_PATH = "{{ spec.title|caseLower }}.config.json";
static CONFIG_FILE_PATH_LEGACY = "{{ spec.title|caseLower }}.json";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per torsten suggestion, it might be better to use library for this: https://github.com/unjs/c12

that will aslo support .js out of the box, which would be great addition for those wanting a bit of complexity.

I would never try to load such JS/TS configs on my own, trusting lib with 10M monthly downloads is better

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.

2 participants