Commit Graph

613 Commits

Author SHA1 Message Date
DavHau
d47b764ef7 refactor: move simpleTranslate2 to dlib 2022-04-23 15:52:46 +02:00
DavHau
60d9308a7b refactor: wrapPureTranslator2 -> wrapPureTranslator 2022-04-23 14:50:17 +02:00
DavHau
3b81f4e35b refactor: translatorsV2 -> translators 2022-04-23 14:48:00 +02:00
DavHau
e8410dc566 fix pure translator template 2022-04-23 13:19:13 +02:00
DavHau
2480581482 change config default for packagesDir: packages -> dream2nix-packages 2022-04-22 22:53:02 +02:00
DavHau
74e8474a21 fix: exclude packagesDir and overridesDirs from invalidationHash 2022-04-22 22:45:35 +02:00
DavHau
890183d2c6 remove more legacy translator code 2022-04-20 17:06:58 +02:00
DavHau
0bd073908f fix typo: aggregates -> aggregated 2022-04-20 16:59:12 +02:00
DavHau
34f1ff3e23 remove deprecated interfaces:
- makeOutputs
- translators.translators
2022-04-20 16:58:38 +02:00
DavHau
feb7eabd0c fixup cargo-lock translator 2022-04-17 14:42:48 +02:00
DavHau
2331a0aa02 fix value is a string error when overriding sources 2022-04-17 14:42:37 +02:00
Yusuf Bera Ertan
2eb9461868
feat: port cargo lock translator to simpleTranslate2 2022-04-16 14:03:33 +03:00
DavHau
25d8bf5125 start moving crago-lock to translator v2 interface 2022-04-15 01:16:32 +02:00
DavHau
e9b336953a Merge branch 'main' into cargo-lock-subpackages 2022-04-15 00:34:25 +02:00
DavHau
8eebb32a52 update translator templates 2022-04-14 23:58:40 +02:00
Yusuf Bera Ertan
07c7d7d2dc
fix: make cargo-lock translator handle discovered project path deps seperately, handle store path source paths correctly 2022-04-12 06:29:49 +03:00
Yusuf Bera Ertan
1cca528ec6
fix(translator/cargo-lock): filter out root member (.) since we already parse this 2022-04-10 17:53:25 +03:00
Yusuf Bera Ertan
aa6099ecf2
feat(translator/cargo-lock): use discoveredProjects to find dependencies that are outside of a packages source 2022-04-10 17:22:58 +03:00
DavHau
e939aa6810 fix: rust source path self reference
fixes #107
2022-04-04 16:55:08 +01:00
DavHau
be7f4f488d rust: fallback to relPath if name not in Cargo.toml 2022-04-04 16:34:23 +01:00
DavHau
ecf409e502 ignore peerDependencies for top level package
fixes #105
2022-04-04 15:40:47 +01:00
DavHau
0bcb6ec0f5 remove .#resolve
(in favor of .#package-name.resolve)

fixes #106
2022-04-04 12:36:45 +01:00
DavHau
0ceb2b95b4 fix: injecting unknown dependency breaks eval
fixes #104
2022-04-04 11:52:34 +01:00
tgunnoe
fb232c8cb0 fix: typo workspaceDependencies 2022-03-30 14:54:14 -04:00
tgunnoe
d019c19164 fix: use name attr before workspace path 2022-03-30 14:54:14 -04:00
DavHau
170a157b1f add comment for filteredRequires in package-lock transl. 2022-03-30 16:46:46 +07:00
DavHau
7afa741704 fix: navigating to relPath in package-json transl. 2022-03-30 16:23:27 +07:00
DavHau
ec30059894 some fixes for package-json and package-lock
- fix missing git & ssh in pacakge-json translator
- package-lock: if dependency missing, raise warning instead of error.
2022-03-30 16:17:55 +07:00
DavHau
f2d40e70cb remove tests-impure 2022-03-28 23:34:56 +07:00
DavHau
502a2fefc5 fix aggregated fetching 2022-03-28 23:20:44 +07:00
DavHau
98ca5ea9bc treat subsystemInfo as translatorArgs 2022-03-28 13:53:06 +07:00
DavHau
489f1ab2c7 remove cli and cli2 2022-03-27 22:40:54 +07:00
DavHau
48439d7e8b rename: lib2 -> lib 2022-03-27 22:32:08 +07:00
DavHau
0593d9d931 remove lib.nix 2022-03-27 22:31:17 +07:00
DavHau
065c283b75 add sourceOverrides to lib2 2022-03-27 21:45:31 +07:00
DavHau
783a64d33a allow selecting builder via lib2 2022-03-27 20:08:22 +07:00
DavHau
c121372991 fix broken format-dream-lock.py 2022-03-25 19:30:46 +07:00
DavHau
6882b06562 fix typo makeFlakeOutpus -> makeFlakeOutputs 2022-03-15 23:24:16 +07:00
DavHau
0ef1821bdc toposort discovered projects to improve selection of main project 2022-03-14 10:15:19 +07:00
DavHau
cd223d4669 python: fix pip translator 2022-03-14 10:14:23 +07:00
DavHau
753452e0fb add discoverer for python 2022-03-14 10:14:01 +07:00
DavHau
e840c50ec7 mark pip translator as experimental 2022-03-13 13:06:58 +07:00
DavHau
07d43c4536 fix python translator + builder 2022-03-13 13:01:20 +07:00
DavHau
c90bcd7389 disable go translator 2022-03-12 23:08:02 +07:00
DavHau
40dedd358a fix: simpleTranslate[2]: filter out store paths 2022-03-12 19:43:46 +07:00
DavHau
38cfc11d5c fix: getRoot trying to resolve root of mainPackage 2022-03-12 19:07:58 +07:00
DavHau
5b1a71c10e add discoverer for rust 2022-03-12 17:51:43 +07:00
DavHau
1fbd29bc66 introduce dlib.construct for safe object cosntruction 2022-03-12 14:38:20 +07:00
DavHau
83c1d872d7
Merge pull request #99 from tgunnoe/git-plus-resolved
fix: parse resolved keys with git+https correctly
2022-03-12 14:15:18 +07:00
tgunnoe
9b1ca860f0 fix: parse resolved keys with git+https correctly 2022-03-11 23:26:56 -05:00
DavHau
5beb65e370 refactor yarn-lock translator 2022-03-10 17:10:21 +07:00
DavHau
d0cfed18e7 add inject for lib2 2022-03-10 17:05:34 +07:00
DavHau
6341f38026 nodejs improvements:
- create passthru.dependencies
- always include peerDeps
- correctly write `location` to dream lock
2022-03-10 14:43:12 +07:00
DavHau
ae169b42ac fix: path of path dependencies not computer correctly 2022-03-10 14:41:29 +07:00
DavHau
3f46f3fad2 fix: count workspaces as dependencies 2022-03-10 14:01:18 +07:00
DavHau
5e8758f22d yarn-lock transaltor fixes
- pick correct lock file fo nested workspaces
- add workspaces to dependencies
2022-03-10 14:00:35 +07:00
DavHau
bac2e77dbf resolve: don't write empty json on failure 2022-03-10 13:58:48 +07:00
DavHau
6b015ff9f5 fixup formatting issues 2022-03-07 18:06:28 +07:00
DavHau
076a1c9aff treewide: format with alejandra 1.0.0
closes #84
2022-03-07 18:06:18 +07:00
DavHau
7641236307
Merge pull request #97 from yusdacra/rust/crane-fixes
fix(rust): dont use hardcoded CARGO_HOME to /build
2022-03-07 17:02:54 +07:00
DavHau
058bc6cf9b dix dream-lock formatting in makeTranslateScript 2022-03-07 11:30:33 +07:00
Yusuf Bera Ertan
09552b21ba
fix(rust): dont use hardcoded CARGO_HOME to /build 2022-03-06 17:19:39 +03:00
DavHau
dac0e8dba9 always export resolveImpure attribute 2022-03-06 00:56:53 +07:00
DavHau
0ce62ee50a
Merge pull request #96 from yusdacra/rust/crane-fixes
fix(rust): fix source replacement config write for crane
2022-03-06 00:43:28 +07:00
DavHau
90649d117a fix invalidationHash logic + remove .#resolve messages 2022-03-06 00:38:06 +07:00
Yusuf Bera Ertan
6895578bea
fix(rust/crane): make crane main build drv only build the package we want to build 2022-03-05 20:29:22 +03:00
Yusuf Bera Ertan
2494b772e2
fix(rust): fix source replacement config write for crane
also make it so that buildRustPackage and crane builder both use same CARGO_HOME
for more consistency
2022-03-05 20:16:31 +03:00
DavHau
77763c957e feature: add new dream-lock.json files to git 2022-03-06 00:05:13 +07:00
DavHau
bc3c3820b0 fix fallback on existing dream-lock.json 2022-03-05 23:55:42 +07:00
DavHau
924bb494e6 feature: nix run .#resolveImpure 2022-03-05 23:34:09 +07:00
DavHau
1878b8f247 feature: add .resolve to every package 2022-03-05 18:44:01 +07:00
DavHau
e7f65555cb translator v2 iface to accept only one project 2022-03-05 16:17:14 +07:00
DavHau
4828105acb translateProjects: return resolved projects 2022-03-05 15:13:48 +07:00
DavHau
b97b84f943 rename: resolveProjectsFromSource -> translateProjects 2022-03-05 14:48:17 +07:00
DavHau
f8f37dd50e lib2: enable packageOverrides 2022-03-05 14:29:55 +07:00
DavHau
6d4b62be79 fix: error on non-top-level workspace roots 2022-03-05 11:42:56 +07:00
DavHau
2a696e7198 nodejs: filter projects duric dicovery 2022-03-05 10:49:43 +07:00
DavHau
16f3667c2c expose cli2 2022-03-04 21:31:43 +07:00
DavHau
b1b80111d2 automatically add dreamLockPath to discovered projects 2022-03-04 21:24:47 +07:00
DavHau
017b2e0144 WIP: cli2 init 2022-03-04 20:45:43 +07:00
DavHau
c7411e67be fix: hashPath and hashFile missing nix options 2022-03-04 20:45:33 +07:00
zimbatm
46dd1ab167
use one nixpkgs instance
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
2022-03-04 13:26:16 +01:00
DavHau
848c424c03 fix: don't error out on impure unresolved projects 2022-03-03 15:58:07 +07:00
DavHau
2b6bcb7b75 add settings argument to lib2.makeFlakeOutputs 2022-03-03 15:48:30 +07:00
DavHau
29741906b2 Handle edge cases with npm workspaces:
- 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
2022-03-02 19:00:09 +07:00
DavHau
5b8a09c764 nodejs: execute npm run build on all workspace packages 2022-03-02 16:03:23 +07:00
DavHau
193b852534 yarn-translator: enable workspace support 2022-03-02 15:33:54 +07:00
DavHau
07a2e7cd9f fixes for yarn-lock translator 2022-03-02 12:44:12 +07:00
DavHau
54b9d1a61e fix: single file lookup via prepareSourceTreeInternal 2022-03-02 12:43:46 +07:00
DavHau
95c6595165 yarn-lock translator: use simpleTranslate2 2022-03-02 12:05:43 +07:00
DavHau
97c75df083 introduce simpleTranslate2
This is a refined interface improving upon simpleTranslate
2022-03-02 12:05:15 +07:00
DavHau
ff01488c42 update yarn-lock translator to v2 interface (no workspaces yet) 2022-03-01 17:56:42 +07:00
DavHau
021e1ef928 factor out some funcs from package-lock -> nodejsUtils 2022-03-01 15:57:20 +07:00
DavHau
1fc9998b0f add flake output projectsJson 2022-03-01 14:21:26 +07:00
DavHau
89a0c4f4c3 handle empty yarn.lock correctly 2022-03-01 13:47:01 +07:00
DavHau
e075f98a90 fix: externalDir not copied to store 2022-02-28 12:11:55 +07:00
DavHau
958bdd6699 Squashed commit of the following:
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)
2022-02-28 11:25:39 +07:00
DavHau
e12bc2fef3 fix: no effect when passing builder to makeFlakeOutputs 2022-02-27 23:59:16 +07:00
DavHau
6cf61ee767 allow selecting builder in makeFlakeOutputs 2022-02-27 23:33:10 +07:00
DavHau
70f30b6eef fix bug: package-lock translator not detecting devDependencies 2022-02-27 19:48:17 +07:00
DavHau
7ff0d5d0e8 add field _generic.location to dream-lock 2022-02-27 19:06:38 +07:00
DavHau
6fb2ec0e6a imrpove nodejs discovery
- use dream-lock transaltor for packages without any dependencies
- scan sub-directories of non-project dirs
2022-02-27 18:46:38 +07:00
DavHau
d76407b4cd expose project discovery via lib2 2022-02-27 17:26:13 +07:00
DavHau
c470172eea improve realizeProjects & resolveProjectsFromSource 2022-02-27 17:25:24 +07:00
DavHau
6a232399ad improve error handling when invalid args passed 2022-02-27 15:48:05 +07:00
DavHau
ed9bdd2fa2 small fixes in translators and resolving 2022-02-27 15:37:09 +07:00
DavHau
d8d0856c96 replace transl. package-lock with package-lock2 2022-02-27 15:36:25 +07:00
DavHau
14954c7d14 init translatorV2 downwards compatibility 2022-02-27 14:07:51 +07:00
DavHau
0ba71a6d1b fix bug when no workspaces in package.json 2022-02-27 00:50:57 +07:00
DavHau
a9f9eaad2a move some more funcs from utils to dlib 2022-02-27 00:50:15 +07:00
DavHau
79a8805656 filter projects in package-lock2 translator 2022-02-26 20:52:55 +07:00
DavHau
cca2b5c402 introduce realizeProjects 2022-02-26 20:52:26 +07:00
DavHau
35af8a5801 fix getNodeFromPath edge cases 2022-02-26 20:50:44 +07:00
DavHau
fa4998d1f4 nodejs builder: export all packages from dream-lock 2022-02-26 20:49:57 +07:00
DavHau
838db1097e make V1 translators V2 comaptible 2022-02-26 10:59:06 +07:00
DavHau
4cb3b20aae proejctRoot default value -> null 2022-02-26 10:57:22 +07:00
DavHau
b1872eb866 fixup resolveAllProjects 2022-02-26 00:54:52 +07:00
DavHau
8fbd1d51a9 fix output of package-lock2 translator 2022-02-25 21:38:08 +07:00
DavHau
57bc7e9c41 WIP: init resolveAllProjects 2022-02-25 21:36:15 +07:00
DavHau
025c4d059f refactor makeOutputs: init makeOutputsForDreamLock 2022-02-25 18:35:13 +07:00
DavHau
0c7e66d79a refactor translators: introduce all 2022-02-25 16:44:48 +07:00
DavHau
5004d7eb5a move parsing helpers from utils to dlib 2022-02-25 16:40:02 +07:00
DavHau
fdaf0589d5 init: package-lock2 translator 2022-02-25 15:11:32 +07:00
DavHau
2afaae4f5b fix and improve prepareSourceTree 2022-02-25 15:11:15 +07:00
DavHau
42507e645c remove dreampkgs reference from readme 2022-02-25 12:52:44 +07:00
DavHau
82389dc014 nodejs builder: only export main package 2022-02-25 12:43:44 +07:00
DavHau
fb8928ae0a implement project discoverer for nodejs 2022-02-25 11:03:50 +07:00
DavHau
afcf7158ae implement projectName for most translators 2022-02-23 19:59:25 +07:00
DavHau
10bbe80f13 refactor: tlib -> dlib.translators 2022-02-23 19:25:52 +07:00
DavHau
b78958849d remove dependency nix-parsec 2022-02-23 19:12:33 +07:00
DavHau
ae3172315e new yarn parser (supports yarn2) 2022-02-23 19:06:08 +07:00
DavHau
6a46a26700 extend translator templates with projectName 2022-02-23 17:40:19 +07:00
DavHau
485eb0be73 feature: allow omitting pname on makeFlakeOutputs 2022-02-23 17:35:01 +07:00
DavHau
7e78d8b37b move some translator funcs to system independent lib 2022-02-23 16:51:47 +07:00
DavHau
8f2fd2afed rename: compatiblePaths -> compatible 2022-02-23 15:29:53 +07:00
DavHau
02eb4a1cf4 refactor: source instead of inputDirectories/Files 2022-02-23 15:26:34 +07:00
DavHau
b4fef5baf0 make some translator functions system independent
- introduce `dlib` - system independent lib
- refactor all translators, to make functions extraArgs and conpatiblePaths system independent
2022-02-23 14:59:42 +07:00
DavHau
3e19b05b9a fix: sourceOverrides not applied to path sources 2022-02-23 12:15:27 +07:00
DavHau
59754b406d nodejs: fix 2 bugs in granular builder
1. package.json dependencies can be a list
2. bin symlinking for namespace packages
2022-02-23 12:13:50 +07:00
DavHau
d19ec4932b fix --no-default-nix description 2022-02-23 12:11:25 +07:00
DavHau
195d0a7e03 fix bug when translatorArgs contained integer 2022-02-22 21:00:40 +07:00
DavHau
a1449936ff fix projectRoot config missing 2022-02-22 20:24:53 +07:00
DavHau
767db79095 raname: riseAndShine -> make[Flake]Outputs 2022-02-22 20:21:33 +07:00
DavHau
d8300cb909 Always build from dream-lock.json if exists
- add an invalidationHash to dream-lock.json
- always evaluate dream-lock.json if exists
- warn user if dream-lock.json doesn't exist
2022-02-22 18:23:49 +07:00
DavHau
ba967fcbe0 remove (most) interactivity of CLI 2022-02-22 15:10:01 +07:00
DavHau
2772c26105 integrate impure translation with flakes
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.
2022-02-22 15:04:16 +07:00
Yusuf Bera Ertan
129134fcd3
fix(rust): don't vendor path deps, handle git dep configs more correctly, handle cyclic deps correctly 2022-02-20 12:16:09 +03:00
Yusuf Bera Ertan
947fb621a8
fix(rust): write cargo checksum for path dependencies 2022-02-10 20:30:26 +03:00
DavHau
2167b7e993 fix bug in rust packages structure 2022-02-10 12:47:58 +07:00
DavHau
04901e48d2 update dream-lock.example for rust subsystem 2022-02-10 11:44:50 +07:00
DavHau
4f35c7b633 rust translator/builder to use dream-lock packages 2022-02-10 11:43:14 +07:00
DavHau
f634038bbf WIP - adapt code to dream lock changes 2022-02-10 11:43:14 +07:00
DavHau
28c29947cd dream-lock structure changes
remove fields:
 - translator
 - translatedBy
 - mainPackageName
 - mainPackageVersion
