Skip to content

Commit cf961a6

Browse files
style(Rest): standardize quote style and improve documentation tables
Standardize JavaScript files to use double quotes throughout bin/Rest.js and postinstall.js, matching the project's code style guidelines. Reformat execSync calls and function calls for improved readability. Improve documentation table formatting in DeepDive.md by expanding column widths to prevent text truncation and enhance readability of module descriptions, integration points, and configuration options. Also perform minor formatting cleanup on .cargo/config.toml rustdocflags array and update the GitHub Update.md timestamp. Updates Documentation/Rust submodule to latest commit.
1 parent 4b77de1 commit cf961a6

6 files changed

Lines changed: 174 additions & 149 deletions

File tree

.cargo/config.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
[build]
22
target-dir = "Target"
3-
rustdocflags = [
4-
"-Zunstable-options",
5-
"--enable-index-page",
6-
]
3+
rustdocflags = ["-Zunstable-options", "--enable-index-page"]
74

85
[net]
96
git-fetch-with-cli = true

.github/Update.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Update: Mon Apr 6 03:23:14 UTC 2026
1+
Update: Mon Apr 6 03:23:14 UTC 2026

Documentation/GitHub/DeepDive.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,20 @@ graph TB
5858

5959
## Key Modules
6060

61-
| Path | Description |
62-
| :--- | :--- |
63-
| `Source/Library.rs` | Binary entry point; parses CLI arguments and dispatches to compiler |
64-
| `Source/Fn/OXC/Compiler.rs` | Main compilation orchestrator; coordinates parser, transformer, and codegen |
65-
| `Source/Fn/OXC/Parser.rs` | Wraps `oxc_parser` with error normalization and source tracking |
66-
| `Source/Fn/OXC/Transformer.rs` | Applies TypeScript-to-JavaScript AST transformations including decorators |
67-
| `Source/Fn/OXC/Codegen.rs` | Generates final JavaScript text from the transformed AST |
68-
| `Source/Fn/Build.rs` | Directory-based compilation: walks source trees preserving structure |
69-
| `Source/Fn/Bundle/` | Bundling utilities for multi-file outputs |
70-
| `Source/Fn/NLS/` | Natural Language Support string extraction |
71-
| `Source/Fn/SWC/` | SWC integration shims (alternative transformer path) |
72-
| `Source/Fn/Worker/` | Worker thread support for parallel compilation |
73-
| `Source/Struct/CompilerConfig.rs` | Configuration struct: decorator mode, class fields, source maps |
74-
| `Source/Struct/SWC.rs` | SWC-specific configuration types |
61+
| Path | Description |
62+
| :-------------------------------- | :-------------------------------------------------------------------------- |
63+
| `Source/Library.rs` | Binary entry point; parses CLI arguments and dispatches to compiler |
64+
| `Source/Fn/OXC/Compiler.rs` | Main compilation orchestrator; coordinates parser, transformer, and codegen |
65+
| `Source/Fn/OXC/Parser.rs` | Wraps `oxc_parser` with error normalization and source tracking |
66+
| `Source/Fn/OXC/Transformer.rs` | Applies TypeScript-to-JavaScript AST transformations including decorators |
67+
| `Source/Fn/OXC/Codegen.rs` | Generates final JavaScript text from the transformed AST |
68+
| `Source/Fn/Build.rs` | Directory-based compilation: walks source trees preserving structure |
69+
| `Source/Fn/Bundle/` | Bundling utilities for multi-file outputs |
70+
| `Source/Fn/NLS/` | Natural Language Support string extraction |
71+
| `Source/Fn/SWC/` | SWC integration shims (alternative transformer path) |
72+
| `Source/Fn/Worker/` | Worker thread support for parallel compilation |
73+
| `Source/Struct/CompilerConfig.rs` | Configuration struct: decorator mode, class fields, source maps |
74+
| `Source/Struct/SWC.rs` | SWC-specific configuration types |
7575

7676
---
7777

@@ -105,24 +105,24 @@ Tokio worker threads and collects aggregated metrics.
105105

106106
## Integration Points
107107

