Skip to content

Commit

Permalink
Merge branch '24_1' into ci/pnpm
Browse files Browse the repository at this point in the history
# Conflicts:
#	tools/scripts/build-all.ts
  • Loading branch information
Alexander Bulychev committed May 17, 2024
2 parents 0ad51eb + 5938767 commit 87f557a
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 29 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/demos_visual_tests_frameworks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,14 @@ jobs:
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm add -w ./devextreme-installer.tgz ./devextreme-dist-installer.tgz ./devextreme-react-installer.tgz ./devextreme-vue-installer.tgz ./devextreme-angular-installer.tgz
working-directory: apps/demos
run: pnpm add ../../devextreme-installer.tgz ../../devextreme-dist-installer.tgz ../../devextreme-react-installer.tgz ../../devextreme-vue-installer.tgz ../../devextreme-angular-installer.tgz

# - name: Build wrappers
# run: pnpm exec nx run-many -t pack -p devextreme-angular devextreme-react devetreme-vue

- name: Link wrappers packages
run: pnpm install
# - name: Link wrappers packages
# run: pnpm install

- name: Prepare bundles
working-directory: apps/demos
Expand Down Expand Up @@ -397,7 +398,8 @@ jobs:
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm add -w ./devextreme-installer.tgz ./devextreme-dist-installer.tgz ./devextreme-react-installer.tgz ./devextreme-vue-installer.tgz ./devextreme-angular-installer.tgz
working-directory: apps/demos
run: pnpm add ../../devextreme-installer.tgz ../../devextreme-dist-installer.tgz ../../devextreme-react-installer.tgz ../../devextreme-vue-installer.tgz ../../devextreme-angular-installer.tgz

# - name: Build wrappers
# run: pnpm exec nx run-many -t pack -p devextreme-angular devextreme-react devetreme-vue
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"prepare": "husky install",
"all:update-version": "ts-node tools/scripts/update-version.ts",
"all:build": "ts-node tools/scripts/build-all.ts",
"all:build-dev": "pnpm run all:build --dev",
"all:pack-and-copy": "nx run-many -t pack-and-copy",
"overwrite-wrappers-packages": "ts-node tools/scripts/overwrite-wrappers-packages.ts",
"webserver": "http-server --port 8080 -c-1"
Expand Down
66 changes: 41 additions & 25 deletions tools/scripts/build-all.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,35 @@
import sh from 'shelljs';
import path from 'node:path';
import yargs from 'yargs';
import { ARTIFACTS_DIR, INTERNAL_TOOLS_ARTIFACTS, ROOT_DIR, NPM_DIR, JS_ARTIFACTS, CSS_ARTIFACTS } from './common/paths';

const argv = yargs
.option('dev', { type: 'boolean', default: false })
.parseSync();

const devMode = argv.dev;

console.log(`Dev mode: ${devMode}`);

const DEVEXTREME_NPM_DIR = path.join(ROOT_DIR, 'packages/devextreme/artifacts/npm');

const injectDescriptions = () => {
sh.pushd(ROOT_DIR);
// Inject descriptions
const DOCUMENTATION_TEMP_DIR = path.join(ARTIFACTS_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_TEMP_DIR);
sh.exec('pnpm i');
sh.exec(`pnpm run update-topics --artifacts ${INTERNAL_TOOLS_ARTIFACTS}`);
sh.popd();

sh.rm('-rf', DOCUMENTATION_TEMP_DIR);

sh.exec('pnpm run devextreme:inject-descriptions');
sh.popd();
}

sh.set('-e');

sh.mkdir('-p', NPM_DIR);
Expand All @@ -21,26 +47,22 @@ sh.cd(ROOT_DIR);
sh.exec('pnpm run tools:discover-declarations');
sh.exec(`pnpm run tools make-aspnet-metadata --version ${MAJOR_VERSION}`);

// Inject descriptions
const DOCUMENTATION_TEMP_DIR = path.join(ARTIFACTS_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_TEMP_DIR);
sh.exec('pnpm i');
sh.exec(`pnpm run update-topics --artifacts ${INTERNAL_TOOLS_ARTIFACTS}`);
sh.popd();

sh.rm('-rf', DOCUMENTATION_TEMP_DIR);
if (!devMode) {
injectDescriptions();
}

sh.exec('pnpm run devextreme:inject-descriptions');
if (devMode) {
sh.exec('pnpx nx build devextreme-main');
} else {
sh.exec('pnpx nx build-dist devextreme-main --skipNxCache', {
env: {
...sh.env,
BUILD_INTERNAL_PACKAGE: 'false'
}
});
}

sh.exec('pnpx nx build devextreme-main', {
env: {
...sh.env,
BUILD_INTERNAL_PACKAGE: 'false'
}
});
sh.exec('pnpx nx build devextreme-themebuilder');
sh.exec(`pnpx nx build devextreme-themebuilder${devMode ? '' : ' --skipNxCache'}`);

// Copy artifacts for DXBuild (Installation)
sh.pushd(path.join(ROOT_DIR, 'packages/devextreme/artifacts'));
Expand All @@ -53,20 +75,14 @@ sh.cp([path.join(BOOTSTRAP_DIR, 'js', 'bootstrap.js'), path.join(BOOTSTRAP_DIR,
sh.cp([path.join(BOOTSTRAP_DIR, 'css', 'bootstrap.css'), path.join(BOOTSTRAP_DIR, 'css', 'bootstrap.min.css')], CSS_ARTIFACTS);

const {
'devextreme-main': devextremeVersion,
devextreme: devextremeNpmVersion
} = JSON.parse(sh.exec('pnpm m ls --json --depth=-1 | jq \'reduce .[] as $item ({}; .[$item.name] = $item.version)\'').stdout);

// Update versions for non-semver builds (daily, alpha and beta)
if (devextremeVersion !== devextremeNpmVersion) {
sh.exec(`pnpm run all:update-version ${devextremeNpmVersion}`);
}

sh.exec('pnpm run all:pack-and-copy');

sh.exec('pnpx nx pack devextreme-react', { silent: true });
sh.exec('pnpx nx pack devextreme-vue', { silent: true });
sh.exec('pnpx nx pack devextreme-angular --with-descriptions', { silent: true });
sh.exec(`pnpx nx pack devextreme-angular${devMode ? '' : ' --with-descriptions'}`, { silent: true });

sh.pushd(path.join(DEVEXTREME_NPM_DIR, 'devextreme'));
packAndCopy(NPM_DIR);
Expand Down

0 comments on commit 87f557a

Please sign in to comment.