Skip to content

Commit bfc3cef

Browse files
authored
Merge pull request #73 from torch2424/torch2424/type-embed-markdown-demo
Got the Markdown Demo working with the new type-embeds release
2 parents 8ca11a5 + a0b7ec2 commit bfc3cef

File tree

4 files changed

+59
-46
lines changed

4 files changed

+59
-46
lines changed

examples/markdown-parser/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { h, render, Component } from "preact";
2-
import asbind from "../../dist/as-bind.esm";
2+
import * as asbind from "../../dist/as-bind.esm";
33

44
// Import our TypeScript equivalent
55
import { convertMarkdownToHTML } from "../../dist/ts/index";

package-lock.json

Lines changed: 49 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,18 @@
77
"iife": "dist/as-bind.iife.js",
88
"types": "dist/as-bind.d.ts",
99
"scripts": {
10-
"build": "run-s lib:wasm:build lib:js:build",
10+
"build": "run-s lib:js:build",
1111
"dev": "run-p lib:watch lib:test:watch",
1212
"serve": "serve dist -p 8080",
1313
"test": "node ./test/test-runner.js",
1414
"lint": "prettier --write **/*.js **/*.ts **/*.json !build/**/* !dist/**/*",
1515
"lint:ci": "prettier --check **/*.js **/*.ts **/*.json !build/**/* !dist/**/*",
16-
"lib:watch": "chokidar --initial \"lib/**/*\" -c \"run-s lib:wasm:build lib:js:build:dev test\"",
17-
"lib:test:watch": "chokidar \"test/**/*.js\" \"test/**/*.ts\" -c \"run-s lib:wasm:build lib:test:build test\"",
18-
"lib:wasm:build": "run-s lib:wasm:build:debug lib:wasm:build:optimized lib:wasm:build:cp",
19-
"lib:wasm:build:debug": "asc lib/assembly/as-bind.ts -b dist/as-bind.debug.wasm -t dist/as-bind.debug.wat --sourceMap --debug --exportRuntime",
20-
"lib:wasm:build:optimized": "asc lib/assembly/as-bind.ts -b dist/as-bind.wasm --sourceMap dist/as-bind.wasm.map -t dist/as-bind.wat -O3 --exportRuntime",
21-
"lib:wasm:build:cp": "cpy 'lib/assembly/**/*' dist",
16+
"lib:watch": "chokidar --initial \"lib/**/*\" -c \"run-s lib:js:build:dev test\"",
17+
"lib:test:watch": "chokidar \"test/**/*.js\" \"test/**/*.ts\" -c \"run-s lib:test:build test\"",
2218
"lib:js:build": "rollup -c --environment LIB,PROD && cpy 'lib/as-bind.d.ts' dist",
2319
"lib:js:build:dev": "rollup -c --environment LIB,DEV",
2420
"lib:test:build": "run-s lib:test:build:entry lib:test:build:no-entry",
25-
"lib:test:build:entry": "asc lib/assembly/as-bind.ts test/assembly/test.ts -b test/assembly/test.wasm --debug --runtime incremental --exportRuntime",
21+
"lib:test:build:entry": "asc test/assembly/test.ts -b test/assembly/test.wasm --debug --runtime incremental --exportRuntime",
2622
"lib:test:build:no-entry": "asc test/assembly/test.ts -b test/assembly/test-no-entry.wasm --debug --runtime incremental --exportRuntime",
2723
"lib:deploy": "npm run build && np",
2824
"md:build": "run-s md:wasm:build md:ts:build md:js:build",
@@ -31,7 +27,7 @@
3127
"md:wasm:watch": "chokidar --initial \"examples/markdown-parser/assembly/**/*\" -c \"run-s md:wasm:build\"",
3228
"md:ts:watch": "chokidar --initial \"examples/markdown-parser/assembly/**/*\" -c \"run-s md:ts:build\"",
3329
"md:js:watch": "chokidar --initial \"examples/markdown-parser/**/*\" -c \"rollup -c --environment MD,DEV\"",
34-
"md:wasm:build": "asc lib/assembly/as-bind.ts examples/markdown-parser/assembly/index.ts -b dist/examples/markdown-parser/index.wasm -t dist/examples/markdown-parser/index.wat --sourceMap dist/examples/markdown-parser/index.wasm.map --runtime incremental --exportRuntime",
30+
"md:wasm:build": "asc examples/markdown-parser/assembly/index.ts --transform ./transform.js -b dist/examples/markdown-parser/index.wasm -t dist/examples/markdown-parser/index.wat --sourceMap dist/examples/markdown-parser/index.wasm.map --runtime incremental --exportRuntime",
3531
"md:ts:build": "tsc --project examples/markdown-parser/assembly/ --outDir dist/ts/ --module \"es2015\"",
3632
"md:js:build": "rollup -c --environment MD,PROD",
3733
"md:deploy": "run-s build md:build md:deploy:gh-pages",
@@ -49,7 +45,7 @@
4945
"@babel/plugin-proposal-export-default-from": "^7.12.13",
5046
"@babel/plugin-proposal-object-rest-spread": "^7.13.8",
5147
"@babel/plugin-transform-react-jsx": "^7.12.17",
52-
"@babel/preset-env": "^7.13.10",
48+
"@babel/preset-env": "^7.13.12",
5349
"@rollup/plugin-babel": "^5.3.0",
5450
"@rollup/plugin-commonjs": "^17.1.0",
5551
"@rollup/plugin-json": "^4.1.0",

rollup.markdown-parser.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,12 @@ const sourcemapOption = process.env.PROD ? undefined : "inline";
3434

3535
const babelPluginConfig = {
3636
babelHelpers: "bundled",
37+
presets: ["@babel/preset-env"],
3738
plugins: [
38-
"@babel/preset-env",
3939
"@babel/plugin-proposal-class-properties",
4040
"@babel/plugin-proposal-object-rest-spread",
41-
"@babel/plugin-proposal-export-default-from"[
42-
("@babel/plugin-transform-react-jsx", { pragma: "h" })
43-
]
41+
"@babel/plugin-proposal-export-default-from",
42+
["@babel/plugin-transform-react-jsx", { pragma: "h" }]
4443
]
4544
};
4645

0 commit comments

Comments
 (0)