diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9c770973..f911ae3d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 diff --git a/README.md b/README.md index 0cbc373e..a4fbc384 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/VOID_USEFUL_LINKS.md b/VOID_USEFUL_LINKS.md index b3ba5a30..abf9a6e4 100644 --- a/VOID_USEFUL_LINKS.md +++ b/VOID_USEFUL_LINKS.md @@ -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). diff --git a/package.json b/package.json index 3f53de4a..ef863f0c 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/vs/workbench/contrib/void/browser/react/build.js b/src/vs/workbench/contrib/void/browser/react/build.js index 0bf84bfc..4360e859 100755 --- a/src/vs/workbench/contrib/void/browser/react/build.js +++ b/src/vs/workbench/contrib/void/browser/react/build.js @@ -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);