Skip to content

Commit 68feecf

Browse files
lordvladtatethurston
authored andcommitted
Update compiler.cmd (#51)
To support monorepos on windows, where protoscript might not actually be located in the project root's own node_modules, but in the monorepo's node_modules, use %~p0 to find compiler.js relative to the cmd file instead of relative to the current working directory
1 parent 6f513bf commit 68feecf

6 files changed

Lines changed: 3767 additions & 3241 deletions

File tree

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18.18.2
1+
22.14.0

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@
5252
"prettier-package-json": "^2.8.0",
5353
"typescript": "^5.2.2"
5454
},
55-
"packageManager": "pnpm@8.6.9"
55+
"packageManager": "pnpm@10.4.1+sha512.c753b6c3ad7afa13af388fa6d808035a008e30ea9993f58c6663e2bc5ff21679aa834db094987129aa4d488b86df57f7b634981b2f827cdcacc698cc0cfb88af"
5656
}

packages/protoscript/src/codegen/utils.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,8 +1046,7 @@ export function processTypes(
10461046
return;
10471047
}
10481048

1049-
const _enum = types.filter((t) => t.type === "enum")[idx]
1050-
.content as EnumOpts;
1049+
const _enum = types.filter((t) => t.type === "enum")[idx].content;
10511050

10521051
// enum comment
10531052
if (path.length === 0) {
@@ -1069,9 +1068,7 @@ export function processTypes(
10691068
return;
10701069
}
10711070

1072-
const message = types.filter((t) => t.type === "message")[
1073-
idx
1074-
] as MessageType;
1071+
const message = types.filter((t) => t.type === "message")[idx];
10751072

10761073
// message comment
10771074
if (path.length === 0) {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
@echo off
2-
node .\node_modules\protoscript\dist\compiler.js %*
2+
node "%~dp0\compiler.js" %*

packages/protoscript/src/runtime/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export type PartialDeep<T> = {
77
[P in keyof T]?: NonNullable<T[P]> extends any[] | Uint8Array
88
? T[P]
99
: NonNullable<T[P]> extends object
10-
? PartialDeep<T[P]>
11-
: T[P];
10+
? PartialDeep<T[P]>
11+
: T[P];
1212
/* eslint-enable @typescript-eslint/no-explicit-any */
1313
};

0 commit comments

Comments
 (0)