Skip to content

Commit

Permalink
Merge pull request #16 from Apillon/v1.0.1
Browse files Browse the repository at this point in the history
V1.0.1
  • Loading branch information
MoMannn authored Nov 29, 2023
2 parents 43f3114 + e088021 commit 2b9f86a
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 51 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apillon-web3-tools",
"version": "1.0.0",
"version": "1.0.1",
"description": "Monorepo for Apillon tools",
"author": "Apillon",
"license": "MIT",
Expand All @@ -11,7 +11,7 @@
"test": "npx turbo run test",
"cli-install": "npx turbo run cli-install",
"dev": "npx turbo run dev",
"publish-all": "npx turbo run publish-package",
"publish-beta": "npx turbo run publish-beta",
"build": "npx turbo run build",
"lint": "npx turbo run lint"
},
Expand Down
5 changes: 1 addition & 4 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,15 @@ npx @apillon/cli <command> [options]

### Global Options

- `--api-url <api url>`: Apillon API URL (default: Production API URL, can be set via the `APILLON_API_URL` environment
variable).
- `--key <api key>`: Apillon API key (can be set via the `APILLON_API_KEY` environment variable).
- `--secret <api secret>`: Apillon API secret (can be set via the `APILLON_API_SECRET` environment variable).
- `--debug`: Output execution logs when running commands.
- `-V`, `--version`: Output the version number.

### Environment Variables

You can use environment variables to set the API URL, API key, and API secret:
You can use environment variables to set an API key, and an API secret:

- `APILLON_API_URL`: Apillon API URL.
- `APILLON_API_KEY`: Apillon API key.
- `APILLON_API_SECRET`: Apillon API secret.

Expand Down
6 changes: 3 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@apillon/cli",
"description": "▶◀ Apillon CLI tools ▶◀",
"version": "1.0.0",
"version": "1.0.1",
"author": "Apillon",
"license": "MIT",
"main": "./dist/index.js",
Expand All @@ -25,7 +25,8 @@
"dev": "tsc --declarationMap --watch",
"lint": "tsc --declarationMap && eslint \"{src,test}/**/*.ts\" --fix",
"cli-install": "tsc && npm uninstall -g ; npm i -g",
"publish-package": "npm publish"
"publish-package": "npm publish",
"publish-beta": "npm publish --tag beta"
},
"bin": {
"apillon": "./dist/index.js",
Expand Down Expand Up @@ -55,7 +56,6 @@
"axios": "^1.3.4",
"chalk": "^4.1.2",
"commander": "^10.0.0",
"dotenv": "^16.0.3",
"@apillon/sdk": "*"
}
}
8 changes: 0 additions & 8 deletions packages/cli/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/* eslint-disable @typescript-eslint/no-var-requires */
import * as dotenv from 'dotenv';

dotenv.config();

