@opensumi/ide-file-search 2.12.1-next-079c1930
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/lib/common/file-search.d.ts +37 -0
- package/lib/common/file-search.d.ts.map +1 -0
- package/lib/common/file-search.js +6 -0
- package/lib/common/file-search.js.map +1 -0
- package/lib/common/index.d.ts +2 -0
- package/lib/common/index.d.ts.map +1 -0
- package/lib/common/index.js +5 -0
- package/lib/common/index.js.map +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +6 -0
- package/lib/index.js.map +1 -0
- package/lib/node/file-search.service.d.ts +12 -0
- package/lib/node/file-search.service.d.ts.map +1 -0
- package/lib/node/file-search.service.js +140 -0
- package/lib/node/file-search.service.js.map +1 -0
- package/lib/node/index.d.ts +13 -0
- package/lib/node/index.d.ts.map +1 -0
- package/lib/node/index.js +26 -0
- package/lib/node/index.js.map +1 -0
- package/package.json +29 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { CancellationToken } from '@opensumi/ide-core-common';
|
|
2
|
+
export declare const FileSearchServicePath = "FileSearchServicePath";
|
|
3
|
+
/**
|
|
4
|
+
* The JSON-RPC file search service interface.
|
|
5
|
+
*/
|
|
6
|
+
export interface IFileSearchService {
|
|
7
|
+
/**
|
|
8
|
+
* finds files by a given search pattern.
|
|
9
|
+
* @return the matching paths, relative to the given `options.rootUri`.
|
|
10
|
+
*/
|
|
11
|
+
find(searchPattern: string, options: IFileSearchService.Options, cancellationToken?: CancellationToken): Promise<string[]>;
|
|
12
|
+
}
|
|
13
|
+
export declare const IFileSearchService: unique symbol;
|
|
14
|
+
export declare namespace IFileSearchService {
|
|
15
|
+
interface BaseOptions {
|
|
16
|
+
useGitIgnore?: boolean;
|
|
17
|
+
noIgnoreParent?: boolean;
|
|
18
|
+
includePatterns?: string[];
|
|
19
|
+
excludePatterns?: string[];
|
|
20
|
+
}
|
|
21
|
+
interface RootOptions {
|
|
22
|
+
[rootUri: string]: BaseOptions;
|
|
23
|
+
}
|
|
24
|
+
interface Options extends BaseOptions {
|
|
25
|
+
rootUris?: string[];
|
|
26
|
+
rootOptions?: RootOptions;
|
|
27
|
+
fuzzyMatch?: boolean;
|
|
28
|
+
limit?: number;
|
|
29
|
+
/**
|
|
30
|
+
* when `undefined`, no excludes will apply, when empty array, default excludes will apply
|
|
31
|
+
*
|
|
32
|
+
* @deprecated since 0.5.0 use `excludePatterns` instead
|
|
33
|
+
*/
|
|
34
|
+
defaultIgnorePatterns?: string[];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=file-search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-search.d.ts","sourceRoot":"","sources":["../../src/common/file-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAEjC;;;OAGG;IACH,IAAI,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,CAAC,OAAO,EAAE,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CAE5H;AAED,eAAO,MAAM,kBAAkB,eAA8B,CAAC;AAE9D,yBAAiB,kBAAkB,CAAC;IAClC,UAAiB,WAAW;QAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;QAC3B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;KAC5B;IACD,UAAiB,WAAW;QAC1B,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,CAAC;KAChC;IACD,UAAiB,OAAQ,SAAQ,WAAW;QAC1C,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QACpB,WAAW,CAAC,EAAE,WAAW,CAAC;QAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf;;;;WAIG;QACH,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;KAClC;CACF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IFileSearchService = exports.FileSearchServicePath = void 0;
|
|
4
|
+
exports.FileSearchServicePath = 'FileSearchServicePath';
|
|
5
|
+
exports.IFileSearchService = Symbol('FileSearchService');
|
|
6
|
+
//# sourceMappingURL=file-search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-search.js","sourceRoot":"","sources":["../../src/common/file-search.ts"],"names":[],"mappings":";;;AAEa,QAAA,qBAAqB,GAAG,uBAAuB,CAAC;AAehD,QAAA,kBAAkB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;AAAA,6DAA8B"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
|
package/lib/index.js
ADDED
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,wDAAyB;AACzB,sDAAuB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CancellationToken } from '@opensumi/ide-core-common';
|
|
2
|
+
import { INodeLogger } from '@opensumi/ide-core-node';
|
|
3
|
+
import { IProcessFactory } from '@opensumi/ide-process';
|
|
4
|
+
import { IFileSearchService } from '../common';
|
|
5
|
+
export declare class FileSearchService implements IFileSearchService {
|
|
6
|
+
processFactory: IProcessFactory;
|
|
7
|
+
logger: INodeLogger;
|
|
8
|
+
find(searchPattern: string, options: IFileSearchService.Options, clientToken?: CancellationToken): Promise<string[]>;
|
|
9
|
+
private doFind;
|
|
10
|
+
private getSearchArgs;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=file-search.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-search.service.d.ts","sourceRoot":"","sources":["../../src/node/file-search.service.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAA8C,MAAM,2BAA2B,CAAC;AAC1G,OAAO,EAAgB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,qBACa,iBAAkB,YAAW,kBAAkB;IAG1D,cAAc,EAAE,eAAe,CAAC;IAGhC,MAAM,EAAE,WAAW,CAAC;IAEd,IAAI,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAqE1H,OAAO,CAAC,MAAM;IA0Bd,OAAO,CAAC,aAAa;CAyBtB"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileSearchService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const fuzzy_1 = (0, tslib_1.__importDefault)(require("fuzzy"));
|
|
6
|
+
const readline_1 = (0, tslib_1.__importDefault)(require("readline"));
|
|
7
|
+
const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
8
|
+
const vscode_ripgrep_1 = require("vscode-ripgrep");
|
|
9
|
+
const di_1 = require("@opensumi/di");
|
|
10
|
+
const ide_core_common_1 = require("@opensumi/ide-core-common");
|
|
11
|
+
const ide_core_node_1 = require("@opensumi/ide-core-node");
|
|
12
|
+
const ide_process_1 = require("@opensumi/ide-process");
|
|
13
|
+
let FileSearchService = class FileSearchService {
|
|
14
|
+
async find(searchPattern, options, clientToken) {
|
|
15
|
+
const cancellationSource = new ide_core_common_1.CancellationTokenSource();
|
|
16
|
+
if (clientToken) {
|
|
17
|
+
clientToken.onCancellationRequested(() => cancellationSource.cancel());
|
|
18
|
+
}
|
|
19
|
+
const token = cancellationSource.token;
|
|
20
|
+
const opts = Object.assign({ fuzzyMatch: true, limit: Number.MAX_SAFE_INTEGER, useGitIgnore: true }, options);
|
|
21
|
+
const roots = options.rootOptions || {};
|
|
22
|
+
if (options.rootUris) {
|
|
23
|
+
for (const rootUri of options.rootUris) {
|
|
24
|
+
if (!roots[rootUri]) {
|
|
25
|
+
roots[rootUri] = {};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
// tslint:disable-next-line:forin
|
|
30
|
+
for (const rootUri in roots) {
|
|
31
|
+
const rootOptions = roots[rootUri];
|
|
32
|
+
if (opts.includePatterns) {
|
|
33
|
+
const includePatterns = rootOptions.includePatterns || [];
|
|
34
|
+
rootOptions.includePatterns = [...includePatterns, ...opts.includePatterns];
|
|
35
|
+
}
|
|
36
|
+
if (opts.excludePatterns) {
|
|
37
|
+
const excludePatterns = rootOptions.excludePatterns || [];
|
|
38
|
+
rootOptions.excludePatterns = [...excludePatterns, ...opts.excludePatterns];
|
|
39
|
+
}
|
|
40
|
+
if (rootOptions.useGitIgnore === undefined) {
|
|
41
|
+
rootOptions.useGitIgnore = opts.useGitIgnore;
|
|
42
|
+
}
|
|
43
|
+
if (rootOptions.noIgnoreParent === undefined) {
|
|
44
|
+
rootOptions.noIgnoreParent = opts.noIgnoreParent;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const exactMatches = new Set();
|
|
48
|
+
const fuzzyMatches = new Set();
|
|
49
|
+
const stringPattern = searchPattern.toLocaleLowerCase();
|
|
50
|
+
await Promise.all(Object.keys(roots).map(async (root) => {
|
|
51
|
+
try {
|
|
52
|
+
const rootUri = new ide_core_node_1.URI(root);
|
|
53
|
+
const rootOptions = roots[root];
|
|
54
|
+
await this.doFind(rootUri, rootOptions, (candidate) => {
|
|
55
|
+
const fileUri = ide_core_node_1.FileUri.create(path_1.default.join(rootUri.codeUri.fsPath, candidate)).toString();
|
|
56
|
+
if (exactMatches.has(fileUri) || fuzzyMatches.has(fileUri)) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (!searchPattern || searchPattern === '*' || candidate.toLocaleLowerCase().indexOf(stringPattern) !== -1) {
|
|
60
|
+
exactMatches.add(fileUri);
|
|
61
|
+
}
|
|
62
|
+
else if (opts.fuzzyMatch && fuzzy_1.default.test(searchPattern, candidate)) {
|
|
63
|
+
fuzzyMatches.add(fileUri);
|
|
64
|
+
}
|
|
65
|
+
if (exactMatches.size + fuzzyMatches.size === opts.limit) {
|
|
66
|
+
cancellationSource.cancel();
|
|
67
|
+
}
|
|
68
|
+
}, token);
|
|
69
|
+
}
|
|
70
|
+
catch (e) {
|
|
71
|
+
// tslint:disable-next-line:no-console
|
|
72
|
+
console.error('Failed to search:', root, e);
|
|
73
|
+
}
|
|
74
|
+
}));
|
|
75
|
+
return [...exactMatches, ...fuzzyMatches];
|
|
76
|
+
}
|
|
77
|
+
doFind(rootUri, options, accept, token) {
|
|
78
|
+
return new Promise((resolve, reject) => {
|
|
79
|
+
try {
|
|
80
|
+
const cwd = ide_core_node_1.FileUri.fsPath(rootUri);
|
|
81
|
+
const args = this.getSearchArgs(options);
|
|
82
|
+
const process = this.processFactory.create({ command: (0, ide_core_common_1.replaceAsarInPath)(vscode_ripgrep_1.rgPath), args, options: { cwd } });
|
|
83
|
+
process.onError(reject);
|
|
84
|
+
process.outputStream.on('close', resolve);
|
|
85
|
+
const lineReader = readline_1.default.createInterface({
|
|
86
|
+
input: process.outputStream,
|
|
87
|
+
output: process.inputStream,
|
|
88
|
+
});
|
|
89
|
+
lineReader.on('line', (line) => {
|
|
90
|
+
if (token.isCancellationRequested) {
|
|
91
|
+
process.dispose();
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
accept(line);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
catch (e) {
|
|
99
|
+
reject(e);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
getSearchArgs(options) {
|
|
104
|
+
const args = ['--files', '--case-sensitive'];
|
|
105
|
+
if (options.includePatterns) {
|
|
106
|
+
for (const includePattern of options.includePatterns) {
|
|
107
|
+
if (includePattern) {
|
|
108
|
+
args.push('--glob', includePattern);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (options.excludePatterns) {
|
|
113
|
+
for (const excludePattern of options.excludePatterns) {
|
|
114
|
+
if (excludePattern) {
|
|
115
|
+
args.push('--glob', `!${excludePattern}`);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (!options.useGitIgnore) {
|
|
120
|
+
args.push('-uu');
|
|
121
|
+
}
|
|
122
|
+
if (options.noIgnoreParent) {
|
|
123
|
+
args.push('--no-ignore-parent');
|
|
124
|
+
}
|
|
125
|
+
return args;
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
(0, tslib_1.__decorate)([
|
|
129
|
+
(0, di_1.Autowired)(ide_process_1.IProcessFactory),
|
|
130
|
+
(0, tslib_1.__metadata)("design:type", Object)
|
|
131
|
+
], FileSearchService.prototype, "processFactory", void 0);
|
|
132
|
+
(0, tslib_1.__decorate)([
|
|
133
|
+
(0, di_1.Autowired)(ide_core_node_1.INodeLogger),
|
|
134
|
+
(0, tslib_1.__metadata)("design:type", Object)
|
|
135
|
+
], FileSearchService.prototype, "logger", void 0);
|
|
136
|
+
FileSearchService = (0, tslib_1.__decorate)([
|
|
137
|
+
(0, di_1.Injectable)()
|
|
138
|
+
], FileSearchService);
|
|
139
|
+
exports.FileSearchService = FileSearchService;
|
|
140
|
+
//# sourceMappingURL=file-search.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-search.service.js","sourceRoot":"","sources":["../../src/node/file-search.service.ts"],"names":[],"mappings":";;;;AAAA,+DAA0B;AAC1B,qEAAgC;AAChC,6DAAwB;AACxB,mDAAwC;AACxC,qCAAqD;AACrD,+DAA0G;AAC1G,2DAAoE;AACpE,uDAAwD;AAIxD,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;IAQ5B,KAAK,CAAC,IAAI,CAAC,aAAqB,EAAE,OAAmC,EAAE,WAA+B;QACpG,MAAM,kBAAkB,GAAG,IAAI,yCAAuB,EAAE,CAAC;QACzD,IAAI,WAAW,EAAE;YACf,WAAW,CAAC,uBAAuB,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC,CAAC;SACxE;QACD,MAAM,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC;QACvC,MAAM,IAAI,mBACR,UAAU,EAAE,IAAI,EAChB,KAAK,EAAE,MAAM,CAAC,gBAAgB,EAC9B,YAAY,EAAE,IAAI,IACf,OAAO,CACX,CAAC;QAEF,MAAM,KAAK,GAAmC,OAAO,CAAC,WAAW,IAAI,EAAE,CAAC;QACxE,IAAI,OAAO,CAAC,QAAQ,EAAE;YACpB,KAAK,MAAM,OAAO,IAAI,OAAO,CAAC,QAAQ,EAAE;gBACtC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE;oBACnB,KAAK,CAAC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CAAC,eAAe,EAAE;gBACpD,IAAI,cAAc,EAAE;oBAClB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,cAAc,EAAE,CAAC,CAAC;iBAC3C;aACF;SACF;QACD,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;YACzB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAClB;QACD,IAAI,OAAO,CAAC,cAAc,EAAE;YAC1B,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;SACjC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CAEF,CAAA;AA7HC;IADC,IAAA,cAAS,EAAC,6BAAe,CAAC;;yDACK;AAGhC;IADC,IAAA,cAAS,EAAC,2BAAW,CAAC;;iDACH;AANT,iBAAiB;IAD7B,IAAA,eAAU,GAAE;GACA,iBAAiB,CAgI7B;AAhIY,8CAAiB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { NodeModule } from '@opensumi/ide-core-node';
|
|
2
|
+
import { FileSearchService } from './file-search.service';
|
|
3
|
+
export declare class FileSearchModule extends NodeModule {
|
|
4
|
+
providers: {
|
|
5
|
+
token: symbol;
|
|
6
|
+
useClass: typeof FileSearchService;
|
|
7
|
+
}[];
|
|
8
|
+
backServices: {
|
|
9
|
+
token: symbol;
|
|
10
|
+
servicePath: string;
|
|
11
|
+
}[];
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG1D,qBACa,gBAAiB,SAAQ,UAAU;IAC9C,SAAS;;;QAGN;IAEH,YAAY;;;QAGT;CACJ"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileSearchModule = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const di_1 = require("@opensumi/di");
|
|
6
|
+
const ide_core_node_1 = require("@opensumi/ide-core-node");
|
|
7
|
+
const file_search_service_1 = require("./file-search.service");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
let FileSearchModule = class FileSearchModule extends ide_core_node_1.NodeModule {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.providers = [{
|
|
13
|
+
token: common_1.IFileSearchService,
|
|
14
|
+
useClass: file_search_service_1.FileSearchService,
|
|
15
|
+
}];
|
|
16
|
+
this.backServices = [{
|
|
17
|
+
token: common_1.IFileSearchService,
|
|
18
|
+
servicePath: common_1.FileSearchServicePath,
|
|
19
|
+
}];
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
FileSearchModule = (0, tslib_1.__decorate)([
|
|
23
|
+
(0, di_1.Injectable)()
|
|
24
|
+
], FileSearchModule);
|
|
25
|
+
exports.FileSearchModule = FileSearchModule;
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":";;;;AAAA,qCAA0C;AAC1C,2DAAqD;AACrD,+DAA0D;AAC1D,sCAAsE;AAGtE,IAAa,gBAAgB,GAA7B,MAAa,gBAAiB,SAAQ,0BAAU;IAAhD;;QACE,cAAS,GAAG,CAAC;gBACX,KAAK,EAAE,2BAAkB;gBACzB,QAAQ,EAAE,uCAAiB;aAC5B,CAAC,CAAC;QAEH,iBAAY,GAAG,CAAC;gBACd,KAAK,EAAE,2BAAkB;gBACzB,WAAW,EAAE,8BAAqB;aACnC,CAAC,CAAC;IACL,CAAC;CAAA,CAAA;AAVY,gBAAgB;IAD5B,IAAA,eAAU,GAAE;GACA,gBAAgB,CAU5B;AAVY,4CAAgB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@opensumi/ide-file-search",
|
|
3
|
+
"version": "2.12.1-next-079c1930",
|
|
4
|
+
"files": [
|
|
5
|
+
"lib"
|
|
6
|
+
],
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"main": "lib/index.js",
|
|
9
|
+
"typings": "lib/index.d.ts",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"prepublishOnly": "npm run build",
|
|
12
|
+
"build": "tsc --build ../../configs/ts/references/tsconfig.file-search.json"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git@github.com:opensumi/core.git"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@opensumi/ide-core-common": "2.12.1-next-079c1930",
|
|
20
|
+
"@opensumi/ide-core-node": "2.12.1-next-079c1930",
|
|
21
|
+
"@opensumi/ide-process": "2.12.1-next-079c1930",
|
|
22
|
+
"vscode-ripgrep": "^1.12.0",
|
|
23
|
+
"fuzzy": "^0.1.3"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@opensumi/ide-core-browser": "2.12.1-next-079c1930",
|
|
27
|
+
"@opensumi/ide-dev-tool": "^1.3.1"
|
|
28
|
+
}
|
|
29
|
+
}
|