Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaRHristov committed Nov 3, 2024
1 parent 31e6066 commit eb3d37f
Show file tree
Hide file tree
Showing 10 changed files with 84 additions and 73 deletions.
42 changes: 23 additions & 19 deletions Configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,26 @@
* @module Option
*
*/
export default (await import("./Target/Function/Merge.js")).default((await import("@playform/pipe/Target/Variable/Option.js")).default, {
Action: {
Wrote: async (On) => {
try {
return (await import("./Target/Function/Output.js")).default(On.Buffer.toString());
}
catch (_Error) {
console.log(_Error);
return On.Buffer;
}
},
Failed: async (Input, _Error) => {
console.log(_Error);
return "";
},
},
Path: new Map([["./Example/Input", "./Example/Output"]]),
File: "**/*.ts",
});
export default (await import("./Target/Function/Merge.js")).default(
(await import("@playform/pipe/Target/Variable/Option.js")).default,
{
Action: {
Wrote: async (On) => {
try {
return (
await import("./Target/Function/Output.js")
).default(On.Buffer.toString());
} catch (_Error) {
console.log(_Error);
return On.Buffer;
}
},
Failed: async (Input, _Error) => {
console.log(_Error);
return "";
},
},
Path: new Map([["./Example/Input", "./Example/Output"]]),
File: "**/*.ts",
},
);
52 changes: 29 additions & 23 deletions Example/Output/Authentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,33 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
class AuthenticationDataRenderer {
render(manifest: IExtensionManifest): IRenderedData<ITableData> {
const authentication = manifest.contributes?.authentication || [];
if (!authentication.length) {
return { data: { headers: [], rows: [] }, dispose: () => { } };
}
const headers = [
localize("authenticationlabel", "Label"),
localize("authenticationid", "ID"),
];
const rows: IRowData[][] = authentication
.sort((a, b) => a.label.localeCompare(b.label))
.map((auth) => {
return [auth.label, auth.id];
});
return { data: { headers: [
localize("authenticationlabel", "Label"),
localize("authenticationid", "ID"),
], rows: authentication
.sort((a, b) => a.label.localeCompare(b.label))
.map((auth) => {
return [auth.label, auth.id];
}) }, dispose: () => { } };
}
render(manifest: IExtensionManifest): IRenderedData<ITableData> {
const authentication = manifest.contributes?.authentication || [];
if (!authentication.length) {
return { data: { headers: [], rows: [] }, dispose: () => {} };
}
const headers = [
localize("authenticationlabel", "Label"),
localize("authenticationid", "ID"),
];
const rows: IRowData[][] = authentication
.sort((a, b) => a.label.localeCompare(b.label))
.map((auth) => {
return [auth.label, auth.id];
});
return {
data: {
headers: [
localize("authenticationlabel", "Label"),
localize("authenticationid", "ID"),
],
rows: authentication
.sort((a, b) => a.label.localeCompare(b.label))
.map((auth) => {
return [auth.label, auth.id];
}),
},
dispose: () => {},
};
}
}
12 changes: 6 additions & 6 deletions Example/Output/Decorator.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class Example {
@observable
x = 5;
@computed
get doubled() {
return this.x * 2;
}
@observable
x = 5;
@computed
get doubled() {
return this.x * 2;
}
}
7 changes: 2 additions & 5 deletions Example/Output/Namespace.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
namespace MyNamespace {
export const x = 5;
;
export const z = (5
+ 3)
* 2;
export const x = 5;
export const z = (5 + 3) * 2;
}
17 changes: 11 additions & 6 deletions Example/Output/Predefined.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@
*--------------------------------------------------------------------------------------------*/
import * as fs from "fs";
import * as path from "path";

const root = path.dirname(path.dirname(__dirname));
;
;
;
const platform = process.platform;
const arch = process.arch;
;
;
console.log(path.join(path.dirname(path.dirname(__dirname)), ".build", "node", `v${/^target="(.*)"$/m.exec(fs.readFileSync(path.join(path.dirname(path.dirname(__dirname)), "remote", ".npmrc"), "utf8"))![1]}`, `${platform}-${arch}`, platform === "win32" ? "node.exe" : "node"));
console.log(
path.join(
path.dirname(path.dirname(__dirname)),
".build",
"node",
`v${/^target="(.*)"$/m.exec(fs.readFileSync(path.join(path.dirname(path.dirname(__dirname)), "remote", ".npmrc"), "utf8"))![1]}`,
`${platform}-${arch}`,
platform === "win32" ? "node.exe" : "node",
),
);
4 changes: 2 additions & 2 deletions Source/Function/Output/Transformer/Visit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ interface ValidationResult {
readonly warning?: TransformWarning;
}

