prettier-plugin-motionwind 2.1.0
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/README.md +32 -0
- package/dist/index.cjs +110 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +85 -0
- package/dist/index.js.map +1 -0
- package/package.json +64 -0
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# prettier-plugin-motionwind
|
|
2
|
+
|
|
3
|
+
Sorts [motionwind](https://github.com/piyushzingade/motionwind) `animate-*` classes into a
|
|
4
|
+
consistent, canonical order — like `prettier-plugin-tailwindcss`, but for motion classes.
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm install -D prettier-plugin-motionwind
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```json
|
|
15
|
+
// .prettierrc
|
|
16
|
+
{
|
|
17
|
+
"plugins": ["prettier-plugin-motionwind"]
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Composes with `prettier-plugin-tailwindcss` — list motionwind **after** it:
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{ "plugins": ["prettier-plugin-tailwindcss", "prettier-plugin-motionwind"] }
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Order
|
|
28
|
+
|
|
29
|
+
`variant defs → gestures → transition → viewport → scroll → drag → layout → unknown → tailwind`
|
|
30
|
+
|
|
31
|
+
Only static `className` string literals are sorted. Classes without `animate-*` are left
|
|
32
|
+
untouched.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
parsers: () => parsers
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(src_exports);
|
|
26
|
+
var import_babel = require("prettier/plugins/babel");
|
|
27
|
+
var import_typescript = require("prettier/plugins/typescript");
|
|
28
|
+
var import_motionwind_core = require("motionwind-core");
|
|
29
|
+
var SKIP_KEYS = /* @__PURE__ */ new Set([
|
|
30
|
+
"loc",
|
|
31
|
+
"start",
|
|
32
|
+
"end",
|
|
33
|
+
"range",
|
|
34
|
+
"comments",
|
|
35
|
+
"leadingComments",
|
|
36
|
+
"trailingComments",
|
|
37
|
+
"innerComments",
|
|
38
|
+
"tokens",
|
|
39
|
+
"parent"
|
|
40
|
+
]);
|
|
41
|
+
function setSorted(node, original) {
|
|
42
|
+
if (!original.includes("animate-")) return;
|
|
43
|
+
const sorted = (0, import_motionwind_core.sortMotionClasses)(original);
|
|
44
|
+
if (sorted === original) return;
|
|
45
|
+
node.value = sorted;
|
|
46
|
+
if (typeof node.raw === "string" && node.raw.length >= 2) {
|
|
47
|
+
const q = node.raw[0];
|
|
48
|
+
node.raw = q + sorted + q;
|
|
49
|
+
}
|
|
50
|
+
if (node.extra && typeof node.extra.raw === "string" && node.extra.raw.length >= 2) {
|
|
51
|
+
const q = node.extra.raw[0];
|
|
52
|
+
node.extra.raw = q + sorted + q;
|
|
53
|
+
node.extra.rawValue = sorted;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function sortAttributeValue(value) {
|
|
57
|
+
if (!value || typeof value.value !== "string") return;
|
|
58
|
+
if (value.type === "StringLiteral" || value.type === "Literal") {
|
|
59
|
+
setSorted(value, value.value);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function walk(node, seen) {
|
|
63
|
+
if (!node || typeof node !== "object") return;
|
|
64
|
+
if (seen.has(node)) return;
|
|
65
|
+
seen.add(node);
|
|
66
|
+
if (Array.isArray(node)) {
|
|
67
|
+
for (const item of node) walk(item, seen);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (node.type === "JSXAttribute" && node.name?.name === "className") {
|
|
71
|
+
sortAttributeValue(node.value);
|
|
72
|
+
}
|
|
73
|
+
if (node.type === "TemplateLiteral" && (!node.expressions || node.expressions.length === 0) && Array.isArray(node.quasis) && node.quasis.length === 1) {
|
|
74
|
+
const raw = node.quasis[0].value.raw;
|
|
75
|
+
if (raw.includes("animate-")) {
|
|
76
|
+
const sorted = (0, import_motionwind_core.sortMotionClasses)(raw);
|
|
77
|
+
if (sorted !== raw) {
|
|
78
|
+
node.quasis[0].value.raw = sorted;
|
|
79
|
+
node.quasis[0].value.cooked = sorted;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
for (const key in node) {
|
|
84
|
+
if (SKIP_KEYS.has(key)) continue;
|
|
85
|
+
const child = node[key];
|
|
86
|
+
if (child && typeof child === "object") walk(child, seen);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function withSort(parser) {
|
|
90
|
+
return {
|
|
91
|
+
...parser,
|
|
92
|
+
async parse(...args) {
|
|
93
|
+
const ast = await parser.parse(...args);
|
|
94
|
+
walk(ast, /* @__PURE__ */ new WeakSet());
|
|
95
|
+
return ast;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
var parsers = {
|
|
100
|
+
babel: withSort(import_babel.parsers.babel),
|
|
101
|
+
"babel-ts": withSort(import_babel.parsers["babel-ts"]),
|
|
102
|
+
typescript: withSort(
|
|
103
|
+
import_typescript.parsers.typescript
|
|
104
|
+
)
|
|
105
|
+
};
|
|
106
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
107
|
+
0 && (module.exports = {
|
|
108
|
+
parsers
|
|
109
|
+
});
|
|
110
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { Parser } from \"prettier\";\nimport { parsers as babelParsers } from \"prettier/plugins/babel\";\nimport { parsers as typescriptParsers } from \"prettier/plugins/typescript\";\nimport { sortMotionClasses } from \"motionwind-core\";\n\n// AST keys that hold position/comment metadata or create cycles — skip them.\nconst SKIP_KEYS = new Set([\n \"loc\",\n \"start\",\n \"end\",\n \"range\",\n \"comments\",\n \"leadingComments\",\n \"trailingComments\",\n \"innerComments\",\n \"tokens\",\n \"parent\",\n]);\n\nfunction setSorted(node: any, original: string): void {\n if (!original.includes(\"animate-\")) return;\n const sorted = sortMotionClasses(original);\n if (sorted === original) return;\n node.value = sorted;\n // Re-quote the cached raw text (estree `.raw`, babel `.extra.raw`) using the\n // original quote character — the printer reads raw and would choke on null.\n // classNames never contain quote chars, so simple re-quoting is safe.\n if (typeof node.raw === \"string\" && node.raw.length >= 2) {\n const q = node.raw[0];\n node.raw = q + sorted + q;\n }\n if (\n node.extra &&\n typeof node.extra.raw === \"string\" &&\n node.extra.raw.length >= 2\n ) {\n const q = node.extra.raw[0];\n node.extra.raw = q + sorted + q;\n node.extra.rawValue = sorted;\n }\n}\n\nfunction sortAttributeValue(value: any): void {\n if (!value || typeof value.value !== \"string\") return;\n // babel → \"StringLiteral\"; typescript/estree → \"Literal\".\n if (value.type === \"StringLiteral\" || value.type === \"Literal\") {\n setSorted(value, value.value);\n }\n}\n\nfunction walk(node: any, seen: WeakSet<object>): void {\n if (!node || typeof node !== \"object\") return;\n if (seen.has(node)) return;\n seen.add(node);\n\n if (Array.isArray(node)) {\n for (const item of node) walk(item, seen);\n return;\n }\n\n if (node.type === \"JSXAttribute\" && node.name?.name === \"className\") {\n sortAttributeValue(node.value);\n }\n\n // Template literal with no expressions — the full class string lives in\n // quasis[0].value.raw. Sort it the same way as a regular string literal.\n if (\n node.type === \"TemplateLiteral\" &&\n (!node.expressions || node.expressions.length === 0) &&\n Array.isArray(node.quasis) &&\n node.quasis.length === 1\n ) {\n const raw: string = node.quasis[0].value.raw;\n if (raw.includes(\"animate-\")) {\n const sorted = sortMotionClasses(raw);\n if (sorted !== raw) {\n node.quasis[0].value.raw = sorted;\n node.quasis[0].value.cooked = sorted;\n }\n }\n }\n\n for (const key in node) {\n if (SKIP_KEYS.has(key)) continue;\n const child = node[key];\n if (child && typeof child === \"object\") walk(child, seen);\n }\n}\n\nfunction withSort(parser: Parser): Parser {\n return {\n ...parser,\n async parse(...args: unknown[]) {\n const ast = await (parser.parse as any)(...args);\n walk(ast, new WeakSet());\n return ast;\n },\n };\n}\n\nexport const parsers: Record<string, Parser> = {\n babel: withSort((babelParsers as Record<string, Parser>).babel!),\n \"babel-ts\": withSort((babelParsers as Record<string, Parser>)[\"babel-ts\"]!),\n typescript: withSort(\n (typescriptParsers as Record<string, Parser>).typescript!,\n ),\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAwC;AACxC,wBAA6C;AAC7C,6BAAkC;AAGlC,IAAM,YAAY,oBAAI,IAAI;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAA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AAS,UAAU,GAAG;AAC5B,YAAM,aAAS,0CAAkB,GAAG;AACpC,UAAI,WAAW,KAAK;AAClB,aAAK,OAAO,CAAC,EAAE,MAAM,MAAM;AAC3B,aAAK,OAAO,CAAC,EAAE,MAAM,SAAS;AAAA,MAChC;AAAA,IACF;AAAA,EACF;AAEA,aAAW,OAAO,MAAM;AACtB,QAAI,UAAU,IAAI,GAAG,EAAG;AACxB,UAAM,QAAQ,KAAK,GAAG;AACtB,QAAI,SAAS,OAAO,UAAU,SAAU,MAAK,OAAO,IAAI;AAAA,EAC1D;AACF;AAEA,SAAS,SAAS,QAAwB;AACxC,SAAO;AAAA,IACL,GAAG;AAAA,IACH,MAAM,SAAS,MAAiB;AAC9B,YAAM,MAAM,MAAO,OAAO,MAAc,GAAG,IAAI;AAC/C,WAAK,KAAK,oBAAI,QAAQ,CAAC;AACvB,aAAO;AAAA,IACT;AAAA,EACF;AACF;AAEO,IAAM,UAAkC;AAAA,EAC7C,OAAO,SAAU,aAAAA,QAAwC,KAAM;AAAA,EAC/D,YAAY,SAAU,aAAAA,QAAwC,UAAU,CAAE;AAAA,EAC1E,YAAY;AAAA,IACT,kBAAAC,QAA6C;AAAA,EAChD;AACF;","names":["babelParsers","typescriptParsers"]}
|
package/dist/index.d.cts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { parsers as babelParsers } from "prettier/plugins/babel";
|
|
3
|
+
import { parsers as typescriptParsers } from "prettier/plugins/typescript";
|
|
4
|
+
import { sortMotionClasses } from "motionwind-core";
|
|
5
|
+
var SKIP_KEYS = /* @__PURE__ */ new Set([
|
|
6
|
+
"loc",
|
|
7
|
+
"start",
|
|
8
|
+
"end",
|
|
9
|
+
"range",
|
|
10
|
+
"comments",
|
|
11
|
+
"leadingComments",
|
|
12
|
+
"trailingComments",
|
|
13
|
+
"innerComments",
|
|
14
|
+
"tokens",
|
|
15
|
+
"parent"
|
|
16
|
+
]);
|
|
17
|
+
function setSorted(node, original) {
|
|
18
|
+
if (!original.includes("animate-")) return;
|
|
19
|
+
const sorted = sortMotionClasses(original);
|
|
20
|
+
if (sorted === original) return;
|
|
21
|
+
node.value = sorted;
|
|
22
|
+
if (typeof node.raw === "string" && node.raw.length >= 2) {
|
|
23
|
+
const q = node.raw[0];
|
|
24
|
+
node.raw = q + sorted + q;
|
|
25
|
+
}
|
|
26
|
+
if (node.extra && typeof node.extra.raw === "string" && node.extra.raw.length >= 2) {
|
|
27
|
+
const q = node.extra.raw[0];
|
|
28
|
+
node.extra.raw = q + sorted + q;
|
|
29
|
+
node.extra.rawValue = sorted;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function sortAttributeValue(value) {
|
|
33
|
+
if (!value || typeof value.value !== "string") return;
|
|
34
|
+
if (value.type === "StringLiteral" || value.type === "Literal") {
|
|
35
|
+
setSorted(value, value.value);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function walk(node, seen) {
|
|
39
|
+
if (!node || typeof node !== "object") return;
|
|
40
|
+
if (seen.has(node)) return;
|
|
41
|
+
seen.add(node);
|
|
42
|
+
if (Array.isArray(node)) {
|
|
43
|
+
for (const item of node) walk(item, seen);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (node.type === "JSXAttribute" && node.name?.name === "className") {
|
|
47
|
+
sortAttributeValue(node.value);
|
|
48
|
+
}
|
|
49
|
+
if (node.type === "TemplateLiteral" && (!node.expressions || node.expressions.length === 0) && Array.isArray(node.quasis) && node.quasis.length === 1) {
|
|
50
|
+
const raw = node.quasis[0].value.raw;
|
|
51
|
+
if (raw.includes("animate-")) {
|
|
52
|
+
const sorted = sortMotionClasses(raw);
|
|
53
|
+
if (sorted !== raw) {
|
|
54
|
+
node.quasis[0].value.raw = sorted;
|
|
55
|
+
node.quasis[0].value.cooked = sorted;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
for (const key in node) {
|
|
60
|
+
if (SKIP_KEYS.has(key)) continue;
|
|
61
|
+
const child = node[key];
|
|
62
|
+
if (child && typeof child === "object") walk(child, seen);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function withSort(parser) {
|
|
66
|
+
return {
|
|
67
|
+
...parser,
|
|
68
|
+
async parse(...args) {
|
|
69
|
+
const ast = await parser.parse(...args);
|
|
70
|
+
walk(ast, /* @__PURE__ */ new WeakSet());
|
|
71
|
+
return ast;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
var parsers = {
|
|
76
|
+
babel: withSort(babelParsers.babel),
|
|
77
|
+
"babel-ts": withSort(babelParsers["babel-ts"]),
|
|
78
|
+
typescript: withSort(
|
|
79
|
+
typescriptParsers.typescript
|
|
80
|
+
)
|
|
81
|
+
};
|
|
82
|
+
export {
|
|
83
|
+
parsers
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { Parser } from \"prettier\";\nimport { parsers as babelParsers } from \"prettier/plugins/babel\";\nimport { parsers as typescriptParsers } from \"prettier/plugins/typescript\";\nimport { sortMotionClasses } from \"motionwind-core\";\n\n// AST keys that hold position/comment metadata or create cycles — skip them.\nconst SKIP_KEYS = new Set([\n \"loc\",\n \"start\",\n \"end\",\n \"range\",\n \"comments\",\n \"leadingComments\",\n \"trailingComments\",\n \"innerComments\",\n \"tokens\",\n \"parent\",\n]);\n\nfunction setSorted(node: any, original: string): void {\n if (!original.includes(\"animate-\")) return;\n const sorted = sortMotionClasses(original);\n if (sorted === original) return;\n node.value = sorted;\n // Re-quote the cached raw text (estree `.raw`, babel `.extra.raw`) using the\n // original quote character — the printer reads raw and would choke on null.\n // classNames never contain quote chars, so simple re-quoting is safe.\n if (typeof node.raw === \"string\" && node.raw.length >= 2) {\n const q = node.raw[0];\n node.raw = q + sorted + q;\n }\n if (\n node.extra &&\n typeof node.extra.raw === \"string\" &&\n node.extra.raw.length >= 2\n ) {\n const q = node.extra.raw[0];\n node.extra.raw = q + sorted + q;\n node.extra.rawValue = sorted;\n }\n}\n\nfunction sortAttributeValue(value: any): void {\n if (!value || typeof value.value !== \"string\") return;\n // babel → \"StringLiteral\"; typescript/estree → \"Literal\".\n if (value.type === \"StringLiteral\" || value.type === \"Literal\") {\n setSorted(value, value.value);\n }\n}\n\nfunction walk(node: any, seen: WeakSet<object>): void {\n if (!node || typeof node !== \"object\") return;\n if (seen.has(node)) return;\n seen.add(node);\n\n if (Array.isArray(node)) {\n for (const item of node) walk(item, seen);\n return;\n }\n\n if (node.type === \"JSXAttribute\" && node.name?.name === \"className\") {\n sortAttributeValue(node.value);\n }\n\n // Template literal with no expressions — the full class string lives in\n // quasis[0].value.raw. Sort it the same way as a regular string literal.\n if (\n node.type === \"TemplateLiteral\" &&\n (!node.expressions || node.expressions.length === 0) &&\n Array.isArray(node.quasis) &&\n node.quasis.length === 1\n ) {\n const raw: string = node.quasis[0].value.raw;\n if (raw.includes(\"animate-\")) {\n const sorted = sortMotionClasses(raw);\n if (sorted !== raw) {\n node.quasis[0].value.raw = sorted;\n node.quasis[0].value.cooked = sorted;\n }\n }\n }\n\n for (const key in node) {\n if (SKIP_KEYS.has(key)) continue;\n const child = node[key];\n if (child && typeof child === \"object\") walk(child, seen);\n }\n}\n\nfunction withSort(parser: Parser): Parser {\n return {\n ...parser,\n async parse(...args: unknown[]) {\n const ast = await (parser.parse as any)(...args);\n walk(ast, new WeakSet());\n return ast;\n },\n };\n}\n\nexport const parsers: Record<string, Parser> = {\n babel: withSort((babelParsers as Record<string, Parser>).babel!),\n \"babel-ts\": withSort((babelParsers as Record<string, Parser>)[\"babel-ts\"]!),\n typescript: withSort(\n (typescriptParsers as Record<string, Parser>).typescript!,\n ),\n};\n"],"mappings":";AACA,SAAS,WAAW,oBAAoB;AACxC,SAAS,WAAW,yBAAyB;AAC7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W,MAClD,MAAM,QAAQ,KAAK,MAAM,KACzB,KAAK,OAAO,WAAW,GACvB;AACA,UAAM,MAAc,KAAK,OAAO,CAAC,EAAE,MAAM;AACzC,QAAI,IAAI,SAAS,UAAU,GAAG;AAC5B,YAAM,SAAS,kBAAkB,GAAG;AACpC,UAAI,WAAW,KAAK;AAClB,aAAK,OAAO,CAAC,EAAE,MAAM,MAAM;AAC3B,aAAK,OAAO,CAAC,EAAE,MAAM,SAAS;AAAA,MAChC;AAAA,IACF;AAAA,EACF;AAEA,aAAW,OAAO,MAAM;AACtB,QAAI,UAAU,IAAI,GAAG,EAAG;AACxB,UAAM,QAAQ,KAAK,GAAG;AACtB,QAAI,SAAS,OAAO,UAAU,SAAU,MAAK,OAAO,IAAI;AAAA,EAC1D;AACF;AAEA,SAAS,SAAS,QAAwB;AACxC,SAAO;AAAA,IACL,GAAG;AAAA,IACH,MAAM,SAAS,MAAiB;AAC9B,YAAM,MAAM,MAAO,OAAO,MAAc,GAAG,IAAI;AAC/C,WAAK,KAAK,oBAAI,QAAQ,CAAC;AACvB,aAAO;AAAA,IACT;AAAA,EACF;AACF;AAEO,IAAM,UAAkC;AAAA,EAC7C,OAAO,SAAU,aAAwC,KAAM;AAAA,EAC/D,YAAY,SAAU,aAAwC,UAAU,CAAE;AAAA,EAC1E,YAAY;AAAA,IACT,kBAA6C;AAAA,EAChD;AACF;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "prettier-plugin-motionwind",
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"description": "Prettier plugin that sorts motionwind animate-* classes into a canonical order.",
|
|
7
|
+
"author": "piyush555",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/piyushzingade/motionwind.git",
|
|
12
|
+
"directory": "packages/prettier-plugin-motionwind"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/piyushzingade/motionwind/issues"
|
|
16
|
+
},
|
|
17
|
+
"homepage": "https://github.com/piyushzingade/motionwind#readme",
|
|
18
|
+
"keywords": [
|
|
19
|
+
"prettier",
|
|
20
|
+
"prettier-plugin",
|
|
21
|
+
"motionwind",
|
|
22
|
+
"motion",
|
|
23
|
+
"animation",
|
|
24
|
+
"tailwind"
|
|
25
|
+
],
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"import": "./dist/index.js",
|
|
29
|
+
"require": "./dist/index.cjs"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"main": "./dist/index.cjs",
|
|
33
|
+
"module": "./dist/index.js",
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"files": [
|
|
36
|
+
"dist"
|
|
37
|
+
],
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "tsup",
|
|
40
|
+
"dev": "tsup --watch",
|
|
41
|
+
"test": "vitest run",
|
|
42
|
+
"test:watch": "vitest",
|
|
43
|
+
"lint": "eslint --max-warnings 0",
|
|
44
|
+
"check-types": "tsc --noEmit"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"prettier": "^3.0.0"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"motionwind-core": "^2.1.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@repo/eslint-config": "*",
|
|
54
|
+
"@repo/typescript-config": "*",
|
|
55
|
+
"eslint": "^9.39.1",
|
|
56
|
+
"prettier": "^3.6.2",
|
|
57
|
+
"tsup": "^8.5.0",
|
|
58
|
+
"typescript": "5.9.2",
|
|
59
|
+
"vitest": "^3.2.1"
|
|
60
|
+
},
|
|
61
|
+
"publishConfig": {
|
|
62
|
+
"access": "public"
|
|
63
|
+
}
|
|
64
|
+
}
|