From dd9daa31338ddf487acc4a5daaf2e926d6e47566 Mon Sep 17 00:00:00 2001 From: Lucas Caton Date: Sun, 20 Sep 2020 11:47:40 +1000 Subject: [PATCH 1/7] Fix version from CHANGELOG (#2387) --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e554dd8ce71e..ea324fb2787c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -927,7 +927,7 @@ No release notes - Everything! [unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v1.8.10...HEAD -[1.8.9]: https://github.com/tailwindlabs/tailwindcss/compare/v1.8.9...v1.8.10 +[1.8.10]: https://github.com/tailwindlabs/tailwindcss/compare/v1.8.9...v1.8.10 [1.8.9]: https://github.com/tailwindlabs/tailwindcss/compare/v1.8.8...v1.8.9 [1.8.8]: https://github.com/tailwindlabs/tailwindcss/compare/v1.8.7...v1.8.8 [1.8.7]: https://github.com/tailwindlabs/tailwindcss/compare/v1.8.6...v1.8.7 From 0221f2f003875fde44395cecc12cca61b5168231 Mon Sep 17 00:00:00 2001 From: Dexter Marks-Barber Date: Sun, 20 Sep 2020 02:49:30 +0100 Subject: [PATCH 2/7] Automatically add `featureFlags.future` flags to the configuration files whenever the `init` command is ran (#2379) * Add --future flag to CLI * Remove early exit * Always add future flags but commented out - Update replace regex - Remove future CLI flag - Update tests --- __tests__/cli.test.js | 19 ++++++++++++++----- src/cli/commands/init.js | 17 ++++++++++++++--- stubs/defaultConfig.stub.js | 5 +---- stubs/simpleConfig.stub.js | 5 +---- 4 files changed, 30 insertions(+), 16 deletions(-) diff --git a/__tests__/cli.test.js b/__tests__/cli.test.js index 099c9017c9d4..96c2fd9a11f7 100644 --- a/__tests__/cli.test.js +++ b/__tests__/cli.test.js @@ -4,12 +4,11 @@ import cli from '../src/cli/main' import * as constants from '../src/constants' import * as utils from '../src/cli/utils' import runInTempDirectory from '../jest/runInTempDirectory' +import featureFlags from '../src/featureFlags' describe('cli', () => { const inputCssPath = path.resolve(__dirname, 'fixtures/tailwind-input.css') const customConfigPath = path.resolve(__dirname, 'fixtures/custom-config.js') - const defaultConfigFixture = utils.readFile(constants.defaultConfigStubFile) - const simpleConfigFixture = utils.readFile(constants.simpleConfigStubFile) const defaultPostCssConfigFixture = utils.readFile(constants.defaultPostCssConfigStubFile) beforeEach(() => { @@ -21,7 +20,7 @@ describe('cli', () => { it('creates a Tailwind config file', () => { return runInTempDirectory(() => { return cli(['init']).then(() => { - expect(utils.readFile(constants.defaultConfigFile)).toEqual(simpleConfigFixture) + expect(utils.exists(constants.defaultConfigFile)).toEqual(true) }) }) }) @@ -29,7 +28,7 @@ describe('cli', () => { it('creates a Tailwind config file and a postcss.config.js file', () => { return runInTempDirectory(() => { return cli(['init', '-p']).then(() => { - expect(utils.readFile(constants.defaultConfigFile)).toEqual(simpleConfigFixture) + expect(utils.exists(constants.defaultConfigFile)).toEqual(true) expect(utils.readFile(constants.defaultPostCssConfigFile)).toEqual( defaultPostCssConfigFixture ) @@ -40,7 +39,7 @@ describe('cli', () => { it('creates a full Tailwind config file', () => { return runInTempDirectory(() => { return cli(['init', '--full']).then(() => { - expect(utils.readFile(constants.defaultConfigFile)).toEqual(defaultConfigFixture) + expect(utils.exists(constants.defaultConfigFile)).toEqual(true) }) }) }) @@ -94,5 +93,15 @@ describe('cli', () => { expect(process.stdout.write.mock.calls[0][0]).not.toContain('-ms-input-placeholder') }) }) + + it('creates a Tailwind config file with future flags', () => { + return runInTempDirectory(() => { + return cli(['init']).then(() => { + featureFlags.future.forEach(flag => { + expect(utils.readFile(constants.defaultConfigFile)).toContain(`${flag}: true`) + }) + }) + }) + }) }) }) diff --git a/src/cli/commands/init.js b/src/cli/commands/init.js index e85c7c6947f6..b4332f2d5806 100644 --- a/src/cli/commands/init.js +++ b/src/cli/commands/init.js @@ -35,15 +35,26 @@ export function run(cliParams, cliOptions) { return new Promise(resolve => { utils.header() - const full = cliOptions.full const file = cliParams[0] || constants.defaultConfigFile const simplePath = utils.getSimplePath(file) utils.exists(file) && utils.die(colors.file(simplePath), 'already exists.') - const stubFile = full ? constants.defaultConfigStubFile : constants.simpleConfigStubFile + const stubFile = cliOptions.full + ? constants.defaultConfigStubFile + : constants.simpleConfigStubFile - utils.copyFile(stubFile, file) + const config = require(stubFile) + const { future: flags } = require('../../featureFlags').default + + flags.forEach(flag => { + config.future[`// ${flag}`] = true + }) + + utils.writeFile( + file, + `module.exports = ${JSON.stringify(config, null, 2).replace(/"([^-_\d"]+)":/g, '$1:')}\n` + ) utils.log() utils.log(emoji.yes, 'Created Tailwind config file:', colors.file(simplePath)) diff --git a/stubs/defaultConfig.stub.js b/stubs/defaultConfig.stub.js index 6ce6e2066d45..d4f7cae2e517 100644 --- a/stubs/defaultConfig.stub.js +++ b/stubs/defaultConfig.stub.js @@ -1,8 +1,5 @@ module.exports = { - future: { - // removeDeprecatedGapUtilities: true, - // purgeLayersByDefault: true, - }, + future: {}, purge: [], target: 'relaxed', prefix: '', diff --git a/stubs/simpleConfig.stub.js b/stubs/simpleConfig.stub.js index c0826ce5dd2c..34c2e831b1fe 100644 --- a/stubs/simpleConfig.stub.js +++ b/stubs/simpleConfig.stub.js @@ -1,8 +1,5 @@ module.exports = { - future: { - // removeDeprecatedGapUtilities: true, - // purgeLayersByDefault: true, - }, + future: {}, purge: [], theme: { extend: {}, From 0f12737ac2d10c8237da502f5d9387826b14d5ad Mon Sep 17 00:00:00 2001 From: Vinayak Kulkarni Date: Wed, 10 Jun 2020 17:50:05 +0530 Subject: [PATCH 3/7] feat(dependabot): add config file --- .github/dependabot.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000000..ee6f7c898276 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,18 @@ +version: 2 +updates: +- package-ecosystem: npm + directory: "/" + schedule: + interval: daily + time: '00:00' + open-pull-requests-limit: 10 + reviewers: + - adamwathan + assignees: + - adamwathan + labels: + - dependencies + commit-message: + prefix: fix + prefix-development: chore + include: scope From 2a83147902f59a2ec3da9e72544b25e6917f557c Mon Sep 17 00:00:00 2001 From: Vinayak Kulkarni Date: Wed, 26 Aug 2020 17:27:17 +0530 Subject: [PATCH 4/7] fix: alignment issue --- .github/dependabot.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ee6f7c898276..c3267f0f6614 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,11 +7,11 @@ updates: time: '00:00' open-pull-requests-limit: 10 reviewers: - - adamwathan + - adamwathan assignees: - - adamwathan + - adamwathan labels: - - dependencies + - dependencies commit-message: prefix: fix prefix-development: chore From 003cf2904cdf5d672662d71d6cc8577d4f81e084 Mon Sep 17 00:00:00 2001 From: Vinayak Kulkarni Date: Wed, 9 Sep 2020 13:10:04 +0530 Subject: [PATCH 5/7] fix: remove manual settings for adding label --- .github/dependabot.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c3267f0f6614..80c0175db070 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,8 +10,6 @@ updates: - adamwathan assignees: - adamwathan - labels: - - dependencies commit-message: prefix: fix prefix-development: chore From 1aabc827f602a55b1b309ef0b35d13525cec96a2 Mon Sep 17 00:00:00 2001 From: Vinayak Kulkarni Date: Wed, 9 Sep 2020 13:10:17 +0530 Subject: [PATCH 6/7] feat: add `github-actions` ecosystem --- .github/dependabot.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 80c0175db070..7db55b4b8c64 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -14,3 +14,17 @@ updates: prefix: fix prefix-development: chore include: scope +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + time: '00:00' + open-pull-requests-limit: 10 + reviewers: + - adamwathan + assignees: + - adamwathan + commit-message: + prefix: fix + prefix-development: chore + include: scope From a1984ed6ee277b9e4b5638b5916c46670d68eead Mon Sep 17 00:00:00 2001 From: Vinayak Kulkarni Date: Thu, 10 Sep 2020 17:16:23 +0530 Subject: [PATCH 7/7] fix: add comments to differentiate ecosystems --- .github/dependabot.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7db55b4b8c64..ef449d8911a7 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,5 +1,6 @@ version: 2 updates: +# Dependabot will automatically update npm packages - package-ecosystem: npm directory: "/" schedule: @@ -14,6 +15,7 @@ updates: prefix: fix prefix-development: chore include: scope +# Dependabot will automatically update packages in GitHub actions - package-ecosystem: github-actions directory: "/" schedule: