tailwindcss 1.9.2 → 1.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -1
- package/lib/cli/commands/init.js +3 -12
- package/lib/featureFlags.js +0 -14
- package/lib/lib/evaluateTailwindFunctions.js +4 -0
- package/lib/util/createPlugin.js +5 -1
- package/lib/util/getAllConfigs.js +3 -3
- package/lib/util/processPlugins.js +11 -1
- package/package.json +1 -1
- package/stubs/defaultConfig.stub.js +5 -1
- package/stubs/simpleConfig.stub.js +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,40 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
- Nothing yet!
|
|
11
|
+
|
|
12
|
+
## [1.9.6]
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- The `presets` feature had unexpected behavior where a preset config without its own `presets` key would not extend the default config. ([#2662](https://github.com/tailwindlabs/tailwindcss/pull/2662))
|
|
17
|
+
|
|
18
|
+
If you were depending on this unexpected behavior, just add `presets: []` to your own preset to exclude the default configuration.
|
|
19
|
+
|
|
20
|
+
## [1.9.5]
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- Fix issue where using `theme` with default line-heights did not resolve correctly
|
|
25
|
+
|
|
26
|
+
## [1.9.4]
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- Fix issue changing plugins defined using the `withOptions` API would not trigger rebuilds in watch processes
|
|
31
|
+
|
|
32
|
+
## [1.9.3]
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
|
|
36
|
+
- Fix issue where `tailwindcss init --full` scaffolded a corrupt config file (https://github.com/tailwindlabs/tailwindcss/issues/2556)
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
|
|
40
|
+
- Remove console warnings about upcoming breaking changes
|
|
41
|
+
|
|
42
|
+
## [1.9.2]
|
|
43
|
+
|
|
10
44
|
### Fixed
|
|
11
45
|
|
|
12
46
|
- Merge plugins when merging config with preset ([#2561](https://github.com/tailwindlabs/tailwindcss/pulls/#2561)
|
|
@@ -974,7 +1008,12 @@ No release notes
|
|
|
974
1008
|
|
|
975
1009
|
- Everything!
|
|
976
1010
|
|
|
977
|
-
[unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v1.9.
|
|
1011
|
+
[unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v1.9.6...HEAD
|
|
1012
|
+
[1.9.6]: https://github.com/tailwindlabs/tailwindcss/compare/v1.9.5...v1.9.6
|
|
1013
|
+
[1.9.5]: https://github.com/tailwindlabs/tailwindcss/compare/v1.9.4...v1.9.5
|
|
1014
|
+
[1.9.4]: https://github.com/tailwindlabs/tailwindcss/compare/v1.9.3...v1.9.4
|
|
1015
|
+
[1.9.3]: https://github.com/tailwindlabs/tailwindcss/compare/v1.9.2...v1.9.3
|
|
1016
|
+
[1.9.2]: https://github.com/tailwindlabs/tailwindcss/compare/v1.9.1...v1.9.2
|
|
978
1017
|
[1.9.1]: https://github.com/tailwindlabs/tailwindcss/compare/v1.9.0...v1.9.1
|
|
979
1018
|
[1.9.0]: https://github.com/tailwindlabs/tailwindcss/compare/v1.8.13...v1.9.0
|
|
980
1019
|
[1.8.13]: https://github.com/tailwindlabs/tailwindcss/compare/v1.8.12...v1.8.13
|
package/lib/cli/commands/init.js
CHANGED
|
@@ -47,21 +47,12 @@ exports.optionMap = optionMap;
|
|
|
47
47
|
function run(cliParams, cliOptions) {
|
|
48
48
|
return new Promise(resolve => {
|
|
49
49
|
utils.header();
|
|
50
|
+
const full = cliOptions.full;
|
|
50
51
|
const file = cliParams[0] || constants.defaultConfigFile;
|
|
51
52
|
const simplePath = utils.getSimplePath(file);
|
|
52
53
|
utils.exists(file) && utils.die(colors.file(simplePath), 'already exists.');
|
|
53
|
-
const stubFile =
|
|
54
|
-
|
|
55
|
-
const config = require(stubFile);
|
|
56
|
-
|
|
57
|
-
const {
|
|
58
|
-
future: flags
|
|
59
|
-
} = require('../../featureFlags').default;
|
|
60
|
-
|
|
61
|
-
flags.forEach(flag => {
|
|
62
|
-
config.future[`// ${flag}`] = true;
|
|
63
|
-
});
|
|
64
|
-
utils.writeFile(file, `module.exports = ${JSON.stringify(config, null, 2).replace(/"([^-_\d"]+)":/g, '$1:')}\n`);
|
|
54
|
+
const stubFile = full ? constants.defaultConfigStubFile : constants.simpleConfigStubFile;
|
|
55
|
+
utils.copyFile(stubFile, file);
|
|
65
56
|
utils.log();
|
|
66
57
|
utils.log(emoji.yes, 'Created Tailwind config file:', colors.file(simplePath));
|
|
67
58
|
|
package/lib/featureFlags.js
CHANGED
|
@@ -40,14 +40,6 @@ function experimentalFlagsEnabled(config) {
|
|
|
40
40
|
return Object.keys(_lodash.default.get(config, 'experimental', {})).filter(flag => featureFlags.experimental.includes(flag) && config.experimental[flag]);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
function futureFlagsAvailable(config) {
|
|
44
|
-
if (config.future === 'all') {
|
|
45
|
-
return [];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return featureFlags.future.filter(flag => !_lodash.default.has(config, ['future', flag]));
|
|
49
|
-
}
|
|
50
|
-
|
|
51
43
|
function issueFlagNotices(config) {
|
|
52
44
|
if (process.env.JEST_WORKER_ID !== undefined) {
|
|
53
45
|
return;
|
|
@@ -58,12 +50,6 @@ function issueFlagNotices(config) {
|
|
|
58
50
|
|
|
59
51
|
_log.default.warn([`You have enabled experimental features: ${changes}`, 'Experimental features are not covered by semver, may introduce breaking changes, and can change at any time.']);
|
|
60
52
|
}
|
|
61
|
-
|
|
62
|
-
if (futureFlagsAvailable(config).length > 0) {
|
|
63
|
-
const changes = futureFlagsAvailable(config).map(s => _chalk.default.magenta(s)).join(', ');
|
|
64
|
-
|
|
65
|
-
_log.default.risk([`There are upcoming breaking changes: ${changes}`, 'We highly recommend opting-in to these changes now to simplify upgrading Tailwind in the future.', 'https://tailwindcss.com/docs/upcoming-changes']);
|
|
66
|
-
}
|
|
67
53
|
}
|
|
68
54
|
|
|
69
55
|
var _default = featureFlags;
|
|
@@ -14,6 +14,10 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
14
14
|
const themeTransforms = {
|
|
15
15
|
fontSize(value) {
|
|
16
16
|
return Array.isArray(value) ? value[0] : value;
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
outline(value) {
|
|
20
|
+
return Array.isArray(value) ? value[0] : value;
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
};
|
package/lib/util/createPlugin.js
CHANGED
|
@@ -20,7 +20,11 @@ createPlugin.withOptions = function (pluginFunction, configFunction = () => ({})
|
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
optionsFunction.__isOptionsFunction = true;
|
|
23
|
+
optionsFunction.__isOptionsFunction = true; // Expose plugin dependencies so that `object-hash` returns a different
|
|
24
|
+
// value if anything here changes, to ensure a rebuild is triggered.
|
|
25
|
+
|
|
26
|
+
optionsFunction.__pluginFunction = pluginFunction;
|
|
27
|
+
optionsFunction.__configFunction = configFunction;
|
|
24
28
|
return optionsFunction;
|
|
25
29
|
};
|
|
26
30
|
|
|
@@ -27,9 +27,9 @@ var _lodash = require("lodash");
|
|
|
27
27
|
|
|
28
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
29
|
|
|
30
|
-
function getAllConfigs(config
|
|
31
|
-
const configs = (0, _lodash.flatMap)([...(0, _lodash.get)(config, 'presets',
|
|
32
|
-
return getAllConfigs(preset
|
|
30
|
+
function getAllConfigs(config) {
|
|
31
|
+
const configs = (0, _lodash.flatMap)([...(0, _lodash.get)(config, 'presets', [_defaultConfigStub.default])].reverse(), preset => {
|
|
32
|
+
return getAllConfigs(preset);
|
|
33
33
|
});
|
|
34
34
|
const features = {
|
|
35
35
|
uniformColorPalette: _uniformColorPalette.default,
|
|
@@ -70,7 +70,17 @@ function _default(plugins, config) {
|
|
|
70
70
|
handler({
|
|
71
71
|
postcss: _postcss.default,
|
|
72
72
|
config: getConfigValue,
|
|
73
|
-
theme: (path, defaultValue) =>
|
|
73
|
+
theme: (path, defaultValue) => {
|
|
74
|
+
const value = getConfigValue(`theme.${path}`, defaultValue);
|
|
75
|
+
|
|
76
|
+
const [rootPath] = _lodash.default.toPath(path);
|
|
77
|
+
|
|
78
|
+
if (['fontSize', 'outline'].includes(rootPath)) {
|
|
79
|
+
return Array.isArray(value) ? value[0] : value;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return value;
|
|
83
|
+
},
|
|
74
84
|
corePlugins: path => {
|
|
75
85
|
if (Array.isArray(config.corePlugins)) {
|
|
76
86
|
return config.corePlugins.includes(path);
|
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
future: {
|
|
2
|
+
future: {
|
|
3
|
+
// removeDeprecatedGapUtilities: true,
|
|
4
|
+
// purgeLayersByDefault: true,
|
|
5
|
+
},
|
|
3
6
|
purge: [],
|
|
4
7
|
target: 'relaxed',
|
|
5
8
|
prefix: '',
|
|
6
9
|
important: false,
|
|
7
10
|
separator: ':',
|
|
11
|
+
presets: [],
|
|
8
12
|
theme: {
|
|
9
13
|
screens: {
|
|
10
14
|
sm: '640px',
|