@glpkg/cli 0.2.3 → 0.3.10
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/dist/cli.js +14 -11
- package/dist/cli.js.map +1 -1
- package/dist/commands/cleanup-registry.d.ts +6 -0
- package/dist/commands/cleanup-registry.d.ts.map +1 -0
- package/dist/commands/cleanup-registry.js +27 -0
- package/dist/commands/cleanup-registry.js.map +1 -0
- package/dist/commands/config.js +126 -97
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/index.d.ts +2 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +7 -13
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/install.d.ts.map +1 -1
- package/dist/commands/install.js +98 -124
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/license.js +12 -18
- package/dist/commands/license.js.map +1 -1
- package/dist/commands/publish.d.ts.map +1 -1
- package/dist/commands/publish.js +126 -159
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/repo.js +79 -118
- package/dist/commands/repo.js.map +1 -1
- package/dist/commands/setup-registry.d.ts +6 -0
- package/dist/commands/setup-registry.d.ts.map +1 -0
- package/dist/commands/setup-registry.js +48 -0
- package/dist/commands/setup-registry.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -7
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Setup Registry Command - Generate .npmrc from glpkg config
|
|
3
|
+
*/
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
import * as fs from 'fs';
|
|
6
|
+
import * as path from 'path';
|
|
7
|
+
const NPMRC_MARKER = '# generated by glpkg - do not edit';
|
|
8
|
+
export const setupRegistryCommand = new Command('setup-registry')
|
|
9
|
+
.description('Generate .npmrc from glpkg scope/token configuration')
|
|
10
|
+
.action(() => {
|
|
11
|
+
try {
|
|
12
|
+
// Dynamic import to fail silently if @glpkg/core is not available
|
|
13
|
+
const { createTokenManager, createConfigManager } = require('@glpkg/core');
|
|
14
|
+
const tokenManager = createTokenManager();
|
|
15
|
+
const configManager = createConfigManager();
|
|
16
|
+
const token = tokenManager.resolveTokenOrNull();
|
|
17
|
+
if (!token) {
|
|
18
|
+
// No token configured, exit silently
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const scopes = configManager.getAllScopes();
|
|
22
|
+
if (!scopes || scopes.length === 0) {
|
|
23
|
+
// No scopes configured, exit silently
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
// Build .npmrc content
|
|
27
|
+
const lines = [NPMRC_MARKER];
|
|
28
|
+
for (const scope of scopes) {
|
|
29
|
+
const registryUrl = scope.registryUrl;
|
|
30
|
+
if (!registryUrl)
|
|
31
|
+
continue;
|
|
32
|
+
const normalizedScope = scope.scope.startsWith('@') ? scope.scope : `@${scope.scope}`;
|
|
33
|
+
// Add scope registry line
|
|
34
|
+
lines.push(`${normalizedScope}:registry=${registryUrl}`);
|
|
35
|
+
// Add auth token for the registry
|
|
36
|
+
// Convert https://gitlab.com/... to //gitlab.com/...
|
|
37
|
+
const authUrl = registryUrl.replace(/^https?:/, '');
|
|
38
|
+
lines.push(`${authUrl}:_authToken=${token}`);
|
|
39
|
+
}
|
|
40
|
+
// Write .npmrc to current directory
|
|
41
|
+
const npmrcPath = path.join(process.cwd(), '.npmrc');
|
|
42
|
+
fs.writeFileSync(npmrcPath, lines.join('\n') + '\n', 'utf-8');
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
// glpkg not configured or unavailable, exit silently
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=setup-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-registry.js","sourceRoot":"","sources":["../../src/commands/setup-registry.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EA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EzD,kCAAkC;YAClC,qDAAqD;YACrD,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;YACpD,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,eAAe,KAAK,EAAE,CAAC,CAAC;QAC/C,CAAC;QAED,oCAAoC;QACpC,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,CAAC;QACrD,EAAE,CAAC,aAAa,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;IAAC,MAAM,CAAC;QACP,qDAAqD;IACvD,CAAC;AACH,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @glpkg/cli - GitLab Package Manager CLI
|
|
3
3
|
*/
|
|
4
|
-
export { configCommand, installCommand, publishCommand } from './commands/index.js';
|
|
4
|
+
export { configCommand, installCommand, publishCommand, setupRegistryCommand, cleanupRegistryCommand } from './commands/index.js';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* @glpkg/cli - GitLab Package Manager CLI
|
|
4
3
|
*/
|
|
5
|
-
|
|
6
|
-
exports.publishCommand = exports.installCommand = exports.configCommand = void 0;
|
|
7
|
-
var index_js_1 = require("./commands/index.js");
|
|
8
|
-
Object.defineProperty(exports, "configCommand", { enumerable: true, get: function () { return index_js_1.configCommand; } });
|
|
9
|
-
Object.defineProperty(exports, "installCommand", { enumerable: true, get: function () { return index_js_1.installCommand; } });
|
|
10
|
-
Object.defineProperty(exports, "publishCommand", { enumerable: true, get: function () { return index_js_1.publishCommand; } });
|
|
4
|
+
export { configCommand, installCommand, publishCommand, setupRegistryCommand, cleanupRegistryCommand } from './commands/index.js';
|
|
11
5
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glpkg/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.10",
|
|
4
4
|
"description": "GitLab Package Manager CLI",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"main": "dist/index.js",
|
|
6
7
|
"types": "dist/index.d.ts",
|
|
7
8
|
"bin": {
|
|
@@ -42,7 +43,6 @@
|
|
|
42
43
|
"@glpkg/adapters.pypi": "^0.1.2",
|
|
43
44
|
"@glpkg/config": "^0.1.0",
|
|
44
45
|
"@glpkg/core": "^0.2.0",
|
|
45
|
-
"@glpkg/fallback": "^0.1.0",
|
|
46
46
|
"@glpkg/installer": "^0.1.0",
|
|
47
47
|
"@glpkg/publisher": "^0.1.0",
|
|
48
48
|
"chalk": "^4.1.2",
|