Skip to content

Commit 1f8df78

Browse files
committed
Initial donejs add plugin run
1 parent 488e161 commit 1f8df78

16 files changed

+363
-13
lines changed

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
; Unix-style newlines
2+
[*]
3+
end_of_line = LF
4+
indent_style = tab
5+
trim_trailing_whitespace = false
6+
insert_final_newline = true

.gitignore

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Logs
22
logs
33
*.log
4-
npm-debug.log*
54

65
# Runtime data
76
pids
@@ -14,24 +13,19 @@ lib-cov
1413
# Coverage directory used by tools like istanbul
1514
coverage
1615

17-
# nyc test coverage
18-
.nyc_output
19-
2016
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
2117
.grunt
2218

23-
# node-waf configuration
24-
.lock-wscript
25-
2619
# Compiled binary addons (http://nodejs.org/api/addons.html)
2720
build/Release
2821

29-
# Dependency directories
22+
# Dependency directory
23+
# Commenting this out is preferred by some people, see
24+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
3025
node_modules
31-
jspm_packages
3226

33-
# Optional npm cache directory
34-
.npm
27+
# Users Environment Variables
28+
.lock-wscript
3529

36-
# Optional REPL history
37-
.node_repl_history
30+
docs/
31+
dist/

.jshintrc

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"globals": {
3+
"steal": true,
4+
"can": true,
5+
"Zepto": true,
6+
"QUnit": true,
7+
"System": true,
8+
"SimpleDOM": true,
9+
"test": true,
10+
"asyncTest": true,
11+
"expect": true,
12+
"module": true,
13+
"ok": true,
14+
"equal": true,
15+
"notEqual": true,
16+
"deepEqual": true,
17+
"notDeepEqual": true,
18+
"strictEqual": true,
19+
"notStrictEqual": true,
20+
"raises": true,
21+
"start": true,
22+
"stop": true,
23+
"global": true
24+
},
25+
"curly": true,
26+
"eqeqeq": true,
27+
"freeze": true,
28+
"indent": 2,
29+
"latedef": true,
30+
"noarg": true,
31+
"undef": true,
32+
"unused": true,
33+
"trailing": true,
34+
"maxdepth": 4,
35+
"boss" : true,
36+
"eqnull": true,
37+
"evil": true,
38+
"loopfunc": true,
39+
"smarttabs": true,
40+
"maxerr" : 200,
41+
"jquery": true,
42+
"dojo": true,
43+
"mootools": true,
44+
"yui": true,
45+
"browser": true,
46+
"phantom": true,
47+
"rhino": true,
48+
"node": true,
49+
"esnext": true
50+
}

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!dist/

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
language: node_js
2+
node_js: node
3+
before_install:
4+
- "export DISPLAY=:99.0"
5+
- "sh -e /etc/init.d/xvfb start"

.yo-rc.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"generator-donejs": {
3+
"promptValues": {
4+
"authorName": "Bitovi",
5+
"authorEmail": "[email protected]",
6+
"authorUrl": "https://www.bitovi.com/"
7+
}
8+
}
9+
}

