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

Namespacing config settings and beefing them up? #192

Closed
mattsah opened this issue Nov 19, 2015 · 1 comment
Closed

Namespacing config settings and beefing them up? #192

mattsah opened this issue Nov 19, 2015 · 1 comment

Comments

@mattsah
Copy link

mattsah commented Nov 19, 2015

I use config.json for other settings, it would be nice to have these under a namespace. I've got a local integration I've done where I did the following:

{
    "app": {
        "directories": {
            "scripts": {
                "source": "source/scripts",
                "target": "public/scripts",
                "tasks":  ["cp:scripts"]
            },
            "styles": {
                "source": "source/styles",
                "target": "public/styles",
                "tasks":  ["cp:styles"]
            },
            "images": {
                "source": "source/images",
                "target": "public/images",
                "tasks":  ["cp:images"]
            },
            "fonts": {
                "source": "source/fonts",
                "target": "public/fonts",
                "tasks":  ["cp:fonts"]
            }
        }
    },

    "lab": {
        "patterns" : {
             "source" : "source/patterns",
             "public" : "public/patterns"
        },

        "data" : {
            "source" : "source/data",
            "public" : "public/data"
        },

        "ignored-extensions" : ["scss", "DS_Store", "less"],
        "ignored-directories" : ["scss"],
        "debug": false,
        "ishControlsVisible": {
            "s": true,
            "m": true,
            "l": true,
            "full": true,
            "random": true,
            "disco": true,
            "hay": true,
            "mqs": true,
            "find": true,
            "views-all": true,
            "views-annotations": true,
            "views-code": true,
            "views-new": true,
            "tools-all": true,
            "tools-sync": true,
            "tools-shortcuts": true,
            "tools-docs": true
        },
        "patternStates": {
        },
        "patternExportKeys": [],
        "patternExportDirectory": "./pattern_exports/",
        "baseurl" : "patterns"
    }
}

I had to modify patternlab.js, but this worked out well since I was able to make the pattern/data directories more variable too (which they didn't actually appear to be before).

I'm potentially thinking about doing a pull request with this, but I wanted to run by whether or not you'd be willing to accept a pull request that changes the config in this manner since it could break BC unless someone went in and namespaced their old config. I could make it so that it look for lab and if not there falls back to the full config.

@bmuenzenmeyer
Copy link
Member

Hi @mattsah

If I understand you correctly, this is causing problems because you are interweaving a patternlab installation with other components, causing two config.json files to be present?

I am in general agreement that we should try to support coexistence when possible. To me, something as simple as calling it patternlab.config.json would suffice. People will likely need to upgrade with major changes coming to pattern lab node for post 1.0 world.

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

No branches or pull requests

2 participants