@unlimitechcloud/devlink 1.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/AGENTS.md +880 -0
- package/LICENSE +21 -0
- package/README.md +335 -0
- package/dist/__tests__/e2e.spec.d.ts +8 -0
- package/dist/__tests__/e2e.spec.d.ts.map +1 -0
- package/dist/__tests__/e2e.spec.js +253 -0
- package/dist/__tests__/e2e.spec.js.map +1 -0
- package/dist/__tests__/integration.spec.d.ts +8 -0
- package/dist/__tests__/integration.spec.d.ts.map +1 -0
- package/dist/__tests__/integration.spec.js +274 -0
- package/dist/__tests__/integration.spec.js.map +1 -0
- package/dist/cli.d.ts +6 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +610 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/consumers.d.ts +37 -0
- package/dist/commands/consumers.d.ts.map +1 -0
- package/dist/commands/consumers.js +107 -0
- package/dist/commands/consumers.js.map +1 -0
- package/dist/commands/docs.d.ts +59 -0
- package/dist/commands/docs.d.ts.map +1 -0
- package/dist/commands/docs.js +262 -0
- package/dist/commands/docs.js.map +1 -0
- package/dist/commands/docs.spec.d.ts +5 -0
- package/dist/commands/docs.spec.d.ts.map +1 -0
- package/dist/commands/docs.spec.js +213 -0
- package/dist/commands/docs.spec.js.map +1 -0
- package/dist/commands/index.d.ts +13 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +13 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/install.d.ts +31 -0
- package/dist/commands/install.d.ts.map +1 -0
- package/dist/commands/install.js +234 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/list.d.ts +22 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +45 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/list.spec.d.ts +5 -0
- package/dist/commands/list.spec.d.ts.map +1 -0
- package/dist/commands/list.spec.js +95 -0
- package/dist/commands/list.spec.js.map +1 -0
- package/dist/commands/prune.d.ts +27 -0
- package/dist/commands/prune.d.ts.map +1 -0
- package/dist/commands/prune.js +74 -0
- package/dist/commands/prune.js.map +1 -0
- package/dist/commands/publish.d.ts +16 -0
- package/dist/commands/publish.d.ts.map +1 -0
- package/dist/commands/publish.js +225 -0
- package/dist/commands/publish.js.map +1 -0
- package/dist/commands/publish.spec.d.ts +5 -0
- package/dist/commands/publish.spec.d.ts.map +1 -0
- package/dist/commands/publish.spec.js +98 -0
- package/dist/commands/publish.spec.js.map +1 -0
- package/dist/commands/push.d.ts +16 -0
- package/dist/commands/push.d.ts.map +1 -0
- package/dist/commands/push.js +164 -0
- package/dist/commands/push.js.map +1 -0
- package/dist/commands/remove.d.ts +24 -0
- package/dist/commands/remove.d.ts.map +1 -0
- package/dist/commands/remove.js +80 -0
- package/dist/commands/remove.js.map +1 -0
- package/dist/commands/remove.spec.d.ts +5 -0
- package/dist/commands/remove.spec.d.ts.map +1 -0
- package/dist/commands/remove.spec.js +87 -0
- package/dist/commands/remove.spec.js.map +1 -0
- package/dist/commands/resolve.d.ts +20 -0
- package/dist/commands/resolve.d.ts.map +1 -0
- package/dist/commands/resolve.js +52 -0
- package/dist/commands/resolve.js.map +1 -0
- package/dist/commands/resolve.spec.d.ts +5 -0
- package/dist/commands/resolve.spec.d.ts.map +1 -0
- package/dist/commands/resolve.spec.js +87 -0
- package/dist/commands/resolve.spec.js.map +1 -0
- package/dist/commands/verify.d.ts +32 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +127 -0
- package/dist/commands/verify.js.map +1 -0
- package/dist/config.d.ts +22 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +70 -0
- package/dist/config.js.map +1 -0
- package/dist/constants.d.ts +65 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +116 -0
- package/dist/constants.js.map +1 -0
- package/dist/constants.spec.d.ts +5 -0
- package/dist/constants.spec.d.ts.map +1 -0
- package/dist/constants.spec.js +72 -0
- package/dist/constants.spec.js.map +1 -0
- package/dist/core/index.d.ts +9 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +9 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/installations.d.ts +79 -0
- package/dist/core/installations.d.ts.map +1 -0
- package/dist/core/installations.js +207 -0
- package/dist/core/installations.js.map +1 -0
- package/dist/core/installations.spec.d.ts +5 -0
- package/dist/core/installations.spec.d.ts.map +1 -0
- package/dist/core/installations.spec.js +261 -0
- package/dist/core/installations.spec.js.map +1 -0
- package/dist/core/lock.d.ts +37 -0
- package/dist/core/lock.d.ts.map +1 -0
- package/dist/core/lock.js +198 -0
- package/dist/core/lock.js.map +1 -0
- package/dist/core/lock.spec.d.ts +5 -0
- package/dist/core/lock.spec.d.ts.map +1 -0
- package/dist/core/lock.spec.js +161 -0
- package/dist/core/lock.spec.js.map +1 -0
- package/dist/core/registry.d.ts +80 -0
- package/dist/core/registry.d.ts.map +1 -0
- package/dist/core/registry.js +231 -0
- package/dist/core/registry.js.map +1 -0
- package/dist/core/registry.spec.d.ts +5 -0
- package/dist/core/registry.spec.d.ts.map +1 -0
- package/dist/core/registry.spec.js +281 -0
- package/dist/core/registry.spec.js.map +1 -0
- package/dist/core/resolver.d.ts +55 -0
- package/dist/core/resolver.d.ts.map +1 -0
- package/dist/core/resolver.js +127 -0
- package/dist/core/resolver.js.map +1 -0
- package/dist/core/resolver.spec.d.ts +5 -0
- package/dist/core/resolver.spec.d.ts.map +1 -0
- package/dist/core/resolver.spec.js +202 -0
- package/dist/core/resolver.spec.js.map +1 -0
- package/dist/core/store.d.ts +65 -0
- package/dist/core/store.d.ts.map +1 -0
- package/dist/core/store.js +245 -0
- package/dist/core/store.js.map +1 -0
- package/dist/core/store.spec.d.ts +5 -0
- package/dist/core/store.spec.d.ts.map +1 -0
- package/dist/core/store.spec.js +195 -0
- package/dist/core/store.spec.js.map +1 -0
- package/dist/formatters/flat.d.ts +41 -0
- package/dist/formatters/flat.d.ts.map +1 -0
- package/dist/formatters/flat.js +131 -0
- package/dist/formatters/flat.js.map +1 -0
- package/dist/formatters/flat.spec.d.ts +5 -0
- package/dist/formatters/flat.spec.d.ts.map +1 -0
- package/dist/formatters/flat.spec.js +130 -0
- package/dist/formatters/flat.spec.js.map +1 -0
- package/dist/formatters/index.d.ts +6 -0
- package/dist/formatters/index.d.ts.map +1 -0
- package/dist/formatters/index.js +6 -0
- package/dist/formatters/index.js.map +1 -0
- package/dist/formatters/tree.d.ts +29 -0
- package/dist/formatters/tree.d.ts.map +1 -0
- package/dist/formatters/tree.js +256 -0
- package/dist/formatters/tree.js.map +1 -0
- package/dist/formatters/tree.spec.d.ts +5 -0
- package/dist/formatters/tree.spec.d.ts.map +1 -0
- package/dist/formatters/tree.spec.js +127 -0
- package/dist/formatters/tree.spec.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/installer.d.ts +13 -0
- package/dist/installer.d.ts.map +1 -0
- package/dist/installer.js +171 -0
- package/dist/installer.js.map +1 -0
- package/dist/store.d.ts +78 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +344 -0
- package/dist/store.js.map +1 -0
- package/dist/types.d.ts +235 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/docs/README.md +68 -0
- package/docs/inspection/consumers.md +178 -0
- package/docs/inspection/list.md +182 -0
- package/docs/inspection/resolve.md +172 -0
- package/docs/installation/configuration.md +238 -0
- package/docs/installation/install.md +184 -0
- package/docs/maintenance/prune.md +159 -0
- package/docs/maintenance/remove.md +174 -0
- package/docs/maintenance/verify.md +174 -0
- package/docs/publishing/publish.md +146 -0
- package/docs/publishing/push.md +146 -0
- package/docs/store/locking.md +118 -0
- package/docs/store/namespaces.md +141 -0
- package/docs/store/structure.md +163 -0
- package/package.json +58 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# Prune Command
|
|
2
|
+
|
|
3
|
+
Removes orphaned packages from the store.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
devlink prune [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
| Option | Description |
|
|
14
|
+
|--------|-------------|
|
|
15
|
+
| `-n, --namespace <name>` | Only prune in specific namespace |
|
|
16
|
+
| `--dry-run` | Show what would be removed without removing |
|
|
17
|
+
| `--repo <path>` | Use custom repo path |
|
|
18
|
+
|
|
19
|
+
## Description
|
|
20
|
+
|
|
21
|
+
The `prune` command removes packages that exist on disk but are not in the registry. These "orphaned" packages can occur when:
|
|
22
|
+
|
|
23
|
+
- A publish operation was interrupted
|
|
24
|
+
- Files were manually added to the store
|
|
25
|
+
- The registry was corrupted or restored from backup
|
|
26
|
+
|
|
27
|
+
## Examples
|
|
28
|
+
|
|
29
|
+
### Prune All Orphans
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
devlink prune
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Output:
|
|
36
|
+
```
|
|
37
|
+
🧹 Pruning orphaned packages...
|
|
38
|
+
|
|
39
|
+
Removed:
|
|
40
|
+
✓ global/@scope/orphan@1.0.0
|
|
41
|
+
✓ feature-v2/@scope/old-pkg@2.0.0
|
|
42
|
+
|
|
43
|
+
Pruned 2 package(s), freed 15.2 MB
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Dry Run
|
|
47
|
+
|
|
48
|
+
Preview what would be removed:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
devlink prune --dry-run
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Output:
|
|
55
|
+
```
|
|
56
|
+
🧹 Pruning orphaned packages (dry run)...
|
|
57
|
+
|
|
58
|
+
Would remove:
|
|
59
|
+
- global/@scope/orphan@1.0.0 (5.1 MB)
|
|
60
|
+
- feature-v2/@scope/old-pkg@2.0.0 (10.1 MB)
|
|
61
|
+
|
|
62
|
+
Would prune 2 package(s), free 15.2 MB
|
|
63
|
+
|
|
64
|
+
Run without --dry-run to actually remove
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Prune Specific Namespace
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
devlink prune -n feature-v2
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Output:
|
|
74
|
+
```
|
|
75
|
+
🧹 Pruning orphaned packages in 'feature-v2'...
|
|
76
|
+
|
|
77
|
+
Removed:
|
|
78
|
+
✓ feature-v2/@scope/old-pkg@2.0.0
|
|
79
|
+
|
|
80
|
+
Pruned 1 package(s), freed 10.1 MB
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### No Orphans Found
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
devlink prune
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Output:
|
|
90
|
+
```
|
|
91
|
+
🧹 Pruning orphaned packages...
|
|
92
|
+
|
|
93
|
+
No orphaned packages found.
|
|
94
|
+
Store is clean ✓
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Difference from Verify --fix
|
|
98
|
+
|
|
99
|
+
| Command | What it does |
|
|
100
|
+
|---------|--------------|
|
|
101
|
+
| `verify --fix` | Fixes both registry orphans AND disk orphans |
|
|
102
|
+
| `prune` | Only removes disk orphans |
|
|
103
|
+
|
|
104
|
+
Use `verify --fix` for comprehensive cleanup, or `prune` when you specifically want to clean disk orphans.
|
|
105
|
+
|
|
106
|
+
## Use Cases
|
|
107
|
+
|
|
108
|
+
### Regular Maintenance
|
|
109
|
+
|
|
110
|
+
Run periodically to keep the store clean:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
devlink prune --dry-run # Check first
|
|
114
|
+
devlink prune # Then clean
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### After Failed Operations
|
|
118
|
+
|
|
119
|
+
If a publish was interrupted:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
devlink prune
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Before Backup
|
|
126
|
+
|
|
127
|
+
Clean up before backing up the store:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
devlink prune
|
|
131
|
+
tar -czf devlink-backup.tar.gz ~/.devlink
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Disk Space Recovery
|
|
135
|
+
|
|
136
|
+
Find and remove orphaned packages to free space:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
devlink prune --dry-run # See how much space would be freed
|
|
140
|
+
devlink prune # Actually free the space
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Safety
|
|
144
|
+
|
|
145
|
+
The `prune` command only removes packages that are NOT in the registry. Packages that are properly registered will never be removed.
|
|
146
|
+
|
|
147
|
+
To be extra safe, always use `--dry-run` first:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
devlink prune --dry-run
|
|
151
|
+
# Review the output
|
|
152
|
+
devlink prune
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## See Also
|
|
156
|
+
|
|
157
|
+
- [Verify Command](verify.md) - Check and fix store integrity
|
|
158
|
+
- [Remove Command](remove.md) - Explicitly remove packages
|
|
159
|
+
- [Store Structure](../store/structure.md) - Understanding the store layout
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# Remove Command
|
|
2
|
+
|
|
3
|
+
Removes packages, versions, or namespaces from the store.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
devlink remove <target> [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Arguments
|
|
12
|
+
|
|
13
|
+
| Argument | Description |
|
|
14
|
+
|----------|-------------|
|
|
15
|
+
| `<target>` | What to remove (see Target Types) |
|
|
16
|
+
|
|
17
|
+
## Options
|
|
18
|
+
|
|
19
|
+
| Option | Description |
|
|
20
|
+
|--------|-------------|
|
|
21
|
+
| `-n, --namespace <name>` | Target namespace (required for packages) |
|
|
22
|
+
| `--repo <path>` | Use custom repo path |
|
|
23
|
+
|
|
24
|
+
## Target Types
|
|
25
|
+
|
|
26
|
+
### Specific Version
|
|
27
|
+
|
|
28
|
+
Remove a single version of a package:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
devlink remove @scope/core@1.0.0 -n global
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Entire Package
|
|
35
|
+
|
|
36
|
+
Remove all versions of a package:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
devlink remove @scope/core -n global
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Namespace
|
|
43
|
+
|
|
44
|
+
Remove an entire namespace and all packages within:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
devlink remove feature-v2
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Examples
|
|
51
|
+
|
|
52
|
+
### Remove Specific Version
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
devlink remove @scope/core@1.0.0 -n global
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Output:
|
|
59
|
+
```
|
|
60
|
+
✓ Removed @scope/core@1.0.0 from namespace 'global'
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Remove All Versions
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
devlink remove @scope/core -n global
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Output:
|
|
70
|
+
```
|
|
71
|
+
✓ Removed package '@scope/core' from namespace 'global'
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Remove Namespace
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
devlink remove feature-v2
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Output:
|
|
81
|
+
```
|
|
82
|
+
✓ Removed namespace 'feature-v2'
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Restrictions
|
|
86
|
+
|
|
87
|
+
### Cannot Remove Global Namespace
|
|
88
|
+
|
|
89
|
+
The `global` namespace is reserved and cannot be deleted:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
devlink remove global
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Output:
|
|
96
|
+
```
|
|
97
|
+
Error: Cannot delete reserved namespace 'global'
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Namespace Required for Packages
|
|
101
|
+
|
|
102
|
+
When removing packages, you must specify the namespace:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# Error: namespace required
|
|
106
|
+
devlink remove @scope/core
|
|
107
|
+
|
|
108
|
+
# Correct
|
|
109
|
+
devlink remove @scope/core -n global
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## What Gets Removed
|
|
113
|
+
|
|
114
|
+
### Version Removal
|
|
115
|
+
|
|
116
|
+
- Package files from disk
|
|
117
|
+
- Version entry from registry
|
|
118
|
+
- If last version, package entry is also removed
|
|
119
|
+
|
|
120
|
+
### Package Removal
|
|
121
|
+
|
|
122
|
+
- All version directories
|
|
123
|
+
- Package directory
|
|
124
|
+
- Package entry from registry
|
|
125
|
+
|
|
126
|
+
### Namespace Removal
|
|
127
|
+
|
|
128
|
+
- All packages in the namespace
|
|
129
|
+
- Namespace directory
|
|
130
|
+
- Namespace entry from registry
|
|
131
|
+
|
|
132
|
+
## Consumer Impact
|
|
133
|
+
|
|
134
|
+
Removing packages does NOT automatically update consumers. Projects that have installed the removed package will:
|
|
135
|
+
|
|
136
|
+
- Keep their existing symlinks (may become broken)
|
|
137
|
+
- Need to reinstall with a different version/namespace
|
|
138
|
+
|
|
139
|
+
To check affected consumers before removing:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
devlink consumers -p @scope/core -n global
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Use Cases
|
|
146
|
+
|
|
147
|
+
### Clean Up Old Versions
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# Keep only latest version
|
|
151
|
+
devlink remove @scope/core@1.0.0 -n global
|
|
152
|
+
devlink remove @scope/core@1.1.0 -n global
|
|
153
|
+
# 2.0.0 remains
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Remove Feature Branch Namespace
|
|
157
|
+
|
|
158
|
+
After merging a feature branch:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
devlink remove feature-auth-v2
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Remove Accidentally Published Package
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
devlink remove @scope/wrong-pkg -n global
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## See Also
|
|
171
|
+
|
|
172
|
+
- [Prune Command](prune.md) - Remove orphaned packages
|
|
173
|
+
- [Verify Command](verify.md) - Check store integrity
|
|
174
|
+
- [Namespaces](../store/namespaces.md) - Understanding namespaces
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# Verify Command
|
|
2
|
+
|
|
3
|
+
Verifies the integrity of the DevLink store.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
devlink verify [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
| Option | Description |
|
|
14
|
+
|--------|-------------|
|
|
15
|
+
| `--fix` | Automatically fix issues found |
|
|
16
|
+
| `--repo <path>` | Use custom repo path |
|
|
17
|
+
|
|
18
|
+
## Description
|
|
19
|
+
|
|
20
|
+
The `verify` command checks for inconsistencies between:
|
|
21
|
+
|
|
22
|
+
- The registry (`registry.json`)
|
|
23
|
+
- The actual files on disk
|
|
24
|
+
|
|
25
|
+
## Checks Performed
|
|
26
|
+
|
|
27
|
+
### Orphans in Registry
|
|
28
|
+
|
|
29
|
+
Entries in the registry that don't have corresponding files on disk.
|
|
30
|
+
|
|
31
|
+
**Cause**: Files were manually deleted or corrupted.
|
|
32
|
+
|
|
33
|
+
**Fix**: Remove the registry entry.
|
|
34
|
+
|
|
35
|
+
### Orphans on Disk
|
|
36
|
+
|
|
37
|
+
Files on disk that don't have corresponding registry entries.
|
|
38
|
+
|
|
39
|
+
**Cause**: Publish was interrupted, or files were manually added.
|
|
40
|
+
|
|
41
|
+
**Fix**: Remove the orphaned files.
|
|
42
|
+
|
|
43
|
+
### Signature Mismatches
|
|
44
|
+
|
|
45
|
+
Package content doesn't match the recorded signature.
|
|
46
|
+
|
|
47
|
+
**Cause**: Files were modified after publishing.
|
|
48
|
+
|
|
49
|
+
**Fix**: Recalculate and update signature.
|
|
50
|
+
|
|
51
|
+
## Examples
|
|
52
|
+
|
|
53
|
+
### Check Store Integrity
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
devlink verify
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Output (healthy store):
|
|
60
|
+
```
|
|
61
|
+
🔍 Verifying store integrity...
|
|
62
|
+
|
|
63
|
+
global/
|
|
64
|
+
✓ @scope/core@1.0.0
|
|
65
|
+
✓ @scope/core@2.0.0
|
|
66
|
+
✓ @scope/utils@1.0.0
|
|
67
|
+
|
|
68
|
+
feature-v2/
|
|
69
|
+
✓ @scope/core@1.0.0
|
|
70
|
+
|
|
71
|
+
─────────────────────────────────
|
|
72
|
+
Summary:
|
|
73
|
+
✓ Valid: 4
|
|
74
|
+
✗ Orphans in registry: 0
|
|
75
|
+
⚠ Orphans on disk: 0
|
|
76
|
+
|
|
77
|
+
Store is healthy ✓
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Store with Issues
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
devlink verify
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Output:
|
|
87
|
+
```
|
|
88
|
+
🔍 Verifying store integrity...
|
|
89
|
+
|
|
90
|
+
global/
|
|
91
|
+
✓ @scope/core@1.0.0
|
|
92
|
+
✗ @scope/data@1.0.0 - In registry, not on disk
|
|
93
|
+
✓ @scope/utils@1.0.0
|
|
94
|
+
⚠ @scope/orphan@1.0.0 - On disk, not in registry
|
|
95
|
+
|
|
96
|
+
─────────────────────────────────
|
|
97
|
+
Summary:
|
|
98
|
+
✓ Valid: 2
|
|
99
|
+
✗ Orphans in registry: 1
|
|
100
|
+
⚠ Orphans on disk: 1
|
|
101
|
+
|
|
102
|
+
Run 'devlink verify --fix' to repair
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Auto-Fix Issues
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
devlink verify --fix
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Output:
|
|
112
|
+
```
|
|
113
|
+
🔍 Verifying and fixing store...
|
|
114
|
+
|
|
115
|
+
Fixing orphans in registry:
|
|
116
|
+
✓ Removed @scope/data@1.0.0 from registry
|
|
117
|
+
|
|
118
|
+
Fixing orphans on disk:
|
|
119
|
+
✓ Removed @scope/orphan@1.0.0 from disk
|
|
120
|
+
|
|
121
|
+
─────────────────────────────────
|
|
122
|
+
Fixed 2 issue(s)
|
|
123
|
+
Store is now healthy ✓
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## When to Use
|
|
127
|
+
|
|
128
|
+
### After System Crash
|
|
129
|
+
|
|
130
|
+
If DevLink or your system crashed during an operation:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
devlink verify --fix
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Periodic Maintenance
|
|
137
|
+
|
|
138
|
+
Run periodically to ensure store health:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
devlink verify
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Before Important Operations
|
|
145
|
+
|
|
146
|
+
Verify before publishing critical packages:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
devlink verify
|
|
150
|
+
devlink publish
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### After Manual File Operations
|
|
154
|
+
|
|
155
|
+
If you manually modified files in the store:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
devlink verify --fix
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Lock Requirement
|
|
162
|
+
|
|
163
|
+
| Mode | Requires Lock |
|
|
164
|
+
|------|---------------|
|
|
165
|
+
| `verify` | No |
|
|
166
|
+
| `verify --fix` | Yes |
|
|
167
|
+
|
|
168
|
+
The `--fix` flag modifies the store, so it requires an exclusive lock.
|
|
169
|
+
|
|
170
|
+
## See Also
|
|
171
|
+
|
|
172
|
+
- [Prune Command](prune.md) - Remove orphaned packages
|
|
173
|
+
- [Store Structure](../store/structure.md) - Understanding the store layout
|
|
174
|
+
- [File Locking](../store/locking.md) - How locking works
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# Publish Command
|
|
2
|
+
|
|
3
|
+
Publishes a package from the current directory to the DevLink store.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
devlink publish [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
| Option | Description |
|
|
14
|
+
|--------|-------------|
|
|
15
|
+
| `-n, --namespace <name>` | Target namespace (default: `global`) |
|
|
16
|
+
| `--repo <path>` | Use custom repo path |
|
|
17
|
+
|
|
18
|
+
## Description
|
|
19
|
+
|
|
20
|
+
The `publish` command:
|
|
21
|
+
|
|
22
|
+
1. Reads `package.json` from the current directory
|
|
23
|
+
2. Validates that `name` and `version` fields exist
|
|
24
|
+
3. Copies files to the store based on the `files` field
|
|
25
|
+
4. Generates a content signature (MD5 hash)
|
|
26
|
+
5. Updates the registry with package metadata
|
|
27
|
+
|
|
28
|
+
## Package Requirements
|
|
29
|
+
|
|
30
|
+
Your `package.json` must have:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"name": "@scope/my-package",
|
|
35
|
+
"version": "1.0.0",
|
|
36
|
+
"files": ["dist", "lib"]
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
- **name**: Package name (scoped or unscoped)
|
|
41
|
+
- **version**: Semantic version
|
|
42
|
+
- **files**: Array of files/directories to include
|
|
43
|
+
|
|
44
|
+
## Examples
|
|
45
|
+
|
|
46
|
+
### Publish to Global
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
cd my-package
|
|
50
|
+
devlink publish
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Output:
|
|
54
|
+
```
|
|
55
|
+
📦 @scope/my-package@1.0.0 published to global
|
|
56
|
+
Signature: 6761ca1fefdde1b6e9ea372e7d6931e4
|
|
57
|
+
Files: 15
|
|
58
|
+
Path: ~/.devlink/namespaces/global/@scope/my-package/1.0.0
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Publish to Custom Namespace
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
devlink publish -n feature-v2
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Publish to Custom Repo
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
devlink publish --repo /path/to/repo
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Publish Multiple Versions
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Publish v1
|
|
77
|
+
devlink publish
|
|
78
|
+
|
|
79
|
+
# Update version in package.json to 2.0.0
|
|
80
|
+
devlink publish # Both versions coexist
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## What Gets Published
|
|
84
|
+
|
|
85
|
+
Files are selected based on the `files` field in `package.json`:
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"files": ["dist", "lib", "README.md"]
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Always included:
|
|
94
|
+
- `package.json`
|
|
95
|
+
|
|
96
|
+
The following are typically excluded:
|
|
97
|
+
- `node_modules/`
|
|
98
|
+
- `.git/`
|
|
99
|
+
- Test files
|
|
100
|
+
- Source files (unless specified)
|
|
101
|
+
|
|
102
|
+
## Signature
|
|
103
|
+
|
|
104
|
+
Each published version gets a signature file (`devlink.sig`) containing an MD5 hash of the package contents. This is used for:
|
|
105
|
+
|
|
106
|
+
- Integrity verification
|
|
107
|
+
- Change detection
|
|
108
|
+
- Consumer updates (push command)
|
|
109
|
+
|
|
110
|
+
## Overwriting Versions
|
|
111
|
+
|
|
112
|
+
Publishing the same version again overwrites the existing content:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# First publish
|
|
116
|
+
devlink publish # @scope/pkg@1.0.0
|
|
117
|
+
|
|
118
|
+
# Make changes, publish again
|
|
119
|
+
devlink publish # Overwrites @scope/pkg@1.0.0
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
The signature will change if the content changed.
|
|
123
|
+
|
|
124
|
+
## Errors
|
|
125
|
+
|
|
126
|
+
### Missing package.json
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
Error: package.json not found
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Ensure you're in a directory with a valid `package.json`.
|
|
133
|
+
|
|
134
|
+
### Missing name or version
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
Error: package.json must have name and version fields
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Add the required fields to your `package.json`.
|
|
141
|
+
|
|
142
|
+
## See Also
|
|
143
|
+
|
|
144
|
+
- [Push Command](push.md) - Publish and update consumers
|
|
145
|
+
- [Store Structure](../store/structure.md) - Where packages are stored
|
|
146
|
+
- [Namespaces](../store/namespaces.md) - Understanding namespaces
|