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

Beta branch #53

Merged
merged 5 commits into from
May 19, 2016
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
836 changes: 725 additions & 111 deletions generators/beta/index.js

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions generators/beta/templates/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
12 changes: 12 additions & 0 deletions generators/beta/templates/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: node_js

notifications:
email:
on_success: never
on_failure: change

node_js:
- "stable"

script:
- npm run lint+build+test
22 changes: 22 additions & 0 deletions generators/beta/templates/npm-scripts/tape-browserify.test.js_
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

const globby = require('globby');
const browserify = require('browserify');
const tsify = require('tsify');
const run = require('tape-run');
const spec = require('tap-spec');

var glob = process.argv.slice(2);
if (glob.length === 0){
glob = ['test/**/*.ts', 'typings/main.d.ts', 'out/main.d.ts'];
}

globby(glob).then((entries) => {
var b = browserify({
entries: entries
})
.plugin(tsify)
.bundle()
.pipe(run())
.pipe(spec())
.pipe(process.stdout);
});
28 changes: 28 additions & 0 deletions generators/beta/templates/npm-scripts/tape-jspm.test.js_
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const streams = require('stream');
const jspm = require('jspm');
const run = require('tape-run');
const reporter = require('tap-spec');

const testFileGlobs = process.argv[2];
if (!testFileGlobs) {
console.error('No test file globs specified.');
process.exit(1);
}

new jspm.Builder()
.buildStatic(testFileGlobs, { sourceMaps: 'inline' })
.then((output) => {
const reader = new streams.Readable();
reader._read = function () { };
reader.push(output.source);
reader.push(null);
reader
.pipe(run())
.on('results', (results) => {
if (!results.ok) {
process.exit(1);
}
})
.pipe(reporter())
.pipe(process.stdout);
});
4 changes: 4 additions & 0 deletions generators/beta/templates/source-test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Source tests
- Change `package.json/script/source-test` to match the test harness used by the source
- Copy test files from `source` and save them as `*.ts` here
- Make necessary changes to the test files
10 changes: 10 additions & 0 deletions generators/beta/templates/source-test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node"
},
"files": [
"../typings/main.d.ts",
"../out/main.d.ts"
]
}
13 changes: 13 additions & 0 deletions generators/beta/templates/template/Apache-2.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright <%- year %> <%- author %>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
26 changes: 26 additions & 0 deletions generators/beta/templates/template/BSD-2-Clause-FreeBSD.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Copyright (c) <%- year %>, <%- author %>
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
24 changes: 24 additions & 0 deletions generators/beta/templates/template/BSD-3-Clause.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Copyright (c) <%- year %>, <%- author %>
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the <organization> nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15 changes: 15 additions & 0 deletions generators/beta/templates/template/ISC.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Copyright (c) <%- year %> <%- author %>

Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted, provided that the
above copyright notice and this permission notice appear in all
copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
21 changes: 21 additions & 0 deletions generators/beta/templates/template/MIT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) <%- year %> <%- author %>

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:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

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.
33 changes: 33 additions & 0 deletions generators/beta/templates/template/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Typed <%- prettyPackageName %> [![Build Status](https://travis-ci.org/<%- organization %>/<%- packageName %>.svg?branch=master)](https://travis-ci.org/<%- organization %>/<%- packageName %>)


The type definition for [`<%- sourcePackageName %>`](<%- sourcePackageUrl %>)

## LICENSE

<%- license %>

## Contributing

```sh
# Fork this repo
npm install

npm run watch

# add tests, make changes, pass tests ... then [ctrl+c]
npm run publish
```

## Updating

Update `typings.json/version` to match the source version you are typing against.
e.g. if you are creating typings for `chai@3.5.0`, then:

```js
// typings.json
{
"version": "3.5.0"
// ...
}
```
44 changes: 44 additions & 0 deletions generators/beta/templates/template/_.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
bower_components
jspm_packages
node_modules

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

# webstorm
.idea

# typings
typings

# output folder
out
4 changes: 4 additions & 0 deletions generators/beta/templates/template/bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "<%- packageName %>",
"private": true
}
1 change: 1 addition & 0 deletions generators/beta/templates/template/nolicense.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Copyright (c) <%- year %> <%- author %>
16 changes: 16 additions & 0 deletions generators/beta/templates/template/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"private": true,
"scripts": {
"build": "echo building... && typings bundle<%- ambient %> -o out/<%- sourceMain %>",
"lint": "echo linting... && tslint \"**/*.ts\" -e \"source/**\" -e \"source-test/**\" -e \"out/**\" -e \"node_modules/**\" -e \"typings/**\"",
"browser-test": "echo running browser tests... && <%- browserTest %>",
"source-test": "echo running source tests... && <%- sourceTest %>",
"test": "echo running server tests... && <%- test %>",
"watch": "onchange \"**/*.ts\" -i -e \"out/**\" -- npm -s run build+test",
"publish": "npm -s run lint+build+test && echo please publish to typings/registry",
"source-test+test+browser-test": "npm run source-test && npm test && npm run browser-test",
"build+test": "npm run build && npm run source-test+test+browser-test",
"lint+build+test": "npm run lint && npm run build+test",
"prepublish": "typings install"
}
}
6 changes: 6 additions & 0 deletions generators/beta/templates/template/typings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "<%- name %>",
"main": "<%- main %>",
"homepage": "<%- homepage %>",
"version": "<%- version %>"
}
24 changes: 24 additions & 0 deletions generators/beta/templates/template/unlicense.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

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 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.

For more information, please refer to <http://unlicense.org/>
10 changes: 10 additions & 0 deletions generators/beta/templates/test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node"
},
"files": [
"../typings/main.d.ts",
"../out/main.d.ts"
]
}
14 changes: 14 additions & 0 deletions generators/beta/templates/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node",
"outDir": "out"
},
"exclude": [
"node_modules",
"typings/browser",
"typings/browser.d.ts",
"out/browser.d.ts",
"source"
]
}
3 changes: 3 additions & 0 deletions generators/beta/templates/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "tslint-config-typings"
}
Loading