add fields:
 - defaultPackage
 - packages
2022-02-10 11:43:14 +07:00
DavHau
ea3d1a2ac1 simplify example flake.nix
fixes a bug where a source tree input was interpreted as a laoded dream-lock
2022-02-09 15:13:49 +07:00
DavHau
817f4d3ba0 package-json transl.: add arg 'npmArgs' 2022-02-04 13:40:56 +07:00
Yusuf Bera Ertan
405e63e941
feat: throw an error in getSourceSpec if the requested dep doesnt exist 2022-01-16 13:00:53 +03:00
Yusuf Bera Ertan
2477a55fbb
fix(rust): put relative paths instead of store paths in lockfile for path deps 2022-01-16 12:56:54 +03:00
Yusuf Bera Ertan
e8c4baf602
feat(rust): use script instead of nix code to find crate paths 2022-01-16 12:56:54 +03:00
Yusuf Bera Ertan
3c6af2acbf
feat(rust): remove git deps from subsystem attrs, use getSourceSpec instead 2022-01-16 12:56:54 +03:00
Yusuf Bera Ertan
c9ea0f7c13
feat: add getSourceSpec 2022-01-16 12:56:54 +03:00
Yusuf Bera Ertan
1d8fc17b93
feat(rust): extend the dream.lock.example.json for the subsystem 2022-01-16 12:56:54 +03:00
Yusuf Bera Ertan
5d18abcdab
fix(rust): write cargo-checksum for vendored git dependencies
fix(rust): copy sources instead of symlinking so we can write cargo checksum

