From 8df3509d5c56e490b8b0a5358345613a48513ba1 Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Sat, 2 Oct 2021 13:40:40 -0400 Subject: [PATCH 01/23] Loosen tailwindcss peer dependency --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9afce62..c679382 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "prepublishOnly": "node scripts/build.js" }, "peerDependencies": { - "tailwindcss": ">=2.0.0" + "tailwindcss": ">=2.0.0 || >=3.0.0-alpha.1" }, "devDependencies": { "autoprefixer": "10", From c68ecc5d4df4bd57eb14661b96175fc4b3040cb3 Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Sat, 2 Oct 2021 13:40:45 -0400 Subject: [PATCH 02/23] 0.2.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c679382..aaa5aee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tailwindcss/aspect-ratio", - "version": "0.2.1", + "version": "0.2.2", "main": "src/index.js", "license": "MIT", "repository": "https://github.com/tailwindlabs/tailwindcss-aspect-ratio", From 9ef7d5759264266054da6dd483ac3c9f2e445c1a Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Sat, 2 Oct 2021 13:41:45 -0400 Subject: [PATCH 03/23] Update changelog --- CHANGELOG.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index daf2051..49fc462 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Nothing yet! +## [0.2.2] - 2021-10-02 + +### Fixed + +- Fix compatibility with Tailwind CSS v3.0.0-alpha.1 + ## [0.2.1] - 2021-05-24 ### Fixed @@ -49,7 +55,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Initial release! -[unreleased]: https://github.com/tailwindlabs/tailwindcss-aspect-ratio/compare/v0.2.1...HEAD +[unreleased]: https://github.com/tailwindlabs/tailwindcss-aspect-ratio/compare/v0.2.2...HEAD +[0.2.2]: https://github.com/tailwindlabs/tailwindcss-aspect-ratio/compare/v0.2.1...v0.2.2 [0.2.1]: https://github.com/tailwindlabs/tailwindcss-aspect-ratio/compare/v0.2.0...v0.2.1 [0.2.0]: https://github.com/tailwindlabs/tailwindcss-aspect-ratio/compare/v0.1.4...v0.2.0 [0.1.4]: https://github.com/tailwindlabs/tailwindcss-aspect-ratio/compare/v0.1.3...v0.1.4 From b40fcc2507656cbbe207a4e0a6727ef7a9ab4158 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Mon, 4 Oct 2021 16:43:06 +0200 Subject: [PATCH 04/23] add release-insiders workflow --- .github/workflows/release-insiders.yml | 50 ++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/release-insiders.yml diff --git a/.github/workflows/release-insiders.yml b/.github/workflows/release-insiders.yml new file mode 100644 index 0000000..5255dc5 --- /dev/null +++ b/.github/workflows/release-insiders.yml @@ -0,0 +1,50 @@ +name: Release Insiders + +on: + push: + branches: [master] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12] + + steps: + - uses: actions/checkout@v2 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + registry-url: 'https://registry.npmjs.org' + + - name: Use cached node_modules + id: cache + uses: actions/cache@v2 + with: + path: node_modules + key: nodeModules-${{ hashFiles('**/package-lock.json') }}-${{ matrix.node-version }} + restore-keys: | + nodeModules- + + - name: Install dependencies + if: steps.cache.outputs.cache-hit != 'true' + run: npm install + env: + CI: true + + - name: Resolve version + id: vars + run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + + - name: "Version based on commit: 0.0.0-insiders.${{ steps.vars.outputs.sha_short }}" + run: npm version 0.0.0-insiders.${{ steps.vars.outputs.sha_short }} --force --no-git-tag-version + + - name: Publish + run: npm publish --tag insiders + env: + CI: true + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From cf145b4e452030b0b6559b7adea4359dc7434f35 Mon Sep 17 00:00:00 2001 From: Brad Cornes Date: Tue, 5 Oct 2021 15:20:31 +0100 Subject: [PATCH 05/23] Use `matchComponents` API where possible (#26) * Use `matchComponents` API where possible * Add tests * Reuse common styles --- package.json | 5 +- src/index.js | 84 ++++++++++++++++++--------- tests/test.js | 157 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 218 insertions(+), 28 deletions(-) create mode 100644 tests/test.js diff --git a/package.json b/package.json index aaa5aee..354c5bc 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "trailingComma": "es5" }, "scripts": { + "test": "jest", "prepublishOnly": "node scripts/build.js" }, "peerDependencies": { @@ -22,7 +23,9 @@ "devDependencies": { "autoprefixer": "10", "clean-css": "^4.2.1", + "jest": "^27.2.4", "postcss": "^8.2.4", - "tailwindcss": "^2.0.2" + "tailwindcss": "^3.0.0-alpha.1", + "tailwindcss-v2": "npm:tailwindcss@^2.2.16" } } diff --git a/src/index.js b/src/index.js index 572fefb..a217a70 100644 --- a/src/index.js +++ b/src/index.js @@ -1,9 +1,62 @@ const plugin = require('tailwindcss/plugin') +const baseStyles = { + position: 'relative', + paddingBottom: `calc(var(--tw-aspect-h) / var(--tw-aspect-w) * 100%)`, +} + +const childStyles = { + position: 'absolute', + height: '100%', + width: '100%', + top: '0', + right: '0', + bottom: '0', + left: '0', +} + +const noneComponent = { + '.aspect-none': { + position: 'static', + paddingBottom: '0', + }, + '.aspect-none > *': { + position: 'static', + height: 'auto', + width: 'auto', + top: 'auto', + right: 'auto', + bottom: 'auto', + left: 'auto', + }, +} + const aspectRatio = plugin( - function ({ addComponents, theme, variants, e }) { + function ({ addComponents, matchComponents, theme, variants, e }) { const values = theme('aspectRatio') + if (matchComponents) { + matchComponents( + { + 'aspect-w': (value) => [ + { + ...baseStyles, + '--tw-aspect-w': value, + }, + { + '> *': childStyles, + }, + ], + 'aspect-h': (value) => ({ '--tw-aspect-h': value }), + }, + { values } + ) + + addComponents(noneComponent) + + return + } + const baseSelectors = Object.entries(values) .map(([key, value]) => { return `.${e(`aspect-w-${key}`)}` @@ -19,33 +72,10 @@ const aspectRatio = plugin( addComponents( [ { - [baseSelectors]: { - position: 'relative', - paddingBottom: `calc(var(--tw-aspect-h) / var(--tw-aspect-w) * 100%)`, - }, - [childSelectors]: { - position: 'absolute', - height: '100%', - width: '100%', - top: '0', - right: '0', - bottom: '0', - left: '0', - }, - '.aspect-none': { - position: 'static', - paddingBottom: '0', - }, - '.aspect-none > *': { - position: 'static', - height: 'auto', - width: 'auto', - top: 'auto', - right: 'auto', - bottom: 'auto', - left: 'auto', - }, + [baseSelectors]: baseStyles, + [childSelectors]: childStyles, }, + noneComponent, Object.entries(values).map(([key, value]) => { return { [`.${e(`aspect-w-${key}`)}`]: { diff --git a/tests/test.js b/tests/test.js new file mode 100644 index 0000000..0142395 --- /dev/null +++ b/tests/test.js @@ -0,0 +1,157 @@ +const postcss = require('postcss') + +let expectedV3 = ` +.aspect-w-1 { + position: relative; + padding-bottom: calc(var(--tw-aspect-h) / var(--tw-aspect-w) * 100%); + --tw-aspect-w: 1 +} +.aspect-w-1 > * { + position: absolute; + height: 100%; + width: 100%; + top: 0; + right: 0; + bottom: 0; + left: 0 +} +.aspect-w-2 { + position: relative; + padding-bottom: calc(var(--tw-aspect-h) / var(--tw-aspect-w) * 100%); + --tw-aspect-w: 2 +} +.aspect-w-2 > * { + position: absolute; + height: 100%; + width: 100%; + top: 0; + right: 0; + bottom: 0; + left: 0 +} +.aspect-h-2 { + --tw-aspect-h: 2 +} +.aspect-w-\\[123\\] { + position: relative; + padding-bottom: calc(var(--tw-aspect-h) / var(--tw-aspect-w) * 100%); + --tw-aspect-w: 123 +} +.aspect-w-\\[123\\] > * { + position: absolute; + height: 100%; + width: 100%; + top: 0; + right: 0; + bottom: 0; + left: 0 +} +.aspect-w-\\[var\\(--width\\)\\] { + position: relative; + padding-bottom: calc(var(--tw-aspect-h) / var(--tw-aspect-w) * 100%); + --tw-aspect-w: var(--width) +} +.aspect-w-\\[var\\(--width\\)\\] > * { + position: absolute; + height: 100%; + width: 100%; + top: 0; + right: 0; + bottom: 0; + left: 0 +} +.aspect-h-\\[123\\] { + --tw-aspect-h: 123 +} +.aspect-h-\\[var\\(--height\\)\\] { + --tw-aspect-h: var(--height) +} +.aspect-none { + position: static; + padding-bottom: 0 +} +.aspect-none > * { + position: static; + height: auto; + width: auto; + top: auto; + right: auto; + bottom: auto; + left: auto +} +` + +it('v3', () => { + let css = postcss([ + require('tailwindcss')({ + content: [ + { + raw: 'aspect-none aspect-w-1 aspect-w-2 aspect-h-2 aspect-w-[123] aspect-w-[var(--width)] aspect-h-[123] aspect-h-[var(--height)]', + }, + ], + plugins: [require('../')], + }), + ]).process('@tailwind components').css + + expect(css).toBe(expectedV3.trim()) +}) + +let expectedV2 = ` +.aspect-w-1, +.aspect-w-2 { + position: relative; + padding-bottom: calc(var(--tw-aspect-h) / var(--tw-aspect-w) * 100%) +} + +.aspect-w-1 > *, +.aspect-w-2 > * { + position: absolute; + height: 100%; + width: 100%; + top: 0; + right: 0; + bottom: 0; + left: 0 +} + +.aspect-none { + position: static; + padding-bottom: 0 +} + +.aspect-none > * { + position: static; + height: auto; + width: auto; + top: auto; + right: auto; + bottom: auto; + left: auto +} + +.aspect-w-1 { + --tw-aspect-w: 1 +} + +.aspect-w-2 { + --tw-aspect-w: 2 +} + +.aspect-h-2 { + --tw-aspect-h: 2 +} +` + +it('v2', () => { + postcss([ + require('tailwindcss-v2')({ + purge: { enabled: true, content: [{ raw: 'aspect-none aspect-w-1 aspect-w-2 aspect-h-2' }] }, + variants: [], + plugins: [require('../')], + }), + ]) + .process('@tailwind components', { from: undefined }) + .then(({ css }) => { + expect(css).toBe(expectedV2.trim()) + }) +}) From 74eca8af6a26d383d18e00b8369638aa6e4fa8a4 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Tue, 5 Oct 2021 16:29:58 +0200 Subject: [PATCH 06/23] trigger insiders build From 2c5dfbb17301e005d1857f0a3d61aaea24120f76 Mon Sep 17 00:00:00 2001 From: Brad Cornes Date: Tue, 5 Oct 2021 15:36:54 +0100 Subject: [PATCH 07/23] Update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49fc462..e19ae08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Nothing yet! +## [0.3.0] - 2021-10-05 + +### Added + +- Support arbitrary values in Tailwind CSS v3.0.0-alpha.1, via the new `matchComponents` API + ## [0.2.2] - 2021-10-02 ### Fixed From 84dc3a18aca31b318bcdf7c54902d5d0246ebd49 Mon Sep 17 00:00:00 2001 From: Brad Cornes Date: Tue, 5 Oct 2021 15:39:28 +0100 Subject: [PATCH 08/23] 0.3.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 354c5bc..3b146e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tailwindcss/aspect-ratio", - "version": "0.2.2", + "version": "0.3.0", "main": "src/index.js", "license": "MIT", "repository": "https://github.com/tailwindlabs/tailwindcss-aspect-ratio", From ae97a2524706e457926c5f49dc880946c1cc065a Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Thu, 9 Dec 2021 17:39:41 +0100 Subject: [PATCH 09/23] make sure 3.0.0 is listed in peerDependencies --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3b146e8..a60f509 100644 --- a/package.json +++ b/package.json @@ -18,14 +18,14 @@ "prepublishOnly": "node scripts/build.js" }, "peerDependencies": { - "tailwindcss": ">=2.0.0 || >=3.0.0-alpha.1" + "tailwindcss": ">=2.0.0 || >=3.0.0 || >=3.0.0-alpha.1" }, "devDependencies": { "autoprefixer": "10", "clean-css": "^4.2.1", "jest": "^27.2.4", "postcss": "^8.2.4", - "tailwindcss": "^3.0.0-alpha.1", + "tailwindcss": "^3.0.0", "tailwindcss-v2": "npm:tailwindcss@^2.2.16" } } From 51471daaf9fe7499f68b5b38c1b507c153ca9e1a Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Thu, 9 Dec 2021 17:42:25 +0100 Subject: [PATCH 10/23] update changelog --- CHANGELOG.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e19ae08..2acbd8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Nothing yet! +## [0.4.0] - 2021-12-09 + +### Added + +- Make sure that Tailwind CSS v3 is in peerDependencies ([ae97a25](https://github.com/tailwindlabs/tailwindcss-aspect-ratio/commit/ae97a25)) + ## [0.3.0] - 2021-10-05 ### Added @@ -61,7 +67,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Initial release! -[unreleased]: https://github.com/tailwindlabs/tailwindcss-aspect-ratio/compare/v0.2.2...HEAD +[unreleased]: https://github.com/tailwindlabs/tailwindcss-aspect-ratio/compare/v0.4.0...HEAD +[0.4.0]: https://github.com/tailwindlabs/tailwindcss-aspect-ratio/compare/v0.3.0...v0.4.0 +[0.3.0]: https://github.com/tailwindlabs/tailwindcss-aspect-ratio/compare/v0.2.2...v0.3.0 [0.2.2]: https://github.com/tailwindlabs/tailwindcss-aspect-ratio/compare/v0.2.1...v0.2.2 [0.2.1]: https://github.com/tailwindlabs/tailwindcss-aspect-ratio/compare/v0.2.0...v0.2.1 [0.2.0]: https://github.com/tailwindlabs/tailwindcss-aspect-ratio/compare/v0.1.4...v0.2.0 From 5efa6d450f24b95e0e220dfc19a20d9dcce1ddcd Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Thu, 9 Dec 2021 17:42:49 +0100 Subject: [PATCH 11/23] 0.4.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a60f509..e655174 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tailwindcss/aspect-ratio", - "version": "0.3.0", + "version": "0.4.0", "main": "src/index.js", "license": "MIT", "repository": "https://github.com/tailwindlabs/tailwindcss-aspect-ratio", From a4d3d64e1eb71e9a3dd0579d7a8a20f15bfdde46 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Wed, 15 Dec 2021 16:05:05 +0100 Subject: [PATCH 12/23] Remove `dist` folder and related dependencies (#29) * remove dist folder and related dependencies * update changelog --- CHANGELOG.md | 4 +++- dist/.gitignore | 3 --- dist/.npmignore | 0 package.json | 5 +---- scripts/build.js | 36 ------------------------------------ 5 files changed, 4 insertions(+), 44 deletions(-) delete mode 100644 dist/.gitignore delete mode 100644 dist/.npmignore delete mode 100644 scripts/build.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 2acbd8f..25b2ff1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -- Nothing yet! +### Added + +- Remove `dist` folder and related dependencies ([#29](https://github.com/tailwindlabs/tailwindcss-aspect-ratio/pull/29)) ## [0.4.0] - 2021-12-09 diff --git a/dist/.gitignore b/dist/.gitignore deleted file mode 100644 index 2f41fac..0000000 --- a/dist/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -* -!.gitignore -!.npmignore diff --git a/dist/.npmignore b/dist/.npmignore deleted file mode 100644 index e69de29..0000000 diff --git a/package.json b/package.json index e655174..711a4ae 100644 --- a/package.json +++ b/package.json @@ -14,15 +14,12 @@ "trailingComma": "es5" }, "scripts": { - "test": "jest", - "prepublishOnly": "node scripts/build.js" + "test": "jest" }, "peerDependencies": { "tailwindcss": ">=2.0.0 || >=3.0.0 || >=3.0.0-alpha.1" }, "devDependencies": { - "autoprefixer": "10", - "clean-css": "^4.2.1", "jest": "^27.2.4", "postcss": "^8.2.4", "tailwindcss": "^3.0.0", diff --git a/scripts/build.js b/scripts/build.js deleted file mode 100644 index 8ee5212..0000000 --- a/scripts/build.js +++ /dev/null @@ -1,36 +0,0 @@ -const fs = require('fs') -const postcss = require('postcss') -const tailwind = require('tailwindcss') -const CleanCSS = require('clean-css') - -function buildDistFile(filename) { - return postcss([ - tailwind({ - corePlugins: false, - plugins: [require('../src/index.js')], - }), - require('autoprefixer'), - ]) - .process('@tailwind components', { - from: null, - to: `./dist/${filename}.css`, - map: false, - }) - .then((result) => { - fs.writeFileSync(`./dist/${filename}.css`, result.css) - return result - }) - .then((result) => { - const minified = new CleanCSS().minify(result.css) - fs.writeFileSync(`./dist/${filename}.min.css`, minified.styles) - }) - .catch((error) => { - console.log(error) - }) -} - -console.info('Building CSS...') - -Promise.all([buildDistFile('aspect-ratio')]).then(() => { - console.log('Finished building CSS.') -}) From e7f1a46a38d945a1563ccd245d6ae331f1ddffdb Mon Sep 17 00:00:00 2001 From: Jonathan Reinink Date: Wed, 15 Dec 2021 13:31:47 -0500 Subject: [PATCH 13/23] Add note about compatibility with the default aspect-ratio utilities --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/README.md b/README.md index fdd0713..f259f76 100644 --- a/README.md +++ b/README.md @@ -101,3 +101,42 @@ module.exports = { } } ``` + +## Compatibility with default aspect-ratio utilities + +Tailwind CSS v3.0 shipped with [native aspect-ratio](https://tailwindcss.com/docs/aspect-ratio) support, and while these new utilities are great, the `aspect-ratio` property isn't supported in Safari 14, which still has [significant global usage](https://caniuse.com/mdn-css_properties_aspect-ratio). If you need to support Safari 14, this plugin is still the best way to do that. + +While it's technically possible to use the new native `aspect-ratio` utilities as well as this plugin in the same project, it doesn't really make a lot of sense to do so. If you're able to use the new native aspect-ratio utilities, just use them instead of this plugin, as they are a lot simpler and work much better. + +However, if you do want to use both approaches in your project, maybe as a way of transitioning slowly from the plugin approach to the new native utilities, you'll need to add the following values to your `tailwind.config.js` file: + +```js +module.exports = { + // ... + theme: { + aspectRatio: { + auto: 'auto', + square: '1 / 1', + video: '16 / 9', + 1: '1', + 2: '2', + 3: '3', + 4: '4', + 5: '5', + 6: '6', + 7: '7', + 8: '8', + 9: '9', + 10: '10', + 11: '11', + 12: '12', + 13: '13', + 14: '14', + 15: '15', + 16: '16', + }, + }, +} +``` + +This is necessary, as the default `aspectRatio` values are overwritten by this plugin's values. From 936b849dfafc348bf9431650c6b2fb52a0a584a2 Mon Sep 17 00:00:00 2001 From: Brad Cornes Date: Fri, 25 Feb 2022 14:22:43 +0000 Subject: [PATCH 14/23] Update README.md --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index f259f76..5bb0a35 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,7 @@ A plugin that provides a composable API for giving elements a fixed aspect ratio Install the plugin from npm: ```sh -# Using npm -npm install @tailwindcss/aspect-ratio - -# Using Yarn -yarn add @tailwindcss/aspect-ratio +npm install -D @tailwindcss/aspect-ratio ``` Then add the plugin to your `tailwind.config.js` file: From 573353e01c2b065d9866779bbea735d3135a9af7 Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Thu, 17 Mar 2022 19:58:43 -0400 Subject: [PATCH 15/23] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5bb0a35..338e047 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Install the plugin from npm: npm install -D @tailwindcss/aspect-ratio ``` -Then add the plugin to your `tailwind.config.js` file: +Then add the plugin to your `tailwind.config.js` file, and disable the `aspectRatio` core plugin to avoid conflicts with the native `aspect-ratio` utilities included in Tailwind CSS v3.0: ```js // tailwind.config.js @@ -19,6 +19,9 @@ module.exports = { theme: { // ... }, + corePlugins: { + aspectRatio: false, + }, plugins: [ require('@tailwindcss/aspect-ratio'), // ... From 21f5bf7454ab75486753c07afae4094a3a035d8a Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Thu, 1 Sep 2022 14:01:09 -0400 Subject: [PATCH 16/23] Add typescript types (#33) --- CHANGELOG.md | 1 + package.json | 1 + src/index.d.ts | 2 ++ 3 files changed, 4 insertions(+) create mode 100644 src/index.d.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 25b2ff1..4477a00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Remove `dist` folder and related dependencies ([#29](https://github.com/tailwindlabs/tailwindcss-aspect-ratio/pull/29)) +- Add typescript types ([#33](https://github.com/tailwindlabs/tailwindcss-aspect-ratio/pull/33)) ## [0.4.0] - 2021-12-09 diff --git a/package.json b/package.json index 711a4ae..410b08d 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "@tailwindcss/aspect-ratio", "version": "0.4.0", "main": "src/index.js", + "types": "src/index.d.ts", "license": "MIT", "repository": "https://github.com/tailwindlabs/tailwindcss-aspect-ratio", "publishConfig": { diff --git a/src/index.d.ts b/src/index.d.ts new file mode 100644 index 0000000..1f93420 --- /dev/null +++ b/src/index.d.ts @@ -0,0 +1,2 @@ +declare function plugin(): Function +export = plugin From 9ac0bf15a3f8171b0b69c0f20dc45e46b1c34d27 Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Thu, 1 Sep 2022 14:05:34 -0400 Subject: [PATCH 17/23] update changelog --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4477a00..fd3084d 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! + +## [0.4.1] - 2022-09-01 + ### Added - Remove `dist` folder and related dependencies ([#29](https://github.com/tailwindlabs/tailwindcss-aspect-ratio/pull/29)) @@ -70,7 +74,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Initial release! -[unreleased]: https://github.com/tailwindlabs/tailwindcss-aspect-ratio/compare/v0.4.0...HEAD +[unreleased]: https://github.com/tailwindlabs/tailwindcss-aspect-ratio/compare/v0.4.1...HEAD +[0.4.1]: https://github.com/tailwindlabs/tailwindcss-aspect-ratio/compare/v0.4.0...v0.4.1 [0.4.0]: https://github.com/tailwindlabs/tailwindcss-aspect-ratio/compare/v0.3.0...v0.4.0 [0.3.0]: https://github.com/tailwindlabs/tailwindcss-aspect-ratio/compare/v0.2.2...v0.3.0 [0.2.2]: https://github.com/tailwindlabs/tailwindcss-aspect-ratio/compare/v0.2.1...v0.2.2 From 74c4244c00fd85771b281998d62ed25e33be9e2d Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Thu, 1 Sep 2022 14:05:34 -0400 Subject: [PATCH 18/23] 0.4.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 410b08d..148cb37 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tailwindcss/aspect-ratio", - "version": "0.4.0", + "version": "0.4.1", "main": "src/index.js", "types": "src/index.d.ts", "license": "MIT", From cf1924f5cea6137314623fa1b864e066c05c1fae Mon Sep 17 00:00:00 2001 From: Brad Cornes Date: Fri, 2 Sep 2022 12:23:46 +0100 Subject: [PATCH 19/23] Update TypeScript types (#34) * Update types * Update changelog --- CHANGELOG.md | 4 +++- src/index.d.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd3084d..8adf92d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -- Nothing yet! +### Fixed + +- Update TypeScript types ([#34](https://github.com/tailwindlabs/tailwindcss-aspect-ratio/pull/34)) ## [0.4.1] - 2022-09-01 diff --git a/src/index.d.ts b/src/index.d.ts index 1f93420..c23a9a3 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -1,2 +1,2 @@ -declare function plugin(): Function +declare const plugin: { handler: () => void } export = plugin From bd273eb005cdbfcf885a7cf45c9eebe38de085a5 Mon Sep 17 00:00:00 2001 From: Brad Cornes Date: Fri, 2 Sep 2022 12:28:46 +0100 Subject: [PATCH 20/23] Update changelog --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8adf92d..03eee30 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! + +## [0.4.2] - 2022-09-02 + ### Fixed - Update TypeScript types ([#34](https://github.com/tailwindlabs/tailwindcss-aspect-ratio/pull/34)) @@ -76,7 +80,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Initial release! -[unreleased]: https://github.com/tailwindlabs/tailwindcss-aspect-ratio/compare/v0.4.1...HEAD +[unreleased]: https://github.com/tailwindlabs/tailwindcss-aspect-ratio/compare/v0.4.2...HEAD +[0.4.2]: https://github.com/tailwindlabs/tailwindcss-aspect-ratio/compare/v0.4.1...v0.4.2 [0.4.1]: https://github.com/tailwindlabs/tailwindcss-aspect-ratio/compare/v0.4.0...v0.4.1 [0.4.0]: https://github.com/tailwindlabs/tailwindcss-aspect-ratio/compare/v0.3.0...v0.4.0 [0.3.0]: https://github.com/tailwindlabs/tailwindcss-aspect-ratio/compare/v0.2.2...v0.3.0 From c9027ad30f8cd19fc259f596bada3a090230a15a Mon Sep 17 00:00:00 2001 From: Brad Cornes Date: Fri, 2 Sep 2022 12:28:59 +0100 Subject: [PATCH 21/23] 0.4.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 148cb37..f9fab69 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tailwindcss/aspect-ratio", - "version": "0.4.1", + "version": "0.4.2", "main": "src/index.js", "types": "src/index.d.ts", "license": "MIT", From ca458c3daf5fefcf1e80be948ab319b2bea322ef Mon Sep 17 00:00:00 2001 From: Dishan Sachin <134765302+dishansa@users.noreply.github.com> Date: Sat, 26 Aug 2023 16:38:39 +0530 Subject: [PATCH 22/23] Add LICENSE (#37) --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9ed6725 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Tailwind Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From b2a9d02229946f3430c0013198be2affa7a175da Mon Sep 17 00:00:00 2001 From: saibotk Date: Fri, 22 Mar 2024 18:16:26 +0100 Subject: [PATCH 23/23] ci: add provenance to insider packages (#38) This commit adds provenance for insider packages. See the NPM documentation [0]. Provenance will allow people to verify that the packages were actually built on GH Actions and with the content of the corresponding commit. This will help with supply chain security. For this to work, the `id-token` permission was added only where necessary. [0]: https://docs.npmjs.com/generating-provenance-statements --- .github/workflows/release-insiders.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-insiders.yml b/.github/workflows/release-insiders.yml index 5255dc5..2d77e8e 100644 --- a/.github/workflows/release-insiders.yml +++ b/.github/workflows/release-insiders.yml @@ -4,6 +4,10 @@ on: push: branches: [master] +permissions: + contents: read + id-token: write + jobs: build: runs-on: ubuntu-latest @@ -40,11 +44,11 @@ jobs: id: vars run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" - - name: "Version based on commit: 0.0.0-insiders.${{ steps.vars.outputs.sha_short }}" + - name: 'Version based on commit: 0.0.0-insiders.${{ steps.vars.outputs.sha_short }}' run: npm version 0.0.0-insiders.${{ steps.vars.outputs.sha_short }} --force --no-git-tag-version - name: Publish - run: npm publish --tag insiders + run: npm publish --provenance --tag insiders env: CI: true NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}