@cleocode/worktree 2026.5.124 → 2026.5.126
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 +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/napi-binding.d.ts +64 -9
- package/dist/napi-binding.d.ts.map +1 -1
- package/dist/napi-binding.js +114 -11
- package/dist/napi-binding.js.map +1 -1
- package/dist/worktree-create.d.ts.map +1 -1
- package/dist/worktree-create.js +66 -2
- package/dist/worktree-create.js.map +1 -1
- package/dist/worktree-destroy.d.ts.map +1 -1
- package/dist/worktree-destroy.js +17 -0
- package/dist/worktree-destroy.js.map +1 -1
- package/dist/worktree-include.d.ts +17 -22
- package/dist/worktree-include.d.ts.map +1 -1
- package/dist/worktree-include.js +67 -33
- package/dist/worktree-include.js.map +1 -1
- package/dist/worktree-migrate.d.ts +68 -0
- package/dist/worktree-migrate.d.ts.map +1 -0
- package/dist/worktree-migrate.js +146 -0
- package/dist/worktree-migrate.js.map +1 -0
- package/dist/worktree-pnpm.d.ts +34 -0
- package/dist/worktree-pnpm.d.ts.map +1 -0
- package/dist/worktree-pnpm.js +127 -0
- package/dist/worktree-pnpm.js.map +1 -0
- package/dist/worktree-prune.d.ts.map +1 -1
- package/dist/worktree-prune.js +28 -6
- package/dist/worktree-prune.js.map +1 -1
- package/native/worktree-napi.cjs +57 -0
- package/native/worktree-napi.darwin-arm64.node +0 -0
- package/native/worktree-napi.linux-arm64-gnu.node +0 -0
- package/native/worktree-napi.linux-x64-gnu.node +0 -0
- package/native/worktree-napi.win32-x64-msvc.node +0 -0
- package/package.json +6 -14
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
// Copyright (c) 2026 kryptobaseddev
|
|
3
|
+
//
|
|
4
|
+
// Native-addon loader for @cleocode/worktree-napi.
|
|
5
|
+
//
|
|
6
|
+
// Resolution order:
|
|
7
|
+
// 1. A `worktree-napi.<triple>.node` file co-located with this loader.
|
|
8
|
+
// Release publishing copies this loader and the built .node files into
|
|
9
|
+
// @cleocode/worktree/native so the existing @cleocode/worktree trusted
|
|
10
|
+
// publisher owns the whole native distribution.
|
|
11
|
+
//
|
|
12
|
+
// If the co-located binary is unavailable we throw a descriptive error pointing
|
|
13
|
+
// at the missing bundled path and local build command.
|
|
14
|
+
|
|
15
|
+
const { existsSync } = require('node:fs');
|
|
16
|
+
const { join } = require('node:path');
|
|
17
|
+
|
|
18
|
+
function tripleName() {
|
|
19
|
+
const { platform, arch } = process;
|
|
20
|
+
if (platform === 'linux' && arch === 'x64') return 'linux-x64-gnu';
|
|
21
|
+
if (platform === 'linux' && arch === 'arm64') return 'linux-arm64-gnu';
|
|
22
|
+
if (platform === 'darwin' && arch === 'arm64') return 'darwin-arm64';
|
|
23
|
+
if (platform === 'darwin' && arch === 'x64') {
|
|
24
|
+
throw new Error(
|
|
25
|
+
'@cleocode/worktree-napi: macOS x64 prebuilds are not published. ' +
|
|
26
|
+
'Use an arm64 Node.js runtime on Apple Silicon or build locally with ' +
|
|
27
|
+
'`pnpm dlx @napi-rs/cli@3 build --release` inside `crates/worktree-napi/`.'
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
if (platform === 'win32' && arch === 'x64') return 'win32-x64-msvc';
|
|
31
|
+
throw new Error(
|
|
32
|
+
`@cleocode/worktree-napi: unsupported platform/arch ${platform}/${arch}`
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const triple = tripleName();
|
|
37
|
+
const localPath = join(__dirname, `worktree-napi.${triple}.node`);
|
|
38
|
+
|
|
39
|
+
let nativeBinding;
|
|
40
|
+
|
|
41
|
+
if (existsSync(localPath)) {
|
|
42
|
+
nativeBinding = require(localPath);
|
|
43
|
+
} else {
|
|
44
|
+
throw new Error(
|
|
45
|
+
`@cleocode/worktree-napi: missing native binding for ${triple} at ${localPath}. ` +
|
|
46
|
+
`The @cleocode/worktree package must include \`native/worktree-napi.${triple}.node\`; ` +
|
|
47
|
+
`for local development, run \`pnpm dlx @napi-rs/cli@3 build --release\` inside ` +
|
|
48
|
+
`\`crates/worktree-napi/\` and rename the output to \`worktree-napi.${triple}.node\`.`
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Static named-export re-binding so Node.js can detect the export shape
|
|
53
|
+
// when this CJS module is imported from an ESM consumer (e.g. compiled
|
|
54
|
+
// @cleocode/worktree under "type": "module"). Without this, ESM named
|
|
55
|
+
// imports like `import { copyPathsParallel } from './native/worktree-napi.cjs'`
|
|
56
|
+
// throw "does not provide an export named ..." at module link time.
|
|
57
|
+
module.exports = nativeBinding;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cleocode/worktree",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.126",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
|
-
"description": "Native CLEO worktree backend SDK
|
|
6
|
+
"description": "Native CLEO worktree backend SDK",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"types": "./dist/index.d.ts",
|
|
12
|
-
"import": "./dist/index.js"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
9
|
"files": [
|
|
16
10
|
"dist/",
|
|
11
|
+
"native/",
|
|
17
12
|
"README.md"
|
|
18
13
|
],
|
|
19
14
|
"keywords": [
|
|
@@ -30,17 +25,14 @@
|
|
|
30
25
|
"author": "CLEO Code <hello@cleocode.dev>",
|
|
31
26
|
"license": "MIT",
|
|
32
27
|
"dependencies": {
|
|
33
|
-
"@cleocode/contracts": "2026.5.
|
|
34
|
-
"@cleocode/paths": "2026.5.
|
|
35
|
-
},
|
|
36
|
-
"optionalDependencies": {
|
|
37
|
-
"@cleocode/worktree-napi": "2026.5.124"
|
|
28
|
+
"@cleocode/contracts": "2026.5.126",
|
|
29
|
+
"@cleocode/paths": "2026.5.126"
|
|
38
30
|
},
|
|
39
31
|
"devDependencies": {
|
|
40
32
|
"@types/node": "^24.3.0",
|
|
41
33
|
"typescript": "^6.0.2",
|
|
42
34
|
"vitest": "^4.1.4",
|
|
43
|
-
"@cleocode/core": "2026.5.
|
|
35
|
+
"@cleocode/core": "2026.5.126"
|
|
44
36
|
},
|
|
45
37
|
"repository": {
|
|
46
38
|
"type": "git",
|