Skip to content

chore: migrate remaining gulp build TS task to nx#33710

Open
GoodDayForSurf wants to merge 19 commits into
26_1from
chore/migrate-devextreme-to-nx-TS
Open

chore: migrate remaining gulp build TS task to nx#33710
GoodDayForSurf wants to merge 19 commits into
26_1from
chore/migrate-devextreme-to-nx-TS

Conversation

@GoodDayForSurf
Copy link
Copy Markdown
Contributor

No description provided.

@GoodDayForSurf GoodDayForSurf marked this pull request as ready for review May 26, 2026 08:28
Copilot AI review requested due to automatic review settings May 26, 2026 08:28
@GoodDayForSurf GoodDayForSurf requested review from a team and alexslavr and removed request for a team May 26, 2026 08:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR completes the migration of DevExtreme TypeScript declaration build/validation steps from the legacy gulp pipeline to Nx by introducing a dedicated check-declarations executor and wiring new Nx targets/scripts to replace gulp ts / gulp validate-ts behavior.

Changes:

  • Added devextreme-nx-infra-plugin:check-declarations executor (modes: jquery, bundle, modules, public-modules) with Jest E2E coverage.
  • Updated packages/devextreme Nx targets and npm scripts to run declaration build + validation via Nx instead of gulp, and removed the old gulp ts.js task implementation.
  • Adjusted dts-modules license header application to exclude specific output subfolders.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/nx-infra-plugin/src/executors/dts-modules/dts-modules.impl.ts Excludes bundles/, dist/, license/ from module license header stamping.
packages/nx-infra-plugin/src/executors/check-declarations/schema.ts Adds TS schema typing for the new executor options.
packages/nx-infra-plugin/src/executors/check-declarations/schema.json Adds Nx JSON schema for check-declarations executor configuration.
packages/nx-infra-plugin/src/executors/check-declarations/executor.ts Registers executor entrypoint + re-exports helper functions.
packages/nx-infra-plugin/src/executors/check-declarations/executor.e2e.spec.ts Adds Jest E2E tests for the new executor + content builders.
packages/nx-infra-plugin/src/executors/check-declarations/declaration-check-content.ts Implements generated TS entry content for jquery and public-modules checks.
packages/nx-infra-plugin/src/executors/check-declarations/check-declarations.impl.ts Implements the new declaration type-checking executor.
packages/nx-infra-plugin/executors.json Registers the new check-declarations executor in the plugin catalog.
packages/nx-infra-plugin/AGENTS.md Documents the new executor as a shared cross-executor concern.
packages/devextreme/project.json Adds Nx targets (verify:*, validate:ts, build:declarations) to replace gulp TS tasks.
packages/devextreme/package.json Switches validate-ts script to run the new Nx target.
packages/devextreme/gulpfile.js Re-routes gulp ts to the Nx build:declarations target and removes gulp TS task import.
packages/devextreme/build/gulp/ts.js Removes the legacy gulp implementation for TS declaration build/check tasks.
packages/devextreme/build/gulp/npm.js Updates npm gulp pipeline to invoke Nx d.ts build steps and drops the old public-modules check from gulp.

