Skip to content

Commit bd6fbe3

Browse files
style(codebase): apply consistent formatting and import organization
This commit introduces a series of stylistic improvements across the codebase to enforce consistency, improve readability, and maintain a clean project structure. The changes are focused on import ordering, code formatting, and minor structural refactoring without altering any functional behavior. Key modifications include: - **Import Organization**: Standardized import ordering by separating external dependencies (like `effect`) from internal or framework-specific imports (e.g., `@codeeditorland/output/...`), as seen in `DesktopMain.ts`, `Bridge.ts`, and `Storage.ts`. - **Formatting Adjustments**: Applied consistent indentation and line breaks in configuration files (`Wind.js` and `Target.ts`) for better visual clarity and maintenance. This includes splitting long lines (e.g., the `On` constant definition) and reformatting objects and arrays. - **Code Style Refinements**: Simplified class declaration syntax in `TreeView/Define.ts` by consolidating a multi-line `implements` clause into a single line, adhering to a more concise style. - **Whitespace Management**: Added strategic blank lines after import blocks in `Problem.ts` files to enhance readability and separation of concerns. - **Import Statement Optimization**: Reorganized and split complex import statements in `Provider.ts` for better legibility. All changes are purely cosmetic, ensuring the codebase remains clean and maintainable while preserving existing functionality.
1 parent dbc5efc commit bd6fbe3

9 files changed

Lines changed: 68 additions & 65 deletions

File tree

Source/Application/Configuration/Problem.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
import { Data } from "effect";
9+
910
import type { IntegrationProblem } from "../Integration/Problem.js";
1011

1112
/**

Source/Application/DesktopMain.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
* - Sets up global error handling and gracefully runs the application.
1313
*/
1414