108-
| Connecting Element | Direction | Mechanism | Description |
109-
| :--- | :--- | :--- | :--- |
110-
| **Output** | Consumer | Process invocation / esbuild plugin | Output's `RestPlugin.ts` invokes the Rest binary or calls it via plugin API |
111-
| **Cocoon** | Indirect consumer | Compiled artifacts | Cocoon loads the JavaScript produced by Rest from `Target/Microsoft/VSCode/` |
112-
| **Sky** | Indirect consumer | `@codeeditorland/output` package | Sky loads VSCode UI components compiled through the Rest pipeline |
108+
| Connecting Element | Direction | Mechanism | Description |
109+
| :----------------- | :---------------- | :---------------------------------- | :--------------------------------------------------------------------------- |
110+
| **Output** | Consumer | Process invocation / esbuild plugin | Output's `RestPlugin.ts` invokes the Rest binary or calls it via plugin API |
111+
| **Cocoon** | Indirect consumer | Compiled artifacts | Cocoon loads the JavaScript produced by Rest from `Target/Microsoft/VSCode/` |
112+
| **Sky** | Indirect consumer | `@codeeditorland/output` package | Sky loads VSCode UI components compiled through the Rest pipeline |
113113

114114
---
115115

116116
## Configuration
117117

118-
| Option | CLI Flag / Variable | Default | Description |
119-
| :--- | :--- | :--- | :--- |
120-
| Input path | `--Input` | required | Directory or file to compile |
121-
| Output path | `--Output` | required | Destination directory for compiled JavaScript |
122-
| Parallel mode | `--Parallel` | off | Enable multi-core parallel compilation |
123-
| Decorator metadata | `CompilerConfig` | `true` | Emit `emitDecoratorMetadata` for VSCode compatibility |
124-
| Class fields mode | `CompilerConfig` | `false` (VSCode default) | `useDefineForClassFields` — off matches VSCode's gulp build |
125-
| Source maps | `CompilerConfig` | development only | Inline source maps for debug builds |
118+
| Option | CLI Flag / Variable | Default | Description |
119+
| :----------------- | :------------------ | :----------------------- | :---------------------------------------------------------- |
120+
| Input path | `--Input` | required | Directory or file to compile |
121+
| Output path | `--Output` | required | Destination directory for compiled JavaScript |
122+
| Parallel mode | `--Parallel` | off | Enable multi-core parallel compilation |
123+
| Decorator metadata | `CompilerConfig` | `true` | Emit `emitDecoratorMetadata` for VSCode compatibility |
124+
| Class fields mode | `CompilerConfig` | `false` (VSCode default) | `useDefineForClassFields` — off matches VSCode's gulp build |
125+
| Source maps | `CompilerConfig` | development only | Inline source maps for debug builds |
126126

127127
The `CompilerConfig` struct is populated from either CLI flags or from the
128128
esbuild plugin context when Rest is invoked as a plugin within the Output build

Documentation/Rust

Submodule Rust updated 517 files

bin/Rest.js

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,35 @@
22
/**
33
* Rest.js - CLI wrapper for Rest compiler binary
44
*/
5-
6-
import { execSync } from 'node:child_process';
7-
import { join, dirname } from 'node:path';
8-
import { fileURLToPath } from 'node:url';
9-
import { existsSync } from 'node:fs';
5+
import { execSync } from "node:child_process";
6+
import { existsSync } from "node:fs";
7+
import { dirname, join } from "node:path";
8+
import { fileURLToPath } from "node:url";
109

1110
const __dirname = dirname(fileURLToPath(import.meta.url));
1211

1312
// Determine the binary path based on platform
1413
const platform = process.platform;
15-
const binaryName = platform === 'win32' ? 'Rest.exe' : 'Rest';
14+
const binaryName = platform === "win32" ? "Rest.exe" : "Rest";
1615
const binaryPath = join(__dirname, binaryName);
1716

1817
if (!existsSync(binaryPath)) {
19-
console.error(`[Rest] Binary not found at: ${binaryPath}`);
20-
console.error('[Rest] Please run: npm install or npm rebuild');
21-
process.exit(1);
18+
console.error(`[Rest] Binary not found at: ${binaryPath}`);
19+
console.error("[Rest] Please run: npm install or npm rebuild");
20+
process.exit(1);
2221
}
2322

2423
// Execute the binary with all arguments
2524
try {
26-
execSync(`"${binaryPath}" ${process.argv.slice(2).map(a => `"${a}"`).join(' ')}`, {
27-
stdio: 'inherit',
28-
});
25+
execSync(
26+
`"${binaryPath}" ${process.argv
27+
.slice(2)
28+
.map((a) => `"${a}"`)
29+
.join(" ")}`,
30+
{
31+
stdio: "inherit",
32+
},
33+
);
2934
} catch (error) {
30-
process.exit(error.status || 1);
35+
process.exit(error.status || 1);
3136
}

0 commit comments

Comments
 (0)