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

pubspec.yaml in cljd.edn: unify configuration file #90

Closed
avelino opened this issue May 24, 2022 · 3 comments
Closed

pubspec.yaml in cljd.edn: unify configuration file #90

avelino opened this issue May 24, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@avelino
Copy link

avelino commented May 24, 2022

Instead of having to maintain several configuration files, why not keep as much configuration as possible in cljd.edn?

Automatically generating pubspec.yaml at runtime

@cgrand
Copy link
Contributor

cgrand commented May 24, 2022

Could you develop your idea further?

@cgrand cgrand added the enhancement New feature or request label May 24, 2022
@avelino
Copy link
Author

avelino commented May 26, 2022

To make an application using ClojureDart you have 3 configuration files:

  • deps.edn clojure config
  • cljd.edn clojuredart config
  • pubspec.yaml flutter app config

My proposal would be to unify them all into a single file, for example cljd.edn or deps.edn (as is done in Node which uses package.json).

Inside the package.json we have the package publication configuration, dependencies, authors and etc.

example cljd.edn:

{;; cljd.edn
 :flutter {:main example.main, :bin "flutter"}
 
 ;; deps.edn
 :paths ["src"]
 :deps {org.clojure/clojure {:mvn/version "1.10.1"}
        tensegritics/clojuredart
        {:git/url "git@github.com:tensegritics/ClojureDart.git"
         :sha "b49677deaee9c2cc46c165975004d297fe5cabc8"}}

 ;; pubspec.yaml
 :pub {:name "example"
       :description "A new Flutter project."
       :publish_to "none"
       :version "1.0.0"
       :environment {:sdk ">=2.16.2 <3.0.0"}
       :dependencies {:flutter {:sdk "flutter"}
                      :cupertino_icons {:version "^1.0.2"}}
       :flutter {:uses-material-design true}}}

Running cljd.build reads cljd.edn and generates the necessary files in memory (or disk), so that when the process is stopped we remove the files if they were created by cljd.build

clj -M -m cljd.build flutter

@cgrand
Copy link
Contributor

cgrand commented Jan 31, 2023

This makes working with flutter cli for adding packages etc impossible and we need to map into edn much if not all of pub spec.yaml.
Nice idea but costs/benefits not compelling at the moment.

@cgrand cgrand closed this as completed Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants