@charcoal-ui/tailwind-diff 5.0.0-beta.4 → 5.0.0-beta.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/dist/commands/check.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/commands/check.ts +8 -6
- package/src/commands/dump.ts +4 -4
- package/src/index.ts +2 -2
- package/src/style.ts +1 -1
- package/src/withPackages.ts +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AAoCA,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,SAAS,GAAG,MAAM,CAAA;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC7B;AAED,wBAAsB,KAAK,CAAC,EAC1B,MAAM,EACN,YAAY,EACZ,WAAW,EACX,QAAa,GACd,EAAE,WAAW,iBA0Fb"}
|
package/package.json
CHANGED
package/src/commands/check.ts
CHANGED
|
@@ -23,7 +23,9 @@ function processDone(child: ChildProcess) {
|
|
|
23
23
|
resolve()
|
|
24
24
|
} else if (signal != null) {
|
|
25
25
|
reject(
|
|
26
|
-
new Error(
|
|
26
|
+
new Error(
|
|
27
|
+
`Subprocess failed with code: ${code}, signal: ${signal}`,
|
|
28
|
+
),
|
|
27
29
|
)
|
|
28
30
|
} else {
|
|
29
31
|
reject(new Error(`Subprocess failed with code: ${code}`))
|
|
@@ -54,7 +56,7 @@ export async function check({
|
|
|
54
56
|
process.on('SIGINT', dispose)
|
|
55
57
|
try {
|
|
56
58
|
const tmpdir = fs.mkdtempSync(
|
|
57
|
-
path.resolve(os.tmpdir(), 'tailwind-diff-css')
|
|
59
|
+
path.resolve(os.tmpdir(), 'tailwind-diff-css'),
|
|
58
60
|
)
|
|
59
61
|
defer(() => {
|
|
60
62
|
const files = fs.readdirSync(tmpdir)
|
|
@@ -77,7 +79,7 @@ export async function check({
|
|
|
77
79
|
'--output',
|
|
78
80
|
beforeCSSPath,
|
|
79
81
|
...(beforeConfig != null ? ['--config', beforeConfig] : []),
|
|
80
|
-
])
|
|
82
|
+
]),
|
|
81
83
|
)
|
|
82
84
|
|
|
83
85
|
const afterCSSPath = path.resolve(tmpdir, 'after.css')
|
|
@@ -94,19 +96,19 @@ export async function check({
|
|
|
94
96
|
'--output',
|
|
95
97
|
afterCSSPath,
|
|
96
98
|
...(afterConfig != null ? ['--config', afterConfig] : []),
|
|
97
|
-
])
|
|
99
|
+
]),
|
|
98
100
|
)
|
|
99
101
|
})
|
|
100
102
|
|
|
101
103
|
const beforeStyles = collectClassNamesAndStyles(
|
|
102
104
|
postcss
|
|
103
105
|
.parse(fs.readFileSync(beforeCSSPath, { encoding: 'utf8' }))
|
|
104
|
-
.toResult()
|
|
106
|
+
.toResult(),
|
|
105
107
|
)
|
|
106
108
|
const afterStyles = collectClassNamesAndStyles(
|
|
107
109
|
postcss
|
|
108
110
|
.parse(fs.readFileSync(afterCSSPath, { encoding: 'utf8' }))
|
|
109
|
-
.toResult()
|
|
111
|
+
.toResult(),
|
|
110
112
|
)
|
|
111
113
|
|
|
112
114
|
const diffs = diffsBetweenStyles(beforeStyles, afterStyles)
|
package/src/commands/dump.ts
CHANGED
|
@@ -19,15 +19,15 @@ export async function dump({ output, config }: DumpConfig) {
|
|
|
19
19
|
const targetDir = process.cwd()
|
|
20
20
|
const postcss = importFrom(
|
|
21
21
|
targetDir,
|
|
22
|
-
'postcss'
|
|
22
|
+
'postcss',
|
|
23
23
|
) as typeof import('postcss').default
|
|
24
24
|
const tailwindcss = importFrom(
|
|
25
25
|
targetDir,
|
|
26
|
-
'tailwindcss'
|
|
26
|
+
'tailwindcss',
|
|
27
27
|
) as typeof import('tailwindcss')
|
|
28
28
|
const tailwindConfig = importFrom.silent(
|
|
29
29
|
targetDir,
|
|
30
|
-
config != null ? config : 'tailwind.config.js'
|
|
30
|
+
config != null ? config : 'tailwind.config.js',
|
|
31
31
|
) as TailwindConfig
|
|
32
32
|
const result = await postcss([tailwindcss(tailwindConfig)]).process(
|
|
33
33
|
sourceCSS,
|
|
@@ -35,7 +35,7 @@ export async function dump({ output, config }: DumpConfig) {
|
|
|
35
35
|
from: undefined,
|
|
36
36
|
to: undefined,
|
|
37
37
|
map: false,
|
|
38
|
-
}
|
|
38
|
+
},
|
|
39
39
|
)
|
|
40
40
|
const sink =
|
|
41
41
|
output != null
|
package/src/index.ts
CHANGED
|
@@ -43,7 +43,7 @@ void yargs
|
|
|
43
43
|
afterConfig: afterConfig != null ? afterConfig : config,
|
|
44
44
|
packages: packages != null ? packages.map((v) => `${v}`) : undefined,
|
|
45
45
|
})
|
|
46
|
-
}
|
|
46
|
+
},
|
|
47
47
|
)
|
|
48
48
|
.command(
|
|
49
49
|
'dump',
|
|
@@ -62,7 +62,7 @@ void yargs
|
|
|
62
62
|
output,
|
|
63
63
|
config,
|
|
64
64
|
})
|
|
65
|
-
}
|
|
65
|
+
},
|
|
66
66
|
)
|
|
67
67
|
.demandCommand()
|
|
68
68
|
.help()
|
package/src/style.ts
CHANGED
package/src/withPackages.ts
CHANGED
|
@@ -14,7 +14,7 @@ import { PackageManagerInfo } from './packageManager'
|
|
|
14
14
|
export async function withPackages<T>(
|
|
15
15
|
packageManagerInfo: PackageManagerInfo,
|
|
16
16
|
packageDescriptors: readonly string[],
|
|
17
|
-
callback: () => T | Promise<T
|
|
17
|
+
callback: () => T | Promise<T>,
|
|
18
18
|
): Promise<T> {
|
|
19
19
|
if (packageDescriptors.length === 0) {
|
|
20
20
|
return callback()
|
|
@@ -26,7 +26,7 @@ export async function withPackages<T>(
|
|
|
26
26
|
|
|
27
27
|
try {
|
|
28
28
|
const tmpdir = fs.mkdtempSync(
|
|
29
|
-
path.join(os.tmpdir(), 'tailwind-diff-packages-')
|
|
29
|
+
path.join(os.tmpdir(), 'tailwind-diff-packages-'),
|
|
30
30
|
)
|
|
31
31
|
defer(() => {
|
|
32
32
|
const files = fs.readdirSync(tmpdir)
|
|
@@ -45,7 +45,7 @@ export async function withPackages<T>(
|
|
|
45
45
|
path: packageManagerInfo.lockfilePath,
|
|
46
46
|
backup: path.join(
|
|
47
47
|
tmpdir,
|
|
48
|
-
path.basename(packageManagerInfo.lockfilePath)
|
|
48
|
+
path.basename(packageManagerInfo.lockfilePath),
|
|
49
49
|
),
|
|
50
50
|
}
|
|
51
51
|
: undefined
|