@reactive-contracts/compiler 0.1.2-beta → 0.1.3-beta

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/index.cli.js +14 -12
  2. package/package.json +3 -3
package/dist/index.cli.js CHANGED
@@ -135,8 +135,7 @@ ${gitignoreTemplate}` : gitignoreTemplate;
135
135
  // src/cli/commands/compile.ts
136
136
  import { glob } from "glob";
137
137
  import * as path2 from "path";
138
- import { pathToFileURL } from "url";
139
- import { register } from "tsx/esm/api";
138
+ import { createJiti } from "jiti";
140
139
 
141
140
  // src/config/index.ts
142
141
  async function loadConfig(_configPath = "./rcontracts.config.ts") {
@@ -825,7 +824,11 @@ ${indentStr}}`;
825
824
  }
826
825
 
827
826
  // src/cli/commands/compile.ts
828
- var tsxUnregister = register();
827
+ var jiti = createJiti(import.meta.url, {
828
+ interopDefault: true,
829
+ moduleCache: false
830
+ // Disable cache to avoid stale imports
831
+ });
829
832
  async function compile() {
830
833
  try {
831
834
  header("Compiling Reactive Contracts");
@@ -850,8 +853,7 @@ async function compile() {
850
853
  const fileName = path2.basename(file, ".contract.ts");
851
854
  start(`Processing ${fileName}...`);
852
855
  try {
853
- const fileUrl = pathToFileURL(file).href;
854
- const module = await import(fileUrl);
856
+ const module = await jiti.import(file);
855
857
  const contractExports = Object.entries(module).filter(
856
858
  ([key, value]) => key.endsWith("Contract") && typeof value === "object" && value !== null && "_brand" in value && value._brand === "Contract"
857
859
  );
@@ -921,7 +923,6 @@ async function compile() {
921
923
  errorCount++;
922
924
  }
923
925
  }
924
- tsxUnregister();
925
926
  console.log("");
926
927
  if (successCount > 0) {
927
928
  success(`\u2713 Successfully compiled ${successCount} contract(s)`);
@@ -942,9 +943,12 @@ async function compile() {
942
943
  // src/cli/commands/validate.ts
943
944
  import { glob as glob2 } from "glob";
944
945
  import * as path3 from "path";
945
- import { pathToFileURL as pathToFileURL2 } from "url";
946
- import { register as register2 } from "tsx/esm/api";
947
- var tsxUnregister2 = register2();
946
+ import { createJiti as createJiti2 } from "jiti";
947
+ var jiti2 = createJiti2(import.meta.url, {
948
+ interopDefault: true,
949
+ moduleCache: false
950
+ // Disable cache to avoid stale imports
951
+ });
948
952
  async function validate() {
949
953
  try {
950
954
  header("Validating Reactive Contracts");
@@ -970,8 +974,7 @@ async function validate() {
970
974
  const fileName = path3.basename(file, ".contract.ts");
971
975
  start(`Validating ${fileName}...`);
972
976
  try {
973
- const fileUrl = pathToFileURL2(file).href;
974
- const module = await import(fileUrl);
977
+ const module = await jiti2.import(file);
975
978
  const contractExports = Object.entries(module).filter(
976
979
  ([key, value]) => key.endsWith("Contract") && typeof value === "object" && value !== null && "_brand" in value && value._brand === "Contract"
977
980
  );
@@ -1031,7 +1034,6 @@ async function validate() {
1031
1034
  invalidCount++;
1032
1035
  }
1033
1036
  }
1034
- tsxUnregister2();
1035
1037
  console.log("");
1036
1038
  console.log("Validation Summary:");
1037
1039
  console.log(` \u2713 Valid: ${validCount}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactive-contracts/compiler",
3
- "version": "0.1.2-beta",
3
+ "version": "0.1.3-beta",
4
4
  "description": "Build-time compiler and validator for Reactive Contracts",
5
5
  "type": "module",
6
6
  "bin": {
@@ -22,11 +22,11 @@
22
22
  "commander": "^14.0.2",
23
23
  "fs-extra": "^11.3.3",
24
24
  "glob": "^13.0.0",
25
+ "jiti": "^2.4.2",
25
26
  "ora": "^9.0.0",
26
27
  "picocolors": "^1.1.1",
27
- "tsx": "^4.21.0",
28
28
  "zod": "^4.3.5",
29
- "@reactive-contracts/core": "0.1.2-beta"
29
+ "@reactive-contracts/core": "0.1.3-beta"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/fs-extra": "^11.0.4",