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

[FEATURE] new @Env('Project specific configs') which should fetch by autocompletion all env files of the project #108

Closed
dragolea opened this issue Nov 6, 2024 · 0 comments · Fixed by #109
Assignees
Labels

Comments

@dragolea
Copy link
Contributor

dragolea commented Nov 6, 2024

Description

Currently there's not specific decorator to fetch ENV variables + the typing of cds.env is not finished entirely

Currently the cds.env looks like below

/**
 * Access to the configuration for Node.js runtime and tools.
 * The object is the effective result of configuration merged from various sources,
 * filtered through the currently active profiles, thus highly dependent on the current working
 * directory and process environment.
 */
export const env: {
    build: _TODO,
    hana: _TODO,
    i18n: {
        languages: string[],
        default_language: string,
        folders: string[],
        [key: string]: any,
    },
    profiles: string[],
    requires: env.Requires,
    folders: {
        app: string,
        db: string,
        srv: string,
        fts: string,
        [key: string]: string, // to allow additional values
    },
    odata: _TODO,
    query: _TODO,
    sql: _TODO,
} & { [key: string]: any };

Suggested solution

A @Env decorator and getting autocompletion of all env files as properties would be useful.

@dragolea dragolea self-assigned this Nov 6, 2024
@dragolea dragolea added minor package.json increase - 0.x.0 and removed minor package.json increase - 0.x.0 labels Nov 11, 2024
@dragolea dragolea linked a pull request Nov 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant