Skip to content

Commit bd0ee30

Browse files
committed
feat: @aave/env package
1 parent 197becd commit bd0ee30

File tree

8 files changed

+143
-1
lines changed

8 files changed

+143
-1
lines changed

packages/env/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# `@aave/env`
2+
3+
The Aave API environments.
4+
5+
---
6+
7+
**It is not intended to be used directly. Its interface will change without notice, use it at your own risk.**
8+

packages/env/package.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "@aave/env",
3+
"version": "0.0.0",
4+
"description": "The Aave API environments",
5+
"repository": {
6+
"directory": "packages/env",
7+
"type": "git",
8+
"url": "git://github.com/aave/aave-sdk.git"
9+
},
10+
"type": "module",
11+
"main": "dist/index.cjs",
12+
"module": "dist/index.js",
13+
"types": "dist/index.d.ts",
14+
"exports": {
15+
".": {
16+
"import": "./dist/index.js",
17+
"require": "./dist/index.cjs"
18+
}
19+
},
20+
"typesVersions": {
21+
"*": {
22+
"import": ["./dist/index.d.ts"],
23+
"require": ["./dist/index.d.cts"]
24+
}
25+
},
26+
"files": ["dist"],
27+
"scripts": {
28+
"build": "tsup"
29+
},
30+
"dependencies": {
31+
"@aave/types": "workspace:*"
32+
},
33+
"devDependencies": {
34+
"tsup": "^8.5.0",
35+
"typescript": "^5.6.3"
36+
},
37+
"license": "MIT"
38+
}

packages/env/src/index.ts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import { never } from '@aave/types';
2+
3+
/**
4+
* The environment configuration type.
5+
*/
6+
export type EnvironmentConfig = {
7+
name: string;
8+
backend: string;
9+
};
10+
11+
/**
12+
* The mainnet environment configuration.
13+
*/
14+
export const mainnet: EnvironmentConfig = new Proxy<EnvironmentConfig>(
15+
{} as EnvironmentConfig,
16+
{
17+
get: () => {
18+
never(`The 'mainnet' environment is not available (yet)`);
19+
},
20+
},
21+
);
22+
23+
/**
24+
* The testnet environment configuration.
25+
*/
26+
export const testnet: EnvironmentConfig = new Proxy<EnvironmentConfig>(
27+
{} as EnvironmentConfig,
28+
{
29+
get: () => {
30+
never(`The 'testnet' environment is not available (yet)`);
31+
},
32+
},
33+
);
34+
35+
/**
36+
* @internal
37+
*/
38+
export const staging: EnvironmentConfig = new Proxy<EnvironmentConfig>(
39+
{} as EnvironmentConfig,
40+
{
41+
get: () => {
42+
never(`The 'staging' environment is not available (yet)`);
43+
},
44+
},
45+
);
46+
47+
/**
48+
* @internal
49+
*/
50+
export const local: EnvironmentConfig = {
51+
name: 'local',
52+
backend: 'http://localhost:3000/graphql',
53+
};

packages/env/tsconfig.build.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+
"extends": "../../tsconfig.base.json",
4+
"compilerOptions": {
5+
"outDir": "dist"
6+
},
7+
"include": ["./src/**/*.ts"],
8+
"exclude": ["node_modules", "dist"]
9+
}

packages/env/tsconfig.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://json.schemastore.org/tsconfig",
3+
"extends": ["./tsconfig.build.json", "../../tsconfig.json"]
4+
}

packages/env/tsup.config.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* eslint-disable import/no-default-export */
2+
import { defineConfig } from 'tsup';
3+
4+
export default defineConfig(() => ({
5+
entry: ['src/index.ts'],
6+
outDir: 'dist',
7+
splitting: false,
8+
sourcemap: true,
9+
treeshake: false,
10+
clean: true,
11+
tsconfig: 'tsconfig.build.json',
12+
bundle: true,
13+
minify: true,
14+
dts: true,
15+
platform: 'neutral',
16+
format: ['esm', 'cjs'],
17+
}));

packages/graphql/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# `@aave/graphql`
22

3-
This package contains [&#x60;gql.tada&#x60;](https://gql-tada.0no.co/) bindings for the Aave GraphQL API.
3+
This package contains [`gql.tada`](https://gql-tada.0no.co/) bindings for the Aave GraphQL API.
44

55
---
66

pnpm-lock.yaml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)