* add devShell outputs for nodejs ad python
* nodejs devShell improvements
- do not export NODE_PATH
- create node_modules directory
- add .bin directories of direct dependencies to PATH
* nodejs: revise devShell logic
- fix namespaced modules symlinking to ./node_modules
- add all transitive exectables to ./node_modules/.bin
- add ./node_modules/.bin to PATH
* set nodejs version in eslint example
* nodejs: improve error message on failed node_modules symlink in devShell
* readme: add nodejs version setting to example
* feat: add translate and shell commands
* feat: add indexer modules
* feat(nodejs): add a basic npm indexer
* feat: add an index app for indexing using an indexer
* feat(rust): add crates-io indexer
* refactor: use configFile in more places
* feat: implement translate-index app
* refactor: move indexers out of subsystems since they aren't subsystem specific
* fix: discard string context for config text
* docs: add a preliminary document for indexers
* docs: add examples for crates-io and npm indexer inputs
* feat: add support for setting sourceRoot in dream-lock, fix translate source patching
* fix: don't discard context from config passed as text
* fix: remove duplicate resolves
* fix: shell command
* refactor: remove useless nix calls, improve the apps
* feat: improve cli apps UX, implement runNixCmdInSrc, remove shell
* docs: more comments
* feat: add generatePackagesFromLocksTree util
* fix: pass args to generatePackagesFromDreamLocks correctly
* Update indexers.md
* chore: remove license from crates-io indexer
* fix: pass config loaded from env vars to loadConfig
* refactor: don't expose dream2nix internally
* feat: add makeOutputsForIndexes utility
* refactor: make make(Flake)OutputsForIndexes interface consistent with make(Flake)Outputs
* fix: allow passing pkgs to makeFlakeOutputsForIndexes
* fix: remove unused code
* fix: rename var to expected name
* refactor(utils/index): improve and fix overrideOutputs arg
* fix(utils/index): actually pass prev outputs to overrideOutputs
* refactor: patch all sources instead of using a seperate field in dream lock
* fix(utils/index): use .program to access the program
* fix: correct jq command in translate app
* refactor: improve translate app performance
* feat: add crates-io-simple indexer
* fix(apps/translate): only set dir if relPath is set
* fix(apps/callNixWithD2N): pin nixpkgs
* fix: unloaded config passed to dlib
* refactor: rewrite root source patching in nix
* tests: add a unit test for replace root sources
Co-authored-by: DavHau <hsngrmpf+github@gmail.com>
- the reason for this change is that the flake app structure can only be used inside `apps`. Nix run will not execute it if it is inside any other attribute
- translator: ensure setup requirements from pyproject.toml are respected
- builder: ensure setup requirements are installed first before the package is built
- simplify the python translator
- dont depend on mach-nix for dependency extraction
- use only pip download to extract dependencies
- allow impure pip translator to cache downloads
- fix dream-lock.json. location was missing
* Nixpkgs input updated
Starting from now `cabal2json` is available in nixpkgs
* Using `cabal2json` from Nixpkgs
* Using more idiomatic `haskellLib` utils
* Formatting
* fix(builder/crane): remove code that triggers IFD, remove dependency on full project source for deps only drv
* fix(rust/builders): pass pkgs to utils.nix
* fix(builder/crane): break dependency on whole project source in dependency derivation
* refactor(rust/builders): change nix version to be more close to when reading toFile paths was made non-IFD
* docs(translator/cargo-lock): make the safety comment about unsafeDiscardStringContext usage more clear
* chore(deps): update crane
* fix: use builtins.path to make paths content addressed and named properly in a few places, fix cargo-lock path replacements
* refactor(rust/builders): remove nix version check for writing cargo.lock to store
* tests: update dream2nix input before overriding it
* tests: remove 'flake.lock's, overriding input generates flake.lock correctly
* tests: use nixpkgs from dream2nix input in d2n-init-pkgs
* refactor: remove useless builtins.path calls
* fix: use writeText for writing generated Cargo.lock, toFile causes problems
This aims to reduce the complexity of adding support for new ecosystems to dream2nix.
Now`discoverProject` can be defined in a translator, which allows to detect projects for that translator with a simple 3-liner.
This should be the default, and only later if complexity is required a fully featured discoverer needs to be implemented.
* feat: return underlying d2n instance if pkgs was passed to init, document init pkgs
* feat: implement makeOutputs
* tests: dont fail if resolveImpure fails
* feat: make init return a dream2nix instance, rework makeFlakeOutputs code
* feat: default to source if config.projectRoot is not specified, update examples and readme
* fix: update the simple template
* docs: clarify init in readme
* docs: change readme numbering to back to 1
* refactor: dont default projectRoot to source
* docs: make extensive example use makeFlakeOutputs, link per-pkgs d2n example in readme
* fix: call loadConfig correctly
* refactor: implement a validation system for builders / translators etc, organize files
* refactor: use seq instead of complicated validation function for validator
* feat: allow adding discoverers, translators and builders via config
* refactor: rework discoverers to use makeSubsystemModules as well
* fix: validate extra modules properly
* feat: support inline modules
* feat: use extra attribute for extending
* feat: make fetchers extensible properly
* fix: add name to extra fetchers
* feat: support list for extra
* docs: add some comment to lib/modules.nix
* fix: get extra module args from extraArgs
* fix: collect all modules instead of only collecting modules for built-in subsystems
* refactor: minor improvements
* refactor: improve how default subsystem modules are declared
* fix: translators and builders are directly under subsystem now
* fix: correct attribute path, remove unused argument
* fix: correct translators attribute paths
* fix: correct file paths and translators attribute paths
* fix: use correct translator attr path in wrapPureTranslator
* fix: update unit tests code
* fix: remove extra paranthesis in unit tests code
* tests: add an extended dream2nix example
* refactor: replace recursiveUpdate usage with normal update op
* tests: fix and extend d2n-extended example
* fix: pass config to d2n instance in wrap pure translator script
* fix: correct toFile usage
* fix: pass config to dlib in more places
* fix: pass config to d2n instance in aggregated hashes cli and gomod2nix translator
* refactor: remove unused extra modules validation, add warning for function modules
* fix: remove non-existent inherited variable
* docs: update translator attr path in contributors guide
* docs: add docs for extending dream2nix
* refactor: comment more code, warn for function modules only if extra is an attrset decl
* docs: fix some typos
* docs: explain some stuff in extending d2n better
* fix: print function modules warning when it is a function
* tests: add a new example that tests adding new subsystem and config.extra as nix file
* tests: use cargo-toml as translator on d2n-extended to potentially catch more bugs
* feat: add ifd warning for builders
* tests: use build-rust-package builder instead of crane builder in d2n-extended to also test it instead of only testing crane builder
* fix(rust/builders): always write the generated Cargo.lock so it doesnt get out of sync with our dream-lock
* fix(rust/builders): delete cargo lock before writing it?
* refactor: also print ifd warnings for translators
* docs: link extending d2n doc in readme, link examples in extending d2n
* docs: example naming (translators.new -> translators.example-translator)
* feat: allow setting nix files for modules declarations (eg. subsystems, subsystems.translators)
* refactor: move IFD warnings to src/lib/builders.nix / translators.nix respectively
* refactor: throw instead of warning if function declarations for modules are used
* refactor: fix throw usage
* refactor: improve modules code
* chore(deps): update nixpkgs
* fix: correct some map usages
* fix: use correct attr path for extra modules
* chore: update examples flake inputs
* style: minor formatting changes
* feat: allow ref to be specified in git source
* feat(translator/cargo-lock): add ref to git source if one is provided
* refactor(fetcher/git): also check for null for ref
Co-authored-by: DavHau <hsngrmpf+github@gmail.com>
* refactor(fetcher/git): move ref check for rev to a let in to avoid recomputing it
* refactor(fetcher/git): do null check for inp.ref in refAndRev
Co-authored-by: DavHau <hsngrmpf+github@gmail.com>
* fix(translator/cargo-lock): prioritize workspaceToml for path dependencies
* fix(builder/rust): replace paths with quotation marks so we dont accidentally replace features
* fix(translator/cargo-lock): flatten workspace member paths to fix coerce error
* wip
* get a list of crates in discover and pass to translator
* prevent re-reading directory tree
Co-authored-by: DavHau <hsngrmpf+github@gmail.com>
* fix path dependency creation
* use correct attr path
* get subsystemInfo properly
* fix discoverCrates
* default to empty subsystemInfo.crates
* fix replacePathsWithAbsolute
* fix hasAttr usage
* dont put fullPath in subsystemInfo
Co-authored-by: DavHau <hsngrmpf+github@gmail.com>
Push the nix configuration into the CLI so we don't need the overlay,
and so we don't need to create another instance of nixpkgs.
This also means that the python CLI can be executed directly as long as
the user has a recent-enough version of nix and make iterations a bit
faster.
For more details, see
https://zimbatm.com/notes/1000-instances-of-nixpkgs
- fixes#93
- package.json workspaces is an attrset instead of list
- workspaces pointing to non-existent directory
- workspaces pointing to a directory whithout a package.json
commit c580c24b82
Author: Yusuf Bera Ertan <y.bera003.06@protonmail.com>
Date: Sun Feb 27 21:51:58 2022 +0300
feat: expose builders in lib.init
commit 2fe01e1715
Author: Yusuf Bera Ertan <y.bera003.06@protonmail.com>
Date: Sun Feb 27 18:37:39 2022 +0300
fix(rust/crane): make sure cargo only builds the package we want
...(more)
Now if dream2nix is used via flakes and impure translation is required, the user will be isntructed to `nix run ...` something to generate the missing dream-lock.