diff options
author | zaverden <zaverden@yandex-team.com> | 2023-09-06 15:23:45 +0300 |
---|---|---|
committer | zaverden <zaverden@yandex-team.com> | 2023-09-06 15:56:10 +0300 |
commit | ca594624ee938ed5ba30ec19be26320a9e0f9395 (patch) | |
tree | 943326fdccd18f80e21ca878efd0935f10ec7381 /build/conf | |
parent | 18f12f33d1ce1a607a5e12d1d2091d065541159d (diff) | |
download | ydb-ca594624ee938ed5ba30ec19be26320a9e0f9395.tar.gz |
feat(conf): add TS_FILES macro
Diffstat (limited to 'build/conf')
-rw-r--r-- | build/conf/ts/node_modules.conf | 4 | ||||
-rw-r--r-- | build/conf/ts/ts.conf | 11 | ||||
-rw-r--r-- | build/conf/ts/ts_bundle.conf | 1 | ||||
-rw-r--r-- | build/conf/ts/ts_library.conf | 1 | ||||
-rw-r--r-- | build/conf/ts/ts_next.conf | 1 | ||||
-rw-r--r-- | build/conf/ts/ts_vite_bundle.conf | 1 |
6 files changed, 17 insertions, 2 deletions
diff --git a/build/conf/ts/node_modules.conf b/build/conf/ts/node_modules.conf index c56b351d58..5567455cb0 100644 --- a/build/conf/ts/node_modules.conf +++ b/build/conf/ts/node_modules.conf @@ -13,8 +13,8 @@ _NODE_MODULES_CMD=$TOUCH_UNIT && $_NODE_MODULES(IN $_NODE_MODULES_INS OUT $_NODE module _NODE_MODULES_BASE: _BARE_UNIT { .CMD=_NODE_MODULES_CMD - # ignore SRCS macro - .ALIASES=SRCS=_NOOP_MACRO + # ignore SRCS macro, use TS_FILES instead of FILES + .ALIASES=SRCS=_NOOP_MACRO FILES=TS_FILES # Propagates peers to related modules .PEERDIR_POLICY=as_build_from .NODE_TYPE=Bundle diff --git a/build/conf/ts/ts.conf b/build/conf/ts/ts.conf index e34f7d6a19..71d3286fe8 100644 --- a/build/conf/ts/ts.conf +++ b/build/conf/ts/ts.conf @@ -12,6 +12,8 @@ module _TS_BASE_UNIT: _BARE_UNIT { .NODE_TYPE=Bundle # Needed for DEPENDS in tests to choose right submodule from multimodule .FINAL_TARGET=yes + # use TS_FILES instead of FILES + .ALIASES=FILES=TS_FILES # .NODE_TYPE=Bundle is required for peers propagation, but it also affects # how merging of pic/nopic graphs. Here we can override this merging behaviour @@ -42,6 +44,15 @@ macro _TS_CONFIG_EPILOGUE() { _SETUP_EXTRACT_NODE_MODULES_RECIPE(${MODDIR}) } +_TS_FILES_COPY_CMD= + +### TS_FILES(Files...) +### +### Adds files to output as is. Similar to FILES but works for TS build modules +macro TS_FILES(Files...) { + _TS_FILES($Files) +} + @import "${CONF_ROOT}/conf/ts/node_modules.conf" @import "${CONF_ROOT}/conf/ts/ts_bundle.conf" @import "${CONF_ROOT}/conf/ts/ts_library.conf" diff --git a/build/conf/ts/ts_bundle.conf b/build/conf/ts/ts_bundle.conf index a1fbfbe59e..370e5be750 100644 --- a/build/conf/ts/ts_bundle.conf +++ b/build/conf/ts/ts_bundle.conf @@ -4,6 +4,7 @@ WEBPACK_OUTPUT_DIR=bundle WEBPACK_CONFIG_PATH=webpack.config.js TS_BUNDLE_WEBPACK=$TOUCH_UNIT \ + && $_TS_FILES_COPY_CMD \ && $ADD_VCS_INFO_FILE_CMD \ && ${cwd:BINDIR} $NOTS_TOOL bundle-webpack $NOTS_TOOL_BASE_ARGS --webpack-resource $WEBPACK_ROOT \ --moddir $MODDIR --webpack-config ${input:WEBPACK_CONFIG_PATH} --ts-config ${input:TS_CONFIG_PATH} \ diff --git a/build/conf/ts/ts_library.conf b/build/conf/ts/ts_library.conf index 09af139be1..d5675daf29 100644 --- a/build/conf/ts/ts_library.conf +++ b/build/conf/ts/ts_library.conf @@ -2,6 +2,7 @@ TYPESCRIPT_ROOT= TS_CONFIG_PATH=tsconfig.json TS_COMPILE=$TOUCH_UNIT \ + && $_TS_FILES_COPY_CMD \ && ${cwd:BINDIR} $NOTS_TOOL compile-ts $NOTS_TOOL_BASE_ARGS --tsc-resource $TYPESCRIPT_ROOT \ --moddir $MODDIR --ts-config ${input:TS_CONFIG_PATH} --node-modules-bundle $NOTS_TOOL_NODE_MODULES_BUNDLE \ $NODE_MODULES_BUNDLE_AS_OUTPUT ${hide:PEERS} ${input;hide:"./package.json"} ${TS_CONFIG_FILES} \ diff --git a/build/conf/ts/ts_next.conf b/build/conf/ts/ts_next.conf index c660fe0d24..c9158d773c 100644 --- a/build/conf/ts/ts_next.conf +++ b/build/conf/ts/ts_next.conf @@ -5,6 +5,7 @@ TS_NEXT_CONFIG_PATH=next.config.js TS_NEXT_SRC_FILES= TS_NEXT_CMD=$TOUCH_UNIT \ + && $_TS_FILES_COPY_CMD \ && $ADD_VCS_INFO_FILE_CMD \ && ${cwd:BINDIR} $NOTS_TOOL build-nextjs $NOTS_TOOL_BASE_ARGS \ --moddir $MODDIR --nextjs-resource $NEXT_ROOT \ diff --git a/build/conf/ts/ts_vite_bundle.conf b/build/conf/ts/ts_vite_bundle.conf index bd9b5d38d6..74feb6cfd6 100644 --- a/build/conf/ts/ts_vite_bundle.conf +++ b/build/conf/ts/ts_vite_bundle.conf @@ -4,6 +4,7 @@ VITE_OUTPUT_DIR=dist VITE_CONFIG_PATH=vite.config.ts TS_BUNDLE_VITE=$TOUCH_UNIT \ + && $_TS_FILES_COPY_CMD \ && $ADD_VCS_INFO_FILE_CMD \ && ${cwd:BINDIR} $NOTS_TOOL bundle-vite $NOTS_TOOL_BASE_ARGS --vite-resource $VITE_ROOT \ --moddir $MODDIR --vite-config ${input:VITE_CONFIG_PATH} --ts-config ${input:TS_CONFIG_PATH} \ |