diff --git a/package.json b/package.json index 0f78e95a..6c3983ac 100644 --- a/package.json +++ b/package.json @@ -49,8 +49,8 @@ "dependencies": { "@aurelia-ux/core": "^0.8.1", "aurelia-binding": "^2.0.0", - "aurelia-framework": "^1.0.0", - "aurelia-templating-resources": "^1.6.0" + "aurelia-framework": "^1.3.0", + "aurelia-templating-resources": "^1.7.0" }, "devDependencies": { "@types/jasmine": "^2.8.6", @@ -67,6 +67,7 @@ "conventional-changelog-cli": "^1.3.5", "copyfiles": "^1.2.0", "cross-env": "^3.2.4", + "csso": "^3.5.1", "istanbul-instrumenter-loader": "^3.0.0", "jasmine-core": "^2.99.1", "karma": "^1.7.1", @@ -83,6 +84,10 @@ "requirejs": "^2.3.3", "requirejs-text": "^2.0.15", "rimraf": "^2.6.1", + "rollup": "^0.61.1", + "rollup-plugin-html": "^0.2.1", + "rollup-plugin-typescript2": "^0.15.0", + "rollup-pluginutils": "^2.3.0", "ts-loader": "^4.0.1", "ts-node": "^5.0.1", "tsconfig-paths": "^3.1.1", diff --git a/packages/boilerplate/package.json b/packages/boilerplate/package.json index eff0a3b2..2cb52560 100644 --- a/packages/boilerplate/package.json +++ b/packages/boilerplate/package.json @@ -92,7 +92,7 @@ }, "dependencies": { "@aurelia-ux/core": "^0.4.0", - "aurelia-framework": "^1.0.0" + "aurelia-framework": "^1.3.0-rc.2" }, "devDependencies": { "@types/jasmine": "^2.8.6", diff --git a/packages/button/package.json b/packages/button/package.json index 2dc713f6..a534957c 100644 --- a/packages/button/package.json +++ b/packages/button/package.json @@ -19,7 +19,7 @@ "Zach Hollingshead " ], "main": "dist/commonjs/index.js", - "typings": "dist/commonjs/index.d.ts", + "typings": "dist/types/index.d.ts", "repository": { "type": "git", "url": "https://github.com/aurelia/ux" @@ -28,23 +28,8 @@ "lint": "cross-env tslint --project tsconfig.json", "test": "cross-env TS_NODE_PROJECT=\"../../tsconfig-tsnode.json\" karma start --single-run", "develop": "cross-env TS_NODE_PROJECT=\"../../tsconfig-tsnode.json\" karma start", - "prebuild:amd": "cross-env rimraf dist/amd", - "build:amd": "cross-env tsc --project tsconfig.json --outDir dist/amd --module amd", - "postbuild:amd": "cross-env copyfiles --up 1 src/**/*.html src/**/*.css dist/amd", - "prebuild:commonjs": "cross-env rimraf dist/commonjs", - "build:commonjs": "cross-env tsc --project tsconfig.json --outDir dist/commonjs --module commonjs", - "postbuild:commonjs": "cross-env copyfiles --up 1 src/**/*.html src/**/*.css dist/commonjs", - "prebuild:es2015": "cross-env rimraf dist/es2015", - "build:es2015": "cross-env tsc --project tsconfig.json --outDir dist/es2015 --module es2015 --target es2015", - "postbuild:es2015": "cross-env copyfiles --up 1 src/**/*.html src/**/*.css dist/es2015", - "prebuild:native-modules": "cross-env rimraf dist/native-modules", - "build:native-modules": "cross-env tsc --project tsconfig.json --outDir dist/native-modules --module es2015", - "postbuild:native-modules": "cross-env copyfiles --up 1 src/**/*.html src/**/*.css dist/native-modules", - "prebuild:system": "cross-env rimraf dist/system", - "build:system": "cross-env tsc --project tsconfig.json --outDir dist/system --module system", - "postbuild:system": "cross-env copyfiles --up 1 src/**/*.html src/**/*.css dist/system", "prebuild": "cross-env rimraf dist", - "build": "concurrently \"npm run build:amd\" \"npm run build:commonjs\" \"npm run build:es2015\" \"npm run build:native-modules\" \"npm run build:system\"", + "build": "rollup -c --environment NODE_ENV:production", "predoc": "cross-env rimraf doc/api.json && rimraf dist/doc-temp && tsc --project tsconfig.json --outFile dist/doc-temp/aurelia-ux.js && node doc/shape-defs && copyfiles tsconfig.json dist/doc-temp", "doc": "cross-env typedoc --json doc/api.json --excludeExternals --includeDeclarations --mode modules --target ES6 --name aurelia-ux-docs dist/doc-temp/", "postdoc": "cross-env node doc/shape-doc && rimraf dist/doc-temp", @@ -73,7 +58,8 @@ "aurelia-framework": "^1.0.0", "aurelia-metadata": "^1.0.0", "aurelia-path": "^1.0.0", - "@aurelia-ux/core": "^0.3.0" + "@aurelia-ux/core": "^0.3.0", + "tslib": "^1.9.3" }, "dependencies": { "aurelia-binding": "^2.0.0", @@ -93,7 +79,10 @@ }, "dependencies": { "@aurelia-ux/core": "^0.11.1", - "aurelia-framework": "^1.0.0" + "aurelia-framework": "^1.3.0" + }, + "peerDependencies": { + "tslib": "^1.9.3" }, "devDependencies": { "@types/jasmine": "^2.8.6", diff --git a/packages/button/rollup.config.js b/packages/button/rollup.config.js new file mode 100644 index 00000000..0ad1395f --- /dev/null +++ b/packages/button/rollup.config.js @@ -0,0 +1,7 @@ +import { configRollup } from '../../rollup-utilities'; + +export default configRollup( + 'button', + [], + process.env.NODE_ENV === 'production' +); diff --git a/packages/button/src/html.d.ts b/packages/button/src/html.d.ts new file mode 100644 index 00000000..4c285b83 --- /dev/null +++ b/packages/button/src/html.d.ts @@ -0,0 +1,9 @@ +declare module '*.html' { + const value: string; + export default value; +} + +declare module '*.css' { + const value: string; + export default value; +} diff --git a/packages/button/src/index.ts b/packages/button/src/index.ts index d849c6ca..46e6765a 100644 --- a/packages/button/src/index.ts +++ b/packages/button/src/index.ts @@ -1,9 +1,10 @@ -import { FrameworkConfiguration, PLATFORM } from 'aurelia-framework'; +import { FrameworkConfiguration, DOM } from 'aurelia-framework'; +import { UxButton } from './ux-button'; +import css from './ux-button.css'; export { UxButtonTheme } from './ux-button-theme'; export function configure(config: FrameworkConfiguration) { - config.globalResources([ - PLATFORM.moduleName('@aurelia-ux/button/ux-button') - ]); + DOM.injectStyles(css, undefined, undefined, 'ux-button-css'); + config.globalResources(UxButton); } diff --git a/packages/button/src/ux-button.html b/packages/button/src/ux-button.html index ad67d8cf..d3a2a1de 100644 --- a/packages/button/src/ux-button.html +++ b/packages/button/src/ux-button.html @@ -1,7 +1,4 @@ diff --git a/packages/card/src/ux-card.ts b/packages/card/src/ux-card.ts index 2069050c..1e907093 100644 --- a/packages/card/src/ux-card.ts +++ b/packages/card/src/ux-card.ts @@ -1,10 +1,12 @@ import { inject } from 'aurelia-dependency-injection'; -import { bindable, customElement } from 'aurelia-templating'; +import { bindable, customElement, inlineView } from 'aurelia-templating'; import { UxComponent, StyleEngine } from '@aurelia-ux/core'; import { UxCardTheme } from './ux-card-theme'; +import UX_CARD_VIEW from './ux-card.html'; @inject(Element, StyleEngine) @customElement('ux-card') +@inlineView(UX_CARD_VIEW) export class UxCard implements UxComponent { @bindable public theme: UxCardTheme; diff --git a/packages/card/tsconfig.json b/packages/card/tsconfig.json index cc5c5ffe..0388f18a 100644 --- a/packages/card/tsconfig.json +++ b/packages/card/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "module": "amd", + "module": "es2015", "moduleResolution": "node", "target": "es5", "lib": [ diff --git a/packages/checkbox/package.json b/packages/checkbox/package.json index 01b1afb1..d1aed330 100644 --- a/packages/checkbox/package.json +++ b/packages/checkbox/package.json @@ -19,7 +19,7 @@ "Zach Hollingshead " ], "main": "dist/commonjs/index.js", - "typings": "dist/commonjs/index.d.ts", + "typings": "dist/types/index.d.ts", "repository": { "type": "git", "url": "https://github.com/aurelia/ux" @@ -28,23 +28,8 @@ "lint": "cross-env tslint --project tsconfig.json", "test": "cross-env TS_NODE_PROJECT=\"../../tsconfig-tsnode.json\" karma start --single-run", "develop": "cross-env TS_NODE_PROJECT=\"../../tsconfig-tsnode.json\" karma start", - "prebuild:amd": "cross-env rimraf dist/amd", - "build:amd": "cross-env tsc --project tsconfig.json --outDir dist/amd --module amd", - "postbuild:amd": "cross-env copyfiles --up 1 src/**/*.html src/**/*.css dist/amd", - "prebuild:commonjs": "cross-env rimraf dist/commonjs", - "build:commonjs": "cross-env tsc --project tsconfig.json --outDir dist/commonjs --module commonjs", - "postbuild:commonjs": "cross-env copyfiles --up 1 src/**/*.html src/**/*.css dist/commonjs", - "prebuild:es2015": "cross-env rimraf dist/es2015", - "build:es2015": "cross-env tsc --project tsconfig.json --outDir dist/es2015 --module es2015 --target es2015", - "postbuild:es2015": "cross-env copyfiles --up 1 src/**/*.html src/**/*.css dist/es2015", - "prebuild:native-modules": "cross-env rimraf dist/native-modules", - "build:native-modules": "cross-env tsc --project tsconfig.json --outDir dist/native-modules --module es2015", - "postbuild:native-modules": "cross-env copyfiles --up 1 src/**/*.html src/**/*.css dist/native-modules", - "prebuild:system": "cross-env rimraf dist/system", - "build:system": "cross-env tsc --project tsconfig.json --outDir dist/system --module system", - "postbuild:system": "cross-env copyfiles --up 1 src/**/*.html src/**/*.css dist/system", "prebuild": "cross-env rimraf dist", - "build": "concurrently \"npm run build:amd\" \"npm run build:commonjs\" \"npm run build:es2015\" \"npm run build:native-modules\" \"npm run build:system\"", + "build": "rollup -c --environment NODE_ENV:production", "predoc": "cross-env rimraf doc/api.json && rimraf dist/doc-temp && tsc --project tsconfig.json --outFile dist/doc-temp/aurelia-ux.js && node doc/shape-defs && copyfiles tsconfig.json dist/doc-temp", "doc": "cross-env typedoc --json doc/api.json --excludeExternals --includeDeclarations --mode modules --target ES6 --name aurelia-ux-docs dist/doc-temp/", "postdoc": "cross-env node doc/shape-doc && rimraf dist/doc-temp", @@ -74,7 +59,8 @@ "aurelia-framework": "^1.0.0", "aurelia-metadata": "^1.0.0", "aurelia-path": "^1.0.0", - "@aurelia-ux/core": "^0.3.0" + "@aurelia-ux/core": "^0.3.0", + "tslib": "^1.9.3" }, "dependencies": { "aurelia-binding": "^2.0.0", @@ -94,7 +80,10 @@ }, "dependencies": { "@aurelia-ux/core": "^0.11.1", - "aurelia-framework": "^1.0.0" + "aurelia-framework": "^1.3.0" + }, + "peerDependencies": { + "tslib": "^1.9.3" }, "devDependencies": { "@types/jasmine": "^2.8.6", diff --git a/packages/checkbox/rollup.config.js b/packages/checkbox/rollup.config.js new file mode 100644 index 00000000..6b521574 --- /dev/null +++ b/packages/checkbox/rollup.config.js @@ -0,0 +1,7 @@ +import { configRollup } from '../../rollup-utilities'; + +export default configRollup( + 'checkbox', + [], + process.env.NODE_ENV === 'production' +); diff --git a/packages/checkbox/src/html.d.ts b/packages/checkbox/src/html.d.ts new file mode 100644 index 00000000..4c285b83 --- /dev/null +++ b/packages/checkbox/src/html.d.ts @@ -0,0 +1,9 @@ +declare module '*.html' { + const value: string; + export default value; +} + +declare module '*.css' { + const value: string; + export default value; +} diff --git a/packages/checkbox/src/index.ts b/packages/checkbox/src/index.ts index 9c71a623..c8e15a2e 100644 --- a/packages/checkbox/src/index.ts +++ b/packages/checkbox/src/index.ts @@ -1,15 +1,16 @@ -import { FrameworkConfiguration, PLATFORM, bindingMode, ObserverLocator } from 'aurelia-framework'; -import { CheckedObserver, EventSubscriber } from 'aurelia-binding'; import { AureliaUX } from '@aurelia-ux/core'; +import { CheckedObserver, EventSubscriber } from 'aurelia-binding'; +import { bindingMode, FrameworkConfiguration, ObserverLocator, DOM } from 'aurelia-framework'; +import { UxCheckbox } from './ux-checkbox'; +import css from './ux-checkbox.css'; -export { UxCheckboxTheme } from './ux-checkbox-theme'; export { UxCheckbox, UxCheckboxElement } from './ux-checkbox'; +export { UxCheckboxTheme } from './ux-checkbox-theme'; export function configure(config: FrameworkConfiguration) { - config.container.get(AureliaUX).registerUxElementConfig(uxCheckBoxConfig); - config.globalResources([ - PLATFORM.moduleName('@aurelia-ux/checkbox/ux-checkbox') - ]); + DOM.injectStyles(css, undefined, undefined, 'ux-checkbox-css'); + (config.container.get(AureliaUX) as AureliaUX).registerUxElementConfig(uxCheckBoxConfig); + config.globalResources(UxCheckbox); } const uxCheckBoxConfig = { diff --git a/packages/checkbox/src/ux-checkbox.html b/packages/checkbox/src/ux-checkbox.html index 73eb2fae..6b73adcf 100644 --- a/packages/checkbox/src/ux-checkbox.html +++ b/packages/checkbox/src/ux-checkbox.html @@ -1,8 +1,4 @@