@weaver-wow/cli 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/wvr.mjs +8 -5
  2. package/package.json +1 -1
package/dist/wvr.mjs CHANGED
@@ -3517,7 +3517,7 @@ async function loadConfig() {
3517
3517
  var import_picocolors4 = __toESM(require_picocolors(), 1);
3518
3518
  import { execSync as execSync2 } from "node:child_process";
3519
3519
  import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, existsSync as existsSync4, readdirSync, mkdirSync as mkdirSync2, unlinkSync } from "node:fs";
3520
- import { dirname, join, relative } from "node:path";
3520
+ import { dirname, join, relative, resolve } from "node:path";
3521
3521
  import { createRequire as createRequire2 } from "node:module";
3522
3522
  var require2 = createRequire2(import.meta.url);
3523
3523
  var GENERATED_TSTL_CONFIG = ".tstl.build.json";
@@ -3568,10 +3568,13 @@ async function buildProject(config, silent = false) {
3568
3568
  mkdirSync2("dist");
3569
3569
  const buildConfig = generateBuildConfig(finalEntryPoint);
3570
3570
  try {
3571
+ const tstlPath = resolve("node_modules", "typescript-to-lua", "dist", "tstl.js");
3572
+ const cmd = existsSync4(tstlPath) ? `node "${tstlPath}"` : "npx typescript-to-lua";
3573
+ console.log(`[Weaver] Running: ${cmd}`);
3571
3574
  if (silent) {
3572
- execSync2(`npx tstl -p ${GENERATED_TSTL_CONFIG}`, { stdio: "pipe" });
3575
+ execSync2(`${cmd} -p ${GENERATED_TSTL_CONFIG}`, { stdio: "pipe" });
3573
3576
  } else {
3574
- execSync2(`npx tstl -p ${GENERATED_TSTL_CONFIG}`, { stdio: "inherit" });
3577
+ execSync2(`${cmd} -p ${GENERATED_TSTL_CONFIG}`, { stdio: "inherit" });
3575
3578
  }
3576
3579
  } catch (e) {
3577
3580
  let rawError = (e.stdout?.toString() || "") + (e.stderr?.toString() || "") + (e.message || "");
@@ -3814,7 +3817,7 @@ async function devCommand() {
3814
3817
 
3815
3818
  // src/cli/commands/link.ts
3816
3819
  import { symlinkSync, existsSync as existsSync5, rmSync, statSync, readFileSync as readFileSync3 } from "node:fs";
3817
- import { join as join2, resolve } from "node:path";
3820
+ import { join as join2, resolve as resolve2 } from "node:path";
3818
3821
  var import_picocolors7 = __toESM(require_picocolors(), 1);
3819
3822
  async function linkCommand() {
3820
3823
  Nt(import_picocolors7.default.bgBlue(" \uD83E\uDDF5 Weaver Link "));
@@ -3869,7 +3872,7 @@ async function linkCommand() {
3869
3872
  process.exit(1);
3870
3873
  }
3871
3874
  const targetLinkPath = join2(addonsDir, addonName);
3872
- const sourceDistPath = resolve("dist");
3875
+ const sourceDistPath = resolve2("dist");
3873
3876
  if (!existsSync5(sourceDistPath)) {
3874
3877
  console.error(import_picocolors7.default.red("dist/ folder does not exist. Run 'bun wvr build' first."));
3875
3878
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weaver-wow/cli",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Command line toolchain for building Weaver addons",
5
5
  "bin": {
6
6
  "wvr": "dist/wvr.mjs"