Skip to content

Commit

Permalink
fix: Fix (literal, type) paths in typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
RomarQ committed Jan 31, 2022
1 parent 04b3773 commit 9dfe3a3
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 40 deletions.
24 changes: 10 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tezwell/michelson-sdk",
"version": "0.4.0",
"version": "0.4.1",
"description": "Michelson SDK is a framework for generating Michelson values and types from Javascript.",
"keywords": [
"Tezos",
Expand All @@ -26,17 +26,13 @@
"require": "./converter/index.cjs",
"import": "./converter/index.mjs"
},
"./core": {
"require": "./core/index.cjs",
"import": "./core/index.mjs"
},
"./literal": {
"require": "./core/literal.cjs",
"import": "./core/literal.mjs"
"require": "./literal.cjs",
"import": "./literal.mjs"
},
"./type": {
"require": "./core/type.cjs",
"import": "./core/type.mjs"
"require": "./type.cjs",
"import": "./type.mjs"
}
},
"scripts": {
Expand All @@ -49,19 +45,19 @@
},
"devDependencies": {
"@types/jest": "27.4.0",
"@typescript-eslint/eslint-plugin": "5.10.0",
"@typescript-eslint/parser": "5.10.0",
"@typescript-eslint/eslint-plugin": "5.10.1",
"@typescript-eslint/parser": "5.10.1",
"coveralls": "3.1.1",
"esbuild": "0.14.11",
"eslint": "8.7.0",
"esbuild": "0.14.14",
"eslint": "8.8.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-prettier": "4.0.0",
"jest": "27.4.7",
"jest-html-reporter": "3.4.2",
"jest-junit": "13.0.0",
"prettier": "2.5.1",
"ts-jest": "27.1.3",
"typescript": "4.5.4"
"typescript": "4.5.5"
},
"jest-junit": {
"suiteName": "jest tests",
Expand Down
8 changes: 1 addition & 7 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@ const DIST_FOLDER = './dist';

// Build steps
cleanUP();
generateBundle([
'./src/index.ts',
'./src/converter/index.ts',
'./src/core/index.ts',
'./src/core/type.ts',
'./src/core/literal.ts',
]);
generateBundle(['./src/index.ts', './src/converter/index.ts', './src/type.ts', './src/literal.ts']);

/**
* Produces the js bundle
Expand Down
2 changes: 1 addition & 1 deletion src/converter/json.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Prim } from '../core/enums/prim';
import { Prim } from '../enums/prim';
import Guards from '../misc/guards';
import { MichelsonJSON, MichelsonJSON_Prim, MichelsonMicheline } from '../typings';

Expand Down
5 changes: 0 additions & 5 deletions src/core/index.ts

This file was deleted.

File renamed without changes.
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './core';
export * from './literal';
export * from './type';
6 changes: 3 additions & 3 deletions src/core/literal.ts → src/literal.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { IRecordVariant } from './type';
import type { MichelsonJSON, MichelsonMicheline, PairsOfKeys, PrimValue, IValue } from '../typings';
import type { MichelsonJSON, MichelsonMicheline, PairsOfKeys, PrimValue, IValue } from './typings';
import {
TOr,
//
buildRecordVariantType,
} from './type';
import { Prim } from './enums/prim';
import Utils, { composeRightCombLayout, curlyBrackets, parenthesis } from '../misc/utils';
import Converter from '../converter';
import Utils, { composeRightCombLayout, curlyBrackets, parenthesis } from './misc/utils';
import Converter from './converter';

export class Michelson_Literal implements IValue {
private prim: PrimValue;
Expand Down
2 changes: 1 addition & 1 deletion src/misc/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { PairsOfKeys } from '../typings';
import { Prim } from '../core/enums/prim';
import { Prim } from '../enums/prim';

export const parenthesis = (str: string) => `(${str})`;
export const curlyBrackets = (str: string) => `{ ${str} }`;
Expand Down
4 changes: 2 additions & 2 deletions src/core/type.ts → src/type.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { MichelsonJSON, MichelsonMicheline, PairsOfKeys, IType, PrimType } from '../typings';
import { composeRightCombLayout, parenthesis } from '../misc/utils';
import type { MichelsonJSON, MichelsonMicheline, PairsOfKeys, IType, PrimType } from './typings';
import { composeRightCombLayout, parenthesis } from './misc/utils';
import { Prim } from './enums/prim';

export class Michelson_Type implements IType {
Expand Down
2 changes: 1 addition & 1 deletion src/typings/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Prim } from '../core/enums/prim';
import { Prim } from '../enums/prim';

export type MichelsonJSON_Prim = {
prim: keyof typeof Prim;
Expand Down
2 changes: 1 addition & 1 deletion src/typings/literal.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Prim } from '../core/enums/prim';
import { Prim } from '../enums/prim';

/**
* @see https://tezos.gitlab.io/alpha/michelson.html#full-grammar
Expand Down
2 changes: 1 addition & 1 deletion src/typings/type.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Prim } from '../core/enums/prim';
import { Prim } from '../enums/prim';

/**
* @see https://tezos.gitlab.io/alpha/michelson.html#full-grammar
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/validate_michelson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
Left,
Right,
Lambda,
} from '../../src/core/literal';
} from '../../src/literal';
import {
TAddress,
TBig_map,
Expand Down Expand Up @@ -56,7 +56,7 @@ import {
TTimestamp,
TUnit,
TVariant,
} from '../../src/core/type';
} from '../../src/type';
import { buildTesterContract, convertContractToJSON, convertMichelsonToJSON } from './utils';

const verifyLiteral = (testName: string, lit: IValue, type: IType) => {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/validate_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
TTicket,
TUnit,
TVariant,
} from '../../src/core/type';
} from '../../src/type';
import { buildTypeTesterContract, convertContractToJSON } from './utils';

const verifyType = (testName: string, type: IType) => {
Expand Down

0 comments on commit 9dfe3a3

Please sign in to comment.