bingo 0.1.0 โ 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +7 -0
- package/README.md +24 -30
- package/package.json +4 -33
- package/.npmignore +0 -1
- package/LICENSE-MIT +0 -22
- package/grunt.js +0 -39
- package/lib/bingo.js +0 -44
- package/test/bingo_test.js +0 -63
package/LICENSE.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# MIT License
|
|
2
|
+
|
|
3
|
+
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:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
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.
|
package/README.md
CHANGED
|
@@ -1,41 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">Bingo</h1>
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<p align="center">Composable, testable, type-safe templates. ๐</p>
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://github.com/JoshuaKGoldberg/create/blob/main/.github/CODE_OF_CONDUCT.md" target="_blank"><img alt="๐ค Code of Conduct: Kept" src="https://img.shields.io/badge/%F0%9F%A4%9D_code_of_conduct-kept-21bb42" /></a>
|
|
7
|
+
<a href="https://codecov.io/gh/JoshuaKGoldberg/create" target="_blank"><img alt="๐งช Coverage" src="https://img.shields.io/codecov/c/github/JoshuaKGoldberg/create?label=%F0%9F%A7%AA%20coverage" /></a>
|
|
8
|
+
<a href="https://github.com/JoshuaKGoldberg/create/blob/main/LICENSE.md" target="_blank"><img alt="๐ License: MIT" src="https://img.shields.io/badge/%F0%9F%93%9D_license-MIT-21bb42.svg"></a>
|
|
9
|
+
<a href="http://npmjs.com/package/create"><img alt="๐ฆ npm version" src="https://img.shields.io/npm/v/create?color=21bb42&label=%F0%9F%93%A6%20npm" /></a>
|
|
10
|
+
<img alt="๐ช TypeScript: Strict" src="https://img.shields.io/badge/%F0%9F%92%AA_typescript-strict-21bb42.svg" />
|
|
11
|
+
</p>
|
|
7
12
|
|
|
8
|
-
|
|
13
|
+
๐ See **[create.bingo](https://create.bingo)**.
|
|
9
14
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var bingo = require('bingo');
|
|
15
|
+
Bingo is a new scaffolding engine for describing repository templates.
|
|
16
|
+
It's like a modern version of [Yeoman](https://yeoman.io), but:
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
- **Composable**: Individual blocks in your templates can be mix-and-matched together
|
|
19
|
+
- **Testable**: Each layer of your templates can be individually unit or end-to-end tested
|
|
20
|
+
- **Type-Safe**: Fully typed from the ground up, including [Zod](https://zod.dev)-based options schemas
|
|
16
21
|
|
|
17
|
-
|
|
18
|
-
console.log(someObject.someFunction.didExecute() === false); // true
|
|
19
|
-
console.log(someObject.someFunction.timesExecuted()); // 0
|
|
22
|
+
Bingo also provides scaffolding to turn templates into a repository generator akin to a `create-next-app` or `create-typescript-app`.
|
|
20
23
|
|
|
21
|
-
|
|
22
|
-
someObject.someFunction();
|
|
24
|
+
๐ See **[create.bingo](https://create.bingo)**.
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
console.log(someObject.someFunction.didExecute() === true); // true
|
|
26
|
-
console.log(someObject.someFunction.timesExecuted()); // 1
|
|
27
|
-
```
|
|
26
|
+
## Status
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
Bingo is early stage.
|
|
29
|
+
It runs well but its APIs are still in flux.
|
|
30
|
+
Please try it out and report any issues on GitHub!
|
|
31
|
+
๐
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
> ๐ This package was templated with [`create-typescript-app`](https://github.com/JoshuaKGoldberg/create-typescript-app).
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
- 0.1.0 (2012-09-14) First version
|
|
36
|
-
|
|
37
|
-
## License
|
|
38
|
-
|
|
39
|
-
Copyright (c) 2012 Djorje Lukic
|
|
40
|
-
|
|
41
|
-
Licensed under the [MIT license](http://rumpl.mit-license.org/).
|
|
35
|
+
> Special thanks to [@rumpl](https://github.com/rumpl) for granting use of the `bingo` package name. ๐
|
package/package.json
CHANGED
|
@@ -1,35 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bingo",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
"name": "Djorje Lukic",
|
|
8
|
-
"email": "lukic.djordje@gmail.com"
|
|
9
|
-
},
|
|
10
|
-
"repository": {
|
|
11
|
-
"type": "git",
|
|
12
|
-
"url": "git://github.com/rumpl/bingo.git"
|
|
13
|
-
},
|
|
14
|
-
"bugs": {
|
|
15
|
-
"url": "https://github.com/rumpl/bingo/issues"
|
|
16
|
-
},
|
|
17
|
-
"licenses": [
|
|
18
|
-
{
|
|
19
|
-
"type": "MIT",
|
|
20
|
-
"url": "https://github.com/rumpl/bingo/blob/master/LICENSE-MIT"
|
|
21
|
-
}
|
|
22
|
-
],
|
|
23
|
-
"main": "lib/bingo",
|
|
24
|
-
"engines": {
|
|
25
|
-
"node": "~0.6.15"
|
|
26
|
-
},
|
|
27
|
-
"scripts": {
|
|
28
|
-
"test": "grunt test"
|
|
29
|
-
},
|
|
30
|
-
"dependencies": {},
|
|
31
|
-
"devDependencies": {
|
|
32
|
-
"grunt": "~0.3.9"
|
|
33
|
-
},
|
|
34
|
-
"keywords": []
|
|
35
|
-
}
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Composable, testable, type-safe templates. ๐",
|
|
5
|
+
"license": "MIT"
|
|
6
|
+
}
|
package/.npmignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/node_modules/
|
package/LICENSE-MIT
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2012 Djorje Lukic
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person
|
|
4
|
-
obtaining a copy of this software and associated documentation
|
|
5
|
-
files (the "Software"), to deal in the Software without
|
|
6
|
-
restriction, including without limitation the rights to use,
|
|
7
|
-
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
-
copies of the Software, and to permit persons to whom the
|
|
9
|
-
Software is furnished to do so, subject to the following
|
|
10
|
-
conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be
|
|
13
|
-
included in all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
16
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
17
|
-
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
18
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
19
|
-
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
20
|
-
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
21
|
-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
22
|
-
OTHER DEALINGS IN THE SOFTWARE.
|
package/grunt.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
module.exports = function(grunt) {
|
|
2
|
-
|
|
3
|
-
// Project configuration.
|
|
4
|
-
grunt.initConfig({
|
|
5
|
-
pkg: '<json:package.json>',
|
|
6
|
-
test: {
|
|
7
|
-
files: ['test/**/*.js']
|
|
8
|
-
},
|
|
9
|
-
lint: {
|
|
10
|
-
files: ['grunt.js', 'lib/**/*.js', 'test/**/*.js']
|
|
11
|
-
},
|
|
12
|
-
watch: {
|
|
13
|
-
files: '<config:lint.files>',
|
|
14
|
-
tasks: 'default'
|
|
15
|
-
},
|
|
16
|
-
jshint: {
|
|
17
|
-
options: {
|
|
18
|
-
curly: true,
|
|
19
|
-
eqeqeq: true,
|
|
20
|
-
immed: true,
|
|
21
|
-
latedef: true,
|
|
22
|
-
newcap: true,
|
|
23
|
-
noarg: true,
|
|
24
|
-
sub: true,
|
|
25
|
-
undef: true,
|
|
26
|
-
boss: true,
|
|
27
|
-
eqnull: true,
|
|
28
|
-
node: true
|
|
29
|
-
},
|
|
30
|
-
globals: {
|
|
31
|
-
exports: true
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
// Default task.
|
|
37
|
-
grunt.registerTask('default', 'lint test');
|
|
38
|
-
|
|
39
|
-
};
|
package/lib/bingo.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* bingo
|
|
3
|
-
* https://github.com/rumpl/bingo
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) 2012 Djorje Lukic
|
|
6
|
-
* Licensed under the MIT license.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
function bingo(func, obj) {
|
|
10
|
-
"use strict";
|
|
11
|
-
var newF = function() {
|
|
12
|
-
newF._didExecute = true;
|
|
13
|
-
newF._timesExecuted++;
|
|
14
|
-
|
|
15
|
-
func.apply(obj, arguments);
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
newF._didExecute = false;
|
|
19
|
-
newF._timesExecuted = 0;
|
|
20
|
-
|
|
21
|
-
newF.didExecute = function () {
|
|
22
|
-
return newF._didExecute;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
newF.timesExecuted = function() {
|
|
26
|
-
return newF._timesExecuted;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
return newF;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
module.exports = function(obj) {
|
|
33
|
-
"use strict";
|
|
34
|
-
|
|
35
|
-
for (var o in obj) {
|
|
36
|
-
if (typeof obj[o] !== 'function') {
|
|
37
|
-
continue;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
obj[o] = bingo(obj[o], obj);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return obj;
|
|
44
|
-
};
|
package/test/bingo_test.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* bingo
|
|
3
|
-
* https://github.com/rumpl/bingo
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) 2012 Djorje Lukic
|
|
6
|
-
* Licensed under the MIT license.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
var bingo = require('../lib/bingo.js');
|
|
10
|
-
|
|
11
|
-
exports.bingo = {
|
|
12
|
-
setUp: function(done) {
|
|
13
|
-
done();
|
|
14
|
-
},
|
|
15
|
-
'Works with objects created with new': function(test) {
|
|
16
|
-
"use strict";
|
|
17
|
-
var Test = function() {};
|
|
18
|
-
Test.prototype.test = function() {};
|
|
19
|
-
Test.prototype.test2 = function() {};
|
|
20
|
-
|
|
21
|
-
var t = new Test();
|
|
22
|
-
|
|
23
|
-
t = bingo(t);
|
|
24
|
-
|
|
25
|
-
test.equal(t.test.didExecute(), false);
|
|
26
|
-
test.equal(t.test.timesExecuted(), 0);
|
|
27
|
-
|
|
28
|
-
t.test();
|
|
29
|
-
|
|
30
|
-
test.equal(t.test.didExecute(), true);
|
|
31
|
-
test.equal(t.test.timesExecuted(), 1);
|
|
32
|
-
test.equal(t.test2.didExecute(), false);
|
|
33
|
-
|
|
34
|
-
test.done();
|
|
35
|
-
},
|
|
36
|
-
'Works with other objects': function(test) {
|
|
37
|
-
"use strict";
|
|
38
|
-
var t = {
|
|
39
|
-
a: function() {
|
|
40
|
-
console.log('a');
|
|
41
|
-
},
|
|
42
|
-
b: function() {
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
t = bingo(t);
|
|
47
|
-
|
|
48
|
-
test.equal(t.b.didExecute(), false);
|
|
49
|
-
t.b();
|
|
50
|
-
test.equal(t.b.didExecute(), true);
|
|
51
|
-
test.equal(t.b.timesExecuted(), 1);
|
|
52
|
-
|
|
53
|
-
for (var i = 0; i < 10; i++) {
|
|
54
|
-
t.b();
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
test.equal(t.b.timesExecuted(), 11);
|
|
58
|
-
|
|
59
|
-
test.equal(t.a.didExecute(), false);
|
|
60
|
-
|
|
61
|
-
test.done();
|
|
62
|
-
}
|
|
63
|
-
};
|