Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix typos
I thought that `convertable` was a valid word since you are "able to
convert" something. Turns out that this is spelled `convertible`.
  • Loading branch information
RobinMalfait committed Oct 21, 2024
commit c5f0bca593f2167e7caa40b43f2f28257b5cba72
10 changes: 5 additions & 5 deletions packages/@tailwindcss-upgrade/src/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,20 +159,20 @@ export async function analyze(stylesheets: Stylesheet[]) {
for (let sheet of stylesheets) {
if (!sheet.file) continue

let { convertablePaths, nonConvertablePaths } = sheet.analyzeImportPaths()
let isAmbiguous = convertablePaths.length > 0 && nonConvertablePaths.length > 0
let { convertiblePaths, nonConvertiblePaths } = sheet.analyzeImportPaths()
let isAmbiguous = convertiblePaths.length > 0 && nonConvertiblePaths.length > 0

if (!isAmbiguous) continue

sheet.canMigrate = false

let filePath = sheet.file.replace(commonPath, '')

for (let path of convertablePaths) {
for (let path of convertiblePaths) {
lines.push(`- ${filePath} <- ${pathToString(path)}`)
}

for (let path of nonConvertablePaths) {
for (let path of nonConvertiblePaths) {
lines.push(`- ${filePath} <- ${pathToString(path)}`)
}
}
Expand All @@ -197,7 +197,7 @@ export async function split(stylesheets: Stylesheet[]) {
}
}

// Keep track of sheets that contain `@utillity` rules
// Keep track of sheets that contain `@utility` rules
let containsUtilities = new Set<Stylesheet>()

for (let sheet of stylesheets) {
Expand Down
16 changes: 8 additions & 8 deletions packages/@tailwindcss-upgrade/src/stylesheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,26 +197,26 @@ export class Stylesheet {
* adjusting imports which is a non-trivial task.
*/
analyzeImportPaths() {
let convertablePaths: StylesheetConnection[][] = []
let nonConvertablePaths: StylesheetConnection[][] = []
let convertiblePaths: StylesheetConnection[][] = []
let nonConvertiblePaths: StylesheetConnection[][] = []

for (let path of this.pathsToRoot()) {
let isConvertable = false
let isConvertible = false

for (let { meta } of path) {
for (let layer of meta.layers) {
isConvertable ||= layer === 'utilities' || layer === 'components'
isConvertible ||= layer === 'utilities' || layer === 'components'
}
}

if (isConvertable) {
convertablePaths.push(path)
if (isConvertible) {
convertiblePaths.push(path)
} else {
nonConvertablePaths.push(path)
nonConvertiblePaths.push(path)
}
}

return { convertablePaths, nonConvertablePaths }
return { convertiblePaths, nonConvertiblePaths }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol what a typo 🤣

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be fair, convertable makes more sense to my non-native-English brain lol

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean same — it does make more sense. I guess I just wasn't thinking when I wrote it originally haha

}

[util.inspect.custom]() {
Expand Down