Skip to content

Commit 6c8462b

Browse files
committed
Build + Server website 🦊
1 parent 4b5f20c commit 6c8462b

File tree

8 files changed

+43
-52
lines changed

8 files changed

+43
-52
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ module.exports = {
189189
"no-unmodified-loop-condition": "off",
190190
"no-unneeded-ternary": "off",
191191
"no-unused-expressions": "error",
192-
"no-use-before-define": "error",
192+
"no-use-before-define": ["error", { "functions": false, "classes": false }],
193193
"no-useless-call": "off",
194194
"no-useless-computed-key": "error",
195195
"no-useless-concat": "error",

assets/demo/demo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Editor } from '../../dist/index.js';
1+
import { Editor } from '../mobiledoc.js';
22

33
function bootstrapSimpleDemo() {
44
const el = document.querySelector('#editor-basic');

bin/build-website.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ echo "Clearing $(pwd)/website"
44
rm -rf website
55
mkdir website
66

7+
echo "Copying $(pwd)/assets/* to $(pwd)/website/"
8+
cp -R assets/* website/
9+
710
echo "Copying $(pwd)/dist/* to $(pwd)/website/"
811
cp -R dist/* website/
912

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
"version": "0.12.3",
44
"description": "A toolkit for building WYSIWYG editors with Mobiledoc",
55
"repository": "https://github.com/bustle/mobiledoc-kit",
6-
"module": "dist/index.js",
6+
"module": "dist/mobiledoc.js",
77
"scripts": {
8-
"start": "rollup --config --watch",
8+
"start": "yarn build --watch",
99
"test:ci": "yarn build:docs && yarn build && testem ci -f testem-ci.js",
10-
"test": "rollup --config --tests && testem ci -f testem.js",
11-
"build": "rollup --config",
10+
"test": "yarn build && testem ci -f testem.js",
11+
"build": "rollup -c",
1212
"build:docs": "jsdoc -c ./.jsdoc",
13-
"build:website": "yarn build && yarn build:docs && ./bin/build-website.sh",
13+
"build:website": "yarn build:docs && yarn build && ./bin/build-website.sh",
1414
"deploy:website": "./bin/deploy-website.sh",
1515
"update-changelog": "conventional-changelog -i CHANGELOG.md -r 0 -s",
1616
"version": "yarn update-changelog && git add CHANGELOG.md",
@@ -24,7 +24,7 @@
2424
"contenteditable"
2525
],
2626
"files": [
27-
"dist/index.js"
27+
"dist/mobiledoc.js"
2828
],
2929
"author": "Garth Poitras <[email protected]> (http://garthpoitras.com/)",
3030
"contributors": [
@@ -59,6 +59,7 @@
5959
"qunit": "^2.9.3",
6060
"rollup": "^1.31.0",
6161
"rollup-plugin-glob-import": "^0.4.5",
62+
"rollup-plugin-serve": "^1.0.1",
6263
"saucie": "^3.3.2",
6364
"testem": "^2.17.0"
6465
},

rollup.config.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ import globImport from 'rollup-plugin-glob-import';
22
import alias from '@rollup/plugin-alias';
33
import resolve from '@rollup/plugin-node-resolve';
44
import commonjs from '@rollup/plugin-commonjs';
5+
import serve from 'rollup-plugin-serve';
56
import path from 'path';
67

78
export default [
89
{
9-
input: 'tests/index.js',
10+
input: 'src/js/index.js',
1011
plugins: [
1112
resolve(),
1213
commonjs(),
@@ -18,17 +19,16 @@ export default [
1819
replacement: path.join(__dirname, 'src/js')
1920
}
2021
]
21-
}),
22-
globImport()
22+
})
2323
],
2424
output: {
25-
file: 'dist/tests.js',
25+
file: 'dist/mobiledoc.js',
2626
format: 'es',
2727
sourcemap: true
2828
}
2929
},
3030
{
31-
input: 'src/js/index.js',
31+
input: 'tests/index.js',
3232
plugins: [
3333
resolve(),
3434
commonjs(),
@@ -40,10 +40,15 @@ export default [
4040
replacement: path.join(__dirname, 'src/js')
4141
}
4242
]
43+
}),
44+
globImport(),
45+
serve({
46+
contentBase: '',
47+
port: process.env.PORT || 4200
4348
})
4449
],
4550
output: {
46-
file: 'dist/index.js',
51+
file: 'dist/tests.js',
4752
format: 'es',
4853
sourcemap: true
4954
}

tests/index.html

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8">
55
<title>Mobiledoc Kit tests</title>
6-
<link rel="stylesheet" href="./qunit/qunit.css">
6+
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css">
77
<style>
88
/* position qunit-fixture within view, for easier debugging */
99
#qunit-fixture {
@@ -19,18 +19,7 @@
1919
<div id="qunit"></div>
2020
<div id="qunit-fixture"></div>
2121

22-
<script src="./jquery/jquery.js"></script>
23-
<script src="./qunit/qunit.js"></script>
22+
<script src="../dist/tests.js"></script>
2423
<script src="/testem.js"></script>
25-
<script src="./loader.js/loader.js"></script>
26-
<script src="../amd/mobiledoc-kit.js"></script>
27-
<script src="./built-amd-tests.js"></script>
28-
<script src="./test-loader/test-loader.js"></script>
29-
<script>
30-
window.QUnit.dump.maxDepth = 15;
31-
var TestLoader = require('ember-cli/test-loader')['default'];
32-
var testLoader = new TestLoader();
33-
testLoader.loadModules();
34-
</script>
3524
</body>
3625
</html>

tests/index.rollup.html

Lines changed: 0 additions & 25 deletions
This file was deleted.

yarn.lock

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4185,6 +4185,11 @@ [email protected], mime@^1.2.11:
41854185
resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"
41864186
integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==
41874187

4188+
mime@>=2.0.3:
4189+
version "2.4.4"
4190+
resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.4.tgz#bd7b91135fc6b01cde3e9bae33d659b63d8857e5"
4191+
integrity sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==
4192+
41884193
mimic-fn@^1.0.0:
41894194
version "1.2.0"
41904195
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022"
@@ -4481,6 +4486,11 @@ onetime@^2.0.0:
44814486
dependencies:
44824487
mimic-fn "^1.0.0"
44834488

4489+
opener@1:
4490+
version "1.5.1"
4491+
resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.1.tgz#6d2f0e77f1a0af0032aca716c2c1fbb8e7e8abed"
4492+
integrity sha512-goYSy5c2UXE4Ra1xixabeVh1guIX/ZV/YokJksb6q2lubWu6UbvPQ20p542/sFIll1nl8JnCyK9oBaOcCWXwvA==
4493+
44844494
optimist@^0.6.1:
44854495
version "0.6.1"
44864496
resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686"
@@ -5237,6 +5247,14 @@ rollup-plugin-glob-import@^0.4.5:
52375247
glob "^7.1.6"
52385248
rollup-pluginutils "^2.8.2"
52395249

5250+
rollup-plugin-serve@^1.0.1:
5251+
version "1.0.1"
5252+
resolved "https://registry.yarnpkg.com/rollup-plugin-serve/-/rollup-plugin-serve-1.0.1.tgz#2da2a784a916c5564609c7696cd9dacdbf17f6cc"
5253+
integrity sha512-bni0pb4s1YLvn1xBmj+dH1OsLdp8gWA4zqh3yuEtT6/YHhg3nDneGU2GwMcRDQwY2tXzuI0uSeAlF1rY+ODitg==
5254+
dependencies:
5255+
mime ">=2.0.3"
5256+
opener "1"
5257+
52405258
rollup-pluginutils@^2.8.2:
52415259
version "2.8.2"
52425260
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e"

0 commit comments

Comments
 (0)