@kasoa/vite-plus-config 0.5.0 → 0.6.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 +51 -113
- package/dist/{compose-XJvIUwAG.d.mts → compose-DcbEF5Mv.d.mts} +1 -3
- package/dist/compose-DcbEF5Mv.d.mts.map +1 -0
- package/dist/{constants-D3UBePrC.mjs → constants-BYglvKjm.mjs} +2 -3
- package/dist/{constants-D3UBePrC.mjs.map → constants-BYglvKjm.mjs.map} +1 -1
- package/dist/src/cloudflare-workers/index.d.mts +2 -3
- package/dist/src/cloudflare-workers/index.d.mts.map +1 -1
- package/dist/src/cloudflare-workers/index.mjs +2 -3
- package/dist/src/index.d.mts +2 -9
- package/dist/src/index.d.mts.map +1 -1
- package/dist/src/index.mjs +42 -43
- package/dist/src/index.mjs.map +1 -1
- package/dist/src/lint/plugin/index.d.mts +4 -0
- package/dist/src/lint/plugin/index.d.mts.map +1 -0
- package/dist/src/lint/plugin/index.mjs +315 -0
- package/dist/src/lint/plugin/index.mjs.map +1 -0
- package/package.json +10 -6
- package/dist/compose-XJvIUwAG.d.mts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["isFunction"],"sources":["../../../../src/lint/plugin/rules/disable-reason.ts","../../../../src/lint/plugin/rules/effects-in-hooks.ts","../../../../src/lint/plugin/key-name.ts","../../../../src/lint/plugin/rules/legend-list-only.ts","../../../../src/lint/plugin/rules/no-dynamic-import.ts","../../../../src/lint/plugin/rules/no-mapped-scrollview.ts","../../../../src/lint/plugin/rules/no-shadowed-globals.ts","../../../../src/lint/plugin/index.ts"],"sourcesContent":["import type { ESTree } from \"vite-plus/lint/plugins\";\nimport { defineRule } from \"vite-plus/lint/plugins\";\n\n// oxlint has no `require-description` of its own, and the community plugin reads only `eslint-`\n// comments, so this reads both.\nconst directive =\n /^\\s*(?:oxlint|eslint)-(?<kind>disable-next-line|disable-line|disable|enable)(?<rest>(?:\\s.*)?)$/su;\n\n/** A directive's kind, the rules it names (none means every rule), and the reason after ` -- `. */\nexport const parseDirective = (comment: string) => {\n const { kind, rest = \"\" } = directive.exec(comment)?.groups ?? {};\n const [names = \"\", ...after] = rest.split(\" -- \");\n const rules = names\n .split(\",\")\n .map((name) => name.trim())\n .filter((name) => name !== \"\");\n return kind === undefined ? undefined : { kind, rules, reason: after.join(\" -- \").trim() };\n};\n\ntype Open = { comment: ESTree.Comment; rules: Set<string> }[];\n\n/** Closes what an `oxlint-enable` names in every open block; naming nothing closes them all. */\nconst enable = (open: Open, rules: string[]) => {\n for (const block of open) {\n if (rules.length === 0) block.rules.clear();\n for (const rule of rules) block.rules.delete(rule);\n }\n};\n\nexport const disableReason = defineRule({\n meta: {\n messages: {\n reason: \"Say why after ` -- `, in at least 10 characters.\",\n unclosed:\n \"Close this with `oxlint-enable {{rules}}`, so it covers only the lines that need it.\",\n },\n },\n create(context) {\n return {\n Program() {\n const open: Open = [];\n for (const comment of context.sourceCode.getAllComments()) {\n const parsed = parseDirective(comment.value);\n if (parsed === undefined) continue;\n if (parsed.kind === \"enable\") {\n enable(open, parsed.rules);\n continue;\n }\n if (parsed.reason.length < 10) context.report({ node: comment, messageId: \"reason\" });\n if (parsed.kind === \"disable\") {\n open.push({ comment, rules: new Set(parsed.rules.length > 0 ? parsed.rules : [\"*\"]) });\n }\n }\n for (const { comment, rules } of open) {\n if (rules.size > 0) {\n const names = [...rules].filter((rule) => rule !== \"*\").join(\", \");\n context.report({ node: comment, messageId: \"unclosed\", data: { rules: names } });\n }\n }\n },\n };\n },\n});\n","import type { ESTree } from \"vite-plus/lint/plugins\";\nimport { defineRule } from \"vite-plus/lint/plugins\";\n\nconst effects = new Set([\"useEffect\", \"useLayoutEffect\", \"useInsertionEffect\"]);\nconst hookName = /^use[A-Z0-9]/u;\n\n/** The name a function is known by: its own, or the variable it's assigned to. */\nfunction functionName(fn: ESTree.Node): string | undefined {\n if ((fn.type === \"FunctionDeclaration\" || fn.type === \"FunctionExpression\") && fn.id !== null) {\n return fn.id.name;\n }\n const { parent } = fn;\n return parent?.type === \"VariableDeclarator\" && parent.id.type === \"Identifier\"\n ? parent.id.name\n : undefined;\n}\n\nconst isFunction = (node: ESTree.Node) =>\n node.type === \"ArrowFunctionExpression\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"FunctionDeclaration\";\n\n// An effect syncs with a system outside React, and a hook named for that system owns it, so a\n// component reads as what it renders (\"You Might Not Need an Effect\" on react.dev).\nexport const effectsInHooks = defineRule({\n meta: {\n messages: {\n effect:\n \"Call {{name}} in a custom hook named for what it syncs with (`useSomething`), not in a component or plain function.\",\n },\n },\n create(context) {\n /** The React effect this identifier names, when it's bound to an import from React. */\n const effectNamed = (identifier: ESTree.Node): string | undefined => {\n if (identifier.type !== \"Identifier\") return undefined;\n const variable = context.sourceCode\n .getScope(identifier)\n .references.find((reference) => reference.identifier === identifier)?.resolved;\n const definition = variable?.defs.find(({ type }) => type === \"ImportBinding\");\n if (definition?.parent?.type !== \"ImportDeclaration\") return undefined;\n if (definition.parent.source.value !== \"react\") return undefined;\n const { node } = definition;\n if (node.type !== \"ImportSpecifier\") return undefined;\n const imported =\n node.imported.type === \"Identifier\" ? node.imported.name : node.imported.value;\n return effects.has(imported) ? imported : undefined;\n };\n /** `React.useEffect`, where `React` is React's default or namespace import. */\n const memberEffect = (callee: ESTree.MemberExpression): string | undefined => {\n const { object, property } = callee;\n if (object.type !== \"Identifier\" || property.type !== \"Identifier\" || callee.computed) {\n return undefined;\n }\n if (!effects.has(property.name)) return undefined;\n const variable = context.sourceCode\n .getScope(object)\n .references.find((reference) => reference.identifier === object)?.resolved;\n const definition = variable?.defs.find(({ type }) => type === \"ImportBinding\");\n const fromReact =\n definition?.parent?.type === \"ImportDeclaration\" &&\n definition.parent.source.value === \"react\" &&\n definition.node.type !== \"ImportSpecifier\";\n return fromReact ? property.name : undefined;\n };\n return {\n CallExpression(call) {\n const name =\n call.callee.type === \"MemberExpression\"\n ? memberEffect(call.callee)\n : effectNamed(call.callee);\n if (name === undefined) return;\n let owner: ESTree.Node | null = call.parent;\n while (owner !== null && !isFunction(owner)) owner = owner.parent;\n const ownerName = owner === null ? undefined : functionName(owner);\n if (ownerName === undefined || !hookName.test(ownerName)) {\n context.report({ node: call, messageId: \"effect\", data: { name } });\n }\n },\n };\n },\n});\n","import type { ESTree } from \"vite-plus/lint/plugins\";\n\n/** A property's name as written, or undefined where it's computed from a variable. */\nexport const keyName = (key: ESTree.Node, computed: boolean) => {\n if (key.type === \"Literal\") return String(key.value);\n if (key.type === \"TemplateLiteral\" && key.expressions.length === 0) {\n return key.quasis[0]?.value.cooked ?? undefined;\n }\n return !computed && key.type === \"Identifier\" ? key.name : undefined;\n};\n","import type { ESTree } from \"vite-plus/lint/plugins\";\nimport { defineRule } from \"vite-plus/lint/plugins\";\nimport { keyName } from \"../key-name.ts\";\n\n// The list engines React Native ships, and that Reanimated and Gesture Handler re-export (named, or\n// on Reanimated's default `Animated` and React Native's `Animated`).\nconst engines = new Set([\"FlatList\", \"SectionList\", \"VirtualizedList\", \"VirtualizedSectionList\"]);\nconst owners = new Set([\"react-native\", \"react-native-gesture-handler\", \"react-native-reanimated\"]);\n\nexport const legendListOnly = defineRule({\n meta: {\n messages: {\n engine:\n \"Every list of data is a Legend List (@legendapp/list): LegendList or AnimatedLegendList, or its SectionList for sections.\",\n },\n },\n create(context) {\n /** Whether the name is bound to an import from a list engine's owner. */\n const fromOwner = (object: ESTree.Node) => {\n if (object.type !== \"Identifier\" && object.type !== \"JSXIdentifier\") return false;\n const variable = context.sourceCode\n .getScope(object)\n .references.find(({ identifier }) => identifier.start === object.start)?.resolved;\n const declaration = variable?.defs.find(({ type }) => type === \"ImportBinding\")?.parent;\n return declaration?.type === \"ImportDeclaration\" && owners.has(declaration.source.value);\n };\n return {\n ImportSpecifier(node) {\n const imported =\n node.imported.type === \"Identifier\" ? node.imported.name : node.imported.value;\n if (\n engines.has(imported) &&\n node.parent.type === \"ImportDeclaration\" &&\n owners.has(node.parent.source.value)\n ) {\n context.report({ node, messageId: \"engine\" });\n }\n },\n MemberExpression(node) {\n const name = keyName(node.property, node.computed);\n if (name !== undefined && engines.has(name) && fromOwner(node.object)) {\n context.report({ node, messageId: \"engine\" });\n }\n },\n JSXMemberExpression(node) {\n if (engines.has(node.property.name) && fromOwner(node.object)) {\n context.report({ node, messageId: \"engine\" });\n }\n },\n };\n },\n});\n","import { defineRule } from \"vite-plus/lint/plugins\";\n\n// Metro's native builds and Wrangler put every module in one bundle, so a dynamic import splits\n// nothing there, and it hides what's imported from the import rules.\nexport const noDynamicImport = defineRule({\n meta: { messages: { dynamic: \"Import statically, so the import rules see what's imported.\" } },\n create(context) {\n return {\n ImportExpression(node) {\n context.report({ node, messageId: \"dynamic\" });\n },\n };\n },\n});\n","import type { Context, ESTree } from \"vite-plus/lint/plugins\";\nimport { defineRule } from \"vite-plus/lint/plugins\";\nimport { keyName } from \"../key-name.ts\";\n\n// React Native's scroll view, and the libraries' that wrap it, by the module each comes from.\nconst scrollViews = new Map([\n [\"react-native\", \"ScrollView\"],\n [\"react-native-gesture-handler\", \"ScrollView\"],\n [\"react-native-keyboard-controller\", \"KeyboardAwareScrollView\"],\n]);\n\n/** The `constantModules` option: modules whose exports are constants written in code. */\nfunction constantModulesOf(options: unknown): RegExp[] {\n if (typeof options !== \"object\" || options === null || !(\"constantModules\" in options)) return [];\n const { constantModules } = options;\n return Array.isArray(constantModules)\n ? constantModules\n .filter((pattern): pattern is string => typeof pattern === \"string\")\n .map((pattern) => new RegExp(pattern, \"u\"))\n : [];\n}\n\nconst isNode = (value: unknown): value is ESTree.Node =>\n typeof value === \"object\" && value !== null && \"type\" in value && typeof value.type === \"string\";\n\n/** Whether JSX is rendered anywhere in the node (a `.map` that renders, not one that computes). */\nfunction rendersJsx(node: ESTree.Node): boolean {\n if (node.type === \"JSXElement\" || node.type === \"JSXFragment\") return true;\n return Object.entries(node).some(\n ([key, value]) =>\n key !== \"parent\" &&\n (Array.isArray(value) ? value : [value]).some((child) => isNode(child) && rendersJsx(child)),\n );\n}\n\nfunction mapped(call: ESTree.CallExpression) {\n const { callee } = call;\n const [callback] = call.arguments;\n const isMap =\n callee.type === \"MemberExpression\" && keyName(callee.property, callee.computed) === \"map\";\n return isMap && callback !== undefined && rendersJsx(callback) ? callee.object : undefined;\n}\n\nconst isFunction = (node: ESTree.Node) =>\n node.type === \"ArrowFunctionExpression\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"FunctionDeclaration\";\n\nfunction renderedAt(context: Context, fn: ESTree.Node) {\n const declared = fn.parent?.type === \"VariableDeclarator\" ? fn.parent : fn;\n return context.sourceCode\n .getDeclaredVariables(declared)\n .filter(({ defs }) => defs.every(({ type }) => type !== \"Parameter\"))\n .filter(({ name }) => /^[A-Z]/u.test(name))\n .flatMap(({ references }) => references)\n .flatMap(({ identifier }) => {\n const opening = identifier.parent;\n return opening.type === \"JSXOpeningElement\" && opening.parent.type === \"JSXElement\"\n ? [opening.parent]\n : [];\n });\n}\n\n/** Where a JSX element's name was imported from, and under what name, if it was imported. */\nfunction importOf(context: Context, element: ESTree.JSXOpeningElement) {\n const { name } = element;\n const variable =\n name.type === \"JSXIdentifier\"\n ? context.sourceCode\n .getScope(element)\n .references.find(({ identifier }) => identifier.start === name.start)?.resolved\n : undefined;\n const definition = variable?.defs.find(({ type }) => type === \"ImportBinding\");\n const { node, parent } = definition ?? {};\n let imported = \"default\";\n if (node?.type === \"ImportSpecifier\") {\n imported = node.imported.type === \"Identifier\" ? node.imported.name : node.imported.value;\n }\n return parent?.type === \"ImportDeclaration\" ? { from: parent.source.value, imported } : undefined;\n}\n\n// A list of data is a virtualised list; a ScrollView holds content written in code. Rendering a\n// constant written in code is that; rendering anything else (a query's rows, a prop, state),\n// anywhere under the ScrollView, is a list of data.\nexport const noMappedScrollview = defineRule({\n meta: {\n defaultOptions: [{}],\n schema: [\n {\n type: \"object\",\n properties: { constantModules: { type: \"array\", items: { type: \"string\" } } },\n additionalProperties: false,\n },\n ],\n messages: {\n data: \"This maps data inside a {{view}}. Use a Legend List, with the rest of the {{view}} as its ListHeaderComponent or ListFooterComponent.\",\n },\n },\n create(context) {\n const constantModules = constantModulesOf(context.options[0]);\n const isConstant = (array: ESTree.Node) => {\n if (array.type !== \"Identifier\") return false;\n const variable = context.sourceCode\n .getScope(array)\n .references.find(({ identifier }) => identifier === array)?.resolved;\n const definition = variable?.defs[0];\n const declaration = definition?.parent;\n if (definition?.type === \"ImportBinding\") {\n return (\n declaration?.type === \"ImportDeclaration\" &&\n constantModules.some((pattern) => pattern.test(declaration.source.value))\n );\n }\n return (\n variable?.scope.type === \"module\" &&\n definition?.type === \"Variable\" &&\n declaration?.type === \"VariableDeclaration\" &&\n declaration.kind === \"const\"\n );\n };\n const readsOf = (declarator: ESTree.VariableDeclarator) =>\n context.sourceCode\n .getDeclaredVariables(declarator)\n .flatMap(({ references }) => references)\n .filter((reference) => reference.isRead())\n .map(({ identifier }) => identifier);\n /** The element's name, when it's a library's scroll view. */\n const scrollViewNamed = (element: ESTree.JSXElement) => {\n const origin = importOf(context, element.openingElement);\n return origin !== undefined && scrollViews.get(origin.from) === origin.imported\n ? origin.imported\n : undefined;\n };\n /** The scroll view this node is rendered in, through components written in this file. */\n const scrollViewAround = (node: ESTree.Node, seen: Set<ESTree.Node>): string | undefined => {\n for (let at = node.parent; at !== null; at = at.parent) {\n const view = at.type === \"JSXElement\" ? scrollViewNamed(at) : undefined;\n if (view !== undefined) return view;\n if (at.type === \"VariableDeclarator\" && !seen.has(at)) {\n seen.add(at);\n const renderedIn = readsOf(at)\n .map((identifier) => scrollViewAround(identifier, seen))\n .find((each) => each !== undefined);\n if (renderedIn !== undefined) return renderedIn;\n }\n if (isFunction(at) && !seen.has(at)) {\n seen.add(at);\n const renderedIn = renderedAt(context, at)\n .map((element) => scrollViewAround(element, seen))\n .find((each) => each !== undefined);\n if (renderedIn !== undefined) return renderedIn;\n }\n }\n return undefined;\n };\n return {\n CallExpression(call) {\n const array = mapped(call);\n if (array === undefined || isConstant(array)) return;\n const view = scrollViewAround(call, new Set());\n if (view !== undefined) context.report({ node: call, messageId: \"data\", data: { view } });\n },\n };\n },\n});\n","import { runInNewContext } from \"node:vm\";\nimport { defineRule } from \"vite-plus/lint/plugins\";\n\n// The language's own globals, as a fresh context holds them: no browser, Node or Hermes names, so\n// a local `event` or `name` stays free. Oxlint's `no-shadow` with `builtinGlobals` flags those too.\nconst languageGlobals = new Set(Object.getOwnPropertyNames(runInNewContext(\"globalThis\")));\n\n// The React Compiler's output calls `Symbol.for` in every compiled component, so a binding named\n// `Symbol` (such as `const Symbol = withUniwind(...)`) breaks each one in its scope. Any\n// language global is the same hazard.\nexport const noShadowedGlobals = defineRule({\n meta: {\n messages: {\n shadowed:\n \"`{{name}}` is a language global: code in this scope, and the React Compiler's output, would read this binding instead. Name it differently.\",\n },\n },\n create(context) {\n // A class declares its name twice, outside and inside its body.\n const reported = new Set<unknown>();\n const check = (node: Parameters<typeof context.sourceCode.getDeclaredVariables>[0]) => {\n for (const variable of context.sourceCode.getDeclaredVariables(node)) {\n const [identifier = node] = variable.identifiers;\n if (languageGlobals.has(variable.name) && !reported.has(identifier)) {\n reported.add(identifier);\n context.report({\n node: identifier,\n messageId: \"shadowed\",\n data: { name: variable.name },\n });\n }\n }\n };\n return {\n VariableDeclarator: check,\n FunctionDeclaration: check,\n ClassDeclaration: check,\n ImportSpecifier: check,\n ImportDefaultSpecifier: check,\n ImportNamespaceSpecifier: check,\n };\n },\n});\n","import type { Plugin } from \"vite-plus/lint/plugins\";\nimport { definePlugin } from \"vite-plus/lint/plugins\";\nimport { disableReason } from \"./rules/disable-reason.ts\";\nimport { effectsInHooks } from \"./rules/effects-in-hooks.ts\";\nimport { legendListOnly } from \"./rules/legend-list-only.ts\";\nimport { noDynamicImport } from \"./rules/no-dynamic-import.ts\";\nimport { noMappedScrollview } from \"./rules/no-mapped-scrollview.ts\";\nimport { noShadowedGlobals } from \"./rules/no-shadowed-globals.ts\";\n\nconst kasoaPlugin: Plugin = definePlugin({\n meta: { name: \"kasoa\" },\n rules: {\n \"disable-reason\": disableReason,\n \"effects-in-hooks\": effectsInHooks,\n \"legend-list-only\": legendListOnly,\n \"no-dynamic-import\": noDynamicImport,\n \"no-mapped-scrollview\": noMappedScrollview,\n \"no-shadowed-globals\": noShadowedGlobals,\n },\n});\n\nexport default kasoaPlugin;\n"],"mappings":";;;AAKA,MAAM,YACJ;;AAGF,MAAa,kBAAkB,YAAoB;CACjD,MAAM,EAAE,MAAM,OAAO,OAAO,UAAU,KAAK,OAAO,CAAC,EAAE,UAAU,CAAC;CAChE,MAAM,CAAC,QAAQ,IAAI,GAAG,SAAS,KAAK,MAAM,MAAM;CAChD,MAAM,QAAQ,MACX,MAAM,GAAG,CAAC,CACV,KAAK,SAAS,KAAK,KAAK,CAAC,CAAC,CAC1B,QAAQ,SAAS,SAAS,EAAE;CAC/B,OAAO,SAAS,KAAA,IAAY,KAAA,IAAY;EAAE;EAAM;EAAO,QAAQ,MAAM,KAAK,MAAM,CAAC,CAAC,KAAK;CAAE;AAC3F;;AAKA,MAAM,UAAU,MAAY,UAAoB;CAC9C,KAAK,MAAM,SAAS,MAAM;EACxB,IAAI,MAAM,WAAW,GAAG,MAAM,MAAM,MAAM;EAC1C,KAAK,MAAM,QAAQ,OAAO,MAAM,MAAM,OAAO,IAAI;CACnD;AACF;AAEA,MAAa,gBAAgB,WAAW;CACtC,MAAM,EACJ,UAAU;EACR,QAAQ;EACR,UACE;CACJ,EACF;CACA,OAAO,SAAS;EACd,OAAO,EACL,UAAU;GACR,MAAM,OAAa,CAAC;GACpB,KAAK,MAAM,WAAW,QAAQ,WAAW,eAAe,GAAG;IACzD,MAAM,SAAS,eAAe,QAAQ,KAAK;IAC3C,IAAI,WAAW,KAAA,GAAW;IAC1B,IAAI,OAAO,SAAS,UAAU;KAC5B,OAAO,MAAM,OAAO,KAAK;KACzB;IACF;IACA,IAAI,OAAO,O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MACX,MAAM,EAAE,MAAM,SAAS,KAAK;KAC9B,CAAC;IACH;GACF;EACF;EACA,OAAO;GACL,oBAAoB;GACpB,qBAAqB;GACrB,kBAAkB;GAClB,iBAAiB;GACjB,wBAAwB;GACxB,0BAA0B;EAC5B;CACF;AACF,CAAC;;ACjCD,MAAM,cAAsB,aAAa;CACvC,MAAM,EAAE,MAAM,QAAQ;CACtB,OAAO;EACL,kBAAkB;EAClB,oBAAoB;EACpB,oBAAoB;EACpB,qBAAqB;EACrB,wBAAwB;EACxB,uBAAuB;CACzB;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kasoa/vite-plus-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Kasoa's Vite+ configurations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"config",
|
|
@@ -36,21 +36,25 @@
|
|
|
36
36
|
"./cloudflare-workers": {
|
|
37
37
|
"types": "./dist/src/cloudflare-workers/index.d.mts",
|
|
38
38
|
"import": "./dist/src/cloudflare-workers/index.mjs"
|
|
39
|
+
},
|
|
40
|
+
"./oxlint-plugin": {
|
|
41
|
+
"types": "./dist/src/lint/plugin/index.d.mts",
|
|
42
|
+
"import": "./dist/src/lint/plugin/index.mjs"
|
|
39
43
|
}
|
|
40
44
|
},
|
|
41
45
|
"publishConfig": {
|
|
42
46
|
"access": "public"
|
|
43
47
|
},
|
|
44
48
|
"devDependencies": {
|
|
45
|
-
"@cloudflare/vitest-plugin": "1.
|
|
46
|
-
"@types/node": "24.
|
|
49
|
+
"@cloudflare/vitest-plugin": "1.4.9",
|
|
50
|
+
"@types/node": "24.19.2",
|
|
47
51
|
"typescript": "^7.0.2",
|
|
48
|
-
"vite-plus": "^
|
|
52
|
+
"vite-plus": "^1.4.0"
|
|
49
53
|
},
|
|
50
54
|
"peerDependencies": {
|
|
51
|
-
"@cloudflare/vitest-plugin": "^1.
|
|
55
|
+
"@cloudflare/vitest-plugin": "^1.4.0",
|
|
52
56
|
"typescript": ">=7 <8",
|
|
53
|
-
"vite-plus": ">=
|
|
57
|
+
"vite-plus": ">=1.4.0 <2"
|
|
54
58
|
},
|
|
55
59
|
"peerDependenciesMeta": {
|
|
56
60
|
"@cloudflare/vitest-plugin": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compose-XJvIUwAG.d.mts","names":[],"sources":["../src/compose.ts"],"mappings":";;UAGU;WACC;;KAGN,cAAc;KAEP,cAAc,cAAc,QAAQ,wBAAwB;KAE5D,iBAAiB,KAAK;WACvB,mBAAmB;;iBAQd,iBAAiB,oBAAoB,mBAAmB"}
|