amae-cli 0.1.2 → 0.2.0
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/README.md +130 -0
- package/package.json +5 -5
package/README.md
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# amae
|
|
2
|
+
|
|
3
|
+
> A fast JavaScript package manager written in Rust.
|
|
4
|
+
|
|
5
|
+
amae resolves, downloads, and links your dependencies the same way npm does — but stores every file exactly once on disk and uses hard links to wire packages into `node_modules`. No duplicates, no copies, just pointers.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Why
|
|
10
|
+
|
|
11
|
+
npm copies files. amae doesn't.
|
|
12
|
+
|
|
13
|
+
Every package you install goes into a global content-addressable store at `~/.amae/store`. When the same file is needed in ten different projects, it lives on disk once and is hard-linked into each `node_modules`. Installs after the first are near-instant because there's nothing to download or unpack — only links to create.
|
|
14
|
+
|
|
15
|
+
The resolved dependency graph is serialized into a binary lockfile (`amae-lock.bin`) using [bincode](https://github.com/bincode-org/bincode). Reading it back is orders of magnitude faster than parsing JSON.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
npm install -g amae-cli
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Or with npx (no install needed):
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
npx amae-cli install
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Prebuilt native binaries ship for:
|
|
32
|
+
- macOS arm64 (Apple Silicon)
|
|
33
|
+
- macOS x64 (Intel)
|
|
34
|
+
- Linux x64
|
|
35
|
+
- Windows x64
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
amae install # Install all dependencies from package.json
|
|
43
|
+
amae add axios # Add a package and install
|
|
44
|
+
amae add -D vitest # Add a dev dependency
|
|
45
|
+
amae remove axios # Remove a package and reinstall
|
|
46
|
+
amae run build # Run a script from package.json
|
|
47
|
+
amae test # Run the "test" script
|
|
48
|
+
amae start # Run the "start" script
|
|
49
|
+
amae list # List installed packages with resolved versions
|
|
50
|
+
amae clean # Delete node_modules and lockfile
|
|
51
|
+
amae prune # Clear the global ~/.amae/store cache
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Workspaces
|
|
57
|
+
|
|
58
|
+
amae understands monorepos. It reads `"workspaces"` from the root `package.json` or `pnpm-workspace.yaml` and resolves local packages directly without touching the registry.
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
my-monorepo/
|
|
62
|
+
├── package.json # { "workspaces": ["packages/*"] }
|
|
63
|
+
├── packages/
|
|
64
|
+
│ ├── math-utils/
|
|
65
|
+
│ │ └── package.json # { "name": "math-utils", "version": "1.0.0" }
|
|
66
|
+
│ └── calc-app/
|
|
67
|
+
│ └── package.json # { "dependencies": { "math-utils": "workspace:*" } }
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
amae install
|
|
72
|
+
# math-utils symlinked directly to packages/math-utils — no registry request
|
|
73
|
+
# external packages downloaded once, hard-linked everywhere
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## How it works
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
amae install
|
|
82
|
+
│
|
|
83
|
+
├─ 1. Read package.json (and all workspace packages if monorepo)
|
|
84
|
+
│
|
|
85
|
+
├─ 2. Resolve — async semver resolution against npm registry
|
|
86
|
+
│ Workspace packages are resolved locally, skipping the network
|
|
87
|
+
│
|
|
88
|
+
├─ 3. Download — parallel .tgz fetching with SHA integrity check
|
|
89
|
+
│ Each package extracted once into ~/.amae/store/<name>@<version>/
|
|
90
|
+
│ Store is set read-only after extraction to prevent corruption
|
|
91
|
+
│
|
|
92
|
+
├─ 4. Link — hard links from store into node_modules/.store/
|
|
93
|
+
│ Symlinks from node_modules/<name> → .store/<name>@<version>/
|
|
94
|
+
│ Binaries linked into node_modules/.bin/
|
|
95
|
+
│
|
|
96
|
+
└─ 5. Lifecycle — preinstall / install / postinstall scripts run
|
|
97
|
+
in topological dependency order
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
The lockfile (`amae-lock.bin`) captures the full resolved graph. On subsequent installs amae reads the binary lockfile directly — no network, no resolution, just linking.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## .npmrc
|
|
105
|
+
|
|
106
|
+
amae reads both local `.npmrc` and `~/.npmrc`. Private registries and auth tokens work out of the box:
|
|
107
|
+
|
|
108
|
+
```ini
|
|
109
|
+
registry=https://registry.npmjs.org/
|
|
110
|
+
//registry.npmjs.org/:_authToken=your_token_here
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Build from source
|
|
116
|
+
|
|
117
|
+
```sh
|
|
118
|
+
git clone https://github.com/poise52/amae
|
|
119
|
+
cd amae
|
|
120
|
+
cargo build --release
|
|
121
|
+
./target/release/amae install
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Requires Rust 1.75+.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## License
|
|
129
|
+
|
|
130
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "amae-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Ultra-fast package manager for JS/TS written in Rust",
|
|
5
5
|
"bin": {
|
|
6
6
|
"amae": "bin/amae"
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
],
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"optionalDependencies": {
|
|
16
|
-
"amae-darwin-arm64": "0.
|
|
17
|
-
"amae-darwin-x64": "0.
|
|
18
|
-
"amae-linux-x64": "0.
|
|
19
|
-
"amae-win32-x64": "0.
|
|
16
|
+
"amae-darwin-arm64": "0.2.0",
|
|
17
|
+
"amae-darwin-x64": "0.2.0",
|
|
18
|
+
"amae-linux-x64": "0.2.0",
|
|
19
|
+
"amae-win32-x64": "0.2.0"
|
|
20
20
|
}
|
|
21
21
|
}
|