Skip to content

Commit 132ea2e

Browse files
committed
fix(monorepo): Resolve issue with usage of ok property in scripts
1 parent fa7defa commit 132ea2e

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

tools/scripts/src/build.mjs

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Building the monorepo in ${configuration} mode...
3737
`)}`,
3838
async () => {
3939
let result = await $`pnpm bootstrap`.timeout("60s");
40-
if (!result.ok()) {
40+
if (!result.ok) {
4141
throw new Error(
4242
`An error occured while bootstrapping the monorepo: \n\n${result.message}\n`
4343
);
@@ -46,15 +46,15 @@ Building the monorepo in ${configuration} mode...
4646
if (configuration === "production") {
4747
result =
4848
await $`pnpm nx run-many --target=build --all --exclude="@storm-stack/monorepo" --configuration=production --parallel=5`;
49-
if (!result.ok()) {
49+
if (!result.ok) {
5050
throw new Error(
5151
`An error occured while building the monorepo in production mode: \n\n${result.message}\n`
5252
);
5353
}
5454
} else {
5555
result =
5656
await $`pnpm nx run-many --target=build --all --exclude="@storm-stack/monorepo" --configuration=${configuration} --nxBail`;
57-
if (!result.ok()) {
57+
if (!result.ok) {
5858
throw new Error(
5959
`An error occured while building the monorepo in development mode: \n\n${result.message}\n`
6060
);

tools/scripts/src/format.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ try {
2929
await $`pnpm nx run-many --target=lint,format --all --exclude="@storm-stack/monorepo" --parallel=5`.timeout(
3030
`${30 * 60}s`
3131
);
32-
if (!result.ok()) {
32+
if (!result.ok) {
3333
throw new Error(
3434
`An error occured while formatting the monorepo: \n\n${result.message}\n`
3535
);
@@ -39,7 +39,7 @@ try {
3939
await $`pnpm nx format:write ${files} --sort-root-tsconfig-paths --all`.timeout(
4040
`${30 * 60}s`
4141
);
42-
if (!result.ok()) {
42+
if (!result.ok) {
4343
throw new Error(
4444
`An error occured while running \`nx format:write\` on the monorepo: \n\n${result.message}\n`
4545
);

tools/scripts/src/lint.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ try {
2424
await $`pnpm nx run-many --target=lint --all --exclude="@storm-stack/monorepo" --parallel=5`.timeout(
2525
`${30 * 60}s`
2626
);
27-
if (!result.ok()) {
27+
if (!result.ok) {
2828
throw new Error(
2929
`An error occured while linting the monorepo: \n\n${result.message}\n`
3030
);
@@ -34,7 +34,7 @@ try {
3434
await $`pnpm exec storm-lint all --skip-cspell --skip-circular-deps`.timeout(
3535
`${30 * 60}s`
3636
);
37-
if (!result.ok()) {
37+
if (!result.ok) {
3838
throw new Error(
3939
`An error occured while running \`storm-lint\` on the monorepo: \n\n${result.message}\n`
4040
);

tools/scripts/src/nuke.mjs

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ usePwsh();
2121

2222
try {
2323
let result = await $`pnpm nx clear-cache`.timeout(`${5 * 60}s`);
24-
if (!result.ok()) {
24+
if (!result.ok) {
2525
throw new Error(
2626
`An error occured while clearing Nx cache: \n\n${result.message}\n`
2727
);
@@ -31,7 +31,7 @@ try {
3131
await $`pnpm exec rimraf --no-interactive -- ./.nx/cache ./.nx/workspace-data ./dist ./tmp ./pnpm-lock.yaml`.timeout(
3232
`${5 * 60}s`
3333
);
34-
if (!result.ok()) {
34+
if (!result.ok) {
3535
throw new Error(
3636
`An error occured while removing cache directories: \n\n${result.message}\n`
3737
);
@@ -41,7 +41,7 @@ try {
4141
await $`pnpm exec rimraf --no-interactive --glob "*/**/{node_modules,dist,.storm}`.timeout(
4242
`${5 * 60}s`
4343
);
44-
if (!result.ok()) {
44+
if (!result.ok) {
4545
throw new Error(
4646
`An error occured while removing node modules and build directories from the monorepo's projects: \n\n${result.message}\n`
4747
);
@@ -51,7 +51,7 @@ try {
5151
await $`pnpm exec rimraf --no-interactive --glob "./node_modules/!rimraf/**"`.timeout(
5252
`${5 * 60}s`
5353
);
54-
if (!result.ok()) {
54+
if (!result.ok) {
5555
throw new Error(
5656
`An error occured while removing node modules from the workspace root: \n\n${result.message}\n`
5757
);

0 commit comments

Comments
 (0)