Skip to content

Commit 69e3464

Browse files
committed
Initial import
0 parents  commit 69e3464

33 files changed

+1752
-0
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[*.{ts,tsx}]
2+
indent_size = 2
3+
quote_type = single

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.idea/
2+
node_modules/
3+
.*.swp
4+
generators/app/index.js

.npmignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.idea/
2+
.editorconfig
3+
.gitignore
4+
.npmignore
5+
circle.yml
6+
tsconfig.json
7+
src/
8+
yarn.lock

LICENSE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2017 Kevin Verdieck
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.

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# @nomcopter/generator-typescript-react
2+
[![CircleCI](SHIELDS IO LINK)](CIRCLE LINK)
3+
[![npm](SHIELDS IO LINK)](NPM PACKAGE LINK)
4+
5+
An opinionated Yeoman Generator for a Typescript + React ready build system.
6+
7+
## Usage
8+
9+
## Upgrade Considerations / Changelog
10+
11+
See [Releases](https://github.com/palantir/react-mosaic/releases)
12+
13+
## License
14+
[MIT](./LICENSE)

circle.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
machine:
2+
node:
3+
version: 6.5.0
4+
dependencies:
5+
pre:
6+
- npm install -g yarn
7+
- yarn config set cache-folder /home/ubuntu/.cache/yarn
8+
cache_directories:
9+
- "/home/ubuntu/.cache/yarn"
10+
- "node_modules"
11+
override:
12+
- yarn install --frozen-lockfile
13+
deployment:
14+
npm-publish:
15+
tag: /v[0-9]+(\.[0-9]+){2}(-rc[0-9]+)?/
16+
owner: nomcopter
17+
commands:
18+
- touch .npmrc
19+
- printf "\n$NPM_REGISTRY_CREDS\n" >> .npmrc
20+
- yarn run build
21+
- npm publish
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[*.{ts,tsx}]
2+
indent_size = 2
3+
quote_type = single

generators/app/templates/_.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.idea/
2+
node_modules/
3+
lib/
4+
/<%= kebabCaseName %>.css*
5+
.*.swp

generators/app/templates/_.npmignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.idea/
2+
.editorconfig
3+
.gitignore
4+
.npmignore
5+
circle.yml
6+
tsconfig*.json
7+
demo/
8+
docs/
9+
webpack/
10+
yarn.lock

generators/app/templates/_LICENSE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2017 Kevin Verdieck
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.

generators/app/templates/_README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# <%= humanReadableName %>
2+
[![CircleCI](SHIELDS IO LINK)](CIRCLE LINK)
3+
[![npm](SHIELDS IO LINK)](NPM PACKAGE LINK)
4+
5+
## Usage
6+
7+
### Installation
8+
9+
## Examples
10+
11+
## API
12+
13+
## Upgrade Considerations / Changelog
14+
15+
See [Releases](https://github.com/palantir/react-mosaic/releases)
16+
17+
## License
18+
[MIT](./LICENSE)

generators/app/templates/_circle.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
machine:
2+
node:
3+
version: 6.5.0
4+
dependencies:
5+
pre:
6+
- npm install -g yarn
7+
- yarn config set cache-folder /home/ubuntu/.cache/yarn
8+
cache_directories:
9+
- "/home/ubuntu/.cache/yarn"
10+
- "node_modules"
11+
override:
12+
- yarn install --frozen-lockfile
13+
test:
14+
override:
15+
- "yarn run test:circle":
16+
environment:
17+
MOCHA_FILE: $CIRCLE_TEST_REPORTS/junit/test-results.xml
18+
deployment:
19+
npm-publish:
20+
tag: /v[0-9]+(\.[0-9]+){2}(-rc[0-9]+)?/
21+
owner: nomcopter
22+
commands:
23+
- touch .npmrc
24+
- printf "\n$NPM_REGISTRY_CREDS\n" >> .npmrc
25+
- yarn run build
26+
- npm publish
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"name": "<%= kebabCaseName %>",
3+
"version": "0.1.0",
4+
"description": "",
5+
"license": "MIT",
6+
"main": "lib/index.js",
7+
"style": "lib/<%= kebabCaseName %>.css",
8+
"typings": "lib/index.d.ts",
9+
"scripts": {
10+
"build": "npm-run-all clean build:ts build:less",
11+
"build:ts": "tsc -p tsconfig-build.json",
12+
"build:less": "lessc --source-map styles/index.less <%= kebabCaseName %>.css",
13+
"bundle": "rm -rf docs/ && webpack --config webpack/bundle.ts",
14+
"clean": "rm -rf lib/",
15+
"start": "webpack-dev-server --config webpack/hot.ts",
16+
"test": "npm-run-all build test:lint test:unit",
17+
"test:circle": "npm-run-all build test:lint test:unit:circle",
18+
"test:lint": "tslint --project tsconfig-build.json",
19+
"test:unit": "mocha --opts test/mocha.opts 'test/*.ts'",
20+
"test:unit:circle": "mocha --opts test/mocha.opts --reporter mocha-junit-reporter 'test/*.ts'",
21+
"version": "npm run bundle && git add -A docs/"
22+
},
23+
"devDependencies": {
24+
"@types/chai": "^4.0.4",
25+
"@types/html-webpack-plugin": "^2.28.0",
26+
"@types/mocha": "^2.2.43",
27+
"@types/react": "^16.0.10",
28+
"@types/react-dom": "^16.0.1",
29+
"@types/react-hot-loader": "^3.0.4",
30+
"@types/webpack": "^3.0.13",
31+
"chai": "^4.1.2",
32+
"css-loader": "^0.28.7",
33+
"file-loader": "^1.1.5",
34+
"html-loader": "^0.5.1",
35+
"html-webpack-plugin": "^2.30.1",
36+
"jsdom": "^11.3.0",
37+
"jsdom-global": "^3.0.2",
38+
"less": "^3.0.0-alpha.3",
39+
"less-loader": "^4.0.5",
40+
"mocha": "^4.0.1",
41+
"mocha-junit-reporter": "^1.15.0",
42+
"npm-run-all": "^4.1.1",
43+
"react": "^16.0.0",
44+
"react-dom": "^16.0.0",
45+
"react-hot-loader": "3.0.0",
46+
"source-map-loader": "^0.2.2",
47+
"style-loader": "^0.19.0",
48+
"ts-loader": "^2.3.7",
49+
"ts-node": "^3.3.0",
50+
"tslint": "^5.7.0",
51+
"typescript": "^2.5.3",
52+
"webpack": "^3.7.1",
53+
"webpack-dev-server": "^2.9.1"
54+
},
55+
"dependencies": {
56+
},
57+
"peerDependencies": {
58+
"react": "^15.0.0 || ^16.0.0"
59+
},
60+
"keywords": [
61+
]
62+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"compilerOptions": {
3+
"noEmit": false,
4+
"outDir": "lib",
5+
"rootDir": "src"
6+
},
7+
"exclude": [
8+
"demo",
9+
"docs",
10+
"lib",
11+
"node_modules",
12+
"test",
13+
"webpack"
14+
],
15+
"extends": "./tsconfig.json"
16+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"compileOnSave": false,
3+
"compilerOptions": {
4+
"declaration": true,
5+
"experimentalDecorators": true,
6+
"forceConsistentCasingInFileNames": true,
7+
"jsx": "react",
8+
"noEmit": true,
9+
"noFallthroughCasesInSwitch": true,
10+
"noImplicitReturns": true,
11+
"noUnusedLocals": true,
12+
"noUnusedParameters": true,
13+
"target": "es5",
14+
"sourceMap": true,
15+
"strict": true
16+
},
17+
"exclude": [
18+
"docs",
19+
"lib",
20+
"node_modules"
21+
]
22+
}

generators/app/templates/_tslint.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"defaultSeverity": "error",
3+
"extends": [
4+
"tslint:recommended"
5+
],
6+
"jsRules": {},
7+
"rules": {
8+
"array-type": false,
9+
"interface-name": {
10+
"options": "never-prefix"
11+
},
12+
"max-classes-per-file": false,
13+
"max-line-length": {
14+
"options": 150
15+
},
16+
"member-access": false,
17+
"member-ordering": false,
18+
"object-literal-sort-keys": false,
19+
"quotemark": {
20+
"options": "single"
21+
},
22+
"semicolon": {
23+
"options": "ignore-bound-class-methods"
24+
},
25+
"variable-name": {
26+
"options": [
27+
"allow-leading-underscore",
28+
"allow-pascal-case"
29+
]
30+
}
31+
},
32+
"rulesDirectory": []
33+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import * as React from 'react';
2+
3+
export class Demo extends React.PureComponent {
4+
render() {
5+
return (
6+
<h1><%= humanReadableName %></h1>
7+
);
8+
}
9+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
html, body, #app {
2+
margin: 0;
3+
height: 100%;
4+
width: 100%;
5+
overflow: hidden;
6+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import * as React from 'react';
2+
import * as ReactDOM from 'react-dom';
3+
import { AppContainer } from 'react-hot-loader';
4+
import { Demo } from './_Demo';
5+
6+
const APP_ELEMENT = document.getElementById('app')!;
7+
const render = (Component: React.ComponentClass<any>) => {
8+
ReactDOM.render(
9+
<AppContainer>
10+
<Component/>
11+
</AppContainer>,
12+
APP_ELEMENT,
13+
);
14+
};
15+
16+
render(Demo);
17+
18+
declare var module: any;
19+
if (module.hot) {
20+
module.hot.accept('./Demo', () => {
21+
render(require('./Demo').Demo);
22+
});
23+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const PACKAGE_NAME = '<%= kebabCaseName %>';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--reporter spec
2+
--compilers ts:./test/registerTsNode,tsx:./test/registerTsNode
3+
--require jsdom-global/register
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// It should still run the tests if there are TypeScript complaints, those problems will be handled by the build step.
2+
return require("ts-node").register({
3+
disableWarnings: true,
4+
});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { expect } from 'chai';
2+
3+
describe('<%= humanReadableName %>', () => {
4+
5+
});

0 commit comments

Comments
 (0)