This repository has been archived by the owner on Mar 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
422 additions
and
273 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
*.swo | ||
*~ | ||
*.log | ||
node_modules | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# :eight_spoked_asterisk: :stars: :sparkles: :dizzy: :star2: :star2: :sparkles: :dizzy: :star2: :star2: Contributing :star: :star2: :dizzy: :sparkles: :star: :star2: :dizzy: :sparkles: :stars: :eight_spoked_asterisk: | ||
|
||
So, you want to contribute to this project! That's awesome. However, before | ||
doing so, please read the following simple steps how to contribute. This will | ||
make the life easier and will avoid wasting time on things which are not | ||
requested. :sparkles: | ||
|
||
## Discuss the changes before doing them | ||
- First of all, open an issue in the repository, using the [bug tracker][1], | ||
describing the contribution you would like to make, the bug you found or any | ||
other ideas you have. This will help us to get you started on the right | ||
foot. | ||
|
||
- If it makes sense, add the platform and software information (e.g. operating | ||
system, Node.JS version etc.), screenshots (so we can see what you are | ||
seeing). | ||
|
||
- It is recommended to wait for feedback before continuing to next steps. | ||
However, if the issue is clear (e.g. a typo) and the fix is simple, you can | ||
continue and fix it. | ||
|
||
## Fixing issues | ||
- Fork the project in your account and create a branch with your fix: | ||
`some-great-feature` or `some-issue-fix`. | ||
|
||
- Commit your changes in that branch, writing the code following the | ||
[code style][2]. If the project contains tests (generally, the `test` | ||
directory), you are encouraged to add a test as well. :memo: | ||
|
||
- If the project contains a `package.json` or a `bower.json` file add yourself | ||
in the `contributors` array (or `authors` in the case of `bower.json`; | ||
if the array does not exist, create it): | ||
|
||
```json | ||
{ | ||
"contributors": [ | ||
"Your Name <and@email.address> (http://your.website)" | ||
] | ||
} | ||
``` | ||
|
||
## Creating a pull request | ||
|
||
- Open a pull request, and reference the initial issue in the pull request | ||
message (e.g. *fixes #<your-issue-number>*). Write a good description and | ||
title, so everybody will know what is fixed/improved. | ||
|
||
- If it makes sense, add screenshots, gifs etc., so it is easier to see what | ||
is going on. | ||
|
||
## Wait for feedback | ||
Before accepting your contributions, we will review them. You may get feedback | ||
about what should be fixed in your modified code. If so, just keep committing | ||
in your branch and the pull request will be updated automatically. | ||
|
||
## Everyone is happy! | ||
Finally, your contributions will be merged, and everyone will be happy! :smile: | ||
Contributions are more than welcome! | ||
|
||
Thanks! :sweat_smile: | ||
|
||
[1]: https://github.com/cdnjs/cdnjs-importer/issues | ||
|
||
[2]: https://github.com/IonicaBizau/code-style |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
## Documentation | ||
You can see below the API reference of this module. | ||
|
||
### `CdnJsImporter(options, callback)` | ||
Creates a new instance of `CdnJsImporter`. | ||
|
||
#### Params | ||
- **Object** `options`: An object containing the following fields: | ||
- `libs` (Array): An array of `Lib` items (see the `add` method what they should contain). They will be downloaded in parallel (default: `[]`). | ||
- `debug` (Boolean|Number): A boolean or number value indicating the log level (default: `false`). | ||
- `cdnjs` (String): The absolute path to the local cdnjs repository. | ||
- **Function** `callback`: The callback function. | ||
|
||
#### Return | ||
- **CdnJsImporter** The `CdnJsImporter` instance. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,24 @@ | ||
The MIT License (MIT) | ||
The KINDLY License | ||
Copyright (c) 2015 Ionică Bizău <bizauionica@gmail.com> | ||
|
||
Copyright (c) 2015 Ionică Bizău | ||
You have the permission to use this software, read its source code, modify and | ||
redistribute it under the following terms: | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
- if you want to use this software or include parts of its code in a | ||
closed-source or commercial project you should kindly ask the | ||
author (via a private message or email) and get a positive answer | ||
- this license should be included in the modified versions of this software | ||
- in case of redistributing modified copies, you are encouraged to clearly | ||
indicate that the copies are based on this work | ||
- if you think that your redistributed copy is awesome, you are encouraged to | ||
show the author of this software what you did and how you helped the others | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
You are free to install and use this software on as many machines as you want, | ||
free of charge, making sure you met the terms above. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
You are encouraged to kindly support the software and its author by: | ||
|
||
- sharing his/her work | ||
- reporting issues/bugs and asking for feature requests | ||
- donating money or any other things that can help the author | ||
- contribute on the software code by fixing bugs and adding features |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,97 @@ | ||
![CDNJS Importer](http://i.imgur.com/OLwedYJ.png) | ||
<!----------------------------------------------------------------------------> | ||
<!-- STOP, LOOK & LISTEN! --> | ||
<!-- ==================== --> | ||
<!-- Do NOT edit this file directly since it's generated from a template --> | ||
<!-- file, using https://github.com/IonicaBizau/node-blah --> | ||
<!-- --> | ||
<!-- If you found a typo in documentation, fix it in the source files --> | ||
<!-- (`lib/*.js`) and make a pull request. --> | ||
<!-- --> | ||
<!-- If you have any other ideas, open an issue. --> | ||
<!-- --> | ||
<!-- Please consider reading the contribution steps (CONTRIBUTING.md). --> | ||
<!-- * * * Thanks! * * * --> | ||
<!----------------------------------------------------------------------------> | ||
|
||
![cdnjs-importer](http://i.imgur.com/OLwedYJ.png) | ||
|
||
# `$ cdnjs-importer` [![Donate now][donate-now]][paypal-donations] | ||
|
||
# CDNJS Importer | ||
Easy way to import a library into CDNJS. | ||
|
||
## Installation | ||
|
||
You can install the package globally and use it as command line tool: | ||
|
||
```sh | ||
$ npm install -g cdnjs-importer | ||
$ npm i -g cdnjs-importer@2.0.0-beta | ||
``` | ||
|
||
## Usage | ||
|
||
Use the `-c` option to specify the path to the CDNJS repository. Default location is `~/cdnjs`. | ||
Then, run `cdnjs-importer --help` and see what the CLI tool can do. | ||
|
||
```sh | ||
$ cdnjs-importer -c path/to/cdnjs git@github.com:someone/project.git git@github.com:someone/another-project.git | ||
``` | ||
$ cdnjs-importer --help | ||
Usage: cdnjs-importer [options] | ||
|
||
## Documentation | ||
Using as module is also possible. | ||
Options: | ||
-g, --git-url <git-url> Your library git url. | ||
-p, --path <path> The path to your cdnjs local repository. | ||
-h, --help Displays this help. | ||
-v, --version Displays version information. | ||
|
||
### `CdnJsImporter(options, callback)` | ||
Creates a new instance of `CdnJsImporter`. | ||
Examples: | ||
cdnjs-importer -g git@github.com:IonicaBizau/gh.js.git # adds gh.js to cdnjs | ||
cdnjs-importer -g ... -p path/to/cdnjs | ||
|
||
#### Params | ||
- **Object** `options`: An object containing the following fields: | ||
- `libs` (Array): An array of `Lib` items (see the `add` method what they should contain). They will be downloaded in parallel (default: `[]`). | ||
- `debug` (Boolean|Number): A boolean or number value indicating the log level (default: `false`). | ||
- `cdnjs` (String): The absolute path to the local cdnjs repository. | ||
The default cdnjs repository location is in ~/cdnjs | ||
|
||
- **Function** `callback`: The callback function. | ||
Documentation can be found at https://github.com/cdnjs/cdnjs-importer | ||
``` | ||
|
||
#### Return | ||
- **CdnJsImporter** The `CdnJsImporter` instance. | ||
## Example | ||
|
||
### `add(lib, callback)` | ||
Adds a new library in the local cdnjs repository. | ||
Here is an example how to use this package as library. To install it locally, as library, you can do that using `npm`: | ||
|
||
#### Params | ||
- **Object|String** `lib`: The git url as string or an object containing: | ||
- `git` (String): The `git` url. | ||
- `dir` (String): The directory containing the files which should be imported (default: `"/dist"` or `"/build"` or `"/src"` or `"/"`). | ||
- `map` (Array): The file map used by cdnjs in autoupdate process (default: `[{ basePath: lib.dir , files: ["**/*"] }]`). | ||
- **Function** `callback`: The callback function called with `error` and `data`. | ||
```sh | ||
$ npm i cdnjs-importer | ||
``` | ||
|
||
#### Return | ||
- **CdnJsImporter** The `CdnJsImporter` instance. | ||
```js | ||
// Dependencies | ||
var CdnJsImporter = require("cdnjs-importer") | ||
, Path = require("path") | ||
; | ||
|
||
// Test adding CaiuSS | ||
CdnJsImporter({ | ||
cdnjs: Path.resolve(__dirname, "../../cdnjs") | ||
, debug: true | ||
, libs: [ | ||
"git@github.com:IonicaBizau/CaiuSS.git" | ||
] | ||
}, function (res) { | ||
console.log(res); | ||
}); | ||
|
||
``` | ||
|
||
## Documentation | ||
|
||
For full API reference, see the [DOCUMENTATION.md][docs] file. | ||
|
||
## How to contribute | ||
1. File an issue in the repository, using the bug tracker, describing the | ||
contribution you'd like to make. This will help us to get you started on the | ||
right foot. | ||
2. Fork the project in your account and create a new branch: | ||
`your-great-feature`. | ||
3. Commit your changes in that branch. | ||
4. Open a pull request, and reference the initial issue in the pull request | ||
message. | ||
Have an idea? Found a bug? See [how to contribute][contributing]. | ||
|
||
## Press Highlights | ||
None yet. If you wrote or found an article about this project, [add it][contributing] in this section. :memo: | ||
|
||
## License | ||
See the [LICENSE](./LICENSE) file. | ||
[KINDLY][license] © [Ionică Bizău][website]–The [LICENSE](/LICENSE) file contains | ||
a copy of the license. | ||
|
||
[license]: http://ionicabizau.github.io/kindly-license/?author=Ionic%C4%83%20Biz%C4%83u%20%3Cbizauionica@gmail.com%3E&year=2015 | ||
[contributing]: /CONTRIBUTING.md | ||
[website]: http://ionicabizau.net | ||
[docs]: /DOCUMENTATION.md | ||
[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MG98D7NPFZ3MG | ||
[donate-now]: http://i.imgur.com/6cMbHOC.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.