From 5239d491a8f56411a4fb14d2fe2c434bf6ba5d29 Mon Sep 17 00:00:00 2001 From: "grafana-delivery-bot[bot]" <132647405+grafana-delivery-bot[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 16:30:56 +0100 Subject: [PATCH] [v11.0.x] Saga-icons: Switch to ESM (#86191) Saga-icons: Switch to ESM (#84875) (cherry picked from commit 0f6858709b74d5e12ff7e7b82c34d72014fc9182) Co-authored-by: Alex Khomenko --- .yarnrc.yml | 12 ++++++------ packages/grafana-icons/{.svgrrc.js => .svgrrc.cjs} | 4 ++-- packages/grafana-icons/package.json | 4 ++-- .../grafana-icons/templates/{icon.js => icon.cjs} | 0 .../grafana-icons/templates/{index.js => index.cjs} | 0 5 files changed, 10 insertions(+), 10 deletions(-) rename packages/grafana-icons/{.svgrrc.js => .svgrrc.cjs} (86%) rename packages/grafana-icons/templates/{icon.js => icon.cjs} (100%) rename packages/grafana-icons/templates/{index.js => index.cjs} (100%) diff --git a/.yarnrc.yml b/.yarnrc.yml index 4f0f49b98d0..017d8b0c4f0 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -44,9 +44,9 @@ plugins: yarnPath: .yarn/releases/yarn-4.1.0.cjs # Uncomment the following lines if you want to use Verdaccio local npm registry. Read more at packages/README.md -# npmScopes: -# grafana: -# npmRegistryServer: http://localhost:4873 - -# unsafeHttpWhitelist: -# - 'localhost' +#npmScopes: +# grafana: +# npmRegistryServer: http://localhost:4873 +# +#unsafeHttpWhitelist: +# - 'localhost' diff --git a/packages/grafana-icons/.svgrrc.js b/packages/grafana-icons/.svgrrc.cjs similarity index 86% rename from packages/grafana-icons/.svgrrc.js rename to packages/grafana-icons/.svgrrc.cjs index 54882c8e9c3..2c1c29451bf 100644 --- a/packages/grafana-icons/.svgrrc.js +++ b/packages/grafana-icons/.svgrrc.cjs @@ -6,8 +6,8 @@ module.exports = { typescript: true, jsxRuntime: 'automatic', outDir: './src/icons-gen', - template: require('./templates/icon'), - indexTemplate: require('./templates/index'), + template: require('./templates/icon.cjs'), + indexTemplate: require('./templates/index.cjs'), memo: true, svgoConfig: { plugins: [ diff --git a/packages/grafana-icons/package.json b/packages/grafana-icons/package.json index c7f274121cc..163deb36ee4 100644 --- a/packages/grafana-icons/package.json +++ b/packages/grafana-icons/package.json @@ -11,11 +11,11 @@ "url": "https://github.com/grafana/grafana.git", "directory": "packages/grafana-icons" }, + "type": "module", "main": "src/index.ts", "types": "src/index.ts", "publishConfig": { "main": "dist/index.js", - "module": "dist/index.js", "types": "dist/index.d.ts", "access": "public" }, @@ -27,7 +27,7 @@ ], "scripts": { "clean": "rimraf ./dist ./compiled ./package.tgz ./src/icons-gen", - "generate": "yarn clean && npx @svgr/cli ./svg && mv ./src/icons-gen/index.ts ./src", + "generate": "yarn clean && npx @svgr/cli ./svg --silent && mv ./src/icons-gen/index.ts ./src", "typecheck": "tsc --emitDeclarationOnly false --noEmit", "lint": "eslint --ext .ts,.tsx ./src", "prettier:check": "prettier --check --list-different=false --log-level=warn \"**/*.{ts,tsx,scss,md,mdx,json}\"", diff --git a/packages/grafana-icons/templates/icon.js b/packages/grafana-icons/templates/icon.cjs similarity index 100% rename from packages/grafana-icons/templates/icon.js rename to packages/grafana-icons/templates/icon.cjs diff --git a/packages/grafana-icons/templates/index.js b/packages/grafana-icons/templates/index.cjs similarity index 100% rename from packages/grafana-icons/templates/index.js rename to packages/grafana-icons/templates/index.cjs