This repository was archived by the owner on Mar 11, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Fix Memo program ESM exports #3507
Merged
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
dfb4993
Fix Memo program ESM exports
jordaaash 14c3ddb
fix repository link
jordaaash ee0a680
web3.js is a peer dependency
jordaaash f1c5354
memo/ts -> memo/js (same as token)
jordaaash b4a2698
add gh-pages dev dep
jordaaash ffabda8
fix version
jordaaash bb0daad
check in package-lock.json
jordaaash edf36bf
remove editorconfig
jordaaash File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,9 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
This file contains hidden or 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,2 +1,5 @@ | ||
lib | ||
docs | ||
lib | ||
test-ledger | ||
|
||
package-lock.json |
This file contains hidden or 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,20 @@ | ||
{ | ||
"root": true, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:prettier/recommended" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": [ | ||
"@typescript-eslint", | ||
"prettier" | ||
], | ||
"rules": { | ||
"@typescript-eslint/ban-ts-comment": "off", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/no-unused-vars": "off", | ||
"@typescript-eslint/no-empty-interface": "off", | ||
"@typescript-eslint/consistent-type-imports": "error" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,2 +1,14 @@ | ||
lib | ||
.idea | ||
.vscode | ||
.DS_Store | ||
|
||
node_modules | ||
|
||
package-lock.json | ||
pnpm-lock.yaml | ||
yarn.lock | ||
|
||
docs | ||
lib | ||
test-ledger | ||
*.tsbuildinfo |
Empty file.
This file contains hidden or 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,5 @@ | ||
docs | ||
lib | ||
test-ledger | ||
|
||
package-lock.json |
This file contains hidden or 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 @@ | ||
{ | ||
"printWidth": 120, | ||
"trailingComma": "es5", | ||
"tabWidth": 4, | ||
"semi": true, | ||
"singleQuote": true | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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,5 @@ | ||
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
}; |
This file contains hidden or 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,70 +1,77 @@ | ||
{ | ||
"name": "@solana/spl-memo", | ||
"version": "0.2.0", | ||
"description": "SPL Memo Program JS API", | ||
"files": [ | ||
"lib", | ||
"src", | ||
"LICENSE", | ||
"README.md" | ||
], | ||
"main": "lib/cjs/index.js", | ||
"module": "lib/esm/index.mjs", | ||
"types": "lib/types/index.d.ts", | ||
"type": "module", | ||
"sideEffects": false, | ||
"exports": { | ||
"import": "./lib/esm/index.mjs", | ||
"require": "./lib/cjs/index.js", | ||
"types": "./lib/types/index.d.ts" | ||
}, | ||
"scripts": { | ||
"build": "yarn clean && tsc -p tsconfig.json && tsc-esm -p tsconfig.json && tsc -p tsconfig.cjs.json", | ||
"postbuild": "echo '{\"type\":\"commonjs\"}' > lib/cjs/package.json && echo '{\"type\":\"module\"}' > lib/esm/package.json", | ||
"clean": "rimraf ./lib", | ||
"deploy": "yarn docs && gh-pages --dist docs --dest memo/ts --dotfiles", | ||
"docs": "rimraf docs && NODE_OPTIONS=--max_old_space_size=4096 typedoc", | ||
"lint": "eslint --max-warnings 0 . && npm run pretty", | ||
"lint:fix": "eslint . --fix && npm run pretty:fix", | ||
"pretty": "prettier --check '{,{src,test}/**/}*.{j,t}s'", | ||
"pretty:fix": "prettier --write '{,{src,test}/**/}*.{j,t}s'", | ||
"test": "npm run test:unit && npm run test:e2e", | ||
"test:unit": "jest test/unit", | ||
"test:e2e": "start-server-and-test 'solana-test-validator -r -q' http://localhost:8899/health 'jest test/e2e'" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/solana-labs/solana-program-library" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"author": "Solana Maintainers <[email protected]>", | ||
"license": "Apache-2.0", | ||
"devDependencies": { | ||
"@types/chai": "^4.3.1", | ||
"@types/jest": "^28.1.1", | ||
"@types/node": "^17.0.42", | ||
"@types/node-fetch": "^2.6.1", | ||
"@types/prettier": "^2.6.3", | ||
"@typescript-eslint/eslint-plugin": "^5.28.0", | ||
"@typescript-eslint/parser": "^5.28.0", | ||
"chai": "^4.3.6", | ||
"eslint": "^8.17.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"jest": "^28.1.1", | ||
"prettier": "^2.7.0", | ||
"process": "^0.11.10", | ||
"rimraf": "^3.0.2", | ||
"start-server-and-test": "^1.14.0", | ||
"ts-jest": "^28.0.5", | ||
"ts-node": "^10.8.1", | ||
"typedoc": "^0.23.10", | ||
"typescript": "^4.7.3", | ||
"typescript-esm": "^2.0.0" | ||
}, | ||
"dependencies": { | ||
"@solana/web3.js": "^1.41.0", | ||
"buffer": "^6.0.3" | ||
} | ||
"name": "@solana/spl-memo", | ||
"description": "SPL Memo Program JS API", | ||
"version": "0.3.1", | ||
jordaaash marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"author": "Solana Maintainers <[email protected]>", | ||
"repository": "https://github.com/solana-labs/solana-program-library", | ||
"license": "Apache-2.0", | ||
"type": "module", | ||
"sideEffects": false, | ||
"engines": { | ||
"node": ">=16" | ||
}, | ||
"files": [ | ||
"lib", | ||
"src", | ||
"LICENSE", | ||
"README.md" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"main": "./lib/cjs/index.js", | ||
"module": "./lib/esm/index.js", | ||
"types": "./lib/types/index.d.ts", | ||
"exports": { | ||
"require": "./lib/cjs/index.js", | ||
"import": "./lib/esm/index.js", | ||
"types": "./lib/types/index.d.ts" | ||
}, | ||
"scripts": { | ||
"nuke": "shx rm -rf node_modules package-lock.json || true", | ||
"reinstall": "npm run nuke && npm install", | ||
"clean": "shx rm -rf lib **/*.tsbuildinfo || true", | ||
"build": "tsc --build --verbose tsconfig.all.json", | ||
"watch": "tsc --build --verbose --watch tsconfig.all.json", | ||
"release": "npm run clean && npm run build", | ||
"fmt": "prettier --write '{*,**/*}.{ts,tsx,js,jsx,json}'", | ||
"lint": "prettier --check '{*,**/*}.{ts,tsx,js,jsx,json}' && eslint --max-warnings 0 .", | ||
"lint:fix": "npm run fmt && eslint --fix .", | ||
"test": "npm run test:unit && npm run test:e2e", | ||
"test:unit": "jest test/unit", | ||
"test:e2e": "start-server-and-test 'solana-test-validator -r -q' http://localhost:8899/health 'jest test/e2e'", | ||
"deploy": "npm run deploy:docs", | ||
"docs": "shx rm -rf docs && typedoc && shx cp .nojekyll docs/", | ||
"deploy:docs": "npm run docs && gh-pages --dist memo/js --dotfiles" | ||
}, | ||
"peerDependencies": { | ||
"@solana/web3.js": "^1.20.0" | ||
}, | ||
"dependencies": { | ||
"buffer": "^6.0.3" | ||
}, | ||
"devDependencies": { | ||
"@solana/web3.js": "^1.20.0", | ||
"@types/chai": "^4.3.3", | ||
"@types/jest": "^28.1.7", | ||
"@types/node": "^18.7.9", | ||
"@types/node-fetch": "^2.6.2", | ||
"@types/prettier": "^2.7.0", | ||
"@typescript-eslint/eslint-plugin": "^5.34.0", | ||
"@typescript-eslint/parser": "^5.34.0", | ||
"chai": "^4.3.6", | ||
"eslint": "^8.20.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"gh-pages": "^3.2.3", | ||
"jest": "^28.1.3", | ||
"prettier": "^2.7.1", | ||
"process": "^0.11.10", | ||
"shx": "^0.3.4", | ||
"start-server-and-test": "^1.14.0", | ||
"ts-jest": "^28.0.8", | ||
"ts-node": "^10.9.1", | ||
"typedoc": "^0.23.10", | ||
"typescript": "^4.7.4" | ||
} | ||
} |
This file contains hidden or 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 hidden or 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,28 +1,17 @@ | ||
import {createMemoInstruction} from '../../src'; | ||
import { | ||
Connection, | ||
Keypair, | ||
Transaction, | ||
LAMPORTS_PER_SOL, | ||
sendAndConfirmTransaction, | ||
} from '@solana/web3.js'; | ||
import { createMemoInstruction } from '../../src'; | ||
import { Connection, Keypair, Transaction, LAMPORTS_PER_SOL, sendAndConfirmTransaction } from '@solana/web3.js'; | ||
|
||
test('transaction: live', async () => { | ||
const url = 'http://localhost:8899'; | ||
const connection = new Connection(url, 'confirmed'); | ||
await connection.getVersion(); | ||
const signer = new Keypair(); // also fee-payer | ||
const url = 'http://localhost:8899'; | ||
const connection = new Connection(url, 'confirmed'); | ||
await connection.getVersion(); | ||
const signer = new Keypair(); // also fee-payer | ||
|
||
const airdropSignature = await connection.requestAirdrop( | ||
signer.publicKey, | ||
LAMPORTS_PER_SOL / 10, | ||
); | ||
await connection.confirmTransaction(airdropSignature, 'confirmed'); | ||
const airdropSignature = await connection.requestAirdrop(signer.publicKey, LAMPORTS_PER_SOL / 10); | ||
await connection.confirmTransaction(airdropSignature, 'confirmed'); | ||
|
||
const memoTx = new Transaction().add( | ||
createMemoInstruction('this is a test memo', [signer.publicKey]), | ||
); | ||
await sendAndConfirmTransaction(connection, memoTx, [signer], { | ||
preflightCommitment: 'confirmed', | ||
}); | ||
const memoTx = new Transaction().add(createMemoInstruction('this is a test memo', [signer.publicKey])); | ||
await sendAndConfirmTransaction(connection, memoTx, [signer], { | ||
preflightCommitment: 'confirmed', | ||
}); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.