Skip to content

License: Add new licensing mechanism#33206

Open
ajivanyandev wants to merge 50 commits intoDevExpress:26_1from
ajivanyandev:license/26-1-full-pipeline
Open

License: Add new licensing mechanism#33206
ajivanyandev wants to merge 50 commits intoDevExpress:26_1from
ajivanyandev:license/26-1-full-pipeline

Conversation

@ajivanyandev
Copy link
Copy Markdown
Contributor

No description provided.

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 introduces a new DevExtreme licensing mechanism, adding a devextreme-license CLI and bundler plugin support to inject a generated license key into DevExtreme’s internal config during builds. It also adds a new LCP (product-only) key validation path and updates license warning/reporting behavior.

Changes:

  • Add devextreme-license CLI + supporting Node-side license key discovery/conversion utilities (LCX → LCP).
  • Add an unplugin-based bundler plugin to replace a license-key placeholder in m_config at build time.
  • Add LCP key parsing/validation logic (product-kind bit flags, expiration checks) and update license warnings/tests.

Reviewed changes

Copilot reviewed 26 out of 28 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
pnpm-lock.yaml Locks unplugin@3.0.0 and related dependency snapshot updates.
packages/devextreme/package.json Adds unplugin dependency and registers devextreme-license as an npm binary.
packages/devextreme/license/messages.js Adds CLI/plugin message templates for licensing guidance.
packages/devextreme/license/dx-lcx-2-lcp.js Implements LCX → LCP conversion + LCP parsing helpers (Node-side).
packages/devextreme/license/dx-get-lcx.js Adds environment/file-based LCX key discovery logic (Node-side).
packages/devextreme/license/devextreme-license.js Adds devextreme-license CLI for generating/printing an LCP key and updating .gitignore.
packages/devextreme/license/devextreme-license-plugin.js Adds unplugin plugin to patch m_config license placeholder during bundling.
packages/devextreme/license/devextreme-license-plugin.d.ts Type declaration for the bundler plugin export.
packages/devextreme/js/__internal/core/m_config.ts Adds licenseKey default placeholder in global config.
packages/devextreme/js/__internal/core/license/types.ts Extends token/error types and adds exported error token constants + warning metadata types.
packages/devextreme/js/__internal/core/license/rsa_bigint.ts Refactors RSA bigint helpers to reuse bigIntFromBytes.
packages/devextreme/js/__internal/core/license/license_warnings.ts Adds centralized console warning templates + logger for license warning types.
packages/devextreme/js/__internal/core/license/license_validation.ts Switches parsing to LCP validation path and changes warning/logging behavior.
packages/devextreme/js/__internal/core/license/license_validation.test.ts Updates tests to assert new warning behavior and adds placeholder coverage.
packages/devextreme/js/__internal/core/license/lcp_key_validation/utils.ts Adds shared helpers for LCP parsing (RSA XML parsing, bit flags, tick conversion, signature verify).
packages/devextreme/js/__internal/core/license/lcp_key_validation/types.ts Defines product-kind bit flags for DevExpress products.
packages/devextreme/js/__internal/core/license/lcp_key_validation/product_info.ts Adds product info model helpers and bitwise product checks.
packages/devextreme/js/__internal/core/license/lcp_key_validation/license_payload.test.ts Adds payload-level tests for product-kind / version behavior.
packages/devextreme/js/__internal/core/license/lcp_key_validation/license_info.ts Adds license info helpers (validity, expiration, latest DevExtreme version).
packages/devextreme/js/__internal/core/license/lcp_key_validation/lcp_key_validator.ts Implements LCP parsing/verification into internal Token representation.
packages/devextreme/js/__internal/core/license/lcp_key_validation/lcp_key_validation.test.ts Adds LCP validator tests (including signature bypass harness).
packages/devextreme/js/__internal/core/license/lcp_key_validation/const.ts Adds LCP constants (signature prefix, decode map, RSA key XML).
packages/devextreme/js/__internal/core/license/key.ts Removes internal-usage ID constant (legacy/internal token behavior).
packages/devextreme/js/__internal/core/license/const.ts Consolidates licensing constants (links, placeholder, formatting values).
packages/devextreme/js/__internal/core/license/byte_utils.ts Adds bigIntFromBytes utility function.
packages/devextreme/eslint.config.mjs Adds license/* to ignore list.
packages/devextreme/build/npm-bin/devextreme-license.js Adds npm bin wrapper to execute the CLI from the distributed package.
packages/devextreme/build/gulp/npm.js Ensures license/** is copied into the npm distribution.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Copilot AI review requested due to automatic review settings April 9, 2026 22:50
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.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

Copilot AI review requested due to automatic review settings April 10, 2026 08:40
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Arman Jivanyan <arman.jivanyan@devexpress.com>
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 26 out of 28 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported


function fail(msg) {
process.stderr.write(msg.endsWith('\n') ? msg : msg + '\n');
process.exit(0);
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

fail() exits with status code 0 even for fatal CLI errors (unknown args, refusing to overwrite existing output file, etc.). This makes scripts/CI treat failures as success and can leave a stale or missing license key output unnoticed. Please exit with a non-zero code (e.g., 1) for error conditions, and keep 0 only for successful runs.

Suggested change
process.exit(0);
process.exit(1);

Copilot uses AI. Check for mistakes.
Comment on lines +83 to +86
else if(a === '--force') out.force = true;
else if(a === '--cwd') {
const next = args[i + 1];
if(!next || next.startsWith('-')) {
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

--cwd parsing will consume the next argument even if it's another flag (e.g., --cwd --force results in cwd='--force'). Consider mirroring the --out handling: validate that a path argument exists and doesn’t start with -, otherwise warn or fail.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback

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.

4 participants