@docker-harpoon/monorepo 0.1.2 → 0.1.4
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/index.d.ts.map +1 -1
- package/dist/strategies/monorepo-simulation.d.ts.map +1 -1
- package/dist/strategies/monorepo-simulation.js +3 -6
- package/dist/transformers/monorepo.d.ts.map +1 -1
- package/dist/utils/process.d.ts +20 -0
- package/dist/utils/process.d.ts.map +1 -0
- package/dist/utils/process.js +38 -0
- package/package.json +8 -9
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EACV,YAAY,EAOb,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAI9E,MAAM,WAAW,sBAAsB;IACrC,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,wGAAwG;IACxG,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/B;AAID;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,sBAAsB,GAC9B,YAAY,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EACV,YAAY,EAOb,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAI9E,MAAM,WAAW,sBAAsB;IACrC,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,wGAAwG;IACxG,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/B;AAID;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,sBAAsB,GAC9B,YAAY,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAsErC;AAID;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CAkB9C;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monorepo-simulation.d.ts","sourceRoot":"","sources":["../../src/strategies/monorepo-simulation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAoC,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"monorepo-simulation.d.ts","sourceRoot":"","sources":["../../src/strategies/monorepo-simulation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAoC,MAAM,sBAAsB,CAAC;AAkG5F;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,EAAE,aA+FxC,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
|
|
@@ -8,6 +8,7 @@ import { Effect } from 'effect';
|
|
|
8
8
|
import * as path from 'path';
|
|
9
9
|
import * as fs from 'fs/promises';
|
|
10
10
|
import { BuildStrategyError } from '@docker-harpoon/core';
|
|
11
|
+
import { execCommand } from '../utils/process';
|
|
11
12
|
// ============ Configuration ============
|
|
12
13
|
/**
|
|
13
14
|
* Default shared folders to copy from monorepo source.
|
|
@@ -23,12 +24,8 @@ const DEFAULT_ROOT_FILES = ['package.json'];
|
|
|
23
24
|
* Recursively copy a directory.
|
|
24
25
|
*/
|
|
25
26
|
async function copyRecursive(src, dest) {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
stderr: 'inherit',
|
|
29
|
-
});
|
|
30
|
-
const exitCode = await proc.exited;
|
|
31
|
-
if (exitCode !== 0) {
|
|
27
|
+
const result = await execCommand('cp', ['-R', src, dest]);
|
|
28
|
+
if (result.exitCode !== 0) {
|
|
32
29
|
throw new Error(`Failed to copy ${src} to ${dest}`);
|
|
33
30
|
}
|
|
34
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monorepo.d.ts","sourceRoot":"","sources":["../../src/transformers/monorepo.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"monorepo.d.ts","sourceRoot":"","sources":["../../src/transformers/monorepo.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,sBAAsB,EAGvB,MAAM,sBAAsB,CAAC;AAK9B;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,EAAE,sBAsB1C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,sBA4BxC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,EAAE,sBAiBzC,CAAC;AAIF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,sBAAsB,EAIhE,CAAC;AAEH,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-Runtime Process Utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides process execution utilities that work with Node.js, Bun, and Deno.
|
|
5
|
+
* Uses Node.js child_process module which is compatible across all major runtimes.
|
|
6
|
+
*/
|
|
7
|
+
export interface SpawnResult {
|
|
8
|
+
exitCode: number;
|
|
9
|
+
stdout: string;
|
|
10
|
+
stderr: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Execute a command and capture output.
|
|
14
|
+
* Works with Node.js, Bun, and Deno (via Node compat).
|
|
15
|
+
*/
|
|
16
|
+
export declare function execCommand(command: string, args: string[], options?: {
|
|
17
|
+
captureStdout?: boolean;
|
|
18
|
+
captureStderr?: boolean;
|
|
19
|
+
}): Promise<SpawnResult>;
|
|
20
|
+
//# sourceMappingURL=process.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../src/utils/process.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,GAAE;IACP,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;CACpB,GACL,OAAO,CAAC,WAAW,CAAC,CA6BtB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-Runtime Process Utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides process execution utilities that work with Node.js, Bun, and Deno.
|
|
5
|
+
* Uses Node.js child_process module which is compatible across all major runtimes.
|
|
6
|
+
*/
|
|
7
|
+
import { spawn } from 'child_process';
|
|
8
|
+
/**
|
|
9
|
+
* Execute a command and capture output.
|
|
10
|
+
* Works with Node.js, Bun, and Deno (via Node compat).
|
|
11
|
+
*/
|
|
12
|
+
export function execCommand(command, args, options = {}) {
|
|
13
|
+
return new Promise((resolve, reject) => {
|
|
14
|
+
const proc = spawn(command, args, {
|
|
15
|
+
stdio: [
|
|
16
|
+
'ignore',
|
|
17
|
+
options.captureStdout ? 'pipe' : 'ignore',
|
|
18
|
+
options.captureStderr ? 'pipe' : 'inherit',
|
|
19
|
+
],
|
|
20
|
+
});
|
|
21
|
+
let stdout = '';
|
|
22
|
+
let stderr = '';
|
|
23
|
+
if (proc.stdout) {
|
|
24
|
+
proc.stdout.on('data', (data) => {
|
|
25
|
+
stdout += data.toString();
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
if (proc.stderr) {
|
|
29
|
+
proc.stderr.on('data', (data) => {
|
|
30
|
+
stderr += data.toString();
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
proc.on('error', reject);
|
|
34
|
+
proc.on('close', (exitCode) => {
|
|
35
|
+
resolve({ exitCode: exitCode ?? 1, stdout, stderr });
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docker-harpoon/monorepo",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"license": "MIT",
|
|
3
|
+
"version": "0.1.4",
|
|
5
4
|
"description": "Monorepo binding for Harpoon - package-manager agnostic build context simulation",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
6
9
|
"type": "module",
|
|
7
10
|
"main": "./dist/index.js",
|
|
8
11
|
"types": "./dist/index.d.ts",
|
|
@@ -12,18 +15,14 @@
|
|
|
12
15
|
"import": "./dist/index.js"
|
|
13
16
|
}
|
|
14
17
|
},
|
|
15
|
-
"files": [
|
|
16
|
-
"dist"
|
|
17
|
-
],
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "
|
|
20
|
-
"typecheck": "
|
|
19
|
+
"build": "tsgo",
|
|
20
|
+
"typecheck": "tsgo --noEmit"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"effect": "^3.19.14"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@docker-harpoon/core": ">=0.1.
|
|
27
|
-
"bun": ">=1.0.0"
|
|
26
|
+
"@docker-harpoon/core": ">=0.1.3"
|
|
28
27
|
}
|
|
29
28
|
}
|