-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from nhenin/big-bang
Big bang
- Loading branch information
Showing
117 changed files
with
5,282 additions
and
548 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
coverage | ||
node_modules | ||
output | ||
docs | ||
env | ||
tsconfig.tsbuildinfo | ||
lerna-debug.log | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/plugins | ||
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions | ||
|
||
# created by nix | ||
result | ||
source | ||
dist | ||
|
||
package-lock.json | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Debug Tests", | ||
"program": "${workspaceRoot}/node_modules/.bin/jest", | ||
"cwd": "${workspaceRoot}", | ||
"args": ["--i", "--config", "jest.config.js"], | ||
}, | ||
{ | ||
"name": "Launch Extension (development)", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"runtimeExecutable": "${execPath}", | ||
"args": ["--extensionDevelopmentPath=${workspaceFolder}"], | ||
"outFiles": ["${workspaceFolder}/out/**/*.js"], | ||
"preLaunchTask": "watch" | ||
}, | ||
{ | ||
"name": "Launch Extension (production)", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"runtimeExecutable": "${execPath}", | ||
"args": ["--extensionDevelopmentPath=${workspaceFolder}"], | ||
"outFiles": ["${workspaceFolder}/out/**/*.js"], | ||
"preLaunchTask": "npm: compile" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
const path = require('path'); | ||
const dotenv = require('dotenv'); | ||
|
||
module.exports = async () => { | ||
dotenv.config({ path: path.resolve(__dirname, '../env/.env.test') }); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
cat >dist/cjs/package.json <<!EOF | ||
{ | ||
"type": "commonjs" | ||
} | ||
!EOF | ||
|
||
cat >dist/mjs/package.json <<!EOF | ||
{ | ||
"type": "module" | ||
} | ||
!EOF |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
global.console = require('console'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
module.exports = { | ||
|
||
projects: [ | ||
{ | ||
displayName: "e2e test", | ||
testMatch: ["./**/*.spec.e2e.ts"], | ||
runner: "jest-serial-runner", | ||
extensionsToTreatAsEsm: ['.ts'], | ||
preset: 'ts-jest/presets/default-esm', | ||
moduleNameMapper: { | ||
'@adapter/(.*)': '<rootDir>/src/adapter/$1', | ||
'@runtime/(.*)': '<rootDir>/src/runtime/$1', | ||
'@language/(.*)': '<rootDir>/src/language/$1', | ||
'^(\\.{1,2}/.*)\\.js$': '$1', | ||
}, | ||
globalSetup: "./dotenv/dotenv-test.js", | ||
setupFilesAfterEnv: ["./jest.config.console.js"], | ||
transform: { | ||
// '^.+\\.[tj]sx?$' to process js/ts with `ts-jest` | ||
// '^.+\\.m?[tj]sx?$' to process js/ts/mjs/mts with `ts-jest` | ||
'^.+\\.m?[tj]sx?$': [ | ||
'ts-jest', | ||
{ | ||
useESM: true, | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
displayName: "unit test", | ||
testMatch: ["./**/*.spec.ts"], | ||
extensionsToTreatAsEsm: ['.ts'], | ||
preset: 'ts-jest/presets/default-esm', | ||
moduleNameMapper: { | ||
'@adapter/(.*)': '<rootDir>/src/adapter/$1', | ||
'@runtime/(.*)': '<rootDir>/src/runtime/$1', | ||
'@language/(.*)': '<rootDir>/src/language/$1', | ||
'^(\\.{1,2}/.*)\\.js$': '$1', | ||
}, | ||
globalSetup: "./dotenv/dotenv-test.js", | ||
setupFilesAfterEnv: ["./jest.config.console.js"], | ||
transform: { | ||
// '^.+\\.[tj]sx?$' to process js/ts with `ts-jest` | ||
// '^.+\\.m?[tj]sx?$' to process js/ts/mjs/mts with `ts-jest` | ||
'^.+\\.m?[tj]sx?$': [ | ||
'ts-jest', | ||
{ | ||
useESM: true, | ||
}, | ||
], | ||
}, | ||
} | ||
] | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,82 @@ | ||
{ | ||
"name": "marlowe-ts-sdk", | ||
"version": "0.0.1", | ||
"description": "Marlowe Runtime Client for building Marlowe Contracts", | ||
"engines": { | ||
"node": ">=14.20.1" | ||
}, | ||
"repository": "https://github.com/input-output-hk/marlowe-ts-sdk", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"contributors": [ | ||
"Nicolas Henin <[email protected]> (https://iohk.io)" | ||
], | ||
"license": "Apache-2.0", | ||
"main": "dist/cjs/index.js", | ||
"module": "dist/mjs/index.js", | ||
"exports": { | ||
".": { | ||
"import": "./dist/mjs/index.js", | ||
"require": "./dist/cjs/index.js" | ||
} | ||
}, | ||
"scripts": { | ||
"build:esm": "tsc -p src/tsconfig.json --outDir ./dist/esm --module es2020", | ||
"build:cjs": "tsc --build src", | ||
"build": "rm -fr dist/* && tsc -p tsconfig.json && tsc -p tsconfig-cjs.json && ./fixup", | ||
"circular-deps:check": "madge --circular dist", | ||
"tscNoEmit": "shx echo typescript --noEmit command not implemented yet", | ||
"cleanup:dist": "shx rm -rf dist", | ||
"cleanup:nm": "shx rm -rf node_modules", | ||
"cleanup": "run-s cleanup:dist cleanup:nm", | ||
"lint": "eslint -c ../../complete.eslintrc.js \"src/**/*.ts\" \"test/**/*.ts\"", | ||
"lint:fix": "yarn lint --fix", | ||
"test": "yarn node --experimental-vm-modules $(yarn bin jest -c ./jest.config.js)", | ||
"test:build:verify": "tsc --build ./test", | ||
"test:e2e": "shx echo 'test:e2e' command not implemented yet", | ||
"coverage": "shx echo No coverage report for this package", | ||
"prepack": "yarn build" | ||
}, | ||
"devDependencies": { | ||
"@types/axios-curlirize": "^1.3.2", | ||
"@types/deep-equal": "^1.0.1", | ||
"@types/jest": "^26.0.24", | ||
"@types/json-bigint": "^1.0.1", | ||
"@types/node": "^18.14.2", | ||
"eslint": "^7.32.0", | ||
"jest": "^29.4", | ||
"npm-run-all": "^4.1.5", | ||
"prettier": "^2.3.2", | ||
"shx": "^0.3.3", | ||
"ts-jest": "^29.0.5", | ||
"jest-serial-runner": "^1.2.1", | ||
"@relmify/jest-fp-ts": "^2.0.2", | ||
"ts-node": "^10.9.1" | ||
}, | ||
"dependencies": { | ||
"@blockfrost/blockfrost-js": "^5.2.0", | ||
"@blockfrost/openapi": "^0.1.54", | ||
"@types/deep-equal": "^1.0.1", | ||
"axios": "^1.3.3", | ||
"axios-curlirize": "^2.0.0", | ||
"date-fns": "2.29.3", | ||
"deep-equal": "^1.0.1", | ||
"dotenv": "^16.0.3", | ||
"fp-ts": "^2.13.1", | ||
"json-bigint": "^1.0.0", | ||
"lucid-cardano": "0.9.4", | ||
"ts-adt": "^2.0.2", | ||
"ts-pattern": "^4.2.0", | ||
"retry-ts":"0.1.4", | ||
"newtype-ts":"0.3.5", | ||
"monocle-ts":"2.3.13", | ||
"io-ts":"2.2.20", | ||
"io-ts-types":"0.5.19", | ||
"io-ts-bigint":"2.0.1", | ||
"io-ts-reporters":"2.0.1", | ||
"typescript": "^4.9.5", | ||
"typescript-language-server": "^3.1.0" | ||
}, | ||
"devDependencies": { | ||
"openapi-typescript": "^6.1.0", | ||
"openapi-typescript-codegen": "^0.23.0", | ||
"ts-node": "^10.9.1" | ||
}, | ||
"type": "module" | ||
"packageManager": "[email protected]" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
import * as TE from 'fp-ts/TaskEither' | ||
import * as E from 'fp-ts/Either' | ||
|
||
import fs from 'fs'; | ||
import { promisify } from 'util'; | ||
|
||
|
||
const readFromFile = promisify(fs.readFile); | ||
export const getFileContents = (path: string) => TE.tryCatch(() => readFromFile(path, 'utf-8'), E.toError); |
Oops, something went wrong.