@towns-protocol/generated 0.0.315 → 0.0.317

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/package.json +2 -2
  2. package/scripts/prepare.js +12 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@towns-protocol/generated",
3
- "version": "0.0.315",
3
+ "version": "0.0.317",
4
4
  "packageManager": "yarn@3.8.0",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -26,5 +26,5 @@
26
26
  "publishConfig": {
27
27
  "access": "public"
28
28
  },
29
- "gitHead": "beebbdcf8f7cdd914eb11b4b8318c44c9537a2c7"
29
+ "gitHead": "44a24293d83c383cc2f3a067a66eb99c57faa4db"
30
30
  }
@@ -81,7 +81,10 @@ async function downloadArtifactsFromNpm() {
81
81
  });
82
82
 
83
83
  const files = execSync('ls *.tgz', { cwd: tempDir, encoding: 'utf8' }).trim().split('\n');
84
- execSync(`tar -xzf "${files[0]}" -C "${tempDir}"`, { stdio: 'pipe' });
84
+ execSync(`tar -xzf "${files[0]}" -C "${tempDir}"`, {
85
+ cwd: tempDir,
86
+ stdio: 'pipe'
87
+ });
85
88
 
86
89
  const extractedDevDir = resolve(tempDir, 'package/dev');
87
90
  if (!existsSync(extractedDevDir)) {
@@ -106,6 +109,8 @@ async function downloadArtifactsFromNpm() {
106
109
  console.log('Successfully downloaded artifacts from npm');
107
110
  return true;
108
111
  } catch (error) {
112
+ console.log('Error in downloadArtifactsFromNpm:', error.message);
113
+ console.log('Stack trace:', error.stack);
109
114
  return false;
110
115
  } finally {
111
116
  if (existsSync(tempDir)) execSync(`rm -rf "${tempDir}"`, { stdio: 'pipe' });
@@ -147,6 +152,12 @@ function installFoundry() {
147
152
 
148
153
  // Generate contract artifacts
149
154
  function generateArtifacts() {
155
+ // Check for contracts directory FIRST (before trying to install Foundry)
156
+ if (!existsSync(contractsDir)) {
157
+ console.log('Contracts directory not found, cannot generate locally');
158
+ throw new Error('Cannot generate artifacts: contracts package not available and npm download failed');
159
+ }
160
+
150
161
  if (!isFoundryInstalled()) {
151
162
  console.log('Foundry not found, attempting installation...');
152
163
  if (!installFoundry()) {
@@ -154,12 +165,6 @@ function generateArtifacts() {
154
165
  }
155
166
  }
156
167
 
157
- // Look for build script in contracts package (sibling to generated package)
158
- if (!existsSync(contractsDir)) {
159
- console.log('Contracts directory not found, cannot generate locally');
160
- throw new Error('Cannot generate artifacts: contracts package not available and npm download failed');
161
- }
162
-
163
168
  const buildScript = resolve(contractsDir, 'scripts/build-contract-types.sh');
164
169
 
165
170
  if (!existsSync(buildScript)) {