From 07b879bfd8e05fdc929a5a753ef9231bcf819c71 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Fri, 24 May 2024 17:26:41 +0300 Subject: [PATCH] chore(react): add .d.mts files --- components/react/cleanup.js | 6 ++++++ components/react/package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/components/react/cleanup.js b/components/react/cleanup.js index f6c40f0..c8be7d1 100644 --- a/components/react/cleanup.js +++ b/components/react/cleanup.js @@ -6,6 +6,7 @@ const text = "'use client'"; // List of files to fix ['iconify', 'offline'].forEach((prefix) => { + // Add 'use client' to files ['js', 'cjs', 'mjs'].forEach((ext) => { const file = `dist/${prefix}.${ext}`; try { @@ -18,4 +19,9 @@ const text = "'use client'"; // } }); + + // Copy .d.ts to .d.mts + const source = `dist/${prefix}.d.ts`; + const target = `dist/${prefix}.d.mts`; + writeFileSync(target, readFileSync(source, 'utf8'), 'utf8'); }); diff --git a/components/react/package.json b/components/react/package.json index ecf0488..12a02c4 100644 --- a/components/react/package.json +++ b/components/react/package.json @@ -2,7 +2,7 @@ "name": "@iconify/react", "description": "Iconify icon component for React.", "author": "Vjacheslav Trushkin", - "version": "5.0.0-beta.3", + "version": "5.0.0-beta.4", "publishConfig": { "access": "public", "tag": "next"