diff --git a/.gitignore b/.gitignore
index 2be39e4..29d86be 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,2 @@
-bower_components*
-bower-*.json
+node_modules
+*.lock
diff --git a/.travis.yml b/.travis.yml
index b57fd63..47a2fe9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,18 +4,14 @@ sudo: required
node_js: stable
addons:
firefox: latest
- apt:
- sources:
- - google-chrome
- packages:
- - google-chrome-stable
+ chrome: beta
before_script:
- npm install -g polymer-cli
- - polymer install --variants
+ - yarn
script:
- - xvfb-run polymer test
+ - xvfb-run polymer test --npm
- >-
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then polymer test -s 'default';
+ if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then polymer test --npm -s 'default';
fi
env:
global:
diff --git a/bower.json b/bower.json
deleted file mode 100644
index a79ae0a..0000000
--- a/bower.json
+++ /dev/null
@@ -1,57 +0,0 @@
-{
- "name": "prism-element",
- "description": "Prism.js import and syntax highlighting",
- "version": "2.0.1",
- "authors": [
- "The Polymer Project Authors (https://polymer.github.io/AUTHORS.txt)"
- ],
- "keywords": [
- "web-components",
- "polymer",
- "prism",
- "molecule"
- ],
- "repository": {
- "type": "git",
- "url": "git://github.com/PolymerElements/prism-element.git"
- },
- "license": "http://polymer.github.io/LICENSE.txt",
- "homepage": "https://github.com/PolymerElements/prism-highlighter",
- "main": "prism-highlighter.html",
- "ignore": [
- "/.*",
- "/test/"
- ],
- "dependencies": {
- "prism": "*",
- "polymer": "Polymer/polymer#1.9 - 2"
- },
- "devDependencies": {
- "iron-component-page": "PolymerElements/iron-component-page#1 - 2",
- "paper-styles": "PolymerElements/paper-styles#1 - 2",
- "webcomponentsjs": "webcomponents/webcomponentsjs#^1.0.0",
- "test-fixture": "PolymerElements/test-fixture#^3.0.0-rc.1",
- "web-component-tester": "^6.0.0"
- },
- "variants": {
- "1.x": {
- "dependencies": {
- "prism": "*",
- "polymer": "Polymer/polymer#^1.9"
- },
- "devDependencies": {
- "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
- "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
- "paper-styles": "PolymerElements/paper-styles#^1.0.0",
- "web-component-tester": "^4.0.0",
- "test-fixture": "PolymerElements/test-fixture#^1.0.0"
- },
- "resolutions": {
- "webcomponentsjs": "^0.7"
- }
- }
- },
- "resolutions": {
- "webcomponentsjs": "^1.0.0"
- }
-}
diff --git a/demo/index.html b/demo/index.html
index c18e617..5f91a73 100644
--- a/demo/index.html
+++ b/demo/index.html
@@ -15,7 +15,7 @@
-
+
diff --git a/index.html b/index.html
index efffd61..9b96634 100644
--- a/index.html
+++ b/index.html
@@ -16,7 +16,7 @@
prism-element
-
+
diff --git a/package.json b/package.json
index f3b9302..7babfa6 100644
--- a/package.json
+++ b/package.json
@@ -20,7 +20,15 @@
"license": "http://polymer.github.io/LICENSE.txt",
"homepage": "https://github.com/PolymerElements/prism-highlighter",
"dependencies": {
- "@polymer/polymer": "^3.0.0-pre.1"
+ "@polymer/polymer": "^3.0.0-pre.1",
+ "prismjs": "^1.6.0"
},
- "devDependencies": {}
-}
\ No newline at end of file
+ "devDependencies": {
+ "@polymer/paper-styles": "next",
+ "wct-browser-legacy": "^0.0.1-pre.3"
+ },
+ "resolutions": {
+ "type-detect": "1.0.0",
+ "supports-color": "3.1.2"
+ }
+}
diff --git a/prism-highlighter.js b/prism-highlighter.js
index beb8f34..152f239 100644
--- a/prism-highlighter.js
+++ b/prism-highlighter.js
@@ -1,5 +1,5 @@
import { Base } from '../polymer/polymer.js';
-import './prism-import.js';
+import '../../prismjs/prism.js';
import { Polymer } from '../polymer/lib/legacy/polymer-fn.js';
var HIGHLIGHT_EVENT = 'syntax-highlight';
@@ -7,7 +7,7 @@ var HIGHLIGHT_EVENT = 'syntax-highlight';
Polymer({
is: 'prism-highlighter',
-
+
properties: {
/**
* Adds languages outside of the core Prism languages.
diff --git a/prism-import.js b/prism-import.js
deleted file mode 100644
index 5e63fd2..0000000
--- a/prism-import.js
+++ /dev/null
@@ -1 +0,0 @@
-import '../prism/prism.js';
diff --git a/test/index.html b/test/index.html
index 949e24c..9fe7143 100644
--- a/test/index.html
+++ b/test/index.html
@@ -13,7 +13,7 @@
-
+
-
+
+
+
@@ -59,7 +60,7 @@
lang: 'markup'
};
- el.fire('syntax-highlight', ev);
+ el.dispatchEvent(new CustomEvent('syntax-highlight', {detail: ev}));
expect(Prism.highlight.calledWithExactly('', Prism.languages.markup))
.to.equal(true);
@@ -70,14 +71,14 @@
sinon.spy(console, 'warn');
- el.fire('syntax-highlight');
+ el.dispatchEvent(new CustomEvent('syntax-highlight'));
expect(console.warn.callCount).to.equal(1);
ev = {
};
- el.fire('syntax-highlight', ev);
+ el.dispatchEvent(new CustomEvent('syntax-highlight', {detail: ev}));
expect(console.warn.callCount).to.equal(2);
expect(ev.code).to.equal(undefined);
@@ -90,7 +91,7 @@
el = fixture('double-highlight');
- el.querySelector('#container-1').fire('syntax-highlight', ev);
+ el.querySelector('#container-1').dispatchEvent(new CustomEvent('syntax-highlight', {detail: ev}));
expect(Prism.highlight.callCount).to.equal(1);
});
@@ -101,7 +102,7 @@
code: ''
};
- el.fire('syntax-highlight', ev);
+ el.dispatchEvent(new CustomEvent('syntax-highlight', {detail: ev}));
expect(Prism.highlight.calledWithExactly('', Prism.languages.markup))
.to.equal(true);
@@ -112,7 +113,7 @@
code: 'return;'
};
- el.fire('syntax-highlight', ev);
+ el.dispatchEvent(new CustomEvent('syntax-highlight', {detail: ev}));
expect(Prism.highlight.calledWithExactly('return;', Prism.languages.javascript))
.to.equal(true);
@@ -126,7 +127,7 @@
lang: 'js'
};
- el.fire('syntax-highlight', ev);
+ el.dispatchEvent(new CustomEvent('syntax-highlight', {detail: ev}));
expect(Prism.highlight.calledWithExactly('return;', Prism.languages.javascript))
.to.equal(true);
@@ -138,7 +139,7 @@
lang: 'es'
};
- el.fire('syntax-highlight', ev);
+ el.dispatchEvent(new CustomEvent('syntax-highlight', {detail: ev}));
expect(Prism.highlight.calledWithExactly('return;', Prism.languages.javascript))
.to.equal(true);
@@ -150,7 +151,7 @@
lang: 'c'
};
- el.fire('syntax-highlight', ev);
+ el.dispatchEvent(new CustomEvent('syntax-highlight', {detail: ev}));
expect(Prism.highlight.calledWithExactly('return;', Prism.languages.clike))
.to.equal(true);
diff --git a/test/simple-container.js b/test/simple-container.js
index cb71d7d..e109842 100644
--- a/test/simple-container.js
+++ b/test/simple-container.js
@@ -1,5 +1,2 @@
-import '../../polymer/polymer.js';
-import { Polymer } from '../../polymer/lib/legacy/polymer-fn.js';
-Polymer({
- is: 'simple-container'
-});
+export class SimpleContainer extends HTMLElement {}
+customElements.define('simple-container', SimpleContainer);