From 59cd43dab9980ef4ead1a59ec540cae3d2810c8f Mon Sep 17 00:00:00 2001 From: Matheus Cardoso Date: Wed, 5 Feb 2025 13:37:01 -0300 Subject: [PATCH 1/3] feat(rollup-plugin): expose version --- packages/@lwc/rollup-plugin/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@lwc/rollup-plugin/src/index.ts b/packages/@lwc/rollup-plugin/src/index.ts index 6004939ad1..97efe01743 100644 --- a/packages/@lwc/rollup-plugin/src/index.ts +++ b/packages/@lwc/rollup-plugin/src/index.ts @@ -182,7 +182,7 @@ export default function lwc(pluginOptions: RollupLwcOptions = {}): Plugin { return { name: PLUGIN_NAME, - + version: process.env.LWC_VERSION, buildStart({ input }) { if (rootDir === undefined) { if (Array.isArray(input)) { From 7f18f0b628e6a0bb11cc803b89fabfc1a0110b53 Mon Sep 17 00:00:00 2001 From: Matheus Cardoso Date: Wed, 5 Feb 2025 13:59:15 -0300 Subject: [PATCH 2/3] test(rollup-plugin): exposes plugin version --- packages/@lwc/rollup-plugin/src/__tests__/index.spec.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 packages/@lwc/rollup-plugin/src/__tests__/index.spec.ts diff --git a/packages/@lwc/rollup-plugin/src/__tests__/index.spec.ts b/packages/@lwc/rollup-plugin/src/__tests__/index.spec.ts new file mode 100644 index 0000000000..9c73cd78fc --- /dev/null +++ b/packages/@lwc/rollup-plugin/src/__tests__/index.spec.ts @@ -0,0 +1,7 @@ +import lwc from '@lwc/rollup-plugin'; +import { test, expect } from 'vitest'; + +test('exposes plugin version', () => { + const plugin = lwc(); + expect(plugin.version).toMatch(/^\d+\.\d+\.\d+/); +}); From 4777327a037636b4ad7432651f8d1c16947f7c2a Mon Sep 17 00:00:00 2001 From: Dale Bustad Date: Thu, 6 Feb 2025 00:09:14 -0800 Subject: [PATCH 3/3] chore: add comment --- packages/@lwc/rollup-plugin/src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/@lwc/rollup-plugin/src/index.ts b/packages/@lwc/rollup-plugin/src/index.ts index 97efe01743..753809e271 100644 --- a/packages/@lwc/rollup-plugin/src/index.ts +++ b/packages/@lwc/rollup-plugin/src/index.ts @@ -182,6 +182,7 @@ export default function lwc(pluginOptions: RollupLwcOptions = {}): Plugin { return { name: PLUGIN_NAME, + // The version from the package.json is inlined by the build script version: process.env.LWC_VERSION, buildStart({ input }) { if (rootDir === undefined) {