ts_next.conf 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. ${kv;hide:"pc magenta"} ${kv;hide:"p TS_NXT"}
  38. ### @usage: TS_NEXT([name])
  39. ###
  40. ### NextJS app, built with `next build`. Requires sources to be under /src folder.
  41. ### /pages and /app on the root level ar not supported.
  42. ### Build results are output.tar.
  43. ###
  44. ### Documentation: https://docs.yandex-team.ru/frontend-in-arcadia/references/TS_NEXT
  45. ###
  46. ### @example
  47. ###
  48. ### TS_NEXT()
  49. ### END()
  50. ###
  51. multimodule TS_NEXT {
  52. module BUILD: _TS_BASE_UNIT {
  53. .CMD=TS_NEXT_CMD
  54. .EPILOGUE=_TS_CONFIG_EPILOGUE
  55. .PEERDIRSELF=TS_PREPARE_DEPS
  56. # by default multimodule overrides inherited MODULE_TAG to submodule name (BUILD in this case)
  57. # but we have to set it to TS for include processor to work
  58. SET(MODULE_TAG TS)
  59. SET(MODULE_LANG TS)
  60. _PEERDIR_TS_RESOURCE(next)
  61. DISABLE(TS_CONFIG_DEDUCE_OUT)
  62. DISABLE(TS_CONFIG_USE_OUTDIR)
  63. _TS_CONFIGURE()
  64. SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${CURDIR}/package.json ${CURDIR}/pnpm-lock.yaml ${CURDIR}/${TS_CONFIG_PATH})
  65. _TS_ADD_NODE_MODULES_FOR_BUILDER()
  66. }
  67. module TS_PREPARE_DEPS: _PREPARE_DEPS_BASE {
  68. }
  69. }