Comparing version 0.1.0 to 0.1.1
@@ -5,2 +5,18 @@ # Changelog | ||
### 0.1.1 (2019-10-09) | ||
### Bug Fixes | ||
* **config:** change default input to apis ([7eb65c7](https://github.com/aspidajs/aspida/commit/7eb65c7)) | ||
* **template:** add AxiosInstance type ([5828743](https://github.com/aspidajs/aspida/commit/5828743)) | ||
* **test:** update $api.ts snapshot ([daaf4c5](https://github.com/aspidajs/aspida/commit/daaf4c5)) | ||
### Features | ||
* **builder:** add index.ts file ([817bf07](https://github.com/aspidajs/aspida/commit/817bf07)) | ||
* **cli:** first commit ([962f4dd](https://github.com/aspidajs/aspida/commit/962f4dd)) | ||
* **test:** add $api.ts snapshot ([4453e6a](https://github.com/aspidajs/aspida/commit/4453e6a)) | ||
### 0.1.0 (2019-10-08) | ||
@@ -7,0 +23,0 @@ |
@@ -1,3 +0,2 @@ | ||
import { Config } from './getConfig'; | ||
declare const _default: (input: string, config: Config, baseURL?: string) => { | ||
declare const _default: (input: string, baseURL?: string) => { | ||
text: string; | ||
@@ -4,0 +3,0 @@ filePath: string; |
@@ -16,4 +16,5 @@ "use strict"; | ||
const ts = __importStar(require("typescript")); | ||
const template_1 = __importDefault(require("./template")); | ||
const replacePathSepIfWindows_1 = __importDefault(require("./replacePathSepIfWindows")); | ||
exports.default = (input, config, baseURL = '') => { | ||
exports.default = (input, baseURL = '') => { | ||
const imports = []; | ||
@@ -148,4 +149,3 @@ let valCount = 0; | ||
}`); | ||
const template = fs_1.default.readFileSync(path_1.default.join(__dirname, 'template.ts'), 'utf8'); | ||
const text = template | ||
const text = template_1.default | ||
.replace("'<% imports %>'", imports.map(i => replacePathSepIfWindows_1.default(i).replace(input, '.')).join('\n')) | ||
@@ -152,0 +152,0 @@ .replace("'<% api %>'", res) |
@@ -25,7 +25,7 @@ "use strict"; | ||
getInputs_1.default(config.input).forEach(input => { | ||
let prevResult = buildRouteFile_1.default(input, config, argv.baseurl); | ||
let prevResult = buildRouteFile_1.default(input, argv.baseurl); | ||
writeRouteFile_1.default(prevResult); | ||
if (argv.watch !== undefined) { | ||
watchInputDir_1.default(input, () => { | ||
const result = buildRouteFile_1.default(input, config, argv.baseurl); | ||
const result = buildRouteFile_1.default(input, argv.baseurl); | ||
if (prevResult.text !== result.text || prevResult.filePath !== result.filePath) { | ||
@@ -32,0 +32,0 @@ fs_1.default.unlink(prevResult.filePath, () => writeRouteFile_1.default(result)); |
@@ -9,4 +9,2 @@ export declare type Config = { | ||
input: string; | ||
target: "es6"; | ||
outputExt: "js"; | ||
}; | ||
@@ -13,0 +11,0 @@ declare const _default: (rcFilePath?: string) => Config; |
@@ -9,7 +9,5 @@ "use strict"; | ||
exports.defaultConfig = { | ||
input: 'mocks', | ||
target: 'es6', | ||
outputExt: 'js' | ||
input: 'apis' | ||
}; | ||
exports.default = (rcFilePath = '.aspidarc') => fs_1.default.existsSync(rcFilePath) ? JSON.parse(fs_1.default.readFileSync(rcFilePath, 'utf8')) : {}; | ||
//# sourceMappingURL=getConfig.js.map |
@@ -1,4 +0,3 @@ | ||
export declare const baseURL = "<% baseURL %>"; | ||
declare const _default: (client?: import("axios").AxiosStatic) => string; | ||
declare const _default: "/* eslint-disable */\nimport axios, { AxiosRequestConfig, AxiosInstance } from 'axios'\n'<% imports %>'\n\nexport const baseURL = '<% baseURL %>'\n\nexport default (client: AxiosInstance = axios) => {\n const prefix = (client.defaults.baseURL ? '' : baseURL).replace(/\\/$/, '')\n\n return '<% api %>'\n}\n"; | ||
export default _default; | ||
//# sourceMappingURL=template.d.ts.map |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/* eslint-disable */ | ||
const axios_1 = __importDefault(require("axios")); | ||
'<% imports %>'; | ||
exports.baseURL = '<% baseURL %>'; | ||
exports.default = (client = axios_1.default) => { | ||
const prefix = (client.defaults.baseURL ? '' : exports.baseURL).replace(/\/$/, ''); | ||
return '<% api %>'; | ||
}; | ||
exports.default = `/* eslint-disable */ | ||
import axios, { AxiosRequestConfig, AxiosInstance } from 'axios' | ||
'<% imports %>' | ||
export const baseURL = '<% baseURL %>' | ||
export default (client: AxiosInstance = axios) => { | ||
const prefix = (client.defaults.baseURL ? '' : baseURL).replace(/\\/$/, '') | ||
return '<% api %>' | ||
} | ||
`; | ||
//# sourceMappingURL=template.js.map |
{ | ||
"name": "aspida", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Type safe HTTP client for the browser and node.js", | ||
@@ -5,0 +5,0 @@ "author": "m-mitsuhide <m.mitsuhide@amatelus.com>", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
30311
0
273