From 6e11ac04c8fdec85642c48375bdc48c6366807aa Mon Sep 17 00:00:00 2001 From: Andrei Vorobev <738482+vorobey@users.noreply.github.com> Date: Mon, 28 Sep 2026 15:22:05 +0300 Subject: [PATCH 1/4] fix: add ignore-scripts to runCommand --- packages/devextreme-cli/testing/themebuilder/utils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/devextreme-cli/testing/themebuilder/utils.js b/packages/devextreme-cli/testing/themebuilder/utils.js index 8edd55857..ca59d4ba4 100644 --- a/packages/devextreme-cli/testing/themebuilder/utils.js +++ b/packages/devextreme-cli/testing/themebuilder/utils.js @@ -11,13 +11,13 @@ module.exports.buildPackage = async() => { module.exports.prepareDirectory = async(devextremeVersion, themeBuilderVersion, workDirectory) => { await runCommand('npm', ['init', '--yes'], { cwd: workDirectory }); if(devextremeVersion) { - await runCommand('npm', ['install', `devextreme@${devextremeVersion}`, '--save-exact'], { cwd: workDirectory }); + await runCommand('npm', ['install', `devextreme@${devextremeVersion}`, '--save-exact --ignore-scripts'], { cwd: workDirectory }); } if(themeBuilderVersion) { - await runCommand('npm', ['install', `devextreme-themebuilder@${themeBuilderVersion}`, '--save-exact'], { cwd: workDirectory }); + await runCommand('npm', ['install', `devextreme-themebuilder@${themeBuilderVersion}`, '--save-exact --ignore-scripts'], { cwd: workDirectory }); } // we need to install cli as tgz (regular install for folder make symlink and require works in wrong way) - await runCommand('npm', ['install', `../../../devextreme-cli-${cliVersion}.tgz`, '--save-exact'], { cwd: workDirectory }); + await runCommand('npm', ['install', `../../../devextreme-cli-${cliVersion}.tgz`, '--save-exact --ignore-scripts'], { cwd: workDirectory }); }; module.exports.parseDetectedVersion = (output) => { From 62263f2f537d01987eee2634c481e5ffb667827d Mon Sep 17 00:00:00 2001 From: Andrei Vorobev <738482+vorobey@users.noreply.github.com> Date: Wed, 14 Oct 2026 16:14:17 +0300 Subject: [PATCH 2/4] CLI: fix for run command syntax --- packages/devextreme-cli/testing/themebuilder/utils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/devextreme-cli/testing/themebuilder/utils.js b/packages/devextreme-cli/testing/themebuilder/utils.js index ca59d4ba4..e6ae4200e 100644 --- a/packages/devextreme-cli/testing/themebuilder/utils.js +++ b/packages/devextreme-cli/testing/themebuilder/utils.js @@ -11,13 +11,13 @@ module.exports.buildPackage = async() => { module.exports.prepareDirectory = async(devextremeVersion, themeBuilderVersion, workDirectory) => { await runCommand('npm', ['init', '--yes'], { cwd: workDirectory }); if(devextremeVersion) { - await runCommand('npm', ['install', `devextreme@${devextremeVersion}`, '--save-exact --ignore-scripts'], { cwd: workDirectory }); + await runCommand('npm', ['install', `devextreme@${devextremeVersion}`, '--save-exact', '--ignore-scripts'], { cwd: workDirectory }); } if(themeBuilderVersion) { - await runCommand('npm', ['install', `devextreme-themebuilder@${themeBuilderVersion}`, '--save-exact --ignore-scripts'], { cwd: workDirectory }); + await runCommand('npm', ['install', `devextreme-themebuilder@${themeBuilderVersion}`, '--save-exact', '--ignore-scripts'], { cwd: workDirectory }); } // we need to install cli as tgz (regular install for folder make symlink and require works in wrong way) - await runCommand('npm', ['install', `../../../devextreme-cli-${cliVersion}.tgz`, '--save-exact --ignore-scripts'], { cwd: workDirectory }); + await runCommand('npm', ['install', `../../../devextreme-cli-${cliVersion}.tgz`, '--save-exact', '--ignore-scripts'], { cwd: workDirectory }); }; module.exports.parseDetectedVersion = (output) => { From 0b137c57810956ead8e429601fc642e2effd4dfd Mon Sep 17 00:00:00 2001 From: Andrei Vorobev <738482+vorobey@users.noreply.github.com> Date: Thu, 15 Oct 2026 11:38:32 +0300 Subject: [PATCH 3/4] Add ignore-scripts to install scripts, remove schematic redundant patch for allowscripts --- .../src/applications/application.nextjs.js | 1 + .../src/utility/package-manager.js | 21 ++++++++----- .../src/add-app-template/index.ts | 30 ++----------------- .../src/add-layout/index.ts | 5 ++-- .../src/install/index.ts | 5 ++-- .../src/utility/patch.ts | 14 --------- 6 files changed, 20 insertions(+), 56 deletions(-) delete mode 100644 packages/devextreme-schematics/src/utility/patch.ts diff --git a/packages/devextreme-cli/src/applications/application.nextjs.js b/packages/devextreme-cli/src/applications/application.nextjs.js index f74b34e82..1770e74b2 100644 --- a/packages/devextreme-cli/src/applications/application.nextjs.js +++ b/packages/devextreme-cli/src/applications/application.nextjs.js @@ -80,6 +80,7 @@ const create = async(appName, options) => { '--no-turbopack', '--no-react-compiler', '--import-alias "@/*"', + '--skip-install' ]; await runCommand('npx', commandArguments); diff --git a/packages/devextreme-cli/src/utility/package-manager.js b/packages/devextreme-cli/src/utility/package-manager.js index 532d42fcd..c978d0a93 100644 --- a/packages/devextreme-cli/src/utility/package-manager.js +++ b/packages/devextreme-cli/src/utility/package-manager.js @@ -16,13 +16,15 @@ const packageManagers = { installCommand: 'install', lockFileName: 'package-lock.json', getLockFile: (cwd) => getLock(cwd, 'package-lock.json', JSON), - getDependencies: (obj) => obj.dependencies + getDependencies: (obj) => obj.dependencies, + defaultInstallationOptions: ['--ignore-scripts'] }, yarn: { installCommand: 'add', lockFileName: 'yarn.lock', getLockFile: (cwd) => getLock(cwd, 'yarn.lock', yarnLockfile), - getDependencies: (obj) => obj.object + getDependencies: (obj) => obj.object, + defaultInstallationOptions: ['--ignore-scripts'] } }; @@ -51,12 +53,10 @@ const getDependencies = (evaluatingOptions = {}) => { const installPackage = (packageName, evaluatingOptions = {}, options = {}) => { const packageManager = getPackageManager(evaluatingOptions.cwd); - const instalationOptions = options[packageManager]; + const defaultInstallationOptions = packageManagers[packageManager].defaultInstallationOptions || []; + const instalationOptions = options[packageManager] || []; const commandArguments = [packageManagers[packageManager].installCommand]; - - if(instalationOptions) { - commandArguments.push(...instalationOptions); - } + commandArguments.push(...defaultInstallationOptions, ...instalationOptions); commandArguments.push(packageName); @@ -65,7 +65,12 @@ const installPackage = (packageName, evaluatingOptions = {}, options = {}) => { const run = (commands, evaluatingOptions = {}) => runCommand(getPackageManager(evaluatingOptions.cwd), commands, evaluatingOptions); -const runInstall = (evaluatingOptions = {}) => run(['install'], evaluatingOptions); +const runInstall = (evaluatingOptions = {}) => { + const packageManager = getPackageManager(evaluatingOptions.cwd); + const defaultInstallationOptions = packageManagers[packageManager].defaultInstallationOptions || []; + + return runCommand(packageManager, ['install', ...defaultInstallationOptions], evaluatingOptions); +}; const hasPackageScript = (scriptName, evaluatingOptions = {}) => { const cwd = evaluatingOptions.cwd; diff --git a/packages/devextreme-schematics/src/add-app-template/index.ts b/packages/devextreme-schematics/src/add-app-template/index.ts index a323a3005..3b17c5486 100644 --- a/packages/devextreme-schematics/src/add-app-template/index.ts +++ b/packages/devextreme-schematics/src/add-app-template/index.ts @@ -1,15 +1,9 @@ import { Rule, chain, - schematic, - Tree, + schematic } from '@angular-devkit/schematics'; -import { existsSync } from 'fs'; -import { resolve, join } from 'path'; - -import { spawnSync } from 'child_process'; - export default function(options: any): Rule { const rules = [ schematic('install', { @@ -23,13 +17,7 @@ export default function(options: any): Rule { skipInstall: true, updateBudgets: options.updateBudgets, globalNgCliVersion: options.globalNgCliVersion - }), - // schematics installed packages with flag --ignore-scripts - // @angular/cli@14 add option allowScript to NodePackageInstallTask - (host: Tree) => { - postinstallScripts(); - return host; - } + }) ]; if (!options.empty) { @@ -40,17 +28,3 @@ export default function(options: any): Rule { return chain(rules); } - -const postinstallScripts = () => { - const isWin = /^win/.test(process.platform); - - const sassEmbeddedPath = resolve('node_modules', 'sass-embedded'); - const sassVendorPath = join(sassEmbeddedPath, 'dist', 'lib', 'src', 'vendor', 'dart-sass-embedded'); - if (!existsSync(sassVendorPath)) { - spawnSync('npm', ['run', 'postinstall'], { - cwd: resolve(join('node_modules', 'sass-embedded')), - windowsVerbatimArguments: true, - shell: isWin ? false : true - }); - } -}; diff --git a/packages/devextreme-schematics/src/add-layout/index.ts b/packages/devextreme-schematics/src/add-layout/index.ts index 2b9cb687d..56747e87c 100644 --- a/packages/devextreme-schematics/src/add-layout/index.ts +++ b/packages/devextreme-schematics/src/add-layout/index.ts @@ -66,9 +66,8 @@ import { insertImport } from '@schematics/angular/utility/ast-utils'; import { getWorkspace } from '@schematics/angular/utility/workspace'; import { Change } from '@schematics/angular/utility/change'; -import { PatchNodePackageInstallTask } from '../utility/patch'; import { isAngularVersionHigherThan } from '../utility/angular-version'; -import { RunSchematicTask } from '@angular-devkit/schematics/tasks'; +import { NodePackageInstallTask, RunSchematicTask } from '@angular-devkit/schematics/tasks'; const routes = [ { @@ -438,7 +437,7 @@ export default function(options: any): Rule { if (!options.skipInstall) { rules.push((_: Tree, context: SchematicContext) => { - const installTaskId = context.addTask(new PatchNodePackageInstallTask()); + const installTaskId = context.addTask(new NodePackageInstallTask()); context.addTask(new RunSchematicTask('build-themes', {}), [installTaskId]); }); } diff --git a/packages/devextreme-schematics/src/install/index.ts b/packages/devextreme-schematics/src/install/index.ts index 54da5bb01..8d964664a 100644 --- a/packages/devextreme-schematics/src/install/index.ts +++ b/packages/devextreme-schematics/src/install/index.ts @@ -16,8 +16,7 @@ import { latestVersions } from '../utility/latest-versions'; import { modifyJSONFile } from '../utility/modify-json-file'; import { getProjectName } from '../utility/project'; -import { PatchNodePackageInstallTask } from '../utility/patch'; -import { RunSchematicTask } from '@angular-devkit/schematics/tasks'; +import { NodePackageInstallTask, RunSchematicTask } from '@angular-devkit/schematics/tasks'; export default function(options: any): Rule { @@ -27,7 +26,7 @@ export default function(options: any): Rule { (host: Tree) => addDevExtremeCSS(host, { project: options.project }), (host: Tree) => reqisterJSZip(host), (_, context: SchematicContext) => { - const installTaskId = context.addTask(new PatchNodePackageInstallTask()); + const installTaskId = context.addTask(new NodePackageInstallTask()); context.addTask(new RunSchematicTask('build-themes', {}), [installTaskId]); }, ]); diff --git a/packages/devextreme-schematics/src/utility/patch.ts b/packages/devextreme-schematics/src/utility/patch.ts deleted file mode 100644 index 90095c631..000000000 --- a/packages/devextreme-schematics/src/utility/patch.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks'; - -export class PatchNodePackageInstallTask extends NodePackageInstallTask { - toConfiguration = (): any => { - const rootConfigurations = super.toConfiguration(); - const customOptions = Object.assign({}, rootConfigurations.options, { allowScripts: true }); - - return { - name: rootConfigurations.name, - dependencies: rootConfigurations.dependencies, - options: customOptions - }; - } -} From 000d35e173a0d16d2e44d695e5530c7b1fbd9e33 Mon Sep 17 00:00:00 2001 From: Andrei Vorobev <738482+vorobey@users.noreply.github.com> Date: Thu, 15 Oct 2026 11:56:07 +0300 Subject: [PATCH 4/4] CLI: fix nextjs installation --- .../devextreme-cli/src/applications/application.nextjs.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/devextreme-cli/src/applications/application.nextjs.js b/packages/devextreme-cli/src/applications/application.nextjs.js index 1770e74b2..d54e7aa26 100644 --- a/packages/devextreme-cli/src/applications/application.nextjs.js +++ b/packages/devextreme-cli/src/applications/application.nextjs.js @@ -80,10 +80,11 @@ const create = async(appName, options) => { '--no-turbopack', '--no-react-compiler', '--import-alias "@/*"', - '--skip-install' ]; - await runCommand('npx', commandArguments); + await runCommand('npx', commandArguments, { + env: { ...process.env, npm_config_ignore_scripts: 'true' } + }); const appPath = path.join(process.cwd(), appName);