diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa85c55332e..450f2c18600 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,9 @@ jobs: - name: Install dependencies run: bun install --frozen-lockfile + - name: Build packages + run: bun run build:packages + - name: Run tests run: bun run test diff --git a/package.json b/package.json index cf3b3f2b0e2..a99a3ccb388 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "node": ">=22.0" }, "scripts": { - "build": "storybook build -o storybook-static", + "build": "storybook build -o storybook-static --stats-json", "build:packages": "bun run build:colours && bun run build:components && bun run build:charts", "build:colours": "cd packages/colours && bun run build", "build:components": "cd packages/components && bun run build", diff --git a/packages/charts/build.ts b/packages/charts/build.ts index 8b174060f27..9606ca07512 100644 --- a/packages/charts/build.ts +++ b/packages/charts/build.ts @@ -38,15 +38,19 @@ const transpileFile = async (srcPath: string, destPath: string) => { const result = await transform(content, { loader: isTsx ? "tsx" : "ts", format: "esm", - target: "esnext", + target: "es2022", + jsx: "automatic", sourcemap: "external", sourcefile: srcPath, - // Use legacy decorators mode for compatibility with mobx-react + // Emit native TC-39 stage 3 decorators. The codebase mixes mobx + // decorators (@computed, @action) with stage-3-style ones (@bind in + // utils/Util.ts), so the legacy emit path produces output that calls + // stage-3 decorators with legacy arguments at runtime. Stage 3 emit + // is what Storybook uses and matches the source authoring style. tsconfigRaw: { compilerOptions: { - experimentalDecorators: true, - emitDecoratorMetadata: false, - useDefineForClassFields: false, + experimentalDecorators: false, + useDefineForClassFields: true, }, }, }) diff --git a/packages/charts/package.json b/packages/charts/package.json index b651cd1702a..a066eed337d 100644 --- a/packages/charts/package.json +++ b/packages/charts/package.json @@ -1,6 +1,6 @@ { "name": "@buildcanada/charts", - "version": "0.3.8", + "version": "0.3.9", "description": "A configurable data visualization library for creating interactive charts.", "type": "module", "main": "./dist/index.js",