const enum ErrorCode {
enum ErrorCode {
MAX_DEPTH_EXCEEDED = "MAX_DEPTH_EXCEEDED",
MAX_VISITS_EXCEEDED = "MAX_VISITS_EXCEEDED",
MAX_ITERATIONS_EXCEEDED = "MAX_ITERATIONS_EXCEEDED",
Expand All @@ -75,7 +75,7 @@ const enum ErrorCode {
SELF_REFERENCE = "SELF_REFERENCE",
}

const enum WarningCode {
enum WarningCode {
POTENTIAL_SIDE_EFFECT = "POTENTIAL_SIDE_EFFECT",
UNUSED_DECLARATION = "UNUSED_DECLARATION",
COMPLEX_INITIALIZATION = "COMPLEX_INITIALIZATION",
Expand Down
17 changes: 8 additions & 9 deletions Source/Function/Output/Visit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,14 @@ export const Fn = ((...[Usage, Initializer]) =>
let True = false;

const Visit = (node: Node) => {
if (ts.isIdentifier(node)) {
if (
node.text === NameNode &&
!ts.isTemplateExpression(node.parent) &&
!ts.isTemplateSpan(node.parent) &&
!ts.isPropertyAccessExpression(node.parent)
) {
True = true;
}
if (
ts.isIdentifier(node) &&
node.text === NameNode &&
!ts.isTemplateExpression(node.parent) &&
!ts.isTemplateSpan(node.parent) &&
!ts.isPropertyAccessExpression(node.parent)
) {
True = true;
}

ts.forEachChild(node, Visit);
Expand Down
2 changes: 1 addition & 1 deletion Target/Class/Eliminate.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Target/Function/Output.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ export declare const ts: {
createAbstractBuilder(rootNames: readonly string[] | undefined, options: import("typescript").CompilerOptions | undefined, host?: import("typescript").CompilerHost, oldProgram?: import("typescript").BuilderProgram, configFileParsingDiagnostics?: readonly import("typescript").Diagnostic[], projectReferences?: readonly import("typescript").ProjectReference[]): import("typescript").BuilderProgram;
readBuilderProgram(compilerOptions: import("typescript").CompilerOptions, host: import("typescript").ReadBuildProgramHost): import("typescript").EmitAndSemanticDiagnosticsBuilderProgram | undefined;
createIncrementalCompilerHost(options: import("typescript").CompilerOptions, system?: import("typescript").System): import("typescript").CompilerHost;
createIncrementalProgram<T extends import("typescript").BuilderProgram = import("typescript").EmitAndSemanticDiagnosticsBuilderProgram>({ rootNames, options, configFileParsingDiagnostics, projectReferences, host, createProgram, }: import("typescript").IncrementalProgramOptions<T>): T;
createIncrementalProgram<T extends import("typescript").BuilderProgram = import("typescript").EmitAndSemanticDiagnosticsBuilderProgram>({ rootNames, options, configFileParsingDiagnostics, projectReferences, host, createProgram }: import("typescript").IncrementalProgramOptions<T>): T;
createWatchCompilerHost<T extends import("typescript").BuilderProgram>(configFileName: string, optionsToExtend: import("typescript").CompilerOptions | undefined, system: import("typescript").System, createProgram?: import("typescript").CreateProgram<T>, reportDiagnostic?: import("typescript").DiagnosticReporter, reportWatchStatus?: import("typescript").WatchStatusReporter, watchOptionsToExtend?: import("typescript").WatchOptions, extraFileExtensions?: readonly import("typescript").FileExtensionInfo[]): import("typescript").WatchCompilerHostOfConfigFile<T>;
createWatchCompilerHost<T extends import("typescript").BuilderProgram>(rootFiles: string[], options: import("typescript").CompilerOptions, system: import("typescript").System, createProgram?: import("typescript").CreateProgram<T>, reportDiagnostic?: import("typescript").DiagnosticReporter, reportWatchStatus?: import("typescript").WatchStatusReporter, projectReferences?: readonly import("typescript").ProjectReference[], watchOptions?: import("typescript").WatchOptions): import("typescript").WatchCompilerHostOfFilesAndCompilerOptions<T>;
createWatchProgram<T extends import("typescript").BuilderProgram>(host: import("typescript").WatchCompilerHostOfFilesAndCompilerOptions<T>): import("typescript").WatchOfFilesAndCompilerOptions<T>;
Expand Down
2 changes: 1 addition & 1 deletion Target/Function/Output/Visit.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit eb3d37f

Please sign in to comment.