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/bin/wyvrn.js CHANGED
@@ -1,164 +1,278 @@
1
1
  #!/usr/bin/env node
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
-
12
- yargs
13
- .option('manifest', {
14
- type: 'string',
15
- description: 'Path to manifest file',
16
- default: './wyvrn.json',
17
- })
18
- .option('root', {
19
- type: 'string',
20
- description: 'Root directory',
21
- default: './',
22
- })
23
- .command(
24
- 'init',
25
- 'Initialise a new wyvrn.json manifest in the current project',
26
- () => {},
27
- (argv) => init(argv),
28
- )
29
- .command(
30
- 'install',
31
- 'Resolve and download all dependencies listed in the manifest',
32
- (yargs) => {
33
- yargs
34
- .option('source', {
35
- alias: 's',
36
- type: 'string',
37
- description: 'Base URL of a package source (can be repeated)',
38
- array: true,
39
- })
40
- .option('platform', {
41
- type: 'string',
42
- description: 'Target platform',
43
- choices: ['win_x64', 'win_x86', 'linux_x64', 'linux_x86', 'osx_x64', 'osx_arm64'],
44
- default: 'win_x64',
45
- })
46
- .option('timeout', {
47
- type: 'number',
48
- description: 'HTTP timeout in seconds',
49
- default: 300,
50
- });
51
- },
52
- (argv) => install(argv),
53
- )
54
- .command(
55
- 'clean',
56
- 'Remove downloaded packages and lock file',
57
- () => {},
58
- (argv) => clean(argv),
59
- )
60
- .command(
61
- 'publish',
62
- 'Package and publish the project to a source (S3 or HTTP server)',
63
- (yargs) => {
64
- yargs
65
- .option('source', {
66
- alias: 's',
67
- type: 'string',
68
- description: 'Publish destination URL/URI or a configured source name (falls back to config)',
69
- })
70
- .option('profile', {
71
- alias: 'p',
72
- type: 'string',
73
- description: 'AWS SSO profile to use for authentication (S3 only)',
74
- })
75
- .option('platform', {
76
- type: 'string',
77
- description: 'Target platform sub-path (e.g. win_x64). Defaults to "common"',
78
- choices: ['win_x64', 'win_x86', 'linux_x64', 'linux_x86', 'osx_x64', 'osx_arm64', 'common'],
79
- default: 'common',
80
- })
81
- .option('path', {
82
- type: 'string',
83
- description: 'Directory to zip and publish (defaults to current directory)',
84
- default: '.',
85
- })
86
- .option('token', {
87
- type: 'string',
88
- description: 'Bearer token for HTTP server authentication (HTTP only)',
89
- })
90
- .option('force', {
91
- alias: 'f',
92
- type: 'boolean',
93
- description: 'Overwrite an existing published version',
94
- default: false,
95
- });
96
- },
97
- (argv) => publish(argv),
98
- )
99
- .command(
100
- 'configure',
101
- 'Manage wyvrnpm configuration (sources, authentication)',
102
- (yargs) => {
103
- yargs
104
- .command('list', 'List all configured sources', () => {}, () => configure.list())
105
- .command(
106
- 'add-source',
107
- 'Add or update an install/publish source',
108
- (yargs) => {
109
- yargs
110
- .option('kind', {
111
- type: 'string',
112
- description: 'Source kind',
113
- choices: ['install', 'publish'],
114
- demandOption: true,
115
- })
116
- .option('name', {
117
- type: 'string',
118
- description: 'Unique name for this source',
119
- demandOption: true,
120
- })
121
- .option('url', {
122
- type: 'string',
123
- description: 'Source URL or URI (s3://, https://, UNC path, etc.)',
124
- demandOption: true,
125
- })
126
- .option('profile', {
127
- type: 'string',
128
- description: 'AWS SSO profile for this source (S3 only)',
129
- })
130
- .option('token', {
131
- type: 'string',
132
- description: 'Bearer token for this source (HTTP only)',
133
- });
134
- },
135
- (argv) => configure.addSource(argv),
136
- )
137
- .command(
138
- 'remove-source',
139
- 'Remove a configured source by name',
140
- (yargs) => {
141
- yargs
142
- .option('kind', {
143
- type: 'string',
144
- description: 'Source kind',
145
- choices: ['install', 'publish'],
146
- demandOption: true,
147
- })
148
- .option('name', {
149
- type: 'string',
150
- description: 'Name of the source to remove',
151
- demandOption: true,
152
- });
153
- },
154
- (argv) => configure.removeSource(argv),
155
- )
156
- .demandCommand(1)
157
- .help();
158
- },
159
- () => {},
160
- )
161
- .demandCommand(1)
162
- .strict()
163
- .help()
164
- .parse();
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": "1.2.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
- }
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
+ }