From 229b9cdf68319c409ac0285e13e5cfd34f80de6e Mon Sep 17 00:00:00 2001
From: Andrey Morozov <amje@yandex-team.ru>
Date: Sat, 4 Nov 2023 00:29:23 +0300
Subject: [PATCH] fix: remove type:module from package.json

---
 commitlint.config.js                    | 2 +-
 package.json                            | 9 ++++-----
 scripts/{aliases.js => aliases.mjs}     | 0
 scripts/{clean.js => clean.mjs}         | 0
 scripts/{constants.js => constants.mjs} | 0
 scripts/{download.js => download.mjs}   | 6 +++---
 scripts/{icons.js => icons.mjs}         | 4 ++--
 scripts/{utils.js => utils.mjs}         | 0
 8 files changed, 10 insertions(+), 11 deletions(-)
 rename scripts/{aliases.js => aliases.mjs} (100%)
 rename scripts/{clean.js => clean.mjs} (100%)
 rename scripts/{constants.js => constants.mjs} (100%)
 rename scripts/{download.js => download.mjs} (95%)
 rename scripts/{icons.js => icons.mjs} (92%)
 rename scripts/{utils.js => utils.mjs} (100%)

diff --git a/commitlint.config.js b/commitlint.config.js
index 0fca76f..3347cb9 100644
--- a/commitlint.config.js
+++ b/commitlint.config.js
@@ -1 +1 @@
-export default {extends: ['@commitlint/config-conventional']};
+module.exports = {extends: ['@commitlint/config-conventional']};
diff --git a/package.json b/package.json
index 8c10376..dc7b0e6 100644
--- a/package.json
+++ b/package.json
@@ -8,7 +8,6 @@
     "react"
   ],
   "license": "MIT",
-  "type": "module",
   "files": [
     "svgs",
     "esm",
@@ -30,19 +29,19 @@
   "homepage": "https://gravity-ui.com",
   "scripts": {
     "prepare": "husky install",
-    "lint:js": "eslint --ext .js,.jsx,.ts,.tsx . .storybook",
+    "lint:js": "eslint --ext .js,.jsx,.mjs,.ts,.tsx . .storybook",
     "lint:styles": "stylelint '**/*.scss' '.storybook/**/*.scss'",
     "lint": "run-p lint:*",
     "typecheck": "tsc --noEmit && tsc --noEmit -p .storybook",
     "test": "exit 0",
     "start": "sb dev -p 7009",
     "build-storybook": "sb build -c .storybook -o storybook-static",
-    "src:download": "node scripts/download.js",
-    "src:icons": "node scripts/icons.js",
+    "src:download": "node scripts/download.mjs",
+    "src:icons": "node scripts/icons.mjs",
     "build:cjs": "tsc --declaration --outDir .",
     "build:esm": "tsc --module esnext --outDir esm",
     "build": "run-p build:*",
-    "clean": "node scripts/clean.js",
+    "clean": "node scripts/clean.mjs",
     "prepublishOnly": "npm run build"
   },
   "devDependencies": {
diff --git a/scripts/aliases.js b/scripts/aliases.mjs
similarity index 100%
rename from scripts/aliases.js
rename to scripts/aliases.mjs
diff --git a/scripts/clean.js b/scripts/clean.mjs
similarity index 100%
rename from scripts/clean.js
rename to scripts/clean.mjs
diff --git a/scripts/constants.js b/scripts/constants.mjs
similarity index 100%
rename from scripts/constants.js
rename to scripts/constants.mjs
diff --git a/scripts/download.js b/scripts/download.mjs
similarity index 95%
rename from scripts/download.js
rename to scripts/download.mjs
index bc2712a..426eba1 100644
--- a/scripts/download.js
+++ b/scripts/download.mjs
@@ -3,9 +3,9 @@ import url from 'url';
 import fs from 'fs/promises';
 import {components as loadComponents} from '@figma-export/core';
 import {optimize} from 'svgo';
-import {ICON_NAME_REGEXP, SVGS_DIR} from './constants.js';
-import {cleanDir, getComponentName} from './utils.js';
-import {aliases} from './aliases.js';
+import {ICON_NAME_REGEXP, SVGS_DIR} from './constants.mjs';
+import {cleanDir, getComponentName} from './utils.mjs';
+import {aliases} from './aliases.mjs';
 
 const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
 
diff --git a/scripts/icons.js b/scripts/icons.mjs
similarity index 92%
rename from scripts/icons.js
rename to scripts/icons.mjs
index 3a5b35b..36379eb 100644
--- a/scripts/icons.js
+++ b/scripts/icons.mjs
@@ -2,8 +2,8 @@ import path from 'path';
 import fs from 'fs/promises';
 import {transform} from '@svgr/core';
 
-import {ICONS_DIR, SVGS_DIR} from './constants.js';
-import {cleanDir, getComponentName, prettify} from './utils.js';
+import {ICONS_DIR, SVGS_DIR} from './constants.mjs';
+import {cleanDir, getComponentName, prettify} from './utils.mjs';
 
 async function createIndexFile(files) {
     const indexFile = path.join(ICONS_DIR, 'index.ts');
diff --git a/scripts/utils.js b/scripts/utils.mjs
similarity index 100%
rename from scripts/utils.js
rename to scripts/utils.mjs