Skip to content

Commit b18ec76

Browse files
committed
'bump'
1 parent 459c75f commit b18ec76

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dequanto",
3-
"version": "0.1.20",
3+
"version": "0.1.21",
44
"author": {
55
"name": "Alex Kit",
66
"email": "alex.kit@atmajs.com"

src/gen/Generator.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ export interface IGenerateOptions {
4545

4646
output?: string
4747

48+
outputFileExt?: string
49+
4850
location?: string
4951

5052
/**
@@ -216,6 +218,7 @@ export class Generator {
216218
contractName: sources?.contractName,
217219
address: address,
218220
output: output,
221+
outputFileExt: this.options.outputFileExt,
219222
implementation: implementation,
220223
sources: sources?.files,
221224
sourceMain: sourceMain,

src/gen/GeneratorFromAbi.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export class GeneratorFromAbi {
3030
contractName: string
3131
address: TAddress
3232
output: string
33+
outputFileExt?: string
3334
implementation: TAddress
3435
saveAbi?: boolean
3536
saveSources?: boolean
@@ -204,7 +205,7 @@ export class GeneratorFromAbi {
204205
let outputFilename = /[^\\/]+$/.exec(name)[0];
205206
let outputPath = /\.(ts|js)$/.test(opts.output)
206207
? opts.output
207-
: class_Uri.combine(opts.output, outputDirectory, `${outputFilename}.${targetType}`);
208+
: class_Uri.combine(opts.output, outputDirectory, `${outputFilename}.${opts.outputFileExt ?? targetType}`);
208209

209210
let meta = {
210211
artifact: opts.artifact
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { WETH } from './0xc/eth/WETH/WETH.js';
1+
import { WETH } from './0xc/eth/WETH/WETH.mjs';
22
import { Config } from 'dequanto/config/Config'
33

4-
//await Config.fetch();
54

65
const decimals = await new WETH().decimals();
7-
86
console.log(`WETH decimals: ${decimals}`);

test/package/lib.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ UTest({
4141
async 'should load the generated contract' () {
4242
const gen = new Generator({
4343
target: 'js',
44+
outputFileExt: 'mjs',
4445
name: 'WETH',
4546
platform: 'polygon',
4647
source: {

0 commit comments

Comments
 (0)