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/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
- 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
- },
91
- (argv) => publish(argv),
92
- )
93
- .command(
94
- 'configure',
95
- 'Manage wyvrnpm configuration (sources, authentication)',
96
- (yargs) => {
97
- yargs
98
- .command('list', 'List all configured sources', () => {}, () => configure.list())
99
- .command(
100
- 'add-source',
101
- 'Add or update an install/publish source',
102
- (yargs) => {
103
- yargs
104
- .option('kind', {
105
- type: 'string',
106
- description: 'Source kind',
107
- choices: ['install', 'publish'],
108
- demandOption: true,
109
- })
110
- .option('name', {
111
- type: 'string',
112
- description: 'Unique name for this source',
113
- demandOption: true,
114
- })
115
- .option('url', {
116
- type: 'string',
117
- description: 'Source URL or URI (s3://, https://, UNC path, etc.)',
118
- demandOption: true,
119
- })
120
- .option('profile', {
121
- type: 'string',
122
- description: 'AWS SSO profile for this source (S3 only)',
123
- })
124
- .option('token', {
125
- type: 'string',
126
- description: 'Bearer token for this source (HTTP only)',
127
- });
128
- },
129
- (argv) => configure.addSource(argv),
130
- )
131
- .command(
132
- 'remove-source',
133
- 'Remove a configured source by name',
134
- (yargs) => {
135
- yargs
136
- .option('kind', {
137
- type: 'string',
138
- description: 'Source kind',
139
- choices: ['install', 'publish'],
140
- demandOption: true,
141
- })
142
- .option('name', {
143
- type: 'string',
144
- description: 'Name of the source to remove',
145
- demandOption: true,
146
- });
147
- },
148
- (argv) => configure.removeSource(argv),
149
- )
150
- .demandCommand(1)
151
- .help();
152
- },
153
- () => {},
154
- )
155
- .demandCommand(1)
156
- .strict()
157
- .help()
158
- .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 { 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.0",
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
+ }
@@ -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;