Comparing version 0.1.2 to 0.2.0
@@ -5,2 +5,14 @@ # Changelog | ||
### [0.2.0](https://github.com/aspidajs/aspida/compare/v0.1.2...v0.2.0) (2019-10-10) | ||
### Features | ||
* **template:** export ApiInstance type ([bab8514](https://github.com/aspidajs/aspida/commit/bab8514)) | ||
### Refactors | ||
* delete replacePathSepIfWindows ([07b05c7](https://github.com/aspidajs/aspida/commit/07b05c7)) | ||
### 0.1.2 (2019-10-10) | ||
@@ -20,11 +32,3 @@ | ||
* **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) | ||
@@ -31,0 +35,0 @@ |
@@ -28,3 +28,2 @@ "use strict"; | ||
var template_1 = __importDefault(require("./template")); | ||
var replacePathSepIfWindows_1 = __importDefault(require("./replacePathSepIfWindows")); | ||
exports.default = (function (input, baseURL) { | ||
@@ -119,3 +118,3 @@ if (baseURL === void 0) { baseURL = ''; } | ||
.forEach(function (file) { | ||
var target = path_1.default.join(mockDir, file); | ||
var target = path_1.default.posix.join(mockDir, file); | ||
var valFn = "" + indent + file.split('.')[0] + ": {\n<% next %>\n" + indent + "}"; | ||
@@ -134,3 +133,3 @@ var newUrl = url + "/" + file.split('.')[0]; | ||
else if (fs_1.default.statSync(target).isDirectory()) { | ||
var indexPath = path_1.default.join(target, 'index.ts'); | ||
var indexPath = path_1.default.posix.join(target, 'index.ts'); | ||
var methods = ''; | ||
@@ -147,3 +146,3 @@ if (fs_1.default.existsSync(indexPath)) { | ||
}; | ||
var rootIndexPath = path_1.default.join(input, 'index.ts'); | ||
var rootIndexPath = path_1.default.posix.join(input, 'index.ts'); | ||
var rootIndent = ' '; | ||
@@ -162,7 +161,7 @@ var rootMethods = ''; | ||
var text = template_1.default | ||
.replace("'<% imports %>'", imports.map(function (i) { return replacePathSepIfWindows_1.default(i).replace(input, '.'); }).join('\n')) | ||
.replace("'<% imports %>'", imports.map(function (i) { return i.replace(input, '.'); }).join('\n')) | ||
.replace("'<% api %>'", res) | ||
.replace('<% baseURL %>', baseURL); | ||
return { text: text, filePath: path_1.default.join(input, '$api.ts') }; | ||
return { text: text, filePath: path_1.default.posix.join(input, '$api.ts') }; | ||
}); | ||
//# sourceMappingURL=buildRouteFile.js.map |
@@ -1,3 +0,3 @@ | ||
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"; | ||
declare const _default: "/* eslint-disable */\nimport axios, { AxiosRequestConfig, AxiosInstance } from 'axios'\n'<% imports %>'\n\nexport const baseURL = '<% baseURL %>'\n\nconst api = (client: AxiosInstance = axios) => {\n const prefix = (client.defaults.baseURL ? '' : baseURL).replace(/\\/$/, '')\n\n return '<% api %>'\n}\n\nexport type ApiInstance = ReturnType<typeof api>\n\nexport default api\n"; | ||
export default _default; | ||
//# sourceMappingURL=template.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.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"; | ||
exports.default = "/* eslint-disable */\nimport axios, { AxiosRequestConfig, AxiosInstance } from 'axios'\n'<% imports %>'\n\nexport const baseURL = '<% baseURL %>'\n\nconst api = (client: AxiosInstance = axios) => {\n const prefix = (client.defaults.baseURL ? '' : baseURL).replace(/\\/$/, '')\n\n return '<% api %>'\n}\n\nexport type ApiInstance = ReturnType<typeof api>\n\nexport default api\n"; | ||
//# sourceMappingURL=template.js.map |
{ | ||
"name": "aspida", | ||
"version": "0.1.2", | ||
"version": "0.2.0", | ||
"description": "Type safe HTTP client for the browser and node.js", | ||
@@ -27,3 +27,3 @@ "author": "m-mitsuhide <m.mitsuhide@amatelus.com>", | ||
"scripts": { | ||
"dev": "ts-node dev", | ||
"dev": "ts-node src/dev", | ||
"build": "rimraf dist && tsc --project tsconfig.build.json", | ||
@@ -30,0 +30,0 @@ "release": "standard-version --skip.tag", |
@@ -29,3 +29,3 @@ <h1>Aspida</h1> | ||
[badge-coverage]: https://img.shields.io/codecov/c/github/aspidajs/aspida.svg | ||
[badge-dependabot]: https://badgen.net/dependabot/aspidajs/aspida?label=dependabot | ||
[badge-dependabot]: https://api.dependabot.com/badges/status?host=github&repo=aspidajs/aspida | ||
[badge-lgtm-url]: https://lgtm.com/projects/g/aspidajs/aspida/context:javascript | ||
@@ -36,1 +36,5 @@ [badge-lgtm]: https://img.shields.io/lgtm/grade/javascript/g/aspidajs/aspida.svg | ||
[badge-npm]: https://img.shields.io/npm/v/aspida | ||
<!-- URL: General --> | ||
[dependabot]: https://dependabot.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
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
31815
286
39