@secondlayer/cli 1.10.0 → 1.10.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/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { AbiContract as AbiContract2 } from "@secondlayer/stacks/clarity";
1
2
  import { AbiContract } from "@secondlayer/stacks/clarity";
2
3
  /** Supported Stacks network identifiers for contract resolution. */
3
4
  type NetworkName = "mainnet" | "testnet" | "devnet";
@@ -55,8 +56,6 @@ interface ResolvedContract {
55
56
  abi: AbiContract;
56
57
  source: "api" | "local";
57
58
  }
58
- type ConfigDefiner = (config: SecondLayerConfig) => SecondLayerConfig;
59
- import { AbiContract as AbiContract2 } from "@secondlayer/stacks/clarity";
60
59
  /**
61
60
  * Core plugin interface that all plugins must implement
62
61
  */
@@ -216,23 +215,6 @@ interface HookResult<T = any> {
216
215
  plugin: string;
217
216
  }
218
217
  /**
219
- * Type-safe helper for creating a `secondlayer.config.ts` configuration.
220
- * Accepts either a config object or a factory function that receives a base config and returns a modified one.
221
- *
222
- * @example
223
- * ```ts
224
- * import { defineConfig } from "@secondlayer/cli";
225
- *
226
- * defineConfig({
227
- * contracts: [{ address: "SP000000000000000000002Q6VF78.bns" }],
228
- * out: "./src/generated.ts",
229
- * });
230
- * ```
231
- */
232
- declare function defineConfig(config: SecondLayerConfig): SecondLayerConfig;
233
- declare function defineConfig(definer: ConfigDefiner): ConfigDefiner;
234
- import { AbiContract as AbiContract3, AbiFunction, AbiType } from "@secondlayer/stacks/clarity";
235
- /**
236
218
  * Core plugin manager that orchestrates plugin execution
237
219
  */
238
220
  declare class PluginManager {
@@ -298,4 +280,85 @@ declare class PluginManager {
298
280
  */
299
281
  private createUtils;
300
282
  }
301
- export { defineConfig, UserConfig, SecondLayerPlugin, SecondLayerConfig, ResolvedConfig, ProcessedContract, PluginUtils, PluginOptions, PluginManager, PluginFactory, PluginContext, OutputType, NetworkName, Logger, GeneratedOutput, GenerateContext, ContractSource, ContractConfig, AbiType, AbiFunction, AbiContract3 as AbiContract };
283
+ interface ClarinetPluginOptions {
284
+ /** Path to Clarinet.toml file */
285
+ path?: string;
286
+ /** Include only specific contracts */
287
+ include?: string[];
288
+ /** Exclude specific contracts */
289
+ exclude?: string[];
290
+ /** Enable debug output */
291
+ debug?: boolean;
292
+ }
293
+ /**
294
+ * Clarinet plugin factory
295
+ */
296
+ declare const clarinet: PluginFactory<ClarinetPluginOptions>;
297
+ /**
298
+ * Utility function to check if a Clarinet project exists
299
+ */
300
+ declare function hasClarinetProject(path?: string): Promise<boolean>;
301
+ interface ActionsPluginOptions {
302
+ /** Include only specific contracts */
303
+ include?: string[];
304
+ /** Exclude specific contracts */
305
+ exclude?: string[];
306
+ /** Include only specific functions */
307
+ includeFunctions?: string[];
308
+ /** Exclude specific functions */
309
+ excludeFunctions?: string[];
310
+ /** Enable debug output */
311
+ debug?: boolean;
312
+ /** Environment variable name for default sender key (default: "STX_SENDER_KEY") */
313
+ senderKeyEnv?: string;
314
+ }
315
+ /**
316
+ * Actions plugin factory
317
+ */
318
+ declare const actions: PluginFactory<ActionsPluginOptions>;
319
+ /**
320
+ * React plugin configuration options
321
+ */
322
+ interface ReactPluginOptions extends PluginOptions {
323
+ /**
324
+ * Hooks to exclude from generation (both generic and contract-specific)
325
+ * By default, all hooks are generated
326
+ */
327
+ exclude?: string[];
328
+ }
329
+ /**
330
+ * React plugin factory
331
+ */
332
+ declare const react: PluginFactory<ReactPluginOptions>;
333
+ interface TestingPluginOptions {
334
+ /** Include only specific contracts */
335
+ include?: string[];
336
+ /** Exclude specific contracts */
337
+ exclude?: string[];
338
+ /** Output path for generated testing helpers (default: ./src/generated/testing.ts) */
339
+ out?: string;
340
+ /** Include private function helpers (default: false) */
341
+ includePrivate?: boolean;
342
+ /** Enable debug output */
343
+ debug?: boolean;
344
+ }
345
+ declare const testing: PluginFactory<TestingPluginOptions>;
346
+ interface BasePluginOptions {
347
+ /** Include only specific contracts/functions */
348
+ include?: string[];
349
+ /** Exclude specific contracts/functions */
350
+ exclude?: string[];
351
+ /** Enable debug output */
352
+ debug?: boolean;
353
+ }
354
+ /**
355
+ * Utility function to filter contracts/functions based on include/exclude options
356
+ */
357
+ declare function filterByOptions<T extends {
358
+ name: string
359
+ }>(items: T[], options?: BasePluginOptions): T[];
360
+ /**
361
+ * Utility function to create a simple plugin
362
+ */
363
+ declare function createPlugin(name: string, version: string, implementation: Partial<SecondLayerPlugin>): SecondLayerPlugin;
364
+ export { testing, react, hasClarinetProject, filterByOptions, createPlugin, clarinet, actions, TestingPluginOptions, SecondLayerPlugin, ReactPluginOptions, PluginUtils, PluginOptions, PluginManager, PluginFactory, PluginContext, Logger, GenerateContext, ClarinetPluginOptions, BasePluginOptions, ActionsPluginOptions };