1- import { CreatePlan , FileUtils , Resource , ResourceSettings , SpawnStatus , getPty , z } from '@codifycli/plugin-core' ;
1+ import { CreatePlan , ExampleConfig , FileUtils , Resource , ResourceSettings , SpawnStatus , getPty , z } from '@codifycli/plugin-core' ;
22import { OS } from '@codifycli/schemas' ;
33import fs from 'node:fs/promises' ;
44import os from 'node:os' ;
@@ -19,10 +19,48 @@ const schema = z.object({
1919
2020export type AsdfConfig = z . infer < typeof schema >
2121
22+ const defaultConfig : Partial < AsdfConfig > = {
23+ plugins : [ ] ,
24+ }
25+
26+ const exampleNodePython : ExampleConfig = {
27+ title : 'Node.js and Python via asdf' ,
28+ description : 'Install asdf with plugins for Node.js and Python - a common setup for web and scripting work.' ,
29+ configs : [ {
30+ type : 'asdf' ,
31+ plugins : [ 'nodejs' , 'python' ] ,
32+ } ]
33+ }
34+
35+ const exampleFullInstall : ExampleConfig = {
36+ title : 'Full asdf setup — install, plugin, and version' ,
37+ description : 'Install asdf, add the Node.js plugin, and activate a specific version - a complete setup from scratch.' ,
38+ configs : [
39+ {
40+ type : 'asdf' ,
41+ plugins : [ 'nodejs' ] ,
42+ } ,
43+ {
44+ type : 'asdf-plugin' ,
45+ plugin : 'nodejs' ,
46+ } ,
47+ {
48+ type : 'asdf-install' ,
49+ plugin : 'nodejs' ,
50+ versions : [ '22.0.0' ] ,
51+ } ,
52+ ]
53+ }
54+
2255export class AsdfResource extends Resource < AsdfConfig > {
2356 getSettings ( ) : ResourceSettings < AsdfConfig > {
2457 return {
2558 id : 'asdf' ,
59+ defaultConfig,
60+ exampleConfigs : {
61+ example1 : exampleNodePython ,
62+ example2 : exampleFullInstall ,
63+ } ,
2664 operatingSystems : [ OS . Darwin , OS . Linux ] ,
2765 schema,
2866 parameterSettings : {
0 commit comments