zyrk 0.0.0-stage → 0.3.5

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.
Files changed (53) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +241 -2
  3. package/VERSION +1 -0
  4. package/bin/zyrk.js +9 -0
  5. package/package.json +64 -4
  6. package/src/cli/main.ts +468 -0
  7. package/src/cli/npm-delegate.ts +97 -0
  8. package/src/cli/parse.ts +106 -0
  9. package/src/commands/dependencies.ts +154 -0
  10. package/src/commands/deploy.ts +777 -0
  11. package/src/commands/maintenance.ts +260 -0
  12. package/src/commands/patch.ts +408 -0
  13. package/src/commands/project.ts +598 -0
  14. package/src/commands/store.ts +689 -0
  15. package/src/config/paths.ts +119 -0
  16. package/src/dlx/create.ts +69 -0
  17. package/src/dlx/run.ts +389 -0
  18. package/src/errors.ts +142 -0
  19. package/src/extract/tarball.ts +868 -0
  20. package/src/fetch/all.ts +206 -0
  21. package/src/fetch/package.ts +181 -0
  22. package/src/fetch/registry.ts +615 -0
  23. package/src/install/import-npm.ts +177 -0
  24. package/src/install/lock.ts +176 -0
  25. package/src/install/metadata.ts +122 -0
  26. package/src/install/registry.ts +88 -0
  27. package/src/install/run.ts +760 -0
  28. package/src/lockfile/fingerprints.ts +74 -0
  29. package/src/lockfile/read.ts +198 -0
  30. package/src/lockfile/types.ts +75 -0
  31. package/src/lockfile/write.ts +257 -0
  32. package/src/log.ts +100 -0
  33. package/src/project/projection.ts +390 -0
  34. package/src/resolve/resolver.ts +757 -0
  35. package/src/resolve/spec.ts +131 -0
  36. package/src/store/db.ts +388 -0
  37. package/src/store/graph.ts +175 -0
  38. package/src/store/layout.ts +431 -0
  39. package/src/store/manifests.ts +347 -0
  40. package/src/store/objects.ts +229 -0
  41. package/src/store/realize.ts +322 -0
  42. package/src/store/source.ts +249 -0
  43. package/src/store/txn.ts +118 -0
  44. package/src/store/verify.ts +433 -0
  45. package/src/types/vendor.d.ts +120 -0
  46. package/src/util/fsx.ts +289 -0
  47. package/src/util/hash.ts +117 -0
  48. package/src/util/ids.ts +42 -0
  49. package/src/util/integrity.ts +269 -0
  50. package/src/util/json.ts +89 -0
  51. package/src/util/locks.ts +266 -0
  52. package/src/util/proc.ts +108 -0
  53. package/src/version.ts +34 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 King Jethro (kingjethro999)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,242 @@
