soltag 0.0.1
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/LICENSE +21 -0
- package/README.md +248 -0
- package/dist/chunk-LNEBK5MP.js +192 -0
- package/dist/chunk-LNEBK5MP.js.map +1 -0
- package/dist/esbuild.d.ts +7 -0
- package/dist/esbuild.js +10 -0
- package/dist/esbuild.js.map +1 -0
- package/dist/index.d.ts +95 -0
- package/dist/index.js +198 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.cjs +391 -0
- package/dist/plugin.cjs.map +1 -0
- package/dist/rollup.d.ts +8 -0
- package/dist/rollup.js +10 -0
- package/dist/rollup.js.map +1 -0
- package/dist/unplugin.d.ts +19 -0
- package/dist/unplugin.js +11 -0
- package/dist/unplugin.js.map +1 -0
- package/dist/vite.d.ts +7 -0
- package/dist/vite.js +10 -0
- package/dist/vite.js.map +1 -0
- package/dist/webpack.d.ts +7 -0
- package/dist/webpack.js +10 -0
- package/dist/webpack.js.map +1 -0
- package/package.json +89 -0
- package/plugin.js +4 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/plugin/analysis.ts","../src/solc.ts","../src/plugin/solc-cache.ts","../src/plugin/completions.ts","../src/plugin/diagnostics.ts","../src/plugin/quickinfo.ts","../src/plugin/index.ts"],"sourcesContent":["import type tslib from \"typescript/lib/tsserverlibrary\";\n\nexport interface SolLiteralInfo {\n /** Solidity source text, or undefined if the template has unresolvable interpolations */\n source: string | undefined;\n /** Position of the template literal expression in the source file */\n pos: number;\n /** End position */\n end: number;\n /** The node itself */\n node: tslib.TaggedTemplateExpression;\n}\n\n/**\n * Find all `sol` tagged template expressions in a source file.\n */\nexport function findSolTemplateLiterals(ts: typeof tslib, sourceFile: tslib.SourceFile): SolLiteralInfo[] {\n const results: SolLiteralInfo[] = [];\n\n function visit(node: tslib.Node) {\n if (ts.isTaggedTemplateExpression(node) && ts.isIdentifier(node.tag) && node.tag.text === \"sol\") {\n results.push({\n source: extractTemplateText(ts, node.template),\n pos: node.pos,\n end: node.end,\n node,\n });\n }\n\n ts.forEachChild(node, visit);\n }\n\n visit(sourceFile);\n return results;\n}\n\n/**\n * Information about a `.call()` expression on a sol-derived variable.\n */\nexport interface CallSiteInfo {\n /** The Solidity source from the sol`` literal */\n soliditySource: string;\n /** The function name argument node (if it's a string literal) */\n functionNameNode: tslib.StringLiteral | undefined;\n /** The function name string (if available) */\n functionName: string | undefined;\n /** The args argument node (if present) */\n argsNode: tslib.Node | undefined;\n /** The full .call() expression */\n callExpression: tslib.CallExpression;\n}\n\n/**\n * Check if a position is inside a `.call()` on a sol-derived variable.\n * Returns info about the call site, or undefined if not applicable.\n */\nexport function getCallSiteAtPosition(\n ts: typeof tslib,\n sourceFile: tslib.SourceFile,\n position: number,\n): CallSiteInfo | undefined {\n const node = findNodeAtPosition(ts, sourceFile, position);\n if (!node) return undefined;\n\n // Walk up to find a CallExpression\n const callExpr = findAncestor(node, ts.isCallExpression);\n if (!callExpr) return undefined;\n\n // Check if it's a `.call(...)` expression\n const expr = callExpr.expression;\n if (!ts.isPropertyAccessExpression(expr)) return undefined;\n if (expr.name.text !== \"call\") return undefined;\n\n // Trace the object back to a sol`` literal\n const soliditySource = traceToSolLiteral(ts, expr.expression, sourceFile);\n if (!soliditySource) return undefined;\n\n // Extract arguments\n const args = callExpr.arguments;\n // .call(client, functionName, args)\n const functionNameArg = args.length >= 2 ? args[1] : undefined;\n const argsArg = args.length >= 3 ? args[2] : undefined;\n\n return {\n soliditySource,\n functionNameNode: functionNameArg && ts.isStringLiteral(functionNameArg) ? functionNameArg : undefined,\n functionName: functionNameArg && ts.isStringLiteral(functionNameArg) ? functionNameArg.text : undefined,\n argsNode: argsArg,\n callExpression: callExpr,\n };\n}\n\n/**\n * Trace an expression back to a `sol` tagged template literal.\n * Returns the Solidity source string, or undefined if the expression\n * doesn't trace back to a sol`` literal.\n */\nexport function traceToSolLiteral(\n ts: typeof tslib,\n node: tslib.Node,\n sourceFile: tslib.SourceFile,\n): string | undefined {\n // Direct: sol`...`.call(...)\n if (ts.isTaggedTemplateExpression(node) && ts.isIdentifier(node.tag) && node.tag.text === \"sol\") {\n return extractTemplateText(ts, node.template);\n }\n\n // Variable reference: const x = sol`...`; x.call(...)\n if (ts.isIdentifier(node)) {\n const declaration = findVariableDeclaration(ts, node, sourceFile);\n if (\n declaration?.initializer &&\n ts.isTaggedTemplateExpression(declaration.initializer) &&\n ts.isIdentifier(declaration.initializer.tag) &&\n declaration.initializer.tag.text === \"sol\"\n ) {\n return extractTemplateText(ts, declaration.initializer.template);\n }\n }\n\n return undefined;\n}\n\nfunction extractTemplateText(ts: typeof tslib, template: tslib.TemplateLiteral): string | undefined {\n if (ts.isNoSubstitutionTemplateLiteral(template)) {\n return template.text;\n }\n // Template has interpolations — can't resolve statically in the plugin\n return undefined;\n}\n\n/**\n * Find the variable declaration for an identifier by walking the AST.\n */\nfunction findVariableDeclaration(\n ts: typeof tslib,\n identifier: tslib.Identifier,\n sourceFile: tslib.SourceFile,\n): tslib.VariableDeclaration | undefined {\n const name = identifier.text;\n let result: tslib.VariableDeclaration | undefined;\n\n function visit(node: tslib.Node) {\n if (result) return;\n\n if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.name.text === name) {\n result = node;\n return;\n }\n ts.forEachChild(node, visit);\n }\n\n visit(sourceFile);\n return result;\n}\n\n/**\n * Find the innermost node at a given position.\n */\nfunction findNodeAtPosition(ts: typeof tslib, sourceFile: tslib.SourceFile, position: number): tslib.Node | undefined {\n let result: tslib.Node | undefined;\n\n function visit(node: tslib.Node) {\n if (position >= node.getStart(sourceFile) && position < node.getEnd()) {\n result = node;\n ts.forEachChild(node, visit);\n }\n }\n\n visit(sourceFile);\n return result;\n}\n\n/**\n * Walk up the AST to find an ancestor matching a predicate.\n */\nfunction findAncestor<T extends tslib.Node>(\n node: tslib.Node,\n predicate: (node: tslib.Node) => node is T,\n): T | undefined {\n let current: tslib.Node | undefined = node;\n while (current) {\n if (predicate(current)) return current;\n current = current.parent;\n }\n return undefined;\n}\n\n/**\n * Determine which argument position (0-based) the cursor is in\n * within a call expression.\n */\nexport function getArgumentIndex(\n callExpression: tslib.CallExpression,\n position: number,\n sourceFile: tslib.SourceFile,\n): number {\n const args = callExpression.arguments;\n for (let i = args.length - 1; i >= 0; i--) {\n if (position >= args[i].getStart(sourceFile)) {\n return i;\n }\n }\n // Before first arg or in the parens\n return 0;\n}\n","/**\n * Shared solc-js types and helpers used by both the runtime compiler\n * and the LS plugin cache.\n */\n\nexport interface SolcModule {\n compile(input: string): string;\n}\n\n/**\n * Build the standard JSON input object for solc.\n */\nexport function buildSolcInput(source: string) {\n return {\n language: \"Solidity\" as const,\n sources: {\n \"inline.sol\": { content: source },\n },\n settings: {\n optimizer: { enabled: true, runs: 1 },\n outputSelection: {\n \"*\": {\n \"*\": [\"abi\", \"evm.bytecode.object\", \"evm.deployedBytecode.object\"],\n },\n },\n },\n };\n}\n\n// --- solc standard output types ---\n\nexport interface SolcStandardOutput {\n contracts?: Record<string, Record<string, SolcContractOutput>>;\n errors?: SolcError[];\n}\n\nexport interface SolcContractOutput {\n abi: SolcAbiItem[];\n evm: {\n bytecode: { object: string };\n deployedBytecode: { object: string };\n };\n}\n\nexport interface SolcAbiItem {\n type: string;\n name?: string;\n inputs?: SolcAbiParam[];\n outputs?: SolcAbiParam[];\n stateMutability?: string;\n}\n\nexport interface SolcAbiParam {\n name: string;\n type: string;\n components?: SolcAbiParam[];\n internalType?: string;\n}\n\nexport interface SolcError {\n severity: string;\n message: string;\n formattedMessage: string;\n sourceLocation?: {\n file: string;\n start: number;\n end: number;\n };\n}\n","/**\n * In-plugin compilation cache.\n * Shares solc types and input-building with the runtime compiler,\n * but maintains a separate cache keyed by raw source string\n * (no hashing needed in the plugin environment).\n */\nimport {\n buildSolcInput,\n type SolcAbiItem,\n type SolcAbiParam,\n type SolcModule,\n type SolcStandardOutput,\n} from \"../solc.js\";\n\nexport type { SolcAbiItem, SolcAbiParam, SolcStandardOutput };\n\n// The LS plugin always runs in tsserver (CJS), so require is available natively.\nlet solcInstance: SolcModule | undefined;\n\nfunction getSolc(): SolcModule {\n if (!solcInstance) {\n solcInstance = require(\"solc\") as SolcModule;\n }\n return solcInstance;\n}\n\nconst cache = new Map<string, SolcStandardOutput>();\n\nexport function compileCached(source: string): SolcStandardOutput {\n const existing = cache.get(source);\n if (existing) return existing;\n\n const solc = getSolc();\n const input = buildSolcInput(source);\n const rawOutput = solc.compile(JSON.stringify(input));\n const output = JSON.parse(rawOutput) as SolcStandardOutput;\n\n cache.set(source, output);\n return output;\n}\n\n/**\n * Extract all ABI items from a compilation result.\n */\nexport function extractAllAbis(output: SolcStandardOutput): SolcAbiItem[] {\n if (!output.contracts) return [];\n\n return Object.values(output.contracts).flatMap((fileContracts) =>\n Object.values(fileContracts).flatMap((contract) => contract.abi),\n );\n}\n\n/**\n * Get all view/pure function names from compiled output.\n */\nexport function getCallableFunctionNames(output: SolcStandardOutput): string[] {\n return extractAllAbis(output)\n .filter((item) => item.type === \"function\" && (item.stateMutability === \"view\" || item.stateMutability === \"pure\"))\n .map((item) => item.name!)\n .filter(Boolean);\n}\n\n/**\n * Find a specific function's ABI item by name.\n */\nexport function findFunctionAbi(output: SolcStandardOutput, functionName: string): SolcAbiItem | undefined {\n return extractAllAbis(output).find((item) => item.type === \"function\" && item.name === functionName);\n}\n","import type tslib from \"typescript/lib/tsserverlibrary\";\n\nimport { getArgumentIndex, getCallSiteAtPosition } from \"./analysis.js\";\nimport {\n compileCached,\n findFunctionAbi,\n getCallableFunctionNames,\n type SolcAbiParam,\n type SolcStandardOutput,\n} from \"./solc-cache.js\";\n\n/**\n * Map a Solidity type to a TypeScript type string for display.\n */\nexport function solidityTypeToTs(param: SolcAbiParam): string {\n const t = param.type;\n\n if (t === \"address\") return \"`0x${string}`\";\n if (t === \"bool\") return \"boolean\";\n if (t === \"string\") return \"string\";\n if (t === \"bytes\" || t.match(/^bytes\\d+$/)) return \"`0x${string}`\";\n\n if (t.match(/^u?int\\d*$/)) return \"bigint\";\n\n // Arrays\n if (t.endsWith(\"[]\")) {\n const inner = { ...param, type: t.slice(0, -2) };\n return `${solidityTypeToTs(inner)}[]`;\n }\n\n // Fixed-size arrays\n const fixedArray = t.match(/^(.+)\\[(\\d+)\\]$/);\n if (fixedArray) {\n const inner = { ...param, type: fixedArray[1] };\n return `${solidityTypeToTs(inner)}[]`;\n }\n\n // Tuples\n if (t === \"tuple\" && param.components) {\n const fields = param.components.map((c) => `${c.name}: ${solidityTypeToTs(c)}`).join(\"; \");\n return `{ ${fields} }`;\n }\n\n return \"unknown\";\n}\n\n/**\n * Format a function's return type for display.\n */\nexport function formatReturnType(outputs: SolcAbiParam[]): string {\n if (outputs.length === 0) return \"void\";\n if (outputs.length === 1) return solidityTypeToTs(outputs[0]);\n // Multiple returns → tuple\n return `[${outputs.map((o) => solidityTypeToTs(o)).join(\", \")}]`;\n}\n\nexport function createGetCompletionsAtPosition(\n ts: typeof tslib,\n info: tslib.server.PluginCreateInfo,\n): tslib.LanguageService[\"getCompletionsAtPosition\"] {\n return (fileName, position, options, formattingSettings) => {\n // Always get the default completions first\n const prior = info.languageService.getCompletionsAtPosition(fileName, position, options, formattingSettings);\n\n const program = info.languageService.getProgram();\n if (!program) return prior;\n\n const sourceFile = program.getSourceFile(fileName);\n if (!sourceFile) return prior;\n\n const callSite = getCallSiteAtPosition(ts, sourceFile, position);\n if (!callSite) return prior;\n\n const argIndex = getArgumentIndex(callSite.callExpression, position, sourceFile);\n\n // Argument index 1 = functionName\n if (argIndex === 1) {\n let output: SolcStandardOutput;\n try {\n output = compileCached(callSite.soliditySource);\n } catch {\n return prior;\n }\n\n const functionNames = getCallableFunctionNames(output);\n\n const entries: tslib.CompletionEntry[] = functionNames.map((name) => {\n const fnAbi = findFunctionAbi(output!, name);\n const returnType = fnAbi?.outputs ? formatReturnType(fnAbi.outputs) : \"unknown\";\n const params = fnAbi?.inputs?.map((p) => `${p.name || \"_\"}: ${p.type}`).join(\", \");\n\n return {\n name,\n kind: ts.ScriptElementKind.memberFunctionElement,\n sortText: \"0\",\n labelDetails: {\n description: `(${params || \"\"}) → ${returnType}`,\n },\n };\n });\n\n return {\n isGlobalCompletion: false,\n isMemberCompletion: false,\n isNewIdentifierLocation: false,\n entries,\n };\n }\n\n return prior;\n };\n}\n","import type tslib from \"typescript/lib/tsserverlibrary\";\n\nimport { findSolTemplateLiterals } from \"./analysis.js\";\nimport { compileCached, type SolcStandardOutput } from \"./solc-cache.js\";\n\nexport function createGetSemanticDiagnostics(\n ts: typeof tslib,\n info: tslib.server.PluginCreateInfo,\n): tslib.LanguageService[\"getSemanticDiagnostics\"] {\n return (fileName) => {\n const prior = info.languageService.getSemanticDiagnostics(fileName);\n\n const program = info.languageService.getProgram();\n if (!program) return prior;\n\n const sourceFile = program.getSourceFile(fileName);\n if (!sourceFile) return prior;\n\n const solLiterals = findSolTemplateLiterals(ts, sourceFile);\n const solDiagnostics: tslib.Diagnostic[] = [];\n\n for (const literal of solLiterals) {\n if (literal.source === undefined) continue;\n\n let output: SolcStandardOutput;\n try {\n output = compileCached(literal.source);\n } catch {\n // If solc itself crashes, report a generic error\n solDiagnostics.push({\n file: sourceFile,\n start: literal.pos,\n length: literal.end - literal.pos,\n messageText: \"Failed to compile Solidity source\",\n category: ts.DiagnosticCategory.Error,\n code: 90001,\n });\n continue;\n }\n\n if (!output.errors) continue;\n\n for (const error of output.errors) {\n const category =\n error.severity === \"error\"\n ? ts.DiagnosticCategory.Error\n : error.severity === \"warning\"\n ? ts.DiagnosticCategory.Warning\n : ts.DiagnosticCategory.Suggestion;\n\n // Try to map source location within the template literal\n let start = literal.pos;\n let length = literal.end - literal.pos;\n\n if (error.sourceLocation && error.sourceLocation.file === \"inline.sol\") {\n // Find the template content start position\n // The template literal starts after the tag and backtick\n const templateNode = literal.node.template;\n const contentStart = templateNode.getStart(sourceFile) + 1; // +1 for backtick\n start = contentStart + error.sourceLocation.start;\n length = error.sourceLocation.end - error.sourceLocation.start;\n }\n\n solDiagnostics.push({\n file: sourceFile,\n start,\n length,\n messageText: error.message,\n category,\n code: 90000,\n });\n }\n }\n\n return [...prior, ...solDiagnostics];\n };\n}\n","import type tslib from \"typescript/lib/tsserverlibrary\";\n\nimport { findSolTemplateLiterals, getCallSiteAtPosition } from \"./analysis.js\";\nimport { formatReturnType, solidityTypeToTs } from \"./completions.js\";\nimport {\n compileCached,\n extractAllAbis,\n findFunctionAbi,\n type SolcAbiParam,\n type SolcStandardOutput,\n} from \"./solc-cache.js\";\n\nfunction formatParamTs(param: SolcAbiParam): string {\n return `${param.name || \"_\"}: ${solidityTypeToTs(param)}`;\n}\n\nexport function createGetQuickInfoAtPosition(\n ts: typeof tslib,\n info: tslib.server.PluginCreateInfo,\n): tslib.LanguageService[\"getQuickInfoAtPosition\"] {\n return (fileName, position) => {\n const prior = info.languageService.getQuickInfoAtPosition(fileName, position);\n\n const program = info.languageService.getProgram();\n if (!program) return prior;\n\n const sourceFile = program.getSourceFile(fileName);\n if (!sourceFile) return prior;\n\n // Check if hovering over a function name in .call()\n const callSite = getCallSiteAtPosition(ts, sourceFile, position);\n if (callSite?.functionName && callSite.functionNameNode) {\n const fnStart = callSite.functionNameNode.getStart(sourceFile);\n const fnEnd = callSite.functionNameNode.getEnd();\n\n if (position >= fnStart && position <= fnEnd) {\n let output: SolcStandardOutput;\n try {\n output = compileCached(callSite.soliditySource);\n } catch {\n return prior;\n }\n\n const fnAbi = findFunctionAbi(output, callSite.functionName);\n if (fnAbi) {\n const params = (fnAbi.inputs ?? []).map(formatParamTs).join(\", \");\n const returns = formatReturnType(fnAbi.outputs ?? []);\n const solParams = (fnAbi.inputs ?? []).map((p) => `${p.type}${p.name ? ` ${p.name}` : \"\"}`).join(\", \");\n const solReturns = (fnAbi.outputs ?? []).map((p) => p.type).join(\", \");\n\n const displayParts: tslib.SymbolDisplayPart[] = [\n { text: `function ${callSite.functionName}`, kind: \"text\" },\n { text: `(${params})`, kind: \"text\" },\n { text: `: Promise<${returns}>`, kind: \"text\" },\n ];\n\n const documentation: tslib.SymbolDisplayPart[] = [\n {\n text: `Solidity: ${fnAbi.name}(${solParams}) returns (${solReturns})`,\n kind: \"text\",\n },\n {\n text: `\\nMutability: ${fnAbi.stateMutability ?? \"nonpayable\"}`,\n kind: \"text\",\n },\n ];\n\n return {\n kind: ts.ScriptElementKind.memberFunctionElement,\n kindModifiers: \"\",\n textSpan: {\n start: fnStart,\n length: fnEnd - fnStart,\n },\n displayParts,\n documentation,\n };\n }\n }\n }\n\n // Check if hovering over the `sol` tag itself\n const solLiterals = findSolTemplateLiterals(ts, sourceFile);\n for (const literal of solLiterals) {\n const tag = literal.node.tag;\n const tagStart = tag.getStart(sourceFile);\n const tagEnd = tag.getEnd();\n\n if (position >= tagStart && position <= tagEnd) {\n if (literal.source === undefined) return prior;\n\n let output: SolcStandardOutput;\n try {\n output = compileCached(literal.source);\n } catch {\n return prior;\n }\n\n const contractNames = output.contracts ? Object.values(output.contracts).flatMap((f) => Object.keys(f)) : [];\n const abis = extractAllAbis(output);\n const fnCount = abis.filter((a) => a.type === \"function\").length;\n\n const displayParts: tslib.SymbolDisplayPart[] = [\n { text: \"sol\", kind: \"text\" },\n {\n text: ` — ${contractNames.length} contract(s), ${fnCount} function(s)`,\n kind: \"text\",\n },\n ];\n\n const documentation: tslib.SymbolDisplayPart[] = [];\n if (contractNames.length > 0) {\n documentation.push({\n text: `Contracts: ${contractNames.join(\", \")}`,\n kind: \"text\",\n });\n }\n\n return {\n kind: ts.ScriptElementKind.constElement,\n kindModifiers: \"\",\n textSpan: { start: tagStart, length: tagEnd - tagStart },\n displayParts,\n documentation,\n };\n }\n }\n\n return prior;\n };\n}\n","import type tslib from \"typescript/lib/tsserverlibrary\";\n\nimport { createGetCompletionsAtPosition } from \"./completions.js\";\nimport { createGetSemanticDiagnostics } from \"./diagnostics.js\";\nimport { createGetQuickInfoAtPosition } from \"./quickinfo.js\";\n\nfunction init(modules: { typescript: typeof tslib }) {\n const ts = modules.typescript;\n\n function create(info: tslib.server.PluginCreateInfo) {\n info.project.projectService.logger.info(\"soltag plugin loaded\");\n\n // Create proxy that delegates to the original language service\n const proxy = Object.create(null) as tslib.LanguageService;\n for (const k of Object.keys(info.languageService) as (keyof tslib.LanguageService)[]) {\n const x = info.languageService[k]!;\n // biome-ignore lint/complexity/noBannedTypes: dynamic proxy for the LS API\n proxy[k] = (...args: unknown[]) => (x as Function).apply(info.languageService, args);\n }\n\n proxy.getCompletionsAtPosition = createGetCompletionsAtPosition(ts, info);\n proxy.getSemanticDiagnostics = createGetSemanticDiagnostics(ts, info);\n proxy.getQuickInfoAtPosition = createGetQuickInfoAtPosition(ts, info);\n\n return proxy;\n }\n\n return { create };\n}\n\n// @ts-expect-error TS1203: export = is required for tsserver plugins (CJS), but our tsconfig targets ESM. tsup handles the actual build.\nexport = init;\n"],"mappings":";;;AAgBO,SAAS,wBAAwB,IAAkB,YAAgD;AACxG,QAAM,UAA4B,CAAC;AAEnC,WAAS,MAAM,MAAkB;AAC/B,QAAI,GAAG,2BAA2B,IAAI,KAAK,GAAG,aAAa,KAAK,GAAG,KAAK,KAAK,IAAI,SAAS,OAAO;AAC/F,cAAQ,KAAK;AAAA,QACX,QAAQ,oBAAoB,IAAI,KAAK,QAAQ;AAAA,QAC7C,KAAK,KAAK;AAAA,QACV,KAAK,KAAK;AAAA,QACV;AAAA,MACF,CAAC;AAAA,IACH;AAEA,OAAG,aAAa,MAAM,KAAK;AAAA,EAC7B;AAEA,QAAM,UAAU;AAChB,SAAO;AACT;AAsBO,SAAS,sBACd,IACA,YACA,UAC0B;AAC1B,QAAM,OAAO,mBAAmB,IAAI,YAAY,QAAQ;AACxD,MAAI,CAAC,KAAM,QAAO;AAGlB,QAAM,WAAW,aAAa,MAAM,GAAG,gBAAgB;AACvD,MAAI,CAAC,SAAU,QAAO;AAGtB,QAAM,OAAO,SAAS;AACtB,MAAI,CAAC,GAAG,2BAA2B,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B,EAAe,MAAM,KAAK,iBAAiB,IAAI;AAAA,IACrF;AAEA,UAAM,2BAA2B,+BAA+B,IAAI,IAAI;AACxE,UAAM,yBAAyB,6BAA6B,IAAI,IAAI;AACpE,UAAM,yBAAyB,6BAA6B,IAAI,IAAI;AAEpE,WAAO;AAAA,EACT;AAEA,SAAO,EAAE,OAAO;AAClB;AAGA,iBAAS;","names":[]}
|
package/dist/rollup.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as rollup from 'rollup';
|
|
2
|
+
import { SoltagPluginOptions } from './unplugin.js';
|
|
3
|
+
import 'unplugin';
|
|
4
|
+
import 'magic-string';
|
|
5
|
+
|
|
6
|
+
declare const _default: (options?: SoltagPluginOptions | undefined) => rollup.Plugin<any> | rollup.Plugin<any>[];
|
|
7
|
+
|
|
8
|
+
export { _default as default };
|
package/dist/rollup.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/build/rollup.ts"],"sourcesContent":["import { unplugin } from \"./unplugin.js\";\nexport default unplugin.rollup;\n"],"mappings":";;;;;AACA,IAAO,iBAAQ,SAAS;","names":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as unplugin$1 from 'unplugin';
|
|
2
|
+
import MagicString from 'magic-string';
|
|
3
|
+
|
|
4
|
+
interface SoltagPluginOptions {
|
|
5
|
+
/** Extra file extensions to include. Defaults to ['.ts', '.tsx', '.mts', '.cts'] */
|
|
6
|
+
include?: string[];
|
|
7
|
+
/** Patterns to exclude. Defaults to [/node_modules/] */
|
|
8
|
+
exclude?: RegExp[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Core transform logic, exported for testing.
|
|
12
|
+
*/
|
|
13
|
+
declare function transformSolTemplates(code: string, id: string): {
|
|
14
|
+
code: string;
|
|
15
|
+
map: ReturnType<MagicString["generateMap"]>;
|
|
16
|
+
} | undefined;
|
|
17
|
+
declare const unplugin: unplugin$1.UnpluginInstance<SoltagPluginOptions | undefined, boolean>;
|
|
18
|
+
|
|
19
|
+
export { type SoltagPluginOptions, unplugin as default, transformSolTemplates, unplugin };
|
package/dist/unplugin.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/vite.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as unplugin from 'unplugin';
|
|
2
|
+
import { SoltagPluginOptions } from './unplugin.js';
|
|
3
|
+
import 'magic-string';
|
|
4
|
+
|
|
5
|
+
declare const _default: (options?: SoltagPluginOptions | undefined) => unplugin.VitePlugin<any> | unplugin.VitePlugin<any>[];
|
|
6
|
+
|
|
7
|
+
export { _default as default };
|
package/dist/vite.js
ADDED
package/dist/vite.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/build/vite.ts"],"sourcesContent":["import { unplugin } from \"./unplugin.js\";\nexport default unplugin.vite;\n"],"mappings":";;;;;AACA,IAAO,eAAQ,SAAS;","names":[]}
|
package/dist/webpack.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/build/webpack.ts"],"sourcesContent":["import { unplugin } from \"./unplugin.js\";\nexport default unplugin.webpack;\n"],"mappings":";;;;;AACA,IAAO,kBAAQ,SAAS;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "soltag",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Inline Solidity tagged template for TypeScript with IDE type inference",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"solidity",
|
|
8
|
+
"inline",
|
|
9
|
+
"plugin"
|
|
10
|
+
],
|
|
11
|
+
"author": "Hayden Shively",
|
|
12
|
+
"repository": "https://github.com/haydenshively/soltag.git",
|
|
13
|
+
"homepage": "https://github.com/haydenshively/soltag",
|
|
14
|
+
"type": "module",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./plugin": {
|
|
21
|
+
"require": "./dist/plugin.cjs"
|
|
22
|
+
},
|
|
23
|
+
"./unplugin": {
|
|
24
|
+
"types": "./dist/unplugin.d.ts",
|
|
25
|
+
"import": "./dist/unplugin.js"
|
|
26
|
+
},
|
|
27
|
+
"./vite": {
|
|
28
|
+
"types": "./dist/vite.d.ts",
|
|
29
|
+
"import": "./dist/vite.js"
|
|
30
|
+
},
|
|
31
|
+
"./rollup": {
|
|
32
|
+
"types": "./dist/rollup.d.ts",
|
|
33
|
+
"import": "./dist/rollup.js"
|
|
34
|
+
},
|
|
35
|
+
"./esbuild": {
|
|
36
|
+
"types": "./dist/esbuild.d.ts",
|
|
37
|
+
"import": "./dist/esbuild.js"
|
|
38
|
+
},
|
|
39
|
+
"./webpack": {
|
|
40
|
+
"types": "./dist/webpack.d.ts",
|
|
41
|
+
"import": "./dist/webpack.js"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"main": "./dist/index.js",
|
|
45
|
+
"types": "./dist/index.d.ts",
|
|
46
|
+
"files": [
|
|
47
|
+
"dist",
|
|
48
|
+
"plugin.js"
|
|
49
|
+
],
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"magic-string": "^0.30.0",
|
|
52
|
+
"solc": "^0.8.28",
|
|
53
|
+
"typescript": ">=5.0",
|
|
54
|
+
"unplugin": "^2.0.0",
|
|
55
|
+
"viem": ">=2.0"
|
|
56
|
+
},
|
|
57
|
+
"peerDependenciesMeta": {
|
|
58
|
+
"magic-string": {
|
|
59
|
+
"optional": true
|
|
60
|
+
},
|
|
61
|
+
"solc": {
|
|
62
|
+
"optional": true
|
|
63
|
+
},
|
|
64
|
+
"typescript": {
|
|
65
|
+
"optional": true
|
|
66
|
+
},
|
|
67
|
+
"unplugin": {
|
|
68
|
+
"optional": true
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"devDependencies": {
|
|
72
|
+
"@biomejs/biome": "^2.3.14",
|
|
73
|
+
"@types/node": "^25.2.2",
|
|
74
|
+
"magic-string": "^0.30.0",
|
|
75
|
+
"solc": "^0.8.28",
|
|
76
|
+
"tsup": "^8.0.0",
|
|
77
|
+
"typescript": "^5.7.0",
|
|
78
|
+
"unplugin": "^2.0.0",
|
|
79
|
+
"viem": "^2.0.0",
|
|
80
|
+
"vitest": "^3.0.0"
|
|
81
|
+
},
|
|
82
|
+
"scripts": {
|
|
83
|
+
"format": "pnpm exec biome format --write",
|
|
84
|
+
"lint": "pnpm exec biome lint --write src",
|
|
85
|
+
"build": "tsup",
|
|
86
|
+
"typecheck": "tsc --noEmit",
|
|
87
|
+
"test": "vitest run"
|
|
88
|
+
}
|
|
89
|
+
}
|
package/plugin.js
ADDED