node_modules.conf 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. PNPM_ROOT=
  2. PNPM_SCRIPT=$PNPM_ROOT/node_modules/pnpm/dist/pnpm.cjs
  3. NPM_ROOT=
  4. NPM_SCRIPT=$NPM_ROOT/node_modules/npm/bin/npm-cli.js
  5. PM_SCRIPT=
  6. PM_TYPE=
  7. # combined input/outputs records as list of directives ${input;hide:<path>} ${output;hide:<path>}, used in builders
  8. _NODE_MODULES_INOUTS=
  9. _YATOOL_PREBUILDER_ARG=
  10. macro _TS_ADD_NODE_MODULES_FOR_BUILDER() {
  11. # Calculate inputs and outputs of node_modules, fill `_NODE_MODULES_INOUTS` variable
  12. _NODE_MODULES_CONFIGURE()
  13. }
  14. _TARBALLS_STORE=__tarballs__
  15. _PREPARE_DEPS_INOUTS=
  16. _PREPARE_DEPS_RESOURCES=
  17. _PREPARE_DEPS_USE_RESOURCES_FLAG=
  18. _PREPARE_DEPS_CMD=$TOUCH_UNIT \
  19. && $NOTS_TOOL $NOTS_TOOL_BASE_ARGS prepare-deps \
  20. --tarballs-store $_TARBALLS_STORE \
  21. $_PREPARE_DEPS_INOUTS \
  22. $_PREPARE_DEPS_RESOURCES \
  23. $_PREPARE_DEPS_USE_RESOURCES_FLAG \
  24. ${hide;kv:"pc magenta"} ${hide;kv:"p TS_DEP"}
  25. # In case of no deps we need to create empty outputs for graph connectivity
  26. _PREPARE_NO_DEPS_CMD=$TOUCH_UNIT \
  27. && $YMAKE_PYTHON ${input:"build/scripts/touch.py"} \
  28. $_PREPARE_DEPS_INOUTS \
  29. ${hide;kv:"pc magenta"} ${hide;kv:"p TS_NODEP"}
  30. module _PREPARE_DEPS_BASE: _BARE_UNIT {
  31. .CMD=_PREPARE_DEPS_CMD
  32. .IGNORED=SRCS FILES TS_FILES COPY_FILE RUN_JAVASCRIPT_AFTER_BUILD
  33. # Propagates peers to related modules
  34. .PEERDIR_POLICY=as_build_from
  35. .NODE_TYPE=Bundle
  36. .INCLUDE_TAG=no
  37. # we have several modules in the same dir (.PEERDIRSELF=TS_PREPARE_DEPS in BUILD)
  38. # we need different names for module identity file
  39. # .fake tells builder to not materialize it in results
  40. SET(MODULE_SUFFIX .prepare_deps.fake)
  41. # .NODE_TYPE=Bundle is required for peers propagation, but it also affects
  42. # how merging of pic/nopic graphs. Here we can override this merging behaviour
  43. SET(MODULE_TYPE LIBRARY)
  44. # define own tag
  45. SET(MODULE_TAG TS_PREPARE_DEPS)
  46. SET(MODULE_LANG TS)
  47. # what modules it can PEERDIR to
  48. SET(PEERDIR_TAGS TS_PREPARE_DEPS)
  49. # do not include it into "results" of graph
  50. DISABLE(START_TARGET)
  51. # we read pnpm-lock.yaml and package.json during configuration
  52. SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${CURDIR}/pnpm-lock.yaml ${CURDIR}/package-lock.json ${CURDIR}/package.json)
  53. _SET_PACKAGE_MANAGER()
  54. _PREPARE_DEPS_CONFIGURE()
  55. }