@unlimitechcloud/devlink 1.0.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/AGENTS.md +880 -0
- package/LICENSE +21 -0
- package/README.md +335 -0
- package/dist/__tests__/e2e.spec.d.ts +8 -0
- package/dist/__tests__/e2e.spec.d.ts.map +1 -0
- package/dist/__tests__/e2e.spec.js +253 -0
- package/dist/__tests__/e2e.spec.js.map +1 -0
- package/dist/__tests__/integration.spec.d.ts +8 -0
- package/dist/__tests__/integration.spec.d.ts.map +1 -0
- package/dist/__tests__/integration.spec.js +274 -0
- package/dist/__tests__/integration.spec.js.map +1 -0
- package/dist/cli.d.ts +6 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +610 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/consumers.d.ts +37 -0
- package/dist/commands/consumers.d.ts.map +1 -0
- package/dist/commands/consumers.js +107 -0
- package/dist/commands/consumers.js.map +1 -0
- package/dist/commands/docs.d.ts +59 -0
- package/dist/commands/docs.d.ts.map +1 -0
- package/dist/commands/docs.js +262 -0
- package/dist/commands/docs.js.map +1 -0
- package/dist/commands/docs.spec.d.ts +5 -0
- package/dist/commands/docs.spec.d.ts.map +1 -0
- package/dist/commands/docs.spec.js +213 -0
- package/dist/commands/docs.spec.js.map +1 -0
- package/dist/commands/index.d.ts +13 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +13 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/install.d.ts +31 -0
- package/dist/commands/install.d.ts.map +1 -0
- package/dist/commands/install.js +234 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/list.d.ts +22 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +45 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/list.spec.d.ts +5 -0
- package/dist/commands/list.spec.d.ts.map +1 -0
- package/dist/commands/list.spec.js +95 -0
- package/dist/commands/list.spec.js.map +1 -0
- package/dist/commands/prune.d.ts +27 -0
- package/dist/commands/prune.d.ts.map +1 -0
- package/dist/commands/prune.js +74 -0
- package/dist/commands/prune.js.map +1 -0
- package/dist/commands/publish.d.ts +16 -0
- package/dist/commands/publish.d.ts.map +1 -0
- package/dist/commands/publish.js +225 -0
- package/dist/commands/publish.js.map +1 -0
- package/dist/commands/publish.spec.d.ts +5 -0
- package/dist/commands/publish.spec.d.ts.map +1 -0
- package/dist/commands/publish.spec.js +98 -0
- package/dist/commands/publish.spec.js.map +1 -0
- package/dist/commands/push.d.ts +16 -0
- package/dist/commands/push.d.ts.map +1 -0
- package/dist/commands/push.js +164 -0
- package/dist/commands/push.js.map +1 -0
- package/dist/commands/remove.d.ts +24 -0
- package/dist/commands/remove.d.ts.map +1 -0
- package/dist/commands/remove.js +80 -0
- package/dist/commands/remove.js.map +1 -0
- package/dist/commands/remove.spec.d.ts +5 -0
- package/dist/commands/remove.spec.d.ts.map +1 -0
- package/dist/commands/remove.spec.js +87 -0
- package/dist/commands/remove.spec.js.map +1 -0
- package/dist/commands/resolve.d.ts +20 -0
- package/dist/commands/resolve.d.ts.map +1 -0
- package/dist/commands/resolve.js +52 -0
- package/dist/commands/resolve.js.map +1 -0
- package/dist/commands/resolve.spec.d.ts +5 -0
- package/dist/commands/resolve.spec.d.ts.map +1 -0
- package/dist/commands/resolve.spec.js +87 -0
- package/dist/commands/resolve.spec.js.map +1 -0
- package/dist/commands/verify.d.ts +32 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +127 -0
- package/dist/commands/verify.js.map +1 -0
- package/dist/config.d.ts +22 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +70 -0
- package/dist/config.js.map +1 -0
- package/dist/constants.d.ts +65 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +116 -0
- package/dist/constants.js.map +1 -0
- package/dist/constants.spec.d.ts +5 -0
- package/dist/constants.spec.d.ts.map +1 -0
- package/dist/constants.spec.js +72 -0
- package/dist/constants.spec.js.map +1 -0
- package/dist/core/index.d.ts +9 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +9 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/installations.d.ts +79 -0
- package/dist/core/installations.d.ts.map +1 -0
- package/dist/core/installations.js +207 -0
- package/dist/core/installations.js.map +1 -0
- package/dist/core/installations.spec.d.ts +5 -0
- package/dist/core/installations.spec.d.ts.map +1 -0
- package/dist/core/installations.spec.js +261 -0
- package/dist/core/installations.spec.js.map +1 -0
- package/dist/core/lock.d.ts +37 -0
- package/dist/core/lock.d.ts.map +1 -0
- package/dist/core/lock.js +198 -0
- package/dist/core/lock.js.map +1 -0
- package/dist/core/lock.spec.d.ts +5 -0
- package/dist/core/lock.spec.d.ts.map +1 -0
- package/dist/core/lock.spec.js +161 -0
- package/dist/core/lock.spec.js.map +1 -0
- package/dist/core/registry.d.ts +80 -0
- package/dist/core/registry.d.ts.map +1 -0
- package/dist/core/registry.js +231 -0
- package/dist/core/registry.js.map +1 -0
- package/dist/core/registry.spec.d.ts +5 -0
- package/dist/core/registry.spec.d.ts.map +1 -0
- package/dist/core/registry.spec.js +281 -0
- package/dist/core/registry.spec.js.map +1 -0
- package/dist/core/resolver.d.ts +55 -0
- package/dist/core/resolver.d.ts.map +1 -0
- package/dist/core/resolver.js +127 -0
- package/dist/core/resolver.js.map +1 -0
- package/dist/core/resolver.spec.d.ts +5 -0
- package/dist/core/resolver.spec.d.ts.map +1 -0
- package/dist/core/resolver.spec.js +202 -0
- package/dist/core/resolver.spec.js.map +1 -0
- package/dist/core/store.d.ts +65 -0
- package/dist/core/store.d.ts.map +1 -0
- package/dist/core/store.js +245 -0
- package/dist/core/store.js.map +1 -0
- package/dist/core/store.spec.d.ts +5 -0
- package/dist/core/store.spec.d.ts.map +1 -0
- package/dist/core/store.spec.js +195 -0
- package/dist/core/store.spec.js.map +1 -0
- package/dist/formatters/flat.d.ts +41 -0
- package/dist/formatters/flat.d.ts.map +1 -0
- package/dist/formatters/flat.js +131 -0
- package/dist/formatters/flat.js.map +1 -0
- package/dist/formatters/flat.spec.d.ts +5 -0
- package/dist/formatters/flat.spec.d.ts.map +1 -0
- package/dist/formatters/flat.spec.js +130 -0
- package/dist/formatters/flat.spec.js.map +1 -0
- package/dist/formatters/index.d.ts +6 -0
- package/dist/formatters/index.d.ts.map +1 -0
- package/dist/formatters/index.js +6 -0
- package/dist/formatters/index.js.map +1 -0
- package/dist/formatters/tree.d.ts +29 -0
- package/dist/formatters/tree.d.ts.map +1 -0
- package/dist/formatters/tree.js +256 -0
- package/dist/formatters/tree.js.map +1 -0
- package/dist/formatters/tree.spec.d.ts +5 -0
- package/dist/formatters/tree.spec.d.ts.map +1 -0
- package/dist/formatters/tree.spec.js +127 -0
- package/dist/formatters/tree.spec.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/installer.d.ts +13 -0
- package/dist/installer.d.ts.map +1 -0
- package/dist/installer.js +171 -0
- package/dist/installer.js.map +1 -0
- package/dist/store.d.ts +78 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +344 -0
- package/dist/store.js.map +1 -0
- package/dist/types.d.ts +235 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/docs/README.md +68 -0
- package/docs/inspection/consumers.md +178 -0
- package/docs/inspection/list.md +182 -0
- package/docs/inspection/resolve.md +172 -0
- package/docs/installation/configuration.md +238 -0
- package/docs/installation/install.md +184 -0
- package/docs/maintenance/prune.md +159 -0
- package/docs/maintenance/remove.md +174 -0
- package/docs/maintenance/verify.md +174 -0
- package/docs/publishing/publish.md +146 -0
- package/docs/publishing/push.md +146 -0
- package/docs/store/locking.md +118 -0
- package/docs/store/namespaces.md +141 -0
- package/docs/store/structure.md +163 -0
- package/package.json +58 -0
package/dist/config.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Config - Carga y gestión de configuración
|
|
3
|
+
*/
|
|
4
|
+
import fs from "fs/promises";
|
|
5
|
+
import path from "path";
|
|
6
|
+
/**
|
|
7
|
+
* Crea el contexto para las factories
|
|
8
|
+
*/
|
|
9
|
+
export function createContext(packages) {
|
|
10
|
+
return {
|
|
11
|
+
env: process.env,
|
|
12
|
+
args: process.argv.slice(2),
|
|
13
|
+
cwd: process.cwd(),
|
|
14
|
+
packages,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Detecta el modo basado en la configuración o defaults
|
|
19
|
+
*/
|
|
20
|
+
export function detectMode(config, ctx) {
|
|
21
|
+
if (config.detectMode) {
|
|
22
|
+
return config.detectMode(ctx);
|
|
23
|
+
}
|
|
24
|
+
// Detección por defecto
|
|
25
|
+
if (ctx.env.SST_LOCAL === "true")
|
|
26
|
+
return "dev";
|
|
27
|
+
if (ctx.env.NODE_ENV === "development")
|
|
28
|
+
return "dev";
|
|
29
|
+
if (ctx.args.includes("--dev"))
|
|
30
|
+
return "dev";
|
|
31
|
+
if (ctx.args.includes("--mode=dev"))
|
|
32
|
+
return "dev";
|
|
33
|
+
return "prod";
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Carga y normaliza la configuración
|
|
37
|
+
*/
|
|
38
|
+
export async function loadConfig(configPath) {
|
|
39
|
+
const absolutePath = path.isAbsolute(configPath)
|
|
40
|
+
? configPath
|
|
41
|
+
: path.resolve(process.cwd(), configPath);
|
|
42
|
+
try {
|
|
43
|
+
await fs.access(absolutePath);
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
throw new Error(`Configuration file not found: ${absolutePath}`);
|
|
47
|
+
}
|
|
48
|
+
// Importar configuración (soporta .mjs, .cjs, .js)
|
|
49
|
+
const imported = await import(absolutePath);
|
|
50
|
+
const config = imported.default || imported;
|
|
51
|
+
// Validar configuración
|
|
52
|
+
if (!config.packages || typeof config.packages !== "object") {
|
|
53
|
+
throw new Error("Configuration must have a 'packages' object");
|
|
54
|
+
}
|
|
55
|
+
if (typeof config.dev !== "function") {
|
|
56
|
+
throw new Error("Configuration must have a 'dev' factory function");
|
|
57
|
+
}
|
|
58
|
+
if (typeof config.prod !== "function") {
|
|
59
|
+
throw new Error("Configuration must have a 'prod' factory function");
|
|
60
|
+
}
|
|
61
|
+
// Crear contexto
|
|
62
|
+
const ctx = createContext(config.packages);
|
|
63
|
+
// Detectar modo
|
|
64
|
+
const mode = detectMode(config, ctx);
|
|
65
|
+
// Obtener configuración del modo
|
|
66
|
+
const modeFactory = mode === "dev" ? config.dev : config.prod;
|
|
67
|
+
const modeConfig = modeFactory(ctx);
|
|
68
|
+
return { config, ctx, mode, modeConfig };
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AAQxB;;GAEG;AACH,MAAM,UAAU,aAAa,CAC3B,QAAyC;IAEzC,OAAO;QACL,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3B,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QAClB,QAAQ;KACT,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CACxB,MAAqB,EACrB,GAAmB;IAEnB,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QACtB,OAAO,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;IAED,wBAAwB;IACxB,IAAI,GAAG,CAAC,GAAG,CAAC,SAAS,KAAK,MAAM;QAAE,OAAO,KAAK,CAAC;IAC/C,I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AAC;IACvE,CAAC;IAED,iBAAiB;IACjB,MAAM,GAAG,GAAG,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAE3C,gBAAgB;IAChB,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAErC,iCAAiC;IACjC,MAAM,WAAW,GAAG,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;IAC9D,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAEpC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants - Paths y valores por defecto
|
|
3
|
+
*/
|
|
4
|
+
export declare const STORE_DIR_NAME = ".devlink";
|
|
5
|
+
export declare const REGISTRY_FILE = "registry.json";
|
|
6
|
+
export declare const INSTALLATIONS_FILE = "installations.json";
|
|
7
|
+
export declare const LOCK_FILE = ".lock";
|
|
8
|
+
export declare const SIGNATURE_FILE = "devlink.sig";
|
|
9
|
+
export declare const IGNORE_FILE = ".devlinkignore";
|
|
10
|
+
export declare const LOCKFILE_NAME = "devlink.lock";
|
|
11
|
+
export declare const NAMESPACES_DIR = "namespaces";
|
|
12
|
+
export declare const DEFAULT_NAMESPACE = "global";
|
|
13
|
+
export declare const DEFAULT_LOCK_TIMEOUT = 30000;
|
|
14
|
+
export declare const DEFAULT_LOCK_RETRY_INTERVAL = 100;
|
|
15
|
+
export declare const DEFAULT_LOCK_STALE_TIME = 10000;
|
|
16
|
+
export declare const DEFAULT_CONFIG_FILES: string[];
|
|
17
|
+
export declare const REGISTRY_VERSION = "1.0.0";
|
|
18
|
+
export declare const INSTALLATIONS_VERSION = "1.0.0";
|
|
19
|
+
export declare const DEVLINK_REPO_ENV = "DEVLINK_REPO";
|
|
20
|
+
/**
|
|
21
|
+
* Set custom repo path for the current process
|
|
22
|
+
*/
|
|
23
|
+
export declare function setRepoPath(repoPath: string): void;
|
|
24
|
+
/**
|
|
25
|
+
* Get the current repo path (custom or default)
|
|
26
|
+
*/
|
|
27
|
+
export declare function getRepoPath(): string | null;
|
|
28
|
+
/**
|
|
29
|
+
* Clear custom repo path (for testing)
|
|
30
|
+
*/
|
|
31
|
+
export declare function clearRepoPath(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Get the default store path (home directory)
|
|
34
|
+
*/
|
|
35
|
+
export declare function getDefaultStorePath(): string;
|
|
36
|
+
/**
|
|
37
|
+
* Get the store base path
|
|
38
|
+
* Priority: 1. Custom repo path (--repo), 2. DEVLINK_REPO env, 3. Default (~/.devlink)
|
|
39
|
+
*/
|
|
40
|
+
export declare function getStorePath(): string;
|
|
41
|
+
/**
|
|
42
|
+
* Get the namespaces directory path
|
|
43
|
+
*/
|
|
44
|
+
export declare function getNamespacesPath(): string;
|
|
45
|
+
/**
|
|
46
|
+
* Get the path for a specific namespace
|
|
47
|
+
*/
|
|
48
|
+
export declare function getNamespacePath(namespace: string): string;
|
|
49
|
+
/**
|
|
50
|
+
* Get the path for a specific package in a namespace
|
|
51
|
+
*/
|
|
52
|
+
export declare function getPackagePath(namespace: string, packageName: string, version: string): string;
|
|
53
|
+
/**
|
|
54
|
+
* Get the registry file path
|
|
55
|
+
*/
|
|
56
|
+
export declare function getRegistryPath(): string;
|
|
57
|
+
/**
|
|
58
|
+
* Get the installations file path
|
|
59
|
+
*/
|
|
60
|
+
export declare function getInstallationsPath(): string;
|
|
61
|
+
/**
|
|
62
|
+
* Get the lock file path
|
|
63
|
+
*/
|
|
64
|
+
export declare function getLockPath(): string;
|
|
65
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,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H,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAEpC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants - Paths y valores por defecto
|
|
3
|
+
*/
|
|
4
|
+
import { homedir } from "os";
|
|
5
|
+
import path from "path";
|
|
6
|
+
// Store paths
|
|
7
|
+
export const STORE_DIR_NAME = ".devlink";
|
|
8
|
+
export const REGISTRY_FILE = "registry.json";
|
|
9
|
+
export const INSTALLATIONS_FILE = "installations.json";
|
|
10
|
+
export const LOCK_FILE = ".lock";
|
|
11
|
+
export const SIGNATURE_FILE = "devlink.sig";
|
|
12
|
+
export const IGNORE_FILE = ".devlinkignore";
|
|
13
|
+
export const LOCKFILE_NAME = "devlink.lock";
|
|
14
|
+
export const NAMESPACES_DIR = "namespaces";
|
|
15
|
+
// Default namespace
|
|
16
|
+
export const DEFAULT_NAMESPACE = "global";
|
|
17
|
+
// Lock options
|
|
18
|
+
export const DEFAULT_LOCK_TIMEOUT = 30000; // 30 seconds
|
|
19
|
+
export const DEFAULT_LOCK_RETRY_INTERVAL = 100; // 100ms
|
|
20
|
+
export const DEFAULT_LOCK_STALE_TIME = 10000; // 10 seconds
|
|
21
|
+
// Config file names (in order of priority)
|
|
22
|
+
export const DEFAULT_CONFIG_FILES = [
|
|
23
|
+
"devlink.config.mjs",
|
|
24
|
+
"devlink.config.js",
|
|
25
|
+
"devlink.config.cjs",
|
|
26
|
+
];
|
|
27
|
+
// Registry version
|
|
28
|
+
export const REGISTRY_VERSION = "1.0.0";
|
|
29
|
+
export const INSTALLATIONS_VERSION = "1.0.0";
|
|
30
|
+
// Environment variable for custom repo path
|
|
31
|
+
export const DEVLINK_REPO_ENV = "DEVLINK_REPO";
|
|
32
|
+
/**
|
|
33
|
+
* Custom repo path (set via --repo flag or DEVLINK_REPO env)
|
|
34
|
+
* This allows multiple repos to coexist
|
|
35
|
+
*/
|
|
36
|
+
let customRepoPath = null;
|
|
37
|
+
/**
|
|
38
|
+
* Set custom repo path for the current process
|
|
39
|
+
*/
|
|
40
|
+
export function setRepoPath(repoPath) {
|
|
41
|
+
customRepoPath = path.resolve(repoPath);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get the current repo path (custom or default)
|
|
45
|
+
*/
|
|
46
|
+
export function getRepoPath() {
|
|
47
|
+
return customRepoPath;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Clear custom repo path (for testing)
|
|
51
|
+
*/
|
|
52
|
+
export function clearRepoPath() {
|
|
53
|
+
customRepoPath = null;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Get the default store path (home directory)
|
|
57
|
+
*/
|
|
58
|
+
export function getDefaultStorePath() {
|
|
59
|
+
if (process.platform === "win32" && process.env.LOCALAPPDATA) {
|
|
60
|
+
return path.join(process.env.LOCALAPPDATA, "DevLink");
|
|
61
|
+
}
|
|
62
|
+
return path.join(homedir(), STORE_DIR_NAME);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Get the store base path
|
|
66
|
+
* Priority: 1. Custom repo path (--repo), 2. DEVLINK_REPO env, 3. Default (~/.devlink)
|
|
67
|
+
*/
|
|
68
|
+
export function getStorePath() {
|
|
69
|
+
// 1. Custom repo path set via setRepoPath()
|
|
70
|
+
if (customRepoPath) {
|
|
71
|
+
return customRepoPath;
|
|
72
|
+
}
|
|
73
|
+
// 2. Environment variable
|
|
74
|
+
if (process.env[DEVLINK_REPO_ENV]) {
|
|
75
|
+
return path.resolve(process.env[DEVLINK_REPO_ENV]);
|
|
76
|
+
}
|
|
77
|
+
// 3. Default path
|
|
78
|
+
return getDefaultStorePath();
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Get the namespaces directory path
|
|
82
|
+
*/
|
|
83
|
+
export function getNamespacesPath() {
|
|
84
|
+
return path.join(getStorePath(), NAMESPACES_DIR);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Get the path for a specific namespace
|
|
88
|
+
*/
|
|
89
|
+
export function getNamespacePath(namespace) {
|
|
90
|
+
return path.join(getNamespacesPath(), namespace);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Get the path for a specific package in a namespace
|
|
94
|
+
*/
|
|
95
|
+
export function getPackagePath(namespace, packageName, version) {
|
|
96
|
+
return path.join(getNamespacePath(namespace), packageName, version);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Get the registry file path
|
|
100
|
+
*/
|
|
101
|
+
export function getRegistryPath() {
|
|
102
|
+
return path.join(getStorePath(), REGISTRY_FILE);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Get the installations file path
|
|
106
|
+
*/
|
|
107
|
+
export function getInstallationsPath() {
|
|
108
|
+
return path.join(getStorePath(), INSTALLATIONS_FILE);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Get the lock file path
|
|
112
|
+
*/
|
|
113
|
+
export function getLockPath() {
|
|
114
|
+
return path.join(getStorePath(), LOCK_FILE);
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,cAAc;AACd,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;AACzC,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC;AAC7C,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AACvD,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAAC;AACjC,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC;AAC5C,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAgB,C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9C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.spec.d.ts","sourceRoot":"","sources":["../src/constants.spec.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants - Unit tests
|
|
3
|
+
*/
|
|
4
|
+
import { describe, it, expect, beforeEach, afterEach } from "vitest";
|
|
5
|
+
import path from "path";
|
|
6
|
+
import os from "os";
|
|
7
|
+
import { setRepoPath, getRepoPath, clearRepoPath, getStorePath, getDefaultStorePath, DEVLINK_REPO_ENV, STORE_DIR_NAME, } from "./constants.js";
|
|
8
|
+
describe("Constants", () => {
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
clearRepoPath();
|
|
11
|
+
delete process.env[DEVLINK_REPO_ENV];
|
|
12
|
+
});
|
|
13
|
+
afterEach(() => {
|
|
14
|
+
clearRepoPath();
|
|
15
|
+
delete process.env[DEVLINK_REPO_ENV];
|
|
16
|
+
});
|
|
17
|
+
describe("getDefaultStorePath", () => {
|
|
18
|
+
it("should return path in home directory", () => {
|
|
19
|
+
const result = getDefaultStorePath();
|
|
20
|
+
if (process.platform === "win32" && process.env.LOCALAPPDATA) {
|
|
21
|
+
expect(result).toBe(path.join(process.env.LOCALAPPDATA, "DevLink"));
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
expect(result).toBe(path.join(os.homedir(), STORE_DIR_NAME));
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
describe("setRepoPath / getRepoPath", () => {
|
|
29
|
+
it("should set and get custom repo path", () => {
|
|
30
|
+
setRepoPath("/custom/path");
|
|
31
|
+
expect(getRepoPath()).toBe("/custom/path");
|
|
32
|
+
});
|
|
33
|
+
it("should resolve relative paths", () => {
|
|
34
|
+
setRepoPath("./relative/path");
|
|
35
|
+
expect(getRepoPath()).toBe(path.resolve("./relative/path"));
|
|
36
|
+
});
|
|
37
|
+
it("should return null when not set", () => {
|
|
38
|
+
expect(getRepoPath()).toBeNull();
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
describe("clearRepoPath", () => {
|
|
42
|
+
it("should clear custom repo path", () => {
|
|
43
|
+
setRepoPath("/custom/path");
|
|
44
|
+
clearRepoPath();
|
|
45
|
+
expect(getRepoPath()).toBeNull();
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
describe("getStorePath", () => {
|
|
49
|
+
it("should return default path when nothing is set", () => {
|
|
50
|
+
const result = getStorePath();
|
|
51
|
+
expect(result).toBe(getDefaultStorePath());
|
|
52
|
+
});
|
|
53
|
+
it("should return custom repo path when set", () => {
|
|
54
|
+
setRepoPath("/custom/repo");
|
|
55
|
+
expect(getStorePath()).toBe("/custom/repo");
|
|
56
|
+
});
|
|
57
|
+
it("should return env var path when set", () => {
|
|
58
|
+
process.env[DEVLINK_REPO_ENV] = "/env/repo";
|
|
59
|
+
expect(getStorePath()).toBe("/env/repo");
|
|
60
|
+
});
|
|
61
|
+
it("should prioritize custom repo over env var", () => {
|
|
62
|
+
process.env[DEVLINK_REPO_ENV] = "/env/repo";
|
|
63
|
+
setRepoPath("/custom/repo");
|
|
64
|
+
expect(getStorePath()).toBe("/custom/repo");
|
|
65
|
+
});
|
|
66
|
+
it("should resolve relative env var paths", () => {
|
|
67
|
+
process.env[DEVLINK_REPO_ENV] = "./relative/env";
|
|
68
|
+
expect(getStorePath()).toBe(path.resolve("./relative/env"));
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
//# sourceMappingURL=constants.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.spec.js","sourceRoot":"","sources":["../src/constants.spec.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,IAAI,MAA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CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;YACpD,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,GAAG,WAAW,CAAC;YAC5C,WAAW,CAAC,cAAc,CAAC,CAAC;YAC5B,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;YAC/C,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,GAAG,gBAAgB,CAAC;YACjD,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAC9D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Installations - Tracking de proyectos consumidores
|
|
3
|
+
*/
|
|
4
|
+
import type { Installations, ProjectEntry, InstalledPackage } from "../types.js";
|
|
5
|
+
/**
|
|
6
|
+
* Create empty installations
|
|
7
|
+
*/
|
|
8
|
+
export declare function createEmptyInstallations(): Installations;
|
|
9
|
+
/**
|
|
10
|
+
* Read installations from disk
|
|
11
|
+
* Returns empty installations if file doesn't exist
|
|
12
|
+
*/
|
|
13
|
+
export declare function readInstallations(): Promise<Installations>;
|
|
14
|
+
/**
|
|
15
|
+
* Write installations to disk (atomic write)
|
|
16
|
+
*/
|
|
17
|
+
export declare function writeInstallations(installations: Installations): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Normalize project path for consistent keys
|
|
20
|
+
*/
|
|
21
|
+
export declare function normalizeProjectPath(projectPath: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Register or update a project's installed packages
|
|
24
|
+
*/
|
|
25
|
+
export declare function registerProject(installations: Installations, projectPath: string, packages: Record<string, InstalledPackage>): void;
|
|
26
|
+
/**
|
|
27
|
+
* Update a single package in a project
|
|
28
|
+
*/
|
|
29
|
+
export declare function updateProjectPackage(installations: Installations, projectPath: string, packageName: string, info: InstalledPackage): void;
|
|
30
|
+
/**
|
|
31
|
+
* Unregister a project completely
|
|
32
|
+
*/
|
|
33
|
+
export declare function unregisterProject(installations: Installations, projectPath: string): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Remove a package from a project
|
|
36
|
+
*/
|
|
37
|
+
export declare function removePackageFromProject(installations: Installations, projectPath: string, packageName: string): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Get all projects that consume a specific package
|
|
40
|
+
*/
|
|
41
|
+
export declare function getConsumers(installations: Installations, packageName: string, options?: {
|
|
42
|
+
namespace?: string;
|
|
43
|
+
version?: string;
|
|
44
|
+
}): {
|
|
45
|
+
projectPath: string;
|
|
46
|
+
info: InstalledPackage;
|
|
47
|
+
}[];
|
|
48
|
+
/**
|
|
49
|
+
* Get all consumers in a specific namespace
|
|
50
|
+
*/
|
|
51
|
+
export declare function getConsumersByNamespace(installations: Installations, namespace: string): {
|
|
52
|
+
projectPath: string;
|
|
53
|
+
packages: Record<string, InstalledPackage>;
|
|
54
|
+
}[];
|
|
55
|
+
/**
|
|
56
|
+
* Prune dead projects (projects that no longer exist on disk)
|
|
57
|
+
* Returns list of removed project paths
|
|
58
|
+
*/
|
|
59
|
+
export declare function pruneDeadProjects(installations: Installations): Promise<string[]>;
|
|
60
|
+
/**
|
|
61
|
+
* Get all registered projects
|
|
62
|
+
*/
|
|
63
|
+
export declare function getAllProjects(installations: Installations): string[];
|
|
64
|
+
/**
|
|
65
|
+
* Get project entry
|
|
66
|
+
*/
|
|
67
|
+
export declare function getProject(installations: Installations, projectPath: string): ProjectEntry | null;
|
|
68
|
+
/**
|
|
69
|
+
* Get total project count
|
|
70
|
+
*/
|
|
71
|
+
export declare function getTotalProjectCount(installations: Installations): number;
|
|
72
|
+
/**
|
|
73
|
+
* Get all unique packages across all projects
|
|
74
|
+
*/
|
|
75
|
+
export declare function getAllInstalledPackages(installations: Installations): {
|
|
76
|
+
packageName: string;
|
|
77
|
+
consumers: number;
|
|
78
|
+
}[];
|
|
79
|
+
//# sourceMappingURL=installations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installations.d.ts","sourceRoot":"","sources":["../../src/core/installations.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAOjF;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,aAAa,CAKxD;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,aAAa,CAAC,CAYhE;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAWpF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,aAAa,EAAE,aAAa,EAC5B,WA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