Comparing version 0.6.0 to 0.6.1
@@ -5,2 +5,27 @@ # Changelog | ||
### [0.6.1](https://github.com/aspidajs/aspida/compare/v0.6.0...v0.6.1) (2019-10-25) | ||
### Bug Fixes | ||
* **builder:** ignore files other than ts ([17ca0a8](https://github.com/aspidajs/aspida/commit/17ca0a8)) | ||
### Documentation | ||
* add contribution section and how to build on local ([fed3110](https://github.com/aspidajs/aspida/commit/fed3110)) | ||
* add how to watch file changes ([cb15b3d](https://github.com/aspidajs/aspida/commit/cb15b3d)) | ||
### Refactors | ||
* define command interface ([428922d](https://github.com/aspidajs/aspida/commit/428922d)) | ||
* define template interface which is used to build and write ([0a7cf33](https://github.com/aspidajs/aspida/commit/0a7cf33)) | ||
* implements build command objects ([47638c0](https://github.com/aspidajs/aspida/commit/47638c0)) | ||
* implements command interface ([1ac82b7](https://github.com/aspidajs/aspida/commit/1ac82b7)) | ||
* refactor cli interface to explicit what argument are usable ([7812353](https://github.com/aspidajs/aspida/commit/7812353)) | ||
* rename command class name for build ([eaf2c6d](https://github.com/aspidajs/aspida/commit/eaf2c6d)) | ||
* return early to make code nest shallow ([21f83de](https://github.com/aspidajs/aspida/commit/21f83de)) | ||
* return early to make code nest shallow ([a054ee5](https://github.com/aspidajs/aspida/commit/a054ee5)) | ||
## [0.6.0](https://github.com/aspidajs/aspida/compare/v0.5.0...v0.6.0) (2019-10-20) | ||
@@ -7,0 +32,0 @@ |
@@ -1,6 +0,4 @@ | ||
declare const _default: (input: string, baseURL?: string) => { | ||
text: string; | ||
filePath: string; | ||
}; | ||
import { Template } from './build/template'; | ||
declare const _default: (input: string, baseURL?: string) => Template; | ||
export default _default; | ||
//# sourceMappingURL=buildTemplate.d.ts.map |
@@ -10,5 +10,7 @@ "use strict"; | ||
var getInputs_1 = __importDefault(require("./getInputs")); | ||
var buildTemplate_1 = __importDefault(require("./buildTemplate")); | ||
var writeRouteFile_1 = __importDefault(require("./writeRouteFile")); | ||
var watchInputDir_1 = __importDefault(require("./watchInputDir")); | ||
var build_1 = require("./cli/build"); | ||
var command_1 = require("./cli/command"); | ||
var version_1 = require("./cli/version"); | ||
var options = { | ||
@@ -18,24 +20,22 @@ string: ['version', 'config', 'build', 'watch', 'baseurl'], | ||
}; | ||
var getBuildCommandFactory = function (config) { | ||
return build_1.CommandToBuild.getFactory(config, { | ||
read: getInputs_1.default, | ||
write: writeRouteFile_1.default, | ||
watch: watchInputDir_1.default, | ||
remove: function (filePath, callback) { | ||
fs_1.default.unlink(filePath, callback); | ||
} | ||
}); | ||
}; | ||
exports.run = function (args) { | ||
var argv = minimist_1.default(args, options); | ||
var config = getConfig_1.default(argv.config); | ||
if (argv.version !== undefined) { | ||
console.log("v" + require('../package').version); | ||
} | ||
if (argv.build !== undefined || argv.watch !== undefined) { | ||
getInputs_1.default(config.input).forEach(function (input) { | ||
var prevResult = buildTemplate_1.default(input, argv.baseurl); | ||
writeRouteFile_1.default(prevResult); | ||
if (argv.watch !== undefined) { | ||
watchInputDir_1.default(input, function () { | ||
var result = buildTemplate_1.default(input, argv.baseurl); | ||
if (prevResult.text !== result.text || prevResult.filePath !== result.filePath) { | ||
fs_1.default.unlink(prevResult.filePath, function () { return writeRouteFile_1.default(result); }); | ||
prevResult = result; | ||
} | ||
}); | ||
} | ||
}); | ||
} | ||
var commands = [ | ||
argv.version !== undefined ? version_1.version : command_1.nullCommand, | ||
argv.build !== undefined || argv.watch !== undefined | ||
? getBuildCommandFactory(getConfig_1.default(argv.config)).create(argv.watch !== undefined ? new build_1.Watch(argv.baseurl) : new build_1.Build(argv.baseurl)) | ||
: command_1.nullCommand | ||
]; | ||
commands.forEach(function (c) { return c.exec(); }); | ||
}; | ||
//# sourceMappingURL=cli.js.map |
@@ -36,2 +36,4 @@ "use strict"; | ||
if (fs_1.default.statSync(target).isFile() && file !== 'index.ts') { | ||
if (path_1.default.extname(file) !== '.ts') | ||
return; | ||
var importName = "Methods" + imports.length; | ||
@@ -38,0 +40,0 @@ imports.push("import { Methods as " + importName + " } from '" + importBasePath + "/" + file.replace(/\.ts$/, '') + "'"); |
@@ -1,6 +0,4 @@ | ||
declare const _default: ({ filePath, text }: { | ||
filePath: string; | ||
text: string; | ||
}) => void; | ||
import { Template } from './build/template'; | ||
declare const _default: ({ filePath, text }: Template) => void; | ||
export default _default; | ||
//# sourceMappingURL=writeRouteFile.d.ts.map |
{ | ||
"name": "aspida", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "Type safe HTTP client for the browser and node.js", | ||
@@ -5,0 +5,0 @@ "author": "m-mitsuhide <m.mitsuhide@amatelus.com>", |
@@ -1,2 +0,2 @@ | ||
<h1>Aspida</h1> | ||
<h1>aspida</h1> | ||
@@ -13,2 +13,40 @@ [![npm version][badge-npm]][badge-npm-url] | ||
## Getting Started | ||
### Installation | ||
- Using [npm][npm]: | ||
```sh | ||
$ npm install axios aspida | ||
``` | ||
- Using [Yarn][yarn]: | ||
```sh | ||
$ yarn add axios aspida | ||
``` | ||
### Examples | ||
See [examples][aspida-examples] for source code. | ||
- **[node](https://github.com/aspidajs/aspida/tree/develop/examples/node)**: | ||
Use in [Node.js][nodejs] (TypeScript) | ||
- **[with-mock](https://github.com/aspidajs/aspida/tree/develop/examples/with-mock)**: | ||
Using with a [axios-mock-server][axios-mock-server] | ||
## Contribution | ||
### Build | ||
```bash | ||
npm install | ||
npm run build | ||
node ./bin/index.js --build --baseurl=http://example.com | ||
``` | ||
if you want to watch file changes and rebuild automatically, | ||
you can use `--watch` instead of `--build` | ||
## License | ||
@@ -20,2 +58,3 @@ | ||
[aspida-examples]: https://github.com/aspidajs/aspida/tree/develop/examples | ||
[aspida-license]: https://github.com/aspidajs/aspida/blob/develop/LICENSE | ||
@@ -40,2 +79,6 @@ | ||
[axios-mock-server]: https://github.com/m-mitsuhide/axios-mock-server/ | ||
[dependabot]: https://dependabot.com | ||
[nodejs]: https://nodejs.org/ | ||
[npm]: https://www.npmjs.com/ | ||
[yarn]: https://yarnpkg.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
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
47690
61
446
82