function getVersion(rollback: string) {
try {
return require('./package.json').version;
Expand All @@ -17,7 +12,4 @@ function getVersion(rollback: string) {

export default {
VERSION: getVersion('1.0.0'),
APILLON_API_KEY: process.env.APILLON_API_KEY,
APILLON_API_SECRET: process.env.APILLON_API_SECRET,
APILLON_API_URL: process.env.APILLON_API_URL || 'https://api.apillon.io',
};
6 changes: 0 additions & 6 deletions packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ cli.addOption(
.env('APILLON_API_SECRET')
.makeOptionMandatory(),
);
cli.addOption(
new Option('--api-url <api url>', 'Apillon API secret')
.env('APILLON_API_URL')
.default('https://api.apillon.io', 'Production API url')
.makeOptionMandatory(),
);

cli.addOption(
new Option('--debug', 'Output debug messages').env('APILLON_DEBUG'),
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ export interface Options {
export interface GlobalOptions {
key: string;
secret: string;
apiUrl?: string;
[key: string]: string;
}
3 changes: 0 additions & 3 deletions packages/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ import * as fs from 'fs';
const hosting = new Hosting({
key: 'yourApiKey',
secret: 'yourApiSecret',
apiUrl: 'https://api.apillon.io',
logLevel: LogLevel.VERBOSE,
});
await hosting.listWebsites({ orderBy: 'createTime' });
Expand Down Expand Up @@ -124,7 +123,6 @@ import * as fs from 'fs';
const storage = new Storage({
key: 'yourApiKey',
secret: 'yourApiSecret',
apiUrl: 'https://api.apillon.io',
logLevel: LogLevel.VERBOSE,
});
await storage.listBuckets({ limit: 5 });
Expand Down Expand Up @@ -178,7 +176,6 @@ import {
const nft = new Nft({
key: 'yourApiKey',
secret: 'yourApiSecret',
apiUrl: 'https://api.apillon.io',
logLevel: LogLevel.VERBOSE,
});
await nft.create({
Expand Down
5 changes: 3 additions & 2 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@apillon/sdk",
"description": "▶◀ Apillon SDK for NodeJS ▶◀",
"version": "1.0.0",
"version": "1.0.1",
"author": "Apillon",
"license": "MIT",
"main": "./dist/index.js",
Expand All @@ -26,6 +26,7 @@
"dev": "tsc --declarationMap --watch",
"lint": "tsc --declarationMap && eslint \"{src,test}/**/*.ts\" --fix",
"publish-package": "npm publish",
"publish-beta": "npm publish --tag beta",
"test": "npx jest",
"generate-docs": "npx typedoc src/docs-index.ts --sort enum-value-ascending"
},
Expand Down Expand Up @@ -79,4 +80,4 @@
"preset": "ts-jest",
"verbose": true
}
}
}
14 changes: 2 additions & 12 deletions packages/sdk/src/lib/apillon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,9 @@ export interface ApillonConfig {

export class ApillonModule {
public constructor(config?: ApillonConfig) {
const defaultConfig: ApillonConfig = {
key: process.env.APILLON_API_KEY,
secret: process.env.APILLON_API_SECRET,
apiUrl: process.env.APILLON_API_URL || 'https://api.apillon.io',
logLevel: LogLevel.ERROR,
debug: false,
};

const mergedConfig = { ...defaultConfig, ...config };

ApillonApi.initialize(mergedConfig);
ApillonApi.initialize(config);
ApillonLogger.initialize(
mergedConfig.debug ? LogLevel.VERBOSE : mergedConfig.logLevel,
config.debug ? LogLevel.VERBOSE : config.logLevel || LogLevel.ERROR,
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/src/modules/hosting/hosting-website.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ export class HostingWebsite extends ApillonModel {
})`,
);

ApillonLogger.logWithTime('Deploy start');
ApillonLogger.logWithTime('Initiating deployment');
const { data } = await ApillonApi.post<any>(`${this.API_PREFIX}/deploy`, {
environment: toEnvironment,
});

ApillonLogger.logWithTime('Deploy complete');
ApillonLogger.logWithTime('Deployment in progress');

return data;
}
Expand Down
1 change: 0 additions & 1 deletion packages/sdk/src/tests/helpers/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export function getConfig(): ApillonConfig {
dotenv.config({ path: envPath });

return {
apiUrl: process.env['APILLON_API_URL'],
secret: process.env['APILLON_API_SECRET'],
key: process.env['APILLON_API_KEY'],
logLevel: LogLevel.VERBOSE,
Expand Down
25 changes: 18 additions & 7 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,39 @@
"$schema": "https://turborepo.org/schema.json",
"pipeline": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**"]
"dependsOn": [
"^build"
],
"outputs": [
"dist/**"
]
},
"cli-install": {
"dependsOn": ["^build"],
"dependsOn": [
"^build"
],
"outputs": []
},
"dev": {
"dependsOn": [],
"outputs": []
},
"publish-package": {
"dependsOn": ["^build"],
"publish-beta": {
"dependsOn": [
"^build",
"^publish-beta"
],
"outputs": []
},
"lint": {
"outputs": []
},
"test": {
"cache": false,
"dependsOn": ["^build"],
"dependsOn": [
"^build"
],
"outputs": []
}
}
}
}

0 comments on commit 2b9f86a

Please sign in to comment.