vzcode 3.1.0 → 3.3.0
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/README.md +185 -40
- package/dist/assets/App-C9mRI7eH.js +387 -0
- package/dist/assets/App-CxiKy3Rs.css +1 -0
- package/dist/assets/bindings_wasm_bg-IWNG_AjZ.wasm +0 -0
- package/dist/assets/buildWorker-N5tFTOqM.js +794 -0
- package/dist/assets/index-COLyIkCc.js +43 -0
- package/dist/assets/index-CZT-v4sH.css +1 -0
- package/dist/assets/rolldown-runtime-COiEfhsA.js +1 -0
- package/dist/assets/worker-BpV7Ustv.js +223 -0
- package/dist/assets/worker-CLeezw6h.js +458 -0
- package/dist/assets/worker-DaSIYBQX.js +327 -0
- package/dist/cli.js +170 -99
- package/dist/index.html +3 -2
- package/dist/server/accessControl.js +104 -0
- package/dist/server/computeInitialDocument.js +4 -1
- package/dist/server/createServer.js +356 -104
- package/dist/server/index.js +4 -3
- package/dist/server/workspaceSecurity.js +115 -0
- package/dist/server/workspaceSync.js +141 -0
- package/package.json +74 -72
- package/src/cli.ts +203 -182
- package/src/client/App/index.tsx +2 -0
- package/src/client/App/usePending.ts +3 -1
- package/src/client/CodeEditor/style.scss +18 -11
- package/src/client/RunCodeWidget/index.tsx +1 -0
- package/src/client/TabList/Tab.tsx +13 -5
- package/src/client/TabList/style.scss +32 -5
- package/src/client/VZCodeContext/types.ts +6 -0
- package/src/client/VZCodeContext/useVZCodeState.ts +2 -0
- package/src/client/VZResizer/styles.scss +1 -1
- package/src/client/VZSidebar/AIChatWrapper.tsx +2 -0
- package/src/client/VZSidebar/DeleteConfirmationModal.tsx +1 -1
- package/src/client/VZSidebar/Item.tsx +8 -4
- package/src/client/VZSidebar/VisualEditor/CheckboxWidget.tsx +22 -30
- package/src/client/VZSidebar/VisualEditor/ColorWidget.tsx +198 -126
- package/src/client/VZSidebar/VisualEditor/DropdownWidget.tsx +25 -67
- package/src/client/VZSidebar/VisualEditor/PropertySection.tsx +41 -0
- package/src/client/VZSidebar/VisualEditor/SegmentedWidget.tsx +34 -0
- package/src/client/VZSidebar/VisualEditor/SliderWidget.tsx +60 -12
- package/src/client/VZSidebar/VisualEditor/VisualEditor.tsx +31 -393
- package/src/client/VZSidebar/VisualEditor/VisualEditorControls.tsx +478 -0
- package/src/client/VZSidebar/VisualEditor/colorUtils.ts +12 -0
- package/src/client/VZSidebar/VisualEditor/status.ts +47 -0
- package/src/client/VZSidebar/VisualEditor/updateConfig.ts +51 -24
- package/src/client/VZSidebar/VisualEditor/utils.ts +1 -1
- package/src/client/VZSidebar/index.tsx +55 -23
- package/src/client/VZSidebar/styles.scss +426 -6
- package/src/client/WorkspaceConflictBanner.tsx +120 -0
- package/src/client/index.ts +2 -0
- package/src/client/main.jsx +54 -12
- package/src/client/ui.scss +156 -4
- package/src/client/ui.tsx +1 -1
- package/src/llm-streaming-server/README.md +4 -16
- package/src/llm-streaming-ui/README.md +41 -2
- package/src/llm-streaming-ui/components/ChatInput.tsx +65 -13
- package/src/llm-streaming-ui/components/index.tsx +2 -0
- package/src/llm-streaming-ui/components/styles.scss +46 -0
- package/src/llm-streaming-ui/hooks/useAutoScroll.ts +1 -1
- package/src/llm-streaming-ui/index.ts +1 -0
- package/src/llm-streaming-ui/props.ts +26 -2
- package/src/server/accessControl.ts +151 -0
- package/src/server/computeInitialDocument.ts +6 -2
- package/src/server/createServer.ts +487 -138
- package/src/server/index.ts +4 -5
- package/src/server/workspaceSecurity.ts +160 -0
- package/src/server/workspaceSync.ts +203 -0
- package/src/types.ts +29 -27
- package/dist/assets/bindings_wasm_bg-9w8E-TmY.wasm +0 -0
- package/dist/assets/buildWorker-BZlya278.js +0 -687
- package/dist/assets/index-5qf102c2.css +0 -1
- package/dist/assets/index-dSJDl5x9.js +0 -356
- package/dist/assets/worker-1oQYaz-F.js +0 -342
- package/dist/assets/worker-BfgPD8zR.js +0 -125
- package/dist/assets/worker-CoJaqtpi.js +0 -436
package/dist/cli.js
CHANGED
|
@@ -1,111 +1,182 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { spawn } from 'child_process';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
2
|
+
import { spawn } from 'node:child_process';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
import open from 'open';
|
|
7
|
+
import { createVZCodeServer } from './server/createServer.js';
|
|
8
|
+
const DEFAULT_PORT = 3030;
|
|
9
|
+
const HOST = '127.0.0.1';
|
|
10
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
11
|
+
const usage = [
|
|
12
|
+
'VZCode - Multiplayer Code Editor',
|
|
13
|
+
'',
|
|
14
|
+
'Usage: vzcode [directory] [options]',
|
|
15
|
+
'',
|
|
16
|
+
'Starts the browser editor for a local workspace (defaults to ".").',
|
|
17
|
+
'',
|
|
18
|
+
'Options:',
|
|
19
|
+
' --help, -h Show this help message',
|
|
20
|
+
' --browser Use the browser editor (the default)',
|
|
21
|
+
' --desktop Launch a locally built Tauri application (experimental)',
|
|
22
|
+
' --no-open Start the server without opening a browser',
|
|
23
|
+
' --port=<port> HTTP/WebSocket port (default: 3030)',
|
|
24
|
+
' --port <port> Equivalent to --port=<port>',
|
|
25
|
+
'',
|
|
26
|
+
'Examples:',
|
|
27
|
+
' vzcode .',
|
|
28
|
+
' vzcode ./my-project --port=4000',
|
|
29
|
+
' vzcode --no-open',
|
|
30
|
+
'',
|
|
31
|
+
'VZCode listens on 127.0.0.1 only. Do not expose its unauthenticated',
|
|
32
|
+
'workspace editing server to untrusted networks.',
|
|
33
|
+
].join('\n');
|
|
34
|
+
function parsePort(value) {
|
|
35
|
+
if (!/^\d+$/.test(value)) {
|
|
36
|
+
throw new Error('Invalid port: ' + value);
|
|
27
37
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
function launchTauriApp(workingDirectory) {
|
|
32
|
-
const tauriBinary = findTauriApp();
|
|
33
|
-
if (!tauriBinary) {
|
|
34
|
-
console.error('VZCode desktop app not found. Please build it first with: npm run tauri:build');
|
|
35
|
-
console.error('Falling back to launching browser version...');
|
|
36
|
-
launchBrowserVersion(workingDirectory);
|
|
37
|
-
return;
|
|
38
|
+
const port = Number(value);
|
|
39
|
+
if (!Number.isSafeInteger(port) || port > 65535) {
|
|
40
|
+
throw new Error('Port must be between 0 and 65535: ' + value);
|
|
38
41
|
}
|
|
39
|
-
|
|
40
|
-
// First start the server in the background
|
|
41
|
-
startServerInBackground(workingDirectory);
|
|
42
|
-
// Give the server a moment to start, then launch Tauri
|
|
43
|
-
setTimeout(() => {
|
|
44
|
-
const child = spawn(tauriBinary, [], {
|
|
45
|
-
cwd: workingDirectory,
|
|
46
|
-
stdio: 'inherit',
|
|
47
|
-
detached: true,
|
|
48
|
-
});
|
|
49
|
-
// Allow the parent process to exit while keeping the child running
|
|
50
|
-
child.unref();
|
|
51
|
-
}, 2000);
|
|
42
|
+
return port;
|
|
52
43
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
44
|
+
function parseOptions(args) {
|
|
45
|
+
const options = {
|
|
46
|
+
directory: '.',
|
|
47
|
+
port: DEFAULT_PORT,
|
|
48
|
+
openBrowser: true,
|
|
49
|
+
desktop: false,
|
|
50
|
+
help: false,
|
|
51
|
+
};
|
|
52
|
+
let hasDirectory = false;
|
|
53
|
+
for (let i = 0; i < args.length; i++) {
|
|
54
|
+
const arg = args[i];
|
|
55
|
+
if (arg === '--help' || arg === '-h') {
|
|
56
|
+
options.help = true;
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
if (arg === '--browser') {
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
if (arg === '--desktop') {
|
|
63
|
+
options.desktop = true;
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
if (arg === '--no-open') {
|
|
67
|
+
options.openBrowser = false;
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
if (arg === '--port' || arg.startsWith('--port=')) {
|
|
71
|
+
const value = arg === '--port'
|
|
72
|
+
? args[++i]
|
|
73
|
+
: arg.slice('--port='.length);
|
|
74
|
+
if (value === undefined) {
|
|
75
|
+
throw new Error('Missing value for --port');
|
|
76
|
+
}
|
|
77
|
+
options.port = parsePort(value);
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
if (arg.startsWith('-')) {
|
|
81
|
+
throw new Error('Unknown option: ' + arg);
|
|
82
|
+
}
|
|
83
|
+
if (hasDirectory) {
|
|
84
|
+
throw new Error('Provide at most one workspace directory');
|
|
85
|
+
}
|
|
86
|
+
options.directory = arg;
|
|
87
|
+
hasDirectory = true;
|
|
74
88
|
}
|
|
89
|
+
return options;
|
|
75
90
|
}
|
|
76
|
-
//
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
91
|
+
// The npm package intentionally does not include a desktop executable.
|
|
92
|
+
// This path is available only after building Tauri in a source checkout.
|
|
93
|
+
function findDesktopApp() {
|
|
94
|
+
const root = path.resolve(__dirname, '..');
|
|
95
|
+
const candidates = [
|
|
96
|
+
'src-tauri/target/debug/vzcode',
|
|
97
|
+
'src-tauri/target/debug/vzcode.exe',
|
|
98
|
+
'src-tauri/target/release/vzcode',
|
|
99
|
+
'src-tauri/target/release/vzcode.exe',
|
|
100
|
+
'src-tauri/target/debug/vzcode.app/Contents/MacOS/vzcode',
|
|
101
|
+
'src-tauri/target/release/vzcode.app/Contents/MacOS/vzcode',
|
|
102
|
+
];
|
|
103
|
+
return (candidates
|
|
104
|
+
.map((candidate) => path.join(root, candidate))
|
|
105
|
+
.find((candidate) => fs.existsSync(candidate)) ?? null);
|
|
81
106
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const args = process.argv.slice(2);
|
|
87
|
-
if (args.includes('--help') || args.includes('-h')) {
|
|
88
|
-
console.log('VZCode - Multiplayer Code Editor');
|
|
89
|
-
console.log('');
|
|
90
|
-
console.log('Usage: vzcode [options]');
|
|
91
|
-
console.log('');
|
|
92
|
-
console.log('Options:');
|
|
93
|
-
console.log(' --help, -h Show this help message');
|
|
94
|
-
console.log(' --browser Force browser version instead of desktop app');
|
|
95
|
-
console.log(' --port=<port> Specify port for server (default: 3030)');
|
|
96
|
-
console.log('');
|
|
97
|
-
console.log('Examples:');
|
|
98
|
-
console.log(' vzcode # Launch desktop app in current directory');
|
|
99
|
-
console.log(' vzcode --browser # Launch browser version');
|
|
100
|
-
console.log(' vzcode --port=4000 # Start server on port 4000');
|
|
107
|
+
async function main() {
|
|
108
|
+
const options = parseOptions(process.argv.slice(2));
|
|
109
|
+
if (options.help) {
|
|
110
|
+
console.log(usage);
|
|
101
111
|
return;
|
|
102
112
|
}
|
|
103
|
-
|
|
104
|
-
|
|
113
|
+
const directory = path.resolve(options.directory);
|
|
114
|
+
if (!fs.existsSync(directory) ||
|
|
115
|
+
!fs.statSync(directory).isDirectory()) {
|
|
116
|
+
throw new Error('Workspace is not a directory: ' + directory);
|
|
117
|
+
}
|
|
118
|
+
const desktopBinary = options.desktop
|
|
119
|
+
? findDesktopApp()
|
|
120
|
+
: null;
|
|
121
|
+
if (options.desktop && !desktopBinary) {
|
|
122
|
+
throw new Error('Tauri application not found. Build it with npm run tauri:build, ' +
|
|
123
|
+
'or omit --desktop to use the browser editor.');
|
|
124
|
+
}
|
|
125
|
+
const server = createVZCodeServer({ cwd: directory });
|
|
126
|
+
await server.ready;
|
|
127
|
+
let actualPort;
|
|
128
|
+
try {
|
|
129
|
+
// Local-only until authenticated remote collaboration exists.
|
|
130
|
+
actualPort = await server.listen(options.port, HOST);
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
await server.close();
|
|
134
|
+
throw error;
|
|
135
|
+
}
|
|
136
|
+
const url = 'http://' + HOST + ':' + actualPort;
|
|
137
|
+
console.log('Workspace: ' + directory);
|
|
138
|
+
const accessUrl = url + '/#vzcode-token=' + server.accessToken;
|
|
139
|
+
console.log('Editor is live at ' + accessUrl);
|
|
140
|
+
console.log('Keep this private link secret; it grants workspace editing access.');
|
|
141
|
+
console.log('Press Ctrl+C to stop VZCode.');
|
|
142
|
+
let closing = false;
|
|
143
|
+
const shutdown = async () => {
|
|
144
|
+
if (closing)
|
|
145
|
+
return;
|
|
146
|
+
closing = true;
|
|
147
|
+
try {
|
|
148
|
+
await server.close();
|
|
149
|
+
}
|
|
150
|
+
catch (error) {
|
|
151
|
+
console.error('Failed to stop VZCode:', error);
|
|
152
|
+
process.exitCode = 1;
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
process.once('SIGINT', () => void shutdown());
|
|
156
|
+
process.once('SIGTERM', () => void shutdown());
|
|
157
|
+
if (desktopBinary) {
|
|
158
|
+
const child = spawn(desktopBinary, [], {
|
|
159
|
+
cwd: directory,
|
|
160
|
+
stdio: 'inherit',
|
|
161
|
+
});
|
|
162
|
+
child.once('error', (error) => {
|
|
163
|
+
console.error('Unable to launch the desktop app:', error);
|
|
164
|
+
process.exitCode = 1;
|
|
165
|
+
void shutdown();
|
|
166
|
+
});
|
|
167
|
+
child.once('exit', () => void shutdown());
|
|
105
168
|
}
|
|
106
|
-
else {
|
|
107
|
-
|
|
169
|
+
else if (options.openBrowser) {
|
|
170
|
+
try {
|
|
171
|
+
await open(accessUrl);
|
|
172
|
+
}
|
|
173
|
+
catch (error) {
|
|
174
|
+
console.warn('Could not open a browser automatically. Visit ' +
|
|
175
|
+
url, error);
|
|
176
|
+
}
|
|
108
177
|
}
|
|
109
178
|
}
|
|
110
|
-
|
|
111
|
-
|
|
179
|
+
main().catch((error) => {
|
|
180
|
+
console.error('VZCode: ' + (error.message ?? error));
|
|
181
|
+
process.exitCode = 1;
|
|
182
|
+
});
|
package/dist/index.html
CHANGED
|
@@ -20,8 +20,9 @@
|
|
|
20
20
|
href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap"
|
|
21
21
|
rel="stylesheet"
|
|
22
22
|
/>
|
|
23
|
-
<script type="module" crossorigin src="/assets/index-
|
|
24
|
-
<link rel="
|
|
23
|
+
<script type="module" crossorigin src="/assets/index-COLyIkCc.js"></script>
|
|
24
|
+
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-COiEfhsA.js">
|
|
25
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CZT-v4sH.css">
|
|
25
26
|
</head>
|
|
26
27
|
<body>
|
|
27
28
|
<div id="root"></div>
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { randomBytes, timingSafeEqual } from 'node:crypto';
|
|
2
|
+
const constantTimeEqual = (a, b) => {
|
|
3
|
+
const left = Buffer.from(a);
|
|
4
|
+
const right = Buffer.from(b);
|
|
5
|
+
return (left.length === right.length &&
|
|
6
|
+
timingSafeEqual(left, right));
|
|
7
|
+
};
|
|
8
|
+
// Deny requests originating from another web origin, including cross-site
|
|
9
|
+
// WebSockets carrying ambient cookies. The explicit token is still required
|
|
10
|
+
// to establish a session.
|
|
11
|
+
export const isSameOrigin = (req) => {
|
|
12
|
+
const origin = req.headers.origin;
|
|
13
|
+
if (!origin)
|
|
14
|
+
return true;
|
|
15
|
+
if (!req.headers.host || typeof origin !== 'string') {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
const parsed = new URL(origin);
|
|
20
|
+
return (parsed.protocol ===
|
|
21
|
+
(req.socket.encrypted
|
|
22
|
+
? 'https:'
|
|
23
|
+
: 'http:') && parsed.host === req.headers.host);
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const sessionCookie = (req, name) => {
|
|
30
|
+
const cookieHeader = req.headers.cookie || '';
|
|
31
|
+
const pair = cookieHeader
|
|
32
|
+
.split(';')
|
|
33
|
+
.map((value) => value.trim())
|
|
34
|
+
.find((value) => value.startsWith(name + '='));
|
|
35
|
+
return pair ? pair.slice(name.length + 1) : '';
|
|
36
|
+
};
|
|
37
|
+
export function createAccessControl(accessToken) {
|
|
38
|
+
const token = accessToken ?? randomBytes(32).toString('hex');
|
|
39
|
+
if (token.length < 32) {
|
|
40
|
+
throw new Error('Access token must have at least 32 characters');
|
|
41
|
+
}
|
|
42
|
+
// Cookies are host-scoped, not port-scoped. A random cookie name lets
|
|
43
|
+
// multiple local VZCode instances coexist on different ports.
|
|
44
|
+
const cookieName = 'vzcode_session_' + randomBytes(8).toString('hex');
|
|
45
|
+
const sessions = new Set();
|
|
46
|
+
const hasBearer = (req) => {
|
|
47
|
+
const authorization = req.headers.authorization || '';
|
|
48
|
+
return (authorization.startsWith('Bearer ') &&
|
|
49
|
+
constantTimeEqual(authorization.slice(7), token));
|
|
50
|
+
};
|
|
51
|
+
const authorized = (req) => {
|
|
52
|
+
const session = sessionCookie(req, cookieName);
|
|
53
|
+
return (isSameOrigin(req) &&
|
|
54
|
+
(hasBearer(req) ||
|
|
55
|
+
(session !== '' && sessions.has(session))));
|
|
56
|
+
};
|
|
57
|
+
const install = (app) => {
|
|
58
|
+
app.post('/auth/session', (req, res) => {
|
|
59
|
+
if (!isSameOrigin(req) || !hasBearer(req)) {
|
|
60
|
+
res.sendStatus(401);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const session = randomBytes(32).toString('hex');
|
|
64
|
+
sessions.add(session);
|
|
65
|
+
const secure = req.secure ? '; Secure' : '';
|
|
66
|
+
res.setHeader('Set-Cookie', cookieName +
|
|
67
|
+
'=' +
|
|
68
|
+
session +
|
|
69
|
+
'; HttpOnly; SameSite=Strict; Path=/' +
|
|
70
|
+
secure);
|
|
71
|
+
res.sendStatus(204);
|
|
72
|
+
});
|
|
73
|
+
app.get('/auth/status', (req, res) => {
|
|
74
|
+
res.status(authorized(req) ? 200 : 401).json({
|
|
75
|
+
authenticated: authorized(req),
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
app.post('/auth/logout', (req, res) => {
|
|
79
|
+
const session = sessionCookie(req, cookieName);
|
|
80
|
+
if (!authorized(req)) {
|
|
81
|
+
res.sendStatus(401);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
sessions.delete(session);
|
|
85
|
+
res.setHeader('Set-Cookie', cookieName +
|
|
86
|
+
'=; Path=/; HttpOnly; SameSite=Strict; Max-Age=0');
|
|
87
|
+
res.sendStatus(204);
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
const requireAuth = (req, res, next) => {
|
|
91
|
+
if (!authorized(req)) {
|
|
92
|
+
res.sendStatus(401);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
next();
|
|
96
|
+
};
|
|
97
|
+
return {
|
|
98
|
+
token,
|
|
99
|
+
install,
|
|
100
|
+
authorized,
|
|
101
|
+
requireAuth,
|
|
102
|
+
close: () => sessions.clear(),
|
|
103
|
+
};
|
|
104
|
+
}
|
|
@@ -81,7 +81,10 @@ export const computeInitialDocument = ({ fullPath }) => {
|
|
|
81
81
|
.readdirSync(currentDirectoryPath, {
|
|
82
82
|
withFileTypes: true,
|
|
83
83
|
})
|
|
84
|
-
|
|
84
|
+
// Reject symlinks and special files during the initial scan.
|
|
85
|
+
// readFileSync would otherwise follow links outside the root.
|
|
86
|
+
.filter((dirent) => dirent.isFile() ||
|
|
87
|
+
(enableDirectories && dirent.isDirectory()));
|
|
85
88
|
// find .ignore or .gitignore files in the current directory
|
|
86
89
|
const ignoreFiles = dirEntries
|
|
87
90
|
.filter((dirent) => dirent.isFile() && isIgnoreFile(dirent.name))
|