From a5a3f7aa61a2892aa3fc00e07c3b02b9463a4bce Mon Sep 17 00:00:00 2001 From: alexlavrov Date: Thu, 19 Oct 2023 17:17:13 +0400 Subject: [PATCH] Fix naming, add "how to use", do not rewrite artifacts dir --- build/{pack-all.ts => build-all.ts} | 2 +- build/{bump-version.ts => update-version.ts} | 5 +++++ package.json | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) rename build/{pack-all.ts => build-all.ts} (98%) rename build/{bump-version.ts => update-version.ts} (83%) diff --git a/build/pack-all.ts b/build/build-all.ts similarity index 98% rename from build/pack-all.ts rename to build/build-all.ts index dcf2c621d9e0..a819c10b9942 100644 --- a/build/pack-all.ts +++ b/build/build-all.ts @@ -7,7 +7,7 @@ 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, NPM_OUTPUT_DIR); +sh.mkdir('-p', 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('_'); diff --git a/build/bump-version.ts b/build/update-version.ts similarity index 83% rename from build/bump-version.ts rename to build/update-version.ts index 1687215e34c6..0a158a81d155 100644 --- a/build/bump-version.ts +++ b/build/update-version.ts @@ -3,6 +3,11 @@ import path from "node:path"; const version = process.argv[2]; +if (version == null) { + console.error(`Usage: "npm run all:update-version -- $version" (XX.X.X)`); + process.exit(1); +} + const MONOREPO_ROOT = path.join(__dirname, '..'); const packagesPath = path.join(MONOREPO_ROOT, 'packages', '**', 'package.json'); const playgroundsPath = path.join(MONOREPO_ROOT, 'playgrounds', '**', 'package.json'); diff --git a/package.json b/package.json index 2fa215ec6e55..567307b9ab17 100644 --- a/package.json +++ b/package.json @@ -21,8 +21,8 @@ "regenerate-all": "nx run-many -t regenerate", "lint-staged": "lint-staged", "prepare": "husky install", - "all:pack": "ts-node build/pack-all.ts", - "all:bump": "ts-node build/bump-version.ts" + "all:update-version": "ts-node build/update-version.ts", + "all:build": "ts-node build/build-all.ts" }, "nx": {}, "private": true,