fix platform

This commit is contained in:
rizrmd 2024-05-28 14:14:11 +07:00
parent 9b543bc391
commit b33b7c3db6
4 changed files with 23 additions and 5 deletions

View File

@ -8,6 +8,7 @@ import { user } from "../../../entity/user";
import { conns } from "../../../entity/conn";
import { sendWS } from "../../../sync-handler";
import { SyncType } from "../../../type";
import { platform } from "os";
export const initTypings = async (
root: string,
id_site: string,
@ -42,7 +43,9 @@ export const initTypings = async (
spawn: Bun.spawn({
cmd: [
...`${dir.path(
"node_modules/.bin/tsc"
platform() === "win32"
? "node_modules/.bin/tsc.exe"
: "node_modules/.bin/tsc"
)} --watch --moduleResolution node --emitDeclarationOnly --outFile ../typings.d.ts --declaration --noEmit false`.split(
" "
),

View File

@ -2,9 +2,10 @@ import { createId } from "@paralleldrive/cuid2";
import brotliPromise from "brotli-wasm";
import { Glob, spawn } from "bun";
import { dir } from "dir";
import { build, context } from "esbuild";
import { build } from "esbuild";
import { fdir } from "fdir";
import { statSync } from "fs";
import { platform } from "os";
import {
copyAsync,
existsAsync,
@ -53,7 +54,11 @@ if (build_all) {
const args = [
"node",
dir.path("node_modules/.bin/parcel"),
dir.path(
platform() === "win32"
? "node_modules/.bin/parcel.exe"
: "node_modules/.bin/parcel"
),
"build",
"./src/index.tsx",
// "--no-optimize",

View File

@ -2,6 +2,7 @@ import { spawn } from "bun";
import { existsAsync, readAsync } from "fs-jetpack";
import { dir } from "../../utils/dir";
import { g } from "../../utils/global";
import { platform } from "os";
export const prepareAPITypes = async () => {
const out: string[] = [];
@ -36,7 +37,11 @@ export const ${name} = {
const args = [
process.execPath,
dir.path("node_modules/.bin/tsc"),
dir.path(
platform() === "win32"
? "node_modules/.bin/tsc.exe"
: "node_modules/.bin/tsc"
),
dir.path("app/srv/exports.ts"),
"--declaration",
"--emitDeclarationOnly",

View File

@ -2,6 +2,7 @@ import { spawn } from "bun";
import { dirAsync } from "fs-jetpack";
import { dir } from "./dir";
import { g } from "./global";
import { platform } from "os";
const decoder = new TextDecoder();
export const parcelBuild = async () => {
@ -9,7 +10,11 @@ export const parcelBuild = async () => {
const args = [
"node",
dir.path("node_modules/.bin/parcel"),
dir.path(
platform() === "win32"
? "node_modules/.bin/parcel.exe"
: "node_modules/.bin/parcel"
),
g.mode === "dev" ? "watch" : "build",
"./src/index.tsx",
g.mode === "dev" ? "--no-hmr" : "--no-optimize",