tailwindcss 3.2.7 → 3.3.1
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 +55 -8
- package/lib/cli/build/index.js +7 -3
- package/lib/cli/build/plugin.js +28 -19
- package/lib/cli/build/watching.js +4 -2
- package/lib/cli/index.js +12 -21
- package/lib/cli/init/index.js +21 -6
- package/lib/corePluginList.js +4 -0
- package/lib/corePlugins.js +282 -26
- package/lib/css/preflight.css +2 -0
- package/lib/featureFlags.js +8 -1
- package/lib/lib/expandApplyAtRules.js +12 -1
- package/lib/lib/generateRules.js +14 -10
- package/lib/lib/getModuleDependencies.js +79 -33
- package/lib/lib/load-config.js +40 -0
- package/lib/lib/setupContextUtils.js +10 -2
- package/lib/lib/setupTrackingContext.js +4 -4
- package/lib/lib/sharedState.js +6 -1
- package/lib/oxide/cli/build/index.js +7 -3
- package/lib/oxide/cli/build/plugin.js +27 -18
- package/lib/oxide/cli/build/watching.js +1 -1
- package/lib/oxide/cli/index.js +10 -16
- package/lib/oxide/cli/init/index.js +19 -4
- package/lib/public/colors.js +44 -22
- package/lib/public/default-config.js +2 -2
- package/lib/public/default-theme.js +2 -2
- package/lib/public/load-config.js +10 -0
- package/lib/util/applyImportantSelector.js +37 -0
- package/lib/util/dataTypes.js +3 -0
- package/lib/util/formatVariantSelector.js +34 -32
- package/lib/util/getAllConfigs.js +2 -2
- package/lib/util/normalizeConfig.js +2 -3
- package/lib/util/pluginUtils.js +9 -2
- package/lib/util/resolveConfigPath.js +19 -7
- package/lib/util/splitAtTopLevelOnly.js +7 -1
- package/lib/util/validateConfig.js +11 -0
- package/loadConfig.d.ts +4 -0
- package/loadConfig.js +2 -0
- package/package.json +5 -4
- package/src/cli/build/index.js +7 -7
- package/src/cli/build/plugin.js +28 -23
- package/src/cli/build/watching.js +4 -2
- package/src/cli/index.js +8 -26
- package/src/cli/init/index.js +37 -8
- package/src/corePluginList.js +1 -1
- package/src/corePlugins.js +184 -27
- package/src/css/preflight.css +2 -0
- package/src/featureFlags.js +7 -0
- package/src/lib/expandApplyAtRules.js +14 -1
- package/src/lib/generateRules.js +15 -5
- package/src/lib/getModuleDependencies.js +70 -30
- package/src/lib/load-config.ts +31 -0
- package/src/lib/setupContextUtils.js +9 -2
- package/src/lib/setupTrackingContext.js +4 -4
- package/src/lib/sharedState.js +15 -6
- package/src/oxide/cli/build/index.ts +7 -7
- package/src/oxide/cli/build/plugin.ts +28 -22
- package/src/oxide/cli/build/watching.ts +1 -1
- package/src/oxide/cli/index.ts +7 -15
- package/src/oxide/cli/init/index.ts +34 -7
- package/src/public/colors.js +22 -0
- package/src/public/default-config.js +1 -1
- package/src/public/default-theme.js +2 -2
- package/src/public/load-config.js +2 -0
- package/src/util/applyImportantSelector.js +30 -0
- package/src/util/dataTypes.js +4 -0
- package/src/util/formatVariantSelector.js +36 -10
- package/src/util/getAllConfigs.js +2 -2
- package/src/util/normalizeConfig.js +2 -1
- package/src/util/pluginUtils.js +10 -2
- package/src/util/resolveConfigPath.js +12 -1
- package/src/util/splitAtTopLevelOnly.js +8 -1
- package/src/util/validateConfig.js +13 -0
- package/stubs/.gitignore +1 -0
- package/stubs/.prettierrc.json +6 -0
- package/stubs/{defaultConfig.stub.js → config.full.js} +36 -1
- package/stubs/{simpleConfig.stub.js → config.simple.js} +0 -1
- package/stubs/postcss.config.js +6 -0
- package/stubs/tailwind.config.cjs +2 -0
- package/stubs/tailwind.config.js +2 -0
- package/stubs/tailwind.config.ts +3 -0
- package/types/config.d.ts +8 -7
- package/types/generated/colors.d.ts +22 -0
- package/types/generated/corePluginList.d.ts +1 -1
- package/types/generated/default-theme.d.ts +31 -2
- package/lib/constants.js +0 -44
- package/src/constants.js +0 -17
- /package/stubs/{defaultPostCssConfig.stub.js → postcss.config.cjs} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,51 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
9
9
|
|
|
10
10
|
- Nothing yet!
|
|
11
11
|
|
|
12
|
+
## [3.3.1] - 2023-03-30
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- Try resolving `config.default` before `config` to ensure the config file is resolved correctly ([#10898](https://github.com/tailwindlabs/tailwindcss/pull/10898))
|
|
17
|
+
- Pull pseudo elements outside of `:is` and `:has` when using `@apply` ([#10903](https://github.com/tailwindlabs/tailwindcss/pull/10903))
|
|
18
|
+
- Update the types for the `safelist` config ([#10901](https://github.com/tailwindlabs/tailwindcss/pull/10901))
|
|
19
|
+
- Fix `@tailwindcss/line-clamp` warning ([#10915](https://github.com/tailwindlabs/tailwindcss/pull/10915), [#10919](https://github.com/tailwindlabs/tailwindcss/pull/10919))
|
|
20
|
+
- Fix `process` is not defined error ([#10919](https://github.com/tailwindlabs/tailwindcss/pull/10919))
|
|
21
|
+
|
|
22
|
+
## [3.3.0] - 2023-03-27
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- Support ESM and TypeScript config files ([#10785](https://github.com/tailwindlabs/tailwindcss/pull/10785))
|
|
27
|
+
- Extend default color palette with new 950 shades ([#10879](https://github.com/tailwindlabs/tailwindcss/pull/10879))
|
|
28
|
+
- Add `line-height` modifier support to `font-size` utilities ([#9875](https://github.com/tailwindlabs/tailwindcss/pull/9875))
|
|
29
|
+
- Add support for using variables as arbitrary values without `var(...)` ([#9880](https://github.com/tailwindlabs/tailwindcss/pull/9880), [#9962](https://github.com/tailwindlabs/tailwindcss/pull/9962))
|
|
30
|
+
- Add logical properties support for inline direction ([#10166](https://github.com/tailwindlabs/tailwindcss/pull/10166))
|
|
31
|
+
- Add `hyphens` utilities ([#10071](https://github.com/tailwindlabs/tailwindcss/pull/10071))
|
|
32
|
+
- Add `from-{position}`, `via-{position}` and `to-{position}` utilities ([#10886](https://github.com/tailwindlabs/tailwindcss/pull/10886))
|
|
33
|
+
- Add `list-style-image` utilities ([#10817](https://github.com/tailwindlabs/tailwindcss/pull/10817))
|
|
34
|
+
- Add `caption-side` utilities ([#10470](https://github.com/tailwindlabs/tailwindcss/pull/10470))
|
|
35
|
+
- Add `line-clamp` utilities from `@tailwindcss/line-clamp` to core ([#10768](https://github.com/tailwindlabs/tailwindcss/pull/10768), [#10876](https://github.com/tailwindlabs/tailwindcss/pull/10876), [#10862](https://github.com/tailwindlabs/tailwindcss/pull/10862))
|
|
36
|
+
- Add `delay-0` and `duration-0` utilities ([#10294](https://github.com/tailwindlabs/tailwindcss/pull/10294))
|
|
37
|
+
- Add `justify-normal` and `justify-stretch` utilities ([#10560](https://github.com/tailwindlabs/tailwindcss/pull/10560))
|
|
38
|
+
- Add `content-normal` and `content-stretch` utilities ([#10645](https://github.com/tailwindlabs/tailwindcss/pull/10645))
|
|
39
|
+
- Add `whitespace-break-spaces` utility ([#10729](https://github.com/tailwindlabs/tailwindcss/pull/10729))
|
|
40
|
+
- Add support for configuring default `font-variation-settings` for a `font-family` ([#10034](https://github.com/tailwindlabs/tailwindcss/pull/10034), [#10515](https://github.com/tailwindlabs/tailwindcss/pull/10515))
|
|
41
|
+
|
|
42
|
+
### Fixed
|
|
43
|
+
|
|
44
|
+
- Disallow using multiple selectors in arbitrary variants ([#10655](https://github.com/tailwindlabs/tailwindcss/pull/10655))
|
|
45
|
+
- Sort class lists deterministically for Prettier plugin ([#10672](https://github.com/tailwindlabs/tailwindcss/pull/10672))
|
|
46
|
+
- Ensure CLI builds have a non-zero exit code on failure ([#10703](https://github.com/tailwindlabs/tailwindcss/pull/10703))
|
|
47
|
+
- Ensure module dependencies for value `null`, is an empty `Set` ([#10877](https://github.com/tailwindlabs/tailwindcss/pull/10877))
|
|
48
|
+
- Fix format assumption when resolving module dependencies ([#10878](https://github.com/tailwindlabs/tailwindcss/pull/10878))
|
|
49
|
+
|
|
50
|
+
### Changed
|
|
51
|
+
|
|
52
|
+
- Mark `rtl` and `ltr` variants as stable and remove warnings ([#10764](https://github.com/tailwindlabs/tailwindcss/pull/10764))
|
|
53
|
+
- Use `inset` instead of `top`, `right`, `bottom`, and `left` properties ([#10765](https://github.com/tailwindlabs/tailwindcss/pull/10765))
|
|
54
|
+
- Make `dark` and `rtl`/`ltr` variants insensitive to DOM order ([#10766](https://github.com/tailwindlabs/tailwindcss/pull/10766))
|
|
55
|
+
- Use `:is` to make important selector option insensitive to DOM order ([#10835](https://github.com/tailwindlabs/tailwindcss/pull/10835))
|
|
56
|
+
|
|
12
57
|
## [3.2.7] - 2023-02-16
|
|
13
58
|
|
|
14
59
|
### Fixed
|
|
@@ -20,7 +65,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
20
65
|
|
|
21
66
|
### Fixed
|
|
22
67
|
|
|
23
|
-
-
|
|
68
|
+
- Fix installation failing with yarn and pnpm by dropping `oxide-api-shim` ([add1636](https://github.com/tailwindlabs/tailwindcss/commit/add16364b4b1100e1af23ad1ca6900a0b53cbba0))
|
|
24
69
|
|
|
25
70
|
## [3.2.5] - 2023-02-08
|
|
26
71
|
|
|
@@ -33,7 +78,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
33
78
|
- Cleanup unused `variantOrder` ([#9829](https://github.com/tailwindlabs/tailwindcss/pull/9829))
|
|
34
79
|
- Fix `foo-[abc]/[def]` not being handled correctly ([#9866](https://github.com/tailwindlabs/tailwindcss/pull/9866))
|
|
35
80
|
- Add container queries plugin to standalone CLI ([#9865](https://github.com/tailwindlabs/tailwindcss/pull/9865))
|
|
36
|
-
- Support renaming of output files by
|
|
81
|
+
- Support renaming of output files by PostCSS plugins in CLI ([#9944](https://github.com/tailwindlabs/tailwindcss/pull/9944))
|
|
37
82
|
- Improve return value of `resolveConfig`, unwrap `ResolvableTo` ([#9972](https://github.com/tailwindlabs/tailwindcss/pull/9972))
|
|
38
83
|
- Clip unbalanced brackets in arbitrary values ([#9973](https://github.com/tailwindlabs/tailwindcss/pull/9973))
|
|
39
84
|
- Don’t reorder webkit scrollbar pseudo elements ([#9991](https://github.com/tailwindlabs/tailwindcss/pull/9991))
|
|
@@ -62,7 +107,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
62
107
|
|
|
63
108
|
- Alphabetize `theme` keys in default config ([#9953](https://github.com/tailwindlabs/tailwindcss/pull/9953))
|
|
64
109
|
- Update esbuild to v17 ([#10368](https://github.com/tailwindlabs/tailwindcss/pull/10368))
|
|
65
|
-
- Include `outline-color` in `transition` and `transition-colors`
|
|
110
|
+
- Include `outline-color` in `transition` and `transition-colors` utilities ([#10385](https://github.com/tailwindlabs/tailwindcss/pull/10385))
|
|
66
111
|
|
|
67
112
|
## [3.2.4] - 2022-11-11
|
|
68
113
|
|
|
@@ -104,7 +149,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
104
149
|
- Fix missing `supports` in types ([#9616](https://github.com/tailwindlabs/tailwindcss/pull/9616))
|
|
105
150
|
- Fix missing PostCSS dependencies in the CLI ([#9617](https://github.com/tailwindlabs/tailwindcss/pull/9617))
|
|
106
151
|
- Ensure `micromatch` is a proper CLI dependency ([#9620](https://github.com/tailwindlabs/tailwindcss/pull/9620))
|
|
107
|
-
- Ensure modifier values exist when using a `modifiers` object for `matchVariant` ([
|
|
152
|
+
- Ensure modifier values exist when using a `modifiers` object for `matchVariant` ([ba6551d](https://github.com/tailwindlabs/tailwindcss/commit/ba6551db0f2726461371b4f3c6cd4c7090888504))
|
|
108
153
|
|
|
109
154
|
## [3.2.0] - 2022-10-19
|
|
110
155
|
|
|
@@ -295,7 +340,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
295
340
|
- Split box shadows on top-level commas only ([#7479](https://github.com/tailwindlabs/tailwindcss/pull/7479))
|
|
296
341
|
- Use local user CSS cache for `@apply` ([#7524](https://github.com/tailwindlabs/tailwindcss/pull/7524))
|
|
297
342
|
- Invalidate context when main CSS changes ([#7626](https://github.com/tailwindlabs/tailwindcss/pull/7626))
|
|
298
|
-
- Only add `!` to selector class matching template candidate when using important modifier with
|
|
343
|
+
- Only add `!` to selector class matching template candidate when using important modifier with multi-class selectors ([#7664](https://github.com/tailwindlabs/tailwindcss/pull/7664))
|
|
299
344
|
- Correctly parse and prefix animation names with dots ([#7163](https://github.com/tailwindlabs/tailwindcss/pull/7163))
|
|
300
345
|
- Fix extraction from template literal/function with array ([#7481](https://github.com/tailwindlabs/tailwindcss/pull/7481))
|
|
301
346
|
- Don't output unparsable arbitrary values ([#7789](https://github.com/tailwindlabs/tailwindcss/pull/7789))
|
|
@@ -739,7 +784,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
739
784
|
- Remove outdated focus style fix in Preflight ([#4780](https://github.com/tailwindlabs/tailwindcss/pull/4780))
|
|
740
785
|
- Enable `purge` if provided on the CLI ([#4772](https://github.com/tailwindlabs/tailwindcss/pull/4772))
|
|
741
786
|
- JIT: Fix error when not using a config file with postcss-cli ([#4773](https://github.com/tailwindlabs/tailwindcss/pull/4773))
|
|
742
|
-
- Fix issue with `resolveConfig` not being importable in Next.js
|
|
787
|
+
- Fix issue with `resolveConfig` not being importable in Next.js pages ([#4725](https://github.com/tailwindlabs/tailwindcss/pull/4725))
|
|
743
788
|
|
|
744
789
|
## [2.2.2] - 2021-06-18
|
|
745
790
|
|
|
@@ -874,7 +919,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
874
919
|
|
|
875
920
|
### Fixed
|
|
876
921
|
|
|
877
|
-
- Fix issue with `@apply` not working as expected with `!important` inside an
|
|
922
|
+
- Fix issue with `@apply` not working as expected with `!important` inside an at-rule ([#2824](https://github.com/tailwindlabs/tailwindcss/pull/2824))
|
|
878
923
|
- Fix issue with `@apply` not working as expected with defined classes ([#2832](https://github.com/tailwindlabs/tailwindcss/pull/2832))
|
|
879
924
|
- Fix memory leak, and broken `@apply` when splitting up files ([#3032](https://github.com/tailwindlabs/tailwindcss/pull/3032))
|
|
880
925
|
|
|
@@ -2176,7 +2221,9 @@ No release notes
|
|
|
2176
2221
|
|
|
2177
2222
|
- Everything!
|
|
2178
2223
|
|
|
2179
|
-
[unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.
|
|
2224
|
+
[unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.3.1...HEAD
|
|
2225
|
+
[3.3.1]: https://github.com/tailwindlabs/tailwindcss/compare/v3.3.0...v3.3.1
|
|
2226
|
+
[3.3.0]: https://github.com/tailwindlabs/tailwindcss/compare/v3.2.7...v3.3.0
|
|
2180
2227
|
[3.2.7]: https://github.com/tailwindlabs/tailwindcss/compare/v3.2.6...v3.2.7
|
|
2181
2228
|
[3.2.6]: https://github.com/tailwindlabs/tailwindcss/compare/v3.2.5...v3.2.6
|
|
2182
2229
|
[3.2.5]: https://github.com/tailwindlabs/tailwindcss/compare/v3.2.4...v3.2.5
|
package/lib/cli/build/index.js
CHANGED
|
@@ -9,13 +9,14 @@ Object.defineProperty(exports, "build", {
|
|
|
9
9
|
});
|
|
10
10
|
const _fs = /*#__PURE__*/ _interopRequireDefault(require("fs"));
|
|
11
11
|
const _path = /*#__PURE__*/ _interopRequireDefault(require("path"));
|
|
12
|
+
const _resolveConfigPathJs = require("../../util/resolveConfigPath.js");
|
|
12
13
|
const _pluginJs = require("./plugin.js");
|
|
13
14
|
function _interopRequireDefault(obj) {
|
|
14
15
|
return obj && obj.__esModule ? obj : {
|
|
15
16
|
default: obj
|
|
16
17
|
};
|
|
17
18
|
}
|
|
18
|
-
async function build(args
|
|
19
|
+
async function build(args) {
|
|
19
20
|
let input = args["--input"];
|
|
20
21
|
let shouldWatch = args["--watch"];
|
|
21
22
|
// TODO: Deprecate this in future versions
|
|
@@ -32,7 +33,7 @@ async function build(args, configs) {
|
|
|
32
33
|
process.exit(9);
|
|
33
34
|
}
|
|
34
35
|
// TODO: Reference the @config path here if exists
|
|
35
|
-
let configPath = args["--config"] ? args["--config"] : (
|
|
36
|
+
let configPath = args["--config"] ? args["--config"] : (0, _resolveConfigPathJs.resolveDefaultConfigPath)();
|
|
36
37
|
let processor = await (0, _pluginJs.createProcessor)(args, configPath);
|
|
37
38
|
if (shouldWatch) {
|
|
38
39
|
// Abort the watcher if stdin is closed to avoid zombie processes
|
|
@@ -43,6 +44,9 @@ async function build(args, configs) {
|
|
|
43
44
|
process.stdin.resume();
|
|
44
45
|
await processor.watch();
|
|
45
46
|
} else {
|
|
46
|
-
await processor.build()
|
|
47
|
+
await processor.build().catch((e)=>{
|
|
48
|
+
console.error(e);
|
|
49
|
+
process.exit(1);
|
|
50
|
+
});
|
|
47
51
|
}
|
|
48
52
|
}
|
package/lib/cli/build/plugin.js
CHANGED
|
@@ -20,12 +20,13 @@ const _deps = require("./deps");
|
|
|
20
20
|
const _utils = require("./utils");
|
|
21
21
|
const _sharedState = require("../../lib/sharedState");
|
|
22
22
|
const _resolveConfigJs = /*#__PURE__*/ _interopRequireDefault(require("../../../resolveConfig.js"));
|
|
23
|
-
const _getModuleDependenciesJs = /*#__PURE__*/ _interopRequireDefault(require("../../lib/getModuleDependencies.js"));
|
|
24
23
|
const _contentJs = require("../../lib/content.js");
|
|
25
24
|
const _watchingJs = require("./watching.js");
|
|
26
25
|
const _fastGlob = /*#__PURE__*/ _interopRequireDefault(require("fast-glob"));
|
|
27
26
|
const _findAtConfigPathJs = require("../../lib/findAtConfigPath.js");
|
|
28
27
|
const _log = /*#__PURE__*/ _interopRequireDefault(require("../../util/log"));
|
|
28
|
+
const _loadConfig = require("../../lib/load-config");
|
|
29
|
+
const _getModuleDependencies = /*#__PURE__*/ _interopRequireDefault(require("../../lib/getModuleDependencies"));
|
|
29
30
|
function _interopRequireDefault(obj) {
|
|
30
31
|
return obj && obj.__esModule ? obj : {
|
|
31
32
|
default: obj
|
|
@@ -109,7 +110,7 @@ let state = {
|
|
|
109
110
|
/** @type {any} */ context: null,
|
|
110
111
|
/** @type {ReturnType<typeof createWatcher> | null} */ watcher: null,
|
|
111
112
|
/** @type {{content: string, extension: string}[]} */ changedContent: [],
|
|
112
|
-
|
|
113
|
+
/** @type {ReturnType<typeof load> | null} */ configBag: null,
|
|
113
114
|
contextDependencies: new Set(),
|
|
114
115
|
/** @type {import('../../lib/content.js').ContentPath[]} */ contentPaths: [],
|
|
115
116
|
refreshContentPaths () {
|
|
@@ -127,32 +128,35 @@ let state = {
|
|
|
127
128
|
},
|
|
128
129
|
loadConfig (configPath, content) {
|
|
129
130
|
if (this.watcher && configPath) {
|
|
130
|
-
this.refreshConfigDependencies(
|
|
131
|
+
this.refreshConfigDependencies();
|
|
131
132
|
}
|
|
132
|
-
let config =
|
|
133
|
+
let config = (0, _loadConfig.loadConfig)(configPath);
|
|
134
|
+
let dependencies = (0, _getModuleDependencies.default)(configPath);
|
|
135
|
+
this.configBag = {
|
|
136
|
+
config,
|
|
137
|
+
dependencies,
|
|
138
|
+
dispose () {
|
|
139
|
+
for (let file of dependencies){
|
|
140
|
+
delete require.cache[require.resolve(file)];
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
};
|
|
133
144
|
// @ts-ignore
|
|
134
|
-
config = (0, _resolveConfigJs.default)(config, {
|
|
145
|
+
this.configBag.config = (0, _resolveConfigJs.default)(this.configBag.config, {
|
|
135
146
|
content: {
|
|
136
147
|
files: []
|
|
137
148
|
}
|
|
138
149
|
});
|
|
139
150
|
// Override content files if `--content` has been passed explicitly
|
|
140
151
|
if ((content === null || content === void 0 ? void 0 : content.length) > 0) {
|
|
141
|
-
config.content.files = content;
|
|
152
|
+
this.configBag.config.content.files = content;
|
|
142
153
|
}
|
|
143
|
-
return config;
|
|
154
|
+
return this.configBag.config;
|
|
144
155
|
},
|
|
145
|
-
refreshConfigDependencies (
|
|
156
|
+
refreshConfigDependencies () {
|
|
157
|
+
var _this_configBag;
|
|
146
158
|
_sharedState.env.DEBUG && console.time("Module dependencies");
|
|
147
|
-
|
|
148
|
-
delete require.cache[require.resolve(file)];
|
|
149
|
-
}
|
|
150
|
-
if (configPath) {
|
|
151
|
-
let deps = (0, _getModuleDependenciesJs.default)(configPath).map(({ file })=>file);
|
|
152
|
-
for (let dependency of deps){
|
|
153
|
-
this.configDependencies.add(dependency);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
159
|
+
(_this_configBag = this.configBag) === null || _this_configBag === void 0 ? void 0 : _this_configBag.dispose();
|
|
156
160
|
_sharedState.env.DEBUG && console.timeEnd("Module dependencies");
|
|
157
161
|
},
|
|
158
162
|
readContentPaths () {
|
|
@@ -326,7 +330,11 @@ async function createProcessor(args, cliConfigPath) {
|
|
|
326
330
|
// If you fix it and then save the main CSS file so there's no error
|
|
327
331
|
// The watcher will start watching the imported CSS files and will be
|
|
328
332
|
// resilient to future errors.
|
|
329
|
-
|
|
333
|
+
if (state.watcher) {
|
|
334
|
+
console.error(err);
|
|
335
|
+
} else {
|
|
336
|
+
return Promise.reject(err);
|
|
337
|
+
}
|
|
330
338
|
});
|
|
331
339
|
}
|
|
332
340
|
/**
|
|
@@ -349,7 +357,8 @@ async function createProcessor(args, cliConfigPath) {
|
|
|
349
357
|
* @param {{file: string, content(): Promise<string>, extension: string}[]} changes
|
|
350
358
|
*/ async rebuild (changes) {
|
|
351
359
|
let needsNewContext = changes.some((change)=>{
|
|
352
|
-
|
|
360
|
+
var _state_configBag;
|
|
361
|
+
return ((_state_configBag = state.configBag) === null || _state_configBag === void 0 ? void 0 : _state_configBag.dependencies.has(change.file)) || state.contextDependencies.has(change.file);
|
|
353
362
|
});
|
|
354
363
|
if (needsNewContext) {
|
|
355
364
|
state.context = null;
|
|
@@ -64,7 +64,9 @@ function createWatcher(args, { state , rebuild }) {
|
|
|
64
64
|
// Clear all pending rebuilds for the about-to-be-built files
|
|
65
65
|
changes.forEach((change)=>pendingRebuilds.delete(change.file));
|
|
66
66
|
// Resolve the promise even when the rebuild fails
|
|
67
|
-
return rebuild(changes).then(()=>{}, ()=>{
|
|
67
|
+
return rebuild(changes).then(()=>{}, (e)=>{
|
|
68
|
+
console.error(e.toString());
|
|
69
|
+
});
|
|
68
70
|
}
|
|
69
71
|
/**
|
|
70
72
|
*
|
|
@@ -171,7 +173,7 @@ function createWatcher(args, { state , rebuild }) {
|
|
|
171
173
|
fswatcher: watcher,
|
|
172
174
|
refreshWatchedFiles () {
|
|
173
175
|
watcher.add(Array.from(state.contextDependencies));
|
|
174
|
-
watcher.add(Array.from(state.
|
|
176
|
+
watcher.add(Array.from(state.configBag.dependencies));
|
|
175
177
|
watcher.add(state.contentPatterns.all);
|
|
176
178
|
}
|
|
177
179
|
};
|
package/lib/cli/index.js
CHANGED
|
@@ -14,23 +14,6 @@ function _interopRequireDefault(obj) {
|
|
|
14
14
|
default: obj
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
function isESM() {
|
|
18
|
-
const pkgPath = _path.default.resolve("./package.json");
|
|
19
|
-
try {
|
|
20
|
-
let pkg = JSON.parse(_fs.default.readFileSync(pkgPath, "utf8"));
|
|
21
|
-
return pkg.type && pkg.type === "module";
|
|
22
|
-
} catch (err) {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
let configs = isESM() ? {
|
|
27
|
-
tailwind: "tailwind.config.cjs",
|
|
28
|
-
postcss: "postcss.config.cjs"
|
|
29
|
-
} : {
|
|
30
|
-
tailwind: "tailwind.config.js",
|
|
31
|
-
postcss: "postcss.config.js"
|
|
32
|
-
};
|
|
33
|
-
// ---
|
|
34
17
|
function oneOf(...options) {
|
|
35
18
|
return Object.assign((value = true)=>{
|
|
36
19
|
for (let option of options){
|
|
@@ -48,13 +31,21 @@ let commands = {
|
|
|
48
31
|
init: {
|
|
49
32
|
run: _init.init,
|
|
50
33
|
args: {
|
|
51
|
-
"--
|
|
34
|
+
"--esm": {
|
|
52
35
|
type: Boolean,
|
|
53
|
-
description: `Initialize
|
|
36
|
+
description: `Initialize configuration file as ESM`
|
|
37
|
+
},
|
|
38
|
+
"--ts": {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
description: `Initialize configuration file as TypeScript`
|
|
54
41
|
},
|
|
55
42
|
"--postcss": {
|
|
56
43
|
type: Boolean,
|
|
57
|
-
description: `Initialize a
|
|
44
|
+
description: `Initialize a \`postcss.config.js\` file`
|
|
45
|
+
},
|
|
46
|
+
"--full": {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
description: `Include the default values for all options in the generated configuration file`
|
|
58
49
|
},
|
|
59
50
|
"-f": "--full",
|
|
60
51
|
"-p": "--postcss"
|
|
@@ -236,4 +227,4 @@ if (args["--help"]) {
|
|
|
236
227
|
});
|
|
237
228
|
process.exit(0);
|
|
238
229
|
}
|
|
239
|
-
run(args
|
|
230
|
+
run(args);
|
package/lib/cli/init/index.js
CHANGED
|
@@ -14,25 +14,40 @@ function _interopRequireDefault(obj) {
|
|
|
14
14
|
default: obj
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function isESM() {
|
|
18
|
+
const pkgPath = _path.default.resolve("./package.json");
|
|
19
|
+
try {
|
|
20
|
+
let pkg = JSON.parse(_fs.default.readFileSync(pkgPath, "utf8"));
|
|
21
|
+
return pkg.type && pkg.type === "module";
|
|
22
|
+
} catch (err) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function init(args) {
|
|
18
27
|
let messages = [];
|
|
28
|
+
let isProjectESM = args["--ts"] || args["--esm"] || isESM();
|
|
29
|
+
let syntax = args["--ts"] ? "ts" : isProjectESM ? "js" : "cjs";
|
|
30
|
+
let extension = args["--ts"] ? "ts" : "js";
|
|
19
31
|
var _args___;
|
|
20
|
-
let tailwindConfigLocation = _path.default.resolve((_args___ = args["_"][1]) !== null && _args___ !== void 0 ? _args___ :
|
|
32
|
+
let tailwindConfigLocation = _path.default.resolve((_args___ = args["_"][1]) !== null && _args___ !== void 0 ? _args___ : `./tailwind.config.${extension}`);
|
|
21
33
|
if (_fs.default.existsSync(tailwindConfigLocation)) {
|
|
22
34
|
messages.push(`${_path.default.basename(tailwindConfigLocation)} already exists.`);
|
|
23
35
|
} else {
|
|
24
|
-
let
|
|
36
|
+
let stubContentsFile = _fs.default.readFileSync(args["--full"] ? _path.default.resolve(__dirname, "../../../stubs/config.full.js") : _path.default.resolve(__dirname, "../../../stubs/config.simple.js"), "utf8");
|
|
37
|
+
let stubFile = _fs.default.readFileSync(_path.default.resolve(__dirname, `../../../stubs/tailwind.config.${syntax}`), "utf8");
|
|
25
38
|
// Change colors import
|
|
26
|
-
|
|
39
|
+
stubContentsFile = stubContentsFile.replace("../colors", "tailwindcss/colors");
|
|
40
|
+
// Replace contents of {ts,js,cjs} file with the stub {simple,full}.
|
|
41
|
+
stubFile = stubFile.replace("__CONFIG__", stubContentsFile.replace("module.exports =", "").trim()).trim() + "\n\n";
|
|
27
42
|
_fs.default.writeFileSync(tailwindConfigLocation, stubFile, "utf8");
|
|
28
43
|
messages.push(`Created Tailwind CSS config file: ${_path.default.basename(tailwindConfigLocation)}`);
|
|
29
44
|
}
|
|
30
45
|
if (args["--postcss"]) {
|
|
31
|
-
let postcssConfigLocation = _path.default.resolve(
|
|
46
|
+
let postcssConfigLocation = _path.default.resolve("./postcss.config.js");
|
|
32
47
|
if (_fs.default.existsSync(postcssConfigLocation)) {
|
|
33
48
|
messages.push(`${_path.default.basename(postcssConfigLocation)} already exists.`);
|
|
34
49
|
} else {
|
|
35
|
-
let stubFile1 = _fs.default.readFileSync(_path.default.resolve(__dirname, "../../../stubs/
|
|
50
|
+
let stubFile1 = _fs.default.readFileSync(isProjectESM ? _path.default.resolve(__dirname, "../../../stubs/postcss.config.js") : _path.default.resolve(__dirname, "../../../stubs/postcss.config.cjs"), "utf8");
|
|
36
51
|
_fs.default.writeFileSync(postcssConfigLocation, stubFile1, "utf8");
|
|
37
52
|
messages.push(`Created PostCSS config file: ${_path.default.basename(postcssConfigLocation)}`);
|
|
38
53
|
}
|
package/lib/corePluginList.js
CHANGED
|
@@ -27,6 +27,7 @@ const _default = [
|
|
|
27
27
|
"clear",
|
|
28
28
|
"margin",
|
|
29
29
|
"boxSizing",
|
|
30
|
+
"lineClamp",
|
|
30
31
|
"display",
|
|
31
32
|
"aspectRatio",
|
|
32
33
|
"height",
|
|
@@ -40,6 +41,7 @@ const _default = [
|
|
|
40
41
|
"flexGrow",
|
|
41
42
|
"flexBasis",
|
|
42
43
|
"tableLayout",
|
|
44
|
+
"captionSide",
|
|
43
45
|
"borderCollapse",
|
|
44
46
|
"borderSpacing",
|
|
45
47
|
"transformOrigin",
|
|
@@ -60,6 +62,7 @@ const _default = [
|
|
|
60
62
|
"scrollPadding",
|
|
61
63
|
"listStylePosition",
|
|
62
64
|
"listStyleType",
|
|
65
|
+
"listStyleImage",
|
|
63
66
|
"appearance",
|
|
64
67
|
"columns",
|
|
65
68
|
"breakBefore",
|
|
@@ -91,6 +94,7 @@ const _default = [
|
|
|
91
94
|
"overscrollBehavior",
|
|
92
95
|
"scrollBehavior",
|
|
93
96
|
"textOverflow",
|
|
97
|
+
"hyphens",
|
|
94
98
|
"whitespace",
|
|
95
99
|
"wordBreak",
|
|
96
100
|
"borderRadius",
|