@vltpkg/vsr 0.0.0-26
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/DEPLOY.md +163 -0
- package/LICENSE +119 -0
- package/README.md +314 -0
- package/config.ts +221 -0
- package/drizzle.config.js +40 -0
- package/info/COMPARISONS.md +37 -0
- package/info/CONFIGURATION.md +143 -0
- package/info/CONTRIBUTING.md +32 -0
- package/info/DATABASE_SETUP.md +108 -0
- package/info/GRANULAR_ACCESS_TOKENS.md +160 -0
- package/info/PROJECT_STRUCTURE.md +291 -0
- package/info/ROADMAP.md +27 -0
- package/info/SUPPORT.md +39 -0
- package/info/TESTING.md +301 -0
- package/info/USER_SUPPORT.md +31 -0
- package/package.json +77 -0
- package/scripts/build-assets.js +31 -0
- package/scripts/build-bin.js +62 -0
- package/scripts/prepack.js +27 -0
- package/src/assets/public/images/bg.png +0 -0
- package/src/assets/public/images/clients/logo-bun.png +0 -0
- package/src/assets/public/images/clients/logo-deno.png +0 -0
- package/src/assets/public/images/clients/logo-npm.png +0 -0
- package/src/assets/public/images/clients/logo-pnpm.png +0 -0
- package/src/assets/public/images/clients/logo-vlt.png +0 -0
- package/src/assets/public/images/clients/logo-yarn.png +0 -0
- package/src/assets/public/images/favicon/apple-touch-icon.png +0 -0
- package/src/assets/public/images/favicon/favicon-96x96.png +0 -0
- package/src/assets/public/images/favicon/favicon.ico +0 -0
- package/src/assets/public/images/favicon/favicon.svg +3 -0
- package/src/assets/public/images/favicon/site.webmanifest +21 -0
- package/src/assets/public/images/favicon/web-app-manifest-192x192.png +0 -0
- package/src/assets/public/images/favicon/web-app-manifest-512x512.png +0 -0
- package/src/assets/public/styles/styles.css +231 -0
- package/src/bin/demo/package.json +6 -0
- package/src/bin/demo/vlt.json +1 -0
- package/src/bin/vsr.ts +484 -0
- package/src/db/client.ts +590 -0
- package/src/db/migrations/0000_faulty_ricochet.sql +14 -0
- package/src/db/migrations/0000_initial.sql +29 -0
- package/src/db/migrations/0001_uuid_validation.sql +35 -0
- package/src/db/migrations/0001_wealthy_magdalene.sql +7 -0
- package/src/db/migrations/drop.sql +3 -0
- package/src/db/migrations/meta/0000_snapshot.json +104 -0
- package/src/db/migrations/meta/0001_snapshot.json +155 -0
- package/src/db/migrations/meta/_journal.json +20 -0
- package/src/db/schema.ts +43 -0
- package/src/index.ts +434 -0
- package/src/middleware/config.ts +79 -0
- package/src/middleware/telemetry.ts +43 -0
- package/src/queue/index.ts +97 -0
- package/src/routes/access.ts +852 -0
- package/src/routes/docs.ts +63 -0
- package/src/routes/misc.ts +469 -0
- package/src/routes/packages.ts +2823 -0
- package/src/routes/ping.ts +39 -0
- package/src/routes/search.ts +131 -0
- package/src/routes/static.ts +74 -0
- package/src/routes/tokens.ts +259 -0
- package/src/routes/users.ts +68 -0
- package/src/utils/auth.ts +202 -0
- package/src/utils/cache.ts +587 -0
- package/src/utils/config.ts +50 -0
- package/src/utils/database.ts +69 -0
- package/src/utils/docs.ts +146 -0
- package/src/utils/packages.ts +453 -0
- package/src/utils/response.ts +125 -0
- package/src/utils/routes.ts +64 -0
- package/src/utils/spa.ts +52 -0
- package/src/utils/tracing.ts +52 -0
- package/src/utils/upstream.ts +172 -0
- package/test/access.test.ts +705 -0
- package/test/audit.test.ts +828 -0
- package/test/dashboard.test.ts +693 -0
- package/test/dist-tags.test.ts +678 -0
- package/test/manifest.test.ts +436 -0
- package/test/packument.test.ts +530 -0
- package/test/ping.test.ts +41 -0
- package/test/search.test.ts +472 -0
- package/test/setup.ts +130 -0
- package/test/static.test.ts +646 -0
- package/test/tokens.test.ts +389 -0
- package/test/utils/auth.test.ts +214 -0
- package/test/utils/packages.test.ts +235 -0
- package/test/utils/response.test.ts +184 -0
- package/test/whoami.test.ts +119 -0
- package/tsconfig.json +16 -0
- package/tsconfig.worker.json +3 -0
- package/typedoc.mjs +2 -0
- package/types.ts +598 -0
- package/vitest.config.ts +25 -0
- package/vlt.json.example +56 -0
- package/wrangler.json +65 -0
package/DEPLOY.md
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# VSR Deploy Command
|
|
2
|
+
|
|
3
|
+
The VSR CLI now includes a `deploy` subcommand that allows you to
|
|
4
|
+
deploy your VSR instance to Cloudflare Workers using configuration
|
|
5
|
+
from your `vlt.json` file.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Deploy to default environment (dev)
|
|
11
|
+
vsr deploy
|
|
12
|
+
|
|
13
|
+
# Deploy to specific environment
|
|
14
|
+
vsr deploy --env=prod
|
|
15
|
+
|
|
16
|
+
# Preview deployment without actually deploying
|
|
17
|
+
vsr deploy --dry-run
|
|
18
|
+
|
|
19
|
+
# Override specific resource names
|
|
20
|
+
vsr deploy --env=staging --db-name=my-custom-db --bucket-name=my-custom-bucket
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Configuration
|
|
24
|
+
|
|
25
|
+
Add a `deploy` section to your `vlt.json` file under the `registry`
|
|
26
|
+
key:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"registry": {
|
|
31
|
+
"deploy": {
|
|
32
|
+
"sentry": {
|
|
33
|
+
"dsn": "https://your-default-sentry-dsn@sentry.io/project-id",
|
|
34
|
+
"sampleRate": 1.0,
|
|
35
|
+
"tracesSampleRate": 0.1
|
|
36
|
+
},
|
|
37
|
+
"environments": {
|
|
38
|
+
"dev": {
|
|
39
|
+
"databaseName": "vsr-dev-database",
|
|
40
|
+
"bucketName": "vsr-dev-bucket",
|
|
41
|
+
"queueName": "vsr-dev-cache-refresh-queue",
|
|
42
|
+
"sentry": {
|
|
43
|
+
"environment": "development"
|
|
44
|
+
},
|
|
45
|
+
"vars": {
|
|
46
|
+
"CUSTOM_VAR": "dev-value"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"prod": {
|
|
50
|
+
"databaseName": "vsr-prod-database",
|
|
51
|
+
"bucketName": "vsr-prod-bucket",
|
|
52
|
+
"queueName": "vsr-prod-cache-refresh-queue",
|
|
53
|
+
"sentry": {
|
|
54
|
+
"environment": "production",
|
|
55
|
+
"dsn": "https://your-prod-sentry-dsn@sentry.io/project-id",
|
|
56
|
+
"sampleRate": 0.1,
|
|
57
|
+
"tracesSampleRate": 0.01
|
|
58
|
+
},
|
|
59
|
+
"vars": {
|
|
60
|
+
"API_BASE_URL": "https://api.example.com"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Configuration Options
|
|
70
|
+
|
|
71
|
+
### Global Deploy Settings
|
|
72
|
+
|
|
73
|
+
- `sentry.dsn`: Default Sentry DSN for error reporting
|
|
74
|
+
- `sentry.sampleRate`: Default error sample rate (0.0 to 1.0)
|
|
75
|
+
- `sentry.tracesSampleRate`: Default performance traces sample rate
|
|
76
|
+
(0.0 to 1.0)
|
|
77
|
+
|
|
78
|
+
### Environment-Specific Settings
|
|
79
|
+
|
|
80
|
+
Each environment can override any global setting and specify:
|
|
81
|
+
|
|
82
|
+
- `databaseName`: D1 database name for this environment
|
|
83
|
+
- `bucketName`: R2 bucket name for this environment
|
|
84
|
+
- `queueName`: Queue name for cache refresh operations
|
|
85
|
+
- `sentry`: Environment-specific Sentry configuration
|
|
86
|
+
- `vars`: Custom environment variables to pass to the Worker
|
|
87
|
+
|
|
88
|
+
### CLI Options
|
|
89
|
+
|
|
90
|
+
- `--env=<string>`: Environment to deploy to (defaults to "dev")
|
|
91
|
+
- `--db-name=<string>`: Override D1 database name
|
|
92
|
+
- `--bucket-name=<string>`: Override R2 bucket name
|
|
93
|
+
- `--queue-name=<string>`: Override queue name
|
|
94
|
+
- `--dry-run`: Show what would be deployed without actually deploying
|
|
95
|
+
|
|
96
|
+
## Precedence
|
|
97
|
+
|
|
98
|
+
Configuration values are resolved in the following order (highest
|
|
99
|
+
precedence first):
|
|
100
|
+
|
|
101
|
+
1. CLI arguments (`--db-name`, `--bucket-name`, etc.)
|
|
102
|
+
2. Environment-specific config (`environments.prod.databaseName`)
|
|
103
|
+
3. Default values
|
|
104
|
+
|
|
105
|
+
## Examples
|
|
106
|
+
|
|
107
|
+
### Basic Deployment
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Deploy to development environment
|
|
111
|
+
vsr deploy --env=dev
|
|
112
|
+
|
|
113
|
+
# Deploy to production
|
|
114
|
+
vsr deploy --env=prod
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Custom Resource Names
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
# Override database and bucket names
|
|
121
|
+
vsr deploy --env=staging --db-name=my-staging-db --bucket-name=my-staging-bucket
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Preview Deployment
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
# See what would be deployed without actually deploying
|
|
128
|
+
vsr deploy --env=prod --dry-run
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Using Custom Config File
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# Use a specific vlt.json file
|
|
135
|
+
vsr deploy --config=/path/to/custom-vlt.json --env=prod
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Generated Wrangler Command
|
|
139
|
+
|
|
140
|
+
The deploy command generates a `wrangler deploy` command with the
|
|
141
|
+
appropriate bindings and variables. For example:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
wrangler deploy dist/index.js \
|
|
145
|
+
--name vsr-prod \
|
|
146
|
+
--compatibility-date 2024-09-23 \
|
|
147
|
+
--var SENTRY_DSN:https://your-sentry-dsn@sentry.io/project-id \
|
|
148
|
+
--var SENTRY_ENVIRONMENT:production \
|
|
149
|
+
--var ARG_DEBUG:false \
|
|
150
|
+
--var ARG_TELEMETRY:true \
|
|
151
|
+
--var ARG_DAEMON:true \
|
|
152
|
+
--d1 DB=vsr-prod-database \
|
|
153
|
+
--r2 BUCKET=vsr-prod-bucket \
|
|
154
|
+
--queue-producer CACHE_REFRESH_QUEUE=vsr-prod-cache-refresh-queue \
|
|
155
|
+
--queue-consumer vsr-prod-cache-refresh-queue
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Prerequisites
|
|
159
|
+
|
|
160
|
+
- Wrangler CLI must be installed and authenticated
|
|
161
|
+
- Cloudflare Workers account with appropriate permissions
|
|
162
|
+
- D1 databases, R2 buckets, and queues must exist (or be created by
|
|
163
|
+
Wrangler)
|
package/LICENSE
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Functional Source License, Version 1.1, MIT Future License
|
|
2
|
+
|
|
3
|
+
## Abbreviation
|
|
4
|
+
|
|
5
|
+
FSL-1.1-MIT
|
|
6
|
+
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2025 vlt technology Inc.
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available
|
|
20
|
+
under these Terms and Conditions, as indicated by our inclusion of
|
|
21
|
+
these Terms and Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the
|
|
27
|
+
right to use, copy, modify, create derivative works, publicly perform,
|
|
28
|
+
publicly display and redistribute the Software for any Permitted
|
|
29
|
+
Purpose identified below.
|
|
30
|
+
|
|
31
|
+
### Permitted Purpose
|
|
32
|
+
|
|
33
|
+
A Permitted Purpose is any purpose other than a Competing Use. A
|
|
34
|
+
Competing Use means making the Software available to others in a
|
|
35
|
+
commercial product or service that:
|
|
36
|
+
|
|
37
|
+
1. substitutes for the Software;
|
|
38
|
+
|
|
39
|
+
2. substitutes for any other product or service we offer using the
|
|
40
|
+
Software that exists as of the date we make the Software available;
|
|
41
|
+
or
|
|
42
|
+
|
|
43
|
+
3. offers the same or substantially similar functionality as the
|
|
44
|
+
Software.
|
|
45
|
+
|
|
46
|
+
Permitted Purposes specifically include using the Software:
|
|
47
|
+
|
|
48
|
+
1. for your internal use and access;
|
|
49
|
+
|
|
50
|
+
2. for non-commercial education;
|
|
51
|
+
|
|
52
|
+
3. for non-commercial research; and
|
|
53
|
+
|
|
54
|
+
4. in connection with professional services that you provide to a
|
|
55
|
+
licensee using the Software in accordance with these Terms and
|
|
56
|
+
Conditions.
|
|
57
|
+
|
|
58
|
+
### Patents
|
|
59
|
+
|
|
60
|
+
To the extent your use for a Permitted Purpose would necessarily
|
|
61
|
+
infringe our patents, the license grant above includes a license under
|
|
62
|
+
our patents. If you make a claim against any party that the Software
|
|
63
|
+
infringes or contributes to the infringement of any patent, then your
|
|
64
|
+
patent license to the Software ends immediately.
|
|
65
|
+
|
|
66
|
+
### Redistribution
|
|
67
|
+
|
|
68
|
+
The Terms and Conditions apply to all copies, modifications and
|
|
69
|
+
derivatives of the Software.
|
|
70
|
+
|
|
71
|
+
If you redistribute any copies, modifications or derivatives of the
|
|
72
|
+
Software, you must include a copy of or a link to these Terms and
|
|
73
|
+
Conditions and not remove any copyright notices provided in or with
|
|
74
|
+
the Software.
|
|
75
|
+
|
|
76
|
+
### Disclaimer
|
|
77
|
+
|
|
78
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND,
|
|
79
|
+
EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS
|
|
80
|
+
FOR A PARTICULAR PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
81
|
+
|
|
82
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR
|
|
83
|
+
RELATED TO THE SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR
|
|
84
|
+
CONSEQUENTIAL DAMAGES, EVEN IF WE HAVE BEEN INFORMED OF THEIR
|
|
85
|
+
POSSIBILITY IN ADVANCE.
|
|
86
|
+
|
|
87
|
+
### Trademarks
|
|
88
|
+
|
|
89
|
+
Except for displaying the License Details and identifying us as the
|
|
90
|
+
origin of the Software, you have no right under these Terms and
|
|
91
|
+
Conditions to use our trademarks, trade names, service marks or
|
|
92
|
+
product names.
|
|
93
|
+
|
|
94
|
+
## Grant of Future License
|
|
95
|
+
|
|
96
|
+
We hereby irrevocably grant you an additional license to use the
|
|
97
|
+
Software under the MIT license that is effective on the second
|
|
98
|
+
anniversary of the date we make the Software available. On or after
|
|
99
|
+
that date, you may use the Software under the MIT license, in which
|
|
100
|
+
case the following will apply:
|
|
101
|
+
|
|
102
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
103
|
+
a copy of this software and associated documentation files (the
|
|
104
|
+
"Software"), to deal in the Software without restriction, including
|
|
105
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
106
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
107
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
108
|
+
the following conditions:
|
|
109
|
+
|
|
110
|
+
The above copyright notice and this permission notice shall be
|
|
111
|
+
included in all copies or substantial portions of the Software.
|
|
112
|
+
|
|
113
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
114
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
115
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
116
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
117
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
118
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
119
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
# **vlt** serverless registry (`vsr`)
|
|
2
|
+
|
|
3
|
+
> A modern, npm-compatible serverless registry that's fast, secure,
|
|
4
|
+
> and ridiculously easy to deploy.
|
|
5
|
+
|
|
6
|
+
`vsr` is a minimal yet powerful npm-compatible registry that
|
|
7
|
+
replicates core npm features while adding cutting-edge capabilities.
|
|
8
|
+
Built for the modern web, it runs seamlessly on Cloudflare's global
|
|
9
|
+
edge network.
|
|
10
|
+
|
|
11
|
+
<img src="https://github.com/user-attachments/assets/e76c6f8a-a078-4787-963c-8ec95a879731" alt="vsr api screenshot" />
|
|
12
|
+
|
|
13
|
+
## π Quick Start
|
|
14
|
+
|
|
15
|
+
### Local Development
|
|
16
|
+
|
|
17
|
+
Get up and running in seconds:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Try it locally
|
|
21
|
+
npx @vltpkg/vsr
|
|
22
|
+
|
|
23
|
+
# Or install globally
|
|
24
|
+
npm install -g @vltpkg/vsr
|
|
25
|
+
vsr
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Boom!** π₯ Your registry is live at `http://localhost:1337`
|
|
29
|
+
|
|
30
|
+
### Deploy to Production
|
|
31
|
+
|
|
32
|
+
Deploy to Cloudflare Workers with one command:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Deploy to production
|
|
36
|
+
vsr deploy --env=prod
|
|
37
|
+
|
|
38
|
+
# Or preview what would be deployed
|
|
39
|
+
vsr deploy --dry-run --env=prod
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**That's it!** π Your registry is now running globally on
|
|
43
|
+
Cloudflare's edge network.
|
|
44
|
+
|
|
45
|
+
## β¨ Why Choose VSR?
|
|
46
|
+
|
|
47
|
+
- **β‘ Blazing Fast**: Edge-optimized with global CDN distribution
|
|
48
|
+
- **π Secure by Default**: Package integrity validation and granular
|
|
49
|
+
access control
|
|
50
|
+
- **π° Cost Effective**: Generous free tier on Cloudflare (100k
|
|
51
|
+
requests/day)
|
|
52
|
+
- **π npm Compatible**: Drop-in replacement for existing workflows
|
|
53
|
+
- **π¦ Zero Config**: Works out of the box, configure when you need to
|
|
54
|
+
- **π Global Scale**: Deploy worldwide in under 5 minutes
|
|
55
|
+
|
|
56
|
+
## π― Perfect For
|
|
57
|
+
|
|
58
|
+
- **Teams** who need private package management
|
|
59
|
+
- **Organizations** requiring granular access control
|
|
60
|
+
- **Developers** wanting fast, reliable package hosting
|
|
61
|
+
- **Companies** needing npm-compatible enterprise solutions
|
|
62
|
+
|
|
63
|
+
## πββοΈ Getting Started
|
|
64
|
+
|
|
65
|
+
### Local Development
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Start with defaults (port 1337)
|
|
69
|
+
vsr
|
|
70
|
+
|
|
71
|
+
# Or explicitly use dev command
|
|
72
|
+
vsr dev
|
|
73
|
+
|
|
74
|
+
# Custom port
|
|
75
|
+
vsr --port 3000
|
|
76
|
+
|
|
77
|
+
# Enable debug mode
|
|
78
|
+
vsr --debug
|
|
79
|
+
|
|
80
|
+
# Use config file
|
|
81
|
+
vsr --config ./vlt.json
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Production Deployment
|
|
85
|
+
|
|
86
|
+
Deploy to Cloudflare Workers in under 5 minutes:
|
|
87
|
+
|
|
88
|
+
#### Option 1: Using VSR Deploy Command (Recommended)
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Clone and setup
|
|
92
|
+
git clone https://github.com/vltpkg/vsr.git
|
|
93
|
+
cd vsr
|
|
94
|
+
vlt install
|
|
95
|
+
|
|
96
|
+
# Deploy to development environment
|
|
97
|
+
vsr deploy
|
|
98
|
+
|
|
99
|
+
# Deploy to production
|
|
100
|
+
vsr deploy --env=prod
|
|
101
|
+
|
|
102
|
+
# Preview deployment configuration
|
|
103
|
+
vsr deploy --dry-run --env=prod
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
#### Option 2: Using Wrangler Directly
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# Clone and setup
|
|
110
|
+
git clone https://github.com/vltpkg/vsr.git
|
|
111
|
+
cd vsr
|
|
112
|
+
vlt install
|
|
113
|
+
|
|
114
|
+
# Deploy to production
|
|
115
|
+
wrangler deploy
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
The VSR deploy command offers better configuration management,
|
|
119
|
+
environment-specific settings, and integration with your `vlt.json`
|
|
120
|
+
configuration.
|
|
121
|
+
|
|
122
|
+
**Coming Soon**: One-click Cloudflare deployment button! π
|
|
123
|
+
|
|
124
|
+
<img src="https://github.com/user-attachments/assets/528deda2-4c20-44c9-b057-f07c2e2e3c71" alt="Deploy to Cloudflare Workers" width="200" />
|
|
125
|
+
|
|
126
|
+
## βοΈ Configuration
|
|
127
|
+
|
|
128
|
+
VSR is designed to work with zero configuration, but when you need
|
|
129
|
+
more control:
|
|
130
|
+
|
|
131
|
+
### Commands
|
|
132
|
+
|
|
133
|
+
| Command | Description |
|
|
134
|
+
| -------- | ---------------------------------- |
|
|
135
|
+
| `dev` | Start development server (default) |
|
|
136
|
+
| `deploy` | Deploy to Cloudflare Workers |
|
|
137
|
+
|
|
138
|
+
### CLI Options
|
|
139
|
+
|
|
140
|
+
| Option | Alias | Default | Description |
|
|
141
|
+
| ---------- | ----- | ------- | ----------------------- |
|
|
142
|
+
| `--port` | `-p` | `1337` | Server port |
|
|
143
|
+
| `--config` | `-c` | - | Config file path |
|
|
144
|
+
| `--debug` | `-d` | `false` | Debug mode |
|
|
145
|
+
| `--daemon` | - | `true` | Local filesystem daemon |
|
|
146
|
+
| `--help` | `-h` | - | Show help |
|
|
147
|
+
|
|
148
|
+
### Deploy Options
|
|
149
|
+
|
|
150
|
+
| Option | Default | Description |
|
|
151
|
+
| --------------- | ------- | ------------------------------ |
|
|
152
|
+
| `--env` | `dev` | Environment (dev/staging/prod) |
|
|
153
|
+
| `--db-name` | - | Override D1 database name |
|
|
154
|
+
| `--bucket-name` | - | Override R2 bucket name |
|
|
155
|
+
| `--queue-name` | - | Override queue name |
|
|
156
|
+
| `--dry-run` | `false` | Preview deployment |
|
|
157
|
+
|
|
158
|
+
### Advanced Configuration
|
|
159
|
+
|
|
160
|
+
Create a `vlt.json` file for shared configuration between VLT and VSR:
|
|
161
|
+
|
|
162
|
+
```json
|
|
163
|
+
{
|
|
164
|
+
"registry": {
|
|
165
|
+
"port": 4000,
|
|
166
|
+
"debug": true,
|
|
167
|
+
"telemetry": false,
|
|
168
|
+
"deploy": {
|
|
169
|
+
"sentry": {
|
|
170
|
+
"dsn": "https://your-sentry-dsn@sentry.io/project-id"
|
|
171
|
+
},
|
|
172
|
+
"environments": {
|
|
173
|
+
"prod": {
|
|
174
|
+
"databaseName": "vsr-prod-database",
|
|
175
|
+
"bucketName": "vsr-prod-bucket",
|
|
176
|
+
"queueName": "vsr-prod-cache-refresh-queue",
|
|
177
|
+
"sentry": {
|
|
178
|
+
"environment": "production"
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
π **[Learn More About Configuration β](info/CONFIGURATION.md)**
|
|
188
|
+
π **[Deployment Guide β](DEPLOY.md)**
|
|
189
|
+
|
|
190
|
+
## π Key Features
|
|
191
|
+
|
|
192
|
+
### Core Registry Features
|
|
193
|
+
|
|
194
|
+
- β
**npm-compatible API** - Drop-in replacement
|
|
195
|
+
- β
**Semver range resolution** - Smart version handling
|
|
196
|
+
- β
**Scoped packages** - Full `@scope/package` support
|
|
197
|
+
- β
**Dist-tag management** - Version tagging and lifecycle
|
|
198
|
+
- β
**Search & discovery** - Find packages fast
|
|
199
|
+
|
|
200
|
+
### Security & Access Control
|
|
201
|
+
|
|
202
|
+
- π **[Granular access tokens](info/GRANULAR_ACCESS_TOKENS.md)** -
|
|
203
|
+
Fine-grained permissions
|
|
204
|
+
- π‘οΈ **Package integrity validation** - Tamper detection
|
|
205
|
+
- π **Manifest confusion protection** - Security by design
|
|
206
|
+
|
|
207
|
+
### Performance & Reliability
|
|
208
|
+
|
|
209
|
+
- β‘ **Edge-optimized responses** - Global performance
|
|
210
|
+
- π¦ **Minimal JSON responses** - Faster installs
|
|
211
|
+
- π **Background data refresh** - Always up-to-date
|
|
212
|
+
- π **Upstream proxying** - Seamless package access
|
|
213
|
+
|
|
214
|
+
### Developer Experience
|
|
215
|
+
|
|
216
|
+
- π **Interactive API docs** - Built-in Scalar documentation
|
|
217
|
+
- π οΈ **Rich CLI interface** - Powerful command-line tools
|
|
218
|
+
- βοΈ **Flexible configuration** - Adapt to your workflow
|
|
219
|
+
|
|
220
|
+
## π How It Compares
|
|
221
|
+
|
|
222
|
+
VSR stands out in the registry landscape:
|
|
223
|
+
|
|
224
|
+
- **vs npm**: Private, customizable, edge-deployed
|
|
225
|
+
- **vs Verdaccio**: Serverless, zero-maintenance, global scale
|
|
226
|
+
- **vs GitHub Packages**: More flexible, better performance
|
|
227
|
+
- **vs Enterprise solutions**: Open source, cost-effective
|
|
228
|
+
|
|
229
|
+
π **[See Detailed Comparisons β](info/COMPARISONS.md)**
|
|
230
|
+
|
|
231
|
+
## π» Requirements
|
|
232
|
+
|
|
233
|
+
### Production
|
|
234
|
+
|
|
235
|
+
- **Cloudflare Account** (free tier available)
|
|
236
|
+
- Workers: 100k requests/day
|
|
237
|
+
- D1 Database: 5GB storage + 5M reads/day
|
|
238
|
+
- R2 Storage: 10GB + 10M reads/day
|
|
239
|
+
|
|
240
|
+
### Development
|
|
241
|
+
|
|
242
|
+
- Node.js (latest LTS)
|
|
243
|
+
- VLT package manager
|
|
244
|
+
- Git
|
|
245
|
+
|
|
246
|
+
## π API Access
|
|
247
|
+
|
|
248
|
+
Once running, access your registry:
|
|
249
|
+
|
|
250
|
+
- **Registry API**: `http://localhost:1337`
|
|
251
|
+
- **Interactive Docs**: `http://localhost:1337/-/docs`
|
|
252
|
+
- **Filesystem Daemon**: `http://localhost:3000` (if enabled)
|
|
253
|
+
|
|
254
|
+
The API includes complete npm compatibility plus enhanced features
|
|
255
|
+
like URL-encoded semver ranges and optimized install responses.
|
|
256
|
+
|
|
257
|
+
## π£οΈ What's Next?
|
|
258
|
+
|
|
259
|
+
We're actively developing exciting features:
|
|
260
|
+
|
|
261
|
+
- π **Web UI** for package management
|
|
262
|
+
- π₯ **User management** with web authentication
|
|
263
|
+
- π’ **Enterprise features** and integrations
|
|
264
|
+
- π **Analytics & insights** dashboard
|
|
265
|
+
|
|
266
|
+
πΊοΈ **[View Full Roadmap β](info/ROADMAP.md)**
|
|
267
|
+
|
|
268
|
+
## π€ Contributing
|
|
269
|
+
|
|
270
|
+
We welcome contributions! VSR is built with modern tools and follows
|
|
271
|
+
best practices:
|
|
272
|
+
|
|
273
|
+
- **TypeScript** for type safety
|
|
274
|
+
- **Comprehensive testing** with 100% coverage
|
|
275
|
+
- **Clean architecture** with separated concerns
|
|
276
|
+
- **Detailed documentation** and examples
|
|
277
|
+
|
|
278
|
+
π§ **[Contributing Guide β](info/CONTRIBUTING.md)**
|
|
279
|
+
|
|
280
|
+
## π Documentation
|
|
281
|
+
|
|
282
|
+
- **[Configuration Guide](info/CONFIGURATION.md)** - Advanced setup
|
|
283
|
+
and options
|
|
284
|
+
- **[Deployment Guide](DEPLOY.md)** - Deploy to Cloudflare Workers
|
|
285
|
+
- **[Access Control](info/GRANULAR_ACCESS_TOKENS.md)** - Security and
|
|
286
|
+
permissions
|
|
287
|
+
- **[Testing Guide](info/TESTING.md)** - Running and writing tests
|
|
288
|
+
- **[Project Structure](info/PROJECT_STRUCTURE.md)** - Codebase
|
|
289
|
+
overview
|
|
290
|
+
- **[Database Setup](info/DATABASE_SETUP.md)** - Storage configuration
|
|
291
|
+
|
|
292
|
+
## π¬ Support
|
|
293
|
+
|
|
294
|
+
Need help? We've got you covered:
|
|
295
|
+
|
|
296
|
+
- π **Documentation** - Comprehensive guides and examples
|
|
297
|
+
- π **Issues** - Report bugs and request features
|
|
298
|
+
- π¬ **Discussions** - Community support and questions
|
|
299
|
+
|
|
300
|
+
π **[Get Support β](info/USER_SUPPORT.md)**
|
|
301
|
+
|
|
302
|
+
## π License
|
|
303
|
+
|
|
304
|
+
VSR is licensed under the
|
|
305
|
+
**[Functional Source License](https://fsl.software)**
|
|
306
|
+
([FSL-1.1-MIT](LICENSE.md)) - free for most use cases, with commercial
|
|
307
|
+
restrictions that convert to MIT after two years.
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
**Ready to revolutionize your package management?** π
|
|
312
|
+
[Get started](#-quick-start) β’
|
|
313
|
+
[Deploy to production](#production-deployment) β’
|
|
314
|
+
[Join the community](info/USER_SUPPORT.md)
|