Comment on lines +55 to +74
export function resolveTypeScript(
projectRoot: string,
typescriptModule?: string,
): typeof import('typescript') {
const candidates = typescriptModule
? [
path.isAbsolute(typescriptModule)
? typescriptModule
: path.resolve(projectRoot, typescriptModule),
]
: [
path.join(projectRoot, 'node_modules', 'typescript-min'),
path.join(projectRoot, 'node_modules', 'typescript'),
];

for (const candidate of candidates) {
try {
const resolved = fs.existsSync(path.join(candidate, 'package.json'))
? candidate
: require.resolve(candidate, { paths: [projectRoot] });
Comment on lines +814 to +825
"verify:ts-jquery": {
"executor": "devextreme-nx-infra-plugin:check-declarations",
"options": {
"mode": "jquery",
"typescriptModule": "typescript-min"
},
"inputs": [
"{projectRoot}/ts/dx.all.d.ts",
"{projectRoot}/ts/aliases.d.ts",
"{projectRoot}/build/gulp/modules_metadata.json"
]
},
},
"tsBundleFile": {
"type": "string",
"description": "Source bundle .d.ts for jquery check (relative to project root)."
Comment on lines +796 to +797
"{projectRoot}/js/**/*.d.ts",
"{projectRoot}/build/gulp/modules_metadata.json"
Copilot AI review requested due to automatic review settings May 26, 2026 12:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Comment on lines +55 to +68
export function resolveTypeScript(
projectRoot: string,
typescriptModule?: string,
): typeof import('typescript') {
const candidates = typescriptModule
? [
path.isAbsolute(typescriptModule)
? typescriptModule
: path.resolve(projectRoot, typescriptModule),
]
: [
path.join(projectRoot, 'node_modules', 'typescript-min'),
path.join(projectRoot, 'node_modules', 'typescript'),
];
Comment on lines +71 to +72
gulp.task('ts', shell.task('pnpm nx run devextreme:build:declarations'));

Comment on lines 836 to 857
"build:declarations": {
"executor": "nx:run-commands",
"options": {
"command": "gulp ts",
"cwd": "{projectRoot}"
"commands": [
"pnpm nx run devextreme:copy:ts-vendor",
"pnpm nx run devextreme:build:npm:dts-bundle",
"pnpm nx run devextreme:verify:ts-jquery",
"pnpm nx run devextreme:verify:ts-bundle"
],
"parallel": false
},
"inputs": [
"{projectRoot}/ts/**/*.d.ts",
"{projectRoot}/build/gulp/ts.js"
"{projectRoot}/ts/vendor/**/*",
"{projectRoot}/build/gulp/modules_metadata.json",
"{projectRoot}/build/gulp/license-header.txt"
],
"outputs": [
"{projectRoot}/artifacts/ts"
"{projectRoot}/artifacts/ts",
"{projectRoot}/artifacts/ts/dx.all.d.ts",
"{projectRoot}/artifacts/npm/devextreme/bundles/dx.all.d.ts"
]
Copilot AI review requested due to automatic review settings May 26, 2026 19:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Comment on lines +55 to +82
export function resolveTypeScript(
projectRoot: string,
typescriptModule?: string,
): typeof import('typescript') {
const candidates = typescriptModule
? [
path.isAbsolute(typescriptModule)
? typescriptModule
: path.resolve(projectRoot, typescriptModule),
]
: [
path.join(projectRoot, 'node_modules', 'typescript-min'),
path.join(projectRoot, 'node_modules', 'typescript'),
];

for (const candidate of candidates) {
try {
const resolved = fs.existsSync(path.join(candidate, 'package.json'))
? candidate
: require.resolve(candidate, { paths: [projectRoot] });
return require(resolved);
} catch {
// try next candidate
}
}

return require('typescript');
}
Comment on lines +208 to +223
case 'jquery': {
const modules = await loadModulesMetadata(resolved.modulesMetadataPath);
const content = buildJqueryCheckContent(resolved.tsBundleFile, modules);
const entryPath = await writeCheckEntryFile(
path.join(projectRoot, resolved.entryOutputDir),
'globals.ts',
content,
);
await runTypeCheckWithTemporaryEntry(entryPath, () =>
runDeclarationsTypeCheck({
projectRoot,
rootNames: [entryPath],
typescriptModule: resolved.typescriptModule,
compilerOptions: resolved.extraCompilerOptions,
}),
);
});
});

const PLUGIN_TYPESCRIPT = path.join(__dirname, '..', '..', '..', 'node_modules', 'typescript');
Comment on lines +814 to +825
"verify:ts-jquery": {
"executor": "devextreme-nx-infra-plugin:check-declarations",
"options": {
"mode": "jquery",
"typescriptModule": "typescript-min"
},
"inputs": [
"{projectRoot}/ts/dx.all.d.ts",
"{projectRoot}/ts/aliases.d.ts",
"{projectRoot}/build/gulp/modules_metadata.json"
]
},
Copilot AI review requested due to automatic review settings May 27, 2026 09:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.

Comment thread packages/devextreme/project.json
Comment thread packages/devextreme/project.json
Comment thread packages/devextreme/project.json
Copilot AI review requested due to automatic review settings May 27, 2026 16:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Comment thread packages/nx-infra-plugin/src/executors/check-declarations/executor.e2e.spec.ts Outdated
Comment thread packages/devextreme/project.json Outdated
fix path resolve
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants