tailwindcss 3.4.2 → 3.4.3
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 +8 -1
- package/lib/lib/content.js +3 -36
- package/package.json +1 -1
- package/src/lib/content.js +1 -42
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
9
9
|
|
|
10
10
|
- Nothing yet!
|
|
11
11
|
|
|
12
|
+
## [3.4.3] - 2024-03-27
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- Revert changes to glob handling ([#13384](https://github.com/tailwindlabs/tailwindcss/pull/13384))
|
|
17
|
+
|
|
12
18
|
## [3.4.2] - 2024-03-27
|
|
13
19
|
|
|
14
20
|
### Fixed
|
|
@@ -2370,7 +2376,8 @@ No release notes
|
|
|
2370
2376
|
|
|
2371
2377
|
- Everything!
|
|
2372
2378
|
|
|
2373
|
-
[unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.4.
|
|
2379
|
+
[unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v3.4.3...HEAD
|
|
2380
|
+
[3.4.3]: https://github.com/tailwindlabs/tailwindcss/compare/v3.4.2...v3.4.3
|
|
2374
2381
|
[3.4.2]: https://github.com/tailwindlabs/tailwindcss/compare/v3.4.1...v3.4.2
|
|
2375
2382
|
[3.4.1]: https://github.com/tailwindlabs/tailwindcss/compare/v3.4.0...v3.4.1
|
|
2376
2383
|
[3.4.0]: https://github.com/tailwindlabs/tailwindcss/compare/v3.3.7...v3.4.0
|
package/lib/lib/content.js
CHANGED
|
@@ -21,6 +21,7 @@ const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
|
21
21
|
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
22
22
|
const _isglob = /*#__PURE__*/ _interop_require_default(require("is-glob"));
|
|
23
23
|
const _fastglob = /*#__PURE__*/ _interop_require_default(require("fast-glob"));
|
|
24
|
+
const _normalizepath = /*#__PURE__*/ _interop_require_default(require("normalize-path"));
|
|
24
25
|
const _parseGlob = require("../util/parseGlob");
|
|
25
26
|
const _sharedState = require("./sharedState");
|
|
26
27
|
function _interop_require_default(obj) {
|
|
@@ -28,42 +29,11 @@ function _interop_require_default(obj) {
|
|
|
28
29
|
default: obj
|
|
29
30
|
};
|
|
30
31
|
}
|
|
31
|
-
/*!
|
|
32
|
-
* Modified version of normalize-path, original license below
|
|
33
|
-
*
|
|
34
|
-
* normalize-path <https://github.com/jonschlinkert/normalize-path>
|
|
35
|
-
*
|
|
36
|
-
* Copyright (c) 2014-2018, Jon Schlinkert.
|
|
37
|
-
* Released under the MIT License.
|
|
38
|
-
*/ function normalizePath(path) {
|
|
39
|
-
if (typeof path !== "string") {
|
|
40
|
-
throw new TypeError("expected path to be a string");
|
|
41
|
-
}
|
|
42
|
-
if (path === "\\" || path === "/") return "/";
|
|
43
|
-
var len = path.length;
|
|
44
|
-
if (len <= 1) return path;
|
|
45
|
-
// ensure that win32 namespaces has two leading slashes, so that the path is
|
|
46
|
-
// handled properly by the win32 version of path.parse() after being normalized
|
|
47
|
-
// https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces
|
|
48
|
-
var prefix = "";
|
|
49
|
-
if (len > 4 && path[3] === "\\") {
|
|
50
|
-
var ch = path[2];
|
|
51
|
-
if ((ch === "?" || ch === ".") && path.slice(0, 2) === "\\\\") {
|
|
52
|
-
path = path.slice(2);
|
|
53
|
-
prefix = "//";
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
// Modified part: instead of purely splitting on `\\` and `/`, we split on
|
|
57
|
-
// `/` and `\\` that is _not_ followed by any of the following characters: ()[]
|
|
58
|
-
// This is to ensure that we keep the escaping of brackets and parentheses
|
|
59
|
-
let segs = path.split(/[/\\]+(?![\(\)\[\]])/);
|
|
60
|
-
return prefix + segs.join("/");
|
|
61
|
-
}
|
|
62
32
|
function parseCandidateFiles(context, tailwindConfig) {
|
|
63
33
|
let files = tailwindConfig.content.files;
|
|
64
34
|
// Normalize the file globs
|
|
65
35
|
files = files.filter((filePath)=>typeof filePath === "string");
|
|
66
|
-
files = files.map(
|
|
36
|
+
files = files.map(_normalizepath.default);
|
|
67
37
|
// Split into included and excluded globs
|
|
68
38
|
let tasks = _fastglob.default.generateTasks(files);
|
|
69
39
|
/** @type {ContentPath[]} */ let included = [];
|
|
@@ -90,9 +60,6 @@ function parseCandidateFiles(context, tailwindConfig) {
|
|
|
90
60
|
* @param {boolean} ignore
|
|
91
61
|
* @returns {ContentPath}
|
|
92
62
|
*/ function parseFilePath(filePath, ignore) {
|
|
93
|
-
// Escape special characters in the file path such as: ()[]
|
|
94
|
-
// But only if the special character isn't already escaped
|
|
95
|
-
filePath = filePath.replace(/(?<!\\)([\[\]\(\)])/g, "\\$1");
|
|
96
63
|
let contentPath = {
|
|
97
64
|
original: filePath,
|
|
98
65
|
base: filePath,
|
|
@@ -114,7 +81,7 @@ function parseCandidateFiles(context, tailwindConfig) {
|
|
|
114
81
|
// Afaik, this technically shouldn't be needed but there's probably
|
|
115
82
|
// some internal, direct path matching with a normalized path in
|
|
116
83
|
// a package which can't handle mixed directory separators
|
|
117
|
-
let base =
|
|
84
|
+
let base = (0, _normalizepath.default)(contentPath.base);
|
|
118
85
|
// If the user's file path contains any special characters (like parens) for instance fast-glob
|
|
119
86
|
// is like "OOOH SHINY" and treats them as such. So we have to escape the base path to fix this
|
|
120
87
|
base = _fastglob.default.escapePath(base);
|
package/package.json
CHANGED
package/src/lib/content.js
CHANGED
|
@@ -4,47 +4,10 @@ import fs from 'fs'
|
|
|
4
4
|
import path from 'path'
|
|
5
5
|
import isGlob from 'is-glob'
|
|
6
6
|
import fastGlob from 'fast-glob'
|
|
7
|
+
import normalizePath from 'normalize-path'
|
|
7
8
|
import { parseGlob } from '../util/parseGlob'
|
|
8
9
|
import { env } from './sharedState'
|
|
9
10
|
|
|
10
|
-
/*!
|
|
11
|
-
* Modified version of normalize-path, original license below
|
|
12
|
-
*
|
|
13
|
-
* normalize-path <https://github.com/jonschlinkert/normalize-path>
|
|
14
|
-
*
|
|
15
|
-
* Copyright (c) 2014-2018, Jon Schlinkert.
|
|
16
|
-
* Released under the MIT License.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
function normalizePath(path) {
|
|
20
|
-
if (typeof path !== 'string') {
|
|
21
|
-
throw new TypeError('expected path to be a string')
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (path === '\\' || path === '/') return '/'
|
|
25
|
-
|
|
26
|
-
var len = path.length
|
|
27
|
-
if (len <= 1) return path
|
|
28
|
-
|
|
29
|
-
// ensure that win32 namespaces has two leading slashes, so that the path is
|
|
30
|
-
// handled properly by the win32 version of path.parse() after being normalized
|
|
31
|
-
// https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces
|
|
32
|
-
var prefix = ''
|
|
33
|
-
if (len > 4 && path[3] === '\\') {
|
|
34
|
-
var ch = path[2]
|
|
35
|
-
if ((ch === '?' || ch === '.') && path.slice(0, 2) === '\\\\') {
|
|
36
|
-
path = path.slice(2)
|
|
37
|
-
prefix = '//'
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Modified part: instead of purely splitting on `\\` and `/`, we split on
|
|
42
|
-
// `/` and `\\` that is _not_ followed by any of the following characters: ()[]
|
|
43
|
-
// This is to ensure that we keep the escaping of brackets and parentheses
|
|
44
|
-
let segs = path.split(/[/\\]+(?![\(\)\[\]])/)
|
|
45
|
-
return prefix + segs.join('/')
|
|
46
|
-
}
|
|
47
|
-
|
|
48
11
|
/** @typedef {import('../../types/config.js').RawFile} RawFile */
|
|
49
12
|
/** @typedef {import('../../types/config.js').FilePath} FilePath */
|
|
50
13
|
|
|
@@ -110,10 +73,6 @@ export function parseCandidateFiles(context, tailwindConfig) {
|
|
|
110
73
|
* @returns {ContentPath}
|
|
111
74
|
*/
|
|
112
75
|
function parseFilePath(filePath, ignore) {
|
|
113
|
-
// Escape special characters in the file path such as: ()[]
|
|
114
|
-
// But only if the special character isn't already escaped
|
|
115
|
-
filePath = filePath.replace(/(?<!\\)([\[\]\(\)])/g, '\\$1')
|
|
116
|
-
|
|
117
76
|
let contentPath = {
|
|
118
77
|
original: filePath,
|
|
119
78
|
base: filePath,
|