@lightprotocol/zk-compression-cli 0.15.2 → 0.17.0

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.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -11,7 +11,6 @@ const psp_utils_1 = require("../../psp-utils");
11
11
  const constants_1 = require("../../utils/constants");
12
12
  const utils_1 = require("../../utils");
13
13
  const case_anything_1 = require("case-anything");
14
- const child_process_1 = require("child_process");
15
14
  class InitCommand extends core_1.Command {
16
15
  async run() {
17
16
  const { args, flags } = await this.parse(InitCommand);
@@ -40,13 +39,14 @@ const initRepo = async (name, flags) => {
40
39
  const kebabCaseName = (0, case_anything_1.kebabCase)(name);
41
40
  const snakeCaseName = (0, case_anything_1.snakeCase)(name);
42
41
  const camelCaseName = (0, case_anything_1.pascalCase)(name);
43
- // Set up environment variables for macOS builds
42
+ let command = localFilePath;
43
+ let env = { ...process.env };
44
44
  if (os.platform() === "darwin") {
45
- process.env.CC = (0, child_process_1.execSync)("xcrun -find clang").toString().trim();
46
- process.env.SDKROOT = (0, child_process_1.execSync)("xcrun --show-sdk-path").toString().trim();
45
+ const cpathExport = 'export CPATH="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include:$CPATH"';
46
+ command = `${cpathExport} && ${command}`;
47
47
  }
48
48
  await (0, process_1.executeCommand)({
49
- command: localFilePath,
49
+ command,
50
50
  args: [
51
51
  "generate",
52
52
  "--name",
@@ -91,8 +91,24 @@ const initRepo = async (name, flags) => {
91
91
  `tokio-version=${constants_1.TOKIO_VERSION}`,
92
92
  ],
93
93
  logFile: true,
94
- env: process.env,
94
+ env: env,
95
95
  });
96
+ if (os.platform() === "darwin") {
97
+ console.log(`
98
+ 🧢 Important for macOS users 🧢
99
+ ---------------------------
100
+ 1. Run this command in your terminal:
101
+ export CPATH="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include:$CPATH"
102
+
103
+ 2. To persist this change:
104
+ • Zsh users (default): Add the line to ~/.zshrc
105
+ • Bash users: Add the line to ~/.bash_profile
106
+
107
+ 3. Apply changes:
108
+ • Zsh: Run 'source ~/.zshrc'
109
+ • Bash: Run 'source ~/.bash_profile'
110
+ `.trim());
111
+ }
96
112
  await (0, stateless_js_1.sleep)(1000);
97
113
  };
98
114
  exports.initRepo = initRepo;
@@ -29,4 +29,4 @@ export declare const LIGHT_CLIENT_VERSION = "0.9.1";
29
29
  export declare const LIGHT_TEST_UTILS_VERSION = "1.2.1";
30
30
  export declare const SOLANA_PROGRAM_TEST_VERSION = "1.18.22";
31
31
  export declare const TOKIO_VERSION = "1.36.0";
32
- export declare const COMPRESSED_PROGRAM_TEMPLATE_TAG = "v0.1.1";
32
+ export declare const COMPRESSED_PROGRAM_TEMPLATE_TAG = "v0.1.2";
@@ -34,4 +34,4 @@ exports.LIGHT_CLIENT_VERSION = "0.9.1";
34
34
  exports.LIGHT_TEST_UTILS_VERSION = "1.2.1";
35
35
  exports.SOLANA_PROGRAM_TEST_VERSION = "1.18.22";
36
36
  exports.TOKIO_VERSION = "1.36.0";
37
- exports.COMPRESSED_PROGRAM_TEMPLATE_TAG = "v0.1.1";
37
+ exports.COMPRESSED_PROGRAM_TEMPLATE_TAG = "v0.1.2";
@@ -35,14 +35,18 @@ async function killProcessByPort(port) {
35
35
  */
36
36
  async function executeCommand({ command, args, additionalPath, logFile = true, env, }) {
37
37
  return new Promise((resolve, reject) => {
38
- const commandBase = path_1.default.basename(command);
38
+ const commandParts = command.split(' && ');
39
+ const finalCommand = commandParts.pop() || '';
40
+ const preCommands = commandParts.join(' && ');
41
+ const fullCommand = preCommands ? `${preCommands} && ${finalCommand} ${args.join(' ')}` : `${finalCommand} ${args.join(' ')}`;
42
+ const commandBase = path_1.default.basename(finalCommand);
39
43
  let stdoutData = "";
40
44
  const childPathEnv = additionalPath
41
45
  ? process.env.PATH + path_1.default.delimiter + additionalPath
42
46
  : process.env.PATH;
43
47
  const options = {
44
- env: env ||
45
- (childPathEnv ? { ...process.env, PATH: childPathEnv } : process.env),
48
+ env: env || (childPathEnv ? { ...process.env, PATH: childPathEnv } : process.env),
49
+ shell: true,
46
50
  detached: true,
47
51
  };
48
52
  let logStream = null;
@@ -52,14 +56,12 @@ async function executeCommand({ command, args, additionalPath, logFile = true, e
52
56
  if (!fs_1.default.existsSync(folderName)) {
53
57
  fs_1.default.mkdirSync(folderName);
54
58
  }
55
- logStream = fs_1.default.createWriteStream(file, {
56
- flags: "a",
57
- });
59
+ logStream = fs_1.default.createWriteStream(file, { flags: "a" });
58
60
  }
59
- console.log(`Executing command ${commandBase} ${args}...`);
61
+ console.log(`Executing command: ${fullCommand}`);
60
62
  let childProcess;
61
63
  try {
62
- childProcess = (0, child_process_1.spawn)(command, args, options);
64
+ childProcess = (0, child_process_1.spawn)(fullCommand, [], options);
63
65
  }
64
66
  catch (e) {
65
67
  throw new Error(`Failed to execute command ${commandBase}: ${e}`);
@@ -98,96 +98,6 @@
98
98
  "index.js"
99
99
  ]
100
100
  },
101
- "compress-sol": {
102
- "aliases": [],
103
- "args": {},
104
- "examples": [
105
- "$ light compress-sol --to PublicKey --amount 10"
106
- ],
107
- "flags": {
108
- "to": {
109
- "description": "Specify the recipient address.",
110
- "name": "to",
111
- "required": true,
112
- "hasDynamicHelp": false,
113
- "multiple": false,
114
- "type": "option"
115
- },
116
- "amount": {
117
- "description": "Amount to compress, in lamports.",
118
- "name": "amount",
119
- "required": true,
120
- "hasDynamicHelp": false,
121
- "multiple": false,
122
- "type": "option"
123
- }
124
- },
125
- "hasDynamicHelp": false,
126
- "hiddenAliases": [],
127
- "id": "compress-sol",
128
- "pluginAlias": "@lightprotocol/zk-compression-cli",
129
- "pluginName": "@lightprotocol/zk-compression-cli",
130
- "pluginType": "core",
131
- "strict": true,
132
- "summary": "Compress SOL.",
133
- "enableJsonFlag": false,
134
- "isESM": false,
135
- "relativePath": [
136
- "dist",
137
- "commands",
138
- "compress-sol",
139
- "index.js"
140
- ]
141
- },
142
- "compress-spl": {
143
- "aliases": [],
144
- "args": {},
145
- "examples": [
146
- "$ light compress-spl --mint PublicKey --to PublicKey --amount 10"
147
- ],
148
- "flags": {
149
- "mint": {
150
- "description": "Specify the mint address.",
151
- "name": "mint",
152
- "required": true,
153
- "hasDynamicHelp": false,
154
- "multiple": false,
155
- "type": "option"
156
- },
157
- "to": {
158
- "description": "Specify the recipient address (owner of destination compressed token account).",
159
- "name": "to",
160
- "required": true,
161
- "hasDynamicHelp": false,
162
- "multiple": false,
163
- "type": "option"
164
- },
165
- "amount": {
166
- "description": "Amount to compress, in tokens.",
167
- "name": "amount",
168
- "required": true,
169
- "hasDynamicHelp": false,
170
- "multiple": false,
171
- "type": "option"
172
- }
173
- },
174
- "hasDynamicHelp": false,
175
- "hiddenAliases": [],
176
- "id": "compress-spl",
177
- "pluginAlias": "@lightprotocol/zk-compression-cli",
178
- "pluginName": "@lightprotocol/zk-compression-cli",
179
- "pluginType": "core",
180
- "strict": true,
181
- "summary": "Compress SPL tokens.",
182
- "enableJsonFlag": false,
183
- "isESM": false,
184
- "relativePath": [
185
- "dist",
186
- "commands",
187
- "compress-spl",
188
- "index.js"
189
- ]
190
- },
191
101
  "config:config": {
192
102
  "aliases": [],
193
103
  "args": {},
@@ -377,6 +287,96 @@
377
287
  "index.js"
378
288
  ]
379
289
  },
290
+ "compress-spl": {
291
+ "aliases": [],
292
+ "args": {},
293
+ "examples": [
294
+ "$ light compress-spl --mint PublicKey --to PublicKey --amount 10"
295
+ ],
296
+ "flags": {
297
+ "mint": {
298
+ "description": "Specify the mint address.",
299
+ "name": "mint",
300
+ "required": true,
301
+ "hasDynamicHelp": false,
302
+ "multiple": false,
303
+ "type": "option"
304
+ },
305
+ "to": {
306
+ "description": "Specify the recipient address (owner of destination compressed token account).",
307
+ "name": "to",
308
+ "required": true,
309
+ "hasDynamicHelp": false,
310
+ "multiple": false,
311
+ "type": "option"
312
+ },
313
+ "amount": {
314
+ "description": "Amount to compress, in tokens.",
315
+ "name": "amount",
316
+ "required": true,
317
+ "hasDynamicHelp": false,
318
+ "multiple": false,
319
+ "type": "option"
320
+ }
321
+ },
322
+ "hasDynamicHelp": false,
323
+ "hiddenAliases": [],
324
+ "id": "compress-spl",
325
+ "pluginAlias": "@lightprotocol/zk-compression-cli",
326
+ "pluginName": "@lightprotocol/zk-compression-cli",
327
+ "pluginType": "core",
328
+ "strict": true,
329
+ "summary": "Compress SPL tokens.",
330
+ "enableJsonFlag": false,
331
+ "isESM": false,
332
+ "relativePath": [
333
+ "dist",
334
+ "commands",
335
+ "compress-spl",
336
+ "index.js"
337
+ ]
338
+ },
339
+ "compress-sol": {
340
+ "aliases": [],
341
+ "args": {},
342
+ "examples": [
343
+ "$ light compress-sol --to PublicKey --amount 10"
344
+ ],
345
+ "flags": {
346
+ "to": {
347
+ "description": "Specify the recipient address.",
348
+ "name": "to",
349
+ "required": true,
350
+ "hasDynamicHelp": false,
351
+ "multiple": false,
352
+ "type": "option"
353
+ },
354
+ "amount": {
355
+ "description": "Amount to compress, in lamports.",
356
+ "name": "amount",
357
+ "required": true,
358
+ "hasDynamicHelp": false,
359
+ "multiple": false,
360
+ "type": "option"
361
+ }
362
+ },
363
+ "hasDynamicHelp": false,
364
+ "hiddenAliases": [],
365
+ "id": "compress-sol",
366
+ "pluginAlias": "@lightprotocol/zk-compression-cli",
367
+ "pluginName": "@lightprotocol/zk-compression-cli",
368
+ "pluginType": "core",
369
+ "strict": true,
370
+ "summary": "Compress SOL.",
371
+ "enableJsonFlag": false,
372
+ "isESM": false,
373
+ "relativePath": [
374
+ "dist",
375
+ "commands",
376
+ "compress-sol",
377
+ "index.js"
378
+ ]
379
+ },
380
380
  "decompress-sol": {
381
381
  "aliases": [],
382
382
  "args": {},
@@ -831,5 +831,5 @@
831
831
  ]
832
832
  }
833
833
  },
834
- "version": "0.15.2"
834
+ "version": "0.17.0"
835
835
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightprotocol/zk-compression-cli",
3
- "version": "0.15.2",
3
+ "version": "0.17.0",
4
4
  "description": "ZK Compression: Secure Scaling on Solana",
5
5
  "maintainers": [
6
6
  {
@@ -44,9 +44,9 @@
44
44
  "tweetnacl": "^1.0.3",
45
45
  "wait-on": "^7.2.0",
46
46
  "which": "^4.0.0",
47
+ "@lightprotocol/compressed-token": "0.13.0",
47
48
  "@lightprotocol/hasher.rs": "0.2.0",
48
- "@lightprotocol/stateless.js": "0.13.0",
49
- "@lightprotocol/compressed-token": "0.13.0"
49
+ "@lightprotocol/stateless.js": "0.13.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@oclif/test": "2.3.9",