@hades200082/envsync 0.0.2

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/schema.json ADDED
@@ -0,0 +1,106 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://raw.githubusercontent.com/hades200082/env-sync/master/schema.json",
4
+ "title": "envsync config",
5
+ "description": "Tools to install and keep updated on every machine. Run with `npx -y envsync@latest`.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["tools"],
9
+ "properties": {
10
+ "$schema": {
11
+ "type": "string"
12
+ },
13
+ "shell": {
14
+ "description": "Default shell per OS family. Defaults: bash (or sh) on Linux and macOS, pwsh (or Windows PowerShell) on Windows.",
15
+ "type": "object",
16
+ "additionalProperties": false,
17
+ "properties": {
18
+ "linux": { "$ref": "#/definitions/shellName" },
19
+ "macos": { "$ref": "#/definitions/shellName" },
20
+ "windows": { "$ref": "#/definitions/shellName" }
21
+ }
22
+ },
23
+ "tools": {
24
+ "description": "Tools in the order they run. Put anything a later tool depends on (like gh) first.",
25
+ "type": "array",
26
+ "items": { "$ref": "#/definitions/tool" }
27
+ }
28
+ },
29
+ "definitions": {
30
+ "shellName": {
31
+ "enum": ["bash", "sh", "zsh", "pwsh", "powershell", "cmd"]
32
+ },
33
+ "commandText": {
34
+ "description": "A string runs as-is. An array is one step per line and stops at the first failing step.",
35
+ "oneOf": [
36
+ { "type": "string" },
37
+ { "type": "array", "items": { "type": "string" }, "minItems": 1 }
38
+ ]
39
+ },
40
+ "commandObject": {
41
+ "type": "object",
42
+ "additionalProperties": false,
43
+ "required": ["run"],
44
+ "properties": {
45
+ "run": { "$ref": "#/definitions/commandText" },
46
+ "shell": { "$ref": "#/definitions/shellName" }
47
+ }
48
+ },
49
+ "commandValue": {
50
+ "description": "null means: nothing to do on this platform.",
51
+ "oneOf": [
52
+ { "$ref": "#/definitions/commandText" },
53
+ { "$ref": "#/definitions/commandObject" },
54
+ { "type": "null" }
55
+ ]
56
+ },
57
+ "platformMap": {
58
+ "description": "Keys are platform selectors. The first key that matches this machine wins, most specific first: host (claude-code, codex, codespaces, gitpod, ci, container, wsl), distro id with version (ubuntu-24.04, ubuntu-24), distro id (ubuntu, linuxmint, fedora), ID_LIKE ids (debian), package manager (apt, dnf, yum, pacman, zypper, apk, nix, brew, port, snap, flatpak, winget, choco, scoop), OS family (linux, macos, windows; also macos-15, windows-11), unix (Linux and macOS), default. Run `npx -y envsync@latest --info` to see a machine's selectors.",
59
+ "type": "object",
60
+ "minProperties": 1,
61
+ "not": { "required": ["run"] },
62
+ "propertyNames": { "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$" },
63
+ "additionalProperties": { "$ref": "#/definitions/commandValue" }
64
+ },
65
+ "command": {
66
+ "oneOf": [
67
+ { "$ref": "#/definitions/commandValue" },
68
+ { "$ref": "#/definitions/platformMap" }
69
+ ]
70
+ },
71
+ "tool": {
72
+ "type": "object",
73
+ "additionalProperties": false,
74
+ "required": ["name"],
75
+ "anyOf": [{ "required": ["install"] }, { "required": ["update"] }],
76
+ "properties": {
77
+ "name": {
78
+ "type": "string",
79
+ "minLength": 1,
80
+ "description": "Unique name. Used in output and for --only / --skip."
81
+ },
82
+ "description": {
83
+ "type": "string"
84
+ },
85
+ "check": {
86
+ "description": "Exit 0 means installed. A bare word with no whitespace (e.g. \"gh\") is looked up on PATH instead of being run. Without a check, install runs and then update runs, every time.",
87
+ "$ref": "#/definitions/command"
88
+ },
89
+ "install": {
90
+ "description": "Runs when the check fails (or always, when there is no check). The environment is re-read afterwards so new tools are on PATH for later steps.",
91
+ "$ref": "#/definitions/command"
92
+ },
93
+ "update": {
94
+ "description": "Runs when the check passes (or after install, when there is no check). Skipped with --install-only.",
95
+ "$ref": "#/definitions/command"
96
+ },
97
+ "platforms": {
98
+ "description": "Only run this tool on machines matching at least one of these selectors.",
99
+ "type": "array",
100
+ "items": { "type": "string" },
101
+ "minItems": 1
102
+ }
103
+ }
104
+ }
105
+ }
106
+ }