Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to CanJS 3.0, Steal 0.16 #273

Merged
merged 7 commits into from Jul 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions .travis.yml
@@ -1,7 +1,7 @@
language: node_js
node_js:
- "0.10"
- "0.12"
- "node"
- 4
- 6
- 8
script: npm test
sudo: false
3 changes: 2 additions & 1 deletion appveyor.yml
@@ -1,7 +1,8 @@
# Test against this version of Node.js
environment:
matrix:
- nodejs_version: "0.12"
- nodejs_version: "4"
- nodejs_version: "6"

# Install scripts. (runs after repo cloning)
install:
Expand Down
4 changes: 2 additions & 2 deletions examples/simple/components/tabs.js
@@ -1,4 +1,4 @@
import can from 'can/';
import CanComponent from 'can-component';
import tabsStache from './tabs.stache!';
/**
* @module {function} components/tabs/ <tabs>
Expand All @@ -7,7 +7,7 @@ import tabsStache from './tabs.stache!';
* @signature `<tabs>`
* Creates a tabs component.
*/
export default can.Component.extend({
export default CanComponent.extend({
tag: "tabs",
template: tabsStache,
scope: { ... }
Expand Down
62 changes: 34 additions & 28 deletions lib/configured/configured_test.js
Expand Up @@ -104,7 +104,7 @@ describe("lib/configured", function(){
done(e)
} else {
configured.getProject({
source: "git://github.com/bitovi/canjs#minor",
source: "git://github.com/canjs/canjs#master",
path: path.join(__dirname,"test","tmp","canjs"),
npmInstall: ["stealjs/steal#master"]
}).then(function(){
Expand All @@ -122,7 +122,7 @@ describe("lib/configured", function(){


it(".geneateProject is able to read the documentjs.json without versions and build a site", function(done){
this.timeout(10000);
this.timeout(30000);
rmdir(path.join(__dirname,"test","api"), function(e){
if(e) {
done(e);
Expand All @@ -141,7 +141,7 @@ describe("lib/configured", function(){
});

it(".geneateProject is able to take a docObject instead of reading one", function(done){
this.timeout(10000);
this.timeout(30000);
rmdir(path.join(__dirname,"test","tmp","example_project"), function(e){
if(e) {
done(e);
Expand Down Expand Up @@ -176,15 +176,17 @@ describe("lib/configured", function(){
open("test/tmp/multiple_versions/1.0.0/api/index.html",function(browser, close){
var select = browser.window.document.getElementsByTagName("select")[0],
$ = browser.window.$;
$(select).val("3.0.0").trigger("change");

waitFor(browser, function(window){
return window.location.href == "http://localhost:8081/test/tmp/multiple_versions/3.0.0/api/index.html"
}, function(){
assert.ok(true,"updated page");
close();
next();
}, close);
$(select).val("3.0.0");
select.dispatchEvent(new browser.window.Event('change'));

waitFor(browser, function(window){
return window.location.href == "http://localhost:8081/test/tmp/multiple_versions/3.0.0/api/index.html"
}, function(){
assert.ok(true,"updated page");
close();
next();
}, close);

},done);
};
Expand All @@ -193,15 +195,17 @@ describe("lib/configured", function(){
open("test/tmp/multiple_versions/api/index.html",function(browser, close){
var select = browser.window.document.getElementsByTagName("select")[0],
$ = browser.window.$;
$(select).val("3.0.0").trigger("change");

waitFor(browser, function(window){
return window.location.href == "http://localhost:8081/test/tmp/multiple_versions/3.0.0/api/index.html"
}, function(){
assert.ok(true,"updated page");
close();
next();
}, close);
$(select).val("3.0.0");
select.dispatchEvent(new browser.window.Event('change'));

waitFor(browser, function(window){
return window.location.href == "http://localhost:8081/test/tmp/multiple_versions/3.0.0/api/index.html"
}, function(){
assert.ok(true,"updated page");
close();
next();
}, close);

},done);
};
Expand All @@ -210,15 +214,17 @@ describe("lib/configured", function(){
open("test/tmp/multiple_versions/3.0.0/api/index.html",function(browser, close){
var select = browser.window.document.getElementsByTagName("select")[0],
$ = browser.window.$;
$(select).val("2.0.0").trigger("change");

waitFor(browser, function(window){
return window.location.href == "http://localhost:8081/test/tmp/multiple_versions/api/index.html"
}, function(){
assert.ok(true,"updated page");
close();
next();
}, close);
$(select).val("2.0.0");
select.dispatchEvent(new browser.window.Event('change'));

waitFor(browser, function(window){
return window.location.href == "http://localhost:8081/test/tmp/multiple_versions/api/index.html"
}, function(){
assert.ok(true,"updated page");
close();
next();
}, close);

},done);
};
Expand Down Expand Up @@ -258,7 +264,7 @@ describe("lib/configured", function(){


it(".generateProject is able to build something without a documentjs.json", function(done){
this.timeout(10000);
this.timeout(30000);
rmdir(path.join(__dirname,"test","docs"), function(e){
if(e) {
done(e);
Expand Down
3 changes: 2 additions & 1 deletion lib/generate/test/generate_test.js
Expand Up @@ -39,7 +39,7 @@ var open = function(url, callback, done){
describe("documentjs/lib/generate/generate",function(){

it("works",function(done){
this.timeout(30000);
this.timeout(10000);
rmdir(__dirname+"/out",function(error){

generate({
Expand All @@ -62,6 +62,7 @@ describe("documentjs/lib/generate/generate",function(){
});

it("@outline works", function(done){
this.timeout(30000);
generate({
glob: __dirname+"/example/*.js",
dest: __dirname+"/out",
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/html/html_test.js
Expand Up @@ -33,7 +33,7 @@ describe("documentjs/lib/generators/html",function(){
}, options));
});
html.generate(docMap,options).then(function(){
if(!fs.existsSync(path.join(__dirname,"test","tmp","static","can","can.js"))) {
if(!fs.existsSync(path.join(__dirname,"test","tmp","static","can-control","can-control.js"))) {
done(new Error("canjs does not exist"));
} else if(fs.existsSync(path.join(__dirname,"test","tmp","static","bundles","static.js"))) {
done(new Error("static build exists"));
Expand Down
2 changes: 1 addition & 1 deletion lib/tags/alias.js
Expand Up @@ -21,7 +21,7 @@ var _default = require("./_default"),
* /**
* * @alias WidgetFactory
* *|
* can.Class.extend("jQuery.Controller",
* CanClass.extend("jQuery.Controller",
* ...
* @codeend
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/tags/deprecated.js
Expand Up @@ -33,7 +33,7 @@ var tnd = require('./helpers/typeNameDescription')
* /**
* * @function
* * @deprecated {1.0} This method has been replaced
* * by [can.Model.parseModel].
* * by [CanModel.parseModel].
* *
* * @param {String} name
* *|
Expand Down
48 changes: 24 additions & 24 deletions lib/tags/helpers/typer_test.js
Expand Up @@ -5,9 +5,9 @@ var typer = require("./typer"),
describe("documentjs/tags/helpers/typer", function(){

it("name",function(){
assert.deepEqual( typer.type("can.Control"), {
assert.deepEqual( typer.type("CanControl"), {
types: [{
type: "can.Control"
type: "CanControl"
}]
});
});
Expand Down Expand Up @@ -43,11 +43,11 @@ describe("documentjs/tags/helpers/typer", function(){
});

it("union",function(){
assert.deepEqual( typer.type("(can.Control|can.Model)"), {
assert.deepEqual( typer.type("(CanControl|CanModel)"), {
types: [{
type: "can.Control"
type: "CanControl"
},{
type: "can.Model"
type: "CanModel"
}]
});
});
Expand All @@ -67,16 +67,16 @@ describe("documentjs/tags/helpers/typer", function(){
});

it("nullable",function(){
assert.deepEqual( typer.type("?can.Control"), {
assert.deepEqual( typer.type("?CanControl"), {
types: [{
type: "can.Control"
type: "CanControl"
}],
nullable: true
});

assert.deepEqual( typer.type("?can.Control"), {
assert.deepEqual( typer.type("?CanControl"), {
types: [{
type: "can.Control"
type: "CanControl"
}],
nullable: true
});
Expand All @@ -85,9 +85,9 @@ describe("documentjs/tags/helpers/typer", function(){


it("nonnullable",function(){
assert.deepEqual( typer.type("!can.Control"), {
assert.deepEqual( typer.type("!CanControl"), {
types: [{
type: "can.Control"
type: "CanControl"
}],
nonnull: true
});
Expand Down Expand Up @@ -123,18 +123,18 @@ describe("documentjs/tags/helpers/typer", function(){
});

it("variable params",function(){
assert.deepEqual( typer.type("...can.Control"), {
assert.deepEqual( typer.type("...CanControl"), {
types: [{
type: "can.Control"
type: "CanControl"
}],
variable: true
});
})

it("variable params",function(){
assert.deepEqual( typer.type("...can.Control"), {
assert.deepEqual( typer.type("...CanControl"), {
types: [{
type: "can.Control"
type: "CanControl"
}],
variable: true
});
Expand All @@ -143,14 +143,14 @@ describe("documentjs/tags/helpers/typer", function(){

it("variable params",function(){

assert.deepEqual( typer.type("function(...can.Observe){}"), {
assert.deepEqual( typer.type("function(...CanObserve){}"), {
types: [{
type: "function",
constructs: undefined,
context: undefined,
returns: {types: [{type: "undefined"}]},
params: [
{types: [{type: "can.Observe"}], variable: true}
{types: [{type: "CanObserve"}], variable: true}
]
}],
});
Expand All @@ -159,9 +159,9 @@ describe("documentjs/tags/helpers/typer", function(){

// NON-STANDARD types ...
it("optional",function(){
assert.deepEqual( typer.type("can.Control="), {
assert.deepEqual( typer.type("CanControl="), {
types: [{
type: "can.Control"
type: "CanControl"
}],
optional: true
});
Expand All @@ -178,17 +178,17 @@ describe("documentjs/tags/helpers/typer", function(){
});

it("parenthesis-less union", function(){
assert.deepEqual( typer.type("can.Control|can.Model"), {
assert.deepEqual( typer.type("CanControl|CanModel"), {
types: [{
type: "can.Control"
type: "CanControl"
},{
type: "can.Model"
type: "CanModel"
}]
});
})

it("parenthesis-less union with function", function(){
assert.deepEqual( typer.type("function|can.Model"), {
assert.deepEqual( typer.type("function|CanModel"), {
types: [{
type: "function",
type: "function",
Expand All @@ -197,7 +197,7 @@ describe("documentjs/tags/helpers/typer", function(){
returns: {types: [{type: "undefined"}]},
params: []
},{
type: "can.Model"
type: "CanModel"
}]
});
});
Expand Down
4 changes: 2 additions & 2 deletions lib/tags/plugin.js
Expand Up @@ -12,8 +12,8 @@
*
* @codestart
* /**
* * @@page can.Construct.super
* * @@parent can.Construct.plugins
* * @@page CanConstruct.super
* * @@parent CanConstruct.plugins
* * @@plugin can/construct/super
* * @@test can/construct/super/qunit.html
* *|
Expand Down
6 changes: 3 additions & 3 deletions lib/tags/property_test.js
Expand Up @@ -27,8 +27,8 @@ describe("documentjs/lib/tags/property",function(){

var obj = {};
var docMap = {Foo: {name: "Foo", type: "constructor"}}
property.add.call(obj,"@property {can.Map|Object|function} bar a description",null,docMap.Foo, docMap );
option.add.call(obj,"@option {can.Map} can.Map description");
property.add.call(obj,"@property {CanMap|Object|function} bar a description",null,docMap.Foo, docMap );
option.add.call(obj,"@option {CanMap} CanMap description");
option.add.call(obj,"@option {Object} Object description");
option.add.call(obj,"@option {function(String)} Function description");

Expand All @@ -37,7 +37,7 @@ describe("documentjs/lib/tags/property",function(){
name: "Foo.bar",
type: "property",
types: [
{type: "can.Map", description: "can.Map description"},
{type: "CanMap", description: "CanMap description"},
{type: "Object", description: "Object description", options: []},
{
constructs: undefined,
Expand Down
4 changes: 2 additions & 2 deletions lib/tags/signature.js
Expand Up @@ -10,9 +10,9 @@
* @codestart javascript
* /**
* * Capitalizes a string.
* * @@signature `can.capitalize(s)` Example:
* * @@signature `CanCapitalize(s)` Example:
* *
* * can.capitalize("foo") //-> "Bar"
* * CanCapitalize("foo") //-> "Bar"
* *
* * @@param {String} s the string to be lowercased.
* * @@return {String} a string with the first character capitalized,
Expand Down