Skip to content

Commit d092317

Browse files
chore(release): 0.3.0 [skip ci]
# [0.3.0](v0.2.4...v0.3.0) (2023-11-27) ### Features * added set command to handle ArNS record setting ([#17](#17)) ([7633427](7633427))
1 parent 7633427 commit d092317

File tree

1 file changed

+35
-37
lines changed

1 file changed

+35
-37
lines changed

dist/index.js

Lines changed: 35 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -73658,34 +73658,26 @@ async function buildManifest (files, buildDir, signer) {
7365873658
}
7365973659

7366073660
;// CONCATENATED MODULE: ./src/utils/getContentTypeByExtension.js
73661+
const CONTENT_TYPE_MAPPING = {
73662+
'.html': 'text/html',
73663+
'.txt': 'text/plain',
73664+
'.css': 'text/css',
73665+
'.js': 'application/javascript',
73666+
'.js.map': 'application/json',
73667+
'.json': 'application/json',
73668+
'.png': 'image/png',
73669+
'.ico': 'image/x-icon',
73670+
'.jpg': 'image/jpeg',
73671+
'.jpeg': 'image/jpeg',
73672+
'.gif': 'image/gif',
73673+
'.svg': 'image/svg+xml',
73674+
}
73675+
7366173676
function getContentTypeByExtension(ext) {
73662-
switch (ext.toLowerCase()) {
73663-
case '.html':
73664-
return 'text/html'
73665-
case '.txt':
73666-
return 'text/plain'
73667-
case '.css':
73668-
return 'text/css'
73669-
case '.js':
73670-
return 'application/javascript'
73671-
case '.js.map':
73672-
return 'application/json'
73673-
case '.json':
73674-
return 'application/json'
73675-
case '.png':
73676-
return 'image/png'
73677-
case '.ico':
73678-
return 'image/x-icon'
73679-
case '.jpg':
73680-
case '.jpeg':
73681-
return 'image/jpeg'
73682-
case '.gif':
73683-
return 'image/gif'
73684-
case '.svg':
73685-
return 'image/svg+xml'
73686-
default:
73687-
return 'application/octet-stream' // default to binary data
73688-
}
73677+
const extension = ext.toLowerCase()
73678+
return CONTENT_TYPE_MAPPING[extension]
73679+
? CONTENT_TYPE_MAPPING[extension]
73680+
: 'application/octet-stream'
7368973681
}
7369073682

7369173683
;// CONCATENATED MODULE: ./src/utils/createDataItem.js
@@ -73818,34 +73810,40 @@ async function upload(buildDir, privateKey, dryRun) {
7381873810
const txId = await executeTransaction(tx, arweave, dryRun)
7381973811

7382073812
if (dryRun) {
73821-
return 1
73813+
return {
73814+
result: 'dry-run',
73815+
manifestId: manifestDataItem.id
73816+
}
7382273817
}
7382373818
console.log(`Wait for tx ${txId}...`)
73824-
let response = await arweave.transactions.getStatus(txId)
73819+
let result = await arweave.transactions.getStatus(txId)
7382573820

7382673821
console.log(
7382773822
'----> number_of_confirmations:',
73828-
response.confirmed?.number_of_confirmations,
73823+
result.confirmed?.number_of_confirmations,
7382973824
)
73830-
while (!response.confirmed?.number_of_confirmations > 0) {
73825+
while (!result.confirmed?.number_of_confirmations > 0) {
7383173826
console.log(
73832-
`${txId} confirmations: ${response.confirmed?.number_of_confirmations}`,
73827+
`${txId} confirmations: ${result.confirmed?.number_of_confirmations}`,
7383373828
)
7383473829
await sleep(1000 * 5)
73835-
response = await arweave.transactions.getStatus(txId)
73830+
result = await arweave.transactions.getStatus(txId)
7383673831
}
7383773832
console.log(`https://viewblock.io/arweave/tx/${txId}`)
7383873833
console.log(`${txId} confirmed`)
7383973834
console.log(
7384073835
` ${txId} number_of_confirmations:`,
73841-
response.confirmed.number_of_confirmations,
73836+
result.confirmed.number_of_confirmations,
7384273837
)
73843-
console.log(` tx ${txId} block_height:`, response.confirmed.block_height)
73838+
console.log(` tx ${txId} block_height:`, result.confirmed.block_height)
7384473839
console.log(
7384573840
` tx ${txId} block_indep_hash:`,
73846-
response.confirmed.block_indep_hash,
73841+
result.confirmed.block_indep_hash,
7384773842
)
73848-
return response.confirmed
73843+
return {
73844+
result,
73845+
manifestId: manifestDataItem.id
73846+
}
7384973847
}
7385073848

7385173849

0 commit comments

Comments
 (0)