From 1765c5608205c0766599441834e4a337ffa88335 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jan 2023 11:24:05 +0100 Subject: [PATCH 1/8] Bump json5 from 2.2.1 to 2.2.3 (#909) Bumps [json5](https://github.com/json5/json5) from 2.2.1 to 2.2.3. - [Release notes](https://github.com/json5/json5/releases) - [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md) - [Commits](https://github.com/json5/json5/compare/v2.2.1...v2.2.3) --- updated-dependencies: - dependency-name: json5 dependency-type: indirect ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8df13ab2e..6eb1223e9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "heroicons", - "version": "2.0.12", + "version": "2.0.13", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "heroicons", - "version": "2.0.12", + "version": "2.0.13", "license": "MIT", "devDependencies": { "@babel/core": "^7.12.10", @@ -1553,9 +1553,9 @@ "dev": true }, "node_modules/json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, "bin": { "json5": "lib/cli.js" @@ -3150,9 +3150,9 @@ "dev": true }, "json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true }, "lines-and-columns": { From edb9526147c41f60aa6e8c4fd7b0644055e01717 Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Wed, 25 Jan 2023 12:00:20 -0500 Subject: [PATCH 2/8] Add exports field (#920) --- react/package.json | 94 +++++++++++++++++++++++++++++++++++++++++++++- scripts/build.js | 60 +++++++++++++++++++++++++++++ vue/package.json | 94 +++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 246 insertions(+), 2 deletions(-) diff --git a/react/package.json b/react/package.json index fc6db5cf3..46adc61fb 100644 --- a/react/package.json +++ b/react/package.json @@ -15,10 +15,102 @@ "solid", "outline" ], + "exports": { + "./package.json": { + "default": "./package.json" + }, + "./outline": { + "default": "./outline/index.js" + }, + "./outline/index": { + "default": "./outline/index.js" + }, + "./outline/index.js": { + "default": "./outline/index.js" + }, + "./solid": { + "default": "./solid/index.js" + }, + "./solid/index": { + "default": "./solid/index.js" + }, + "./solid/index.js": { + "default": "./solid/index.js" + }, + "./20/solid": { + "types": "./20/solid/index.d.ts", + "import": "./20/solid/index.js", + "require": "./20/solid/index.js" + }, + "./20/solid/*": { + "types": "./20/solid/*.d.ts", + "import": "./20/solid/esm/*.js", + "require": "./20/solid/*.js" + }, + "./20/solid/*.js": { + "types": "./20/solid/*.d.ts", + "import": "./20/solid/esm/*.js", + "require": "./20/solid/*.js" + }, + "./20/solid/esm/*": { + "types": "./20/solid/*.d.ts", + "import": "./20/solid/esm/*.js" + }, + "./20/solid/esm/*.js": { + "types": "./20/solid/*.d.ts", + "import": "./20/solid/esm/*.js" + }, + "./24/outline": { + "types": "./24/outline/index.d.ts", + "import": "./24/outline/index.js", + "require": "./24/outline/index.js" + }, + "./24/outline/*": { + "types": "./24/outline/*.d.ts", + "import": "./24/outline/esm/*.js", + "require": "./24/outline/*.js" + }, + "./24/outline/*.js": { + "types": "./24/outline/*.d.ts", + "import": "./24/outline/esm/*.js", + "require": "./24/outline/*.js" + }, + "./24/outline/esm/*": { + "types": "./24/outline/*.d.ts", + "import": "./24/outline/esm/*.js" + }, + "./24/outline/esm/*.js": { + "types": "./24/outline/*.d.ts", + "import": "./24/outline/esm/*.js" + }, + "./24/solid": { + "types": "./24/solid/index.d.ts", + "import": "./24/solid/index.js", + "require": "./24/solid/index.js" + }, + "./24/solid/*": { + "types": "./24/solid/*.d.ts", + "import": "./24/solid/esm/*.js", + "require": "./24/solid/*.js" + }, + "./24/solid/*.js": { + "types": "./24/solid/*.d.ts", + "import": "./24/solid/esm/*.js", + "require": "./24/solid/*.js" + }, + "./24/solid/esm/*": { + "types": "./24/solid/*.d.ts", + "import": "./24/solid/esm/*.js" + }, + "./24/solid/esm/*.js": { + "types": "./24/solid/*.d.ts", + "import": "./24/solid/esm/*.js" + } + }, "publishConfig": { "access": "public" }, "peerDependencies": { "react": ">= 16" } -} +} \ No newline at end of file diff --git a/scripts/build.js b/scripts/build.js index 859191373..fad76ebc1 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -108,6 +108,56 @@ async function buildIcons(package, style, format) { await ensureWrite(`${outDir}/index.d.ts`, exportAll(icons, 'esm', false)) } +/** + * @param {string[]} styles + */ +async function buildExports(styles) { + let pkg = {} + + // For those that want to read the version from package.json + pkg[`./package.json`] = { "default": "./package.json" } + + // Backwards compatibility with v1 imports (points to proxy that prints an error message): + pkg["./outline"] = { "default": "./outline/index.js" } + pkg["./outline/index"] = { "default": "./outline/index.js" } + pkg["./outline/index.js"] = { "default": "./outline/index.js" } + pkg["./solid"] = { "default": "./solid/index.js" } + pkg["./solid/index"] = { "default": "./solid/index.js" } + pkg["./solid/index.js"] = { "default": "./solid/index.js" } + + // Explicit exports for each style: + for (let style of styles) { + pkg[`./${style}`] = { + "types": `./${style}/index.d.ts`, + "import": `./${style}/index.js`, + "require": `./${style}/index.js` + } + pkg[`./${style}/*`] = { + "types": `./${style}/*.d.ts`, + "import": `./${style}/esm/*.js`, + "require": `./${style}/*.js` + } + pkg[`./${style}/*.js`] = { + "types": `./${style}/*.d.ts`, + "import": `./${style}/esm/*.js`, + "require": `./${style}/*.js` + } + + // This dir is basically an implementation detail, but it's needed for + // backwards compatibility in case people were importing from it directly. + pkg[`./${style}/esm/*`] = { + "types": `./${style}/*.d.ts`, + "import": `./${style}/esm/*.js` + } + pkg[`./${style}/esm/*.js`] = { + "types": `./${style}/*.d.ts`, + "import": `./${style}/esm/*.js` + } + } + + return pkg +} + async function main(package) { const cjsPackageJson = { module: './esm/index.js', sideEffects: false } const esmPackageJson = { type: 'module', sideEffects: false } @@ -135,6 +185,16 @@ async function main(package) { ensureWriteJson(`./${package}/24/solid/package.json`, cjsPackageJson), ]) + let packageJson = JSON.parse(await fs.readFile(`./${package}/package.json`, 'utf8')) + + packageJson.exports = await buildExports([ + '20/solid', + '24/outline', + '24/solid', + ]) + + await ensureWriteJson(`./${package}/package.json`, packageJson) + return console.log(`Finished building ${package} package.`) } diff --git a/vue/package.json b/vue/package.json index 64059e9b2..9d87e1f97 100644 --- a/vue/package.json +++ b/vue/package.json @@ -15,10 +15,102 @@ "outline", "solid" ], + "exports": { + "./package.json": { + "default": "./package.json" + }, + "./outline": { + "default": "./outline/index.js" + }, + "./outline/index": { + "default": "./outline/index.js" + }, + "./outline/index.js": { + "default": "./outline/index.js" + }, + "./solid": { + "default": "./solid/index.js" + }, + "./solid/index": { + "default": "./solid/index.js" + }, + "./solid/index.js": { + "default": "./solid/index.js" + }, + "./20/solid": { + "types": "./20/solid/index.d.ts", + "import": "./20/solid/index.js", + "require": "./20/solid/index.js" + }, + "./20/solid/*": { + "types": "./20/solid/*.d.ts", + "import": "./20/solid/esm/*.js", + "require": "./20/solid/*.js" + }, + "./20/solid/*.js": { + "types": "./20/solid/*.d.ts", + "import": "./20/solid/esm/*.js", + "require": "./20/solid/*.js" + }, + "./20/solid/esm/*": { + "types": "./20/solid/*.d.ts", + "import": "./20/solid/esm/*.js" + }, + "./20/solid/esm/*.js": { + "types": "./20/solid/*.d.ts", + "import": "./20/solid/esm/*.js" + }, + "./24/outline": { + "types": "./24/outline/index.d.ts", + "import": "./24/outline/index.js", + "require": "./24/outline/index.js" + }, + "./24/outline/*": { + "types": "./24/outline/*.d.ts", + "import": "./24/outline/esm/*.js", + "require": "./24/outline/*.js" + }, + "./24/outline/*.js": { + "types": "./24/outline/*.d.ts", + "import": "./24/outline/esm/*.js", + "require": "./24/outline/*.js" + }, + "./24/outline/esm/*": { + "types": "./24/outline/*.d.ts", + "import": "./24/outline/esm/*.js" + }, + "./24/outline/esm/*.js": { + "types": "./24/outline/*.d.ts", + "import": "./24/outline/esm/*.js" + }, + "./24/solid": { + "types": "./24/solid/index.d.ts", + "import": "./24/solid/index.js", + "require": "./24/solid/index.js" + }, + "./24/solid/*": { + "types": "./24/solid/*.d.ts", + "import": "./24/solid/esm/*.js", + "require": "./24/solid/*.js" + }, + "./24/solid/*.js": { + "types": "./24/solid/*.d.ts", + "import": "./24/solid/esm/*.js", + "require": "./24/solid/*.js" + }, + "./24/solid/esm/*": { + "types": "./24/solid/*.d.ts", + "import": "./24/solid/esm/*.js" + }, + "./24/solid/esm/*.js": { + "types": "./24/solid/*.d.ts", + "import": "./24/solid/esm/*.js" + } + }, "publishConfig": { "access": "public" }, "peerDependencies": { "vue": ">= 3" } -} +} \ No newline at end of file From f53375d9f9b8948c45e93ba1977fdf6af9d98180 Mon Sep 17 00:00:00 2001 From: Alexander Nanberg Date: Wed, 25 Jan 2023 18:17:48 +0100 Subject: [PATCH 3/8] Fix React ref type (#903) --- scripts/build.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build.js b/scripts/build.js index fad76ebc1..62d09d84e 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -93,7 +93,7 @@ async function buildIcons(package, style, format) { let content = await transform[package](svg, componentName, format) let types = package === 'react' - ? `import * as React from 'react';\ndeclare function ${componentName}(props: React.ComponentProps<'svg'> & { title?: string, titleId?: string }): JSX.Element;\nexport default ${componentName};\n` + ? `import * as React from 'react';\ndeclare const ${componentName}: React.ForwardRefExoticComponent & { title?: string, titleId?: string }>;\nexport default ${componentName};\n` : `import type { FunctionalComponent, HTMLAttributes, VNodeProps } from 'vue';\ndeclare const ${componentName}: FunctionalComponent;\nexport default ${componentName};\n` return [ From b1a35fe3eded1ffb65065d7d784e996658b9d5f0 Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Wed, 25 Jan 2023 12:27:04 -0500 Subject: [PATCH 4/8] Update changelog --- CHANGELOG.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6fb7dce8..a1b3f566a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -- Nothing yet! +### Fixed + +- Fix React ref types ([#903](https://github.com/tailwindlabs/heroicons/pull/903)) + +### Changed + +- Specify explicit package exports ([#920](https://github.com/tailwindlabs/heroicons/pull/920)) ## [2.0.13] - 2022-11-02 From 82593a4fa8e2438601e234f61dfc2af2db6e1543 Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Wed, 25 Jan 2023 15:11:00 -0500 Subject: [PATCH 5/8] update changelog --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1b3f566a..978948da3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +- Nothing yet! + +## [2.0.14] - 2023-01-25 + ### Fixed - Fix React ref types ([#903](https://github.com/tailwindlabs/heroicons/pull/903)) @@ -196,7 +200,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Everything! -[unreleased]: https://github.com/tailwindlabs/heroicons/compare/v2.0.13...HEAD +[unreleased]: https://github.com/tailwindlabs/heroicons/compare/v2.0.14...HEAD +[2.0.14]: https://github.com/tailwindlabs/heroicons/compare/v2.0.13...v2.0.14 [2.0.13]: https://github.com/tailwindlabs/heroicons/compare/v2.0.12...v2.0.13 [2.0.12]: https://github.com/tailwindlabs/heroicons/compare/v2.0.11...v2.0.12 [2.0.11]: https://github.com/tailwindlabs/heroicons/compare/v2.0.10...v2.0.11 From 421f8f545d19668c832e3b51a3605ec82164c88e Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Wed, 25 Jan 2023 15:11:01 -0500 Subject: [PATCH 6/8] 2.0.14 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6eb1223e9..865baed7e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "heroicons", - "version": "2.0.13", + "version": "2.0.14", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "heroicons", - "version": "2.0.13", + "version": "2.0.14", "license": "MIT", "devDependencies": { "@babel/core": "^7.12.10", diff --git a/package.json b/package.json index fedb51839..0cbaba427 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "heroicons", - "version": "2.0.13", + "version": "2.0.14", "license": "MIT", "files": [ "20/", From d93386a68909995339a747217840d4f3c702033b Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Wed, 25 Jan 2023 15:16:10 -0500 Subject: [PATCH 7/8] Update individual package version numbers --- react/package.json | 2 +- vue/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/react/package.json b/react/package.json index 46adc61fb..953c02905 100644 --- a/react/package.json +++ b/react/package.json @@ -1,7 +1,7 @@ { "name": "@heroicons/react", "license": "MIT", - "version": "2.0.13", + "version": "2.0.14", "description": "", "keywords": [], "homepage": "https://github.com/tailwindlabs/heroicons#readme", diff --git a/vue/package.json b/vue/package.json index 9d87e1f97..9b3c2ab28 100644 --- a/vue/package.json +++ b/vue/package.json @@ -1,7 +1,7 @@ { "name": "@heroicons/vue", "license": "MIT", - "version": "2.0.13", + "version": "2.0.14", "description": "", "keywords": [], "homepage": "https://github.com/tailwindlabs/heroicons#readme", From ddb4af0ae0cfdf02ee138c7cd7eeb321fd35fd40 Mon Sep 17 00:00:00 2001 From: Jonathan Reinink Date: Wed, 25 Jan 2023 15:31:50 -0500 Subject: [PATCH 8/8] Add publishing information to contributing docs --- .github/CONTRIBUTING.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/CONTRIBUTING.md diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 000000000..68b1b716e --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,11 @@ +# Contributing + +## Publishing + +This section is intended only for the project maintainers. + +1. Increment the version number in the `package.json`, `./react/package.json` and `./vue/package.json` files. +2. Commit and tag those changes. +3. Push the commit and tag to GitHub. +4. Review the draft release generated by GitHub. +5. Publish the new release on GitHub. This will automatically trigger a GitHub action to publish these packages to NPM.