Skip to content

Commit

Permalink
Merge pull request #39 from caseyWebb/legacy-browser-support
Browse files Browse the repository at this point in the history
Legacy browser support, better Monorepo usage.
  • Loading branch information
brianmhunt authored Oct 23, 2017
2 parents 3dfaa95 + 1ad236d commit eb8219a
Show file tree
Hide file tree
Showing 173 changed files with 18,790 additions and 8,611 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ node_modules
# Knockout built files
_repo
coverage/
work/
**/dist/*
!packages/tko/dist/*

yarn.lock

*-debug.log
*-error.log

# Rollup Visualizer
visual.html
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@

To install use one of the usual package managers e.g.

- $ `yarn install tko`
- $ `yarn add tko`
- $ `npm install tko`

By CDN

- Latest: https://unpkg.com/tko/dist/ko.js
- Stable: https://unpkg.com/tko/dist/tko[.es6][.min].js
- Latest (development only): https://rawgit.com/knockout/tko/master/packages/tko/dist/tko[.es6][.min].js

### Using the Monorepo

Expand All @@ -35,12 +36,12 @@ The following commands are to get the build system set up. *Note:* you need to h
| ------- | ------ |
| $ `git clone git@github.com:knockout/tko` | Clone the repository.
| $ `npm install -g yarn` otherwise | Ensure yarn is globally available
| $ `yarn` | Install local node packages
| $ `yarn run lerna` | Link local `packages/` to each other
| $ `yarn` | Install local node packages and link tko modules
| $ `yarn test` | Run all tests
| $ `yarn run build` | Make the `dist/ko[.es6].js` files, where the `.es6` version has not been passed through Babel
| $ `yarn build` | Build tko\[.module\]\[.es6\]\[.min\].js files, where `.es6` version has not been transpiled
| $ `lerna publish` | Bump versions and publish to npm registry

Checkout `package.json` for more script commands that can be executed with `yarn run {command}`.
Checkout `package.json => scripts` for more commands that can be executed with `yarn {command}`.

In each individual `packages/*/` directory, you can also run (presuming `rollup` and `karma` are installed globally):

Expand Down
3 changes: 0 additions & 3 deletions dist/ko.js

This file was deleted.

3 changes: 0 additions & 3 deletions dist/ko.js.map

This file was deleted.

3 changes: 0 additions & 3 deletions dist/ko.min.js

This file was deleted.

3 changes: 0 additions & 3 deletions dist/ko.min.js.map

This file was deleted.

13 changes: 4 additions & 9 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const path = require('path')
const nodeResolve = require('rollup-plugin-node-resolve')
const rollupCommonJS = require('rollup-plugin-commonjs')
const rollupVisualizer = require('rollup-plugin-visualizer')
const includePaths = require('rollup-plugin-includepaths')

const pkg = JSON.parse(fs.readFileSync('package.json'))

Expand All @@ -25,18 +24,15 @@ const frameworks = pkg.karma.frameworks
const browsers = ['Electron']

const files = [
{ pattern: 'src/*.js', included: false, watched: true },
{ pattern: 'spec/*.js' }
{ pattern: 'spec/*.js', watched: false }
]

const preprocessors = {
'src/**/*.js': ['rollup'],
'spec/**/*.js': ['rollup']
}

const ROLLUP_CONFIG = {
INCLUDE_PATHS: { paths: [ path.join(root, '../..') ] },
RESOLVE: {jsnext: true},
RESOLVE: {module: true},
VISUALIZER: { filename: './visual.html' },
COMMONJS: {}
}
Expand All @@ -53,14 +49,13 @@ const ROLLUP_CONFIG = {

const rollupPreprocessor = Object.assign({}, {
format: 'iife',
moduleName: pkg.name,
name: pkg.name,
plugins: [
includePaths(ROLLUP_CONFIG.INCLUDE_PATHS),
nodeResolve(ROLLUP_CONFIG.RESOLVE),
rollupVisualizer(ROLLUP_CONFIG.VISUALIZER),
rollupCommonJS(ROLLUP_CONFIG.COMMONJS)
],
sourceMap: process.argv.includes('--sourcemap') ? 'inline' : false
sourcemap: process.argv.includes('--sourcemap') ? 'inline' : false
})

module.exports = (config) => {
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"packages": [
"packages/*"
],
"version": "4.0.0-alpha3"
"version": "4.0.0-alpha4"
}
43 changes: 15 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
{
"name": "tko",
"description": "TKO is an experimental fork of Knockout",
"homepage": "http://knockoutjs.com/",
"version": "4.0.0-alpha4",
"license": "MIT",
"author": "The Knockout.js Team",
"main": "dist/ko.js",
"repository": {
"type": "git",
"url": "https://github.com/knockout/tko.git"
},
"scripts": {
"postinstall": "lerna bootstrap --hoist --npm-client yarn",
"prepublish": "yarn build",
"test": "lerna exec --concurrency=1 --loglevel=warn -- karma start ../../karma.conf.js --once",
"lint": "standard",
"lerna": "lerna bootstrap --hoist --npm-client yarn",
"make": "npm run test && npm run build && npm run minify",
"build": "rollup -c rollup.config.js -o dist/ko.js",
"minify": "MINIFY=1 rollup -c rollup.config.js -o dist/ko.min.js"
"build": "lerna exec --concurrency=1 --loglevel=warn -- rollup -c ../../rollup.config.js",
"lint": "standard"
},
"files": [
"dist/"
],
"bugs": "https://github.com/knockout/tko/issues",
"licenses": [
{
Expand All @@ -43,37 +36,31 @@
"runs"
]
},
"dependencies": {},
"devDependencies": {
"chai": "^4.1.0",
"colors": "^1.1.2",
"electron": "^1.6.11",
"gulp": "^3.9.1",
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.6.1",
"jquery": "^3.2.1",
"js-yaml": "^3.9.1",
"karma": "^1.7.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^2.2.0",
"karma-electron-launcher": "^0.2.0",
"karma-jasmine": "^1.1.0",
"karma-jasmine": "^0.1.0",
"karma-mocha": "^1.3.0",
"karma-rollup-plugin": "^0.2.4",
"karma-rollup-preprocessor": "^5.0.1",
"karma-sinon": "^1.0.5",
"lerna": "^2.0.0",
"lodash": "^4.17.4",
"mocha": "^3.4.2",
"rollup": "^0.45.2",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-babili": "^3.1.0",
"rollup": "^0.50.0",
"rollup-plugin-alias": "^1.3.1",
"rollup-plugin-babel-minify": "^3.1.2",
"rollup-plugin-commonjs": "^8.0.2",
"rollup-plugin-includepaths": "^0.2.2",
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-plugin-replace": "^1.1.1",
"rollup-plugin-stub": "^1.2.0",
"rollup-plugin-typescript": "^0.8.1",
"rollup-plugin-uglify": "^2.0.1",
"rollup-plugin-visualizer": "^0.3.1",
"sinon": "^2.4.1",
"standard": "^10.0.2"
},
"dependencies": {}
"standard": "^10.0.2",
"typescript": "^2.5.3"
}
}
Empty file removed packages/knockout/index.js
Empty file.
9 changes: 0 additions & 9 deletions packages/knockout/package.json

This file was deleted.

6 changes: 0 additions & 6 deletions packages/tko.bind/index.js

This file was deleted.

28 changes: 13 additions & 15 deletions packages/tko.bind/package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
{
"name": "tko.bind",
"version": "1.0.0",
"version": "4.0.0-alpha4",
"description": "TKO DOM-Observable Binding",
"main": "index.js",
"module": "dist/tko.bind.js",
"dependencies": {
"tko.computed": "knockout/tko.computed",
"tko.lifecycle": "knockout/tko.lifecycle",
"tko.observable": "knockout/tko.observable",
"tko.provider": "knockout/tko.provider",
"tko.utils": "knockout/tko.utils"
"tko.computed": "4.0.0-alpha4",
"tko.lifecycle": "4.0.0-alpha4",
"tko.observable": "4.0.0-alpha4",
"tko.provider": "4.0.0-alpha4",
"tko.utils": "4.0.0-alpha4",
"tslib": "^1.8.0"
},
"devDependencies": {
"tko.binding.foreach": "4.0.0-alpha4"
},
"files": [
"dist/",
"src/",
"index.js",
"./*.ya?ml"
"dist/"
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/knockout/tko.bind.git"
"url": "git+https://github.com/knockout/tko.git"
},
"author": "Knockout Team",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/tko.bind/spec/arrayToDomEditDetectionBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {

import {
setDomNodeChildrenFromArrayMapping
} from '../index';
} from '../src';

import 'tko.utils/helpers/jasmine-13-helper.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/tko.bind/spec/asyncBindingBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {bindings as templateBindings} from 'tko.binding.template';

import {
applyBindings
} from '../index';
} from '../src';

import {
useMockForTasks
Expand Down
2 changes: 1 addition & 1 deletion packages/tko.bind/spec/bindingAttributeBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { DataBindProvider } from 'tko.provider.databind'
import {
applyBindings, dataFor, bindingContext,
applyBindingsToDescendants, applyBindingsToNode, contextFor
} from '../index.js';
} from '../src';

import { bindings as coreBindings } from 'tko.binding.core';
import { bindings as templateBindings } from 'tko.binding.template';
Expand Down
2 changes: 1 addition & 1 deletion packages/tko.bind/spec/bindingCompletionPromiseBehavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { DataBindProvider } from 'tko.provider.databind'

import {
applyBindings, BindingHandler, applyBindingsToDescendants
} from '../index.js'
} from '../src'

import { bindings as coreBindings } from 'tko.binding.core'
import { bindings as templateBindings } from 'tko.binding.template'
Expand Down
2 changes: 1 addition & 1 deletion packages/tko.bind/spec/bindingDependencyBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { VirtualProvider } from 'tko.provider.virtual';
import {
applyBindings, contextFor,
applyBindingsToDescendants
} from '../index.js';
} from '../src';

import {bindings as coreBindings} from 'tko.binding.core';

Expand Down
2 changes: 1 addition & 1 deletion packages/tko.bind/spec/bindingHandlerBehaviour.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
import {
applyBindings, dataFor, bindingContext, BindingHandler,
applyBindingsToDescendants, applyBindingsToNode, contextFor
} from '../index.js';
} from '../src';

import { bindings as coreBindings } from 'tko.binding.core';
import { bindings as templateBindings } from 'tko.binding.template';
Expand Down
7 changes: 3 additions & 4 deletions packages/tko.bind/spec/crossWindowBehaviors.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import {
applyBindings
} from '../src';

import {
cleanNode, options
Expand All @@ -7,10 +10,6 @@ import {
observable
} from 'tko.observable';

import {
applyBindings
} from 'tko.bind';

import {
renderTemplate, setTemplateEngine, templateEngine
} from 'tko.binding.template';
Expand Down
2 changes: 1 addition & 1 deletion packages/tko.bind/spec/nodePreprocessingBehaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {

import {
applyBindings
} from '../index';
} from '../src';

import 'tko.utils/helpers/jasmine-13-helper.js';

Expand Down
6 changes: 6 additions & 0 deletions packages/tko.bind/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

export * from './bindingContext';
export * from './applyBindings';
export * from './arrayToDomNodeChildren';

export { BindingHandler, AsyncBindingHandler } from './BindingHandler';
3 changes: 0 additions & 3 deletions packages/tko.binding.component/index.js

This file was deleted.

16 changes: 14 additions & 2 deletions packages/tko.binding.component/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
{
"name": "tko.binding.component",
"version": "1.0.0",
"version": "4.0.0-alpha4",
"description": "component: binding for web components",
"main": "index.js",
"module": "dist/tko.binding.component.js",
"license": "MIT",
"dependencies": {
"tko.bind": "4.0.0-alpha4",
"tko.lifecycle": "4.0.0-alpha4",
"tko.observable": "4.0.0-alpha4",
"tko.provider": "4.0.0-alpha4",
"tko.utils": "4.0.0-alpha4",
"tko.utils.component": "4.0.0-alpha4",
"tslib": "^1.8.0"
},
"files": [
"dist/"
],
"karma": { "frameworks": ["jasmine"]}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {

import {
bindings as componentBindings
} from '../index'
} from '../src'

import components from 'tko.utils.component'

Expand Down
3 changes: 3 additions & 0 deletions packages/tko.binding.component/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

import component from './componentBinding'
export var bindings = { component }
Loading

0 comments on commit eb8219a

Please sign in to comment.