39 Commits

Author SHA1 Message Date
Victor Savkin
fe846882aa
chore(repo): update repo to 13.10 (#9497) 2022-03-24 12:21:07 -04:00
Victor Savkin
d4b5c30eba
cleanup(core): remove the indirection left after inlining ta… (#9469) 2022-03-23 22:18:17 -04:00
Sorin Davidoi
75f9ece440
fix(core): don't allow arbitrary code execution when manipulating cache (#9329)
The Node documentation for `exec` states:

> Never pass unsanitized user input to this function. Any input containing shell metacharacters may be used to trigger arbitrary command execution.

The `folder` variable comes directly from the `NX_CACHE_DIRECTORY` environment variable (or from `nx.json`). Careful crafting of this variable can result in NX executing arbitrary commands.

This patch fixes this by using `execFile`, which does not spawn a shell.
2022-03-18 16:19:12 -04:00
Victor Savkin
6f038e7a4a feat(core): reorganize packges to consolidate all cli-related code in nx 2022-03-14 16:42:51 -04:00
Victor Savkin
51b90435b3
fix(core): fix cache for directory outputs (#8756)
Only use parent directory for outputs if output is a file. Closes #8504.
This bug has been caused by 16e9f58f76.

Co-authored-by: skrtheboss <denisfrenademetz97@gmail.com>
2022-01-28 16:30:14 -05:00
Phillip Barta
f94d3dad2a
fix(core): use fs/promises instead of promisifying with the util module (#8530)
* fix(core): use fs/promises instead of promisifying with the util module

* chore(core): use path exists instead of existsSync

Co-authored-by: Jason Jean <jasonjean1993@gmail.com>
2022-01-28 15:53:08 -05:00
Victor Savkin
fd3673df7a feat(core): separate local and remote cache statuses 2022-01-12 13:18:57 -05:00
Victor Savkin
75cc52fd48 fix(core): change default folder for daemon assets to cache dir 2022-01-10 16:54:12 -05:00
Victor Savkin
16e9f58f76 feat(core): optimise cache restoration and storing 2022-01-10 11:40:10 -05:00
Fabian
65f6c0d562
fix(core): fix single file outputs cache regression (#7355) 2021-10-15 11:00:59 -04:00
Jason Jean
3520d7fd48
fix(core): handle failures writing to the cache (#7349) 2021-10-15 10:31:45 -04:00
Victor Savkin
b79072a5ae feat(core): parallelize cache restoration 2021-10-04 16:55:41 -04:00
Minijus L
ae7361c0aa
fix(core): gracefully handle errors when writing the latest output hash cache files (#6959)
* fix(core): wrap writing cache hash into try/catch

Instead of failing the task run process it will allow the process to continue.

Fixes of #6957

* fix(core): ignore errors writing latest output hash cache files

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2021-10-01 17:02:38 +01:00
Kirils L
d53e25a611
fix(core): caching individual files (#6445) 2021-07-21 12:15:31 -04:00
Miroslav Jonaš
8ab463e386
cleanup(core): replace deprecated usage of appRootPath (#6241)
* cleanup(core): replace deprecated usage of appRootPath

* cleanup(core): revert migration changes
2021-07-05 15:51:19 -04:00
Kirils L
e7a1cd2c91
fix(core): make missing output check more comprehensive (#6204) 2021-07-01 16:00:24 -04:00
Jason Jean
8ac7519ada feat(core): introduce batch executors 2021-06-28 14:46:53 -04:00
Jason Jean
235725b585
cleanup(core): refactor process forking out of task orchestrator (#6037) 2021-06-18 10:26:05 -04:00
Leosvel Pérez Espinosa
b388c1ed81
cleanup(core): copy from cache only when needed (#5464) 2021-04-27 12:02:06 +01:00
Phillip Barta
c0ce1ce65e
cleanup(core): normalized usage of fs-extra and updated fs-extra to 9.1.0 (#5199)
* cleanup(core): normalized usage of fs-extra and updated fs-extra

* cleanup(misc): use fs over fs-extra when possible

Co-authored-by: Jason Jean <jasonjean1993@gmail.com>
2021-04-22 12:52:52 -04:00
vsavkin
05f2f94543 Revert "cleanup(core): copy from cache only when needed"
This reverts commit c4967fa462d79e05f1c0eb536e02f5fe5e1abd88.
2021-04-21 15:09:19 -04:00
Leosvel Pérez Espinosa
c4967fa462 cleanup(core): copy from cache only when needed 2021-04-19 16:14:19 -04:00
vsavkin
f89cf4a14b feat(core): cache task failures 2021-04-14 14:49:46 -04:00
Jason Jean
2319dc36dc Revert "cleanup(core): copy from cache only when needed"
This reverts commit 4dac0a21228977379e5d794343390181e8e84759.
2021-04-14 13:20:31 -04:00
Leosvel Pérez Espinosa
4dac0a2122 cleanup(core): copy from cache only when needed 2021-04-06 12:18:10 -04:00
Victor Savkin
a25e081a84 feat(core): remove angular devkit deps 2021-01-25 12:52:30 -05:00
Victor Savkin
ce877bb8ad fix(core): store nx results and nx deps in the configured cache directory 2020-12-19 20:50:53 -05:00
Tasos Bekos
e03d7d56c1 cleanup(core): avoid referencing node_modules 2020-09-28 11:48:37 -04:00
Kyle Bastien
b548f1a759 feat(core): adds ability for outputs to be files and not just folders
Makes the cache put code slightly more flexible, which allows for specified outputs to be not
just
folder but also files. This allows for greater flexibility of control when it comes to which
files
you want Nx to cache, so you could exclude sub folders of your dist. This is useful so that
Nx
doesn't spend time copying sometimes complex folder structures to cache (i.e. node_modules in
the
case of using npm link).
2020-09-14 14:15:25 -04:00
Victor Savkin
acf92e4e2b fix(core): handle empty list of cacheable targets 2020-06-08 11:25:04 -04:00
Victor Savkin
606ad29b93 feat(core): support other targets but build that require strict ordering 2020-05-30 00:06:03 -04:00
Victor Savkin
690be207be fix(misc): several misc fixes 2020-05-28 15:02:06 -04:00
Jason Jean
e06822da7e
chore(repo): update prettier to v2 (#2934)
this is just for the repo, and not the workspace

Co-authored-by: Rares Matei <matei.rar@gmail.com>
2020-04-29 01:09:37 -04:00
Victor Savkin
b780a1b585 feat(core): switch to use tasks-runner-v2 by default 2020-03-09 12:01:20 -04:00
Victor Savkin
ed2259b5f1 feat(core): hash tasks in run commands 2020-01-19 16:19:23 -05:00
Victor Savkin
840f49943e fix(core): make command caching work with earlier versions of node 2020-01-15 21:06:42 -05:00
Victor Savkin
f84c55d5aa feat(core): remove old cache records 2020-01-10 08:04:55 -05:00
Victor Savkin
c3fdf2e702 feat(core): running one task uses the same tasks runner as run-many 2020-01-09 12:07:41 -05:00
Victor Savkin
d2d9f1cca0 feat(core): implement caching 2020-01-01 10:51:58 -05:00