Skip to content

Commit a0b1c77

Browse files
committed
Initial denali project scaffold
0 parents  commit a0b1c77

39 files changed

+6499
-0
lines changed

.babelrc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"plugins": [
3+
"transform-exponentiation-operator",
4+
"syntax-trailing-function-commas",
5+
"transform-es2015-arrow-functions",
6+
"transform-es2015-template-literals",
7+
"transform-es2015-spread",
8+
"transform-es2015-shorthand-properties",
9+
"transform-es2015-destructuring",
10+
"transform-class-properties",
11+
"transform-es2015-modules-commonjs",
12+
"transform-regenerator",
13+
"syntax-async-functions",
14+
"transform-runtime"
15+
],
16+
"ignore": [
17+
"blueprints/*/files/**",
18+
"test/dummy/**"
19+
]
20+
}

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
10+
[*.md]
11+
trim_trailing_whitespace = false

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blueprints/*/files/**

.eslintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "denali"
3+
}

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
* text=auto
2+
3+
# normalize text files to use lf
4+
text eol=lf

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist
3+
tmp

.nvmrc

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

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
language: node_js
3+
node_js:
4+
- "6.2"
5+
sudo: false
6+
cache:
7+
directories:
8+
- node_modules

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 0.0.0
2+
3+
* Initial release

LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright 2016
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWAR.

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Denali Typescript
2+
3+
An awesome addon built on the Denali framework.
4+
5+
6+
## Developing
7+
8+
1. Clone the repo down
9+
2. `npm install`
10+
3. `denali server`
11+
4. Hit [localhost:3000](http://localhost:3000)
12+
13+
14+
## Tests
15+
16+
```sh
17+
$ denali test
18+
```

app/actions/.gitkeep

Whitespace-only changes.

app/addon.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { Addon } from 'denali';
2+
3+
export default class DenaliTypescriptAddon extends Addon {}

app/models/.gitkeep

Whitespace-only changes.

app/serializers/.gitkeep

Whitespace-only changes.

app/services/.gitkeep

Whitespace-only changes.

blueprints/denali-typescript/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Blueprint } from 'denali-cli';
2+
3+
export default class DenaliTypescriptBlueprint extends Blueprint {
4+
5+
static blueprintName = 'denali-typescript';
6+
static description = 'Installs denali-typescript';
7+
8+
locals(/* argv */) {
9+
console.log("This blueprint is run when denali-typescript is installed via `denali install`. It's a good spot to make any changes to the consuming app or addon, i.e. create a config file, add a route, etc");
10+
}
11+
12+
}

config/environment.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default function environmentConfig(environment, appConfig) {
2+
3+
appConfig['denali-typescript'] = {
4+
5+
};
6+
}

config/initializers/.gitkeep

Whitespace-only changes.

config/middleware.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default function middleware(/* router, application */) {
2+
3+
// Add your own middleware that will execute before Denali:
4+
// this.use(someMiddlewareFunction);
5+
6+
}

config/routes.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export default function drawRoutes(/* router */) {
2+
}

denali-build.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const { Builder } = require('denali-cli');
2+
3+
module.exports = class DenaliTypescriptBuilder extends Builder {};

package.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"name": "denali-typescript",
3+
"version": "0.0.1",
4+
"scripts": {
5+
"test": "denali test"
6+
},
7+
"keywords": [
8+
"denali",
9+
"denali-addon",
10+
"addon"
11+
],
12+
"main": "app/addon.js",
13+
"license": "MIT",
14+
"dependencies": {
15+
"bluebird": "^3.4.6",
16+
"eslint-config-denali": "^1.1.0",
17+
"denali": "0.0.21",
18+
"denali-cli": "0.0.x",
19+
"in-publish": "^2.0.0",
20+
"lodash": "^4.16.4"
21+
},
22+
"devDependencies": {
23+
"ava": "^0.17.0",
24+
"babel-eslint": "^7.1.1",
25+
"babel-plugin-syntax-async-functions": "^6.13.0",
26+
"babel-plugin-syntax-trailing-function-commas": "^6.13.0",
27+
"babel-plugin-transform-async-to-generator": "^6.16.0",
28+
"babel-plugin-transform-class-properties": "^6.19.0",
29+
"babel-plugin-transform-es2015-destructuring": "^6.19.0",
30+
"babel-plugin-transform-es2015-modules-commonjs": "^6.18.0",
31+
"babel-plugin-transform-es2015-shorthand-properties": "^6.18.0",
32+
"babel-plugin-transform-es2015-spread": "^6.8.0",
33+
"babel-plugin-transform-es2015-template-literals": "^6.8.0",
34+
"babel-plugin-transform-exponentiation-operator": "^6.8.0",
35+
"babel-plugin-transform-regenerator": "^6.16.1",
36+
"babel-plugin-transform-runtime": "^6.15.0",
37+
"denali-babel": "0.0.x",
38+
"denali-eslint": "0.0.x"
39+
},
40+
"ava": {
41+
"plugins": [],
42+
"presets": []
43+
},
44+
"scripts": {
45+
"build": "denali build",
46+
"prepublish": "in-publish && echo \"Use 'denali publish' instead.\" && exit 1 || not-in-publish"
47+
}
48+
}