1
- # Temporary Holding Version
1
+ # zyrk
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![CI](https://github.com/kingjethro999/zyrk/actions/workflows/ci.yml/badge.svg)](https://github.com/kingjethro999/zyrk/actions/workflows/ci.yml)
4
+ [![Node.js](https://img.shields.io/badge/Node.js-24%2B-339933?logo=node.js&logoColor=white)](https://nodejs.org/)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
+
7
+ An npm-compatible package manager built around **one verified package store per
8
+ OS user**, with dependency-aware package instances linked into projects.
9
+
10
+ **Pre-release and under active construction.** `zyrk install` installs project
11
+ dependencies through verified shared storage; `dlx` and `create` run one-off
12
+ tools. Check `zyrk --help` and the limitations below before adopting it.
13
+
14
+ ## Why zyrk exists
15
+
16
+ A developer often works on several Node.js projects with overlapping
17
+ dependencies. zyrk's intended default is to verify package sources once, keep
18
+ them in a per-user store, and assemble each project's dependency graph through
19
+ links. Different versions and peer dependency contexts remain separate.
20
+
21
+ Application code keeps using ordinary imports. There is no custom Node.js
22
+ loader, privileged daemon, or manual mount setup in the intended development
23
+ model.
24
+
25
+ Sharing files is an established approach: pnpm also uses hard links. zyrk makes
26
+ the shared store, exact dependency context, mutation rules, and cleanup contract
27
+ central to its design. Storage savings, speed, and framework compatibility will
28
+ be reported only after reproducible measurements and compatibility tests.
29
+
30
+ ## Try the current CLI
31
+
32
+ Install from npm:
33
+
34
+ ```bash
35
+ npm install -g zyrk
36
+ zyrk --help
37
+ zyrk --version
38
+ ```
39
+
40
+ Requires **Node.js 24 or newer**. The source runs directly with Node's native
41
+ TypeScript support; no compilation step or native toolchain is required to
42
+ install zyrk itself.
43
+
44
+ From a checkout:
45
+
46
+ ```bash
47
+ git clone https://github.com/kingjethro999/zyrk.git zyrk
48
+ cd zyrk
49
+ npm ci
50
+ node bin/zyrk.js --help
51
+ node bin/zyrk.js --version
52
+ ```
53
+
54
+ ### One-line install (shell)
55
+
56
+ Linux / macOS:
57
+
58
+ ```bash
59
+ curl -fsSL https://raw.githubusercontent.com/kingjethro999/zyrk/main/install.sh | sh
60
+ ```
61
+
62
+ Windows (PowerShell):
63
+
64
+ ```powershell
65
+ irm https://raw.githubusercontent.com/kingjethro999/zyrk/main/install.ps1 | iex
66
+ ```
67
+
68
+ ### Install project dependencies
69
+
70
+ ```bash
71
+ zyrk install # dependencies + devDependencies
72
+ zyrk install react # add and save a registry package
73
+ zyrk install -D typescript # save a development dependency
74
+ zyrk i --frozen-lockfile # require an unchanged compatible lock
75
+ zyrk install --offline --frozen-lockfile
76
+ zyrk install --omit=dev # project production roots only
77
+ zyrk install --lockfile-only # write selections without installing
78
+ ```
79
+
80
+ zyrk resolves exact versions, verifies archive integrity before extraction, and
81
+ creates dependency-aware realizations in the per-user store. Project
82
+ `node_modules` contains links to those realizations. Two projects selecting the
83
+ same dependency context reuse the same files; incompatible versions and peer
84
+ contexts stay separate. Normal CJS and ESM imports continue to work.
85
+
86
+ `package-lock.json` records npm selections plus a `zyrk` extension. Warm installs
87
+ reuse compatible locked selections; frozen installs reject drift. Non-frozen
88
+ installation can adopt supported npm v2/v3 lockfiles without reselecting versions.
89
+ Offline installs use locked verified sources and fail if an input is missing.
90
+ Manifest, lock, and projection changes are journaled for process-crash recovery;
91
+ a failed resolution, verification, or build-policy check keeps the prior graph.
92
+
93
+ Dependency install scripts and implicit native builds are blocked by default.
94
+ `--ignore-scripts` explicitly produces an **intentionally unbuilt** installation.
95
+ Root install hooks are reported and never run automatically. Script approval,
96
+ private native builds, runtime-mutable packages, workspaces, overrides, Git/local
97
+ sources, and authenticated or mixed scoped registries are not supported by this
98
+ install path yet. Unsupported platform constraints and failed optional packages
99
+ currently fail installation instead of being silently omitted. macOS/Windows
100
+ compatibility and framework support remain unverified.
101
+
102
+ Use `--registry=https://your-registry.example/` for a compatible unauthenticated
103
+ registry. The adapter reads the default registry from user/project `.npmrc`, and
104
+ fails closed on scoped registry routing or disabled TLS verification. Tool
105
+ commands (`dlx`/`create`) still use their existing public-registry configuration.
106
+
107
+ ### Run a one-off tool
108
+
109
+ ```bash
110
+ zyrk dlx <package>[@version] [args...]
111
+ zyrk create <initializer>[@version] [args...]
112
+ ```
113
+
114
+ When running from source, replace `zyrk` with `node bin/zyrk.js`.
115
+
116
+ `dlx` resolves the requested package and its dependencies, verifies downloaded
117
+ archives, creates a dependency-aware tool graph, and launches the selected
118
+ JavaScript bin entry with the supplied arguments. Its temporary projection is
119
+ removed afterward; verified sources and shared realizations remain in the
120
+ store.
121
+
122
+ `create` uses the same execution path and maps initializer names to their
123
+ `create-*` packages. For example, `vite` maps to `create-vite`, while a scoped
124
+ initializer stays in its scope. Compatibility depends on the selected tool:
125
+ closures declaring install lifecycle scripts are currently blocked, and native
126
+ or shell executable bins are not supported by the JavaScript-only launcher.
127
+
128
+ These commands run the tool's code with your account's permissions. The tool
129
+ working directory is your current directory. A temporary tool projection is
130
+ not a sandbox.
131
+
132
+ ### Current command coverage
133
+
134
+ | Surface | Current behavior |
135
+ | -------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
136
+ | `install`, `i` | Resolve or reuse the lock, verify sources, and publish shared project dependencies. |
137
+ | `--help`, `--version` | Show the CLI surface and package version. |
138
+ | `dlx`, `create` | Resolve, fetch, verify archives, and run temporary tool environments. |
139
+ | `publish`, `unpublish`, `access`, `deprecate`, `dist-tag`, `owner` | Explicitly delegate to your npm CLI. |
140
+ | `token`, `adduser`, `login`, `logout`, `whoami`, `ping`, `pack` | Explicitly delegate to your npm CLI. |
141
+ | `add`, `remove`, `update`, `run`, `exec` | Report `ZYRK_NOT_IMPLEMENTED`. |
142
+ | `store`, `projects`, `repair`, `import`, `deploy`, `docker` | Report `ZYRK_NOT_IMPLEMENTED`. |
143
+ | `list`, `why`, `doctor`, `approve-builds`, `rebuild`, `audit`, `patch`, `patch-commit` | Report `ZYRK_NOT_IMPLEMENTED`. |
144
+
145
+ Native commands that support `--json` return a versioned result envelope.
146
+ `dlx` and `create` reject that option because the tool owns stdout. Delegated
147
+ commands preserve npm's own output format.
148
+
149
+ ## Storage, isolation, and trust
150
+
151
+ On Linux, the default store is:
152
+
153
+ ```text
154
+ ${XDG_DATA_HOME:-$HOME/.local/share}/zyrk/store/v1
155
+ ```
156
+
157
+ Set `ZYRK_STORE_DIR` deliberately to choose another store location. The store
158
+ must satisfy ownership and permission checks. Linux local filesystems are the
159
+ initial target; platform and framework support remain gated on their own tests.
160
+
161
+ The design separates three things:
162
+
163
+ - **Verified source:** archive integrity is checked before extraction and source
164
+ publication. Extraction rejects unsafe paths and links and normalizes modes.
165
+ - **Dependency context:** a package instance records its selected dependency
166
+ wiring, so incompatible versions and peer contexts are not merged.
167
+ - **Mutable work:** the planned build/runtime mutation model uses private
168
+ project generations. Writable build outputs must not change shared source.
169
+
170
+ Read-only modes help prevent accidental writes; they are not a security boundary
171
+ against code running as the same OS user. Shared stores should be used only by
172
+ mutually trusted processes. Do not share them across unrelated CI trust domains.
173
+
174
+ Native tool commands currently use the public npm registry. Private registry
175
+ configuration and credential support are not implemented; do not use these
176
+ commands for internal tools that depend on private registry routing.
177
+
178
+ ## Global installs and npm delegation
179
+
180
+ zyrk never installs packages globally and never forwards a global-install
181
+ request to npm:
182
+
183
+ ```bash
184
+ zyrk install --global <package>
185
+ # ZYRK_GLOBAL_INSTALL_UNSUPPORTED
186
+ ```
187
+
188
+ Use npm directly when you want a global package. Installing the zyrk executable
189
+ with npm is separate from asking zyrk to install another package globally.
190
+
191
+ Registry write and account operations use your npm installation. zyrk prints a
192
+ disclosure, inherits stdio, and returns the child status. npm uses its own
193
+ registry configuration and authentication:
194
+
195
+ ```bash
196
+ zyrk publish --tag beta
197
+ zyrk pack --ignore-scripts
198
+ ```
199
+
200
+ npm options may come before or after the command: zyrk forwards every
201
+ non-zyrk token verbatim, so protective flags such as `--dry-run` always
202
+ reach npm. A bare value before the command that cannot be the command
203
+ itself fails before npm launches — use the `--flag=value` form or place
204
+ the command first. npm may run package lifecycle scripts according to its
205
+ own options and configuration.
206
+
207
+ ## Develop and contribute
208
+
209
+ ```bash
210
+ npm ci
211
+ npm run setup:hooks
212
+ npm run typecheck
213
+ npm test
214
+ npm run check
215
+ npm run format:check
216
+ npm run format
217
+ ```
218
+
219
+ The commit hook runs the full check gate, increments the version in
220
+ `package.json`, `package-lock.json`, and `VERSION`, and creates a matching version
221
+ tag after the commit. Keep changes focused and never bypass the hooks.
222
+
223
+ CI checks pushed commits and pull requests. The separate
224
+ [npm publishing action](.github/workflows/npm-publish.yml) is triggered when a
225
+ GitHub release is created; ordinary commits do not trigger that action.
226
+
227
+ The contributor guide is [AGENTS.md](AGENTS.md). Bug reports and reproducible
228
+ compatibility cases belong in
229
+ [GitHub issues](https://github.com/kingjethro999/zyrk/issues).
230
+
231
+ ## Naming and local state
232
+
233
+ The project was renamed from snpm to **zyrk**. The shared-store philosophy,
234
+ version isolation, mutation policy, and security requirements remain the same.
235
+ Current CLI/configuration uses `zyrk` / `ZYRK`, and lock metadata uses the `zyrk`
236
+ namespace. Pre-rename stores and lock metadata are not migrated automatically.
237
+ Keep existing data until an explicit migration is supported.
238
+
239
+ ## License
240
+
241
+ [MIT](LICENSE). If you want to support development,
242
+ [sponsor the maintainer](https://github.com/sponsors/kingjethro999).
package/VERSION ADDED
@@ -0,0 +1 @@
1
+ v0.3.5
package/bin/zyrk.js ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import { runCli } from "../src/cli/main.ts";
3
+
4
+ process.exitCode = await runCli({
5
+ argv: process.argv.slice(2),
6
+ env: process.env,
7
+ stdout: process.stdout,
8
+ stderr: process.stderr,
9
+ });
package/package.json CHANGED
@@ -1,6 +1,66 @@
1
1
  {
2
2
  "name": "zyrk",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.3.5",
4
+ "description": "Storage-efficient Node package manager: one verified store per user, shared across projects through links.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "engines": {
8
+ "node": ">=24.0.0"
9
+ },
10
+ "bin": {
11
+ "zyrk": "bin/zyrk.js"
12
+ },
13
+ "scripts": {
14
+ "typecheck": "tsc -p tsconfig.json",
15
+ "test": "vitest run",
16
+ "test:watch": "vitest",
17
+ "check": "node scripts/check.mjs",
18
+ "format:check": "prettier --check .",
19
+ "format": "prettier --write .",
20
+ "version:bump": "node scripts/bump-version.js",
21
+ "setup:hooks": "git config core.hooksPath .githooks"
22
+ },
23
+ "dependencies": {
24
+ "npm-package-arg": "^14.0.0",
25
+ "npm-registry-fetch": "^20.0.1",
26
+ "semver": "^7.8.5",
27
+ "ssri": "^14.0.0",
28
+ "tar": "^7.5.22"
29
+ },
30
+ "devDependencies": {
31
+ "@types/node": "^24.19.2",
32
+ "@types/semver": "^7.8.0",
33
+ "prettier": "3.9.10",
34
+ "typescript": "^7.0.2",
35
+ "vitest": "^5.0.5"
36
+ },
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "git+https://github.com/kingjethro999/zyrk.git"
40
+ },
41
+ "bugs": {
42
+ "url": "https://github.com/kingjethro999/zyrk/issues"
43
+ },
44
+ "homepage": "https://github.com/kingjethro999/zyrk#readme",
45
+ "keywords": [
46
+ "package-manager",
47
+ "npm",
48
+ "nodejs",
49
+ "typescript",
50
+ "dependency-management",
51
+ "shared-store",
52
+ "content-addressable-storage",
53
+ "cli"
54
+ ],
55
+ "files": [
56
+ "bin/",
57
+ "src/",
58
+ "VERSION",
59
+ "LICENSE",
60
+ "README.md"
61
+ ],
62
+ "publishConfig": {
63
+ "access": "public",
64
+ "registry": "https://registry.npmjs.org/"
65
+ }
66
+ }