Skip to content

Commit

Permalink
Use glimmer build (#40)
Browse files Browse the repository at this point in the history
* build with @glimmer/build. Change "main" + add "module" keys to package

add tsconfig
Prune unused devDependencies
Move tests from `tests/` to `test/`
Build SimpleDOM vendor tree for tests

* 0.6.0-0
  • Loading branch information
bantic authored Feb 14, 2017
1 parent 55f4f1f commit 8b82854
Show file tree
Hide file tree
Showing 12 changed files with 106 additions and 65 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ dist/
tmp/
bower_components/
node_modules/
tests/
20 changes: 19 additions & 1 deletion Brocfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
/* jshint node: true */
'use strict';
"use strict";

var build = require('@glimmer/build');

const buildVendorPackage = require('@glimmer/build/lib/build-vendor-package');
const funnel = require('broccoli-funnel');
const path = require('path');

let buildOptions = {};

if (process.env.BROCCOLI_ENV === 'tests') {
buildOptions.vendorTrees = [
buildVendorPackage('simple-dom')
];
}

module.exports = build(buildOptions);

/*
var multiBuilder = require('broccoli-multi-builder');
var mergeTrees = require('broccoli-merge-trees');
var testBuilder = require('broccoli-test-builder');
Expand All @@ -22,3 +39,4 @@ module.exports = mergeTrees([
testBuilder.build(),
simpleDOMTree
]);
*/
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
<a name="0.6.0-0"></a>
# 0.6.0-0 (2017-02-14)

* Add @glimmer/build. Change "main" + add "module" keys to package ([964bcd0](https://github.com/bustlelabs/mobiledoc-dom-renderer/commit/964bcd0))
* add tsconfig, get basic glimmer-build working ([4226b06](https://github.com/bustlelabs/mobiledoc-dom-renderer/commit/4226b06))
* Added tests for #reduceAndSanitizeAttributes ([1efce8e](https://github.com/bustlelabs/mobiledoc-dom-renderer/commit/1efce8e))
* Build SimpleDOM vendor tree for tests ([1404bfd](https://github.com/bustlelabs/mobiledoc-dom-renderer/commit/1404bfd))
* Cleanup for sanitization ([c81f512](https://github.com/bustlelabs/mobiledoc-dom-renderer/commit/c81f512))
* Cover edge case. ([eb1a0d6](https://github.com/bustlelabs/mobiledoc-dom-renderer/commit/eb1a0d6))
* Fix test that was not running. ([1a98c0e](https://github.com/bustlelabs/mobiledoc-dom-renderer/commit/1a98c0e))
* fix up testem ([7120d9a](https://github.com/bustlelabs/mobiledoc-dom-renderer/commit/7120d9a))
* Links with unsafe URIs are filtered out. ([ff17b95](https://github.com/bustlelabs/mobiledoc-dom-renderer/commit/ff17b95))
* Refactor and extend to version 0.2 ([b89d508](https://github.com/bustlelabs/mobiledoc-dom-renderer/commit/b89d508))
* Refactor href values to be sanitized ([003c749](https://github.com/bustlelabs/mobiledoc-dom-renderer/commit/003c749))
* remove unused tests/index.html ([3683dd4](https://github.com/bustlelabs/mobiledoc-dom-renderer/commit/3683dd4))
* WIP ~75% of tests passing -- all SimpleDOM references fail ([1476c8f](https://github.com/bustlelabs/mobiledoc-dom-renderer/commit/1476c8f))



<a name="0.5.4"></a>
## 0.5.4 (2016-11-15)

* 0.5.2 ([40cdbe5](https://github.com/bustlelabs/mobiledoc-dom-renderer/commit/40cdbe5))
* 0.5.3 ([43f7908](https://github.com/bustlelabs/mobiledoc-dom-renderer/commit/43f7908))
* 0.5.4 ([5730c65](https://github.com/bustlelabs/mobiledoc-dom-renderer/commit/5730c65))
* Add a markup renderer option (#32) ([a368f34](https://github.com/bustlelabs/mobiledoc-dom-renderer/commit/a368f34))
* Document markup renderer (#33) ([2614b4e](https://github.com/bustlelabs/mobiledoc-dom-renderer/commit/2614b4e))
* Mobiledoc 0.3.1 ([93cd8ba](https://github.com/bustlelabs/mobiledoc-dom-renderer/commit/93cd8ba))
Expand Down
18 changes: 8 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "mobiledoc-dom-renderer",
"version": "0.5.4",
"version": "0.6.0-0",
"description": "Renders Mobiledoc input to DOM output",
"scripts": {
"test": "testem ci",
"build": "rm -rf dist/ && broccoli build dist",
"build:tests": "rm -rf tests && BROCCOLI_ENV=tests broccoli build tests",
"update-changelog": "conventional-changelog -i CHANGELOG.md -r 0 -s",
"prepublish": "npm run build",
"version": "npm run update-changelog && git add CHANGELOG.md"
},
"repository": {
Expand All @@ -30,15 +30,13 @@
],
"homepage": "https://github.com/bustlelabs/mobiledoc-dom-renderer",
"devDependencies": {
"broccoli": "^0.16.3",
"broccoli-funnel": "^1.0.1",
"broccoli-merge-trees": "^0.2.1",
"broccoli-multi-builder": "^0.2.6",
"broccoli-test-builder": "^0.2.0",
"@glimmer/build": "^0.2.1",
"broccoli": "^1.1.0",
"conventional-changelog": "^1.1.0",
"conventional-changelog-cli": "^1.1.1",
"simple-dom": "^0.2.7",
"testem": "^0.9.0-1"
"simple-dom": "^0.3.2",
"testem": "^1.15.0"
},
"main": "dist/commonjs/mobiledoc-dom-renderer/index.js"
"main": "dist/commonjs/es5/index.js",
"module": "dist/modules/es5/index.js"
}
2 changes: 1 addition & 1 deletion tests/helpers/dom.js → test/helpers/dom.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global SimpleDOM */
import SimpleDOM from 'simple-dom';

export function childNodesLength(element) {
let length = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
/* global QUnit, SimpleDOM */
/* global QUnit */

import Renderer from 'mobiledoc-dom-renderer';
import { RENDER_TYPE } from 'mobiledoc-dom-renderer';
import Renderer from '../../../lib/index';
import { RENDER_TYPE } from '../../../lib/index';
import {
MARKUP_SECTION_TYPE,
LIST_SECTION_TYPE,
CARD_SECTION_TYPE,
IMAGE_SECTION_TYPE
} from 'mobiledoc-dom-renderer/utils/section-types';
} from '../../../lib/utils/section-types';
import {
innerHTML,
outerHTML,
childNodesLength,
escapeQuotes
} from '../../helpers/dom';
import SimpleDOM from 'simple-dom';

const { test, module } = QUnit;
const MOBILEDOC_VERSION = '0.2.0';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
/* global QUnit, SimpleDOM */
/* global QUnit */

import Renderer from 'mobiledoc-dom-renderer';
import ImageCard from 'mobiledoc-dom-renderer/cards/image';
import { RENDER_TYPE } from 'mobiledoc-dom-renderer';
import Renderer from '../../../lib/index';
import ImageCard from '../../../lib/cards/image';
import { RENDER_TYPE } from '../../../lib/index';
import {
MARKUP_SECTION_TYPE,
LIST_SECTION_TYPE,
CARD_SECTION_TYPE,
IMAGE_SECTION_TYPE
} from 'mobiledoc-dom-renderer/utils/section-types';
} from '../../../lib/utils/section-types';
import {
innerHTML,
outerHTML,
childNodesLength,
escapeQuotes
} from '../../helpers/dom';
import {
MARKUP_MARKER_TYPE,
ATOM_MARKER_TYPE
} from '../../../lib//utils/marker-types';
import SimpleDOM from 'simple-dom';

const { test, module } = QUnit;
const MOBILEDOC_VERSION_0_3_0 = '0.3.0';
const MOBILEDOC_VERSION_0_3_1 = '0.3.1';
const dataUri = "data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=";

import {
MARKUP_MARKER_TYPE,
ATOM_MARKER_TYPE
} from 'mobiledoc-dom-renderer/utils/marker-types';

let renderer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import {
sanitizeAttributeValue,
reduceAndSanitizeAttributes
} from 'mobiledoc-dom-renderer/utils/sanitization-utils';
} from '../../../lib/utils/sanitization-utils';

const { test, module } = QUnit;

Expand Down
18 changes: 5 additions & 13 deletions testem.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
{
"framework": "qunit",
"test_page": "dist/tests/index.html",
"src_files": [
"tests/**/*.js",
"src/**/*.js"
],
"before_tests": "npm run build",
"launch_in_ci": [
"PhantomJS"
],
"launch_in_dev": [
"PhantomJS",
"Chrome"
]
"test_page": "tests/index.html",
"before_tests": "npm run build:tests",
"src_files": ["src/**/*", "test/**/*"],
"launch_in_ci": ["PhantomJS"],
"launch_in_dev": ["PhantomJS", "Chrome"]
}
26 changes: 0 additions & 26 deletions tests/index.html

This file was deleted.

16 changes: 16 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"compilerOptions": {
"allowJs": true,
"target": "es2017",
"module": "es2015",
"moduleResolution": "node",
"experimentalDecorators": true,
"inlineSources": true,
"inlineSourceMap": true,
"newLine": "LF",
"outDir": "dist"
},
"include": [
"lib/**/*"
]
}
20 changes: 20 additions & 0 deletions tsconfig.tests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"allowJs": true,
"target": "es5",
"module": "amd",
"experimentalDecorators": true,
"moduleResolution": "node",
"inlineSources": true,
"inlineSourceMap": true,
"declaration": false,
"newLine": "LF",
"outFile": "tests/tests.js",
"types": ["qunit"]
},
"include": [
"lib/**/*",
"test/**/*",
"node_modules/@types/**/*.ts"
]
}

0 comments on commit 8b82854

Please sign in to comment.