wyvrnpm 1.2.1 → 2.0.1
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 +513 -413
- package/bin/wyvrn.js +277 -163
- package/package.json +37 -37
- package/src/commands/install.js +156 -109
- package/src/commands/link.js +316 -0
- package/src/commands/profile.js +171 -0
- package/src/commands/publish.js +232 -180
- package/src/config.js +63 -60
- package/src/download.js +325 -164
- package/src/index.js +10 -9
- package/src/link-utils.js +95 -0
- package/src/manifest.js +133 -77
- package/src/profile.js +377 -0
- package/src/providers/base.js +133 -56
- package/src/providers/file.js +181 -71
- package/src/providers/http.js +268 -118
- package/src/providers/s3.js +273 -136
- package/src/resolve.js +262 -200
package/bin/wyvrn.js
CHANGED
|
@@ -1,164 +1,278 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
'use strict';
|
|
4
|
-
|
|
5
|
-
const yargs
|
|
6
|
-
const init
|
|
7
|
-
const install
|
|
8
|
-
const clean
|
|
9
|
-
const publish
|
|
10
|
-
const configure = require('../src/commands/configure');
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
.option('
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
})
|
|
46
|
-
.option('
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
default:
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
.option('
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
})
|
|
86
|
-
.option('
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
type: '
|
|
93
|
-
description: '
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
.
|
|
105
|
-
|
|
106
|
-
'
|
|
107
|
-
'
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
.option('
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
})
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
2
|
+
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
const yargs = require('yargs');
|
|
6
|
+
const init = require('../src/commands/init');
|
|
7
|
+
const install = require('../src/commands/install');
|
|
8
|
+
const clean = require('../src/commands/clean');
|
|
9
|
+
const publish = require('../src/commands/publish');
|
|
10
|
+
const configure = require('../src/commands/configure');
|
|
11
|
+
const profile = require('../src/commands/profile');
|
|
12
|
+
const { link, unlink } = require('../src/commands/link');
|
|
13
|
+
|
|
14
|
+
yargs
|
|
15
|
+
.option('manifest', {
|
|
16
|
+
type: 'string',
|
|
17
|
+
description: 'Path to manifest file',
|
|
18
|
+
default: './wyvrn.json',
|
|
19
|
+
})
|
|
20
|
+
.option('root', {
|
|
21
|
+
type: 'string',
|
|
22
|
+
description: 'Root directory',
|
|
23
|
+
default: './',
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
// ── init ──────────────────────────────────────────────────────────────────
|
|
27
|
+
.command(
|
|
28
|
+
'init',
|
|
29
|
+
'Initialise a new wyvrn.json manifest in the current project',
|
|
30
|
+
() => {},
|
|
31
|
+
(argv) => init(argv),
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
// ── install ───────────────────────────────────────────────────────────────
|
|
35
|
+
.command(
|
|
36
|
+
'install',
|
|
37
|
+
'Resolve and download all dependencies listed in the manifest',
|
|
38
|
+
(y) => {
|
|
39
|
+
y
|
|
40
|
+
.option('source', {
|
|
41
|
+
alias: 's',
|
|
42
|
+
type: 'string',
|
|
43
|
+
description: 'Base URL of a package source (can be repeated)',
|
|
44
|
+
array: true,
|
|
45
|
+
})
|
|
46
|
+
.option('profile', {
|
|
47
|
+
alias: 'p',
|
|
48
|
+
type: 'string',
|
|
49
|
+
description: 'Build profile name to use (default: config.defaultProfile → "default")',
|
|
50
|
+
})
|
|
51
|
+
.option('platform', {
|
|
52
|
+
type: 'string',
|
|
53
|
+
description: 'v1 legacy platform path (used as fallback if v2 not found)',
|
|
54
|
+
choices: ['win_x64', 'win_x86', 'linux_x64', 'linux_x86', 'osx_x64', 'osx_arm64'],
|
|
55
|
+
default: 'win_x64',
|
|
56
|
+
})
|
|
57
|
+
.option('timeout', {
|
|
58
|
+
type: 'number',
|
|
59
|
+
description: 'HTTP timeout in seconds',
|
|
60
|
+
default: 300,
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
(argv) => install(argv),
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
// ── clean ─────────────────────────────────────────────────────────────────
|
|
67
|
+
.command(
|
|
68
|
+
'clean',
|
|
69
|
+
'Remove downloaded packages and lock file',
|
|
70
|
+
() => {},
|
|
71
|
+
(argv) => clean(argv),
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
// ── publish ───────────────────────────────────────────────────────────────
|
|
75
|
+
.command(
|
|
76
|
+
'publish',
|
|
77
|
+
'Package and publish the project. The active build profile is loaded from the ' +
|
|
78
|
+
'profiles directory (--profile selects which one).',
|
|
79
|
+
(y) => {
|
|
80
|
+
y
|
|
81
|
+
.option('source', {
|
|
82
|
+
alias: 's',
|
|
83
|
+
type: 'string',
|
|
84
|
+
description: 'Publish destination URL/URI or a configured source name',
|
|
85
|
+
})
|
|
86
|
+
.option('profile', {
|
|
87
|
+
alias: 'p',
|
|
88
|
+
type: 'string',
|
|
89
|
+
description: 'Build profile name to publish as (default: config.defaultProfile → "default")',
|
|
90
|
+
})
|
|
91
|
+
.option('aws-profile', {
|
|
92
|
+
type: 'string',
|
|
93
|
+
description: 'AWS SSO profile for S3 authentication (S3 only)',
|
|
94
|
+
})
|
|
95
|
+
.option('path', {
|
|
96
|
+
type: 'string',
|
|
97
|
+
description: 'Directory to zip and publish (defaults to current directory)',
|
|
98
|
+
default: '.',
|
|
99
|
+
})
|
|
100
|
+
.option('token', {
|
|
101
|
+
type: 'string',
|
|
102
|
+
description: 'Bearer token for HTTP server authentication',
|
|
103
|
+
})
|
|
104
|
+
.option('force', {
|
|
105
|
+
alias: 'f',
|
|
106
|
+
type: 'boolean',
|
|
107
|
+
description: 'Overwrite an existing published version',
|
|
108
|
+
default: false,
|
|
109
|
+
})
|
|
110
|
+
;
|
|
111
|
+
},
|
|
112
|
+
(argv) => publish({ ...argv, awsProfile: argv['aws-profile'] }),
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
// ── configure ─────────────────────────────────────────────────────────────
|
|
116
|
+
.command(
|
|
117
|
+
'configure',
|
|
118
|
+
'Manage wyvrnpm configuration (sources, authentication, build profiles)',
|
|
119
|
+
(y) => {
|
|
120
|
+
y
|
|
121
|
+
// --- list ---
|
|
122
|
+
.command('list', 'List all configured sources', () => {}, () => configure.list())
|
|
123
|
+
|
|
124
|
+
// --- add-source ---
|
|
125
|
+
.command(
|
|
126
|
+
'add-source',
|
|
127
|
+
'Add or update an install/publish source',
|
|
128
|
+
(y2) => {
|
|
129
|
+
y2
|
|
130
|
+
.option('kind', { type: 'string', choices: ['install', 'publish'], demandOption: true })
|
|
131
|
+
.option('name', { type: 'string', demandOption: true })
|
|
132
|
+
.option('url', { type: 'string', demandOption: true })
|
|
133
|
+
.option('profile', { type: 'string', description: 'AWS SSO profile (S3 only)' })
|
|
134
|
+
.option('token', { type: 'string', description: 'Bearer token (HTTP only)' });
|
|
135
|
+
},
|
|
136
|
+
(argv) => configure.addSource(argv),
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
// --- remove-source ---
|
|
140
|
+
.command(
|
|
141
|
+
'remove-source',
|
|
142
|
+
'Remove a configured source by name',
|
|
143
|
+
(y2) => {
|
|
144
|
+
y2
|
|
145
|
+
.option('kind', { type: 'string', choices: ['install', 'publish'], demandOption: true })
|
|
146
|
+
.option('name', { type: 'string', demandOption: true });
|
|
147
|
+
},
|
|
148
|
+
(argv) => configure.removeSource(argv),
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
// --- profile ---
|
|
152
|
+
.command(
|
|
153
|
+
'profile',
|
|
154
|
+
'Manage named build profiles stored in the wyvrnpm profiles directory',
|
|
155
|
+
(y2) => {
|
|
156
|
+
y2
|
|
157
|
+
// list
|
|
158
|
+
.command(
|
|
159
|
+
'list',
|
|
160
|
+
'List all saved build profiles',
|
|
161
|
+
() => {},
|
|
162
|
+
() => profile.list(),
|
|
163
|
+
)
|
|
164
|
+
// show
|
|
165
|
+
.command(
|
|
166
|
+
'show',
|
|
167
|
+
'Display a named profile',
|
|
168
|
+
(y3) => {
|
|
169
|
+
y3.option('name', {
|
|
170
|
+
alias: 'n',
|
|
171
|
+
type: 'string',
|
|
172
|
+
description: 'Profile name (default: configured default)',
|
|
173
|
+
});
|
|
174
|
+
},
|
|
175
|
+
(argv) => profile.show(argv),
|
|
176
|
+
)
|
|
177
|
+
// detect
|
|
178
|
+
.command(
|
|
179
|
+
'detect',
|
|
180
|
+
'Auto-detect the build environment and save as a named profile',
|
|
181
|
+
(y3) => {
|
|
182
|
+
y3
|
|
183
|
+
.option('name', {
|
|
184
|
+
alias: 'n',
|
|
185
|
+
type: 'string',
|
|
186
|
+
description: 'Profile name to save to (default: "default")',
|
|
187
|
+
})
|
|
188
|
+
.option('dry-run', {
|
|
189
|
+
type: 'boolean',
|
|
190
|
+
description: 'Print detected values without saving',
|
|
191
|
+
default: false,
|
|
192
|
+
});
|
|
193
|
+
},
|
|
194
|
+
(argv) => profile.detect(argv),
|
|
195
|
+
)
|
|
196
|
+
// set
|
|
197
|
+
.command(
|
|
198
|
+
'set',
|
|
199
|
+
'Manually override fields in a named profile',
|
|
200
|
+
(y3) => {
|
|
201
|
+
y3
|
|
202
|
+
.option('name', { alias: 'n', type: 'string', description: 'Profile name (default: "default")' })
|
|
203
|
+
.option('os', { type: 'string', description: 'OS (Windows | Linux | Macos)' })
|
|
204
|
+
.option('arch', { type: 'string', description: 'Architecture (x86_64 | x86 | armv8 | ...)' })
|
|
205
|
+
.option('compiler', { type: 'string', description: 'Compiler (msvc | gcc | clang | apple-clang)' })
|
|
206
|
+
.option('compiler-version', { type: 'string', description: 'Compiler version (193 | 11 | 14 | ...)' })
|
|
207
|
+
.option('cppstd', { type: 'string', description: 'C++ standard (14 | 17 | 20 | 23)' })
|
|
208
|
+
.option('runtime', { type: 'string', description: 'Runtime linkage (static | dynamic)' });
|
|
209
|
+
},
|
|
210
|
+
(argv) => profile.set({ ...argv, compilerVersion: argv['compiler-version'] }),
|
|
211
|
+
)
|
|
212
|
+
// set-default
|
|
213
|
+
.command(
|
|
214
|
+
'set-default <name>',
|
|
215
|
+
'Change which profile is used by default',
|
|
216
|
+
(y3) => {
|
|
217
|
+
y3.positional('name', { type: 'string', demandOption: true });
|
|
218
|
+
},
|
|
219
|
+
(argv) => profile.setDefault(argv),
|
|
220
|
+
)
|
|
221
|
+
// delete
|
|
222
|
+
.command(
|
|
223
|
+
'delete <name>',
|
|
224
|
+
'Delete a saved profile',
|
|
225
|
+
(y3) => {
|
|
226
|
+
y3.positional('name', { type: 'string', demandOption: true });
|
|
227
|
+
},
|
|
228
|
+
(argv) => profile.del(argv),
|
|
229
|
+
)
|
|
230
|
+
.demandCommand(1)
|
|
231
|
+
.help();
|
|
232
|
+
},
|
|
233
|
+
() => {},
|
|
234
|
+
)
|
|
235
|
+
|
|
236
|
+
.demandCommand(1)
|
|
237
|
+
.help();
|
|
238
|
+
},
|
|
239
|
+
() => {},
|
|
240
|
+
)
|
|
241
|
+
|
|
242
|
+
// ── link ──────────────────────────────────────────────────────────────────
|
|
243
|
+
.command(
|
|
244
|
+
'link [name] [path]',
|
|
245
|
+
'Link a local package for development',
|
|
246
|
+
(y) => {
|
|
247
|
+
y
|
|
248
|
+
.positional('name', { type: 'string', description: 'Package name to link' })
|
|
249
|
+
.positional('path', { type: 'string', description: 'Local path to package' })
|
|
250
|
+
.option('list', { type: 'boolean', description: 'List all globally registered packages', default: false })
|
|
251
|
+
.option('subdir', { type: 'string', description: 'Subdirectory within the package to link' });
|
|
252
|
+
},
|
|
253
|
+
(argv) => link(argv),
|
|
254
|
+
)
|
|
255
|
+
|
|
256
|
+
// ── unlink ────────────────────────────────────────────────────────────────
|
|
257
|
+
.command(
|
|
258
|
+
'unlink <name>',
|
|
259
|
+
'Remove a linked package',
|
|
260
|
+
(y) => {
|
|
261
|
+
y
|
|
262
|
+
.positional('name', { type: 'string', demandOption: true })
|
|
263
|
+
.option('restore', { type: 'boolean', description: 'Re-download after unlinking', default: false })
|
|
264
|
+
.option('source', { alias: 's', type: 'string', array: true, description: 'Package source URL (for --restore)' })
|
|
265
|
+
.option('platform', {
|
|
266
|
+
type: 'string',
|
|
267
|
+
choices: ['win_x64', 'win_x86', 'linux_x64', 'linux_x86', 'osx_x64', 'osx_arm64'],
|
|
268
|
+
default: 'win_x64',
|
|
269
|
+
})
|
|
270
|
+
.option('timeout', { type: 'number', default: 300 });
|
|
271
|
+
},
|
|
272
|
+
(argv) => unlink(argv),
|
|
273
|
+
)
|
|
274
|
+
|
|
275
|
+
.demandCommand(1)
|
|
276
|
+
.strict()
|
|
277
|
+
.help()
|
|
278
|
+
.parse();
|
package/package.json
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "wyvrnpm",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "A simple, static-hosting-compatible C++ package manager",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"c++",
|
|
7
|
-
"package-manager",
|
|
8
|
-
"cpp",
|
|
9
|
-
"dependency-management",
|
|
10
|
-
"s3",
|
|
11
|
-
"azure"
|
|
12
|
-
],
|
|
13
|
-
"license": "MIT",
|
|
14
|
-
"bin": {
|
|
15
|
-
"wyvrnpm": "bin/wyvrn.js"
|
|
16
|
-
},
|
|
17
|
-
"main": "src/index.js",
|
|
18
|
-
"type": "commonjs",
|
|
19
|
-
"files": [
|
|
20
|
-
"bin/",
|
|
21
|
-
"src/",
|
|
22
|
-
"README.md"
|
|
23
|
-
],
|
|
24
|
-
"scripts": {
|
|
25
|
-
"test": "node --test tests/*.test.js"
|
|
26
|
-
},
|
|
27
|
-
"dependencies": {
|
|
28
|
-
"adm-zip": "^0.5.16",
|
|
29
|
-
"node-stream-zip": "^1.15.0",
|
|
30
|
-
"yargs": "^17.7.2",
|
|
31
|
-
"@aws-sdk/client-s3": "^3.0.0",
|
|
32
|
-
"@aws-sdk/credential-providers": "^3.0.0"
|
|
33
|
-
},
|
|
34
|
-
"engines": {
|
|
35
|
-
"node": ">=18.0.0"
|
|
36
|
-
}
|
|
37
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "wyvrnpm",
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"description": "A simple, static-hosting-compatible C++ package manager",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"c++",
|
|
7
|
+
"package-manager",
|
|
8
|
+
"cpp",
|
|
9
|
+
"dependency-management",
|
|
10
|
+
"s3",
|
|
11
|
+
"azure"
|
|
12
|
+
],
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"bin": {
|
|
15
|
+
"wyvrnpm": "bin/wyvrn.js"
|
|
16
|
+
},
|
|
17
|
+
"main": "src/index.js",
|
|
18
|
+
"type": "commonjs",
|
|
19
|
+
"files": [
|
|
20
|
+
"bin/",
|
|
21
|
+
"src/",
|
|
22
|
+
"README.md"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"test": "node --test tests/*.test.js"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"adm-zip": "^0.5.16",
|
|
29
|
+
"node-stream-zip": "^1.15.0",
|
|
30
|
+
"yargs": "^17.7.2",
|
|
31
|
+
"@aws-sdk/client-s3": "^3.0.0",
|
|
32
|
+
"@aws-sdk/credential-providers": "^3.0.0"
|
|
33
|
+
},
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=18.0.0"
|
|
36
|
+
}
|
|
37
|
+
}
|