Skip to content

Commit

Permalink
Build + Server website 🦊
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeeJab committed Feb 12, 2020
1 parent 4b5f20c commit 6c8462b
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ module.exports = {
"no-unmodified-loop-condition": "off",
"no-unneeded-ternary": "off",
"no-unused-expressions": "error",
"no-use-before-define": "error",
"no-use-before-define": ["error", { "functions": false, "classes": false }],
"no-useless-call": "off",
"no-useless-computed-key": "error",
"no-useless-concat": "error",
Expand Down
2 changes: 1 addition & 1 deletion assets/demo/demo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Editor } from '../../dist/index.js';
import { Editor } from '../mobiledoc.js';

function bootstrapSimpleDemo() {
const el = document.querySelector('#editor-basic');
Expand Down
3 changes: 3 additions & 0 deletions bin/build-website.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ echo "Clearing $(pwd)/website"
rm -rf website
mkdir website

echo "Copying $(pwd)/assets/* to $(pwd)/website/"
cp -R assets/* website/

echo "Copying $(pwd)/dist/* to $(pwd)/website/"
cp -R dist/* website/

Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"version": "0.12.3",
"description": "A toolkit for building WYSIWYG editors with Mobiledoc",
"repository": "https://github.com/bustle/mobiledoc-kit",
"module": "dist/index.js",
"module": "dist/mobiledoc.js",
"scripts": {
"start": "rollup --config --watch",
"start": "yarn build --watch",
"test:ci": "yarn build:docs && yarn build && testem ci -f testem-ci.js",
"test": "rollup --config --tests && testem ci -f testem.js",
"build": "rollup --config",
"test": "yarn build && testem ci -f testem.js",
"build": "rollup -c",
"build:docs": "jsdoc -c ./.jsdoc",
"build:website": "yarn build && yarn build:docs && ./bin/build-website.sh",
"build:website": "yarn build:docs && yarn build && ./bin/build-website.sh",
"deploy:website": "./bin/deploy-website.sh",
"update-changelog": "conventional-changelog -i CHANGELOG.md -r 0 -s",
"version": "yarn update-changelog && git add CHANGELOG.md",
Expand All @@ -24,7 +24,7 @@
"contenteditable"
],
"files": [
"dist/index.js"
"dist/mobiledoc.js"
],
"author": "Garth Poitras <garth22@gmail.com> (http://garthpoitras.com/)",
"contributors": [
Expand Down Expand Up @@ -59,6 +59,7 @@
"qunit": "^2.9.3",
"rollup": "^1.31.0",
"rollup-plugin-glob-import": "^0.4.5",
"rollup-plugin-serve": "^1.0.1",
"saucie": "^3.3.2",
"testem": "^2.17.0"
},
Expand Down
17 changes: 11 additions & 6 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import globImport from 'rollup-plugin-glob-import';
import alias from '@rollup/plugin-alias';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import serve from 'rollup-plugin-serve';
import path from 'path';

export default [
{
input: 'tests/index.js',
input: 'src/js/index.js',
plugins: [
resolve(),
commonjs(),
Expand All @@ -18,17 +19,16 @@ export default [
replacement: path.join(__dirname, 'src/js')
}
]
}),
globImport()
})
],
output: {
file: 'dist/tests.js',
file: 'dist/mobiledoc.js',
format: 'es',
sourcemap: true
}
},
{
input: 'src/js/index.js',
input: 'tests/index.js',
plugins: [
resolve(),
commonjs(),
Expand All @@ -40,10 +40,15 @@ export default [
replacement: path.join(__dirname, 'src/js')
}
]
}),
globImport(),
serve({
contentBase: '',
port: process.env.PORT || 4200
})
],
output: {
file: 'dist/index.js',
file: 'dist/tests.js',
format: 'es',
sourcemap: true
}
Expand Down
15 changes: 2 additions & 13 deletions tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>Mobiledoc Kit tests</title>
<link rel="stylesheet" href="./qunit/qunit.css">
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css">
<style>
/* position qunit-fixture within view, for easier debugging */
#qunit-fixture {
Expand All @@ -19,18 +19,7 @@
<div id="qunit"></div>
<div id="qunit-fixture"></div>

<script src="./jquery/jquery.js"></script>
<script src="./qunit/qunit.js"></script>
<script src="../dist/tests.js"></script>
<script src="/testem.js"></script>
<script src="./loader.js/loader.js"></script>
<script src="../amd/mobiledoc-kit.js"></script>
<script src="./built-amd-tests.js"></script>
<script src="./test-loader/test-loader.js"></script>
<script>
window.QUnit.dump.maxDepth = 15;
var TestLoader = require('ember-cli/test-loader')['default'];
var testLoader = new TestLoader();
testLoader.loadModules();
</script>
</body>
</html>
25 changes: 0 additions & 25 deletions tests/index.rollup.html

This file was deleted.

18 changes: 18 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4185,6 +4185,11 @@ mime@1.6.0, mime@^1.2.11:
resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"
integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==

mime@>=2.0.3:
version "2.4.4"
resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.4.tgz#bd7b91135fc6b01cde3e9bae33d659b63d8857e5"
integrity sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==

mimic-fn@^1.0.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022"
Expand Down Expand Up @@ -4481,6 +4486,11 @@ onetime@^2.0.0:
dependencies:
mimic-fn "^1.0.0"

opener@1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.1.tgz#6d2f0e77f1a0af0032aca716c2c1fbb8e7e8abed"
integrity sha512-goYSy5c2UXE4Ra1xixabeVh1guIX/ZV/YokJksb6q2lubWu6UbvPQ20p542/sFIll1nl8JnCyK9oBaOcCWXwvA==

optimist@^0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686"
Expand Down Expand Up @@ -5237,6 +5247,14 @@ rollup-plugin-glob-import@^0.4.5:
glob "^7.1.6"
rollup-pluginutils "^2.8.2"

rollup-plugin-serve@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/rollup-plugin-serve/-/rollup-plugin-serve-1.0.1.tgz#2da2a784a916c5564609c7696cd9dacdbf17f6cc"
integrity sha512-bni0pb4s1YLvn1xBmj+dH1OsLdp8gWA4zqh3yuEtT6/YHhg3nDneGU2GwMcRDQwY2tXzuI0uSeAlF1rY+ODitg==
dependencies:
mime ">=2.0.3"
opener "1"

rollup-pluginutils@^2.8.2:
version "2.8.2"
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e"
Expand Down

0 comments on commit 6c8462b

Please sign in to comment.