You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+63Lines changed: 63 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -374,6 +374,69 @@ parameterSettings: {
374
374
}
375
375
```
376
376
377
+
### defaultConfig and exampleConfigs
378
+
379
+
Every resource should have a `defaultConfig` and `exampleConfigs`. These are surfaced in the Codify Editor to help users get started quickly.
380
+
381
+
**`defaultConfig`** — pre-fills the resource form with sensible starting values:
382
+
- Use Syncthing's/asdf's/AWS's own documented defaults where applicable
383
+
- For required fields with no sensible default (e.g. `deviceId`, `plugin`, `awsAccessKeyId`), use the placeholder string `'<Replace me here!'>`
384
+
- For optional array fields that default to empty (e.g. `plugins`, `aliases`, `paths`), set them to `[]`
385
+
- Omit fields that are purely user-specific (e.g. paths, names, credentials) — don't guess
386
+
- If the resource declares `operatingSystems: [OS.Darwin]` or `operatingSystems: [OS.Linux]` (i.e. only one OS, not both), do NOT add `os` to `defaultConfig` (it's not on the typed config interface). Instead, add `os: ['darwin']` or `os: ['linux']` only to the config entries inside `exampleConfigs`. Skip entirely when the resource supports both OS.
387
+
388
+
**`exampleConfigs`** — up to two named examples (`example1`, `example2`):
389
+
-`example1`: a minimal, focused single-resource example showing the most common use case
390
+
-`example2`: either a more advanced single-resource variant, OR a multi-resource example that shows the full end-to-end setup (e.g. install the tool + configure it)
391
+
- Multi-resource examples (configs array with multiple types) are especially useful when the resource `dependsOn` another — show installing the dependency too
392
+
- Every example needs a `title` (short, noun-phrase) and a `description` (one sentence explaining what it does and why)
393
+
- Use realistic but obviously-placeholder values for sensitive fields (`'<Replace me here!'>`), not real credentials
394
+
- Don't add step-numbering ("Step 1 of 3") in descriptions — it doesn't make sense when viewed from a single resource page
395
+
- If the resource is OS-specific (only Darwin or only Linux), add `os: ['darwin']` or `os: ['linux']` to each config entry in the example so the editor filters it correctly
**When there is a shared multi-resource example** (e.g. the asdf full-install example used across `asdf`, `asdf-plugin`, and `asdf-install`): define it once in a separate `examples.ts` file in the resource folder and spread it into `exampleConfigs` using `...exampleSharedConfigs`. Use a consistent description across all three rather than per-resource step labels.
439
+
377
440
### Dependencies
378
441
379
442
Resources can declare dependencies on other resources:
Copy file name to clipboardExpand all lines: src/resources/javascript/npm/npm-login-schema.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@
8
8
"properties": {
9
9
"authToken": {
10
10
"type": "string",
11
-
"description": "The npm auth token used for authenticating with the registry. If not provided, then web login is assumed"
11
+
"description": "The npm auth token used for authenticating with the registry. If not provided, then web login is assumed. Generate one at https://www.npmjs.com/settings/<username>/tokens by creating a 'Classic Token' (Automation or Read/Write). Tokens look like: npm_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
description: 'Authenticate with the public npm registry using a personal access token stored in ~/.npmrc. Tokens are generated at https://www.npmjs.com/settings/<username>/tokens by creating a Classic Token',
32
+
configs: [{
33
+
type: 'npm-login',
34
+
authToken: '<Replace me here!>',
35
+
registry: 'https://registry.npmjs.org/',
36
+
}]
37
+
}
38
+
39
+
constexampleScopedLogin: ExampleConfig={
40
+
title: 'Scoped private registry login',
41
+
description: 'Authenticate with a private npm registry and bind it to a package scope, so all @myorg/* packages resolve to that registry. Tokens are generated at https://www.npmjs.com/settings/<username>/tokens by creating a Classic Token',
0 commit comments