From b12d0ee29c68153bafe766807fa0211c1a566d4b Mon Sep 17 00:00:00 2001 From: alexlavrov Date: Thu, 19 Oct 2023 16:56:37 +0400 Subject: [PATCH] Clean up, add comments, copy bootstrap --- build/pack-all.ts | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/build/pack-all.ts b/build/pack-all.ts index d105931afdea..dcf2c621d9e0 100644 --- a/build/pack-all.ts +++ b/build/pack-all.ts @@ -7,35 +7,44 @@ const INTERNAL_TOOLS_ARTIFACTS = path.join(MONOREPO_ROOT, 'artifacts', 'internal const OUTPUT_DIR = path.join(MONOREPO_ROOT, 'artifacts'); const NPM_OUTPUT_DIR = path.join(OUTPUT_DIR, 'npm'); -sh.mkdir('-p', OUTPUT_DIR); +sh.mkdir('-p', OUTPUT_DIR, NPM_OUTPUT_DIR); const { "devextreme-main": devextremeVersion, devextreme: devextremeNpmVersion } = JSON.parse(sh.exec('npm pkg get version -ws --json').stdout); const MAJOR_VERSION = devextremeVersion.split('.').slice(0, 2).join('_'); +// Prepare metadata sh.cd(MONOREPO_ROOT); sh.exec('npm run tools:discover-declarations'); sh.exec(`npm run tools -- make-aspnet-metadata --version ${MAJOR_VERSION}`); -// Descriptions -const DOCUMENTATION_DIR = path.join(OUTPUT_DIR, 'documentation'); -sh.exec(`git clone -b ${MAJOR_VERSION} --depth 1 --config core.longpaths=true https://github.com/DevExpress/devextreme-documentation.git ${DOCUMENTATION_DIR}`); +// Inject descriptions +const DOCUMENTATION_TEMP_DIR = path.join(OUTPUT_DIR, 'doc_tmp'); +sh.exec(`git clone -b ${MAJOR_VERSION} --depth 1 --config core.longpaths=true https://github.com/DevExpress/devextreme-documentation.git ${DOCUMENTATION_TEMP_DIR}`); -sh.pushd(DOCUMENTATION_DIR); +sh.pushd(DOCUMENTATION_TEMP_DIR); sh.exec('npm i'); sh.exec(`npm run update-topics -- --artifacts ${INTERNAL_TOOLS_ARTIFACTS}`); sh.popd(); +sh.rm('-rf', DOCUMENTATION_TEMP_DIR); + sh.exec('npm run devextreme:inject-descriptions'); sh.exec('npm run build-dist -w devextreme-main'); +// Copy artifacts for DXBuild (Installation) sh.pushd(path.join(MONOREPO_ROOT, 'packages/devextreme/artifacts')); sh.cp('-r', 'ts', OUTPUT_DIR); sh.cp('-r', 'js', OUTPUT_DIR); sh.cp('-r', 'css', OUTPUT_DIR); -// TODO: copy bootstrap from node_modules sh.popd(); +// TODO: maybe we should add bootstrap to vendors +const BOOTSTRAP_DIR = path.join(MONOREPO_ROOT, 'node_modules', 'bootstrap', 'dist'); +sh.cp([path.join(BOOTSTRAP_DIR, 'js', 'bootstrap.js'), path.join(BOOTSTRAP_DIR, 'js', 'bootstrap.min.js')], path.join(OUTPUT_DIR, 'js')); +sh.cp([path.join(BOOTSTRAP_DIR, 'css', 'bootstrap.css'), path.join(BOOTSTRAP_DIR, 'js', 'bootstrap.min.css')], path.join(OUTPUT_DIR, 'css')); + +// Update versions for non-semver builds (daily, alpha and beta) if (devextremeVersion !== devextremeNpmVersion) { sh.exec(`npm run all:bump -- ${devextremeNpmVersion}`); }