@towns-protocol/generated 0.0.339 → 0.0.342
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.
- package/package.json +4 -5
- package/scripts/copy-addresses.sh +1 -1
- package/scripts/make-config.js +14 -4
package/package.json
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@towns-protocol/generated",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.342",
|
|
4
4
|
"packageManager": "yarn@3.8.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build": "node ./scripts/prepare.js
|
|
7
|
+
"build": "node ./scripts/prepare.js",
|
|
8
8
|
"make-config": "node ./scripts/make-config.js",
|
|
9
|
-
"preinstall": "node ./scripts/make-config.js",
|
|
10
9
|
"prepare": "node ./scripts/prepare.js"
|
|
11
10
|
},
|
|
12
11
|
"devDependencies": {
|
|
13
|
-
"@towns-protocol/contracts": "^0.0.
|
|
12
|
+
"@towns-protocol/contracts": "^0.0.342"
|
|
14
13
|
},
|
|
15
14
|
"files": [
|
|
16
15
|
"config/**/*",
|
|
@@ -29,5 +28,5 @@
|
|
|
29
28
|
"publishConfig": {
|
|
30
29
|
"access": "public"
|
|
31
30
|
},
|
|
32
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "bc68bd20b3176ef9ece012adf2c4a8dba0726032"
|
|
33
32
|
}
|
package/scripts/make-config.js
CHANGED
|
@@ -66,6 +66,7 @@ function makeEnvFile(key, outputData, fileName, keyPrefix = '') {
|
|
|
66
66
|
const data = outputData[key];
|
|
67
67
|
const envData = convertToEnv(data, keyPrefix);
|
|
68
68
|
fs.writeFileSync(envFile, `${keyPrefix}RIVER_ENV=${key}\n${envData}`);
|
|
69
|
+
return envFile;
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
const outputData = combineJson(deploymentsSourceDir);
|
|
@@ -74,12 +75,21 @@ const outputData = combineJson(deploymentsSourceDir);
|
|
|
74
75
|
// for each top level key in outputData, write a .env file in the deployments/<key> folder
|
|
75
76
|
// with all keys in the json converted to UPPER SNAKE CASE
|
|
76
77
|
for (const key of Object.keys(outputData)) {
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
const files = [
|
|
79
|
+
makeEnvFile(key, outputData, '.env', ''),
|
|
80
|
+
makeEnvFile(key, outputData, '.env.vite', 'VITE_')
|
|
81
|
+
];
|
|
82
|
+
console.log(`Wrote "${key}" env files at ${files.join(', ')}`);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// delete the local_ environments from the outputData
|
|
86
|
+
for (const key of Object.keys(outputData)) {
|
|
87
|
+
if (key.startsWith('local')) {
|
|
88
|
+
delete outputData[key];
|
|
89
|
+
}
|
|
79
90
|
}
|
|
80
91
|
|
|
81
92
|
// write a config.json file
|
|
82
93
|
fs.mkdirSync(path.dirname(deploymentsOutputFile), { recursive: true });
|
|
83
94
|
fs.writeFileSync(deploymentsOutputFile, JSON.stringify(outputData, null, 2));
|
|
84
|
-
|
|
85
|
-
console.log(`Combined deployments config JSON written to ${deploymentsOutputFile}`);
|
|
95
|
+
console.log(`Combined deployments for [${Object.keys(outputData).join(', ')}] JSON written to ${deploymentsOutputFile}`);
|