@latticexyz/cli 2.0.0-alpha.0 → 2.0.0-alpha.1

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 (82) hide show
  1. package/dist/chunk-6V563IAZ.js +283 -0
  2. package/dist/{chunk-ATAWDHWC.js → chunk-FPG73MVN.js} +5 -1
  3. package/dist/{chunk-O6HOO6WA.js → chunk-L4YLJHLJ.js} +1 -9
  4. package/dist/{chunk-J4DJQNIC.js → chunk-SKNB74MT.js} +129 -568
  5. package/dist/chunk-VQTZJIFF.js +353 -0
  6. package/dist/chunk-WZFXLDPK.js +761 -0
  7. package/dist/chunk-YL4GJLLL.js +26139 -0
  8. package/dist/chunk-ZSZDPSLH.js +3841 -0
  9. package/dist/index.d.ts +2 -3
  10. package/dist/index.js +0 -21
  11. package/dist/mud.d.ts +1 -1
  12. package/dist/mud.js +326 -4452
  13. package/dist/mud2.d.ts +1 -0
  14. package/dist/mud2.js +25 -0
  15. package/dist/render-solidity/index.d.ts +171 -0
  16. package/dist/render-solidity/index.js +49 -0
  17. package/dist/render-ts/index.d.ts +26 -0
  18. package/dist/render-ts/index.js +14 -0
  19. package/dist/utils/deprecated/index.js +3 -3
  20. package/dist/utils/index.d.ts +13 -18
  21. package/dist/utils/index.js +14 -16
  22. package/package.json +20 -21
  23. package/src/commands/deploy-v2.ts +80 -64
  24. package/src/commands/deprecated/index.ts +22 -0
  25. package/src/commands/deprecated/test.ts +1 -1
  26. package/src/commands/gas-report.ts +54 -55
  27. package/src/commands/index.ts +6 -17
  28. package/src/commands/set-version.ts +172 -0
  29. package/src/commands/tablegen.ts +5 -5
  30. package/src/commands/test-v2.ts +71 -0
  31. package/src/commands/tsgen.ts +33 -0
  32. package/src/commands/worldgen.ts +5 -4
  33. package/src/contracts/BulkUpload.sol +13 -20
  34. package/src/contracts/Deploy.sol +3 -3
  35. package/src/contracts/LibDeploy.sol +1 -1
  36. package/src/contracts/LibDeployStub.sol +1 -1
  37. package/src/index.ts +1 -15
  38. package/src/mud.ts +4 -3
  39. package/src/mud2.ts +29 -0
  40. package/src/render-solidity/common.ts +4 -4
  41. package/src/render-solidity/field.ts +25 -2
  42. package/src/render-solidity/record.ts +14 -10
  43. package/src/render-solidity/renderSystemInterface.ts +4 -4
  44. package/src/render-solidity/renderTableIndex.ts +15 -0
  45. package/src/render-solidity/renderTypesFromConfig.ts +1 -1
  46. package/src/render-solidity/tableOptions.ts +2 -2
  47. package/src/render-solidity/tablegen.ts +15 -13
  48. package/src/render-solidity/types.ts +2 -1
  49. package/src/render-solidity/userType.ts +1 -2
  50. package/src/render-solidity/worldgen.ts +8 -9
  51. package/src/render-ts/index.ts +5 -0
  52. package/src/render-ts/recsV1TableOptions.ts +39 -0
  53. package/src/render-ts/renderRecsV1Tables.ts +31 -0
  54. package/src/render-ts/schemaTypesToRecsTypeStrings.ts +202 -0
  55. package/src/render-ts/tsgen.ts +12 -0
  56. package/src/render-ts/types.ts +13 -0
  57. package/src/utils/contractToInterface.ts +5 -3
  58. package/src/utils/deploy-v2.ts +90 -84
  59. package/src/utils/errors.ts +3 -34
  60. package/src/utils/format.ts +6 -0
  61. package/src/utils/formatAndWrite.ts +11 -2
  62. package/src/utils/foundry.ts +9 -0
  63. package/src/utils/index.ts +1 -0
  64. package/dist/chunk-O57QENJ6.js +0 -23039
  65. package/dist/chunk-SLIMIO4Z.js +0 -14358
  66. package/dist/config/index.d.ts +0 -763
  67. package/dist/config/index.js +0 -83
  68. package/src/config/commonSchemas.ts +0 -34
  69. package/src/config/dynamicResolution.ts +0 -49
  70. package/src/config/index.ts +0 -24
  71. package/src/config/loadConfig.ts +0 -39
  72. package/src/config/loadStoreConfig.ts +0 -18
  73. package/src/config/parseStoreConfig.test-d.ts +0 -40
  74. package/src/config/parseStoreConfig.ts +0 -314
  75. package/src/config/validation.ts +0 -163
  76. package/src/config/world/index.ts +0 -4
  77. package/src/config/world/loadWorldConfig.test-d.ts +0 -11
  78. package/src/config/world/loadWorldConfig.ts +0 -26
  79. package/src/config/world/parseWorldConfig.ts +0 -55
  80. package/src/config/world/resolveWorldConfig.ts +0 -80
  81. package/src/config/world/userTypes.ts +0 -72
  82. package/src/utils/typeUtils.ts +0 -17
@@ -31,3 +31,9 @@ export async function formatSolidity(content: string, prettierConfigPath?: strin
31
31
  return content;
32
32
  }
33
33
  }
34
+
35
+ export async function formatTypescript(content: string) {
36
+ return prettier.format(content, {
37
+ parser: "typescript",
38
+ });
39
+ }
@@ -1,8 +1,8 @@
1
1
  import { mkdirSync, writeFileSync } from "fs";
2
2
  import { dirname } from "path";
3
- import { formatSolidity } from "./format.js";
3
+ import { formatSolidity, formatTypescript } from "./format.js";
4
4
 
5
- export async function formatAndWrite(output: string, fullOutputPath: string, logPrefix: string) {
5
+ export async function formatAndWriteSolidity(output: string, fullOutputPath: string, logPrefix: string) {
6
6
  const formattedOutput = await formatSolidity(output);
7
7
 
8
8
  mkdirSync(dirname(fullOutputPath), { recursive: true });
@@ -10,3 +10,12 @@ export async function formatAndWrite(output: string, fullOutputPath: string, log
10
10
  writeFileSync(fullOutputPath, formattedOutput);
11
11
  console.log(`${logPrefix}: ${fullOutputPath}`);
12
12
  }
13
+
14
+ export async function formatAndWriteTypescript(output: string, fullOutputPath: string, logPrefix: string) {
15
+ const formattedOutput = await formatTypescript(output);
16
+
17
+ mkdirSync(dirname(fullOutputPath), { recursive: true });
18
+
19
+ writeFileSync(fullOutputPath, formattedOutput);
20
+ console.log(`${logPrefix}: ${fullOutputPath}`);
21
+ }
@@ -92,3 +92,12 @@ export async function cast(args: string[], options?: { profile?: string }): Prom
92
92
  env: { FOUNDRY_PROFILE: options?.profile },
93
93
  });
94
94
  }
95
+
96
+ /**
97
+ * Start an anvil chain
98
+ * @param args The arguments to pass to anvil
99
+ * @returns Stdout of the command
100
+ */
101
+ export async function anvil(args: string[]): Promise<string> {
102
+ return execLog("anvil", args);
103
+ }
@@ -1,4 +1,5 @@
1
1
  export * from "./errors.js";
2
2
  export * from "./foundry.js";
3
3
  export * from "./format.js";
4
+ export * from "./formatAndWrite.js";
4
5
  export * from "./deploy-v2.js";