ts_next.conf 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. TS_NEXT_CONFIG_PATH=next.config.js
  2. TS_NEXT_COMMAND=build
  3. ### @usage: TS_NEXT_CONFIG(ConfigPath)
  4. ###
  5. ### Macro sets the config path for TS_NEXT module.
  6. ###
  7. ### - ConfigPath - config path. Default value: next.config.js
  8. ###
  9. ### Documentation: https://docs.yandex-team.ru/frontend-in-arcadia/references/TS_NEXT#ts-next-config
  10. macro TS_NEXT_CONFIG(ConfigPath) {
  11. SET(TS_NEXT_CONFIG_PATH $ConfigPath)
  12. }
  13. TS_NEXT_OUTPUT_DIR=.next
  14. ### @usage: TS_NEXT_OUTPUT(DirName)
  15. ###
  16. ### Macro sets the output directory name for TS_NEXT module.
  17. ###
  18. ### - DirName - output directory name. Default value: .next.
  19. ###
  20. ### Documentation: https://docs.yandex-team.ru/frontend-in-arcadia/references/TS_NEXT#ts-next-output
  21. macro TS_NEXT_OUTPUT(DirName) {
  22. SET(TS_NEXT_OUTPUT_DIR $DirName)
  23. }
  24. macro TS_NEXT_EXPERIMENTAL_COMPILE() {
  25. SET(TS_NEXT_COMMAND experimental-compile)
  26. }
  27. TS_NEXT_CMD=$TOUCH_UNIT \
  28. && $_TS_FILES_COPY_CMD \
  29. && $ADD_VCS_INFO_FILE_CMD \
  30. && $NOTS_TOOL $NOTS_TOOL_BASE_ARGS build-next $NOTS_TOOL_COMMON_BUILDER_ARGS \
  31. --ts-next-command ${TS_NEXT_COMMAND} \
  32. --bundler-config-path ${input:TS_NEXT_CONFIG_PATH} \
  33. --output-dirs ${TS_NEXT_OUTPUT_DIR} \
  34. $_NODE_MODULES_INOUTS ${hide:PEERS} \
  35. ${input;hide:"package.json"} ${TS_CONFIG_FILES} $_AS_HIDDEN_INPUTS(IN $TS_INPUT_FILES) \
  36. ${output;hide:"package.json"} \
  37. ${requirements;hide:"cpu:2"} \
  38. ${kv;hide:"pc magenta"} ${kv;hide:"p TS_NXT"}
  39. ### @usage: TS_NEXT([name])
  40. ###
  41. ### NextJS app, built with `next build`. Requires sources to be under /src folder.
  42. ### /pages and /app on the root level ar not supported.
  43. ### Build results are output.tar.
  44. ###
  45. ### Documentation: https://docs.yandex-team.ru/frontend-in-arcadia/references/TS_NEXT
  46. ###
  47. ### @example
  48. ###
  49. ### TS_NEXT()
  50. ### END()
  51. ###
  52. multimodule TS_NEXT {
  53. module BUILD: _TS_BASE_UNIT {
  54. .CMD=TS_NEXT_CMD
  55. .EPILOGUE=_TS_CONFIG_EPILOGUE
  56. .PEERDIRSELF=TS_PREPARE_DEPS
  57. # by default multimodule overrides inherited MODULE_TAG to submodule name (BUILD in this case)
  58. # but we have to set it to TS for include processor to work
  59. SET(MODULE_TAG TS)
  60. SET(MODULE_LANG TS)
  61. _PEERDIR_TS_RESOURCE(next)
  62. DISABLE(TS_CONFIG_DEDUCE_OUT)
  63. DISABLE(TS_CONFIG_USE_OUTDIR)
  64. _TS_CONFIGURE()
  65. SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${CURDIR}/package.json ${CURDIR}/pnpm-lock.yaml ${CURDIR}/${TS_CONFIG_PATH})
  66. _TS_ADD_NODE_MODULES_FOR_BUILDER()
  67. }
  68. module TS_PREPARE_DEPS: _PREPARE_DEPS_BASE {
  69. }
  70. }