15-
import { Effect } from "effect";
1615
import { domContentLoaded } from "@codeeditorland/output/vs/base/browser/dom.js";
1716
import { onUnexpectedError } from "@codeeditorland/output/vs/base/common/errors.js";
1817
import { ServiceCollection } from "@codeeditorland/output/vs/platform/instantiation/common/serviceCollection.js";
@@ -25,6 +24,7 @@ import {
2524
import { Registry } from "@codeeditorland/output/vs/platform/registry/common/platform.js";
2625
import { Workbench } from "@codeeditorland/output/vs/workbench/browser/workbench.js";
2726
import { CommandsQuickAccessProvider } from "@codeeditorland/output/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js";
27+
import { Effect } from "effect";
2828

2929
import { IntegrationService } from "../Integration/Tauri/Service.js";
3030
import { HostService } from "./Host/Service.js";

Source/Application/QuickInput/Problem.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
import { Data } from "effect";
9+
910
import type { HostProblem } from "../Host/Problem.js";
1011

1112
/**

Source/Application/Storage/Storage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import {
1515
} from "@codeeditorland/output/vs/base/parts/storage/common/storage.js";
1616
import { Effect } from "effect";
1717

18-
import { CreateEmitter } from "../Problem.jsorm/Vscode/Type.js";
1918
import { IntegrationService } from "../Integration/Define.js";
19+
import { CreateEmitter } from "../Problem.jsorm/Vscode/Type.js";
2020
import type { StorageDatabase } from "./Database.js";
2121
import { StorageProblem } from "./Problem.js";
2222

Source/Application/TreeView/Define.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ export interface TreeItemDTO {
3939
* This class is used for any tree view whose data is provided natively, such as
4040
* the File Explorer. It translates VS Code's provider requests into IPC calls.
4141
*/
42-
export class NativeTreeViewDataProvider
43-
implements TreeDataProvider<TreeItemDTO>
44-
{
42+
export class NativeTreeViewDataProvider implements TreeDataProvider<TreeItemDTO> {
4543
private readonly _OnDidChangeTreeDataEmitter = CreateEmitter<
4644
TreeItemDTO | TreeItemDTO[] | undefined | null | void
4745
>();

Source/Bridge.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@
88
*/
99

1010
import { URI } from "@codeeditorland/output/vs/base/common/uri.js";
11-
import { invoke as TauriInvoke } from "@tauri-apps/api/core";
12-
import {
13-
emit as TauriEmit,
14-
listen as TauriListen,
15-
type Event as TauriEvent,
16-
} from "@tauri-apps/api/event";
1711
import type { ISandboxConfiguration } from "@codeeditorland/output/vs/base/parts/sandbox/common/sandboxTypes.js";
1812
import type {
1913
IpcRenderer,
@@ -23,6 +17,12 @@ import type {
2317
IMainWindowSandboxGlobals,
2418
ISandboxNodeProcess,
2519
} from "@codeeditorland/output/vs/base/parts/sandbox/electron-browser/globals";
20+
import { invoke as TauriInvoke } from "@tauri-apps/api/core";
21+
import {
22+
emit as TauriEmit,
23+
listen as TauriListen,
24+
type Event as TauriEvent,
25+
} from "@tauri-apps/api/event";
2626

2727
/**
2828
* A shim for the `ipcRenderer` object, adapting it to use Tauri's IPC.

Source/Configuration/ESBuild/Target.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ export default async (Current: BuildOptions): Promise<BuildOptions> =>
5959
) {
6060
if (Output.endsWith(".js")) {
6161
(
62-
await import(
63-
"@playform/build/Target/Function/Exec.js"
64-
)
62+
await import("@playform/build/Target/Function/Exec.js")
6563
).default(
6664
`Build '${Output}' \
6765
--ESBuild Configuration/ESBuild/Target/Compile.js \
Lines changed: 52 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
export const On = process.env["NODE_ENV"] === "development" ||
2-
process.env["TAURI_ENV_DEBUG"] === "true";
1+
export const On =
2+
process.env["NODE_ENV"] === "development" ||
3+
process.env["TAURI_ENV_DEBUG"] === "true";
34
export const Clean = process.env["Clean"] === "true";
45
export const Bundle = process.env["Bundle"] === "true";
56
export const Compile = process.env["Compile"] === "true";
@@ -8,53 +9,54 @@ export const Compile = process.env["Compile"] === "true";
89
*
910
*/
1011
export default {
11-
color: true,
12-
format: "esm",
13-
logLevel: "debug",
14-
metafile: true,
15-
minify: !On,
16-
outdir: "Configuration",
17-
platform: "node",
18-
target: "esnext",
19-
tsconfig: "tsconfig.json",
20-
write: true,
21-
legalComments: On ? "inline" : "none",
22-
bundle: Bundle,
23-
assetNames: "Asset/[name]-[hash]",
24-
sourcemap: On,
25-
drop: On ? [] : ["debugger"],
26-
ignoreAnnotations: !On,
27-
keepNames: On,
28-
plugins: [
29-
{
30-
name: "Target",
31-
// @ts-ignore
32-
setup({ onStart, initialOptions: { outdir } }) {
33-
switch (true) {
34-
case Clean === true:
35-
onStart(async () => {
36-
try {
37-
outdir
38-
? await (await import("node:fs/promises")).rm(outdir, {
39-
recursive: true,
40-
})
41-
: {};
42-
}
43-
catch (_Error) {
44-
console.log(_Error);
45-
}
46-
});
47-
break;
48-
default:
49-
break;
50-
}
51-
},
52-
},
53-
],
54-
outbase: "Source/Configuration",
55-
loader: {
56-
".json": "copy",
57-
".sh": "copy",
58-
},
12+
color: true,
13+
format: "esm",
14+
logLevel: "debug",
15+
metafile: true,
16+
minify: !On,
17+
outdir: "Configuration",
18+
platform: "node",
19+
target: "esnext",
20+
tsconfig: "tsconfig.json",
21+
write: true,
22+
legalComments: On ? "inline" : "none",
23+
bundle: Bundle,
24+
assetNames: "Asset/[name]-[hash]",
25+
sourcemap: On,
26+
drop: On ? [] : ["debugger"],
27+
ignoreAnnotations: !On,
28+
keepNames: On,
29+
plugins: [
30+
{
31+
name: "Target",
32+
// @ts-ignore
33+
setup({ onStart, initialOptions: { outdir } }) {
34+
switch (true) {
35+
case Clean === true:
36+
onStart(async () => {
37+
try {
38+
outdir
39+
? await (
40+
await import("node:fs/promises")
41+
).rm(outdir, {
42+
recursive: true,
43+
})
44+
: {};
45+
} catch (_Error) {
46+
console.log(_Error);
47+
}
48+
});
49+
break;
50+
default:
51+
break;
52+
}
53+
},
54+
},
55+
],
56+
outbase: "Source/Configuration",
57+
loader: {
58+
".json": "copy",
59+
".sh": "copy",
60+
},
5961
};
6062
export const { sep, posix } = await import("node:path");

Source/TypeConverter/SourceControlManagement/Provider.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
*/
55

66
import { Emitter } from "@codeeditorland/output/vs/base/common/event";
7-
import { observableValue, type IObservable } from "@codeeditorland/output/vs/base/common/observable";
7+
import {
8+
observableValue,
9+
type IObservable,
10+
} from "@codeeditorland/output/vs/base/common/observable";
811
import { URI } from "@codeeditorland/output/vs/base/common/uri.js";
912
import type { ITextModel } from "@codeeditorland/output/vs/editor/common/model";
1013
import type {

0 commit comments

Comments
 (0)