Merge branch 'main' into feat-mistral-new

This commit is contained in:
Jérôme Commaret 2025-01-09 15:48:57 +01:00 committed by GitHub
commit af85949561
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 68 additions and 15 deletions

View file

@ -83,7 +83,8 @@ Alternatively, if you want to build Void from the terminal, instead of pressing
## Bundling
We don't usually recommend bundling. Instead, you should probably just build. If you're sure you want to bundle Void into an executable app, make sure you've built first, then run one of the following commands. This will create a folder named `VSCode-darwin-arm64` (or similar) in the repo's parent's directory. Be patient - compiling can take ~25 minutes.
We don't usually recommend bundling. Instead, you should probably just build. If you're sure you want to bundle Void into an executable app, make sure you've built first, then run one of the following commands. This will create a folder named `VSCode-darwin-arm64` or similar outside of the void/ repo (see below). Be patient - compiling can take ~25 minutes.
### Mac
- `npm run gulp vscode-darwin-arm64` - most common (Apple Silicon)
@ -99,6 +100,16 @@ We don't usually recommend bundling. Instead, you should probably just build. If
- `npm run gulp vscode-linux-ia32`
### Output
This will generate a folder outside of `void/`:
```bash
workspace/
├── void/ # Your Void fork
└── VSCode-darwin-arm64/ # Generated output
```
# Guidelines

View file

@ -10,8 +10,7 @@ To build and run Void, follow the steps in [`CONTRIBUTING.md`](https://github.co
## Reference
Void is a fork of the of [vscode](https://github.com/microsoft/vscode) repository.
For some useful links on VSCode, see [`VOID_USEFUL_LINKS.md`](https://github.com/voideditor/void/blob/main/VOID_USEFUL_LINKS.md).
Void is a fork of the of [vscode](https://github.com/microsoft/vscode) repository. For some useful links on VSCode, see [`VOID_USEFUL_LINKS.md`](https://github.com/voideditor/void/blob/main/VOID_USEFUL_LINKS.md).
## Support
Feel free to reach out in our [Discord](https://discord.gg/RSNjgaugJs) server or contact us via email.

View file

@ -32,6 +32,6 @@ Void is no longer an extension, so these links are no longer required, but they
- [The Full VSCode Extension API](https://code.visualstudio.com/api/references/vscode-api) - look on the right side for organization. The [bottom](https://code.visualstudio.com/api/references/vscode-api#api-patterns) of the page is easy to miss but is useful - cancellation tokens, events, disposables.
- [Activation events](https://code.visualstudio.com/api/references/activation-events) you can define in `package.json` (not the most useful)
- [Activation events](https://code.visualstudio.com/api/references/activation-events) you can define in `package.json` (not the most useful).

View file

@ -3,8 +3,10 @@
"productName": "Void",
"version": "1.94.0",
"distro": "this is a commit number if we want to publish on npm",
"homepage": "https://voideditor.com",
"author": {
"name": "Glass Devtools, Inc."
"name": "Glass Devtools, Inc.",
"email": "andrew@voideditor.com"
},
"license": "MIT",
"main": "./out/main",

View file

@ -11,23 +11,64 @@ import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const __void_name = 'void'
function doesPathExist(filePath) {
try {
const stats = fs.statSync(filePath);
return stats.isFile();
} catch (err) {
if (err.code === 'ENOENT') {
return false;
}
throw err;
}
}
/*
This function finds `globalDesiredPath` given `localDesiredPath` and `currentPath`
Diagram:
...basePath/
void/
...currentPath/ (defined globally)
...localDesiredPath/ (defined locally)
*/
function findDesiredPathFromLocalPath(localDesiredPath, currentPath) {
// walk upwards until currentPath + localDesiredPath exists
while (!doesPathExist(path.join(currentPath, localDesiredPath))) {
const parentDir = path.dirname(currentPath);
if (parentDir === currentPath) {
return undefined;
}
currentPath = parentDir;
}
// return the `globallyDesiredPath`
const globalDesiredPath = path.join(currentPath, localDesiredPath)
return globalDesiredPath;
}
// hack to refresh styles automatically
function saveStylesFile() {
setTimeout(() => {
try {
// Find "void" in __dirname and use that as our base:
const voidIdx = __dirname.indexOf(__void_name);
const baseDir = __dirname.substring(0, voidIdx + __void_name.length);
const target = path.join(
baseDir,
'src/vs/workbench/contrib/void/browser/react/src2/styles.css'
);
const pathToCssFile = findDesiredPathFromLocalPath('./src/vs/workbench/contrib/void/browser/react/src2/styles.css', __dirname);
if (pathToCssFile === undefined) {
console.error('[scope-tailwind] Error finding styles.css');
return;
}
// Or re-write with the same content:
const content = fs.readFileSync(target, 'utf8');
fs.writeFileSync(target, content, 'utf8');
const content = fs.readFileSync(pathToCssFile, 'utf8');
fs.writeFileSync(pathToCssFile, content, 'utf8');
console.log('[scope-tailwind] Force-saved styles.css');
} catch (err) {
console.error('[scope-tailwind] Error saving styles.css:', err);