CONTRIBUTING.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Contributing to can-ajax
2+
3+
## Developing Locally
4+
5+
This section will walk you through setting up the [repository](https://github.com/canjs/can-ajax) on your computer.
6+
7+
### Signing up for GitHub
8+
9+
If you don’t already have a GitHub account, you’ll need to [create a new one](https://help.github.com/articles/signing-up-for-a-new-github-account/).
10+
11+
### Forking & cloning the repository
12+
13+
A “fork” is a copy of a repository in your personal GitHub account. “Cloning” is the process of getting the repository’s source code on your computer.
14+
15+
GitHub has a guide for [forking a repo](https://help.github.com/articles/fork-a-repo/). To fork can-ajax, you can start by going to its [fork page](https://github.com/canjs/can-ajax/fork).
16+
17+
Next, you’ll want to clone the repo. [GitHub’s cloning guide](https://help.github.com/articles/cloning-a-repository/) explains how to do this on Linux, Mac, or Windows.
18+
19+
GitHub’s guide will [instruct you](https://help.github.com/articles/fork-a-repo/#step-2-create-a-local-clone-of-your-fork) to clone it with a command like:
20+
21+
```shell
22+
git clone https://github.com/YOUR-USERNAME/can-ajax
23+
```
24+
25+
Make sure you replace `YOUR-USERNAME` with your GitHub username.
26+
27+
### Installing the dependencies
28+
29+
After you’ve forked & cloned the repository, you’ll need to install the project’s dependencies.
30+
31+
First, make sure you’ve [installed Node.js and npm](https://docs.npmjs.com/getting-started/installing-node).
32+
33+
If you just cloned the repo from the command line, you’ll want to switch to the folder with your clone:
34+
35+
```shell
36+
cd can-ajax
37+
```
38+
39+
Next, install the project’s dependencies with npm:
40+
41+
```shell
42+
npm install
43+
```
44+
45+
### Starting the development server
46+
47+
Run the following to start a dev server:
48+
49+
```shell
50+
npm run develop
51+
```
52+
53+
### Running the tests
54+
55+
You can manually run this repository’s tests in any browser by starting the dev server (see the section above) and visiting this page: http://localhost:8080/test/test.html
56+
57+
Firefox is used to run the repository’s automated tests from the command line. If you don’t already have it, [download Firefox](https://www.mozilla.org/en-US/firefox/new/). Mozilla has guides for installing it on [Linux](https://support.mozilla.org/t5/Install-and-Update/Install-Firefox-on-Linux/ta-p/2516), [Mac](https://support.mozilla.org/t5/Install-and-Update/How-to-download-and-install-Firefox-on-Mac/ta-p/3453), and [Windows](https://support.mozilla.org/t5/Install-and-Update/How-to-download-and-install-Firefox-on-Windows/ta-p/2210).
58+
59+
After Firefox is installed, you can run:
60+
61+
```shell
62+
npm test
63+
```
64+
65+
### Making a build
66+
67+
Run the following command to create a build:
68+
69+
```shell
70+
npm run build
71+
```
72+
73+
This will create a `dist/` folder that contains the AMD, CommonJS, and global module versions of the project.
74+
75+
### Building the documentation
76+
77+
To generate the docs:
78+
79+
```shell
80+
npm run document
81+
```
82+
83+
This will create a `docs/` folder that contains a browsable site with all of your documentation.
84+
85+
With the dev server running, you can view the docs at http://localhost:8080/docs/

README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,54 @@
11
# can-ajax
2+
3+
[![Build Status](https://travis-ci.org/canjs/can-ajax.png?branch=master)](https://travis-ci.org/canjs/can-ajax)
4+
25
jQuery-inspired AJAX request library.
6+
7+
## Usage
8+
9+
### ES6 use
10+
11+
With StealJS, you can import this module directly in a template that is autorendered:
12+
13+
```js
14+
import plugin from 'can-ajax';
15+
```
16+
17+
### CommonJS use
18+
19+
Use `require` to load `can-ajax` and everything else
20+
needed to create a template that uses `can-ajax`:
21+
22+
```js
23+
var plugin = require("can-ajax");
24+
```
25+
26+
## AMD use
27+
28+
Configure the `can` and `jquery` paths and the `can-ajax` package:
29+
30+
```html
31+
<script src="require.js"></script>
32+
<script>
33+
require.config({
34+
paths: {
35+
"jquery": "node_modules/jquery/dist/jquery",
36+
"can": "node_modules/canjs/dist/amd/can"
37+
},
38+
packages: [{
39+
name: 'can-ajax',
40+
location: 'node_modules/can-ajax/dist/amd',
41+
main: 'lib/can-ajax'
42+
}]
43+
});
44+
require(["main-amd"], function(){});
45+
</script>
46+
```
47+
48+
### Standalone use
49+
50+
Load the `global` version of the plugin:
51+
52+
```html
53+
<script src='./node_modules/can-ajax/dist/global/can-ajax.js'></script>
54+
```

build.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
var stealTools = require("steal-tools");
2+
3+
stealTools.export({
4+
steal: {
5+
config: __dirname + "/package.json!npm"
6+
},
7+
outputs: {
8+
"+cjs": {},
9+
"+amd": {},
10+
"+global-js": {}
11+
}
12+
}).catch(function(e){
13+
14+
setTimeout(function(){
15+
throw e;
16+
},1);
17+
18+
});

index.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>can-ajax - A Plugin for DoneJS</title>
5+
<style>
6+
body {
7+
width: 800px;
8+
margin: 0 auto;
9+
text-align: center;
10+
}
11+
h1 {
12+
font-weight: 100;
13+
font-size: 60px;
14+
color: #393E40;
15+
}
16+
</style>
17+
</head>
18+
<body>
19+
<h1>Created with the</h1>
20+
<a href="https://donejs.com/plugin.html">
21+
<img src="https://donejs.com/static/img/donejs-logo-black.svg" alt="DoneJS logo" style="max-width:100%;">
22+
</a>
23+
<a href="https://www.bitovi.com/blog/create-reusable-components-for-your-donejs-applications">plugin generator</a>
24+
</body>
25+
</html>

0 commit comments

Comments
 (0)