Skip to content

Commit

Permalink
add orderedPaths, rerun yarn, add personal deploy script, fix ts errors
Browse files Browse the repository at this point in the history
  • Loading branch information
lostadam committed Aug 25, 2023
1 parent bf50062 commit 7508df4
Show file tree
Hide file tree
Showing 5 changed files with 1,250 additions and 3,144 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Publish arkb

on:
push:
branches:
- main

jobs:
publish:
uses: lost-worlds/.github/.github/workflows/deploy-package.yaml@main
secrets: inherit
22 changes: 0 additions & 22 deletions .github/workflows/deploy.yml

This file was deleted.

12 changes: 3 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "arkb",
"version": "1.1.60",
"name": "@lost-worlds/arkb",
"version": "1.1.90",
"main": "./bin/app.js",
"repository": "https://github.com/textury/arkb.git",
"author": "Cedrik <cedrik.git@tryninja.io>",
Expand All @@ -13,17 +13,11 @@
},
"scripts": {
"start": "node ./bin/app.js",
"predev": "yarn build",
"dev": "node ./bin/app.js",
"prebuild": "rimraf bin",
"build": "tsc",
"format": "prettier --write \"src/**/*.ts\"",
"lint": "tslint -p tsconfig.json",
"prepare": "npm run build && husky install",
"prepublishOnly": "npm run lint",
"preversion": "npm run lint",
"version": "npm run format && git add -A src",
"postversion": "git push && git push --tags"
"lint": "tslint -p tsconfig.json"
},
"engines": {
"node": ">=15.11.0",
Expand Down
19 changes: 14 additions & 5 deletions src/lib/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ export default class Deploy {
feeMultiplier?: number,
forceRedeploy: boolean = false,
colors: boolean = true,
orderedPaths: string[] = [],
mimeType: string = '',
) {
this.txs = [];

Expand Down Expand Up @@ -151,7 +153,7 @@ export default class Deploy {
}
}

const type = mime.getType(filePath) || 'application/octet-stream';
const type = mime.getType(filePath) || mimeType || 'application/octet-stream';
const newTags = new Tags();
for (const tag of tags.tags) {
newTags.addTag(tag.name, tag.value);
Expand Down Expand Up @@ -205,14 +207,14 @@ export default class Deploy {
}

// Don't allow manifest build
if (!isFile) await this.buildManifest(dir, index, tags, useBundler, feeMultiplier);
if (!isFile) await this.buildManifest(dir, index, tags, useBundler, feeMultiplier, orderedPaths);

if (this.logs) countdown.stop();

if (useBundler || this.localBundle) {
this.bundle = await this.bundler.bundleAndSign(this.txs.map((t) => t.tx) as FileDataItem[]);

this.bundledTx = (await this.bundle.toTransaction({}, this.arweave, this.wallet)) as any;
this.bundledTx = (await this.bundle.toTransaction({}, this.arweave as any, this.wallet)) as any;

await this.arweave.transactions.sign(this.bundledTx as unknown as ArweaveTransaction, this.wallet);
}
Expand Down Expand Up @@ -325,8 +327,7 @@ export default class Deploy {
console.log(parseColor(colors, 'Failed to deploy data item: ' + txData.filePath, 'red'));
}
} else if (this.localBundle) {
console.log('inside');
const txRes = await this.bundle.signAndSubmit(this.arweave, this.wallet);
const txRes = await this.bundle.signAndSubmit(this.arweave as any, this.wallet);
console.log(txRes);
deployed = true;
}
Expand Down Expand Up @@ -409,6 +410,7 @@ export default class Deploy {
tags: Tags,
useBundler: string,
feeMultiplier: number,
orderedPaths: string[],
) {
const { results: pDuplicates } = await PromisePool.for(this.duplicates)
.withConcurrency(this.threads)
Expand Down Expand Up @@ -442,6 +444,13 @@ export default class Deploy {
}
}

if (orderedPaths) {
orderedPaths.forEach((orderedPath, indexOfPath) => {
if (!paths[orderedPath]) throw Error(`${orderedPath} does not exist as a valid path! ${JSON.stringify(paths)}`);
paths[indexOfPath] = paths[orderedPath];
});
}

const data = {
manifest: 'arweave/paths',
version: '0.1.0',
Expand Down
Loading

0 comments on commit 7508df4

Please sign in to comment.