Description: export commonjs file
 This patch add a commonjs file which keep old chalk behaviour
Author: Yadd <yadd@debian.org>
Forwarded: not-needed
Last-Update: 2022-12-02

--- a/package.json
+++ b/package.json
@@ -7,12 +7,15 @@
 	"funding": "https://github.com/chalk/chalk?sponsor=1",
 	"type": "module",
 	"main": "./source/index.js",
-	"exports": "./source/index.js",
+	"module": "./source/index.js",
+	"exports": {
+		"import": "./source/index.js",
+		"require": "./cjs/index.cjs"
+	},
 	"imports": {
 		"#ansi-styles": "./source/vendor/ansi-styles/index.js",
 		"#supports-color": {
-			"node": "./source/vendor/supports-color/index.js",
-			"default": "./source/vendor/supports-color/browser.js"
+			"default": "./source/vendor/supports-color/index.js"
 		}
 	},
 	"types": "./source/index.d.ts",
@@ -25,6 +28,7 @@
 		"bench": "matcha benchmark.js"
 	},
 	"files": [
+		"cjs",
 		"source",
 		"!source/index.test-d.ts"
 	],
--- /dev/null
+++ b/source/cjs.cjs
@@ -0,0 +1,12 @@
+const c = require('./index.js');
+
+const m = c.default;
+Object.keys(c).forEach(k => {
+  if( k === '__proto___') {
+    Object.setPrototypeOf(m, Object.getPrototypeOf(c));
+  } else {
+    m[k] = c[k];
+  }
+})
+m.Instance = c.Chalk;
+module.exports = m;