test/.eslintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "denali/test"
3+
}

test/acceptance/.gitkeep

Whitespace-only changes.

test/dummy/.babelrc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"plugins": [
3+
"transform-exponentiation-operator",
4+
"syntax-trailing-function-commas",
5+
"transform-es2015-arrow-functions",
6+
"transform-es2015-template-literals",
7+
"transform-es2015-spread",
8+
"transform-es2015-shorthand-properties",
9+
"transform-es2015-destructuring",
10+
"transform-class-properties",
11+
"transform-es2015-modules-commonjs",
12+
"transform-regenerator",
13+
"syntax-async-functions",
14+
"transform-runtime"
15+
],
16+
"ignore": [
17+
"blueprints/*/files/**"
18+
]
19+
}

test/dummy/.eslintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "denali"
3+
}

test/dummy/app/actions/application.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { Action } from 'denali';
2+
3+
export default class ApplicationAction extends Action {
4+
}

test/dummy/app/actions/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import ApplicationAction from './application';
2+
3+
export default class IndexAction extends ApplicationAction {
4+
5+
serializer = false;
6+
7+
respond() {
8+
return { message: 'Welcome to Denali!' };
9+
}
10+
11+
}

test/dummy/app/application.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { Application } from 'denali';
2+
3+
export default class DummyApplication extends Application {
4+
}

test/dummy/app/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import sourcemaps from 'source-map-support';
2+
import path from 'path';
3+
import Application from './application';
4+
5+
sourcemaps.install();
6+
7+
let application = new Application({
8+
environment: process.env.DENALI_ENV || process.env.NODE_ENV || 'development',
9+
dir: path.dirname(__dirname)
10+
});
11+
12+
application.start();
13+
14+
export default application;

test/dummy/config/environment.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
export default function environmentConfig(environment) {
2+
let config = {
3+
server: {
4+
port: process.env.PORT || 3000
5+
},
6+
ormAdapter: 'memory',
7+
database: {
8+
9+
}
10+
};
11+
12+
if (environment === 'development') {
13+
// development-specific config
14+
}
15+
16+
if (environment === 'production') {
17+
// production-specific config
18+
19+
// You can start Denali in SSL mode by providing your private key and
20+
// certificate, or your pfx file contents
21+
//
22+
// config.server.ssl = {
23+
// key: fs.readFileSync('privatekey.pem'),
24+
// cert: fs.readFileSync('certificate.pem')
25+
// };
26+
//
27+
// or,
28+
//
29+
// config.server.ssl = {
30+
// pfx: fs.readFileSync('server.pfx')
31+
// };
32+
//
33+
}
34+
35+
return config;
36+
}

test/dummy/config/initializers/.gitkeep

Whitespace-only changes.

test/dummy/config/middleware.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default function middleware(/* router, application */) {
2+
3+
// Add your own middleware that will execute before Denali:
4+
// router.use(someMiddlewareFunction);
5+
6+
}

test/dummy/config/routes.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
export default function drawRoutes(router) {
2+
3+
router.get('/', 'index');
4+
5+
/*
6+
* # Single routes
7+
*
8+
* If you have some custom endpoint you want to create, you can always add it
9+
* via the basic routing DSL:
10+
*
11+
* router.post('/foo', 'foo')
12+
* └┬─┘ └┬───┘ └┬──┘
13+
* │ │ │
14+
* │ │ └ action
15+
* │ └ URL pattern
16+
* └ HTTP method
17+
*
18+
* That will create an endpoint that responds to a POST /foo, and triggers the
19+
* `foo` action.
20+
*
21+
* Nested actions can be references via their path:
22+
*
23+
* router.post('/comments/:id/replies', 'comments/replies/create')
24+
*
25+
*
26+
* # Resources
27+
*
28+
* Single routes are useful, but Denali's real power comes from resources.
29+
* Using just:
30+
*
31+
* router.resource('book')
32+
*
33+
* sets up the following routes mapped to actions in the `books/` folder:
34+
*
35+
* Method | URL | Action
36+
* --------|---------------------------------------------------|-------
37+
* GET | /books | list
38+
* POST | /books | create
39+
* GET | /books/:book_id | show
40+
* PATCH | /books/:book_id | update
41+
* DELETE | /books/:book_id | destroy
42+
* GET | /books/:book_id/:relationship_name | fetch[relationshipName]
43+
* GET | /books/:book_id/relationships/:relationship_name | fetch[relationshipName]Relationship
44+
* POST | /books/:book_id/relationships/:relationship_name | add[relationshipName]Relationship
45+
* PATCH | /books/:book_id/relationships/:relationship_name | replace[relationshipName]Relationship
46+
* DELETE | /books/:book_id/relationships/:relationship_name | remove[relationshipName]Relationship
47+
*
48+
*/
49+
50+
}

test/dummy/package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "dummy",
3+
"version": "0.0.0",
4+
"dependencies": {
5+
"denali": "*",
6+
"denali-babel": "*",
7+
"denali-eslint": "*",
8+
"denali-typescript": "*"
9+
}
10+
}

test/helpers/.gitkeep

Whitespace-only changes.

test/unit/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)