Skip to content

Commit 0bc8528

Browse files
committed
Boilerplate code for @solana/rpc-core
1 parent ad23683 commit 0bc8528

File tree

7 files changed

+144
-0
lines changed

7 files changed

+144
-0
lines changed

packages/rpc-core/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/

packages/rpc-core/.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/

packages/rpc-core/LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2018 Solana Labs, Inc
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

packages/rpc-core/package.json

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
{
2+
"name": "@solana/rpc-core",
3+
"version": "0.0.0-development",
4+
"description": "A library for making calls to the Solana JSON RPC API",
5+
"exports": {
6+
"browser": {
7+
"import": "./dist/index.browser.js",
8+
"require": "./dist/index.browser.cjs"
9+
},
10+
"node": {
11+
"import": "./dist/index.node.js",
12+
"require": "./dist/index.node.cjs"
13+
},
14+
"react-native": "./dist/index.native.js",
15+
"types": "./dist/types/index.d.ts"
16+
},
17+
"browser": {
18+
"./dist/index.node.cjs": "./dist/index.browser.cjs",
19+
"./dist/index.node.js": "./dist/index.browser.js"
20+
},
21+
"main": "./dist/index.node.cjs",
22+
"module": "./dist/index.node.js",
23+
"react-native": "./dist/index.native.js",
24+
"types": "./dist/types/index.d.ts",
25+
"type": "module",
26+
"files": [
27+
"./dist/"
28+
],
29+
"sideEffects": false,
30+
"keywords": [
31+
"blockchain",
32+
"solana",
33+
"web3"
34+
],
35+
"scripts": {
36+
"compile:js": "tsup --config build-scripts/tsup.config.package.ts",
37+
"compile:typedefs": "tsc -p ./tsconfig.declarations.json",
38+
"dev": "jest -c node_modules/test-config/jest-dev.config.ts --rootDir . --watch",
39+
"test:lint": "jest -c node_modules/test-config/jest-lint.config.ts --rootDir . --silent",
40+
"test:prettier": "jest -c node_modules/test-config/jest-prettier.config.ts --rootDir . --silent",
41+
"test:treeshakability:browser": "agadoo dist/index.browser.js",
42+
"test:treeshakability:native": "agadoo dist/index.node.js",
43+
"test:treeshakability:node": "agadoo dist/index.native.js",
44+
"test:typecheck": "tsc --noEmit",
45+
"test:unit:browser": "jest -c node_modules/test-config/jest-unit.config.browser.ts --rootDir . --silent",
46+
"test:unit:node": "jest -c node_modules/test-config/jest-unit.config.node.ts --rootDir . --silent"
47+
},
48+
"author": "Solana Labs Maintainers <[email protected]>",
49+
"license": "MIT",
50+
"repository": {
51+
"type": "git",
52+
"url": "https://github.com/solana-labs/solana-web3.js"
53+
},
54+
"bugs": {
55+
"url": "https://github.com/solana-labs/solana-web3.js/issues"
56+
},
57+
"browserslist": [
58+
"supports bigint and not dead",
59+
"maintained node versions"
60+
],
61+
"dependencies": {
62+
"@solana/keys": "workspace:*",
63+
"@solana/rpc-transport": "workspace:*"
64+
},
65+
"devDependencies": {
66+
"@solana/eslint-config-solana": "^0.0.4",
67+
"@swc/core": "^1.3.18",
68+
"@swc/jest": "^0.2.23",
69+
"@types/jest": "^29.2.3",
70+
"@typescript-eslint/eslint-plugin": "^5.43.0",
71+
"@typescript-eslint/parser": "^5.43.0",
72+
"agadoo": "^2.0.0",
73+
"build-scripts": "workspace:*",
74+
"eslint": "^8.27.0",
75+
"eslint-plugin-jest": "^27.1.5",
76+
"eslint-plugin-react-hooks": "^4.6.0",
77+
"eslint-plugin-sort-keys-fix": "^1.1.2",
78+
"jest": "^29.3.1",
79+
"jest-environment-jsdom": "^29.3.1",
80+
"jest-runner-eslint": "^1.1.0",
81+
"jest-runner-prettier": "^1.0.0",
82+
"postcss": "^8.4.12",
83+
"prettier": "^2.7.1",
84+
"test-config": "workspace:*",
85+
"ts-node": "^10.9.1",
86+
"tsconfig": "workspace:*",
87+
"tsup": "6.5.0",
88+
"turbo": "^1.6.3",
89+
"typescript": "^4.9"
90+
},
91+
"bundlewatch": {
92+
"defaultCompression": "gzip",
93+
"files": [
94+
{
95+
"path": "./dist/index*.js"
96+
}
97+
]
98+
}
99+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare const __BROWSER__: boolean;
2+
declare const __DEV__: boolean;
3+
declare const __NODEJS__: boolean;
4+
declare const __REACTNATIVE__: boolean;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"compilerOptions": {
3+
"declaration": true,
4+
"declarationMap": true,
5+
"emitDeclarationOnly": true,
6+
"outDir": "./dist/types"
7+
},
8+
"extends": "./tsconfig.json",
9+
"include": ["src/index.ts", "src/types"]
10+
}

packages/rpc-core/tsconfig.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "https://json.schemastore.org/tsconfig",
3+
"compilerOptions": {
4+
"lib": ["ES2015.Proxy", "ES2015.Promise", "ES5"]
5+
},
6+
"display": "@solana/rpc-core",
7+
"extends": "tsconfig/base.json",
8+
"include": ["src"]
9+
}

0 commit comments

Comments
 (0)