diff options
author | zaverden <zaverden@yandex-team.com> | 2024-07-18 21:17:16 +0300 |
---|---|---|
committer | zaverden <zaverden@yandex-team.com> | 2024-07-18 21:27:44 +0300 |
commit | be0dfb42b3e15e4d8ac221200d48a55cead36dd8 (patch) | |
tree | 180249315a1fd25c3fb439ca9b13301b9eb710c0 /build/conf/ts | |
parent | 0a7acacbbb400208d9bfe3610f1f77c38c3c0d7d (diff) | |
download | ydb-be0dfb42b3e15e4d8ac221200d48a55cead36dd8.tar.gz |
feat(npm): build standalone npm module
f944a35c196f6f7b7d93b7d2e9716fcd57f85d9f
Diffstat (limited to 'build/conf/ts')
-rw-r--r-- | build/conf/ts/node_modules.conf | 10 | ||||
-rw-r--r-- | build/conf/ts/ts.conf | 11 | ||||
-rw-r--r-- | build/conf/ts/ts_test.conf | 9 | ||||
-rw-r--r-- | build/conf/ts/ts_tsc.conf | 2 |
4 files changed, 22 insertions, 10 deletions
diff --git a/build/conf/ts/node_modules.conf b/build/conf/ts/node_modules.conf index dc282e6924..7e67059450 100644 --- a/build/conf/ts/node_modules.conf +++ b/build/conf/ts/node_modules.conf @@ -1,5 +1,12 @@ PNPM_ROOT= PNPM_SCRIPT=$PNPM_ROOT/node_modules/pnpm/dist/pnpm.cjs + +NPM_ROOT= +NPM_SCRIPT=$NPM_ROOT/node_modules/npm/bin/npm-cli.js + +PM_SCRIPT= +PM_TYPE= + NPM_CONTRIBS_PATH=contrib/typescript # combined input/outputs records as list of directives ${input;hide:<path>} ${output;hide:<path>}, used in builders _NODE_MODULES_INOUTS= @@ -99,7 +106,8 @@ module _PREPARE_DEPS_BASE: _BARE_UNIT { DISABLE(START_TARGET) # we read pnpm-lock.yaml and package.json during configuration - SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${CURDIR}/pnpm-lock.yaml ${CURDIR}/package.json) + SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${CURDIR}/pnpm-lock.yaml ${CURDIR}/package-lock.json ${CURDIR}/package.json) + _SET_PACKAGE_MANAGER() _PREPARE_DEPS_CONFIGURE() } diff --git a/build/conf/ts/ts.conf b/build/conf/ts/ts.conf index 0556da4cb9..4fb763242b 100644 --- a/build/conf/ts/ts.conf +++ b/build/conf/ts/ts.conf @@ -6,7 +6,6 @@ TS_LOCAL_CLI=no TS_YNDEXING=no # Use outdir defined in tsconfig (actual not for bundlers, they use own way to define output directory) TS_CONFIG_USE_OUTDIR= - NOTS_TOOL=${tool:"devtools/frontend_build_platform/nots/builder"} @@ -29,7 +28,8 @@ NOTS_TOOL_BASE_ARGS=\ --moddir $MODDIR \ --local-cli $TS_LOCAL_CLI \ --nodejs-bin $NODEJS_BIN \ - --pnpm-script $PNPM_SCRIPT \ + --pm-script $PM_SCRIPT \ + --pm-type $PM_TYPE \ --contribs $NPM_CONTRIBS_PATH \ --trace $TS_TRACE \ --verbose $TS_LOG \ @@ -87,7 +87,8 @@ module _TS_BASE_UNIT: _BARE_UNIT { SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${ARCADIA_ROOT}/$ERM_PACKAGES_PATH) # PEERDIR that reads required version of tool from package.json - _PEERDIR_TS_RESOURCE(nodejs pnpm) + _PEERDIR_TS_RESOURCE(nodejs) + _SET_PACKAGE_MANAGER() } # tag:test @@ -124,8 +125,8 @@ TSYNDEXER_CMD=${cwd:ARCADIA_BUILD_ROOT} \ ### _DO_TS_YNDEXING() # internal ### -### Adds a command-node for TS-modules codenavigation indexing. -### Output ydx.pb2 file will be processed along with other indexes for other modules and +### Adds a command-node for TS-modules codenavigation indexing. +### Output ydx.pb2 file will be processed along with other indexes for other modules and ### other languages in ya-bin. ### (see _gen_merge_node, _gen_upload_node in devtools/ya/build/graph.py) for details. ### The macro is called from nots.py plugin in case we have `TS_YNDEXING=yes` flag set. diff --git a/build/conf/ts/ts_test.conf b/build/conf/ts/ts_test.conf index 599121a200..69fef446b5 100644 --- a/build/conf/ts/ts_test.conf +++ b/build/conf/ts/ts_test.conf @@ -38,7 +38,7 @@ module TS_TEST_JEST_FOR: _TS_TEST_BASE { # nots.py will decide if we need to depend on the testing target module output _DEPENDS_ON_MOD() - _PEERDIR_TS_RESOURCE(nodejs pnpm jest) + _PEERDIR_TS_RESOURCE(nodejs jest) _TS_TEST_FOR_CONFIGURE(jest jest.config.js workspace_node_modules.tar) _TS_ADD_NODE_MODULES_FOR_BUILDER() @@ -70,7 +70,7 @@ module TS_TEST_HERMIONE_FOR: _TS_TEST_BASE { TS_TEST_DEPENDS_ON_BUILD() _DEPENDS_ON_MOD() - _PEERDIR_TS_RESOURCE(nodejs pnpm typescript hermione) + _PEERDIR_TS_RESOURCE(nodejs typescript hermione) _TS_TEST_FOR_CONFIGURE(hermione .hermione.conf.js workspace_node_modules.tar) } @@ -103,7 +103,7 @@ module TS_TEST_PLAYWRIGHT_FOR: _TS_TEST_BASE { _DEPENDS_ON_MOD() _TS_ADD_NODE_MODULES_FOR_BUILDER() - _PEERDIR_TS_RESOURCE(nodejs pnpm playwright) + _PEERDIR_TS_RESOURCE(nodejs playwright) _TS_TEST_FOR_CONFIGURE(playwright playwright.config.ts workspace_node_modules.tar) } @@ -126,6 +126,9 @@ module _TS_TEST_BASE: _BARE_UNIT { # parse module args _TS_TEST_FOR_ARGS($MODULE_ARGS_RAW) + # Set PM values from TS_TEST_FOR_DIR + _SET_PACKAGE_MANAGER() + # we don't want to have TS outputs for tests DISABLE(TS_CONFIG_DEDUCE_OUT) } diff --git a/build/conf/ts/ts_tsc.conf b/build/conf/ts/ts_tsc.conf index 6cd4a94290..2052a99ee1 100644 --- a/build/conf/ts/ts_tsc.conf +++ b/build/conf/ts/ts_tsc.conf @@ -35,7 +35,7 @@ multimodule TS_TSC { _TS_CONFIGURE() - SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${CURDIR}/package.json ${CURDIR}/pnpm-lock.yaml ${CURDIR}/${TS_CONFIG_PATH}) + SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${CURDIR}/package.json ${CURDIR}/pnpm-lock.yaml ${CURDIR}/package-lock.json ${CURDIR}/${TS_CONFIG_PATH}) _TS_ADD_NODE_MODULES_FOR_BUILDER() } |