wyvrnpm 1.2.0 → 1.3.2
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 +413 -413
- package/bin/wyvrn.js +224 -157
- package/package.json +37 -37
- package/src/commands/clean.js +40 -40
- package/src/commands/configure.js +80 -80
- package/src/commands/init.js +33 -33
- package/src/commands/install.js +109 -109
- package/src/commands/link.js +316 -0
- package/src/commands/publish.js +180 -167
- package/src/config.js +61 -60
- package/src/download.js +172 -164
- package/src/index.js +9 -9
- package/src/link-utils.js +95 -0
- package/src/manifest.js +77 -77
- package/src/providers/base.js +56 -45
- package/src/providers/file.js +71 -65
- package/src/providers/http.js +118 -102
- package/src/providers/index.js +43 -43
- package/src/providers/s3.js +136 -109
- package/src/resolve.js +257 -200
package/bin/wyvrn.js
CHANGED
|
@@ -1,158 +1,225 @@
|
|
|
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
|
-
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 { link, unlink } = require('../src/commands/link');
|
|
12
|
+
|
|
13
|
+
yargs
|
|
14
|
+
.option('manifest', {
|
|
15
|
+
type: 'string',
|
|
16
|
+
description: 'Path to manifest file',
|
|
17
|
+
default: './wyvrn.json',
|
|
18
|
+
})
|
|
19
|
+
.option('root', {
|
|
20
|
+
type: 'string',
|
|
21
|
+
description: 'Root directory',
|
|
22
|
+
default: './',
|
|
23
|
+
})
|
|
24
|
+
.command(
|
|
25
|
+
'init',
|
|
26
|
+
'Initialise a new wyvrn.json manifest in the current project',
|
|
27
|
+
() => {},
|
|
28
|
+
(argv) => init(argv),
|
|
29
|
+
)
|
|
30
|
+
.command(
|
|
31
|
+
'install',
|
|
32
|
+
'Resolve and download all dependencies listed in the manifest',
|
|
33
|
+
(yargs) => {
|
|
34
|
+
yargs
|
|
35
|
+
.option('source', {
|
|
36
|
+
alias: 's',
|
|
37
|
+
type: 'string',
|
|
38
|
+
description: 'Base URL of a package source (can be repeated)',
|
|
39
|
+
array: true,
|
|
40
|
+
})
|
|
41
|
+
.option('platform', {
|
|
42
|
+
type: 'string',
|
|
43
|
+
description: 'Target platform',
|
|
44
|
+
choices: ['win_x64', 'win_x86', 'linux_x64', 'linux_x86', 'osx_x64', 'osx_arm64'],
|
|
45
|
+
default: 'win_x64',
|
|
46
|
+
})
|
|
47
|
+
.option('timeout', {
|
|
48
|
+
type: 'number',
|
|
49
|
+
description: 'HTTP timeout in seconds',
|
|
50
|
+
default: 300,
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
(argv) => install(argv),
|
|
54
|
+
)
|
|
55
|
+
.command(
|
|
56
|
+
'clean',
|
|
57
|
+
'Remove downloaded packages and lock file',
|
|
58
|
+
() => {},
|
|
59
|
+
(argv) => clean(argv),
|
|
60
|
+
)
|
|
61
|
+
.command(
|
|
62
|
+
'publish',
|
|
63
|
+
'Package and publish the project to a source (S3 or HTTP server)',
|
|
64
|
+
(yargs) => {
|
|
65
|
+
yargs
|
|
66
|
+
.option('source', {
|
|
67
|
+
alias: 's',
|
|
68
|
+
type: 'string',
|
|
69
|
+
description: 'Publish destination URL/URI or a configured source name (falls back to config)',
|
|
70
|
+
})
|
|
71
|
+
.option('profile', {
|
|
72
|
+
alias: 'p',
|
|
73
|
+
type: 'string',
|
|
74
|
+
description: 'AWS SSO profile to use for authentication (S3 only)',
|
|
75
|
+
})
|
|
76
|
+
.option('platform', {
|
|
77
|
+
type: 'string',
|
|
78
|
+
description: 'Target platform sub-path (e.g. win_x64). Defaults to "common"',
|
|
79
|
+
choices: ['win_x64', 'win_x86', 'linux_x64', 'linux_x86', 'osx_x64', 'osx_arm64', 'common'],
|
|
80
|
+
default: 'common',
|
|
81
|
+
})
|
|
82
|
+
.option('path', {
|
|
83
|
+
type: 'string',
|
|
84
|
+
description: 'Directory to zip and publish (defaults to current directory)',
|
|
85
|
+
default: '.',
|
|
86
|
+
})
|
|
87
|
+
.option('token', {
|
|
88
|
+
type: 'string',
|
|
89
|
+
description: 'Bearer token for HTTP server authentication (HTTP only)',
|
|
90
|
+
})
|
|
91
|
+
.option('force', {
|
|
92
|
+
alias: 'f',
|
|
93
|
+
type: 'boolean',
|
|
94
|
+
description: 'Overwrite an existing published version',
|
|
95
|
+
default: false,
|
|
96
|
+
});
|
|
97
|
+
},
|
|
98
|
+
(argv) => publish(argv),
|
|
99
|
+
)
|
|
100
|
+
.command(
|
|
101
|
+
'configure',
|
|
102
|
+
'Manage wyvrnpm configuration (sources, authentication)',
|
|
103
|
+
(yargs) => {
|
|
104
|
+
yargs
|
|
105
|
+
.command('list', 'List all configured sources', () => {}, () => configure.list())
|
|
106
|
+
.command(
|
|
107
|
+
'add-source',
|
|
108
|
+
'Add or update an install/publish source',
|
|
109
|
+
(yargs) => {
|
|
110
|
+
yargs
|
|
111
|
+
.option('kind', {
|
|
112
|
+
type: 'string',
|
|
113
|
+
description: 'Source kind',
|
|
114
|
+
choices: ['install', 'publish'],
|
|
115
|
+
demandOption: true,
|
|
116
|
+
})
|
|
117
|
+
.option('name', {
|
|
118
|
+
type: 'string',
|
|
119
|
+
description: 'Unique name for this source',
|
|
120
|
+
demandOption: true,
|
|
121
|
+
})
|
|
122
|
+
.option('url', {
|
|
123
|
+
type: 'string',
|
|
124
|
+
description: 'Source URL or URI (s3://, https://, UNC path, etc.)',
|
|
125
|
+
demandOption: true,
|
|
126
|
+
})
|
|
127
|
+
.option('profile', {
|
|
128
|
+
type: 'string',
|
|
129
|
+
description: 'AWS SSO profile for this source (S3 only)',
|
|
130
|
+
})
|
|
131
|
+
.option('token', {
|
|
132
|
+
type: 'string',
|
|
133
|
+
description: 'Bearer token for this source (HTTP only)',
|
|
134
|
+
});
|
|
135
|
+
},
|
|
136
|
+
(argv) => configure.addSource(argv),
|
|
137
|
+
)
|
|
138
|
+
.command(
|
|
139
|
+
'remove-source',
|
|
140
|
+
'Remove a configured source by name',
|
|
141
|
+
(yargs) => {
|
|
142
|
+
yargs
|
|
143
|
+
.option('kind', {
|
|
144
|
+
type: 'string',
|
|
145
|
+
description: 'Source kind',
|
|
146
|
+
choices: ['install', 'publish'],
|
|
147
|
+
demandOption: true,
|
|
148
|
+
})
|
|
149
|
+
.option('name', {
|
|
150
|
+
type: 'string',
|
|
151
|
+
description: 'Name of the source to remove',
|
|
152
|
+
demandOption: true,
|
|
153
|
+
});
|
|
154
|
+
},
|
|
155
|
+
(argv) => configure.removeSource(argv),
|
|
156
|
+
)
|
|
157
|
+
.demandCommand(1)
|
|
158
|
+
.help();
|
|
159
|
+
},
|
|
160
|
+
() => {},
|
|
161
|
+
)
|
|
162
|
+
.command(
|
|
163
|
+
'link [name] [path]',
|
|
164
|
+
'Link a local package for development',
|
|
165
|
+
(yargs) => {
|
|
166
|
+
yargs
|
|
167
|
+
.positional('name', {
|
|
168
|
+
type: 'string',
|
|
169
|
+
description: 'Package name to link (omit to register current directory)',
|
|
170
|
+
})
|
|
171
|
+
.positional('path', {
|
|
172
|
+
type: 'string',
|
|
173
|
+
description: 'Local path to package (optional, uses global registry if omitted)',
|
|
174
|
+
})
|
|
175
|
+
.option('list', {
|
|
176
|
+
type: 'boolean',
|
|
177
|
+
description: 'List all globally registered packages',
|
|
178
|
+
default: false,
|
|
179
|
+
})
|
|
180
|
+
.option('subdir', {
|
|
181
|
+
type: 'string',
|
|
182
|
+
description: 'Subdirectory within the package to link (e.g., "output/install" for CMake packages)',
|
|
183
|
+
});
|
|
184
|
+
},
|
|
185
|
+
(argv) => link(argv),
|
|
186
|
+
)
|
|
187
|
+
.command(
|
|
188
|
+
'unlink <name>',
|
|
189
|
+
'Remove a linked package',
|
|
190
|
+
(yargs) => {
|
|
191
|
+
yargs
|
|
192
|
+
.positional('name', {
|
|
193
|
+
type: 'string',
|
|
194
|
+
description: 'Package name to unlink',
|
|
195
|
+
demandOption: true,
|
|
196
|
+
})
|
|
197
|
+
.option('restore', {
|
|
198
|
+
type: 'boolean',
|
|
199
|
+
description: 'Re-download the package from registry after unlinking',
|
|
200
|
+
default: false,
|
|
201
|
+
})
|
|
202
|
+
.option('source', {
|
|
203
|
+
alias: 's',
|
|
204
|
+
type: 'string',
|
|
205
|
+
description: 'Base URL of a package source (for --restore)',
|
|
206
|
+
array: true,
|
|
207
|
+
})
|
|
208
|
+
.option('platform', {
|
|
209
|
+
type: 'string',
|
|
210
|
+
description: 'Target platform (for --restore)',
|
|
211
|
+
choices: ['win_x64', 'win_x86', 'linux_x64', 'linux_x86', 'osx_x64', 'osx_arm64'],
|
|
212
|
+
default: 'win_x64',
|
|
213
|
+
})
|
|
214
|
+
.option('timeout', {
|
|
215
|
+
type: 'number',
|
|
216
|
+
description: 'HTTP timeout in seconds (for --restore)',
|
|
217
|
+
default: 300,
|
|
218
|
+
});
|
|
219
|
+
},
|
|
220
|
+
(argv) => unlink(argv),
|
|
221
|
+
)
|
|
222
|
+
.demandCommand(1)
|
|
223
|
+
.strict()
|
|
224
|
+
.help()
|
|
225
|
+
.parse();
|
package/package.json
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "wyvrnpm",
|
|
3
|
-
"version": "1.2
|
|
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": "1.3.2",
|
|
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
|
+
}
|
package/src/commands/clean.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Removes the wyvrn_internal/ package cache directory and the wyvrn.lock file.
|
|
8
|
-
*
|
|
9
|
-
* @param {object} argv - Parsed yargs arguments.
|
|
10
|
-
* @param {string} argv.root - Project root directory.
|
|
11
|
-
* @param {string} argv.manifest - Path to the manifest file (used to locate wyvrn.lock).
|
|
12
|
-
* @returns {Promise<void>}
|
|
13
|
-
*/
|
|
14
|
-
async function clean(argv) {
|
|
15
|
-
const rootDir = path.resolve(argv.root);
|
|
16
|
-
const razerDir = path.join(rootDir, 'wyvrn_internal');
|
|
17
|
-
const lockPath = path.join(path.dirname(path.resolve(argv.manifest)), 'wyvrn.lock');
|
|
18
|
-
|
|
19
|
-
let removedAnything = false;
|
|
20
|
-
|
|
21
|
-
if (fs.existsSync(razerDir)) {
|
|
22
|
-
fs.rmSync(razerDir, { recursive: true, force: true });
|
|
23
|
-
console.log(`[wyvrn] Removed ${razerDir}`);
|
|
24
|
-
removedAnything = true;
|
|
25
|
-
} else {
|
|
26
|
-
console.log(`[wyvrn] Nothing to clean at ${razerDir}`);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (fs.existsSync(lockPath)) {
|
|
30
|
-
fs.unlinkSync(lockPath);
|
|
31
|
-
console.log(`[wyvrn] Removed ${lockPath}`);
|
|
32
|
-
removedAnything = true;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (!removedAnything) {
|
|
36
|
-
console.log('[wyvrn] Nothing to clean.');
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
module.exports = clean;
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Removes the wyvrn_internal/ package cache directory and the wyvrn.lock file.
|
|
8
|
+
*
|
|
9
|
+
* @param {object} argv - Parsed yargs arguments.
|
|
10
|
+
* @param {string} argv.root - Project root directory.
|
|
11
|
+
* @param {string} argv.manifest - Path to the manifest file (used to locate wyvrn.lock).
|
|
12
|
+
* @returns {Promise<void>}
|
|
13
|
+
*/
|
|
14
|
+
async function clean(argv) {
|
|
15
|
+
const rootDir = path.resolve(argv.root);
|
|
16
|
+
const razerDir = path.join(rootDir, 'wyvrn_internal');
|
|
17
|
+
const lockPath = path.join(path.dirname(path.resolve(argv.manifest)), 'wyvrn.lock');
|
|
18
|
+
|
|
19
|
+
let removedAnything = false;
|
|
20
|
+
|
|
21
|
+
if (fs.existsSync(razerDir)) {
|
|
22
|
+
fs.rmSync(razerDir, { recursive: true, force: true });
|
|
23
|
+
console.log(`[wyvrn] Removed ${razerDir}`);
|
|
24
|
+
removedAnything = true;
|
|
25
|
+
} else {
|
|
26
|
+
console.log(`[wyvrn] Nothing to clean at ${razerDir}`);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (fs.existsSync(lockPath)) {
|
|
30
|
+
fs.unlinkSync(lockPath);
|
|
31
|
+
console.log(`[wyvrn] Removed ${lockPath}`);
|
|
32
|
+
removedAnything = true;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (!removedAnything) {
|
|
36
|
+
console.log('[wyvrn] Nothing to clean.');
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
module.exports = clean;
|