-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e27e881
commit db2fcb8
Showing
42 changed files
with
428 additions
and
233 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
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
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
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
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
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,5 +1,11 @@ | ||
# pactlings | ||
|
||
## 0.0.10 | ||
|
||
### Patch Changes | ||
|
||
- Improve installer version detection | ||
|
||
## 0.0.9 | ||
|
||
### Patch Changes | ||
|
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,3 @@ | ||
#!/usr/bin/env node | ||
'use strict'; | ||
import '../dist/cli.js'; |
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,6 +1,6 @@ | ||
{ | ||
"name": "pactlings", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "A tool to help you build, test and deploy your Pact smart contracts", | ||
"keywords": [ | ||
"pact", | ||
|
@@ -11,10 +11,10 @@ | |
"author": "Salama Ashoush <[email protected]>", | ||
"license": "MIT", | ||
"type": "module", | ||
"private": false, | ||
"private": true, | ||
"main": "./src/index.ts", | ||
"bin": { | ||
"pact-toolbox": "./src/cli.ts" | ||
"pactlings": "./src/cli.ts" | ||
}, | ||
"files": [ | ||
"dist" | ||
|
@@ -38,12 +38,11 @@ | |
"module": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"bin": { | ||
"pact-toolbox": "./bin/pact-toolbox.mjs" | ||
"pactlings": "./bin/pactlings.mjs" | ||
} | ||
}, | ||
"scripts": { | ||
"cli": "tsx src/cli.ts", | ||
"playground": "tsx src/playground.ts", | ||
"build": "tsup", | ||
"dev": "tsup --watch", | ||
"lint": "oxlint --import-plugin -D all && prettier -c src", | ||
|
@@ -55,21 +54,6 @@ | |
"verify": "tsc --noEmit --skipLibCheck" | ||
}, | ||
"dependencies": { | ||
"@kadena/client": "^1.11.0", | ||
"@kadena/pactjs": "^0.4.2", | ||
"@kadena/pactjs-cli": "^1.11.0", | ||
"@kadena/types": "^0.6.1", | ||
"@pact-toolbox/client-utils": "workspace:*", | ||
"@pact-toolbox/config": "workspace:*", | ||
"@pact-toolbox/fabricator": "workspace:*", | ||
"@pact-toolbox/init": "workspace:*", | ||
"@pact-toolbox/installer": "workspace:*", | ||
"@pact-toolbox/network": "workspace:*", | ||
"@pact-toolbox/prelude": "workspace:*", | ||
"@pact-toolbox/runtime": "workspace:*", | ||
"@pact-toolbox/script": "workspace:*", | ||
"@pact-toolbox/test": "workspace:*", | ||
"@pact-toolbox/utils": "workspace:*", | ||
"citty": "^0.1.6", | ||
"defu": "^6.1.4", | ||
"pathe": "^1.1.2" | ||
|
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
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,6 +1,6 @@ | ||
{ | ||
"name": "@pact-toolbox/fabricator", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "A tool to generate Pact contracts and components", | ||
"repository": "kadena-community/pact-toolbox", | ||
"author": "Salama Ashoush <[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
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,6 +1,6 @@ | ||
{ | ||
"name": "@pact-toolbox/init", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"repository": "kadena-community/pact-toolbox", | ||
"author": "Salama Ashoush <[email protected]>", | ||
"license": "MIT", | ||
|
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
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,6 +1,6 @@ | ||
{ | ||
"name": "@pact-toolbox/installer", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"repository": "kadena-community/pact-toolbox", | ||
"author": "Salama Ashoush <[email protected]>", | ||
"license": "MIT", | ||
|
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
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,57 @@ | ||
import { logger } from '@pact-toolbox/utils'; | ||
import { appendFile } from 'node:fs/promises'; | ||
import { homedir } from 'node:os'; | ||
import { join } from 'pathe'; | ||
|
||
export function getShellProfile(shell: string) { | ||
if (shell.includes('zsh')) { | ||
return join(homedir(), '.zshrc'); | ||
} | ||
|
||
if (shell.includes('bash')) { | ||
return join(homedir(), '.bashrc'); | ||
} | ||
|
||
if (shell.includes('fish')) { | ||
return join(homedir(), '.config/fish/config.fish'); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
export function getShellProfileScript() { | ||
return ` | ||
# Pact Toolbox | ||
export PATH="$PATH:$HOME/.kadena/bin" | ||
`; | ||
} | ||
|
||
export function isKadenaBinInPath() { | ||
const path = process.env.PATH; | ||
if (!path) { | ||
return false; | ||
} | ||
return path.includes('.kadena/bin'); | ||
} | ||
export async function updateShellProfileScript() { | ||
if (isKadenaBinInPath()) { | ||
return; | ||
} | ||
const shell = process.env.SHELL; | ||
if (!shell) { | ||
throw new Error('SHELL environment variable is not set'); | ||
} | ||
const profile = getShellProfile(shell); | ||
const script = getShellProfileScript(); | ||
if (!profile) { | ||
throw new Error('Shell profile not found'); | ||
} | ||
if (!script) { | ||
throw new Error('Shell profile script not found'); | ||
} | ||
if (profile.includes(script)) { | ||
return; | ||
} | ||
await appendFile(profile, script); | ||
logger.box(`Shell profile updated. Please restart your shell to apply changes.\n or run \n\`. ${profile}\``); | ||
} |
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
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
Oops, something went wrong.