codebuff 1.0.274 → 1.0.275
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-handlers/initialization-flow.d.ts +1 -0
- package/dist/cli-handlers/initialization-flow.js +24 -0
- package/dist/cli-handlers/initialization-flow.js.map +1 -0
- package/dist/cli-modules/command-processor.d.ts +12 -0
- package/dist/cli-modules/command-processor.js +129 -0
- package/dist/cli-modules/command-processor.js.map +1 -0
- package/dist/cli-modules/input-handler.d.ts +20 -0
- package/dist/cli-modules/input-handler.js +98 -0
- package/dist/cli-modules/input-handler.js.map +1 -0
- package/dist/cli-modules/readline-handler.d.ts +17 -0
- package/dist/cli-modules/readline-handler.js +134 -0
- package/dist/cli-modules/readline-handler.js.map +1 -0
- package/dist/cli-modules/signal-handler.d.ts +13 -0
- package/dist/cli-modules/signal-handler.js +69 -0
- package/dist/cli-modules/signal-handler.js.map +1 -0
- package/dist/cli-modules/types.d.ts +51 -0
- package/dist/cli-modules/types.js +3 -0
- package/dist/cli-modules/types.js.map +1 -0
- package/dist/cli-modules/websocket-handler.d.ts +16 -0
- package/dist/cli-modules/websocket-handler.js +53 -0
- package/dist/cli-modules/websocket-handler.js.map +1 -0
- package/dist/code-map/__mocks__/tree-sitter-typescript.d.ts +12 -0
- package/dist/code-map/__mocks__/tree-sitter-typescript.d.ts.map +1 -0
- package/dist/code-map/__mocks__/tree-sitter-typescript.js +14 -0
- package/dist/code-map/__mocks__/tree-sitter-typescript.js.map +1 -0
- package/dist/code-map/__mocks__/wasm-mock.d.ts +2 -0
- package/dist/code-map/__mocks__/wasm-mock.d.ts.map +1 -0
- package/dist/code-map/__mocks__/wasm-mock.js +3 -0
- package/dist/code-map/__mocks__/wasm-mock.js.map +1 -0
- package/dist/code-map/__tests__/parse.test.d.ts +2 -0
- package/dist/code-map/__tests__/parse.test.d.ts.map +1 -0
- package/dist/code-map/__tests__/parse.test.js +231 -0
- package/dist/code-map/__tests__/parse.test.js.map +1 -0
- package/dist/code-map/__tests__/test-langs/consumer.d.ts +2 -0
- package/dist/code-map/__tests__/test-langs/consumer.d.ts.map +1 -0
- package/dist/code-map/__tests__/test-langs/consumer.js +6 -0
- package/dist/code-map/__tests__/test-langs/consumer.js.map +1 -0
- package/dist/code-map/__tests__/test-langs/empty.d.ts +1 -0
- package/dist/code-map/__tests__/test-langs/empty.d.ts.map +1 -0
- package/dist/code-map/__tests__/test-langs/empty.js +2 -0
- package/dist/code-map/__tests__/test-langs/empty.js.map +1 -0
- package/dist/code-map/__tests__/test-langs/test.d.ts +12 -0
- package/dist/code-map/__tests__/test-langs/test.d.ts.map +1 -0
- package/dist/code-map/__tests__/test-langs/test.js +23 -0
- package/dist/code-map/__tests__/test-langs/test.js.map +1 -0
- package/dist/code-map/__tests__/test-langs/unused.d.ts +2 -0
- package/dist/code-map/__tests__/test-langs/unused.d.ts.map +1 -0
- package/dist/code-map/__tests__/test-langs/unused.js +7 -0
- package/dist/code-map/__tests__/test-langs/unused.js.map +1 -0
- package/dist/code-map/__tests__/test-langs/utils1.d.ts +2 -0
- package/dist/code-map/__tests__/test-langs/utils1.d.ts.map +1 -0
- package/dist/code-map/__tests__/test-langs/utils1.js +7 -0
- package/dist/code-map/__tests__/test-langs/utils1.js.map +1 -0
- package/dist/code-map/__tests__/test-langs/utils2.d.ts +2 -0
- package/dist/code-map/__tests__/test-langs/utils2.d.ts.map +1 -0
- package/dist/code-map/__tests__/test-langs/utils2.js +8 -0
- package/dist/code-map/__tests__/test-langs/utils2.js.map +1 -0
- package/dist/code-map/__tests__/tree-sitter-minimal.test.d.ts +2 -0
- package/dist/code-map/__tests__/tree-sitter-minimal.test.d.ts.map +1 -0
- package/dist/code-map/__tests__/tree-sitter-minimal.test.js +79 -0
- package/dist/code-map/__tests__/tree-sitter-minimal.test.js.map +1 -0
- package/dist/code-map/jest.config.d.ts +4 -0
- package/dist/code-map/jest.config.d.ts.map +1 -0
- package/dist/code-map/jest.config.js +18 -0
- package/dist/code-map/jest.config.js.map +1 -0
- package/dist/code-map/parse.test.d.ts +2 -0
- package/dist/code-map/parse.test.d.ts.map +1 -0
- package/dist/code-map/parse.test.js +218 -0
- package/dist/code-map/parse.test.js.map +1 -0
- package/dist/code-map/scripts/tree-sitter-test.cjs +27 -0
- package/dist/code-map/scripts/tree-sitter-test.cjs.map +1 -0
- package/dist/code-map/scripts/tree-sitter-test.d.cts +2 -0
- package/dist/code-map/scripts/tree-sitter-test.d.cts.map +1 -0
- package/dist/code-map/scripts/tree-sitter-test.d.ts +2 -0
- package/dist/code-map/scripts/tree-sitter-test.d.ts.map +1 -0
- package/dist/code-map/scripts/tree-sitter-test.js +54 -0
- package/dist/code-map/scripts/tree-sitter-test.js.map +1 -0
- package/dist/code-map/test-parser.d.ts +2 -0
- package/dist/code-map/test-parser.d.ts.map +1 -0
- package/dist/code-map/test-parser.js +42 -0
- package/dist/code-map/test-parser.js.map +1 -0
- package/dist/code-map/tsconfig.tsbuildinfo +1 -1
- package/dist/common/actions.d.ts +28 -28
- package/dist/common/bigquery/client.d.ts +15 -0
- package/dist/common/bigquery/client.js +265 -0
- package/dist/common/bigquery/client.js.map +1 -0
- package/dist/common/bigquery/schema.d.ts +55 -0
- package/dist/common/bigquery/schema.js +24 -0
- package/dist/common/bigquery/schema.js.map +1 -0
- package/dist/common/constants/tools.d.ts +1 -0
- package/dist/common/constants/tools.js +1 -0
- package/dist/common/constants/tools.js.map +1 -1
- package/dist/common/util/file-metadata.d.ts +9 -0
- package/dist/common/util/file-metadata.js +24 -0
- package/dist/common/util/file-metadata.js.map +1 -0
- package/dist/common/util/promise.js +1 -1
- package/dist/common/util/promise.js.map +1 -1
- package/dist/common/websockets/websocket-schema.d.ts +48 -48
- package/dist/index.js +2 -8
- package/dist/tool-handlers.js +3 -0
- package/dist/tool-handlers.js.map +1 -1
- package/dist/utils/tool-renderers.js +3 -0
- package/dist/utils/tool-renderers.js.map +1 -1
- package/package.json +1 -1
- package/dist/common/__tests__/project-file-tree.test.d.ts +0 -1
- package/dist/common/__tests__/project-file-tree.test.js +0 -251
- package/dist/common/__tests__/project-file-tree.test.js.map +0 -1
- package/dist/common/json-config/__tests__/__snapshots__/stringify-schema.test.js.snap +0 -119
- package/dist/common/util/process-stream.d.ts +0 -7
- package/dist/common/util/process-stream.js +0 -162
- package/dist/common/util/process-stream.js.map +0 -1
- package/dist/utils/__tests__/__snapshots__/background-process-manager.test.js.snap +0 -137
- package/dist/utils/__tests__/file-paths.test.d.ts +0 -1
- package/dist/utils/__tests__/file-paths.test.js +0 -37
- package/dist/utils/__tests__/file-paths.test.js.map +0 -1
- package/dist/utils/__tests__/path.test.d.ts +0 -1
- package/dist/utils/__tests__/path.test.js +0 -37
- package/dist/utils/__tests__/path.test.js.map +0 -1
- package/dist/utils/file-paths.d.ts +0 -9
- package/dist/utils/file-paths.js +0 -24
- package/dist/utils/file-paths.js.map +0 -1
- package/dist/utils/path.d.ts +0 -9
- package/dist/utils/path.js +0 -27
- package/dist/utils/path.js.map +0 -1
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
// Bun Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`getBackgroundProcessInfoString formats a running process correctly 1`] = `
|
|
4
|
-
"<background_process>
|
|
5
|
-
<process_id>123</process_id>
|
|
6
|
-
<command>npm test</command>
|
|
7
|
-
<start_time_utc>1970-01-01T00:00:01.000Z</start_time_utc>
|
|
8
|
-
<duration_ms>2000</duration_ms>
|
|
9
|
-
<stdout>test output</stdout>
|
|
10
|
-
<stderr>test error</stderr>
|
|
11
|
-
<status>running</status>
|
|
12
|
-
</background_process>"
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
exports[`getBackgroundProcessInfoString formats a completed process correctly 1`] = `
|
|
16
|
-
"<background_process>
|
|
17
|
-
<process_id>456</process_id>
|
|
18
|
-
<command>npm build</command>
|
|
19
|
-
<start_time_utc>1970-01-01T00:00:01.000Z</start_time_utc>
|
|
20
|
-
<duration_ms>1000</duration_ms>
|
|
21
|
-
<stdout>build successful</stdout>
|
|
22
|
-
<status>completed</status>
|
|
23
|
-
<exit_code>0</exit_code>
|
|
24
|
-
</background_process>"
|
|
25
|
-
`;
|
|
26
|
-
|
|
27
|
-
exports[`getBackgroundProcessInfoString formats an errored process correctly 1`] = `
|
|
28
|
-
"<background_process>
|
|
29
|
-
<process_id>789</process_id>
|
|
30
|
-
<command>invalid-command</command>
|
|
31
|
-
<start_time_utc>1970-01-01T00:00:01.000Z</start_time_utc>
|
|
32
|
-
<duration_ms>1500</duration_ms>
|
|
33
|
-
<stderr>command not found</stderr>
|
|
34
|
-
<status>error</status>
|
|
35
|
-
<exit_code>1</exit_code>
|
|
36
|
-
<signal_code>SIGTERM</signal_code>
|
|
37
|
-
</background_process>"
|
|
38
|
-
`;
|
|
39
|
-
|
|
40
|
-
exports[`getBackgroundProcessInfoString handles new output since last report 1`] = `
|
|
41
|
-
"<background_process>
|
|
42
|
-
<process_id>102</process_id>
|
|
43
|
-
<command>echo test</command>
|
|
44
|
-
<start_time_utc>1970-01-01T00:00:01.000Z</start_time_utc>
|
|
45
|
-
<duration_ms>1000</duration_ms>
|
|
46
|
-
<stdout>[PREVIOUS OUTPUT]
|
|
47
|
-
more output</stdout>
|
|
48
|
-
<status>completed</status>
|
|
49
|
-
</background_process>"
|
|
50
|
-
`;
|
|
51
|
-
|
|
52
|
-
exports[`getBackgroundProcessInfoString handles no new content 1`] = `
|
|
53
|
-
"<background_process>
|
|
54
|
-
<process_id>103</process_id>
|
|
55
|
-
<command>echo test</command>
|
|
56
|
-
<start_time_utc>1970-01-01T00:00:01.000Z</start_time_utc>
|
|
57
|
-
<duration_ms>1000</duration_ms>
|
|
58
|
-
<status>running</status>
|
|
59
|
-
</background_process>"
|
|
60
|
-
`;
|
|
61
|
-
|
|
62
|
-
exports[`getBackgroundProcessInfoString handles new stderr without when no previous stderr 1`] = `
|
|
63
|
-
"<background_process>
|
|
64
|
-
<process_id>104</process_id>
|
|
65
|
-
<command>echo test</command>
|
|
66
|
-
<start_time_utc>1970-01-01T00:00:01.000Z</start_time_utc>
|
|
67
|
-
<duration_ms>1000</duration_ms>
|
|
68
|
-
<stderr>new error</stderr>
|
|
69
|
-
<status>error</status>
|
|
70
|
-
</background_process>"
|
|
71
|
-
`;
|
|
72
|
-
|
|
73
|
-
exports[`getBackgroundProcessInfoString handles new stdout without when no previous stdout 1`] = `
|
|
74
|
-
"<background_process>
|
|
75
|
-
<process_id>105</process_id>
|
|
76
|
-
<command>echo test</command>
|
|
77
|
-
<start_time_utc>1970-01-01T00:00:01.000Z</start_time_utc>
|
|
78
|
-
<duration_ms>2000</duration_ms>
|
|
79
|
-
<stdout>first output</stdout>
|
|
80
|
-
<status>running</status>
|
|
81
|
-
</background_process>"
|
|
82
|
-
`;
|
|
83
|
-
|
|
84
|
-
exports[`getBackgroundProcessInfoString reports completed process with new stderr even if stdout unchanged 1`] = `
|
|
85
|
-
"<background_process>
|
|
86
|
-
<process_id>106</process_id>
|
|
87
|
-
<command>echo test</command>
|
|
88
|
-
<start_time_utc>1970-01-01T00:00:01.000Z</start_time_utc>
|
|
89
|
-
<duration_ms>1000</duration_ms>
|
|
90
|
-
<stderr>new error</stderr>
|
|
91
|
-
<status>completed</status>
|
|
92
|
-
</background_process>"
|
|
93
|
-
`;
|
|
94
|
-
|
|
95
|
-
exports[`getBackgroundProcessInfoString reports completed process with new stdout even if stderr unchanged 1`] = `
|
|
96
|
-
"<background_process>
|
|
97
|
-
<process_id>107</process_id>
|
|
98
|
-
<command>echo test</command>
|
|
99
|
-
<start_time_utc>1970-01-01T00:00:01.000Z</start_time_utc>
|
|
100
|
-
<duration_ms>1000</duration_ms>
|
|
101
|
-
<stdout>[PREVIOUS OUTPUT]
|
|
102
|
-
more</stdout>
|
|
103
|
-
<status>completed</status>
|
|
104
|
-
</background_process>"
|
|
105
|
-
`;
|
|
106
|
-
|
|
107
|
-
exports[`getBackgroundProcessInfoString reports process when status changes even without output changes 1`] = `
|
|
108
|
-
"<background_process>
|
|
109
|
-
<process_id>108</process_id>
|
|
110
|
-
<command>echo test</command>
|
|
111
|
-
<start_time_utc>1970-01-01T00:00:01.000Z</start_time_utc>
|
|
112
|
-
<duration_ms>1000</duration_ms>
|
|
113
|
-
<status>completed</status>
|
|
114
|
-
</background_process>"
|
|
115
|
-
`;
|
|
116
|
-
|
|
117
|
-
exports[`getBackgroundProcessInfoString calculates duration from endTime when available 1`] = `
|
|
118
|
-
"<background_process>
|
|
119
|
-
<process_id>109</process_id>
|
|
120
|
-
<command>echo test</command>
|
|
121
|
-
<start_time_utc>1970-01-01T00:00:01.000Z</start_time_utc>
|
|
122
|
-
<duration_ms>1500</duration_ms>
|
|
123
|
-
<stdout>test</stdout>
|
|
124
|
-
<status>completed</status>
|
|
125
|
-
</background_process>"
|
|
126
|
-
`;
|
|
127
|
-
|
|
128
|
-
exports[`getBackgroundProcessInfoString calculates duration from current time when no endTime 1`] = `
|
|
129
|
-
"<background_process>
|
|
130
|
-
<process_id>110</process_id>
|
|
131
|
-
<command>echo test</command>
|
|
132
|
-
<start_time_utc>1970-01-01T00:00:01.000Z</start_time_utc>
|
|
133
|
-
<duration_ms>2000</duration_ms>
|
|
134
|
-
<stdout>test</stdout>
|
|
135
|
-
<status>running</status>
|
|
136
|
-
</background_process>"
|
|
137
|
-
`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const file_paths_1 = require("../file-paths");
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
describe('toAbsolutePath', () => {
|
|
9
|
-
const projectRoot = '/home/user/project';
|
|
10
|
-
it('should handle relative paths', () => {
|
|
11
|
-
expect((0, file_paths_1.toAbsolutePath)('src/file.ts', projectRoot))
|
|
12
|
-
.toBe(path_1.default.normalize(path_1.default.join(projectRoot, 'src/file.ts')));
|
|
13
|
-
});
|
|
14
|
-
it('should handle parent directory references', () => {
|
|
15
|
-
expect((0, file_paths_1.toAbsolutePath)('../file.ts', projectRoot))
|
|
16
|
-
.toBe(path_1.default.normalize(path_1.default.join(path_1.default.dirname(projectRoot), 'file.ts')));
|
|
17
|
-
});
|
|
18
|
-
it('should handle current directory references', () => {
|
|
19
|
-
expect((0, file_paths_1.toAbsolutePath)('./file.ts', projectRoot))
|
|
20
|
-
.toBe(path_1.default.normalize(path_1.default.join(projectRoot, 'file.ts')));
|
|
21
|
-
});
|
|
22
|
-
it('should return absolute paths unchanged', () => {
|
|
23
|
-
const absolutePath = '/absolute/path/file.ts';
|
|
24
|
-
expect((0, file_paths_1.toAbsolutePath)(absolutePath, projectRoot))
|
|
25
|
-
.toBe(path_1.default.normalize(absolutePath));
|
|
26
|
-
});
|
|
27
|
-
it('should handle Windows-style paths', () => {
|
|
28
|
-
const winPath = 'src\\file.ts';
|
|
29
|
-
expect((0, file_paths_1.toAbsolutePath)(winPath, projectRoot))
|
|
30
|
-
.toBe(path_1.default.normalize(path_1.default.join(projectRoot, 'src/file.ts')));
|
|
31
|
-
});
|
|
32
|
-
it('should normalize paths with multiple slashes', () => {
|
|
33
|
-
expect((0, file_paths_1.toAbsolutePath)('src//file.ts', projectRoot))
|
|
34
|
-
.toBe(path_1.default.normalize(path_1.default.join(projectRoot, 'src/file.ts')));
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
//# sourceMappingURL=file-paths.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-paths.test.js","sourceRoot":"","sources":["../../../src/utils/__tests__/file-paths.test.ts"],"names":[],"mappings":";;;;;AAAA,8CAA8C;AAC9C,gDAAuB;AAEvB,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,MAAM,WAAW,GAAG,oBAAoB,CAAA;IAExC,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACtC,MAAM,CAAC,IAAA,2BAAc,EAAC,aAAa,EAAE,WAAW,CAAC,CAAC;aAC/C,IAAI,CAAC,cAAI,CAAC,SAAS,CAAC,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;IAChE,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACnD,MAAM,CAAC,IAAA,2BAAc,EAAC,YAAY,EAAE,WAAW,CAAC,CAAC;aAC9C,IAAI,CAAC,cAAI,CAAC,SAAS,CAAC,cAAI,CAAC,IAAI,CAAC,cAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;IAC1E,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QACpD,MAAM,CAAC,IAAA,2BAAc,EAAC,WAAW,EAAE,WAAW,CAAC,CAAC;aAC7C,IAAI,CAAC,cAAI,CAAC,SAAS,CAAC,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;IAC5D,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,YAAY,GAAG,wBAAwB,CAAA;QAC7C,MAAM,CAAC,IAAA,2BAAc,EAAC,YAAY,EAAE,WAAW,CAAC,CAAC;aAC9C,IAAI,CAAC,cAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAA;IACvC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC3C,MAAM,OAAO,GAAG,cAAc,CAAA;QAC9B,MAAM,CAAC,IAAA,2BAAc,EAAC,OAAO,EAAE,WAAW,CAAC,CAAC;aACzC,IAAI,CAAC,cAAI,CAAC,SAAS,CAAC,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;IAChE,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACtD,MAAM,CAAC,IAAA,2BAAc,EAAC,cAAc,EAAE,WAAW,CAAC,CAAC;aAChD,IAAI,CAAC,cAAI,CAAC,SAAS,CAAC,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;IAChE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const path_1 = require("../path");
|
|
7
|
-
const path_2 = __importDefault(require("path"));
|
|
8
|
-
describe('toAbsolutePath', () => {
|
|
9
|
-
const projectRoot = '/home/user/project';
|
|
10
|
-
it('should handle relative paths', () => {
|
|
11
|
-
expect((0, path_1.toAbsolutePath)('src/file.ts', projectRoot))
|
|
12
|
-
.toBe(path_2.default.normalize(path_2.default.join(projectRoot, 'src/file.ts')));
|
|
13
|
-
});
|
|
14
|
-
it('should handle parent directory references', () => {
|
|
15
|
-
expect((0, path_1.toAbsolutePath)('../file.ts', projectRoot))
|
|
16
|
-
.toBe(path_2.default.normalize(path_2.default.join(path_2.default.dirname(projectRoot), 'file.ts')));
|
|
17
|
-
});
|
|
18
|
-
it('should handle current directory references', () => {
|
|
19
|
-
expect((0, path_1.toAbsolutePath)('./file.ts', projectRoot))
|
|
20
|
-
.toBe(path_2.default.normalize(path_2.default.join(projectRoot, 'file.ts')));
|
|
21
|
-
});
|
|
22
|
-
it('should return absolute paths unchanged', () => {
|
|
23
|
-
const absolutePath = '/absolute/path/file.ts';
|
|
24
|
-
expect((0, path_1.toAbsolutePath)(absolutePath, projectRoot))
|
|
25
|
-
.toBe(path_2.default.normalize(absolutePath));
|
|
26
|
-
});
|
|
27
|
-
it('should handle Windows-style paths', () => {
|
|
28
|
-
const winPath = 'src\\file.ts';
|
|
29
|
-
expect((0, path_1.toAbsolutePath)(winPath, projectRoot))
|
|
30
|
-
.toBe(path_2.default.normalize(path_2.default.join(projectRoot, 'src/file.ts')));
|
|
31
|
-
});
|
|
32
|
-
it('should normalize paths with multiple slashes', () => {
|
|
33
|
-
expect((0, path_1.toAbsolutePath)('src//file.ts', projectRoot))
|
|
34
|
-
.toBe(path_2.default.normalize(path_2.default.join(projectRoot, 'src/file.ts')));
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
//# sourceMappingURL=path.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"path.test.js","sourceRoot":"","sources":["../../../src/utils/__tests__/path.test.ts"],"names":[],"mappings":";;;;;AAAA,kCAAwC;AACxC,gDAAuB;AAEvB,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,MAAM,WAAW,GAAG,oBAAoB,CAAA;IAExC,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACtC,MAAM,CAAC,IAAA,qBAAc,EAAC,aAAa,EAAE,WAAW,CAAC,CAAC;aAC/C,IAAI,CAAC,cAAI,CAAC,SAAS,CAAC,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;IAChE,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACnD,MAAM,CAAC,IAAA,qBAAc,EAAC,YAAY,EAAE,WAAW,CAAC,CAAC;aAC9C,IAAI,CAAC,cAAI,CAAC,SAAS,CAAC,cAAI,CAAC,IAAI,CAAC,cAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;IAC1E,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QACpD,MAAM,CAAC,IAAA,qBAAc,EAAC,WAAW,EAAE,WAAW,CAAC,CAAC;aAC7C,IAAI,CAAC,cAAI,CAAC,SAAS,CAAC,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC,CAAA;IAC5D,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,YAAY,GAAG,wBAAwB,CAAA;QAC7C,MAAM,CAAC,IAAA,qBAAc,EAAC,YAAY,EAAE,WAAW,CAAC,CAAC;aAC9C,IAAI,CAAC,cAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAA;IACvC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC3C,MAAM,OAAO,GAAG,cAAc,CAAA;QAC9B,MAAM,CAAC,IAAA,qBAAc,EAAC,OAAO,EAAE,WAAW,CAAC,CAAC;aACzC,IAAI,CAAC,cAAI,CAAC,SAAS,CAAC,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;IAChE,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACtD,MAAM,CAAC,IAAA,qBAAc,EAAC,cAAc,EAAE,WAAW,CAAC,CAAC;aAChD,IAAI,CAAC,cAAI,CAAC,SAAS,CAAC,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;IAChE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transforms a relative filepath into an absolute one, using the project root as the base.
|
|
3
|
-
* Handles '..' and '.' in paths correctly. Also handles Windows paths.
|
|
4
|
-
*
|
|
5
|
-
* @param filepath The relative filepath to transform
|
|
6
|
-
* @param projectRoot The absolute path to the project root
|
|
7
|
-
* @returns The absolute filepath
|
|
8
|
-
*/
|
|
9
|
-
export declare function toAbsolutePath(filepath: string, projectRoot: string): string;
|
package/dist/utils/file-paths.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.toAbsolutePath = toAbsolutePath;
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
/**
|
|
9
|
-
* Transforms a relative filepath into an absolute one, using the project root as the base.
|
|
10
|
-
* Handles '..' and '.' in paths correctly. Also handles Windows paths.
|
|
11
|
-
*
|
|
12
|
-
* @param filepath The relative filepath to transform
|
|
13
|
-
* @param projectRoot The absolute path to the project root
|
|
14
|
-
* @returns The absolute filepath
|
|
15
|
-
*/
|
|
16
|
-
function toAbsolutePath(filepath, projectRoot) {
|
|
17
|
-
// If already absolute, normalize and return
|
|
18
|
-
if (path_1.default.isAbsolute(filepath)) {
|
|
19
|
-
return path_1.default.normalize(filepath);
|
|
20
|
-
}
|
|
21
|
-
// Handle '..' at the start by resolving against project root
|
|
22
|
-
return path_1.default.normalize(path_1.default.resolve(projectRoot, filepath));
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=file-paths.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-paths.js","sourceRoot":"","sources":["../../src/utils/file-paths.ts"],"names":[],"mappings":";;;;;AAUA,wCAQC;AAlBD,gDAAuB;AAEvB;;;;;;;GAOG;AACH,SAAgB,cAAc,CAAC,QAAgB,EAAE,WAAmB;IAClE,4CAA4C;IAC5C,IAAI,cAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC9B,OAAO,cAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAA;IACjC,CAAC;IAED,6DAA6D;IAC7D,OAAO,cAAI,CAAC,SAAS,CAAC,cAAI,CAAC,OAAO,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAA;AAC5D,CAAC"}
|
package/dist/utils/path.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transforms a relative filepath into an absolute one, using the project root as the base.
|
|
3
|
-
* Handles '..' and '.' in paths correctly. Also handles Windows paths.
|
|
4
|
-
*
|
|
5
|
-
* @param filepath The relative filepath to transform
|
|
6
|
-
* @param projectRoot The absolute path to the project root
|
|
7
|
-
* @returns The absolute filepath
|
|
8
|
-
*/
|
|
9
|
-
export declare function toAbsolutePath(filepath: string, projectRoot: string): string;
|
package/dist/utils/path.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.toAbsolutePath = toAbsolutePath;
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
/**
|
|
9
|
-
* Transforms a relative filepath into an absolute one, using the project root as the base.
|
|
10
|
-
* Handles '..' and '.' in paths correctly. Also handles Windows paths.
|
|
11
|
-
*
|
|
12
|
-
* @param filepath The relative filepath to transform
|
|
13
|
-
* @param projectRoot The absolute path to the project root
|
|
14
|
-
* @returns The absolute filepath
|
|
15
|
-
*/
|
|
16
|
-
function toAbsolutePath(filepath, projectRoot) {
|
|
17
|
-
// If already absolute, normalize and return
|
|
18
|
-
if (path_1.default.isAbsolute(filepath)) {
|
|
19
|
-
return path_1.default.normalize(filepath);
|
|
20
|
-
}
|
|
21
|
-
// Handle Windows paths
|
|
22
|
-
const normalizedFilepath = filepath.replace(/\\/g, '/');
|
|
23
|
-
const normalizedProjectRoot = projectRoot.replace(/\\/g, '/');
|
|
24
|
-
// Handle '..' at the start by resolving against project root
|
|
25
|
-
return path_1.default.normalize(path_1.default.resolve(normalizedProjectRoot, normalizedFilepath));
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=path.js.map
|
package/dist/utils/path.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"path.js","sourceRoot":"","sources":["../../src/utils/path.ts"],"names":[],"mappings":";;;;;AAUA,wCAYC;AAtBD,gDAAuB;AAEvB;;;;;;;GAOG;AACH,SAAgB,cAAc,CAAC,QAAgB,EAAE,WAAmB;IAClE,4CAA4C;IAC5C,IAAI,cAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC9B,OAAO,cAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAA;IACjC,CAAC;IAED,uBAAuB;IACvB,MAAM,kBAAkB,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IACvD,MAAM,qBAAqB,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IAE7D,6DAA6D;IAC7D,OAAO,cAAI,CAAC,SAAS,CAAC,cAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,kBAAkB,CAAC,CAAC,CAAA;AAChF,CAAC"}
|