@dojo/cli-create-app
Advanced tools
Comparing version 2.0.0-beta2.6 to 2.0.0-beta2.8
@@ -17,2 +17,3 @@ (function (factory) { | ||
`${appName}/src`, | ||
`${appName}/src/img`, | ||
`${appName}/src/styles`, | ||
@@ -32,7 +33,8 @@ `${appName}/src/widgets`, | ||
'template-.gitignore', | ||
'template-.dojorc', | ||
'README.md', | ||
'src/img/logo.svg', | ||
'src/index.html', | ||
'src/main.ts', | ||
'src/main.css', | ||
'src/App.ts', | ||
'src/widgets/HelloWorld.ts', | ||
@@ -42,4 +44,2 @@ 'src/widgets/styles/HelloWorld.m.css', | ||
'tests/unit/all.ts', | ||
'tests/unit/main.ts', | ||
'tests/unit/App.ts', | ||
'tests/unit/widgets/all.ts', | ||
@@ -46,0 +46,0 @@ 'tests/unit/widgets/HelloWorld.ts', |
{ | ||
"name": "@dojo/cli-create-app", | ||
"version": "2.0.0-beta2.6", | ||
"version": "2.0.0-beta2.8", | ||
"description": "Command to scaffold a new command", | ||
@@ -5,0 +5,0 @@ "homepage": "https://dojo.io", |
@@ -10,2 +10,3 @@ { | ||
"@dojo/widget-core": "beta2", | ||
"@dojo/widgets": "beta2", | ||
"@dojo/i18n": "beta2" | ||
@@ -18,2 +19,3 @@ }, | ||
"@dojo/loader": "beta2", | ||
"@dojo/test-extras": "beta2", | ||
"@types/chai": "~3.4.0", | ||
@@ -20,0 +22,0 @@ "@types/glob": "~5.0.0", |
# <%- appName %> | ||
This project was generated with the [Dojo CLI](https://github.com/dojo/cli) & [Dojo CLI create app command](https://github.com/dojo/cli-create-app). | ||
## Build | ||
Run `dojo build` to create a production build for the project. The built artifacts will be stored in the `dist` directory. | ||
## Development server | ||
Run `dojo build -w` to create a development build and start a development server. By default the server runs on port `9999`, navigate to `http://localhost:9999/`. | ||
If port `9999` is already in use, the next available port in the `9990:9999` range (working backwards) will be used. The selected port is output to the console at the start of the `dojo build -w` process. The app will automatically reload if you change any of the source files. | ||
## Running unit tests | ||
Run `dojo test` to run the projects unit tests. These tests are located in the `tests/unit` directory. | ||
## Running functional tests | ||
Run `dojo test -f` to run the projects functional tests. These tests are located in the `tests/functional` directory. | ||
## Further help | ||
To get help for these commands and more, run `dojo` on the command line. |
import { ProjectorMixin } from '@dojo/widget-core/mixins/Projector'; | ||
import App from './App'; | ||
import HelloWorld from './widgets/HelloWorld'; | ||
const root = document.querySelector('my-app') || undefined; | ||
const Projector = ProjectorMixin(App); | ||
const Projector = ProjectorMixin(HelloWorld); | ||
const projector = new Projector(); | ||
projector.append(root); | ||
projector.append(); |
import { v } from '@dojo/widget-core/d'; | ||
import { DNode, WidgetProperties } from '@dojo/widget-core/interfaces'; | ||
import { ThemeableMixin, theme } from '@dojo/widget-core/mixins/Themeable'; | ||
@@ -8,24 +7,13 @@ import { WidgetBase } from '@dojo/widget-core/WidgetBase'; | ||
export interface HelloWorldProperties extends WidgetProperties { | ||
stranger: boolean; | ||
toggleStranger: Function; | ||
} | ||
export const HelloWorldBase = ThemeableMixin(WidgetBase); | ||
@theme(css) | ||
export default class HelloWorld extends HelloWorldBase<HelloWorldProperties> { | ||
export class HelloWorld extends ThemeableMixin(WidgetBase) { | ||
private onClick(): void { | ||
this.properties.toggleStranger && this.properties.toggleStranger(); | ||
protected render() { | ||
return v('div', { classes: this.classes(css.root) }, [ | ||
v('img', { src: './img/logo.svg', classes: this.classes(css.logo) }), | ||
v('div', { classes: this.classes(css.label) }, [ 'Hello, Dojo 2 World!' ]) | ||
]); | ||
} | ||
} | ||
protected render(): DNode { | ||
const classes = this.classes( | ||
css.hello, | ||
this.properties.stranger ? css.upsidedown : null | ||
); | ||
return v('div', { classes, onclick: this.onClick }, [ 'Hello, Dojo World!' ]); | ||
} | ||
} | ||
export default HelloWorld; |
@@ -1,2 +0,4 @@ | ||
export const hello: string; | ||
export const upsidedown: string; | ||
export const root: string; | ||
export const logo: string; | ||
export const rotation: string; | ||
export const label: string; |
@@ -1,2 +0,1 @@ | ||
import './App'; | ||
import './widgets/all'; |
import * as registerSuite from 'intern/lib/interfaces/object'; | ||
import { assert } from 'chai'; | ||
import { VNode } from '@dojo/interfaces/vdom'; | ||
import harness from '@dojo/test-extras/harness'; | ||
import { v } from '@dojo/widget-core/d'; | ||
import HelloWorld from '../../../src/widgets/HelloWorld'; | ||
@@ -11,21 +12,8 @@ import * as css from '../../../src/widgets/styles/HelloWorld.m.css'; | ||
'render'() { | ||
const helloWorld = new HelloWorld(); | ||
const vnode = <VNode> helloWorld.__render__(); | ||
assert.strictEqual(vnode.vnodeSelector, 'div'); | ||
assert.equal(vnode.text, 'Hello, Dojo World!'); | ||
assert.deepEqual(vnode.properties!.classes, { [css.hello]: true }); | ||
}, | ||
'render with stranger'() { | ||
const helloWorld = new HelloWorld(); | ||
helloWorld.__setProperties__({ | ||
stranger: true, | ||
toggleStranger: () => {} | ||
}); | ||
const vnode = <VNode> helloWorld.__render__(); | ||
assert.strictEqual(vnode.vnodeSelector, 'div'); | ||
assert.equal(vnode.text, 'Hello, Dojo World!'); | ||
assert.deepEqual(vnode.properties!.classes, { [css.hello]: true, [css.upsidedown]: true }); | ||
const testHelloWorld = harness(HelloWorld); | ||
testHelloWorld.expectRender(v('div', { classes: testHelloWorld.classes(css.root) }, [ | ||
v('img', { src: './img/logo.svg', classes: testHelloWorld.classes(css.logo) }), | ||
v('div', { classes: testHelloWorld.classes(css.label) }, [ 'Hello, Dojo 2 World!' ]) | ||
])); | ||
} | ||
}); |
@@ -5,2 +5,4 @@ { | ||
"experimentalDecorators": true, | ||
"jsx": "react", | ||
"jsxFactory": "tsx", | ||
"lib": [ | ||
@@ -16,8 +18,7 @@ "dom", | ||
"moduleResolution": "node", | ||
"noImplicitAny": true, | ||
"noImplicitThis": true, | ||
"noUnusedLocals": true, | ||
"outDir": "_build/", | ||
"removeComments": false, | ||
"sourceMap": true, | ||
"strictNullChecks": true, | ||
"strict": true, | ||
"target": "es5", | ||
@@ -24,0 +25,0 @@ "types": [ "intern" ] |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
143005
455