Skip to content

[dev] Make yarn launch prefer local plugin source code#2330

Merged
ava-silver merged 3 commits into
masterfrom
ava.silver/chore/launch-local-plugin-source
May 21, 2026
Merged

[dev] Make yarn launch prefer local plugin source code#2330
ava-silver merged 3 commits into
masterfrom
ava.silver/chore/launch-local-plugin-source

Conversation

@ava-silver

@ava-silver ava-silver commented May 21, 2026

Copy link
Copy Markdown
Contributor

What and why?

yarn launch should execute plugin command source when running with the development condition. After the bundling migration, plugin resolution tried the package root bundle before the command submodule, so local source changes could be bypassed when a stale dist/bundle.js existed.

yarn launch:dist should exercise the packaged CLI bundle instead of TypeScript-compiled dist/cli.js, so it now runs packages/datadog-ci/dist/bundle.js directly.

How?

Prefer @datadog/datadog-ci-plugin-<scope>/commands/<command> before the self-contained package bundle in the plugin loader. The submodule export resolves to src under --conditions=development and to dist in normal/package usage. Keep the root bundle as a fallback for bundled/plugin packages without submodule exports.

Normalize dynamic imports of CommonJS command wrappers so packaged dist/commands/* wrappers expose PluginCommand consistently during bundled/e2e execution.

Documented the difference between yarn launch and yarn launch:dist in CONTRIBUTING.md, including the bundle build commands needed for dist-mode testing.

Added regression tests that verify command submodules win over self-contained bundles and that CommonJS default-export wrapper shapes are unwrapped.

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)

ava-silver commented May 21, 2026

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ava-silver
ava-silver marked this pull request as ready for review May 21, 2026 13:51
@ava-silver
ava-silver requested a review from a team as a code owner May 21, 2026 13:51
@datadog-official

datadog-official Bot commented May 21, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: e7bc8e1 | Docs | Datadog PR Page | Give us feedback!

@ava-silver
ava-silver requested a review from Drarig29 May 21, 2026 13:53
@ava-silver
ava-silver requested a review from a team as a code owner May 21, 2026 13:59
@ava-silver ava-silver added the chores Related to the CI or developer experience label May 21, 2026
@Drarig29 Drarig29 changed the title make launch prefer local plugin sources [dev] Make yarn launch prefer local plugin source code May 21, 2026
@ava-silver
ava-silver merged commit df95ca1 into master May 21, 2026
29 checks passed
@ava-silver
ava-silver deleted the ava.silver/chore/launch-local-plugin-source branch May 21, 2026 15:28
@afontan afontan mentioned this pull request May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chores Related to the CI or developer experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants