mirror of https://github.com/abpframework/abp.git
11 changed files with 3804 additions and 0 deletions
@ -0,0 +1,5 @@ |
|||
{ |
|||
"trailingComma": "all", |
|||
"printWidth": 120, |
|||
"singleQuote": true |
|||
} |
|||
@ -0,0 +1,2 @@ |
|||
#!/usr/bin/env node |
|||
export {}; |
|||
@ -0,0 +1,83 @@ |
|||
#!/usr/bin/env node
|
|||
"use strict"; |
|||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { |
|||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } |
|||
return new (P || (P = Promise))(function (resolve, reject) { |
|||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } |
|||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } |
|||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } |
|||
step((generator = generator.apply(thisArg, _arguments || [])).next()); |
|||
}); |
|||
}; |
|||
var __generator = (this && this.__generator) || function (thisArg, body) { |
|||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; |
|||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; |
|||
function verb(n) { return function (v) { return step([n, v]); }; } |
|||
function step(op) { |
|||
if (f) throw new TypeError("Generator is already executing."); |
|||
while (_) try { |
|||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; |
|||
if (y = 0, t) op = [op[0] & 2, t.value]; |
|||
switch (op[0]) { |
|||
case 0: case 1: t = op; break; |
|||
case 4: _.label++; return { value: op[1], done: false }; |
|||
case 5: _.label++; y = op[1]; op = [0]; continue; |
|||
case 7: op = _.ops.pop(); _.trys.pop(); continue; |
|||
default: |
|||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } |
|||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } |
|||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } |
|||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } |
|||
if (t[2]) _.ops.pop(); |
|||
_.trys.pop(); continue; |
|||
} |
|||
op = body.call(thisArg, _); |
|||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } |
|||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; |
|||
} |
|||
}; |
|||
var __importDefault = (this && this.__importDefault) || function (mod) { |
|||
return (mod && mod.__esModule) ? mod : { "default": mod }; |
|||
}; |
|||
Object.defineProperty(exports, "__esModule", { value: true }); |
|||
var chalk_1 = __importDefault(require("chalk")); |
|||
var commander_1 = __importDefault(require("commander")); |
|||
var axios_1 = require("./utils/axios"); |
|||
var clear = require('clear'); |
|||
var figlet = require('figlet'); |
|||
clear(); |
|||
console.log(chalk_1.default.red(figlet.textSync('abp', { horizontalLayout: 'full' }))); |
|||
commander_1.default |
|||
.version('0.0.1') |
|||
.description("An example CLI for ordering pizza's") |
|||
.option('-p, --peppers', 'Add peppers') |
|||
.option('-P, --pineapple', 'Add pineapple') |
|||
.option('-b, --bbq', 'Add bbq sauce') |
|||
.option('-c, --cheese <type>', 'Add the specified type of cheese [marble]') |
|||
.option('-C, --no-cheese', 'You do not want any cheese') |
|||
.parse(process.argv); |
|||
if (!process.argv.slice(2).length) { |
|||
commander_1.default.outputHelp(); |
|||
} |
|||
console.log('you ordered a pizza with:'); |
|||
if (commander_1.default.peppers) |
|||
console.log(' - peppers'); |
|||
if (commander_1.default.pineapple) |
|||
console.log(' - pineapple'); |
|||
if (commander_1.default.bbq) |
|||
console.log(' - bbq'); |
|||
var cheese = true === commander_1.default.cheese ? 'marble' : commander_1.default.cheese || 'no'; |
|||
console.log(' - %s cheese', cheese); |
|||
console.log((function () { return __awaiter(void 0, void 0, void 0, function () { |
|||
var _a, _b; |
|||
return __generator(this, function (_c) { |
|||
switch (_c.label) { |
|||
case 0: |
|||
_b = (_a = console).log; |
|||
return [4 /*yield*/, axios_1.axiosInstance.get('https://swapi.co/api/people/1')]; |
|||
case 1: |
|||
_b.apply(_a, [_c.sent()]); |
|||
return [2 /*return*/]; |
|||
} |
|||
}); |
|||
}); })()); |
|||
@ -0,0 +1 @@ |
|||
export declare const axiosInstance: import("axios").AxiosInstance; |
|||
File diff suppressed because it is too large
@ -0,0 +1,6 @@ |
|||
{ |
|||
"watch": ["src"], |
|||
"ext": "ts", |
|||
"ignore": ["src/**/*.spec.ts"], |
|||
"exec": "ts-node ./src/index.ts" |
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
{ |
|||
"name": "@abp/client-generator", |
|||
"version": "0.0.1", |
|||
"description": "", |
|||
"main": "./lib/index.js", |
|||
"bin": { |
|||
"abp-type": "./lib/index.js" |
|||
}, |
|||
"scripts": { |
|||
"start": "ts-node src/index.ts", |
|||
"start:watch": "nodemon", |
|||
"create": "npm run build && npm run test", |
|||
"build": "tsc -p .", |
|||
"test": "jest", |
|||
"prepublish": "yarn build" |
|||
}, |
|||
"author": "", |
|||
"license": "ISC", |
|||
"dependencies": { |
|||
"axios": "^0.19.0", |
|||
"chalk": "^3.0.0", |
|||
"clear": "^0.1.0", |
|||
"commander": "^4.0.1", |
|||
"figlet": "^1.2.4", |
|||
"path": "^0.12.7" |
|||
}, |
|||
"devDependencies": { |
|||
"@types/node": "^12.12.8", |
|||
"nodemon": "^1.19.4", |
|||
"ts-node": "^8.5.2", |
|||
"typescript": "^3.7.2" |
|||
} |
|||
} |
|||
@ -0,0 +1,40 @@ |
|||
#!/usr/bin/env node |
|||
import chalk from 'chalk'; |
|||
import path from 'path'; |
|||
import commander from 'commander'; |
|||
import { axiosInstance } from './utils/axios'; |
|||
const clear = require('clear'); |
|||
const figlet = require('figlet'); |
|||
|
|||
clear(); |
|||
|
|||
console.log( |
|||
chalk.red( |
|||
figlet.textSync('abp', { horizontalLayout: 'full' }) |
|||
) |
|||
); |
|||
|
|||
commander |
|||
.version('0.0.1') |
|||
.description("An example CLI for ordering pizza's") |
|||
.option('-p, --peppers', 'Add peppers') |
|||
.option('-P, --pineapple', 'Add pineapple') |
|||
.option('-b, --bbq', 'Add bbq sauce') |
|||
.option('-c, --cheese <type>', 'Add the specified type of cheese [marble]') |
|||
.option('-C, --no-cheese', 'You do not want any cheese') |
|||
.parse(process.argv); |
|||
|
|||
if (!process.argv.slice(2).length) { |
|||
commander.outputHelp(); |
|||
} |
|||
|
|||
console.log('you ordered a pizza with:'); |
|||
if (commander.peppers) console.log(' - peppers'); |
|||
if (commander.pineapple) console.log(' - pineapple'); |
|||
if (commander.bbq) console.log(' - bbq'); |
|||
const cheese: string = true === commander.cheese ? 'marble' : commander.cheese || 'no'; |
|||
console.log(' - %s cheese', cheese); |
|||
|
|||
console.log((async () => { |
|||
console.log(await axiosInstance.get('https://swapi.co/api/people/1')) |
|||
})()) |
|||
File diff suppressed because it is too large
@ -0,0 +1,14 @@ |
|||
{ |
|||
"compilerOptions": { |
|||
"target": "es5", |
|||
"module": "commonjs", |
|||
"lib": ["es6", "es2015", "dom"], |
|||
"declaration": true, |
|||
"outDir": "lib", |
|||
"rootDir": "src", |
|||
"strict": true, |
|||
"types": ["node"], |
|||
"esModuleInterop": true, |
|||
"resolveJsonModule": true, |
|||
}, |
|||
} |
|||
File diff suppressed because it is too large
Loading…
Reference in new issue