Commit Graph

930 Commits

Author SHA1 Message Date
DavHau
30401cbc9d fix example for haskell 2022-06-05 16:52:19 +02:00
DavHau
8836a3f422 WIP stack-lock translator & haskell builder 2022-06-05 16:51:37 +02:00
DavHau
d6d94d88db simpleTranslate2: ignore irrelevant dependency objects 2022-06-05 16:51:25 +02:00
DavHau
e37041d443 remove extraDependencies from simpleTranslate2
- this field is unneccessary and `extraObjects` should be sufficient
2022-06-05 16:47:48 +02:00
Yusuf Bera Ertan
39eeaaa450
refactor: use new flake output schema for default package and devshells (#168) 2022-06-05 13:17:41 +02:00
Yusuf Bera Ertan
a46486a67e
fix(builder/crane): remove code that triggers IFD, remove dependency on full project source for deps only drv (#166)
* 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
2022-06-05 13:14:20 +02:00
DavHau
6bc00a70df improve comments in yarn-lock/parser.nix 2022-06-03 14:12:00 +02:00
Yusuf Bera Ertan
33e2a3e39f
fix: add projectRoot to simple template 2022-06-02 17:46:35 +03:00
Yusuf Bera Ertan
8e170fe1f8
chore(deps): update crane 2022-06-02 14:14:34 +03:00
DavHau
073fed4eb2 yarn-lock: add more comments to parser.nix 2022-06-02 09:48:53 +02:00
DavHau
505a3d9976
Merge pull request #165 from nix-community/simpler-discover
Simpler discover
2022-06-01 23:41:12 +02:00
DavHau
4484d3bd75 Revert "simpleTranslate2: ignore irrelevant dependency objects"
This reverts commit c7c59c8353.
2022-06-01 23:29:53 +02:00
DavHau
aab1b396e8 feat: strongly simplified discoverers.
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.
2022-06-01 23:29:47 +02:00
DavHau
2047caab52 python ffi: ensure store paths don't lose context 2022-06-01 23:07:40 +02:00
DavHau
7c02eb5e0b fix builder template to fit #155 2022-06-01 23:04:12 +02:00
DavHau
c7c59c8353 simpleTranslate2: ignore irrelevant dependency objects 2022-06-01 23:02:15 +02:00
DavHau
965d1b1a31 cleanup: remove dead code from getDreamLockPath 2022-06-01 23:01:55 +02:00
Yusuf Bera Ertan
9b6638a1a7
feat: implement makeOutputs that outputs systemless structure (#161)
* 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
2022-06-01 22:53:46 +02:00
Yusuf Bera Ertan
ca7f4d0a7f
fix(rust/builders): dont default to rev as ref part while generating Cargo.lock (#163) 2022-05-30 23:58:15 +03:00
DavHau
39facf29df fix templates for pure/impure translator 2022-05-30 18:30:05 +02:00
DavHau
3d0ed21c2a fix contribute app and templates.
adapt to changes from #155
2022-05-30 14:14:56 +02:00
Yusuf Bera Ertan
8d275a1dc9
fix: expose all builder outputs (#162)
* fix: expose all builder outputs

* fix: don't recursively update into derivations
2022-05-29 22:16:44 +02:00
DavHau
c83389fd43 Fix: #152 parse npm:package-name@ver correctly
closes #160

Co-authored-by: tgunnoe
2022-05-29 22:01:08 +02:00
Yusuf Bera Ertan
645c6fd98e
refactor: implement a validation system for builders / translators, reorganize files (#155)
* 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
2022-05-29 21:42:47 +02:00
DavHau
4b3dfb101f fix broken tsconfig converter script
-  see 72e73fa255 (r74144832)
2022-05-21 14:18:51 +02:00
olaf
bc499a3003
Update README.md (#154)
fix pkgs variable
2022-05-21 10:37:44 +03:00
DavHau
cf39c16a6b yarn-lock: generate unit tests for cardano-js-sdk 2022-05-20 15:35:31 +02:00
DavHau
01c0df4eaf Merge remote-tracking branch 'nrdxp/yarn-fix' 2022-05-20 15:35:22 +02:00
Yusuf Bera Ertan
3a5ed1a596
refactor(builder/crane): use runCommandNoCC instead of runCommand 2022-05-20 15:07:32 +03:00
Timothy DeHerrera
58cafa92ab
fix: bad regex in yarn translator
Also don't allow evaluation to fail, but instead provide default value.
2022-05-19 14:37:56 -06:00
DavHau
7b0162c227 fix builders template 2022-05-19 18:30:06 +02:00
DavHau
fb3789c9a1 update contributors guide 2022-05-19 17:58:08 +02:00
DavHau
0722f0d777 update alejandra code formatter 2022-05-19 17:27:20 +02:00
DavHau
13b7536e28 improve builder template 2022-05-19 17:26:28 +02:00
DavHau
efe9698305 refactor: clean up builder interface 2022-05-19 16:54:32 +02:00
DavHau
1215fff66b readme: fix typo 2022-05-19 16:07:34 +02:00
Yusuf Bera Ertan
ce73e1a256
fix(rust/builders): change a null default to a string default so hasPrefix doesnt error 2022-05-18 22:52:12 +03:00
DavHau
2cdf24dfb7
Merge pull request #147 from yusdacra/main
Follow up fixes for #144
2022-05-18 20:49:16 +02:00
DavHau
523b19fa0e fix escaping problem in tests-examples 2022-05-18 20:45:26 +02:00
DavHau
b5d473e2e8 tests-examples: allow passing arguments 2022-05-18 20:42:05 +02:00
Yusuf Bera Ertan
1bfa39b68e
fix(translator/cargo-toml): fix comment, actually inherit options from cargo-lock 2022-05-18 19:16:07 +03:00
Yusuf Bera Ertan
00bef62ae7
fix(rust/builders): remove IFD while using writeCargoLock 2022-05-18 19:13:40 +03:00
Yusuf Bera Ertan
a4c4b64bd7
fix(examples): remove dream-lock.json files from git 2022-05-18 19:10:31 +03:00
Yusuf Bera Ertan
2fd96e44e9
feat: implement cargo-toml impure translator for rust subsystem (#144) 2022-05-18 09:21:56 +03:00
DavHau
ed9f030be9 example tests: run all tests despite error 2022-05-17 20:12:26 +02:00
DavHau
ad48c2134c Merge remote-tracking branch 'jaen/resolve-path-sources-relative-to-source-root' 2022-05-17 20:11:55 +02:00
DavHau
0ace4f5e05
fix src/fetchers/default-fetcher.nix 2022-05-17 20:11:32 +02:00
DavHau
bb5be4955d fix typo in builder template 2022-05-17 19:31:47 +02:00
DavHau
4f1b483239 improve testing examples: fail on error 2022-05-17 13:56:08 +02:00
DavHau
db19f7c07a add path-example for nodejs 2022-05-17 12:57:57 +02:00