feat(rust): add trace for is git

feat(rust): add trace for is git

feat(rust): add trace for git deps

feat(rust): add trace for git deps

fix(rust): use findFirst not findSingle for finding git dep

fix(rust): remove is git trace

refactor(rust): remove unused code
2022-01-16 12:56:54 +03:00
Yusuf Bera Ertan
901f8a4fc8
fix(rust): pass git dependency parsed information to builders, generate cargo config for git dependencies
fix(rust): fix infinite recursion caused by same name

fix(rust): split gitDeps, generate vendor entries properly

fix(rust): fix infinite recursion in builder

fix(rust): apply git source type to generated vendor entries after applying replace-with

fix(rust): don't overwrite cargo config with generated entries
2022-01-16 12:56:54 +03:00
Yusuf Bera Ertan
e5e88a03b5
feat(rust): workaround git dependencies that are in a workspace by locating the crate source more accurately
fix(rust): copy over findCratePath to builder

fix(rust): correct getAllFiles usage
2022-01-16 12:56:54 +03:00
Yusuf Bera Ertan
f380a81016
fix(rust): dont use src.name
feat(rust): add trace to builder
2022-01-16 12:56:54 +03:00
Max
2132262d5c yarn-lock: allow empty quoted strings 2022-01-13 19:34:36 +01:00
Tom Bereknyei
d2143bb96d Parse unquoted strings in yarn.lock
Sometimes there will be unquoted strings (eg: latest) in dependecy
positions. They are resolved elsewhere but results in a parse error.
2022-01-10 11:03:52 -05:00
DavHau
e69cb52ab0 nodejs builder+translator improvements 2021-12-22 17:31:37 +01:00
DavHau
792deb6a6b feature: CLI: add --sub-dirs flag to enable recursive package transaltion 2021-12-22 17:28:34 +01:00
DavHau
72e73fa255 bugfix: unable to parse tsconfig with comments 2021-12-19 17:06:44 +01:00
DavHau
013dc86524 improve electron support 2021-12-19 14:39:33 +01:00
DavHau
a08f5eb25a merge dev 2021-12-11 11:12:52 +07:00
DavHau
8934508e66 refactor simpleTranslate 2021-12-11 09:13:26 +07:00
DavHau
6a96f26e14 nodejs builder: support electron apps 2021-12-11 09:07:14 +07:00
DavHau
dafda69911 add.py: imporve handling+naming of subpackages 2021-12-11 09:05:59 +07:00
DavHau
87b6959039 fix updating packages + add test 2021-12-09 15:47:08 +07:00
DavHau
728677b654 nodejs package-json: improve + add arguments 2021-12-09 14:46:12 +07:00
DavHau
ed08f9e24c fix fetchers: npm, pypi 2021-12-09 12:55:32 +07:00
DavHau
d608742406 fix: yarn-lock translator 2021-12-08 23:29:09 +07:00
DavHau
1358e1a303 always use internal overrides 2021-12-08 23:18:21 +07:00
DavHau
12c9f565aa nodejs: use package name set via CLI 2021-12-08 23:18:21 +07:00
DavHau
c441eabbb8 make nodejs configurable 2021-12-08 23:18:21 +07:00
Yusuf Bera Ertan
0e236db189
fix(build-rust-package): use produceDerivation to apply overrides to the resulting package(s) 2021-12-03 07:40:55 +03:00
DavHau
d3a279875e feature: support multiple packages per source 2021-12-02 14:15:40 +07:00
DavHau
133b2d0093 fix shortcuts + pname, version handling 2021-11-30 12:36:49 +07:00
Yusuf Bera Ertan
0903f5ea43
feat: pass version and pname to fetchers (#60)
* feat: pass version and pname to fetchers, adjust schema for new behaviour

* fix: name -> pname

* refactor: move override warning to simpleTranslate, flatten dependencyInfo
2021-11-30 12:20:27 +07:00
DavHau
c5126b2053 feature: installMethod copy 2021-11-29 18:44:30 +07:00
Yusuf Bera Ertan
bfcd5b6f35
feat: cargo lock translator, rust builder (#59) 2021-11-29 18:34:53 +07:00
DavHau
fb42313192 bugfix add.py 2021-11-24 09:44:43 +07:00
DavHau
b8dc44d0f2 feature: translate subdir of source via ?dir=foo 2021-11-24 08:50:05 +07:00
DavHau
9d2d385273 test nix funcs with pytest via nix_ffi.py 2021-11-20 11:34:04 +07:00
DavHau
5ad6855226 fix: aggregated fetching 2021-11-18 12:09:14 +07:00
DavHau
553d29724f bugfixes: fixes #54, fixes #55
- add package vie http URL
- create default.nix for debugging
- package-lock parse `npm:` reference
2021-11-18 11:33:24 +07:00
DavHau
4cf80a1460 add test for aggregated fetching: github source 2021-11-17 17:40:09 +07:00
DavHau
e99487cee9 rename sourcesCombinedHash -> sourcesAggregatedHash 2021-11-17 17:12:02 +07:00
DavHau
97e2fef121 fix & improve aggregated source fetching 2021-11-17 17:09:25 +07:00
DavHau
87157ecc8b fix NIX_PATH impurity in writePureShellScript 2021-11-17 12:18:22 +07:00
DavHau
b4b7435ca3
Merge branch 'dev' into go 2021-11-17 11:28:22 +07:00
DavHau
3b5b9096e1 hercules ci + improvements
- yarn-lock: add nodejs version argument
 - add impure tests
 - add ci.nix for hercules
2021-11-17 11:23:31 +07:00
Akshat Agarwal
ff9e30b242 add go support using gomod2nix
Co-authored-by: DavHau <hsngrmpf+github@gmail.com>
2021-11-16 23:28:05 +05:30
DavHau
ec63d19cf5 add.py: refactor spaghetti into functions 2021-11-16 17:02:22 +07:00
DavHau
1c31d53605 fix: add packages via git URL + params; fetch submodules 2021-11-16 08:50:00 +07:00
DavHau
079ec025dc nodejs builder: fix executing $buildScript 2021-11-15 18:10:22 +07:00
DavHau
f1e34e0e89 builder API; move override logic into produceDerivation
This should simplify writing builders
2021-11-13 17:41:48 +07:00
DavHau
163db67245 package-lock: handle resolved=false 2021-11-12 21:52:57 +07:00
DavHau
3ec6baf2c4 support parsing github:... URLs 2021-11-12 21:52:32 +07:00
DavHau
def2b8b499 package-lock translator: deal with more weirdnes 2021-11-12 14:34:48 +07:00
DavHau
6d2a9fd95e nodejs buider: fix crash on empty string bin field 2021-11-11 19:08:25 +07:00
DavHau
48af5f0ec1 nodejs builder: just exclude cyclic deps 2021-11-10 14:05:51 +07:00
DavHau
6097051a5f automatically add new packages to git 2021-11-10 13:11:33 +07:00
DavHau
9302d24fc3 add name argument to package-lock translator 2021-11-10 13:11:21 +07:00
DavHau
baa442739f add template and docs for contributing builder 2021-11-08 11:47:15 +07:00
DavHau
791bb7638f pure translator template based on simpleTranslate 2021-11-08 09:44:27 +07:00
DavHau
8f743b24d4 yarn-lock: fix parsing github URL with revision 2021-11-07 23:59:46 +07:00
DavHau
9fc0623a48 nodejs builder: improve phases 2021-11-07 15:18:28 +07:00
DavHau
9ff7a0ab58 CLI improvements
- rename command package -> add
  - improve handling of dream2nix config
  - improve purity of cli execution
  - automatically find git repo root
  - improve package update cli
2021-11-07 15:18:28 +07:00
DavHau
60d89f776f improve flake interfaces and apps
- improve exposing apps for other flakes
  - configure overridesDirs via config
2021-11-07 15:18:28 +07:00
DavHau
39db511926 improve override system
- add utils.satisfiesSemver (from poetry2nix)
  - nix-parsec add LICENSE from https://github.com/nprindle/nix-parsec/issues/5
  - remove builtin overrides (moved to dreampkgs)
2021-11-07 15:18:28 +07:00
DavHau
bccf3b25c7 multiple override dirs, nodejs improvements
- nodejs builder: symlink sub dependencies
  - allow multiple directories with overrides
  - rename app: cli -> dream2nix
2021-11-07 15:18:28 +07:00
DavHau
62317e6501 fix: inject 2021-11-07 15:18:28 +07:00
DavHau
74a2a2351e ask to create default.nix by default 2021-11-07 15:18:14 +07:00
DavHau
a936cf44a5 rename dream.lock -> dream-lock.json 2021-11-04 15:48:40 +07:00
DavHau
a1d0ed99a8 restructure / rename dream-lock attributes 2021-11-04 15:36:12 +07:00
DavHau
c2e9d3adf4 yarn: remove noOptional + improve UI 2021-11-04 15:02:44 +07:00
DavHau
b1cb420434 fixes for yarn translator and node builder 2021-11-03 10:46:02 +07:00
DavHau
aa81800846 fixes and improvements for nodejs
- add system specific dream2nix to flake outputs
   - add more overrides
   - overrides allow regex as key
2021-11-02 15:13:34 +07:00
DavHau
f1662dabe5 cleanup package.json translator 2021-11-01 15:16:39 +07:00
DavHau
4ef9af0f73 add translator.package.json
- update default.nix template
  - add npm to dream lock schema
  - handle empty depedency graph in readDreamLock
2021-11-01 14:42:02 +07:00
DavHau
5a00d557b9 add npm fetcher 2021-11-01 13:48:23 +07:00
DavHau
03ef2e4c7a detect cycles in pure nix 2021-11-01 13:30:37 +07:00
DavHau
2fd7782af4 nodejs: enable dev deps by default 2021-11-01 13:30:37 +07:00
DavHau
6850db9cc4 cli: rename --extra-arg -> --arg 2021-11-01 13:30:37 +07:00
DavHau
c120dbe328 allow passing translatorArgs to riseAndShine 2021-11-01 13:30:31 +07:00
DavHau
8189d77a7e fix unpackging tgz with broken permissions 2021-11-01 10:03:10 +07:00
DavHau
b23e9ef8f3 make output packages flakes compatible
- closes #39
2021-11-01 00:14:36 +07:00
DavHau
cd6095406b split nodejs builder into different phases 2021-10-31 21:43:45 +07:00
DavHau
0d1e36f770 init: dream2nix overrides 2021-10-31 10:38:51 +07:00
DavHau
120b2d0ee0 improve overrides:
- make overrides referenceable
  - automatically detect override functions for attributes
2021-10-30 19:23:55 +07:00
DavHau
d20f318b58 rename several things
- rename fetcher 'fetchurl' -> 'http'
  - rename specialArgs -> extraArgs
  - rename order_dict -> sort_dict
2021-10-29 21:18:58 +07:00
DavHau
52740e8f96 Tests + refactor externls
- add flake checks
  - refactor handling of external sources
  - rename 'dependenciesRemoved' -> 'cyclicDependencies'
2021-10-29 21:18:58 +07:00
DavHau
c4b110bc38 output schema flakes-style 2021-10-29 16:59:56 +07:00
DavHau
607be5f99c nodejs: improve builder
- stop using npm install
  - run postinstall scripts
  - make binaries of direct dependencies available during build
2021-10-29 16:21:42 +07:00
Daniel Thwaites
84a2a606cc
fix typo emtpy → empty 2021-10-29 07:37:21 +01:00
DavHau
c5881e2db1 pass nodeDeps as path 2021-10-28 14:23:53 +07:00
DavHau
9d8292878a stop using string substitutions in installPhase 2021-10-27 14:42:57 +07:00
DavHau
9e2b46edfd improve nodejs builder + bug fixes
- add option `dontNpmInstall`
  - handle package incompatible to platform
  - replace version in package.json on mismatch
  - fix generated versions for github revisions
2021-10-27 13:24:36 +07:00
DavHau
1219a10592 overrides: allow passing functions for attributes 2021-10-27 13:24:36 +07:00
DavHau
d6dc1560cc fix update command 2021-10-26 20:06:43 +07:00
DavHau
99a87ea7cd add getCyclicDependencies to dream-lock interface 2021-10-26 19:46:55 +07:00
DavHau
1cbc64fe73 nodejs: never execute scripts on installation 2021-10-26 19:29:19 +07:00
DavHau
f49f05e943 improve nodejs builders and translators
- add buildPackageWithOtherBuilder helper
  - do not delete cyclic dependencies by default
  - always delete devDependencies in package.json
  - fix handling of source type `path`
  - yarn-lock: handle missing name
  - update utils.dreamLock interface
  - add `createMissingSource` capability to simpleTranslator
2021-10-26 15:25:35 +07:00
DavHau
70cf6c2723 new builder interface:
- dream lock interface via utils.readDreamLock
  - improve granular builder for nodejs
  - support fetching urls with sha1 hash
  - add jsonschema for source type path
2021-10-23 18:50:36 +07:00
DavHau
9ac7e462f3 improve granular nodejs builder 2021-10-22 23:10:14 +07:00
DavHau
b79343b398 finalize conditional overrides 2021-10-22 23:05:20 +07:00
DavHau
8a5108a602 fix combined hashing mode 2021-10-22 16:29:29 +07:00
DavHau
72c435b8a8 yarn-lock: use git fetcher instead of github 2021-10-22 15:55:45 +07:00
DavHau
38f1725a24 fix dream-lock-schema.json 2021-10-22 15:52:20 +07:00
DavHau
68f38ac988 remove option allowBuiltinFetchers 2021-10-22 15:52:06 +07:00
DavHau
055102e698 use utils.writePureShellScript for all translators 2021-10-22 14:56:56 +07:00
DavHau
6a4a1da0f1 refactor dream.lock sources structure:
- now accessed like sources.{name}.{version}
2021-10-22 14:29:38 +07:00
DavHau
3cbac60c4d add: support git URLs in package-lock parser 2021-10-21 13:45:49 +07:00
DavHau
39b3851ceb fix: extractSource 2021-10-20 21:36:22 +07:00
DavHau
850dc71568 fix python translator+fetcher+builder 2021-10-20 16:39:11 +07:00
DavHau
bf4b807e34 add: update cli app for automatic package update 2021-10-19 00:23:48 +07:00
DavHau
5083a88e4c rename: npmlock2nix -> package-lock 2021-10-18 00:16:13 +07:00
DavHau
99cee262e5 refactor npmlock2nix to use simpleTranslate 2021-10-18 00:15:54 +07:00
DavHau
0867db4b8a move translator yarn-lock-2 -> yarn-lock 2021-10-17 23:08:08 +07:00
DavHau
35a806264f remove old yarn-lock parser 2021-10-17 23:07:18 +07:00
DavHau
353cc807be refine simpleTranslate 2021-10-17 23:03:55 +07:00
DavHau
9677c12e9e add: simpleTranslate helper function for translators 2021-10-17 15:48:32 +07:00
DavHau
7e00121e33 Merge remote-tracking branch 'raghu/main' into dev 2021-10-13 22:52:25 +07:00
DavHau
8ef88fc523 add justBuild (simplified interface) 2021-10-12 23:16:00 +07:00
DavHau
788134d4e8 cli: add option --default-nix 2021-10-12 22:25:06 +07:00
DavHau
7edf7cbf1d granular nodejs builder 2021-10-09 18:33:45 +07:00
DavHau
f7472d096b WIP: conditional overrides 2021-10-09 18:33:19 +07:00
raghuram
441f10fd64 moved specifications folder 2021-10-08 15:29:45 +00:00
raghuram
0ca35d09ad moved src 2021-10-08 15:12:55 +00:00
DavHau
5be5ae49a5 readDreamLock: revert autmatic top-level packages 2021-10-08 11:38:09 +07:00
DavHau
f9752da027 yarn-lock: add flags dev, optional, peer 2021-10-08 11:37:20 +07:00
DavHau
35f9cec8d0 fix github dependency for yarn v1 2021-10-08 00:43:46 +07:00
DavHau
74bff7571b fix: top-lvl deps for package-lock and yarn-lock 2021-10-07 17:07:52 +07:00
DavHau
d5801d1804 bugfix in parseDreamLock 2021-10-07 17:06:09 +07:00
DavHau
d06519bce0 fix parsing CRLF formatted files 2021-10-07 16:25:28 +07:00
DavHau
1c48002dfc fix bugs 2021-10-07 14:38:19 +07:00
happysalada
fb372a0f51 translators: yarn: add parsing of links 2021-10-07 15:07:05 +09:00
DavHau
40d3a3e46b different improvements:
- templating for default.nix
- templates for translators
- fixup nodejs translators
2021-10-07 12:07:28 +07:00
DavHau
e99e002920 Squashed commit of add_yarn_lock:
commit 3415d7f6f834dc3e52cf6898ec02b58ac7df4089
Merge: fca3973 daa71d3
Author: DavHau <hsngrmpf+github@gmail.com>
Date:   Wed Oct 6 10:33:52 2021 +0700

    Merge remote-tracking branch 'happysalada/add_yarn_lock' into dev

commit daa71d3e53
Author: happysalada <raphael@megzari.com>
Date:   Wed Oct 6 00:01:26 2021 +0900

    yarn.lock: initial translator

commit 8f4632ab5e
Author: happysalada <raphael@megzari.com>
Date:   Tue Oct 5 20:52:00 2021 +0900

    translators: add yarn.lock
2021-10-07 11:52:51 +07:00
DavHau
8264abe9c1 remove old cli entry 2021-10-06 10:16:00 +07:00
DavHau
7f19e0662f finalize new CLI 2021-10-06 10:16:00 +07:00
DavHau
66c1ce3c0d add finders for finding new package versions 2021-10-06 10:16:00 +07:00
DavHau
9adf141700 simplify git shortcut + add versionField 2021-10-06 10:16:00 +07:00
DavHau
aa6c0c7027 introduce fetcher modules 2021-10-06 10:16:00 +07:00
DavHau
15ae842a7b WIP revamp cli using cleo 2021-10-06 10:16:00 +07:00
happysalada
1f3b7713a7 fix typo 2021-10-05 16:37:04 +09:00
DavHau
ed145173f5 fix some strings and comments 2021-09-30 01:35:46 +01:00
DavHau
f3444c90f7 add app 'contribute' to initialize templates 2021-09-24 14:19:48 +01:00
DavHau
8d4cf7565a add templates for adding translators 2021-09-23 11:05:25 +01:00
DavHau
e4b9717fa2 fix node2nix builder 2021-09-22 00:30:56 +01:00
DavHau
35eeba24df feature: remove cyclic dependencies 2021-09-20 22:09:14 +01:00
DavHau
f685e44d59 Add builder for nodejs
- python builder support application
- add version to dream.lock
- allowBuiltinsFetchers config option
- node2nix builder
- handle github sources without hash
2021-09-20 20:52:31 +01:00
DavHau
33c7912037 rename: generic lock -> dream lock 2021-09-18 18:08:08 +01:00
DavHau
aa7902a09e improve translators:
- translator flags
  - translatedBy
  - translatorParams
2021-09-18 01:06:48 +01:00
DavHau
d23fb76ef6 feature: sourceOverrides 2021-09-17 13:12:07 +01:00
DavHau
76ae17fc27 support 'unknown' source type 2021-09-17 12:18:39 +01:00
DavHau
042d203237 feature: special arguments for translators 2021-09-17 10:46:03 +01:00
DavHau
7dccfd6e3b separate handling of input files and input dirs 2021-09-16 19:33:31 +01:00
DavHau
b6dfa1dbd4
feature: autoselect translator (#4) 2021-09-16 15:05:31 +01:00
DavHau
a1a3e57e05 add translator: npmlock2nix 2021-09-14 03:00:29 +01:00
DavHau
d83d76d5ef improve handling of translator modules 2021-09-13 18:08:28 +01:00
DavHau
4a00410a2b add support for opt-in FOD fetching
- will ommit storing individual hashes, reducing lock file size
2021-09-11 00:06:48 +02:00
DavHau
72bbad7d9d minor fixes 2021-09-10 10:15:44 +02:00
DavHau
7ef59b51d5 move translator cli to src/apps 2021-09-10 09:44:45 +02:00
DavHau
2ce1ddb6f3 implement UI and examples:
- generic translator CLI exposed as flake app
 - flake app 'install' to install the framework
 - generic fetcher
 - simple translator for python
 - simple builer for python
2021-09-09 23:42:56 +02:00