@glideapps/prettier-plugin-glide-tailwind
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -50,3 +50,4 @@ { | ||
"editor.renderControlCharacters": true, | ||
"editor.suggest.showStatusBar": true | ||
"editor.suggest.showStatusBar": true, | ||
"editor.wordWrapColumn": 120 | ||
} |
@@ -12,5 +12,5 @@ "use strict"; | ||
// Use this path for running tests.jsx locally during development | ||
// nodeModulesPath: path.join(__dirname, "../node_modules"), | ||
nodeModulesPath: path_1.default.join(__dirname, "../node_modules"), | ||
// Use this path for production builds to get it working in app/ | ||
nodeModulesPath: path_1.default.join(__dirname, "../../../../node_modules"), | ||
// nodeModulesPath: path.join(__dirname, "../../../../node_modules"), | ||
config: path_1.default.join(__dirname, "../tailwind.config.js"), | ||
@@ -17,0 +17,0 @@ }); |
@@ -56,5 +56,4 @@ "use strict"; | ||
const restructuredGroups = groups.map(({ names, content }) => `${names}:(${content})`); | ||
const newValue = `${restructuredClasses}${indentedNewLine}${restructuredGroups.join(`${indentedNewLine}`)}`.trim(); | ||
// loop through newvalue array and conditionally join a new \n and indent if media type | ||
// console.log(normalClasses); | ||
const indentedGroups = restructuredGroups.join(`${indentedNewLine}`); | ||
const newValue = ` ${restructuredClasses} ${indentedNewLine}${indentedGroups}`.trim(); | ||
node.value.value = newValue; | ||
@@ -61,0 +60,0 @@ node.value.extra = Object.assign(Object.assign({}, (node.value.extra || {})), { rawValue: newValue, raw: `"${newValue}"` }); |
@@ -42,8 +42,7 @@ "use strict"; | ||
// the additional +1 is to indent it below the child | ||
const indentString = support_1.default(node.loc.start.column - 8); | ||
const indentString = support_1.default(node.loc.start.column - 7); | ||
const indentedNewLine = `\n${indentString}`; | ||
// This will sort through tw definitions with this type of format: | ||
// css={[ tw`block mx-auto`]}, | ||
const normalClasses = twClassesSorter | ||
.sortClasslist(rawValue.replace(support_1.TW_MARCO_EXP, str => { | ||
const normalClasses = twClassesSorter.sortClasslist(rawValue.replace(support_1.TW_MARCO_EXP, str => { | ||
const groupNames = str | ||
@@ -61,11 +60,8 @@ .match(support_1.TW_MARCO_GROUP_NAMES_EXP) | ||
return ""; | ||
})) | ||
.join(" "); | ||
// Sort groups | ||
groups.sort(group_names_sorter_1.default(val => val.names[0])); | ||
})); | ||
const restructuredClasses = normalClasses.join(" "); | ||
// groups.sort(groupNamesSorter<{ names: string[] }>(val => val.names[0])); | ||
const restructuredGroups = groups.map(({ names, content }) => `${names}:(${content})`); | ||
// const finalStr = `\n${normalClasses} ${groups | ||
// .map(({ names, content }) => `${names.join(":")}:(${content})`) | ||
// .join(` \n${indentString}`)}`.trim(); | ||
const finalStr = `${normalClasses}${indentedNewLine}${restructuredGroups.join(`${indentedNewLine}`)}`.trim(); | ||
const indentedGroups = restructuredGroups.join(`${indentedNewLine}`); | ||
const finalStr = `${restructuredClasses.length > 20 ? indentedNewLine : ""}${restructuredClasses}${indentedNewLine}${indentedGroups}`.trim(); | ||
q.value.raw = finalStr; | ||
@@ -72,0 +68,0 @@ if (q.value.cooked) { |
@@ -7,4 +7,3 @@ import type TWClassesSorter from "tailwind-classes-sorter"; | ||
typescript: any; | ||
vue: any; | ||
}; | ||
export default _default; |
@@ -10,3 +10,2 @@ "use strict"; | ||
const typescript_1 = __importDefault(require("./typescript")); | ||
const vue_1 = __importDefault(require("./vue")); | ||
exports.default = (twClassesSorter) => ({ | ||
@@ -17,3 +16,2 @@ html: html_1.default(twClassesSorter), | ||
typescript: typescript_1.default(twClassesSorter), | ||
vue: vue_1.default(twClassesSorter), | ||
}); |
{ | ||
"name": "@glideapps/prettier-plugin-glide-tailwind", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Formatting and sorting for glide tailwind classes", | ||
@@ -5,0 +5,0 @@ "author": "Original author - Ari Seyhun | Modified by Bry Nguyen", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
82514
47
1068